@ixfx/components 0.17.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/index.d.ts +193 -8
- package/bundle/index.js +153 -152
- package/dist/{checked-select-BmwqpgGr.js → checked-select-DsQ-o9lI.js} +1 -1
- package/dist/checked-select.js +1 -1
- package/dist/{crumb-navigation-D7dAC0H-.js → crumb-navigation-09YFje6W.js} +2 -2
- package/dist/{crumb-navigation-Tm4fnsvN.d.ts → crumb-navigation-DOfOS7li.d.ts} +1 -1
- package/dist/crumbs.d.ts +1 -1
- package/dist/crumbs.js +1 -1
- package/dist/{data-grid-BcO3SMac.js → data-grid-BGmJbMCb.js} +4 -3
- package/dist/{data-grid-vasJtjFP.d.ts → data-grid-BQWmVYg0.d.ts} +8 -2
- package/dist/data-grid.d.ts +2 -2
- package/dist/data-grid.js +1 -1
- package/dist/{detail-list-E9WdMVbE.d.ts → detail-list-CfjoIl2N.d.ts} +9 -3
- package/dist/{detail-list-vPVwE1CP.js → detail-list-CrHASoAx.js} +2 -1
- package/dist/detail-list.d.ts +3 -3
- package/dist/detail-list.js +1 -1
- package/dist/{flat-list-CfutGqKY.d.ts → flat-list-C2z81bK6.d.ts} +5 -3
- package/dist/flat-list.d.ts +1 -1
- package/dist/flat-list.js +4 -2
- package/dist/{grid-list-Dg8hIiKO.d.ts → grid-list-Crv-hFJL.d.ts} +60 -4
- package/dist/{grid-list-BHo9TBxX.js → grid-list-DYU_z2K9.js} +258 -19
- package/dist/grid-list.d.ts +3 -3
- package/dist/grid-list.js +1 -1
- package/dist/incr-search.d.ts +1 -1
- package/dist/{index-CzhYJJsx.d.ts → index-BE0hk8xS.d.ts} +2 -2
- package/dist/{index-88ra6YHP.d.ts → index-BymYKGY-.d.ts} +3 -3
- package/dist/{index-CRLTVAyt.d.ts → index-Db5VGFR1.d.ts} +1 -1
- package/dist/index.d.ts +82 -20
- package/dist/index.js +293 -107
- package/dist/{interaction-8Kbbf6xN.js → interaction-BEcBIY0d.js} +1 -1
- package/dist/{list-native-drag-controller-ByftBooJ.js → list-native-drag-controller-Brk30s5d.js} +3 -0
- package/dist/{list-native-drag-controller-CgXKdmjr.d.ts → list-native-drag-controller-Cs-Tmtaa.d.ts} +1 -1
- package/dist/{menu-C3DhTjHx.js → menu-B6NFqEtm.js} +3 -3
- package/dist/{menu-item-BSxhlWnW.js → menu-item-D0zy1yax.js} +2 -2
- package/dist/menu.js +2 -2
- package/dist/{miller-DqDEaXqT.js → miller-B0qbnWwe.js} +1 -1
- package/dist/miller.d.ts +2 -2
- package/dist/miller.js +1 -1
- package/dist/narrowed-text.js +1 -1
- package/dist/{node-graph-DqEGv5QR.js → node-graph-D9iovxQp.js} +1 -1
- package/dist/node-graph.js +1 -1
- package/dist/{notification-pill-BiHEJk-o.d.ts → notification-pill-BJonE_wo.d.ts} +14 -1
- package/dist/notifier.d.ts +1 -1
- package/dist/select-horiz.js +1 -1
- package/dist/sunburst-tree.d.ts +1 -1
- package/dist/{sunbursttree-list-CsrmVSB8.d.ts → sunbursttree-list-XF7gBKod.d.ts} +2 -2
- package/dist/{tree-BP5fxvEX.js → tree-1CSNgw72.js} +2 -2
- package/dist/{tree-component-DNuzfo6R.d.ts → tree-component-BE7OEIiH.d.ts} +7 -1
- package/dist/tree.d.ts +2 -2
- package/dist/tree.js +1 -1
- package/dist/{vertical-list-B9z1lbjM.js → vertical-list-BNCRA_zy.js} +2 -1
- package/dist/{vertical-list-BzeXehBt.d.ts → vertical-list-Dyc5azxv.d.ts} +8 -2
- package/dist/vertical-list.d.ts +2 -2
- package/dist/vertical-list.js +1 -1
- package/docs-user/grid-list.md +70 -0
- package/docs-user/index.json +2 -2
- package/docs-user/notifier.md +28 -0
- package/package.json +3 -3
package/bundle/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-CAoDHAWh.js";import{LitElement as n,css as r,html as i,nothing as a,render as o,svg as s,unsafeCSS as c}from"lit";import{customElement as l,eventOptions as u,property as d,query as f,queryAssignedElements as p,state as m}from"lit/decorators.js";import{styleMap as h}from"lit/directives/style-map.js";import{unsafeHTML as g}from"lit/directives/unsafe-html.js";import{repeat as _}from"lit/directives/repeat.js";import{classMap as v}from"lit/directives/class-map.js";import{live as y}from"lit/directives/live.js";import{ifDefined as b}from"lit/directives/if-defined.js";import{
|
|
1
|
+
import{t as e}from"./rolldown-runtime-CAoDHAWh.js";import{LitElement as n,css as r,html as i,nothing as a,render as o,svg as s,unsafeCSS as c}from"lit";import{customElement as l,eventOptions as u,property as d,query as f,queryAssignedElements as p,state as m}from"lit/decorators.js";import{styleMap as h}from"lit/directives/style-map.js";import{unsafeHTML as g}from"lit/directives/unsafe-html.js";import{repeat as _}from"lit/directives/repeat.js";import{classMap as v}from"lit/directives/class-map.js";import{live as y}from"lit/directives/live.js";import{ifDefined as b}from"lit/directives/if-defined.js";import{keyed as x}from"lit/directives/keyed.js";import{createRef as S,ref as ee}from"lit/directives/ref.js";const te=`incr-search-highlight`;function ne(e,n={}){if(typeof CSS>`u`||!CSS.highlights)return;let r=n.key??te;CSS.highlights.delete(r);let i=[];for(let{element:n,text:r,positions:a}of e){if(!a.size)continue;let e=ae(n,r);if(e)for(let n of a){let r=new Range;r.setStart(e,n),r.setEnd(e,n+1),i.push(r)}}i.length>0&&CSS.highlights.set(r,new Highlight(...i))}function re(e={}){typeof CSS<`u`&&CSS.highlights&&CSS.highlights.delete(e.key??te)}function ie(e,n,r,i,a){let o=[],s=e.querySelectorAll(n);for(let e of s){let n=i(e);if(n===void 0)continue;let s=r.get(n);s&&s.size!==0&&o.push({element:e,text:a(e),positions:s})}return o}function ae(e,n){for(let r of e.childNodes)if(r.nodeType===Node.TEXT_NODE&&(n===void 0||r.textContent===n))return r;return null}var oe=class e{static{this._lastMouseClientX=NaN}static{this._lastMouseClientY=NaN}static{this._mouseMovedSinceKeyboard=!0}static{this._listenerRefCount=0}static{this._onGlobalPointerMove=n=>{e.handleGlobalPointerMove(n.clientX,n.clientY)}}constructor(e,n){this._tickledId=void 0,this.host=e,this.config=n,this._inputMode=n.initialInputMode??`mouse`,this.hoverDisabled=n.hoverDisabled??(()=>!1),e.addController(this)}hostConnected(){e._listenerRefCount===0&&document.addEventListener(`pointermove`,e._onGlobalPointerMove,{passive:!0}),e._listenerRefCount++}hostDisconnected(){e._listenerRefCount--,e._listenerRefCount===0&&document.removeEventListener(`pointermove`,e._onGlobalPointerMove)}get inputMode(){return this._inputMode}get tickledId(){return this._tickledId}get current(){return this._tickledId}focus(e){this.setTickled(e)}isTickled(e){return this._tickledId===e}static handleGlobalPointerMove(n,r){Number.isNaN(e._lastMouseClientX)||(n!==e._lastMouseClientX||r!==e._lastMouseClientY)&&(e._mouseMovedSinceKeyboard=!0),e._lastMouseClientX=n,e._lastMouseClientY=r}static ignoreHoverUntilPointerMoves(){e._mouseMovedSinceKeyboard=!1}static get hasMouseMovedSinceKeyboard(){return e._mouseMovedSinceKeyboard}handlePointerEnter(n){if(this.hoverDisabled()||!e._mouseMovedSinceKeyboard)return;let r=this.config.getItems().find(e=>e.id===n);if(r&&r.enabled===!1)return;let i=this._inputMode!==`mouse`;this._inputMode=`mouse`;let a=this._tickledId;this._tickledId=n,this.host.requestUpdate(),a!==n&&this.config.onTickle&&this.config.onTickle(n),(a!==n||i)&&this.config.onStateChange&&this.config.onStateChange()}handlePointerLeave(n){this.hoverDisabled()||e._mouseMovedSinceKeyboard&&this.clearTickled()}handleKeyboardNavigation(n){let r=this._inputMode!==`keyboard`;this._inputMode=`keyboard`,e.ignoreHoverUntilPointerMoves();let i=this.config.getItems().filter(e=>e.enabled!==!1);if(i.length===0)return;let a;if(n===`first`)a=i[0].id;else if(n===`last`)a=i.at(-1)?.id;else if(n===`next`||n===`previous`){let e=i.findIndex(e=>e.id===this._tickledId),r=this.config.itemWrap===`wrap`;if(e===-1)a=n===`next`?i[0].id:i.at(-1)?.id;else{let o=e+(n===`next`?1:-1);o>=0&&o<i.length?a=i[o].id:r&&(o=o<0?i.length-1:0,a=i[o].id)}}else{let e=i.find(e=>e.id===n);e&&(a=e.id)}if(a!==void 0){let e=this._tickledId;this._tickledId=a,this.host.requestUpdate(),e!==a&&this.config.onTickle&&this.config.onTickle(a),(e!==a||r)&&this.config.onStateChange&&this.config.onStateChange()}}setTickled(e){let n=this._tickledId;this._tickledId=e,this.host.requestUpdate(),n!==e&&this.config.onTickle&&this.config.onTickle(e),n!==e&&this.config.onStateChange&&this.config.onStateChange()}clearTickled(){this._tickledId!==void 0&&(this._tickledId=void 0,this.host.requestUpdate(),this.config.onTickle&&this.config.onTickle(void 0),this.config.onStateChange&&this.config.onStateChange())}setInputMode(n){this._inputMode!==n&&(this._inputMode=n,this.host.requestUpdate(),n===`keyboard`&&(e._mouseMovedSinceKeyboard=!1),this.config.onStateChange&&this.config.onStateChange())}};const se=r`
|
|
2
2
|
/**
|
|
3
3
|
* No suppression needed - tickled styling is always active.
|
|
4
4
|
*/
|
|
@@ -1059,7 +1059,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
1059
1059
|
color: var(--surface-muted-text);
|
|
1060
1060
|
font-style: italic;
|
|
1061
1061
|
}
|
|
1062
|
-
`]}};E([d({type:Object})],Jt.prototype,`completionProvider`,void 0),E([d({type:Object})],Jt.prototype,`tokenizer`,void 0),E([d({attribute:!1})],Jt.prototype,`tokenStyle`,void 0),E([d({type:String})],Jt.prototype,`placeholder`,void 0),E([d({type:Number,attribute:`cache-size`})],Jt.prototype,`cacheSize`,void 0),E([d({type:Number,attribute:`debounce-ms`})],Jt.prototype,`debounceMs`,void 0),E([d({type:Boolean})],Jt.prototype,`strict`,void 0),E([d({type:Boolean,attribute:`allow-duplicates`})],Jt.prototype,`allowDuplicates`,void 0),E([m()],Jt.prototype,`_tokens`,void 0),E([m()],Jt.prototype,`_draft`,void 0),E([m()],Jt.prototype,`_selectedTokenIndex`,void 0),E([m()],Jt.prototype,`_isOpen`,void 0),Jt=E([T(`ixfx-ac-token`)],Jt);var Yt=class{commands=/* @__PURE__ */ new Map;invokeListeners=/* @__PURE__ */ new Set;options;constructor(e={}){this.options=e}register(e){if(this.commands.has(e.id))throw Error(`Command "${e.id}" already registered`);this.commands.set(e.id,e)}unregister(e){return this.commands.delete(e)}invoke(e,n){let r=this.commands.get(e);if(!r)return this.options.onCommandNotFound?.(e),!1;try{r.execute(n)}catch(n){return this.options.onInvokeError?.(e,n,`execute`),!1}try{this.options.onInvoke?.(e,n)}catch(n){this.options.onInvokeError?.(e,n,`on-invoke`)}try{for(let r of this.invokeListeners)r(e,n)}catch(n){this.options.onInvokeError?.(e,n,`listener`)}return!0}addOnInvokeHandler(e){return this.invokeListeners.add(e),()=>this.invokeListeners.delete(e)}get(e){return this.commands.get(e)}getAll(){return Array.from(this.commands.values())}getEnabled(e){return this.getAll().filter(n=>!n.enabledWhen||n.enabledWhen(e))}has(e){return this.commands.has(e)}};function Xt(e={}){return new Yt(e)}const Zt=/* @__PURE__ */ new Set([`INPUT`,`TEXTAREA`]);function Qt(e){let n=e.composedPath?.()[0]??e.target;if(!n||typeof n!=`object`)return!1;let r=n;return Zt.has(r.tagName??``)||r.isContentEditable===!0}new class{bindings=[];active=!0;element=null;eventHandlers=/* @__PURE__ */ new Set;modeGetter=null;keydownListener=e=>this.handleKeydown(e);setModeGetter(e){this.modeGetter=e}bind(e){if(!e.nonExclusive&&this.hasOverlap(e))throw Error(`Key binding for "${e.key}" with modifiers "${this.formatModifiers(e.modifiers)}" already exists`);this.bindings.push(e)}unbind(e,n){this.bindings=this.bindings.filter(r=>!(r.key===e&&this.setsEqual(r.modifiers,n)))}setActive(e){this.active=e}onKeyEvent(e){return this.eventHandlers.add(e),()=>{this.eventHandlers.delete(e)}}attach(e){this.element=e,e.addEventListener(`keydown`,this.keydownListener)}detach(){this.element&&=(this.element.removeEventListener(`keydown`,this.keydownListener),null)}getBindings(){return this.bindings}handleKeydown(e){if(!this.active)return;let n=this.getModifiers(e),r=this.getInputContext(e),i=this.findBinding(e.key,n,this.modeGetter?.(),r,Qt(e));if(i){if(e.preventDefault(),e.repeat&&i.allowRepeat===!1)return;let a=this.toModifiers(n);this.eventHandlers.forEach(e=>e(i.commandId,a,r))}}getInputContext(e){let n=document.activeElement,r=n instanceof HTMLElement?n:null;return{source:`keyboard`,element:r,commandContext:r?.dataset?.commandContext,repeat:e.repeat===!0}}getModifiers(e){let n=/* @__PURE__ */ new Set;return e.ctrlKey&&n.add(`ctrl`),e.shiftKey&&n.add(`shift`),e.altKey&&n.add(`alt`),e.metaKey&&n.add(`meta`),n}findBinding(e,n,r,i,a=!1){let o=[];for(let i of this.bindings)i.key.toLowerCase()===e.toLowerCase()&&(!a||i.inTextInput)&&(i.exact?this.setsEqual(i.modifiers,n):this.isSubset(i.modifiers,n))&&(i.mode&&i.mode!==`all`&&i.mode!==r||o.push(i));return this.pickBestBinding(o,i)}pickBestBinding(e,n){if(e.length===0)return;let r=n?.commandContext?e.filter(e=>this.matchesCommandContext(e.commandContext,n.commandContext)):[],i=r.length>0?r:e,a=i[0];if(a){for(let e of i)e.modifiers.size>a.modifiers.size&&(a=e);return a}}matchesCommandContext(e,n){if(!e||!n)return!1;if(e.endsWith(`*`)){let r=e.slice(0,-1);return n.startsWith(r)}return e===n}hasOverlap(e){for(let n of this.bindings)if(n.key.toLowerCase()===e.key.toLowerCase()&&n.mode===e.mode&&this.setsEqual(n.modifiers,e.modifiers))return!0;return!1}formatModifiers(e){return e.size===0?`none`:Array.from(e.values()).sort().join(`+`)}isSubset(e,n){for(let r of e)if(!n.has(r))return!1;return!0}setsEqual(e,n){if(e.size!==n.size)return!1;for(let r of e)if(!n.has(r))return!1;return!0}toModifiers(e){return{ctrl:e.has(`ctrl`),shift:e.has(`shift`),alt:e.has(`alt`),meta:e.has(`meta`)}}},new class{initialized=!1;async init(){this.initialized||=!0}destroy(){this.initialized=!1}isSupported(){return`requestMIDIAccess`in navigator}};const $t=r`
|
|
1062
|
+
`]}};E([d({type:Object})],Jt.prototype,`completionProvider`,void 0),E([d({type:Object})],Jt.prototype,`tokenizer`,void 0),E([d({attribute:!1})],Jt.prototype,`tokenStyle`,void 0),E([d({type:String})],Jt.prototype,`placeholder`,void 0),E([d({type:Number,attribute:`cache-size`})],Jt.prototype,`cacheSize`,void 0),E([d({type:Number,attribute:`debounce-ms`})],Jt.prototype,`debounceMs`,void 0),E([d({type:Boolean})],Jt.prototype,`strict`,void 0),E([d({type:Boolean,attribute:`allow-duplicates`})],Jt.prototype,`allowDuplicates`,void 0),E([m()],Jt.prototype,`_tokens`,void 0),E([m()],Jt.prototype,`_draft`,void 0),E([m()],Jt.prototype,`_selectedTokenIndex`,void 0),E([m()],Jt.prototype,`_isOpen`,void 0),Jt=E([T(`ixfx-ac-token`)],Jt);var Yt=class{commands=/* @__PURE__ */ new Map;invokeListeners=/* @__PURE__ */ new Set;labelOverrides=/* @__PURE__ */ new Map;labelListeners=/* @__PURE__ */ new Set;options;constructor(e={}){this.options=e}register(e){if(this.commands.has(e.id))throw Error(`Command "${e.id}" already registered`);this.commands.set(e.id,e)}unregister(e){return this.labelOverrides.delete(e),this.commands.delete(e)}setLabel(e,n){if(!this.commands.has(e))return!1;if(this.labelOverrides.get(e)===n)return!0;n===void 0?this.labelOverrides.delete(e):this.labelOverrides.set(e,n);for(let r of this.labelListeners)try{r(e,n)}catch(n){this.options.onInvokeError?.(e,n,`listener`)}return!0}getLabel(e,n){let r=this.commands.get(e);if(!r)return;let i=this.labelOverrides.get(e);return i===void 0?typeof r.label==`function`?r.label(n):r.label:i}addOnLabelChangeHandler(e){return this.labelListeners.add(e),()=>this.labelListeners.delete(e)}invoke(e,n){let r=this.commands.get(e);if(!r)return this.options.onCommandNotFound?.(e),!1;try{r.execute(n)}catch(n){return this.options.onInvokeError?.(e,n,`execute`),!1}try{this.options.onInvoke?.(e,n)}catch(n){this.options.onInvokeError?.(e,n,`on-invoke`)}try{for(let r of this.invokeListeners)r(e,n)}catch(n){this.options.onInvokeError?.(e,n,`listener`)}return!0}addOnInvokeHandler(e){return this.invokeListeners.add(e),()=>this.invokeListeners.delete(e)}get(e){return this.commands.get(e)}getAll(){return Array.from(this.commands.values())}getEnabled(e){return this.getAll().filter(n=>!n.enabledWhen||n.enabledWhen(e))}has(e){return this.commands.has(e)}};function Xt(e={}){return new Yt(e)}const Zt=/* @__PURE__ */ new Set([`INPUT`,`TEXTAREA`]);function Qt(e){let n=e.composedPath?.()[0]??e.target;if(!n||typeof n!=`object`)return!1;let r=n;return Zt.has(r.tagName??``)||r.isContentEditable===!0}new class{bindings=[];active=!0;element=null;eventHandlers=/* @__PURE__ */ new Set;modeGetter=null;keydownListener=e=>this.handleKeydown(e);setModeGetter(e){this.modeGetter=e}bind(e){if(!e.nonExclusive&&this.hasOverlap(e))throw Error(`Key binding for "${e.key}" with modifiers "${this.formatModifiers(e.modifiers)}" already exists`);this.bindings.push(e)}unbind(e,n){this.bindings=this.bindings.filter(r=>!(r.key===e&&this.setsEqual(r.modifiers,n)))}setActive(e){this.active=e}onKeyEvent(e){return this.eventHandlers.add(e),()=>{this.eventHandlers.delete(e)}}attach(e){this.element=e,e.addEventListener(`keydown`,this.keydownListener)}detach(){this.element&&=(this.element.removeEventListener(`keydown`,this.keydownListener),null)}getBindings(){return this.bindings}handleKeydown(e){if(!this.active)return;let n=this.getModifiers(e),r=this.getInputContext(e),i=this.findBinding(e.key,n,this.modeGetter?.(),r,Qt(e));if(i){if(e.preventDefault(),e.repeat&&i.allowRepeat===!1)return;let a=this.toModifiers(n);this.eventHandlers.forEach(e=>e(i.commandId,a,r))}}getInputContext(e){let n=document.activeElement,r=n instanceof HTMLElement?n:null;return{source:`keyboard`,element:r,commandContext:r?.dataset?.commandContext,repeat:e.repeat===!0}}getModifiers(e){let n=/* @__PURE__ */ new Set;return e.ctrlKey&&n.add(`ctrl`),e.shiftKey&&n.add(`shift`),e.altKey&&n.add(`alt`),e.metaKey&&n.add(`meta`),n}findBinding(e,n,r,i,a=!1){let o=[];for(let i of this.bindings)i.key.toLowerCase()===e.toLowerCase()&&(!a||i.inTextInput)&&(i.exact?this.setsEqual(i.modifiers,n):this.isSubset(i.modifiers,n))&&(i.mode&&i.mode!==`all`&&i.mode!==r||o.push(i));return this.pickBestBinding(o,i)}pickBestBinding(e,n){if(e.length===0)return;let r=n?.commandContext?e.filter(e=>this.matchesCommandContext(e.commandContext,n.commandContext)):[],i=r.length>0?r:e,a=i[0];if(a){for(let e of i)e.modifiers.size>a.modifiers.size&&(a=e);return a}}matchesCommandContext(e,n){if(!e||!n)return!1;if(e.endsWith(`*`)){let r=e.slice(0,-1);return n.startsWith(r)}return e===n}hasOverlap(e){for(let n of this.bindings)if(n.key.toLowerCase()===e.key.toLowerCase()&&n.mode===e.mode&&this.setsEqual(n.modifiers,e.modifiers))return!0;return!1}formatModifiers(e){return e.size===0?`none`:Array.from(e.values()).sort().join(`+`)}isSubset(e,n){for(let r of e)if(!n.has(r))return!1;return!0}setsEqual(e,n){if(e.size!==n.size)return!1;for(let r of e)if(!n.has(r))return!1;return!0}toModifiers(e){return{ctrl:e.has(`ctrl`),shift:e.has(`shift`),alt:e.has(`alt`),meta:e.has(`meta`)}}},new class{initialized=!1;async init(){this.initialized||=!0}destroy(){this.initialized=!1}isSupported(){return`requestMIDIAccess`in navigator}};const $t=r`
|
|
1063
1063
|
.ixfx-handle {
|
|
1064
1064
|
/* Bridge: public --ixfx-handle-* (element or ancestor) → internal alias → fallback. */
|
|
1065
1065
|
--_handle-color: var(--ixfx-handle-color, var(--surface-3-text));
|
|
@@ -2499,7 +2499,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
2499
2499
|
from { opacity: 1; }
|
|
2500
2500
|
to { opacity: 0; }
|
|
2501
2501
|
}
|
|
2502
|
-
`;function Yn(e,n){let r=e.getBoundingClientRect();return n===`inline`?r.width:r.height}function Xn(e,n){if(n!==void 0)return n;let r=getComputedStyle(e).getPropertyValue(`--ixfx-list-item-move-duration`).trim();if(r){let e=Number.parseFloat(r);if(!Number.isNaN(e))return r.endsWith(`ms`)?e:r.endsWith(`s`)?e*1e3:e}return 200}function Zn(e){let n=e===`inline`?`width`:`height`,r=e===`inline`?`minWidth`:`minHeight`;return{[n]:`0px`,[r]:`0px`,opacity:0,overflow:`hidden`}}function Qn(e,n){let r=n===`inline`?`width`:`height`,i=n===`inline`?`minWidth`:`minHeight`;return{[r]:`${e}px`,[i]:`0px`,opacity:1,overflow:`hidden`}}function $n(e,n={}){if(qn())return;let{axis:r=`block`,easing:i=`ease`}=n,a=Xn(e,n.duration),o=Yn(e,r);if(!(o<=0))return e.animate([Zn(r),Qn(o,r)],{duration:a,easing:i})}function er(e,n){return Object.assign(e,{animation:n})}function tr(e,n={}){if(qn())return;let{axis:r=`block`,easing:i=`ease`}=n,a=Xn(e,n.duration),o=Yn(e,r);if(!(o<=0))return e.animate([Qn(o,r),Zn(r)],{duration:a,easing:i,fill:`forwards`})}function nr(e,n={}){let r=tr(e,n);return r?er(r.finished.then(()=>void 0,()=>void 0),r):er(Promise.resolve(),void 0)}var rr=class{#e;#t;#n=!1;#r;#i=!1;#a=/* @__PURE__ */ new WeakSet;#o;constructor(e,n){this.#e=e,this.#t=n,e.addController(this)}get isDragging(){return this.#n}get draggableAttr(){try{return this.#t.isEnabled()?`true`:`false`}catch{return`false`}}refreshDraggable(){try{this.#t.syncLightDomDraggable?.()}catch{}}hostConnected(){this.#c(),this.#o??=new MutationObserver(()=>this.refreshDraggable());try{this.#o.observe(this.#e,{childList:!0,subtree:!0})}catch{}this.refreshDraggable()}hostUpdated(){this.#c()}hostDisconnected(){this.#l();try{this.#o?.disconnect()}catch{}this.#n=!1}#s(){return this.#e.renderRoot??this.#e}#c(){let e=this.#s();e!==this.#r&&(this.#l(),this.#r=e,e.addEventListener(`dragstart`,this.#u,{capture:!0}),e.addEventListener(`dragend`,this.#d,{capture:!0})),this.#i||(this.#i=!0,this.#e.addEventListener(`dragstart`,this.#u,{capture:!0}),this.#e.addEventListener(`dragend`,this.#d,{capture:!0}))}#l(){this.#r?.removeEventListener(`dragstart`,this.#u,{capture:!0}),this.#r?.removeEventListener(`dragend`,this.#d,{capture:!0}),this.#r=void 0,this.#i&&(this.#i=!1,this.#e.removeEventListener(`dragstart`,this.#u,{capture:!0}),this.#e.removeEventListener(`dragend`,this.#d,{capture:!0}))}#u=e=>{if(!(e instanceof DragEvent)||this.#a.has(e))return;if(this.#t.shouldStart){let n=!0;try{n=this.#t.shouldStart(e)}catch{n=!1}if(!n){try{e.preventDefault()}catch{}return}}let n=!1;try{n=this.#t.isEnabled()}catch{return}if(!n)return;let r;try{r=this.#t.resolveEventToKey(e.target)}catch{return}if(r&&this.#a.add(e),!r)return;let i;try{i=this.#t.prepareSelection(r)}catch{return}if(!i||i.selected.length===0)return;let{origin:a,selected:o}=i,s;try{s=getComputedStyle(this.#e)}catch{s=document.createElement(`div`).style}let c={};try{c=this.#t.getMetrics()??{}}catch{c={}}let l;try{l=this.#t.getDragPreviewSourceResolver?.()}catch{l=void 0}let u={source:this.#t.source,origin:a,selected:o,metrics:c,hostStyle:s,...l?{resolveDragPreviewSource:l}:{}},d;try{d=this.#t.getRenderer()}catch{d=void 0}let f;try{f=d?d(u):Un(u)}catch{f=Un(u)}try{document.body.appendChild(f.element)}catch{}let p={key:a.key,index:a.index,item:a.item,selectedKeys:o.map(e=>e.key),selected:o,preview:f},m=!0;try{m=this.#t.dispatch(p)}catch{m=!0}if(m){if(e.dataTransfer){try{(e.dataTransfer.effectAllowed===`none`||e.dataTransfer.effectAllowed===`uninitialized`)&&(e.dataTransfer.effectAllowed=`copyMove`)}catch{}try{this.#t.writeDataTransfer?.(e.dataTransfer,p)}catch{}}let n=f.hotspot??{x:16,y:16};try{e.dataTransfer?.setDragImage(f.element,n.x,n.y)}catch{}this.#n=!0;try{this.#t.onActiveChange(!0,a.key)}catch{}}else try{e.preventDefault()}catch{}requestAnimationFrame(()=>{try{f.element.remove()}catch{}try{f.dispose?.()}catch{}})};#d=()=>{if(this.#n){this.#n=!1;try{this.#t.onActiveChange(!1)}catch{}try{this.#t.onEnd()}catch{}}}};const ir=2e3,O=/* @__PURE__ */ new Set,ar=/* @__PURE__ */ new Map;function or(e,n){if(e.size===0)return{present:[],missing:e};let r=[],i=/* @__PURE__ */ new Set;for(let a of e)n(a)?r.push(a):i.add(a);return{present:r,missing:r.length===0?e:i}}function sr(e,n){if(e.size===0)return{present:[],missing:e};let r=[],i=/* @__PURE__ */ new Map;for(let[a,o]of e)n(a)?r.push([a,o]):i.set(a,o);return{present:r,missing:r.length===0?e:i}}function cr(e,n=ir){return e.size<=n?e:new Set([...e].slice(e.size-n))}function lr(e,n=ir){return e.size<=n?e:new Map([...e].slice(e.size-n))}function ur(e,n){if(!e.has(n))return e;let r=new Map(e);return r.delete(n),r}function dr(e){if(!e)return ar;let n=/* @__PURE__ */ new Map;for(let[r,i]of Object.entries(e))typeof i==`boolean`&&n.set(r,i);return n}function fr(...e){let n={};for(let r of e)for(let[e,i]of r)n[e]=i;return n}function pr(...e){let n=/* @__PURE__ */ new Set;for(let r of e)for(let e of r)n.add(e);return[...n]}function mr(e,n=!0){return[...e].map(e=>[e,n])}function hr(e){return{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,pointerType:e.pointerType}}function gr(e){return e===`checked`||e===`sticky`||e===`vscode`||e===`standard`}var _r=class{#e;#t=/* @__PURE__ */ new Set;#n;#r=O;constructor(e){this.#e=e}get selected(){return this.#t}get selectedKeys(){let e=this.#e.getKey,n=/* @__PURE__ */ new Set;if(e)for(let r of this.#t){let i=e(r);i!==void 0&&n.add(i)}return n}get anchor(){return this.#n}canSelectAll(){return this.canSelectMultiple()&&this.#e.getModes().selectionMode!==`none`}canSelectMultiple(){let{selectionMode:e,interactionMode:n}=this.#e.getModes();return e===`multiple`||gr(n)}replace(e){this.#e.getModes().selectionMode!==`none`&&this.#e.isSelectable(e)&&(this.#n=e,this.#h(/* @__PURE__ */ new Set([e])))}toggle(e){let{selectionMode:n,interactionMode:r}=this.#e.getModes();if(!this.#e.isSelectable(e)||n===`none`&&r!==`checked`&&r!==`sticky`)return;let i=new Set(this.#t);if(i.has(e))i.delete(e);else{if(this.canSelectMultiple()||i.clear(),this.#f()){let n=this.#p(e);for(let e of[...i])this.#p(e)!==n&&i.delete(e)}i.add(e)}this.#h(i)}rangeTo(e){if(this.#e.getModes().selectionMode===`none`)return;let n=this.#i(e);n===void 0?this.replace(e):this.#h(new Set(n))}#i(e){if(this.#n===void 0)return;let n=this.#e.getOrderedItems(),r=n.indexOf(this.#n),i=n.indexOf(e);if(r===-1||i===-1)return;let a=n,o=r,s=i;if(this.#f()){let r=this.#p(this.#n);if(r!==this.#p(e)||(a=n.filter(e=>this.#p(e)===r),o=a.indexOf(this.#n),s=a.indexOf(e),o===-1||s===-1))return}return a.slice(Math.min(o,s),Math.max(o,s)+1).filter(e=>this.#e.isSelectable(e))}clear(){this.#r=O,this.#t.size!==0&&this.#h(/* @__PURE__ */ new Set)}selectAll(e=`api`){let n=this.#e.getOrderedItems(),r=null;if(this.#f()&&(r=(this.#n===void 0?null:this.#p(this.#n))??this.#e.getFallbackGroupKey?.()??null,r!==null&&(n=n.filter(e=>this.#p(e)===r))),this.#d({kind:`all`,keys:[],...r===null?{}:{groupKey:r},source:e}))return;let i=new Set(n.filter(e=>this.#e.isSelectable(e)));i.size!==0&&this.#h(i)}selectMany(e){let{selectionMode:n}=this.#e.getModes();if(n!==`multiple`)throw Error(`selectMany requires selectionMode="multiple" (current: "${n}")`);let r=this.#m(new Set([...e].filter(e=>this.#e.isSelectable(e))));r.size!==0&&(this.#n=[...r].at(-1),this.#h(r))}canDragSelect(){return this.#e.getModes().selectionMode!==`none`&&this.#a()}applyDragSelection(e,n){if(!this.canDragSelect())return;let r=[...e],i=n?[...n.covered].filter(e=>this.#e.isSelectable(e)):r,a=n?.mode??(n?.additive?`toggle`:`replace`);if(this.#d({kind:`marquee`,keys:this.#u(i),additive:a!==`replace`,mode:a,source:`pointer`})){this.#n=r.at(-1)??this.#n;return}let o=this.#m(new Set(r.filter(e=>this.#e.isSelectable(e))));(o.size!==0||this.#t.size!==0)&&(this.#n=[...o].at(-1),this.#h(o))}deselect(e){if(!this.#t.has(e))return;let n=new Set(this.#t);n.delete(e),this.#h(n)}#a(){let{selectionMode:e,interactionMode:n}=this.#e.getModes();return e===`multiple`||n===`checked`||n===`sticky`||n===`vscode`}selectKeys(e,n){if(this.#e.getModes().selectionMode===`none`)return;let r=/* @__PURE__ */ new Set,i=/* @__PURE__ */ new Set;for(let a of new Set(e)){let e=n(a);e===void 0?i.add(a):this.#e.isSelectable(e)&&r.add(e)}let a=i;this.#a()||(r.size>0?(r=new Set([...r].slice(-1)),a=O):a=new Set([...i].slice(-1))),this.#n=[...r].at(-1),this.#r=cr(a),this.#h(r,!0)}addKeys(e,n){if(!this.#a())return;let r=new Set(this.#t),i=new Set(this.#r),a=!1;for(let o of new Set(e)){let e=n(o);e===void 0?i.add(o):!r.has(e)&&this.#e.isSelectable(e)&&(r.add(e),a=!0)}a&&this.#h(r,!0),this.#r=cr(i)}removeKeys(e,n){let r=new Set(e);if(this.#r.size>0&&(this.#r=new Set([...this.#r].filter(e=>!r.has(e)))),this.#t.size===0)return;let i=new Set(this.#t),a=!1;for(let e of r){let r=n(e);r!==void 0&&i.delete(r)&&(a=!0)}a&&this.#h(i,!0)}get pendingKeys(){return this.#r}restoreKeys(e,n){let{present:r,missing:i}=or(new Set(e),e=>this.#o(e,n)!==void 0),a=/* @__PURE__ */ new Set;if(this.#e.getModes().selectionMode!==`none`)for(let e of r)a.add(this.#o(e,n));!this.#a()&&a.size>1&&(a=new Set([...a].slice(-1))),this.#n=[...a].at(-1),this.#r=cr(i),(a.size!==0||this.#t.size!==0)&&this.#h(a,!0)}resolvePending(e){if(this.#r.size===0||this.#e.getModes().selectionMode===`none`)return!1;let{present:n,missing:r}=or(this.#r,n=>this.#o(n,e)!==void 0);if(n.length===0)return!1;let i=n.map(n=>this.#o(n,e)),a;return this.#a()?(a=/* @__PURE__ */ new Set([...this.#t,...i]),this.#r=r):(a=/* @__PURE__ */ new Set([i.at(-1)]),this.#r=O),this.#n??=i.at(-1),this.#h(a,!0),!0}demote(e){let n=this.#e.getKey,r=new Set(this.#t),i=new Set(this.#r),a=!1;for(let o of e){if(!r.delete(o))continue;a=!0;let e=n?.(o);e!==void 0&&i.add(e),this.#n===o&&(this.#n=void 0)}return a?(this.#t=r,this.#r=cr(i),!0):!1}clearPending(){this.#r=O}#o(e,n){let r=n(e);return r!==void 0&&this.#e.isSelectable(r)?r:void 0}handleClick(e,n){let{selectionMode:r,interactionMode:i}=this.#e.getModes();if(r===`none`&&i!==`checked`&&i!==`sticky`)return;let a=n.pointerType===`touch`,o=n.ctrlKey||n.metaKey,s=r===`multiple`||i===`vscode`;switch(i){case`implicit`:this.#s(e,`pointer`);break;case`manual`:o?this.#c(e,`pointer`):n.shiftKey?this.#l(e,`pointer`):this.#s(e,`pointer`);break;case`standard`:case`vscode`:o?s&&this.#c(e,`pointer`):n.shiftKey&&s?this.#l(e,`pointer`):this.#s(e,`pointer`);break;case`checked`:break;case`sticky`:this.#c(e,a?`touch`:`pointer`)}}handleSpace(e){this.#e.getModes().interactionMode===`implicit`?this.#s(e,`keyboard`):this.#c(e,`keyboard`)}handleCheckbox(e,n=`pointer`){this.#c(e,n)}handleReplace(e,n=`pointer`){this.#s(e,n)}handleExtend(e){this.#l(e,`keyboard`)}handleClear(e=`keyboard`,n=!1){this.#d({kind:`clear`,keys:[],source:e})||n&&this.#e.getModes().interactionMode===`manual`||this.clear()}#s(e,n){this.#e.getModes().selectionMode!==`none`&&this.#e.isSelectable(e)&&(this.#d({kind:`replace`,keys:this.#u([e]),source:n})?this.#n=e:this.#e.getModes().interactionMode!==`manual`&&this.replace(e))}#c(e,n){this.#e.isSelectable(e)&&(this.#d({kind:`toggle`,keys:this.#u([e]),source:n})||this.#e.getModes().interactionMode!==`manual`&&this.toggle(e))}#l(e,n){if(this.#e.getModes().selectionMode===`none`)return;let r=this.#n===void 0?void 0:this.#i(e),i=this.#n===void 0?void 0:this.#e.getKey?.(this.#n),a=this.#e.getKey?.(e);this.#d({kind:`extend`,keys:this.#u(r??[e]),...i===void 0?{}:{anchorKey:i},...a===void 0?{}:{targetKey:a},source:n})?this.#n===void 0&&(this.#n=e):this.#e.getModes().interactionMode!==`manual`&&this.rangeTo(e)}#u(e){let n=this.#e.getKey;if(!n)return[];let r=[];for(let i of e){let e=n(i);e!==void 0&&r.push(e)}return r}#d(e){return this.#e.onIntent?.(e)??!1}clearAnchor(){this.#n=void 0}remap(e){this.#t.size!==0&&(this.#t=new Set([...this.#t].map(e)))}reset(){this.demote([...this.#t]),this.#t=/* @__PURE__ */ new Set,this.#n=void 0}seed(e,n){this.#t=new Set(e),this.#n=n}#f(){return this.#e.getGroupKey!==void 0&&!(this.#e.crossGroupSelection?.()??!1)}#p(e){return this.#e.getGroupKey?.(e)??null}#m(e){if(!this.#f()||e.size===0)return new Set(e);let n=this.#e.getOrderedItems().find(n=>e.has(n))??[...e][0],r=this.#p(n);return new Set([...e].filter(e=>this.#p(e)===r))}#h(e,n=!1){n||(this.#r=O);let r=this.#t;this.#t=e,this.#e.onChange(e,r)}};const vr=`Partially selected`;function yr(e,n,r){return!r&&e!==void 0&&n.has(e)}function br(e,n){if(e.size!==n.size)return!1;for(let r of e)if(!n.has(r))return!1;return!0}function xr(e,n){e.toggleAttribute(`data-partial`,n),n?e.hasAttribute(`aria-description`)||e.setAttribute(`aria-description`,vr):e.getAttribute(`aria-description`)===`Partially selected`&&e.removeAttribute(`aria-description`)}const Sr=`data-scroll-hover-suppress`;function Cr(e){let{host:n,enabled:r,onResume:i}=e,a=!1,o=NaN,s=NaN,c=()=>{a&&(a=!1,n.toggleAttribute(Sr,!1))};return{suppressed:()=>a,onScroll:()=>{!a&&r()&&(a=!0,n.toggleAttribute(Sr,!0))},onPointerMove:e=>{let n=!Number.isNaN(o)&&(e.clientX!==o||e.clientY!==s);o=e.clientX,s=e.clientY,n&&a&&(c(),i?.(e.clientX,e.clientY))},onPointerLeave:c,end:c}}var wr=class{constructor(e,n,r){this.handleKeyDown=e=>{if(this.disableKeyboardNavigation())return;let{key:n}=e;switch([`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`,`Enter`,`Escape`].includes(n)&&this.tickled.setInputMode(`keyboard`),n){case`ArrowDown`:e.preventDefault(),this.#e();break;case`ArrowUp`:e.preventDefault(),this.#t();break;case`ArrowRight`:e.preventDefault(),this.#n();break;case`ArrowLeft`:e.preventDefault(),this.#r();break;case`Enter`:e.preventDefault(),this.#i();break;case`Escape`:e.preventDefault(),this.callbacks.onEscape?.()}},this.host=e,this.tickled=n,this.callbacks=r.callbacks,this.disableKeyboardNavigation=r.disableKeyboardNavigation??(()=>!1),e.addController(this)}hostConnected(){}hostDisconnected(){}#e(){this.tickled.handleKeyboardNavigation(`next`)}#t(){this.tickled.handleKeyboardNavigation(`previous`)}#n(){let e=this.tickled.tickledId;if(e&&!this.callbacks.isLeaf(e)){if(!this.callbacks.isExpanded(e))this.callbacks.onExpand(e),this.tickled.setTickled(e);else{let n=this.callbacks.getItems(),r=n.findIndex(n=>n.id===e);if(r!==-1&&r+1<n.length){let e=n[r+1];e.enabled!==!1&&this.tickled.setTickled(e.id)}}}}#r(){let e=this.tickled.tickledId;if(e){if(this.callbacks.isLeaf(e)){let n=this.callbacks.getParentId?.(e);n&&(this.tickled.setTickled(n),this.callbacks.isExpanded(n)&&this.callbacks.onCollapse(n))}else if(this.callbacks.isExpanded(e))this.callbacks.onCollapse(e);else{let n=this.callbacks.getParentId?.(e);n&&this.tickled.setTickled(n)}}}#i(){let e=this.tickled.tickledId;e&&(this.callbacks.onActivate(e),this.callbacks.onSelect?.(e))}};function Tr(e){let n=`scroll-fade-${e}`,i=`--${n}-start`,a=`--${n}-end`,o=`--${n}-timeline`,s=`${n}-fade`,l=e===`x`?`to right`:`to bottom`;return r`
|
|
2502
|
+
`;function Yn(e,n){let r=e.getBoundingClientRect();return n===`inline`?r.width:r.height}function Xn(e,n){if(n!==void 0)return n;let r=getComputedStyle(e).getPropertyValue(`--ixfx-list-item-move-duration`).trim();if(r){let e=Number.parseFloat(r);if(!Number.isNaN(e))return r.endsWith(`ms`)?e:r.endsWith(`s`)?e*1e3:e}return 200}function Zn(e){let n=e===`inline`?`width`:`height`,r=e===`inline`?`minWidth`:`minHeight`;return{[n]:`0px`,[r]:`0px`,opacity:0,overflow:`hidden`}}function Qn(e,n){let r=n===`inline`?`width`:`height`,i=n===`inline`?`minWidth`:`minHeight`;return{[r]:`${e}px`,[i]:`0px`,opacity:1,overflow:`hidden`}}function $n(e,n={}){if(qn())return;let{axis:r=`block`,easing:i=`ease`}=n,a=Xn(e,n.duration),o=Yn(e,r);if(!(o<=0))return e.animate([Zn(r),Qn(o,r)],{duration:a,easing:i})}function er(e,n){return Object.assign(e,{animation:n})}function tr(e,n={}){if(qn())return;let{axis:r=`block`,easing:i=`ease`}=n,a=Xn(e,n.duration),o=Yn(e,r);if(!(o<=0))return e.animate([Qn(o,r),Zn(r)],{duration:a,easing:i,fill:`forwards`})}function nr(e,n={}){let r=tr(e,n);return r?er(r.finished.then(()=>void 0,()=>void 0),r):er(Promise.resolve(),void 0)}var rr=class{#e;#t;#n=!1;#r;#i=!1;#a=/* @__PURE__ */ new WeakSet;#o;constructor(e,n){this.#e=e,this.#t=n,e.addController(this)}get isDragging(){return this.#n}get draggableAttr(){try{return this.#t.isEnabled()?`true`:`false`}catch{return`false`}}refreshDraggable(){try{this.#t.syncLightDomDraggable?.()}catch{}}hostConnected(){this.#c(),this.#o??=new MutationObserver(()=>this.refreshDraggable());try{this.#o.observe(this.#e,{childList:!0,subtree:!0})}catch{}this.refreshDraggable()}hostUpdated(){this.#c()}hostDisconnected(){this.#l();try{this.#o?.disconnect()}catch{}this.#n=!1}#s(){return this.#e.renderRoot??this.#e}#c(){let e=this.#s();e!==this.#r&&(this.#l(),this.#r=e,e.addEventListener(`dragstart`,this.#u,{capture:!0}),e.addEventListener(`dragend`,this.#d,{capture:!0})),this.#i||(this.#i=!0,this.#e.addEventListener(`dragstart`,this.#u,{capture:!0}),this.#e.addEventListener(`dragend`,this.#d,{capture:!0}))}#l(){this.#r?.removeEventListener(`dragstart`,this.#u,{capture:!0}),this.#r?.removeEventListener(`dragend`,this.#d,{capture:!0}),this.#r=void 0,this.#i&&(this.#i=!1,this.#e.removeEventListener(`dragstart`,this.#u,{capture:!0}),this.#e.removeEventListener(`dragend`,this.#d,{capture:!0}))}#u=e=>{if(!(e instanceof DragEvent)||this.#a.has(e))return;if(this.#t.shouldStart){let n=!0;try{n=this.#t.shouldStart(e)}catch{n=!1}if(!n){try{e.preventDefault()}catch{}return}}let n=!1;try{n=this.#t.isEnabled()}catch{return}if(!n)return;let r;try{r=this.#t.resolveEventToKey(e.target)}catch{return}if(r&&this.#a.add(e),!r)return;let i;try{i=this.#t.prepareSelection(r)}catch{return}if(!i||i.selected.length===0)return;let{origin:a,selected:o}=i,s;try{s=getComputedStyle(this.#e)}catch{s=document.createElement(`div`).style}let c={};try{c=this.#t.getMetrics()??{}}catch{c={}}let l;try{l=this.#t.getDragPreviewSourceResolver?.()}catch{l=void 0}let u={source:this.#t.source,origin:a,selected:o,metrics:c,hostStyle:s,...l?{resolveDragPreviewSource:l}:{}},d;try{d=this.#t.getRenderer()}catch{d=void 0}let f;try{f=d?d(u):Un(u)}catch{f=Un(u)}try{document.body.appendChild(f.element)}catch{}let p={key:a.key,index:a.index,item:a.item,selectedKeys:o.map(e=>e.key),selected:o,preview:f},m=!0;try{m=this.#t.dispatch(p)}catch{m=!0}if(m){if(e.dataTransfer){try{(e.dataTransfer.effectAllowed===`none`||e.dataTransfer.effectAllowed===`uninitialized`)&&(e.dataTransfer.effectAllowed=`copyMove`)}catch{}try{this.#t.writeDataTransfer?.(e.dataTransfer,p)}catch{}try{this.#e.writeDataTransfer?.(e.dataTransfer,p)}catch{}}let n=f.hotspot??{x:16,y:16};try{e.dataTransfer?.setDragImage(f.element,n.x,n.y)}catch{}this.#n=!0;try{this.#t.onActiveChange(!0,a.key)}catch{}}else try{e.preventDefault()}catch{}requestAnimationFrame(()=>{try{f.element.remove()}catch{}try{f.dispose?.()}catch{}})};#d=()=>{if(this.#n){this.#n=!1;try{this.#t.onActiveChange(!1)}catch{}try{this.#t.onEnd()}catch{}}}};const ir=2e3,O=/* @__PURE__ */ new Set,ar=/* @__PURE__ */ new Map;function or(e,n){if(e.size===0)return{present:[],missing:e};let r=[],i=/* @__PURE__ */ new Set;for(let a of e)n(a)?r.push(a):i.add(a);return{present:r,missing:r.length===0?e:i}}function sr(e,n){if(e.size===0)return{present:[],missing:e};let r=[],i=/* @__PURE__ */ new Map;for(let[a,o]of e)n(a)?r.push([a,o]):i.set(a,o);return{present:r,missing:r.length===0?e:i}}function cr(e,n=ir){return e.size<=n?e:new Set([...e].slice(e.size-n))}function lr(e,n=ir){return e.size<=n?e:new Map([...e].slice(e.size-n))}function ur(e,n){if(!e.has(n))return e;let r=new Map(e);return r.delete(n),r}function dr(e){if(!e)return ar;let n=/* @__PURE__ */ new Map;for(let[r,i]of Object.entries(e))typeof i==`boolean`&&n.set(r,i);return n}function fr(...e){let n={};for(let r of e)for(let[e,i]of r)n[e]=i;return n}function pr(...e){let n=/* @__PURE__ */ new Set;for(let r of e)for(let e of r)n.add(e);return[...n]}function mr(e,n=!0){return[...e].map(e=>[e,n])}function hr(e){return{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,pointerType:e.pointerType}}function gr(e){return e===`checked`||e===`sticky`||e===`vscode`||e===`standard`}var _r=class{#e;#t=/* @__PURE__ */ new Set;#n;#r=O;constructor(e){this.#e=e}get selected(){return this.#t}get selectedKeys(){let e=this.#e.getKey,n=/* @__PURE__ */ new Set;if(e)for(let r of this.#t){let i=e(r);i!==void 0&&n.add(i)}return n}get anchor(){return this.#n}canSelectAll(){return this.canSelectMultiple()&&this.#e.getModes().selectionMode!==`none`}canSelectMultiple(){let{selectionMode:e,interactionMode:n}=this.#e.getModes();return e===`multiple`||gr(n)}replace(e){this.#e.getModes().selectionMode!==`none`&&this.#e.isSelectable(e)&&(this.#n=e,this.#h(/* @__PURE__ */ new Set([e])))}toggle(e){let{selectionMode:n,interactionMode:r}=this.#e.getModes();if(!this.#e.isSelectable(e)||n===`none`&&r!==`checked`&&r!==`sticky`)return;let i=new Set(this.#t);if(i.has(e))i.delete(e);else{if(this.canSelectMultiple()||i.clear(),this.#f()){let n=this.#p(e);for(let e of[...i])this.#p(e)!==n&&i.delete(e)}i.add(e)}this.#h(i)}rangeTo(e){if(this.#e.getModes().selectionMode===`none`)return;let n=this.#i(e);n===void 0?this.replace(e):this.#h(new Set(n))}#i(e){if(this.#n===void 0)return;let n=this.#e.getOrderedItems(),r=n.indexOf(this.#n),i=n.indexOf(e);if(r===-1||i===-1)return;let a=n,o=r,s=i;if(this.#f()){let r=this.#p(this.#n);if(r!==this.#p(e)||(a=n.filter(e=>this.#p(e)===r),o=a.indexOf(this.#n),s=a.indexOf(e),o===-1||s===-1))return}return a.slice(Math.min(o,s),Math.max(o,s)+1).filter(e=>this.#e.isSelectable(e))}clear(){this.#r=O,this.#t.size!==0&&this.#h(/* @__PURE__ */ new Set)}selectAll(e=`api`){let n=this.#e.getOrderedItems(),r=null;if(this.#f()&&(r=(this.#n===void 0?null:this.#p(this.#n))??this.#e.getFallbackGroupKey?.()??null,r!==null&&(n=n.filter(e=>this.#p(e)===r))),this.#d({kind:`all`,keys:[],...r===null?{}:{groupKey:r},source:e}))return;let i=new Set(n.filter(e=>this.#e.isSelectable(e)));i.size!==0&&this.#h(i)}selectMany(e){let{selectionMode:n}=this.#e.getModes();if(n!==`multiple`)throw Error(`selectMany requires selectionMode="multiple" (current: "${n}")`);let r=this.#m(new Set([...e].filter(e=>this.#e.isSelectable(e))));r.size!==0&&(this.#n=[...r].at(-1),this.#h(r))}canDragSelect(){return this.#e.getModes().selectionMode!==`none`&&this.#a()}applyDragSelection(e,n){if(!this.canDragSelect())return;let r=[...e],i=n?[...n.covered].filter(e=>this.#e.isSelectable(e)):r,a=n?.mode??(n?.additive?`toggle`:`replace`);if(this.#d({kind:`marquee`,keys:this.#u(i),additive:a!==`replace`,mode:a,source:`pointer`})){this.#n=r.at(-1)??this.#n;return}let o=this.#m(new Set(r.filter(e=>this.#e.isSelectable(e))));(o.size!==0||this.#t.size!==0)&&(this.#n=[...o].at(-1),this.#h(o))}deselect(e){if(!this.#t.has(e))return;let n=new Set(this.#t);n.delete(e),this.#h(n)}#a(){let{selectionMode:e,interactionMode:n}=this.#e.getModes();return e===`multiple`||n===`checked`||n===`sticky`||n===`vscode`}selectKeys(e,n){if(this.#e.getModes().selectionMode===`none`)return;let r=/* @__PURE__ */ new Set,i=/* @__PURE__ */ new Set;for(let a of new Set(e)){let e=n(a);e===void 0?i.add(a):this.#e.isSelectable(e)&&r.add(e)}let a=i;this.#a()||(r.size>0?(r=new Set([...r].slice(-1)),a=O):a=new Set([...i].slice(-1))),this.#n=[...r].at(-1),this.#r=cr(a),this.#h(r,!0)}addKeys(e,n){if(!this.#a())return;let r=new Set(this.#t),i=new Set(this.#r),a=!1;for(let o of new Set(e)){let e=n(o);e===void 0?i.add(o):!r.has(e)&&this.#e.isSelectable(e)&&(r.add(e),a=!0)}a&&this.#h(r,!0),this.#r=cr(i)}removeKeys(e,n){let r=new Set(e);if(this.#r.size>0&&(this.#r=new Set([...this.#r].filter(e=>!r.has(e)))),this.#t.size===0)return;let i=new Set(this.#t),a=!1;for(let e of r){let r=n(e);r!==void 0&&i.delete(r)&&(a=!0)}a&&this.#h(i,!0)}get pendingKeys(){return this.#r}restoreKeys(e,n){let{present:r,missing:i}=or(new Set(e),e=>this.#o(e,n)!==void 0),a=/* @__PURE__ */ new Set;if(this.#e.getModes().selectionMode!==`none`)for(let e of r)a.add(this.#o(e,n));!this.#a()&&a.size>1&&(a=new Set([...a].slice(-1))),this.#n=[...a].at(-1),this.#r=cr(i),(a.size!==0||this.#t.size!==0)&&this.#h(a,!0)}resolvePending(e){if(this.#r.size===0||this.#e.getModes().selectionMode===`none`)return!1;let{present:n,missing:r}=or(this.#r,n=>this.#o(n,e)!==void 0);if(n.length===0)return!1;let i=n.map(n=>this.#o(n,e)),a;return this.#a()?(a=/* @__PURE__ */ new Set([...this.#t,...i]),this.#r=r):(a=/* @__PURE__ */ new Set([i.at(-1)]),this.#r=O),this.#n??=i.at(-1),this.#h(a,!0),!0}demote(e){let n=this.#e.getKey,r=new Set(this.#t),i=new Set(this.#r),a=!1;for(let o of e){if(!r.delete(o))continue;a=!0;let e=n?.(o);e!==void 0&&i.add(e),this.#n===o&&(this.#n=void 0)}return a?(this.#t=r,this.#r=cr(i),!0):!1}clearPending(){this.#r=O}#o(e,n){let r=n(e);return r!==void 0&&this.#e.isSelectable(r)?r:void 0}handleClick(e,n){let{selectionMode:r,interactionMode:i}=this.#e.getModes();if(r===`none`&&i!==`checked`&&i!==`sticky`)return;let a=n.pointerType===`touch`,o=n.ctrlKey||n.metaKey,s=r===`multiple`||i===`vscode`;switch(i){case`implicit`:this.#s(e,`pointer`);break;case`manual`:o?this.#c(e,`pointer`):n.shiftKey?this.#l(e,`pointer`):this.#s(e,`pointer`);break;case`standard`:case`vscode`:o?s&&this.#c(e,`pointer`):n.shiftKey&&s?this.#l(e,`pointer`):this.#s(e,`pointer`);break;case`checked`:break;case`sticky`:this.#c(e,a?`touch`:`pointer`)}}handleSpace(e){this.#e.getModes().interactionMode===`implicit`?this.#s(e,`keyboard`):this.#c(e,`keyboard`)}handleCheckbox(e,n=`pointer`){this.#c(e,n)}handleReplace(e,n=`pointer`){this.#s(e,n)}handleExtend(e){this.#l(e,`keyboard`)}handleClear(e=`keyboard`,n=!1){this.#d({kind:`clear`,keys:[],source:e})||n&&this.#e.getModes().interactionMode===`manual`||this.clear()}#s(e,n){this.#e.getModes().selectionMode!==`none`&&this.#e.isSelectable(e)&&(this.#d({kind:`replace`,keys:this.#u([e]),source:n})?this.#n=e:this.#e.getModes().interactionMode!==`manual`&&this.replace(e))}#c(e,n){this.#e.isSelectable(e)&&(this.#d({kind:`toggle`,keys:this.#u([e]),source:n})||this.#e.getModes().interactionMode!==`manual`&&this.toggle(e))}#l(e,n){if(this.#e.getModes().selectionMode===`none`)return;let r=this.#n===void 0?void 0:this.#i(e),i=this.#n===void 0?void 0:this.#e.getKey?.(this.#n),a=this.#e.getKey?.(e);this.#d({kind:`extend`,keys:this.#u(r??[e]),...i===void 0?{}:{anchorKey:i},...a===void 0?{}:{targetKey:a},source:n})?this.#n===void 0&&(this.#n=e):this.#e.getModes().interactionMode!==`manual`&&this.rangeTo(e)}#u(e){let n=this.#e.getKey;if(!n)return[];let r=[];for(let i of e){let e=n(i);e!==void 0&&r.push(e)}return r}#d(e){return this.#e.onIntent?.(e)??!1}clearAnchor(){this.#n=void 0}remap(e){this.#t.size!==0&&(this.#t=new Set([...this.#t].map(e)))}reset(){this.demote([...this.#t]),this.#t=/* @__PURE__ */ new Set,this.#n=void 0}seed(e,n){this.#t=new Set(e),this.#n=n}#f(){return this.#e.getGroupKey!==void 0&&!(this.#e.crossGroupSelection?.()??!1)}#p(e){return this.#e.getGroupKey?.(e)??null}#m(e){if(!this.#f()||e.size===0)return new Set(e);let n=this.#e.getOrderedItems().find(n=>e.has(n))??[...e][0],r=this.#p(n);return new Set([...e].filter(e=>this.#p(e)===r))}#h(e,n=!1){n||(this.#r=O);let r=this.#t;this.#t=e,this.#e.onChange(e,r)}};const vr=`Partially selected`;function yr(e,n,r){return!r&&e!==void 0&&n.has(e)}function br(e,n){if(e.size!==n.size)return!1;for(let r of e)if(!n.has(r))return!1;return!0}function xr(e,n){e.toggleAttribute(`data-partial`,n),n?e.hasAttribute(`aria-description`)||e.setAttribute(`aria-description`,vr):e.getAttribute(`aria-description`)===`Partially selected`&&e.removeAttribute(`aria-description`)}const Sr=`data-scroll-hover-suppress`;function Cr(e){let{host:n,enabled:r,onResume:i}=e,a=!1,o=NaN,s=NaN,c=()=>{a&&(a=!1,n.toggleAttribute(Sr,!1))};return{suppressed:()=>a,onScroll:()=>{!a&&r()&&(a=!0,n.toggleAttribute(Sr,!0))},onPointerMove:e=>{let n=!Number.isNaN(o)&&(e.clientX!==o||e.clientY!==s);o=e.clientX,s=e.clientY,n&&a&&(c(),i?.(e.clientX,e.clientY))},onPointerLeave:c,end:c}}var wr=class{constructor(e,n,r){this.handleKeyDown=e=>{if(this.disableKeyboardNavigation())return;let{key:n}=e;switch([`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`,`Enter`,`Escape`].includes(n)&&this.tickled.setInputMode(`keyboard`),n){case`ArrowDown`:e.preventDefault(),this.#e();break;case`ArrowUp`:e.preventDefault(),this.#t();break;case`ArrowRight`:e.preventDefault(),this.#n();break;case`ArrowLeft`:e.preventDefault(),this.#r();break;case`Enter`:e.preventDefault(),this.#i();break;case`Escape`:e.preventDefault(),this.callbacks.onEscape?.()}},this.host=e,this.tickled=n,this.callbacks=r.callbacks,this.disableKeyboardNavigation=r.disableKeyboardNavigation??(()=>!1),e.addController(this)}hostConnected(){}hostDisconnected(){}#e(){this.tickled.handleKeyboardNavigation(`next`)}#t(){this.tickled.handleKeyboardNavigation(`previous`)}#n(){let e=this.tickled.tickledId;if(e&&!this.callbacks.isLeaf(e)){if(!this.callbacks.isExpanded(e))this.callbacks.onExpand(e),this.tickled.setTickled(e);else{let n=this.callbacks.getItems(),r=n.findIndex(n=>n.id===e);if(r!==-1&&r+1<n.length){let e=n[r+1];e.enabled!==!1&&this.tickled.setTickled(e.id)}}}}#r(){let e=this.tickled.tickledId;if(e){if(this.callbacks.isLeaf(e)){let n=this.callbacks.getParentId?.(e);n&&(this.tickled.setTickled(n),this.callbacks.isExpanded(n)&&this.callbacks.onCollapse(n))}else if(this.callbacks.isExpanded(e))this.callbacks.onCollapse(e);else{let n=this.callbacks.getParentId?.(e);n&&this.tickled.setTickled(n)}}}#i(){let e=this.tickled.tickledId;e&&(this.callbacks.onActivate(e),this.callbacks.onSelect?.(e))}};function Tr(e){let n=`scroll-fade-${e}`,i=`--${n}-start`,a=`--${n}-end`,o=`--${n}-timeline`,s=`${n}-fade`,l=e===`x`?`to right`:`to bottom`;return r`
|
|
2503
2503
|
@property ${c(i)} {
|
|
2504
2504
|
syntax: '<length>';
|
|
2505
2505
|
inherits: false;
|
|
@@ -2700,7 +2700,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
2700
2700
|
>
|
|
2701
2701
|
<slot name="menu" @slotchange=${this._handleSlotChange}></slot>
|
|
2702
2702
|
</div>
|
|
2703
|
-
`}};E([d({type:String,reflect:!0})],Or.prototype,`mode`,void 0),E([d({type:String})],Or.prototype,`label`,void 0),E([d({type:String,attribute:`icon-name`})],Or.prototype,`iconName`,void 0),E([d({attribute:!1})],Or.prototype,`registry`,void 0),E([d({attribute:!1})],Or.prototype,`keyboardManager`,void 0),E([d({type:String,reflect:!0})],Or.prototype,`placement`,void 0),E([d({type:Boolean,attribute:`tab-stop`})],Or.prototype,`tabStop`,void 0),E([m()],Or.prototype,`_isOpen`,void 0),E([m()],Or.prototype,`_hasMenu`,void 0),E([m()],Or.prototype,`_hasTriggerSlot`,void 0),E([m()],Or.prototype,`_hasContextTarget`,void 0),E([f(`.trigger-btn`)],Or.prototype,`_triggerBtn`,void 0),E([f(`.popup`)],Or.prototype,`_popup`,void 0),Or=Dr=E([T(`ixfx-menu-trigger`)],Or);function kr(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e instanceof HTMLElement?e:null}let Ar=class extends n{constructor(...e){super(...e),this.command=``,this.commandArgs=``,this.label=``,this.disabled=!1,this.iconName=``,this._hasChildren=!1,this._hoverTimeout=null}disconnectedCallback(){super.disconnectedCallback(),this._hoverTimeout&&clearTimeout(this._hoverTimeout)}_handleSlotChange(){let e=this._slot?.assignedElements()??[];this._hasChildren=e.length>0}_handleMouseEnter(){!this.disabled&&this._hasChildren&&this.submenuPopover&&(this._hoverTimeout&&clearTimeout(this._hoverTimeout),this._hoverTimeout=window.setTimeout(()=>{this._showSubmenu()},150))}_handleMouseLeave(){this._hoverTimeout&&=(clearTimeout(this._hoverTimeout),null),this._hideSubmenu()}_showSubmenu(){if(this.submenuPopover?.popover)try{this.submenuPopover.showPopover()}catch(e){console.warn(`showPopover failed:`,e)}}_hideSubmenu(){if(this.submenuPopover?.popover)try{this.submenuPopover.hidePopover()}catch(e){console.warn(`hidePopover failed:`,e)}}handleClick(){this.disabled||this.dispatchEvent(new CustomEvent(`command`,{detail:{command:this.command,args:this.commandArgs},bubbles:!0,composed:!0}))}_resolvedLabel(){return this.label?this.label:this.registry&&this.command?this.registry.
|
|
2703
|
+
`}};E([d({type:String,reflect:!0})],Or.prototype,`mode`,void 0),E([d({type:String})],Or.prototype,`label`,void 0),E([d({type:String,attribute:`icon-name`})],Or.prototype,`iconName`,void 0),E([d({attribute:!1})],Or.prototype,`registry`,void 0),E([d({attribute:!1})],Or.prototype,`keyboardManager`,void 0),E([d({type:String,reflect:!0})],Or.prototype,`placement`,void 0),E([d({type:Boolean,attribute:`tab-stop`})],Or.prototype,`tabStop`,void 0),E([m()],Or.prototype,`_isOpen`,void 0),E([m()],Or.prototype,`_hasMenu`,void 0),E([m()],Or.prototype,`_hasTriggerSlot`,void 0),E([m()],Or.prototype,`_hasContextTarget`,void 0),E([f(`.trigger-btn`)],Or.prototype,`_triggerBtn`,void 0),E([f(`.popup`)],Or.prototype,`_popup`,void 0),Or=Dr=E([T(`ixfx-menu-trigger`)],Or);function kr(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e instanceof HTMLElement?e:null}let Ar=class extends n{constructor(...e){super(...e),this.command=``,this.commandArgs=``,this.label=``,this.disabled=!1,this.iconName=``,this._hasChildren=!1,this._hoverTimeout=null}disconnectedCallback(){super.disconnectedCallback(),this._hoverTimeout&&clearTimeout(this._hoverTimeout)}_handleSlotChange(){let e=this._slot?.assignedElements()??[];this._hasChildren=e.length>0}_handleMouseEnter(){!this.disabled&&this._hasChildren&&this.submenuPopover&&(this._hoverTimeout&&clearTimeout(this._hoverTimeout),this._hoverTimeout=window.setTimeout(()=>{this._showSubmenu()},150))}_handleMouseLeave(){this._hoverTimeout&&=(clearTimeout(this._hoverTimeout),null),this._hideSubmenu()}_showSubmenu(){if(this.submenuPopover?.popover)try{this.submenuPopover.showPopover()}catch(e){console.warn(`showPopover failed:`,e)}}_hideSubmenu(){if(this.submenuPopover?.popover)try{this.submenuPopover.hidePopover()}catch(e){console.warn(`hidePopover failed:`,e)}}handleClick(){this.disabled||this.dispatchEvent(new CustomEvent(`command`,{detail:{command:this.command,args:this.commandArgs},bubbles:!0,composed:!0}))}_resolvedLabel(){return this.label?this.label:this.registry&&this.command?this.registry.getLabel(this.command,void 0)??``:``}_resolvedIcon(){return this.iconName?this.iconName:this.registry&&this.command?this.registry.get(this.command)?.icon??null:null}willUpdate(e){super.willUpdate(e);let n=this._resolvedIcon();n&&!this.iconName?this.setAttribute(`data-icon-section`,``):!n&&!this.iconName&&this.removeAttribute(`data-icon-section`)}updated(e){super.updated(e)}_getShortcut(){if(!this.keyboardManager||!this.command)return null;let e=(this.keyboardManager.getBindings?.()??[]).find(e=>e.commandId===this.command);if(!e)return null;let n=Array.from(e.modifiers??[],e=>({ctrl:`⌃`,shift:`⇧`,alt:`⌥`,meta:`⌘`})[e]??e),r=e.key?.length===1?e.key.toUpperCase():e.key;return[...n,r].join(``)}static{this.styles=[w,C,r`
|
|
2704
2704
|
:host {
|
|
2705
2705
|
display: block;
|
|
2706
2706
|
}
|
|
@@ -4488,108 +4488,108 @@ function Eg(e){return!(typeof e!=`object`||!(`h`in e)||!(`s`in e)||!(`l`in e)||!
|
|
|
4488
4488
|
user-select: none;
|
|
4489
4489
|
scroll-snap-align: start;
|
|
4490
4490
|
}
|
|
4491
|
-
`]}};E([d({type:Object})],V.prototype,`root`,void 0),E([d({attribute:!1})],V.prototype,`model`,void 0),E([d({type:Object})],V.prototype,`selectedNode`,void 0),E([m()],V.prototype,`_selectedNodes`,void 0),E([d({attribute:!1})],V.prototype,`loadChildren`,void 0),E([d({attribute:!1})],V.prototype,`filterPredicate`,void 0),E([d({reflect:!0,attribute:`exclusivity`})],V.prototype,`exclusivity`,void 0),E([d({reflect:!0,attribute:`selection-filter`})],V.prototype,`selectionFilter`,void 0),E([m()],V.prototype,`_openIdx`,void 0),E([m()],V.prototype,`_isFocused`,void 0),E([m()],V.prototype,`_menuOpen`,void 0),E([m()],V.prototype,`_focusOnNarrowedText`,void 0),E([d({reflect:!0,attribute:`input-mode`})],V.prototype,`inputMode`,void 0),E([d({type:Boolean,reflect:!0,attribute:`no-truncate`})],V.prototype,`noTruncate`,void 0),E([d({type:Boolean,reflect:!0,attribute:`show-suggestions`})],V.prototype,`showSuggestions`,void 0),E([d({type:Boolean,reflect:!0,attribute:`leading-caret`})],V.prototype,`leadingCaret`,void 0),E([d({type:Boolean,reflect:!0,attribute:`caret-embedded`})],V.prototype,`caretEmbedded`,void 0),E([d({type:Boolean,reflect:!0,attribute:`hide-root`})],V.prototype,`hideRoot`,void 0),E([d({type:Boolean,reflect:!0,attribute:`pad-ending`})],V.prototype,`padEnding`,void 0),E([d({type:Boolean,reflect:!0,attribute:`with-up`})],V.prototype,`withUp`,void 0),E([d({attribute:!1})],V.prototype,`restoreLoads`,void 0),V=E([T(`ixfx-crumb-navigation`)],V);var my=class{#e=null;#t;#n;#r;#i;constructor(e={}){this.#n=e.separator??`/`,this.#r=e.onQuery,this.#i=e.sortCompare,this.#t=new Hf.Pathed.Pathed({separator:this.#n}),e.paths&&this.addPaths(e.paths)}get separator(){return this.#n}addPath(e){let n=e.split(this.#n).filter(e=>e.length>0);for(let e=0;e<n.length;e++){let r=n.slice(0,e+1).join(this.#n),i={label:n[e]};this.#t.add(i,r)}}addPaths(e){for(let n of e)this.addPath(n)}addSegment(e,n){this.#t.add(e,n)}addSegments(e){for(let{path:n,segment:r}of e)this.addSegment(r,n)}getIcon(e){let n=this.#t.getValue(e);if(n!==void 0)return typeof n==`object`&&n&&`value`in n?n.value?.icon:n.icon}getPath(){return this.#e?.getPath()??``}setPath(e){this.#e?.setPath(e)}#a=e=>this.getIcon(e.join(this.#n));connect(e){this.#e=e,e.separator=this.#n,e.siblingLookup=this.#o.bind(this),e.segmentIconLookup||=this.#a}disconnect(){this.#e&&=(this.#e.siblingLookup=void 0,this.#e.segmentIconLookup===this.#a&&(this.#e.segmentIconLookup=void 0),null)}async#o(e,n,r){let i=e.join(this.#n),a=[...this.#t.children(i)];if(a.length>0){let e=a.map(e=>e.value).filter(e=>e!==void 0).map(e=>`value`in e?e.value??{label:e.label}:{label:e.label});return this.#i?[...e].sort(this.#i):e}if(this.#r){let n=await this.#r(e),a=this.#i?[...n].sort(this.#i):n;for(let e of a){let n=i.length>0?`${i}${this.#n}${e.label}`:e.label;this.#t.add(e,n)}return r.aborted?[]:a}return[]}};const hy=/[^\w-]/g;let gy=class extends n{constructor(...e){super(...e),this.path=``,this.separator=`/`,this.pathRoot=``,this.hintPrevious=!1,this._openIdx=null,this._editing=!1,this._cachedSiblings=/* @__PURE__ */ new Map,this._leafSegmentIndex=null,this._confirmedLeafIndices=/* @__PURE__ */ new Set,this._dropdownActiveIndex=-1,this._editingCancelled=!1,this._editStartIndex=null,this._openCumPath=null,this._dragCumPath=null,this._dropCumPath=null,this._hintSegments=null,this.#n=Math.random().toString(36).slice(2,8),this.#r=0,this.#o=e=>{e.newState===`closed`&&this._openIdx!==null&&(this._openIdx=null,this._dropdownActiveIndex=-1,this.#s())},this.#M=e=>{if(this._openIdx===null)return;let n=this._cachedSiblings.get(this._openCumPath??String(this._openIdx))??[];if(!n.length)e.key===`Escape`&&(e.preventDefault(),this.#a());else switch(e.key){case`ArrowDown`:e.preventDefault(),this._dropdownActiveIndex=(this._dropdownActiveIndex+1)%n.length,this.#N();break;case`ArrowUp`:e.preventDefault(),this._dropdownActiveIndex=this._dropdownActiveIndex<=0?n.length-1:this._dropdownActiveIndex-1,this.#N();break;case`Enter`:this._dropdownActiveIndex>=0&&(e.preventDefault(),this.#A(this._openIdx,n[this._dropdownActiveIndex]));break;case`Escape`:e.preventDefault(),this.#a()}},this.#K=e=>{this._editing||[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Enter`].includes(e.key)||(this._editing=!0)}}#e;#t;#n;#r;#i(e){return`--cp-${this.#n}-${e.replaceAll(this.separator,`-`).replaceAll(` `,`-`).replace(hy,`-`)}`}#a(){if(this._openIdx!==null){this._openIdx=null,this._openCumPath=null,this._dropdownActiveIndex=-1,this.#s();let e=this.shadowRoot?.querySelector(`.crumb-dropdown`);try{e?.hidePopover()}catch{}}}#o;updated(e){if(this._editing){let e=this.shadowRoot?.querySelector(`ixfx-ac-text`);if(e instanceof n){let n=this.path;if(this._editStartIndex!==null){let r=this.#c()[this._editStartIndex],i=this.path.indexOf(r);e.focusWithValue(n,i)}else e.focusWithValue(n)}}e.has(`_openIdx`)&&this._openIdx!==null&&this.updateComplete.then(()=>{let e=this.shadowRoot?.querySelector(`.crumb-dropdown`);if(e){e.style.setProperty(`position-anchor`,this.#i(this._openCumPath??String(this._openIdx)));try{e.showPopover()}catch{}e.focus()}})}#s(){this.#e&&(this.#e.abort(),this.#e=void 0,this.#t=void 0)}#c(){let e=this.path;return this.pathRoot.length>0&&e.startsWith(this.pathRoot)?e.slice(this.pathRoot.length).split(this.separator).filter(e=>e.length>0):this.path.split(this.separator).filter(e=>e.length>0)}#l(){return this.pathRoot.length===0?[]:this.pathRoot.split(this.separator).filter(e=>e.length>0)}#u(e,n){let r=this.#c(),i=this.#l();return n?i.slice(0,e+1).join(this.separator):[...i,...r.slice(0,e+1)].join(this.separator)}#d(e,n){let r=this.#l();return n?r.slice(0,e+1):[...r,...this.#c().slice(0,e+1)]}#f(e){try{let n=this.segmentDragLookup?.(e,e.length-1);return n==null?[]:Array.isArray(n)?[...n]:[n]}catch{return[]}}#p(){return Date.now()<this.#r||this._dragCumPath!==null}#m(e,n){return e.length<=n.length&&e.every((e,r)=>e===n[r])}#h(e,n){if(!this.hintPrevious)return;let r=this._hintSegments;r!==null&&this.#m(n,r)||(this._hintSegments=e)}#g(e,n){let r=this.segmentIconLookup?.(e,n);if(typeof r==`string`&&r.length>0)return r;let i=e[n];if(i===void 0)return;let a=e.slice(0,n).join(this.separator);return this._cachedSiblings.get(a)?.find(e=>e.label===i)?.icon}setPath(e){this.#s(),this.pathRoot.length>0&&!e.startsWith(this.pathRoot)&&(e=this.pathRoot),e!==this.path&&(this.path=e,this._cachedSiblings=/* @__PURE__ */ new Map,this._openIdx=null,this._leafSegmentIndex=null,this._confirmedLeafIndices=/* @__PURE__ */ new Set)}invalidateSiblings(){this._cachedSiblings=/* @__PURE__ */ new Map,this._leafSegmentIndex=null,this._confirmedLeafIndices=/* @__PURE__ */ new Set}getPath(){return this.path}#_(e,n){if(n.preventDefault(),n.stopPropagation(),this._openIdx===e){this.#a();return}let r=n.currentTarget.dataset.cumulative;this._openIdx=e,this._openCumPath=r??null,this._dropdownActiveIndex=-1;let i=this.#c(),a=this.#l(),o=r?r.split(this.separator).filter(e=>e.length>0):e===-1?a:i.slice(0,e+1),s=r??String(e);if(!this._cachedSiblings.has(s)&&this.siblingLookup){this.#s();let n=new AbortController;this.#e=n,this.#t=e,this.siblingLookup(o,e,n.signal).then(e=>{n.signal.aborted||(this._cachedSiblings.set(s,e),e.length===0&&this._confirmedLeafIndices.add(r??``),this.#e=void 0,this.#t=void 0,this.requestUpdate())}).catch(e=>{e.name!==`AbortError`&&console.error(`Sibling lookup failed:`,e),this.#e=void 0,this.#t=void 0}),this.dispatchEvent(new CustomEvent(`expand`,{detail:{index:e,segments:o,path:o.join(this.separator),signal:n.signal},bubbles:!0,composed:!0}))}this.requestUpdate()}#v(e,n,r){this.#a();let i=e.length-1,a=r.dataTransfer,o={index:i,label:e[i]??``,pathSegments:e,parentPath:e.slice(0,-1).join(this.separator),fullPath:e.join(this.separator),dataTransfer:a},s=new CustomEvent(`crumb-drag-start`,{detail:o,bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(s))r.preventDefault();else if(this._dragCumPath=n,this.toggleAttribute(`data-native-dragging`,!0),a){try{(a.effectAllowed===`none`||a.effectAllowed===`uninitialized`)&&(a.effectAllowed=`copyMove`)}catch{}try{for(let n of this.#f(e))a.setData(n.type,n.data);a.types.includes(`text/plain`)||a.setData(`text/plain`,o.fullPath)}catch{}}}#y(){this._dragCumPath=null,this._dropCumPath=null,this.toggleAttribute(`data-native-dragging`,!1),this.#r=Date.now()+150}#b(e,n){this.parseExternalDrop&&n.dataTransfer&&(n.preventDefault(),this._dropCumPath!==e&&(this._dropCumPath=e))}#x(e,n){this.parseExternalDrop&&this._dropCumPath===e&&(this._dropCumPath=null)}#S(e,n){if(!this.parseExternalDrop)return;n.preventDefault(),n.stopPropagation(),this._dropCumPath=null;let r=n.dataTransfer;if(!r)return;let i;try{i=this.parseExternalDrop(r)}catch(e){console.error(`parseExternalDrop failed:`,e);return}if(i===void 0)return;let a=e.length-1;this.dispatchEvent(new CustomEvent(`crumb-drop`,{detail:{index:a,label:e[a]??``,pathSegments:e,parentPath:e.slice(0,-1).join(this.separator),fullPath:e.join(this.separator),data:i,dataTransfer:r},bubbles:!0,composed:!0}))}#C(){let e=this.#c();if(e.length>0){let n=e.length-1;return{cumPath:this.#u(n,!1),fullPathSegments:this.#d(n,!1)}}let n=this.#l();if(n.length>0){let e=n.length-1;return{cumPath:this.#u(e,!0),fullPathSegments:this.#d(e,!0)}}}#w(e){return!!e.target?.closest?.(`.seg:not(.seg-virtual)`)}#T(e){if(!this.parseExternalDrop||!e.dataTransfer||this.#w(e))return;let n=this.#C();n&&(e.preventDefault(),this._dropCumPath!==n.cumPath&&(this._dropCumPath=n.cumPath))}#E(e){if(!this.parseExternalDrop||this.#w(e))return;let n=this.#C();n&&this._dropCumPath===n.cumPath&&(this._dropCumPath=null)}#D(e){if(!this.parseExternalDrop||this.#w(e))return;let n=this.#C();n&&this.#S(n.fullPathSegments,e)}#O(e,n){if(this.#p())return;n.preventDefault(),n.stopPropagation(),this.#a();let r=this.#c(),i=r.slice(0,e+1);this.#h(r,i);let a=this.path.startsWith(this.separator),o=i.join(this.separator);this.path=a?this.separator+o:o,this._cachedSiblings=/* @__PURE__ */ new Map,this._leafSegmentIndex=null;let s=i.slice(0,-1).join(this.separator);this.dispatchEvent(new CustomEvent(`navigate`,{detail:{index:e,label:i[e],parentPath:s,fullPath:o},bubbles:!0,composed:!0}))}#k(e,n){if(this.#p())return;n.preventDefault(),n.stopPropagation(),this.#a();let r=this._hintSegments;if(!r)return;let i=r.slice(0,e+1),a=this.path.startsWith(this.separator),o=i.join(this.separator);this.path=a?this.separator+o:o,this._cachedSiblings=/* @__PURE__ */ new Map,this._leafSegmentIndex=null;let s=i.slice(0,-1).join(this.separator);this.dispatchEvent(new CustomEvent(`navigate`,{detail:{index:e,label:i[e],parentPath:s,fullPath:o},bubbles:!0,composed:!0}))}#A(e,n){let r=this._openCumPath;this.#a();let i=this.#c(),a=this.#l(),o;o=r?[...r.split(this.separator).filter(e=>e.length>0),n.label]:this.pathRoot.length>0&&e<a.length?[...a.slice(0,e+1),n.label]:[...a,...i.slice(0,e+1-a.length),n.label];let s=this.path.startsWith(this.separator),c=o.join(this.separator);this.path=s?this.separator+c:c,this._cachedSiblings=/* @__PURE__ */ new Map;let l=n.isLeaf?o.length-1:null;this._leafSegmentIndex=l,n.isLeaf&&this._confirmedLeafIndices.add(r??``);let u=o.slice(0,-1).join(this.separator);this.dispatchEvent(new CustomEvent(`navigate`,{detail:{index:e,label:n.label,parentPath:u,fullPath:c},bubbles:!0,composed:!0}))}#j(e,n,r){r.preventDefault(),r.stopPropagation(),this.#A(e,n)}#M;#N(){this.updateComplete.then(()=>{this.shadowRoot?.querySelector(`.crumb-option.active`)?.scrollIntoView({block:`nearest`})})}#P(e){let n=this._cachedSiblings.get(this._openCumPath??String(e))??[],r=this.#t===e;return i`
|
|
4491
|
+
`]}};E([d({type:Object})],V.prototype,`root`,void 0),E([d({attribute:!1})],V.prototype,`model`,void 0),E([d({type:Object})],V.prototype,`selectedNode`,void 0),E([m()],V.prototype,`_selectedNodes`,void 0),E([d({attribute:!1})],V.prototype,`loadChildren`,void 0),E([d({attribute:!1})],V.prototype,`filterPredicate`,void 0),E([d({reflect:!0,attribute:`exclusivity`})],V.prototype,`exclusivity`,void 0),E([d({reflect:!0,attribute:`selection-filter`})],V.prototype,`selectionFilter`,void 0),E([m()],V.prototype,`_openIdx`,void 0),E([m()],V.prototype,`_isFocused`,void 0),E([m()],V.prototype,`_menuOpen`,void 0),E([m()],V.prototype,`_focusOnNarrowedText`,void 0),E([d({reflect:!0,attribute:`input-mode`})],V.prototype,`inputMode`,void 0),E([d({type:Boolean,reflect:!0,attribute:`no-truncate`})],V.prototype,`noTruncate`,void 0),E([d({type:Boolean,reflect:!0,attribute:`show-suggestions`})],V.prototype,`showSuggestions`,void 0),E([d({type:Boolean,reflect:!0,attribute:`leading-caret`})],V.prototype,`leadingCaret`,void 0),E([d({type:Boolean,reflect:!0,attribute:`caret-embedded`})],V.prototype,`caretEmbedded`,void 0),E([d({type:Boolean,reflect:!0,attribute:`hide-root`})],V.prototype,`hideRoot`,void 0),E([d({type:Boolean,reflect:!0,attribute:`pad-ending`})],V.prototype,`padEnding`,void 0),E([d({type:Boolean,reflect:!0,attribute:`with-up`})],V.prototype,`withUp`,void 0),E([d({attribute:!1})],V.prototype,`restoreLoads`,void 0),V=E([T(`ixfx-crumb-navigation`)],V);var my=class{#e=null;#t;#n;#r;#i;constructor(e={}){this.#n=e.separator??`/`,this.#r=e.onQuery,this.#i=e.sortCompare,this.#t=new Hf.Pathed.Pathed({separator:this.#n}),e.paths&&this.addPaths(e.paths)}get separator(){return this.#n}addPath(e){let n=e.split(this.#n).filter(e=>e.length>0);for(let e=0;e<n.length;e++){let r=n.slice(0,e+1).join(this.#n),i={label:n[e]};this.#t.add(i,r)}}addPaths(e){for(let n of e)this.addPath(n)}addSegment(e,n){this.#t.add(e,n)}addSegments(e){for(let{path:n,segment:r}of e)this.addSegment(r,n)}getIcon(e){let n=this.#t.getValue(e);if(n!==void 0)return typeof n==`object`&&n&&`value`in n?n.value?.icon:n.icon}getPath(){return this.#e?.getPath()??``}setPath(e){this.#e?.setPath(e)}#a=e=>this.getIcon(e.join(this.#n));connect(e){this.#e=e,e.separator=this.#n,e.siblingLookup=this.#o.bind(this),e.segmentIconLookup||=this.#a}disconnect(){this.#e&&=(this.#e.siblingLookup=void 0,this.#e.segmentIconLookup===this.#a&&(this.#e.segmentIconLookup=void 0),null)}async#o(e,n,r){let i=e.join(this.#n),a=[...this.#t.children(i)];if(a.length>0){let e=a.map(e=>e.value).filter(e=>e!==void 0).map(e=>`value`in e?e.value??{label:e.label}:{label:e.label});return this.#i?[...e].sort(this.#i):e}if(this.#r){let n=await this.#r(e),a=this.#i?[...n].sort(this.#i):n;for(let e of a){let n=i.length>0?`${i}${this.#n}${e.label}`:e.label;this.#t.add(e,n)}return r.aborted?[]:a}return[]}};const hy=/[^\w-]/g;let gy=class extends n{constructor(...e){super(...e),this.path=``,this.separator=`/`,this.pathRoot=``,this.hintPrevious=!1,this._openIdx=null,this._editing=!1,this._cachedSiblings=/* @__PURE__ */ new Map,this._leafSegmentIndex=null,this._confirmedLeafIndices=/* @__PURE__ */ new Set,this._dropdownActiveIndex=-1,this._editingCancelled=!1,this._editStartIndex=null,this._openCumPath=null,this._dragCumPath=null,this._dropCumPath=null,this._hintSegments=null,this.#n=Math.random().toString(36).slice(2,8),this.#r=0,this.#i=[],this.#s=e=>{e.newState===`closed`&&this._openIdx!==null&&(this._openIdx=null,this._dropdownActiveIndex=-1,this.#c())},this.#F=e=>{if(this._openIdx===null)return;let n=this._cachedSiblings.get(this._openCumPath??String(this._openIdx))??[];if(!n.length)e.key===`Escape`&&(e.preventDefault(),this.#o());else switch(e.key){case`ArrowDown`:e.preventDefault(),this._dropdownActiveIndex=(this._dropdownActiveIndex+1)%n.length,this.#I();break;case`ArrowUp`:e.preventDefault(),this._dropdownActiveIndex=this._dropdownActiveIndex<=0?n.length-1:this._dropdownActiveIndex-1,this.#I();break;case`Enter`:this._dropdownActiveIndex>=0&&(e.preventDefault(),this.#N(this._openIdx,n[this._dropdownActiveIndex]));break;case`Escape`:e.preventDefault(),this.#o()}},this.#X=e=>{this._editing||[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Enter`].includes(e.key)||(this._editing=!0)}}#e;#t;#n;#r;#i;#a(e){return`--cp-${this.#n}-${e.replaceAll(``,`-`).replaceAll(this.separator,`-`).replaceAll(` `,`-`).replace(hy,`-`)}`}#o(){if(this._openIdx!==null){this._openIdx=null,this._openCumPath=null,this._dropdownActiveIndex=-1,this.#c();let e=this.shadowRoot?.querySelector(`.crumb-dropdown`);try{e?.hidePopover()}catch{}}}#s;updated(e){if(this._editing){let e=this.shadowRoot?.querySelector(`ixfx-ac-text`);if(e instanceof n){let n=this.path;if(this._editStartIndex!==null){let r=this.#u()[this._editStartIndex],i=this.path.indexOf(r);e.focusWithValue(n,i)}else e.focusWithValue(n)}}e.has(`_openIdx`)&&this._openIdx!==null&&this.updateComplete.then(()=>{let e=this.shadowRoot?.querySelector(`.crumb-dropdown`);if(e){e.style.setProperty(`position-anchor`,this.#a(this._openCumPath??String(this._openIdx)));try{e.showPopover()}catch{}e.focus()}})}#c(){this.#e&&(this.#e.abort(),this.#e=void 0,this.#t=void 0)}willUpdate(e){if(e.has(`segments`)&&this.segments!==void 0){let e=this.segments.map(e=>e.label).join(this.separator);e!==this.path&&(this.path=e)}}getSegments(){return this.segments?this.segments.map(e=>({...e})):this.#u().map(e=>({label:e}))}#l(e,n,r){let i=e.join(this.separator);if(this.segments===void 0)return this.path=n?this.separator+i:i,i;let a=this.segments;return this.segments=e.map((n,i)=>{let o=a[i]?.label===n?a[i].value:this.#i[i];return i===e.length-1&&r!==void 0&&(o=r),o===void 0?{label:n}:{label:n,value:o}}),this.path=i,i}#u(){if(this.segments)return this.segments.map(e=>e.label);let e=this.path;return this.pathRoot.length>0&&e.startsWith(this.pathRoot)?e.slice(this.pathRoot.length).split(this.separator).filter(e=>e.length>0):this.path.split(this.separator).filter(e=>e.length>0)}#d(){return this.pathRoot.length===0?[]:this.pathRoot.split(this.separator).filter(e=>e.length>0)}#f(e,n){let r=this.#u(),i=this.#d();return n?i.slice(0,e+1).join(``):[...i,...r.slice(0,e+1)].join(``)}#p(e,n){let r=this.#d();return n?r.slice(0,e+1):[...r,...this.#u().slice(0,e+1)]}#m(e){try{let n=this.segmentDragLookup?.(e,e.length-1);return n==null?[]:Array.isArray(n)?[...n]:[n]}catch{return[]}}#h(){return Date.now()<this.#r||this._dragCumPath!==null}#g(e,n){return e.length<=n.length&&e.every((e,r)=>e===n[r])}#_(e,n){if(!this.hintPrevious)return;let r=this._hintSegments;r!==null&&this.#g(n,r)||(this._hintSegments=e,this.#i=this.segments?.map(e=>e.value)??[])}#v(e,n){let r=this.segmentIconLookup?.(e,n);if(typeof r==`string`&&r.length>0)return r;let i=e[n];if(i===void 0)return;let a=e.slice(0,n).join(``);return this._cachedSiblings.get(a)?.find(e=>e.label===i)?.icon}setPath(e){if(this.#c(),this.pathRoot.length>0&&!e.startsWith(this.pathRoot)&&(e=this.pathRoot),e!==this.path||this.segments!==void 0){if(this.segments!==void 0){let n=e.split(this.separator).filter(e=>e.length>0);if(n.join(this.separator)===this.path)return;this.#l(n,!1)}else this.path=e;this._cachedSiblings=/* @__PURE__ */ new Map,this._openIdx=null,this._leafSegmentIndex=null,this._confirmedLeafIndices=/* @__PURE__ */ new Set}}invalidateSiblings(){this._cachedSiblings=/* @__PURE__ */ new Map,this._leafSegmentIndex=null,this._confirmedLeafIndices=/* @__PURE__ */ new Set}getPath(){return this.path}#y(){return this.segments?{segments:this.getSegments()}:{}}#b(e,n){if(n.preventDefault(),n.stopPropagation(),this._openIdx===e){this.#o();return}let r=n.currentTarget.dataset.cumulative;this._openIdx=e,this._openCumPath=r??null,this._dropdownActiveIndex=-1;let i=this.#u(),a=this.#d(),o=r?r.split(``).filter(e=>e.length>0):e===-1?a:i.slice(0,e+1),s=r??String(e);if(!this._cachedSiblings.has(s)&&this.siblingLookup){this.#c();let n=new AbortController;this.#e=n,this.#t=e,this.siblingLookup(o,e,n.signal).then(e=>{n.signal.aborted||(this._cachedSiblings.set(s,e),e.length===0&&this._confirmedLeafIndices.add(r??``),this.#e=void 0,this.#t=void 0,this.requestUpdate())}).catch(e=>{e.name!==`AbortError`&&console.error(`Sibling lookup failed:`,e),this.#e=void 0,this.#t=void 0}),this.dispatchEvent(new CustomEvent(`expand`,{detail:{index:e,segments:o,path:o.join(this.separator),signal:n.signal},bubbles:!0,composed:!0}))}this.requestUpdate()}#x(e,n,r){this.#o();let i=e.length-1,a=r.dataTransfer,o={index:i,label:e[i]??``,pathSegments:e,parentPath:e.slice(0,-1).join(this.separator),fullPath:e.join(this.separator),dataTransfer:a},s=new CustomEvent(`crumb-drag-start`,{detail:o,bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(s))r.preventDefault();else if(this._dragCumPath=n,this.toggleAttribute(`data-native-dragging`,!0),a){try{(a.effectAllowed===`none`||a.effectAllowed===`uninitialized`)&&(a.effectAllowed=`copyMove`)}catch{}try{for(let n of this.#m(e))a.setData(n.type,n.data);a.types.includes(`text/plain`)||a.setData(`text/plain`,o.fullPath)}catch{}}}#S(){this._dragCumPath=null,this._dropCumPath=null,this.toggleAttribute(`data-native-dragging`,!1),this.#r=Date.now()+150}#C(e,n){this.parseExternalDrop&&n.dataTransfer&&(n.preventDefault(),this._dropCumPath!==e&&(this._dropCumPath=e))}#w(e,n){this.parseExternalDrop&&this._dropCumPath===e&&(this._dropCumPath=null)}#T(e,n){if(!this.parseExternalDrop)return;n.preventDefault(),n.stopPropagation(),this._dropCumPath=null;let r=n.dataTransfer;if(!r)return;let i;try{i=this.parseExternalDrop(r)}catch(e){console.error(`parseExternalDrop failed:`,e);return}if(i===void 0)return;let a=e.length-1;this.dispatchEvent(new CustomEvent(`crumb-drop`,{detail:{index:a,label:e[a]??``,pathSegments:e,parentPath:e.slice(0,-1).join(this.separator),fullPath:e.join(this.separator),data:i,dataTransfer:r},bubbles:!0,composed:!0}))}#E(){let e=this.#u();if(e.length>0){let n=e.length-1;return{cumPath:this.#f(n,!1),fullPathSegments:this.#p(n,!1)}}let n=this.#d();if(n.length>0){let e=n.length-1;return{cumPath:this.#f(e,!0),fullPathSegments:this.#p(e,!0)}}}#D(e){return!!e.target?.closest?.(`.seg:not(.seg-virtual)`)}#O(e){if(!this.parseExternalDrop||!e.dataTransfer||this.#D(e))return;let n=this.#E();n&&(e.preventDefault(),this._dropCumPath!==n.cumPath&&(this._dropCumPath=n.cumPath))}#k(e){if(!this.parseExternalDrop||this.#D(e))return;let n=this.#E();n&&this._dropCumPath===n.cumPath&&(this._dropCumPath=null)}#A(e){if(!this.parseExternalDrop||this.#D(e))return;let n=this.#E();n&&this.#T(n.fullPathSegments,e)}#j(e,n){if(this.#h())return;n.preventDefault(),n.stopPropagation(),this.#o();let r=this.#u(),i=r.slice(0,e+1);this.#_(r,i);let a=this.path.startsWith(this.separator),o=this.#l(i,a);this._cachedSiblings=/* @__PURE__ */ new Map,this._leafSegmentIndex=null;let s=i.slice(0,-1).join(this.separator);this.dispatchEvent(new CustomEvent(`navigate`,{detail:{index:e,label:i[e],parentPath:s,fullPath:o,...this.#y()},bubbles:!0,composed:!0}))}#M(e,n){if(this.#h())return;n.preventDefault(),n.stopPropagation(),this.#o();let r=this._hintSegments;if(!r)return;let i=r.slice(0,e+1),a=this.path.startsWith(this.separator),o=this.#l(i,a);this._cachedSiblings=/* @__PURE__ */ new Map,this._leafSegmentIndex=null;let s=i.slice(0,-1).join(this.separator);this.dispatchEvent(new CustomEvent(`navigate`,{detail:{index:e,label:i[e],parentPath:s,fullPath:o,...this.#y()},bubbles:!0,composed:!0}))}#N(e,n){let r=this._openCumPath;this.#o();let i=this.#u(),a=this.#d(),o;o=r?[...r.split(``).filter(e=>e.length>0),n.label]:this.pathRoot.length>0&&e<a.length?[...a.slice(0,e+1),n.label]:[...a,...i.slice(0,e+1-a.length),n.label];let s=this.path.startsWith(this.separator),c=this.#l(o,s,n.value);this._cachedSiblings=/* @__PURE__ */ new Map;let l=n.isLeaf?o.length-1:null;this._leafSegmentIndex=l,n.isLeaf&&this._confirmedLeafIndices.add(r??``);let u=o.slice(0,-1).join(this.separator);this.dispatchEvent(new CustomEvent(`navigate`,{detail:{index:e,label:n.label,parentPath:u,fullPath:c,...this.#y()},bubbles:!0,composed:!0}))}#P(e,n,r){r.preventDefault(),r.stopPropagation(),this.#N(e,n)}#F;#I(){this.updateComplete.then(()=>{this.shadowRoot?.querySelector(`.crumb-option.active`)?.scrollIntoView({block:`nearest`})})}#L(e){let n=this._cachedSiblings.get(this._openCumPath??String(e))??[],r=this.#t===e;return i`
|
|
4492
4492
|
${r?i`<span class="loading-spinner"></span>`:a}
|
|
4493
4493
|
${n.length===0&&!r?i`<span class="crumb-option crumb-option-label">No items</span>`:n.map((n,r)=>i`
|
|
4494
4494
|
<div class="crumb-option ${r===this._dropdownActiveIndex?`active`:``}"
|
|
4495
|
-
@click=${r=>this.#
|
|
4495
|
+
@click=${r=>this.#P(e,n,r)}>
|
|
4496
4496
|
${n.icon?i`<ixfx-icon class="crumb-icon" name="${n.icon}"></ixfx-icon>`:a}
|
|
4497
4497
|
<span class="option-label">${n.label}</span>
|
|
4498
4498
|
</div>
|
|
4499
4499
|
`)}
|
|
4500
|
-
`}#
|
|
4500
|
+
`}#R(e,n,r){let o=this._openIdx===n,s=this.#f(n,!1),c=this.#p(n,!1),l=this.#v(c,c.length-1),u=this.#m(c).length>0,d=this._dragCumPath===s,f=this._dropCumPath===s;return i`
|
|
4501
4501
|
<div class="seg ${d?`dragging`:``} ${f?`drop-into`:``}"
|
|
4502
4502
|
part=${f?`segment drop-target`:`segment`}
|
|
4503
4503
|
data-cumulative=${s}
|
|
4504
|
-
@click=${e=>this.#
|
|
4505
|
-
@dragover=${e=>this.#
|
|
4506
|
-
@dragleave=${e=>this.#
|
|
4507
|
-
@drop=${e=>this.#
|
|
4504
|
+
@click=${e=>this.#H(n,e)}
|
|
4505
|
+
@dragover=${e=>this.#C(s,e)}
|
|
4506
|
+
@dragleave=${e=>this.#w(s,e)}
|
|
4507
|
+
@drop=${e=>this.#T(c,e)}>
|
|
4508
4508
|
<label title=${e}
|
|
4509
4509
|
part="label"
|
|
4510
4510
|
draggable=${u?`true`:`false`}
|
|
4511
|
-
@click=${e=>this.#
|
|
4512
|
-
@dragstart=${e=>this.#
|
|
4513
|
-
@dragend=${()=>this.#
|
|
4511
|
+
@click=${e=>this.#j(n,e)}
|
|
4512
|
+
@dragstart=${e=>this.#x(c,s,e)}
|
|
4513
|
+
@dragend=${()=>this.#S()}>
|
|
4514
4514
|
${l?i`<ixfx-icon class="crumb-icon segment-icon" name=${l}></ixfx-icon>`:a}
|
|
4515
4515
|
${e}
|
|
4516
4516
|
</label>
|
|
4517
4517
|
${(!r||this.siblingLookup)&&this._leafSegmentIndex!==n?i`
|
|
4518
4518
|
<div class="caret ${o?`open`:``} ${this._confirmedLeafIndices.has(s)?`disabled`:``}"
|
|
4519
4519
|
part="caret"
|
|
4520
|
-
style="anchor-name: ${this.#
|
|
4520
|
+
style="anchor-name: ${this.#a(s)}"
|
|
4521
4521
|
data-cumulative=${s}
|
|
4522
|
-
@click=${e=>this.#
|
|
4522
|
+
@click=${e=>this.#b(n,e)}>
|
|
4523
4523
|
${this.separator}
|
|
4524
4524
|
</div>
|
|
4525
4525
|
`:a}
|
|
4526
4526
|
</div>
|
|
4527
|
-
`}#
|
|
4527
|
+
`}#z(e,n){let r=[...this.#d(),...(this._hintSegments??[]).slice(0,n+1)],o=this.#v(r,r.length-1);return i`
|
|
4528
4528
|
<div class="seg seg-virtual" part="segment virtual">
|
|
4529
4529
|
<label title=${e}
|
|
4530
4530
|
part="label"
|
|
4531
|
-
@click=${e=>this.#
|
|
4531
|
+
@click=${e=>this.#M(n,e)}>
|
|
4532
4532
|
${o?i`<ixfx-icon class="crumb-icon segment-icon" name=${o}></ixfx-icon>`:a}
|
|
4533
4533
|
${e}
|
|
4534
4534
|
</label>
|
|
4535
4535
|
</div>
|
|
4536
|
-
`}#
|
|
4536
|
+
`}#B(e,n){let r=n===this.#d().length-1,o=this._openIdx===n,s=this.#f(n,!0),c=this.#p(n,!0),l=this.#v(c,n),u=this.#m(c).length>0,d=this._dragCumPath===s,f=this._dropCumPath===s;return i`
|
|
4537
4537
|
<div class="seg seg-root ${d?`dragging`:``} ${f?`drop-into`:``}"
|
|
4538
4538
|
part=${f?`segment drop-target`:`segment`}
|
|
4539
4539
|
data-cumulative=${s}
|
|
4540
|
-
@click=${e=>this.#
|
|
4541
|
-
@dragover=${e=>this.#
|
|
4542
|
-
@dragleave=${e=>this.#
|
|
4543
|
-
@drop=${e=>this.#
|
|
4540
|
+
@click=${e=>this.#V(n,e)}
|
|
4541
|
+
@dragover=${e=>this.#C(s,e)}
|
|
4542
|
+
@dragleave=${e=>this.#w(s,e)}
|
|
4543
|
+
@drop=${e=>this.#T(c,e)}>
|
|
4544
4544
|
<label title=${e}
|
|
4545
4545
|
part="label"
|
|
4546
4546
|
draggable=${u?`true`:`false`}
|
|
4547
|
-
@click=${e=>this.#
|
|
4548
|
-
@dragstart=${e=>this.#
|
|
4549
|
-
@dragend=${()=>this.#
|
|
4547
|
+
@click=${e=>this.#j(n,e)}
|
|
4548
|
+
@dragstart=${e=>this.#x(c,s,e)}
|
|
4549
|
+
@dragend=${()=>this.#S()}>${l?i`<ixfx-icon class="crumb-icon segment-icon" name=${l}></ixfx-icon>`:a}${e}</label>
|
|
4550
4550
|
${r&&this.siblingLookup?i`
|
|
4551
4551
|
<div class="caret ${o?`open`:``} ${this._confirmedLeafIndices.has(s)?`disabled`:``}"
|
|
4552
4552
|
part="caret"
|
|
4553
|
-
style="anchor-name: ${this.#
|
|
4553
|
+
style="anchor-name: ${this.#a(s)}"
|
|
4554
4554
|
data-cumulative=${s}
|
|
4555
|
-
@click=${e=>this.#
|
|
4555
|
+
@click=${e=>this.#b(n,e)}>
|
|
4556
4556
|
${this.separator}
|
|
4557
4557
|
</div>
|
|
4558
4558
|
`:a}
|
|
4559
4559
|
</div>
|
|
4560
|
-
`}#
|
|
4560
|
+
`}#V(e,n){if(this.#h())return;n.preventDefault(),n.stopPropagation();let r=this.#d().slice(0,e+1).join(this.separator);this.setPath(r)}#H(e,n){this.#h()||(n.preventDefault(),n.stopPropagation(),this.#o(),this._editing=!0,this._editStartIndex=e)}#U(){this.#h()||(this.#o(),this._editing=!0,this._editStartIndex=null)}#W(){return async(e,n)=>{if(!this.siblingLookup)return[];let r=e.endsWith(this.separator),i=e.split(this.separator).filter(e=>e.length>0),a=r?i:i.slice(0,-1),o=r?``:i.at(-1)??``,s=e.startsWith(this.separator);return(await this.siblingLookup(a,a.length-1,n)).filter(e=>e.label.toLowerCase().startsWith(o.toLowerCase())).map(e=>{let n=[...a,e.label].join(this.separator);return{label:s?this.separator+n:n,icon:e.icon,isLeaf:e.isLeaf}})}}#G(e){e.stopPropagation();let n=e.detail.value;this.#q(n),this._cachedSiblings=/* @__PURE__ */ new Map,this._leafSegmentIndex=n.endsWith(this.separator)?null:n.split(this.separator).filter(e=>e.length>0).length-1,this._editing=!1,this._editingCancelled=!1,this._editStartIndex=null,this.#J(n)}#K(){if(this._editing){if(this._editing=!1,!this._editingCancelled){let e=this.shadowRoot?.querySelector(`ixfx-ac-text`)?.value??this.path;e!==this.path&&(this.#q(e),this._cachedSiblings=/* @__PURE__ */ new Map,this._leafSegmentIndex=e.endsWith(this.separator)?null:e.split(this.separator).filter(e=>e.length>0).length-1,this.#J(e))}this._editingCancelled=!1,this._editStartIndex=null}}#q(e){this.segments===void 0?this.path=e:this.#l(e.split(this.separator).filter(e=>e.length>0),!1)}#J(e){let n=this.segments?this.segments.map(e=>e.label):e.split(this.separator).filter(e=>e.length>0),r=n.at(-1)??``,i=n.slice(0,-1).join(this.separator);this.dispatchEvent(new CustomEvent(`change`,{detail:{label:r,parentPath:i,fullPath:e,...this.#y()},bubbles:!0,composed:!0}))}#Y(e){e.key===`Escape`&&(this._editingCancelled=!0,this._editing=!1,this._editStartIndex=null)}#X;render(){let e=this.#u(),n=this.hintPrevious?this._hintSegments:null,r=n!==null&&n.length>e.length&&this.#g(e,n)?n.slice(e.length):[];if(this._editing){let e=this.path;return i`
|
|
4561
4561
|
<ixfx-ac-text
|
|
4562
4562
|
.value=${e}
|
|
4563
4563
|
.tabSuffix=${this.separator}
|
|
4564
|
-
.completionProvider=${this.#
|
|
4565
|
-
@change=${this.#
|
|
4566
|
-
@focusout=${this.#
|
|
4567
|
-
@keydown=${this.#
|
|
4564
|
+
.completionProvider=${this.#W()}
|
|
4565
|
+
@change=${this.#G}
|
|
4566
|
+
@focusout=${this.#K}
|
|
4567
|
+
@keydown=${this.#Y}
|
|
4568
4568
|
></ixfx-ac-text>
|
|
4569
|
-
`}let o=this.#
|
|
4569
|
+
`}let o=this.#d(),s=this.siblingLookup&&o.length===0?i`
|
|
4570
4570
|
<div class="caret ${this._openIdx===-1?`open`:``} ${this._confirmedLeafIndices.has(``)?`disabled`:``}"
|
|
4571
|
-
style="anchor-name: ${this.#
|
|
4571
|
+
style="anchor-name: ${this.#a(``)}"
|
|
4572
4572
|
data-cumulative=""
|
|
4573
|
-
@click=${e=>this.#
|
|
4573
|
+
@click=${e=>this.#b(-1,e)}>
|
|
4574
4574
|
${this.separator}
|
|
4575
4575
|
</div>`:a;return i`
|
|
4576
4576
|
<div class="crumbs scroll-fade-x" tabindex="0"
|
|
4577
|
-
@keydown=${this.#
|
|
4578
|
-
@dragover=${e=>this.#
|
|
4579
|
-
@dragleave=${e=>this.#
|
|
4580
|
-
@drop=${e=>this.#
|
|
4581
|
-
${o.length>0?o.map((e,n)=>this.#
|
|
4577
|
+
@keydown=${this.#X}
|
|
4578
|
+
@dragover=${e=>this.#O(e)}
|
|
4579
|
+
@dragleave=${e=>this.#k(e)}
|
|
4580
|
+
@drop=${e=>this.#A(e)}>
|
|
4581
|
+
${o.length>0?o.map((e,n)=>this.#B(e,n)):a}
|
|
4582
4582
|
${s}
|
|
4583
|
-
${e.map((n,r)=>this.#
|
|
4584
|
-
${r.map((n,r)=>this.#
|
|
4585
|
-
<div class="trailing" @click=${this.#
|
|
4583
|
+
${e.map((n,r)=>this.#R(n,r,r===e.length-1))}
|
|
4584
|
+
${r.map((n,r)=>this.#z(n,e.length+r))}
|
|
4585
|
+
<div class="trailing" @click=${this.#U}></div>
|
|
4586
4586
|
</div>
|
|
4587
4587
|
${this._openIdx===null?a:i`
|
|
4588
4588
|
<div class="crumb-dropdown popup-surface" popover="auto" tabindex="-1"
|
|
4589
|
-
@toggle=${this.#
|
|
4590
|
-
@keydown=${this.#
|
|
4589
|
+
@toggle=${this.#s}
|
|
4590
|
+
@keydown=${this.#F}
|
|
4591
4591
|
@click=${e=>e.stopPropagation()}>
|
|
4592
|
-
${this.#
|
|
4592
|
+
${this.#L(this._openIdx)}
|
|
4593
4593
|
</div>
|
|
4594
4594
|
`}
|
|
4595
4595
|
`}static{this.styles=[dn,w,de,Tr(`x`),r`
|
|
@@ -4791,7 +4791,7 @@ function Eg(e){return!(typeof e!=`object`||!(`h`in e)||!(`s`in e)||!(`l`in e)||!
|
|
|
4791
4791
|
@keyframes crumb-spin {
|
|
4792
4792
|
to { transform: rotate(360deg); }
|
|
4793
4793
|
}
|
|
4794
|
-
`]}};E([d({type:String})],gy.prototype,`path`,void 0),E([d({type:String})],gy.prototype,`separator`,void 0),E([d({type:String,attribute:`path-root`})],gy.prototype,`pathRoot`,void 0),E([d({type:Object})],gy.prototype,`siblingLookup`,void 0),E([d({type:Object})],gy.prototype,`segmentIconLookup`,void 0),E([d({type:Object})],gy.prototype,`segmentDragLookup`,void 0),E([d({type:Object})],gy.prototype,`parseExternalDrop`,void 0),E([d({type:Boolean,attribute:`hint-previous`})],gy.prototype,`hintPrevious`,void 0),E([m()],gy.prototype,`_openIdx`,void 0),E([m()],gy.prototype,`_editing`,void 0),E([m()],gy.prototype,`_cachedSiblings`,void 0),E([m()],gy.prototype,`_leafSegmentIndex`,void 0),E([m()],gy.prototype,`_confirmedLeafIndices`,void 0),E([m()],gy.prototype,`_dropdownActiveIndex`,void 0),E([m()],gy.prototype,`_editingCancelled`,void 0),E([m()],gy.prototype,`_editStartIndex`,void 0),E([m()],gy.prototype,`_openCumPath`,void 0),E([m()],gy.prototype,`_dragCumPath`,void 0),E([m()],gy.prototype,`_dropCumPath`,void 0),E([m()],gy.prototype,`_hintSegments`,void 0),gy=E([T(`ixfx-crumb-path`)],gy);let _y=class extends n{static{this.styles=[w,r`
|
|
4794
|
+
`]}};E([d({type:String})],gy.prototype,`path`,void 0),E([d({attribute:!1})],gy.prototype,`segments`,void 0),E([d({type:String})],gy.prototype,`separator`,void 0),E([d({type:String,attribute:`path-root`})],gy.prototype,`pathRoot`,void 0),E([d({type:Object})],gy.prototype,`siblingLookup`,void 0),E([d({type:Object})],gy.prototype,`segmentIconLookup`,void 0),E([d({type:Object})],gy.prototype,`segmentDragLookup`,void 0),E([d({type:Object})],gy.prototype,`parseExternalDrop`,void 0),E([d({type:Boolean,attribute:`hint-previous`})],gy.prototype,`hintPrevious`,void 0),E([m()],gy.prototype,`_openIdx`,void 0),E([m()],gy.prototype,`_editing`,void 0),E([m()],gy.prototype,`_cachedSiblings`,void 0),E([m()],gy.prototype,`_leafSegmentIndex`,void 0),E([m()],gy.prototype,`_confirmedLeafIndices`,void 0),E([m()],gy.prototype,`_dropdownActiveIndex`,void 0),E([m()],gy.prototype,`_editingCancelled`,void 0),E([m()],gy.prototype,`_editStartIndex`,void 0),E([m()],gy.prototype,`_openCumPath`,void 0),E([m()],gy.prototype,`_dragCumPath`,void 0),E([m()],gy.prototype,`_dropCumPath`,void 0),E([m()],gy.prototype,`_hintSegments`,void 0),gy=E([T(`ixfx-crumb-path`)],gy);let _y=class extends n{static{this.styles=[w,r`
|
|
4795
4795
|
:host {
|
|
4796
4796
|
display: block;
|
|
4797
4797
|
width: fit-content;
|
|
@@ -4867,7 +4867,7 @@ function Eg(e){return!(typeof e!=`object`||!(`h`in e)||!(`s`in e)||!(`l`in e)||!
|
|
|
4867
4867
|
--_trigger-hover-bg: transparent;
|
|
4868
4868
|
--_trigger-hover-opacity: 0.6;
|
|
4869
4869
|
}
|
|
4870
|
-
`}render(){return i`<slot role="menubar"></slot>`}};Ry=E([T(`ixfx-menu-bar`)],Ry);let zy=class extends n{constructor(...e){super(...e),this.command=``,this.commandArgs=``,this.label=``,this.checked=!1,this.disabled=!1,this.iconName=``}handleClick(){this.disabled||(this.checked=!this.checked,this.dispatchEvent(new CustomEvent(`command`,{detail:{command:this.command,checked:this.checked,args:this.commandArgs},bubbles:!0,composed:!0})))}_resolvedLabel(){return this.label?this.label:this.registry&&this.command?this.registry.
|
|
4870
|
+
`}render(){return i`<slot role="menubar"></slot>`}};Ry=E([T(`ixfx-menu-bar`)],Ry);let zy=class extends n{constructor(...e){super(...e),this.command=``,this.commandArgs=``,this.label=``,this.checked=!1,this.disabled=!1,this.iconName=``}handleClick(){this.disabled||(this.checked=!this.checked,this.dispatchEvent(new CustomEvent(`command`,{detail:{command:this.command,checked:this.checked,args:this.commandArgs},bubbles:!0,composed:!0})))}_resolvedLabel(){return this.label?this.label:this.registry&&this.command?this.registry.getLabel(this.command,void 0)??``:``}_resolvedIcon(){return this.iconName?this.iconName:this.registry&&this.command?this.registry.get(this.command)?.icon??null:null}willUpdate(e){super.willUpdate(e);let n=this._resolvedIcon();n&&!this.iconName?this.setAttribute(`data-icon-section`,``):!n&&!this.iconName&&this.removeAttribute(`data-icon-section`)}updated(e){super.updated(e)}_getShortcut(){if(!this.keyboardManager||!this.command)return null;let e=(this.keyboardManager.getBindings?.()??[]).find(e=>e.commandId===this.command);if(!e)return null;let n=Array.from(e.modifiers??[],e=>({ctrl:`⌃`,shift:`⇧`,alt:`⌥`,meta:`⌘`})[e]??e),r=e.key?.length===1?e.key.toUpperCase():e.key;return[...n,r].join(``)}static{this.styles=[w,C,r`
|
|
4871
4871
|
:host {
|
|
4872
4872
|
display: block;
|
|
4873
4873
|
}
|
|
@@ -5442,7 +5442,7 @@ function Eg(e){return!(typeof e!=`object`||!(`h`in e)||!(`s`in e)||!(`l`in e)||!
|
|
|
5442
5442
|
`:a}
|
|
5443
5443
|
</ixfx-menu-container>
|
|
5444
5444
|
</ixfx-menu-trigger>
|
|
5445
|
-
</div>`:a}};E([d({type:Array})],H.prototype,`columns`,void 0),E([d({type:Array})],H.prototype,`rows`,void 0),E([d({type:String,attribute:`selection-mode`})],H.prototype,`selectionMode`,void 0),E([d({type:String,attribute:`interaction-mode`})],H.prototype,`interactionMode`,void 0),E([d({attribute:!1})],H.prototype,`sortState`,void 0),E([d({type:Number,attribute:`row-height`})],H.prototype,`rowHeight`,void 0),E([d({attribute:!1})],H.prototype,`getRowKey`,void 0),E([d({attribute:!1})],H.prototype,`checkboxRenderer`,void 0),E([d({attribute:!1})],H.prototype,`editable`,void 0),E([d({type:String,reflect:!0})],H.prototype,`editability`,void 0),E([d({type:String,attribute:`cell-overflow`})],H.prototype,`cellOverflow`,void 0),E([d({type:Boolean,attribute:`zebra-stripes`,reflect:!0})],H.prototype,`zebraStripes`,void 0),E([d({attribute:!1})],H.prototype,`groupBy`,void 0),E([d({type:Boolean,attribute:`allow-grouping`})],H.prototype,`allowGrouping`,void 0),E([d({attribute:!1})],H.prototype,`groupLabel`,void 0),E([d({attribute:!1})],H.prototype,`groupableColumns`,void 0),E([d({type:Boolean,attribute:`cross-group-selection`,reflect:!0})],H.prototype,`crossGroupSelection`,void 0),E([d({type:String,attribute:`column-menu`})],H.prototype,`columnMenu`,void 0),E([d({attribute:!1})],H.prototype,`globalFormatter`,void 0),E([d({type:String,attribute:`text-color-column`})],H.prototype,`textColorColumn`,void 0),E([d({type:String,attribute:`icon-column`})],H.prototype,`iconColumn`,void 0),E([d({type:String,attribute:`badge-column`})],H.prototype,`badgeColumn`,void 0),E([d({attribute:!1})],H.prototype,`filterPredicate`,void 0),E([d({attribute:!1})],H.prototype,`rowSearchText`,void 0),E([d({type:String,attribute:`search-column`})],H.prototype,`searchColumn`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],H.prototype,`searchModes`,void 0),E([d({type:Boolean,attribute:`items-draggable`,reflect:!0})],H.prototype,`itemsDraggable`,void 0),E([d({attribute:!1})],H.prototype,`dragPreviewRenderer`,void 0),E([d({attribute:!1})],H.prototype,`dragPreviewSource`,void 0),E([d({type:String,attribute:`column-button-icon`})],H.prototype,`columnButtonIcon`,void 0),E([m()],H.prototype,`_resizingColKey`,void 0),E([m()],H.prototype,`_animatingColKeys`,void 0),E([m()],H.prototype,`_selectedKeys`,void 0),E([m()],H.prototype,`_viewportH`,void 0),E([m()],H.prototype,`_viewportW`,void 0),E([m()],H.prototype,`_collapsedGroups`,void 0),E([m()],H.prototype,`_editing`,void 0),E([m()],H.prototype,`_editingRow`,void 0),E([m()],H.prototype,`_lastClick`,void 0),E([m()],H.prototype,`_lastClickedCell`,void 0),E([m()],H.prototype,`_editValue`,void 0),E([f(`.viewport`)],H.prototype,`_viewportEl`,void 0),E([f(`.header-row`)],H.prototype,`_headerRowEl`,void 0),E([m()],H.prototype,`_partialKeys`,void 0),H=E([T(`ixfx-data-grid`)],H);let cb=class extends n{constructor(...e){super(...e),this.rows=[],this.tickleDelay=400,this.layout=`auto`,this.narrowBreakpoint=420,this._tickled=new oe(this,{getItems:()=>this.rows.map((e,n)=>({id:n,enabled:!0}))}),this._stacked=!1,this.#n=0}static{this.styles=[se,C,de,r`
|
|
5445
|
+
</div>`:a}};E([d({type:Array})],H.prototype,`columns`,void 0),E([d({type:Array})],H.prototype,`rows`,void 0),E([d({type:String,attribute:`selection-mode`})],H.prototype,`selectionMode`,void 0),E([d({type:String,attribute:`interaction-mode`})],H.prototype,`interactionMode`,void 0),E([d({attribute:!1})],H.prototype,`sortState`,void 0),E([d({type:Number,attribute:`row-height`})],H.prototype,`rowHeight`,void 0),E([d({attribute:!1})],H.prototype,`getRowKey`,void 0),E([d({attribute:!1})],H.prototype,`checkboxRenderer`,void 0),E([d({attribute:!1})],H.prototype,`editable`,void 0),E([d({type:String,reflect:!0})],H.prototype,`editability`,void 0),E([d({type:String,attribute:`cell-overflow`})],H.prototype,`cellOverflow`,void 0),E([d({type:Boolean,attribute:`zebra-stripes`,reflect:!0})],H.prototype,`zebraStripes`,void 0),E([d({attribute:!1})],H.prototype,`groupBy`,void 0),E([d({type:Boolean,attribute:`allow-grouping`})],H.prototype,`allowGrouping`,void 0),E([d({attribute:!1})],H.prototype,`groupLabel`,void 0),E([d({attribute:!1})],H.prototype,`groupableColumns`,void 0),E([d({type:Boolean,attribute:`cross-group-selection`,reflect:!0})],H.prototype,`crossGroupSelection`,void 0),E([d({type:String,attribute:`column-menu`})],H.prototype,`columnMenu`,void 0),E([d({attribute:!1})],H.prototype,`globalFormatter`,void 0),E([d({type:String,attribute:`text-color-column`})],H.prototype,`textColorColumn`,void 0),E([d({type:String,attribute:`icon-column`})],H.prototype,`iconColumn`,void 0),E([d({type:String,attribute:`badge-column`})],H.prototype,`badgeColumn`,void 0),E([d({attribute:!1})],H.prototype,`filterPredicate`,void 0),E([d({attribute:!1})],H.prototype,`rowSearchText`,void 0),E([d({type:String,attribute:`search-column`})],H.prototype,`searchColumn`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],H.prototype,`searchModes`,void 0),E([d({type:Boolean,attribute:`items-draggable`,reflect:!0})],H.prototype,`itemsDraggable`,void 0),E([d({attribute:!1})],H.prototype,`dragPreviewRenderer`,void 0),E([d({attribute:!1})],H.prototype,`writeDataTransfer`,void 0),E([d({attribute:!1})],H.prototype,`dragPreviewSource`,void 0),E([d({type:String,attribute:`column-button-icon`})],H.prototype,`columnButtonIcon`,void 0),E([m()],H.prototype,`_resizingColKey`,void 0),E([m()],H.prototype,`_animatingColKeys`,void 0),E([m()],H.prototype,`_selectedKeys`,void 0),E([m()],H.prototype,`_viewportH`,void 0),E([m()],H.prototype,`_viewportW`,void 0),E([m()],H.prototype,`_collapsedGroups`,void 0),E([m()],H.prototype,`_editing`,void 0),E([m()],H.prototype,`_editingRow`,void 0),E([m()],H.prototype,`_lastClick`,void 0),E([m()],H.prototype,`_lastClickedCell`,void 0),E([m()],H.prototype,`_editValue`,void 0),E([f(`.viewport`)],H.prototype,`_viewportEl`,void 0),E([f(`.header-row`)],H.prototype,`_headerRowEl`,void 0),E([m()],H.prototype,`_partialKeys`,void 0),H=E([T(`ixfx-data-grid`)],H);let cb=class extends n{constructor(...e){super(...e),this.rows=[],this.tickleDelay=400,this.layout=`auto`,this.narrowBreakpoint=420,this._tickled=new oe(this,{getItems:()=>this.rows.map((e,n)=>({id:n,enabled:!0}))}),this._stacked=!1,this.#n=0}static{this.styles=[se,C,de,r`
|
|
5446
5446
|
:host {
|
|
5447
5447
|
display: block;
|
|
5448
5448
|
container-type: inline-size;
|
|
@@ -5912,7 +5912,7 @@ function Eg(e){return!(typeof e!=`object`||!(`h`in e)||!(`s`in e)||!(`l`in e)||!
|
|
|
5912
5912
|
</div>
|
|
5913
5913
|
${this.search.renderField()}
|
|
5914
5914
|
</div>
|
|
5915
|
-
`}};E([d({type:String,attribute:`selection-mode`})],U.prototype,`selectionMode`,void 0),E([d({type:String,attribute:`interaction-mode`})],U.prototype,`interactionMode`,void 0),E([d({type:String})],U.prototype,`sort`,void 0),E([d({type:String,attribute:`sort-by`})],U.prototype,`sortBy`,void 0),E([d({attribute:!1})],U.prototype,`sortComparator`,void 0),E([d({attribute:!1})],U.prototype,`items`,void 0),E([d({attribute:!1})],U.prototype,`provider`,void 0),E([d({type:String,attribute:`display-property`})],U.prototype,`displayProperty`,void 0),E([d({attribute:!1})],U.prototype,`formatter`,void 0),E([d({attribute:!1})],U.prototype,`searchText`,void 0),E([d({type:String,attribute:`icon-property`})],U.prototype,`iconProperty`,void 0),E([d({type:String,attribute:`icon-color-property`})],U.prototype,`iconColorProperty`,void 0),E([d({type:String,attribute:`text-color-property`})],U.prototype,`textColorProperty`,void 0),E([d({type:String,attribute:`badge-property`})],U.prototype,`badgeProperty`,void 0),E([d({type:String,attribute:`key-property`})],U.prototype,`keyProperty`,void 0),E([d({attribute:!1})],U.prototype,`filterPredicate`,void 0),E([d({type:String,attribute:`item-wrap`})],U.prototype,`itemWrap`,void 0),E([d({attribute:!1})],U.prototype,`checkboxRenderer`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],U.prototype,`searchModes`,void 0),E([d({type:Boolean,attribute:`items-draggable`,reflect:!0})],U.prototype,`itemsDraggable`,void 0),E([d({attribute:!1})],U.prototype,`dragPreviewRenderer`,void 0),E([d({attribute:!1})],U.prototype,`dragPreviewSource`,void 0),E([d({attribute:`group-by`})],U.prototype,`groupBy`,void 0),E([d({attribute:!1})],U.prototype,`groupLabel`,void 0),E([d({type:Boolean,attribute:`cross-group-selection`,reflect:!0})],U.prototype,`crossGroupSelection`,void 0),E([m()],U.prototype,`_collapsedGroups`,void 0),E([f(`ul`)],U.prototype,`_listEl`,void 0),U=E([T(`ixfx-detail-list`)],U);let Lb=null;const Rb=/* @__PURE__ */ new Set;function zb(e){Rb.add(e)}function Bb(e){Rb.delete(e),Lb!==null&&Lb.sourceHost}function Vb(e,n,r,i,a,o){Lb={panelId:e,kind:o,sourceHost:n,pointerId:r,ghost:Hb(n,e),outside:!1};for(let r of Rb)r.setDragActive(!0,qb(n,r)?{panelId:e,kind:o}:void 0);Lb.ghost?.move(i,a),window.addEventListener(`pointermove`,Ub),window.addEventListener(`pointerup`,Wb),window.addEventListener(`pointercancel`,Gb),window.addEventListener(`keydown`,Kb)}function Hb(e,n){let r=Array.from(e.children).find(e=>e instanceof HTMLElement&&e.panelId===n);if(!r)return null;let i=document.createElement(`span`);if(i.style.display=`inline-flex`,i.style.alignItems=`center`,i.style.gap=`var(--space-xs, 4px)`,i.style.minWidth=`0`,r.iconName){let e=document.createElement(`ixfx-icon`);e.name=r.iconName,i.appendChild(e)}let a=document.createElement(`span`);a.textContent=r.title||n,a.style.overflow=`hidden`,a.style.textOverflow=`ellipsis`,a.style.whiteSpace=`nowrap`,i.appendChild(a);try{return Sy({anchor:r,content:i})}catch{return null}}function Ub(e){let n=Lb;if(n===null||e.pointerId!==n.pointerId)return;n.ghost?.move(e.clientX,e.clientY);let r=Jb(n,e.clientX,e.clientY);for(let e of Rb)e.setDropZone(r!==null&&r.host===e?r:null);let i=!Yb(e.clientX,e.clientY);i!==n.outside&&(n.outside=i,Xb(n,i?`dock-panel-drag-out`:`dock-panel-drag-in`,e))}function Wb(e){let n=Lb;if(n===null||e.pointerId!==n.pointerId)return;let r=Jb(n,e.clientX,e.clientY);r===null?Yb(e.clientX,e.clientY)||Zb(n,e):r.host.handleDrop(n.panelId,r,n.sourceHost),Qb()}function Gb(e){let n=Lb;n!==null&&e.pointerId===n.pointerId&&Qb()}function Kb(e){Lb!==null&&e.key===`Escape`&&Qb()}function qb(e,n){return e===n||!e.isolated&&e.family===n.family}function Jb(e,n,r){for(let i of Rb){if(!qb(e.sourceHost,i))continue;let a=i.computeDropZone(n,r,e.panelId,e.kind);if(a!==null)return a}return null}function Yb(e,n){for(let r of Rb){let i=r.getBoundingClientRect();if(e>=i.left&&e<=i.right&&n>=i.top&&n<=i.bottom)return!0}return!1}function Xb(e,n,r){e.sourceHost.dispatchEvent(new CustomEvent(n,{detail:{panelId:e.panelId,clientX:r.clientX,clientY:r.clientY,screenX:r.screenX,screenY:r.screenY},bubbles:!0,composed:!0}))}function Zb(e,n){let r=e.sourceHost.getPanelSnapshot(e.panelId);r!==null&&e.sourceHost.dispatchEvent(new CustomEvent(`dock-panel-tear-out`,{detail:{panelId:e.panelId,snapshot:r,clientX:n.clientX,clientY:n.clientY,screenX:n.screenX,screenY:n.screenY},bubbles:!0,composed:!0}))}function Qb(){let e=Lb;if(e!==null){for(let e of Rb)e.setDropZone(null),e.setDragActive(!1);e.ghost?.destroy(),Lb=null,window.removeEventListener(`pointermove`,Ub),window.removeEventListener(`pointerup`,Wb),window.removeEventListener(`pointercancel`,Gb),window.removeEventListener(`keydown`,Kb)}}function $b(){return Lb!==null}function ex(){return Lb?.panelId??null}const tx=`data-dock-maximized`;function nx(e,n){let{style:r}=e;r.position=`fixed`,r.inset=`auto`,r.margin=`0`,r.left=`${n.left}px`,r.top=`${n.top}px`,r.width=`${n.width}px`,r.height=`${n.height}px`}function rx(e,n){let r=e;e.setAttribute(tx,``),e.setAttribute(`popover`,`manual`),nx(e,n);try{r.matches(`:popover-open`)||r.showPopover?.()}catch{}}function ix(e){let n=e;try{n.matches(`:popover-open`)&&n.hidePopover?.()}catch{}e.removeAttribute(`popover`),e.removeAttribute(tx);let{style:r}=e;for(let e of[`position`,`inset`,`margin`,`left`,`top`,`width`,`height`])r.removeProperty(e)}const ax=`
|
|
5915
|
+
`}};E([d({type:String,attribute:`selection-mode`})],U.prototype,`selectionMode`,void 0),E([d({type:String,attribute:`interaction-mode`})],U.prototype,`interactionMode`,void 0),E([d({type:String})],U.prototype,`sort`,void 0),E([d({type:String,attribute:`sort-by`})],U.prototype,`sortBy`,void 0),E([d({attribute:!1})],U.prototype,`sortComparator`,void 0),E([d({attribute:!1})],U.prototype,`items`,void 0),E([d({attribute:!1})],U.prototype,`provider`,void 0),E([d({type:String,attribute:`display-property`})],U.prototype,`displayProperty`,void 0),E([d({attribute:!1})],U.prototype,`formatter`,void 0),E([d({attribute:!1})],U.prototype,`searchText`,void 0),E([d({type:String,attribute:`icon-property`})],U.prototype,`iconProperty`,void 0),E([d({type:String,attribute:`icon-color-property`})],U.prototype,`iconColorProperty`,void 0),E([d({type:String,attribute:`text-color-property`})],U.prototype,`textColorProperty`,void 0),E([d({type:String,attribute:`badge-property`})],U.prototype,`badgeProperty`,void 0),E([d({type:String,attribute:`key-property`})],U.prototype,`keyProperty`,void 0),E([d({attribute:!1})],U.prototype,`filterPredicate`,void 0),E([d({type:String,attribute:`item-wrap`})],U.prototype,`itemWrap`,void 0),E([d({attribute:!1})],U.prototype,`checkboxRenderer`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],U.prototype,`searchModes`,void 0),E([d({type:Boolean,attribute:`items-draggable`,reflect:!0})],U.prototype,`itemsDraggable`,void 0),E([d({attribute:!1})],U.prototype,`dragPreviewRenderer`,void 0),E([d({attribute:!1})],U.prototype,`writeDataTransfer`,void 0),E([d({attribute:!1})],U.prototype,`dragPreviewSource`,void 0),E([d({attribute:`group-by`})],U.prototype,`groupBy`,void 0),E([d({attribute:!1})],U.prototype,`groupLabel`,void 0),E([d({type:Boolean,attribute:`cross-group-selection`,reflect:!0})],U.prototype,`crossGroupSelection`,void 0),E([m()],U.prototype,`_collapsedGroups`,void 0),E([f(`ul`)],U.prototype,`_listEl`,void 0),U=E([T(`ixfx-detail-list`)],U);let Lb=null;const Rb=/* @__PURE__ */ new Set;function zb(e){Rb.add(e)}function Bb(e){Rb.delete(e),Lb!==null&&Lb.sourceHost}function Vb(e,n,r,i,a,o){Lb={panelId:e,kind:o,sourceHost:n,pointerId:r,ghost:Hb(n,e),outside:!1};for(let r of Rb)r.setDragActive(!0,qb(n,r)?{panelId:e,kind:o}:void 0);Lb.ghost?.move(i,a),window.addEventListener(`pointermove`,Ub),window.addEventListener(`pointerup`,Wb),window.addEventListener(`pointercancel`,Gb),window.addEventListener(`keydown`,Kb)}function Hb(e,n){let r=Array.from(e.children).find(e=>e instanceof HTMLElement&&e.panelId===n);if(!r)return null;let i=document.createElement(`span`);if(i.style.display=`inline-flex`,i.style.alignItems=`center`,i.style.gap=`var(--space-xs, 4px)`,i.style.minWidth=`0`,r.iconName){let e=document.createElement(`ixfx-icon`);e.name=r.iconName,i.appendChild(e)}let a=document.createElement(`span`);a.textContent=r.title||n,a.style.overflow=`hidden`,a.style.textOverflow=`ellipsis`,a.style.whiteSpace=`nowrap`,i.appendChild(a);try{return Sy({anchor:r,content:i})}catch{return null}}function Ub(e){let n=Lb;if(n===null||e.pointerId!==n.pointerId)return;n.ghost?.move(e.clientX,e.clientY);let r=Jb(n,e.clientX,e.clientY);for(let e of Rb)e.setDropZone(r!==null&&r.host===e?r:null);let i=!Yb(e.clientX,e.clientY);i!==n.outside&&(n.outside=i,Xb(n,i?`dock-panel-drag-out`:`dock-panel-drag-in`,e))}function Wb(e){let n=Lb;if(n===null||e.pointerId!==n.pointerId)return;let r=Jb(n,e.clientX,e.clientY);r===null?Yb(e.clientX,e.clientY)||Zb(n,e):r.host.handleDrop(n.panelId,r,n.sourceHost),Qb()}function Gb(e){let n=Lb;n!==null&&e.pointerId===n.pointerId&&Qb()}function Kb(e){Lb!==null&&e.key===`Escape`&&Qb()}function qb(e,n){return e===n||!e.isolated&&e.family===n.family}function Jb(e,n,r){for(let i of Rb){if(!qb(e.sourceHost,i))continue;let a=i.computeDropZone(n,r,e.panelId,e.kind);if(a!==null)return a}return null}function Yb(e,n){for(let r of Rb){let i=r.getBoundingClientRect();if(e>=i.left&&e<=i.right&&n>=i.top&&n<=i.bottom)return!0}return!1}function Xb(e,n,r){e.sourceHost.dispatchEvent(new CustomEvent(n,{detail:{panelId:e.panelId,clientX:r.clientX,clientY:r.clientY,screenX:r.screenX,screenY:r.screenY},bubbles:!0,composed:!0}))}function Zb(e,n){let r=e.sourceHost.getPanelSnapshot(e.panelId);r!==null&&e.sourceHost.dispatchEvent(new CustomEvent(`dock-panel-tear-out`,{detail:{panelId:e.panelId,snapshot:r,clientX:n.clientX,clientY:n.clientY,screenX:n.screenX,screenY:n.screenY},bubbles:!0,composed:!0}))}function Qb(){let e=Lb;if(e!==null){for(let e of Rb)e.setDropZone(null),e.setDragActive(!1);e.ghost?.destroy(),Lb=null,window.removeEventListener(`pointermove`,Ub),window.removeEventListener(`pointerup`,Wb),window.removeEventListener(`pointercancel`,Gb),window.removeEventListener(`keydown`,Kb)}}function $b(){return Lb!==null}function ex(){return Lb?.panelId??null}const tx=`data-dock-maximized`;function nx(e,n){let{style:r}=e;r.position=`fixed`,r.inset=`auto`,r.margin=`0`,r.left=`${n.left}px`,r.top=`${n.top}px`,r.width=`${n.width}px`,r.height=`${n.height}px`}function rx(e,n){let r=e;e.setAttribute(tx,``),e.setAttribute(`popover`,`manual`),nx(e,n);try{r.matches(`:popover-open`)||r.showPopover?.()}catch{}}function ix(e){let n=e;try{n.matches(`:popover-open`)&&n.hidePopover?.()}catch{}e.removeAttribute(`popover`),e.removeAttribute(tx);let{style:r}=e;for(let e of[`position`,`inset`,`margin`,`left`,`top`,`width`,`height`])r.removeProperty(e)}const ax=`
|
|
5916
5916
|
.leaf[${tx}] {
|
|
5917
5917
|
z-index: 1;
|
|
5918
5918
|
padding: 0;
|
|
@@ -7066,7 +7066,7 @@ function Eg(e){return!(typeof e!=`object`||!(`h`in e)||!(`s`in e)||!(`l`in e)||!
|
|
|
7066
7066
|
:host([fill-style="circular"]:not([circular-style])) {
|
|
7067
7067
|
aspect-ratio: 1;
|
|
7068
7068
|
}
|
|
7069
|
-
`]}};E([d({type:Number})],bC.prototype,`min`,void 0),E([d({type:Number})],bC.prototype,`max`,void 0),E([d({type:Number})],bC.prototype,`step`,void 0),E([d({type:Number})],bC.prototype,`stops`,void 0),E([d({type:Number,attribute:`drag-sensitivity`})],bC.prototype,`dragSensitivity`,void 0),E([d({attribute:`fill-style`})],bC.prototype,`fillStyle`,void 0),E([d({attribute:`linear-style`})],bC.prototype,`linearStyle`,void 0),E([d({attribute:`circular-style`})],bC.prototype,`circularStyle`,void 0),E([d({type:Boolean,attribute:`no-drag`})],bC.prototype,`noDrag`,void 0),E([d({type:Number})],bC.prototype,`precision`,void 0),bC=E([T(`ixfx-editable-number`)],bC);function xC(e,n){let r=/* @__PURE__ */ new Map;for(let i of e){let e=n(i);e!==void 0&&!r.has(e)&&r.set(e,i)}return r}function SC(e,n){let r=[];for(let i of e)n(i)||r.push(i);return r}function CC(e,n,r,i){let a=/* @__PURE__ */ new Map,o=[];for(let n of e){let e=i(n);e===void 0?o.push(n):a.set(e,n)}let s=[],c=/* @__PURE__ */ new Set,l;for(let e of r){let r=i(e);r!==void 0&&(a.has(r)&&!c.has(r)&&(s.push(e),c.add(r)),r===n&&(l??=e))}for(let[e,n]of a)c.has(e)||o.push(n);return{live:s,gone:o,anchor:l}}function wC(e,n,r){let i=e??n;return i!==void 0&&r(i)?{pending:void 0,apply:i}:{pending:i,apply:void 0}}function TC(e,n,r,i){if(n<=0||r===0)return iy(e,void 0,0);let a=Math.min(r-1,Math.max(0,Math.floor(e/n)));return iy(e,i(a),a*n)}function EC(e,n,r){if(!e.anchor)return e.top;let i=r(e.anchor.key);return i<0?void 0:i*n+e.anchor.offset}const DC=`li:not([data-virtual-spacer]), [data-list-item]:not([data-virtual-spacer])`;function OC(e,n){if(e===void 0||e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==n[r])return!1;return!0}let kC=class extends n{constructor(...e){super(...e),this.selectionMode=`single`,this.interactionMode=`standard`,this.itemWrap=`stop`,this.itemsDraggable=!1,this.keyProperty=``,this.virtualize=!1,this.itemHeight=0,this.itemsDroppable=!1,this.#e=/* @__PURE__ */ new Map,this.#t=/* @__PURE__ */ new Set,this.#n=/* @__PURE__ */ new WeakMap,this.#i=/* @__PURE__ */ new WeakSet,this.#a=[],this.#o=document.createDocumentFragment(),this.#s=0,this.#c=0,this.#l=[],this.#u=!1,this.#d=0,this.#_=0,this.#v=!1,this.#y=new cy(this,{kind:`vertical-list`,capture:()=>this.getViewState()}),this.#x=!1,this.selection=new _r({getOrderedItems:()=>this.#ae(),isSelectable:e=>this._isCheckable(e),getModes:()=>({selectionMode:this.selectionMode,interactionMode:this.interactionMode}),getKey:D,onIntent:e=>this._dispatchCancelable(`list-select-intent`,e)===!1,onChange:(e,n)=>{this._syncItemStates(),this.#y.notify(),this._dispatch(`list-select`,{selected:e,previous:n,selectedKeys:this.selection.selectedKeys,previousKeys:At(n)})}}),this.tickled=(e=>new oe(e,{getItems:()=>e.#ae().map(e=>({id:e,enabled:!e.hasAttribute(`not-checked`)})),onTickle:n=>{e.tickled.inputMode===`keyboard`&&(e.#y.isRestoring||(e.#b=void 0),e.#y.notify()),n!==void 0&&this._dispatch(`list-tickle`,{item:n})},onStateChange:()=>this._syncItemStates(),get itemWrap(){return e.itemWrap},hoverDisabled:()=>this.#O.isDragging||this.#w.isDragging}))(this),this.#S=!1,this.#C=0,this.#w=new rr(this,{source:`vertical-list`,isEnabled:()=>this.itemsDraggable&&this.selectionMode!==`none`&&this._getVisibleItems().length>0,resolveEventToKey:e=>{if(!(e instanceof Element))return;let n=e.closest?.(DC);if(n&&this.contains(n)&&!this.#t.has(n))return D(n)},prepareSelection:e=>this.#T(e),getMetrics:()=>({}),getRenderer:()=>this.dragPreviewRenderer,getDragPreviewSourceResolver:()=>this.dragPreviewSource,dispatch:e=>this._dispatchCancelable(`list-native-drag-start`,e),onActiveChange:(e,n)=>{this.#S=e,this.toggleAttribute(`data-native-dragging`,e);for(let r of this._getVisibleItems())r.toggleAttribute(`data-drag-origin`,e&&n!==void 0&&D(r)===n);if(e){let e=this.selection.selected.size;this.setAttribute(`aria-label`,e<=1?`Dragging 1 item`:`Dragging ${e} items`)}else this.removeAttribute(`aria-label`);this.requestUpdate()},onEnd:()=>{this.#S=!1,this.toggleAttribute(`data-native-dragging`,!1),this.removeAttribute(`aria-label`);for(let e of this._getVisibleItems())e.removeAttribute(`data-drag-origin`);if(this.#ie())for(let e of this.#a)e.removeAttribute(`data-drag-origin`);this.#E()},syncLightDomDraggable:()=>this._syncNativeDraggable()}),this.#O=new Gn(this,{getSurface:()=>this.renderRoot.querySelector(`.container`),isEnabled:()=>!this.#ie()&&this.selection.canDragSelect()&&this._getVisibleItems().length>0&&!this.hasAttribute(`disable-drag-select`),hitTest:e=>this.#k(e),getBaseSelection:()=>this.selection.selected,onPreview:(e,n)=>{this.#D=n;for(let n of this._getVisibleItems())n.toggleAttribute(`data-marquee`,e.has(n));this.requestUpdate()},onCommit:e=>{this.selection.applyDragSelection(e);for(let e of this._getVisibleItems())e.removeAttribute(`data-marquee`);this.#D=void 0,this.requestUpdate()},autoScroll:(e,n)=>{let r=this.renderRoot.querySelector(`ul`);r&&(r.scrollTop+=n)}}),this.search=new Ht(this,{adapter:Nt(this,{itemSelector:DC,getLabel:e=>e.getAttribute(`data-search-label`)??e.textContent?.trim()??``,highlightKey:`vertical-list-search`,getAllItems:()=>this.#ae(),observeContainer:!1})}),this.#L=/* @__PURE__ */ new Set,this.#ge=()=>{this.#y.pendingScroll||this.#y.notify(),this.#d===0&&(this.#d=requestAnimationFrame(()=>{this.#d=0,this.#_e(),this.#xe()}))},this._onPointerOver=e=>{let n=this._findListItem(e.composedPath());n&&this.tickled.handlePointerEnter(n)},this._onPointerLeave=e=>{this.tickled.handlePointerLeave(e)},this._onKeyDown=e=>{if(!(this.search.isOpen||this.#Oe(e))){if(e.key===`ContextMenu`||e.shiftKey&&e.key===`F10`){let n=this.tickled.tickledId;if(n){e.preventDefault();let r=n.getBoundingClientRect();this.#Ee(n,r.left,r.bottom)}}else if((e.ctrlKey||e.metaKey)&&e.key===`a`)this.selection.canSelectAll()&&(e.preventDefault(),this.selection.selectAll(`keyboard`));else switch(e.key){case`ArrowDown`:if(e.preventDefault(),this.tickled.handleKeyboardNavigation(`next`),this.#R(),e.shiftKey&&(this.interactionMode===`vscode`||this.interactionMode===`manual`)){let e=this.tickled.tickledId;e&&this.selection.handleExtend(e)}break;case`ArrowUp`:if(e.preventDefault(),this.tickled.handleKeyboardNavigation(`previous`),this.#R(),e.shiftKey&&(this.interactionMode===`vscode`||this.interactionMode===`manual`)){let e=this.tickled.tickledId;e&&this.selection.handleExtend(e)}break;case`Home`:e.preventDefault(),this.tickled.handleKeyboardNavigation(`first`),this.#R();break;case`End`:e.preventDefault(),this.tickled.handleKeyboardNavigation(`last`),this.#R();break;case`PageDown`:e.preventDefault(),this.#B(1);break;case`PageUp`:e.preventDefault(),this.#B(-1);break;case`Enter`:{let n=this.tickled.tickledId;n&&(e.preventDefault(),this._dispatch(`list-item-click`,{item:n}),this._activateItem(n,`keyboard`));break}case` `:{let n=this.tickled.tickledId;n&&(e.preventDefault(),this.selection.handleSpace(n));break}case`Escape`:this.selection.handleClear(`keyboard`)}}},this._onClick=e=>{if(this.#Oe(e)||this.#O.isDragging||this.#w.isDragging||this.#C!==0)return;let n=this._findListItem(e.composedPath());n&&(this._dispatch(`list-item-click`,{item:n}),this.selection.handleClick(n,hr(e)))},this._onDblClick=e=>{if(this.#Oe(e))return;let n=this._findListItem(e.composedPath());n&&this._activateItem(n)},this._onDragOver=e=>{let n=e.dataTransfer;if(!this.itemsDroppable||!n||this.#Oe(e))return;let r=this._findListItem(e.composedPath());this.canDrop&&!this.canDrop(r,n)?this.#Ce():(this.#Se&&this.#Se.item!==r&&this.#Ce(),this.#Se={item:r},this._dispatchCancelable(`list-drag-over`,{key:r?D(r):void 0,item:r,dataTransfer:n})?this.#Te(void 0,!1):(e.preventDefault(),n.dropEffect===`none`&&(n.dropEffect=`copy`),this.#Te(r,!0)))},this._onDragLeave=e=>{let n=e.relatedTarget;n instanceof Node&&this.contains(n)||this.#Ce()},this._onDrop=e=>{let n=e.dataTransfer;if(!this.itemsDroppable||!n||this.#Oe(e))return;let r=this._findListItem(e.composedPath());this.canDrop&&!this.canDrop(r,n)?this.#Ce():(e.preventDefault(),this.#Se=void 0,this.#Te(void 0,!1),this._dispatch(`list-drop`,{key:r?D(r):void 0,item:r,dataTransfer:n}))},this._onContextMenu=e=>{if(this.#Oe(e))return;let n=this._findListItem(e.composedPath());n&&(this.#Ee(n,e.clientX,e.clientY)||e.preventDefault())}}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;#C;#w;#T(e){let n=this.#V(e);if(!n||!this._isCheckable(n))return;this.selection.selected.has(n)||this.selection.replace(n);let r=this.#ae(),i=[];r.forEach(n=>{if(!this.selection.selected.has(n))return;let r=this.#oe(n);i.push({key:D(n)??e,index:r,item:n,element:n})});let a=i.find(n=>n.key===e);if(a)return{origin:a,selected:i}}_syncNativeDraggable(){if(this.isConnected)for(let e of this.querySelectorAll(DC))this.#t.has(e)||e instanceof HTMLElement&&(e.draggable=this.itemsDraggable&&this._isCheckable(e))}#E(){this.#C&&clearTimeout(this.#C),this.#C=window.setTimeout(()=>{this.#C=0},0)}#D;#O;#k(e){let n=this.renderRoot.querySelector(`.container`);if(!n)return[];let r=n.getBoundingClientRect(),i=e.x,a=e.y,o=e.x+e.width,s=e.y+e.height,c=[];for(let e of this._getVisibleItems()){let n=e.getBoundingClientRect(),l=n.left-r.left,u=n.top-r.top;l<=o&&l+n.width>=i&&u<=s&&u+n.height>=a&&c.push(e)}return c}#A(e){return`left:${e.x}px;top:${e.y}px;width:${Math.max(0,e.width)}px;height:${Math.max(0,e.height)}px`}#j;#M;get registry(){return this.#j}#N(){let e=this.searchModes?.trim(),n;if(e===void 0)n=[...Bt];else{let r=new Set(e.split(/\s+/));n=Bt.filter(e=>r.has(e))}return this.#ie()?n.filter(e=>e!==`filter`):n}#P(){this.#j&&(this.search.setModes(this.#N()),this.#M?.(),this.#M=zt(this.#j,this.search))}connectedCallback(){super.connectedCallback(),this.hasAttribute(`tabindex`)||(this.tabIndex=0),this.addEventListener(`pointerover`,this._onPointerOver),this.addEventListener(`pointerleave`,this._onPointerLeave),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`click`,this._onClick),this.addEventListener(`dblclick`,this._onDblClick),this.addEventListener(`dragover`,this._onDragOver),this.addEventListener(`dragleave`,this._onDragLeave),this.addEventListener(`drop`,this._onDrop),this.addEventListener(`contextmenu`,this._onContextMenu);for(let e of this.querySelectorAll(DC))this.#i.add(e);this.#r??=new MutationObserver(e=>this.#F(e)),this.#r.observe(this,{childList:!0}),this.#j??=Xt(),this.#P(),this.#he()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`pointerover`,this._onPointerOver),this.removeEventListener(`pointerleave`,this._onPointerLeave),this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`click`,this._onClick),this.removeEventListener(`dblclick`,this._onDblClick),this.removeEventListener(`dragover`,this._onDragOver),this.removeEventListener(`dragleave`,this._onDragLeave),this.removeEventListener(`drop`,this._onDrop),this.removeEventListener(`contextmenu`,this._onContextMenu),this.#Ce(),this.#De=void 0,this.#r?.disconnect(),this.#f?.disconnect(),this.#f=void 0,this.#d!==0&&(cancelAnimationFrame(this.#d),this.#d=0),this.#M?.(),this.#M=void 0,this.#j=void 0,this.#C&&=(clearTimeout(this.#C),0)}firstUpdated(){this.#he(),this.#y.observeScrollTarget(this),this.#G()}#F(e){if(!this.isConnected)return;if(this.#ie()){this.#_e(this.#ue(e)),this.#be();return}let n=[];for(let r of e)for(let e of r.addedNodes)e instanceof HTMLElement&&e.parentElement===this&&e.matches(DC)&&(this.#i.has(e)||this.#e.has(e)||this.#t.has(e)||(this.#i.add(e),n.push(e)));if(this.#be(),e.some(e=>e.removedNodes.length>0)&&this.#W(SC(this.selection.selected,e=>e.parentNode===this||this.#t.has(e))),this.#G(),n.length!==0&&!this.#I(n.length))for(let e of n)$n(e)}#I(e){return e>=this.querySelectorAll(DC).length}updated(e){if(super.updated(e),e.has(`searchModes`)&&this.#P(),e.has(`virtualize`)||e.has(`itemHeight`)){let n=(e.has(`virtualize`)?e.get(`virtualize`):this.virtualize)===!0&&((e.has(`itemHeight`)?e.get(`itemHeight`):this.itemHeight)??0)>0;if(this.#ie()){if(!n){this.#o=document.createDocumentFragment(),this.#a=[...this.querySelectorAll(DC)];for(let e of this.#a)this.#i.add(e);this.#l=[]}this.#_e(!0)}else n?this.#ye():this.virtualize&&!this.#v&&(this.#v=!0,console.warn(`ixfx-vertical-list: virtualize needs item-height > 0 — running non-virtualized.`));this.#P()}if((e.has(`items`)||e.has(`formatter`)||e.has(`keyProperty`)||e.has(`icon`)||e.has(`iconColor`)||e.has(`textColor`)||e.has(`badge`))&&this.items!==void 0&&(this.#u?this.#u=!1:this.#ie()?this.#re():this.#J()),e.has(`interactionMode`)){this.selection.clearAnchor();let n=this.selection.selected,r=e.get(`interactionMode`)===`checked`?new Map(this.#e):null;if(this._syncCheckboxes(),n.size>0){if(r&&r.size>0)this.selection.remap(e=>r.get(e)??e);else if(this.#e.size>0){let e=new Map([...this.#e].map(([e,n])=>[n,e]));this.selection.remap(n=>e.get(n)??n)}}this._syncItemStates()}else e.has(`checkboxRenderer`)&&this.interactionMode===`checked`&&this._syncCheckboxes();(e.has(`itemsDraggable`)||e.has(`interactionMode`))&&(this._syncNativeDraggable(),this.#w.refreshDraggable())}get selectedItem(){return[...this.selection.selected].at(-1)}get selectedItems(){return this.selection.selected}addItem(e,n){let r;if(typeof e==`string`){let n=document.createElement(`li`);n.textContent=e,r=n}else r=e;n?.notChecked&&r.setAttribute(`not-checked`,``),this.appendChild(r),this.#ie()?this.#_e(!0):(this.interactionMode===`checked`&&this._syncCheckboxes(),this.search.refresh(),this.#G())}removeItem(e){return this.#W([e]),this.#ie()?(e.parentNode===this?nr(e):Object.assign(Promise.resolve(),{animation:void 0})).then(()=>{let n=this.#oe(e);n>=0&&this.#a.splice(n,1),this.#ce(e),e.remove(),this.interactionMode===`checked`&&this._syncCheckboxes(),this.#_e(!0)}):nr(e).then(()=>{e.remove(),this.interactionMode===`checked`&&this._syncCheckboxes()})}removeItems(e){return Promise.all([...e].map(e=>this.removeItem(e))).then(()=>void 0)}clearItems(){this.#e.clear(),this.#ie()&&(this.#a=[],this.#o=document.createDocumentFragment(),this.#l=[]),this.replaceChildren(),this.selection.reset(),this._syncItemStates(),this.search.refresh(),this.#ie()?this.#_e(!0):this.#G()}setItems(e){if(this.#ie()){this.#e.clear(),this.#o=document.createDocumentFragment(),this.#l=[],this.#a=[...e];for(let e of this.#a)this.#i.add(e);this.selection.reset(),this.search.refresh(),this.#_e(!0)}else{for(let n of e)this.appendChild(n);this.interactionMode===`checked`&&this._syncCheckboxes(),this.search.refresh(),this.#G()}}dispatch(e,n){this.#j?.invoke(e,n)}select(e){this.selection.replace(e)}selectMany(e){this.selection.selectMany(e)}deselect(e){this.selection.deselect(e)}clearSelection(){this.selection.clear()}selectAll(){this.selection.canSelectAll()&&this.selection.selectAll()}get selectedKeys(){return this.selection.selectedKeys}#L;get partialKeys(){return this.#L}set partialKeys(e){let n=new Set(e);br(n,this.#L)||(this.#L=n,this._syncItemStates())}get tickledKey(){let e=this.tickled.tickledId;return e?D(e):void 0}selectKeys(e){this.selection.selectKeys(e,e=>this.#V(e))}addSelectedKeys(e){this.selection.addKeys(e,e=>this.#V(e))}removeSelectedKeys(e){this.selection.removeKeys(e,e=>this.#V(e))}focusKey(e){if(this.#ie()){let n=this.#a.findIndex(n=>D(n)===e);if(n<0)return;let r=this.renderRoot.querySelector(`ul`);if(r){let e=this.itemHeight,i=r.clientHeight,a=n*e,o=(n+1)*e,s=r.scrollTop,c=i,l=s;a<s?l=a:o>s+c&&(l=o-c),l!==s&&(r.scrollTop=l),this.#_e(!0)}}let n=this.#V(e);n&&n.parentNode===this&&(this.#b=void 0,this.tickled.focus(n),n.scrollIntoView({block:`nearest`,inline:`nearest`}))}#R(){let e=this.tickled.tickledId,n=e?D(e):void 0;n!==void 0&&this.focusKey(n)}#z(){let e=this.#fe();if(!e)return 1;let n=e.clientHeight;if(this.#ie())return Math.max(1,Math.floor(n/this.itemHeight));let r=this.querySelector(`li[data-key]`);if(!r)return 1;let i=r.offsetHeight||this.itemHeight;return Math.max(1,Math.floor(n/i))}#B(e){let n=this.#z(),r=this.#ae().filter(e=>!e.hasAttribute(`not-checked`));if(r.length===0)return;let i=this.tickled.tickledId?D(this.tickled.tickledId):void 0,a=i===void 0?-1:r.findIndex(e=>D(e)===i),o=e===1?n-1:0,s=a<0?o:a+e*n;this.tickled.handleKeyboardNavigation(r[Math.min(r.length-1,Math.max(0,s))]),this.#R()}#V(e){if(this.#ie())return this.#a.find(n=>D(n)===e);for(let n of this.querySelectorAll(DC))if(!this.#t.has(n)&&D(n)===e)return n}getItemByKey(e){return this.#V(e)}getViewState(e){let n=e?.includePending??!0,r=this.tickled.inputMode===`keyboard`?this.tickledKey:void 0;return this.#y.shape({selected:pr(this.selection.selectedKeys,n?this.selection.pendingKeys:[]),focus:r??(n?this.#b:void 0),scroll:(n?this.#y.pendingScroll:void 0)??this.#K()},e)}setViewState(e){this.#y.accepts(e)&&(this.#y.restoring(()=>{if(e.selected){let n=this.#H();this.selection.restoreKeys(e.selected,e=>n.get(e))}e.focus!==void 0&&(this.#b=e.focus),e.scroll&&(this.#y.pendingScroll=e.scroll),this.#y.notify()}),this.#G())}clearPendingViewState(){this.selection.clearPending(),this.#b=void 0,this.#y.pendingScroll=void 0}#H(){return this.#ie()?xC(this.#a,D):xC([...this.querySelectorAll(DC)].filter(e=>!this.#t.has(e)),D)}#U(e){return this.#ie()?this.#oe(e)>=0:e.parentNode===this||this.#t.has(e)}#W(e){e.length!==0&&this.selection.demote(e)&&(this._syncItemStates(),this.#y.notify(`data`))}#G(){if(!this.#x){this.#x=!0;try{this.#y.restoring(()=>{let e,n=n=>(e??=this.#H()).get(n);this.selection.resolvePending(n);let r=this.tickled.tickledId,i=r!==void 0&&!this.#U(r);if(this.#b===void 0&&!i)return;let a=i&&this.tickled.inputMode===`keyboard`?D(r):void 0;i&&this.tickled.clearTickled();let o=wC(this.#b,a,e=>n(e)!==void 0);this.#b=o.pending,o.apply!==void 0&&(this.tickled.setInputMode(`keyboard`),this.tickled.setTickled(n(o.apply)),this.#y.notify())}),this.#y.applyPendingScroll(e=>this.#q(e))}finally{this.#x=!1}}}#K(){let e=this.#fe();if(e)return this.#ie()?TC(e.scrollTop,this.itemHeight,this.#a.length,e=>D(this.#a[e])):ty(e,this._getVisibleItems(),D)}#q(e){let n=this.#fe();if(!n||n.clientHeight===0)return!1;if(this.#ie()){let r=EC(e,this.itemHeight,e=>this.#a.findIndex(n=>D(n)===e));if(r===void 0)return!1;let i=Math.max(0,this.#a.length*this.itemHeight-this.#pe(n));return n.scrollTop=Math.max(0,Math.min(r,i)),this.#_e(),r<=i+1}if(!e.anchor)return ry(n,e.top);let r=this.#H().get(e.anchor.key);return!r||r.hidden?!1:ny(n,r,e.anchor.offset)}visibleKeys(){let e=this.renderRoot.querySelector(`ul`);if(!e)return[];let n=e.getBoundingClientRect(),r=[];for(let e of this._getVisibleItems()){let i=D(e);if(i===void 0)continue;let a=e.getBoundingClientRect();a.bottom>n.top&&a.top<n.bottom&&r.push(i)}return r}renderedKeys(){if(!this.#ie()){let e=[];for(let n of this._getVisibleItems()){let r=D(n);r!==void 0&&e.push(r)}return e}let e=[];for(let n=this.#s;n<this.#c;n++){let r=this.#a[n];if(!r)continue;let i=D(r);i!==void 0&&e.push(i)}return e}*selectedFilter(e){let n=this.#ie()?this.#a:this.querySelectorAll(DC),r=e=>this.interactionMode===`checked`&&!(this.#e.get(e)??e).hasAttribute(`not-checked`)&&this.selection.selected.has(e);for(let i of n)if((this.#ie()||!this.#t.has(i))&&!i.hidden)switch(e){case`selected`:this.selection.selected.has(i)&&(yield i);break;case`checked`:r(i)&&(yield i);break;case`either`:(this.selection.selected.has(i)||r(i))&&(yield i)}}getItemData(e){return this.#n.get(e)}updateItem(e,n){if(this.items===void 0)return;let r=this.getItemByKey(e);if(!r||!this.#n.has(r))return;let i=this.#ne(r),a=this.formatter?this.formatter(n,i):n;if(r instanceof HTMLLIElement){for(let e of[...r.childNodes])e.remove();this.#Z(r,a,n,i),this.interactionMode===`checked`&&this._syncCheckboxes(),this._syncItemStates()}else a instanceof Element&&this.#$(a)&&(a.tagName!==`LI`&&!a.hasAttribute(`data-list-item`)&&a.setAttribute(`data-list-item`,``),this.#ee(a,n),this.#n.set(a,n),this.#n.delete(r),this.selection.remap(e=>e===r?a:e),this.#ie()&&this.#se(r,a),r.replaceWith(a),this.interactionMode===`checked`&&this._syncCheckboxes(),this._syncItemStates());if(this.keyProperty){let r=this.items.findIndex(n=>this.#te(n,this.keyProperty)!==void 0&&String(this.#te(n,this.keyProperty))===e);if(r>=0){let e=[...this.items];e[r]=n,this.#u=!0,this.items=e}}}#J(){let e=this.items??[],n=[...this.selection.selected],r=this.selection.anchor?D(this.selection.anchor):void 0;this.#e.clear(),this.replaceChildren(...e.map((e,n)=>this.#X(e,n))),this.#Y(n,r,this.querySelectorAll(DC)),this.interactionMode===`checked`&&this._syncCheckboxes(),this._syncItemStates(),this._syncNativeDraggable(),this.#w.refreshDraggable(),this.#G()}#Y(e,n,r){if(e.length===0&&n===void 0)return;let{live:i,gone:a,anchor:o}=CC(e,n,r,D);this.selection.demote(a),this.selection.seed(i,o)}#X(e,n){let r=this.formatter?this.formatter(e,n):e;if(r instanceof Element&&this.#$(r))return r.tagName!==`LI`&&!r.hasAttribute(`data-list-item`)&&r.setAttribute(`data-list-item`,``),this.#ee(r,e),this.#n.set(r,e),r;let i=document.createElement(`li`);return this.#Z(i,r,e,n),i}#Z(e,n,r,i){typeof n==`string`?e.textContent=n:n instanceof Node?e.appendChild(n):this.formatter&&n!=null&&o(n,e),this.#Q(e,r,i),this.#ee(e,r),this.#n.set(e,r)}#Q(e,n,r){let i=yy(this.textColor?.(n,r));i===void 0?e.style.removeProperty(`color`):e.style.color=i;let a=this.icon?.(n,r);if(!vy(a)){let i=document.createElement(`span`);i.className=`item-icon`,i.style.cssText=`flex:none;display:inline-flex;align-items:center;justify-content:center;overflow:hidden;margin-inline-end:var(--list-item-icon-gap,6px);width:var(--list-item-icon-size,1em);height:var(--list-item-icon-size,1em)`;let s=yy(this.iconColor?.(n,r));s!==void 0&&(i.style.color=s),a instanceof Node?i.appendChild(a):o(a,i),e.prepend(i)}let s=this.badge?.(n,r);if(!vy(s)){let n=document.createElement(`span`);n.className=`item-badge`,n.style.cssText=`flex:none;display:inline-flex;align-items:center;margin-inline-start:auto;padding-inline-start:var(--list-item-badge-gap,8px)`,s instanceof Node?n.appendChild(s):o(s,n),e.appendChild(n)}}#$(e){return e.tagName===`LI`||e.hasAttribute(`data-list-item`)||e.tagName.includes(`-`)}#ee(e,n){if(!this.keyProperty)return;let r=this.#te(n,this.keyProperty);r!=null&&e.setAttribute(`data-key`,String(r))}#te(e,n){if(typeof e==`object`&&e&&n in e)return e[n]}#ne(e){if(this.#ie())return this.#oe(e);let n=0;for(let r of this.querySelectorAll(DC)){if(r===e)return n;this.#n.has(r)&&n++}return n}#re(){let e=this.items??[],n=[...this.selection.selected],r=this.selection.anchor?D(this.selection.anchor):void 0;this.#e.clear(),this.#o=document.createDocumentFragment(),this.#l=[],this.#a=e.map((e,n)=>this.#X(e,n));for(let e of this.#a)this.#i.add(e);this.#Y(n,r,this.#a),this.#_e(!0)}#ie(){return this.virtualize&&this.itemHeight>0}#ae(){return this.#ie()?this.#a.filter(e=>!(e.hidden||this.filterPredicate&&!this.filterPredicate(e))):this._getVisibleItems()}#oe(e){let n=this.#a.indexOf(e);if(n>=0)return n;if(this.#t.has(e)){for(let[n,r]of this.#e)if(r===e)return this.#a.indexOf(n)}return-1}#se(e,n){let r=this.#a.indexOf(e);r>=0&&(this.#a[r]=n)}#ce(e){if(this.#e.has(e)){let n=this.#e.get(e);this.#e.delete(e),n&&this.#t.delete(n)}if(this.#t.has(e)){for(let[n,r]of this.#e)if(r===e){this.#e.delete(n);break}this.#t.delete(e)}}#le(e){let n=0,r=e.previousElementSibling;for(;r;){if(r===this.#h)return this.#s+n;if(r===this.#g)return this.#a.length;r.matches(DC)&&n++,r=r.previousElementSibling}return n}#ue(e){let n=!1,r=[],i=[];for(let a of e){for(let e of a.addedNodes){if(!(e instanceof Element)||e.parentNode!==this||e.hasAttribute(`data-virtual-spacer`)||!e.matches(DC))continue;let i=this.#oe(e);if(i<0){let i=Math.min(this.#le(e),this.#a.length);this.#a.splice(i,0,e),r.push(e),n=!0}else if(this.#le(e)!==i){let r=Math.min(this.#le(e),this.#a.length-1);this.#a.splice(i,1),this.#a.splice(r,0,e),n=!0}}for(let e of a.removedNodes){if(!(e instanceof Element)||e.hasAttribute(`data-virtual-spacer`))continue;let r=this.#oe(e);r<0||e.parentNode!==this.#o&&e.parentNode!==this&&(this.#a.splice(r,1),i.push(e),n=!0)}}if(this.#W(i),r.length>0){if(this.#I(r.length))for(let e of r)this.#i.add(e);else this.#l.push(...r)}return n&&this.interactionMode===`checked`&&this._syncCheckboxes(),n&&this.search.refresh(),n}#de(){let e=this.#r?.takeRecords()??[];return e.length>0&&this.#ue(e)}#fe(){return this.renderRoot.querySelector(`ul`)}#pe(e){if(!e)return this.#_;let n=e.clientHeight||e.getBoundingClientRect().height||0;return n>0&&(this.#_=n),this.#_}#me(){if(this.#h&&this.#g)return;let e=()=>{let e=document.createElement(`li`);return e.setAttribute(`data-virtual-spacer`,``),e.setAttribute(`aria-hidden`,`true`),e};this.#h=e(),this.#g=e()}#he(){let e=this.#fe();e&&(this.#f??=new ResizeObserver(()=>{this.#_e(),this.#be(),this.#G()}),this.#f.observe(e))}#ge;#_e(e=!1){if(!this.#ie()||!this.isConnected)return;let n=this.#de()||e;this.#he();let r=this.#a.length,i=this.#fe(),a=this.itemHeight,o=this.#pe(i),s=Math.max(0,r*a-o),c=Math.min(Math.max(0,i?i.scrollTop:0),s);i&&Math.abs(i.scrollTop-c)>.5&&(i.scrollTop=c);let l=Math.floor(c/a),u=Math.ceil((c+o)/a),d=r===0?0:Math.max(0,l-3),f=Math.min(r,u+3);if(!n&&d===this.#s&&f===this.#c)return;if(r===0)this.#a.length>0&&this.#o.append(...this.#a),this.replaceChildren();else{this.#me();let e=this.#h,n=this.#g;if(!e||!n)return;e.style.height=`${d*a}px`,n.style.height=`${Math.max(0,(r-f)*a)}px`;let i=this.#a.slice(d,f),o=[...this.#a.slice(0,d),...this.#a.slice(f)];o.length>0&&this.#o.append(...o),this.replaceChildren(e,...i,n)}this.#s=d,this.#c=f,this.interactionMode===`checked`&&this._syncCheckboxes(),this._syncItemStates();let p=this.#ae().length;for(let e=d;e<f;e++){let n=this.#a[e];n&&this.#ve(n,e+1,p)}let m=this.#l;this.#l=[];for(let e of m)this.#i.add(e),e.parentNode===this&&$n(e);this.search.repaintHighlights(),n&&this.#G()}#ve(e,n,r){e instanceof HTMLElement&&(e.draggable=this.itemsDraggable&&this._isCheckable(e)&&!e.hasAttribute(`data-editing`),n!==void 0&&r!==void 0&&(e.setAttribute(`aria-setsize`,String(r)),e.setAttribute(`aria-posinset`,String(n)),(!e.hasAttribute(`role`)||e.hasAttribute(`data-aria-role`))&&(e.setAttribute(`role`,`option`),e.setAttribute(`data-aria-role`,``),e.setAttribute(`aria-selected`,String(this.selection.selected.has(e)))))),e.removeAttribute(`data-marquee`),e.removeAttribute(`data-drag-origin`),e.removeAttribute(`data-drop-target`)}#ye(){for(let e of this.#a)this.#i.add(e);this.#a.length>0?this.replaceChildren(...this.#a):this.replaceChildren(),this.#o=document.createDocumentFragment(),this.#h=void 0,this.#g=void 0,this.#s=0,this.#c=0,this.#l=[],this._syncCheckboxes(),this._syncItemStates(),this._syncNativeDraggable(),this.#w.refreshDraggable(),this.#be()}#be(){this.#d===0&&(this.#d=requestAnimationFrame(()=>{this.#d=0,this.#_e(),this.#xe()}))}#xe(){let e=this.renderedKeys(),n=this.visibleKeys();OC(this.#p,e)&&OC(this.#m,n)||(this.#p=e,this.#m=n,this._dispatch(`vertical-list-viewport-change`,{renderedKeys:e,visibleKeys:n}))}_getVisibleItems(){return Array.from(this.querySelectorAll(DC)).filter(e=>!(this.#t.has(e)||e.hidden||this.filterPredicate&&!this.filterPredicate(e)))}_isCheckable(e){return this.interactionMode!==`checked`||!(this.#e.get(e)??e).hasAttribute(`not-checked`)}_syncItemStates(){for(let e of this.querySelectorAll(DC)){if(this.#t.has(e))continue;let n=this.#e.get(e)??e;e.toggleAttribute(`data-tickled`,this.tickled.isTickled(e)),e.toggleAttribute(`data-selected`,this.selection.selected.has(e)),xr(e,yr(D(e),this.#L,this.selection.selected.has(e))),e.hasAttribute(`data-aria-role`)&&e.setAttribute(`aria-selected`,String(this.selection.selected.has(e))),this.interactionMode===`checked`?e.toggleAttribute(`data-checked`,!n.hasAttribute(`not-checked`)&&this.selection.selected.has(e)):e.removeAttribute(`data-checked`)}this.dataset.inputMode=this.tickled.inputMode,this._syncCheckboxes()}_syncCheckboxes(){let e=this.interactionMode===`checked`,n=typeof this.checkboxRenderer==`function`,r=this.#ie()?[this,this.#o]:[this];if(e)for(let e of r)for(let n of Array.from(e.children)){if(!n.hasAttribute(`data-list-item`)||n.parentNode!==e)continue;let r=document.createElement(`li`);r.className=`ixfx-custom-row`;let i=n.getAttribute(`data-key`),a=n.getAttribute(`data-search-label`);i!==null&&r.setAttribute(`data-key`,i),a!==null&&r.setAttribute(`data-search-label`,a),n.removeAttribute(`data-list-item`),e.insertBefore(r,n),r.appendChild(n),this.#e.set(r,n),this.#t.add(n),this.#n.has(n)&&this.#n.set(r,this.#n.get(n)),this.#ie()&&this.#se(n,r)}else{for(let[e,n]of this.#e){if(e.parentNode!==this&&e.parentNode!==this.#o)continue;n.setAttribute(`data-list-item`,``);let r=e.parentNode;r&&r.insertBefore(n,e),e.remove(),this.#n.delete(e),this.#ie()&&this.#se(e,n)}this.#e.clear(),this.#t.clear()}for(let r of this.querySelectorAll(`li`)){let i=r.querySelector(`.ixfx-list-checkbox`);if(!e||(this.#e.get(r)??r).hasAttribute(`not-checked`)){i&&i.remove();continue}let a=i?.classList.contains(`ixfx-list-checkbox-custom`)??!1;i&&a!==n&&i.remove();let s=r.querySelector(`.ixfx-list-checkbox`);if(!s){if(n){let e=this.checkboxRenderer,n=e.margin??`0`,i=e.width??`24px`;s=this._createCustomCheckbox(r,n,i)}else s=this._createNativeCheckboxCell(r);r.prepend(s)}let c=this.selection.selected.has(r),l=yr(D(r),this.#L,c);if(n){if(s.setAttribute(`aria-checked`,l?`mixed`:String(c)),s.toggleAttribute(`data-checked`,c),s.toggleAttribute(`data-partial`,l),this.checkboxRenderer){let e=typeof this.checkboxRenderer==`function`?this.checkboxRenderer:this.checkboxRenderer.renderer;o(e(c),s)}}else{let e=s.querySelector(`input.ixfx-list-checkbox`);e&&(e.checked=c,e.indeterminate=l),s.setAttribute(`aria-checked`,l?`mixed`:String(c))}}}_createNativeCheckboxCell(e){let n=document.createElement(`span`);n.className=`ixfx-list-checkbox ixfx-list-checkbox-native`,n.style.cssText=`display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;align-self:stretch;width:18px;margin:0 6px 0 0;cursor:pointer;pointer-events:auto`,n.tabIndex=-1,n.setAttribute(`role`,`checkbox`),n.setAttribute(`part`,`checkbox`),n.addEventListener(`click`,n=>{n.stopPropagation(),this.selection.handleCheckbox(e)});let r=document.createElement(`input`);return r.type=`checkbox`,r.className=`ixfx-list-checkbox`,r.style.cssText=`pointer-events:none;cursor:pointer;margin:0`,n.appendChild(r),n}_createCustomCheckbox(e,n,r){let i=document.createElement(`span`);return i.className=`ixfx-list-checkbox ixfx-list-checkbox-custom`,i.style.cssText=`display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;align-self:stretch;width:${r};margin:${n};cursor:pointer;pointer-events:auto`,i.tabIndex=-1,i.setAttribute(`role`,`checkbox`),i.setAttribute(`part`,`checkbox`),i.addEventListener(`click`,n=>{n.stopPropagation(),this.selection.handleCheckbox(e)}),i}_findListItem(e){for(let n of e)if(n instanceof Element){if(n===this)break;if(n.parentElement===this&&n.matches(DC))return n}}_dispatch(e,n){this.dispatchEvent(new CustomEvent(e,{detail:n,bubbles:!0,composed:!0}))}_dispatchCancelable(e,n){return this.dispatchEvent(new CustomEvent(e,{detail:n,bubbles:!0,composed:!0,cancelable:!0}))}_activateItem(e,n=`pointer`){this.selection.handleReplace(e,n),this._dispatch(`list-activate`,{item:e})}activateKey(e){let n=this.#V(e);n&&this._activateItem(n,`api`)}#Se;#Ce(){let e=this.#Se;this.#Se=void 0,this.#Te(void 0,!1),e&&this._dispatch(`list-drag-leave`,{key:e.item?D(e.item):void 0})}#we;#Te(e,n){this.#we?.removeAttribute(`data-drop-target`),this.#we=n?e:void 0,this.toggleAttribute(`data-drop-target`,n&&e===void 0),n&&e&&e.setAttribute(`data-drop-target`,``)}#Ee(e,n,r){return!this.selection.selected.has(e)&&this.interactionMode!==`manual`&&this._isCheckable(e)&&this.selection.replace(e),this._dispatchCancelable(`list-context-menu`,{key:D(e),item:e,x:n,y:r,selectedKeys:this.selection.selectedKeys})}#De;get editingKey(){return this.#De?.key}#Oe(e){return this.#De!==void 0&&e.composedPath().includes(this.#De.label)}beginEdit(e){this.#ke();let n=this.editValidator;if(!n)return!1;let r=this.#V(e);if(!(r instanceof HTMLElement)||r.parentNode!==this)return!1;let i=r.querySelector(`[data-edit-label]`)??r,a=i.getAttribute(`data-edit-value`)??i.textContent?.trim()??``,o=document.createElement(`ixfx-editable-label`);o.mode=`label`,o.value=a,o.validator=r=>n(r,e),o.style.cssText=`flex:1;min-width:0;--label-align:left;--label-padding:0 var(--space-xs,3px)`;let s={key:e,row:r,container:i,saved:[...i.childNodes],label:o,committed:void 0,refocus:!1};this.#De=s,o.addEventListener(`change`,e=>{e.stopPropagation(),s.committed=e.detail.value}),o.addEventListener(`input`,e=>e.stopPropagation()),o.addEventListener(`keydown`,e=>{s.refocus=e.key===`Enter`||e.key===`Escape`});for(let e of[`pointerdown`,`dragstart`])o.addEventListener(e,e=>e.stopPropagation());return o.addEventListener(`focusout`,()=>this.#ke()),i.replaceChildren(o),r.setAttribute(`data-editing`,``),r.draggable=!1,r.scrollIntoView({block:`nearest`,inline:`nearest`}),o.updateComplete.then(()=>{this.#De===s&&o.shadowRoot?.querySelector(`.content`)?.click()}),!0}#ke(){let e=this.#De;e&&(this.#De=void 0,e.container.isConnected&&e.container.replaceChildren(...e.saved),e.row.removeAttribute(`data-editing`),this.#ve(e.row),e.refocus&&this.focus(),e.committed===void 0?this._dispatch(`list-edit-cancel`,{key:e.key}):this._dispatch(`list-edit-commit`,{key:e.key,value:e.committed}))}static{this.styles=[w,Tr(`y`),Ut,r`
|
|
7069
|
+
`]}};E([d({type:Number})],bC.prototype,`min`,void 0),E([d({type:Number})],bC.prototype,`max`,void 0),E([d({type:Number})],bC.prototype,`step`,void 0),E([d({type:Number})],bC.prototype,`stops`,void 0),E([d({type:Number,attribute:`drag-sensitivity`})],bC.prototype,`dragSensitivity`,void 0),E([d({attribute:`fill-style`})],bC.prototype,`fillStyle`,void 0),E([d({attribute:`linear-style`})],bC.prototype,`linearStyle`,void 0),E([d({attribute:`circular-style`})],bC.prototype,`circularStyle`,void 0),E([d({type:Boolean,attribute:`no-drag`})],bC.prototype,`noDrag`,void 0),E([d({type:Number})],bC.prototype,`precision`,void 0),bC=E([T(`ixfx-editable-number`)],bC);function xC(e,n){let r=/* @__PURE__ */ new Map;for(let i of e){let e=n(i);e!==void 0&&!r.has(e)&&r.set(e,i)}return r}function SC(e,n){let r=[];for(let i of e)n(i)||r.push(i);return r}function CC(e,n,r,i){let a=/* @__PURE__ */ new Map,o=[];for(let n of e){let e=i(n);e===void 0?o.push(n):a.set(e,n)}let s=[],c=/* @__PURE__ */ new Set,l;for(let e of r){let r=i(e);r!==void 0&&(a.has(r)&&!c.has(r)&&(s.push(e),c.add(r)),r===n&&(l??=e))}for(let[e,n]of a)c.has(e)||o.push(n);return{live:s,gone:o,anchor:l}}function wC(e,n,r){let i=e??n;return i!==void 0&&r(i)?{pending:void 0,apply:i}:{pending:i,apply:void 0}}function TC(e,n,r,i){if(n<=0||r===0)return iy(e,void 0,0);let a=Math.min(r-1,Math.max(0,Math.floor(e/n)));return iy(e,i(a),a*n)}function EC(e,n,r){if(!e.anchor)return e.top;let i=r(e.anchor.key);return i<0?void 0:i*n+e.anchor.offset}const DC=`li:not([data-virtual-spacer]), [data-list-item]:not([data-virtual-spacer])`;function OC(e,n){if(e===void 0||e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==n[r])return!1;return!0}let G=class extends n{constructor(...e){super(...e),this.selectionMode=`single`,this.interactionMode=`standard`,this.itemWrap=`stop`,this.itemsDraggable=!1,this.keyProperty=``,this.virtualize=!1,this.itemHeight=0,this.itemsDroppable=!1,this.#e=/* @__PURE__ */ new Map,this.#t=/* @__PURE__ */ new Set,this.#n=/* @__PURE__ */ new WeakMap,this.#i=/* @__PURE__ */ new WeakSet,this.#a=[],this.#o=document.createDocumentFragment(),this.#s=0,this.#c=0,this.#l=[],this.#u=!1,this.#d=0,this.#_=0,this.#v=!1,this.#y=new cy(this,{kind:`vertical-list`,capture:()=>this.getViewState()}),this.#x=!1,this.selection=new _r({getOrderedItems:()=>this.#ae(),isSelectable:e=>this._isCheckable(e),getModes:()=>({selectionMode:this.selectionMode,interactionMode:this.interactionMode}),getKey:D,onIntent:e=>this._dispatchCancelable(`list-select-intent`,e)===!1,onChange:(e,n)=>{this._syncItemStates(),this.#y.notify(),this._dispatch(`list-select`,{selected:e,previous:n,selectedKeys:this.selection.selectedKeys,previousKeys:At(n)})}}),this.tickled=(e=>new oe(e,{getItems:()=>e.#ae().map(e=>({id:e,enabled:!e.hasAttribute(`not-checked`)})),onTickle:n=>{e.tickled.inputMode===`keyboard`&&(e.#y.isRestoring||(e.#b=void 0),e.#y.notify()),n!==void 0&&this._dispatch(`list-tickle`,{item:n})},onStateChange:()=>this._syncItemStates(),get itemWrap(){return e.itemWrap},hoverDisabled:()=>this.#O.isDragging||this.#w.isDragging}))(this),this.#S=!1,this.#C=0,this.#w=new rr(this,{source:`vertical-list`,isEnabled:()=>this.itemsDraggable&&this.selectionMode!==`none`&&this._getVisibleItems().length>0,resolveEventToKey:e=>{if(!(e instanceof Element))return;let n=e.closest?.(DC);if(n&&this.contains(n)&&!this.#t.has(n))return D(n)},prepareSelection:e=>this.#T(e),getMetrics:()=>({}),getRenderer:()=>this.dragPreviewRenderer,getDragPreviewSourceResolver:()=>this.dragPreviewSource,dispatch:e=>this._dispatchCancelable(`list-native-drag-start`,e),onActiveChange:(e,n)=>{this.#S=e,this.toggleAttribute(`data-native-dragging`,e);for(let r of this._getVisibleItems())r.toggleAttribute(`data-drag-origin`,e&&n!==void 0&&D(r)===n);if(e){let e=this.selection.selected.size;this.setAttribute(`aria-label`,e<=1?`Dragging 1 item`:`Dragging ${e} items`)}else this.removeAttribute(`aria-label`);this.requestUpdate()},onEnd:()=>{this.#S=!1,this.toggleAttribute(`data-native-dragging`,!1),this.removeAttribute(`aria-label`);for(let e of this._getVisibleItems())e.removeAttribute(`data-drag-origin`);if(this.#ie())for(let e of this.#a)e.removeAttribute(`data-drag-origin`);this.#E()},syncLightDomDraggable:()=>this._syncNativeDraggable()}),this.#O=new Gn(this,{getSurface:()=>this.renderRoot.querySelector(`.container`),isEnabled:()=>!this.#ie()&&this.selection.canDragSelect()&&this._getVisibleItems().length>0&&!this.hasAttribute(`disable-drag-select`),hitTest:e=>this.#k(e),getBaseSelection:()=>this.selection.selected,onPreview:(e,n)=>{this.#D=n;for(let n of this._getVisibleItems())n.toggleAttribute(`data-marquee`,e.has(n));this.requestUpdate()},onCommit:e=>{this.selection.applyDragSelection(e);for(let e of this._getVisibleItems())e.removeAttribute(`data-marquee`);this.#D=void 0,this.requestUpdate()},autoScroll:(e,n)=>{let r=this.renderRoot.querySelector(`ul`);r&&(r.scrollTop+=n)}}),this.search=new Ht(this,{adapter:Nt(this,{itemSelector:DC,getLabel:e=>e.getAttribute(`data-search-label`)??e.textContent?.trim()??``,highlightKey:`vertical-list-search`,getAllItems:()=>this.#ae(),observeContainer:!1})}),this.#L=/* @__PURE__ */ new Set,this.#ge=()=>{this.#y.pendingScroll||this.#y.notify(),this.#d===0&&(this.#d=requestAnimationFrame(()=>{this.#d=0,this.#_e(),this.#xe()}))},this._onPointerOver=e=>{let n=this._findListItem(e.composedPath());n&&this.tickled.handlePointerEnter(n)},this._onPointerLeave=e=>{this.tickled.handlePointerLeave(e)},this._onKeyDown=e=>{if(!(this.search.isOpen||this.#Oe(e))){if(e.key===`ContextMenu`||e.shiftKey&&e.key===`F10`){let n=this.tickled.tickledId;if(n){e.preventDefault();let r=n.getBoundingClientRect();this.#Ee(n,r.left,r.bottom)}}else if((e.ctrlKey||e.metaKey)&&e.key===`a`)this.selection.canSelectAll()&&(e.preventDefault(),this.selection.selectAll(`keyboard`));else switch(e.key){case`ArrowDown`:if(e.preventDefault(),this.tickled.handleKeyboardNavigation(`next`),this.#R(),e.shiftKey&&(this.interactionMode===`vscode`||this.interactionMode===`manual`)){let e=this.tickled.tickledId;e&&this.selection.handleExtend(e)}break;case`ArrowUp`:if(e.preventDefault(),this.tickled.handleKeyboardNavigation(`previous`),this.#R(),e.shiftKey&&(this.interactionMode===`vscode`||this.interactionMode===`manual`)){let e=this.tickled.tickledId;e&&this.selection.handleExtend(e)}break;case`Home`:e.preventDefault(),this.tickled.handleKeyboardNavigation(`first`),this.#R();break;case`End`:e.preventDefault(),this.tickled.handleKeyboardNavigation(`last`),this.#R();break;case`PageDown`:e.preventDefault(),this.#B(1);break;case`PageUp`:e.preventDefault(),this.#B(-1);break;case`Enter`:{let n=this.tickled.tickledId;n&&(e.preventDefault(),this._dispatch(`list-item-click`,{item:n}),this._activateItem(n,`keyboard`));break}case` `:{let n=this.tickled.tickledId;n&&(e.preventDefault(),this.selection.handleSpace(n));break}case`Escape`:this.selection.handleClear(`keyboard`)}}},this._onClick=e=>{if(this.#Oe(e)||this.#O.isDragging||this.#w.isDragging||this.#C!==0)return;let n=this._findListItem(e.composedPath());n&&(this._dispatch(`list-item-click`,{item:n}),this.selection.handleClick(n,hr(e)))},this._onDblClick=e=>{if(this.#Oe(e))return;let n=this._findListItem(e.composedPath());n&&this._activateItem(n)},this._onDragOver=e=>{let n=e.dataTransfer;if(!this.itemsDroppable||!n||this.#Oe(e))return;let r=this._findListItem(e.composedPath());this.canDrop&&!this.canDrop(r,n)?this.#Ce():(this.#Se&&this.#Se.item!==r&&this.#Ce(),this.#Se={item:r},this._dispatchCancelable(`list-drag-over`,{key:r?D(r):void 0,item:r,dataTransfer:n})?this.#Te(void 0,!1):(e.preventDefault(),n.dropEffect===`none`&&(n.dropEffect=`copy`),this.#Te(r,!0)))},this._onDragLeave=e=>{let n=e.relatedTarget;n instanceof Node&&this.contains(n)||this.#Ce()},this._onDrop=e=>{let n=e.dataTransfer;if(!this.itemsDroppable||!n||this.#Oe(e))return;let r=this._findListItem(e.composedPath());this.canDrop&&!this.canDrop(r,n)?this.#Ce():(e.preventDefault(),this.#Se=void 0,this.#Te(void 0,!1),this._dispatch(`list-drop`,{key:r?D(r):void 0,item:r,dataTransfer:n}))},this._onContextMenu=e=>{if(this.#Oe(e))return;let n=this._findListItem(e.composedPath());n&&(this.#Ee(n,e.clientX,e.clientY)||e.preventDefault())}}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;#C;#w;#T(e){let n=this.#V(e);if(!n||!this._isCheckable(n))return;this.selection.selected.has(n)||this.selection.replace(n);let r=this.#ae(),i=[];r.forEach(n=>{if(!this.selection.selected.has(n))return;let r=this.#oe(n);i.push({key:D(n)??e,index:r,item:n,element:n})});let a=i.find(n=>n.key===e);if(a)return{origin:a,selected:i}}_syncNativeDraggable(){if(this.isConnected)for(let e of this.querySelectorAll(DC))this.#t.has(e)||e instanceof HTMLElement&&(e.draggable=this.itemsDraggable&&this._isCheckable(e))}#E(){this.#C&&clearTimeout(this.#C),this.#C=window.setTimeout(()=>{this.#C=0},0)}#D;#O;#k(e){let n=this.renderRoot.querySelector(`.container`);if(!n)return[];let r=n.getBoundingClientRect(),i=e.x,a=e.y,o=e.x+e.width,s=e.y+e.height,c=[];for(let e of this._getVisibleItems()){let n=e.getBoundingClientRect(),l=n.left-r.left,u=n.top-r.top;l<=o&&l+n.width>=i&&u<=s&&u+n.height>=a&&c.push(e)}return c}#A(e){return`left:${e.x}px;top:${e.y}px;width:${Math.max(0,e.width)}px;height:${Math.max(0,e.height)}px`}#j;#M;get registry(){return this.#j}#N(){let e=this.searchModes?.trim(),n;if(e===void 0)n=[...Bt];else{let r=new Set(e.split(/\s+/));n=Bt.filter(e=>r.has(e))}return this.#ie()?n.filter(e=>e!==`filter`):n}#P(){this.#j&&(this.search.setModes(this.#N()),this.#M?.(),this.#M=zt(this.#j,this.search))}connectedCallback(){super.connectedCallback(),this.hasAttribute(`tabindex`)||(this.tabIndex=0),this.addEventListener(`pointerover`,this._onPointerOver),this.addEventListener(`pointerleave`,this._onPointerLeave),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`click`,this._onClick),this.addEventListener(`dblclick`,this._onDblClick),this.addEventListener(`dragover`,this._onDragOver),this.addEventListener(`dragleave`,this._onDragLeave),this.addEventListener(`drop`,this._onDrop),this.addEventListener(`contextmenu`,this._onContextMenu);for(let e of this.querySelectorAll(DC))this.#i.add(e);this.#r??=new MutationObserver(e=>this.#F(e)),this.#r.observe(this,{childList:!0}),this.#j??=Xt(),this.#P(),this.#he()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`pointerover`,this._onPointerOver),this.removeEventListener(`pointerleave`,this._onPointerLeave),this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`click`,this._onClick),this.removeEventListener(`dblclick`,this._onDblClick),this.removeEventListener(`dragover`,this._onDragOver),this.removeEventListener(`dragleave`,this._onDragLeave),this.removeEventListener(`drop`,this._onDrop),this.removeEventListener(`contextmenu`,this._onContextMenu),this.#Ce(),this.#De=void 0,this.#r?.disconnect(),this.#f?.disconnect(),this.#f=void 0,this.#d!==0&&(cancelAnimationFrame(this.#d),this.#d=0),this.#M?.(),this.#M=void 0,this.#j=void 0,this.#C&&=(clearTimeout(this.#C),0)}firstUpdated(){this.#he(),this.#y.observeScrollTarget(this),this.#G()}#F(e){if(!this.isConnected)return;if(this.#ie()){this.#_e(this.#ue(e)),this.#be();return}let n=[];for(let r of e)for(let e of r.addedNodes)e instanceof HTMLElement&&e.parentElement===this&&e.matches(DC)&&(this.#i.has(e)||this.#e.has(e)||this.#t.has(e)||(this.#i.add(e),n.push(e)));if(this.#be(),e.some(e=>e.removedNodes.length>0)&&this.#W(SC(this.selection.selected,e=>e.parentNode===this||this.#t.has(e))),this.#G(),n.length!==0&&!this.#I(n.length))for(let e of n)$n(e)}#I(e){return e>=this.querySelectorAll(DC).length}updated(e){if(super.updated(e),e.has(`searchModes`)&&this.#P(),e.has(`virtualize`)||e.has(`itemHeight`)){let n=(e.has(`virtualize`)?e.get(`virtualize`):this.virtualize)===!0&&((e.has(`itemHeight`)?e.get(`itemHeight`):this.itemHeight)??0)>0;if(this.#ie()){if(!n){this.#o=document.createDocumentFragment(),this.#a=[...this.querySelectorAll(DC)];for(let e of this.#a)this.#i.add(e);this.#l=[]}this.#_e(!0)}else n?this.#ye():this.virtualize&&!this.#v&&(this.#v=!0,console.warn(`ixfx-vertical-list: virtualize needs item-height > 0 — running non-virtualized.`));this.#P()}if((e.has(`items`)||e.has(`formatter`)||e.has(`keyProperty`)||e.has(`icon`)||e.has(`iconColor`)||e.has(`textColor`)||e.has(`badge`))&&this.items!==void 0&&(this.#u?this.#u=!1:this.#ie()?this.#re():this.#J()),e.has(`interactionMode`)){this.selection.clearAnchor();let n=this.selection.selected,r=e.get(`interactionMode`)===`checked`?new Map(this.#e):null;if(this._syncCheckboxes(),n.size>0){if(r&&r.size>0)this.selection.remap(e=>r.get(e)??e);else if(this.#e.size>0){let e=new Map([...this.#e].map(([e,n])=>[n,e]));this.selection.remap(n=>e.get(n)??n)}}this._syncItemStates()}else e.has(`checkboxRenderer`)&&this.interactionMode===`checked`&&this._syncCheckboxes();(e.has(`itemsDraggable`)||e.has(`interactionMode`))&&(this._syncNativeDraggable(),this.#w.refreshDraggable())}get selectedItem(){return[...this.selection.selected].at(-1)}get selectedItems(){return this.selection.selected}addItem(e,n){let r;if(typeof e==`string`){let n=document.createElement(`li`);n.textContent=e,r=n}else r=e;n?.notChecked&&r.setAttribute(`not-checked`,``),this.appendChild(r),this.#ie()?this.#_e(!0):(this.interactionMode===`checked`&&this._syncCheckboxes(),this.search.refresh(),this.#G())}removeItem(e){return this.#W([e]),this.#ie()?(e.parentNode===this?nr(e):Object.assign(Promise.resolve(),{animation:void 0})).then(()=>{let n=this.#oe(e);n>=0&&this.#a.splice(n,1),this.#ce(e),e.remove(),this.interactionMode===`checked`&&this._syncCheckboxes(),this.#_e(!0)}):nr(e).then(()=>{e.remove(),this.interactionMode===`checked`&&this._syncCheckboxes()})}removeItems(e){return Promise.all([...e].map(e=>this.removeItem(e))).then(()=>void 0)}clearItems(){this.#e.clear(),this.#ie()&&(this.#a=[],this.#o=document.createDocumentFragment(),this.#l=[]),this.replaceChildren(),this.selection.reset(),this._syncItemStates(),this.search.refresh(),this.#ie()?this.#_e(!0):this.#G()}setItems(e){if(this.#ie()){this.#e.clear(),this.#o=document.createDocumentFragment(),this.#l=[],this.#a=[...e];for(let e of this.#a)this.#i.add(e);this.selection.reset(),this.search.refresh(),this.#_e(!0)}else{for(let n of e)this.appendChild(n);this.interactionMode===`checked`&&this._syncCheckboxes(),this.search.refresh(),this.#G()}}dispatch(e,n){this.#j?.invoke(e,n)}select(e){this.selection.replace(e)}selectMany(e){this.selection.selectMany(e)}deselect(e){this.selection.deselect(e)}clearSelection(){this.selection.clear()}selectAll(){this.selection.canSelectAll()&&this.selection.selectAll()}get selectedKeys(){return this.selection.selectedKeys}#L;get partialKeys(){return this.#L}set partialKeys(e){let n=new Set(e);br(n,this.#L)||(this.#L=n,this._syncItemStates())}get tickledKey(){let e=this.tickled.tickledId;return e?D(e):void 0}selectKeys(e){this.selection.selectKeys(e,e=>this.#V(e))}addSelectedKeys(e){this.selection.addKeys(e,e=>this.#V(e))}removeSelectedKeys(e){this.selection.removeKeys(e,e=>this.#V(e))}focusKey(e){if(this.#ie()){let n=this.#a.findIndex(n=>D(n)===e);if(n<0)return;let r=this.renderRoot.querySelector(`ul`);if(r){let e=this.itemHeight,i=r.clientHeight,a=n*e,o=(n+1)*e,s=r.scrollTop,c=i,l=s;a<s?l=a:o>s+c&&(l=o-c),l!==s&&(r.scrollTop=l),this.#_e(!0)}}let n=this.#V(e);n&&n.parentNode===this&&(this.#b=void 0,this.tickled.focus(n),n.scrollIntoView({block:`nearest`,inline:`nearest`}))}#R(){let e=this.tickled.tickledId,n=e?D(e):void 0;n!==void 0&&this.focusKey(n)}#z(){let e=this.#fe();if(!e)return 1;let n=e.clientHeight;if(this.#ie())return Math.max(1,Math.floor(n/this.itemHeight));let r=this.querySelector(`li[data-key]`);if(!r)return 1;let i=r.offsetHeight||this.itemHeight;return Math.max(1,Math.floor(n/i))}#B(e){let n=this.#z(),r=this.#ae().filter(e=>!e.hasAttribute(`not-checked`));if(r.length===0)return;let i=this.tickled.tickledId?D(this.tickled.tickledId):void 0,a=i===void 0?-1:r.findIndex(e=>D(e)===i),o=e===1?n-1:0,s=a<0?o:a+e*n;this.tickled.handleKeyboardNavigation(r[Math.min(r.length-1,Math.max(0,s))]),this.#R()}#V(e){if(this.#ie())return this.#a.find(n=>D(n)===e);for(let n of this.querySelectorAll(DC))if(!this.#t.has(n)&&D(n)===e)return n}getItemByKey(e){return this.#V(e)}getViewState(e){let n=e?.includePending??!0,r=this.tickled.inputMode===`keyboard`?this.tickledKey:void 0;return this.#y.shape({selected:pr(this.selection.selectedKeys,n?this.selection.pendingKeys:[]),focus:r??(n?this.#b:void 0),scroll:(n?this.#y.pendingScroll:void 0)??this.#K()},e)}setViewState(e){this.#y.accepts(e)&&(this.#y.restoring(()=>{if(e.selected){let n=this.#H();this.selection.restoreKeys(e.selected,e=>n.get(e))}e.focus!==void 0&&(this.#b=e.focus),e.scroll&&(this.#y.pendingScroll=e.scroll),this.#y.notify()}),this.#G())}clearPendingViewState(){this.selection.clearPending(),this.#b=void 0,this.#y.pendingScroll=void 0}#H(){return this.#ie()?xC(this.#a,D):xC([...this.querySelectorAll(DC)].filter(e=>!this.#t.has(e)),D)}#U(e){return this.#ie()?this.#oe(e)>=0:e.parentNode===this||this.#t.has(e)}#W(e){e.length!==0&&this.selection.demote(e)&&(this._syncItemStates(),this.#y.notify(`data`))}#G(){if(!this.#x){this.#x=!0;try{this.#y.restoring(()=>{let e,n=n=>(e??=this.#H()).get(n);this.selection.resolvePending(n);let r=this.tickled.tickledId,i=r!==void 0&&!this.#U(r);if(this.#b===void 0&&!i)return;let a=i&&this.tickled.inputMode===`keyboard`?D(r):void 0;i&&this.tickled.clearTickled();let o=wC(this.#b,a,e=>n(e)!==void 0);this.#b=o.pending,o.apply!==void 0&&(this.tickled.setInputMode(`keyboard`),this.tickled.setTickled(n(o.apply)),this.#y.notify())}),this.#y.applyPendingScroll(e=>this.#q(e))}finally{this.#x=!1}}}#K(){let e=this.#fe();if(e)return this.#ie()?TC(e.scrollTop,this.itemHeight,this.#a.length,e=>D(this.#a[e])):ty(e,this._getVisibleItems(),D)}#q(e){let n=this.#fe();if(!n||n.clientHeight===0)return!1;if(this.#ie()){let r=EC(e,this.itemHeight,e=>this.#a.findIndex(n=>D(n)===e));if(r===void 0)return!1;let i=Math.max(0,this.#a.length*this.itemHeight-this.#pe(n));return n.scrollTop=Math.max(0,Math.min(r,i)),this.#_e(),r<=i+1}if(!e.anchor)return ry(n,e.top);let r=this.#H().get(e.anchor.key);return!r||r.hidden?!1:ny(n,r,e.anchor.offset)}visibleKeys(){let e=this.renderRoot.querySelector(`ul`);if(!e)return[];let n=e.getBoundingClientRect(),r=[];for(let e of this._getVisibleItems()){let i=D(e);if(i===void 0)continue;let a=e.getBoundingClientRect();a.bottom>n.top&&a.top<n.bottom&&r.push(i)}return r}renderedKeys(){if(!this.#ie()){let e=[];for(let n of this._getVisibleItems()){let r=D(n);r!==void 0&&e.push(r)}return e}let e=[];for(let n=this.#s;n<this.#c;n++){let r=this.#a[n];if(!r)continue;let i=D(r);i!==void 0&&e.push(i)}return e}*selectedFilter(e){let n=this.#ie()?this.#a:this.querySelectorAll(DC),r=e=>this.interactionMode===`checked`&&!(this.#e.get(e)??e).hasAttribute(`not-checked`)&&this.selection.selected.has(e);for(let i of n)if((this.#ie()||!this.#t.has(i))&&!i.hidden)switch(e){case`selected`:this.selection.selected.has(i)&&(yield i);break;case`checked`:r(i)&&(yield i);break;case`either`:(this.selection.selected.has(i)||r(i))&&(yield i)}}getItemData(e){return this.#n.get(e)}updateItem(e,n){if(this.items===void 0)return;let r=this.getItemByKey(e);if(!r||!this.#n.has(r))return;let i=this.#ne(r),a=this.formatter?this.formatter(n,i):n;if(r instanceof HTMLLIElement){for(let e of[...r.childNodes])e.remove();this.#Z(r,a,n,i),this.interactionMode===`checked`&&this._syncCheckboxes(),this._syncItemStates()}else a instanceof Element&&this.#$(a)&&(a.tagName!==`LI`&&!a.hasAttribute(`data-list-item`)&&a.setAttribute(`data-list-item`,``),this.#ee(a,n),this.#n.set(a,n),this.#n.delete(r),this.selection.remap(e=>e===r?a:e),this.#ie()&&this.#se(r,a),r.replaceWith(a),this.interactionMode===`checked`&&this._syncCheckboxes(),this._syncItemStates());if(this.keyProperty){let r=this.items.findIndex(n=>this.#te(n,this.keyProperty)!==void 0&&String(this.#te(n,this.keyProperty))===e);if(r>=0){let e=[...this.items];e[r]=n,this.#u=!0,this.items=e}}}#J(){let e=this.items??[],n=[...this.selection.selected],r=this.selection.anchor?D(this.selection.anchor):void 0;this.#e.clear(),this.replaceChildren(...e.map((e,n)=>this.#X(e,n))),this.#Y(n,r,this.querySelectorAll(DC)),this.interactionMode===`checked`&&this._syncCheckboxes(),this._syncItemStates(),this._syncNativeDraggable(),this.#w.refreshDraggable(),this.#G()}#Y(e,n,r){if(e.length===0&&n===void 0)return;let{live:i,gone:a,anchor:o}=CC(e,n,r,D);this.selection.demote(a),this.selection.seed(i,o)}#X(e,n){let r=this.formatter?this.formatter(e,n):e;if(r instanceof Element&&this.#$(r))return r.tagName!==`LI`&&!r.hasAttribute(`data-list-item`)&&r.setAttribute(`data-list-item`,``),this.#ee(r,e),this.#n.set(r,e),r;let i=document.createElement(`li`);return this.#Z(i,r,e,n),i}#Z(e,n,r,i){typeof n==`string`?e.textContent=n:n instanceof Node?e.appendChild(n):this.formatter&&n!=null&&o(n,e),this.#Q(e,r,i),this.#ee(e,r),this.#n.set(e,r)}#Q(e,n,r){let i=yy(this.textColor?.(n,r));i===void 0?e.style.removeProperty(`color`):e.style.color=i;let a=this.icon?.(n,r);if(!vy(a)){let i=document.createElement(`span`);i.className=`item-icon`,i.style.cssText=`flex:none;display:inline-flex;align-items:center;justify-content:center;overflow:hidden;margin-inline-end:var(--list-item-icon-gap,6px);width:var(--list-item-icon-size,1em);height:var(--list-item-icon-size,1em)`;let s=yy(this.iconColor?.(n,r));s!==void 0&&(i.style.color=s),a instanceof Node?i.appendChild(a):o(a,i),e.prepend(i)}let s=this.badge?.(n,r);if(!vy(s)){let n=document.createElement(`span`);n.className=`item-badge`,n.style.cssText=`flex:none;display:inline-flex;align-items:center;margin-inline-start:auto;padding-inline-start:var(--list-item-badge-gap,8px)`,s instanceof Node?n.appendChild(s):o(s,n),e.appendChild(n)}}#$(e){return e.tagName===`LI`||e.hasAttribute(`data-list-item`)||e.tagName.includes(`-`)}#ee(e,n){if(!this.keyProperty)return;let r=this.#te(n,this.keyProperty);r!=null&&e.setAttribute(`data-key`,String(r))}#te(e,n){if(typeof e==`object`&&e&&n in e)return e[n]}#ne(e){if(this.#ie())return this.#oe(e);let n=0;for(let r of this.querySelectorAll(DC)){if(r===e)return n;this.#n.has(r)&&n++}return n}#re(){let e=this.items??[],n=[...this.selection.selected],r=this.selection.anchor?D(this.selection.anchor):void 0;this.#e.clear(),this.#o=document.createDocumentFragment(),this.#l=[],this.#a=e.map((e,n)=>this.#X(e,n));for(let e of this.#a)this.#i.add(e);this.#Y(n,r,this.#a),this.#_e(!0)}#ie(){return this.virtualize&&this.itemHeight>0}#ae(){return this.#ie()?this.#a.filter(e=>!(e.hidden||this.filterPredicate&&!this.filterPredicate(e))):this._getVisibleItems()}#oe(e){let n=this.#a.indexOf(e);if(n>=0)return n;if(this.#t.has(e)){for(let[n,r]of this.#e)if(r===e)return this.#a.indexOf(n)}return-1}#se(e,n){let r=this.#a.indexOf(e);r>=0&&(this.#a[r]=n)}#ce(e){if(this.#e.has(e)){let n=this.#e.get(e);this.#e.delete(e),n&&this.#t.delete(n)}if(this.#t.has(e)){for(let[n,r]of this.#e)if(r===e){this.#e.delete(n);break}this.#t.delete(e)}}#le(e){let n=0,r=e.previousElementSibling;for(;r;){if(r===this.#h)return this.#s+n;if(r===this.#g)return this.#a.length;r.matches(DC)&&n++,r=r.previousElementSibling}return n}#ue(e){let n=!1,r=[],i=[];for(let a of e){for(let e of a.addedNodes){if(!(e instanceof Element)||e.parentNode!==this||e.hasAttribute(`data-virtual-spacer`)||!e.matches(DC))continue;let i=this.#oe(e);if(i<0){let i=Math.min(this.#le(e),this.#a.length);this.#a.splice(i,0,e),r.push(e),n=!0}else if(this.#le(e)!==i){let r=Math.min(this.#le(e),this.#a.length-1);this.#a.splice(i,1),this.#a.splice(r,0,e),n=!0}}for(let e of a.removedNodes){if(!(e instanceof Element)||e.hasAttribute(`data-virtual-spacer`))continue;let r=this.#oe(e);r<0||e.parentNode!==this.#o&&e.parentNode!==this&&(this.#a.splice(r,1),i.push(e),n=!0)}}if(this.#W(i),r.length>0){if(this.#I(r.length))for(let e of r)this.#i.add(e);else this.#l.push(...r)}return n&&this.interactionMode===`checked`&&this._syncCheckboxes(),n&&this.search.refresh(),n}#de(){let e=this.#r?.takeRecords()??[];return e.length>0&&this.#ue(e)}#fe(){return this.renderRoot.querySelector(`ul`)}#pe(e){if(!e)return this.#_;let n=e.clientHeight||e.getBoundingClientRect().height||0;return n>0&&(this.#_=n),this.#_}#me(){if(this.#h&&this.#g)return;let e=()=>{let e=document.createElement(`li`);return e.setAttribute(`data-virtual-spacer`,``),e.setAttribute(`aria-hidden`,`true`),e};this.#h=e(),this.#g=e()}#he(){let e=this.#fe();e&&(this.#f??=new ResizeObserver(()=>{this.#_e(),this.#be(),this.#G()}),this.#f.observe(e))}#ge;#_e(e=!1){if(!this.#ie()||!this.isConnected)return;let n=this.#de()||e;this.#he();let r=this.#a.length,i=this.#fe(),a=this.itemHeight,o=this.#pe(i),s=Math.max(0,r*a-o),c=Math.min(Math.max(0,i?i.scrollTop:0),s);i&&Math.abs(i.scrollTop-c)>.5&&(i.scrollTop=c);let l=Math.floor(c/a),u=Math.ceil((c+o)/a),d=r===0?0:Math.max(0,l-3),f=Math.min(r,u+3);if(!n&&d===this.#s&&f===this.#c)return;if(r===0)this.#a.length>0&&this.#o.append(...this.#a),this.replaceChildren();else{this.#me();let e=this.#h,n=this.#g;if(!e||!n)return;e.style.height=`${d*a}px`,n.style.height=`${Math.max(0,(r-f)*a)}px`;let i=this.#a.slice(d,f),o=[...this.#a.slice(0,d),...this.#a.slice(f)];o.length>0&&this.#o.append(...o),this.replaceChildren(e,...i,n)}this.#s=d,this.#c=f,this.interactionMode===`checked`&&this._syncCheckboxes(),this._syncItemStates();let p=this.#ae().length;for(let e=d;e<f;e++){let n=this.#a[e];n&&this.#ve(n,e+1,p)}let m=this.#l;this.#l=[];for(let e of m)this.#i.add(e),e.parentNode===this&&$n(e);this.search.repaintHighlights(),n&&this.#G()}#ve(e,n,r){e instanceof HTMLElement&&(e.draggable=this.itemsDraggable&&this._isCheckable(e)&&!e.hasAttribute(`data-editing`),n!==void 0&&r!==void 0&&(e.setAttribute(`aria-setsize`,String(r)),e.setAttribute(`aria-posinset`,String(n)),(!e.hasAttribute(`role`)||e.hasAttribute(`data-aria-role`))&&(e.setAttribute(`role`,`option`),e.setAttribute(`data-aria-role`,``),e.setAttribute(`aria-selected`,String(this.selection.selected.has(e)))))),e.removeAttribute(`data-marquee`),e.removeAttribute(`data-drag-origin`),e.removeAttribute(`data-drop-target`)}#ye(){for(let e of this.#a)this.#i.add(e);this.#a.length>0?this.replaceChildren(...this.#a):this.replaceChildren(),this.#o=document.createDocumentFragment(),this.#h=void 0,this.#g=void 0,this.#s=0,this.#c=0,this.#l=[],this._syncCheckboxes(),this._syncItemStates(),this._syncNativeDraggable(),this.#w.refreshDraggable(),this.#be()}#be(){this.#d===0&&(this.#d=requestAnimationFrame(()=>{this.#d=0,this.#_e(),this.#xe()}))}#xe(){let e=this.renderedKeys(),n=this.visibleKeys();OC(this.#p,e)&&OC(this.#m,n)||(this.#p=e,this.#m=n,this._dispatch(`vertical-list-viewport-change`,{renderedKeys:e,visibleKeys:n}))}_getVisibleItems(){return Array.from(this.querySelectorAll(DC)).filter(e=>!(this.#t.has(e)||e.hidden||this.filterPredicate&&!this.filterPredicate(e)))}_isCheckable(e){return this.interactionMode!==`checked`||!(this.#e.get(e)??e).hasAttribute(`not-checked`)}_syncItemStates(){for(let e of this.querySelectorAll(DC)){if(this.#t.has(e))continue;let n=this.#e.get(e)??e;e.toggleAttribute(`data-tickled`,this.tickled.isTickled(e)),e.toggleAttribute(`data-selected`,this.selection.selected.has(e)),xr(e,yr(D(e),this.#L,this.selection.selected.has(e))),e.hasAttribute(`data-aria-role`)&&e.setAttribute(`aria-selected`,String(this.selection.selected.has(e))),this.interactionMode===`checked`?e.toggleAttribute(`data-checked`,!n.hasAttribute(`not-checked`)&&this.selection.selected.has(e)):e.removeAttribute(`data-checked`)}this.dataset.inputMode=this.tickled.inputMode,this._syncCheckboxes()}_syncCheckboxes(){let e=this.interactionMode===`checked`,n=typeof this.checkboxRenderer==`function`,r=this.#ie()?[this,this.#o]:[this];if(e)for(let e of r)for(let n of Array.from(e.children)){if(!n.hasAttribute(`data-list-item`)||n.parentNode!==e)continue;let r=document.createElement(`li`);r.className=`ixfx-custom-row`;let i=n.getAttribute(`data-key`),a=n.getAttribute(`data-search-label`);i!==null&&r.setAttribute(`data-key`,i),a!==null&&r.setAttribute(`data-search-label`,a),n.removeAttribute(`data-list-item`),e.insertBefore(r,n),r.appendChild(n),this.#e.set(r,n),this.#t.add(n),this.#n.has(n)&&this.#n.set(r,this.#n.get(n)),this.#ie()&&this.#se(n,r)}else{for(let[e,n]of this.#e){if(e.parentNode!==this&&e.parentNode!==this.#o)continue;n.setAttribute(`data-list-item`,``);let r=e.parentNode;r&&r.insertBefore(n,e),e.remove(),this.#n.delete(e),this.#ie()&&this.#se(e,n)}this.#e.clear(),this.#t.clear()}for(let r of this.querySelectorAll(`li`)){let i=r.querySelector(`.ixfx-list-checkbox`);if(!e||(this.#e.get(r)??r).hasAttribute(`not-checked`)){i&&i.remove();continue}let a=i?.classList.contains(`ixfx-list-checkbox-custom`)??!1;i&&a!==n&&i.remove();let s=r.querySelector(`.ixfx-list-checkbox`);if(!s){if(n){let e=this.checkboxRenderer,n=e.margin??`0`,i=e.width??`24px`;s=this._createCustomCheckbox(r,n,i)}else s=this._createNativeCheckboxCell(r);r.prepend(s)}let c=this.selection.selected.has(r),l=yr(D(r),this.#L,c);if(n){if(s.setAttribute(`aria-checked`,l?`mixed`:String(c)),s.toggleAttribute(`data-checked`,c),s.toggleAttribute(`data-partial`,l),this.checkboxRenderer){let e=typeof this.checkboxRenderer==`function`?this.checkboxRenderer:this.checkboxRenderer.renderer;o(e(c),s)}}else{let e=s.querySelector(`input.ixfx-list-checkbox`);e&&(e.checked=c,e.indeterminate=l),s.setAttribute(`aria-checked`,l?`mixed`:String(c))}}}_createNativeCheckboxCell(e){let n=document.createElement(`span`);n.className=`ixfx-list-checkbox ixfx-list-checkbox-native`,n.style.cssText=`display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;align-self:stretch;width:18px;margin:0 6px 0 0;cursor:pointer;pointer-events:auto`,n.tabIndex=-1,n.setAttribute(`role`,`checkbox`),n.setAttribute(`part`,`checkbox`),n.addEventListener(`click`,n=>{n.stopPropagation(),this.selection.handleCheckbox(e)});let r=document.createElement(`input`);return r.type=`checkbox`,r.className=`ixfx-list-checkbox`,r.style.cssText=`pointer-events:none;cursor:pointer;margin:0`,n.appendChild(r),n}_createCustomCheckbox(e,n,r){let i=document.createElement(`span`);return i.className=`ixfx-list-checkbox ixfx-list-checkbox-custom`,i.style.cssText=`display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;align-self:stretch;width:${r};margin:${n};cursor:pointer;pointer-events:auto`,i.tabIndex=-1,i.setAttribute(`role`,`checkbox`),i.setAttribute(`part`,`checkbox`),i.addEventListener(`click`,n=>{n.stopPropagation(),this.selection.handleCheckbox(e)}),i}_findListItem(e){for(let n of e)if(n instanceof Element){if(n===this)break;if(n.parentElement===this&&n.matches(DC))return n}}_dispatch(e,n){this.dispatchEvent(new CustomEvent(e,{detail:n,bubbles:!0,composed:!0}))}_dispatchCancelable(e,n){return this.dispatchEvent(new CustomEvent(e,{detail:n,bubbles:!0,composed:!0,cancelable:!0}))}_activateItem(e,n=`pointer`){this.selection.handleReplace(e,n),this._dispatch(`list-activate`,{item:e})}activateKey(e){let n=this.#V(e);n&&this._activateItem(n,`api`)}#Se;#Ce(){let e=this.#Se;this.#Se=void 0,this.#Te(void 0,!1),e&&this._dispatch(`list-drag-leave`,{key:e.item?D(e.item):void 0})}#we;#Te(e,n){this.#we?.removeAttribute(`data-drop-target`),this.#we=n?e:void 0,this.toggleAttribute(`data-drop-target`,n&&e===void 0),n&&e&&e.setAttribute(`data-drop-target`,``)}#Ee(e,n,r){return!this.selection.selected.has(e)&&this.interactionMode!==`manual`&&this._isCheckable(e)&&this.selection.replace(e),this._dispatchCancelable(`list-context-menu`,{key:D(e),item:e,x:n,y:r,selectedKeys:this.selection.selectedKeys})}#De;get editingKey(){return this.#De?.key}#Oe(e){return this.#De!==void 0&&e.composedPath().includes(this.#De.label)}beginEdit(e){this.#ke();let n=this.editValidator;if(!n)return!1;let r=this.#V(e);if(!(r instanceof HTMLElement)||r.parentNode!==this)return!1;let i=r.querySelector(`[data-edit-label]`)??r,a=i.getAttribute(`data-edit-value`)??i.textContent?.trim()??``,o=document.createElement(`ixfx-editable-label`);o.mode=`label`,o.value=a,o.validator=r=>n(r,e),o.style.cssText=`flex:1;min-width:0;--label-align:left;--label-padding:0 var(--space-xs,3px)`;let s={key:e,row:r,container:i,saved:[...i.childNodes],label:o,committed:void 0,refocus:!1};this.#De=s,o.addEventListener(`change`,e=>{e.stopPropagation(),s.committed=e.detail.value}),o.addEventListener(`input`,e=>e.stopPropagation()),o.addEventListener(`keydown`,e=>{s.refocus=e.key===`Enter`||e.key===`Escape`});for(let e of[`pointerdown`,`dragstart`])o.addEventListener(e,e=>e.stopPropagation());return o.addEventListener(`focusout`,()=>this.#ke()),i.replaceChildren(o),r.setAttribute(`data-editing`,``),r.draggable=!1,r.scrollIntoView({block:`nearest`,inline:`nearest`}),o.updateComplete.then(()=>{this.#De===s&&o.shadowRoot?.querySelector(`.content`)?.click()}),!0}#ke(){let e=this.#De;e&&(this.#De=void 0,e.container.isConnected&&e.container.replaceChildren(...e.saved),e.row.removeAttribute(`data-editing`),this.#ve(e.row),e.refocus&&this.focus(),e.committed===void 0?this._dispatch(`list-edit-cancel`,{key:e.key}):this._dispatch(`list-edit-commit`,{key:e.key,value:e.committed}))}static{this.styles=[w,Tr(`y`),Ut,r`
|
|
7070
7070
|
:host {
|
|
7071
7071
|
display: block;
|
|
7072
7072
|
position: relative;
|
|
@@ -7269,13 +7269,13 @@ function Eg(e){return!(typeof e!=`object`||!(`h`in e)||!(`s`in e)||!(`l`in e)||!
|
|
|
7269
7269
|
${this.#D?i`<div class="marquee" part="marquee" style=${this.#A(this.#D)}></div>`:``}
|
|
7270
7270
|
${this.search.renderField()}
|
|
7271
7271
|
</div>
|
|
7272
|
-
`}};E([d({type:String,attribute:`selection-mode`})],
|
|
7272
|
+
`}};E([d({type:String,attribute:`selection-mode`})],G.prototype,`selectionMode`,void 0),E([d({type:String,attribute:`interaction-mode`})],G.prototype,`interactionMode`,void 0),E([d({attribute:!1})],G.prototype,`filterPredicate`,void 0),E([d({type:String,attribute:`item-wrap`})],G.prototype,`itemWrap`,void 0),E([d({attribute:!1})],G.prototype,`checkboxRenderer`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],G.prototype,`searchModes`,void 0),E([d({type:Boolean,attribute:`items-draggable`,reflect:!0})],G.prototype,`itemsDraggable`,void 0),E([d({attribute:!1})],G.prototype,`dragPreviewRenderer`,void 0),E([d({attribute:!1})],G.prototype,`writeDataTransfer`,void 0),E([d({attribute:!1})],G.prototype,`dragPreviewSource`,void 0),E([d({attribute:!1})],G.prototype,`items`,void 0),E([d({type:String,attribute:`key-property`})],G.prototype,`keyProperty`,void 0),E([d({attribute:!1})],G.prototype,`formatter`,void 0),E([d({attribute:!1})],G.prototype,`icon`,void 0),E([d({attribute:!1})],G.prototype,`iconColor`,void 0),E([d({attribute:!1})],G.prototype,`textColor`,void 0),E([d({attribute:!1})],G.prototype,`badge`,void 0),E([d({type:Boolean,attribute:`virtualize`,reflect:!0})],G.prototype,`virtualize`,void 0),E([d({type:Number,attribute:`item-height`})],G.prototype,`itemHeight`,void 0),E([d({type:Boolean,attribute:`items-droppable`,reflect:!0})],G.prototype,`itemsDroppable`,void 0),E([d({attribute:!1})],G.prototype,`editValidator`,void 0),E([d({attribute:!1})],G.prototype,`canDrop`,void 0),G=E([T(`ixfx-vertical-list`)],G);function kC(e){return e.item.isLeaf===!1||e.item.isLeaf!==!0&&e.children?.length!==0}function AC(e,n){return e.length===n.length&&e.every((e,r)=>e===n[r])}function jC(e,n){return e.length===n.length&&e.every((e,r)=>e.node===n[r].node&&e.branch===n[r].branch)}function MC(e,n){if(!e)return[];let r=[e];for(let e of n){let n=r.at(-1).children?.find(n=>n.item.key===e);if(!n)break;r.push(n)}return r}function NC(e,n){if(e===n)return[];for(let r of e.children??[]){let e=NC(r,n);if(e)return[r.item.key,...e]}}function PC(e){let{selected:n,focus:r,scroll:i}=e;if(n!==void 0||r!==void 0||i!==void 0)return{selected:n,focus:r,scroll:i}}function FC(e,n,r){let i=e.map(e=>({key:e.item.key,node:e,branch:kC(e)})),a=r?[...i].sort((e,n)=>r(e.node,n.node)):i;return n===`mixed`?a:[...a.filter(e=>e.branch),...a.filter(e=>!e.branch)]}let K=class extends n{constructor(...e){super(...e),this.path=[],this.branchOrder=`first`,this.selectionMode=`single`,this.interactionMode=`standard`,this.partialKeys=/* @__PURE__ */ new Set,this.itemWrap=`stop`,this.itemsDraggable=!1,this.itemsDroppable=!1,this.virtualize=!1,this.itemHeight=0,this.withUp=!0,this.hideRoot=!1,this.emptyText=`Empty`,this._focusVisible=!1,this._hasToolbar=!1,this._rows=[],this._loading=!1,this.#r=[],this.#a=/* @__PURE__ */ new Set,this.#o=`jump`,this.#c=new cy(this,{kind:`flat-list`,capture:()=>this.getViewState()}),this.#d=!1,this.#f=this.path,this.#v=e=>{e.stopPropagation();let n=e.detail.reason;e.target===this.list&&n!==`restore`&&this.#c.notify(n)},this.#T=(e,n)=>{let r=this.#w(e);return!!r&&(this.canDrop?.(r,n)??!0)},this.#E=e=>{this.itemsDroppable&&e.preventDefault()},this.#D=e=>{let n=this.#S(e.detail.key)??this.currentNode;n&&this.dispatchEvent(new CustomEvent(`flat-list-drop`,{detail:{node:n,dataTransfer:e.detail.dataTransfer},bubbles:!0,composed:!0}))},this.#O=e=>{let n=this.#S(e.detail.key);if(!n)return;let r=[...e.detail.selectedKeys].map(e=>this.#S(e)).filter(e=>e!==void 0);this.dispatchEvent(new CustomEvent(`flat-list-context-menu`,{detail:{node:n,nodes:r,x:e.detail.x,y:e.detail.y},bubbles:!0,composed:!0,cancelable:!0}))||e.preventDefault()},this.#k=(e,n)=>{let r=this.#S(n);return!!r&&(this.validateEdit?.(e,r)??!1)},this.#A=e=>{let n=this.#S(e.detail.key);n&&this.dispatchEvent(new CustomEvent(`flat-list-edit-commit`,{detail:{node:n,value:e.detail.value},bubbles:!0,composed:!0}))},this.#j=e=>{let n=this.#S(e.detail.key);n&&this.dispatchEvent(new CustomEvent(`flat-list-edit-cancel`,{detail:{node:n},bubbles:!0,composed:!0}))},this.#M=e=>{!this.#c.isRestoring&&this.#u?.selected&&(this.#u={...this.#u,selected:void 0}),this.#c.notify();let n=this.#a,r=[...e.detail.selectedKeys].map(e=>this.#S(e)).filter(e=>e!==void 0);this.#a=new Set(r),this.dispatchEvent(new CustomEvent(`flat-list-select`,{detail:{selected:this.#a,selectedKeys:e.detail.selectedKeys,previous:n},bubbles:!0,composed:!0}))},this.#N=e=>{let n=e.detail.item.getAttribute(`data-key`)??void 0,r=this.#S(n);r&&(kC(r)?this.navigateInto(r.item.key):this.dispatchEvent(new CustomEvent(`flat-list-activate`,{detail:{node:r},bubbles:!0,composed:!0})))},this.#P=e=>{this._hasToolbar=e.target.assignedNodes({flatten:!0}).some(e=>e.nodeType===Node.ELEMENT_NODE||!!e.textContent?.trim())},this.#F=()=>{this._focusVisible=this.list?.matches(`:focus-visible`)??!1},this.#I=e=>{if(e.defaultPrevented||e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)return;let n=e.composedPath()[0];if(!(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)){if(this.#d=!1,(e.key===`ArrowRight`||e.key===`ArrowLeft`||e.key===`Backspace`)&&oe.ignoreHoverUntilPointerMoves(),e.key===`ArrowRight`){let n=this.#S(this.list?.tickledKey);n&&kC(n)&&(e.preventDefault(),this.navigateInto(n.item.key))}else(e.key===`ArrowLeft`||e.key===`Backspace`)&&this.navigateUp()&&e.preventDefault()}},this.#L=e=>{e.stopPropagation();let n=[...e.detail.selected].at(-1),r=this.#p;if(!n||!r)return;let i=NC(r,n);if(i){if(kC(n)){let e=i.length<this.path.length&&i.every((e,n)=>e===this.path[n])?`up`:`jump`;this.#m(i,e)}else{let e=i.slice(0,-1),r=AC(e,this.path);this.#m(e,`jump`),this.#s=n.item.key,r&&this.#B()}}},this.#V=e=>this.#U(e,!1),this.#H=e=>this.#U(e,!0),this.#W=e=>{let{node:n}=e;return n.item.icon?i`<ixfx-icon name=${n.item.icon}></ixfx-icon>`:void 0},this.#G=e=>{let{node:n,branch:r}=e,o=vy(n.item.badge)?a:n.item.badge,s=yy(n.item.textColor);return i`${o}${r?i`<span
|
|
7273
7273
|
class="chevron"
|
|
7274
7274
|
aria-hidden="true"
|
|
7275
7275
|
style=${s?`color:${s}`:a}
|
|
7276
7276
|
@pointerdown=${e=>e.stopPropagation()}
|
|
7277
7277
|
@click=${e=>this.#C(e,n)}
|
|
7278
|
-
>›</span>`:a}`}}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;get list(){return this.renderRoot.querySelector(`ixfx-vertical-list`)??void 0}get registry(){return this.list?.registry}dispatch(e,n){this.list?.dispatch(e,n)}beginEdit(e){let n=this.#S(e);return!this.validateEdit||!n?.item.editable?!1:this.list?.beginEdit(e)??!1}get currentNode(){return
|
|
7278
|
+
>›</span>`:a}`}}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;get list(){return this.renderRoot.querySelector(`ixfx-vertical-list`)??void 0}get registry(){return this.list?.registry}dispatch(e,n){this.list?.dispatch(e,n)}beginEdit(e){let n=this.#S(e);return!this.validateEdit||!n?.item.editable?!1:this.list?.beginEdit(e)??!1}get currentNode(){return MC(this.#p,this.path).at(-1)}get selectedNodes(){return this.#a}get#p(){return this.model?.root??this.root}navigateTo(e){return MC(this.#p,e).length===e.length+1&&(this.#m(e,`jump`),!0)}navigateInto(e){let n=this.currentNode?.children?.find(n=>n.item.key===e);return!n||!kC(n)?!1:(this.#m([...this.path,e],`into`),!0)}navigateUp(){return this.path.length!==0&&(this.#i=this.path.at(-1),this.#m(this.path.slice(0,-1),`up`),!0)}#m(e,n){AC(e,this.path)||(this.#c.isRestoring||(this.#l=void 0,this.#u=void 0,this.#d=!1),this.#c.notify(),this.#f=e,this.#r=this.path,this.#o=n,this.list?.search.close(),this.list?.clearSelection(),this.path=e)}getViewState(e){let n=e?.includePending??!0,r=(n?this.#u:void 0)??this.#g(n);return this.#c.shape({path:[...(n?this.#l:void 0)??this.path],...r},e)}setViewState(e){if(!this.#c.accepts(e))return;let n=PC(e);e.path&&(this.#l=[...e.path]),n&&(this.#u={...this.#u,...n}),this.#h(),this.requestUpdate()}clearPendingViewState(){this.#l=void 0,this.#u=void 0,this.list?.clearPendingViewState()}#h(){let e=this.#l,n=this.#p;if(!e||!n)return;let r=ly(n,e);r.done&&(this.#l=void 0);let i=e.slice(0,r.nodes.length-1);AC(i,this.path)||this.#c.restoring(()=>this.#m(i,`jump`))}#g(e){let n=this.list?.getViewState({includePending:e});return n&&{selected:n.selected,focus:n.focus,scroll:n.scroll}}#_(){let e=this.list,n=this.#u;e&&n&&(this.#u=void 0,n.focus!==void 0&&(this.#d=!0),this.#c.restoring(()=>e.setViewState(n)))}#v;disconnectedCallback(){super.disconnectedCallback(),this.#e?.(),this.#e=void 0,this.#t?.abort(),this.#n=void 0}willUpdate(e){e.has(`model`)&&(this.#e?.(),this.#e=this.model?._subscribe(e=>{if(e.type===`invalidate`&&e.key===this.currentNode?.item.key){let e=this.currentNode;e&&(e.children=void 0)}this.requestUpdate(),this.#y(!0)})),e.has(`path`)&&this.path!==this.#f&&(this.#f=this.path,this.#l=void 0,this.#c.notify());let n=MC(this.#p,this.path).length-1;this.#p&&n<this.path.length&&(this.#l??=this.path,this.#u??=this.#g(!0),this.path=this.#f=this.path.slice(0,n)),this.#h(),[`root`,`model`,`path`,`branchOrder`,`sort`,`filterPredicate`,`loadChildren`].some(n=>e.has(n))&&this.#y(e.has(`root`)||e.has(`model`)||e.has(`loadChildren`))}updated(e){if(this.#u&&!this.#l&&this.#_(),e.has(`path`)&&!AC(this.path,this.#r)&&this.#p){let e=this.currentNode;if(e){let n=this.#r;this.#r=this.path,this.dispatchEvent(new CustomEvent(`flat-list-navigate`,{detail:{path:this.path,previousPath:n,node:e,direction:this.#o},bubbles:!0,composed:!0})),this.#o=`jump`}}e.has(`_rows`)&&this.#B(),(e.has(`_rows`)||e.has(`markedKey`))&&this.#z()}#y(e){let n=this.currentNode;n?n.children===void 0&&(this.model||this.loadChildren)&&(e||this.#n!==n)?this.#x(n):this.#b(n):this._rows=[]}#b(e){let n=this.filterPredicate,r=this.path.length,i=FC((e.children??[]).filter(e=>!n||n(e,r)),this.branchOrder,this.sort);jC(i,this._rows)||(this._rows=i)}async#x(e){this.#t?.abort();let n=new AbortController;this.#t=n,this.#n=e,this._loading=!0,this._rows=[];try{let r=this.path.length,i=this.model?await this.model.getChildren(e,r,n.signal):[...await Pv(this.loadChildren({node:e,depth:r},n.signal),n.signal)];if(n.signal.aborted)return;e.children=[...i]}catch{if(n.signal.aborted)return;e.children=[]}this.#n=void 0,this._loading=!1,e===this.currentNode&&this.#b(e)}#S(e){return e===void 0?void 0:this._rows.find(n=>n.key===e)?.node}#C(e,n){e.stopPropagation(),this.navigateInto(n.item.key)}#w(e){return e?this.#S(e.getAttribute(`data-key`)??void 0):this.currentNode}#T;#E;#D;#O;#k;#A;#j;#M;#N;#P;#F;#I;#L;#R;async#z(){let e=this.list;if(!e)return;await e.updateComplete,this.#R?.removeAttribute(`data-marked`);let n=this.markedKey;this.#R=n===void 0?void 0:e.getItemByKey(n),this.#R?.setAttribute(`data-marked`,``)}async#B(){let e=this.list;if(!e)return;let n=this.matches(`:focus-within`);await e.updateComplete;let r=this.#s,i=this.#i??r??this._rows[0]?.key;this.#s=void 0,this.#i=void 0,r&&e.selectKeys([r]),i!==void 0&&!this.#d&&e.focusKey(i),n&&e.focus()}#V;#H;#U(e,n){let{node:r}=e,o=yy(r.item.textColor),s=n&&r.item.editable===!0;return i`<span class="label" data-edit-label=${s?``:a} data-edit-value=${s?r.item.label:a} style=${o?`color:${o}`:a}>${r.item.label}</span>`}#W;#G;render(){let e=this.#p;return i`
|
|
7279
7279
|
<div class="crumbs" part="crumbs">
|
|
7280
7280
|
<ixfx-crumb-navigation
|
|
7281
7281
|
.root=${e}
|
|
@@ -7307,6 +7307,7 @@ function Eg(e){return!(typeof e!=`object`||!(`h`in e)||!(`s`in e)||!(`l`in e)||!
|
|
|
7307
7307
|
.itemWrap=${this.itemWrap}
|
|
7308
7308
|
.searchModes=${this.searchModes}
|
|
7309
7309
|
?items-draggable=${this.itemsDraggable}
|
|
7310
|
+
.writeDataTransfer=${this.writeDataTransfer}
|
|
7310
7311
|
?items-droppable=${this.itemsDroppable}
|
|
7311
7312
|
.canDrop=${this.#T}
|
|
7312
7313
|
.editValidator=${this.#k}
|
|
@@ -7424,7 +7425,7 @@ function Eg(e){return!(typeof e!=`object`||!(`h`in e)||!(`s`in e)||!(`l`in e)||!
|
|
|
7424
7425
|
/* Inherit the row's text colour, so it follows selected / tickled states. */
|
|
7425
7426
|
color: inherit;
|
|
7426
7427
|
}
|
|
7427
|
-
`]}};E([d({attribute:!1})],
|
|
7428
|
+
`]}};E([d({attribute:!1})],K.prototype,`root`,void 0),E([d({attribute:!1})],K.prototype,`model`,void 0),E([d({attribute:!1})],K.prototype,`path`,void 0),E([d({attribute:!1})],K.prototype,`loadChildren`,void 0),E([d({attribute:!1})],K.prototype,`filterPredicate`,void 0),E([d({attribute:!1})],K.prototype,`sort`,void 0),E([d({type:String,attribute:`branch-order`,reflect:!0})],K.prototype,`branchOrder`,void 0),E([d({type:String,attribute:`selection-mode`})],K.prototype,`selectionMode`,void 0),E([d({type:String,attribute:`interaction-mode`})],K.prototype,`interactionMode`,void 0),E([d({attribute:!1})],K.prototype,`partialKeys`,void 0),E([d({type:String,attribute:`item-wrap`})],K.prototype,`itemWrap`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],K.prototype,`searchModes`,void 0),E([d({type:Boolean,attribute:`items-draggable`,reflect:!0})],K.prototype,`itemsDraggable`,void 0),E([d({attribute:!1})],K.prototype,`writeDataTransfer`,void 0),E([d({type:Boolean,attribute:`items-droppable`,reflect:!0})],K.prototype,`itemsDroppable`,void 0),E([d({attribute:!1})],K.prototype,`canDrop`,void 0),E([d({attribute:!1})],K.prototype,`validateEdit`,void 0),E([d({type:String,attribute:`marked-key`,reflect:!0})],K.prototype,`markedKey`,void 0),E([d({type:Boolean,reflect:!0})],K.prototype,`virtualize`,void 0),E([d({type:Number,attribute:`item-height`})],K.prototype,`itemHeight`,void 0),E([d({type:Boolean,attribute:`with-up`,reflect:!0})],K.prototype,`withUp`,void 0),E([d({type:Boolean,attribute:`hide-root`,reflect:!0})],K.prototype,`hideRoot`,void 0),E([d({type:String,attribute:`empty-text`})],K.prototype,`emptyText`,void 0),E([d({type:Boolean,reflect:!0,attribute:`data-focus-visible`})],K.prototype,`_focusVisible`,void 0),E([m()],K.prototype,`_hasToolbar`,void 0),E([m()],K.prototype,`_rows`,void 0),E([m()],K.prototype,`_loading`,void 0),K=E([T(`ixfx-flat-list`)],K);const IC=/* @__PURE__ */ new WeakMap;function LC(e,n){let r=e.getRootNode();if(!(r instanceof ShadowRoot)&&!(r instanceof Document))return;let i=IC.get(r)??/* @__PURE__ */ new Set;if(i.has(n))return;if(i.add(n),IC.set(r,i),r instanceof Document){let e=document.createElement(`style`);e.textContent=n.cssText,document.head.prepend(e);return}let a=n.styleSheet;if(a&&`adoptedStyleSheets`in r)r.adoptedStyleSheets=[a,...r.adoptedStyleSheets];else{let e=document.createElement(`style`);e.textContent=n.cssText,r.prepend(e)}}const RC=r`
|
|
7428
7429
|
ixfx-form > form {
|
|
7429
7430
|
display: block;
|
|
7430
7431
|
margin: 0;
|
|
@@ -7654,7 +7655,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
7654
7655
|
grid-column: 2 / -1;
|
|
7655
7656
|
}
|
|
7656
7657
|
}
|
|
7657
|
-
`;let BC=class extends n{constructor(...e){super(...e),this.label=``}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),RC(this,zC),this._observer=new MutationObserver(()=>this._sync())}firstUpdated(){this._fieldset=this.querySelector(`fieldset`)??void 0,this._fieldset&&(this._observer?.observe(this,{childList:!0,subtree:!0}),this._sync())}disconnectedCallback(){super.disconnectedCallback(),this._observer?.disconnect()}_sync(){this._moveChildren(),this._updatePairs()}_updatePairs(){if(!this._fieldset)return;let e=Array.from(this._fieldset.querySelectorAll(`:scope > ixfx-form-row`)).map(e=>e.querySelectorAll(`:scope > ixfx-form-part`).length),n=Math.max(1,...e);this._fieldset.style.setProperty(`--ixfx-form-pairs`,String(n))}_moveChildren(){this._fieldset&&Array.from(this.children).filter(e=>e.tagName!==`FIELDSET`).forEach(e=>{this._fieldset.appendChild(e)})}render(){return i`<fieldset><legend>${this.label}</legend></fieldset>`}};E([d({type:String})],BC.prototype,`label`,void 0),E([d({type:String,attribute:`label-align`,reflect:!0})],BC.prototype,`labelAlign`,void 0),BC=E([T(`ixfx-form-group`)],BC);let VC=0,HC=class extends n{constructor(...e){super(...e),this.label=``,this.orientation=`horizontal`,this._labelId=`ixfx-form-options-${++VC}`}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),RC(this,zC),this.setAttribute(`role`,`group`),this.setAttribute(`aria-labelledby`,this._labelId),this._observer=new MutationObserver(()=>this._moveChildren())}firstUpdated(){this._observer?.observe(this,{childList:!0}),this._moveChildren()}disconnectedCallback(){super.disconnectedCallback(),this._observer?.disconnect()}_moveChildren(){let e=this.querySelector(`:scope > .ixfx-form-options-items`);e&&Array.from(this.children).filter(e=>!e.classList.contains(`ixfx-form-options-items`)&&!e.classList.contains(`ixfx-form-options-label`)).forEach(n=>e.appendChild(n))}render(){return i`<span class="ixfx-form-options-label" id=${this._labelId}>${this.label}</span><div class="ixfx-form-options-items"></div>`}};E([d({type:String})],HC.prototype,`label`,void 0),E([d({type:String,reflect:!0})],HC.prototype,`orientation`,void 0),HC=E([T(`ixfx-form-options`)],HC);let UC=0,WC=class extends n{constructor(...e){super(...e),this.label=``}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),RC(this,zC),this._ensureId()}_ensureId(){let e=this.querySelector(`input, select, textarea, [name]`);e&&(e.id?this._id=e.id:(this._id=`ixfx-form-part-${++UC}`,e.id=this._id))}render(){return this._id||this._ensureId(),i`<label for=${this._id??``}>${this.label}</label>`}};E([d({type:String})],WC.prototype,`label`,void 0),WC=E([T(`ixfx-form-part`)],WC);let GC=class extends n{createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),RC(this,zC),this._observer=new MutationObserver(()=>this._indexParts()),this._observer.observe(this,{childList:!0}),this._indexParts()}disconnectedCallback(){super.disconnectedCallback(),this._observer?.disconnect()}_indexParts(){Array.from(this.children).filter(e=>e.tagName===`IXFX-FORM-PART`).forEach((e,n)=>{e.style.setProperty(`--ixfx-form-part-index`,String(n+1))})}};GC=E([T(`ixfx-form-row`)],GC);function KC(e,n={}){let r={};return e.querySelectorAll(`[name]`).forEach(e=>{let i=e.getAttribute(`name`);i&&(e instanceof HTMLInputElement?e.type===`radio`?e.checked&&(r[i]=e.value):e.type===`checkbox`?r[i]=e.checked:n.typed&&(e.type===`number`||e.type===`range`)?r[i]=Number.isNaN(e.valueAsNumber)?null:e.valueAsNumber:r[i]=e.value:e instanceof HTMLSelectElement?e.multiple?r[i]=Array.from(e.selectedOptions).map(e=>e.value):r[i]=e.value:(e instanceof HTMLTextAreaElement||`value`in e)&&(r[i]=e.value))}),r}function qC(e,n){e.querySelectorAll(`[name]`).forEach(e=>{let r=e.getAttribute(`name`);if(!r||!(r in n))return;let i=n[r];e instanceof HTMLInputElement?(e.type===`radio`?e.checked=e.value===i:e.type===`checkbox`?e.checked=!!i:e.value=String(i??``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.dispatchEvent(new Event(`change`,{bubbles:!0}))):e instanceof HTMLSelectElement?(e.multiple&&Array.isArray(i)?Array.from(e.options).forEach(e=>{e.selected=i.includes(e.value)}):e.value=String(i??``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.dispatchEvent(new Event(`change`,{bubbles:!0}))):e instanceof HTMLTextAreaElement?(e.value=String(i??``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.dispatchEvent(new Event(`change`,{bubbles:!0}))):`value`in e&&(e.value=i)})}const JC=/* @__PURE__ */ new Set([`button`,`submit`,`reset`,`image`,`file`,`color`]);let YC=class extends n{constructor(...e){super(...e),this.labelAlign=`right`,this.noValidate=!1,this._onKeydown=e=>{if(e.key!==`Enter`||e.defaultPrevented||e.isComposing||e.shiftKey||e.ctrlKey||e.altKey||e.metaKey)return;let n=e.target;n instanceof HTMLInputElement&&!JC.has(n.type)&&(this.form.querySelector(`button:not([type]), button[type=submit], input[type=submit], input[type=image]`)||(e.preventDefault(),this.requestSubmit()))}}createRenderRoot(){return this}get form(){return this._form||(this._form=document.createElement(`form`),this._form.addEventListener(`submit`,e=>e.preventDefault()),this._form.addEventListener(`keydown`,this._onKeydown)),this._form}get elements(){return this.form.elements}connectedCallback(){super.connectedCallback(),RC(this,zC),this._adoptChildren(),this._observer=new MutationObserver(()=>this._adoptChildren()),this._observer.observe(this,{childList:!0})}disconnectedCallback(){super.disconnectedCallback(),this._observer?.disconnect()}updated(){this.form.noValidate=this.noValidate}_adoptChildren(){let e=this.form;e.parentNode!==this&&this.append(e);let n=Array.from(this.childNodes).filter(n=>n!==e);n.length>0&&e.append(...n)}requestSubmit(){this.form.requestSubmit()}reset(){this.form.reset()}checkValidity(){return this.form.checkValidity()}reportValidity(){return this.form.reportValidity()}getValues(e){return KC(this,e)}setValues(e){qC(this,e)}};E([d({type:String,attribute:`label-align`,reflect:!0})],YC.prototype,`labelAlign`,void 0),E([d({type:Boolean,attribute:`novalidate`,reflect:!0})],YC.prototype,`noValidate`,void 0),YC=E([T(`ixfx-form`)],YC);function XC(e,n,r,i,a,o,s,c,l=2){let u=Math.max(1,n),d=Math.max(1,r),f=Math.max(0,i),p=u+f,m=d+f,h=Math.max(0,s);if(c===`row`){let n=e===0?0:1,r=e===0?0:(e-1)*p+u;if(e===0||a<=0)return{cols:e,rows:n,totalHeight:0,totalWidth:r,startIndex:0,endIndex:0,colStride:p,rowStride:m,horizontal:!0};let i=Math.max(0,Math.floor(h/p)),o=Math.ceil((h+a)/p);return{cols:e,rows:n,totalHeight:0,totalWidth:r,startIndex:Math.max(0,i-l),endIndex:Math.min(e,o+l),colStride:p,rowStride:m,horizontal:!0}}let g=c===`column`?1:Math.max(1,Math.floor((Math.max(0,a)+f)/p)),_=e===0?0:Math.ceil(e/g),v=_===0?0:(_-1)*m+d;if(e===0||o<=0)return{cols:g,rows:_,totalHeight:v,totalWidth:0,startIndex:0,endIndex:0,colStride:p,rowStride:m,horizontal:!1};let y=Math.max(0,Math.floor(h/m)),b=Math.ceil((h+o)/m),x=Math.max(0,y-l),S=Math.min(_,b+l);return{cols:g,rows:_,totalHeight:v,totalWidth:0,startIndex:x*g,endIndex:Math.min(e,S*g),colStride:p,rowStride:m,horizontal:!1}}function ZC(e,n,r,i){let a=Math.max(0,e.gap),o=e.orientation===`row`,s=e=>o?e:Math.ceil(e/n),c=e=>e===0?0:(s(e)-1)*r+i;if(!e.groups){let n=c(e.count);return{sections:[{group:void 0,first:0,count:e.count,headerOffset:0,itemsOffset:0,end:n}],total:n,count:e.count}}let l=o?e.headerWidth:e.headerHeight,u=[],d=0,f=0;for(let n of e.groups){let e=n.collapsed?0:n.count,r=d+l+a,i=e===0?d+l:r+c(e);u.push({group:n,first:f,count:e,headerOffset:d,itemsOffset:r,end:i}),f+=e,d=i+a}return{sections:u,total:u.length===0?0:u[u.length-1].end,count:f}}function QC(e,n){let r=0,i=e.length-1;for(;r<i;){let a=r+i+1>>1;e[a].headerOffset<=n?r=a:i=a-1}return r}function $C(e,n){let r=0,i=e.length-1;for(;r<i;){let a=r+i+1>>1;e[a].first<=n?r=a:i=a-1}let a=r;for(;a<e.length-1&&e[a].count===0;)a++;return a}function ew(e){let n=e.orientation===`row`,r=Math.max(1,e.itemWidth),i=Math.max(1,e.rowHeight),a=Math.max(0,e.gap),o=r+a,s=i+a,c=n||e.orientation===`column`?1:Math.max(1,Math.floor((Math.max(0,e.viewportWidth)+a)/o)),l=n?o:s,u=n?r:i,{sections:d,total:f,count:p}=ZC(e,c,l,u),m=e.groups!==void 0,h=n?e.headerWidth:e.headerHeight,g=n?e.viewportWidth:e.viewportHeight,_=s-a,v=Math.max(0,(e.viewportHeight-_)/2),y=e=>{let r=$C(d,e),i=d[r],a=Math.max(0,e-i.first);if(n)return{x:i.itemsOffset+a*o,y:v,col:0,line:a,section:r};let l=c<=1?0:a%c,u=c<=1?a:Math.floor(a/c);return{x:l*o,y:i.itemsOffset+u*s,col:l,line:u,section:r}};return{horizontal:n,cols:c,colStride:o,rowStride:s,grouped:m,count:p,totalExtent:f,window:(u,m=2)=>{let _=Math.max(0,u),v=[],y=[],b=_-m*l,x=_+g+m*l,S=0;if(d.length>1){let e=0,n=d.length-1;for(;e<n;){let r=e+n>>1;d[r].end>=b?n=r:e=r+1}S=e}if(g>0)for(let o=S;o<d.length;o++){let s=d[o];if(s.headerOffset>x)break;if(s.group&&s.headerOffset+h>=b&&v.push({key:s.group.key,label:s.group.label,count:s.group.count,collapsed:s.group.collapsed,offset:s.headerOffset,size:h}),s.count===0)continue;let c=_-s.itemsOffset,l=c<0?g+c:g;if(l<=0)continue;let u=XC(s.count,r,i,a,n?l:e.viewportWidth,n?e.viewportHeight:l,Math.max(0,c),e.orientation,m);u.endIndex>u.startIndex&&y.push([s.first+u.startIndex,s.first+u.endIndex])}return{cols:n?p:c,rows:0,totalHeight:n?0:f,totalWidth:n?f:0,startIndex:y.length>0?y[0][0]:0,endIndex:y.length>0?y[y.length-1][1]:0,colStride:o,rowStride:s,horizontal:n,headers:v,ranges:y}},positionOf:y,extentOf:e=>{let{line:n,section:r}=y(e),i=d[r],a=i.itemsOffset+n*l;return[n===0&&i.group?i.headerOffset:a,a+u]},neighbour:(e,n)=>{if(p===0)return e;let r=$C(d,e),i=d[r],a=e-i.first,o=a%c;if(n>0){let e=a+c;if(e<=i.count-1)return i.first+e;let n=Math.floor((i.count-1)/c);if(Math.floor(a/c)<n)return i.first+i.count-1;for(let e=r+1;e<d.length;e++)if(d[e].count>0)return d[e].first+Math.min(o,d[e].count-1);return i.first+i.count-1}let s=a-c;if(s>=0)return i.first+s;for(let e=r-1;e>=0;e--){let n=d[e];if(n.count>0){let e=Math.floor((n.count-1)/c);return n.first+Math.min(e*c+o,n.count-1)}}return i.first},hitTest:(e,r,i,a)=>{let u=[];if(p===0)return u;let f=n?e:i,m=n?r:a,h=QC(d,f-l);for(let l=Math.max(0,h);l<d.length;l++){let p=d[l];if(p.itemsOffset>m)break;if(!(p.count===0||p.end<f)){if(n){let n=Math.max(0,Math.floor((e-p.itemsOffset)/o)),i=Math.min(p.count-1,Math.floor((r-p.itemsOffset)/o));for(let e=n;e<=i;e++)u.push(p.first+e)}else{let n=Math.max(0,Math.floor(e/o)),l=Math.min(c-1,Math.floor(r/o)),d=Math.max(0,Math.floor((i-p.itemsOffset)/s)),f=Math.floor((a-p.itemsOffset)/s);for(let e=d;e<=f;e++)for(let r=n;r<=l;r++){let n=e*c+r;n>=0&&n<p.count&&u.push(p.first+n)}}}}return u},anchorAt:e=>{if(p===0)return{index:0,lineFrac:0};let r=QC(d,e);for(;r<d.length-1&&d[r].count===0;)r++;let i=d[r];if(i.count===0)return{index:0,lineFrac:0};let a=Math.max(0,e-i.itemsOffset)/l,o=Math.max(0,Math.floor(a)),s=n?Math.min(i.count-1,o):Math.min(i.count-1,o*c+Math.max(0,Math.floor((c-1)/2)));return{index:i.first+s,lineFrac:a-o}},offsetOfAnchor:(e,n)=>{let{line:r,section:i}=y(e);return d[i].itemsOffset+(r+n)*l},snapTarget:e=>{let r=QC(d,e),i=d[r],a=Math.round((e-i.itemsOffset)/l);if(m){let e=i.count===0?0:n?i.count:Math.ceil(i.count/c);a=Math.max(0,Math.min(Math.max(0,e-1),a))}let o=[i.itemsOffset+a*l];return m&&(o.push(i.headerOffset),r+1<d.length&&o.push(d[r+1].headerOffset)),o.reduce((n,r)=>Math.abs(r-e)<Math.abs(n-e)?r:n)}}}function tw(e,n,r){let i=yn(e,e=>n.groupKeyOf(e),n.labelOf?(e,r)=>n.labelOf(e,r.map(e=>n.itemAt(e))):void 0),a=[],o=[],s=/* @__PURE__ */ new Map;for(let e of i){let i=n.collapsed.has(e.key);o.push({key:e.key,label:e.label,count:e.items.length,collapsed:i});for(let n of e.items)s.set(r(n),e.key),i||a.push(n)}return{order:a,groups:o,groupByKey:s}}const nw=`gl-auto-`;function rw(e){return e.startsWith(nw)}function iw(e){let n=/* @__PURE__ */ new Set,r=/* @__PURE__ */ new Set;for(let i of e)rw(i)||(n.has(i)?r.add(i):n.add(i));r.size>0&&console.warn(`ixfx-grid-list: duplicate item key(s) ${[...r].map(e=>`"${e}"`).join(`, `)} — the first occurrence wins for key-based operations.`)}function aw(e){let n=/* @__PURE__ */ new Map;return e.forEach((e,r)=>{n.has(e)||n.set(e,r)}),n}var ow=class{#e;#t=[];#n=/* @__PURE__ */ new WeakMap;#r=0;#i;#a;#o=[];#s;#c;#l;#u=[];#d=/* @__PURE__ */ new Map;constructor(e){this.#e=e,this.refresh()}get count(){return this.#o.length}get rawCount(){return this.#t.length}keyAt(e){let n=this.#o[e];return n===void 0?``:this.#m(this.#t[n])}indexOfKey(e){return this.#c??=aw(this.keys()),this.#c.get(e)??-1}keys(){return this.#s??=this.#o.map(e=>this.#m(this.#t[e])),this.#s}labelAt(e){let n=this.#o[e];return n===void 0?``:this.#h(this.#t[n])}rawKeyAt(e){let n=this.#t[e];return n===void 0?``:this.#m(n)}rawSearchTextAt(e){let n=this.#t[e];return n===void 0?``:n.getAttribute(`data-search-label`)??n.getAttribute(`data-label`)??n.querySelector(`[data-grid-list-caption]`)?.textContent?.trim()??n.textContent?.trim()??``}isSelectable(e){let n=this.#o[e];return n!==void 0&&!this.#t[n].hasAttribute(`not-checked`)}renderCellContent(e){}iconAt(e){}iconColorAt(e){}textColorAt(e){}badgeAt(e){}setFilters(e){`predicate`in e&&(this.#i=e.predicate),`searchKeys`in e&&(this.#a=e.searchKeys),this.#f()}setGrouping(e){this.#l=e,this.#f()}groups(){return this.#u}groupKeyOfKey(e){return this.#d.get(e)??null}refresh(){this.#t=Array.from(this.#e.querySelectorAll(`:scope > *`)).filter(e=>!e.hidden),iw(this.#t.map(e=>this.#m(e))),this.#f()}effectiveElements(){return this.#o.map(e=>this.#t[e])}rawElementAt(e){return this.#t[e]}resolveKeyToElement(e){return rw(e)?this.#t.find(n=>this.#n.get(n)===e):this.#t.find(n=>D(n)===e)}resolveKeyToData(e){}#f(){let e=[];for(let n=0;n<this.#t.length;n++)if(this.#i===void 0||this.#i(n)){if(this.#a!==void 0){let e=this.#m(this.#t[n]);if(!rw(e)&&!this.#a.has(e))continue}e.push(n)}this.#p(e),this.#s=void 0,this.#c=void 0}#p(e){if(this.#l===void 0){this.#o=e,this.#u=[],this.#d=/* @__PURE__ */ new Map;return}let n=tw(e,this.#l,e=>this.#m(this.#t[e]));this.#o=n.order,this.#u=n.groups,this.#d=n.groupByKey}#m(e){let n=D(e);if(n!==void 0)return n;let r=this.#n.get(e);return r===void 0&&(this.#r+=1,r=`${nw}${this.#r}`,this.#n.set(e,r)),r}#h(e){return e.getAttribute(`data-label`)??e.querySelector(`[data-grid-list-caption]`)?.textContent?.trim()??``}},sw=class{#e;#t;#n;#r;#i=[];#a;#o;#s;#c=[];#l=/* @__PURE__ */ new Map;constructor(e,n){this.#e=e,this.#t=n,iw(e.map((e,r)=>n.key(e,r))),this.#u()}get count(){return this.#i.length}get rawCount(){return this.#e.length}keyAt(e){let n=this.#i[e];return n===void 0?``:this.#t.key(this.#e[n],n)}indexOfKey(e){return this.#o??=aw(this.keys()),this.#o.get(e)??-1}keys(){return this.#a??=this.#i.map(e=>this.#t.key(this.#e[e],e)),this.#a}labelAt(e){let n=this.#i[e];return n===void 0?``:this.#t.label?.(this.#e[n],n)??this.#t.key(this.#e[n],n)}rawKeyAt(e){return e<0||e>=this.#e.length?``:this.#t.key(this.#e[e],e)}rawSearchTextAt(e){if(e<0||e>=this.#e.length)return``;let n=this.#e[e];return this.#t.searchableText?.(n,e)??this.#t.label?.(n,e)??``}isSelectable(e){let n=this.#i[e];return n!==void 0&&!this.#t.disabled?.(this.#e[n],n)}renderCellContent(e){let n=this.#i[e];return n===void 0?void 0:this.#t.render(this.#e[n],n)}iconAt(e){let n=this.#i[e];return n===void 0||this.#t.icon===void 0?void 0:this.#t.icon(this.#e[n],n)}iconColorAt(e){let n=this.#i[e];return n===void 0?void 0:this.#t.iconColor?.(this.#e[n],n)}textColorAt(e){let n=this.#i[e];return n===void 0?void 0:this.#t.textColor?.(this.#e[n],n)}badgeAt(e){let n=this.#i[e];return n===void 0||this.#t.badge===void 0?void 0:this.#t.badge(this.#e[n],n)}setFilters(e){`predicate`in e&&(this.#n=e.predicate),`searchKeys`in e&&(this.#r=e.searchKeys),this.#u()}setGrouping(e){this.#s=e,this.#u()}groups(){return this.#c}groupKeyOfKey(e){return this.#l.get(e)??null}refresh(){this.#u()}rawItemAt(e){return this.#e[e]}getItemAt(e){let n=this.#i[e];return n===void 0?void 0:this.#e[n]}resolveKeyToElement(e){}resolveKeyToData(e){let n=this.#e.findIndex((n,r)=>this.#t.key(n,r)===e);return n>=0?this.#e[n]:void 0}#u(){let e=[];for(let n=0;n<this.#e.length;n++)(this.#n===void 0||this.#n(n))&&(this.#r===void 0||this.#r.has(this.#t.key(this.#e[n],n)))&&e.push(n);if(this.#s===void 0)this.#i=e,this.#c=[],this.#l=/* @__PURE__ */ new Map;else{let n=tw(e,this.#s,e=>this.#t.key(this.#e[e],e));this.#i=n.order,this.#c=n.groups,this.#l=n.groupByKey}this.#a=void 0,this.#o=void 0}};function cw(e,n,r){let i,a;for(let o of e)r(o)||(i??=new Set(e),i.delete(o),a??=new Map(n),a.set(o,!1));for(let[o,s]of n)r(o)&&(a??=new Map(n),a.delete(o),s===(i??e).has(o)&&(i??=new Set(e),s?i.delete(o):i.add(o)));return{collapsed:i??e,pending:a?lr(a):n,changed:i!==void 0||a!==void 0}}function lw(e,n,r){return fr(r?n:[],mr(e,!1))}function uw(e,n,r,i){let a=e.horizontal?{top:r,left:n}:r===0?{top:n}:{top:n,left:r},o=e.window(n,0);if(o.ranges.length===0)return a;let s=o.startIndex,c=i(s);if(c===void 0)return a;let l=e.offsetOfAnchor(s,0);return{...a,anchor:{key:c,offset:Math.round(n-l)}}}function dw(e,n,r,i){let a=n.horizontal?e.left??0:e.top;if(e.anchor){let i=r(e.anchor.key);if(i<0)return;a=n.offsetOfAnchor(i,0)+e.anchor.offset}let o=Math.max(0,n.totalExtent-i);return{offset:Math.max(0,Math.min(a,o)),reached:a<=o+1}}function fw(e,n){return typeof e==`object`&&e?e[n]:void 0}function pw(e,n){return e.getAttribute(`data-${n}`)}function mw(e,n){if(e===void 0||e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==n[r])return!1;return!0}function hw(e,n,r){for(let i of n)r.has(i)||i.removeAttribute(e);for(let n of r)n.hasAttribute(e)||n.setAttribute(e,``);return r}let K=class extends n{constructor(...e){super(...e),this.selectionMode=`single`,this.interactionMode=`standard`,this.disableHoverTickle=!1,this.scrollHoverTickle=!1,this.itemSize=160,this.gap=8,this.orientation=`grid`,this.captionStyle=`under`,this.captionAlign=`middle`,this.captionPosition=`bottom`,this.captionBackdrop=`scrim`,this.captionHeight=24,this.itemWrap=`stop`,this.itemsDraggable=!1,this.marqueeFromCellBlank=!1,this.snapToItem=!1,this.items=[],this.groupBy=null,this.crossGroupSelection=!1,this.groupHeaderHeight=28,this.groupHeaderWidth=120,this._collapsedGroups=/* @__PURE__ */ new Set,this._scrollTop=0,this._scrollLeft=0,this._viewportHeight=0,this._viewportWidth=0,this.#e=new cy(this,{kind:`grid-list`,capture:()=>this.getViewState()}),this.#t=ar,this.#i=x(),this.#c=0,this.#l=0,this.#u=[],this.#d=`stop`,this.#f=/* @__PURE__ */ new Map,this.#p=0,this.#m=/* @__PURE__ */ new Set,this.#h=[],this.#g=/* @__PURE__ */ new Map,this.#_=/* @__PURE__ */ new Set,this.#v=0,this.#b=new ow(this),this.#x=this.#b,this.selection=new _r({getOrderedItems:()=>this.#x.keys(),isSelectable:e=>{let n=this.#x.indexOfKey(e);return n>=0&&this.#x.isSelectable(n)},getModes:()=>({selectionMode:this.selectionMode,interactionMode:this.interactionMode}),getKey:e=>e,onIntent:e=>this._dispatch(`list-select-intent`,e,!0)===!1,getGroupKey:e=>this.groupBy===null?null:this.#x.groupKeyOfKey(e),crossGroupSelection:()=>this.crossGroupSelection,getFallbackGroupKey:()=>{let e=this.tickled.tickledId;return e!==void 0&&this.groupBy!==null?this.#x.groupKeyOfKey(e):null},onChange:(e,n)=>{this._syncItemStates(),this.requestUpdate(),this.#De(e,n)}}),this.tickled=new oe(this,{getItems:()=>this.#x.keys().map((e,n)=>({id:e,enabled:this.#x.isSelectable(n)})),onTickle:e=>{this.#ze(),e!==void 0&&this.#Oe(`list-tickle`,e),this.tickled.inputMode===`keyboard`&&(e!==void 0&&!this.#e.isRestoring&&(this.#n=void 0),this.#e.notify())},onStateChange:()=>this._syncItemStates(),itemWrap:this.#d,hoverDisabled:()=>this.disableHoverTickle||this.#M.isDragging||this.#O.isDragging}),this.#S=Cr({host:this,enabled:()=>!this.scrollHoverTickle,onResume:(e,n)=>{if(this.disableHoverTickle)return;let r=this.shadowRoot?.elementFromPoint?.(e,n)?.closest(`.cell`)?.getAttribute(`data-key`);r&&this.tickled.handlePointerEnter(r)}}),this.#C=/* @__PURE__ */ new Set,this.#T=!1,this.#E=void 0,this.#D=0,this.#O=new rr(this,{source:`grid-list`,isEnabled:()=>this.itemsDraggable&&this.selectionMode!==`none`&&this.#x.count>0,resolveEventToKey:e=>{if(e instanceof Element){let n=(e.closest?.(`.cell`))?.dataset.key;if(n)return n;let r=(e.closest?.(`[data-key]`))?.dataset.key??e.dataset?.key??D(e);if(r)return r}},prepareSelection:e=>this.#A(e),getMetrics:()=>({itemSize:this.itemSize,captionStyle:this.captionStyle,captionHeight:this.captionHeight,rowHeight:this.#ne()}),getRenderer:()=>this.dragPreviewRenderer,getDragPreviewSourceResolver:()=>this.dragPreviewSource,dispatch:e=>this._dispatch(`list-native-drag-start`,e,!0),onActiveChange:(e,n)=>{if(this.#T=e,this.#E=e?n:void 0,this.toggleAttribute(`data-native-dragging`,e),e){let e=[...this.selection.selectedKeys].filter(e=>!rw(e)).length;this.setAttribute(`aria-label`,e<=1?`Dragging 1 item`:`Dragging ${e} items`)}else this.removeAttribute(`aria-label`);this.requestUpdate()},onEnd:()=>{this.#et(),this.#$e()},syncLightDomDraggable:()=>{for(let e of this.children)e instanceof HTMLElement&&(e.draggable=this.itemsDraggable)},shouldStart:e=>!(this.marqueeFromCellBlank&&this.#N(e))}),this.#j=null,this.#M=new Gn(this,{getSurface:()=>this.#i.value,isEnabled:()=>this.selection.canDragSelect()&&this.#x.count>0&&!this.hasAttribute(`disable-drag-select`),hitTest:e=>this.#P(e),getBaseSelection:()=>this.selection.selected,onPreview:(e,n)=>{this.#C=e,this.#w=n,this.requestUpdate()},onCommit:(e,n)=>{this.selection.applyDragSelection(e,n),this.#C=/* @__PURE__ */ new Set,this.#w=void 0,this.requestUpdate()},autoScroll:(e,n)=>{let r=this.#i.value;r&&(e!==0&&(r.scrollLeft+=e,this._scrollLeft=r.scrollLeft),n!==0&&(r.scrollTop+=n,this._scrollTop=r.scrollTop))},shouldStart:e=>{if(this.marqueeFromCellBlank&&this.#N(e))return!0;for(let n of e.composedPath())if(n instanceof Element&&(n.classList.contains(`cell`)||n.classList.contains(`group-header`)))return!1;return!0}}),this.#Z=!1,this.#le=e=>this.#x.indexOfKey(e)>=0?e:void 0,this.#Ce=/* @__PURE__ */ new Set,this.#we=/* @__PURE__ */ new Set,this.#Te=/* @__PURE__ */ new Set,this.#Ee=/* @__PURE__ */ new Set,this.#ke=/* @__PURE__ */ new Set,this.#We=e=>{let n=e.target;this.#S.onScroll(),this.#qe(),this.#c=requestAnimationFrame(()=>{this.#c=0,this._scrollTop=n.scrollTop,this._scrollLeft=n.scrollLeft,this.#J()}),this.#Ye();let r=this.orientation===`row`?n.scrollLeft:n.scrollTop,i=this.#r!==void 0&&Math.abs(r-this.#r)<=1;this.#r=void 0,!i&&!this.#e.pendingScroll&&this.#e.notify()},this.#Ge=e=>{if(this.orientation!==`row`||e.ctrlKey||e.metaKey||e.deltaY===0)return;let n=this.#i.value??e.currentTarget;n&&(n.scrollWidth<=n.clientWidth+1||(this.#S.onScroll(),n.scrollLeft+=e.deltaX+e.deltaY,e.preventDefault()))},this._onKeyDown=e=>{if((e.ctrlKey||e.metaKey)&&e.key===`f`)return;if((e.ctrlKey||e.metaKey)&&e.key===`a`){this.selection.canSelectAll()&&(e.preventDefault(),this.selection.selectAll(`keyboard`));return}let n=this.#x.count;if(n===0)return;let r=this.#xe(),i=this.#be(),a=()=>this.tickled.tickledId?this.#x.indexOfKey(this.tickled.tickledId):-1,o=e=>{let n=this.#x.keyAt(e);n&&(this.tickled.handleKeyboardNavigation(n),this.#Se(n))},s=e=>o(Math.max(0,Math.min(n-1,a()+e))),c=(e,n=1)=>{let c=a();if(c<0)s(e*n*r.cols);else{for(let r=0;r<n;r++)c=i.neighbour(c,e);o(c)}},l=this.orientation===`grid`?r.cols:1;switch(e.key){case`ArrowLeft`:s(-1);break;case`ArrowRight`:s(1);break;case`ArrowUp`:this.orientation===`grid`?c(-1):s(-l);break;case`ArrowDown`:this.orientation===`grid`?c(1):s(l);break;case`Home`:this.tickled.handleKeyboardNavigation(`first`),this.tickled.tickledId&&this.#Se(this.tickled.tickledId);break;case`End`:this.tickled.handleKeyboardNavigation(`last`),this.tickled.tickledId&&this.#Se(this.tickled.tickledId);break;case`PageUp`:case`PageDown`:{let n=r.horizontal?this._viewportWidth:this._viewportHeight,i=r.horizontal?r.colStride:r.rowStride,a=Math.max(1,Math.floor(n/i));this.orientation===`grid`?c(e.key===`PageDown`?1:-1,a):s((e.key===`PageDown`?1:-1)*a*l);break}case`Enter`:{let n=this.tickled.tickledId;n&&(e.preventDefault(),this.#Oe(`list-item-click`,n),this.#tt(n,`keyboard`));break}case` `:{let n=this.tickled.tickledId;n&&(e.preventDefault(),this.selection.handleSpace(n));break}case`Escape`:this.#T&&this.#et(),this.selection.handleClear(`keyboard`);break;default:return}e.preventDefault()}}static{this.styles=[w,se,C,Tr(`x`),Tr(`y`),Jn,Ut,r`
|
|
7658
|
+
`;let zC=class extends n{constructor(...e){super(...e),this.label=``}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),LC(this,RC),this._observer=new MutationObserver(()=>this._sync())}firstUpdated(){this._fieldset=this.querySelector(`fieldset`)??void 0,this._fieldset&&(this._observer?.observe(this,{childList:!0,subtree:!0}),this._sync())}disconnectedCallback(){super.disconnectedCallback(),this._observer?.disconnect()}_sync(){this._moveChildren(),this._updatePairs()}_updatePairs(){if(!this._fieldset)return;let e=Array.from(this._fieldset.querySelectorAll(`:scope > ixfx-form-row`)).map(e=>e.querySelectorAll(`:scope > ixfx-form-part`).length),n=Math.max(1,...e);this._fieldset.style.setProperty(`--ixfx-form-pairs`,String(n))}_moveChildren(){this._fieldset&&Array.from(this.children).filter(e=>e.tagName!==`FIELDSET`).forEach(e=>{this._fieldset.appendChild(e)})}render(){return i`<fieldset><legend>${this.label}</legend></fieldset>`}};E([d({type:String})],zC.prototype,`label`,void 0),E([d({type:String,attribute:`label-align`,reflect:!0})],zC.prototype,`labelAlign`,void 0),zC=E([T(`ixfx-form-group`)],zC);let BC=0,VC=class extends n{constructor(...e){super(...e),this.label=``,this.orientation=`horizontal`,this._labelId=`ixfx-form-options-${++BC}`}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),LC(this,RC),this.setAttribute(`role`,`group`),this.setAttribute(`aria-labelledby`,this._labelId),this._observer=new MutationObserver(()=>this._moveChildren())}firstUpdated(){this._observer?.observe(this,{childList:!0}),this._moveChildren()}disconnectedCallback(){super.disconnectedCallback(),this._observer?.disconnect()}_moveChildren(){let e=this.querySelector(`:scope > .ixfx-form-options-items`);e&&Array.from(this.children).filter(e=>!e.classList.contains(`ixfx-form-options-items`)&&!e.classList.contains(`ixfx-form-options-label`)).forEach(n=>e.appendChild(n))}render(){return i`<span class="ixfx-form-options-label" id=${this._labelId}>${this.label}</span><div class="ixfx-form-options-items"></div>`}};E([d({type:String})],VC.prototype,`label`,void 0),E([d({type:String,reflect:!0})],VC.prototype,`orientation`,void 0),VC=E([T(`ixfx-form-options`)],VC);let HC=0,UC=class extends n{constructor(...e){super(...e),this.label=``}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),LC(this,RC),this._ensureId()}_ensureId(){let e=this.querySelector(`input, select, textarea, [name]`);e&&(e.id?this._id=e.id:(this._id=`ixfx-form-part-${++HC}`,e.id=this._id))}render(){return this._id||this._ensureId(),i`<label for=${this._id??``}>${this.label}</label>`}};E([d({type:String})],UC.prototype,`label`,void 0),UC=E([T(`ixfx-form-part`)],UC);let WC=class extends n{createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),LC(this,RC),this._observer=new MutationObserver(()=>this._indexParts()),this._observer.observe(this,{childList:!0}),this._indexParts()}disconnectedCallback(){super.disconnectedCallback(),this._observer?.disconnect()}_indexParts(){Array.from(this.children).filter(e=>e.tagName===`IXFX-FORM-PART`).forEach((e,n)=>{e.style.setProperty(`--ixfx-form-part-index`,String(n+1))})}};WC=E([T(`ixfx-form-row`)],WC);function GC(e,n={}){let r={};return e.querySelectorAll(`[name]`).forEach(e=>{let i=e.getAttribute(`name`);i&&(e instanceof HTMLInputElement?e.type===`radio`?e.checked&&(r[i]=e.value):e.type===`checkbox`?r[i]=e.checked:n.typed&&(e.type===`number`||e.type===`range`)?r[i]=Number.isNaN(e.valueAsNumber)?null:e.valueAsNumber:r[i]=e.value:e instanceof HTMLSelectElement?e.multiple?r[i]=Array.from(e.selectedOptions).map(e=>e.value):r[i]=e.value:(e instanceof HTMLTextAreaElement||`value`in e)&&(r[i]=e.value))}),r}function KC(e,n){e.querySelectorAll(`[name]`).forEach(e=>{let r=e.getAttribute(`name`);if(!r||!(r in n))return;let i=n[r];e instanceof HTMLInputElement?(e.type===`radio`?e.checked=e.value===i:e.type===`checkbox`?e.checked=!!i:e.value=String(i??``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.dispatchEvent(new Event(`change`,{bubbles:!0}))):e instanceof HTMLSelectElement?(e.multiple&&Array.isArray(i)?Array.from(e.options).forEach(e=>{e.selected=i.includes(e.value)}):e.value=String(i??``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.dispatchEvent(new Event(`change`,{bubbles:!0}))):e instanceof HTMLTextAreaElement?(e.value=String(i??``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.dispatchEvent(new Event(`change`,{bubbles:!0}))):`value`in e&&(e.value=i)})}const qC=/* @__PURE__ */ new Set([`button`,`submit`,`reset`,`image`,`file`,`color`]);let JC=class extends n{constructor(...e){super(...e),this.labelAlign=`right`,this.noValidate=!1,this._onKeydown=e=>{if(e.key!==`Enter`||e.defaultPrevented||e.isComposing||e.shiftKey||e.ctrlKey||e.altKey||e.metaKey)return;let n=e.target;n instanceof HTMLInputElement&&!qC.has(n.type)&&(this.form.querySelector(`button:not([type]), button[type=submit], input[type=submit], input[type=image]`)||(e.preventDefault(),this.requestSubmit()))}}createRenderRoot(){return this}get form(){return this._form||(this._form=document.createElement(`form`),this._form.addEventListener(`submit`,e=>e.preventDefault()),this._form.addEventListener(`keydown`,this._onKeydown)),this._form}get elements(){return this.form.elements}connectedCallback(){super.connectedCallback(),LC(this,RC),this._adoptChildren(),this._observer=new MutationObserver(()=>this._adoptChildren()),this._observer.observe(this,{childList:!0})}disconnectedCallback(){super.disconnectedCallback(),this._observer?.disconnect()}updated(){this.form.noValidate=this.noValidate}_adoptChildren(){let e=this.form;e.parentNode!==this&&this.append(e);let n=Array.from(this.childNodes).filter(n=>n!==e);n.length>0&&e.append(...n)}requestSubmit(){this.form.requestSubmit()}reset(){this.form.reset()}checkValidity(){return this.form.checkValidity()}reportValidity(){return this.form.reportValidity()}getValues(e){return GC(this,e)}setValues(e){KC(this,e)}};E([d({type:String,attribute:`label-align`,reflect:!0})],JC.prototype,`labelAlign`,void 0),E([d({type:Boolean,attribute:`novalidate`,reflect:!0})],JC.prototype,`noValidate`,void 0),JC=E([T(`ixfx-form`)],JC);var YC=class{#e=/* @__PURE__ */ new Map;#t=void 0;#n=void 0;ensure(e,n){if(this.#t===e&&this.#n===n)return;if(!n){this.#e=/* @__PURE__ */ new Map,this.#t=e,this.#n=void 0;return}let r=/* @__PURE__ */ new Map;for(let i=0;i<e.length;i++){let a=n.key(e[i],i);r.has(a)||r.set(a,i)}this.#e=r,this.#t=e,this.#n=n}get(e){return this.#e.get(e)??-1}has(e){return this.#e.has(e)}commit(e,n){n&&n(this.#e),this.#t=e}rekey(e,n,r,i,a){let o=a.key(i,n);if(o!==r){if(this.#e.delete(r),!this.#e.has(r)){for(let i=n+1;i<e.length;i++)if(a.key(e[i],i)===r){this.#e.set(r,i);break}}this.#e.has(o)||this.#e.set(o,n)}}rebuild(e,n){let r=/* @__PURE__ */ new Map;for(let i=0;i<e.length;i++){let a=n.key(e[i],i);r.has(a)||r.set(a,i)}this.#e=r,this.#t=e}addAppended(e,n,r){for(let i=0;i<e.length;i++){let a=r.key(e[i],n+i);this.#e.has(a)||this.#e.set(a,n+i)}}};function XC(e,n,r,i,a,o,s,c,l=2){let u=Math.max(1,n),d=Math.max(1,r),f=Math.max(0,i),p=u+f,m=d+f,h=Math.max(0,s);if(c===`row`){let n=e===0?0:1,r=e===0?0:(e-1)*p+u;if(e===0||a<=0)return{cols:e,rows:n,totalHeight:0,totalWidth:r,startIndex:0,endIndex:0,colStride:p,rowStride:m,horizontal:!0};let i=Math.max(0,Math.floor(h/p)),o=Math.ceil((h+a)/p);return{cols:e,rows:n,totalHeight:0,totalWidth:r,startIndex:Math.max(0,i-l),endIndex:Math.min(e,o+l),colStride:p,rowStride:m,horizontal:!0}}let g=c===`column`?1:Math.max(1,Math.floor((Math.max(0,a)+f)/p)),_=e===0?0:Math.ceil(e/g),v=_===0?0:(_-1)*m+d;if(e===0||o<=0)return{cols:g,rows:_,totalHeight:v,totalWidth:0,startIndex:0,endIndex:0,colStride:p,rowStride:m,horizontal:!1};let y=Math.max(0,Math.floor(h/m)),b=Math.ceil((h+o)/m),x=Math.max(0,y-l),S=Math.min(_,b+l);return{cols:g,rows:_,totalHeight:v,totalWidth:0,startIndex:x*g,endIndex:Math.min(e,S*g),colStride:p,rowStride:m,horizontal:!1}}function ZC(e,n,r,i){let a=Math.max(0,e.gap),o=e.orientation===`row`,s=e=>o?e:Math.ceil(e/n),c=e=>e===0?0:(s(e)-1)*r+i;if(!e.groups){let n=c(e.count);return{sections:[{group:void 0,first:0,count:e.count,headerOffset:0,itemsOffset:0,end:n}],total:n,count:e.count}}let l=o?e.headerWidth:e.headerHeight,u=[],d=0,f=0;for(let n of e.groups){let e=n.collapsed?0:n.count,r=d+l+a,i=e===0?d+l:r+c(e);u.push({group:n,first:f,count:e,headerOffset:d,itemsOffset:r,end:i}),f+=e,d=i+a}return{sections:u,total:u.length===0?0:u[u.length-1].end,count:f}}function QC(e,n){let r=0,i=e.length-1;for(;r<i;){let a=r+i+1>>1;e[a].headerOffset<=n?r=a:i=a-1}return r}function $C(e,n){let r=0,i=e.length-1;for(;r<i;){let a=r+i+1>>1;e[a].first<=n?r=a:i=a-1}let a=r;for(;a<e.length-1&&e[a].count===0;)a++;return a}function ew(e){let n=e.orientation===`row`,r=Math.max(1,e.itemWidth),i=Math.max(1,e.rowHeight),a=Math.max(0,e.gap),o=r+a,s=i+a,c=n||e.orientation===`column`?1:Math.max(1,Math.floor((Math.max(0,e.viewportWidth)+a)/o)),l=n?o:s,u=n?r:i,{sections:d,total:f,count:p}=ZC(e,c,l,u),m=e.groups!==void 0,h=n?e.headerWidth:e.headerHeight,g=n?e.viewportWidth:e.viewportHeight,_=s-a,v=Math.max(0,(e.viewportHeight-_)/2),y=e=>{let r=$C(d,e),i=d[r],a=Math.max(0,e-i.first);if(n)return{x:i.itemsOffset+a*o,y:v,col:0,line:a,section:r};let l=c<=1?0:a%c,u=c<=1?a:Math.floor(a/c);return{x:l*o,y:i.itemsOffset+u*s,col:l,line:u,section:r}};return{horizontal:n,cols:c,colStride:o,rowStride:s,grouped:m,count:p,totalExtent:f,window:(u,m=2)=>{let _=Math.max(0,u),v=[],y=[],b=_-m*l,x=_+g+m*l,S=0;if(d.length>1){let e=0,n=d.length-1;for(;e<n;){let r=e+n>>1;d[r].end>=b?n=r:e=r+1}S=e}if(g>0)for(let o=S;o<d.length;o++){let s=d[o];if(s.headerOffset>x)break;if(s.group&&s.headerOffset+h>=b&&v.push({key:s.group.key,label:s.group.label,count:s.group.count,collapsed:s.group.collapsed,offset:s.headerOffset,size:h}),s.count===0)continue;let c=_-s.itemsOffset,l=c<0?g+c:g;if(l<=0)continue;let u=XC(s.count,r,i,a,n?l:e.viewportWidth,n?e.viewportHeight:l,Math.max(0,c),e.orientation,m);u.endIndex>u.startIndex&&y.push([s.first+u.startIndex,s.first+u.endIndex])}return{cols:n?p:c,rows:0,totalHeight:n?0:f,totalWidth:n?f:0,startIndex:y.length>0?y[0][0]:0,endIndex:y.length>0?y[y.length-1][1]:0,colStride:o,rowStride:s,horizontal:n,headers:v,ranges:y}},positionOf:y,extentOf:e=>{let{line:n,section:r}=y(e),i=d[r],a=i.itemsOffset+n*l;return[n===0&&i.group?i.headerOffset:a,a+u]},neighbour:(e,n)=>{if(p===0)return e;let r=$C(d,e),i=d[r],a=e-i.first,o=a%c;if(n>0){let e=a+c;if(e<=i.count-1)return i.first+e;let n=Math.floor((i.count-1)/c);if(Math.floor(a/c)<n)return i.first+i.count-1;for(let e=r+1;e<d.length;e++)if(d[e].count>0)return d[e].first+Math.min(o,d[e].count-1);return i.first+i.count-1}let s=a-c;if(s>=0)return i.first+s;for(let e=r-1;e>=0;e--){let n=d[e];if(n.count>0){let e=Math.floor((n.count-1)/c);return n.first+Math.min(e*c+o,n.count-1)}}return i.first},hitTest:(e,r,i,a)=>{let u=[];if(p===0)return u;let f=n?e:i,m=n?r:a,h=QC(d,f-l);for(let l=Math.max(0,h);l<d.length;l++){let p=d[l];if(p.itemsOffset>m)break;if(!(p.count===0||p.end<f)){if(n){let n=Math.max(0,Math.floor((e-p.itemsOffset)/o)),i=Math.min(p.count-1,Math.floor((r-p.itemsOffset)/o));for(let e=n;e<=i;e++)u.push(p.first+e)}else{let n=Math.max(0,Math.floor(e/o)),l=Math.min(c-1,Math.floor(r/o)),d=Math.max(0,Math.floor((i-p.itemsOffset)/s)),f=Math.floor((a-p.itemsOffset)/s);for(let e=d;e<=f;e++)for(let r=n;r<=l;r++){let n=e*c+r;n>=0&&n<p.count&&u.push(p.first+n)}}}}return u},anchorAt:e=>{if(p===0)return{index:0,lineFrac:0};let r=QC(d,e);for(;r<d.length-1&&d[r].count===0;)r++;let i=d[r];if(i.count===0)return{index:0,lineFrac:0};let a=Math.max(0,e-i.itemsOffset)/l,o=Math.max(0,Math.floor(a)),s=n?Math.min(i.count-1,o):Math.min(i.count-1,o*c+Math.max(0,Math.floor((c-1)/2)));return{index:i.first+s,lineFrac:a-o}},offsetOfAnchor:(e,n)=>{let{line:r,section:i}=y(e);return d[i].itemsOffset+(r+n)*l},snapTarget:e=>{let r=QC(d,e),i=d[r],a=Math.round((e-i.itemsOffset)/l);if(m){let e=i.count===0?0:n?i.count:Math.ceil(i.count/c);a=Math.max(0,Math.min(Math.max(0,e-1),a))}let o=[i.itemsOffset+a*l];return m&&(o.push(i.headerOffset),r+1<d.length&&o.push(d[r+1].headerOffset)),o.reduce((n,r)=>Math.abs(r-e)<Math.abs(n-e)?r:n)}}}function tw(e,n,r){let i=yn(e,e=>n.groupKeyOf(e),n.labelOf?(e,r)=>n.labelOf(e,r.map(e=>n.itemAt(e))):void 0),a=[],o=[],s=/* @__PURE__ */ new Map;for(let e of i){let i=n.collapsed.has(e.key);o.push({key:e.key,label:e.label,count:e.items.length,collapsed:i});for(let n of e.items)s.set(r(n),e.key),i||a.push(n)}return{order:a,groups:o,groupByKey:s}}const nw=`gl-auto-`;function rw(e){return e.startsWith(nw)}function iw(e,n){let r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Set;for(let a=0;a<e.length;a++){let o=n(e[a],a);r.has(o)?rw(o)||i.add(o):r.set(o,a)}return i.size>0&&console.warn(`ixfx-grid-list: duplicate item key(s) ${[...i].map(e=>`"${e}"`).join(`, `)} — the first occurrence wins for key-based operations.`),r}function aw(e){let n=/* @__PURE__ */ new Map;return e.forEach((e,r)=>{n.has(e)||n.set(e,r)}),n}var ow=class{#e;#t=[];#n=/* @__PURE__ */ new WeakMap;#r=0;#i;#a;#o=[];#s;#c;#l=/* @__PURE__ */ new Map;#u;#d=[];#f=/* @__PURE__ */ new Map;constructor(e){this.#e=e,this.refresh()}get count(){return this.#o.length}get rawCount(){return this.#t.length}keyAt(e){let n=this.#o[e];return n===void 0?``:this.#h(this.#t[n])}indexOfKey(e){return this.#c??=aw(this.keys()),this.#c.get(e)??-1}rawIndexOfKey(e){return this.#l.get(e)??-1}keys(){return this.#s??=this.#o.map(e=>this.#h(this.#t[e])),this.#s}labelAt(e){let n=this.#o[e];return n===void 0?``:this.#g(this.#t[n])}rawKeyAt(e){let n=this.#t[e];return n===void 0?``:this.#h(n)}rawSearchTextAt(e){let n=this.#t[e];return n===void 0?``:n.getAttribute(`data-search-label`)??n.getAttribute(`data-label`)??n.querySelector(`[data-grid-list-caption]`)?.textContent?.trim()??n.textContent?.trim()??``}isSelectable(e){let n=this.#o[e];return n!==void 0&&!this.#t[n].hasAttribute(`not-checked`)}renderCellContent(e){}iconAt(e){}iconColorAt(e){}textColorAt(e){}badgeAt(e){}setFilters(e){`predicate`in e&&(this.#i=e.predicate),`searchKeys`in e&&(this.#a=e.searchKeys),this.#p()}setGrouping(e){this.#u=e,this.#p()}groups(){return this.#d}groupKeyOfKey(e){return this.#f.get(e)??null}refresh(){this.#t=Array.from(this.#e.querySelectorAll(`:scope > *`)).filter(e=>!e.hidden),this.#l=iw(this.#t,e=>this.#h(e)),this.#p()}effectiveElements(){return this.#o.map(e=>this.#t[e])}rawElementAt(e){return this.#t[e]}resolveKeyToElement(e){return rw(e)?this.#t.find(n=>this.#n.get(n)===e):this.#t.find(n=>D(n)===e)}resolveKeyToData(e){}#p(){let e=[];for(let n=0;n<this.#t.length;n++)if(this.#i===void 0||this.#i(n)){if(this.#a!==void 0){let e=this.#h(this.#t[n]);if(!rw(e)&&!this.#a.has(e))continue}e.push(n)}this.#m(e),this.#s=void 0,this.#c=void 0}#m(e){if(this.#u===void 0){this.#o=e,this.#d=[],this.#f=/* @__PURE__ */ new Map;return}let n=tw(e,this.#u,e=>this.#h(this.#t[e]));this.#o=n.order,this.#d=n.groups,this.#f=n.groupByKey}#h(e){let n=D(e);if(n!==void 0)return n;let r=this.#n.get(e);return r===void 0&&(this.#r+=1,r=`${nw}${this.#r}`,this.#n.set(e,r)),r}#g(e){return e.getAttribute(`data-label`)??e.querySelector(`[data-grid-list-caption]`)?.textContent?.trim()??``}},sw=class{#e;#t;#n;#r;#i=[];#a;#o;#s;#c;#l=[];#u=/* @__PURE__ */ new Map;constructor(e,n){this.#e=e,this.#t=n,this.#s=iw(e,(e,r)=>n.key(e,r)),this.#d()}get count(){return this.#i.length}get rawCount(){return this.#e.length}keyAt(e){let n=this.#i[e];return n===void 0?``:this.#t.key(this.#e[n],n)}indexOfKey(e){return this.#o??=aw(this.keys()),this.#o.get(e)??-1}keys(){return this.#a??=this.#i.map(e=>this.#t.key(this.#e[e],e)),this.#a}labelAt(e){let n=this.#i[e];return n===void 0?``:this.#t.label?.(this.#e[n],n)??this.#t.key(this.#e[n],n)}rawKeyAt(e){return e<0||e>=this.#e.length?``:this.#t.key(this.#e[e],e)}rawSearchTextAt(e){if(e<0||e>=this.#e.length)return``;let n=this.#e[e];return this.#t.searchableText?.(n,e)??this.#t.label?.(n,e)??``}isSelectable(e){let n=this.#i[e];return n!==void 0&&!this.#t.disabled?.(this.#e[n],n)}renderCellContent(e){let n=this.#i[e];return n===void 0?void 0:this.#t.render(this.#e[n],n)}iconAt(e){let n=this.#i[e];return n===void 0||this.#t.icon===void 0?void 0:this.#t.icon(this.#e[n],n)}iconColorAt(e){let n=this.#i[e];return n===void 0?void 0:this.#t.iconColor?.(this.#e[n],n)}textColorAt(e){let n=this.#i[e];return n===void 0?void 0:this.#t.textColor?.(this.#e[n],n)}badgeAt(e){let n=this.#i[e];return n===void 0||this.#t.badge===void 0?void 0:this.#t.badge(this.#e[n],n)}setFilters(e){`predicate`in e&&(this.#n=e.predicate),`searchKeys`in e&&(this.#r=e.searchKeys),this.#d()}setGrouping(e){this.#c=e,this.#d()}groups(){return this.#l}groupKeyOfKey(e){return this.#u.get(e)??null}refresh(){this.#d()}rawItemAt(e){return this.#e[e]}getItemAt(e){let n=this.#i[e];return n===void 0?void 0:this.#e[n]}resolveKeyToElement(e){}resolveKeyToData(e){let n=this.#s.get(e);return n===void 0?void 0:this.#e[n]}rawIndexOfKey(e){return this.#s.get(e)??-1}#d(){let e=[];for(let n=0;n<this.#e.length;n++)(this.#n===void 0||this.#n(n))&&(this.#r===void 0||this.#r.has(this.#t.key(this.#e[n],n)))&&e.push(n);if(this.#c===void 0)this.#i=e,this.#l=[],this.#u=/* @__PURE__ */ new Map;else{let n=tw(e,this.#c,e=>this.#t.key(this.#e[e],e));this.#i=n.order,this.#l=n.groups,this.#u=n.groupByKey}this.#a=void 0,this.#o=void 0}};function cw(e,n,r){let i,a;for(let o of e)r(o)||(i??=new Set(e),i.delete(o),a??=new Map(n),a.set(o,!1));for(let[o,s]of n)r(o)&&(a??=new Map(n),a.delete(o),s===(i??e).has(o)&&(i??=new Set(e),s?i.delete(o):i.add(o)));return{collapsed:i??e,pending:a?lr(a):n,changed:i!==void 0||a!==void 0}}function lw(e,n,r){return fr(r?n:[],mr(e,!1))}function uw(e,n,r,i){let a=e.horizontal?{top:r,left:n}:r===0?{top:n}:{top:n,left:r},o=e.window(n,0);if(o.ranges.length===0)return a;let s=o.startIndex,c=i(s);if(c===void 0)return a;let l=e.offsetOfAnchor(s,0);return{...a,anchor:{key:c,offset:Math.round(n-l)}}}function dw(e,n,r,i){let a=n.horizontal?e.left??0:e.top;if(e.anchor){let i=r(e.anchor.key);if(i<0)return;a=n.offsetOfAnchor(i,0)+e.anchor.offset}let o=Math.max(0,n.totalExtent-i);return{offset:Math.max(0,Math.min(a,o)),reached:a<=o+1}}function fw(e,n){return typeof e==`object`&&e?e[n]:void 0}function pw(e,n){return e.getAttribute(`data-${n}`)}function mw(e,n){if(e===void 0||e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==n[r])return!1;return!0}function hw(e,n,r){for(let i of n)r.has(i)||i.removeAttribute(e);for(let n of r)n.hasAttribute(e)||n.setAttribute(e,``);return r}let q=class extends n{constructor(...e){super(...e),this.selectionMode=`single`,this.interactionMode=`standard`,this.disableHoverTickle=!1,this.scrollHoverTickle=!1,this.itemSize=160,this.gap=8,this.orientation=`grid`,this.captionStyle=`under`,this.captionAlign=`middle`,this.captionPosition=`bottom`,this.captionBackdrop=`scrim`,this.captionHeight=24,this.itemWrap=`stop`,this.itemsDraggable=!1,this.marqueeFromCellBlank=!1,this.snapToItem=!1,this.items=[],this.groupBy=null,this.crossGroupSelection=!1,this.groupHeaderHeight=28,this.groupHeaderWidth=120,this._collapsedGroups=/* @__PURE__ */ new Set,this._scrollTop=0,this._scrollLeft=0,this._viewportHeight=0,this._viewportWidth=0,this.#e=new cy(this,{kind:`grid-list`,capture:()=>this.getViewState()}),this.#t=ar,this.#i=S(),this.#c=0,this.#l=0,this.#u=[],this.#d=`stop`,this.#f=/* @__PURE__ */ new Map,this.#p=0,this.#m=/* @__PURE__ */ new Set,this.#h=[],this.#g=/* @__PURE__ */ new Map,this.#_=/* @__PURE__ */ new Set,this.#v=0,this.#b=new ow(this),this.#x=this.#b,this.selection=new _r({getOrderedItems:()=>this.#x.keys(),isSelectable:e=>{let n=this.#x.indexOfKey(e);return n>=0&&this.#x.isSelectable(n)},getModes:()=>({selectionMode:this.selectionMode,interactionMode:this.interactionMode}),getKey:e=>e,onIntent:e=>this._dispatch(`list-select-intent`,e,!0)===!1,getGroupKey:e=>this.groupBy===null?null:this.#x.groupKeyOfKey(e),crossGroupSelection:()=>this.crossGroupSelection,getFallbackGroupKey:()=>{let e=this.tickled.tickledId;return e!==void 0&&this.groupBy!==null?this.#x.groupKeyOfKey(e):null},onChange:(e,n)=>{this._syncItemStates(),this.requestUpdate(),this.#Ae(e,n)}}),this.tickled=new oe(this,{getItems:()=>this.#x.keys().map((e,n)=>({id:e,enabled:this.#x.isSelectable(n)})),onTickle:e=>{this.#Ue(),e!==void 0&&this.#je(`list-tickle`,e),this.tickled.inputMode===`keyboard`&&(e!==void 0&&!this.#e.isRestoring&&(this.#n=void 0),this.#e.notify())},onStateChange:()=>this._syncItemStates(),itemWrap:this.#d,hoverDisabled:()=>this.disableHoverTickle||this.#M.isDragging||this.#O.isDragging}),this.#S=Cr({host:this,enabled:()=>!this.scrollHoverTickle,onResume:(e,n)=>{if(this.disableHoverTickle)return;let r=this.shadowRoot?.elementFromPoint?.(e,n)?.closest(`.cell`)?.getAttribute(`data-key`);r&&this.tickled.handlePointerEnter(r)}}),this.#C=/* @__PURE__ */ new Set,this.#T=!1,this.#E=void 0,this.#D=0,this.#O=new rr(this,{source:`grid-list`,isEnabled:()=>this.itemsDraggable&&this.selectionMode!==`none`&&this.#x.count>0,resolveEventToKey:e=>{if(e instanceof Element){let n=(e.closest?.(`.cell`))?.dataset.key;if(n)return n;let r=(e.closest?.(`[data-key]`))?.dataset.key??e.dataset?.key??D(e);if(r)return r}},prepareSelection:e=>this.#A(e),getMetrics:()=>({itemSize:this.itemSize,captionStyle:this.captionStyle,captionHeight:this.captionHeight,rowHeight:this.#ne()}),getRenderer:()=>this.dragPreviewRenderer,getDragPreviewSourceResolver:()=>this.dragPreviewSource,dispatch:e=>this._dispatch(`list-native-drag-start`,e,!0),onActiveChange:(e,n)=>{if(this.#T=e,this.#E=e?n:void 0,this.toggleAttribute(`data-native-dragging`,e),e){let e=[...this.selection.selectedKeys].filter(e=>!rw(e)).length;this.setAttribute(`aria-label`,e<=1?`Dragging 1 item`:`Dragging ${e} items`)}else this.removeAttribute(`aria-label`);this.requestUpdate()},onEnd:()=>{this.#it(),this.#rt()},syncLightDomDraggable:()=>{for(let e of this.children)e instanceof HTMLElement&&(e.draggable=this.itemsDraggable)},shouldStart:e=>!(this.marqueeFromCellBlank&&this.#N(e))}),this.#j=null,this.#M=new Gn(this,{getSurface:()=>this.#i.value,isEnabled:()=>this.selection.canDragSelect()&&this.#x.count>0&&!this.hasAttribute(`disable-drag-select`),hitTest:e=>this.#P(e),getBaseSelection:()=>this.selection.selected,onPreview:(e,n)=>{this.#C=e,this.#w=n,this.requestUpdate()},onCommit:(e,n)=>{this.selection.applyDragSelection(e,n),this.#C=/* @__PURE__ */ new Set,this.#w=void 0,this.requestUpdate()},autoScroll:(e,n)=>{let r=this.#i.value;r&&(e!==0&&(r.scrollLeft+=e,this._scrollLeft=r.scrollLeft),n!==0&&(r.scrollTop+=n,this._scrollTop=r.scrollTop))},shouldStart:e=>{if(this.marqueeFromCellBlank&&this.#N(e))return!0;for(let n of e.composedPath())if(n instanceof Element&&(n.classList.contains(`cell`)||n.classList.contains(`group-header`)))return!1;return!0}}),this.#Z=!1,this.#le=new YC,this.#de=/* @__PURE__ */ new Map,this.#fe=e=>this.#x.indexOfKey(e)>=0?e:void 0,this.#Ee=/* @__PURE__ */ new Set,this.#De=/* @__PURE__ */ new Set,this.#Oe=/* @__PURE__ */ new Set,this.#ke=/* @__PURE__ */ new Set,this.#Me=/* @__PURE__ */ new Set,this.#Je=e=>{let n=e.target;this.#S.onScroll(),this.#Ze(),this.#c=requestAnimationFrame(()=>{this.#c=0,this._scrollTop=n.scrollTop,this._scrollLeft=n.scrollLeft,this.#J()}),this.#$e();let r=this.orientation===`row`?n.scrollLeft:n.scrollTop,i=this.#r!==void 0&&Math.abs(r-this.#r)<=1;this.#r=void 0,!i&&!this.#e.pendingScroll&&this.#e.notify()},this.#Ye=e=>{if(this.orientation!==`row`||e.ctrlKey||e.metaKey||e.deltaY===0)return;let n=this.#i.value??e.currentTarget;n&&(n.scrollWidth<=n.clientWidth+1||(this.#S.onScroll(),n.scrollLeft+=e.deltaX+e.deltaY,e.preventDefault()))},this._onKeyDown=e=>{if((e.ctrlKey||e.metaKey)&&e.key===`f`)return;if((e.ctrlKey||e.metaKey)&&e.key===`a`){this.selection.canSelectAll()&&(e.preventDefault(),this.selection.selectAll(`keyboard`));return}let n=this.#x.count;if(n===0)return;let r=this.#we(),i=this.#Ce(),a=()=>this.tickled.tickledId?this.#x.indexOfKey(this.tickled.tickledId):-1,o=e=>{let n=this.#x.keyAt(e);n&&(this.tickled.handleKeyboardNavigation(n),this.#Te(n))},s=e=>o(Math.max(0,Math.min(n-1,a()+e))),c=(e,n=1)=>{let c=a();if(c<0)s(e*n*r.cols);else{for(let r=0;r<n;r++)c=i.neighbour(c,e);o(c)}},l=this.orientation===`grid`?r.cols:1;switch(e.key){case`ArrowLeft`:s(-1);break;case`ArrowRight`:s(1);break;case`ArrowUp`:this.orientation===`grid`?c(-1):s(-l);break;case`ArrowDown`:this.orientation===`grid`?c(1):s(l);break;case`Home`:this.tickled.handleKeyboardNavigation(`first`),this.tickled.tickledId&&this.#Te(this.tickled.tickledId);break;case`End`:this.tickled.handleKeyboardNavigation(`last`),this.tickled.tickledId&&this.#Te(this.tickled.tickledId);break;case`PageUp`:case`PageDown`:{let n=r.horizontal?this._viewportWidth:this._viewportHeight,i=r.horizontal?r.colStride:r.rowStride,a=Math.max(1,Math.floor(n/i));this.orientation===`grid`?c(e.key===`PageDown`?1:-1,a):s((e.key===`PageDown`?1:-1)*a*l);break}case`Enter`:{let n=this.tickled.tickledId;n&&(e.preventDefault(),this.#je(`list-item-click`,n),this.#at(n,`keyboard`));break}case` `:{let n=this.tickled.tickledId;n&&(e.preventDefault(),this.selection.handleSpace(n));break}case`Escape`:this.#T&&this.#it(),this.selection.handleClear(`keyboard`);break;default:return}e.preventDefault()}}static{this.styles=[w,se,C,Tr(`x`),Tr(`y`),Jn,Ut,r`
|
|
7658
7659
|
:host {
|
|
7659
7660
|
--grid-list-item-bg: var(--item-bg);
|
|
7660
7661
|
--grid-list-radius: var(--radius-m);
|
|
@@ -8045,24 +8046,24 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
8045
8046
|
.cell.dragging-origin {
|
|
8046
8047
|
opacity: 0.6;
|
|
8047
8048
|
}
|
|
8048
|
-
`]}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;#C;#w;#T;#E;#D;#O;#k(e){let n=`.cell[data-key="${CSS.escape(e)}"]`;return this.renderRoot.querySelector(n)??void 0}#A(e){let n=this.#x.indexOfKey(e);if(n<0||!this.#x.isSelectable(n))return;this.selection.selectedKeys.has(e)||this.selection.replace(e);let r=this.#x.keys().filter(e=>!rw(e)&&this.selection.selectedKeys.has(e)),i=[];for(let e of r){let n=this.#x.indexOfKey(e);if(n<0)continue;let r=this.#x.resolveKeyToData(e),a=this.#x.resolveKeyToElement(e),o=a??(this.#x instanceof sw?this.#k(e):void 0),s=r??a;s!==void 0&&i.push({key:e,index:n,item:s,...o?{element:o}:{}})}let a=i.find(n=>n.key===e);if(a)return{origin:a,selected:i}}#j;#M;#N(e){for(let n of e.composedPath())if(n instanceof Element)return n.classList.contains(`caption`)||n.matches?.(`input,button,a,select,textarea,[contenteditable]`)?!1:n.classList.contains(`content`)||n.classList.contains(`thumb`)?!0:(n.classList.contains(`cell`),!1);return!1}#P(e){if(this.#x.count===0)return[];let n=this.orientation===`row`,r=e.x+this._scrollLeft,i=r+e.width,a=n?0:e.y+this._scrollTop,o=n?0:a+e.height,s=this.#be().hitTest(r,i,a,o),c=[];for(let e of s){let n=this.#x.keyAt(e);n&&!rw(n)&&this.#x.isSelectable(e)&&c.push(n)}return c}#F;#I;#L(){let e=this.itemAdapter===void 0?`element`:`data`;if(this.#F===e&&this.search!==void 0)return;let n=this.search;n&&(n.hostDisconnected(),this.removeController(n)),this.search=e===`data`?new Ht(this,{adapter:kt(this,{rawCount:()=>this.#x?.rawCount??0,rawKeyAt:e=>this.#x?.rawKeyAt(e)??``,rawSearchTextAt:e=>this.#x?.rawSearchTextAt(e)??``,onFilterChange:e=>{this.#I=e,this.#x?.setFilters({searchKeys:e}),this.requestUpdate(),this.updateComplete.then(()=>this.#J())},onActivate:e=>this.#tt(e),getHighlightRoot:()=>this.renderRoot})}):new Ht(this,{adapter:Nt(this,{itemSelector:`:scope > *`,getLabel:e=>e.getAttribute(`data-label`)??e.querySelector(`[data-grid-list-caption]`)?.textContent?.trim()??e.getAttribute(`data-search-label`)??e.textContent?.trim()??``,highlightKey:`grid-list-search`})}),this.#F=e}#R;#z;get registry(){return this.#R}#B(){let e=this.searchModes?.trim();if(e===void 0)return[...Bt];let n=new Set(e.split(/\s+/));return Bt.filter(e=>n.has(e))}#V(){this.#R&&this.search&&(this.search.setModes(this.#B()),this.#z?.(),this.#z=zt(this.#R,this.search))}connectedCallback(){super.connectedCallback(),this.hasAttribute(`tabindex`)||(this.tabIndex=0),this.hasAttribute(`role`)||this.setAttribute(`role`,`listbox`),this.#te();for(let[e,n]of[[`caption-style`,this.captionStyle],[`caption-align`,this.captionAlign],[`caption-position`,this.captionPosition],[`caption-backdrop`,this.captionBackdrop]])this.hasAttribute(e)||this.setAttribute(e,n);this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`pointermove`,this.#S.onPointerMove,{passive:!0}),this.addEventListener(`pointerleave`,this.#S.onPointerLeave),this.#e.observeScrollTarget(this),this.#o??=new MutationObserver(e=>this.#U(e)),this.#o.observe(this,{childList:!0}),this.#s??=new MutationObserver(e=>this.#H(e)),this.#s.observe(this,{subtree:!0,attributeFilter:[`hidden`,`data-key`,`data-value`]}),this.#R??=Xt(),this.#L(),this.#V()}disconnectedCallback(){super.disconnectedCallback(),this.#ze(),this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`pointermove`,this.#S.onPointerMove),this.removeEventListener(`pointerleave`,this.#S.onPointerLeave),this.#S.end(),this.#a?.disconnect(),this.#a=void 0,this.#o?.disconnect(),this.#s?.disconnect(),this.#qe(),this.#Je(),this.#z?.(),this.#z=void 0,this.#R=void 0,this.#v&&=(clearTimeout(this.#v),0),(this.#T||this.#O.isDragging)&&this.#et()}#H(e){e.some(e=>e.target.parentNode===this)&&this.#U([])}#U(e){let n=this.#u.length;this.#se();let r=[];for(let n of e??[])for(let e of n.removedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let n=D(e);n!==void 0&&r.push(n)}if(r.length>0){let e=new Set(this.#x.keys()),n=r.filter(n=>!e.has(n));n.length>0&&this.#fe(n);let i=this.tickled.tickledId;i&&n.includes(i)&&this.#pe(i)}this.#ue(),this._syncItemStates(!0),this.#W(n,e),this.requestUpdate(),this.updateComplete.then(()=>this.#J())}#W(e,n){if(!this.hasUpdated||!n||n.length===0)return;let r=new Set(this.#u),i=[],a=0;for(let e of n){for(let n of e.addedNodes)n.nodeType===Node.ELEMENT_NODE&&r.has(n)&&i.push(n);for(let n of e.removedNodes)n.nodeType===Node.ELEMENT_NODE&&a++}if((i.length!==0||a!==0)&&(e!==0||a!==0)&&!(i.length>0&&i.length===this.#u.length)){for(let e of i)this.#_.add(e);this.#G()}}#G(){this.toggleAttribute(`reflowing`,!0),this.#v&&clearTimeout(this.#v),this.#v=window.setTimeout(()=>{this.#v=0,this.#_.clear(),this.toggleAttribute(`reflowing`,!1),this.requestUpdate()},320)}#K;#q;#J(){let e=this.renderedKeys(),n=this.visibleKeys();mw(this.#K,e)&&mw(this.#q,n)||(this.#K=e,this.#q=n,this._dispatch(`grid-list-viewport-change`,{renderedKeys:e,visibleKeys:n}))}firstUpdated(){this.#x||this.#Y();let e=this.#i.value;e&&(this.#a=new ResizeObserver(e=>{for(let n of e){let e=n.contentRect.width,r=n.contentRect.height;if(e<=0||r<=0)return;if(e===this._viewportWidth&&r===this._viewportHeight)continue;let i=this.orientation===`row`,a=i?this._scrollLeft:this._scrollTop,o=i?this._viewportWidth:this._viewportHeight;o>0&&a>1&&this.#ae(a,o,this.itemSize,this.gap,this.captionStyle,this.captionHeight,this.orientation),this._viewportWidth=e,this._viewportHeight=r}}),this.#a.observe(e),this.#oe(!1),this.#se(),this.#ue(),this.requestUpdate(),this.#O.refreshDraggable())}#Y(){this.itemAdapter===void 0?(this.#b=new ow(this),this.#x=this.#b):(this.#x=new sw(this.items,this.itemAdapter),this.#b=void 0),this.#x.setGrouping(this.#Q()),this.#X(),this.#I&&this.#x.setFilters({searchKeys:this.#I})}#X(){if(this.#x instanceof ow){let e=this.filterPredicate,n=this.#x;n.setFilters({predicate:e?r=>e(n.rawElementAt(r)):void 0}),this.#u=n.effectiveElements()}else if(this.#x instanceof sw){let e=this.itemFilterPredicate,n=this.#x;n.setFilters({predicate:e?r=>e(n.rawItemAt(r),r):void 0})}}willUpdate(e){e.has(`searchModes`)&&this.#V(),(e.has(`filterPredicate`)||e.has(`itemFilterPredicate`))&&(this.#X(),this.updateComplete.then(()=>this.#J()));let n=e.has(`items`)||e.has(`itemAdapter`);if(n){this.#y=void 0;let e=this.#x?.keys()??[],n=this.itemAdapter!==void 0!=this.#x instanceof sw;this.#Y();let r=this.#x.keys(),i=new Set(r),a=e.filter(e=>!i.has(e));a.length>0&&this.#fe(a);let o=this.tickled.tickledId;o&&!i.has(o)&&this.#pe(o),this._syncItemStates(),this.updateComplete.then(()=>this.#J()),n&&(this.#L(),this.#V()),this.search?.refresh()}let r=e.has(`groupBy`)||e.has(`groupLabel`)||e.has(`_collapsedGroups`);if(r&&this.hasUpdated?(e.has(`groupBy`)&&(this._collapsedGroups.size>0&&(this._collapsedGroups=/* @__PURE__ */ new Set),this.#Z=!0),this.#$(),this.#ee(),this.#G(),this.updateComplete.then(()=>this.#J())):r&&this.#$(),(e.has(`itemSize`)||e.has(`gap`))&&(this.itemSize=Math.max(16,Math.round(this.itemSize)),this.gap=Math.max(0,Math.round(this.gap))),e.has(`captionHeight`)&&(this.captionHeight=Math.max(0,Math.round(this.captionHeight))),e.has(`itemWrap`)&&(this.#d=this.itemWrap),(e.has(`itemSize`)||e.has(`gap`)||e.has(`captionStyle`)||e.has(`captionHeight`)||e.has(`orientation`))&&this.hasUpdated&&this.#x.count>0){let n=e.get(`orientation`)??this.orientation,r=n===`row`,i=r?this._scrollLeft:this._scrollTop,a=r?this._viewportWidth:this._viewportHeight;if(a>0&&i>1){let r=e.get(`itemSize`)??this.itemSize,o=e.get(`gap`)??this.gap,s=e.get(`captionStyle`)??this.captionStyle,c=e.get(`captionHeight`)??this.captionHeight;this.#ae(i,a,r,o,s,c,n)}}(n||r||e.has(`filterPredicate`)||e.has(`itemFilterPredicate`))&&this.#ue()}#Z;#Q(){let e=this.groupBy;if(e==null||e===``)return;let n=this._collapsedGroups,r=this.#x;if(r instanceof sw)return{groupKeyOf:n=>vn(e,r.rawItemAt(n),n,fw),itemAt:e=>r.rawItemAt(e),labelOf:this.groupLabel,collapsed:n};let i=r;return{groupKeyOf:n=>vn(e,i.rawElementAt(n),n,pw),itemAt:e=>i.rawElementAt(e),labelOf:this.groupLabel,collapsed:n}}#$(){this.#x.setGrouping(this.#Q()),this.#x instanceof ow&&(this.#u=this.#x.effectiveElements())}#ee(){let e=this.tickled.tickledId;e!==void 0&&this.#x.indexOfKey(e)<0&&this.tickled.focus(void 0)}get groups(){return this.groupBy===null?[]:this.#x.groups()}setGroupCollapsed(e,n){if(this._collapsedGroups.has(e)===n)return;let r=new Set(this._collapsedGroups);n?r.add(e):r.delete(e),this._collapsedGroups=r,this.#t=ur(this.#t,e),this.#e.notify(),this._dispatch(`list-group-toggle`,{groupKey:e,collapsed:n})}toggleGroup(e){this.setGroupCollapsed(e,!this._collapsedGroups.has(e))}collapseAllGroups(){for(let e of this.groups)this.setGroupCollapsed(e.key,!0)}expandAllGroups(){for(let e of[...this._collapsedGroups])this.setGroupCollapsed(e,!1)}#te(){this.setAttribute(`aria-multiselectable`,this.selection.canSelectMultiple()?`true`:`false`)}#ne(){let e=this.captionStyle===`separate`||this.captionStyle===`under`;return this.itemSize+(e?this.captionHeight:0)}#re(e){return e.getAttribute(`data-label`)??e.querySelector(`[data-grid-list-caption]`)?.textContent?.trim()??``}updated(e){super.updated(e),this.search?.isOpen&&this.search.repaintHighlights();let n=this.#o?.takeRecords(),r=this.#s?.takeRecords();if(n!==void 0&&n.length>0?this.#U(n):r!==void 0&&r.length>0&&this.#H(r),this.#x instanceof ow&&this.#Ne(),(e.has(`selectionMode`)||e.has(`interactionMode`))&&(this.selection.clearAnchor(),this.#te()),e.has(`scrollHoverTickle`)&&this.scrollHoverTickle&&this.#S.end(),e.has(`itemsDraggable`)&&this.#O.refreshDraggable(),e.has(`orientation`)){let e=this.#i.value;e&&(this.orientation===`row`?(e.scrollTop=0,this._scrollTop=0):(e.scrollLeft=0,this._scrollLeft=0))}let i=this.#i.value;i&&(Math.abs(i.scrollTop-this._scrollTop)>.5&&(i.scrollTop=this._scrollTop),Math.abs(i.scrollLeft-this._scrollLeft)>.5&&(i.scrollLeft=this._scrollLeft)),this.#ie(),this.#e.applyPendingScroll(e=>this.#he(e)),this.#Be(),this.#Z&&(this.#Z=!1,this._dispatch(`list-group-change`,{groupBy:this.groupBy}))}#ie(){if(!this.#y)return;let{index:e,lineFrac:n}=this.#y;this.#y=void 0;let r=this.#i.value;if(!r)return;let i=this.#be(),a=i.horizontal,o=a?this._viewportWidth:this._viewportHeight;if(o<=0)return;let s=i.offsetOfAnchor(e,n),c=Math.max(0,i.totalExtent-o),l=Math.min(c,Math.max(0,s-o/2));a?Math.abs(r.scrollLeft-l)>.5&&(r.scrollLeft=l,this._scrollLeft=l):Math.abs(r.scrollTop-l)>.5&&(r.scrollTop=l,this._scrollTop=l)}#ae(e,n,r,i,a,o,s){if((this.#x?.count??0)===0)return;let c=r+(a===`separate`||a===`under`?o:0),l=this.#ve({itemWidth:r,rowHeight:c,gap:i,orientation:s});this.#y=l.anchorAt(e+n/2)}refreshLayout(){this.#oe(!0)}remeasure(){this.#oe(!0)}#oe(e=!1){let n=this.#i.value;if(!n)return;let r=n.clientWidth,i=n.clientHeight;if(r<=0||i<=0)return;let a=this.orientation===`row`,o=r!==this._viewportWidth||i!==this._viewportHeight;if(o){let e=a?this._scrollLeft:this._scrollTop,n=a?r:i;this.#ae(e,n,this.itemSize,this.gap,this.captionStyle,this.captionHeight,this.orientation),this._viewportWidth=r,this._viewportHeight=i}e&&!o&&(this.#ae(a?this._scrollLeft:this._scrollTop,a?r:i,this.itemSize,this.gap,this.captionStyle,this.captionHeight,this.orientation),this.requestUpdate()),(o||e)&&this.updateComplete.then(()=>this.#J())}#se(){this.#x instanceof ow&&(this.#x.refresh(),this.#X())}get count(){return this.#x.count}get renderedCount(){return this.renderRoot.querySelectorAll(`.cell`).length}get selectedItems(){let e=/* @__PURE__ */ new Set;for(let n of this.selection.selectedKeys){let r=this.#x.resolveKeyToElement(n);r&&e.add(r)}return e}get selectedKeys(){let e=/* @__PURE__ */ new Set;for(let n of this.selection.selectedKeys)rw(n)||e.add(n);return e}select(e){let n=D(e);n&&this.selection.replace(n)}selectMany(e){let n=[];for(let r of e){let e=D(r);e&&n.push(e)}this.selection.selectMany(n)}deselect(e){let n=D(e);n&&this.selection.deselect(n)}clearSelection(){this.selection.clear()}selectAll(){this.selection.canSelectAll()&&this.selection.selectAll()}selectKeys(e){this.selection.selectKeys(e,e=>e)}addSelectedKeys(e){this.selection.addKeys(e,e=>e)}removeSelectedKeys(e){this.selection.removeKeys(e,e=>e)}#ce(e){let n=this.itemAdapter;return n?this.items.findIndex((r,i)=>n.key(r,i)===e):-1}setItems(e){this.itemAdapter&&(this.items=e)}appendItems(e){this.itemAdapter&&e.length>0&&(this.items=[...this.items,...e])}updateItem(e,n){if(!this.itemAdapter)return;let r=this.#ce(e);if(r<0)return;let i=[...this.items];i[r]=n,this.items=i}removeItems(e){if(!this.itemAdapter)return;let n=this.itemAdapter,r=new Set(e);this.items=this.items.filter((e,i)=>!r.has(n.key(e,i)))}clearItems(){if(!this.itemAdapter)return;this.selection.reset();let e=this.tickled.tickledId;e!==void 0&&this.#pe(e),this.items=[],this.#De(/* @__PURE__ */ new Set,/* @__PURE__ */ new Set)}focusKey(e){this.#x.indexOfKey(e)<0||(this.#n=void 0,this.tickled.focus(e),this.#Se(e))}get tickledKey(){return this.tickled.tickledId}getViewState(e){let n=e?.includePending??!0,r=this.tickled.tickledId,i=this.tickled.inputMode===`keyboard`&&r!==void 0&&!rw(r)?r:void 0;return this.#e.shape({selected:pr(this.selectedKeys,n?[...this.selection.pendingKeys].filter(e=>!rw(e)):[]),expanded:lw(this._collapsedGroups,this.#t,n),focus:i??(n?this.#n:void 0),scroll:(n?this.#e.pendingScroll:void 0)??this.#me()},e)}setViewState(e){this.#e.accepts(e)&&(this.#e.restoring(()=>{e.expanded&&(this.#t=lr(dr(e.expanded)),this._collapsedGroups.size>0&&(this._collapsedGroups=/* @__PURE__ */ new Set)),e.focus!==void 0&&(this.#n=e.focus),e.scroll&&(this.#e.pendingScroll=e.scroll),this.#de(),e.selected&&this.selection.restoreKeys(e.selected,this.#le),this.#ue()}),this.requestUpdate())}clearPendingViewState(){this.selection.clearPending(),this.#t=ar,this.#n=void 0,this.#e.pendingScroll=void 0}#le;#ue(){this.#e.restoring(()=>{this.#de(),this.selection.resolvePending(this.#le);let e=this.#n;e!==void 0&&this.#x.indexOfKey(e)>=0&&(this.tickled.setInputMode(`keyboard`),this.tickled.focus(e),this.#n=void 0)})}#de(){if(this._collapsedGroups.size===0&&this.#t.size===0)return;let e=this.groupBy===null?/* @__PURE__ */ new Set:new Set(this.#x.groups().map(e=>e.key)),n=cw(this._collapsedGroups,this.#t,n=>e.has(n));n.changed&&(this.#t=n.pending,n.collapsed!==this._collapsedGroups&&(this._collapsedGroups=n.collapsed,this.#$(),this.#ee(),this.#e.notify(`data`)))}#fe(e){let n=e.filter(rw);this.selection.demote(e.filter(e=>!rw(e)))&&(this._syncItemStates(),this.#e.notify(`data`)),n.length>0&&this.selection.removeKeys(n,e=>e)}#pe(e){this.tickled.inputMode===`keyboard`&&!rw(e)&&(this.#n??=e),this.tickled.focus(void 0)}#me(){let e=this.#i.value;if(!e)return;let n=this.orientation===`row`,r=n?e.scrollLeft:e.scrollTop,i=n?e.scrollTop:e.scrollLeft,a=this.#x.keys();return uw(this.#be(),r,i,e=>{let n=a[e];return n===void 0||rw(n)?void 0:n})}#he(e){let n=this.#i.value,r=this.orientation===`row`,i=r?this._viewportWidth:this._viewportHeight;if(!n||i<=0)return!1;let a=dw(e,this.#be(),e=>this.#x.indexOfKey(e),i);return a?(r?(Math.abs(n.scrollLeft-a.offset)>.5&&(this.#r=a.offset),n.scrollLeft=a.offset,this._scrollLeft=a.offset):(Math.abs(n.scrollTop-a.offset)>.5&&(this.#r=a.offset),n.scrollTop=a.offset,this._scrollTop=a.offset),a.reached):!1}getItem(e){return this.#x.resolveKeyToElement(e)}getItemByIndex(e){return this.#u[e]}getData(e){return this.#x.resolveKeyToData(e)}getKey(e){return D(e)}renderedKeys(){return this.#ge(this.#xe())}visibleKeys(){return this.#ge(this.#xe(!0))}#ge(e){let n=this.#x.keys(),r=[];for(let[i,a]of e.ranges)for(let e=i;e<a;e++)rw(n[e])||r.push(n[e]);return r}#_e(e={}){return{count:this.#x.count,groups:this.groupBy===null?void 0:this.#x.groups(),itemWidth:this.itemSize,rowHeight:this.#ne(),gap:this.gap,viewportWidth:this._viewportWidth,viewportHeight:this._viewportHeight,orientation:this.orientation,headerHeight:this.groupHeaderHeight,headerWidth:this.groupHeaderWidth,...e}}#ve(e={}){return ew(this.#_e(e))}#ye;#be(){let e=this.#_e(),n=this.#ye;if(n){let r=n.params,i=r.groups===e.groups;for(let n of Object.keys(e)){if(!i)break;i=r[n]===e[n]}if(i)return n.layout}let r=ew(e);return this.#ye={params:e,layout:r},r}#xe(e=!1){return this.#be().window(this.orientation===`row`?this._scrollLeft:this._scrollTop,e?0:2)}#Se(e){let n=this.#x.indexOfKey(e),r=this.#i.value;if(n<0||!r)return;let[i,a]=this.#be().extentOf(n);if(this.orientation===`row`){let e=r.scrollLeft,n=e;i<e?n=i:a>e+this._viewportWidth&&(n=a-this._viewportWidth),n!==e&&(r.scrollLeft=n,this._scrollLeft=n);return}let o=r.scrollTop,s=o;i<o?s=i:a>o+this._viewportHeight&&(s=a-this._viewportHeight),s!==o&&(r.scrollTop=s,this._scrollTop=s)}#Ce;#we;#Te;#Ee;get partialKeys(){return this.#Ee}set partialKeys(e){let n=new Set(e);br(n,this.#Ee)||(this.#Ee=n,this._syncItemStates(),this.requestUpdate())}_syncItemStates(e=!1){let n=this.selection.selectedKeys,r=this.tickled.tickledId,i=e=>{if(rw(e))return;let n=this.#x.indexOfKey(e);return n<0?void 0:this.#u[n]},a=r===void 0?void 0:i(r),o=/* @__PURE__ */ new Set;for(let e of n){let n=i(e);n&&o.add(n)}if(e)for(let e of this.#u)this.#Ce.add(e),this.#we.add(e);this.#Ce=hw(`data-tickled`,this.#Ce,a?/* @__PURE__ */ new Set([a]):/* @__PURE__ */ new Set),this.#we=hw(`data-selected`,this.#we,o);let s=/* @__PURE__ */ new Set;for(let e of this.#Ee){let r=n.has(e)?void 0:i(e);r&&s.add(r)}this.#Te=hw(`data-partial`,this.#Te,s),this.setAttribute(`data-input-mode`,this.tickled.inputMode)}#De(e,n){this.#e.notify();let r=/* @__PURE__ */ new Set,i=/* @__PURE__ */ new Set;for(let n of e){let e=this.#x.resolveKeyToElement(n);e&&r.add(e)}for(let e of n){let n=this.#x.resolveKeyToElement(e);n&&i.add(n)}this._dispatch(`list-select`,{selected:r,previous:i,selectedKeys:this.selectedKeys,previousKeys:new Set([...n].filter(e=>!rw(e)))})}#Oe(e,n){let r=this.#x.indexOfKey(n),i=this.#x.resolveKeyToElement(n),a=i??this.#x.resolveKeyToData(n);this._dispatch(e,{item:a,key:n,index:r,element:i})}_dispatch(e,n,r=!1){return this.dispatchEvent(new CustomEvent(e,{detail:n,bubbles:!0,composed:!0,cancelable:r}))}#ke;#Ae(e){return`left:${e.x}px;top:${e.y}px;width:${Math.max(0,e.width)}px;height:${Math.max(0,e.height)}px`}render(){let e=this.#xe();this.#ke=this.selection.selectedKeys;let n=e.horizontal?`width:${e.totalWidth}px;height:100%`:`height:${e.totalHeight}px`,r=e.horizontal?`scroll-fade-x`:`scroll-fade-y`;return i`
|
|
8049
|
+
`]}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;#C;#w;#T;#E;#D;#O;#k(e){let n=`.cell[data-key="${CSS.escape(e)}"]`;return this.renderRoot.querySelector(n)??void 0}#A(e){let n=this.#x.indexOfKey(e);if(n<0||!this.#x.isSelectable(n))return;this.selection.selectedKeys.has(e)||this.selection.replace(e);let r=this.#x.keys().filter(e=>!rw(e)&&this.selection.selectedKeys.has(e)),i=[];for(let e of r){let n=this.#x.indexOfKey(e);if(n<0)continue;let r=this.#x.resolveKeyToData(e),a=this.#x.resolveKeyToElement(e),o=a??(this.#x instanceof sw?this.#k(e):void 0),s=r??a;s!==void 0&&i.push({key:e,index:n,item:s,...o?{element:o}:{}})}let a=i.find(n=>n.key===e);if(a)return{origin:a,selected:i}}#j;#M;#N(e){for(let n of e.composedPath())if(n instanceof Element)return n.classList.contains(`caption`)||n.matches?.(`input,button,a,select,textarea,[contenteditable]`)?!1:n.classList.contains(`content`)||n.classList.contains(`thumb`)?!0:(n.classList.contains(`cell`),!1);return!1}#P(e){if(this.#x.count===0)return[];let n=this.orientation===`row`,r=e.x+this._scrollLeft,i=r+e.width,a=n?0:e.y+this._scrollTop,o=n?0:a+e.height,s=this.#Ce().hitTest(r,i,a,o),c=[];for(let e of s){let n=this.#x.keyAt(e);n&&!rw(n)&&this.#x.isSelectable(e)&&c.push(n)}return c}#F;#I;#L(){let e=this.itemAdapter===void 0?`element`:`data`;if(this.#F===e&&this.search!==void 0)return;let n=this.search;n&&(n.hostDisconnected(),this.removeController(n)),this.search=e===`data`?new Ht(this,{adapter:kt(this,{rawCount:()=>this.#x?.rawCount??0,rawKeyAt:e=>this.#x?.rawKeyAt(e)??``,rawSearchTextAt:e=>this.#x?.rawSearchTextAt(e)??``,onFilterChange:e=>{this.#I=e,this.#x?.setFilters({searchKeys:e}),this.requestUpdate(),this.updateComplete.then(()=>this.#J())},onActivate:e=>this.#at(e),getHighlightRoot:()=>this.renderRoot})}):new Ht(this,{adapter:Nt(this,{itemSelector:`:scope > *`,getLabel:e=>e.getAttribute(`data-label`)??e.querySelector(`[data-grid-list-caption]`)?.textContent?.trim()??e.getAttribute(`data-search-label`)??e.textContent?.trim()??``,highlightKey:`grid-list-search`})}),this.#F=e}#R;#z;get registry(){return this.#R}#B(){let e=this.searchModes?.trim();if(e===void 0)return[...Bt];let n=new Set(e.split(/\s+/));return Bt.filter(e=>n.has(e))}#V(){this.#R&&this.search&&(this.search.setModes(this.#B()),this.#z?.(),this.#z=zt(this.#R,this.search))}connectedCallback(){super.connectedCallback(),this.hasAttribute(`tabindex`)||(this.tabIndex=0),this.hasAttribute(`role`)||this.setAttribute(`role`,`listbox`),this.#te();for(let[e,n]of[[`caption-style`,this.captionStyle],[`caption-align`,this.captionAlign],[`caption-position`,this.captionPosition],[`caption-backdrop`,this.captionBackdrop]])this.hasAttribute(e)||this.setAttribute(e,n);this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`pointermove`,this.#S.onPointerMove,{passive:!0}),this.addEventListener(`pointerleave`,this.#S.onPointerLeave),this.#e.observeScrollTarget(this),this.#o??=new MutationObserver(e=>this.#U(e)),this.#o.observe(this,{childList:!0}),this.#s??=new MutationObserver(e=>this.#H(e)),this.#s.observe(this,{subtree:!0,attributeFilter:[`hidden`,`data-key`,`data-value`]}),this.#R??=Xt(),this.#L(),this.#V()}disconnectedCallback(){super.disconnectedCallback(),this.#Ue(),this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`pointermove`,this.#S.onPointerMove),this.removeEventListener(`pointerleave`,this.#S.onPointerLeave),this.#S.end(),this.#a?.disconnect(),this.#a=void 0,this.#o?.disconnect(),this.#s?.disconnect(),this.#Ze(),this.#Qe(),this.#z?.(),this.#z=void 0,this.#R=void 0,this.#v&&=(clearTimeout(this.#v),0),(this.#T||this.#O.isDragging)&&this.#it()}#H(e){e.some(e=>e.target.parentNode===this)&&this.#U([])}#U(e){let n=this.#u.length;this.#se();let r=[];for(let n of e??[])for(let e of n.removedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let n=D(e);n!==void 0&&r.push(n)}if(r.length>0){let e=new Set(this.#x.keys()),n=r.filter(n=>!e.has(n));n.length>0&&this.#he(n);let i=this.tickled.tickledId;i&&n.includes(i)&&this.#ge(i)}this.#pe(),this._syncItemStates(!0),this.#W(n,e),this.requestUpdate(),this.updateComplete.then(()=>this.#J())}#W(e,n){if(!this.hasUpdated||!n||n.length===0)return;let r=new Set(this.#u),i=[],a=0;for(let e of n){for(let n of e.addedNodes)n.nodeType===Node.ELEMENT_NODE&&r.has(n)&&i.push(n);for(let n of e.removedNodes)n.nodeType===Node.ELEMENT_NODE&&a++}if((i.length!==0||a!==0)&&(e!==0||a!==0)&&!(i.length>0&&i.length===this.#u.length)){for(let e of i)this.#_.add(e);this.#G()}}#G(){this.toggleAttribute(`reflowing`,!0),this.#v&&clearTimeout(this.#v),this.#v=window.setTimeout(()=>{this.#v=0,this.#_.clear(),this.toggleAttribute(`reflowing`,!1),this.requestUpdate()},320)}#K;#q;#J(){let e=this.renderedKeys(),n=this.visibleKeys();mw(this.#K,e)&&mw(this.#q,n)||(this.#K=e,this.#q=n,this._dispatch(`grid-list-viewport-change`,{renderedKeys:e,visibleKeys:n}))}firstUpdated(){this.#x||this.#Y();let e=this.#i.value;e&&(this.#a=new ResizeObserver(e=>{for(let n of e){let e=n.contentRect.width,r=n.contentRect.height;if(e<=0||r<=0)return;if(e===this._viewportWidth&&r===this._viewportHeight)continue;let i=this.orientation===`row`,a=i?this._scrollLeft:this._scrollTop,o=i?this._viewportWidth:this._viewportHeight;o>0&&a>1&&this.#ae(a,o,this.itemSize,this.gap,this.captionStyle,this.captionHeight,this.orientation),this._viewportWidth=e,this._viewportHeight=r}}),this.#a.observe(e),this.#oe(!1),this.#se(),this.#pe(),this.requestUpdate(),this.#O.refreshDraggable())}#Y(){this.itemAdapter===void 0?(this.#b=new ow(this),this.#x=this.#b):(this.#x=new sw(this.items,this.itemAdapter),this.#b=void 0),this.#x.setGrouping(this.#Q()),this.#X(),this.#I&&this.#x.setFilters({searchKeys:this.#I})}#X(){if(this.#x instanceof ow){let e=this.filterPredicate,n=this.#x;n.setFilters({predicate:e?r=>e(n.rawElementAt(r)):void 0}),this.#u=n.effectiveElements()}else if(this.#x instanceof sw){let e=this.itemFilterPredicate,n=this.#x;n.setFilters({predicate:e?r=>e(n.rawItemAt(r),r):void 0})}}willUpdate(e){e.has(`searchModes`)&&this.#V(),(e.has(`filterPredicate`)||e.has(`itemFilterPredicate`))&&(this.#X(),this.updateComplete.then(()=>this.#J()));let n=e.has(`items`)||e.has(`itemAdapter`);if(n){this.#y=void 0,this.#ue();let e=this.#x?.keys()??[],n=this.itemAdapter!==void 0!=this.#x instanceof sw;this.#Y();let r=this.#x.keys(),i=new Set(r),a=e.filter(e=>!i.has(e));if(a.length>0){this.#he(a);for(let e of a)this.#de.delete(e)}let o=this.tickled.tickledId;o&&!i.has(o)&&this.#ge(o),this._syncItemStates(),this.updateComplete.then(()=>this.#J()),n&&(this.#L(),this.#V()),this.search?.refresh()}let r=e.has(`groupBy`)||e.has(`groupLabel`)||e.has(`_collapsedGroups`);if(r&&this.hasUpdated?(e.has(`groupBy`)&&(this._collapsedGroups.size>0&&(this._collapsedGroups=/* @__PURE__ */ new Set),this.#Z=!0),this.#$(),this.#ee(),this.#G(),this.updateComplete.then(()=>this.#J())):r&&this.#$(),(e.has(`itemSize`)||e.has(`gap`))&&(this.itemSize=Math.max(16,Math.round(this.itemSize)),this.gap=Math.max(0,Math.round(this.gap))),e.has(`captionHeight`)&&(this.captionHeight=Math.max(0,Math.round(this.captionHeight))),e.has(`itemWrap`)&&(this.#d=this.itemWrap),(e.has(`itemSize`)||e.has(`gap`)||e.has(`captionStyle`)||e.has(`captionHeight`)||e.has(`orientation`))&&this.hasUpdated&&this.#x.count>0){let n=e.get(`orientation`)??this.orientation,r=n===`row`,i=r?this._scrollLeft:this._scrollTop,a=r?this._viewportWidth:this._viewportHeight;if(a>0&&i>1){let r=e.get(`itemSize`)??this.itemSize,o=e.get(`gap`)??this.gap,s=e.get(`captionStyle`)??this.captionStyle,c=e.get(`captionHeight`)??this.captionHeight;this.#ae(i,a,r,o,s,c,n)}}(n||r||e.has(`filterPredicate`)||e.has(`itemFilterPredicate`))&&this.#pe()}#Z;#Q(){let e=this.groupBy;if(e==null||e===``)return;let n=this._collapsedGroups,r=this.#x;if(r instanceof sw)return{groupKeyOf:n=>vn(e,r.rawItemAt(n),n,fw),itemAt:e=>r.rawItemAt(e),labelOf:this.groupLabel,collapsed:n};let i=r;return{groupKeyOf:n=>vn(e,i.rawElementAt(n),n,pw),itemAt:e=>i.rawElementAt(e),labelOf:this.groupLabel,collapsed:n}}#$(){this.#x.setGrouping(this.#Q()),this.#x instanceof ow&&(this.#u=this.#x.effectiveElements())}#ee(){let e=this.tickled.tickledId;e!==void 0&&this.#x.indexOfKey(e)<0&&this.tickled.focus(void 0)}get groups(){return this.groupBy===null?[]:this.#x.groups()}setGroupCollapsed(e,n){if(this._collapsedGroups.has(e)===n)return;let r=new Set(this._collapsedGroups);n?r.add(e):r.delete(e),this._collapsedGroups=r,this.#t=ur(this.#t,e),this.#e.notify(),this._dispatch(`list-group-toggle`,{groupKey:e,collapsed:n})}toggleGroup(e){this.setGroupCollapsed(e,!this._collapsedGroups.has(e))}collapseAllGroups(){for(let e of this.groups)this.setGroupCollapsed(e.key,!0)}expandAllGroups(){for(let e of[...this._collapsedGroups])this.setGroupCollapsed(e,!1)}#te(){this.setAttribute(`aria-multiselectable`,this.selection.canSelectMultiple()?`true`:`false`)}#ne(){let e=this.captionStyle===`separate`||this.captionStyle===`under`;return this.itemSize+(e?this.captionHeight:0)}#re(e){return e.getAttribute(`data-label`)??e.querySelector(`[data-grid-list-caption]`)?.textContent?.trim()??``}updated(e){super.updated(e),this.search?.isOpen&&this.search.repaintHighlights();let n=this.#o?.takeRecords(),r=this.#s?.takeRecords();if(n!==void 0&&n.length>0?this.#U(n):r!==void 0&&r.length>0&&this.#H(r),this.#x instanceof ow&&this.#Ie(),(e.has(`selectionMode`)||e.has(`interactionMode`))&&(this.selection.clearAnchor(),this.#te()),e.has(`scrollHoverTickle`)&&this.scrollHoverTickle&&this.#S.end(),e.has(`itemsDraggable`)&&this.#O.refreshDraggable(),e.has(`orientation`)){let e=this.#i.value;e&&(this.orientation===`row`?(e.scrollTop=0,this._scrollTop=0):(e.scrollLeft=0,this._scrollLeft=0))}let i=this.#i.value;i&&(Math.abs(i.scrollTop-this._scrollTop)>.5&&(i.scrollTop=this._scrollTop),Math.abs(i.scrollLeft-this._scrollLeft)>.5&&(i.scrollLeft=this._scrollLeft)),this.#ie(),this.#e.applyPendingScroll(e=>this.#ve(e)),this.#We(),this.#Z&&(this.#Z=!1,this._dispatch(`list-group-change`,{groupBy:this.groupBy}))}#ie(){if(!this.#y)return;let{index:e,lineFrac:n}=this.#y;this.#y=void 0;let r=this.#i.value;if(!r)return;let i=this.#Ce(),a=i.horizontal,o=a?this._viewportWidth:this._viewportHeight;if(o<=0)return;let s=i.offsetOfAnchor(e,n),c=Math.max(0,i.totalExtent-o),l=Math.min(c,Math.max(0,s-o/2));a?Math.abs(r.scrollLeft-l)>.5&&(r.scrollLeft=l,this._scrollLeft=l):Math.abs(r.scrollTop-l)>.5&&(r.scrollTop=l,this._scrollTop=l)}#ae(e,n,r,i,a,o,s){if((this.#x?.count??0)===0)return;let c=r+(a===`separate`||a===`under`?o:0),l=this.#xe({itemWidth:r,rowHeight:c,gap:i,orientation:s});this.#y=l.anchorAt(e+n/2)}refreshLayout(){this.#oe(!0)}remeasure(){this.#oe(!0)}#oe(e=!1){let n=this.#i.value;if(!n)return;let r=n.clientWidth,i=n.clientHeight;if(r<=0||i<=0)return;let a=this.orientation===`row`,o=r!==this._viewportWidth||i!==this._viewportHeight;if(o){let e=a?this._scrollLeft:this._scrollTop,n=a?r:i;this.#ae(e,n,this.itemSize,this.gap,this.captionStyle,this.captionHeight,this.orientation),this._viewportWidth=r,this._viewportHeight=i}e&&!o&&(this.#ae(a?this._scrollLeft:this._scrollTop,a?r:i,this.itemSize,this.gap,this.captionStyle,this.captionHeight,this.orientation),this.requestUpdate()),(o||e)&&this.updateComplete.then(()=>this.#J())}#se(){this.#x instanceof ow&&(this.#x.refresh(),this.#X())}get count(){return this.#x.count}get renderedCount(){return this.renderRoot.querySelectorAll(`.cell`).length}get selectedItems(){let e=/* @__PURE__ */ new Set;for(let n of this.selection.selectedKeys){let r=this.#x.resolveKeyToElement(n);r&&e.add(r)}return e}get selectedKeys(){let e=/* @__PURE__ */ new Set;for(let n of this.selection.selectedKeys)rw(n)||e.add(n);return e}select(e){let n=D(e);n&&this.selection.replace(n)}selectMany(e){let n=[];for(let r of e){let e=D(r);e&&n.push(e)}this.selection.selectMany(n)}deselect(e){let n=D(e);n&&this.selection.deselect(n)}clearSelection(){this.selection.clear()}selectAll(){this.selection.canSelectAll()&&this.selection.selectAll()}selectKeys(e){this.selection.selectKeys(e,e=>e)}addSelectedKeys(e){this.selection.addKeys(e,e=>e)}removeSelectedKeys(e){this.selection.removeKeys(e,e=>e)}#ce(e){return this.#ue(),this.#le.get(e)}#le;#ue(){this.#le.ensure(this.items,this.itemAdapter)}setItems(e){this.itemAdapter&&(this.items=e)}appendItems(e){if(this.itemAdapter&&e.length>0){let n=this.items.length,r=[...this.items,...e];this.#ue(),this.#le.addAppended(e,n,this.itemAdapter),this.#le.commit(r),this.items=r}}updateItem(e,n){if(!this.itemAdapter)return;let r=this.#ce(e);if(r<0||this.items[r]===n)return;let i=[...this.items];i[r]=n,this.#ue(),this.#le.rekey(i,r,e,n,this.itemAdapter),this.#le.commit(i),this.items=i}updateItems(e){if(!this.itemAdapter)return;let n=[];for(let r of e)Array.isArray(r)?n.push([r[0],r[1]]):n.push([r.key,r.item]);if(n.length===0)return;this.#ue();let r=[...this.items],i=[];for(let[e,a]of n){let n=this.#le.get(e);n<0||r[n]!==a&&(r[n]=a,i.push([n,e,a]))}if(i.length!==0){for(let[e,n,a]of i)this.#le.rekey(r,e,n,a,this.itemAdapter);this.#le.commit(r),this.items=r}}refreshItem(e){this.itemAdapter&&(this.#ce(e)<0||(this.#de.set(e,(this.#de.get(e)??0)+1),this.requestUpdate()))}#de;removeItems(e){if(!this.itemAdapter)return;let n=this.itemAdapter,r=new Set(e),i=this.items.filter((e,i)=>!r.has(n.key(e,i)));i.length!==this.items.length&&(this.#ue(),this.#le.rebuild(i,n),this.#le.commit(i),this.items=i)}clearItems(){if(!this.itemAdapter)return;this.selection.reset();let e=this.tickled.tickledId;e!==void 0&&this.#ge(e),this.items=[],this.#Ae(/* @__PURE__ */ new Set,/* @__PURE__ */ new Set)}focusKey(e){this.#x.indexOfKey(e)<0||(this.#n=void 0,this.tickled.focus(e),this.#Te(e))}get tickledKey(){return this.tickled.tickledId}getViewState(e){let n=e?.includePending??!0,r=this.tickled.tickledId,i=this.tickled.inputMode===`keyboard`&&r!==void 0&&!rw(r)?r:void 0;return this.#e.shape({selected:pr(this.selectedKeys,n?[...this.selection.pendingKeys].filter(e=>!rw(e)):[]),expanded:lw(this._collapsedGroups,this.#t,n),focus:i??(n?this.#n:void 0),scroll:(n?this.#e.pendingScroll:void 0)??this.#_e()},e)}setViewState(e){this.#e.accepts(e)&&(this.#e.restoring(()=>{e.expanded&&(this.#t=lr(dr(e.expanded)),this._collapsedGroups.size>0&&(this._collapsedGroups=/* @__PURE__ */ new Set)),e.focus!==void 0&&(this.#n=e.focus),e.scroll&&(this.#e.pendingScroll=e.scroll),this.#me(),e.selected&&this.selection.restoreKeys(e.selected,this.#fe),this.#pe()}),this.requestUpdate())}clearPendingViewState(){this.selection.clearPending(),this.#t=ar,this.#n=void 0,this.#e.pendingScroll=void 0}#fe;#pe(){this.#e.restoring(()=>{this.#me(),this.selection.resolvePending(this.#fe);let e=this.#n;e!==void 0&&this.#x.indexOfKey(e)>=0&&(this.tickled.setInputMode(`keyboard`),this.tickled.focus(e),this.#n=void 0)})}#me(){if(this._collapsedGroups.size===0&&this.#t.size===0)return;let e=this.groupBy===null?/* @__PURE__ */ new Set:new Set(this.#x.groups().map(e=>e.key)),n=cw(this._collapsedGroups,this.#t,n=>e.has(n));n.changed&&(this.#t=n.pending,n.collapsed!==this._collapsedGroups&&(this._collapsedGroups=n.collapsed,this.#$(),this.#ee(),this.#e.notify(`data`)))}#he(e){let n=e.filter(rw);this.selection.demote(e.filter(e=>!rw(e)))&&(this._syncItemStates(),this.#e.notify(`data`)),n.length>0&&this.selection.removeKeys(n,e=>e)}#ge(e){this.tickled.inputMode===`keyboard`&&!rw(e)&&(this.#n??=e),this.tickled.focus(void 0)}#_e(){let e=this.#i.value;if(!e)return;let n=this.orientation===`row`,r=n?e.scrollLeft:e.scrollTop,i=n?e.scrollTop:e.scrollLeft,a=this.#x.keys();return uw(this.#Ce(),r,i,e=>{let n=a[e];return n===void 0||rw(n)?void 0:n})}#ve(e){let n=this.#i.value,r=this.orientation===`row`,i=r?this._viewportWidth:this._viewportHeight;if(!n||i<=0)return!1;let a=dw(e,this.#Ce(),e=>this.#x.indexOfKey(e),i);return a?(r?(Math.abs(n.scrollLeft-a.offset)>.5&&(this.#r=a.offset),n.scrollLeft=a.offset,this._scrollLeft=a.offset):(Math.abs(n.scrollTop-a.offset)>.5&&(this.#r=a.offset),n.scrollTop=a.offset,this._scrollTop=a.offset),a.reached):!1}getItem(e){return this.#x.resolveKeyToElement(e)}getItemByIndex(e){return this.#u[e]}getData(e){return this.#x.resolveKeyToData(e)}getKey(e){return D(e)}renderedKeys(){return this.#ye(this.#we())}visibleKeys(){return this.#ye(this.#we(!0))}#ye(e){let n=this.#x.keys(),r=[];for(let[i,a]of e.ranges)for(let e=i;e<a;e++)rw(n[e])||r.push(n[e]);return r}#be(e={}){return{count:this.#x.count,groups:this.groupBy===null?void 0:this.#x.groups(),itemWidth:this.itemSize,rowHeight:this.#ne(),gap:this.gap,viewportWidth:this._viewportWidth,viewportHeight:this._viewportHeight,orientation:this.orientation,headerHeight:this.groupHeaderHeight,headerWidth:this.groupHeaderWidth,...e}}#xe(e={}){return ew(this.#be(e))}#Se;#Ce(){let e=this.#be(),n=this.#Se;if(n){let r=n.params,i=r.groups===e.groups;for(let n of Object.keys(e)){if(!i)break;i=r[n]===e[n]}if(i)return n.layout}let r=ew(e);return this.#Se={params:e,layout:r},r}#we(e=!1){return this.#Ce().window(this.orientation===`row`?this._scrollLeft:this._scrollTop,e?0:2)}#Te(e){let n=this.#x.indexOfKey(e),r=this.#i.value;if(n<0||!r)return;let[i,a]=this.#Ce().extentOf(n);if(this.orientation===`row`){let e=r.scrollLeft,n=e;i<e?n=i:a>e+this._viewportWidth&&(n=a-this._viewportWidth),n!==e&&(r.scrollLeft=n,this._scrollLeft=n);return}let o=r.scrollTop,s=o;i<o?s=i:a>o+this._viewportHeight&&(s=a-this._viewportHeight),s!==o&&(r.scrollTop=s,this._scrollTop=s)}#Ee;#De;#Oe;#ke;get partialKeys(){return this.#ke}set partialKeys(e){let n=new Set(e);br(n,this.#ke)||(this.#ke=n,this._syncItemStates(),this.requestUpdate())}_syncItemStates(e=!1){let n=this.selection.selectedKeys,r=this.tickled.tickledId,i=e=>{if(rw(e))return;let n=this.#x.indexOfKey(e);return n<0?void 0:this.#u[n]},a=r===void 0?void 0:i(r),o=/* @__PURE__ */ new Set;for(let e of n){let n=i(e);n&&o.add(n)}if(e)for(let e of this.#u)this.#Ee.add(e),this.#De.add(e);this.#Ee=hw(`data-tickled`,this.#Ee,a?/* @__PURE__ */ new Set([a]):/* @__PURE__ */ new Set),this.#De=hw(`data-selected`,this.#De,o);let s=/* @__PURE__ */ new Set;for(let e of this.#ke){let r=n.has(e)?void 0:i(e);r&&s.add(r)}this.#Oe=hw(`data-partial`,this.#Oe,s),this.setAttribute(`data-input-mode`,this.tickled.inputMode)}#Ae(e,n){this.#e.notify();let r=/* @__PURE__ */ new Set,i=/* @__PURE__ */ new Set;for(let n of e){let e=this.#x.resolveKeyToElement(n);e&&r.add(e)}for(let e of n){let n=this.#x.resolveKeyToElement(e);n&&i.add(n)}this._dispatch(`list-select`,{selected:r,previous:i,selectedKeys:this.selectedKeys,previousKeys:new Set([...n].filter(e=>!rw(e)))})}#je(e,n){let r=this.#x.indexOfKey(n),i=this.#x.resolveKeyToElement(n),a=i??this.#x.resolveKeyToData(n);this._dispatch(e,{item:a,key:n,index:r,element:i})}_dispatch(e,n,r=!1){return this.dispatchEvent(new CustomEvent(e,{detail:n,bubbles:!0,composed:!0,cancelable:r}))}#Me;#Ne(e){return`left:${e.x}px;top:${e.y}px;width:${Math.max(0,e.width)}px;height:${Math.max(0,e.height)}px`}render(){let e=this.#we();this.#Me=this.selection.selectedKeys;let n=e.horizontal?`width:${e.totalWidth}px;height:100%`:`height:${e.totalHeight}px`,r=e.horizontal?`scroll-fade-x`:`scroll-fade-y`;return i`
|
|
8049
8050
|
<div
|
|
8050
8051
|
class="viewport ${r}"
|
|
8051
8052
|
part="viewport"
|
|
8052
|
-
${
|
|
8053
|
+
${ee(this.#i)}
|
|
8053
8054
|
data-input-mode=${this.tickled.inputMode}
|
|
8054
|
-
@scroll=${this.#
|
|
8055
|
-
@wheel=${this.#
|
|
8056
|
-
@click=${this.#
|
|
8055
|
+
@scroll=${this.#Je}
|
|
8056
|
+
@wheel=${this.#Ye}
|
|
8057
|
+
@click=${this.#nt}
|
|
8057
8058
|
>
|
|
8058
8059
|
<div class="spacer" style=${n}>
|
|
8059
|
-
${this.#x instanceof sw?this.#
|
|
8060
|
-
${this.#
|
|
8060
|
+
${this.#x instanceof sw?this.#Pe(e):this.#Ge(e)}
|
|
8061
|
+
${this.#Ke(e)}
|
|
8061
8062
|
</div>
|
|
8062
|
-
${this.#w?i`<div class="marquee" part="marquee" style=${this.#
|
|
8063
|
+
${this.#w?i`<div class="marquee" part="marquee" style=${this.#Ne(this.#w)}></div>`:``}
|
|
8063
8064
|
</div>
|
|
8064
8065
|
${this.search?.renderField()}
|
|
8065
|
-
`}#
|
|
8066
|
+
`}#Pe(e){let n=this.#Le(e);return _(n,e=>this.#f.get(this.#x.keyAt(e)),n=>this.#ze(n,e))}#Fe(e){return`gl-cell-${this.#f.get(e)}`}#Ie(){let e=/* @__PURE__ */ new Map;for(let[n,r]of this.#h)e.set(n,r),n.getAttribute(`slot`)!==r&&n.setAttribute(`slot`,r);for(let n of this.#g.keys())e.has(n)||n.removeAttribute(`slot`);this.#g=e}#Le(e){let n=e.ranges.flatMap(([e,n])=>Array.from({length:n-e},(n,r)=>e+r));return this.#Re(n.map(e=>this.#x.keyAt(e))),n}#Re(e){let n=new Set(e),r=[];for(let[e,i]of this.#f)n.has(e)||r.push(i);let i=/* @__PURE__ */ new Map;for(let n of e){let e=this.#f.get(n);e!==void 0&&i.set(n,e)}let a=/* @__PURE__ */ new Set;for(let n of e){if(i.has(n))continue;let e=r.pop();e===void 0?i.set(n,this.#p++):(i.set(n,e),a.add(n))}this.#f=i,this.#m=a}#ze(e,n){let r=this.#x.keyAt(e),o=this.#Me.has(r),s=yr(r,this.#ke,o),c=this.#C.has(r),l=this.tickled.isTickled(r),u=this.#x.isSelectable(e),d=this.itemsDraggable&&u,f=this.captionStyle,p=f===`separate`,m=f===`hidden`?``:this.#x.labelAt(e),h=m!==``,g=n.rowStride-this.gap,{x:_,y:v}=this.#Ce().positionOf(e),y=p?`height:${Math.max(0,this.captionHeight-4)}px`:f===`under`?`height:${this.captionHeight}px`:``,b=this.#x.iconAt(e),x=vy(b)?void 0:b;return i`
|
|
8066
8067
|
<div
|
|
8067
8068
|
class="cell${o?` selected`:``}${s?` partial`:``}${l?` tickled`:``}${c?` marquee`:``}${this.#m.has(r)?` recycled`:``}${this.#T&&r===this.#E?` dragging-origin`:``}"
|
|
8068
8069
|
part="item${o?` selected`:``}${s?` partial`:``}${l?` tickled`:``}"
|
|
@@ -8079,17 +8080,17 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
8079
8080
|
?data-partial=${s}
|
|
8080
8081
|
?data-tickled=${l}
|
|
8081
8082
|
?data-marquee=${c}
|
|
8082
|
-
@click=${e=>this.#
|
|
8083
|
-
@dblclick=${()=>this.#
|
|
8084
|
-
@pointerenter=${()=>this.#
|
|
8083
|
+
@click=${e=>this.#tt(e,r)}
|
|
8084
|
+
@dblclick=${()=>this.#at(r)}
|
|
8085
|
+
@pointerenter=${()=>this.#Xe(r)}
|
|
8085
8086
|
>
|
|
8086
8087
|
<div class="content${x===void 0?``:` has-icon`}" part="content">
|
|
8087
|
-
${x===void 0?a:i`<span class="cell-icon" part="icon" style=${this.#
|
|
8088
|
-
${this.#
|
|
8088
|
+
${x===void 0?a:i`<span class="cell-icon" part="icon" style=${this.#He(this.#x.iconColorAt(e))}>${x}</span>`}
|
|
8089
|
+
${this.#Be(e,r)}
|
|
8089
8090
|
</div>
|
|
8090
|
-
${h?this.#
|
|
8091
|
+
${h?this.#Ve(m,y,l,this.#x.badgeAt(e),this.#x.textColorAt(e)):``}
|
|
8091
8092
|
</div>
|
|
8092
|
-
`}#
|
|
8093
|
+
`}#Be(e,n){let r=this.#de.get(n);return r===void 0?this.#x.renderCellContent(e):x(r,this.#x.renderCellContent(e))}#Ve(e,n,r,a,o){let s=yy(o),c=s===void 0?n:`${n}${n.length>0?`;`:``}color:${s};`;if(vy(a))return r?i`<div class="caption" part="caption" style=${c} title=${e}><ixfx-pan-text mode="loop">${e}</ixfx-pan-text></div>`:i`<div class="caption" part="caption" style=${c} title=${e}>${e}</div>`;let l=r?i`<ixfx-pan-text mode="loop">${e}</ixfx-pan-text>`:i`<span class="caption-text">${e}</span>`;return i`<div class="caption has-badge" part="caption" style=${c} title=${e}><span class="badge" part="badge">${a}</span>${l}</div>`}#He(e){let n=yy(e);return n===void 0?a:`color:${n};`}#Ue(){let e=this.#j;this.#j=null;try{e?.stopLoop?.()}catch{}}#We(){let e=this.renderRoot.querySelector(`.cell[data-tickled]`),n=[...this.renderRoot.querySelectorAll(`ixfx-pan-text[mode="loop"]`)],r=e?.querySelector(`ixfx-pan-text[mode="loop"]`)??null;for(let e of n)if(e!==r)try{e.stopLoop?.()}catch{}let i=this.#j;if(i&&i!==r)try{i.stopLoop?.()}catch{}r?(this.#j=r,r.startLoop?.()):this.#j=null}#Ge(e){let n=this.#Le(e);return this.#h=n.map(e=>[this.#u[e],this.#Fe(this.#x.keyAt(e))]),_(n,e=>this.#f.get(this.#x.keyAt(e)),n=>this.#qe(this.#u[n],n,e))}#Ke(e){if(e.headers.length===0)return a;let n=e.horizontal;return _(e.headers,e=>`__group__${e.key}`,e=>i`
|
|
8093
8094
|
<ixfx-list-group-header
|
|
8094
8095
|
class="group-header"
|
|
8095
8096
|
part="group-header"
|
|
@@ -8102,7 +8103,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
8102
8103
|
style=${n?`width:${e.size}px;height:100%;transform:translate(${e.offset}px,0)`:`width:100%;height:${e.size}px;transform:translate(0,${e.offset}px)`}
|
|
8103
8104
|
@click=${()=>this.toggleGroup(e.key)}
|
|
8104
8105
|
></ixfx-list-group-header>
|
|
8105
|
-
`)}#
|
|
8106
|
+
`)}#qe(e,n,r){let o=this.#x.keyAt(n),s=this.#Me.has(o),c=yr(o,this.#ke,s),l=this.#C.has(o),u=this.tickled.isTickled(o),d=this.#_.has(e),f=this.#x.isSelectable(n),p=this.itemsDraggable&&f,m=this.captionStyle,h=m===`separate`,g=m===`hidden`?``:this.#re(e),_=g!==``,v=r.rowStride-this.gap,{x:y,y:b}=this.#Ce().positionOf(n),x=h?`height:${this.itemSize}px`:``,S=h?`height:${Math.max(0,this.captionHeight-4)}px`:m===`under`?`height:${this.captionHeight}px`:``;return i`
|
|
8106
8107
|
<div
|
|
8107
8108
|
class="cell${s?` selected`:``}${c?` partial`:``}${u?` tickled`:``}${d?` entering`:``}${l?` marquee`:``}${this.#m.has(o)?` recycled`:``}${this.#T&&o===this.#E?` dragging-origin`:``}"
|
|
8108
8109
|
part="item${s?` selected`:``}${c?` partial`:``}${u?` tickled`:``}"
|
|
@@ -8119,16 +8120,16 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
8119
8120
|
?data-partial=${c}
|
|
8120
8121
|
?data-tickled=${u}
|
|
8121
8122
|
?data-marquee=${l}
|
|
8122
|
-
@click=${e=>this.#
|
|
8123
|
-
@dblclick=${()=>this.#
|
|
8124
|
-
@pointerenter=${()=>this.#
|
|
8123
|
+
@click=${e=>this.#tt(e,o)}
|
|
8124
|
+
@dblclick=${()=>this.#at(o)}
|
|
8125
|
+
@pointerenter=${()=>this.#Xe(o)}
|
|
8125
8126
|
>
|
|
8126
8127
|
<div class="thumb" part="thumb" style=${x}>
|
|
8127
|
-
<slot name=${this.#
|
|
8128
|
+
<slot name=${this.#Fe(o)}></slot>
|
|
8128
8129
|
</div>
|
|
8129
|
-
${_?this.#
|
|
8130
|
+
${_?this.#Ve(g,S,u):``}
|
|
8130
8131
|
</div>
|
|
8131
|
-
`}#
|
|
8132
|
+
`}#Je;#Ye;#Xe(e){this.#S.suppressed()||this.tickled.handlePointerEnter(e)}#Ze(){this.#c!==0&&(cancelAnimationFrame(this.#c),this.#c=0)}#Qe(){this.#l!==0&&(clearTimeout(this.#l),this.#l=0)}#$e(){!this.snapToItem||this.orientation!==`row`&&this.orientation!==`column`||(this.#Qe(),this.#l=window.setTimeout(()=>{this.#l=0,this.#et()},120))}#et(){let e=this.#i.value;if(!e)return;let n=this.#Ce(),r=n.horizontal,i=r?e.scrollLeft:e.scrollTop,a=r?this._viewportWidth:this._viewportHeight,o=Math.max(0,n.totalExtent-a),s=Math.min(o,Math.max(0,n.snapTarget(i)));Math.abs(s-i)<.5||e.scrollTo(r?{left:s,behavior:`smooth`}:{top:s,behavior:`smooth`})}#tt(e,n){this.#M.isDragging||this.#T||this.#O.isDragging||this.#D!==0||(this.selection.handleClick(n,hr(e)),this.#je(`list-item-click`,n))}#nt(e){let n=this.interactionMode;if((this.selectionMode!==`none`||n===`checked`||n===`sticky`)&&!(this.#M.isDragging||this.#T||this.#O.isDragging||this.#D!==0)){for(let n of e.composedPath())if(n instanceof Element&&(n.classList.contains(`cell`)||n.classList.contains(`group-header`)))return;this.selection.handleClear(`pointer`,!0)}}#rt(){this.#D&&clearTimeout(this.#D),this.#D=window.setTimeout(()=>{this.#D=0},0)}#it(){this.#T=!1,this.#E=void 0,this.toggleAttribute(`data-native-dragging`,!1),this.removeAttribute(`aria-label`)}#at(e,n=`pointer`){this.selection.handleReplace(e,n),this.#je(`list-activate`,e)}};E([d({type:String,attribute:`selection-mode`})],q.prototype,`selectionMode`,void 0),E([d({type:String,attribute:`interaction-mode`})],q.prototype,`interactionMode`,void 0),E([d({type:Boolean,attribute:`disable-hover-tickle`,reflect:!0})],q.prototype,`disableHoverTickle`,void 0),E([d({type:Boolean,attribute:`scroll-hover-tickle`,reflect:!0})],q.prototype,`scrollHoverTickle`,void 0),E([d({type:Number,attribute:`item-size`})],q.prototype,`itemSize`,void 0),E([d({type:Number})],q.prototype,`gap`,void 0),E([d({type:String,reflect:!0})],q.prototype,`orientation`,void 0),E([d({type:String,attribute:`caption-style`,reflect:!0})],q.prototype,`captionStyle`,void 0),E([d({type:String,attribute:`caption-align`,reflect:!0})],q.prototype,`captionAlign`,void 0),E([d({type:String,attribute:`caption-position`,reflect:!0})],q.prototype,`captionPosition`,void 0),E([d({type:String,attribute:`caption-backdrop`,reflect:!0})],q.prototype,`captionBackdrop`,void 0),E([d({type:Number,attribute:`caption-height`})],q.prototype,`captionHeight`,void 0),E([d({type:String,attribute:`item-wrap`})],q.prototype,`itemWrap`,void 0),E([d({attribute:!1})],q.prototype,`filterPredicate`,void 0),E([d({attribute:!1})],q.prototype,`itemFilterPredicate`,void 0),E([d({type:Boolean,attribute:`items-draggable`,reflect:!0})],q.prototype,`itemsDraggable`,void 0),E([d({type:Boolean,attribute:`marquee-from-cell-blank`,reflect:!0})],q.prototype,`marqueeFromCellBlank`,void 0),E([d({attribute:!1})],q.prototype,`dragPreviewRenderer`,void 0),E([d({attribute:!1})],q.prototype,`writeDataTransfer`,void 0),E([d({attribute:!1})],q.prototype,`dragPreviewSource`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],q.prototype,`searchModes`,void 0),E([d({type:Boolean,attribute:`snap-to-item`,reflect:!0})],q.prototype,`snapToItem`,void 0),E([d({attribute:!1})],q.prototype,`items`,void 0),E([d({attribute:!1})],q.prototype,`itemAdapter`,void 0),E([d({attribute:`group-by`})],q.prototype,`groupBy`,void 0),E([d({attribute:!1})],q.prototype,`groupLabel`,void 0),E([d({type:Boolean,attribute:`cross-group-selection`,reflect:!0})],q.prototype,`crossGroupSelection`,void 0),E([d({type:Number,attribute:`group-header-height`})],q.prototype,`groupHeaderHeight`,void 0),E([d({type:Number,attribute:`group-header-width`})],q.prototype,`groupHeaderWidth`,void 0),E([m()],q.prototype,`_collapsedGroups`,void 0),E([m()],q.prototype,`_scrollTop`,void 0),E([m()],q.prototype,`_scrollLeft`,void 0),E([m()],q.prototype,`_viewportHeight`,void 0),E([m()],q.prototype,`_viewportWidth`,void 0),q=E([T(`ixfx-grid-list`)],q);let gw=class extends n{constructor(...e){super(...e),this.collapsed=!1,this.orientation=`horizontal`,this.closable=!1,this.collapsible=!0,this.title=``,this.iconName=``,this.toggleInteraction=`implicit`,this.variant=`titlebar`,this.hideTitlebar=!1,this.keepToolbar=!1,this.stickyHeader=!1}_onTitlebarToggle(e){e.stopPropagation(),this.collapsed=e.detail.collapsed,this.dispatchEvent(new CustomEvent(`toggle`,{detail:{collapsed:this.collapsed},bubbles:!0,composed:!0}))}_onCloseClick(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent(`close`,{bubbles:!0,composed:!0})),this.remove()}render(){let e=this.keepToolbar||!this.collapsed;return i`
|
|
8132
8133
|
${this.hideTitlebar?a:i`
|
|
8133
8134
|
<ixfx-titlebar
|
|
8134
8135
|
.title=${this.title}
|
|
@@ -8281,7 +8282,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
8281
8282
|
height: 100%;
|
|
8282
8283
|
transform: none;
|
|
8283
8284
|
}
|
|
8284
|
-
`]}};E([d({type:Boolean,reflect:!0})],gw.prototype,`collapsed`,void 0),E([d({type:String,attribute:`orientation`,reflect:!0})],gw.prototype,`orientation`,void 0),E([d({type:Boolean})],gw.prototype,`closable`,void 0),E([d({type:Boolean,reflect:!0})],gw.prototype,`collapsible`,void 0),E([d({type:String})],gw.prototype,`title`,void 0),E([d({type:String,attribute:`icon-name`})],gw.prototype,`iconName`,void 0),E([d({type:String,attribute:`toggle-interaction`})],gw.prototype,`toggleInteraction`,void 0),E([d({type:String,attribute:`variant`,reflect:!0})],gw.prototype,`variant`,void 0),E([d({type:Boolean,attribute:`hide-titlebar`})],gw.prototype,`hideTitlebar`,void 0),E([d({type:Boolean,attribute:`keep-toolbar`})],gw.prototype,`keepToolbar`,void 0),E([d({type:Boolean,attribute:`sticky-header`,reflect:!0})],gw.prototype,`stickyHeader`,void 0),gw=E([T(`ixfx-panel`)],gw);const _w=`__ungrouped__`;let vw=class extends n{constructor(...e){super(...e),this.grouped=!1,this.crossGroupSelection=!1,this.#n=/* @__PURE__ */ new Map,this.#i=!1,this.#a=new je(this),this.#d=e=>{if(this.#i)return;let n=e.target,r;for(let[e,i]of this.#n)if(i===n){r=e;break}if(r!==void 0){if(this.grouped&&!this.crossGroupSelection){this.#i=!0;for(let[e,n]of this.#n)e!==r&&n.clearSelection();this.#i=!1}this.dispatchEvent(new CustomEvent(`grouped-select`,{detail:{selected:this.selectedItems,groupKey:r===_w?void 0:r},bubbles:!0,composed:!0}))}}}#e;#t;#n;#r;#i;#a;get groupBy(){return this.#e}set groupBy(e){this.#e=e,this.requestUpdate()}get factory(){return this.#t}set factory(e){e!==this.#t&&(this.#s(),this.#t=e,this.requestUpdate())}get provider(){return this.#a.provider}set provider(e){this.#a.provider=e,e&&this.#a.request(void 0)}get selectedItems(){let e=/* @__PURE__ */ new Set;for(let n of this.#n.values())for(let r of n.selectedItems)e.add(r);return e}dispatch(e,n){for(let r of this.#n.values())r.dispatch(e,n)}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener(`select`,this.#d)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`select`,this.#d)}updated(e){super.updated(e),e.has(`grouped`)&&this.#s(),this.#c()}render(){return this.#t?this.grouped?this.#e?(this.#r=this.#o(),i`${_(this.#r.keys(),e=>e,e=>i`<ixfx-panel data-group-key=${e} .title=${e}></ixfx-panel>`)}`):a:i`<div class="ungrouped-host"></div>`:a}#o(){let e=/* @__PURE__ */ new Map;if(!this.#e)return e;for(let n of this.#a.items){let r=this.#e(n),i=e.get(r);i||(i=[],e.set(r,i)),i.push(n)}return e}#s(){for(let e of this.#n.values())e.remove();this.#n.clear()}#c(){this.#t&&(this.grouped?this.#e&&this.#u():this.#l())}#l(){let e=this.querySelector(`.ungrouped-host`);if(!e)return;let n=this.#n.get(_w);n||(n=this.#t(void 0),e.appendChild(n),this.#n.set(_w,n)),n.setItems(this.#a.items)}#u(){let e=this.#r??this.#o();for(let n of[...this.#n.keys()])e.has(n)||(this.#n.get(n)?.remove(),this.#n.delete(n));for(let[n,r]of e){let e=[...this.children].find(e=>e instanceof HTMLElement&&e.dataset.groupKey===n);if(!e)continue;let i=this.#n.get(n);i||(i=this.#t(n),e.appendChild(i),this.#n.set(n,i)),i.setItems(r)}}#d};E([d({type:Boolean,reflect:!0})],vw.prototype,`grouped`,void 0),E([d({type:Boolean,attribute:`cross-group-selection`,reflect:!0})],vw.prototype,`crossGroupSelection`,void 0),vw=E([T(`ixfx-grouped-item-lister`)],vw);const yw=`application/x-ixfx-tree`,bw=/* @__PURE__ */ new Map,xw=/* @__PURE__ */ new Map;let Sw,Cw=0;function ww(){return`tree-drag-${++Cw}-${Date.now()}`}function Tw(e,n,r,i){bw.set(e,{sourceId:e,nodes:r,keys:i}),xw.set(e,new WeakRef(n)),Sw=e}function Ew(e){bw.delete(e),xw.delete(e),Sw===e&&(Sw=void 0)}function Dw(){if(Sw===void 0)return;let e=bw.get(Sw);if(e)return{sourceId:Sw,keys:e.keys,nodes:e.nodes,element:xw.get(Sw)?.deref()}}const Ow={direction:0,depth:0};function kw(e){return Math.min(e/2,Math.max(24,Math.min(64,e*.2)))}function Aw(e,n){if(n<=0)return Ow;let r=kw(n);return e<r?{direction:-1,depth:Math.min(1,(r-e)/r)}:e>n-r?{direction:1,depth:Math.min(1,(e-(n-r))/r)}:Ow}function jw(e,n){let r=Math.min(1,Math.max(0,n)/2500);return(120+3080*r*r)*(.35+.65*Math.min(1,Math.max(0,e)))}function Mw(e,n,r){return Math.max(n,Math.min(r,e))}var Nw=class{#e;#t;#n=!1;#r;#i=`internal`;#a=[];#o=[];#s;#c;#l=0;#u=0;#d=0;#f=0;#p=0;#m=0;#h=0;#g;#_=!1;#v;constructor(e,n){this.#e=e,this.#t=n,e.addController(this)}get isDragging(){return this.#n}get isRejected(){return this.#n&&this.#r===void 0}get dropState(){return this.#r}hostConnected(){this.#y()}hostUpdated(){this.#y()}#y(){let e=this.#t.getScrollContainer();e&&e!==this.#v&&(this.#b(),this.#v=e,e.addEventListener(`dragenter`,this.#x),e.addEventListener(`dragover`,this.#S),e.addEventListener(`dragleave`,this.#w),e.addEventListener(`drop`,this.#T))}#b(){let e=this.#v;e&&(e.removeEventListener(`dragenter`,this.#x),e.removeEventListener(`dragover`,this.#S),e.removeEventListener(`dragleave`,this.#w),e.removeEventListener(`drop`,this.#T),this.#v=void 0)}hostDisconnected(){this.#b(),this.#A(),this.#N(),this.#n=!1,this.#r=void 0}#x=e=>{this.#t.getDndMode()!==`none`&&e.dataTransfer&&this.#t.resolveDrag(e.dataTransfer,`hover`)!==void 0&&(e.preventDefault(),this.#n||(this.#n=!0,this.#t.onActiveChange(!0)))};#S=e=>{if(this.#t.getDndMode()===`none`||!e.dataTransfer)return;this.#u=e.clientX,this.#d=e.clientY,this.#g=e;let n=this.#t.resolveDrag(e.dataTransfer,`hover`);if(!n){this.#C(e);return}this.#n||(this.#n=!0,this.#t.onActiveChange(!0)),this.#i=n.source,this.#a=n.keys,this.#o=n.nodes;let r=this.#t.getVisibleRows();this.#k(this.#D(r,e.clientY)),this.#j();let i=this.#O(e,r,n.source);if(!i){this.#C(e,!1);return}let a={source:n.source,dragged:n.nodes.length>0?n.nodes:void 0,draggedKeys:n.keys,target:i,dataTransfer:e.dataTransfer};this.#t.vet(a)?(e.preventDefault(),e.dataTransfer.dropEffect=n.source===`internal`?`move`:`copy`,this.#P(i)):this.#C(e,!1)};#C(e,n=!0){e.dataTransfer&&(e.dataTransfer.dropEffect=`none`),this.#P(void 0),n&&this.#A()}#w=e=>{let n=this.#t.getScrollContainer(),r=e.relatedTarget;n&&r&&n.contains(r)||this.#E()};#T=e=>{if(!e.dataTransfer){this.#E();return}e.preventDefault(),this.#N(),this.#A();let n=e=>{this.#r=void 0,this.#n=!1,this.#t.onDropStateChange(void 0),this.#t.onActiveChange(!1),this.#t.onDragEnd(e)};if(this.#t.getDndMode()===`none`){n(!1);return}let r=this.#t.resolveDrag(e.dataTransfer,`drop`);if(!r){n(!1);return}this.#a=r.keys,this.#o=r.nodes;let i=this.#O(e,this.#t.getVisibleRows(),r.source);if(!i){n(!1);return}let a={source:r.source,dragged:r.nodes.length>0?r.nodes:void 0,draggedKeys:r.keys,target:i,dataTransfer:e.dataTransfer};if(!this.#t.vet(a)){n(!1);return}let o={...a,external:r.source===`external`?r.nodes:void 0};n(this.#t.commitDrop(o))};#E(){this.#A(),this.#N(),this.#r!==void 0&&(this.#r=void 0,this.#t.onDropStateChange(void 0)),this.#n&&(this.#n=!1,this.#t.onActiveChange(!1))}#D(e,n){if(e.length!==0)return n<e[0].rect.top?e[0]:n>e[e.length-1].rect.bottom?e[e.length-1]:e.find(e=>n>=e.rect.top&&n<=e.rect.bottom)??e[e.length-1]}#O(e,n,r){if(n.length===0)return;let i=this.#D(n,e.clientY);if(!i)return;let a=Mw((e.clientY-i.rect.top)/i.rect.height,0,1),o=a<.25?`before`:a>.75?`after`:`inside`,s=i.node.item.isLeaf===!0;o===`inside`&&s&&(o=`after`);let c=!1;o===`after`&&!s&&this.#t.isExpanded(i.key)&&(o=`inside`,c=!0);let l,u,d,f;if(o===`inside`)l=i.key,u=i.key,d=i.depth+1,f=c?0:i.node.children?.length??0;else{let r=this.#t.getIndentPx()||1,a=n[0].rect.left,s=Mw(Math.round((e.clientX-a)/r),0,i.depth),c={node:i.node,depth:i.depth,parentKey:this.#t.getRowInfo(i.key)?.parentKey};u=i.key;for(let e=i.depth-s;e>0&&c.parentKey!==void 0;e--){let e=this.#t.getRowInfo(c.parentKey);if(!e)break;u=c.parentKey,c=e}d=c.depth,l=c.parentKey;let p=this.#t.getChildren(l).findIndex(e=>e.item.key===u);f=(p<0?0:p)+ +(o===`after`)}if(r===`internal`){for(let e of this.#a)if(e===l||e===u||l!==void 0&&this.#t.isSelfOrDescendant(e,l)||o!==`inside`&&this.#t.isSelfOrDescendant(e,u))return;if(this.#a.length>0&&!this.#t.isReorderAllowed()&&!this.#a.some(e=>this.#t.getParentKey(e)!==l))return}return{parentKey:l,index:f,referenceKey:u,position:o,depth:d}}#k(e){if(!e||e.node.item.isLeaf===!0||this.#t.isExpanded(e.key)){this.#A();return}if(e.key===this.#c)return;this.#A();let n=this.#c=e.key;this.#s=setTimeout(()=>{this.#s=void 0,this.#c===n&&(this.#c=void 0,this.#t.expandKey(n))},Math.max(0,this.#t.getExpandHoverMs()))}#A(){this.#s!==void 0&&(clearTimeout(this.#s),this.#s=void 0),this.#c=void 0}#j(){this.#l===0&&(this.#l=requestAnimationFrame(this.#M))}#M=e=>{if(this.#l=0,!this.#n)return;let n=this.#t.getScrollContainer();if(!n||this.#_&&this.#g&&(this.#_=!1,this.#S(this.#g),!this.#n))return;let r=n.getBoundingClientRect(),i=this.#u>=r.left&&this.#u<=r.right?Aw(this.#d-r.top,r.height):{direction:0,depth:0};if(i.direction!==this.#f&&(this.#f=i.direction,this.#p=e,this.#m=e,this.#h=0),i.direction===0)return;let a=Math.min(50,Math.max(0,e-this.#m));this.#m=e;let o=jw(i.depth,e-this.#p),s=i.direction*o*a/1e3+this.#h,c=Math.trunc(s);if(this.#h=s-c,c!==0){let e=n.scrollTop;n.scrollTop=e+c,n.scrollTop!==e&&(this.#_=!0)}this.#j()};#N(){this.#l!==0&&(cancelAnimationFrame(this.#l),this.#l=0),this.#f=0,this.#h=0,this.#_=!1,this.#g=void 0}#P(e){let n=e===void 0?this.#r===void 0:e.referenceKey===this.#r?.referenceKey&&e.position===this.#r?.position&&e.depth===this.#r?.depth&&e.index===this.#r?.index;this.#r=e,(!n||this.#n)&&this.#t.onDropStateChange(e)}};function Pw(e,n){let r=[],i=/* @__PURE__ */ new Map,a=[],o=(e,r,i)=>{if(!e||e.length===0)return;let o=e.filter(e=>n.isShown(e,r));for(let e=o.length-1;e>=0;e--)a.push({node:o[e],depth:r,parentKey:i,posInSet:e+1,setSize:o.length})};for(o(e.children,0,void 0);a.length>0;){let{node:e,depth:s,parentKey:c,posInSet:l,setSize:u}=a.pop();i.set(e.item.key,r.length),r.push({node:e,depth:s,parentKey:c,posInSet:l,setSize:u}),e.children&&e.children.length>0&&n.isExpanded(e,s)&&o(e.children,s+1,e.item.key)}return{rows:r,indexByKey:i}}function Fw(e){let n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ new Set,i=/* @__PURE__ */ new Set([e.item.key]),a=/* @__PURE__ */ new Set,o=[];if(e.children)for(let r of e.children)n.set(r.item.key,e.item.key),o.push({node:r,depth:0,parentKey:e.item.key});for(;o.length>0;){let{node:e,depth:s,parentKey:c}=o.pop();if(i.has(e.item.key)&&a.add(e.item.key),i.add(e.item.key),n.set(e.item.key,c),e.item.icon&&r.add(s),e.children)for(let n=e.children.length-1;n>=0;n--){let r=e.children[n];o.push({node:r,depth:s+1,parentKey:e.item.key})}}if(a.size>0){let e=[...a].slice(0,5).map(e=>`"${e}"`).join(`, `);console.warn(`[ixfx-tree] ${a.size} duplicate item key(s) in tree (e.g. ${e}). Keys must be unique across the whole tree; duplicates break checkbox state, expansion and selection.`)}return{parentByKey:n,depthsWithIcons:r}}function Iw(e,n){let r=/* @__PURE__ */ new Set;if(!e.children)return r;let i=[],a=(e,r)=>{i.push({node:e,depth:r,next:0,matched:n(e,r)})};for(let n of e.children)for(a(n,0);i.length>0;){let e=i[i.length-1],n=e.node.children;n&&e.next<n.length?a(n[e.next++],e.depth+1):(i.pop(),e.matched&&(r.add(e.node.item.key),i.length>0&&(i[i.length-1].matched=!0)))}return r}function Lw(e,n,r){if(r.size===0)return[...e];let i=/* @__PURE__ */ new Set;for(let n of e)i.add(n.node.item.key);let a=Symbol(`end`),o=/* @__PURE__ */ new Map,s=a;for(let e=n.length-1;e>=0;e--){let a=n[e];if(i.has(a)){s=a;continue}let c=r.get(a);if(!c)continue;let l=o.get(s);l?l.push(c):o.set(s,[c])}let c=[];for(let n of e){let e=o.get(n.node.item.key);if(e)for(let n=e.length-1;n>=0;n--)c.push(e[n]);c.push(n)}let l=o.get(a);if(l)for(let e=l.length-1;e>=0;e--)c.push(l[e]);return c}function Rw(e,n){let r=/* @__PURE__ */ new Map;if(!e.children)return r;let i=[];for(let a of e.children)for(i.push({node:a,next:0,checked:0,unchecked:0,counted:0});i.length>0;){let e=i[i.length-1],{node:a}=e,o=a.children,s=a.item.isLeaf||!o?.length;if(!s&&e.next<o.length){i.push({node:o[e.next++],next:0,checked:0,unchecked:0,counted:0});continue}i.pop();let c;c=s?n.has(a)?`checked`:`unchecked`:e.counted===0?`unchecked`:e.checked===e.counted?`checked`:e.unchecked===e.counted?`unchecked`:`indeterminate`,r.set(a.item.key,c);let l=s&&a.item.selectable===!1;if(i.length>0&&!l){let e=i[i.length-1];e.counted++,c===`checked`?e.checked++:c===`unchecked`&&e.unchecked++}}return r}function zw(e,n){if(e.has(n))return e;let r=new Set(e);return r.add(n),r}function Bw(e,n){if(!e.has(n))return e;let r=new Set(e);return r.delete(n),r}function Vw(e,n){let r;for(let i of e)n(i)&&(r??=new Set(e),r.delete(i));return r??e}function Hw(e){return Math.max(1,e.rowHeight+e.gap)}function Uw(e,n){return e.listOffset+n*Hw(e)+e.gap}function Ww(e,n){return Uw(e,n)+e.rowHeight}function Gw(e,n,r=5){let{count:i}=e;if(i<=0)return{start:0,end:0};let a=Hw(e),o=Math.max(0,n-e.listOffset),s=Math.floor(o/a),c=Math.ceil((o+e.viewportHeight)/a),l=Math.min(i,Math.max(0,s-r));return{start:l,end:Math.min(i,Math.max(l,c+r))}}function Kw(e,n){if(e.count<=0)return-1;let r=Math.floor((n-e.listOffset)/Hw(e));return Math.min(e.count-1,Math.max(0,r))}function qw(e,n,r,i=0){if(n<0||n>=e.count)return r;let a=Uw(e,n),o=a+e.rowHeight;return a<r+i?n===0?0:Math.max(0,a-i):o>r+e.viewportHeight?Math.max(0,o-e.viewportHeight):r}function Jw(e,n,r,i=0){if(n<0||n>=e.count)return r;let a=Uw(e,n),o=a+e.rowHeight;if(a>=r+i&&o<=r+e.viewportHeight)return r;let s=a+e.rowHeight/2-(e.viewportHeight+i)/2;return Math.max(0,s)}function Yw(e){return Math.max(1,Math.floor(e.viewportHeight/Hw(e))-1)}function Xw(e){return{count:e.count,topOf:n=>Uw(e,n),bottomOf:n=>Ww(e,n)}}function Zw(e,n){let r=0,i=e.count;for(;r<i;){let a=r+i>>>1;e.bottomOf(a)>n?i=a:r=a+1}return r}function Qw(e,n,r,i=0){if(e.count===0)return;let a=Math.min(Zw(e,n),e.count-1),o=a,s=e.count;for(;o<s;){let n=o+s>>>1;e.topOf(n)>=r?s=n:o=n+1}let c=Math.max(a,o-1);return{first:Math.max(0,a-i),last:Math.min(e.count-1,c+i)}}function $w(e,n,r,i){let a,o,s=[];for(let i of e)r(i)||(a??=new Set(e),a.delete(i),o??=new Map(n),o.set(i,!0));for(let[c,l]of n)r(c)&&(l&&!i(c)?s.push(c):(o??=new Map(n),o.delete(c),l!==(a??e).has(c)&&(a??=new Set(e),l?a.add(c):a.delete(c))));return{live:a??e,pending:o?lr(o):n,needsLoad:s,changed:a!==void 0||o!==void 0}}function eT(e,n,r,i,a){if(e.size===0&&n.size===0)return{selected:e,pending:n,restored:!1,changed:!1};let o=/* @__PURE__ */ new Set,s=/* @__PURE__ */ new Set,c=!1;for(let n of e){let e=r(n.item.key);e?(o.add(e),e!==n&&(c=!0)):(s.add(n.item.key),c=!0)}let l;for(let e of n){let n=r(e);n&&i(n)?(o.add(n),l=n,c=!0):s.add(e)}if(!c)return{selected:e,pending:n,restored:!1,changed:!1};let u=o,d=s;return a&&o.size>0&&(u=/* @__PURE__ */ new Set([l??[...o].at(-1)]),d=O),{selected:u,pending:cr(d),restored:l!==void 0,changed:!0}}function tT(e,n,r,i){let a=n,o=!1;return e!==void 0&&!r(e)&&(a??=e,o=!0),a!==void 0&&i(a)?{clear:o,apply:a,pending:void 0}:{clear:o,apply:void 0,pending:a}}function nT(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):void 0}function rT(e,n,r){if(!e)return{status:`missing`};let i=[],a=e;for(let e of n){if(a.children===void 0)return r(a)?{status:`load`,node:a,depth:i.length-1}:{status:`missing`};let n=a.children.find(n=>n.item.key===e);if(!n)return{status:`missing`};i.push(n),a=n}return{status:`found`,nodes:i}}const iT={rows:[],indexByKey:/* @__PURE__ */ new Map};let q=class extends n{constructor(...e){super(...e),this.exclusivity=`none`,this.selectionFilter=`all`,this.interactionMode=`standard`,this._selectedNodes=/* @__PURE__ */ new Set,this.disableKeyboardNavigation=!1,this.scrollHoverTickle=!1,this.registry=void 0,this.itemDnd=`none`,this.dndExpandHoverMs=500,this.reorderable=!0,this.stickyHeaders=!0,this.virtualize=`auto`,this.virtualizeThreshold=200,this.animation=`auto`,this.applyInternalDrop=!0,this._expandedKeys=/* @__PURE__ */ new Set,this.restoreLoads=!0,this.#t=new cy(this,{kind:`tree-list`,capture:()=>this.getViewState()}),this.#n=ar,this.#r=O,this.#o=-1,this.#d=0,this._selectionVersion=0,this._scrollTop=0,this.#g={rowHeight:30,gap:1,listOffset:0},this.#_=0,this.#v=0,this.#x=0,this.#S=0,this.#C=!1,this.#k=()=>{this.#v===0&&(this.#v=requestAnimationFrame(()=>{this.#v=0,this.#A()}))},this.tickled=new oe(this,{getItems:()=>this.#m().rows.map(({node:e})=>({id:e.item.key,enabled:!0})),hoverDisabled:()=>this.#re?.isDragging===!0||this.#ie?.isDragging===!0,onStateChange:()=>{this.setAttribute(`data-input-mode`,this.tickled.inputMode)}}),this.#F=Cr({host:this,enabled:()=>!this.scrollHoverTickle,onResume:(e,n)=>{let r=(this.shadowRoot?.elementFromPoint?.(e,n)?.closest(`li.item`))?.dataset.key,i=this.#m(),a=r===void 0?void 0:i.indexByKey.get(r),o=a===void 0?void 0:i.rows[a];o&&this._handleRowPointerEnter(o.node,o.depth)}}),this._focusedDepth=0,this.search=new Ht(this,{adapter:Gt(this,{labelSelector:`.tree-label`,highlightKey:`incr-search-highlight`})}),this.#W={indent:20},this.#G=[],this.#K=[],this.#q=/* @__PURE__ */ new Map,this.#J=/* @__PURE__ */ new Map,this.#Y=/* @__PURE__ */ new Set,this.#X=/* @__PURE__ */ new Map,this.#Z=/* @__PURE__ */ new Map,this.#Q=!1,this.#ee=``,this.#ae=/* @__PURE__ */ new Set,this.#oe=!1,this.#ce=()=>{this.#se=void 0},this.#ue=()=>{this.#be===0&&(this.#be=requestAnimationFrame(()=>{this.#be=0,this.#fe()}))},this._stickyKeys=[],this.#ve=/* @__PURE__ */ new Map,this.#ye=!0,this.#be=0,this.#Se=!1,this.#We=()=>{this.#t.notifyScroll()},this.#et=`user`,this.#tt=!1,this.#wt=0,this.#It=e=>{if(this.search.isOpen)return;let n=this.#m().rows;if(n.length===0)return;if((e.ctrlKey||e.metaKey)&&e.key===`a`){if(e.preventDefault(),this.#at({kind:`all`,keys:[],source:`keyboard`}))return;this.#Je({visibleOnly:!0});return}[`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`,`Home`,`End`,`PageUp`,`PageDown`,`Enter`,` `].includes(e.key)&&this.tickled.setInputMode(`keyboard`);let r=this.#jt();switch(e.key){case`ArrowDown`:e.preventDefault(),this.#Ft(n,r,Math.min(r+1,n.length-1),e.shiftKey);break;case`ArrowUp`:e.preventDefault(),this.#Ft(n,r,Math.max(r-1,0),e.shiftKey);break;case`Home`:e.preventDefault(),this.#Ft(n,r,0,e.shiftKey);break;case`End`:e.preventDefault(),this.#Ft(n,r,n.length-1,e.shiftKey);break;case`PageDown`:{e.preventDefault();let i=this.#Pt();this.#Ft(n,r,Math.min(r+i,n.length-1),e.shiftKey);break}case`PageUp`:{e.preventDefault();let i=this.#Pt();this.#Ft(n,r,Math.max(r-i,0),e.shiftKey);break}case`ArrowRight`:{e.preventDefault();let i=n[r];i&&i.node.item.isLeaf!==!0&&(this._expandedKeys.has(i.node.item.key)?r+1<n.length&&this.#Mt(r+1):this.#ht(i.node,i.depth)),this.requestUpdate();break}case`ArrowLeft`:{e.preventDefault();let i=n[r];if(i&&this._expandedKeys.has(i.node.item.key))this.#e(Bw(this._expandedKeys,i.node.item.key)),this.dispatchEvent(new CustomEvent(`collapse`,{detail:{node:i.node,depth:i.depth},bubbles:!0,composed:!0}));else if(i.depth>0){let e=i.depth-1;for(let i=r-1;i>=0;i--)if(n[i].depth===e){this.#Mt(i);break}}this.requestUpdate();break}case`Enter`:{e.preventDefault();let i=n[r];i&&(this.interactionMode!==`manual`&&this.interactionMode!==`checked`&&(this.#st(i.node,`keyboard`,!1),this.requestUpdate()),this.dispatchEvent(new CustomEvent(`activate`,{detail:{node:i.node,depth:i.depth},bubbles:!0,composed:!0})),this.requestUpdate());break}case` `:{e.preventDefault();let i=n[r];if(!i)break;this.interactionMode===`checked`?this._handleCheckboxClick(new MouseEvent(`click`),i.node,i.depth,`keyboard`):(this.interactionMode===`standard`||this.interactionMode===`vscode`||this.interactionMode===`manual`)&&this.#mt(i.node,i.depth);break}case`Escape`:e.preventDefault(),this.#Et()}},this.#Lt=e=>{let n=e.target.closest(`ul.tree-list li`);if(!n)return;let r=n.dataset.key;if(!r)return;let i=this.#m(),a=i.indexByKey.get(r),o=a===void 0?void 0:i.rows[a];if(!o)return;let s={node:o.node,depth:o.depth};this.dispatchEvent(new CustomEvent(`item-dblclick`,{detail:s,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`activate`,{detail:s,bubbles:!0,composed:!0}))}}get selectedNodes(){return this._selectedNodes}#e(e){e!==this._expandedKeys&&(this._expandedKeys=e,this.#c=void 0,this.#ye=!0,this.#t.notify())}#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;invalidateStructure(){this.#d++,this.#c=void 0,this.requestUpdate()}#m(){if(!this.root)return iT;if(this.#c&&this.#l===this.root&&this.#u===this.filterPredicate)return this.#c;let e=this.#P();return this.#c=Pw(this.root,{isExpanded:(e,n)=>this._isExpanded(e,n),isShown:e?n=>e.matches.has(n.item.key):()=>!0}),this.#l=this.root,this.#u=this.filterPredicate,this.#c}#h(){let e=this.root;if(!e)return{parentByKey:/* @__PURE__ */ new Map,depthsWithIcons:/* @__PURE__ */ new Set};let n=this.#f;if(n&&n.root===e&&n.version===this.#d)return n.index;let r=Fw(e);return this.#f={root:e,version:this.#d,index:r},r}#g;#_;#v;#y;#b;#x;#S;#C;#w(){return this.virtualize===`off`?!1:this.virtualize===`on`||this.#m().rows.length>this.virtualizeThreshold}#T(e){return{count:e,rowHeight:this.#g.rowHeight,gap:this.#g.gap,listOffset:this.#g.listOffset,viewportHeight:this.#_>0?this.#_:600}}#E(){let e=this.renderRoot.querySelector(`ul.tree-list`),n=e?.querySelector(`li.item:not(.leaving)`),r=n?.getBoundingClientRect().height??0,i=r>0?r:this.#Me(),a=n?Number.parseFloat(getComputedStyle(n).marginTop):NaN,o=Number.isNaN(a)?Number.parseFloat(getComputedStyle(this).getPropertyValue(`--tree-item-gap`)):a,s=Number.isNaN(o)?1:o,c=this.#g.listOffset;if(e){let n=Number.parseFloat(getComputedStyle(e).paddingTop);c=e.offsetTop+(Number.isNaN(n)?0:n)}let l=this.#Ae()?.clientHeight??0,u=l>0&&l!==this.#_;l>0&&(this.#_=l);let d=this.#g,f=d.rowHeight!==i||d.gap!==s||d.listOffset!==c;return this.#g={rowHeight:i,gap:s,listOffset:c},f||u}#D(e){return Gw(this.#T(e),this._scrollTop)}#O(){let e=this.#Ae()?.scrollTop;e!==void 0&&e!==this._scrollTop&&(this._scrollTop=e)}#k;#A(){let e=this.#Ae();if(!e||!this.root||!this.#w())return;let n=e.scrollTop;if(n===this._scrollTop)return;let r=Gw(this.#T(this.#m().rows.length),n);(r.start!==this.#x||r.end!==this.#S)&&(this._scrollTop=n)}#j(){let e=this.#Ae();e!==this.#y&&(this.#y?.removeEventListener(`scroll`,this.#k),this.#b?.disconnect(),this.#b=void 0,this.#y=e,e&&(e.addEventListener(`scroll`,this.#k,{passive:!0}),typeof ResizeObserver<`u`&&(this.#b=new ResizeObserver(e=>{let n=e.at(-1)?.contentRect.height??0;n>0&&n!==this.#_&&this.#w()&&this.requestUpdate()}),this.#b.observe(e))))}#M(){this.#y?.removeEventListener(`scroll`,this.#k),this.#y=void 0,this.#b?.disconnect(),this.#b=void 0,this.#v!==0&&(cancelAnimationFrame(this.#v),this.#v=0)}#N(e,n=`edge`){let r=this.#Ae();if(!r)return;let i=this.#T(this.#m().rows.length),a=this.renderRoot.querySelector(`.sticky-headers`)?.getBoundingClientRect().height??0,o=(n===`center-if-hidden`?Jw:qw)(i,e,r.scrollTop,a);(o!==r.scrollTop||o!==this._scrollTop)&&(r.scrollTop=o,this._scrollTop=o)}#P(){let e=this.filterPredicate,n=this.root;if(!e||!n)return;let r=this.#p;if(r&&r.predicate===e&&r.root===n&&r.version===this.#d)return r;let i=Iw(n,e),{parentByKey:a}=this.#h(),o=/* @__PURE__ */ new Set;for(let e of i){let n=a.get(e);n!==void 0&&o.add(n)}let s={predicate:e,root:n,version:this.#d,matches:i,autoExpanded:o};return this.#p=s,s}get _structureVersion(){return this.#d}get _depthsWithIcons(){return this.#h().depthsWithIcons}#F;_handleRowPointerEnter(e,n){this.#F.suppressed()||(this.tickled.handlePointerEnter(e.item.key),this.dispatchEvent(new CustomEvent(`tickle`,{detail:{node:e,depth:n},bubbles:!0,composed:!0})))}#I;#L(){let e=this.searchModes?.trim();if(e===void 0)return[...Bt];let n=new Set(e.split(/\s+/));return Bt.filter(e=>n.has(e))}#R(){this.#U&&(this.search.setModes(this.#L()),this.#I?.(),this.#I=zt(this.#U,this.search))}#z;#B;#V;#H;#U;#W;#G;#K;#q;#J;#Y;#X;#Z;#Q;#$;#ee;#te;#ne;#re;#ie;#ae;#oe;#se;#ce;#le(){let e=this.#Ae();this.stickyHeaders&&e?this.#Se&&this.#xe===e||(this.#xe?.removeEventListener(`scroll`,this.#ue),e.addEventListener(`scroll`,this.#ue,{passive:!0}),this.#xe=e,this.#Se=!0):this.#Se&&=(this.#xe?.removeEventListener(`scroll`,this.#ue),this.#xe=void 0,!1)}#ue;#de(e){return{count:e.length,topOf:n=>e[n].offsetTop,bottomOf:n=>e[n].offsetTop+e[n].offsetHeight}}#fe(){this.#ye=!1;let e=/* @__PURE__ */ new Map,n=()=>this.#pe([],e);if(!this.stickyHeaders||!this.root)return n();let r=this.#Ae(),i=this.renderRoot.querySelector(`ul.tree-list`);if(!r||!i)return n();let a=this.#m(),o=this.#w(),s=i.children,c=this.#K;if(a.rows.length===0||!o&&(s.length===0||s.length!==c.length))return n();let l=o?Xw(this.#T(a.rows.length)):this.#de(s),u=r.scrollTop,d=u+(this.renderRoot.querySelector(`.sticky-headers`)?.getBoundingClientRect().height??0),f=Zw(l,u);if(!o)for(;f<s.length&&s[f].classList.contains(`leaving`);)f++;if(f>=l.count)return n();let p=o?f:a.indexByKey.get(c[f]);if(p===void 0)return n();let m=[],h=a.rows[p].parentKey;for(;h!==void 0;){let e=a.indexByKey.get(h);if(e===void 0)break;m.unshift(a.rows[e]),h=a.rows[e].parentKey}let g=/* @__PURE__ */ new Map,_=[];for(let e of m){let n=e.node.item.key,r=o?a.indexByKey.get(n):this.#q.get(n);r===void 0||l.bottomOf(r)>d||(_.push(n),g.set(n,{node:e.node,depth:e.depth}))}this.#pe(_,g)}#pe(e,n){let r=this._stickyKeys;r.length===e.length&&r.every((n,r)=>n===e[r])||(this.#ve=n,this._stickyKeys=e)}#me(){return!this.stickyHeaders||this._stickyKeys.length===0?a:i`
|
|
8285
|
+
`]}};E([d({type:Boolean,reflect:!0})],gw.prototype,`collapsed`,void 0),E([d({type:String,attribute:`orientation`,reflect:!0})],gw.prototype,`orientation`,void 0),E([d({type:Boolean})],gw.prototype,`closable`,void 0),E([d({type:Boolean,reflect:!0})],gw.prototype,`collapsible`,void 0),E([d({type:String})],gw.prototype,`title`,void 0),E([d({type:String,attribute:`icon-name`})],gw.prototype,`iconName`,void 0),E([d({type:String,attribute:`toggle-interaction`})],gw.prototype,`toggleInteraction`,void 0),E([d({type:String,attribute:`variant`,reflect:!0})],gw.prototype,`variant`,void 0),E([d({type:Boolean,attribute:`hide-titlebar`})],gw.prototype,`hideTitlebar`,void 0),E([d({type:Boolean,attribute:`keep-toolbar`})],gw.prototype,`keepToolbar`,void 0),E([d({type:Boolean,attribute:`sticky-header`,reflect:!0})],gw.prototype,`stickyHeader`,void 0),gw=E([T(`ixfx-panel`)],gw);const _w=`__ungrouped__`;let vw=class extends n{constructor(...e){super(...e),this.grouped=!1,this.crossGroupSelection=!1,this.#n=/* @__PURE__ */ new Map,this.#i=!1,this.#a=new je(this),this.#d=e=>{if(this.#i)return;let n=e.target,r;for(let[e,i]of this.#n)if(i===n){r=e;break}if(r!==void 0){if(this.grouped&&!this.crossGroupSelection){this.#i=!0;for(let[e,n]of this.#n)e!==r&&n.clearSelection();this.#i=!1}this.dispatchEvent(new CustomEvent(`grouped-select`,{detail:{selected:this.selectedItems,groupKey:r===_w?void 0:r},bubbles:!0,composed:!0}))}}}#e;#t;#n;#r;#i;#a;get groupBy(){return this.#e}set groupBy(e){this.#e=e,this.requestUpdate()}get factory(){return this.#t}set factory(e){e!==this.#t&&(this.#s(),this.#t=e,this.requestUpdate())}get provider(){return this.#a.provider}set provider(e){this.#a.provider=e,e&&this.#a.request(void 0)}get selectedItems(){let e=/* @__PURE__ */ new Set;for(let n of this.#n.values())for(let r of n.selectedItems)e.add(r);return e}dispatch(e,n){for(let r of this.#n.values())r.dispatch(e,n)}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener(`select`,this.#d)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`select`,this.#d)}updated(e){super.updated(e),e.has(`grouped`)&&this.#s(),this.#c()}render(){return this.#t?this.grouped?this.#e?(this.#r=this.#o(),i`${_(this.#r.keys(),e=>e,e=>i`<ixfx-panel data-group-key=${e} .title=${e}></ixfx-panel>`)}`):a:i`<div class="ungrouped-host"></div>`:a}#o(){let e=/* @__PURE__ */ new Map;if(!this.#e)return e;for(let n of this.#a.items){let r=this.#e(n),i=e.get(r);i||(i=[],e.set(r,i)),i.push(n)}return e}#s(){for(let e of this.#n.values())e.remove();this.#n.clear()}#c(){this.#t&&(this.grouped?this.#e&&this.#u():this.#l())}#l(){let e=this.querySelector(`.ungrouped-host`);if(!e)return;let n=this.#n.get(_w);n||(n=this.#t(void 0),e.appendChild(n),this.#n.set(_w,n)),n.setItems(this.#a.items)}#u(){let e=this.#r??this.#o();for(let n of[...this.#n.keys()])e.has(n)||(this.#n.get(n)?.remove(),this.#n.delete(n));for(let[n,r]of e){let e=[...this.children].find(e=>e instanceof HTMLElement&&e.dataset.groupKey===n);if(!e)continue;let i=this.#n.get(n);i||(i=this.#t(n),e.appendChild(i),this.#n.set(n,i)),i.setItems(r)}}#d};E([d({type:Boolean,reflect:!0})],vw.prototype,`grouped`,void 0),E([d({type:Boolean,attribute:`cross-group-selection`,reflect:!0})],vw.prototype,`crossGroupSelection`,void 0),vw=E([T(`ixfx-grouped-item-lister`)],vw);const yw=`application/x-ixfx-tree`,bw=/* @__PURE__ */ new Map,xw=/* @__PURE__ */ new Map;let Sw,Cw=0;function ww(){return`tree-drag-${++Cw}-${Date.now()}`}function Tw(e,n,r,i){bw.set(e,{sourceId:e,nodes:r,keys:i}),xw.set(e,new WeakRef(n)),Sw=e}function Ew(e){bw.delete(e),xw.delete(e),Sw===e&&(Sw=void 0)}function Dw(){if(Sw===void 0)return;let e=bw.get(Sw);if(e)return{sourceId:Sw,keys:e.keys,nodes:e.nodes,element:xw.get(Sw)?.deref()}}const Ow={direction:0,depth:0};function kw(e){return Math.min(e/2,Math.max(24,Math.min(64,e*.2)))}function Aw(e,n){if(n<=0)return Ow;let r=kw(n);return e<r?{direction:-1,depth:Math.min(1,(r-e)/r)}:e>n-r?{direction:1,depth:Math.min(1,(e-(n-r))/r)}:Ow}function jw(e,n){let r=Math.min(1,Math.max(0,n)/2500);return(120+3080*r*r)*(.35+.65*Math.min(1,Math.max(0,e)))}function Mw(e,n,r){return Math.max(n,Math.min(r,e))}var Nw=class{#e;#t;#n=!1;#r;#i=`internal`;#a=[];#o=[];#s;#c;#l=0;#u=0;#d=0;#f=0;#p=0;#m=0;#h=0;#g;#_=!1;#v;constructor(e,n){this.#e=e,this.#t=n,e.addController(this)}get isDragging(){return this.#n}get isRejected(){return this.#n&&this.#r===void 0}get dropState(){return this.#r}hostConnected(){this.#y()}hostUpdated(){this.#y()}#y(){let e=this.#t.getScrollContainer();e&&e!==this.#v&&(this.#b(),this.#v=e,e.addEventListener(`dragenter`,this.#x),e.addEventListener(`dragover`,this.#S),e.addEventListener(`dragleave`,this.#w),e.addEventListener(`drop`,this.#T))}#b(){let e=this.#v;e&&(e.removeEventListener(`dragenter`,this.#x),e.removeEventListener(`dragover`,this.#S),e.removeEventListener(`dragleave`,this.#w),e.removeEventListener(`drop`,this.#T),this.#v=void 0)}hostDisconnected(){this.#b(),this.#A(),this.#N(),this.#n=!1,this.#r=void 0}#x=e=>{this.#t.getDndMode()!==`none`&&e.dataTransfer&&this.#t.resolveDrag(e.dataTransfer,`hover`)!==void 0&&(e.preventDefault(),this.#n||(this.#n=!0,this.#t.onActiveChange(!0)))};#S=e=>{if(this.#t.getDndMode()===`none`||!e.dataTransfer)return;this.#u=e.clientX,this.#d=e.clientY,this.#g=e;let n=this.#t.resolveDrag(e.dataTransfer,`hover`);if(!n){this.#C(e);return}this.#n||(this.#n=!0,this.#t.onActiveChange(!0)),this.#i=n.source,this.#a=n.keys,this.#o=n.nodes;let r=this.#t.getVisibleRows();this.#k(this.#D(r,e.clientY)),this.#j();let i=this.#O(e,r,n.source);if(!i){this.#C(e,!1);return}let a={source:n.source,dragged:n.nodes.length>0?n.nodes:void 0,draggedKeys:n.keys,target:i,dataTransfer:e.dataTransfer};this.#t.vet(a)?(e.preventDefault(),e.dataTransfer.dropEffect=n.source===`internal`?`move`:`copy`,this.#P(i)):this.#C(e,!1)};#C(e,n=!0){e.dataTransfer&&(e.dataTransfer.dropEffect=`none`),this.#P(void 0),n&&this.#A()}#w=e=>{let n=this.#t.getScrollContainer(),r=e.relatedTarget;n&&r&&n.contains(r)||this.#E()};#T=e=>{if(!e.dataTransfer){this.#E();return}e.preventDefault(),this.#N(),this.#A();let n=e=>{this.#r=void 0,this.#n=!1,this.#t.onDropStateChange(void 0),this.#t.onActiveChange(!1),this.#t.onDragEnd(e)};if(this.#t.getDndMode()===`none`){n(!1);return}let r=this.#t.resolveDrag(e.dataTransfer,`drop`);if(!r){n(!1);return}this.#a=r.keys,this.#o=r.nodes;let i=this.#O(e,this.#t.getVisibleRows(),r.source);if(!i){n(!1);return}let a={source:r.source,dragged:r.nodes.length>0?r.nodes:void 0,draggedKeys:r.keys,target:i,dataTransfer:e.dataTransfer};if(!this.#t.vet(a)){n(!1);return}let o={...a,external:r.source===`external`?r.nodes:void 0};n(this.#t.commitDrop(o))};#E(){this.#A(),this.#N(),this.#r!==void 0&&(this.#r=void 0,this.#t.onDropStateChange(void 0)),this.#n&&(this.#n=!1,this.#t.onActiveChange(!1))}#D(e,n){if(e.length!==0)return n<e[0].rect.top?e[0]:n>e[e.length-1].rect.bottom?e[e.length-1]:e.find(e=>n>=e.rect.top&&n<=e.rect.bottom)??e[e.length-1]}#O(e,n,r){if(n.length===0)return;let i=this.#D(n,e.clientY);if(!i)return;let a=Mw((e.clientY-i.rect.top)/i.rect.height,0,1),o=a<.25?`before`:a>.75?`after`:`inside`,s=i.node.item.isLeaf===!0;o===`inside`&&s&&(o=`after`);let c=!1;o===`after`&&!s&&this.#t.isExpanded(i.key)&&(o=`inside`,c=!0);let l,u,d,f;if(o===`inside`)l=i.key,u=i.key,d=i.depth+1,f=c?0:i.node.children?.length??0;else{let r=this.#t.getIndentPx()||1,a=n[0].rect.left,s=Mw(Math.round((e.clientX-a)/r),0,i.depth),c={node:i.node,depth:i.depth,parentKey:this.#t.getRowInfo(i.key)?.parentKey};u=i.key;for(let e=i.depth-s;e>0&&c.parentKey!==void 0;e--){let e=this.#t.getRowInfo(c.parentKey);if(!e)break;u=c.parentKey,c=e}d=c.depth,l=c.parentKey;let p=this.#t.getChildren(l).findIndex(e=>e.item.key===u);f=(p<0?0:p)+ +(o===`after`)}if(r===`internal`){for(let e of this.#a)if(e===l||e===u||l!==void 0&&this.#t.isSelfOrDescendant(e,l)||o!==`inside`&&this.#t.isSelfOrDescendant(e,u))return;if(this.#a.length>0&&!this.#t.isReorderAllowed()&&!this.#a.some(e=>this.#t.getParentKey(e)!==l))return}return{parentKey:l,index:f,referenceKey:u,position:o,depth:d}}#k(e){if(!e||e.node.item.isLeaf===!0||this.#t.isExpanded(e.key)){this.#A();return}if(e.key===this.#c)return;this.#A();let n=this.#c=e.key;this.#s=setTimeout(()=>{this.#s=void 0,this.#c===n&&(this.#c=void 0,this.#t.expandKey(n))},Math.max(0,this.#t.getExpandHoverMs()))}#A(){this.#s!==void 0&&(clearTimeout(this.#s),this.#s=void 0),this.#c=void 0}#j(){this.#l===0&&(this.#l=requestAnimationFrame(this.#M))}#M=e=>{if(this.#l=0,!this.#n)return;let n=this.#t.getScrollContainer();if(!n||this.#_&&this.#g&&(this.#_=!1,this.#S(this.#g),!this.#n))return;let r=n.getBoundingClientRect(),i=this.#u>=r.left&&this.#u<=r.right?Aw(this.#d-r.top,r.height):{direction:0,depth:0};if(i.direction!==this.#f&&(this.#f=i.direction,this.#p=e,this.#m=e,this.#h=0),i.direction===0)return;let a=Math.min(50,Math.max(0,e-this.#m));this.#m=e;let o=jw(i.depth,e-this.#p),s=i.direction*o*a/1e3+this.#h,c=Math.trunc(s);if(this.#h=s-c,c!==0){let e=n.scrollTop;n.scrollTop=e+c,n.scrollTop!==e&&(this.#_=!0)}this.#j()};#N(){this.#l!==0&&(cancelAnimationFrame(this.#l),this.#l=0),this.#f=0,this.#h=0,this.#_=!1,this.#g=void 0}#P(e){let n=e===void 0?this.#r===void 0:e.referenceKey===this.#r?.referenceKey&&e.position===this.#r?.position&&e.depth===this.#r?.depth&&e.index===this.#r?.index;this.#r=e,(!n||this.#n)&&this.#t.onDropStateChange(e)}};function Pw(e,n){let r=[],i=/* @__PURE__ */ new Map,a=[],o=(e,r,i)=>{if(!e||e.length===0)return;let o=e.filter(e=>n.isShown(e,r));for(let e=o.length-1;e>=0;e--)a.push({node:o[e],depth:r,parentKey:i,posInSet:e+1,setSize:o.length})};for(o(e.children,0,void 0);a.length>0;){let{node:e,depth:s,parentKey:c,posInSet:l,setSize:u}=a.pop();i.set(e.item.key,r.length),r.push({node:e,depth:s,parentKey:c,posInSet:l,setSize:u}),e.children&&e.children.length>0&&n.isExpanded(e,s)&&o(e.children,s+1,e.item.key)}return{rows:r,indexByKey:i}}function Fw(e){let n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ new Set,i=/* @__PURE__ */ new Set([e.item.key]),a=/* @__PURE__ */ new Set,o=[];if(e.children)for(let r of e.children)n.set(r.item.key,e.item.key),o.push({node:r,depth:0,parentKey:e.item.key});for(;o.length>0;){let{node:e,depth:s,parentKey:c}=o.pop();if(i.has(e.item.key)&&a.add(e.item.key),i.add(e.item.key),n.set(e.item.key,c),e.item.icon&&r.add(s),e.children)for(let n=e.children.length-1;n>=0;n--){let r=e.children[n];o.push({node:r,depth:s+1,parentKey:e.item.key})}}if(a.size>0){let e=[...a].slice(0,5).map(e=>`"${e}"`).join(`, `);console.warn(`[ixfx-tree] ${a.size} duplicate item key(s) in tree (e.g. ${e}). Keys must be unique across the whole tree; duplicates break checkbox state, expansion and selection.`)}return{parentByKey:n,depthsWithIcons:r}}function Iw(e,n){let r=/* @__PURE__ */ new Set;if(!e.children)return r;let i=[],a=(e,r)=>{i.push({node:e,depth:r,next:0,matched:n(e,r)})};for(let n of e.children)for(a(n,0);i.length>0;){let e=i[i.length-1],n=e.node.children;n&&e.next<n.length?a(n[e.next++],e.depth+1):(i.pop(),e.matched&&(r.add(e.node.item.key),i.length>0&&(i[i.length-1].matched=!0)))}return r}function Lw(e,n,r){if(r.size===0)return[...e];let i=/* @__PURE__ */ new Set;for(let n of e)i.add(n.node.item.key);let a=Symbol(`end`),o=/* @__PURE__ */ new Map,s=a;for(let e=n.length-1;e>=0;e--){let a=n[e];if(i.has(a)){s=a;continue}let c=r.get(a);if(!c)continue;let l=o.get(s);l?l.push(c):o.set(s,[c])}let c=[];for(let n of e){let e=o.get(n.node.item.key);if(e)for(let n=e.length-1;n>=0;n--)c.push(e[n]);c.push(n)}let l=o.get(a);if(l)for(let e=l.length-1;e>=0;e--)c.push(l[e]);return c}function Rw(e,n){let r=/* @__PURE__ */ new Map;if(!e.children)return r;let i=[];for(let a of e.children)for(i.push({node:a,next:0,checked:0,unchecked:0,counted:0});i.length>0;){let e=i[i.length-1],{node:a}=e,o=a.children,s=a.item.isLeaf||!o?.length;if(!s&&e.next<o.length){i.push({node:o[e.next++],next:0,checked:0,unchecked:0,counted:0});continue}i.pop();let c;c=s?n.has(a)?`checked`:`unchecked`:e.counted===0?`unchecked`:e.checked===e.counted?`checked`:e.unchecked===e.counted?`unchecked`:`indeterminate`,r.set(a.item.key,c);let l=s&&a.item.selectable===!1;if(i.length>0&&!l){let e=i[i.length-1];e.counted++,c===`checked`?e.checked++:c===`unchecked`&&e.unchecked++}}return r}function zw(e,n){if(e.has(n))return e;let r=new Set(e);return r.add(n),r}function Bw(e,n){if(!e.has(n))return e;let r=new Set(e);return r.delete(n),r}function Vw(e,n){let r;for(let i of e)n(i)&&(r??=new Set(e),r.delete(i));return r??e}function Hw(e){return Math.max(1,e.rowHeight+e.gap)}function Uw(e,n){return e.listOffset+n*Hw(e)+e.gap}function Ww(e,n){return Uw(e,n)+e.rowHeight}function Gw(e,n,r=5){let{count:i}=e;if(i<=0)return{start:0,end:0};let a=Hw(e),o=Math.max(0,n-e.listOffset),s=Math.floor(o/a),c=Math.ceil((o+e.viewportHeight)/a),l=Math.min(i,Math.max(0,s-r));return{start:l,end:Math.min(i,Math.max(l,c+r))}}function Kw(e,n){if(e.count<=0)return-1;let r=Math.floor((n-e.listOffset)/Hw(e));return Math.min(e.count-1,Math.max(0,r))}function qw(e,n,r,i=0){if(n<0||n>=e.count)return r;let a=Uw(e,n),o=a+e.rowHeight;return a<r+i?n===0?0:Math.max(0,a-i):o>r+e.viewportHeight?Math.max(0,o-e.viewportHeight):r}function Jw(e,n,r,i=0){if(n<0||n>=e.count)return r;let a=Uw(e,n),o=a+e.rowHeight;if(a>=r+i&&o<=r+e.viewportHeight)return r;let s=a+e.rowHeight/2-(e.viewportHeight+i)/2;return Math.max(0,s)}function Yw(e){return Math.max(1,Math.floor(e.viewportHeight/Hw(e))-1)}function Xw(e){return{count:e.count,topOf:n=>Uw(e,n),bottomOf:n=>Ww(e,n)}}function Zw(e,n){let r=0,i=e.count;for(;r<i;){let a=r+i>>>1;e.bottomOf(a)>n?i=a:r=a+1}return r}function Qw(e,n,r,i=0){if(e.count===0)return;let a=Math.min(Zw(e,n),e.count-1),o=a,s=e.count;for(;o<s;){let n=o+s>>>1;e.topOf(n)>=r?s=n:o=n+1}let c=Math.max(a,o-1);return{first:Math.max(0,a-i),last:Math.min(e.count-1,c+i)}}function $w(e,n,r,i){let a,o,s=[];for(let i of e)r(i)||(a??=new Set(e),a.delete(i),o??=new Map(n),o.set(i,!0));for(let[c,l]of n)r(c)&&(l&&!i(c)?s.push(c):(o??=new Map(n),o.delete(c),l!==(a??e).has(c)&&(a??=new Set(e),l?a.add(c):a.delete(c))));return{live:a??e,pending:o?lr(o):n,needsLoad:s,changed:a!==void 0||o!==void 0}}function eT(e,n,r,i,a){if(e.size===0&&n.size===0)return{selected:e,pending:n,restored:!1,changed:!1};let o=/* @__PURE__ */ new Set,s=/* @__PURE__ */ new Set,c=!1;for(let n of e){let e=r(n.item.key);e?(o.add(e),e!==n&&(c=!0)):(s.add(n.item.key),c=!0)}let l;for(let e of n){let n=r(e);n&&i(n)?(o.add(n),l=n,c=!0):s.add(e)}if(!c)return{selected:e,pending:n,restored:!1,changed:!1};let u=o,d=s;return a&&o.size>0&&(u=/* @__PURE__ */ new Set([l??[...o].at(-1)]),d=O),{selected:u,pending:cr(d),restored:l!==void 0,changed:!0}}function tT(e,n,r,i){let a=n,o=!1;return e!==void 0&&!r(e)&&(a??=e,o=!0),a!==void 0&&i(a)?{clear:o,apply:a,pending:void 0}:{clear:o,apply:void 0,pending:a}}function nT(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):void 0}function rT(e,n,r){if(!e)return{status:`missing`};let i=[],a=e;for(let e of n){if(a.children===void 0)return r(a)?{status:`load`,node:a,depth:i.length-1}:{status:`missing`};let n=a.children.find(n=>n.item.key===e);if(!n)return{status:`missing`};i.push(n),a=n}return{status:`found`,nodes:i}}const iT={rows:[],indexByKey:/* @__PURE__ */ new Map};let J=class extends n{constructor(...e){super(...e),this.exclusivity=`none`,this.selectionFilter=`all`,this.interactionMode=`standard`,this._selectedNodes=/* @__PURE__ */ new Set,this.disableKeyboardNavigation=!1,this.scrollHoverTickle=!1,this.registry=void 0,this.itemDnd=`none`,this.dndExpandHoverMs=500,this.reorderable=!0,this.stickyHeaders=!0,this.virtualize=`auto`,this.virtualizeThreshold=200,this.animation=`auto`,this.applyInternalDrop=!0,this._expandedKeys=/* @__PURE__ */ new Set,this.restoreLoads=!0,this.#t=new cy(this,{kind:`tree-list`,capture:()=>this.getViewState()}),this.#n=ar,this.#r=O,this.#o=-1,this.#d=0,this._selectionVersion=0,this._scrollTop=0,this.#g={rowHeight:30,gap:1,listOffset:0},this.#_=0,this.#v=0,this.#x=0,this.#S=0,this.#C=!1,this.#k=()=>{this.#v===0&&(this.#v=requestAnimationFrame(()=>{this.#v=0,this.#A()}))},this.tickled=new oe(this,{getItems:()=>this.#m().rows.map(({node:e})=>({id:e.item.key,enabled:!0})),hoverDisabled:()=>this.#re?.isDragging===!0||this.#ie?.isDragging===!0,onStateChange:()=>{this.setAttribute(`data-input-mode`,this.tickled.inputMode)}}),this.#F=Cr({host:this,enabled:()=>!this.scrollHoverTickle,onResume:(e,n)=>{let r=(this.shadowRoot?.elementFromPoint?.(e,n)?.closest(`li.item`))?.dataset.key,i=this.#m(),a=r===void 0?void 0:i.indexByKey.get(r),o=a===void 0?void 0:i.rows[a];o&&this._handleRowPointerEnter(o.node,o.depth)}}),this._focusedDepth=0,this.search=new Ht(this,{adapter:Gt(this,{labelSelector:`.tree-label`,highlightKey:`incr-search-highlight`})}),this.#W={indent:20},this.#G=[],this.#K=[],this.#q=/* @__PURE__ */ new Map,this.#J=/* @__PURE__ */ new Map,this.#Y=/* @__PURE__ */ new Set,this.#X=/* @__PURE__ */ new Map,this.#Z=/* @__PURE__ */ new Map,this.#Q=!1,this.#ee=``,this.#ae=/* @__PURE__ */ new Set,this.#oe=!1,this.#ce=()=>{this.#se=void 0},this.#ue=()=>{this.#be===0&&(this.#be=requestAnimationFrame(()=>{this.#be=0,this.#fe()}))},this._stickyKeys=[],this.#ve=/* @__PURE__ */ new Map,this.#ye=!0,this.#be=0,this.#Se=!1,this.#We=()=>{this.#t.notifyScroll()},this.#et=`user`,this.#tt=!1,this.#wt=0,this.#It=e=>{if(this.search.isOpen)return;let n=this.#m().rows;if(n.length===0)return;if((e.ctrlKey||e.metaKey)&&e.key===`a`){if(e.preventDefault(),this.#at({kind:`all`,keys:[],source:`keyboard`}))return;this.#Je({visibleOnly:!0});return}[`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`,`Home`,`End`,`PageUp`,`PageDown`,`Enter`,` `].includes(e.key)&&this.tickled.setInputMode(`keyboard`);let r=this.#jt();switch(e.key){case`ArrowDown`:e.preventDefault(),this.#Ft(n,r,Math.min(r+1,n.length-1),e.shiftKey);break;case`ArrowUp`:e.preventDefault(),this.#Ft(n,r,Math.max(r-1,0),e.shiftKey);break;case`Home`:e.preventDefault(),this.#Ft(n,r,0,e.shiftKey);break;case`End`:e.preventDefault(),this.#Ft(n,r,n.length-1,e.shiftKey);break;case`PageDown`:{e.preventDefault();let i=this.#Pt();this.#Ft(n,r,Math.min(r+i,n.length-1),e.shiftKey);break}case`PageUp`:{e.preventDefault();let i=this.#Pt();this.#Ft(n,r,Math.max(r-i,0),e.shiftKey);break}case`ArrowRight`:{e.preventDefault();let i=n[r];i&&i.node.item.isLeaf!==!0&&(this._expandedKeys.has(i.node.item.key)?r+1<n.length&&this.#Mt(r+1):this.#ht(i.node,i.depth)),this.requestUpdate();break}case`ArrowLeft`:{e.preventDefault();let i=n[r];if(i&&this._expandedKeys.has(i.node.item.key))this.#e(Bw(this._expandedKeys,i.node.item.key)),this.dispatchEvent(new CustomEvent(`collapse`,{detail:{node:i.node,depth:i.depth},bubbles:!0,composed:!0}));else if(i.depth>0){let e=i.depth-1;for(let i=r-1;i>=0;i--)if(n[i].depth===e){this.#Mt(i);break}}this.requestUpdate();break}case`Enter`:{e.preventDefault();let i=n[r];i&&(this.interactionMode!==`manual`&&this.interactionMode!==`checked`&&(this.#st(i.node,`keyboard`,!1),this.requestUpdate()),this.dispatchEvent(new CustomEvent(`activate`,{detail:{node:i.node,depth:i.depth},bubbles:!0,composed:!0})),this.requestUpdate());break}case` `:{e.preventDefault();let i=n[r];if(!i)break;this.interactionMode===`checked`?this._handleCheckboxClick(new MouseEvent(`click`),i.node,i.depth,`keyboard`):(this.interactionMode===`standard`||this.interactionMode===`vscode`||this.interactionMode===`manual`)&&this.#mt(i.node,i.depth);break}case`Escape`:e.preventDefault(),this.#Et()}},this.#Lt=e=>{let n=e.target.closest(`ul.tree-list li`);if(!n)return;let r=n.dataset.key;if(!r)return;let i=this.#m(),a=i.indexByKey.get(r),o=a===void 0?void 0:i.rows[a];if(!o)return;let s={node:o.node,depth:o.depth};this.dispatchEvent(new CustomEvent(`item-dblclick`,{detail:s,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`activate`,{detail:s,bubbles:!0,composed:!0}))}}get selectedNodes(){return this._selectedNodes}#e(e){e!==this._expandedKeys&&(this._expandedKeys=e,this.#c=void 0,this.#ye=!0,this.#t.notify())}#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;invalidateStructure(){this.#d++,this.#c=void 0,this.requestUpdate()}#m(){if(!this.root)return iT;if(this.#c&&this.#l===this.root&&this.#u===this.filterPredicate)return this.#c;let e=this.#P();return this.#c=Pw(this.root,{isExpanded:(e,n)=>this._isExpanded(e,n),isShown:e?n=>e.matches.has(n.item.key):()=>!0}),this.#l=this.root,this.#u=this.filterPredicate,this.#c}#h(){let e=this.root;if(!e)return{parentByKey:/* @__PURE__ */ new Map,depthsWithIcons:/* @__PURE__ */ new Set};let n=this.#f;if(n&&n.root===e&&n.version===this.#d)return n.index;let r=Fw(e);return this.#f={root:e,version:this.#d,index:r},r}#g;#_;#v;#y;#b;#x;#S;#C;#w(){return this.virtualize===`off`?!1:this.virtualize===`on`||this.#m().rows.length>this.virtualizeThreshold}#T(e){return{count:e,rowHeight:this.#g.rowHeight,gap:this.#g.gap,listOffset:this.#g.listOffset,viewportHeight:this.#_>0?this.#_:600}}#E(){let e=this.renderRoot.querySelector(`ul.tree-list`),n=e?.querySelector(`li.item:not(.leaving)`),r=n?.getBoundingClientRect().height??0,i=r>0?r:this.#Me(),a=n?Number.parseFloat(getComputedStyle(n).marginTop):NaN,o=Number.isNaN(a)?Number.parseFloat(getComputedStyle(this).getPropertyValue(`--tree-item-gap`)):a,s=Number.isNaN(o)?1:o,c=this.#g.listOffset;if(e){let n=Number.parseFloat(getComputedStyle(e).paddingTop);c=e.offsetTop+(Number.isNaN(n)?0:n)}let l=this.#Ae()?.clientHeight??0,u=l>0&&l!==this.#_;l>0&&(this.#_=l);let d=this.#g,f=d.rowHeight!==i||d.gap!==s||d.listOffset!==c;return this.#g={rowHeight:i,gap:s,listOffset:c},f||u}#D(e){return Gw(this.#T(e),this._scrollTop)}#O(){let e=this.#Ae()?.scrollTop;e!==void 0&&e!==this._scrollTop&&(this._scrollTop=e)}#k;#A(){let e=this.#Ae();if(!e||!this.root||!this.#w())return;let n=e.scrollTop;if(n===this._scrollTop)return;let r=Gw(this.#T(this.#m().rows.length),n);(r.start!==this.#x||r.end!==this.#S)&&(this._scrollTop=n)}#j(){let e=this.#Ae();e!==this.#y&&(this.#y?.removeEventListener(`scroll`,this.#k),this.#b?.disconnect(),this.#b=void 0,this.#y=e,e&&(e.addEventListener(`scroll`,this.#k,{passive:!0}),typeof ResizeObserver<`u`&&(this.#b=new ResizeObserver(e=>{let n=e.at(-1)?.contentRect.height??0;n>0&&n!==this.#_&&this.#w()&&this.requestUpdate()}),this.#b.observe(e))))}#M(){this.#y?.removeEventListener(`scroll`,this.#k),this.#y=void 0,this.#b?.disconnect(),this.#b=void 0,this.#v!==0&&(cancelAnimationFrame(this.#v),this.#v=0)}#N(e,n=`edge`){let r=this.#Ae();if(!r)return;let i=this.#T(this.#m().rows.length),a=this.renderRoot.querySelector(`.sticky-headers`)?.getBoundingClientRect().height??0,o=(n===`center-if-hidden`?Jw:qw)(i,e,r.scrollTop,a);(o!==r.scrollTop||o!==this._scrollTop)&&(r.scrollTop=o,this._scrollTop=o)}#P(){let e=this.filterPredicate,n=this.root;if(!e||!n)return;let r=this.#p;if(r&&r.predicate===e&&r.root===n&&r.version===this.#d)return r;let i=Iw(n,e),{parentByKey:a}=this.#h(),o=/* @__PURE__ */ new Set;for(let e of i){let n=a.get(e);n!==void 0&&o.add(n)}let s={predicate:e,root:n,version:this.#d,matches:i,autoExpanded:o};return this.#p=s,s}get _structureVersion(){return this.#d}get _depthsWithIcons(){return this.#h().depthsWithIcons}#F;_handleRowPointerEnter(e,n){this.#F.suppressed()||(this.tickled.handlePointerEnter(e.item.key),this.dispatchEvent(new CustomEvent(`tickle`,{detail:{node:e,depth:n},bubbles:!0,composed:!0})))}#I;#L(){let e=this.searchModes?.trim();if(e===void 0)return[...Bt];let n=new Set(e.split(/\s+/));return Bt.filter(e=>n.has(e))}#R(){this.#U&&(this.search.setModes(this.#L()),this.#I?.(),this.#I=zt(this.#U,this.search))}#z;#B;#V;#H;#U;#W;#G;#K;#q;#J;#Y;#X;#Z;#Q;#$;#ee;#te;#ne;#re;#ie;#ae;#oe;#se;#ce;#le(){let e=this.#Ae();this.stickyHeaders&&e?this.#Se&&this.#xe===e||(this.#xe?.removeEventListener(`scroll`,this.#ue),e.addEventListener(`scroll`,this.#ue,{passive:!0}),this.#xe=e,this.#Se=!0):this.#Se&&=(this.#xe?.removeEventListener(`scroll`,this.#ue),this.#xe=void 0,!1)}#ue;#de(e){return{count:e.length,topOf:n=>e[n].offsetTop,bottomOf:n=>e[n].offsetTop+e[n].offsetHeight}}#fe(){this.#ye=!1;let e=/* @__PURE__ */ new Map,n=()=>this.#pe([],e);if(!this.stickyHeaders||!this.root)return n();let r=this.#Ae(),i=this.renderRoot.querySelector(`ul.tree-list`);if(!r||!i)return n();let a=this.#m(),o=this.#w(),s=i.children,c=this.#K;if(a.rows.length===0||!o&&(s.length===0||s.length!==c.length))return n();let l=o?Xw(this.#T(a.rows.length)):this.#de(s),u=r.scrollTop,d=u+(this.renderRoot.querySelector(`.sticky-headers`)?.getBoundingClientRect().height??0),f=Zw(l,u);if(!o)for(;f<s.length&&s[f].classList.contains(`leaving`);)f++;if(f>=l.count)return n();let p=o?f:a.indexByKey.get(c[f]);if(p===void 0)return n();let m=[],h=a.rows[p].parentKey;for(;h!==void 0;){let e=a.indexByKey.get(h);if(e===void 0)break;m.unshift(a.rows[e]),h=a.rows[e].parentKey}let g=/* @__PURE__ */ new Map,_=[];for(let e of m){let n=e.node.item.key,r=o?a.indexByKey.get(n):this.#q.get(n);r===void 0||l.bottomOf(r)>d||(_.push(n),g.set(n,{node:e.node,depth:e.depth}))}this.#pe(_,g)}#pe(e,n){let r=this._stickyKeys;r.length===e.length&&r.every((n,r)=>n===e[r])||(this.#ve=n,this._stickyKeys=e)}#me(){return!this.stickyHeaders||this._stickyKeys.length===0?a:i`
|
|
8285
8286
|
<div class="sticky-anchor">
|
|
8286
8287
|
<div class="sticky-headers" part="sticky-headers">
|
|
8287
8288
|
${this._stickyKeys.map(e=>{let n=this.#ve.get(e);return n?this.#he(n.node,n.depth):a})}
|
|
@@ -8577,7 +8578,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
8577
8578
|
:host([data-drop-rejected]) {
|
|
8578
8579
|
cursor: not-allowed;
|
|
8579
8580
|
}
|
|
8580
|
-
`]}};E([d({type:Object})],
|
|
8581
|
+
`]}};E([d({type:Object})],J.prototype,`root`,void 0),E([d({attribute:!1})],J.prototype,`model`,void 0),E([d({attribute:!1})],J.prototype,`loadChildren`,void 0),E([d({reflect:!0,attribute:`exclusivity`})],J.prototype,`exclusivity`,void 0),E([d({reflect:!0,attribute:`selection-filter`})],J.prototype,`selectionFilter`,void 0),E([d({type:String,attribute:`interaction-mode`})],J.prototype,`interactionMode`,void 0),E([d({attribute:!1})],J.prototype,`selectedNode`,void 0),E([m()],J.prototype,`_selectedNodes`,void 0),E([d({attribute:!1})],J.prototype,`filterPredicate`,void 0),E([d({type:Boolean,attribute:`disable-keyboard-navigation`})],J.prototype,`disableKeyboardNavigation`,void 0),E([d({type:Boolean,attribute:`scroll-hover-tickle`,reflect:!0})],J.prototype,`scrollHoverTickle`,void 0),E([d({attribute:!1})],J.prototype,`registry`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],J.prototype,`searchModes`,void 0),E([d({reflect:!0,attribute:`item-dnd`})],J.prototype,`itemDnd`,void 0),E([d({type:String,attribute:`accept-drop-types`})],J.prototype,`acceptDropTypes`,void 0),E([d({type:Number,attribute:`dnd-expand-hover-ms`})],J.prototype,`dndExpandHoverMs`,void 0),E([d({reflect:!0,attribute:`reorderable`,converter:{fromAttribute:e=>e!==`false`,toAttribute:e=>e?null:`false`}})],J.prototype,`reorderable`,void 0),E([d({reflect:!0,attribute:`sticky-headers`,converter:{fromAttribute:e=>e!==`false`,toAttribute:e=>e?null:`false`}})],J.prototype,`stickyHeaders`,void 0),E([d({reflect:!0,attribute:`virtualize`})],J.prototype,`virtualize`,void 0),E([d({type:Number,attribute:`virtualize-threshold`})],J.prototype,`virtualizeThreshold`,void 0),E([d({reflect:!0,attribute:`animation`})],J.prototype,`animation`,void 0),E([d({attribute:!1})],J.prototype,`dragPreviewRenderer`,void 0),E([d({attribute:!1})],J.prototype,`dragPreviewSource`,void 0),E([d({attribute:!1})],J.prototype,`canDrag`,void 0),E([d({attribute:!1})],J.prototype,`canDrop`,void 0),E([d({attribute:!1})],J.prototype,`parseExternalDrop`,void 0),E([d({attribute:!1})],J.prototype,`applyInternalDrop`,void 0),E([m()],J.prototype,`_expandedKeys`,void 0),E([d({attribute:!1})],J.prototype,`restoreLoads`,void 0),E([m()],J.prototype,`_scrollTop`,void 0),E([m()],J.prototype,`_focusedDepth`,void 0),E([m()],J.prototype,`_stickyKeys`,void 0),J=E([T(`ixfx-tree-base`)],J);let aT=class extends J{constructor(...e){super(...e),this.alignCheckboxes=!1,this._partialKeys=/* @__PURE__ */ new Set}get partialKeys(){return this._partialKeys}set partialKeys(e){let n=new Set(e);br(n,this._partialKeys)||(this._partialKeys=n)}#e;willUpdate(e){super.willUpdate(e),this.#t()}#t(){let e=this.root;if(this.interactionMode!==`checked`||!e){this.#e=void 0;return}let n=this.#e;n&&n.root===e&&n.structureVersion===this._structureVersion&&n.selectionVersion===this._selectionVersion||(this.#e={root:e,structureVersion:this._structureVersion,selectionVersion:this._selectionVersion,states:Rw(e,this._selectedNodes)})}renderNodeContent(e,n){let r=e.item.isLeaf!==!0,o=this._isExpanded(e,n),s=e.item.icon,c=e.item.tooltip,l=i`
|
|
8581
8582
|
<span class="tree-caret">
|
|
8582
8583
|
${r?i`<ixfx-icon class="caret-icon" name="chevron-down" .rotate=${o?a:`-90deg`}></ixfx-icon>`:``}
|
|
8583
8584
|
</span>
|
|
@@ -8631,7 +8632,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
8631
8632
|
${this.renderNodeContent(e,n)}
|
|
8632
8633
|
${u?this.renderLoadingIndicator():a}
|
|
8633
8634
|
</li>
|
|
8634
|
-
`}static{this.styles=[w,...
|
|
8635
|
+
`}static{this.styles=[w,...J.styles,r`
|
|
8635
8636
|
.tree-caret {
|
|
8636
8637
|
display: inline-flex;
|
|
8637
8638
|
align-items: center;
|
|
@@ -9245,7 +9246,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
9245
9246
|
data-from=${e.fromKey}
|
|
9246
9247
|
data-to=${e.toKey}
|
|
9247
9248
|
style="--edge-weight: ${e.weightNormalized};${wD(e.toId,n)}"
|
|
9248
|
-
/>`}function HD(e,n,r,i){return _(e,e=>`${e.fromId}->${e.toId}`,e=>{let a=n.get(e.fromId)?.node,o=n.get(e.toId)?.node;return i&&a&&o?s`<g transform="scale(${500})">${i({edge:e,fromNode:a,toNode:o})}</g>`:VD(e,r)})}let J=class extends n{constructor(...e){super(...e),this.exclusivity=`none`,this.selectionFilter=`all`,this.interactionMode=`standard`,this.maxRadius=4,this.nodeShape=`dot`,this.boxMaxChars=24,this.minLabelSize=9,this.colorByBranch=!1,this.nodeRadius=.05,this.minNodeRadius=.015,this.minWeightScale=.6,this.maxWeightScale=1.6,this.zoom=1,this.disableZoomGestures=!1,this.disableRadialLabels=!1,this.disableChildPreview=!1,this.curvature=1,this.siblingSpacing=zE,this.focusAnimationDuration=400,this._selectedNodes=/* @__PURE__ */ new Set,this.disableKeyboardNavigation=!1,this.registry=void 0,this._focusId=void 0,this.restoreLoads=!0,this.#e=$E({controller:new cy(this,{kind:`hyperbolictree-list`,capture:()=>this.getViewState()}),root:()=>this.#u,focusId:()=>this._focusId,setCenter:(e,n)=>this.#E(e,n),selected:()=>this._selectedNodes,selectedNode:()=>this.selectedNode,canSelect:e=>this.#y(e),singleSelect:()=>this.interactionMode===`implicit`,setSelection:(e,n,r)=>{let i=this._selectedNodes;this._selectedNodes=new Set(e),this.selectedNode=n,r&&this.#x(i)},tickled:()=>this.tickled.tickledId,setTickled:e=>e===void 0?this.tickled.clearTickled():this.tickled.setTickled(e),visibleIdOf:e=>this.#d().nodes.find(n=>n.key===e)?.id,zoom:()=>this.zoom,setZoom:e=>{this.zoom=e},restoreLoads:()=>this.restoreLoads,load:(e,n)=>this.#n.loadOne(e,n)}),this._viewOverride=void 0,this._focusRotation=0,this._zoomOffset={x:0,y:0},this._previewId=void 0,this.#t=HT({candidate:e=>{let n=this.#d().nodes,r=e===void 0||this.disableChildPreview?void 0:n.find(n=>n.id===e);return r&&!this.#l.isDragging()&&zT(r,n,this.#r)?r.id:void 0},currentId:()=>this._previewId,setPreviewId:e=>{this._previewId=e}}),this.#n=iD(()=>({model:this.model,loadChildren:this.loadChildren}),()=>{this.#e.invalidate(),this.requestUpdate()}),this.#r=/* @__PURE__ */ new Set,this.search=new Ht(this,{adapter:Gt(this,{labelSelector:`.hyperbolictree-label`,highlightKey:`incr-search-highlight`})}),this.tickled=new oe(this,{getItems:()=>this.#d().nodes.map(e=>({id:e.id,enabled:!0})),onStateChange:()=>{this.setAttribute(`data-input-mode`,this.tickled.inputMode)},onTickle:e=>{if(this.#t.update(e),e===void 0)return;let n=this.#d().nodes.find(n=>n.id===e);n&&this.dispatchEvent(new CustomEvent(`tickle`,{detail:{node:n.node,depth:n.depth},bubbles:!0,composed:!0}))}}),this._hostSize={width:0,height:0},this.#l=EE({svgRect:()=>this.renderRoot.querySelector(`svg.hyperbolictree`)?.getBoundingClientRect(),onDragStart:()=>this.#t.hide(),takeView:()=>{let e=this.#p();return this.#S(),this._viewOverride=e,e},setView:e=>{this._viewOverride=e},zoomState:()=>this.#j(),setZoomState:e=>{e.zoom!==this.zoom&&this.#e.notify(),this.zoom=e.zoom,this._zoomOffset=e.offset},zoomGesturesEnabled:()=>!this.disableZoomGestures,hasFocus:()=>this.renderRoot.activeElement!==null,focusTree:()=>this.#M()})}static{this.shadowRootOptions={...n.shadowRootOptions,delegatesFocus:!0}}get selectedNodes(){return this._selectedNodes}get focusedNode(){return this._focusId===void 0?this.#u:jE(this.#u,this._focusId)?.at(-1)??this.#u}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;get#u(){return this.model?.root??this.root}#d(){return KE(this.#u,{focusedKey:this._focusId,maxRadius:this.maxRadius,curvature:this.curvature,siblingSpacing:this.siblingSpacing,view:this.#p()})}get#f(){return this.#u?.item.key}#p(){return this._viewOverride??uE(this._focusRotation)}#m(e,n){let r=VE(this.#u,24,this.curvature,this.siblingSpacing),i=n===void 0?void 0:WE(r,n,e);return i?sE(this.#p(),i):uE(this._focusRotation)}#h(e){let n=this.#u,r=ME(n,e);if(r!==void 0)return r;let i=PE(n,e.item.key);return i?ME(n,i):void 0}connectedCallback(){super.connectedCallback(),this.setAttribute(`data-input-mode`,`mouse`);let e=this.#a=Xt();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.#_(),typeof ResizeObserver==`function`&&(this.#c=new ResizeObserver(([e])=>{let{width:n,height:r}=e.contentRect;this._hostSize={width:n,height:r}}),this.#c.observe(this))}disconnectedCallback(){super.disconnectedCallback(),this.#c?.disconnect(),this.#c=void 0,this.#i?.(),this.#i=void 0,this.#t.dispose(),this.#n.abortAll(),this.#s!==void 0&&(cancelAnimationFrame(this.#s),this.#s=void 0),this.#a&&(this.#a.unregister(`select-all`),this.#a.unregister(`deselect-all`),this.#a=void 0,this.registry=void 0)}#g(){let e=this.searchModes?.trim();if(e===void 0)return[...Bt];let n=new Set(e.split(/\s+/));return Bt.filter(e=>n.has(e))}#_(){this.#a&&(this.search.setModes(this.#g()),this.#o?.(),this.#o=zt(this.#a,this.search))}willUpdate(e){(e.has(`root`)&&this.root||e.has(`model`))&&this.#v(),this.#e.reconcileIfNeeded(this._focusId!==void 0&&!jE(this.#u,this._focusId))}updated(e){e.has(`model`)&&(this.#i?.(),this.#i=void 0,this.model&&(this.#i=this.model._subscribe(e=>{e.type===`root`?this.#v():e.type===`invalidate`&&this.#e.invalidate(),this.requestUpdate()}))),e.has(`interactionMode`)&&e.get(`interactionMode`)!==void 0&&this.clearSelection(),e.has(`searchModes`)&&this.#_(),this.#n.ensure(this.#d().nodes),this.#e.continueRestoreLoads()}#v(){this._previewId=void 0,this.#l.cancel(),this.#e.invalidate()}#y(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}#b(){this._selectedNodes.clear(),this.selectedNode=void 0}#x(e){this.#e.selectionChanged(),this.dispatchEvent(new CustomEvent(`select`,{detail:{selected:new Set(this._selectedNodes),previous:e},bubbles:!0,composed:!0}))}select(e){if(!this.#y(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.clear(),this._selectedNodes.add(e),this.selectedNode=e,this.#x(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.#x(n),this.requestUpdate()}clearSelection(){if(this.#e.clearPendingSelection(),this._selectedNodes.size===0)return;let e=new Set(this._selectedNodes);this.#b(),this.#x(e),this.requestUpdate()}selectAll(){let e=new Set(this._selectedNodes);for(let e of this.#d().nodes)this.#y(e.node)&&this._selectedNodes.add(e.node);this.selectedNode=[...this._selectedNodes].at(-1),this.#x(e),this.requestUpdate()}deselectAll(){let e=new Set(this._selectedNodes);this.#b(),this.#x(e),this.requestUpdate()}selectMany(e){let n=new Set(this._selectedNodes);this._selectedNodes=new Set([...e].filter(e=>this.#y(e))),this.selectedNode=[...this._selectedNodes].at(-1),this.#x(n),this.requestUpdate()}focusOn(e){let n=this.#u,r=this.#h(e),i=this._focusId??this.#f;if(r===void 0||i===r)return;let a=jE(n,r)?.at(-1)??e,o=i===void 0?void 0:jE(n,i)?.at(-1),s=this.#m(r,i);this._focusId=r,this.#e.centred(r),this.#l.cancel(),this._previewId=void 0,this.#C(s),this.dispatchEvent(new CustomEvent(`focus`,{detail:{node:a,previous:o},bubbles:!0,composed:!0})),o&&i!==void 0&&(AE(r,i)?this.dispatchEvent(new CustomEvent(`expand`,{detail:{node:a,depth:OE(r)},bubbles:!0,composed:!0})):AE(i,r)&&this.dispatchEvent(new CustomEvent(`collapse`,{detail:{node:o,depth:OE(i)},bubbles:!0,composed:!0}))),this.requestUpdate()}#S(){this.#s!==void 0&&(cancelAnimationFrame(this.#s),this.#s=void 0)}#C(e){this.#S();let{viewAt:n,settledRotation:r}=yE(e);this._focusRotation=r;let i=this._zoomOffset;if(this.focusAnimationDuration<=0||_E()||typeof requestAnimationFrame!=`function`){this._viewOverride=void 0,this._zoomOffset={x:0,y:0};return}let a=performance.now(),o=this.focusAnimationDuration,s=e=>{let r=Math.min(1,(e-a)/o),c=1-gE(r);this._zoomOffset={x:i.x*c,y:i.y*c},this._viewOverride=r>=1?void 0:n(r),this.#s=r<1?requestAnimationFrame(s):void 0};this.#s=requestAnimationFrame(s)}#w(e){this.focusOn(e);let n=this.#h(e);n!==void 0&&this.#T(n,e),this.interactionMode===`implicit`&&this.select(e)}navigateTo(e){let n=this.#u;if(!n?.children)return!1;let r=n;for(let n of e){let e=r.children?.find(e=>e.item.key===n);if(!e)return!1;r=e}this.focusOn(r),this.select(r);let i=this.#h(r);return i!==void 0&&this.tickled.setTickled(i),this.requestUpdate(),!0}navigateToNode(e){let n=this.#u;if(!n?.children)return!1;let r=NE(n.children,e);return r?this.navigateTo(r):!1}revealKey(e){let n=PE(this.#u,e),r=n?this.#h(n):void 0;return!n||r===void 0?!1:(this.#d().nodes.some(e=>e.id===r)||this.focusOn(n),this.#T(r,n),this.requestUpdate(),!0)}#T(e,n){this.tickled.setTickled(e),this.#e.keyboardCursorMoved(e,n.item.key)}getNodes(){return this.#d().nodes.map(e=>({node:e.node,depth:e.depth}))}getViewState(e){return this.#e.get(e)}setViewState(e){this.#e.set(e),this.requestUpdate()}clearPendingViewState(){this.#e.clearPending()}#E(e,n){let r=this.focusedNode;if(this.#S(),this._focusId=e,this._viewOverride=void 0,this._zoomOffset={x:0,y:0},!n){this._focusRotation=0;return}let i=this.focusedNode;i&&this.dispatchEvent(new CustomEvent(`focus`,{detail:{node:i,previous:r},bubbles:!0,composed:!0}))}#D(e,n){return!this.filterPredicate||this.filterPredicate(e,n)?!0:e.children?.some(e=>this.#D(e,n+1))??!1}#O(e,n){if(this.dispatchEvent(new CustomEvent(`item-click`,{detail:{node:e.node,depth:e.depth},bubbles:!0,composed:!0})),this.interactionMode===`standard`&&(n.ctrlKey||n.metaKey)){if(this._selectedNodes.has(e.node))this.deselect(e.node);else if(this.#y(e.node)){let n=new Set(this._selectedNodes);this._selectedNodes.add(e.node),this.selectedNode=e.node,this.#x(n),this.requestUpdate()}}else this.interactionMode!==`manual`&&this.select(e.node);this.tickled.setTickled(e.id),this.focusOn(e.node)}#k(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}))}#A(e){let n=this.#u;if(this.disableKeyboardNavigation||!n)return;if(e.key===`Escape`&&this._previewId!==void 0){e.preventDefault(),this._previewId=void 0;return}let{action:r,handled:i}=rD(e.key,n,this._focusId??n.item.key,this.#d().nodes);i&&e.preventDefault(),r.kind===`focus`?this.#w(r.node):r.kind===`activate`&&(this.interactionMode!==`manual`&&this.select(r.node),this.dispatchEvent(new CustomEvent(`activate`,{detail:{node:r.node,depth:r.depth},bubbles:!0,composed:!0})))}#j(){return xE({zoom:this.zoom,offset:this._zoomOffset})}#M(){this.renderRoot.querySelector(`svg.hyperbolictree`)?.focus({preventScroll:!0})}#N(e){this.#t.hide(),this.interactionMode!==`manual`&&this.select(e);let n=this.#h(e);n!==void 0&&this.tickled.setTickled(n),this.focusOn(e),this.#M()}#P(e){let n=this._previewId===void 0||this.disableChildPreview?void 0:e.find(e=>e.id===this._previewId);if(!n)return;let{width:r,height:i}=this._hostSize,a=BT(n.position,this.#j(),r||420,i||420),o=n.parentId===void 0?void 0:e.find(e=>e.id===n.parentId)?.node;return{node:n.node,anchor:a,side:RT(a,r||420,i||420),parent:o}}#F(e,n){return jD(e,{nodeShape:this.nodeShape,radialLabels:!this.disableRadialLabels,zoom:this.#j().zoom,font:SD(this,Math.min(this._hostSize.width,this._hostSize.height),this.zoom),branches:n,boxMaxChars:this.boxMaxChars,minLabelSize:this.minLabelSize,nodeRadius:this.nodeRadius,minNodeRadius:this.minNodeRadius,minWeightScale:this.minWeightScale,maxWeightScale:this.maxWeightScale,isSelected:e=>this._selectedNodes.has(e),isTickled:e=>this.tickled.isTickled(e)})}#I(e,n){return BD(e,this.nodeShape,{ctx:n,state:{isSelected:e=>this._selectedNodes.has(e),isTickled:e=>this.tickled.isTickled(e),showTitle:e=>this.disableChildPreview||!e.node.children?.length,isFiltered:e=>!this.#D(e.node,e.depth),isPending:e=>this.#n.isPending(e)},handlers:{onClick:(e,n)=>{n.stopPropagation(),this.#l.wasDragged()||this.#O(e,n)},onDblClick:(e,n)=>{n.stopPropagation(),this.#l.wasDragged()||this.#k(e)},onPointerEnter:e=>this.tickled.handlePointerEnter(e)}})}render(){let{nodes:e,edges:n}=this.#d(),r=new Map(e.map(e=>[e.id,e])),a=CD(this.#u),o=this.#F(e,a);this.#r=o.labelIds;let{zoom:s,offset:c}=this.#j(),l=c.x===0&&c.y===0?``:`translate(${c.x*500} ${c.y*500}) `;return i`
|
|
9249
|
+
/>`}function HD(e,n,r,i){return _(e,e=>`${e.fromId}->${e.toId}`,e=>{let a=n.get(e.fromId)?.node,o=n.get(e.toId)?.node;return i&&a&&o?s`<g transform="scale(${500})">${i({edge:e,fromNode:a,toNode:o})}</g>`:VD(e,r)})}let Y=class extends n{constructor(...e){super(...e),this.exclusivity=`none`,this.selectionFilter=`all`,this.interactionMode=`standard`,this.maxRadius=4,this.nodeShape=`dot`,this.boxMaxChars=24,this.minLabelSize=9,this.colorByBranch=!1,this.nodeRadius=.05,this.minNodeRadius=.015,this.minWeightScale=.6,this.maxWeightScale=1.6,this.zoom=1,this.disableZoomGestures=!1,this.disableRadialLabels=!1,this.disableChildPreview=!1,this.curvature=1,this.siblingSpacing=zE,this.focusAnimationDuration=400,this._selectedNodes=/* @__PURE__ */ new Set,this.disableKeyboardNavigation=!1,this.registry=void 0,this._focusId=void 0,this.restoreLoads=!0,this.#e=$E({controller:new cy(this,{kind:`hyperbolictree-list`,capture:()=>this.getViewState()}),root:()=>this.#u,focusId:()=>this._focusId,setCenter:(e,n)=>this.#E(e,n),selected:()=>this._selectedNodes,selectedNode:()=>this.selectedNode,canSelect:e=>this.#y(e),singleSelect:()=>this.interactionMode===`implicit`,setSelection:(e,n,r)=>{let i=this._selectedNodes;this._selectedNodes=new Set(e),this.selectedNode=n,r&&this.#x(i)},tickled:()=>this.tickled.tickledId,setTickled:e=>e===void 0?this.tickled.clearTickled():this.tickled.setTickled(e),visibleIdOf:e=>this.#d().nodes.find(n=>n.key===e)?.id,zoom:()=>this.zoom,setZoom:e=>{this.zoom=e},restoreLoads:()=>this.restoreLoads,load:(e,n)=>this.#n.loadOne(e,n)}),this._viewOverride=void 0,this._focusRotation=0,this._zoomOffset={x:0,y:0},this._previewId=void 0,this.#t=HT({candidate:e=>{let n=this.#d().nodes,r=e===void 0||this.disableChildPreview?void 0:n.find(n=>n.id===e);return r&&!this.#l.isDragging()&&zT(r,n,this.#r)?r.id:void 0},currentId:()=>this._previewId,setPreviewId:e=>{this._previewId=e}}),this.#n=iD(()=>({model:this.model,loadChildren:this.loadChildren}),()=>{this.#e.invalidate(),this.requestUpdate()}),this.#r=/* @__PURE__ */ new Set,this.search=new Ht(this,{adapter:Gt(this,{labelSelector:`.hyperbolictree-label`,highlightKey:`incr-search-highlight`})}),this.tickled=new oe(this,{getItems:()=>this.#d().nodes.map(e=>({id:e.id,enabled:!0})),onStateChange:()=>{this.setAttribute(`data-input-mode`,this.tickled.inputMode)},onTickle:e=>{if(this.#t.update(e),e===void 0)return;let n=this.#d().nodes.find(n=>n.id===e);n&&this.dispatchEvent(new CustomEvent(`tickle`,{detail:{node:n.node,depth:n.depth},bubbles:!0,composed:!0}))}}),this._hostSize={width:0,height:0},this.#l=EE({svgRect:()=>this.renderRoot.querySelector(`svg.hyperbolictree`)?.getBoundingClientRect(),onDragStart:()=>this.#t.hide(),takeView:()=>{let e=this.#p();return this.#S(),this._viewOverride=e,e},setView:e=>{this._viewOverride=e},zoomState:()=>this.#j(),setZoomState:e=>{e.zoom!==this.zoom&&this.#e.notify(),this.zoom=e.zoom,this._zoomOffset=e.offset},zoomGesturesEnabled:()=>!this.disableZoomGestures,hasFocus:()=>this.renderRoot.activeElement!==null,focusTree:()=>this.#M()})}static{this.shadowRootOptions={...n.shadowRootOptions,delegatesFocus:!0}}get selectedNodes(){return this._selectedNodes}get focusedNode(){return this._focusId===void 0?this.#u:jE(this.#u,this._focusId)?.at(-1)??this.#u}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;get#u(){return this.model?.root??this.root}#d(){return KE(this.#u,{focusedKey:this._focusId,maxRadius:this.maxRadius,curvature:this.curvature,siblingSpacing:this.siblingSpacing,view:this.#p()})}get#f(){return this.#u?.item.key}#p(){return this._viewOverride??uE(this._focusRotation)}#m(e,n){let r=VE(this.#u,24,this.curvature,this.siblingSpacing),i=n===void 0?void 0:WE(r,n,e);return i?sE(this.#p(),i):uE(this._focusRotation)}#h(e){let n=this.#u,r=ME(n,e);if(r!==void 0)return r;let i=PE(n,e.item.key);return i?ME(n,i):void 0}connectedCallback(){super.connectedCallback(),this.setAttribute(`data-input-mode`,`mouse`);let e=this.#a=Xt();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.#_(),typeof ResizeObserver==`function`&&(this.#c=new ResizeObserver(([e])=>{let{width:n,height:r}=e.contentRect;this._hostSize={width:n,height:r}}),this.#c.observe(this))}disconnectedCallback(){super.disconnectedCallback(),this.#c?.disconnect(),this.#c=void 0,this.#i?.(),this.#i=void 0,this.#t.dispose(),this.#n.abortAll(),this.#s!==void 0&&(cancelAnimationFrame(this.#s),this.#s=void 0),this.#a&&(this.#a.unregister(`select-all`),this.#a.unregister(`deselect-all`),this.#a=void 0,this.registry=void 0)}#g(){let e=this.searchModes?.trim();if(e===void 0)return[...Bt];let n=new Set(e.split(/\s+/));return Bt.filter(e=>n.has(e))}#_(){this.#a&&(this.search.setModes(this.#g()),this.#o?.(),this.#o=zt(this.#a,this.search))}willUpdate(e){(e.has(`root`)&&this.root||e.has(`model`))&&this.#v(),this.#e.reconcileIfNeeded(this._focusId!==void 0&&!jE(this.#u,this._focusId))}updated(e){e.has(`model`)&&(this.#i?.(),this.#i=void 0,this.model&&(this.#i=this.model._subscribe(e=>{e.type===`root`?this.#v():e.type===`invalidate`&&this.#e.invalidate(),this.requestUpdate()}))),e.has(`interactionMode`)&&e.get(`interactionMode`)!==void 0&&this.clearSelection(),e.has(`searchModes`)&&this.#_(),this.#n.ensure(this.#d().nodes),this.#e.continueRestoreLoads()}#v(){this._previewId=void 0,this.#l.cancel(),this.#e.invalidate()}#y(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}#b(){this._selectedNodes.clear(),this.selectedNode=void 0}#x(e){this.#e.selectionChanged(),this.dispatchEvent(new CustomEvent(`select`,{detail:{selected:new Set(this._selectedNodes),previous:e},bubbles:!0,composed:!0}))}select(e){if(!this.#y(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.clear(),this._selectedNodes.add(e),this.selectedNode=e,this.#x(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.#x(n),this.requestUpdate()}clearSelection(){if(this.#e.clearPendingSelection(),this._selectedNodes.size===0)return;let e=new Set(this._selectedNodes);this.#b(),this.#x(e),this.requestUpdate()}selectAll(){let e=new Set(this._selectedNodes);for(let e of this.#d().nodes)this.#y(e.node)&&this._selectedNodes.add(e.node);this.selectedNode=[...this._selectedNodes].at(-1),this.#x(e),this.requestUpdate()}deselectAll(){let e=new Set(this._selectedNodes);this.#b(),this.#x(e),this.requestUpdate()}selectMany(e){let n=new Set(this._selectedNodes);this._selectedNodes=new Set([...e].filter(e=>this.#y(e))),this.selectedNode=[...this._selectedNodes].at(-1),this.#x(n),this.requestUpdate()}focusOn(e){let n=this.#u,r=this.#h(e),i=this._focusId??this.#f;if(r===void 0||i===r)return;let a=jE(n,r)?.at(-1)??e,o=i===void 0?void 0:jE(n,i)?.at(-1),s=this.#m(r,i);this._focusId=r,this.#e.centred(r),this.#l.cancel(),this._previewId=void 0,this.#C(s),this.dispatchEvent(new CustomEvent(`focus`,{detail:{node:a,previous:o},bubbles:!0,composed:!0})),o&&i!==void 0&&(AE(r,i)?this.dispatchEvent(new CustomEvent(`expand`,{detail:{node:a,depth:OE(r)},bubbles:!0,composed:!0})):AE(i,r)&&this.dispatchEvent(new CustomEvent(`collapse`,{detail:{node:o,depth:OE(i)},bubbles:!0,composed:!0}))),this.requestUpdate()}#S(){this.#s!==void 0&&(cancelAnimationFrame(this.#s),this.#s=void 0)}#C(e){this.#S();let{viewAt:n,settledRotation:r}=yE(e);this._focusRotation=r;let i=this._zoomOffset;if(this.focusAnimationDuration<=0||_E()||typeof requestAnimationFrame!=`function`){this._viewOverride=void 0,this._zoomOffset={x:0,y:0};return}let a=performance.now(),o=this.focusAnimationDuration,s=e=>{let r=Math.min(1,(e-a)/o),c=1-gE(r);this._zoomOffset={x:i.x*c,y:i.y*c},this._viewOverride=r>=1?void 0:n(r),this.#s=r<1?requestAnimationFrame(s):void 0};this.#s=requestAnimationFrame(s)}#w(e){this.focusOn(e);let n=this.#h(e);n!==void 0&&this.#T(n,e),this.interactionMode===`implicit`&&this.select(e)}navigateTo(e){let n=this.#u;if(!n?.children)return!1;let r=n;for(let n of e){let e=r.children?.find(e=>e.item.key===n);if(!e)return!1;r=e}this.focusOn(r),this.select(r);let i=this.#h(r);return i!==void 0&&this.tickled.setTickled(i),this.requestUpdate(),!0}navigateToNode(e){let n=this.#u;if(!n?.children)return!1;let r=NE(n.children,e);return r?this.navigateTo(r):!1}revealKey(e){let n=PE(this.#u,e),r=n?this.#h(n):void 0;return!n||r===void 0?!1:(this.#d().nodes.some(e=>e.id===r)||this.focusOn(n),this.#T(r,n),this.requestUpdate(),!0)}#T(e,n){this.tickled.setTickled(e),this.#e.keyboardCursorMoved(e,n.item.key)}getNodes(){return this.#d().nodes.map(e=>({node:e.node,depth:e.depth}))}getViewState(e){return this.#e.get(e)}setViewState(e){this.#e.set(e),this.requestUpdate()}clearPendingViewState(){this.#e.clearPending()}#E(e,n){let r=this.focusedNode;if(this.#S(),this._focusId=e,this._viewOverride=void 0,this._zoomOffset={x:0,y:0},!n){this._focusRotation=0;return}let i=this.focusedNode;i&&this.dispatchEvent(new CustomEvent(`focus`,{detail:{node:i,previous:r},bubbles:!0,composed:!0}))}#D(e,n){return!this.filterPredicate||this.filterPredicate(e,n)?!0:e.children?.some(e=>this.#D(e,n+1))??!1}#O(e,n){if(this.dispatchEvent(new CustomEvent(`item-click`,{detail:{node:e.node,depth:e.depth},bubbles:!0,composed:!0})),this.interactionMode===`standard`&&(n.ctrlKey||n.metaKey)){if(this._selectedNodes.has(e.node))this.deselect(e.node);else if(this.#y(e.node)){let n=new Set(this._selectedNodes);this._selectedNodes.add(e.node),this.selectedNode=e.node,this.#x(n),this.requestUpdate()}}else this.interactionMode!==`manual`&&this.select(e.node);this.tickled.setTickled(e.id),this.focusOn(e.node)}#k(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}))}#A(e){let n=this.#u;if(this.disableKeyboardNavigation||!n)return;if(e.key===`Escape`&&this._previewId!==void 0){e.preventDefault(),this._previewId=void 0;return}let{action:r,handled:i}=rD(e.key,n,this._focusId??n.item.key,this.#d().nodes);i&&e.preventDefault(),r.kind===`focus`?this.#w(r.node):r.kind===`activate`&&(this.interactionMode!==`manual`&&this.select(r.node),this.dispatchEvent(new CustomEvent(`activate`,{detail:{node:r.node,depth:r.depth},bubbles:!0,composed:!0})))}#j(){return xE({zoom:this.zoom,offset:this._zoomOffset})}#M(){this.renderRoot.querySelector(`svg.hyperbolictree`)?.focus({preventScroll:!0})}#N(e){this.#t.hide(),this.interactionMode!==`manual`&&this.select(e);let n=this.#h(e);n!==void 0&&this.tickled.setTickled(n),this.focusOn(e),this.#M()}#P(e){let n=this._previewId===void 0||this.disableChildPreview?void 0:e.find(e=>e.id===this._previewId);if(!n)return;let{width:r,height:i}=this._hostSize,a=BT(n.position,this.#j(),r||420,i||420),o=n.parentId===void 0?void 0:e.find(e=>e.id===n.parentId)?.node;return{node:n.node,anchor:a,side:RT(a,r||420,i||420),parent:o}}#F(e,n){return jD(e,{nodeShape:this.nodeShape,radialLabels:!this.disableRadialLabels,zoom:this.#j().zoom,font:SD(this,Math.min(this._hostSize.width,this._hostSize.height),this.zoom),branches:n,boxMaxChars:this.boxMaxChars,minLabelSize:this.minLabelSize,nodeRadius:this.nodeRadius,minNodeRadius:this.minNodeRadius,minWeightScale:this.minWeightScale,maxWeightScale:this.maxWeightScale,isSelected:e=>this._selectedNodes.has(e),isTickled:e=>this.tickled.isTickled(e)})}#I(e,n){return BD(e,this.nodeShape,{ctx:n,state:{isSelected:e=>this._selectedNodes.has(e),isTickled:e=>this.tickled.isTickled(e),showTitle:e=>this.disableChildPreview||!e.node.children?.length,isFiltered:e=>!this.#D(e.node,e.depth),isPending:e=>this.#n.isPending(e)},handlers:{onClick:(e,n)=>{n.stopPropagation(),this.#l.wasDragged()||this.#O(e,n)},onDblClick:(e,n)=>{n.stopPropagation(),this.#l.wasDragged()||this.#k(e)},onPointerEnter:e=>this.tickled.handlePointerEnter(e)}})}render(){let{nodes:e,edges:n}=this.#d(),r=new Map(e.map(e=>[e.id,e])),a=CD(this.#u),o=this.#F(e,a);this.#r=o.labelIds;let{zoom:s,offset:c}=this.#j(),l=c.x===0&&c.y===0?``:`translate(${c.x*500} ${c.y*500}) `;return i`
|
|
9249
9250
|
<svg
|
|
9250
9251
|
class="hyperbolictree"
|
|
9251
9252
|
viewBox="${-525} ${-525} ${1050} ${1050}"
|
|
@@ -9274,7 +9275,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
9274
9275
|
</svg>
|
|
9275
9276
|
${VT(this.#P(e),{onPointerEnter:()=>this.#t.pointerEnter(),onPointerLeave:()=>this.#t.pointerLeave(this.tickled.tickledId),onPick:e=>this.#N(e)})}
|
|
9276
9277
|
${this.search.renderField()}
|
|
9277
|
-
`}static{this.styles=[w,Ut,eD]}};E([d({type:Object})],
|
|
9278
|
+
`}static{this.styles=[w,Ut,eD]}};E([d({type:Object})],Y.prototype,`root`,void 0),E([d({attribute:!1})],Y.prototype,`model`,void 0),E([d({attribute:!1})],Y.prototype,`loadChildren`,void 0),E([d({reflect:!0,attribute:`exclusivity`})],Y.prototype,`exclusivity`,void 0),E([d({reflect:!0,attribute:`selection-filter`})],Y.prototype,`selectionFilter`,void 0),E([d({type:String,attribute:`interaction-mode`})],Y.prototype,`interactionMode`,void 0),E([d({type:Number,attribute:`max-radius`})],Y.prototype,`maxRadius`,void 0),E([d({type:String,attribute:`node-shape`,reflect:!0})],Y.prototype,`nodeShape`,void 0),E([d({type:Number,attribute:`box-max-chars`})],Y.prototype,`boxMaxChars`,void 0),E([d({type:Number,attribute:`min-label-size`})],Y.prototype,`minLabelSize`,void 0),E([d({type:Boolean,attribute:`color-by-branch`,reflect:!0})],Y.prototype,`colorByBranch`,void 0),E([d({type:Number,attribute:`node-radius`})],Y.prototype,`nodeRadius`,void 0),E([d({type:Number,attribute:`min-node-radius`})],Y.prototype,`minNodeRadius`,void 0),E([d({type:Number,attribute:`min-weight-scale`})],Y.prototype,`minWeightScale`,void 0),E([d({type:Number,attribute:`max-weight-scale`})],Y.prototype,`maxWeightScale`,void 0),E([d({type:Number})],Y.prototype,`zoom`,void 0),E([d({type:Boolean,attribute:`disable-zoom-gestures`})],Y.prototype,`disableZoomGestures`,void 0),E([d({type:Boolean,attribute:`disable-radial-labels`})],Y.prototype,`disableRadialLabels`,void 0),E([d({type:Boolean,attribute:`disable-child-preview`})],Y.prototype,`disableChildPreview`,void 0),E([d({type:Number})],Y.prototype,`curvature`,void 0),E([d({type:Number,attribute:`sibling-spacing`})],Y.prototype,`siblingSpacing`,void 0),E([d({type:Number,attribute:`focus-animation-duration`})],Y.prototype,`focusAnimationDuration`,void 0),E([d({attribute:!1})],Y.prototype,`edgeRenderer`,void 0),E([d({attribute:!1})],Y.prototype,`selectedNode`,void 0),E([m()],Y.prototype,`_selectedNodes`,void 0),E([d({attribute:!1})],Y.prototype,`filterPredicate`,void 0),E([d({type:Boolean,attribute:`disable-keyboard-navigation`})],Y.prototype,`disableKeyboardNavigation`,void 0),E([d({attribute:!1})],Y.prototype,`registry`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],Y.prototype,`searchModes`,void 0),E([m()],Y.prototype,`_focusId`,void 0),E([d({attribute:!1})],Y.prototype,`restoreLoads`,void 0),E([m()],Y.prototype,`_viewOverride`,void 0),E([m()],Y.prototype,`_focusRotation`,void 0),E([m()],Y.prototype,`_zoomOffset`,void 0),E([m()],Y.prototype,`_previewId`,void 0),E([m()],Y.prototype,`_hostSize`,void 0),Y=E([T(`ixfx-hyperbolictree-list`)],Y);function UD(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:0}function WD(e,n){if(e){if(e.item.key===n)return e;for(let r of e.children??[]){let e=WD(r,n);if(e)return e}}}function GD(e,n){if(e){if(e.item.key===n)return[e];for(let r of e.children??[]){let i=GD(r,n);if(i)return[e,...i]}}}function KD(e,n){let r=e;for(let e of n){let n=e===r?.item.key?r:r?.children?.find(n=>n.item.key===e);if(!n)return;r=n}return r}function qD(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=qD(i.children,n,e);if(r)return r}}}function JD(e,n={}){if(!e?.children?.length)return[];let{maxDepth:r=1/0,valueAccessor:i=()=>1,zoomKey:a,hideLeaves:o=!1}=n;if(r<=0)return[];let s=a===void 0?e:WD(e,a)??e,c=GD(e,s.item.key),l=c?c.length-2:-1,u=s.children??[];if(u.length===0)return[];let d=e=>e.item.isLeaf===!0||e.children!==void 0&&e.children.length===0,f=[],p=(e,n,a,s,c,l)=>{let u=o?e.filter(e=>!d(e)):e;if(u.length===0||a>=r)return;let m=u.map(e=>UD(i(e.item))),h=m.reduce((e,n)=>e+n,0),g=u.length,_=s;u.forEach((e,r)=>{let i=c*(h>0?m[r]/h:1/g),o=e.children??[];f.push({node:e,depth:n,relativeDepth:a,x:_,width:i,parentKey:l,index:r,setSize:g,hasChildren:o.length>0||e.children===void 0&&e.item.isLeaf!==!0}),o.length>0&&p(o,n+1,a+1,_,i,e.item.key),_+=i})};return p(u,l+1,0,0,1,s.item.key),f}function YD(e){let n=/* @__PURE__ */ new Map,r=e=>{n.has(e.item.key)||n.set(e.item.key,e);for(let n of e.children??[])r(n)};return e&&r(e),n}function XD(e,n,r){let i=rT(e,n,()=>!1);if(i.status===`found`)return i.nodes;let a=n.at(-1);return a!==void 0&&r(a)?GD(e,a)?.slice(1):void 0}function ZD(e){return e.scrollLeft===0?{top:e.scrollTop}:{top:e.scrollTop,left:e.scrollLeft}}function QD(e,n){let r=ry(e,n.top),i=n.left===void 0||ry(e,n.left,`horizontal`);return r&&i}function $D(e,n,r){if(e.length!==0){if(r===`Home`)return e[0];if(r===`End`)return e.at(-1);if([`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`].includes(r)){if(!n)return e[0];switch(r){case`ArrowLeft`:case`ArrowRight`:{let i=r===`ArrowRight`?1:-1,a=e.filter(e=>e.relativeDepth===n.relativeDepth&&e.parentKey===n.parentKey);return a[a.findIndex(e=>e.node.item.key===n.node.item.key)+i]??(i>0?a[0]:a.at(-1))}case`ArrowUp`:return(n.parentKey===void 0?void 0:e.find(e=>e.node.item.key===n.parentKey))??e[0];default:return e.find(e=>e.parentKey===n.node.item.key)}}}}const eO=r`
|
|
9278
9279
|
:host {
|
|
9279
9280
|
--icicletree-band-height: 44px;
|
|
9280
9281
|
--icicletree-band-gap: 2px;
|
|
@@ -11356,7 +11357,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
11356
11357
|
${this.label===``?a:i`<span class="label">${this.label}</span>`}
|
|
11357
11358
|
${this.description===``?a:i`<span class="byline" part="byline">${this.description}</span>`}
|
|
11358
11359
|
</span>`}
|
|
11359
|
-
`}firstUpdated(){this.#n()}#n(){this.dispatchEvent(new CustomEvent(`graph-port-rendered`,{bubbles:!0}))}updated(e){if(e.has(`availability`)&&this.#t(),e.has(`blink`)){let e=TA(this.blink);this.toggleAttribute(`data-blinking`,e!==void 0),e===void 0?this.style.removeProperty(`--_blink-period`):this.style.setProperty(`--_blink-period`,`${Math.round(e*1e3)/1e3}s`)}if(!e.has(`dir`)&&(e.has(`label`)||e.has(`description`))&&this.hasUpdated&&this.#n(),e.has(`label`)||e.has(`description`)){let e=this.description||this.label;e===``?this.removeAttribute(`data-tooltip`):this.setAttribute(`data-tooltip`,e)}}};E([d({type:String,reflect:!0})],EA.prototype,`key`,void 0),E([d({type:String,reflect:!0})],EA.prototype,`dir`,void 0),E([d({type:String,reflect:!0})],EA.prototype,`type`,void 0),E([d({type:Number,reflect:!0})],EA.prototype,`max`,void 0),E([d({type:String,reflect:!0})],EA.prototype,`side`,void 0),E([d({type:String,reflect:!0})],EA.prototype,`label`,void 0),E([d({type:String,reflect:!0})],EA.prototype,`description`,void 0),E([d({type:String,reflect:!0})],EA.prototype,`availability`,void 0),E([d({type:Number,reflect:!0})],EA.prototype,`blink`,void 0),EA=E([T(`ixfx-graph-port`)],EA);const DA=[`n`,`s`,`e`,`w`,`ne`,`nw`,`se`,`sw`];function OA(e){return typeof e==`string`&&DA.includes(e)}const kA=(e,n,r)=>Math.min(r,Math.max(n,e));function AA(e,n,r,i,a){let{x:o,y:s,width:c,height:l}=e;return n.includes(`e`)&&(c=kA(e.width+r,a.minWidth,a.maxWidth)),n.includes(`w`)&&(c=kA(e.width-r,a.minWidth,a.maxWidth),o=e.x+(e.width-c)),n.includes(`s`)&&(l=kA(e.height+i,a.minHeight,a.maxHeight)),n.includes(`n`)&&(l=kA(e.height-i,a.minHeight,a.maxHeight),s=e.y+(e.height-l)),{x:o,y:s,width:c,height:l}}const jA={rect:{kind:`box`,radius:`0`},rounded:{kind:`box`,radius:`var(--graph-node-radius)`},pill:{kind:`box`,radius:`9999px`},circle:{kind:`box`,radius:`50%`},diamond:{kind:`polygon`,clip:`polygon(50% 0, 100% 50%, 50% 100%, 0 50%)`},hexagon:{kind:`polygon`,clip:`polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%)`}};function MA(e){return typeof e==`string`&&Object.hasOwn(jA,e)}function NA(e){return jA[MA(e)?e:`rounded`]}let Y=class extends n{constructor(...e){super(...e),this.key=``,this.x=0,this.y=0,this.label=``,this.selected=!1,this.parent=``,this.shape=``,this.group=!1,this.extent=``,this.icon=``,this.availablePorts=``,this.inheritedAvailablePorts=`show`,this._potential={in:0,out:0},this._virtual={in:0,out:0},this.portLayout=``,this.inheritedPortLayout=`rail`,this.portLocation=``,this.inheritedPortLocation=`vertical`,this.flipPorts=!1,this.inheritedFlipPorts=!1,this.inheritedDblclickToggle=!1,this._bodyEmpty=!0,this._filled={before:!1,after:!1},this.collapsed=!1,this.noCollapse=!1,this._hasMenu=!1,this.resizable=!1,this.width=0,this.height=0,this.minWidth=80,this.minHeight=40,this.maxWidth=0,this.maxHeight=0,this.dragBy=``,this.inheritedDragBy=`node`,this.easyConnect=``,this.connectPort=``,this.toolbarVisible=`selected`,this.toolbarPosition=`top`,this.#t={x:0,y:0,depth:0},this.#n={},this.#r={in:!1,out:!1},this.#a=()=>{this.dispatchEvent(new CustomEvent(`graph-node-ports`,{detail:{key:this.key},bubbles:!0}))},this.#c=e=>{e.stopPropagation();let n=e.detail.command??``,r=this._menu,i=n.startsWith(`add:`)?[...this.children].find(e=>e instanceof EA&&e.key===n.slice(4)):r?.kind===`hide`?r.port:void 0;i!==void 0&&(i.availability=n===`hide`?`potential`:`available`,n!==`hide`&&this.reveal(i.dir===`out`?`out`:`in`,1/0),this.dispatchEvent(new CustomEvent(`graph-port-change`,{detail:{node:this.key,port:i.key,dir:i.dir,availability:i.availability},bubbles:!0,composed:!0})))},this.#u=null,this.#d=null,this.#p=e=>n=>{let r=n.target.assignedNodes().some(e=>e.nodeType===1||(e.textContent??``).trim()!==``);r!==this._filled[e]&&(this._filled={...this._filled,[e]:r})},this.#m=e=>{e.composedPath().some(e=>e instanceof Element&&(e.classList.contains(`disclosure`)||e.classList.contains(`menu`)||e.classList.contains(`grip-zone`)))||this.dispatchEvent(new CustomEvent(`graph-node-title-dblclick`,{detail:{key:this.key,collapsed:this.isCollapsed},bubbles:!0,composed:!0,cancelable:!0}))&&this.inheritedDblclickToggle&&this.toggleCollapsed()},this.#h=e=>{this._bodyEmpty=!e.target.assignedNodes().some(e=>e.nodeType===1||(e.textContent??``).trim()!==``)},this.#g=e=>{this._hasMenu=e.target.assignedElements().length>0}}static{this.styles=CA}get hidesAvailable(){return(this.availablePorts||this.inheritedAvailablePorts)===`hide`}get effectivePortLocation(){return this.portLocation||this.inheritedPortLocation}get effectiveFlipPorts(){return this.flipPorts||this.inheritedFlipPorts}#e(e){return this.effectiveFlipPorts===(e===`in`)?`out`:`in`}get effectivePortLayout(){return this.effectivePortLocation===`horizontal`?`rail`:this.portLayout||this.inheritedPortLayout}get isCollapsed(){return this.collapsed&&this.label!==``}get dragsByHandle(){return(this.dragBy||this.inheritedDragBy)===`handle`}startsDrag(e){return!this.dragsByHandle||e.composedPath().some(e=>e instanceof Element&&e.hasAttribute(`data-drag-handle`))}#t;#n;#r;reveal(e,n){window.clearTimeout(this.#n[e]),this.#r[e]=n>0,n>0&&Number.isFinite(n)&&(this.#n[e]=window.setTimeout(()=>this.reveal(e,0),n)),this.#i(e)}#i(e){let n=`data-reveal-${this.#e(e)}`,r=this.hasAttribute(n),i=this.hidesAvailable&&(this.#r[e]||this.selected);this.toggleAttribute(n,i),this.#o(),r!==i&&this.#a()}async openAddMenu(e,n,r){this._menu={kind:`add`,side:e},await this.updateComplete,this.renderRoot.querySelector(`.port-menu`)?.openAt(n,r)}async openPortMenu(e,n,r){this._menu={kind:`hide`,port:e},await this.updateComplete,this.renderRoot.querySelector(`.port-menu`)?.openAt(n,r)}#a;overlayContains(e,n,r=10){let i=this.#e(e),a=this.renderRoot.querySelector(`.reveal-${i}`);if(a===null||!this.hasAttribute(`data-reveal-${i}`))return!1;let o=a.getBoundingClientRect();return n.x>=o.left-r&&n.x<=o.right+r&&n.y>=o.top-r&&n.y<=o.bottom+r}#o(){for(let e of[`in`,`out`]){let n=this.renderRoot.querySelector(`.reveal-${e}`),r=this.hasAttribute(`data-reveal-${e}`)&&n!==null;this.style.setProperty(`--reveal-${e}-h`,r?`${n.offsetHeight}px`:`0px`),this.style.setProperty(`--reveal-${e}-w`,r?`${n.offsetWidth}px`:`0px`)}}refreshPortSlots(){this.#_()}#s(e){return[...this.children].filter(n=>n instanceof EA&&n.status===`potential`&&n.dir===e)}#c;toggleCollapsed(){this.label!==``&&(this.collapsed=!this.collapsed,this.toggleAttribute(`data-collapsed`,this.isCollapsed),this.dispatchEvent(new CustomEvent(`graph-node-collapse`,{detail:{key:this.key,collapsed:this.isCollapsed},bubbles:!0,composed:!0})))}setVirtualPorts(e,n){(e!==this._virtual.in||n!==this._virtual.out)&&(this._virtual={in:e,out:n})}setHiddenByAncestor(e){this.toggleAttribute(`data-hidden`,e)}setClip(e){this.style.clipPath!==e&&(this.style.clipPath=e)}setSize(e,n){this.width=e,this.height=n,this.style.width=`${e}px`,this.style.height=`${n}px`}setOrigin(e,n,r){let i=this.#t;(i.x!==e||i.y!==n||i.depth!==r)&&(this.#t={x:e,y:n,depth:r},this.#l())}#l(){this.style.transform=`translate(${this.#t.x+this.x}px, ${this.#t.y+this.y}px)`,this.style.zIndex=this.#t.depth===0?``:String(this.#t.depth)}#u;#d;#f;connectedCallback(){super.connectedCallback(),this.addEventListener(`graph-port-rendered`,this.#a),this._hasMenu=this.querySelector(`:scope > [slot="context-menu"]`)!==null,this.toggleAttribute(`data-collapsed`,this.isCollapsed),this.#l(),this.#_(),queueMicrotask(()=>{this.#_(),this.#v()})}disconnectedCallback(){super.disconnectedCallback(),this.#u?.disconnect(),this.#d?.disconnect(),this.#u=null,this.#d=null}firstUpdated(){this.#u=new ResizeObserver(()=>this.#v()),this.#u.observe(this),this.#d=new MutationObserver(()=>{this.#_(),this.#v()}),this.#d.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`data-status`,`availability`,`label`]})}willUpdate(e){if(e.has(`width`)||e.has(`height`)||e.has(`minWidth`)||e.has(`minHeight`)||e.has(`maxWidth`)||e.has(`maxHeight`)){let e=e=>e>0?`${e}px`:``;this.style.width=e(this.width),this.style.height=e(this.height),this.style.minWidth=e(this.minWidth),this.style.minHeight=e(this.minHeight),this.style.maxWidth=e(this.maxWidth),this.style.maxHeight=e(this.maxHeight)}}updated(e){let n=[`portLocation`,`inheritedPortLocation`,`flipPorts`,`inheritedFlipPorts`].some(n=>e.has(n));n&&(this.setAttribute(`data-port-location`,this.effectivePortLocation),this.toggleAttribute(`data-flip-ports`,this.effectiveFlipPorts)),(n||e.has(`portLayout`)||e.has(`inheritedPortLayout`))&&(this.setAttribute(`data-port-layout`,this.effectivePortLayout),this.#_(),this.#a(),n&&(this.#i(`in`),this.#i(`out`))),(e.has(`availablePorts`)||e.has(`inheritedAvailablePorts`))&&this.#_(),(e.has(`selected`)||e.has(`availablePorts`)||e.has(`inheritedAvailablePorts`))&&(this.#i(`in`),this.#i(`out`)),(e.has(`collapsed`)||e.has(`label`))&&this.toggleAttribute(`data-collapsed`,this.isCollapsed),(e.has(`x`)||e.has(`y`))&&(this.#l(),this.#v())}#p;#m;#h;#g;#_(){let e=this.hidesAvailable?`hide`:`show`,n={in:0,out:0},r=[...this.children].filter(e=>e instanceof EA&&!(e.hasAttribute(`slot`)&&!e.hasAttribute(`data-auto-slot`))),i=e=>r.filter(n=>(n.dir===`out`?`out`:`in`)===e),a={in:this.effectivePortLayout===`full`&&i(`in`).length>0&&(i(`in`).length!==1||i(`in`)[0].label!==``),out:this.effectivePortLayout===`full`&&i(`out`).length>0&&(i(`out`).length!==1||i(`out`)[0].label!==``)};this.toggleAttribute(`data-full-in`,a[this.#e(`in`)]),this.toggleAttribute(`data-full-out`,a[this.#e(`out`)]);let o=!1;for(let r of this.children){if(!(r instanceof EA)||r.hasAttribute(`slot`)&&!r.hasAttribute(`data-auto-slot`))continue;let i=eA(r.status,e),s=this.#e(r.dir===`out`?`out`:`in`),c=i===`rail`?s:i===`overlay`?`${s}-hidden`:`potential`;r.setAttribute(`data-auto-slot`,``),r.toggleAttribute(`data-horizontal`,this.effectivePortLocation===`horizontal`),r.setAttribute(`data-edge`,s===`in`?`start`:`end`),r.toggleAttribute(`data-full`,a[r.dir===`out`?`out`:`in`]&&i===`rail`),r.slot!==c&&(r.slot=c,o=!0),r.status===`potential`&&n[r.dir===`out`?`out`:`in`]++}(n.in!==this._potential.in||n.out!==this._potential.out)&&(this._potential=n),o&&this.#a(),this.#o()}#v(){let e={key:this.key,x:this.x,y:this.y,width:this.offsetWidth,height:this.offsetHeight},n=this.#f;(n===void 0||n.x!==e.x||n.y!==e.y||n.width!==e.width||n.height!==e.height)&&(this.#f=e,this.dispatchEvent(new CustomEvent(`graph-node-geometry`,{detail:e,bubbles:!0,composed:!1})))}#y(e){return this._potential[e]>0?i`<button class="add" part="add-${e}" type="button" data-nodrag aria-label=${e===`in`?`Add input`:`Add output`} @click=${n=>this.#b(e,n)}><span class="plus"><ixfx-icon name="add"></ixfx-icon></span></button>`:a}#b(e,n){let r=n.currentTarget.getBoundingClientRect();this.openAddMenu(e,r.left+r.width/2,r.bottom)}#x(){let e=this._menu;return e?.kind===`add`?this.#s(e.side).map(e=>i`<ixfx-menu-item command=${`add:${e.key}`} label=${e.label||e.key}></ixfx-menu-item>`):e?.kind===`hide`?i`<ixfx-menu-item command="hide" label="Hide port"></ixfx-menu-item>`:a}render(){let e=NA(this.shape),n=e.kind===`polygon`,r=this.dragsByHandle;return i`
|
|
11360
|
+
`}firstUpdated(){this.#n()}#n(){this.dispatchEvent(new CustomEvent(`graph-port-rendered`,{bubbles:!0}))}updated(e){if(e.has(`availability`)&&this.#t(),e.has(`blink`)){let e=TA(this.blink);this.toggleAttribute(`data-blinking`,e!==void 0),e===void 0?this.style.removeProperty(`--_blink-period`):this.style.setProperty(`--_blink-period`,`${Math.round(e*1e3)/1e3}s`)}if(!e.has(`dir`)&&(e.has(`label`)||e.has(`description`))&&this.hasUpdated&&this.#n(),e.has(`label`)||e.has(`description`)){let e=this.description||this.label;e===``?this.removeAttribute(`data-tooltip`):this.setAttribute(`data-tooltip`,e)}}};E([d({type:String,reflect:!0})],EA.prototype,`key`,void 0),E([d({type:String,reflect:!0})],EA.prototype,`dir`,void 0),E([d({type:String,reflect:!0})],EA.prototype,`type`,void 0),E([d({type:Number,reflect:!0})],EA.prototype,`max`,void 0),E([d({type:String,reflect:!0})],EA.prototype,`side`,void 0),E([d({type:String,reflect:!0})],EA.prototype,`label`,void 0),E([d({type:String,reflect:!0})],EA.prototype,`description`,void 0),E([d({type:String,reflect:!0})],EA.prototype,`availability`,void 0),E([d({type:Number,reflect:!0})],EA.prototype,`blink`,void 0),EA=E([T(`ixfx-graph-port`)],EA);const DA=[`n`,`s`,`e`,`w`,`ne`,`nw`,`se`,`sw`];function OA(e){return typeof e==`string`&&DA.includes(e)}const kA=(e,n,r)=>Math.min(r,Math.max(n,e));function AA(e,n,r,i,a){let{x:o,y:s,width:c,height:l}=e;return n.includes(`e`)&&(c=kA(e.width+r,a.minWidth,a.maxWidth)),n.includes(`w`)&&(c=kA(e.width-r,a.minWidth,a.maxWidth),o=e.x+(e.width-c)),n.includes(`s`)&&(l=kA(e.height+i,a.minHeight,a.maxHeight)),n.includes(`n`)&&(l=kA(e.height-i,a.minHeight,a.maxHeight),s=e.y+(e.height-l)),{x:o,y:s,width:c,height:l}}const jA={rect:{kind:`box`,radius:`0`},rounded:{kind:`box`,radius:`var(--graph-node-radius)`},pill:{kind:`box`,radius:`9999px`},circle:{kind:`box`,radius:`50%`},diamond:{kind:`polygon`,clip:`polygon(50% 0, 100% 50%, 50% 100%, 0 50%)`},hexagon:{kind:`polygon`,clip:`polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%)`}};function MA(e){return typeof e==`string`&&Object.hasOwn(jA,e)}function NA(e){return jA[MA(e)?e:`rounded`]}let X=class extends n{constructor(...e){super(...e),this.key=``,this.x=0,this.y=0,this.label=``,this.selected=!1,this.parent=``,this.shape=``,this.group=!1,this.extent=``,this.icon=``,this.availablePorts=``,this.inheritedAvailablePorts=`show`,this._potential={in:0,out:0},this._virtual={in:0,out:0},this.portLayout=``,this.inheritedPortLayout=`rail`,this.portLocation=``,this.inheritedPortLocation=`vertical`,this.flipPorts=!1,this.inheritedFlipPorts=!1,this.inheritedDblclickToggle=!1,this._bodyEmpty=!0,this._filled={before:!1,after:!1},this.collapsed=!1,this.noCollapse=!1,this._hasMenu=!1,this.resizable=!1,this.width=0,this.height=0,this.minWidth=80,this.minHeight=40,this.maxWidth=0,this.maxHeight=0,this.dragBy=``,this.inheritedDragBy=`node`,this.easyConnect=``,this.connectPort=``,this.toolbarVisible=`selected`,this.toolbarPosition=`top`,this.#t={x:0,y:0,depth:0},this.#n={},this.#r={in:!1,out:!1},this.#a=()=>{this.dispatchEvent(new CustomEvent(`graph-node-ports`,{detail:{key:this.key},bubbles:!0}))},this.#c=e=>{e.stopPropagation();let n=e.detail.command??``,r=this._menu,i=n.startsWith(`add:`)?[...this.children].find(e=>e instanceof EA&&e.key===n.slice(4)):r?.kind===`hide`?r.port:void 0;i!==void 0&&(i.availability=n===`hide`?`potential`:`available`,n!==`hide`&&this.reveal(i.dir===`out`?`out`:`in`,1/0),this.dispatchEvent(new CustomEvent(`graph-port-change`,{detail:{node:this.key,port:i.key,dir:i.dir,availability:i.availability},bubbles:!0,composed:!0})))},this.#u=null,this.#d=null,this.#p=e=>n=>{let r=n.target.assignedNodes().some(e=>e.nodeType===1||(e.textContent??``).trim()!==``);r!==this._filled[e]&&(this._filled={...this._filled,[e]:r})},this.#m=e=>{e.composedPath().some(e=>e instanceof Element&&(e.classList.contains(`disclosure`)||e.classList.contains(`menu`)||e.classList.contains(`grip-zone`)))||this.dispatchEvent(new CustomEvent(`graph-node-title-dblclick`,{detail:{key:this.key,collapsed:this.isCollapsed},bubbles:!0,composed:!0,cancelable:!0}))&&this.inheritedDblclickToggle&&this.toggleCollapsed()},this.#h=e=>{this._bodyEmpty=!e.target.assignedNodes().some(e=>e.nodeType===1||(e.textContent??``).trim()!==``)},this.#g=e=>{this._hasMenu=e.target.assignedElements().length>0}}static{this.styles=CA}get hidesAvailable(){return(this.availablePorts||this.inheritedAvailablePorts)===`hide`}get effectivePortLocation(){return this.portLocation||this.inheritedPortLocation}get effectiveFlipPorts(){return this.flipPorts||this.inheritedFlipPorts}#e(e){return this.effectiveFlipPorts===(e===`in`)?`out`:`in`}get effectivePortLayout(){return this.effectivePortLocation===`horizontal`?`rail`:this.portLayout||this.inheritedPortLayout}get isCollapsed(){return this.collapsed&&this.label!==``}get dragsByHandle(){return(this.dragBy||this.inheritedDragBy)===`handle`}startsDrag(e){return!this.dragsByHandle||e.composedPath().some(e=>e instanceof Element&&e.hasAttribute(`data-drag-handle`))}#t;#n;#r;reveal(e,n){window.clearTimeout(this.#n[e]),this.#r[e]=n>0,n>0&&Number.isFinite(n)&&(this.#n[e]=window.setTimeout(()=>this.reveal(e,0),n)),this.#i(e)}#i(e){let n=`data-reveal-${this.#e(e)}`,r=this.hasAttribute(n),i=this.hidesAvailable&&(this.#r[e]||this.selected);this.toggleAttribute(n,i),this.#o(),r!==i&&this.#a()}async openAddMenu(e,n,r){this._menu={kind:`add`,side:e},await this.updateComplete,this.renderRoot.querySelector(`.port-menu`)?.openAt(n,r)}async openPortMenu(e,n,r){this._menu={kind:`hide`,port:e},await this.updateComplete,this.renderRoot.querySelector(`.port-menu`)?.openAt(n,r)}#a;overlayContains(e,n,r=10){let i=this.#e(e),a=this.renderRoot.querySelector(`.reveal-${i}`);if(a===null||!this.hasAttribute(`data-reveal-${i}`))return!1;let o=a.getBoundingClientRect();return n.x>=o.left-r&&n.x<=o.right+r&&n.y>=o.top-r&&n.y<=o.bottom+r}#o(){for(let e of[`in`,`out`]){let n=this.renderRoot.querySelector(`.reveal-${e}`),r=this.hasAttribute(`data-reveal-${e}`)&&n!==null;this.style.setProperty(`--reveal-${e}-h`,r?`${n.offsetHeight}px`:`0px`),this.style.setProperty(`--reveal-${e}-w`,r?`${n.offsetWidth}px`:`0px`)}}refreshPortSlots(){this.#_()}#s(e){return[...this.children].filter(n=>n instanceof EA&&n.status===`potential`&&n.dir===e)}#c;toggleCollapsed(){this.label!==``&&(this.collapsed=!this.collapsed,this.toggleAttribute(`data-collapsed`,this.isCollapsed),this.dispatchEvent(new CustomEvent(`graph-node-collapse`,{detail:{key:this.key,collapsed:this.isCollapsed},bubbles:!0,composed:!0})))}setVirtualPorts(e,n){(e!==this._virtual.in||n!==this._virtual.out)&&(this._virtual={in:e,out:n})}setHiddenByAncestor(e){this.toggleAttribute(`data-hidden`,e)}setClip(e){this.style.clipPath!==e&&(this.style.clipPath=e)}setSize(e,n){this.width=e,this.height=n,this.style.width=`${e}px`,this.style.height=`${n}px`}setOrigin(e,n,r){let i=this.#t;(i.x!==e||i.y!==n||i.depth!==r)&&(this.#t={x:e,y:n,depth:r},this.#l())}#l(){this.style.transform=`translate(${this.#t.x+this.x}px, ${this.#t.y+this.y}px)`,this.style.zIndex=this.#t.depth===0?``:String(this.#t.depth)}#u;#d;#f;connectedCallback(){super.connectedCallback(),this.addEventListener(`graph-port-rendered`,this.#a),this._hasMenu=this.querySelector(`:scope > [slot="context-menu"]`)!==null,this.toggleAttribute(`data-collapsed`,this.isCollapsed),this.#l(),this.#_(),queueMicrotask(()=>{this.#_(),this.#v()})}disconnectedCallback(){super.disconnectedCallback(),this.#u?.disconnect(),this.#d?.disconnect(),this.#u=null,this.#d=null}firstUpdated(){this.#u=new ResizeObserver(()=>this.#v()),this.#u.observe(this),this.#d=new MutationObserver(()=>{this.#_(),this.#v()}),this.#d.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`data-status`,`availability`,`label`]})}willUpdate(e){if(e.has(`width`)||e.has(`height`)||e.has(`minWidth`)||e.has(`minHeight`)||e.has(`maxWidth`)||e.has(`maxHeight`)){let e=e=>e>0?`${e}px`:``;this.style.width=e(this.width),this.style.height=e(this.height),this.style.minWidth=e(this.minWidth),this.style.minHeight=e(this.minHeight),this.style.maxWidth=e(this.maxWidth),this.style.maxHeight=e(this.maxHeight)}}updated(e){let n=[`portLocation`,`inheritedPortLocation`,`flipPorts`,`inheritedFlipPorts`].some(n=>e.has(n));n&&(this.setAttribute(`data-port-location`,this.effectivePortLocation),this.toggleAttribute(`data-flip-ports`,this.effectiveFlipPorts)),(n||e.has(`portLayout`)||e.has(`inheritedPortLayout`))&&(this.setAttribute(`data-port-layout`,this.effectivePortLayout),this.#_(),this.#a(),n&&(this.#i(`in`),this.#i(`out`))),(e.has(`availablePorts`)||e.has(`inheritedAvailablePorts`))&&this.#_(),(e.has(`selected`)||e.has(`availablePorts`)||e.has(`inheritedAvailablePorts`))&&(this.#i(`in`),this.#i(`out`)),(e.has(`collapsed`)||e.has(`label`))&&this.toggleAttribute(`data-collapsed`,this.isCollapsed),(e.has(`x`)||e.has(`y`))&&(this.#l(),this.#v())}#p;#m;#h;#g;#_(){let e=this.hidesAvailable?`hide`:`show`,n={in:0,out:0},r=[...this.children].filter(e=>e instanceof EA&&!(e.hasAttribute(`slot`)&&!e.hasAttribute(`data-auto-slot`))),i=e=>r.filter(n=>(n.dir===`out`?`out`:`in`)===e),a={in:this.effectivePortLayout===`full`&&i(`in`).length>0&&(i(`in`).length!==1||i(`in`)[0].label!==``),out:this.effectivePortLayout===`full`&&i(`out`).length>0&&(i(`out`).length!==1||i(`out`)[0].label!==``)};this.toggleAttribute(`data-full-in`,a[this.#e(`in`)]),this.toggleAttribute(`data-full-out`,a[this.#e(`out`)]);let o=!1;for(let r of this.children){if(!(r instanceof EA)||r.hasAttribute(`slot`)&&!r.hasAttribute(`data-auto-slot`))continue;let i=eA(r.status,e),s=this.#e(r.dir===`out`?`out`:`in`),c=i===`rail`?s:i===`overlay`?`${s}-hidden`:`potential`;r.setAttribute(`data-auto-slot`,``),r.toggleAttribute(`data-horizontal`,this.effectivePortLocation===`horizontal`),r.setAttribute(`data-edge`,s===`in`?`start`:`end`),r.toggleAttribute(`data-full`,a[r.dir===`out`?`out`:`in`]&&i===`rail`),r.slot!==c&&(r.slot=c,o=!0),r.status===`potential`&&n[r.dir===`out`?`out`:`in`]++}(n.in!==this._potential.in||n.out!==this._potential.out)&&(this._potential=n),o&&this.#a(),this.#o()}#v(){let e={key:this.key,x:this.x,y:this.y,width:this.offsetWidth,height:this.offsetHeight},n=this.#f;(n===void 0||n.x!==e.x||n.y!==e.y||n.width!==e.width||n.height!==e.height)&&(this.#f=e,this.dispatchEvent(new CustomEvent(`graph-node-geometry`,{detail:e,bubbles:!0,composed:!1})))}#y(e){return this._potential[e]>0?i`<button class="add" part="add-${e}" type="button" data-nodrag aria-label=${e===`in`?`Add input`:`Add output`} @click=${n=>this.#b(e,n)}><span class="plus"><ixfx-icon name="add"></ixfx-icon></span></button>`:a}#b(e,n){let r=n.currentTarget.getBoundingClientRect();this.openAddMenu(e,r.left+r.width/2,r.bottom)}#x(){let e=this._menu;return e?.kind===`add`?this.#s(e.side).map(e=>i`<ixfx-menu-item command=${`add:${e.key}`} label=${e.label||e.key}></ixfx-menu-item>`):e?.kind===`hide`?i`<ixfx-menu-item command="hide" label="Hide port"></ixfx-menu-item>`:a}render(){let e=NA(this.shape),n=e.kind===`polygon`,r=this.dragsByHandle;return i`
|
|
11360
11361
|
<div
|
|
11361
11362
|
class="shape"
|
|
11362
11363
|
part="shape"
|
|
@@ -11386,7 +11387,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
11386
11387
|
<div class="toolbar" part="toolbar" data-nodrag data-position=${this.toolbarPosition}><slot name="toolbar"></slot></div>
|
|
11387
11388
|
${this.resizable?DA.map(e=>i`
|
|
11388
11389
|
<div class=${e.length===2?`grip corner`:`grip`} part="resize-${e}" data-resize=${e} data-nodrag></div>`):a}
|
|
11389
|
-
`}};E([d({type:String,reflect:!0})],
|
|
11390
|
+
`}};E([d({type:String,reflect:!0})],X.prototype,`key`,void 0),E([d({type:Number,reflect:!0})],X.prototype,`x`,void 0),E([d({type:Number,reflect:!0})],X.prototype,`y`,void 0),E([d({type:String,reflect:!0})],X.prototype,`label`,void 0),E([d({type:Boolean,reflect:!0})],X.prototype,`selected`,void 0),E([d({type:String,reflect:!0})],X.prototype,`parent`,void 0),E([d({type:String,reflect:!0})],X.prototype,`shape`,void 0),E([d({type:Boolean,reflect:!0})],X.prototype,`group`,void 0),E([d({type:String,reflect:!0})],X.prototype,`extent`,void 0),E([d({type:String})],X.prototype,`icon`,void 0),E([d({type:String,attribute:`available-ports`,reflect:!0})],X.prototype,`availablePorts`,void 0),E([d({attribute:!1})],X.prototype,`inheritedAvailablePorts`,void 0),E([m()],X.prototype,`_potential`,void 0),E([m()],X.prototype,`_virtual`,void 0),E([m()],X.prototype,`_menu`,void 0),E([d({type:String,attribute:`port-layout`})],X.prototype,`portLayout`,void 0),E([d({attribute:!1})],X.prototype,`inheritedPortLayout`,void 0),E([d({type:String,attribute:`port-location`})],X.prototype,`portLocation`,void 0),E([d({attribute:!1})],X.prototype,`inheritedPortLocation`,void 0),E([d({type:Boolean,attribute:`flip-ports`})],X.prototype,`flipPorts`,void 0),E([d({attribute:!1})],X.prototype,`inheritedFlipPorts`,void 0),E([d({attribute:!1})],X.prototype,`inheritedDblclickToggle`,void 0),E([m()],X.prototype,`_bodyEmpty`,void 0),E([m()],X.prototype,`_filled`,void 0),E([d({type:Boolean,reflect:!0})],X.prototype,`collapsed`,void 0),E([d({type:Boolean,attribute:`no-collapse`})],X.prototype,`noCollapse`,void 0),E([m()],X.prototype,`_hasMenu`,void 0),E([d({type:Boolean,reflect:!0})],X.prototype,`resizable`,void 0),E([d({type:Number,reflect:!0})],X.prototype,`width`,void 0),E([d({type:Number,reflect:!0})],X.prototype,`height`,void 0),E([d({type:Number,attribute:`min-width`})],X.prototype,`minWidth`,void 0),E([d({type:Number,attribute:`min-height`})],X.prototype,`minHeight`,void 0),E([d({type:Number,attribute:`max-width`})],X.prototype,`maxWidth`,void 0),E([d({type:Number,attribute:`max-height`})],X.prototype,`maxHeight`,void 0),E([d({type:String,attribute:`drag-by`,reflect:!0})],X.prototype,`dragBy`,void 0),E([d({attribute:!1})],X.prototype,`inheritedDragBy`,void 0),E([d({type:String,attribute:`easy-connect`,reflect:!0})],X.prototype,`easyConnect`,void 0),E([d({type:String,attribute:`connect-port`})],X.prototype,`connectPort`,void 0),E([d({type:String,attribute:`toolbar-visible`,reflect:!0})],X.prototype,`toolbarVisible`,void 0),E([d({type:String,attribute:`toolbar-position`,reflect:!0})],X.prototype,`toolbarPosition`,void 0),X=E([T(`ixfx-graph-node`)],X);function PA(e,n){return Math.hypot(e.x-n.x,e.y-n.y)}function FA(e,n){return e.node===n.node&&e.port===n.port}function IA(e,n,r,i){let a,o=1/0;for(let r of e){let e=PA(r,n);e<o&&(a=r,o=e)}if(i!==void 0){let s=e.find(e=>FA(e.ref,i.ref));if(s!==void 0){let e=PA(s,n);if(e<=r*1.5&&(a===void 0||o>=e*.75))return{ref:s.ref,x:s.x,y:s.y,distance:e}}}if(a!==void 0&&o<=r)return{ref:a.ref,x:a.x,y:a.y,distance:o}}function LA(e,n){let r=n*2;return e>=r?0:Math.max(0,Math.min(1,1-e/r))}function RA(e,n,r,i){if(i<=0)return{x:n.x,y:n.y};let a=1-Math.exp(-r/i);return{x:e.x+(n.x-e.x)*a,y:e.y+(n.y-e.y)*a}}function zA(e,n){return Math.abs(e.x-n.x)<.5&&Math.abs(e.y-n.y)<.5}function BA(e,n){return{x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),width:Math.abs(e.x-n.x),height:Math.abs(e.y-n.y)}}function VA(e,n){return e.x<n.x+n.width&&e.x+e.width>n.x&&e.y<n.y+n.height&&e.y+e.height>n.y}function HA(e,n){return n.filter(n=>VA(e,n.rect)).map(e=>e.key)}function UA(e,n,r){return new Set(r?[...e,...n]:n)}function WA(e){return!e.onBackground||e.spacePan||e.button!==0?!1:e.pointerType===`mouse`?e.shiftKey:e.touchMode===`select`}function GA(e,n){return{left:`${e.x-n.x}px`,top:`${e.y-n.y}px`,width:`${e.width}px`,height:`${e.height}px`}}const KA=3;var qA=class{#e;#t=null;#n={x:0,y:0};#r={x:0,y:0};#i=!1;#a=!1;#o={nodes:/* @__PURE__ */ new Set,edges:/* @__PURE__ */ new Set};constructor(e){this.#e=e}get pointerId(){return this.#t}get clientRect(){return this.#t!==null&&this.#i?BA(this.#n,this.#r):void 0}begin(e,n){this.#t=e.pointerId,this.#n={x:e.clientX,y:e.clientY},this.#r=this.#n,this.#i=!1,this.#a=n,this.#o=this.#e.getSelection(),this.#e.getPane()?.setPointerCapture(e.pointerId)}onPointerMove(e){if(e.pointerId!==this.#t)return;if(this.#r={x:e.clientX,y:e.clientY},!this.#i){if(Math.hypot(this.#r.x-this.#n.x,this.#r.y-this.#n.y)<3)return;this.#i=!0}let n=HA(BA(this.#e.screenToFlow(this.#n),this.#e.screenToFlow(this.#r)),this.#e.getNodeRects());this.#e.applySelection(UA(this.#o.nodes,n,this.#a),this.#a?this.#o.edges:/* @__PURE__ */ new Set),this.#e.invalidate()}onPointerUp(e){return e.pointerId===this.#t&&(!this.#i&&!this.#a&&this.#e.applySelection(/* @__PURE__ */ new Set,/* @__PURE__ */ new Set),this.#s()),!1}onPointerCancel(e){return e.pointerId===this.#t&&this.abort(),!1}abort(){this.#t!==null&&(this.#e.applySelection(this.#o.nodes,this.#o.edges),this.#s())}cancelForPinch(){if(this.#t===null)return;let e={pointerId:this.#t,point:this.#r};return this.abort(),e}#s(){this.#t=null,this.#i=!1,this.#e.invalidate()}};const JA=3;var YA=class{#e;#t=null;#n=!1;#r={x:0,y:0};#i=[];#a=[];constructor(e){this.#e=e}get dragging(){return this.#n}onPointerDown(e,n){return e.button!==0||this.#e.getPane()===void 0||n.length===0?!1:(this.#t=e.pointerId,this.#r={x:e.clientX,y:e.clientY},this.#i=n.map(e=>({el:e,x:e.x,y:e.y})),this.#n=!1,this.#a=[],!0)}onPointerMove(e){if(e.pointerId!==this.#t||this.#i.length===0)return;let n=e.clientX-this.#r.x,r=e.clientY-this.#r.y;if(!this.#n){if(Math.hypot(n,r)<3)return;this.#e.getPane()?.setPointerCapture(e.pointerId),this.#n=!0,this.#e.setGestureActive(!0)}let i=this.#e.getViewport().zoom,a=this.#i.map(e=>({key:e.el.key,x:e.x+n/i,y:e.y+r/i})),o=this.#e.applyMoves(a);this.#a=[...o],this.#e.emitMove(o)}onPointerUp(e){if(e.pointerId!==this.#t)return!1;let n=this.#n;return n&&this.#a.length>0&&this.#e.emitMoved(this.#a),this.#o(),n&&this.#e.onEnd?.(!0),!1}onPointerCancel(e){if(e.pointerId!==this.#t)return!1;let n=this.#n;return n&&this.#e.applyMoves(this.#i.map(e=>({key:e.el.key,x:e.x,y:e.y}))),this.#o(),n&&this.#e.onEnd?.(!1),!1}#o(){this.#t=null,this.#n=!1,this.#i=[],this.#a=[],this.#e.setGestureActive(!1)}};const XA=r`
|
|
11390
11391
|
:host {
|
|
11391
11392
|
/* Consumer-customisable variables (see README). Defaults come from theme tokens. */
|
|
11392
11393
|
--node-graph-bg: var(--surface-2, oklch(12% 0.02 240));
|
|
@@ -11557,7 +11558,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
11557
11558
|
stroke-dasharray: 4 3;
|
|
11558
11559
|
pointer-events: none;
|
|
11559
11560
|
}
|
|
11560
|
-
`;function ZA(e,n,r){return Math.min(r,Math.max(n,e))}function QA(e,n,r){return{x:(e.x-r.x-n.x)/n.zoom,y:(e.y-r.y-n.y)/n.zoom}}function $A(e,n,r){return{x:e.x*n.zoom+n.x+r.x,y:e.y*n.zoom+n.y+r.y}}function ej(e,n,r,i,a,o){let s=ZA(e.zoom*i,a,o),c=(n.x-r.x-e.x)/e.zoom,l=(n.y-r.y-e.y)/e.zoom;return{zoom:s,x:n.x-r.x-c*s,y:n.y-r.y-l*s}}function tj(e,n,r){return{x:e.x+n,y:e.y+r,zoom:e.zoom}}function nj(e,n,r,i){let a=Math.max(1,e.width),o=Math.max(1,e.height),s=n-i.padding*2,c=r-i.padding*2,l=s>0&&c>0?ZA(Math.min(s/a,c/o),i.minZoom,i.maxZoom):i.minZoom;return{zoom:l,x:n/2-(e.x+a/2)*l,y:r/2-(e.y+o/2)*l}}function rj(e){if(e.length===0)return{x:0,y:0,width:0,height:0};let n=1/0,r=1/0,i=-1/0,a=-1/0;for(let o of e)n=Math.min(n,o.x),r=Math.min(r,o.y),i=Math.max(i,o.x+o.width),a=Math.max(a,o.y+o.height);return{x:n,y:r,width:i-n,height:a-r}}function ij(e,n,r){return nj(rj(e),n.width,n.height,r)}function aj(e){let n=e instanceof Element?e:null;return n===null?!1:n instanceof HTMLElement&&n.isContentEditable?!0:n.closest(`input, textarea, select, button, [contenteditable]`)!==null}var oj=class{#e;#t;#n=null;#r={x:0,y:0};#i=null;#a=/* @__PURE__ */ new Map;#o=null;#s=!1;constructor(e,n){this.#e=e,this.#t=n,e.addController(this)}hostDisconnected(){this.setSpacePan(!1)}onKeyDown(e){return e.key===` `&&(e.repeat||(e.preventDefault(),this.setSpacePan(!0)),!0)}onKeyUp(e){(e===void 0||e.key===` `)&&this.setSpacePan(!1)}get spacePan(){return this.#s}setSpacePan(e){this.#s!==e&&(this.#s=e,this.#t.setSpacePan(e))}onPointerDown(e){let n=this.#t.getPane();return n===void 0?!1:this.#n!==null&&e.pointerId!==this.#n?(this.#a.set(this.#n,this.#r),this.#a.set(e.pointerId,{x:e.clientX,y:e.clientY}),this.#c(),!0):!(e.target===n||e.button===1||this.#s&&!aj(e.target))||e.button===2?!1:(this.#n=e.pointerId,this.#r={x:e.clientX,y:e.clientY},this.#i=this.#t.getViewport(),this.#a.set(e.pointerId,this.#r),n.setPointerCapture(e.pointerId),this.#t.setGestureActive(!0),!0)}startPinch(e,n){this.#n=e.pointerId,this.#r=e.point,this.#i=this.#t.getViewport(),this.#a.set(e.pointerId,e.point),this.#a.set(n.pointerId,{x:n.clientX,y:n.clientY}),this.#t.getPane()?.setPointerCapture(n.pointerId),this.#t.setGestureActive(!0),this.#c()}onPointerMove(e){if(this.#o!==null){this.#a.set(e.pointerId,{x:e.clientX,y:e.clientY}),this.#l();return}if(this.#n===null||e.pointerId!==this.#n)return;this.#a.set(e.pointerId,{x:e.clientX,y:e.clientY});let n=this.#i;n!==null&&this.#t.setViewport({x:n.x+(e.clientX-this.#r.x),y:n.y+(e.clientY-this.#r.y),zoom:n.zoom})}onPointerUp(e){return this.#a.delete(e.pointerId),this.#o===null?e.pointerId===this.#n?(this.#u(),!1):this.#n!==null:this.#a.size>=2?(this.#c(),!0):(this.#u(),!1)}onPointerCancel(e){return this.onPointerUp(e)}addPointer(e){this.#n!==null&&this.#o===null&&(this.#a.set(e.pointerId,{x:e.clientX,y:e.clientY}),this.#c())}onWheel(e){if(this.#t.isWheelBlockedTarget(e))return;let n=this.#t.getPane();if(n===void 0)return;let r=e.deltaX,i=e.deltaY;e.deltaMode===1?(r*=16,i*=16):e.deltaMode===2&&(r*=n.clientHeight,i*=n.clientHeight);let a=e.ctrlKey||e.metaKey,o=this.#t.getWheelMode(),s=this.#t.getPaneRect();if(s===void 0)return;let c={x:s.left,y:s.top},l=this.#t.getViewport();if(e.preventDefault(),a||o===`zoom`){let n=a?.01:.002;this.#t.setViewport(ej(l,{x:e.clientX,y:e.clientY},c,Math.exp(-i*n),this.#t.getMinZoom(),this.#t.getMaxZoom()))}else this.#t.setViewport(tj(l,-r,-i))}#c(){let e=[...this.#a.values()];if(e.length<2){this.#o=null;return}let[n,r]=e;this.#o={dist:Math.hypot(r.x-n.x,r.y-n.y),mid:{x:(n.x+r.x)/2,y:(n.y+r.y)/2}}}#l(){let e=this.#o,n=[...this.#a.values()];if(e===null||n.length<2)return;let[r,i]=n,a=Math.hypot(i.x-r.x,i.y-r.y),o={x:(r.x+i.x)/2,y:(r.y+i.y)/2},s=this.#t.getPaneRect();if(s===void 0||e.dist<=0)return;let c={x:s.left,y:s.top},l=ej(this.#t.getViewport(),o,c,a/e.dist,this.#t.getMinZoom(),this.#t.getMaxZoom());l=tj(l,o.x-e.mid.x,o.y-e.mid.y),this.#o={dist:a,mid:o},this.#t.setViewport(l)}#u(){this.#n=null,this.#i=null,this.#o=null,this.#a.clear(),this.#t.setGestureActive(!1)}};function sj(e,n){for(let r of e)if(r instanceof Element&&r.localName===n)return r}function cj(e,n){for(let r of e.composedPath())if(r instanceof Element&&(r.closest(`[${n}]`)!==null||aj(r)))return!0;return!1}const lj=e=>cj(e,`data-nodrag`),uj=e=>cj(e,`data-nowheel`);function dj(e){return typeof e?.openAt==`function`}function fj(e,n){let r=sj(e,`ixfx-graph-node`),i=sj(e,`ixfx-graph-port`);if(r!==void 0&&i!==void 0&&i.status===`available`)return{kind:`port`,id:`${r.key}/${i.key}`,menu:{openAt:(e,n)=>void r.openPortMenu(i,e,n)}};if(r!==void 0&&(r.key??``)!==``){let e=r.querySelector(`:scope > [slot="context-menu"]`);return{kind:`node`,id:r.key,menu:dj(e)?e:void 0}}let a=e.find(e=>e instanceof Element&&e.hasAttribute(`data-edge-id`))?.getAttribute(`data-edge-id`)??void 0,o=a===void 0?`pane`:`edge`,s=n.querySelector(`:scope > [slot="${o}-menu"]`);return{kind:o,id:a,menu:dj(s)?s:void 0}}function pj(e,n){let r=()=>e.openAt(n.clientX,n.clientY);n.buttons===0?r():document.addEventListener(`pointerup`,()=>setTimeout(r,0),{capture:!0,once:!0})}function mj(e){let n=e[0];if(!(n instanceof Element)||n.getAttribute(`slot`)!==`context-menu`)return;let r=n.parentElement;return r?.localName===`ixfx-graph-node`&&(r.key??``)!==``?r.key:void 0}const hj=2e3;function gj(e){return typeof e!=`number`||!Number.isFinite(e)||e<=0?0:Math.min(e,hj)}function _j(e,n,r){let i=gj(r);if(i===(e[n]??0))return e;if(i===0){let{[n]:r,...i}=e;return i}return{...e,[n]:i}}function vj(e,n,r){let{[n]:i,...a}=e;return r===void 0?a:{...a,[n]:r}}var yj=class extends n{constructor(...e){super(...e),this.wireFlow={},this.edgeLabels={},this.edgeStyle=`bezier`,this.edgeHints={},this.edgeRouter=void 0}setWireFlow(e,n){this.wireFlow=_j(this.wireFlow,e,n)}setEdgeLabel(e,n){this.edgeLabels=vj(this.edgeLabels,e,n===``?void 0:n)}setEdgeHint(e,n){this.edgeHints=vj(this.edgeHints,e,n)}};E([d({attribute:!1})],yj.prototype,`wireFlow`,void 0),E([d({attribute:!1})],yj.prototype,`edgeLabels`,void 0),E([d({type:String,attribute:`edge-style`})],yj.prototype,`edgeStyle`,void 0),E([d({attribute:!1})],yj.prototype,`edgeHints`,void 0),E([d({attribute:!1})],yj.prototype,`edgeRouter`,void 0);function bj(e,n,r,i=!1){return e.dispatchEvent(new CustomEvent(n,{detail:r,bubbles:!0,composed:!0,cancelable:i}))}async function xj(e,n,r){let i=n(e);if(i==null)return;i.x=e.point.x,i.y=e.point.y,r.append(i),r.register(),await i.updateComplete;let a=r.portsOf(i.key).find(n=>r.canConnect(e.from,n));if(a===void 0)return{node:i};let o=r.layout(i.key)?.offsets.get(a.ref.port);return o!==void 0&&(i.x=e.point.x-o.x,i.y=e.point.y-o.y),r.connect(e.from.ref,a.ref)?{node:i,connectedTo:a.ref}:{node:i}}function Sj(e,n){let r=0,i=0,a=0,o=0;for(let s of n)r=Math.max(r,s.y-e.y),o=Math.max(o,s.x-e.x),i=Math.max(i,e.x+e.width-(s.x+s.width)),a=Math.max(a,e.y+e.height-(s.y+s.height));return r>0||i>0||a>0||o>0?{top:Math.max(0,r),right:Math.max(0,i),bottom:Math.max(0,a),left:Math.max(0,o)}:void 0}function Cj(e){if(e===void 0)return``;let n=e=>`${e>0?Math.round(e*100)/100:-400}px`;return`inset(${n(e.top)} ${n(e.right)} ${n(e.bottom)} ${n(e.left)})`}function wj(e,n,r){switch(e){case`left`:return{x:0,y:r/2};case`right`:return{x:n,y:r/2};case`top`:return{x:n/2,y:0};case`bottom`:return{x:n/2,y:r}}}function Tj(e,n){let r=e.getBoundingClientRect(),i=n>0?n:1,a=/* @__PURE__ */ new Map,o=e.hasAttribute(`data-collapsed`),s=e.getAttribute(`data-port-location`)===`horizontal`?`horizontal`:`vertical`,c=e.hasAttribute(`data-flip-ports`),l=e.querySelectorAll(`ixfx-graph-port`);for(let e of l){let n=e.getAttribute(`key`)??``;if(n===``||!o&&e.getClientRects().length===0)continue;let l=(e.shadowRoot?.querySelector(`.dot`)??e).getBoundingClientRect(),u=e.getAttribute(`side`),d=e.getAttribute(`dir`)===`out`?`out`:`in`,f=u===`left`||u===`right`||u===`top`||u===`bottom`?u:aA(d,s,c),p=o?wj(f,r.width/i,r.height/i):{x:(l.left+l.width/2-r.left)/i,y:(l.top+l.height/2-r.top)/i};a.set(n,{key:n,...p,side:f})}return{offsets:a,width:r.width/i,height:r.height/i}}function Ej(e,n){let r=[],i=[],a=[];for(let o of e){let e=n.has(o.from.node),s=n.has(o.to.node);e&&s?a.push(o):s?r.push(o):e&&i.push(o)}return{incoming:r,outgoing:i,internal:a}}function Dj(e,n){let r=/* @__PURE__ */ new Map,i=(e,n)=>{let i=r.get(e)??{in:0,out:0};i[n]++,r.set(e,i)};for(let r of e){let e=n(r.from.node),a=n(r.to.node);(e===void 0||e!==a)&&(e!==void 0&&i(e,`out`),a!==void 0&&i(a,`in`))}return r}var Oj=class{#e;#t;#n;#r;#i;#a;constructor(e){this.nodes=/* @__PURE__ */ new Map,this.#t=/* @__PURE__ */ new Map,this.#n=/* @__PURE__ */ new Map,this.#r=/* @__PURE__ */ new Map,this.#i=/* @__PURE__ */ new Set,this.#a={dragBy:`node`,availablePorts:`show`,portLayout:`rail`,portLocation:`vertical`,flipPorts:!1,dblclickToggle:!1},this.#e=e}setDefaults(e){this.#a=e;for(let e of this.nodes.values())this.#o(e)}#o(e){e.inheritedDragBy=this.#a.dragBy,e.inheritedAvailablePorts=this.#a.availablePorts,e.inheritedPortLayout=this.#a.portLayout,e.inheritedPortLocation=this.#a.portLocation,e.inheritedFlipPorts=this.#a.flipPorts,e.inheritedDblclickToggle=this.#a.dblclickToggle}syncPortStatuses(e){for(let[n,r]of this.#t)n.setConnected(e.has(wk({node:r,port:n.key})));for(let e of this.nodes.values())e.refreshPortSlots()}refresh(e,n){let r=/* @__PURE__ */ new Map;for(let n of e)n instanceof Y&&n.key!==``&&r.set(n.key,n);let i=[];for(let[e,n]of this.nodes)r.has(e)||(this.nodes.delete(e),this.#r.delete(e),this.#e.unobserve(n),i.push(e));for(let[e,i]of r)this.nodes.has(e)||(this.nodes.set(e,i),this.#r.delete(e),this.#e.observe(i),i.selected=n(e),this.#o(i));return this.#s(),this.syncOrigins(),i}#s(){this.#t.clear(),this.#n.clear();for(let[e,n]of this.nodes)for(let r of n.querySelectorAll(`ixfx-graph-port`)){if(r.key===``)continue;let n=`${e}\u0000${r.key}`;this.#n.has(n)&&!this.#i.has(n)&&(this.#i.add(n),console.warn(`[ixfx-node-graph] node "${e}" has more than one port with key "${r.key}"; port keys must be unique within a node (in and out ports included). Only the last is wireable.`)),this.#t.set(r,e),this.#n.set(n,r)}}layout(e){let n=this.nodes.get(e);if(n===void 0||n.hasAttribute(`data-hidden`))return;let r=this.#r.get(e);return r===void 0&&(r=Tj(n,this.#e.getZoom()),this.#r.set(e,r)),r}invalidateLayout(e){this.#r.delete(e)}noteGeometry(e,n,r){let i=this.#r.get(e);(i===void 0||Math.abs(i.width-n)>.5||Math.abs(i.height-r)>.5)&&this.#r.delete(e)}snapshot(){return[...this.nodes.values()].map(e=>({key:e.key,x:e.x,y:e.y,label:e.label,ports:this.portsOf(e.key)}))}cachedLayout(e){return this.#r.get(e)}parentKey(e){let n=this.nodes.get(e)?.parent??``;return n!==``&&n!==e&&this.nodes.has(n)?n:void 0}abs(e){let n=0,r=0,i=e;for(let e=0;i!==void 0&&e<64;e++){let e=this.nodes.get(i);if(e===void 0)break;n+=e.x,r+=e.y,i=this.parentKey(i)}return{x:n,y:r}}depth(e){let n=0,r=this.parentKey(e);for(;r!==void 0&&n<64;)n++,r=this.parentKey(r);return n}descendants(e){let n=[];for(let r of this.nodes.keys()){let i=this.parentKey(r);for(let a=0;i!==void 0&&a<64;a++){if(i===e){n.push(r);break}i=this.parentKey(i)}}return n}hasAncestorIn(e,n){let r=this.parentKey(e);for(let e=0;r!==void 0&&e<64;e++){if(n.has(r))return!0;r=this.parentKey(r)}return!1}isHidden(e){return this.nodes.get(e)?.hasAttribute(`data-hidden`)??!1}syncOrigins(){for(let[e,n]of this.nodes){let r=this.parentKey(e),i=r===void 0?{x:0,y:0}:this.abs(r);n.setOrigin(i.x,i.y,this.depth(e)),n.setHiddenByAncestor(this.#c(e).some(e=>this.nodes.get(e)?.isCollapsed===!0))}for(let[e,n]of this.nodes){let r=n.hasAttribute(`data-hidden`)?void 0:this.rect(e),i=this.#c(e).map(e=>this.rect(e)).filter(e=>e!==void 0);n.setClip(r===void 0||i.length===0?``:Cj(Sj(r,i)))}}#c(e){let n=[],r=this.parentKey(e);for(;r!==void 0&&n.length<64;)n.push(r),r=this.parentKey(r);return n}applyRect(e,n){let r=this.nodes.get(e);r!==void 0&&(r.x=n.x,r.y=n.y,r.setSize(n.width,n.height),this.invalidateLayout(e),this.syncOrigins())}clampToParent(e,n){let r=this.nodes.get(e),i=this.parentKey(e),a=this.layout(e),o=i===void 0?void 0:this.layout(i);return r?.extent!==`parent`||a===void 0||o===void 0?n:{x:Math.min(Math.max(n.x,0),Math.max(0,o.width-a.width)),y:Math.min(Math.max(n.y,0),Math.max(0,o.height-a.height))}}collapsedProxyOf(e){if(this.isHidden(e))return this.#c(e).find(e=>this.nodes.get(e)?.isCollapsed===!0&&!this.isHidden(e))}virtualPortGeometry(e,n){let r=this.rect(e);if(r===void 0)return;let i=this.nodes.get(e),a=Qk(n,i?.effectivePortLocation,i?.effectiveFlipPorts),o={x:r.x+r.width/2,y:r.y+r.height/2};switch(a){case`left`:return{pos:{x:r.x,y:o.y},side:a};case`right`:return{pos:{x:r.x+r.width,y:o.y},side:a};case`top`:return{pos:{x:o.x,y:r.y},side:a};case`bottom`:return{pos:{x:o.x,y:r.y+r.height},side:a}}}syncVirtualPorts(e){let n=Dj(e,e=>this.collapsedProxyOf(e));for(let[e,r]of this.nodes){let i=n.get(e);r.setVirtualPorts(i?.in??0,i?.out??0)}}rect(e){let n=this.layout(e);if(n===void 0)return;let r=this.abs(e);return{x:r.x,y:r.y,width:n.width,height:n.height}}rects(){let e=[];for(let n of this.nodes.keys()){if(this.isHidden(n))continue;let r=this.rect(n);r!==void 0&&e.push({key:n,rect:r})}return e}nodeAt(e,n=/* @__PURE__ */ new Set){let r;for(let{key:i,rect:a}of this.rects()){if(n.has(i)||e.x<a.x||e.x>a.x+a.width||e.y<a.y||e.y>a.y+a.height)continue;let o=this.depth(i);(r===void 0||o>=r.depth)&&(r={key:i,depth:o})}return r?.key}portGeometry(e){let n=this.layout(e.node)?.offsets.get(e.port);if(n===void 0)return;let r=this.abs(e.node);return{pos:{x:r.x+n.x,y:r.y+n.y},side:n.side}}portInfoFor(e){if(e===void 0||e.key===``)return;let n=this.#t.get(e);return n===void 0?void 0:e.portInfo(n)}portInfoOf(e){return this.portInfoFor(this.#n.get(`${e.node}\u0000${e.port}`))}portsOf(e){let n=[];for(let[r,i]of this.#t){if(i!==e)continue;let a=this.portInfoFor(r);a!==void 0&&n.push(a)}return n}wireLookups(){return{portInfoFor:e=>this.portInfoFor(e),portInfoForSource:e=>this.portInfoOf(e),allPorts:()=>this.allPorts(),portOffset:(e,n)=>this.layout(e)?.offsets.get(n),nodePosition:e=>this.nodes.has(e)?this.abs(e):void 0,nodeAt:e=>this.nodeAt(e)}}portKeysOf(e){return[...this.#t].filter(([,n])=>n===e).map(([e])=>e.key)}allPorts(){return[...this.#t].filter(([,e])=>!this.isHidden(e)&&this.nodes.get(e)?.isCollapsed!==!0).map(([e])=>e)}},kj=class{#e;#t=null;#n;#r=`se`;#i={x:0,y:0};#a;constructor(e){this.#e=e}beginForNode(e,n,r,i){let a=e=>e>0?e:1/0;this.begin(e,{key:n.key,rect:{x:n.x,y:n.y,width:r.width,height:r.height},limits:{minWidth:n.minWidth,minHeight:n.minHeight,maxWidth:a(n.maxWidth),maxHeight:a(n.maxHeight)}},i)}begin(e,n,r){this.#t=e.pointerId,this.#n=n,this.#r=r,this.#i={x:e.clientX,y:e.clientY},this.#a=n.rect,this.#e.getPane()?.setPointerCapture(e.pointerId),this.#e.setGestureActive(!0)}onPointerMove(e){let n=this.#n;if(n===void 0||e.pointerId!==this.#t)return;let r=this.#e.getZoom()||1,i=AA(n.rect,this.#r,(e.clientX-this.#i.x)/r,(e.clientY-this.#i.y)/r,n.limits);this.#a=i,this.#e.apply(n.key,i),this.#e.emit(n.key,i,!1)}onPointerUp(e){let n=this.#n;return n===void 0||e.pointerId!==this.#t||(this.#a!==void 0&&this.#e.emit(n.key,this.#a,!0),this.#o()),!1}onPointerCancel(e){return e.pointerId===this.#t&&this.abort(),!1}abort(){let e=this.#n;e!==void 0&&(this.#e.apply(e.key,e.rect),this.#o())}#o(){this.#t=null,this.#n=void 0,this.#a=void 0,this.#e.setGestureActive(!1)}};const Aj=[`in`,`out`];var jj=class{#e;#t=[];#n=[];#r;constructor(e){this.#e=e}#i(e){let n=[];for(let[r,i]of this.#e.nodes()){let a=i.hidesAvailable&&!this.#e.isHidden(r)?this.#e.rect(r):void 0;a!==void 0&&n.push(...nA(e,a,i.effectivePortLocation,i.effectiveFlipPorts).map(e=>({node:i,side:e})))}return n}approach(e,n){let r=this.#i(e);for(let e of this.#t)e.node.overlayContains(e.side,n)&&!r.some(n=>n.node===e.node&&n.side===e.side)&&r.push(e);for(let e of this.#t)r.some(n=>n.node===e.node&&n.side===e.side)||e.node.reveal(e.side,0);for(let e of r)e.node.reveal(e.side,1/0);this.#t=r}releaseHeld(){for(let e of this.#t)e.node.reveal(e.side,0);this.#t=[]}hoverNode(e){let n=this.#r;if(n!==void 0&&n!==e)for(let e of Aj)this.#n.some(r=>r.node===n&&r.side===e)||n.reveal(e,400);if(this.#r=e,e!==void 0)for(let n of Aj)e.reveal(n,1/0)}hold(e,n){e.reveal(n,1/0),this.#n=[...this.#n.filter(r=>r.node!==e||r.side!==n),{node:e,side:n}]}pressOn(e){for(let n of this.#n)n.node!==e&&n.node.reveal(n.side,0);this.#n=this.#n.filter(n=>n.node===e)}};function Mj(e,n){let r=Math.max(0,e.x-(n.x+n.width),n.x-(e.x+e.width)),i=Math.max(0,e.y-(n.y+n.height),n.y-(e.y+e.height));return Math.hypot(r,i)}function Nj(e){let n=e.rects.find(n=>n.key===e.dragged);if(n===void 0||e.threshold<=0)return;let r=e.rects.filter(n=>n.key!==e.dragged&&!e.exclude?.has(n.key)).map(e=>({key:e.key,rect:e.rect,gap:Mj(n.rect,e.rect)})).filter(n=>n.gap<=e.threshold).sort((e,n)=>e.gap-n.gap);for(let i of r){let r=n.rect.x+n.rect.width/2>=i.rect.x+i.rect.width/2,a=r?e.tryPair(i.key,e.dragged):e.tryPair(e.dragged,i.key);if(a!==void 0)return a;let o=r?e.tryPair(e.dragged,i.key):e.tryPair(i.key,e.dragged);if(o!==void 0)return o}}function Pj(e,n){return e?.from.ref.node===n?.from.ref.node&&e?.from.ref.port===n?.from.ref.port&&e?.to.ref.node===n?.to.ref.node&&e?.to.ref.port===n?.to.ref.port}var Fj=class{#e;#t;constructor(e){this.#e=e}get path(){return this.#t===void 0?void 0:this.#e.pathFor(this.#t)}update(e){let n=e[0]?.key,r=this.#e.getThreshold();if(r<=0||n===void 0)return;let i=Nj({dragged:n,rects:this.#e.getRects(),threshold:r,exclude:new Set(e.map(e=>e.key).filter(e=>e!==n)),tryPair:this.#e.tryPair});Pj(i,this.#t)||(this.#t=i,this.#e.invalidate())}end(e){let n=this.#t;this.#t=void 0,this.#e.invalidate(),e&&n!==void 0&&this.#e.commit(n)}};function Ij(e,n){let r=new Set(e);return r.has(n)?r.delete(n):r.add(n),r}function Lj(e,n,r){return r?{nodes:Ij(e.nodes,n),edges:e.edges}:e.nodes.has(n)?void 0:{nodes:/* @__PURE__ */ new Set([n]),edges:/* @__PURE__ */ new Set}}function Rj(e,n,r){return r?{nodes:e.nodes,edges:Ij(e.edges,n)}:{nodes:/* @__PURE__ */ new Set,edges:/* @__PURE__ */ new Set([n])}}function zj(e,n){return e.size===n.size&&[...e].every(e=>n.has(e))}var Bj=class{#e;#t;#n;constructor(e){this.#t=/* @__PURE__ */ new Set,this.#n=/* @__PURE__ */ new Set,this.onEdgeClick=e=>{let n=e.target instanceof Element?e.target.getAttribute(`data-edge-id`):null;n!==null&&this.set(Rj(this.snapshot(),n,e.shiftKey||e.metaKey||e.ctrlKey))},this.#e=e}get nodes(){return this.#t}get edges(){return this.#n}snapshot(){return{nodes:this.#t,edges:this.#n}}set(e){e!==void 0&&this.apply(e.nodes,e.edges)}apply(e,n){let r=!zj(e,this.#t)||!zj(n,this.#n);this.#t=new Set(e),this.#n=new Set(n);for(let[e,n]of this.#e.registry.nodes)n.selected=this.#t.has(e);r&&(this.#e.changed(),this.#e.emit(`graph-selection-change`,{nodes:[...this.#t],edges:[...this.#n]}))}forget(e){let n=new Set(this.#t);for(let r of e)n.delete(r);this.#t=n}deleteSelected(){let{registry:e}=this.#e,n=[...this.#t],r=[.../* @__PURE__ */ new Set([...n,...n.flatMap(n=>e.descendants(n))])],i=this.#e.getEdges().filter(e=>this.#n.has(e.id)),a=this.#e.getPortGraph();for(let e of i)a=kk(a,e.from,e.to);let o=new Set(n),s=this.#e.bridgeOnDelete()?new Set(n.filter(n=>!e.hasAncestorIn(n,o))):/* @__PURE__ */ new Set,c=qk(a,r,s,{portInfo:n=>e.portInfoOf(n),portKeys:n=>e.portKeysOf(n),nodeKeys:[...e.nodes.keys()],rules:this.#e.rules()});if(this.#e.emit(`graph-delete`,{nodes:r,edges:i,bridged:c.bridged},!0)){for(let n of r)e.nodes.get(n)?.remove();(r.length>0||i.length>0)&&this.#e.commitEdges(c.graph),this.apply(/* @__PURE__ */ new Set,/* @__PURE__ */ new Set)}}},Vj=class{#e;constructor(e){this.#e=e}connect(e,n){let r=n===void 0?{edge:e}:{edge:e,replaces:n};if(!this.#e.emitCancelable(`graph-connect`,r))return!1;let i=this.#e.getGraph();return n!==void 0&&(i=kk(i,n.from,n.to)),this.#e.commit(Ok(i,e.from,e.to)),!0}disconnect(e,n){if(e.length===0)return!0;if(!this.#e.emitCancelable(`graph-disconnect`,{edges:e,reason:n}))return!1;let r=this.#e.getGraph();for(let n of e)r=kk(r,n.from,n.to);return this.#e.commit(r),!0}},Hj=class{#e;#t;#n=0;#r=0;#i=[];constructor(e){this.#e=e}get state(){return this.#t}get detachedEdgeId(){return this.#t?.mode===`detach`?this.#t.originalEdge?.id:void 0}get previewPath(){let e=this.#t;if(e!==void 0)return oA(e.anchorFlow,e.anchor.side,e.rendered,this.#p())}get active(){return this.#t!==void 0}onPointerDown(e,n){if(e.button!==0)return!1;let r=this.#e.getPane();if(r===void 0||this.#t!==void 0)return!1;let i=this.#e.getPortGraph(),a,o,s;if(n.dir===`out`)a=`new`,o=n;else{let r=Bk(i,n.ref);r.length===0?(a=`new-backward`,o=n):(a=`detach`,s=this.#d(r,e),o=this.#e.portInfoForSource(s.from)??Wj(s.from))}let c=this.#u(o)??QA({x:e.clientX,y:e.clientY},this.#e.getViewport(),this.#f()),l=s===void 0?i:kk(i,s.from,s.to),u=o.dir===`out`,d=Pk(l,this.#e.getNodeGraph(),o.ref,u,this.#e.getAcyclic()),f=[],p=[];for(let e of this.#e.allPorts()){let n=this.#e.portInfoFor(e);if(n===void 0||n.ref.node===o.ref.node&&n.ref.port===o.ref.port)continue;let r=u?{from:o,to:n}:{from:n,to:o},i=Uk(r.from,r.to,d,l,this.#e.getRulesOptions());p.push(e),i.ok?(e.setDragState(`valid`),f.push({info:n,el:e})):e.setDragState(`invalid`)}let m=QA({x:e.clientX,y:e.clientY},this.#e.getViewport(),this.#f());return this.#t={mode:a,pointerId:e.pointerId,anchor:o,anchorFlow:c,originalEdge:s,workingGraph:l,context:d,candidates:this.#a(f),valid:f,markedPorts:p,glowing:/* @__PURE__ */ new Set,pointerFlow:m,client:{x:e.clientX,y:e.clientY},startClient:{x:e.clientX,y:e.clientY},moved:!1,goal:m,rendered:{...m},snap:void 0},r.setPointerCapture(e.pointerId),this.#e.setGestureActive(!0),this.#e.invalidate(),this.#g(),this.#m(),!0}#a(e){let n=[];for(let r of e){let e=this.#u(r.info);e!==void 0&&n.push({info:r.info,el:r.el,pos:e})}return n}relayout(){this.#t!==void 0&&(this.#t.candidates=this.#a(this.#t.valid))}onPointerMove(e){let n=this.#t;if(n===void 0||e.pointerId!==n.pointerId)return;n.client={x:e.clientX,y:e.clientY},!n.moved&&Math.hypot(n.client.x-n.startClient.x,n.client.y-n.startClient.y)>=3&&(n.moved=!0),n.pointerFlow=QA(n.client,this.#e.getViewport(),this.#f()),this.#e.onApproach?.(n.pointerFlow,n.client);let r=this.#e.getViewport(),i=this.#f();if(n.snap=IA(n.candidates.map(e=>{let n=$A(e.pos,r,i);return{ref:e.info.ref,x:n.x,y:n.y}}),n.client,this.#e.getSnapRadius(),n.snap),n.snap===void 0&&this.#e.getEasyConnect?.()===!0){let e=this.#e.nodeAt?.(n.pointerFlow),a=(e===void 0?[]:n.candidates.filter(n=>n.info.ref.node===e)).sort((e,r)=>Math.hypot(e.pos.x-n.pointerFlow.x,e.pos.y-n.pointerFlow.y)-Math.hypot(r.pos.x-n.pointerFlow.x,r.pos.y-n.pointerFlow.y))[0];if(a!==void 0){let e=$A(a.pos,r,i);n.snap={ref:a.info.ref,x:e.x,y:e.y,distance:0}}}n.goal=n.snap===void 0?n.pointerFlow:this.#l(n.snap.ref)??n.pointerFlow,this.#c(),this.#m(),this.#e.invalidate()}onPointerUp(e){let n=this.#t;return n===void 0||e.pointerId!==n.pointerId||(this.#s(),n.moved&&this.#o(n)),!1}onPointerCancel(e){return this.#s(),!1}abort(){this.#s()}#o(e){let n=e.snap;if(n!==void 0){let r=e.candidates.find(e=>Uj(e.info.ref,n.ref));if(r!==void 0){let n=e.mode===`new-backward`?{from:r.info,to:e.anchor}:{from:e.anchor,to:r.info},i=Uk(n.from,n.to,e.context,e.workingGraph,this.#e.getRulesOptions());if(i.ok){let e={id:Ek(n.from.ref,n.to.ref),from:n.from.ref,to:n.to.ref};if(i.replaces!==void 0&&!this.#e.requestDisconnect([i.replaces],`replace`))return;!this.#e.requestConnect(e,i.replaces)&&i.replaces!==void 0&&this.#e.commitEdges(Ok(this.#e.getPortGraph(),i.replaces.from,i.replaces.to));return}}}e.mode===`detach`&&e.originalEdge!==void 0?this.#e.requestDisconnect([e.originalEdge],`detach`):this.#e.emitConnectEnd(e.anchor.ref,e.pointerFlow,e.client)}#s(){let e=this.#t;if(e!==void 0){this.#t=void 0,this.#n!==0&&(cancelAnimationFrame(this.#n),this.#n=0);for(let n of e.markedPorts)n.setDragState(void 0);for(let n of e.glowing)n.setMagnet(!1,0);this.#_(),this.#e.setGestureActive(!1),this.#e.invalidate()}}#c(){let e=this.#t;if(e===void 0)return;let n=this.#e.getSnapRadius(),r=this.#e.getViewport(),i=this.#f(),a=/* @__PURE__ */ new Set;for(let o of e.candidates){let s=$A(o.pos,r,i),c=Math.hypot(s.x-e.client.x,s.y-e.client.y),l=e.snap!==void 0&&Uj(e.snap.ref,o.info.ref),u=LA(c,n);(u>0||l)&&(a.add(o.el),o.el.setMagnet(l,u))}for(let n of e.glowing)a.has(n)||n.setMagnet(!1,0);e.glowing.clear();for(let n of a)e.glowing.add(n)}#l(e){let n=this.#t;if(n!==void 0)return n.candidates.find(n=>Uj(n.info.ref,e))?.pos}#u(e){let n=this.#e.portOffset(e.ref.node,e.ref.port),r=this.#e.nodePosition(e.ref.node);if(n!==void 0&&r!==void 0)return{x:r.x+n.x,y:r.y+n.y}}#d(e,n){if(e.length===1)return e[0];let r=this.#e.getViewport(),i=this.#f(),a=e[0],o=1/0;for(let s of e){let e=this.#e.portInfoForSource(s.from);if(e===void 0)continue;let c=this.#u(e);if(c===void 0)continue;let l=$A(c,r,i),u=Math.hypot(l.x-n.clientX,l.y-n.clientY);u<o&&(a=s,o=u)}return a}#f(){let e=this.#e.getPaneRect();return e===void 0?{x:0,y:0}:{x:e.left,y:e.top}}#p(){let e=this.#t;if(e===void 0)return`right`;if(e.snap!==void 0){let n=e.candidates.find(n=>Uj(n.info.ref,e.snap.ref));if(n!==void 0)return n.info.side}switch(e.anchor.side){case`left`:return`right`;case`right`:return`left`;case`top`:return`bottom`;case`bottom`:return`top`}}#m(){this.#n===0&&(this.#r=performance.now(),this.#n=requestAnimationFrame(this.#h))}#h=e=>{let n=this.#t;if(n===void 0){this.#n=0;return}let r=Math.min(50,e-this.#r);this.#r=e;let i=this.#e.prefersReducedMotion()?0:60;n.rendered=RA(n.rendered,n.goal,r,i),this.#e.invalidate(),this.#n=zA(n.rendered,n.goal)?0:requestAnimationFrame(this.#h)};#g(){let e=e=>{e.key===`Escape`&&this.abort()};window.addEventListener(`keydown`,e,!0),this.#i.push(()=>window.removeEventListener(`keydown`,e,!0))}#_(){for(let e of this.#i)e();this.#i=[]}};function Uj(e,n){return e.node===n.node&&e.port===n.port}function Wj(e){return{ref:e,dir:`out`,type:``,max:1/0,side:`right`}}function Gj(e,n,r,i,a){let o=[];for(let r of e){let e=n.collapsedProxyOf(r.from.node),a=n.collapsedProxyOf(r.to.node),s=n.isHidden(r.from.node)&&e===void 0,c=n.isHidden(r.to.node)&&a===void 0;if(s||c||e!==void 0&&e===a)continue;let l=e===void 0?n.portGeometry(r.from):n.virtualPortGeometry(e,`out`),u=a===void 0?n.portGeometry(r.to):n.virtualPortGeometry(a,`in`);l===void 0||u===void 0?n.portInfoOf(r.from)!==void 0&&n.portInfoOf(r.to)!==void 0||i.has(r.id)||(i.add(r.id),console.warn(`[ixfx-node-graph] edge "${r.id}" references a missing node or port; kept but not drawn`)):o.push({edge:r,a:l,b:u,from:{node:e??r.from.node,port:e===void 0?r.from.port:`@out`,pos:l.pos,side:l.side},to:{node:a??r.to.node,port:a===void 0?r.to.port:`@in`,pos:u.pos,side:u.side}})}let s=Kj(o,n,a.router,i);return o.map(({edge:e,a:n,b:i})=>{let o=s?.get(e.id),c=a.hints[e.id],l=o!==void 0&&o.length>=2?hA(o):c?.waypoints!==void 0&&c.waypoints.length>0?hA([n.pos,...c.waypoints,i.pos]):mA(c?.style??a.style,n.pos,n.side,i.pos,i.side);return{id:e.id,d:l.d,mid:l.mid,selected:r.has(e.id)}})}function Kj(e,n,r,i){if(r!==void 0&&e.length!==0)try{return r({edges:e.map(e=>({id:e.edge.id,from:e.from,to:e.to})),obstacles:n.rects()})}catch(e){i.has(`router`)||(i.add(`router`),console.warn(`[ixfx-node-graph] edgeRouter threw; wires are drawn without it`,e));return}}function qj(e,n,r,i,o,c=void 0){return s`
|
|
11561
|
+
`;function ZA(e,n,r){return Math.min(r,Math.max(n,e))}function QA(e,n,r){return{x:(e.x-r.x-n.x)/n.zoom,y:(e.y-r.y-n.y)/n.zoom}}function $A(e,n,r){return{x:e.x*n.zoom+n.x+r.x,y:e.y*n.zoom+n.y+r.y}}function ej(e,n,r,i,a,o){let s=ZA(e.zoom*i,a,o),c=(n.x-r.x-e.x)/e.zoom,l=(n.y-r.y-e.y)/e.zoom;return{zoom:s,x:n.x-r.x-c*s,y:n.y-r.y-l*s}}function tj(e,n,r){return{x:e.x+n,y:e.y+r,zoom:e.zoom}}function nj(e,n,r,i){let a=Math.max(1,e.width),o=Math.max(1,e.height),s=n-i.padding*2,c=r-i.padding*2,l=s>0&&c>0?ZA(Math.min(s/a,c/o),i.minZoom,i.maxZoom):i.minZoom;return{zoom:l,x:n/2-(e.x+a/2)*l,y:r/2-(e.y+o/2)*l}}function rj(e){if(e.length===0)return{x:0,y:0,width:0,height:0};let n=1/0,r=1/0,i=-1/0,a=-1/0;for(let o of e)n=Math.min(n,o.x),r=Math.min(r,o.y),i=Math.max(i,o.x+o.width),a=Math.max(a,o.y+o.height);return{x:n,y:r,width:i-n,height:a-r}}function ij(e,n,r){return nj(rj(e),n.width,n.height,r)}function aj(e){let n=e instanceof Element?e:null;return n===null?!1:n instanceof HTMLElement&&n.isContentEditable?!0:n.closest(`input, textarea, select, button, [contenteditable]`)!==null}var oj=class{#e;#t;#n=null;#r={x:0,y:0};#i=null;#a=/* @__PURE__ */ new Map;#o=null;#s=!1;constructor(e,n){this.#e=e,this.#t=n,e.addController(this)}hostDisconnected(){this.setSpacePan(!1)}onKeyDown(e){return e.key===` `&&(e.repeat||(e.preventDefault(),this.setSpacePan(!0)),!0)}onKeyUp(e){(e===void 0||e.key===` `)&&this.setSpacePan(!1)}get spacePan(){return this.#s}setSpacePan(e){this.#s!==e&&(this.#s=e,this.#t.setSpacePan(e))}onPointerDown(e){let n=this.#t.getPane();return n===void 0?!1:this.#n!==null&&e.pointerId!==this.#n?(this.#a.set(this.#n,this.#r),this.#a.set(e.pointerId,{x:e.clientX,y:e.clientY}),this.#c(),!0):!(e.target===n||e.button===1||this.#s&&!aj(e.target))||e.button===2?!1:(this.#n=e.pointerId,this.#r={x:e.clientX,y:e.clientY},this.#i=this.#t.getViewport(),this.#a.set(e.pointerId,this.#r),n.setPointerCapture(e.pointerId),this.#t.setGestureActive(!0),!0)}startPinch(e,n){this.#n=e.pointerId,this.#r=e.point,this.#i=this.#t.getViewport(),this.#a.set(e.pointerId,e.point),this.#a.set(n.pointerId,{x:n.clientX,y:n.clientY}),this.#t.getPane()?.setPointerCapture(n.pointerId),this.#t.setGestureActive(!0),this.#c()}onPointerMove(e){if(this.#o!==null){this.#a.set(e.pointerId,{x:e.clientX,y:e.clientY}),this.#l();return}if(this.#n===null||e.pointerId!==this.#n)return;this.#a.set(e.pointerId,{x:e.clientX,y:e.clientY});let n=this.#i;n!==null&&this.#t.setViewport({x:n.x+(e.clientX-this.#r.x),y:n.y+(e.clientY-this.#r.y),zoom:n.zoom})}onPointerUp(e){return this.#a.delete(e.pointerId),this.#o===null?e.pointerId===this.#n?(this.#u(),!1):this.#n!==null:this.#a.size>=2?(this.#c(),!0):(this.#u(),!1)}onPointerCancel(e){return this.onPointerUp(e)}addPointer(e){this.#n!==null&&this.#o===null&&(this.#a.set(e.pointerId,{x:e.clientX,y:e.clientY}),this.#c())}onWheel(e){if(this.#t.isWheelBlockedTarget(e))return;let n=this.#t.getPane();if(n===void 0)return;let r=e.deltaX,i=e.deltaY;e.deltaMode===1?(r*=16,i*=16):e.deltaMode===2&&(r*=n.clientHeight,i*=n.clientHeight);let a=e.ctrlKey||e.metaKey,o=this.#t.getWheelMode(),s=this.#t.getPaneRect();if(s===void 0)return;let c={x:s.left,y:s.top},l=this.#t.getViewport();if(e.preventDefault(),a||o===`zoom`){let n=a?.01:.002;this.#t.setViewport(ej(l,{x:e.clientX,y:e.clientY},c,Math.exp(-i*n),this.#t.getMinZoom(),this.#t.getMaxZoom()))}else this.#t.setViewport(tj(l,-r,-i))}#c(){let e=[...this.#a.values()];if(e.length<2){this.#o=null;return}let[n,r]=e;this.#o={dist:Math.hypot(r.x-n.x,r.y-n.y),mid:{x:(n.x+r.x)/2,y:(n.y+r.y)/2}}}#l(){let e=this.#o,n=[...this.#a.values()];if(e===null||n.length<2)return;let[r,i]=n,a=Math.hypot(i.x-r.x,i.y-r.y),o={x:(r.x+i.x)/2,y:(r.y+i.y)/2},s=this.#t.getPaneRect();if(s===void 0||e.dist<=0)return;let c={x:s.left,y:s.top},l=ej(this.#t.getViewport(),o,c,a/e.dist,this.#t.getMinZoom(),this.#t.getMaxZoom());l=tj(l,o.x-e.mid.x,o.y-e.mid.y),this.#o={dist:a,mid:o},this.#t.setViewport(l)}#u(){this.#n=null,this.#i=null,this.#o=null,this.#a.clear(),this.#t.setGestureActive(!1)}};function sj(e,n){for(let r of e)if(r instanceof Element&&r.localName===n)return r}function cj(e,n){for(let r of e.composedPath())if(r instanceof Element&&(r.closest(`[${n}]`)!==null||aj(r)))return!0;return!1}const lj=e=>cj(e,`data-nodrag`),uj=e=>cj(e,`data-nowheel`);function dj(e){return typeof e?.openAt==`function`}function fj(e,n){let r=sj(e,`ixfx-graph-node`),i=sj(e,`ixfx-graph-port`);if(r!==void 0&&i!==void 0&&i.status===`available`)return{kind:`port`,id:`${r.key}/${i.key}`,menu:{openAt:(e,n)=>void r.openPortMenu(i,e,n)}};if(r!==void 0&&(r.key??``)!==``){let e=r.querySelector(`:scope > [slot="context-menu"]`);return{kind:`node`,id:r.key,menu:dj(e)?e:void 0}}let a=e.find(e=>e instanceof Element&&e.hasAttribute(`data-edge-id`))?.getAttribute(`data-edge-id`)??void 0,o=a===void 0?`pane`:`edge`,s=n.querySelector(`:scope > [slot="${o}-menu"]`);return{kind:o,id:a,menu:dj(s)?s:void 0}}function pj(e,n){let r=()=>e.openAt(n.clientX,n.clientY);n.buttons===0?r():document.addEventListener(`pointerup`,()=>setTimeout(r,0),{capture:!0,once:!0})}function mj(e){let n=e[0];if(!(n instanceof Element)||n.getAttribute(`slot`)!==`context-menu`)return;let r=n.parentElement;return r?.localName===`ixfx-graph-node`&&(r.key??``)!==``?r.key:void 0}const hj=2e3;function gj(e){return typeof e!=`number`||!Number.isFinite(e)||e<=0?0:Math.min(e,hj)}function _j(e,n,r){let i=gj(r);if(i===(e[n]??0))return e;if(i===0){let{[n]:r,...i}=e;return i}return{...e,[n]:i}}function vj(e,n,r){let{[n]:i,...a}=e;return r===void 0?a:{...a,[n]:r}}var yj=class extends n{constructor(...e){super(...e),this.wireFlow={},this.edgeLabels={},this.edgeStyle=`bezier`,this.edgeHints={},this.edgeRouter=void 0}setWireFlow(e,n){this.wireFlow=_j(this.wireFlow,e,n)}setEdgeLabel(e,n){this.edgeLabels=vj(this.edgeLabels,e,n===``?void 0:n)}setEdgeHint(e,n){this.edgeHints=vj(this.edgeHints,e,n)}};E([d({attribute:!1})],yj.prototype,`wireFlow`,void 0),E([d({attribute:!1})],yj.prototype,`edgeLabels`,void 0),E([d({type:String,attribute:`edge-style`})],yj.prototype,`edgeStyle`,void 0),E([d({attribute:!1})],yj.prototype,`edgeHints`,void 0),E([d({attribute:!1})],yj.prototype,`edgeRouter`,void 0);function bj(e,n,r,i=!1){return e.dispatchEvent(new CustomEvent(n,{detail:r,bubbles:!0,composed:!0,cancelable:i}))}async function xj(e,n,r){let i=n(e);if(i==null)return;i.x=e.point.x,i.y=e.point.y,r.append(i),r.register(),await i.updateComplete;let a=r.portsOf(i.key).find(n=>r.canConnect(e.from,n));if(a===void 0)return{node:i};let o=r.layout(i.key)?.offsets.get(a.ref.port);return o!==void 0&&(i.x=e.point.x-o.x,i.y=e.point.y-o.y),r.connect(e.from.ref,a.ref)?{node:i,connectedTo:a.ref}:{node:i}}function Sj(e,n){let r=0,i=0,a=0,o=0;for(let s of n)r=Math.max(r,s.y-e.y),o=Math.max(o,s.x-e.x),i=Math.max(i,e.x+e.width-(s.x+s.width)),a=Math.max(a,e.y+e.height-(s.y+s.height));return r>0||i>0||a>0||o>0?{top:Math.max(0,r),right:Math.max(0,i),bottom:Math.max(0,a),left:Math.max(0,o)}:void 0}function Cj(e){if(e===void 0)return``;let n=e=>`${e>0?Math.round(e*100)/100:-400}px`;return`inset(${n(e.top)} ${n(e.right)} ${n(e.bottom)} ${n(e.left)})`}function wj(e,n,r){switch(e){case`left`:return{x:0,y:r/2};case`right`:return{x:n,y:r/2};case`top`:return{x:n/2,y:0};case`bottom`:return{x:n/2,y:r}}}function Tj(e,n){let r=e.getBoundingClientRect(),i=n>0?n:1,a=/* @__PURE__ */ new Map,o=e.hasAttribute(`data-collapsed`),s=e.getAttribute(`data-port-location`)===`horizontal`?`horizontal`:`vertical`,c=e.hasAttribute(`data-flip-ports`),l=e.querySelectorAll(`ixfx-graph-port`);for(let e of l){let n=e.getAttribute(`key`)??``;if(n===``||!o&&e.getClientRects().length===0)continue;let l=(e.shadowRoot?.querySelector(`.dot`)??e).getBoundingClientRect(),u=e.getAttribute(`side`),d=e.getAttribute(`dir`)===`out`?`out`:`in`,f=u===`left`||u===`right`||u===`top`||u===`bottom`?u:aA(d,s,c),p=o?wj(f,r.width/i,r.height/i):{x:(l.left+l.width/2-r.left)/i,y:(l.top+l.height/2-r.top)/i};a.set(n,{key:n,...p,side:f})}return{offsets:a,width:r.width/i,height:r.height/i}}function Ej(e,n){let r=[],i=[],a=[];for(let o of e){let e=n.has(o.from.node),s=n.has(o.to.node);e&&s?a.push(o):s?r.push(o):e&&i.push(o)}return{incoming:r,outgoing:i,internal:a}}function Dj(e,n){let r=/* @__PURE__ */ new Map,i=(e,n)=>{let i=r.get(e)??{in:0,out:0};i[n]++,r.set(e,i)};for(let r of e){let e=n(r.from.node),a=n(r.to.node);(e===void 0||e!==a)&&(e!==void 0&&i(e,`out`),a!==void 0&&i(a,`in`))}return r}var Oj=class{#e;#t;#n;#r;#i;#a;constructor(e){this.nodes=/* @__PURE__ */ new Map,this.#t=/* @__PURE__ */ new Map,this.#n=/* @__PURE__ */ new Map,this.#r=/* @__PURE__ */ new Map,this.#i=/* @__PURE__ */ new Set,this.#a={dragBy:`node`,availablePorts:`show`,portLayout:`rail`,portLocation:`vertical`,flipPorts:!1,dblclickToggle:!1},this.#e=e}setDefaults(e){this.#a=e;for(let e of this.nodes.values())this.#o(e)}#o(e){e.inheritedDragBy=this.#a.dragBy,e.inheritedAvailablePorts=this.#a.availablePorts,e.inheritedPortLayout=this.#a.portLayout,e.inheritedPortLocation=this.#a.portLocation,e.inheritedFlipPorts=this.#a.flipPorts,e.inheritedDblclickToggle=this.#a.dblclickToggle}syncPortStatuses(e){for(let[n,r]of this.#t)n.setConnected(e.has(wk({node:r,port:n.key})));for(let e of this.nodes.values())e.refreshPortSlots()}refresh(e,n){let r=/* @__PURE__ */ new Map;for(let n of e)n instanceof X&&n.key!==``&&r.set(n.key,n);let i=[];for(let[e,n]of this.nodes)r.has(e)||(this.nodes.delete(e),this.#r.delete(e),this.#e.unobserve(n),i.push(e));for(let[e,i]of r)this.nodes.has(e)||(this.nodes.set(e,i),this.#r.delete(e),this.#e.observe(i),i.selected=n(e),this.#o(i));return this.#s(),this.syncOrigins(),i}#s(){this.#t.clear(),this.#n.clear();for(let[e,n]of this.nodes)for(let r of n.querySelectorAll(`ixfx-graph-port`)){if(r.key===``)continue;let n=`${e}\u0000${r.key}`;this.#n.has(n)&&!this.#i.has(n)&&(this.#i.add(n),console.warn(`[ixfx-node-graph] node "${e}" has more than one port with key "${r.key}"; port keys must be unique within a node (in and out ports included). Only the last is wireable.`)),this.#t.set(r,e),this.#n.set(n,r)}}layout(e){let n=this.nodes.get(e);if(n===void 0||n.hasAttribute(`data-hidden`))return;let r=this.#r.get(e);return r===void 0&&(r=Tj(n,this.#e.getZoom()),this.#r.set(e,r)),r}invalidateLayout(e){this.#r.delete(e)}noteGeometry(e,n,r){let i=this.#r.get(e);(i===void 0||Math.abs(i.width-n)>.5||Math.abs(i.height-r)>.5)&&this.#r.delete(e)}snapshot(){return[...this.nodes.values()].map(e=>({key:e.key,x:e.x,y:e.y,label:e.label,ports:this.portsOf(e.key)}))}cachedLayout(e){return this.#r.get(e)}parentKey(e){let n=this.nodes.get(e)?.parent??``;return n!==``&&n!==e&&this.nodes.has(n)?n:void 0}abs(e){let n=0,r=0,i=e;for(let e=0;i!==void 0&&e<64;e++){let e=this.nodes.get(i);if(e===void 0)break;n+=e.x,r+=e.y,i=this.parentKey(i)}return{x:n,y:r}}depth(e){let n=0,r=this.parentKey(e);for(;r!==void 0&&n<64;)n++,r=this.parentKey(r);return n}descendants(e){let n=[];for(let r of this.nodes.keys()){let i=this.parentKey(r);for(let a=0;i!==void 0&&a<64;a++){if(i===e){n.push(r);break}i=this.parentKey(i)}}return n}hasAncestorIn(e,n){let r=this.parentKey(e);for(let e=0;r!==void 0&&e<64;e++){if(n.has(r))return!0;r=this.parentKey(r)}return!1}isHidden(e){return this.nodes.get(e)?.hasAttribute(`data-hidden`)??!1}syncOrigins(){for(let[e,n]of this.nodes){let r=this.parentKey(e),i=r===void 0?{x:0,y:0}:this.abs(r);n.setOrigin(i.x,i.y,this.depth(e)),n.setHiddenByAncestor(this.#c(e).some(e=>this.nodes.get(e)?.isCollapsed===!0))}for(let[e,n]of this.nodes){let r=n.hasAttribute(`data-hidden`)?void 0:this.rect(e),i=this.#c(e).map(e=>this.rect(e)).filter(e=>e!==void 0);n.setClip(r===void 0||i.length===0?``:Cj(Sj(r,i)))}}#c(e){let n=[],r=this.parentKey(e);for(;r!==void 0&&n.length<64;)n.push(r),r=this.parentKey(r);return n}applyRect(e,n){let r=this.nodes.get(e);r!==void 0&&(r.x=n.x,r.y=n.y,r.setSize(n.width,n.height),this.invalidateLayout(e),this.syncOrigins())}clampToParent(e,n){let r=this.nodes.get(e),i=this.parentKey(e),a=this.layout(e),o=i===void 0?void 0:this.layout(i);return r?.extent!==`parent`||a===void 0||o===void 0?n:{x:Math.min(Math.max(n.x,0),Math.max(0,o.width-a.width)),y:Math.min(Math.max(n.y,0),Math.max(0,o.height-a.height))}}collapsedProxyOf(e){if(this.isHidden(e))return this.#c(e).find(e=>this.nodes.get(e)?.isCollapsed===!0&&!this.isHidden(e))}virtualPortGeometry(e,n){let r=this.rect(e);if(r===void 0)return;let i=this.nodes.get(e),a=Qk(n,i?.effectivePortLocation,i?.effectiveFlipPorts),o={x:r.x+r.width/2,y:r.y+r.height/2};switch(a){case`left`:return{pos:{x:r.x,y:o.y},side:a};case`right`:return{pos:{x:r.x+r.width,y:o.y},side:a};case`top`:return{pos:{x:o.x,y:r.y},side:a};case`bottom`:return{pos:{x:o.x,y:r.y+r.height},side:a}}}syncVirtualPorts(e){let n=Dj(e,e=>this.collapsedProxyOf(e));for(let[e,r]of this.nodes){let i=n.get(e);r.setVirtualPorts(i?.in??0,i?.out??0)}}rect(e){let n=this.layout(e);if(n===void 0)return;let r=this.abs(e);return{x:r.x,y:r.y,width:n.width,height:n.height}}rects(){let e=[];for(let n of this.nodes.keys()){if(this.isHidden(n))continue;let r=this.rect(n);r!==void 0&&e.push({key:n,rect:r})}return e}nodeAt(e,n=/* @__PURE__ */ new Set){let r;for(let{key:i,rect:a}of this.rects()){if(n.has(i)||e.x<a.x||e.x>a.x+a.width||e.y<a.y||e.y>a.y+a.height)continue;let o=this.depth(i);(r===void 0||o>=r.depth)&&(r={key:i,depth:o})}return r?.key}portGeometry(e){let n=this.layout(e.node)?.offsets.get(e.port);if(n===void 0)return;let r=this.abs(e.node);return{pos:{x:r.x+n.x,y:r.y+n.y},side:n.side}}portInfoFor(e){if(e===void 0||e.key===``)return;let n=this.#t.get(e);return n===void 0?void 0:e.portInfo(n)}portInfoOf(e){return this.portInfoFor(this.#n.get(`${e.node}\u0000${e.port}`))}portsOf(e){let n=[];for(let[r,i]of this.#t){if(i!==e)continue;let a=this.portInfoFor(r);a!==void 0&&n.push(a)}return n}wireLookups(){return{portInfoFor:e=>this.portInfoFor(e),portInfoForSource:e=>this.portInfoOf(e),allPorts:()=>this.allPorts(),portOffset:(e,n)=>this.layout(e)?.offsets.get(n),nodePosition:e=>this.nodes.has(e)?this.abs(e):void 0,nodeAt:e=>this.nodeAt(e)}}portKeysOf(e){return[...this.#t].filter(([,n])=>n===e).map(([e])=>e.key)}allPorts(){return[...this.#t].filter(([,e])=>!this.isHidden(e)&&this.nodes.get(e)?.isCollapsed!==!0).map(([e])=>e)}},kj=class{#e;#t=null;#n;#r=`se`;#i={x:0,y:0};#a;constructor(e){this.#e=e}beginForNode(e,n,r,i){let a=e=>e>0?e:1/0;this.begin(e,{key:n.key,rect:{x:n.x,y:n.y,width:r.width,height:r.height},limits:{minWidth:n.minWidth,minHeight:n.minHeight,maxWidth:a(n.maxWidth),maxHeight:a(n.maxHeight)}},i)}begin(e,n,r){this.#t=e.pointerId,this.#n=n,this.#r=r,this.#i={x:e.clientX,y:e.clientY},this.#a=n.rect,this.#e.getPane()?.setPointerCapture(e.pointerId),this.#e.setGestureActive(!0)}onPointerMove(e){let n=this.#n;if(n===void 0||e.pointerId!==this.#t)return;let r=this.#e.getZoom()||1,i=AA(n.rect,this.#r,(e.clientX-this.#i.x)/r,(e.clientY-this.#i.y)/r,n.limits);this.#a=i,this.#e.apply(n.key,i),this.#e.emit(n.key,i,!1)}onPointerUp(e){let n=this.#n;return n===void 0||e.pointerId!==this.#t||(this.#a!==void 0&&this.#e.emit(n.key,this.#a,!0),this.#o()),!1}onPointerCancel(e){return e.pointerId===this.#t&&this.abort(),!1}abort(){let e=this.#n;e!==void 0&&(this.#e.apply(e.key,e.rect),this.#o())}#o(){this.#t=null,this.#n=void 0,this.#a=void 0,this.#e.setGestureActive(!1)}};const Aj=[`in`,`out`];var jj=class{#e;#t=[];#n=[];#r;constructor(e){this.#e=e}#i(e){let n=[];for(let[r,i]of this.#e.nodes()){let a=i.hidesAvailable&&!this.#e.isHidden(r)?this.#e.rect(r):void 0;a!==void 0&&n.push(...nA(e,a,i.effectivePortLocation,i.effectiveFlipPorts).map(e=>({node:i,side:e})))}return n}approach(e,n){let r=this.#i(e);for(let e of this.#t)e.node.overlayContains(e.side,n)&&!r.some(n=>n.node===e.node&&n.side===e.side)&&r.push(e);for(let e of this.#t)r.some(n=>n.node===e.node&&n.side===e.side)||e.node.reveal(e.side,0);for(let e of r)e.node.reveal(e.side,1/0);this.#t=r}releaseHeld(){for(let e of this.#t)e.node.reveal(e.side,0);this.#t=[]}hoverNode(e){let n=this.#r;if(n!==void 0&&n!==e)for(let e of Aj)this.#n.some(r=>r.node===n&&r.side===e)||n.reveal(e,400);if(this.#r=e,e!==void 0)for(let n of Aj)e.reveal(n,1/0)}hold(e,n){e.reveal(n,1/0),this.#n=[...this.#n.filter(r=>r.node!==e||r.side!==n),{node:e,side:n}]}pressOn(e){for(let n of this.#n)n.node!==e&&n.node.reveal(n.side,0);this.#n=this.#n.filter(n=>n.node===e)}};function Mj(e,n){let r=Math.max(0,e.x-(n.x+n.width),n.x-(e.x+e.width)),i=Math.max(0,e.y-(n.y+n.height),n.y-(e.y+e.height));return Math.hypot(r,i)}function Nj(e){let n=e.rects.find(n=>n.key===e.dragged);if(n===void 0||e.threshold<=0)return;let r=e.rects.filter(n=>n.key!==e.dragged&&!e.exclude?.has(n.key)).map(e=>({key:e.key,rect:e.rect,gap:Mj(n.rect,e.rect)})).filter(n=>n.gap<=e.threshold).sort((e,n)=>e.gap-n.gap);for(let i of r){let r=n.rect.x+n.rect.width/2>=i.rect.x+i.rect.width/2,a=r?e.tryPair(i.key,e.dragged):e.tryPair(e.dragged,i.key);if(a!==void 0)return a;let o=r?e.tryPair(e.dragged,i.key):e.tryPair(i.key,e.dragged);if(o!==void 0)return o}}function Pj(e,n){return e?.from.ref.node===n?.from.ref.node&&e?.from.ref.port===n?.from.ref.port&&e?.to.ref.node===n?.to.ref.node&&e?.to.ref.port===n?.to.ref.port}var Fj=class{#e;#t;constructor(e){this.#e=e}get path(){return this.#t===void 0?void 0:this.#e.pathFor(this.#t)}update(e){let n=e[0]?.key,r=this.#e.getThreshold();if(r<=0||n===void 0)return;let i=Nj({dragged:n,rects:this.#e.getRects(),threshold:r,exclude:new Set(e.map(e=>e.key).filter(e=>e!==n)),tryPair:this.#e.tryPair});Pj(i,this.#t)||(this.#t=i,this.#e.invalidate())}end(e){let n=this.#t;this.#t=void 0,this.#e.invalidate(),e&&n!==void 0&&this.#e.commit(n)}};function Ij(e,n){let r=new Set(e);return r.has(n)?r.delete(n):r.add(n),r}function Lj(e,n,r){return r?{nodes:Ij(e.nodes,n),edges:e.edges}:e.nodes.has(n)?void 0:{nodes:/* @__PURE__ */ new Set([n]),edges:/* @__PURE__ */ new Set}}function Rj(e,n,r){return r?{nodes:e.nodes,edges:Ij(e.edges,n)}:{nodes:/* @__PURE__ */ new Set,edges:/* @__PURE__ */ new Set([n])}}function zj(e,n){return e.size===n.size&&[...e].every(e=>n.has(e))}var Bj=class{#e;#t;#n;constructor(e){this.#t=/* @__PURE__ */ new Set,this.#n=/* @__PURE__ */ new Set,this.onEdgeClick=e=>{let n=e.target instanceof Element?e.target.getAttribute(`data-edge-id`):null;n!==null&&this.set(Rj(this.snapshot(),n,e.shiftKey||e.metaKey||e.ctrlKey))},this.#e=e}get nodes(){return this.#t}get edges(){return this.#n}snapshot(){return{nodes:this.#t,edges:this.#n}}set(e){e!==void 0&&this.apply(e.nodes,e.edges)}apply(e,n){let r=!zj(e,this.#t)||!zj(n,this.#n);this.#t=new Set(e),this.#n=new Set(n);for(let[e,n]of this.#e.registry.nodes)n.selected=this.#t.has(e);r&&(this.#e.changed(),this.#e.emit(`graph-selection-change`,{nodes:[...this.#t],edges:[...this.#n]}))}forget(e){let n=new Set(this.#t);for(let r of e)n.delete(r);this.#t=n}deleteSelected(){let{registry:e}=this.#e,n=[...this.#t],r=[.../* @__PURE__ */ new Set([...n,...n.flatMap(n=>e.descendants(n))])],i=this.#e.getEdges().filter(e=>this.#n.has(e.id)),a=this.#e.getPortGraph();for(let e of i)a=kk(a,e.from,e.to);let o=new Set(n),s=this.#e.bridgeOnDelete()?new Set(n.filter(n=>!e.hasAncestorIn(n,o))):/* @__PURE__ */ new Set,c=qk(a,r,s,{portInfo:n=>e.portInfoOf(n),portKeys:n=>e.portKeysOf(n),nodeKeys:[...e.nodes.keys()],rules:this.#e.rules()});if(this.#e.emit(`graph-delete`,{nodes:r,edges:i,bridged:c.bridged},!0)){for(let n of r)e.nodes.get(n)?.remove();(r.length>0||i.length>0)&&this.#e.commitEdges(c.graph),this.apply(/* @__PURE__ */ new Set,/* @__PURE__ */ new Set)}}},Vj=class{#e;constructor(e){this.#e=e}connect(e,n){let r=n===void 0?{edge:e}:{edge:e,replaces:n};if(!this.#e.emitCancelable(`graph-connect`,r))return!1;let i=this.#e.getGraph();return n!==void 0&&(i=kk(i,n.from,n.to)),this.#e.commit(Ok(i,e.from,e.to)),!0}disconnect(e,n){if(e.length===0)return!0;if(!this.#e.emitCancelable(`graph-disconnect`,{edges:e,reason:n}))return!1;let r=this.#e.getGraph();for(let n of e)r=kk(r,n.from,n.to);return this.#e.commit(r),!0}},Hj=class{#e;#t;#n=0;#r=0;#i=[];constructor(e){this.#e=e}get state(){return this.#t}get detachedEdgeId(){return this.#t?.mode===`detach`?this.#t.originalEdge?.id:void 0}get previewPath(){let e=this.#t;if(e!==void 0)return oA(e.anchorFlow,e.anchor.side,e.rendered,this.#p())}get active(){return this.#t!==void 0}onPointerDown(e,n){if(e.button!==0)return!1;let r=this.#e.getPane();if(r===void 0||this.#t!==void 0)return!1;let i=this.#e.getPortGraph(),a,o,s;if(n.dir===`out`)a=`new`,o=n;else{let r=Bk(i,n.ref);r.length===0?(a=`new-backward`,o=n):(a=`detach`,s=this.#d(r,e),o=this.#e.portInfoForSource(s.from)??Wj(s.from))}let c=this.#u(o)??QA({x:e.clientX,y:e.clientY},this.#e.getViewport(),this.#f()),l=s===void 0?i:kk(i,s.from,s.to),u=o.dir===`out`,d=Pk(l,this.#e.getNodeGraph(),o.ref,u,this.#e.getAcyclic()),f=[],p=[];for(let e of this.#e.allPorts()){let n=this.#e.portInfoFor(e);if(n===void 0||n.ref.node===o.ref.node&&n.ref.port===o.ref.port)continue;let r=u?{from:o,to:n}:{from:n,to:o},i=Uk(r.from,r.to,d,l,this.#e.getRulesOptions());p.push(e),i.ok?(e.setDragState(`valid`),f.push({info:n,el:e})):e.setDragState(`invalid`)}let m=QA({x:e.clientX,y:e.clientY},this.#e.getViewport(),this.#f());return this.#t={mode:a,pointerId:e.pointerId,anchor:o,anchorFlow:c,originalEdge:s,workingGraph:l,context:d,candidates:this.#a(f),valid:f,markedPorts:p,glowing:/* @__PURE__ */ new Set,pointerFlow:m,client:{x:e.clientX,y:e.clientY},startClient:{x:e.clientX,y:e.clientY},moved:!1,goal:m,rendered:{...m},snap:void 0},r.setPointerCapture(e.pointerId),this.#e.setGestureActive(!0),this.#e.invalidate(),this.#g(),this.#m(),!0}#a(e){let n=[];for(let r of e){let e=this.#u(r.info);e!==void 0&&n.push({info:r.info,el:r.el,pos:e})}return n}relayout(){this.#t!==void 0&&(this.#t.candidates=this.#a(this.#t.valid))}onPointerMove(e){let n=this.#t;if(n===void 0||e.pointerId!==n.pointerId)return;n.client={x:e.clientX,y:e.clientY},!n.moved&&Math.hypot(n.client.x-n.startClient.x,n.client.y-n.startClient.y)>=3&&(n.moved=!0),n.pointerFlow=QA(n.client,this.#e.getViewport(),this.#f()),this.#e.onApproach?.(n.pointerFlow,n.client);let r=this.#e.getViewport(),i=this.#f();if(n.snap=IA(n.candidates.map(e=>{let n=$A(e.pos,r,i);return{ref:e.info.ref,x:n.x,y:n.y}}),n.client,this.#e.getSnapRadius(),n.snap),n.snap===void 0&&this.#e.getEasyConnect?.()===!0){let e=this.#e.nodeAt?.(n.pointerFlow),a=(e===void 0?[]:n.candidates.filter(n=>n.info.ref.node===e)).sort((e,r)=>Math.hypot(e.pos.x-n.pointerFlow.x,e.pos.y-n.pointerFlow.y)-Math.hypot(r.pos.x-n.pointerFlow.x,r.pos.y-n.pointerFlow.y))[0];if(a!==void 0){let e=$A(a.pos,r,i);n.snap={ref:a.info.ref,x:e.x,y:e.y,distance:0}}}n.goal=n.snap===void 0?n.pointerFlow:this.#l(n.snap.ref)??n.pointerFlow,this.#c(),this.#m(),this.#e.invalidate()}onPointerUp(e){let n=this.#t;return n===void 0||e.pointerId!==n.pointerId||(this.#s(),n.moved&&this.#o(n)),!1}onPointerCancel(e){return this.#s(),!1}abort(){this.#s()}#o(e){let n=e.snap;if(n!==void 0){let r=e.candidates.find(e=>Uj(e.info.ref,n.ref));if(r!==void 0){let n=e.mode===`new-backward`?{from:r.info,to:e.anchor}:{from:e.anchor,to:r.info},i=Uk(n.from,n.to,e.context,e.workingGraph,this.#e.getRulesOptions());if(i.ok){let e={id:Ek(n.from.ref,n.to.ref),from:n.from.ref,to:n.to.ref};if(i.replaces!==void 0&&!this.#e.requestDisconnect([i.replaces],`replace`))return;!this.#e.requestConnect(e,i.replaces)&&i.replaces!==void 0&&this.#e.commitEdges(Ok(this.#e.getPortGraph(),i.replaces.from,i.replaces.to));return}}}e.mode===`detach`&&e.originalEdge!==void 0?this.#e.requestDisconnect([e.originalEdge],`detach`):this.#e.emitConnectEnd(e.anchor.ref,e.pointerFlow,e.client)}#s(){let e=this.#t;if(e!==void 0){this.#t=void 0,this.#n!==0&&(cancelAnimationFrame(this.#n),this.#n=0);for(let n of e.markedPorts)n.setDragState(void 0);for(let n of e.glowing)n.setMagnet(!1,0);this.#_(),this.#e.setGestureActive(!1),this.#e.invalidate()}}#c(){let e=this.#t;if(e===void 0)return;let n=this.#e.getSnapRadius(),r=this.#e.getViewport(),i=this.#f(),a=/* @__PURE__ */ new Set;for(let o of e.candidates){let s=$A(o.pos,r,i),c=Math.hypot(s.x-e.client.x,s.y-e.client.y),l=e.snap!==void 0&&Uj(e.snap.ref,o.info.ref),u=LA(c,n);(u>0||l)&&(a.add(o.el),o.el.setMagnet(l,u))}for(let n of e.glowing)a.has(n)||n.setMagnet(!1,0);e.glowing.clear();for(let n of a)e.glowing.add(n)}#l(e){let n=this.#t;if(n!==void 0)return n.candidates.find(n=>Uj(n.info.ref,e))?.pos}#u(e){let n=this.#e.portOffset(e.ref.node,e.ref.port),r=this.#e.nodePosition(e.ref.node);if(n!==void 0&&r!==void 0)return{x:r.x+n.x,y:r.y+n.y}}#d(e,n){if(e.length===1)return e[0];let r=this.#e.getViewport(),i=this.#f(),a=e[0],o=1/0;for(let s of e){let e=this.#e.portInfoForSource(s.from);if(e===void 0)continue;let c=this.#u(e);if(c===void 0)continue;let l=$A(c,r,i),u=Math.hypot(l.x-n.clientX,l.y-n.clientY);u<o&&(a=s,o=u)}return a}#f(){let e=this.#e.getPaneRect();return e===void 0?{x:0,y:0}:{x:e.left,y:e.top}}#p(){let e=this.#t;if(e===void 0)return`right`;if(e.snap!==void 0){let n=e.candidates.find(n=>Uj(n.info.ref,e.snap.ref));if(n!==void 0)return n.info.side}switch(e.anchor.side){case`left`:return`right`;case`right`:return`left`;case`top`:return`bottom`;case`bottom`:return`top`}}#m(){this.#n===0&&(this.#r=performance.now(),this.#n=requestAnimationFrame(this.#h))}#h=e=>{let n=this.#t;if(n===void 0){this.#n=0;return}let r=Math.min(50,e-this.#r);this.#r=e;let i=this.#e.prefersReducedMotion()?0:60;n.rendered=RA(n.rendered,n.goal,r,i),this.#e.invalidate(),this.#n=zA(n.rendered,n.goal)?0:requestAnimationFrame(this.#h)};#g(){let e=e=>{e.key===`Escape`&&this.abort()};window.addEventListener(`keydown`,e,!0),this.#i.push(()=>window.removeEventListener(`keydown`,e,!0))}#_(){for(let e of this.#i)e();this.#i=[]}};function Uj(e,n){return e.node===n.node&&e.port===n.port}function Wj(e){return{ref:e,dir:`out`,type:``,max:1/0,side:`right`}}function Gj(e,n,r,i,a){let o=[];for(let r of e){let e=n.collapsedProxyOf(r.from.node),a=n.collapsedProxyOf(r.to.node),s=n.isHidden(r.from.node)&&e===void 0,c=n.isHidden(r.to.node)&&a===void 0;if(s||c||e!==void 0&&e===a)continue;let l=e===void 0?n.portGeometry(r.from):n.virtualPortGeometry(e,`out`),u=a===void 0?n.portGeometry(r.to):n.virtualPortGeometry(a,`in`);l===void 0||u===void 0?n.portInfoOf(r.from)!==void 0&&n.portInfoOf(r.to)!==void 0||i.has(r.id)||(i.add(r.id),console.warn(`[ixfx-node-graph] edge "${r.id}" references a missing node or port; kept but not drawn`)):o.push({edge:r,a:l,b:u,from:{node:e??r.from.node,port:e===void 0?r.from.port:`@out`,pos:l.pos,side:l.side},to:{node:a??r.to.node,port:a===void 0?r.to.port:`@in`,pos:u.pos,side:u.side}})}let s=Kj(o,n,a.router,i);return o.map(({edge:e,a:n,b:i})=>{let o=s?.get(e.id),c=a.hints[e.id],l=o!==void 0&&o.length>=2?hA(o):c?.waypoints!==void 0&&c.waypoints.length>0?hA([n.pos,...c.waypoints,i.pos]):mA(c?.style??a.style,n.pos,n.side,i.pos,i.side);return{id:e.id,d:l.d,mid:l.mid,selected:r.has(e.id)}})}function Kj(e,n,r,i){if(r!==void 0&&e.length!==0)try{return r({edges:e.map(e=>({id:e.edge.id,from:e.from,to:e.to})),obstacles:n.rects()})}catch(e){i.has(`router`)||(i.add(`router`),console.warn(`[ixfx-node-graph] edgeRouter threw; wires are drawn without it`,e));return}}function qj(e,n,r,i,o,c=void 0){return s`
|
|
11561
11562
|
${_(e,e=>e.id,e=>{let o=gj(n[e.id]);return s`
|
|
11562
11563
|
<path
|
|
11563
11564
|
class=${v({wire:!0,selected:e.selected,detached:e.id===i})}
|
|
@@ -11573,10 +11574,10 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
11573
11574
|
:host(:focus) {
|
|
11574
11575
|
outline: none;
|
|
11575
11576
|
}
|
|
11576
|
-
`]}get edges(){return this.#t}set edges(e){if(e===this.#t)return;let n=this.#t;this.#e=jk(e??[]),this.#n=void 0,this.#t=Mk(this.#e),this.#l=!0,this.#F(),this.requestUpdate(`edges`,n)}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;constructor(){super(),this.viewport={x:0,y:0,zoom:1},this.minZoom=.2,this.maxZoom=3,this.wheel=`zoom`,this.snapRadius=32,this.allowSelf=!1,this.acyclic=!1,this.touchMode=`pan`,this.isValidConnection=void 0,this.dragBy=`node`,this.availablePorts=`show`,this.portLayout=`rail`,this.portLocation=`vertical`,this.flipPorts=!1,this.dblclickToggle=!1,this.easyConnect=!1,this.easyConnectMargin=10,this.proximityConnect=0,this.bridgeOnDelete=!1,this.nodeFactory=void 0,this.#e=F.Directed.graph(),this.#t=[],this.#r=new Oj({getZoom:()=>this.viewport.zoom,observe:e=>this.#f.observe(e),unobserve:e=>this.#f.unobserve(e)}),this.#i=/* @__PURE__ */ new Set,this.#a=new Bj({registry:this.#r,getEdges:()=>this.#t,getPortGraph:()=>this.#e,commitEdges:e=>this.#H(e),rules:()=>this.#R(),bridgeOnDelete:()=>this.bridgeOnDelete,emit:(e,n,r)=>bj(this,e,n,r),changed:()=>{this.#l=!0,this.requestUpdate(),this.#S.notify(`user`)}}),this._gestureActive=!1,this._spacePan=!1,this.#s=0,this.#c=[],this.#l=!0,this.#u=20,this.#d=
|
|
11577
|
+
`]}get edges(){return this.#t}set edges(e){if(e===this.#t)return;let n=this.#t;this.#e=jk(e??[]),this.#n=void 0,this.#t=Mk(this.#e),this.#l=!0,this.#F(),this.requestUpdate(`edges`,n)}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;constructor(){super(),this.viewport={x:0,y:0,zoom:1},this.minZoom=.2,this.maxZoom=3,this.wheel=`zoom`,this.snapRadius=32,this.allowSelf=!1,this.acyclic=!1,this.touchMode=`pan`,this.isValidConnection=void 0,this.dragBy=`node`,this.availablePorts=`show`,this.portLayout=`rail`,this.portLocation=`vertical`,this.flipPorts=!1,this.dblclickToggle=!1,this.easyConnect=!1,this.easyConnectMargin=10,this.proximityConnect=0,this.bridgeOnDelete=!1,this.nodeFactory=void 0,this.#e=F.Directed.graph(),this.#t=[],this.#r=new Oj({getZoom:()=>this.viewport.zoom,observe:e=>this.#f.observe(e),unobserve:e=>this.#f.unobserve(e)}),this.#i=/* @__PURE__ */ new Set,this.#a=new Bj({registry:this.#r,getEdges:()=>this.#t,getPortGraph:()=>this.#e,commitEdges:e=>this.#H(e),rules:()=>this.#R(),bridgeOnDelete:()=>this.bridgeOnDelete,emit:(e,n,r)=>bj(this,e,n,r),changed:()=>{this.#l=!0,this.requestUpdate(),this.#S.notify(`user`)}}),this._gestureActive=!1,this._spacePan=!1,this.#s=0,this.#c=[],this.#l=!0,this.#u=20,this.#d=S(),this.#f=new ResizeObserver(e=>{for(let n of e)this.#r.invalidateLayout(n.target.key);this.#L()}),this.#p=new MutationObserver(()=>{queueMicrotask(()=>this.#j())}),this.#b=new jj({nodes:()=>this.#r.nodes,rect:e=>this.#r.rect(e),isHidden:e=>this.#r.isHidden(e)}),this.#S=new cy(this,{kind:`node-graph`,capture:()=>this.getViewState()}),this.#C=e=>{if(this.#o!==void 0){if(this.#o===this.#_){if(e.pointerId===this.#_.pointerId)return;let n=this.#_.cancelForPinch();n!==void 0&&(this.#m.startPinch(n,e),this.#o=this.#m);return}this.#o.addPointer?.(e);return}if(e.button===2)return;if(this.#b.pressOn(sj(e.composedPath(),`ixfx-graph-node`)),WA({pointerType:e.pointerType,button:e.button,shiftKey:e.shiftKey,onBackground:e.target===this.#d.value,spacePan:this.#m.spacePan,touchMode:this.touchMode})){this.#d.value?.focus({preventScroll:!0}),this.#_.begin(e,e.pointerType===`mouse`&&(e.ctrlKey||e.metaKey)),this.#o=this.#_;return}if(this.#m.onPointerDown(e)){e.button===0&&this.#a.apply(/* @__PURE__ */ new Set,/* @__PURE__ */ new Set),this.#d.value?.focus({preventScroll:!0}),this.#o=this.#m;return}let n=e.composedPath(),r=n.find(e=>e instanceof Element&&e.hasAttribute(`data-resize`)),i=sj(n,`ixfx-graph-node`),a=r?.getAttribute(`data-resize`);if(i!==void 0&&OA(a)){this.#X(e,i,a);return}let o=sj(n,`ixfx-graph-port`);if(o!==void 0){let n=this.#r.portInfoFor(o);n!==void 0&&this.#g.onPointerDown(e,n)&&(this.#o=this.#g);return}let s=sj(n,`ixfx-graph-node`);if(s!==void 0&&s.key!==``){if(this.#Z(e,s))return;if(this.#a.set(Lj(this.#a.snapshot(),s.key,e.shiftKey||e.metaKey||e.ctrlKey)),s.startsDrag(e)&&!lj(e)){let n=[];for(let e of this.#a.nodes){let r=this.#r.nodes.get(e);r!==void 0&&!this.#r.hasAncestorIn(e,this.#a.nodes)&&n.push(r)}this.#h.onPointerDown(e,n)&&(this.#o=this.#h)}}},this.#w=e=>{this.#o===void 0&&e.pointerType===`mouse`&&this.#b.hoverNode(sj(e.composedPath(),`ixfx-graph-node`)),this.#o?.onPointerMove(e)},this.#T=e=>{let n=this.#o;n!==void 0&&(n.onPointerUp(e)||(this.#o=void 0))},this.#E=e=>{let n=this.#o;n!==void 0&&(n.onPointerCancel(e)||(this.#o=void 0))},this.#D=e=>{this.#m.onWheel(e)},this.#O=e=>{aj(e.target)||(e.key===`Escape`?(this.#g.abort(),this.#_.abort(),this.#v.abort()):e.key===`Delete`||e.key===`Backspace`?(this.#a.nodes.size>0||this.#a.edges.size>0)&&(e.preventDefault(),this.#a.deleteSelected()):this.#m.onKeyDown(e))},this.#k=e=>this.#m.onKeyUp(e),this.#A=()=>this.#m.onKeyUp(),this.#j=()=>{for(let e of this.#r.refresh(this.children,e=>this.#a.nodes.has(e)))this.#a.forget([e]);this.#n=void 0,this.#F(),this.#L()},this.#M=e=>{let{key:n,width:r,height:i}=e.detail;this.#r.noteGeometry(n,r,i),this.#r.syncOrigins(),this.#L()},this.#N=e=>{this.#r.invalidateLayout(e.detail.key),this.#r.syncOrigins(),this.#g.relayout(),this.#L()},this.#P=e=>{let{node:n,dir:r,availability:i}=e.detail,a=this.#r.nodes.get(n);i===`available`&&a!==void 0&&this.#b.hold(a,r),this.#F(),this.#L()},this.#I=e=>{let n=mj(e.composedPath());if(n===void 0||this.#x?.kind===`node`&&this.#x.id===n)return;let r=e.composedPath()[0].getBoundingClientRect(),i={x:r.left,y:r.bottom};this.#x={kind:`node`,id:n,client:i,point:this.screenToFlow(i)}},this.#z=new Vj({getGraph:()=>this.#e,commit:e=>this.#H(e),emitCancelable:(e,n)=>bj(this,e,n,!0)}),this.#B=(e,n)=>this.#z.connect(e,n),this.#V=(e,n)=>this.#z.disconnect(e,n),this.#H=e=>{let n=this.#t;this.#e=e,this.#n=void 0,this.#t=Mk(e),this.#l=!0,this.#F(),this.requestUpdate(`edges`,n),bj(this,`graph-edges-change`,{edges:this.#t,graph:e})},this.#$=e=>{let{kind:n,id:r,menu:i}=fj(e.composedPath(),this);if(i===void 0)return;e.preventDefault(),n===`node`&&r!==void 0?this.#a.set(Lj(this.#a.snapshot(),r,!1)):n===`edge`&&r!==void 0&&this.#a.set(Rj(this.#a.snapshot(),r,!1));let a={x:e.clientX,y:e.clientY},o={kind:n,id:r,client:a,point:this.screenToFlow(a)};this.#x=o,bj(this,`graph-context-menu`,o,!0)&&pj(i,e)},this.#ee=(e,n)=>{let r={moves:e};bj(this,n,r)},this.#m=new oj(this,{getPane:()=>this.#d.value,getPaneRect:()=>this.#d.value?.getBoundingClientRect(),getViewport:()=>this.viewport,setViewport:e=>this.#W(e),getMinZoom:()=>this.minZoom,getMaxZoom:()=>this.maxZoom,getWheelMode:()=>this.wheel,isWheelBlockedTarget:uj,setGestureActive:e=>this.#q(e),setSpacePan:e=>this.#J(e)}),this.#h=new YA({getPane:()=>this.#d.value,getViewport:()=>this.viewport,applyMoves:e=>this.#Y(e),emitMove:e=>{this.#ee(e,`graph-node-move`),this.#y.update(e)},emitMoved:e=>{this.#ee(e,`graph-node-moved`),this.#S.notify(`user`)},setGestureActive:e=>this.#q(e),onEnd:e=>this.#y.end(e)}),this.#y=new Fj({getThreshold:()=>this.proximityConnect,getRects:()=>this.#r.rects(),tryPair:(e,n)=>Kk(this.#r.portsOf(e),this.#r.portsOf(n),this.#e,this.getNodeGraph(),this.#R()),pathFor:e=>{let n=this.#r.portGeometry(e.from.ref),r=this.#r.portGeometry(e.to.ref);return n===void 0||r===void 0?void 0:oA(n.pos,n.side,r.pos,r.side)},commit:e=>this.#B({id:Ek(e.from.ref,e.to.ref),from:e.from.ref,to:e.to.ref},void 0),invalidate:()=>this.requestUpdate()}),this.#v=new kj({getPane:()=>this.#d.value,getZoom:()=>this.viewport.zoom,apply:(e,n)=>{this.#r.applyRect(e,n),this.#L()},emit:(e,n,r)=>{bj(this,r?`graph-node-resized`:`graph-node-resize`,{key:e,...n}),r&&this.#S.notify(`user`)},setGestureActive:e=>this.#q(e)}),this.#_=new qA({getPane:()=>this.#d.value,screenToFlow:e=>this.screenToFlow(e),getNodeRects:()=>this.#r.rects(),getSelection:()=>this.#a.snapshot(),applySelection:(e,n)=>this.#a.apply(e,n),invalidate:()=>this.requestUpdate()}),this.#g=new Hj({getPane:()=>this.#d.value,getPaneRect:()=>this.#d.value?.getBoundingClientRect(),getViewport:()=>this.viewport,getSnapRadius:()=>this.snapRadius,getRulesOptions:()=>this.#R(),getPortGraph:()=>this.#e,getNodeGraph:()=>this.getNodeGraph(),getAcyclic:()=>this.acyclic,...this.#r.wireLookups(),getEasyConnect:()=>this.easyConnect,onApproach:(e,n)=>this.#b.approach(e,n),setGestureActive:e=>this.#q(e),commitEdges:e=>this.#H(e),requestConnect:(e,n)=>this.#B(e,n),requestDisconnect:(e,n)=>this.#V(e,n),emitConnectEnd:(e,n,r)=>{bj(this,`graph-connect-end`,{from:e,point:n,client:r}),this.#Q(e,n,r)},invalidate:()=>this.requestUpdate(),prefersReducedMotion:()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1})}connectedCallback(){super.connectedCallback(),this.addEventListener(`graph-node-geometry`,this.#M),this.addEventListener(`graph-node-collapse`,this.#N),this.addEventListener(`graph-node-ports`,this.#N),this.addEventListener(`graph-port-change`,this.#P),this.addEventListener(`menu-trigger-open`,this.#I),this.#p.observe(this,{childList:!0,subtree:!0}),queueMicrotask(()=>{this.#K(),this.#j()})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`graph-node-geometry`,this.#M),this.removeEventListener(`graph-node-collapse`,this.#N),this.removeEventListener(`graph-node-ports`,this.#N),this.removeEventListener(`graph-port-change`,this.#P),this.removeEventListener(`menu-trigger-open`,this.#I),this.#p.disconnect(),this.#f.disconnect(),this.#s!==0&&(cancelAnimationFrame(this.#s),this.#s=0)}firstUpdated(){let e=this.#d.value;e!==void 0&&(e.addEventListener(`pointerdown`,this.#C),e.addEventListener(`contextmenu`,this.#$),e.addEventListener(`pointerleave`,()=>this.#b.hoverNode(void 0)),e.addEventListener(`pointermove`,this.#w),e.addEventListener(`pointerup`,this.#T),e.addEventListener(`pointercancel`,this.#E),e.addEventListener(`wheel`,this.#D,{passive:!1}),e.addEventListener(`keydown`,this.#O),e.addEventListener(`keyup`,this.#k),e.addEventListener(`focusout`,this.#A))}willUpdate(e){(e.has(`edgeStyle`)||e.has(`edgeHints`)||e.has(`edgeRouter`))&&(this.#l=!0)}updated(e){Jj.some(n=>e.has(n))&&this.#r.setDefaults(this)}render(){let e=this.viewport,n=h({transform:`translate(${e.x}px, ${e.y}px) scale(${e.zoom})`}),r=h({"--_bg-size":`${this.#u*e.zoom}px`,"--_bg-x":`${e.x}px`,"--_bg-y":`${e.y}px`}),o=this.#U(),s=this.#g.previewPath,c=this.#g.detachedEdgeId,l=this.#_.clientRect;return i`
|
|
11577
11578
|
<div
|
|
11578
11579
|
class="pane"
|
|
11579
|
-
${
|
|
11580
|
+
${ee(this.#d)}
|
|
11580
11581
|
tabindex="0"
|
|
11581
11582
|
?data-space-pan=${this._spacePan}
|
|
11582
11583
|
?data-marquee=${l!==void 0}
|
|
@@ -11675,7 +11676,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
11675
11676
|
transform: none !important;
|
|
11676
11677
|
}
|
|
11677
11678
|
}
|
|
11678
|
-
`]}};E([d({type:String,attribute:`notification-type`})],Xj.prototype,`notificationType`,void 0),E([d({type:String})],Xj.prototype,`message`,void 0),E([d({type:String})],Xj.prototype,`icon`,void 0),E([d({type:Boolean,reflect:!0})],Xj.prototype,`dismissing`,void 0),E([d({type:String,attribute:`notification-id`})],Xj.prototype,`notificationId`,void 0),Xj=E([T(`ixfx-notification-pill`)],Xj);function Zj(e){return{vertical:e.startsWith(`top`)?`top`:`bottom`,horizontal:e.endsWith(`-left`)?`left`:e.endsWith(`-right`)?`right`:`middle`}}function Qj(e,n){let{vertical:r,horizontal:i}=Zj(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 $j(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 eM(e,n,r){return e.horizontal===`middle`?`translateX(-50%) translate(${n}px, ${r}px)`:`translate(${n}px, ${r}px)`}function tM(e){return typeof e.showPopover==`function`&&typeof e.hidePopover==`function`}function nM(e={}){let n=e.position??`top-right`,r=e.queueDisplay??`list`,i=e.safeArea??{},a=Zj(n),o=e.topLayer??!0,s=null,c=null,l=/* @__PURE__ */ new Map,u=40,d=!1;function f(){return s||(s=document.createElement(`div`),s.className=`ixfx-notification-container`,s.setAttribute(`role`,`region`),s.setAttribute(`aria-label`,`Notifications`),s.style.cssText=`pointer-events: none;`,o&&tM(s)?(s.setAttribute(`popover`,`manual`),s.style.cssText+=`position: fixed; inset: 0 auto auto 0; width: 0; height: 0; margin: 0; padding: 0; border: 0; overflow: visible; background: transparent; color: inherit;`):!o&&e.zIndex!==void 0&&(s.style.cssText+=`position: fixed; inset: 0 auto auto 0; width: 0; height: 0; z-index: ${e.zIndex};`),document.body.appendChild(s),s)}function p(e){e.hasAttribute(`popover`)&&(e.matches(`:popover-open`)&&e.hidePopover(),e.showPopover())}function m(e,n){e.setAttribute(`notification-type`,n.type),e.setAttribute(`message`,n.message),n.icon?e.setAttribute(`icon`,n.icon):e.removeAttribute(`icon`)}function h(e){let r=document.createElement(`ixfx-notification-pill`);return r.setAttribute(`notification-id`,e.id),r.style.cssText=Qj(n,i),m(r,e),r.style.opacity=`0`,r.style.transform=$j(a),r.addEventListener(`pill-tap`,e=>{let n=e;c?.onTap(n.detail.id)}),r}function g(e){d||requestAnimationFrame(()=>{let n=e.getBoundingClientRect().height;n>0&&(u=n,d=!0)})}function _(e){let n=e.length;e.forEach((e,i)=>{let o=l.get(e.id);if(!o)return;let s=o.element,c=0,d=0,f=1,p=`auto`,m=`none`;if(r===`list`){let e=i*(u+8);d=a.vertical===`top`?e:-e}else{let e=i*4;if(d=a.vertical===`top`?e:-e,c=a.horizontal===`left`?e:a.horizontal===`right`?-e:0,i>0){let e=i-1;f=Math.max(.2,.7-e*.15),p=`none`,m=`saturate(0.6)`}}s.style.transition=`opacity 0.2s ease-out, transform 0.2s ease-out`,s.style.opacity=`${f}`,s.style.zIndex=`${n-i}`,s.style.pointerEvents=p,s.style.filter=m,s.style.transform=eM(a,c,d)})}function v(e){let n=l.get(e);if(!n)return;let r=n.element;r.setAttribute(`dismissing`,`true`);let i=()=>{r.removeEventListener(`transitionend`,i),r.remove(),l.delete(e),s&&l.size===0&&(s.remove(),s=null,d=!1,u=40)};r.addEventListener(`transitionend`,i),setTimeout(i,300)}function y(e,n){let r=f(),i=!1,a=new Set(e.map(e=>e.id));for(let n of e){let e=l.get(n.id);if(e){e.notification=n,m(e.element,n);continue}let a=h(n);l.set(n.id,{element:a,notification:n}),r.appendChild(a),i=!0,g(a)}i&&p(r);for(let[e]of l)a.has(e)||v(e);requestAnimationFrame(()=>_(e))}return{attach(e){c=e},detach(){for(let[e]of l)v(e);s&&=(s.remove(),null)},setNotifications:y}}
|
|
11679
|
+
`]}};E([d({type:String,attribute:`notification-type`})],Xj.prototype,`notificationType`,void 0),E([d({type:String})],Xj.prototype,`message`,void 0),E([d({type:String})],Xj.prototype,`icon`,void 0),E([d({type:Boolean,reflect:!0})],Xj.prototype,`dismissing`,void 0),E([d({type:String,attribute:`notification-id`})],Xj.prototype,`notificationId`,void 0),Xj=E([T(`ixfx-notification-pill`)],Xj);function Zj(e){return{vertical:e.startsWith(`top`)?`top`:`bottom`,horizontal:e.endsWith(`-left`)?`left`:e.endsWith(`-right`)?`right`:`middle`}}function Qj(e,n){let{vertical:r,horizontal:i}=Zj(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 $j(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 eM(e,n,r){return e.horizontal===`middle`?`translateX(-50%) translate(${n}px, ${r}px)`:`translate(${n}px, ${r}px)`}function tM(e){return typeof e.showPopover==`function`&&typeof e.hidePopover==`function`}function nM(e={}){let n=e.position??`top-right`,r=e.queueDisplay??`list`,i=e.safeArea??{},a=Zj(n),o=e.topLayer??!0,s=null,c=null,l=/* @__PURE__ */ new Map,u=40,d=!1;function f(){return s||(s=document.createElement(`div`),s.className=`ixfx-notification-container`,s.setAttribute(`role`,`region`),s.setAttribute(`aria-label`,`Notifications`),s.style.cssText=`pointer-events: none;`,o&&tM(s)?(s.setAttribute(`popover`,`manual`),s.style.cssText+=`position: fixed; inset: 0 auto auto 0; width: 0; height: 0; margin: 0; padding: 0; border: 0; overflow: visible; background: transparent; color: inherit;`):!o&&e.zIndex!==void 0&&(s.style.cssText+=`position: fixed; inset: 0 auto auto 0; width: 0; height: 0; z-index: ${e.zIndex};`),document.body.appendChild(s),s)}function p(e){e.hasAttribute(`popover`)&&(e.matches(`:popover-open`)&&e.hidePopover(),e.showPopover())}function m(e,n){e.setAttribute(`notification-type`,n.type),e.setAttribute(`message`,n.message),n.icon?e.setAttribute(`icon`,n.icon):e.removeAttribute(`icon`)}function h(e){let r=document.createElement(`ixfx-notification-pill`);return r.setAttribute(`notification-id`,e.id),r.style.cssText=Qj(n,i),m(r,e),r.style.opacity=`0`,r.style.transform=$j(a),r.addEventListener(`pill-tap`,e=>{let n=e;c?.onTap(n.detail.id)}),r}function g(e){d||requestAnimationFrame(()=>{let n=e.getBoundingClientRect().height;n>0&&(u=n,d=!0)})}function _(e){let n=e.length;e.forEach((e,i)=>{let o=l.get(e.id);if(!o)return;let s=o.element,c=0,d=0,f=1,p=`auto`,m=`none`;if(r===`list`){let e=i*(u+8);d=a.vertical===`top`?e:-e}else{let e=i*4;if(d=a.vertical===`top`?e:-e,c=a.horizontal===`left`?e:a.horizontal===`right`?-e:0,i>0){let e=i-1;f=Math.max(.2,.7-e*.15),p=`none`,m=`saturate(0.6)`}}s.style.transition=`opacity 0.2s ease-out, transform 0.2s ease-out`,s.style.opacity=`${f}`,s.style.zIndex=`${n-i}`,s.style.pointerEvents=p,s.style.filter=m,s.style.transform=eM(a,c,d)})}function v(e){let n=l.get(e);if(!n)return;let r=n.element;r.setAttribute(`dismissing`,`true`);let i=()=>{r.removeEventListener(`transitionend`,i),r.remove(),l.delete(e),s&&l.size===0&&(s.remove(),s=null,d=!1,u=40)};r.addEventListener(`transitionend`,i),setTimeout(i,300)}function y(e,n){let r=f(),i=!1,a=new Set(e.map(e=>e.id));for(let n of e){let e=l.get(n.id);if(e){e.notification=n,m(e.element,n);continue}let a=h(n);l.set(n.id,{element:a,notification:n}),r.appendChild(a),i=!0,g(a)}i&&p(r);for(let[e]of l)a.has(e)||v(e);requestAnimationFrame(()=>_(e))}return{attach(e){c=e},detach(){for(let[e]of l)v(e);s&&=(s.remove(),null)},setNotifications:y}}function rM(e={}){let n={renderer:void 0,timeout:4e3,timeoutError:8e3,queue:!0,queueSize:3,tapBehaviour:`dismiss`,tapHandlerDefault:void 0,historyLimit:100},r=[],i=[],a=/* @__PURE__ */ new Set,o=null,s=null;function c(){return s??=nM({position:`top-right`}),s}function l(){return o??c()}function u(){l().setNotifications([...r],n.queueSize)}function d(){if(a.size===0)return;let e=f();for(let n of[...a])try{n(e)}catch(e){console.error(`Notification history listener failed:`,e)}}function f(){return i.map(e=>({...e}))}function p(e){return i.find(n=>n.id===e)}function m(e){let n=p(e);n&&n.dismissedAt===void 0&&(n.dismissedAt=Date.now(),d())}function h(e){e.timer!==null&&(clearTimeout(e.timer),e.timer=null)}function g(e){h(e),m(e.id)}function _(e){let r=e.type===`error`?n.timeoutError:n.timeout,i=e.wasQueued?r/n.queueSize:r;e.timer=window.setTimeout(y,i,e.id)}function v(){let e=r[0];e&&e.timer===null&&_(e)}function y(e){let n=r.findIndex(n=>n.id===e);n!==-1&&(g(r.splice(n,1)[0]),v(),u())}function b(e){let n=p(e);n&&!n.read&&(n.read=!0,d())}function x(e){if(e.renderer!==void 0&&(o?.detach?.(),o=e.renderer,o.attach({onTap(e){let i=r.find(n=>n.id===e);i&&(b(e),i.onTap?i.onTap(e):n.tapHandlerDefault?.(i),n.tapBehaviour===`dismiss`&&y(e))}}),u()),e.timeout!==void 0&&(n.timeout=e.timeout),e.timeoutError!==void 0&&(n.timeoutError=e.timeoutError),e.queue!==void 0&&(n.queue=e.queue),e.queueSize!==void 0){for(n.queueSize=Math.max(1,e.queueSize);r.length>n.queueSize;)g(r.shift());v(),u()}e.tapBehaviour!==void 0&&(n.tapBehaviour=e.tapBehaviour),e.tapHandlerDefault!==void 0&&(n.tapHandlerDefault=e.tapHandlerDefault),e.historyLimit!==void 0&&(n.historyLimit=Math.max(0,Math.floor(e.historyLimit)),i.length>n.historyLimit&&(i.splice(0,i.length-n.historyLimit),d()))}function S(e){let a=crypto.randomUUID(),o=Date.now(),s=e.icon??(e.type===`error`?`error`:void 0),c={...e,icon:s,id:a,createdAt:o,updatedAt:o,timer:null,wasQueued:!1};if(n.queue)r.length>=n.queueSize&&g(r.shift()),c.wasQueued=r.length>0,r.push(c);else{for(;r.length>0;)g(r.pop());r.push(c)}if(n.historyLimit>0){let{timer:e,wasQueued:r,...a}=c;i.push({...a,read:!1}),i.length>n.historyLimit&&i.splice(0,i.length-n.historyLimit),d()}return v(),u(),a}function ee(e,n){let i=r.find(n=>n.id===e);i&&(Object.assign(i,n),i.updatedAt=Date.now(),r[0]===i&&(h(i),_(i)),u());let a=p(e);a&&(Object.assign(a,n),a.updatedAt=Date.now(),d())}function te(){for(let e of r)g(e);r.length=0,u()}function ne(){let e=!1;for(let n of i)n.read||(n.read=!0,e=!0);e&&d()}function re(){i.length!==0&&(i.length=0,d())}function ie(){te(),i.length=0,a.clear(),o?.detach?.(),o=null}return x(e),{configure:x,notify:S,update:ee,dismiss:y,dismissAll:te,getHistory:f,get unreadCount(){return i.reduce((e,n)=>n.read?e:e+1,0)},markRead:b,markAllRead:ne,clearHistory:re,subscribe(e){return a.add(e),()=>a.delete(e)},destroy:ie}}const iM=/* @__PURE__ */ new Map,aM=rM(),oM={...aM,get unreadCount(){return aM.unreadCount},scope(e,n){let r=iM.get(e);return r||(r=rM(n),iM.set(e,r)),r},releaseScope(e){iM.get(e)?.destroy(),iM.delete(e)}};function sM(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 cM=!1;function lM(){if(cM)return;cM=!0;let e=document.createElement(`style`);e.textContent=`
|
|
11679
11680
|
.ixfx-drag-ghost.ixfx-panel-group-ghost {
|
|
11680
11681
|
padding: var(--space-s, 8px) var(--space-m, 16px);
|
|
11681
11682
|
background: var(--surface-4);
|
|
@@ -11694,7 +11695,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
11694
11695
|
height: 1.25em;
|
|
11695
11696
|
flex-shrink: 0;
|
|
11696
11697
|
}
|
|
11697
|
-
`,document.head.appendChild(e)}let
|
|
11698
|
+
`,document.head.appendChild(e)}let uM=class extends n{constructor(...e){super(...e),this.orientation=`horizontal`,this.variant=`titlebar`,this.toggleInteraction=`implicit`,this.collapsible=!0,this.accordion=!1,this.allowReorder=!1,this.stickyHeaders=!0,this._dragState=null,this._suppressNextClick=!1,this._onClickCapture=e=>{this._suppressNextClick&&(this._suppressNextClick=!1,e.preventDefault(),e.stopPropagation())},this._onKeyDown=e=>{let n=this._dragState;if(e.key!==`Escape`||!n?.active)return;e.preventDefault();let r=n.pointerId;this._abortDrag(),this._endDrag(r)},this._onPointerDown=e=>{if(!this.allowReorder||e.button!==0)return;let n=this._findDragTarget(e);if(!n?.parentNode)return;let r=Array.prototype.indexOf.call(n.parentNode.children,n);r<0||(this._dragState={pointerId:e.pointerId,source:n,fromIndex:r,startX:e.clientX,startY:e.clientY,active:!1,ghost:null,gapIndex:void 0},window.addEventListener(`pointermove`,this._onPointerMove),window.addEventListener(`pointerup`,this._onPointerUp),window.addEventListener(`pointercancel`,this._onPointerCancel))},this._onPointerMove=e=>{let n=this._dragState;if(!n||e.pointerId!==n.pointerId)return;let r=Math.hypot(e.clientX-n.startX,e.clientY-n.startY);if(!n.active){if(r<5)return;this._beginDrag(e)}n.ghost?.move(e.clientX,e.clientY);let i=this._computeGapIndex(e.clientX,e.clientY);i!==n.gapIndex&&(n.gapIndex=i,this.requestUpdate())},this._onPointerUp=e=>{let n=this._dragState;if(n&&e.pointerId===n.pointerId){if(n.active){let r=this._computeGapIndex(e.clientX,e.clientY);this._commitDrag(n.source,n.fromIndex,r)}this._endDrag(e.pointerId)}},this._onPointerCancel=e=>{let n=this._dragState;n&&e.pointerId===n.pointerId&&(this._abortDrag(),this._endDrag(e.pointerId))}}_onPanelToggle(e){let n=e.target;if(!n.collapsed&&this.accordion)for(let e of this._panels)e!==n&&(e.collapsed=!0)}connectedCallback(){super.connectedCallback(),this.addEventListener(`click`,this._onClickCapture,!0)}disconnectedCallback(){this.removeEventListener(`click`,this._onClickCapture,!0),this._dragState&&(this._abortDrag(),this._endDrag(this._dragState.pointerId)),super.disconnectedCallback()}firstUpdated(){this.gap!==void 0&&this.style.setProperty(`--group-gap`,this.gap),this.updateComplete.then(()=>{this._propagateAll()})}updated(e){super.updated(e),e.has(`gap`)&&(this.gap===void 0?this.style.removeProperty(`--group-gap`):this.style.setProperty(`--group-gap`,this.gap)),(e.has(`variant`)||e.has(`toggleInteraction`)||e.has(`orientation`)||e.has(`collapsible`)||e.has(`stickyHeaders`))&&this.updateComplete.then(()=>{this._propagateAll()})}_propagateAll(){let e=this.orientation===`horizontal`?`vertical`:`horizontal`;for(let n of this._panels)n.setAttribute(`variant`,this.variant),n.setAttribute(`toggle-interaction`,this.toggleInteraction),n.setAttribute(`orientation`,e),n.toggleAttribute(`sticky-header`,this.stickyHeaders),this.collapsible?n.setAttribute(`collapsible`,``):n.removeAttribute(`collapsible`)}_onSlotChange(){this.updateComplete.then(()=>{this._propagateAll()})}_findDragTarget(e){if(!this.allowReorder)return null;let n=e.composedPath(),r=null,i=!1;for(let e of n){if(!(e instanceof HTMLElement))continue;let n=e.tagName;if(n===`BUTTON`||n===`A`||n===`INPUT`||n===`SELECT`||n===`TEXTAREA`||e.classList.contains(`toolbar`)||e.classList.contains(`close-btn`)||e.classList.contains(`caret-btn`)||e.hasAttribute?.(`slot`)&&e.getAttribute(`slot`)===`toolbar`)return null;n===`IXFX-TITLEBAR`&&(i=!0),!r&&n===`IXFX-PANEL`&&(r=e)}return!r||!i?null:r}_beginDrag(e){let n=this._dragState;if(n&&!n.active){try{this.setPointerCapture(e.pointerId)}catch{}n.active=!0,this.setAttribute(`dragging`,``),n.source.setAttribute(`drag-source`,``),n.ghost=this._createGhost(n.source),n.ghost?.move(e.clientX,e.clientY)}}_abortDrag(){let e=this._dragState;e&&(e.source.removeAttribute(`drag-source`),e.gapIndex!==void 0&&(e.gapIndex=void 0,this.requestUpdate()))}_endDrag(e){let n=this._dragState;if(n){n.ghost?.destroy(),n.ghost=null,this.removeAttribute(`dragging`),this._dragState=null,window.removeEventListener(`pointermove`,this._onPointerMove),window.removeEventListener(`pointerup`,this._onPointerUp),window.removeEventListener(`pointercancel`,this._onPointerCancel);try{this.releasePointerCapture(e)}catch{}this.requestUpdate()}}_commitDrag(e,n,r){e.removeAttribute(`drag-source`);let i=(this._panels??[]).filter(n=>n!==e),a=r===void 0?i.length:Math.max(0,Math.min(r,i.length)),o=e.parentNode;if(!o)return;let s=i[a]??null;o.insertBefore(e,s);let c=Array.prototype.indexOf.call(o.children,e);c!==n&&(this._suppressNextClick=!0,this.dispatchEvent(new CustomEvent(`reorder`,{bubbles:!0,composed:!0,detail:{fromIndex:n,toIndex:c,panel:e}})))}_createGhost(e){let n=document.createElement(`span`);if(n.style.display=`inline-flex`,n.style.alignItems=`center`,n.style.padding=`0 var(--space-s, 8px)`,n.style.minWidth=`0`,e.iconName){let r=document.createElement(`ixfx-icon`);r.name=e.iconName,n.appendChild(r)}let r=document.createElement(`span`);r.textContent=(e.title||(e.textContent??``).trim()).slice(0,60),r.style.paddingLeft=`1ch`,r.style.overflow=`hidden`,r.style.textOverflow=`ellipsis`,r.style.whiteSpace=`nowrap`,n.appendChild(r);try{return lM(),Sy({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 sM(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`
|
|
11698
11699
|
<slot
|
|
11699
11700
|
@toggle=${this._onPanelToggle}
|
|
11700
11701
|
@slotchange=${this._onSlotChange}
|
|
@@ -11758,7 +11759,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
11758
11759
|
pointer-events: none;
|
|
11759
11760
|
z-index: 1;
|
|
11760
11761
|
}
|
|
11761
|
-
`}};E([d({type:String,reflect:!0})],
|
|
11762
|
+
`}};E([d({type:String,reflect:!0})],uM.prototype,`orientation`,void 0),E([d({type:String})],uM.prototype,`variant`,void 0),E([d({type:String,attribute:`toggle-interaction`})],uM.prototype,`toggleInteraction`,void 0),E([d({type:Boolean})],uM.prototype,`collapsible`,void 0),E([d({type:Boolean,attribute:`accordion`,reflect:!0})],uM.prototype,`accordion`,void 0),E([d({type:Boolean,attribute:`allow-reorder`,reflect:!0})],uM.prototype,`allowReorder`,void 0),E([d({attribute:`sticky-headers`,reflect:!0,converter:{fromAttribute:e=>e!==`false`,toAttribute:e=>e?`true`:`false`}})],uM.prototype,`stickyHeaders`,void 0),E([d()],uM.prototype,`gap`,void 0),E([p({slot:``})],uM.prototype,`_panels`,void 0),uM=E([T(`ixfx-panel-group`)],uM);var dM=Object.defineProperty,fM=(e,n)=>{let r={};for(var i in e)dM(r,i,{get:e[i],enumerable:!0});return n||dM(r,Symbol.toStringTag,{value:`Module`}),r};const pM=Math.pow,mM=1/Math.sqrt(2*Math.PI),hM=(e=.4)=>n=>{let r=mM/e,i=-2.5,a=(n-.5)/e;a*=a,i*=a;let o=r*pM(Math.E,i);return o>1?1:o<0?0:o};var gM=/* @__PURE__ */ fM({arch:()=>TM,backIn:()=>WM,backInOut:()=>qM,backOut:()=>GM,bell:()=>ZM,bounceIn:()=>XM,bounceInOut:()=>$M,bounceOut:()=>SM,circIn:()=>HM,circInOut:()=>KM,circOut:()=>UM,cubicIn:()=>PM,cubicOut:()=>FM,elasticIn:()=>JM,elasticInOut:()=>QM,elasticOut:()=>YM,expoIn:()=>RM,expoInOut:()=>VM,expoOut:()=>zM,quadIn:()=>AM,quadInOut:()=>NM,quadOut:()=>jM,quartIn:()=>IM,quartOut:()=>LM,quintIn:()=>CM,quintInOut:()=>BM,quintOut:()=>wM,sineIn:()=>OM,sineInOut:()=>MM,sineOut:()=>kM,smootherstep:()=>DM,smoothstep:()=>EM});const _M=Math.sqrt,vM=Math.pow,yM=Math.cos,bM=Math.PI,xM=Math.sin,SM=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},CM=e=>e*e*e*e*e,wM=e=>1-vM(1-e,5),TM=e=>e*(1-e)*4,EM=e=>e*e*(3-2*e),DM=e=>(e*(e*6-15)+10)*e*e*e,OM=e=>1-yM(e*bM/2),kM=e=>xM(e*bM/2),AM=e=>e*e,jM=e=>1-(1-e)*(1-e),MM=e=>-(yM(bM*e)-1)/2,NM=e=>e<.5?2*e*e:1-vM(-2*e+2,2)/2,PM=e=>e*e*e,FM=e=>1-vM(1-e,3),IM=e=>e*e*e*e,LM=e=>1-vM(1-e,4),RM=e=>e===0?0:vM(2,10*e-10),zM=e=>e===1?1:1-vM(2,-10*e),BM=e=>e<.5?16*e*e*e*e*e:1-vM(-2*e+2,5)/2,VM=e=>e===0?0:e===1?1:e<.5?vM(2,20*e-10)/2:(2-vM(2,-20*e+10))/2,HM=e=>1-_M(1-vM(e,2)),UM=e=>_M(1-vM(e-1,2)),WM=e=>2.70158*e*e*e-1.70158*e*e,GM=e=>1+2.70158*vM(e-1,3)+1.70158*vM(e-1,2),KM=e=>e<.5?(1-_M(1-vM(2*e,2)))/2:(_M(1-vM(-2*e+2,2))+1)/2,qM=e=>{let n=2.5949095;return e<.5?vM(2*e,2)*(7.189819*e-n)/2:(vM(2*e-2,2)*(3.5949095*(e*2-2)+n)+2)/2},JM=e=>{let n=2*bM/3;return e===0?0:e===1?1:-vM(2,10*e-10)*xM((e*10-10.75)*n)},YM=e=>{let n=2*bM/3;return e===0?0:e===1?1:vM(2,-10*e)*xM((e*10-.75)*n)+1},XM=e=>1-SM(1-e),ZM=hM(),QM=e=>{let n=2*bM/4.5;return e===0?0:e===1?1:e<.5?-(vM(2,20*e-10)*xM((20*e-11.125)*n))/2:vM(2,-20*e+10)*xM((20*e-11.125)*n)/2+1},$M=e=>e<.5?(1-SM(1-2*e))/2:(1+SM(2*e-1))/2,eN=(e=0,n=0)=>{let r={x:Ni(e,-1,1,0,1),y:Ni(e,-1,1,1,0)},i=tm.interpolate(Math.abs(e),tm.Empty,r);e!==0&&n>0&&(i=e>0?tm.interpolate(n,i,{x:0,y:r.x*2}):tm.interpolate(n,i,{x:r.y*2,y:0}));let a=ho.cubic(tm.Empty,tm.Unit,i,r),o=ho.interpolator(a);return e=>o(e)},tN=(e,n)=>{k(si(e,`fn`));let r;return()=>(r===void 0&&(r=Kf(n,{clampValue:!0})),e(r()))},nN=(e,n)=>{k(si(e,`fn`));let r=Zf(),i=is(n);if(i===void 0)throw Error(`Param 'duration' not provided`);let a=Xf(i,{timer:r,clampValue:!0});return $f(e,a)},rN=(e,n)=>{k(si(e,`fn`));let r;return()=>(r===void 0&&(r=qf(n,{clampValue:!0})),e(r()))},iN=(e,n)=>{k(si(e,`fn`));let r=Qf(),i=Xf(n,{timer:r,clampValue:!0});return $f(e,i)};var aN=/* @__PURE__ */ fM({Named:()=>gM,create:()=>oN,get:()=>pN,getEasingNames:()=>hN,line:()=>eN,tickEasing:()=>uN,ticks:()=>lN,time:()=>cN,timeEasing:()=>sN});const oN=e=>{let n=dN(e.name??`quintIn`)??e.fn;if(n===void 0)throw Error(`Either 'name' or 'fn' must be set`);if(`duration`in e)return cN(n,e.duration);if(`ticks`in e)return lN(n,e.ticks);throw Error(`Expected 'duration' or 'ticks' in options`)},sN=(e,n)=>nN(dN(e),n),cN=(e,n)=>tN(dN(e),n),lN=(e,n)=>rN(dN(e),n),uN=(e,n)=>iN(dN(e),n),dN=e=>{let n=typeof e==`function`?e:pN(e);if(n===void 0)throw Error(typeof e==`string`?`Easing function not found: '${e}'`:`Easing function not found`);return n};let fN;const pN=function(e){k(ci(e,`non-empty`,`easingName`));let n=mN().get(e.toLowerCase());if(n===void 0)throw Error(`Easing not found: '${e}'`);return n};function mN(){if(fN===void 0){fN=/* @__PURE__ */ new Map;for(let[e,n]of Object.entries(gM))fN.set(e.toLowerCase(),n);return fN}return fN}function*hN(){yield*mN().keys()}const gN=[`green`,`yellow`,`red`],_N=/* @__PURE__ */ new Map;function vN(e){let n=e.join(`\0`);return _N.has(n)||_N.set(n,Cv.scale(e,{stepsBetween:99})),_N.get(n)}function yN(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 bN(e){return yN(e,`--plot-color`)||`oklch(60% 0.15 140)`}function xN(e){if(!e.trim())return gN;let n=e.split(`,`).map(e=>e.trim()).filter(Boolean);return n.length>=2?n:gN}function SN(e){try{let n=Cv.HslSpace.fromCss(e,{scalar:!0});return{h:n.h,s:n.s,l:n.l}}catch{return{h:.39,s:.5,l:.55}}}function CN(e,n){let r=Math.max(0,Math.min(1,e));if(n.easingName)try{return Math.max(0,Math.min(1,aN.get(n.easingName)(r)))}catch{}return n.valueMap?Math.max(0,Math.min(1,n.valueMap(r))):r}function wN(e,n,r){let i=CN(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=SN(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=SN(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=SN(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=vN(r.palette.length>=2?r.palette:gN);return{fill:e[Math.min(e.length-1,Math.floor(i*e.length))],opacity:1}}default:return{fill:n,opacity:1}}}function TN(e,n,r){if(r===`opacity`)return{...e,opacity:e.opacity*Math.max(.08,n**.6)};if(r===`desaturation`){let r=SN(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 EN=class{#e;#t;#n;#r;constructor(e={}){this.values=[],this.#e=Li(),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=Li());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 DN(e){if(typeof e==`number`)return!0;if(typeof e!=`string`)return!1;let n=e.trim();return n!==``&&!Number.isNaN(Number(n))}var ON;let kN=!1;function AN(){if(kN)return;kN=!0;let e=document.createElement(`style`);e.textContent=`
|
|
11762
11763
|
ixfx-tooltip {
|
|
11763
11764
|
display: inline-block;
|
|
11764
11765
|
background: var(--surface-5);
|
|
@@ -11773,7 +11774,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
11773
11774
|
ixfx-tooltip .tooltip-type-number {
|
|
11774
11775
|
font-family: var(--font-mono, ui-monospace, monospace);
|
|
11775
11776
|
}
|
|
11776
|
-
`,document.head.appendChild(e)}let
|
|
11777
|
+
`,document.head.appendChild(e)}let jN=class extends n{static{ON=this}constructor(...e){super(...e),this.valueFormatTooltip=ON.defaultFormatter,this.orientation=`top`,this.anchor=`--tooltip`}connectedCallback(){super.connectedCallback(),AN()}static{this.numberFormatter=e=>Math.floor(e).toString()}static{this.defaultFormatter=e=>typeof e==`number`?Number.isInteger(e)?e.toString():e.toFixed(2):typeof e==`string`?e:JSON.stringify(e)}#e(){return this.icon?this.icon.startsWith(`<svg`)?i`<span class="tooltip-icon" style="display:inline-flex;align-items:center;margin-right:0.25em">${g(this.icon)}</span>`:xe(this.icon)?i`<ixfx-icon class="tooltip-icon" style="margin-right:0.25em" name="${this.icon}"></ixfx-icon>`:a:a}render(){let e={tooltip:!0,"tooltip-orientation-top":this.orientation===`top`,"tooltip-orientation-bottom":this.orientation===`bottom`,"tooltip-orientation-right":this.orientation===`right`,"tooltip-orientation-left":this.orientation===`left`,"tooltip-type-text":!0,"tooltip-type-number":!1,"tooltip-style-bubble":!0},n=``;switch(typeof this.value){case`number`:e[`tooltip-type-number`]=!0,n=this.valueFormatTooltip(this.value);break;case`string`:DN(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})],jN.prototype,`orientation`,void 0),E([d({type:String})],jN.prototype,`anchor`,void 0),E([d()],jN.prototype,`value`,void 0),E([d({type:String})],jN.prototype,`icon`,void 0),jN=ON=E([T(`ixfx-tooltip`)],jN);let MN=null,NN=null;function PN(){if(MN)return MN;let e=document.createElement(`div`);return e.style.cssText=`
|
|
11777
11778
|
position: fixed;
|
|
11778
11779
|
pointer-events: none;
|
|
11779
11780
|
z-index: 9999;
|
|
@@ -11787,13 +11788,13 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
11787
11788
|
font-family: ui-monospace, monospace;
|
|
11788
11789
|
opacity: 0;
|
|
11789
11790
|
transition: opacity 0.1s ease;
|
|
11790
|
-
`,document.body.appendChild(e),
|
|
11791
|
+
`,document.body.appendChild(e),MN=e,e}function FN(e,n,r,i){let a=PN();NN=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 IN(e,n,r,i){let a=PN();NN=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 LN(e){if(NN!==e)return;let n=PN();n.style.opacity=`0`,NN=null}let RN=null,zN=null;function BN(){if(RN)return RN;let e=document.createElement(`ixfx-tooltip`);return e.style.cssText=`
|
|
11791
11792
|
position: fixed;
|
|
11792
11793
|
z-index: 9999;
|
|
11793
11794
|
pointer-events: none;
|
|
11794
11795
|
opacity: 0;
|
|
11795
11796
|
transition: opacity 0.12s ease;
|
|
11796
|
-
`,document.body.appendChild(e),
|
|
11797
|
+
`,document.body.appendChild(e),RN=e,e}function VN(e,n,r,i,a){let o=BN();zN=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 HN(e){if(zN!==e)return;let n=BN();n.style.opacity=`0`,zN=null}function UN(e,n){return Math.max(1,Math.min(e,n)/25)}function WN(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 GN(e,n,r){let i=r-n;return i===0?.5:(e-n)/i}const KN=[`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 qN=class extends n{constructor(...e){super(...e),this.layout=`overlap`,this.gridMinWidth=200,this.valueFormat=e=>e?e.toFixed(2):``,this.#e=/* @__PURE__ */ new Map,this.#t=[],this.#n=/* @__PURE__ */ new Set,this.#r=/* @__PURE__ */ 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);else 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%KN.length;n.style.setProperty(`--plot-color`,KN[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){LN(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)}`)}i.length===0?LN(this):IN(this,e,n,i.join(`<br>`))}#s(){LN(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`
|
|
11797
11798
|
<div
|
|
11798
11799
|
id="container"
|
|
11799
11800
|
class="layout layout-${this.layout}"
|
|
@@ -11849,7 +11850,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
11849
11850
|
grid-template-columns: repeat(auto-fill, minmax(var(--grid-min-width, 200px), 1fr));
|
|
11850
11851
|
gap: var(--space-s, 4px);
|
|
11851
11852
|
}
|
|
11852
|
-
`}};E([d()],
|
|
11853
|
+
`}};E([d()],qN.prototype,`layout`,void 0),E([d({attribute:`grid-min-width`,type:Number})],qN.prototype,`gridMinWidth`,void 0),qN=E([T(`ixfx-plot-multi-axis`)],qN);let JN=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 EN({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=()=>{this.interactionMode===`select`?this._isDragging&&(this._isDragging=!1,this._selectionOverlayText=null,this.requestUpdate(),this.#s(!0)):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 EN({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,HN(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);VN(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,HN(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);this.#_=o,this.#m?(VN(this,a,o.mainClient,o.crossClient,this.orientation),this.#b(()=>this.#w())):(this.#h!==null&&clearTimeout(this.#h),this.#h=window.setTimeout(()=>{this.#h=null,this.#m=!0,VN(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){e!==this._hoveredIndex&&(this._hoveredIndex=e,this.#y(),e===null?this._inlineOverlayText=null:(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`
|
|
11853
11854
|
<rect class="bar" x=${e.x} y=${e.y} width=${e.width} height=${e.height}
|
|
11854
11855
|
style="--value: ${e.relativeValue}; ${r}"
|
|
11855
11856
|
@click=${()=>this.#o(n,e.valueMin,e.valueMax,e.relativeValue)} />
|
|
@@ -11898,37 +11899,37 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
11898
11899
|
dominant-baseline: hanging;
|
|
11899
11900
|
pointer-events: none;
|
|
11900
11901
|
}
|
|
11901
|
-
`}};E([d({attribute:`orientation`})],
|
|
11902
|
-
d=${
|
|
11902
|
+
`}};E([d({attribute:`orientation`})],JN.prototype,`orientation`,void 0),E([d({type:Number})],JN.prototype,`resolution`,void 0),E([d({type:Number})],JN.prototype,`min`,void 0),E([d({type:Number})],JN.prototype,`max`,void 0),E([d({type:Number})],JN.prototype,`capacity`,void 0),E([d({attribute:!1})],JN.prototype,`title`,void 0),E([d({type:Boolean,reflect:!0})],JN.prototype,`paused`,void 0),E([d({attribute:`value-tooltips`})],JN.prototype,`valueTooltips`,void 0),E([d({type:Number,attribute:`tooltip-delay`})],JN.prototype,`tooltipDelay`,void 0),E([d({type:Number,attribute:`value-update-interval`})],JN.prototype,`valueUpdateInterval`,void 0),E([d({attribute:`interaction-mode`})],JN.prototype,`interactionMode`,void 0),E([m()],JN.prototype,`_width`,void 0),E([m()],JN.prototype,`_height`,void 0),E([m()],JN.prototype,`_hoveredIndex`,void 0),E([m()],JN.prototype,`_inlineOverlayText`,void 0),E([m()],JN.prototype,`_coloredRangeMin`,void 0),E([m()],JN.prototype,`_coloredRangeMax`,void 0),E([m()],JN.prototype,`_selectionStart`,void 0),E([m()],JN.prototype,`_selectionEnd`,void 0),E([m()],JN.prototype,`_isDragging`,void 0),E([m()],JN.prototype,`_selectionOverlayText`,void 0),JN=E([T(`ixfx-plot-histogram`)],JN);function YN(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 XN(e,n,r,i){return s`<path
|
|
11903
|
+
d=${YN(e)}
|
|
11903
11904
|
fill="none"
|
|
11904
11905
|
stroke=${n.fill}
|
|
11905
11906
|
stroke-width=${r}
|
|
11906
11907
|
opacity=${n.opacity}
|
|
11907
11908
|
stroke-linecap=${i?`round`:`butt`}
|
|
11908
11909
|
stroke-linejoin=${i?`round`:`miter`}
|
|
11909
|
-
/>`}function
|
|
11910
|
+
/>`}function ZN(e,n,r,i){if(e.length<2)return s``;let a=YN(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 QN(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 $N(e,n,r,i){return e.map((e,a)=>{let o=i===`size`?r*Math.max(.2,e.ageFraction):r;return s`<rect
|
|
11910
11911
|
x=${e.x-o/2} y=${e.y-o/2}
|
|
11911
11912
|
width=${o} height=${o}
|
|
11912
11913
|
fill=${n[a].fill} opacity=${n[a].opacity}
|
|
11913
|
-
/>`})}function
|
|
11914
|
+
/>`})}function eP(e,n,r,i,a){return e.map((e,o)=>{let c=a===`size`?r*Math.max(.2,e.ageFraction):r;return s`<line
|
|
11914
11915
|
x1=${e.x} y1=${i} x2=${e.x} y2=${e.y}
|
|
11915
11916
|
stroke=${n[o].fill} stroke-width=${c} opacity=${n[o].opacity}
|
|
11916
|
-
/>`})}function
|
|
11917
|
+
/>`})}function tP(e,n,r,i,a){return e.map((e,o)=>{let c=a===`size`?i*Math.max(.2,e.ageFraction):i;return s`<line
|
|
11917
11918
|
x1=${e.x-c/2} y1=${e.y} x2=${e.x+c/2} y2=${e.y}
|
|
11918
11919
|
stroke=${n[o].fill} stroke-width=${r} opacity=${n[o].opacity}
|
|
11919
|
-
/>`})}function
|
|
11920
|
+
/>`})}function nP(e,n,r,i,a){return e.map((e,o)=>{let c=a===`size`?r*Math.max(.2,e.ageFraction):r;return s`<rect
|
|
11920
11921
|
x=${e.x-c/2} y=${e.y}
|
|
11921
11922
|
width=${c} height=${Math.max(1,i-e.y)}
|
|
11922
11923
|
fill=${n[o].fill} opacity=${n[o].opacity}
|
|
11923
|
-
/>`})}function
|
|
11924
|
+
/>`})}function rP(e,n,r,i,a){return e.map((e,o)=>{let c=a===`size`?r*Math.max(.2,e.ageFraction):r;return s`<rect
|
|
11924
11925
|
x=${e.x-c/2} y=${i}
|
|
11925
11926
|
width=${c} height=${Math.max(1,e.y-i)}
|
|
11926
11927
|
fill=${n[o].fill} opacity=${n[o].opacity}
|
|
11927
|
-
/>`})}function
|
|
11928
|
+
/>`})}function iP(e,n,r,i,a){return e.map((e,o)=>{let c=a===`size`?r*Math.max(.2,e.ageFraction):r;return s`<rect
|
|
11928
11929
|
x=${e.x-c/2} y=${Math.min(e.y,i)}
|
|
11929
11930
|
width=${c} height=${Math.max(1,Math.abs(e.y-i))}
|
|
11930
11931
|
fill=${n[o].fill} opacity=${n[o].opacity}
|
|
11931
|
-
/>`})}let
|
|
11932
|
+
/>`})}let aP=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 EN,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,LN(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 EN({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);i<0?LN(this):FN(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=Ei(GN(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[ZN(e,l,o,d),this.drawStyle===`line-sharp`?XN(e,l,r,!1):XN(e,l,r,!0)];switch(this.drawStyle){case`line-sharp`:return[XN(e,l,r,!1)];case`line-round`:return[XN(e,l,r,!0)];case`circles`:return QN(e,n,i,this.ageStyle);case`squares`:return $N(e,n,i*2,this.ageStyle);case`vbar`:return eP(e,n,r,o,this.ageStyle);case`hbar`:return tP(e,n,r,a,this.ageStyle);case`hist-bottom`:return nP(e,n,a,o,this.ageStyle);case`hist-top`:return rP(e,n,a,s,this.ageStyle);case`hist-middle`:return iP(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=UN(r,a),m=WN(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?bN(this):``,y={mode:this.colorMode,palette:xN(this.colorScale),easingName:this.colorEasing,valueMap:this.colorValueMap},b=this.drawStyle!==`line-sharp`&&this.drawStyle!==`line-round`,x=_.map(e=>{let n=wN(e.scaledValue,v,y);return b?TN(n,e.ageFraction,this.ageStyle):n}),S=_.length>0?this.#f(_,x,p,m,h,u,d,f):[],ee=this.title?s`<text
|
|
11932
11933
|
x=${o+2} y=${d+Math.min(10,a*.6)}
|
|
11933
11934
|
class="overlay-text"
|
|
11934
11935
|
fill=${g}
|
|
@@ -11974,7 +11975,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
11974
11975
|
dominant-baseline: hanging;
|
|
11975
11976
|
pointer-events: none;
|
|
11976
11977
|
}
|
|
11977
|
-
`}};E([d({attribute:`draw-style`})],
|
|
11978
|
+
`}};E([d({attribute:`draw-style`})],aP.prototype,`drawStyle`,void 0),E([d({attribute:`age-style`})],aP.prototype,`ageStyle`,void 0),E([d()],aP.prototype,`title`,void 0),E([d({type:Boolean})],aP.prototype,`precise`,void 0),E([d({type:Boolean})],aP.prototype,`tooltips`,void 0),E([d({type:Number})],aP.prototype,`capacity`,void 0),E([d({type:Number})],aP.prototype,`rangeMin`,void 0),E([d({type:Number})],aP.prototype,`rangeMax`,void 0),E([d({type:Boolean,attribute:`persistent-scale`})],aP.prototype,`persistentScale`,void 0),E([d({type:Boolean,reflect:!0})],aP.prototype,`paused`,void 0),E([d({type:Boolean,attribute:`click-pauses`})],aP.prototype,`clickPauses`,void 0),E([d({type:Boolean,attribute:`shaded`})],aP.prototype,`shaded`,void 0),E([d({attribute:`area-color`})],aP.prototype,`areaColor`,void 0),E([d({attribute:`color-mode`})],aP.prototype,`colorMode`,void 0),E([d({attribute:`color-easing`})],aP.prototype,`colorEasing`,void 0),E([d({attribute:`color-scale`})],aP.prototype,`colorScale`,void 0),E([m()],aP.prototype,`_width`,void 0),E([m()],aP.prototype,`_height`,void 0),aP=E([T(`ixfx-plot-single-axis`)],aP);let oP=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 EN({capacityLimit:100,persistentScaling:!0}),this.#t=new EN({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,LN(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 EN(e),this.#t=new EN(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+GN(i[f],s,c)*n,y:e+(1-GN(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:xN(this.colorScale),easingName:this.colorEasing,valueMap:this.colorValueMap};return e.map(e=>TN(wN(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);i?FN(this,e,n,this.valueFormat(i.xVal,i.yVal)):LN(this)}#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?bN(this):``,u=this.#r(c,l),d=WN(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
|
|
11978
11979
|
x=${r+2} y=${r+2}
|
|
11979
11980
|
class="overlay-text"
|
|
11980
11981
|
fill=${f}
|
|
@@ -12019,7 +12020,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
12019
12020
|
dominant-baseline: hanging;
|
|
12020
12021
|
pointer-events: none;
|
|
12021
12022
|
}
|
|
12022
|
-
`}};E([d({attribute:`draw-style`})],
|
|
12023
|
+
`}};E([d({attribute:`draw-style`})],oP.prototype,`drawStyle`,void 0),E([d({attribute:`age-style`})],oP.prototype,`ageStyle`,void 0),E([d()],oP.prototype,`title`,void 0),E([d({type:Boolean})],oP.prototype,`precise`,void 0),E([d({type:Boolean})],oP.prototype,`tooltips`,void 0),E([d({type:Number})],oP.prototype,`capacity`,void 0),E([d({type:Boolean,attribute:`persistent-scale`})],oP.prototype,`persistentScale`,void 0),E([d({type:Boolean,reflect:!0})],oP.prototype,`paused`,void 0),E([d({type:Boolean,attribute:`click-pauses`})],oP.prototype,`clickPauses`,void 0),E([d({attribute:`color-mode`})],oP.prototype,`colorMode`,void 0),E([d({attribute:`color-easing`})],oP.prototype,`colorEasing`,void 0),E([d({attribute:`color-scale`})],oP.prototype,`colorScale`,void 0),E([m()],oP.prototype,`_width`,void 0),E([m()],oP.prototype,`_height`,void 0),oP=E([T(`ixfx-plot-xy-axis`)],oP);const sP=Math.PI/180,cP=180/Math.PI;function lP(e,n){let r=n*50;return{x:50+Math.cos(e)*r,y:50+Math.sin(e)*r}}function uP(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 dP=e=>Math.max(0,Math.min(1,e));function fP(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 pP(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 mP(e,n){if(!n||n<=1)return e;let r=360/n,i=(e%360+360)%360;return Math.round(i/r)*r}function hP(e,n){if(!n||n<=1)return e;let r=1/n;return Math.round(e/r)*r}let gP=class extends yC(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=/* @__PURE__ */ 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=vC(360,n,this.stepAngle,e),a=vC(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=fP(o,this._prevAngle,this.rays,this.snapValue),l=pP(s,this._prevRadius,this.rings,this.snapValue);c=mP(c,n),l=hP(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=[dn,w,r`
|
|
12023
12024
|
:host {
|
|
12024
12025
|
display: block;
|
|
12025
12026
|
width: 200px;
|
|
@@ -12152,7 +12153,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
12152
12153
|
stroke: var(--accent);
|
|
12153
12154
|
stroke-width: 3;
|
|
12154
12155
|
}
|
|
12155
|
-
`]}_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}=
|
|
12156
|
+
`]}_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}=uP((e.clientX-r.left)/i*100,(e.clientY-r.top)/i*100),s=a*cP,c=dP(o);this._prevAngle=this.angle,this._prevRadius=this.radius;let l=fP(s,this._prevAngle,this.rays,this.snapValue),u=pP(c,this._prevRadius,this.rings,this.snapValue),d=this.stopsAngle??this.stops,f=this.stopsRadius??this.stops;this.angle=mP(l,d),this.radius=hP(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=vC(1,r,this.stepRadius,n);this._prevRadius=this.radius;let a=hP(pP(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*sP}`),this.style.setProperty(`--radius-pct`,`${dP(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}=lP(this.angle*sP,dP(this.radius));return i`
|
|
12156
12157
|
<div class="polar-pad-area"
|
|
12157
12158
|
@pointerdown=${this._onPointerDown}
|
|
12158
12159
|
@keydown=${this._onKeyDown}
|
|
@@ -12191,7 +12192,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
12191
12192
|
/>
|
|
12192
12193
|
</svg>
|
|
12193
12194
|
</div>
|
|
12194
|
-
`}};E([d({type:Number})],
|
|
12195
|
+
`}};E([d({type:Number})],gP.prototype,`angle`,void 0),E([d({type:Number})],gP.prototype,`radius`,void 0),E([d({type:Number})],gP.prototype,`rings`,void 0),E([d({type:Number})],gP.prototype,`rays`,void 0),E([d({type:Boolean,reflect:!0,attribute:`show-ray`})],gP.prototype,`showRay`,void 0),E([d({type:Boolean,reflect:!0,attribute:`show-origin`})],gP.prototype,`showOrigin`,void 0),E([d({type:Boolean,reflect:!0,attribute:`hide-cursor`})],gP.prototype,`hideCursor`,void 0),E([d({type:Boolean,attribute:`snap-value`,reflect:!0})],gP.prototype,`snapValue`,void 0),E([d({type:Boolean,reflect:!0})],gP.prototype,`disabled`,void 0),E([d({type:Number})],gP.prototype,`stops`,void 0),E([d({type:Number,attribute:`stops-angle`})],gP.prototype,`stopsAngle`,void 0),E([d({type:Number,attribute:`stops-radius`})],gP.prototype,`stopsRadius`,void 0),E([d({type:Number,attribute:`step-angle`})],gP.prototype,`stepAngle`,void 0),E([d({type:Number,attribute:`step-radius`})],gP.prototype,`stepRadius`,void 0),gP=E([T(`ixfx-polar-pad`)],gP);const _P=r`
|
|
12195
12196
|
|
|
12196
12197
|
output.tooltip {
|
|
12197
12198
|
user-select: none;
|
|
@@ -12288,7 +12289,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
12288
12289
|
100% calc(50% + var(--b)/2));
|
|
12289
12290
|
}
|
|
12290
12291
|
}
|
|
12291
|
-
`;function
|
|
12292
|
+
`;function vP(e,n,r){return r===n?0:(e-n)/(r-n)}let yP=class extends yC(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(vP(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(vP(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(vP(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,vP(n,this.min,this.max));let r=this.step>=1?0:this.step>=.1?1:2;return n.toFixed(r)})}_formatTooltipLabel(){let e=vP(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`
|
|
12292
12293
|
<ixfx-tooltip
|
|
12293
12294
|
style="--tooltip-background: var(--surface-5); --tooltip-color: var(--surface-5-text)"
|
|
12294
12295
|
.orientation=${this.tooltipOrientation}
|
|
@@ -12308,7 +12309,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
12308
12309
|
@change=${this._handleChange}
|
|
12309
12310
|
>${e}
|
|
12310
12311
|
</div>
|
|
12311
|
-
`}static{this.styles=[w,
|
|
12312
|
+
`}static{this.styles=[w,_P,r`
|
|
12312
12313
|
:host {
|
|
12313
12314
|
display: block;
|
|
12314
12315
|
container-type: size;
|
|
@@ -12588,14 +12589,14 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
12588
12589
|
:host([swipeable][orientation="vertical"]):hover .range-bg {
|
|
12589
12590
|
background: var(--background-track-hover-vertical, var(--_bg-track-hover));
|
|
12590
12591
|
}
|
|
12591
|
-
`]}};E([d({type:Number})],
|
|
12592
|
+
`]}};E([d({type:Number})],yP.prototype,`min`,void 0),E([d({type:Number})],yP.prototype,`max`,void 0),E([d({type:Number})],yP.prototype,`value`,void 0),E([d({type:Number})],yP.prototype,`step`,void 0),E([d({type:String,reflect:!0})],yP.prototype,`orientation`,void 0),E([d({type:Boolean,reflect:!0})],yP.prototype,`swipeable`,void 0),E([d({type:Boolean})],yP.prototype,`tooltip`,void 0),E([d({type:String,attribute:`tooltip-orientation`})],yP.prototype,`tooltipOrientation`,void 0),E([d({attribute:!1})],yP.prototype,`labelFormatter`,void 0),E([f(`input`)],yP.prototype,`_inputEl`,void 0),E([f(`ixfx-tooltip`)],yP.prototype,`_tooltipEl`,void 0),yP=E([T(`ixfx-range-input`)],yP);function bP(e){return{client:{x:e.clientX,y:e.clientY},offset:{x:e.offsetX,y:e.offsetY}}}function xP(e,n){let r=bP(e),i=e=>{n.progress(bP(e),r)},a=e=>{document.removeEventListener(`pointermove`,i),document.removeEventListener(`pointerup`,a),n.complete(bP(e),r)};document.addEventListener(`pointermove`,i),document.addEventListener(`pointerup`,a)}function SP(e,n){let r=e-n,i=e+n;return e=>e>=r&&e<=i}let CP=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=Pi(this.#t,this.#e,0,100),this.#r=Pi(0,100,this.#t,this.#e),this.#i=Di(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=SP(d,10),m=SP(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;xP(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`)}else if(m(c)){if(this.draggingThumb=`b`,this.resizeMode===`dual`)return!1;e.preventDefault(),e.target.setPointerCapture(e.pointerId),h(`b`)}else 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`
|
|
12592
12593
|
<div @pointerdown=${this._onPointerDown} @input=${this._onInput} style="--a: ${r}; --b: ${o}">
|
|
12593
12594
|
<input class="thumb-round" .value=${r} id="a" step=${this.step} type="range" style="${s}" anchor="--a-tooltip" />
|
|
12594
12595
|
${e}
|
|
12595
12596
|
|
|
12596
12597
|
<input class="thumb-round" .value=${o} id="b" step=${this.step} type="range" style="${s}" anchor="--b-tooltip" />
|
|
12597
12598
|
${n}
|
|
12598
|
-
</div>`}static{this.styles=[w,
|
|
12599
|
+
</div>`}static{this.styles=[w,_P,dn,r`
|
|
12599
12600
|
:host {
|
|
12600
12601
|
display: grid;
|
|
12601
12602
|
--value-label-color: unset;
|
|
@@ -12740,14 +12741,14 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
12740
12741
|
[type=range]:focus, [type=range]:focus + ixfx-tooltip, [type=range]:hover, [type=range]:hover + ixfx-tooltip {
|
|
12741
12742
|
--sel: 1 ;
|
|
12742
12743
|
}
|
|
12743
|
-
`]}};E([d({type:Boolean})],
|
|
12744
|
+
`]}};E([d({type:Boolean})],CP.prototype,`tooltip`,void 0),E([d({type:String,attribute:`tooltip-orientation`})],CP.prototype,`tooltipOrientation`,void 0),E([d({type:String})],CP.prototype,`crossover`,void 0),E([d({type:String,attribute:`resize-mode`})],CP.prototype,`resizeMode`,void 0),E([d({type:String,reflect:!0})],CP.prototype,`orientation`,void 0),E([d()],CP.prototype,`step`,void 0),E([d({type:Number})],CP.prototype,`a`,void 0),E([d({type:Number})],CP.prototype,`b`,void 0),E([d({type:Number})],CP.prototype,`max`,null),E([d({type:Number})],CP.prototype,`min`,null),E([u({capture:!0})],CP.prototype,`_onInput`,null),E([u({capture:!0})],CP.prototype,`_onPointerDown`,null),CP=E([T(`ixfx-range-multi`)],CP);let wP=class extends yC(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
|
|
12744
12745
|
style="--tooltip-background: var(--surface-5); --tooltip-color: var(--surface-5-text)"
|
|
12745
12746
|
.orientation=${this.tooltipOrientation}
|
|
12746
12747
|
anchor="--thumb-tooltip"
|
|
12747
12748
|
.value=${this.value}></ixfx-tooltip>`:a,n=this.orientation===`vertical`?`writing-mode: vertical-lr; direction: rtl;`:a;return i`
|
|
12748
12749
|
<input ?disabled=${this.disabled} step=${this.step} min=${this.min} max=${this.max} value=${this.value} @input=${this.onRangeInput} type="range" style=${n}>
|
|
12749
12750
|
${e}
|
|
12750
|
-
`}static{this.styles=[w,dn,
|
|
12751
|
+
`}static{this.styles=[w,dn,_P,r`
|
|
12751
12752
|
:host {
|
|
12752
12753
|
display: inline-block;
|
|
12753
12754
|
--value-label-color: unset;
|
|
@@ -12806,7 +12807,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
12806
12807
|
[type="range"]:focus {
|
|
12807
12808
|
outline: none;
|
|
12808
12809
|
}
|
|
12809
|
-
`]}};E([d({type:Boolean})],
|
|
12810
|
+
`]}};E([d({type:Boolean})],wP.prototype,`tooltip`,void 0),E([d({type:String,attribute:`tooltip-orientation`})],wP.prototype,`tooltipOrientation`,void 0),E([d({type:String,reflect:!0})],wP.prototype,`orientation`,void 0),E([d({type:Boolean,attribute:!0})],wP.prototype,`disabled`,void 0),E([d({type:Number})],wP.prototype,`min`,void 0),E([d({type:Number})],wP.prototype,`max`,void 0),E([d({type:Number})],wP.prototype,`value`,null),E([d({type:Number})],wP.prototype,`step`,void 0),wP=E([T(`ixfx-range`)],wP);let TP=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=[dn,r`
|
|
12810
12811
|
:host {
|
|
12811
12812
|
--ixfx-rating-size: 1.5rem;
|
|
12812
12813
|
--ixfx-rating-gap: 0.2rem;
|
|
@@ -12844,7 +12845,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
12844
12845
|
@click=${e=>this._commit(this._calc(e,a))}>
|
|
12845
12846
|
<svg viewBox="0 0 24 24" class="bg" fill="currentColor"><path d=${d}></path></svg>
|
|
12846
12847
|
${s||c?i`<svg viewBox="0 0 24 24" class="fill" fill="currentColor"><path d=${d}></path></svg>`:``}
|
|
12847
|
-
</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})],
|
|
12848
|
+
</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})],TP.prototype,`value`,void 0),E([d({type:Number})],TP.prototype,`max`,void 0),E([d({type:Boolean,attribute:`allow-half`})],TP.prototype,`allowHalf`,void 0),E([d({type:Boolean,reflect:!0})],TP.prototype,`disabled`,void 0),E([d({type:Boolean,reflect:!0})],TP.prototype,`readonly`,void 0),E([d({type:String})],TP.prototype,`variant`,void 0),E([m()],TP.prototype,`_preview`,void 0),TP=E([T(`ixfx-rating`)],TP);let EP=class extends yC(n){constructor(...e){super(...e),this._selectedIndex=-1,this._slottedItems=[],this.tickled=new oe(this,{getItems:()=>this._slottedItems.map((e,n)=>({id:n,enabled:!0})),onStateChange:()=>this._syncTickled()}),this._onSlotChange=()=>{this._slottedItems=Array.from(this.shadowRoot?.querySelector(`slot`)?.assignedElements()??[]);let e=this._slottedItems.findIndex(e=>e.hasAttribute(`selected`)),n=e>=0?e:this._selectedIndex;n>=this._slottedItems.length&&(n=this._slottedItems.length-1),n<0&&this._slottedItems.length>0&&(n=0),this.selectedIndex=n},this._syncTickled=()=>{this._slottedItems.forEach((e,n)=>{let r=this.tickled.isTickled(n);e.classList.toggle(`tickled`,r),e.tabIndex=r&&this.tickled.inputMode===`keyboard`?0:-1})},this._findSlottedItem=e=>{let n=e instanceof Element?e:null;for(;n;){if(this._slottedItems.includes(n))return n;n=n.parentElement}},this._handlePointerOver=e=>{let n=this._findSlottedItem(e.target);n&&this.tickled.handlePointerEnter(this._slottedItems.indexOf(n))},this._handleKeyDown=e=>{e.key===`ArrowLeft`?(e.preventDefault(),this.tickled.handleKeyboardNavigation(`previous`),this._applyTickledSelection()):e.key===`ArrowRight`?(e.preventDefault(),this.tickled.handleKeyboardNavigation(`next`),this._applyTickledSelection()):e.key===`Home`?(e.preventDefault(),this.tickled.handleKeyboardNavigation(`first`),this._applyTickledSelection()):e.key===`End`&&(e.preventDefault(),this.tickled.handleKeyboardNavigation(`last`),this._applyTickledSelection())},this._applyTickledSelection=()=>{let e=this.tickled.tickledId;e!==void 0&&e!==this._selectedIndex&&(this.selectedIndex=e)},this._wheelCooldown=!1,this._handleClick=e=>{e.currentTarget.focus();let n=this._findSlottedItem(e.target),r=n?this._slottedItems.indexOf(n):-1;r>=0&&r!==this._selectedIndex&&(this.selectedIndex=r)},this._updateSelectedAttribute=()=>{this._slottedItems.forEach((e,n)=>{n===this._selectedIndex?e.setAttribute(`selected`,``):e.removeAttribute(`selected`)})},this._scrollSelectedIntoView=()=>{let e=this._slottedItems[this._selectedIndex];e&&e.scrollIntoView({inline:`center`,behavior:`smooth`})},this._emitChange=()=>{this.dispatchEvent(new CustomEvent(`change`,{detail:{selectedIndex:this._selectedIndex,selectedItem:this.selectedItem,selectedValue:this.selectedValue},bubbles:!0,composed:!0}))}}static{this.styles=[w,se,C,Tr(`x`),r`
|
|
12848
12849
|
:host {
|
|
12849
12850
|
--select-horiz-item-width: 80%;
|
|
12850
12851
|
--select-horiz-gap: var(--space-s);
|
|
@@ -12940,7 +12941,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
12940
12941
|
<slot @slotchange=${this._onSlotChange}></slot>
|
|
12941
12942
|
<div class="spacer"></div>
|
|
12942
12943
|
</div>
|
|
12943
|
-
`}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()],
|
|
12944
|
+
`}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()],EP.prototype,`_selectedIndex`,void 0),E([m()],EP.prototype,`_slottedItems`,void 0),E([d({type:Number,reflect:!0,attribute:`selected-index`})],EP.prototype,`selectedIndex`,null),E([d({type:String})],EP.prototype,`selectedValue`,null),EP=E([T(`ixfx-select-horiz`)],EP);function DP(e,n,r){return Math.min(Math.max(e,n),r)}function OP(e,n,r,i,a){return r===n?i:i+(e-n)/(r-n)*(a-i)}let kP=class extends yC(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=OP(this.#n+r,this.min,this.max,0,1);this.#c(DP(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=vC(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 OP(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=OP(e,0,1,this.min,this.max),i=this.#s(DP(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(DP(this.#o()+e,0,1),n)}_applyWheelDelta(e,n){let r=this.max-this.min,i=vC(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`
|
|
12944
12945
|
<circle class="fill" cx="${r}" cy="${50}" r="${n}" />
|
|
12945
12946
|
<circle class="outline" cx="${50}" cy="${50}" r="${45}" fill="none" />
|
|
12946
12947
|
`}#_(){let e=this.#o();if(this.fillMode===`left`||this.fillMode===`right`){let n=90*e,r=this.fillMode===`left`?5:95-n;return s`
|
|
@@ -13007,10 +13008,10 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
13007
13008
|
fill: var(--shapefill-value-fill-color, var(--accent));
|
|
13008
13009
|
transition: var(--shapefill-value-fill-transition, none);
|
|
13009
13010
|
}
|
|
13010
|
-
`]}};E([d({type:String})],
|
|
13011
|
+
`]}};E([d({type:String})],kP.prototype,`display`,void 0),E([d({type:String,attribute:`fill-mode`})],kP.prototype,`fillMode`,void 0),E([d({type:Number})],kP.prototype,`value`,void 0),E([d({type:Number})],kP.prototype,`min`,void 0),E([d({type:Number})],kP.prototype,`max`,void 0),E([d({type:Number})],kP.prototype,`step`,void 0),E([d({type:Number})],kP.prototype,`stops`,void 0),E([d({type:Boolean,reflect:!0})],kP.prototype,`disabled`,void 0),kP=E([T(`ixfx-shapefill-value`)],kP);const AP=Array.from({length:30},(e,n)=>n%10),jP={lead:0,integer:1,decimal:2,fraction:3,trail:4};function MP(e,n){return(e%n+n)%n}function NP(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 PP=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=/* @__PURE__ */ 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()?NP(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)=>jP[e.section]-jP[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+MP(r-n,10):i===`down`?o-MP(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`
|
|
13011
13012
|
<span class="cell digit" part="digit" data-key=${e.key} data-phase=${e.phase}>
|
|
13012
13013
|
<span class="reel" style=${`--o:${10+Number(e.char)}`}>
|
|
13013
|
-
${
|
|
13014
|
+
${AP.map(e=>i`<span>${e}</span>`)}
|
|
13014
13015
|
</span>
|
|
13015
13016
|
</span>
|
|
13016
13017
|
`:i`
|
|
@@ -13119,7 +13120,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
13119
13120
|
:host([data-static]) .cell {
|
|
13120
13121
|
transition: none;
|
|
13121
13122
|
}
|
|
13122
|
-
`}};E([d({type:Number})],
|
|
13123
|
+
`}};E([d({type:Number})],PP.prototype,`value`,void 0),E([d({type:String})],PP.prototype,`locales`,void 0),E([d({type:Object})],PP.prototype,`format`,void 0),E([d({type:String})],PP.prototype,`prefix`,void 0),E([d({type:String})],PP.prototype,`suffix`,void 0),E([d({type:String})],PP.prototype,`trend`,void 0),E([d({type:Boolean,attribute:`no-animate`})],PP.prototype,`noAnimate`,void 0),E([d({type:Boolean,attribute:!1})],PP.prototype,`respectMotionPreference`,void 0),E([m()],PP.prototype,`_cells`,void 0),PP=E([T(`ixfx-sliding-number`)],PP);let FP=0,IP=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-${++FP}`,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;else 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}"`);else 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(){this._cancelHide(),this._cancelShow(),this.showDelay<=0?this.show():this._showTimeout=window.setTimeout(()=>this.show(),this.showDelay)}_scheduleHide(){this._cancelShow(),this._cancelHide(),this.hideDelay<=0?this.hide():this._hideTimeout=window.setTimeout(()=>this.hide(),this.hideDelay)}_cancelShow(){this._showTimeout!==void 0&&(window.clearTimeout(this._showTimeout),this._showTimeout=void 0)}_cancelHide(){this._hideTimeout!==void 0&&(window.clearTimeout(this._hideTimeout),this._hideTimeout=void 0)}static{this.styles=[w,de,r`
|
|
13123
13124
|
:host {
|
|
13124
13125
|
display: flex;
|
|
13125
13126
|
align-items: center;
|
|
@@ -13171,7 +13172,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
13171
13172
|
position-area: inline-end;
|
|
13172
13173
|
margin-inline-start: var(--space-s);
|
|
13173
13174
|
}
|
|
13174
|
-
`]}render(){return i`<slot></slot>`}};E([d({type:String})],
|
|
13175
|
+
`]}render(){return i`<slot></slot>`}};E([d({type:String})],IP.prototype,`for`,void 0),E([d({type:String})],IP.prototype,`mode`,void 0),E([d({type:String,reflect:!0})],IP.prototype,`placement`,void 0),E([d({type:String})],IP.prototype,`dismiss`,void 0),E([d({type:Number,attribute:`show-delay`})],IP.prototype,`showDelay`,void 0),E([d({type:Number,attribute:`hide-delay`})],IP.prototype,`hideDelay`,void 0),E([m()],IP.prototype,`_isOpen`,void 0),IP=E([T(`ixfx-snackbar`)],IP);let LP=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`
|
|
13175
13176
|
:host {
|
|
13176
13177
|
display: block;
|
|
13177
13178
|
position: relative;
|
|
@@ -13235,16 +13236,16 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
13235
13236
|
>
|
|
13236
13237
|
<slot></slot>
|
|
13237
13238
|
</div>
|
|
13238
|
-
`}};E([d({type:String,attribute:`orientation`})],
|
|
13239
|
+
`}};E([d({type:String,attribute:`orientation`})],LP.prototype,`orientation`,void 0),E([d({type:Number,attribute:`snap-positions`})],LP.prototype,`snapPositions`,void 0),E([d({type:String,attribute:`snap-logic`})],LP.prototype,`snapLogic`,void 0),E([d({type:String,attribute:`click-snap`})],LP.prototype,`clickSnap`,void 0),E([d({type:Number})],LP.prototype,`snap`,void 0),E([m()],LP.prototype,`_dragging`,void 0),LP=E([T(`ixfx-snap-container`)],LP);const RP=``,zP=e=>e.weight;function BP(e,n){return`${e}${n}`}function VP(e){return e.join(``)}function HP(e,n){return n.startsWith(`${e}`)}function UP(e){return e.split(``)}function WP(e){let n=e.lastIndexOf(``);return n<0?void 0:e.slice(0,n)}function GP(e,n){if(!e)return;let[r,...i]=UP(n);if(r!==e.item.key)return;let a=e;for(let e of i)if(a=a.children?.find(n=>n.item.key===e),!a)return;return a}function KP(e,n){if(!e)return;let r=(e,i)=>{if(n(e))return i;for(let n of e.children??[]){let e=r(n,BP(i,n.item.key));if(e!==void 0)return e}};return r(e,e.item.key)}function qP(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0?e:void 0}function JP(e){let n=/* @__PURE__ */ new Map,r=i=>{let a=n.get(i);if(a!==void 0)return a;let o=qP(e(i.item,i));if(o===void 0){let e=i.children??[];o=e.length>0?e.reduce((e,n)=>e+r(n),0):1}return n.set(i,o),o};return r}function YP(e){return e.children===void 0?e.item.isLeaf!==!0:e.children.length>0}function XP(e,n={}){let r=/* @__PURE__ */ new Map;if(!e)return r;let{valueAccessor:i=zP,maxDepth:a=1/0}=n,o=JP(i),s={id:e.item.key,node:e,parentId:void 0,depth:0,x0:0,x1:1,value:o(e),index:0,setSize:1,hasChildren:YP(e)};r.set(s.id,s);let c=[s];for(;c.length>0;){let e=[];for(let n of c){let i=n.node.children??[];if(i.length===0||n.depth+1>a)continue;let s=i.map(o),c=s.reduce((e,n)=>e+n,0),l=Math.max(n.value,c),u=n.x1-n.x0,d=n.x0;i.forEach((a,o)=>{let c=l>0?u*s[o]/l:0,f={id:BP(n.id,a.item.key),node:a,parentId:n.id,depth:n.depth+1,x0:d,x1:d+c,value:s[o],index:o,setSize:i.length,hasChildren:YP(a)};d+=c,r.set(f.id,f),e.push(f)})}c=e}return r}const ZP=Math.PI*2,QP=1-1e-6,$P=e=>Math.min(1,Math.max(0,e));function eF(e){return!e||e.x1-e.x0<=0?{x0:0,x1:1,depth:0}:{x0:e.x0,x1:e.x1,depth:e.depth}}function tF(e,n){let r=n.x1-n.x0;return{a0:$P((e.x0-n.x0)/r),a1:$P((e.x1-n.x0)/r),depth:e.depth-n.depth-1}}function nF(e,n){return e>=0?n.center+e*n.ring:Math.max(0,n.center*(1+e))}function rF(e,n){return{inner:nF(e,n),outer:nF(e+1,n)}}function iF(e,n,r){let i=Math.max(0,e),a=i*Math.min(.9,Math.max(0,r));return{center:a,ring:(i-a)/Math.max(1,n)}}function aF(e,n){let r=e*ZP;return`${(n*Math.sin(r)).toFixed(2)} ${(-n*Math.cos(r)).toFixed(2)}`}function oF(e){let n=(e*2).toFixed(2);return`M0 ${(-e).toFixed(2)}a${e.toFixed(2)} ${e.toFixed(2)} 0 1 1 0 ${n}a${e.toFixed(2)} ${e.toFixed(2)} 0 1 1 0 -${n}Z`}function sF(e,n,r,i){let a=n-e;if(a<=0||i<=0||i<=r)return``;if(a>=QP)return r>0?`${oF(i)}${oF(r)}`:oF(i);let o=+(a>.5),s=i.toFixed(2);if(r<=0)return`M0 0L${aF(e,i)}A${s} ${s} 0 ${o} 1 ${aF(n,i)}Z`;let c=r.toFixed(2);return`M${aF(e,i)}A${s} ${s} 0 ${o} 1 ${aF(n,i)}L${aF(n,r)}A${c} ${c} 0 ${o} 0 ${aF(e,r)}Z`}function cF(e,n,r){return Math.max(0,n-e)*ZP*r}function lF(e,n,r,i){let a=Math.min(n,e+.9999),o=+(a-e>.5),s=r.toFixed(2);return i?`M${aF(a,r)}A${s} ${s} 0 ${o} 0 ${aF(e,r)}`:`M${aF(e,r)}A${s} ${s} 0 ${o} 1 ${aF(a,r)}`}function uF(e,n){return e.length<=n?e:`${e.slice(0,n-1)}…`}function dF(e,n,r,i,a={}){if(e.depth<0||n.length===0)return;let{inner:o,outer:s}=rF(e.depth,r),c=s-o,l=(o+s)/2,u=e.a1-e.a0,d=cF(e.a0,e.a1,l),f=i*.6,p=i*.5,m=(e.a0+e.a1)/2,h=m*360,g=h>90&&h<270,_=c>=i*1.3;if(a.curved&&_){let r=Math.floor((d-p)/f);if(r>=Math.min(n.length,4))return{kind:`curved`,path:u>=QP?lF(.5,1.5,l,!1):lF(e.a0,e.a1,l,g),text:uF(n,r)}}let v=m*ZP,y=l*Math.sin(v),b=-l*Math.cos(v);if(!a.curved&&_&&u<.5&&d>=n.length*f+p)return{kind:`straight`,x:y,y:b,rotate:h+(g?180:0),text:n};if(d<i*1.1)return;let x=Math.floor((c-p)/f);if(!(x<3))return{kind:`straight`,x:y,y:b,rotate:h-90+(h>180?180:0),text:uF(n,x)}}function fF(e,n,r){let i=/* @__PURE__ */ new Map;for(let a of e.values()){if(a.depth<=n.depth)continue;if(a.parentId===r){let{a0:e,a1:r}=tF(a,n);i.set(a.id,(e+r)/2*360);continue}let e=a.parentId===void 0?void 0:i.get(a.parentId);e!==void 0&&i.set(a.id,e)}return i}function pF(e,n){return n<=1?0:(e+.5)/n-.5}function mF(e){let{layout:n,view:r,rings:i,zoomId:a,maxDepth:o}=e,s=/* @__PURE__ */ new Map;if(a===void 0)return s;let c=fF(n,r,a);for(let l of n.values()){let n=tF(l,r);n.depth<-1||n.depth>=o||(n.depth===-1?l.id!==a:!c.has(l.id))||n.depth>=0&&cF(n.a0,n.a1,rF(n.depth,i).outer)<e.minArcLength||s.set(l.id,{...n,hue:c.get(l.id)??e.displayed.get(l.id)?.hue??0,shade:pF(l.index,l.setSize),opacity:1})}return s}function hF(e,n,r){if(e.length===0)return;let i=n===void 0?void 0:e.find(e=>e.id===n);if(r===`Home`)return e[0].id;if(r===`End`)return e.at(-1).id;if([`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`].includes(r)){if(!i)return e[0].id;switch(r){case`ArrowLeft`:case`ArrowRight`:{let n=e.filter(e=>e.parentId===i.parentId);return n[(n.findIndex(e=>e.id===i.id)+(r===`ArrowRight`?1:-1)+n.length)%n.length].id}case`ArrowUp`:return e.find(e=>e.id===i.parentId)?.id;default:return e.find(e=>e.parentId===i.id)?.id}}}function gF(e){let n=[],r=[];for(let[i,a]of e.displayed){let o=e.layout.get(i);if(!o||a.opacity<.05)continue;let c=dF(a,o.node.item.label,e.rings,e.fontSize,{curved:e.curved});if(!c)continue;let l=`--arc-hue:${a.hue.toFixed(2)};opacity:${a.opacity.toFixed(3)}`;if(c.kind===`curved`){let i=`${e.idPrefix}${r.length}`;r.push(s`<path id=${i} d=${c.path}></path>`),n.push(s`<text class="sunburst-label curved" part="label" style=${l}
|
|
13239
13240
|
><textPath href="#${i}" startOffset="50%">${c.text}</textPath></text>`)}else n.push(s`<text
|
|
13240
13241
|
class="sunburst-label"
|
|
13241
13242
|
part="label"
|
|
13242
13243
|
transform="translate(${c.x.toFixed(2)} ${c.y.toFixed(2)}) rotate(${c.rotate.toFixed(2)})"
|
|
13243
13244
|
style=${l}
|
|
13244
|
-
>${c.text}</text>`)}return s`<defs>${r}</defs>${n}`}function
|
|
13245
|
+
>${c.text}</text>`)}return s`<defs>${r}</defs>${n}`}function _F(e,n,r,i,o){if(!e)return a;let c=n??e,l=Math.max(4,Math.floor(r.center*1.7/(i*.6))),u=c.node.item.label,d=u.length<=l?u:`${u.slice(0,l-1)}…`,f=n&&e.value>0?` · ${(n.value/e.value*100).toFixed(+(n.value/e.value<.1))}%`:``,p=i*1.3;return s`<g class="center-readout" part="center-readout" aria-hidden="true">
|
|
13245
13246
|
<text class="center-label" y=${(-p/2).toFixed(2)}>${d}</text>
|
|
13246
13247
|
<text class="center-meta" y=${(p/2).toFixed(2)}>${o(c.value,c.node)}${f}</text>
|
|
13247
|
-
</g>`}const
|
|
13248
|
+
</g>`}const vF=r`
|
|
13248
13249
|
:host {
|
|
13249
13250
|
--sunbursttree-hue-start: 250;
|
|
13250
13251
|
--sunbursttree-chroma: 0.14;
|
|
@@ -13357,7 +13358,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
13357
13358
|
color: var(--surface-muted-text);
|
|
13358
13359
|
font-size: var(--text-s);
|
|
13359
13360
|
}
|
|
13360
|
-
`;function EF(e){let n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map,a=(e,o)=>{n.set(o,e),r.set(e,o),i.has(e.item.key)||i.set(e.item.key,e);for(let n of e.children??[])a(n,qP(o,n.item.key))};return e&&a(e,e.item.key),{byId:n,idOf:r,byKey:i}}function DF(e){let{selected:n,pending:r,primary:i}=e,a={selected:n,pending:r,primary:i,restored:!1,changed:!1};if(n.size===0&&r.size===0)return a;let o=/* @__PURE__ */ new Map;for(let n of e.previousLayout.values())o.set(n.node,n.id);if(r.size===0&&[...n].every(n=>{let r=o.get(n);return r!==void 0&&QP(e.root,r)===n}))return a;let{byId:s,idOf:c,byKey:l}=EF(e.root),u=e=>{if(c.has(e))return e;let n=o.get(e);return n===void 0?void 0:s.get(n)},d=/* @__PURE__ */ new Set,f=/* @__PURE__ */ new Set,p=!1;for(let e of n){let n=u(e);n?(d.add(n),p||=n!==e):(f.add(e.item.key),p=!0)}let m;for(let n of r){let r=l.get(n);r&&e.canSelect(r)?(d.add(r),m=r,p=!0):f.add(n)}if(!p)return a;if(e.single&&d.size>0){let e=m??[...d].at(-1);return{selected:/* @__PURE__ */ new Set([e]),pending:O,primary:e,restored:m!==void 0,changed:!0}}let h=i&&u(i);return{selected:d,pending:cr(f),primary:h&&d.has(h)?h:[...d].at(-1),restored:m!==void 0,changed:!0}}function OF(e){return e<.5?4*e*e*e:1-(-2*e+2)**3/2}function kF(e){return 1-(1-e)**3}function AF(){return typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches}const jF=(e,n,r)=>e+(n-e)*r;function MF(e,n,r){return e+(((n-e)%360+540)%360-180)*r}function NF(e,n,r){return{a0:jF(e.a0,n.a0,r),a1:jF(e.a1,n.a1,r),depth:jF(e.depth,n.depth,r),hue:MF(e.hue,n.hue,r),shade:jF(e.shade,n.shade,r),opacity:jF(e.opacity,n.opacity,r)}}function PF(e){let{current:n,targets:r,enter:i,exit:a}=e,o=/* @__PURE__ */ new Map,s=/* @__PURE__ */ new Map,c=/* @__PURE__ */ new Set;for(let[e,a]of r)o.set(e,n.get(e)??i(e,a)),s.set(e,a);for(let[e,i]of n)r.has(e)||(o.set(e,i),s.set(e,a(e,i)),c.add(e));return{from:o,to:s,exiting:c}}function FF(e,n){let r=/* @__PURE__ */ new Map;for(let[i,a]of e.to){let o=e.from.get(i)??a;r.set(i,n>=1?a:NF(o,a,n))}return r}function IF(e){let n=/* @__PURE__ */ new Map;for(let[r,i]of e.to)e.exiting.has(r)||n.set(r,i);return n}const LF=1e-4;function RF(e,n){return Math.abs(e.a0-n.a0)<LF&&Math.abs(e.a1-n.a1)<LF&&Math.abs(e.depth-n.depth)<LF&&Math.abs(MF(e.hue,n.hue,1)-e.hue)<LF*360&&Math.abs(e.shade-n.shade)<LF&&Math.abs(e.opacity-n.opacity)<LF}function zF(e,n){if(e.size!==n.size)return!1;for(let[r,i]of e){let e=n.get(r);if(!e||!RF(i,e))return!1}return!0}const BF=e=>e.toLocaleString(void 0,{maximumFractionDigits:2});let VF=0,Z=class extends n{constructor(...e){super(...e),this.exclusivity=`none`,this.selectionFilter=`all`,this.interactionMode=`standard`,this.maxDepth=5,this.centerRatio=.22,this.minArcLength=1.5,this.disableLabels=!1,this.curvedLabels=!1,this.animationDuration=600,this.valueAccessor=KP,this.valueFormatter=BF,this._selectedNodes=/* @__PURE__ */ new Set,this.disableKeyboardNavigation=!1,this.registry=void 0,this._zoomId=void 0,this.restoreLoads=!0,this.#e=new cy(this,{kind:`sunbursttree-list`,capture:()=>this.getViewState()}),this.#t=O,this._size={width:0,height:0},this.search=new Ht(this,{adapter:Gt(this,{labelSelector:`.sunburst-label`,highlightKey:`incr-search-highlight`})}),this.tickled=new oe(this,{getItems:()=>this.#T().map(e=>({id:e.id,enabled:!0})),onStateChange:()=>{this.setAttribute(`data-input-mode`,this.tickled.inputMode)},onTickle:e=>{let n=e===void 0?void 0:this.#i.get(e);n&&this.dispatchEvent(new CustomEvent(`tickle`,{detail:{node:n.node,depth:n.depth-1},bubbles:!0,composed:!0}))}}),this._layoutDirty=!0,this._ticking=!1,this.#i=/* @__PURE__ */ new Map,this.#a={x0:0,x1:1,depth:0},this.#o={center:0,ring:0},this.#s=/* @__PURE__ */ new Map,this.#c=/* @__PURE__ */ new Map,this.#u=0,this.#d=OF,this.#p=11,this.#m=`sunburst-${++VF}-label-`,this.#_=/* @__PURE__ */ new Set,this.#v=/* @__PURE__ */ new Map,this.#j=e=>{this.#f=void 0;let n=this.#l;if(!n)return;let r=(e-this.#u)/Math.max(1,this.animationDuration);r>=1?(this.#c=IF(n),this.#l=void 0):(this.#c=FF(n,this.#d(Math.max(0,r))),this.#f=requestAnimationFrame(this.#j)),this._ticking=!0;try{this.requestUpdate()}finally{this._ticking=!1}}}static{this.shadowRootOptions={...n.shadowRootOptions,delegatesFocus:!0}}get selectedNodes(){return this._selectedNodes}get focusedNode(){if(this._zoomId!==void 0)return QP(this.#C,this._zoomId)}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;get#C(){return this.model?.root??this.root}get#w(){return this._zoomId??this.#C?.item.key}#T(){let e=[];for(let[n,r]of this.#s){let i=this.#i.get(n);i&&r.depth>=0&&e.push(i)}return e}requestUpdate(...e){this._ticking||(this._layoutDirty=!0),super.requestUpdate(...e)}connectedCallback(){super.connectedCallback(),this.setAttribute(`data-input-mode`,`mouse`);let e=this.#b=Xt();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()}),e.register({id:`zoom-up`,label:`Zoom Out One Level`,description:`Zoom to the parent of the centre`,execute:()=>this.zoomUp()}),this.registry=e,this.#D(),typeof ResizeObserver<`u`&&(this.#S=new ResizeObserver(([e])=>{let{width:n,height:r}=e.contentRect;this.#p=Number.parseFloat(getComputedStyle(this).getPropertyValue(`--sunbursttree-font-size`))||11,(n!==this._size.width||r!==this._size.height)&&(this._size={width:n,height:r})}),this.#S.observe(this))}disconnectedCallback(){super.disconnectedCallback(),this.#g?.(),this.#g=void 0;for(let e of this.#v.values())e.abort();if(this.#v.clear(),this.#_.clear(),this.#S?.disconnect(),this.#S=void 0,this.#f!==void 0&&cancelAnimationFrame(this.#f),this.#f=void 0,this.#l&&(this.#c=IF(this.#l)),this.#l=void 0,this.#b){for(let e of[`select-all`,`deselect-all`,`zoom-up`])this.#b.unregister(e);this.#b=void 0,this.registry=void 0}}#E(){let e=this.searchModes?.trim();if(e===void 0)return[...Bt];let n=new Set(e.split(/\s+/));return Bt.filter(e=>n.has(e))}#D(){this.#b&&(this.search.setModes(this.#E()),this.#x?.(),this.#x=zt(this.#b,this.search))}willUpdate(e){e.has(`root`)&&e.get(`root`)!==void 0&&(this.#y=void 0),e.has(`interactionMode`)&&e.get(`interactionMode`)!==void 0&&(this.#y=void 0,this.#B()),this._layoutDirty&&(this._layoutDirty=!1,this.#N(),this.#k(),this.#e.restoring(()=>this.#F()))}updated(e){e.has(`model`)&&(this.#g?.(),this.#g=this.model?._subscribe(()=>this.requestUpdate())),e.has(`searchModes`)&&this.#D(),this.#L(),this.#I()}#O(){let e=this._size.width||320,n=this._size.height||320;return Math.max(0,Math.min(e,n)/2-2)}#k(){let e=this.#C,n=this.#i,r=this.#a,i=Math.max(1,Math.floor(this.maxDepth)),a=this._zoomId===void 0?0:XP(this._zoomId).length-1,o=rF(e,{valueAccessor:this.valueAccessor,maxDepth:Math.max(a,r.depth)+i});this._zoomId!==void 0&&!o.has(this._zoomId)&&(this._zoomId=void 0);let s=this.#w,c=sF(s===void 0?void 0:o.get(s)),l=dF(this.#O(),i,this.centerRatio),u=xF({layout:o,view:c,rings:l,zoomId:s,maxDepth:i,minArcLength:this.minArcLength,displayed:this.#c});if(this.#i=o,this.#a=c,this.#o=l,zF(u,this.#s))return;this.#s=u;let d=PF({current:this.#c,targets:u,enter:(e,i)=>{let a=n.get(e);if(a){let e=cF(a,r);return{...i,...e,opacity:0}}return{...i,a1:i.a0}},exit:(e,n)=>{let r=o.get(e);if(r)return{...n,...cF(r,c),opacity:0};let i=(n.a0+n.a1)/2;return{...n,a0:i,a1:i,opacity:0}}});this.#A(d)}#A(e){(AF()?0:this.animationDuration)<=0||!this.isConnected?(this.#l=void 0,this.#c=IF(e)):(this.#d=this.#l?kF:OF,this.#l=e,this.#c=FF(e,0),this.#u=performance.now(),this.#f??=requestAnimationFrame(this.#j))}#j;getViewState(e){let n=e?.includePending??!0,r=this.tickled.inputMode===`keyboard`?this.tickled.tickledId:void 0,i=r===void 0?void 0:XP(r).at(-1);return this.#e.shape({selected:pr([...this._selectedNodes].map(e=>e.item.key),n?this.#t:[]),zoom:(n?this.#n:void 0)??this.#M(),focus:i??(n?this.#r:void 0)},e)}setViewState(e){this.#e.accepts(e)&&(this.#e.restoring(()=>{e.selected&&(this.#t=cr(new Set(e.selected)),this._selectedNodes.size>0&&this.#V(/* @__PURE__ */ new Set)),e.zoom&&(this.#n=[...e.zoom]),e.focus!==void 0&&(this.#r=e.focus),this.#N(),this.#n!==void 0&&this.#U(void 0)}),this.requestUpdate())}clearPendingViewState(){this.#t=O,this.#n=void 0,this.#r=void 0}#M(){return this._zoomId===void 0?[]:XP(this._zoomId).slice(1)}#N(){let e=this.#C;this.#e.restoring(()=>{this._zoomId!==void 0&&!QP(e,this._zoomId)&&(this.#n??=this.#M(),this._zoomId=void 0,this.#e.notify(`data`));let n=this.#n;e&&n!==void 0&&rT(e,n,()=>!1).status===`found`&&(this.#n=void 0,this.#U(JP([e.item.key,...n]))),(this._selectedNodes.size>0||this.#t.size>0)&&this.#P(e)})}#P(e){let n=DF({root:e,previousLayout:this.#i,selected:this._selectedNodes,primary:this.selectedNode,pending:this.#t,canSelect:e=>this.#z(e),single:this.interactionMode===`implicit`});n.changed&&(this.#t=n.pending,n.restored?this.#V(new Set(n.selected),n.primary):(this._selectedNodes=new Set(n.selected),this.selectedNode=n.primary,this.#e.notify(`data`)))}#F(){let e=this.tickled.tickledId;e!==void 0&&!this.#i.has(e)&&(this.tickled.inputMode===`keyboard`&&(this.#r??=XP(e).at(-1)),this.tickled.clearTickled());let n=this.#r,r=n===void 0?void 0:this.#T().find(e=>e.node.item.key===n);r&&(this.#r=void 0,this.tickled.setInputMode(`keyboard`),this.tickled.setTickled(r.id))}#I(){let e=this.#C,n=this.#n;if(!this.restoreLoads||!e||n===void 0||!this.model&&!this.loadChildren)return;let r=rT(e,n,e=>e.item.isLeaf!==!0);if(r.status!==`load`)return;let i=JP([e.item.key,...n.slice(0,r.depth+1)]);this.#_.has(i)||this.#R(i,r.node,r.depth)}#L(){if(this.model||this.loadChildren)for(let e of this.#s.keys()){let n=this.#i.get(e);n&&n.node.children===void 0&&n.node.item.isLeaf!==!0&&!this.#_.has(e)&&this.#R(e,n.node,n.depth-1)}}async#R(e,n,r){this.#_.add(e);let i=new AbortController;this.#v.set(e,i);try{let e=this.model?await this.model.getChildren(n,r,i.signal):[...await Pv(this.loadChildren({node:n,depth:r},i.signal),i.signal)];if(i.signal.aborted)return;n.children=e}catch{if(i.signal.aborted)return;n.children=[]}finally{this.#_.delete(e),this.#v.delete(e),i.signal.aborted||this.requestUpdate()}}#z(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}#B(){this._selectedNodes=/* @__PURE__ */ new Set,this.selectedNode=void 0}#V(e,n=[...e].at(-1)){let r=this._selectedNodes;this._selectedNodes=e,this.selectedNode=n,this.#e.isRestoring||(this.#t=O),this.#e.notify(),this.dispatchEvent(new CustomEvent(`select`,{detail:{selected:new Set(e),previous:r},bubbles:!0,composed:!0}))}select(e){this.#z(e)&&this.#V(/* @__PURE__ */ new Set([e]),e)}deselect(e){if(!this._selectedNodes.has(e))return;let n=new Set(this._selectedNodes);n.delete(e),this.#V(n,this.selectedNode===e?[...n].at(-1):this.selectedNode)}clearSelection(){this.#t=O,this._selectedNodes.size>0&&this.#V(/* @__PURE__ */ new Set)}selectAll(){this.#V(/* @__PURE__ */ new Set([...this._selectedNodes,...this.#T().map(e=>e.node).filter(e=>this.#z(e))]))}deselectAll(){this.#V(/* @__PURE__ */ new Set)}selectMany(e){this.#V(new Set([...e].filter(e=>this.#z(e))))}#H(e){for(let n of this.#i.values())if(n.node===e)return n.id;return $P(this.#C,n=>n===e)}#U(e){this.#e.isRestoring||(this.#n=void 0);let n=e===this.#C?.item.key?void 0:e;if(n===this._zoomId)return;let r=this._zoomId,i=this.focusedNode;this._zoomId=n,this.tickled.clearTickled(),this.#e.notify();let a=this.focusedNode,o=e=>e===void 0?-1:XP(e).length-2;this.dispatchEvent(new CustomEvent(`zoom`,{detail:{node:a,depth:o(n)},bubbles:!0,composed:!0})),n!==void 0&&(r===void 0||YP(r,n))&&a?this.dispatchEvent(new CustomEvent(`expand`,{detail:{node:a,depth:o(n)},bubbles:!0,composed:!0})):i&&this.dispatchEvent(new CustomEvent(`collapse`,{detail:{node:i,depth:o(r)},bubbles:!0,composed:!0}))}zoomTo(e){let n=this.#H(e);n!==void 0&&this.#U(n)}zoomUp(){this._zoomId!==void 0&&this.#U(ZP(this._zoomId))}zoomOut(){this.#U(void 0)}#W(e){return e.x1-e.x0<=0||e.node.item.isLeaf===!0?!1:e.node.children===void 0?this.model!==void 0||this.loadChildren!==void 0:e.node.children.length>0}#G(e){let n=this.#C,r=QP(n,e);if(!r)return;let i=ZP(e);return i!==void 0&&this.#U(i),this.tickled.setTickled(e),r}navigateTo(e){let n=this.#C;if(!n||e.length===0)return!1;let r=this.#G(JP([n.item.key,...e]));return r?(this.select(r),!0):!1}navigateToNode(e){let n=this.#C,r=$P(n,r=>r!==n&&e(r));return r!==void 0&&this.navigateTo(XP(r).slice(1))}revealKey(e){let n=this.#C,r=$P(n,r=>r!==n&&r.item.key===e);return r!==void 0&&this.#G(r)!==void 0}getNodes(){return this.#T().map(e=>({node:e.node,depth:e.depth-1}))}#K(e){let n=this.filterPredicate;if(!n)return!1;if(this.#h?.predicate!==n||this.#h.layout!==this.#i){let e=(r,i)=>n(r,i)||(r.children?.some(n=>e(n,i+1))??!1),r=/* @__PURE__ */ new Set;for(let n of this.#i.values())n.depth>0&&!e(n.node,n.depth-1)&&r.add(n.id);this.#h={predicate:n,layout:this.#i,ids:r}}return this.#h.ids.has(e)}#q(e,n){this.dispatchEvent(new CustomEvent(`item-click`,{detail:{node:e.node,depth:e.depth-1},bubbles:!0,composed:!0}));let{node:r}=e,i=this.#T(),a=i.findIndex(n=>n.id===e.id);if(this.interactionMode===`standard`&&(n.ctrlKey||n.metaKey))this._selectedNodes.has(r)?this.deselect(r):this.#z(r)&&this.#V(/* @__PURE__ */ new Set([...this._selectedNodes,r]),r),this.#y=a;else if(this.interactionMode===`standard`&&n.shiftKey&&this.#y!==void 0){let e=Math.min(this.#y,a),n=Math.max(this.#y,a);this.#V(new Set(i.slice(e,n+1).map(e=>e.node).filter(e=>this.#z(e))))}else this.interactionMode!==`manual`&&(this.select(r),this.#y=a),this.#W(e)?this.#U(e.id):this.tickled.setTickled(e.id)}#J(e){let n={node:e.node,depth:e.depth-1};this.dispatchEvent(new CustomEvent(`item-dblclick`,{detail:n,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`activate`,{detail:n,bubbles:!0,composed:!0}))}#Y(e){if(this.disableKeyboardNavigation)return;if(e.key===`Escape`||e.key===`Backspace`){this._zoomId!==void 0&&(e.preventDefault(),this.zoomUp());return}let n=this.#T(),r=this.tickled.tickledId;if(e.key===`Enter`){let n=r===void 0?void 0:this.#i.get(r);if(!n)return;e.preventDefault(),this.interactionMode!==`manual`&&this.select(n.node),this.dispatchEvent(new CustomEvent(`activate`,{detail:{node:n.node,depth:n.depth-1},bubbles:!0,composed:!0})),this.#W(n)&&this.#U(n.id);return}let i=SF(n,r,e.key);if(i===void 0)return;e.preventDefault(),this.tickled.setInputMode(`keyboard`),this.tickled.setTickled(i),this.#r=void 0,this.#e.notify();let a=this.#i.get(i);a&&this.interactionMode===`implicit`&&this.select(a.node)}#X(e,n,r){let i=this.#i.get(e),{inner:o,outer:c}=uF(n.depth,this.#o),l=mF(n.a0,n.a1,o,c),u=!this.#s.has(e),d=e===r,f=`--arc-hue:${n.hue.toFixed(2)};--arc-depth:${Math.max(0,n.depth).toFixed(3)};--arc-shade:${n.shade.toFixed(3)};--arc-centre:${Math.min(1,Math.max(0,-n.depth)).toFixed(3)};opacity:${n.opacity.toFixed(3)}`;if(!i||u)return s`<path class="arc exiting" d=${l} style=${f} aria-hidden="true"></path>`;if(d){let e=this._zoomId!==void 0;return s`<path
|
|
13361
|
+
`;function yF(e){let n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map,a=(e,o)=>{n.set(o,e),r.set(e,o),i.has(e.item.key)||i.set(e.item.key,e);for(let n of e.children??[])a(n,BP(o,n.item.key))};return e&&a(e,e.item.key),{byId:n,idOf:r,byKey:i}}function bF(e){let{selected:n,pending:r,primary:i}=e,a={selected:n,pending:r,primary:i,restored:!1,changed:!1};if(n.size===0&&r.size===0)return a;let o=/* @__PURE__ */ new Map;for(let n of e.previousLayout.values())o.set(n.node,n.id);if(r.size===0&&[...n].every(n=>{let r=o.get(n);return r!==void 0&&GP(e.root,r)===n}))return a;let{byId:s,idOf:c,byKey:l}=yF(e.root),u=e=>{if(c.has(e))return e;let n=o.get(e);return n===void 0?void 0:s.get(n)},d=/* @__PURE__ */ new Set,f=/* @__PURE__ */ new Set,p=!1;for(let e of n){let n=u(e);n?(d.add(n),p||=n!==e):(f.add(e.item.key),p=!0)}let m;for(let n of r){let r=l.get(n);r&&e.canSelect(r)?(d.add(r),m=r,p=!0):f.add(n)}if(!p)return a;if(e.single&&d.size>0){let e=m??[...d].at(-1);return{selected:/* @__PURE__ */ new Set([e]),pending:O,primary:e,restored:m!==void 0,changed:!0}}let h=i&&u(i);return{selected:d,pending:cr(f),primary:h&&d.has(h)?h:[...d].at(-1),restored:m!==void 0,changed:!0}}function xF(e){return e<.5?4*e*e*e:1-(-2*e+2)**3/2}function SF(e){return 1-(1-e)**3}function CF(){return typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches}const wF=(e,n,r)=>e+(n-e)*r;function TF(e,n,r){return e+(((n-e)%360+540)%360-180)*r}function EF(e,n,r){return{a0:wF(e.a0,n.a0,r),a1:wF(e.a1,n.a1,r),depth:wF(e.depth,n.depth,r),hue:TF(e.hue,n.hue,r),shade:wF(e.shade,n.shade,r),opacity:wF(e.opacity,n.opacity,r)}}function DF(e){let{current:n,targets:r,enter:i,exit:a}=e,o=/* @__PURE__ */ new Map,s=/* @__PURE__ */ new Map,c=/* @__PURE__ */ new Set;for(let[e,a]of r)o.set(e,n.get(e)??i(e,a)),s.set(e,a);for(let[e,i]of n)r.has(e)||(o.set(e,i),s.set(e,a(e,i)),c.add(e));return{from:o,to:s,exiting:c}}function OF(e,n){let r=/* @__PURE__ */ new Map;for(let[i,a]of e.to){let o=e.from.get(i)??a;r.set(i,n>=1?a:EF(o,a,n))}return r}function kF(e){let n=/* @__PURE__ */ new Map;for(let[r,i]of e.to)e.exiting.has(r)||n.set(r,i);return n}const AF=1e-4;function jF(e,n){return Math.abs(e.a0-n.a0)<AF&&Math.abs(e.a1-n.a1)<AF&&Math.abs(e.depth-n.depth)<AF&&Math.abs(TF(e.hue,n.hue,1)-e.hue)<AF*360&&Math.abs(e.shade-n.shade)<AF&&Math.abs(e.opacity-n.opacity)<AF}function MF(e,n){if(e.size!==n.size)return!1;for(let[r,i]of e){let e=n.get(r);if(!e||!jF(i,e))return!1}return!0}const NF=e=>e.toLocaleString(void 0,{maximumFractionDigits:2});let PF=0,Z=class extends n{constructor(...e){super(...e),this.exclusivity=`none`,this.selectionFilter=`all`,this.interactionMode=`standard`,this.maxDepth=5,this.centerRatio=.22,this.minArcLength=1.5,this.disableLabels=!1,this.curvedLabels=!1,this.animationDuration=600,this.valueAccessor=zP,this.valueFormatter=NF,this._selectedNodes=/* @__PURE__ */ new Set,this.disableKeyboardNavigation=!1,this.registry=void 0,this._zoomId=void 0,this.restoreLoads=!0,this.#e=new cy(this,{kind:`sunbursttree-list`,capture:()=>this.getViewState()}),this.#t=O,this._size={width:0,height:0},this.search=new Ht(this,{adapter:Gt(this,{labelSelector:`.sunburst-label`,highlightKey:`incr-search-highlight`})}),this.tickled=new oe(this,{getItems:()=>this.#T().map(e=>({id:e.id,enabled:!0})),onStateChange:()=>{this.setAttribute(`data-input-mode`,this.tickled.inputMode)},onTickle:e=>{let n=e===void 0?void 0:this.#i.get(e);n&&this.dispatchEvent(new CustomEvent(`tickle`,{detail:{node:n.node,depth:n.depth-1},bubbles:!0,composed:!0}))}}),this._layoutDirty=!0,this._ticking=!1,this.#i=/* @__PURE__ */ new Map,this.#a={x0:0,x1:1,depth:0},this.#o={center:0,ring:0},this.#s=/* @__PURE__ */ new Map,this.#c=/* @__PURE__ */ new Map,this.#u=0,this.#d=xF,this.#p=11,this.#m=`sunburst-${++PF}-label-`,this.#_=/* @__PURE__ */ new Set,this.#v=/* @__PURE__ */ new Map,this.#j=e=>{this.#f=void 0;let n=this.#l;if(!n)return;let r=(e-this.#u)/Math.max(1,this.animationDuration);r>=1?(this.#c=kF(n),this.#l=void 0):(this.#c=OF(n,this.#d(Math.max(0,r))),this.#f=requestAnimationFrame(this.#j)),this._ticking=!0;try{this.requestUpdate()}finally{this._ticking=!1}}}static{this.shadowRootOptions={...n.shadowRootOptions,delegatesFocus:!0}}get selectedNodes(){return this._selectedNodes}get focusedNode(){if(this._zoomId!==void 0)return GP(this.#C,this._zoomId)}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;get#C(){return this.model?.root??this.root}get#w(){return this._zoomId??this.#C?.item.key}#T(){let e=[];for(let[n,r]of this.#s){let i=this.#i.get(n);i&&r.depth>=0&&e.push(i)}return e}requestUpdate(...e){this._ticking||(this._layoutDirty=!0),super.requestUpdate(...e)}connectedCallback(){super.connectedCallback(),this.setAttribute(`data-input-mode`,`mouse`);let e=this.#b=Xt();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()}),e.register({id:`zoom-up`,label:`Zoom Out One Level`,description:`Zoom to the parent of the centre`,execute:()=>this.zoomUp()}),this.registry=e,this.#D(),typeof ResizeObserver<`u`&&(this.#S=new ResizeObserver(([e])=>{let{width:n,height:r}=e.contentRect;this.#p=Number.parseFloat(getComputedStyle(this).getPropertyValue(`--sunbursttree-font-size`))||11,(n!==this._size.width||r!==this._size.height)&&(this._size={width:n,height:r})}),this.#S.observe(this))}disconnectedCallback(){super.disconnectedCallback(),this.#g?.(),this.#g=void 0;for(let e of this.#v.values())e.abort();if(this.#v.clear(),this.#_.clear(),this.#S?.disconnect(),this.#S=void 0,this.#f!==void 0&&cancelAnimationFrame(this.#f),this.#f=void 0,this.#l&&(this.#c=kF(this.#l)),this.#l=void 0,this.#b){for(let e of[`select-all`,`deselect-all`,`zoom-up`])this.#b.unregister(e);this.#b=void 0,this.registry=void 0}}#E(){let e=this.searchModes?.trim();if(e===void 0)return[...Bt];let n=new Set(e.split(/\s+/));return Bt.filter(e=>n.has(e))}#D(){this.#b&&(this.search.setModes(this.#E()),this.#x?.(),this.#x=zt(this.#b,this.search))}willUpdate(e){e.has(`root`)&&e.get(`root`)!==void 0&&(this.#y=void 0),e.has(`interactionMode`)&&e.get(`interactionMode`)!==void 0&&(this.#y=void 0,this.#B()),this._layoutDirty&&(this._layoutDirty=!1,this.#N(),this.#k(),this.#e.restoring(()=>this.#F()))}updated(e){e.has(`model`)&&(this.#g?.(),this.#g=this.model?._subscribe(()=>this.requestUpdate())),e.has(`searchModes`)&&this.#D(),this.#L(),this.#I()}#O(){let e=this._size.width||320,n=this._size.height||320;return Math.max(0,Math.min(e,n)/2-2)}#k(){let e=this.#C,n=this.#i,r=this.#a,i=Math.max(1,Math.floor(this.maxDepth)),a=this._zoomId===void 0?0:UP(this._zoomId).length-1,o=XP(e,{valueAccessor:this.valueAccessor,maxDepth:Math.max(a,r.depth)+i});this._zoomId!==void 0&&!o.has(this._zoomId)&&(this._zoomId=void 0);let s=this.#w,c=eF(s===void 0?void 0:o.get(s)),l=iF(this.#O(),i,this.centerRatio),u=mF({layout:o,view:c,rings:l,zoomId:s,maxDepth:i,minArcLength:this.minArcLength,displayed:this.#c});if(this.#i=o,this.#a=c,this.#o=l,MF(u,this.#s))return;this.#s=u;let d=DF({current:this.#c,targets:u,enter:(e,i)=>{let a=n.get(e);if(a){let e=tF(a,r);return{...i,...e,opacity:0}}return{...i,a1:i.a0}},exit:(e,n)=>{let r=o.get(e);if(r)return{...n,...tF(r,c),opacity:0};let i=(n.a0+n.a1)/2;return{...n,a0:i,a1:i,opacity:0}}});this.#A(d)}#A(e){(CF()?0:this.animationDuration)<=0||!this.isConnected?(this.#l=void 0,this.#c=kF(e)):(this.#d=this.#l?SF:xF,this.#l=e,this.#c=OF(e,0),this.#u=performance.now(),this.#f??=requestAnimationFrame(this.#j))}#j;getViewState(e){let n=e?.includePending??!0,r=this.tickled.inputMode===`keyboard`?this.tickled.tickledId:void 0,i=r===void 0?void 0:UP(r).at(-1);return this.#e.shape({selected:pr([...this._selectedNodes].map(e=>e.item.key),n?this.#t:[]),zoom:(n?this.#n:void 0)??this.#M(),focus:i??(n?this.#r:void 0)},e)}setViewState(e){this.#e.accepts(e)&&(this.#e.restoring(()=>{e.selected&&(this.#t=cr(new Set(e.selected)),this._selectedNodes.size>0&&this.#V(/* @__PURE__ */ new Set)),e.zoom&&(this.#n=[...e.zoom]),e.focus!==void 0&&(this.#r=e.focus),this.#N(),this.#n!==void 0&&this.#U(void 0)}),this.requestUpdate())}clearPendingViewState(){this.#t=O,this.#n=void 0,this.#r=void 0}#M(){return this._zoomId===void 0?[]:UP(this._zoomId).slice(1)}#N(){let e=this.#C;this.#e.restoring(()=>{this._zoomId!==void 0&&!GP(e,this._zoomId)&&(this.#n??=this.#M(),this._zoomId=void 0,this.#e.notify(`data`));let n=this.#n;e&&n!==void 0&&rT(e,n,()=>!1).status===`found`&&(this.#n=void 0,this.#U(VP([e.item.key,...n]))),(this._selectedNodes.size>0||this.#t.size>0)&&this.#P(e)})}#P(e){let n=bF({root:e,previousLayout:this.#i,selected:this._selectedNodes,primary:this.selectedNode,pending:this.#t,canSelect:e=>this.#z(e),single:this.interactionMode===`implicit`});n.changed&&(this.#t=n.pending,n.restored?this.#V(new Set(n.selected),n.primary):(this._selectedNodes=new Set(n.selected),this.selectedNode=n.primary,this.#e.notify(`data`)))}#F(){let e=this.tickled.tickledId;e!==void 0&&!this.#i.has(e)&&(this.tickled.inputMode===`keyboard`&&(this.#r??=UP(e).at(-1)),this.tickled.clearTickled());let n=this.#r,r=n===void 0?void 0:this.#T().find(e=>e.node.item.key===n);r&&(this.#r=void 0,this.tickled.setInputMode(`keyboard`),this.tickled.setTickled(r.id))}#I(){let e=this.#C,n=this.#n;if(!this.restoreLoads||!e||n===void 0||!this.model&&!this.loadChildren)return;let r=rT(e,n,e=>e.item.isLeaf!==!0);if(r.status!==`load`)return;let i=VP([e.item.key,...n.slice(0,r.depth+1)]);this.#_.has(i)||this.#R(i,r.node,r.depth)}#L(){if(this.model||this.loadChildren)for(let e of this.#s.keys()){let n=this.#i.get(e);n&&n.node.children===void 0&&n.node.item.isLeaf!==!0&&!this.#_.has(e)&&this.#R(e,n.node,n.depth-1)}}async#R(e,n,r){this.#_.add(e);let i=new AbortController;this.#v.set(e,i);try{let e=this.model?await this.model.getChildren(n,r,i.signal):[...await Pv(this.loadChildren({node:n,depth:r},i.signal),i.signal)];if(i.signal.aborted)return;n.children=e}catch{if(i.signal.aborted)return;n.children=[]}finally{this.#_.delete(e),this.#v.delete(e),i.signal.aborted||this.requestUpdate()}}#z(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}#B(){this._selectedNodes=/* @__PURE__ */ new Set,this.selectedNode=void 0}#V(e,n=[...e].at(-1)){let r=this._selectedNodes;this._selectedNodes=e,this.selectedNode=n,this.#e.isRestoring||(this.#t=O),this.#e.notify(),this.dispatchEvent(new CustomEvent(`select`,{detail:{selected:new Set(e),previous:r},bubbles:!0,composed:!0}))}select(e){this.#z(e)&&this.#V(/* @__PURE__ */ new Set([e]),e)}deselect(e){if(!this._selectedNodes.has(e))return;let n=new Set(this._selectedNodes);n.delete(e),this.#V(n,this.selectedNode===e?[...n].at(-1):this.selectedNode)}clearSelection(){this.#t=O,this._selectedNodes.size>0&&this.#V(/* @__PURE__ */ new Set)}selectAll(){this.#V(/* @__PURE__ */ new Set([...this._selectedNodes,...this.#T().map(e=>e.node).filter(e=>this.#z(e))]))}deselectAll(){this.#V(/* @__PURE__ */ new Set)}selectMany(e){this.#V(new Set([...e].filter(e=>this.#z(e))))}#H(e){for(let n of this.#i.values())if(n.node===e)return n.id;return KP(this.#C,n=>n===e)}#U(e){this.#e.isRestoring||(this.#n=void 0);let n=e===this.#C?.item.key?void 0:e;if(n===this._zoomId)return;let r=this._zoomId,i=this.focusedNode;this._zoomId=n,this.tickled.clearTickled(),this.#e.notify();let a=this.focusedNode,o=e=>e===void 0?-1:UP(e).length-2;this.dispatchEvent(new CustomEvent(`zoom`,{detail:{node:a,depth:o(n)},bubbles:!0,composed:!0})),n!==void 0&&(r===void 0||HP(r,n))&&a?this.dispatchEvent(new CustomEvent(`expand`,{detail:{node:a,depth:o(n)},bubbles:!0,composed:!0})):i&&this.dispatchEvent(new CustomEvent(`collapse`,{detail:{node:i,depth:o(r)},bubbles:!0,composed:!0}))}zoomTo(e){let n=this.#H(e);n!==void 0&&this.#U(n)}zoomUp(){this._zoomId!==void 0&&this.#U(WP(this._zoomId))}zoomOut(){this.#U(void 0)}#W(e){return e.x1-e.x0<=0||e.node.item.isLeaf===!0?!1:e.node.children===void 0?this.model!==void 0||this.loadChildren!==void 0:e.node.children.length>0}#G(e){let n=this.#C,r=GP(n,e);if(!r)return;let i=WP(e);return i!==void 0&&this.#U(i),this.tickled.setTickled(e),r}navigateTo(e){let n=this.#C;if(!n||e.length===0)return!1;let r=this.#G(VP([n.item.key,...e]));return r?(this.select(r),!0):!1}navigateToNode(e){let n=this.#C,r=KP(n,r=>r!==n&&e(r));return r!==void 0&&this.navigateTo(UP(r).slice(1))}revealKey(e){let n=this.#C,r=KP(n,r=>r!==n&&r.item.key===e);return r!==void 0&&this.#G(r)!==void 0}getNodes(){return this.#T().map(e=>({node:e.node,depth:e.depth-1}))}#K(e){let n=this.filterPredicate;if(!n)return!1;if(this.#h?.predicate!==n||this.#h.layout!==this.#i){let e=(r,i)=>n(r,i)||(r.children?.some(n=>e(n,i+1))??!1),r=/* @__PURE__ */ new Set;for(let n of this.#i.values())n.depth>0&&!e(n.node,n.depth-1)&&r.add(n.id);this.#h={predicate:n,layout:this.#i,ids:r}}return this.#h.ids.has(e)}#q(e,n){this.dispatchEvent(new CustomEvent(`item-click`,{detail:{node:e.node,depth:e.depth-1},bubbles:!0,composed:!0}));let{node:r}=e,i=this.#T(),a=i.findIndex(n=>n.id===e.id);if(this.interactionMode===`standard`&&(n.ctrlKey||n.metaKey))this._selectedNodes.has(r)?this.deselect(r):this.#z(r)&&this.#V(/* @__PURE__ */ new Set([...this._selectedNodes,r]),r),this.#y=a;else if(this.interactionMode===`standard`&&n.shiftKey&&this.#y!==void 0){let e=Math.min(this.#y,a),n=Math.max(this.#y,a);this.#V(new Set(i.slice(e,n+1).map(e=>e.node).filter(e=>this.#z(e))))}else this.interactionMode!==`manual`&&(this.select(r),this.#y=a),this.#W(e)?this.#U(e.id):this.tickled.setTickled(e.id)}#J(e){let n={node:e.node,depth:e.depth-1};this.dispatchEvent(new CustomEvent(`item-dblclick`,{detail:n,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`activate`,{detail:n,bubbles:!0,composed:!0}))}#Y(e){if(this.disableKeyboardNavigation)return;if(e.key===`Escape`||e.key===`Backspace`){this._zoomId!==void 0&&(e.preventDefault(),this.zoomUp());return}let n=this.#T(),r=this.tickled.tickledId;if(e.key===`Enter`){let n=r===void 0?void 0:this.#i.get(r);if(!n)return;e.preventDefault(),this.interactionMode!==`manual`&&this.select(n.node),this.dispatchEvent(new CustomEvent(`activate`,{detail:{node:n.node,depth:n.depth-1},bubbles:!0,composed:!0})),this.#W(n)&&this.#U(n.id);return}let i=hF(n,r,e.key);if(i===void 0)return;e.preventDefault(),this.tickled.setInputMode(`keyboard`),this.tickled.setTickled(i),this.#r=void 0,this.#e.notify();let a=this.#i.get(i);a&&this.interactionMode===`implicit`&&this.select(a.node)}#X(e,n,r){let i=this.#i.get(e),{inner:o,outer:c}=rF(n.depth,this.#o),l=sF(n.a0,n.a1,o,c),u=!this.#s.has(e),d=e===r,f=`--arc-hue:${n.hue.toFixed(2)};--arc-depth:${Math.max(0,n.depth).toFixed(3)};--arc-shade:${n.shade.toFixed(3)};--arc-centre:${Math.min(1,Math.max(0,-n.depth)).toFixed(3)};opacity:${n.opacity.toFixed(3)}`;if(!i||u)return s`<path class="arc exiting" d=${l} style=${f} aria-hidden="true"></path>`;if(d){let e=this._zoomId!==void 0;return s`<path
|
|
13361
13362
|
class="arc center ${e?``:`leaf`}"
|
|
13362
13363
|
part="center"
|
|
13363
13364
|
d=${l}
|
|
@@ -13394,11 +13395,11 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
13394
13395
|
@pointerleave=${()=>this.tickled.clearTickled()}
|
|
13395
13396
|
>
|
|
13396
13397
|
<g class="arcs">${_(this.#c,([e])=>e,([e,n])=>this.#X(e,n,r))}</g>
|
|
13397
|
-
<g class="labels">${this.disableLabels?a:
|
|
13398
|
-
${
|
|
13398
|
+
<g class="labels">${this.disableLabels?a:gF({displayed:this.#c,layout:this.#i,rings:this.#o,fontSize:this.#p,curved:this.curvedLabels,idPrefix:this.#m})}</g>
|
|
13399
|
+
${_F(r===void 0?void 0:this.#i.get(r),o===void 0?void 0:this.#i.get(o),this.#o,this.#p,this.valueFormatter)}
|
|
13399
13400
|
</svg>
|
|
13400
13401
|
${this.search.renderField()}
|
|
13401
|
-
`}static{this.styles=[w,Ut,
|
|
13402
|
+
`}static{this.styles=[w,Ut,vF]}};E([d({type:Object})],Z.prototype,`root`,void 0),E([d({attribute:!1})],Z.prototype,`model`,void 0),E([d({attribute:!1})],Z.prototype,`loadChildren`,void 0),E([d({reflect:!0,attribute:`exclusivity`})],Z.prototype,`exclusivity`,void 0),E([d({reflect:!0,attribute:`selection-filter`})],Z.prototype,`selectionFilter`,void 0),E([d({type:String,attribute:`interaction-mode`})],Z.prototype,`interactionMode`,void 0),E([d({type:Number,attribute:`max-depth`})],Z.prototype,`maxDepth`,void 0),E([d({type:Number,attribute:`center-ratio`})],Z.prototype,`centerRatio`,void 0),E([d({type:Number,attribute:`min-arc-length`})],Z.prototype,`minArcLength`,void 0),E([d({type:Boolean,attribute:`disable-labels`})],Z.prototype,`disableLabels`,void 0),E([d({type:Boolean,attribute:`curved-labels`,reflect:!0})],Z.prototype,`curvedLabels`,void 0),E([d({type:Number,attribute:`animation-duration`})],Z.prototype,`animationDuration`,void 0),E([d({attribute:!1})],Z.prototype,`valueAccessor`,void 0),E([d({attribute:!1})],Z.prototype,`valueFormatter`,void 0),E([d({attribute:!1})],Z.prototype,`selectedNode`,void 0),E([m()],Z.prototype,`_selectedNodes`,void 0),E([d({attribute:!1})],Z.prototype,`filterPredicate`,void 0),E([d({type:Boolean,attribute:`disable-keyboard-navigation`})],Z.prototype,`disableKeyboardNavigation`,void 0),E([d({attribute:!1})],Z.prototype,`registry`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],Z.prototype,`searchModes`,void 0),E([m()],Z.prototype,`_zoomId`,void 0),E([d({attribute:!1})],Z.prototype,`restoreLoads`,void 0),E([m()],Z.prototype,`_size`,void 0),Z=E([T(`ixfx-sunbursttree-list`)],Z);let FF=class extends yC(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,dn,r`
|
|
13402
13403
|
:host {
|
|
13403
13404
|
display: block;
|
|
13404
13405
|
user-select: none;
|
|
@@ -13434,7 +13435,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
13434
13435
|
>
|
|
13435
13436
|
<svg aria-hidden="true">${this.#s()}</svg>
|
|
13436
13437
|
</div>
|
|
13437
|
-
`}};E([d({type:Number})],
|
|
13438
|
+
`}};E([d({type:Number})],FF.prototype,`barSpacing`,void 0),E([d({type:Number})],FF.prototype,`barWidth`,void 0),E([d({type:Number})],FF.prototype,`debounceMs`,void 0),E([d({type:Number})],FF.prototype,`retractDurationMs`,void 0),FF=E([T(`ixfx-swipe`)],FF);let IF=class extends n{render(){return i`<slot></slot>`}static{this.styles=[w,r`
|
|
13438
13439
|
:host {
|
|
13439
13440
|
display:none;
|
|
13440
13441
|
height:100%;
|
|
@@ -13445,12 +13446,12 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
13445
13446
|
background: var(--surface-3);
|
|
13446
13447
|
display:block;
|
|
13447
13448
|
}
|
|
13448
|
-
`]}};
|
|
13449
|
+
`]}};IF=E([T(`ixfx-tab-panel`)],IF);var LF=class{#e;#t;#n;#r=[];#i;#a;#o;#s=/* @__PURE__ */ 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){typeof n==`function`?n(e):typeof n==`string`?e.append(document.createTextNode(n)):e.append(n)}#b(e,n,r){let i=Array.from(e.children);e.insertBefore(n,i[r]??null)}#x(){let e=/* @__PURE__ */ 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 RF=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`
|
|
13449
13450
|
:host {
|
|
13450
13451
|
display: block;
|
|
13451
13452
|
}
|
|
13452
13453
|
|
|
13453
|
-
`}};E([p()],
|
|
13454
|
+
`}};E([p()],RF.prototype,`_listItems`,void 0),RF=E([T(`ixfx-tab-panels`)],RF);let zF=class extends n{constructor(...e){super(...e),this.text=``,this.paused=!1}render(){return i`<span class="shimmer" part="text"
|
|
13454
13455
|
>${this.text===``?i`<slot></slot>`:this.text}</span
|
|
13455
13456
|
>`}static{this.styles=r`
|
|
13456
13457
|
:host {
|
|
@@ -13506,7 +13507,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
13506
13507
|
-webkit-text-fill-color: var(--text-shimmer-color);
|
|
13507
13508
|
}
|
|
13508
13509
|
}
|
|
13509
|
-
`}};E([d({type:String})],KF.prototype,`text`,void 0),E([d({type:Boolean,reflect:!0})],KF.prototype,`paused`,void 0),KF=E([T(`ixfx-text-shimmer`)],KF);var qF=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 JF=[1,2,5,10];function YF(e,n,r,i=`adaptive`,a,o){return i===`fixed`&&a!==void 0&&o!==void 0?ZF(a,o):XF(e,n,r)}function XF(e,n,r){let i=e.max-e.min;if(i<=0||r<=0)return{majorStep:100,minorDivisions:4,minorStep:25};let a=80*QF(n),o=i/Math.max(2,Math.floor(r/a)),s=10**Math.floor(Math.log10(o)),c=s;for(let e of JF){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 ZF(e,n){let r=e;for(;r*n<5&&r<0xe8d4a51000;)r*=2;return{majorStep:r*4,minorDivisions:4,minorStep:r}}function QF(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 $F(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 eI(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 tI(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 nI(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(),iI(e,_,y,v,b,Math.min(m,v/2,b/2)),e.fill(),g&&(e.strokeStyle=`#fff`,e.lineWidth=1.5,e.beginPath(),iI(e,_,y,v,b,Math.min(m,v/2,b/2)),e.stroke()),x&&!g&&(e.strokeStyle=d,e.lineWidth=1,e.beginPath(),iI(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 rI(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 iI(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 aI=[`--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 oI(e){let n=getComputedStyle(e),r={};for(let e of aI)r[e]=n.getPropertyValue(e).trim();return r}function sI(e,n,r){return e/n+r}function cI(e){return e>0?1/e:1}function lI(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*cI(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 uI(e,n){return n.find(n=>e>=n.y&&e<n.y+n.height)?.trackKey}function dI(e,n){return Math.abs(e)>n?e-Math.sign(e)*n:0}function fI(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 pI(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 mI(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=sI(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=lI(o,s,e._internalEvents,e._trackLayout,i);r.shiftKey&&l.kind===`event-move`?gI(e,l.eventId):l.kind===`event-move`?(n.setPointerCapture(r.pointerId),e._drag={kind:`event-move`,eventId:l.eventId,originTrackKey:l.trackKey,offsetX:l.offsetX}):l.kind===`event-start`?(n.setPointerCapture(r.pointerId),e._drag={kind:`event-start`,eventId:l.eventId}):l.kind===`event-end`?(n.setPointerCapture(r.pointerId),e._drag={kind:`event-end`,eventId:l.eventId}):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`){hI(e,n,r);return}let a=e.pxPerUnit,o=n.convertFromViewportToCanvas(r.offsetX,r.offsetY),s=sI(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=dI(n,4),s=dI(a,4),c=fI(i.startViewMin,i.startPpu,i.anchorUnit,o,s);e.setZoomPan(c.viewMin,c.ppu)}else if(i.kind===`marquee`)e._drag={...i,currentLogicalX:s,currentY:c},n.invalidateAll();else 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=uI(c,e._trackLayout)??r.trackKey,p=e.pxPerUnit,m=YF(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()}else 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()}else 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`};else 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=/* @__PURE__ */ new Set,_I(e);else{let n=/* @__PURE__ */ 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,_I(e)}e._drag={kind:`none`},n.invalidateAll()}else 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`}}else 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`}}else e._drag={kind:`none`}},{signal:i}),n.addEventListener(`pointerleave`,()=>{e._tickledId!==void 0&&(e._tickledId=void 0,n.invalidateAll())},{signal:i}),()=>r.abort()}function hI(e,n,r){let i=e.pxPerUnit,a=n.convertFromViewportToCanvas(r.offsetX,r.offsetY),o=sI(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=lI(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 gI(e,n){let r=new Set(e._selectedIds);r.has(n)?r.delete(n):r.add(n),e._selectedIds=r,_I(e),e.getVCanvas()?.invalidateAll()}function _I(e){e.dispatchEvent(new CustomEvent(`selection-change`,{detail:{selectedIds:[...e._selectedIds]},bubbles:!0,composed:!0}))}const vI=r`
|
|
13510
|
+
`}};E([d({type:String})],zF.prototype,`text`,void 0),E([d({type:Boolean,reflect:!0})],zF.prototype,`paused`,void 0),zF=E([T(`ixfx-text-shimmer`)],zF);var BF=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 VF=[1,2,5,10];function HF(e,n,r,i=`adaptive`,a,o){return i===`fixed`&&a!==void 0&&o!==void 0?WF(a,o):UF(e,n,r)}function UF(e,n,r){let i=e.max-e.min;if(i<=0||r<=0)return{majorStep:100,minorDivisions:4,minorStep:25};let a=80*GF(n),o=i/Math.max(2,Math.floor(r/a)),s=10**Math.floor(Math.log10(o)),c=s;for(let e of VF){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 WF(e,n){let r=e;for(;r*n<5&&r<0xe8d4a51000;)r*=2;return{majorStep:r*4,minorDivisions:4,minorStep:r}}function GF(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 KF(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 qF(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 JF(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 YF(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(),ZF(e,_,y,v,b,Math.min(m,v/2,b/2)),e.fill(),g&&(e.strokeStyle=`#fff`,e.lineWidth=1.5,e.beginPath(),ZF(e,_,y,v,b,Math.min(m,v/2,b/2)),e.stroke()),x&&!g&&(e.strokeStyle=d,e.lineWidth=1,e.beginPath(),ZF(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 XF(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 ZF(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 QF=[`--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 $F(e){let n=getComputedStyle(e),r={};for(let e of QF)r[e]=n.getPropertyValue(e).trim();return r}function eI(e,n,r){return e/n+r}function tI(e){return e>0?1/e:1}function nI(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*tI(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 rI(e,n){return n.find(n=>e>=n.y&&e<n.y+n.height)?.trackKey}function iI(e,n){return Math.abs(e)>n?e-Math.sign(e)*n:0}function aI(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 oI(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 sI(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=eI(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=nI(o,s,e._internalEvents,e._trackLayout,i);r.shiftKey&&l.kind===`event-move`?lI(e,l.eventId):l.kind===`event-move`?(n.setPointerCapture(r.pointerId),e._drag={kind:`event-move`,eventId:l.eventId,originTrackKey:l.trackKey,offsetX:l.offsetX}):l.kind===`event-start`?(n.setPointerCapture(r.pointerId),e._drag={kind:`event-start`,eventId:l.eventId}):l.kind===`event-end`?(n.setPointerCapture(r.pointerId),e._drag={kind:`event-end`,eventId:l.eventId}):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`){cI(e,n,r);return}let a=e.pxPerUnit,o=n.convertFromViewportToCanvas(r.offsetX,r.offsetY),s=eI(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=iI(n,4),s=iI(a,4),c=aI(i.startViewMin,i.startPpu,i.anchorUnit,o,s);e.setZoomPan(c.viewMin,c.ppu)}else if(i.kind===`marquee`)e._drag={...i,currentLogicalX:s,currentY:c},n.invalidateAll();else 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=rI(c,e._trackLayout)??r.trackKey,p=e.pxPerUnit,m=HF(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()}else 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()}else 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`};else 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=/* @__PURE__ */ new Set,uI(e);else{let n=/* @__PURE__ */ 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,uI(e)}e._drag={kind:`none`},n.invalidateAll()}else 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`}}else 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`}}else e._drag={kind:`none`}},{signal:i}),n.addEventListener(`pointerleave`,()=>{e._tickledId!==void 0&&(e._tickledId=void 0,n.invalidateAll())},{signal:i}),()=>r.abort()}function cI(e,n,r){let i=e.pxPerUnit,a=n.convertFromViewportToCanvas(r.offsetX,r.offsetY),o=eI(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=nI(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 lI(e,n){let r=new Set(e._selectedIds);r.has(n)?r.delete(n):r.add(n),e._selectedIds=r,uI(e),e.getVCanvas()?.invalidateAll()}function uI(e){e.dispatchEvent(new CustomEvent(`selection-change`,{detail:{selectedIds:[...e._selectedIds]},bubbles:!0,composed:!0}))}const dI=r`
|
|
13510
13511
|
:host {
|
|
13511
13512
|
/* Layout */
|
|
13512
13513
|
--timeline-axis-height: 24px;
|
|
@@ -13656,7 +13657,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
13656
13657
|
.meta-area.visible {
|
|
13657
13658
|
display: block;
|
|
13658
13659
|
}
|
|
13659
|
-
`;let
|
|
13660
|
+
`;let fI=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)}else 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,$t,r`
|
|
13660
13661
|
:host {
|
|
13661
13662
|
display: flex;
|
|
13662
13663
|
align-items: center;
|
|
@@ -13701,7 +13702,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
13701
13702
|
`]}#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`
|
|
13702
13703
|
<span class="handle ixfx-handle" data-handle="dotted" data-shape="spot" part="handle"></span>
|
|
13703
13704
|
<span class="label">${this.label}</span>
|
|
13704
|
-
`}#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})],
|
|
13705
|
+
`}#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})],fI.prototype,`label`,void 0),E([d({type:String,attribute:`track-key`})],fI.prototype,`trackKey`,void 0),E([d({type:Boolean,reflect:!0})],fI.prototype,`selected`,void 0),E([d({type:Boolean,reflect:!0})],fI.prototype,`reorderable`,void 0),E([d({type:Boolean,reflect:!0})],fI.prototype,`resizable`,void 0),fI=E([T(`ixfx-timeline-track-tab`)],fI);function pI(e,n,r,i,a=0,o=0){return{x:e+r-i,y:n+a-o}}function mI(e,n,r,i,a=0,o=0){return{x:e-r+i,y:n-a+o}}function hI(e,n,r){return Math.max(n,Math.min(e,r))}const gI=r`
|
|
13705
13706
|
:host {
|
|
13706
13707
|
display: block;
|
|
13707
13708
|
position: relative;
|
|
@@ -13795,7 +13796,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
13795
13796
|
scroll-timeline: --scrollfade x;
|
|
13796
13797
|
}
|
|
13797
13798
|
|
|
13798
|
-
`;function wI(e,n){return e*n}function TI(e,n){return n===0||e<=n}function EI(e,n){return e<0||n===0?0:TI(e,n)?(n-e)/2:0}function DI(e,n,r,i,a){if(n===0||e<0)return 0;let o=r+i*a;return e>=o?0:TI(r,i)?r:e+n>o?Math.max(0,o-e):n}function OI(e,n,r,i){if(r===0)return{firstTile:0,lastTile:0,tiles:[]};let a=wI(n,i.tileWidthMultiplier);if(TI(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 kI(e,n){return e*n}function AI(e,n){return n===0||e<=n}function jI(e,n){return e<0||n===0?0:AI(e,n)?(n-e)/2:0}function MI(e,n,r,i,a){if(n===0||e<0)return 0;let o=r+i*a;return e>=o?0:AI(r,i)?r:e+n>o?Math.max(0,o-e):n}function NI(e,n,r,i){if(r===0)return{firstRow:0,lastRow:0,rows:[]};let a=kI(n,i.tileHeightMultiplier);if(AI(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 PI(e,n){let r=null,i=(...i)=>{r&&clearTimeout(r),r=setTimeout(()=>{e(...i)},n)};return i.cancel=()=>{r&&=(clearTimeout(r),null)},i}const FI=[`#FF6B6B`,`#4ECDC4`,`#45B7D1`,`#96CEB4`,`#FFEAA7`,`#DDA0DD`,`#98D8C8`,`#F7DC6F`,`#BB8FCE`,`#85C1E9`];function II(e){return FI[e%FI.length]}function LI(e,n,r,i,a){i.fillStyle=`whitesmoke`,i.fillRect(a.x,a.y,a.width,a.height),i.fillStyle=II(e),i.strokeStyle=II(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 RI=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 zI=(e,n)=>`${e},${n}`;let BI=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.dragToScroll=!0,this._drag=null,this._suppressClick=!1,this._boundPointerDown=this._onPointerDown.bind(this),this._boundPointerMove=this._onPointerMove.bind(this),this._boundPointerEnd=this._onPointerEnd.bind(this),this._boundClickCapture=this._onClickCapture.bind(this),this._viewportWidth=0,this._viewportHeight=0,this._scrollLeft=0,this._scrollTop=0,this._logicalHeight=0,this._tilePool=/* @__PURE__ */ new Map,this._visibleTiles=/* @__PURE__ */ new Set,this._pendingDraws=/* @__PURE__ */ new Map,this._scrollContainer=null,this._spacer=null,this._tilePoolEl=null,this._childrenContainerEl=null,this._resizeObserver=null,this._positionedChildren=/* @__PURE__ */ 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=PI(()=>{this._requestRedrawAll(`scrollDebounce`)},this._renderingOptions.scrollDebounceMs),this._scrollEndDebounce=PI(()=>{this._emitScrollEndEvent(!0)},this._renderingOptions.scrollDebounceMs),this._resizeDebounce=PI(()=>{this._onResize()},this._renderingOptions.scrollDebounceMs)}static{this.styles=CI}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),this._detachDragListeners()}_detachDragListeners(){let e=this._scrollContainer;e&&(e.removeEventListener(`pointerdown`,this._boundPointerDown),e.removeEventListener(`pointermove`,this._boundPointerMove),e.removeEventListener(`pointerup`,this._boundPointerEnd),e.removeEventListener(`pointercancel`,this._boundPointerEnd),e.removeEventListener(`click`,this._boundClickCapture,!0),this._drag=null)}_attachDragListeners(){let e=this._scrollContainer;e&&(e.addEventListener(`pointerdown`,this._boundPointerDown),e.addEventListener(`pointermove`,this._boundPointerMove),e.addEventListener(`pointerup`,this._boundPointerEnd),e.addEventListener(`pointercancel`,this._boundPointerEnd),e.addEventListener(`click`,this._boundClickCapture,!0))}_onPointerDown(e){this.dragToScroll&&this._scrollContainer&&e.pointerType!==`touch`&&e.isPrimary&&e.button===0&&(this._suppressClick=!1,this._drag={pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,startLeft:this._scrollContainer.scrollLeft,startTop:this._scrollContainer.scrollTop,active:!1})}_onPointerMove(e){let n=this._drag,r=this._scrollContainer;if(!n||!r||e.pointerId!==n.pointerId)return;let i=e.clientX-n.startX,a=e.clientY-n.startY;if(!n.active){if(Math.hypot(i,a)<4)return;n.active=!0;try{r.setPointerCapture(e.pointerId)}catch{}r.classList.add(`dragging`)}e.preventDefault(),r.scrollLeft=n.startLeft-i,r.classList.contains(`vertical`)&&(r.scrollTop=n.startTop-a)}_onPointerEnd(e){let n=this._drag,r=this._scrollContainer;if(n&&r&&e.pointerId===n.pointerId&&(this._drag=null,n.active)){this._suppressClick=!0,setTimeout(()=>{this._suppressClick=!1},0);try{r.releasePointerCapture(e.pointerId)}catch{}r.classList.remove(`dragging`)}}_onClickCapture(e){this._suppressClick&&(this._suppressClick=!1,e.stopPropagation(),e.preventDefault())}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),this._attachDragListeners()),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=TI(this.effectiveLogicalWidth,this._viewportWidth),n=AI(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 wI(this._viewportWidth,this._renderingOptions.tileWidthMultiplier)}_getTileHeight(){return kI(this._viewportHeight,this._renderingOptions.tileHeightMultiplier)}_getTileClippedWidth(e,n){return DI(e,n,this.effectiveLogicalWidth,this._viewportWidth,this._renderingOptions.overscrollPadMultiplier)}_getTileClippedHeight(e,n){return MI(e,n,this.effectiveLogicalHeight,this._viewportHeight,this._renderingOptions.overscrollPadMultiplier)}_calculateTileRange(){return OI(this._scrollLeft,this._viewportWidth,this.effectiveLogicalWidth,this._renderingOptions)}_calculateTileRowRange(){return NI(this._scrollTop,this._viewportHeight,this.effectiveLogicalHeight,this._renderingOptions)}_recalculateTiles(e){this._updateViewportDimensions();let{tiles:n}=this._calculateTileRange(),{rows:r}=this._calculateTileRowRange(),i=/* @__PURE__ */ new Set;for(let{index:e,logicalX:a}of n)for(let{row:n,logicalY:o}of r)i.add(zI(e,n)),this._tilePool.has(zI(e,n))||this._tilePool.set(zI(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=zI(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=TI(this.effectiveLogicalWidth,this._viewportWidth),d=AI(this.effectiveLogicalHeight,this._viewportHeight),f=EI(this.effectiveLogicalWidth,this._viewportWidth),p=jI(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=zI(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=TI(this.effectiveLogicalWidth,this._viewportWidth),l=AI(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&&LI(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=SI(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=SI(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=zI(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=EI(this.effectiveLogicalWidth,this._viewportWidth),i=jI(this.effectiveLogicalHeight,this._viewportHeight);return bI(e,n,this._scrollLeft,r,this._scrollTop,i)}convertFromCanvasToViewport(e,n){let r=EI(this.effectiveLogicalWidth,this._viewportWidth),i=jI(this.effectiveLogicalHeight,this._viewportHeight);return xI(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`
|
|
13799
|
+
`;function _I(e,n){return e*n}function vI(e,n){return n===0||e<=n}function yI(e,n){return e<0||n===0?0:vI(e,n)?(n-e)/2:0}function bI(e,n,r,i,a){if(n===0||e<0)return 0;let o=r+i*a;return e>=o?0:vI(r,i)?r:e+n>o?Math.max(0,o-e):n}function xI(e,n,r,i){if(r===0)return{firstTile:0,lastTile:0,tiles:[]};let a=_I(n,i.tileWidthMultiplier);if(vI(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 SI(e,n){return e*n}function CI(e,n){return n===0||e<=n}function wI(e,n){return e<0||n===0?0:CI(e,n)?(n-e)/2:0}function TI(e,n,r,i,a){if(n===0||e<0)return 0;let o=r+i*a;return e>=o?0:CI(r,i)?r:e+n>o?Math.max(0,o-e):n}function EI(e,n,r,i){if(r===0)return{firstRow:0,lastRow:0,rows:[]};let a=SI(n,i.tileHeightMultiplier);if(CI(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 DI(e,n){let r=null,i=(...i)=>{r&&clearTimeout(r),r=setTimeout(()=>{e(...i)},n)};return i.cancel=()=>{r&&=(clearTimeout(r),null)},i}const OI=[`#FF6B6B`,`#4ECDC4`,`#45B7D1`,`#96CEB4`,`#FFEAA7`,`#DDA0DD`,`#98D8C8`,`#F7DC6F`,`#BB8FCE`,`#85C1E9`];function kI(e){return OI[e%OI.length]}function AI(e,n,r,i,a){i.fillStyle=`whitesmoke`,i.fillRect(a.x,a.y,a.width,a.height),i.fillStyle=kI(e),i.strokeStyle=kI(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 jI=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 MI=(e,n)=>`${e},${n}`;let NI=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.dragToScroll=!0,this._drag=null,this._suppressClick=!1,this._boundPointerDown=this._onPointerDown.bind(this),this._boundPointerMove=this._onPointerMove.bind(this),this._boundPointerEnd=this._onPointerEnd.bind(this),this._boundClickCapture=this._onClickCapture.bind(this),this._viewportWidth=0,this._viewportHeight=0,this._scrollLeft=0,this._scrollTop=0,this._logicalHeight=0,this._tilePool=/* @__PURE__ */ new Map,this._visibleTiles=/* @__PURE__ */ new Set,this._pendingDraws=/* @__PURE__ */ new Map,this._scrollContainer=null,this._spacer=null,this._tilePoolEl=null,this._childrenContainerEl=null,this._resizeObserver=null,this._positionedChildren=/* @__PURE__ */ 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=DI(()=>{this._requestRedrawAll(`scrollDebounce`)},this._renderingOptions.scrollDebounceMs),this._scrollEndDebounce=DI(()=>{this._emitScrollEndEvent(!0)},this._renderingOptions.scrollDebounceMs),this._resizeDebounce=DI(()=>{this._onResize()},this._renderingOptions.scrollDebounceMs)}static{this.styles=gI}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),this._detachDragListeners()}_detachDragListeners(){let e=this._scrollContainer;e&&(e.removeEventListener(`pointerdown`,this._boundPointerDown),e.removeEventListener(`pointermove`,this._boundPointerMove),e.removeEventListener(`pointerup`,this._boundPointerEnd),e.removeEventListener(`pointercancel`,this._boundPointerEnd),e.removeEventListener(`click`,this._boundClickCapture,!0),this._drag=null)}_attachDragListeners(){let e=this._scrollContainer;e&&(e.addEventListener(`pointerdown`,this._boundPointerDown),e.addEventListener(`pointermove`,this._boundPointerMove),e.addEventListener(`pointerup`,this._boundPointerEnd),e.addEventListener(`pointercancel`,this._boundPointerEnd),e.addEventListener(`click`,this._boundClickCapture,!0))}_onPointerDown(e){this.dragToScroll&&this._scrollContainer&&e.pointerType!==`touch`&&e.isPrimary&&e.button===0&&(this._suppressClick=!1,this._drag={pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,startLeft:this._scrollContainer.scrollLeft,startTop:this._scrollContainer.scrollTop,active:!1})}_onPointerMove(e){let n=this._drag,r=this._scrollContainer;if(!n||!r||e.pointerId!==n.pointerId)return;let i=e.clientX-n.startX,a=e.clientY-n.startY;if(!n.active){if(Math.hypot(i,a)<4)return;n.active=!0;try{r.setPointerCapture(e.pointerId)}catch{}r.classList.add(`dragging`)}e.preventDefault(),r.scrollLeft=n.startLeft-i,r.classList.contains(`vertical`)&&(r.scrollTop=n.startTop-a)}_onPointerEnd(e){let n=this._drag,r=this._scrollContainer;if(n&&r&&e.pointerId===n.pointerId&&(this._drag=null,n.active)){this._suppressClick=!0,setTimeout(()=>{this._suppressClick=!1},0);try{r.releasePointerCapture(e.pointerId)}catch{}r.classList.remove(`dragging`)}}_onClickCapture(e){this._suppressClick&&(this._suppressClick=!1,e.stopPropagation(),e.preventDefault())}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),this._attachDragListeners()),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=vI(this.effectiveLogicalWidth,this._viewportWidth),n=CI(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 _I(this._viewportWidth,this._renderingOptions.tileWidthMultiplier)}_getTileHeight(){return SI(this._viewportHeight,this._renderingOptions.tileHeightMultiplier)}_getTileClippedWidth(e,n){return bI(e,n,this.effectiveLogicalWidth,this._viewportWidth,this._renderingOptions.overscrollPadMultiplier)}_getTileClippedHeight(e,n){return TI(e,n,this.effectiveLogicalHeight,this._viewportHeight,this._renderingOptions.overscrollPadMultiplier)}_calculateTileRange(){return xI(this._scrollLeft,this._viewportWidth,this.effectiveLogicalWidth,this._renderingOptions)}_calculateTileRowRange(){return EI(this._scrollTop,this._viewportHeight,this.effectiveLogicalHeight,this._renderingOptions)}_recalculateTiles(e){this._updateViewportDimensions();let{tiles:n}=this._calculateTileRange(),{rows:r}=this._calculateTileRowRange(),i=/* @__PURE__ */ new Set;for(let{index:e,logicalX:a}of n)for(let{row:n,logicalY:o}of r)i.add(MI(e,n)),this._tilePool.has(MI(e,n))||this._tilePool.set(MI(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=MI(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=vI(this.effectiveLogicalWidth,this._viewportWidth),d=CI(this.effectiveLogicalHeight,this._viewportHeight),f=yI(this.effectiveLogicalWidth,this._viewportWidth),p=wI(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=MI(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=vI(this.effectiveLogicalWidth,this._viewportWidth),l=CI(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&&AI(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=hI(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=hI(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=MI(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=yI(this.effectiveLogicalWidth,this._viewportWidth),i=wI(this.effectiveLogicalHeight,this._viewportHeight);return pI(e,n,this._scrollLeft,r,this._scrollTop,i)}convertFromCanvasToViewport(e,n){let r=yI(this.effectiveLogicalWidth,this._viewportWidth),i=wI(this.effectiveLogicalHeight,this._viewportHeight);return mI(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`
|
|
13799
13800
|
<div class=${e}>
|
|
13800
13801
|
<div class="spacer"></div>
|
|
13801
13802
|
<div class="tile-pool"></div>
|
|
@@ -13803,7 +13804,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
13803
13804
|
<slot></slot>
|
|
13804
13805
|
</div>
|
|
13805
13806
|
</div>
|
|
13806
|
-
`}};
|
|
13807
|
+
`}};jI([d({type:Boolean})],NI.prototype,`hinting`,void 0),jI([d({type:Boolean,attribute:`drag-to-scroll`})],NI.prototype,`dragToScroll`,void 0),jI([d()],NI.prototype,`logicalWidth`,null),jI([d()],NI.prototype,`logicalHeight`,null),jI([d({type:Number})],NI.prototype,`logicalScrollLeft`,null),jI([d({type:Number})],NI.prototype,`logicalScrollTop`,null),NI=jI([l(`x-vcanvas`)],NI);const PI=1e4;let Q=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=/* @__PURE__ */ new Set,this._tickledId=void 0,this._drag={kind:`none`},this._metaHeight=120,this._trackHeightOverrides=/* @__PURE__ */ 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=$F(this);let o=HF(this._viewRange,this.userScale,this.#c(),this.gridMode,this.minorStep,i),s=this._internalTracks.map(e=>({key:e.key,color:e.color}));JF(e,a,this._trackLayout,s,this.#t,i),KF(e,a,o,this.altMajorBg,this.#t,i),YF(e,a,this._internalEvents,this._trackLayout,this._selectedIds,this._tickledId,this._drag,this.#t,i),XF(e,this._drag,i);let c=this.#e?.logicalScrollTop??0;qF(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,PI))),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=iI(r,4),o=iI(i,4),s=oI(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=[dI]}#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,PI)),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,PI))),this._viewRange=this.#_(e.min,this._ppu)}setZoomPan(e,n){this._ppu=Math.max(this.#l(),Math.min(n,PI)),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=/* @__PURE__ */ 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=/* @__PURE__ */ 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=sI(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=/* @__PURE__ */ 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`
|
|
13807
13808
|
<div class="content-wrapper">
|
|
13808
13809
|
<div class="content-area">
|
|
13809
13810
|
<div class="v-axis-zone"
|
|
@@ -13856,7 +13857,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
13856
13857
|
|
|
13857
13858
|
<div class="meta-resizer ${this.metaEnabled?`visible`:``}"></div>
|
|
13858
13859
|
<div class="meta-area ${this.metaEnabled?`visible`:``}" style="height:${this._metaHeight}px"></div>
|
|
13859
|
-
`}#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})],Q.prototype,`tracks`,void 0),E([d({type:Array})],Q.prototype,`events`,void 0),E([d({type:Number})],Q.prototype,`min`,void 0),E([d({type:Number})],Q.prototype,`max`,void 0),E([d({type:String,attribute:`track-height`})],Q.prototype,`trackHeight`,void 0),E([d({type:String,attribute:`user-scale`})],Q.prototype,`userScale`,void 0),E([d({type:Boolean})],Q.prototype,`reorderable`,void 0),E([d({type:Boolean,attribute:`meta`})],Q.prototype,`metaEnabled`,void 0),E([d({type:Boolean,attribute:`alt-major-bg`})],Q.prototype,`altMajorBg`,void 0),E([d({type:Number,attribute:`default-track-height`})],Q.prototype,`defaultTrackHeight`,void 0),E([d({type:String,attribute:`grid-mode`})],Q.prototype,`gridMode`,void 0),E([d({type:Number,attribute:`minor-step`})],Q.prototype,`minorStep`,void 0),E([d({type:Object})],Q.prototype,`onDragging`,void 0),E([m()],Q.prototype,`_ppu`,void 0),E([m()],Q.prototype,`_viewRange`,void 0),E([m()],Q.prototype,`_vViewRange`,void 0),E([m()],Q.prototype,`_vScale`,void 0),E([m()],Q.prototype,`_selectedIds`,void 0),E([m()],Q.prototype,`_tickledId`,void 0),E([m()],Q.prototype,`_drag`,void 0),E([m()],Q.prototype,`_metaHeight`,void 0),E([m()],Q.prototype,`_trackHeightOverrides`,void 0),E([m()],Q.prototype,`_trackLayout`,void 0),E([m()],Q.prototype,`_internalEvents`,void 0),E([m()],Q.prototype,`_internalTracks`,void 0),Q=E([T(`ixfx-timeline`)],Q);let
|
|
13860
|
+
`}#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})],Q.prototype,`tracks`,void 0),E([d({type:Array})],Q.prototype,`events`,void 0),E([d({type:Number})],Q.prototype,`min`,void 0),E([d({type:Number})],Q.prototype,`max`,void 0),E([d({type:String,attribute:`track-height`})],Q.prototype,`trackHeight`,void 0),E([d({type:String,attribute:`user-scale`})],Q.prototype,`userScale`,void 0),E([d({type:Boolean})],Q.prototype,`reorderable`,void 0),E([d({type:Boolean,attribute:`meta`})],Q.prototype,`metaEnabled`,void 0),E([d({type:Boolean,attribute:`alt-major-bg`})],Q.prototype,`altMajorBg`,void 0),E([d({type:Number,attribute:`default-track-height`})],Q.prototype,`defaultTrackHeight`,void 0),E([d({type:String,attribute:`grid-mode`})],Q.prototype,`gridMode`,void 0),E([d({type:Number,attribute:`minor-step`})],Q.prototype,`minorStep`,void 0),E([d({type:Object})],Q.prototype,`onDragging`,void 0),E([m()],Q.prototype,`_ppu`,void 0),E([m()],Q.prototype,`_viewRange`,void 0),E([m()],Q.prototype,`_vViewRange`,void 0),E([m()],Q.prototype,`_vScale`,void 0),E([m()],Q.prototype,`_selectedIds`,void 0),E([m()],Q.prototype,`_tickledId`,void 0),E([m()],Q.prototype,`_drag`,void 0),E([m()],Q.prototype,`_metaHeight`,void 0),E([m()],Q.prototype,`_trackHeightOverrides`,void 0),E([m()],Q.prototype,`_trackLayout`,void 0),E([m()],Q.prototype,`_internalEvents`,void 0),E([m()],Q.prototype,`_internalTracks`,void 0),Q=E([T(`ixfx-timeline`)],Q);let FI=class extends n{constructor(...e){super(...e),this.label=``,this.grow=!1,this.reorderable=!1}static{this.styles=[w,$t,r`
|
|
13860
13861
|
:host {
|
|
13861
13862
|
display: flex;
|
|
13862
13863
|
flex-direction: column;
|
|
@@ -13932,7 +13933,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
13932
13933
|
<slot></slot>
|
|
13933
13934
|
</div>
|
|
13934
13935
|
</div>
|
|
13935
|
-
`}};E([d({type:String})],
|
|
13936
|
+
`}};E([d({type:String})],FI.prototype,`label`,void 0),E([d({type:Boolean,reflect:!0})],FI.prototype,`grow`,void 0),E([d({type:Boolean,reflect:!0})],FI.prototype,`reorderable`,void 0),FI=E([T(`ixfx-toolbar-group`)],FI);var II;function LI(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 RI=!1;function zI(){if(RI)return;RI=!0;let e=document.createElement(`style`);e.textContent=`
|
|
13936
13937
|
.ixfx-drag-ghost.ixfx-toolbar-group-ghost {
|
|
13937
13938
|
padding: var(--space-s, 8px) var(--space-m, 16px);
|
|
13938
13939
|
background: var(--surface-4);
|
|
@@ -13945,7 +13946,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
13945
13946
|
user-select: none;
|
|
13946
13947
|
-webkit-user-select: none;
|
|
13947
13948
|
}
|
|
13948
|
-
`,document.head.appendChild(e)}let
|
|
13949
|
+
`,document.head.appendChild(e)}let BI=class extends n{static{II=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-${II._cnt++}`,this._sizes=/* @__PURE__ */ new WeakMap,this._measureQueued=!1,this._dragState=null,this._suppressNextClick=!1,this._onClickCapture=e=>{this._suppressNextClick&&(this._suppressNextClick=!1,e.preventDefault(),e.stopPropagation())},this._onKeyDown=e=>{let n=this._dragState;if(e.key!==`Escape`||!n?.active)return;e.preventDefault();let r=n.pointerId;this._abortDrag(),this._endDrag(r)},this._onPointerDown=e=>{if(!this.allowReorder||e.button!==0)return;let n=this._findDragTarget(e);n?.parentNode&&(Array.prototype.indexOf.call(n.parentNode.children,n)<0||(this._dragState={pointerId:e.pointerId,source:n,startX:e.clientX,startY:e.clientY,active:!1,ghost:null,gapIndex:void 0},window.addEventListener(`pointermove`,this._onPointerMove),window.addEventListener(`pointerup`,this._onPointerUp),window.addEventListener(`pointercancel`,this._onPointerCancel)))},this._onPointerMove=e=>{let n=this._dragState;if(!n||e.pointerId!==n.pointerId)return;let r=Math.hypot(e.clientX-n.startX,e.clientY-n.startY);if(!n.active){if(r<5)return;this._beginDrag(e)}n.ghost?.move(e.clientX,e.clientY);let i=this._computeGapIndex(e.clientX,e.clientY);i!==n.gapIndex&&(n.gapIndex=i,this.requestUpdate())},this._onPointerUp=e=>{let n=this._dragState;if(n&&e.pointerId===n.pointerId){if(n.active){let r=this._computeGapIndex(e.clientX,e.clientY);this._commitDrag(n.source,r)}this._endDrag(e.pointerId)}},this._onPointerCancel=e=>{let n=this._dragState;n&&e.pointerId===n.pointerId&&(this._abortDrag(),this._endDrag(e.pointerId))}}static{this._cnt=0}static{this.styles=[w,de,r`
|
|
13949
13950
|
:host {
|
|
13950
13951
|
--toolbar-gap: var(--space-s);
|
|
13951
13952
|
--toolbar-group-gap: var(--space-m);
|
|
@@ -14043,7 +14044,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
14043
14044
|
pointer-events: none;
|
|
14044
14045
|
z-index: 1;
|
|
14045
14046
|
}
|
|
14046
|
-
`]}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=/* @__PURE__ */ 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
|
|
14047
|
+
`]}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=/* @__PURE__ */ 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 zI(),Sy({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 LI(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`
|
|
14047
14048
|
<div class="inner" role="toolbar" aria-orientation=${this.orientation}>
|
|
14048
14049
|
<slot @pointerdown=${this._onPointerDown} @keydown=${this._onKeyDown}></slot>
|
|
14049
14050
|
<ixfx-button class="overflow-btn" ?hidden=${!n} @click=${this._toggleOverflow} aria-label="More" aria-haspopup="true" aria-expanded=${this._popoverOpen}>⋯</ixfx-button>
|
|
@@ -14052,13 +14053,13 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
14052
14053
|
<slot name="overflow"></slot>
|
|
14053
14054
|
</div>
|
|
14054
14055
|
${r?i`<div class="drop-caret" style=${r}></div>`:a}
|
|
14055
|
-
`}};E([d({type:String,reflect:!0})],
|
|
14056
|
-
${
|
|
14056
|
+
`}};E([d({type:String,reflect:!0})],BI.prototype,`orientation`,void 0),E([d({type:String,reflect:!0})],BI.prototype,`layout`,void 0),E([d({type:String,attribute:`vertical-writing`,reflect:!0})],BI.prototype,`verticalWriting`,void 0),E([d({type:String,attribute:`toolbar-align`,reflect:!0})],BI.prototype,`toolbarAlign`,void 0),E([d({type:Boolean,attribute:`show-group-labels`,reflect:!0})],BI.prototype,`showGroupLabels`,void 0),E([d({type:Boolean,attribute:`invisible-groups`,reflect:!0})],BI.prototype,`invisibleGroups`,void 0),E([d({type:Boolean,attribute:`allow-reorder`,reflect:!0})],BI.prototype,`allowReorder`,void 0),E([m()],BI.prototype,`_overflowCount`,void 0),E([m()],BI.prototype,`_popoverOpen`,void 0),E([f(`.inner`)],BI.prototype,`_inner`,void 0),E([f(`.overflow-popover`)],BI.prototype,`_popover`,void 0),E([f(`slot`)],BI.prototype,`_slot`,void 0),BI=II=E([T(`ixfx-toolbar`)],BI);let VI=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`
|
|
14057
|
+
${x(`cc${this._transitionId}`,i`
|
|
14057
14058
|
<span class="layer current char-swap">
|
|
14058
14059
|
${r.map((e,n)=>i`<span class="char in" style=${c(n)}>${e}</span>`)}
|
|
14059
14060
|
</span>
|
|
14060
14061
|
`)}
|
|
14061
|
-
${this._outgoingText?
|
|
14062
|
+
${this._outgoingText?x(this._transitionId,i`
|
|
14062
14063
|
<span class="layer outgoing char-swap">
|
|
14063
14064
|
${o.map((e,n)=>i`<span
|
|
14064
14065
|
class="char out"
|
|
@@ -14069,12 +14070,12 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
14069
14070
|
`):a}
|
|
14070
14071
|
`}render(){if(this._activeEffect===`character-swap`)return i`<span class="container">${this.#n()}</span>`;let e=this._activeEffect??``,n=this._activeEffect?`animation-duration:${this.duration}ms;animation-timing-function:${this.easing}`:``;return i`
|
|
14071
14072
|
<span class="container">
|
|
14072
|
-
${this._outgoingText?
|
|
14073
|
+
${this._outgoingText?x(this._transitionId,i`
|
|
14073
14074
|
<span class="layer outgoing ${e}" style=${n} @animationend=${this.#e}>
|
|
14074
14075
|
${this._outgoingText}
|
|
14075
14076
|
</span>
|
|
14076
14077
|
`):a}
|
|
14077
|
-
${
|
|
14078
|
+
${x(`c${this._transitionId}`,i`
|
|
14078
14079
|
<span class="layer current ${e}" style=${n}>
|
|
14079
14080
|
${this._currentText}
|
|
14080
14081
|
</span>
|
|
@@ -14212,7 +14213,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
14212
14213
|
from { opacity: 1; transform: translateY(0) scale(1); }
|
|
14213
14214
|
to { opacity: 0; transform: translateY(0.3em) scale(0.8); }
|
|
14214
14215
|
}
|
|
14215
|
-
`}};E([d({type:String})],JI.prototype,`text`,void 0),E([d({type:String})],JI.prototype,`effect`,void 0),E([d({type:Number})],JI.prototype,`duration`,void 0),E([d({type:String})],JI.prototype,`easing`,void 0),E([m()],JI.prototype,`_currentText`,void 0),E([m()],JI.prototype,`_outgoingText`,void 0),E([m()],JI.prototype,`_activeEffect`,void 0),E([m()],JI.prototype,`_transitionId`,void 0),JI=E([T(`ixfx-transitory-label`)],JI);var YI=class{#e;#t;#n;#r=/* @__PURE__ */ new WeakMap;#i=/* @__PURE__ */ new Map;#a=/* @__PURE__ */ new Map;#o=/* @__PURE__ */ 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=/* @__PURE__ */ 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=/* @__PURE__ */ 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 XI(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:0}function ZI(e,n){if(e){if(e.item.key===n)return e;for(let r of e.children??[]){let e=ZI(r,n);if(e)return e}}}function QI(e,n){if(e){if(e.item.key===n)return[e];for(let r of e.children??[]){let i=QI(r,n);if(i)return[e,...i]}}}function $I(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 eL(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=$I(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=$I(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 tL(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?Math.min(e,1):0}function nL(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=eL(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 rL(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?tL(l):0,p=d?tL(u):0,m=e=>{let n=e.children??[];return s?n.filter(e=>e.item.isLeaf!==!0):n},h=a===void 0?e:ZI(e,a)??e,g=QI(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=nL(n,e.map(e=>XI(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}function iL(e){let n=/* @__PURE__ */ new Map;if(!e)return n;let r=(e,i,a)=>{n.has(e.item.key)||n.set(e.item.key,{node:e,parentKey:i,depth:a});for(let n of e.children??[])r(n,e.item.key,a+1)};return r(e,void 0,-1),n}function aL(e,n){let r=[];for(let i=e.get(n);i!==void 0;i=i.parentKey===void 0?void 0:e.get(i.parentKey)){if(i.parentKey===void 0)return r;r.unshift(i.node.item.key)}}function oL(e,n){let r=n.at(-1);if(r===void 0)return{kind:`found`,key:void 0};if(e.has(r))return{kind:`found`,key:r};for(let r=n.length-2;r>=0;r--){let i=e.get(n[r]);if(!i)continue;let{node:a,depth:o}=i;return a.children===void 0&&a.item.isLeaf!==!0?{kind:`load`,node:a,depth:o}:{kind:`missing`}}return{kind:`missing`}}function sL(e){let{index:n}=e,r,i=e.pendingZoom;if(e.zoomKey!==void 0&&!n.has(e.zoomKey))i??=e.zoomPath,r={key:void 0,path:[],restored:!1};else if(e.zoomKey!==void 0){let i=aL(n,e.zoomKey)??e.zoomPath;cL(i,e.zoomPath)||(r={key:e.zoomKey,path:i,restored:!1})}if(i){let e=oL(n,i);if(e.kind===`found`){let a=e.key;r={key:a,path:a===void 0?[]:aL(n,a)??i,restored:!0},i=void 0}}let a=eT(e.selected,e.pendingSelected,e=>n.get(e)?.node,e.canSelect,e.singleSelect);return{zoom:r,pendingZoom:i,selection:a}}function cL(e,n){return e.length===n.length&&e.every((e,r)=>e===n[r])}function lL(e){let{controller:n}=e,r=[],i,a=O,o,s=!1,c=0,l=-1,u,d=()=>(u?.version!==c&&(u={version:c,index:iL(e.root())}),u.index),f=()=>s?e.tickled():void 0,p=(i,a,o)=>{r=a,e.zoomKey()!==i&&(e.setZoom(i,o),n.notify())},m=r=>{let i=tT(f(),o,e=>r.has(e),e.isVisible);o=i.pending;let a=e.tickled();(i.clear||a!==void 0&&!r.has(a))&&e.setTickled(void 0),i.apply!==void 0&&(e.setTickled(i.apply),s=!0,n.notify())},h=()=>{if(l=c,!e.root())return;let o=d();n.restoring(()=>{let n=sL({index:o,zoomKey:e.zoomKey(),zoomPath:r,pendingZoom:i,selected:e.selected(),pendingSelected:a,canSelect:e.canSelect,singleSelect:e.singleSelect()});i=n.pendingZoom,n.zoom&&p(n.zoom.key,n.zoom.path,n.zoom.restored);let s=n.selection;if(s.changed){a=s.pending;let n=e.selectedNode()?.item.key,r=[...s.selected].find(e=>e.item.key===n)??[...s.selected].at(-1);e.setSelection(s.selected,r,s.restored)}m(o)})};return{invalidate(){c++},reconcileIfNeeded(e){e&&c++,l!==c&&h()},zoomed(e){i=void 0,r=e===void 0?[]:aL(d(),e)??[e],n.notify()},selectionChanged(){n.isRestoring||(a=O),n.notify()},clearPendingSelection(){a=O},keyboardCursorMoved(){s=!0,o=void 0,n.notify()},pointerCursorMoved(){s&&(s=!1,n.notify())},get(s){let c=s?.includePending??!0;return n.shape({selected:pr([...e.selected()].map(e=>e.item.key),c?a:[]),focus:f()??(c?o:void 0),zoom:[...(c?i:void 0)??r]},s)},set(r){n.accepts(r)&&n.restoring(()=>{r.selected&&(a=cr(new Set(r.selected)),e.selected().size>0&&e.setSelection(/* @__PURE__ */ new Set,void 0,!0)),r.focus!==void 0&&(o=r.focus);let n=nT(r.zoom);n&&(i=n),h(),n&&i&&p(void 0,[],!0)})},clearPending(){a=O,o=void 0,i=void 0},continueRestoreLoads(){if(!i||!e.restoreLoads()||!e.canLoad())return;let n=oL(d(),i);n.kind===`load`&&!e.isLoading(n.node.item.key)&&e.load(n.node,n.depth)}}}let $=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=/* @__PURE__ */ new Set,this.disableKeyboardNavigation=!1,this.registry=void 0,this._zoomKey=void 0,this.restoreLoads=!0,this.#e=lL({controller:new cy(this,{kind:`treemap-list`,capture:()=>this.getViewState()}),root:()=>this.#u,zoomKey:()=>this._zoomKey,setZoom:(e,n)=>this.#C(e,n),selected:()=>this._selectedNodes,selectedNode:()=>this.selectedNode,canSelect:e=>this.#y(e),singleSelect:()=>this.interactionMode===`implicit`,setSelection:(e,n,r)=>{let i=this._selectedNodes;this._selectedNodes=new Set(e),this.selectedNode=n,r&&this.#x(i)},tickled:()=>this.tickled.tickledId,setTickled:e=>e===void 0?this.tickled.clearTickled():this.tickled.setTickled(e),isVisible:e=>this.#d().some(n=>n.node.item.key===e),restoreLoads:()=>this.restoreLoads,canLoad:()=>this.model!==void 0||this.loadChildren!==void 0,isLoading:e=>this.#n.has(e),load:(e,n)=>void this.#v(e,n)}),this.search=new Ht(this,{adapter:Gt(this,{labelSelector:`.treemap-label`,highlightKey:`incr-search-highlight`})}),this.tickled=new oe(this,{getItems:()=>this.#d().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.#d().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.#n=/* @__PURE__ */ new Set,this.#r=/* @__PURE__ */ new Map,this.#l=0}get selectedNodes(){return this._selectedNodes}get focusedNode(){if(this._zoomKey!==void 0)return ZI(this.#u,this._zoomKey)}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;get#u(){return this.model?.root??this.root}#d(){return this.#f(this._zoomKey)}#f(e){return rL(this.#u,{valueAccessor:this.valueAccessor,maxDepth:this.maxDepth,zoomKey:e,tilingMethod:this.tilingMethod,hideLeaves:this.hideLeaves,presentation:this.presentation,...this.#p()})}#p(){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.#a=Xt();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.#h(),typeof ResizeObserver<`u`&&(this.#s=new ResizeObserver(()=>this.requestUpdate()),this.#s.observe(this))}disconnectedCallback(){super.disconnectedCallback(),this.#t?.(),this.#t=void 0;for(let e of this.#r.values())e.abort();this.#r.clear(),this.#n.clear(),this.#s?.disconnect(),this.#s=void 0,this.#a&&(this.#a.unregister(`select-all`),this.#a.unregister(`deselect-all`),this.#a=void 0,this.registry=void 0)}#m(){let e=this.searchModes?.trim();if(e===void 0)return[...Bt];let n=new Set(e.split(/\s+/));return Bt.filter(e=>n.has(e))}#h(){this.#a&&(this.search.setModes(this.#m()),this.#o?.(),this.#o=zt(this.#a,this.search))}willUpdate(e){(e.has(`root`)&&this.root||e.has(`model`))&&this.#g(),this.#e.reconcileIfNeeded(this._zoomKey!==void 0&&!ZI(this.#u,this._zoomKey))}updated(e){if(e.has(`model`)&&(this.#t?.(),this.#t=void 0,this.model&&(this.#t=this.model._subscribe(e=>{e.type===`root`?this.#g():e.type===`invalidate`&&this.#e.invalidate(),this.requestUpdate()}))),e.has(`interactionMode`)&&e.get(`interactionMode`)!==void 0&&(this.#i=void 0,this.clearSelection()),e.has(`searchModes`)&&this.#h(),this.#_(),this.#e.continueRestoreLoads(),this.#c){let e=this.#c;this.#c=void 0,this.#T(e)}}#g(){this.#c=void 0,this.#i=void 0,this.#e.invalidate()}#_(){if(this.model||this.loadChildren)for(let e of this.#d()){let{node:n}=e;n.children!==void 0||this.#n.has(n.item.key)||this.#v(n,e.depth)}}async#v(e,n){let r=e.item.key;this.#n.add(r);let i=new AbortController;this.#r.set(r,i),this.requestUpdate();try{let r;if(r=this.model?await this.model.getChildren(e,n,i.signal):[...await Pv(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.#n.delete(r),this.#r.delete(r),i.signal.aborted||(this.#e.invalidate(),this.requestUpdate())}}#y(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}#b(){this._selectedNodes.clear(),this.selectedNode=void 0}#x(e){this.#e.selectionChanged(),this.dispatchEvent(new CustomEvent(`select`,{detail:{selected:new Set(this._selectedNodes),previous:e},bubbles:!0,composed:!0}))}select(e){if(!this.#y(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.clear(),this._selectedNodes.add(e),this.selectedNode=e,this.#x(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.#x(n),this.requestUpdate()}clearSelection(){if(this.#e.clearPendingSelection(),this._selectedNodes.size===0)return;let e=new Set(this._selectedNodes);this.#b(),this.#x(e),this.requestUpdate()}selectAll(){let e=new Set(this._selectedNodes);for(let e of this.#d())this.#y(e.node)&&this._selectedNodes.add(e.node);this.selectedNode=[...this._selectedNodes].at(-1),this.#x(e),this.requestUpdate()}deselectAll(){let e=new Set(this._selectedNodes);this.#b(),this.#x(e),this.requestUpdate()}selectMany(e){let n=new Set(this._selectedNodes);this._selectedNodes=new Set([...e].filter(e=>this.#y(e))),this.selectedNode=[...this._selectedNodes].at(-1),this.#x(n),this.requestUpdate()}zoomTo(e){if(this._zoomKey===e.item.key)return;this.#c=this.#w(e.item.key),this.#S(e.item.key),this.tickled.clearTickled();let n=QI(this.#u,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.#c=this.#w(void 0);let e=this.focusedNode,n=this._zoomKey===void 0?void 0:QI(this.#u,this._zoomKey),r=n===void 0?-1:n.length-2;this.#S(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()}#S(e){this._zoomKey=e,this.#e.zoomed(e)}#C(e,n){if(this._zoomKey=e,!n)return;let r=e===void 0?void 0:QI(this.#u,e);this.dispatchEvent(new CustomEvent(`zoom`,{detail:{node:r?.at(-1),depth:r===void 0?-1:r.length-2},bubbles:!0,composed:!0}))}#w(e){if(typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;if(e!==void 0){let n=this.#d().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.#f(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}}}#T(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})}#E(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.#u;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.#u;if(!n?.children)return!1;let r=this.#A(n.children,e);return r?this.navigateTo(r):!1}revealKey(e){let n=this.#u;if(!n?.children)return!1;let r=this.#A(n.children,n=>n.item.key===e);if(!r)return!1;if(r.length>this.maxDepth){let e=this.#k(r.slice(0,r.length-this.maxDepth));e&&this.zoomTo(e)}return this.#D(e),this.requestUpdate(),!0}#D(e){this.tickled.setTickled(e),this.#e.keyboardCursorMoved()}#O(e){let n=this.tickled.tickledId;this.tickled.handlePointerEnter(e),this.tickled.tickledId!==n&&this.#e.pointerCursorMoved()}#k(e){let n=this.#u;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}#A(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.#A(i.children,n,e);if(r)return r}}}getNodes(){return this.#d().map(e=>({node:e.node,depth:e.depth}))}getViewState(e){return this.#e.get(e)}setViewState(e){this.#e.set(e),this.requestUpdate()}clearPendingViewState(){this.#e.clearPending()}#j(e,n){return!this.filterPredicate||this.filterPredicate(e,n)?!0:e.children?.some(e=>this.#j(e,n+1))??!1}#M(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}#N(e,n){let r=this.#d(),i=this.#M(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.#M(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))}#P(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.#y(e.node)){let n=new Set(this._selectedNodes);this._selectedNodes.add(e.node),this.selectedNode=e.node,this.#x(n),this.requestUpdate()}this.#i=n}else if(this.interactionMode===`standard`&&r.shiftKey&&this.#i!==void 0){let e=this.#d(),r=Math.min(this.#i,n),i=Math.max(this.#i,n),a=new Set(this._selectedNodes);this._selectedNodes=new Set(e.slice(r,i+1).map(e=>e.node).filter(e=>this.#y(e))),this.selectedNode=[...this._selectedNodes].at(-1),this.#x(a),this.requestUpdate()}else this.interactionMode!==`manual`&&(this.select(e.node),this.#i=n);this.tickled.setTickled(e.node.item.key),this.#E(e.node)&&this.zoomTo(e.node)}#F(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}))}#I(e){if(this.disableKeyboardNavigation)return;let n=this.#d();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.#D(n.node.item.key),this.interactionMode===`implicit`&&this.select(n.node))};switch(e.key){case`ArrowLeft`:o(a?this.#N(a,`left`):n[0]);return;case`ArrowRight`:o(a?this.#N(a,`right`):n[0]);return;case`ArrowUp`:o(a?this.#N(a,`up`):n[0]);return;case`ArrowDown`:o(a?this.#N(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.#E(a.node)&&this.zoomTo(a.node);return;case`Backspace`:case`Escape`:this._zoomKey!==void 0&&(e.preventDefault(),this.zoomOut())}}#L(e){if(!e.metaKey||e.deltaY===0||(e.preventDefault(),performance.now()<this.#l))return;if(e.deltaY>0){if(this._zoomKey===void 0)return;this.#l=performance.now()+260,this.#R();return}let n=(e.target?.closest(`.tile`))?.getAttribute(`data-key`)??void 0;if(n===void 0)return;let r=this.#d().find(e=>e.node.item.key===n);r&&this.#E(r.node)&&(this.#l=performance.now()+260,this.zoomTo(r.node))}#R(){let e=this._zoomKey===void 0?void 0:QI(this.#u,this._zoomKey),n=e&&e.length>2?e[e.length-2]:void 0;n?this.zoomTo(n):this.zoomOut()}#z(){let e=this.focusedNode;return e===void 0?a:i`
|
|
14216
|
+
`}};E([d({type:String})],VI.prototype,`text`,void 0),E([d({type:String})],VI.prototype,`effect`,void 0),E([d({type:Number})],VI.prototype,`duration`,void 0),E([d({type:String})],VI.prototype,`easing`,void 0),E([m()],VI.prototype,`_currentText`,void 0),E([m()],VI.prototype,`_outgoingText`,void 0),E([m()],VI.prototype,`_activeEffect`,void 0),E([m()],VI.prototype,`_transitionId`,void 0),VI=E([T(`ixfx-transitory-label`)],VI);var HI=class{#e;#t;#n;#r=/* @__PURE__ */ new WeakMap;#i=/* @__PURE__ */ new Map;#a=/* @__PURE__ */ new Map;#o=/* @__PURE__ */ 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=/* @__PURE__ */ 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=/* @__PURE__ */ 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 UI(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:0}function WI(e,n){if(e){if(e.item.key===n)return e;for(let r of e.children??[]){let e=WI(r,n);if(e)return e}}}function GI(e,n){if(e){if(e.item.key===n)return[e];for(let r of e.children??[]){let i=GI(r,n);if(i)return[e,...i]}}}function KI(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 qI(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=KI(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=KI(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 JI(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?Math.min(e,1):0}function YI(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=qI(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 XI(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?JI(l):0,p=d?JI(u):0,m=e=>{let n=e.children??[];return s?n.filter(e=>e.item.isLeaf!==!0):n},h=a===void 0?e:WI(e,a)??e,g=GI(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=YI(n,e.map(e=>UI(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}function ZI(e){let n=/* @__PURE__ */ new Map;if(!e)return n;let r=(e,i,a)=>{n.has(e.item.key)||n.set(e.item.key,{node:e,parentKey:i,depth:a});for(let n of e.children??[])r(n,e.item.key,a+1)};return r(e,void 0,-1),n}function QI(e,n){let r=[];for(let i=e.get(n);i!==void 0;i=i.parentKey===void 0?void 0:e.get(i.parentKey)){if(i.parentKey===void 0)return r;r.unshift(i.node.item.key)}}function $I(e,n){let r=n.at(-1);if(r===void 0)return{kind:`found`,key:void 0};if(e.has(r))return{kind:`found`,key:r};for(let r=n.length-2;r>=0;r--){let i=e.get(n[r]);if(!i)continue;let{node:a,depth:o}=i;return a.children===void 0&&a.item.isLeaf!==!0?{kind:`load`,node:a,depth:o}:{kind:`missing`}}return{kind:`missing`}}function eL(e){let{index:n}=e,r,i=e.pendingZoom;if(e.zoomKey!==void 0&&!n.has(e.zoomKey))i??=e.zoomPath,r={key:void 0,path:[],restored:!1};else if(e.zoomKey!==void 0){let i=QI(n,e.zoomKey)??e.zoomPath;tL(i,e.zoomPath)||(r={key:e.zoomKey,path:i,restored:!1})}if(i){let e=$I(n,i);if(e.kind===`found`){let a=e.key;r={key:a,path:a===void 0?[]:QI(n,a)??i,restored:!0},i=void 0}}let a=eT(e.selected,e.pendingSelected,e=>n.get(e)?.node,e.canSelect,e.singleSelect);return{zoom:r,pendingZoom:i,selection:a}}function tL(e,n){return e.length===n.length&&e.every((e,r)=>e===n[r])}function nL(e){let{controller:n}=e,r=[],i,a=O,o,s=!1,c=0,l=-1,u,d=()=>(u?.version!==c&&(u={version:c,index:ZI(e.root())}),u.index),f=()=>s?e.tickled():void 0,p=(i,a,o)=>{r=a,e.zoomKey()!==i&&(e.setZoom(i,o),n.notify())},m=r=>{let i=tT(f(),o,e=>r.has(e),e.isVisible);o=i.pending;let a=e.tickled();(i.clear||a!==void 0&&!r.has(a))&&e.setTickled(void 0),i.apply!==void 0&&(e.setTickled(i.apply),s=!0,n.notify())},h=()=>{if(l=c,!e.root())return;let o=d();n.restoring(()=>{let n=eL({index:o,zoomKey:e.zoomKey(),zoomPath:r,pendingZoom:i,selected:e.selected(),pendingSelected:a,canSelect:e.canSelect,singleSelect:e.singleSelect()});i=n.pendingZoom,n.zoom&&p(n.zoom.key,n.zoom.path,n.zoom.restored);let s=n.selection;if(s.changed){a=s.pending;let n=e.selectedNode()?.item.key,r=[...s.selected].find(e=>e.item.key===n)??[...s.selected].at(-1);e.setSelection(s.selected,r,s.restored)}m(o)})};return{invalidate(){c++},reconcileIfNeeded(e){e&&c++,l!==c&&h()},zoomed(e){i=void 0,r=e===void 0?[]:QI(d(),e)??[e],n.notify()},selectionChanged(){n.isRestoring||(a=O),n.notify()},clearPendingSelection(){a=O},keyboardCursorMoved(){s=!0,o=void 0,n.notify()},pointerCursorMoved(){s&&(s=!1,n.notify())},get(s){let c=s?.includePending??!0;return n.shape({selected:pr([...e.selected()].map(e=>e.item.key),c?a:[]),focus:f()??(c?o:void 0),zoom:[...(c?i:void 0)??r]},s)},set(r){n.accepts(r)&&n.restoring(()=>{r.selected&&(a=cr(new Set(r.selected)),e.selected().size>0&&e.setSelection(/* @__PURE__ */ new Set,void 0,!0)),r.focus!==void 0&&(o=r.focus);let n=nT(r.zoom);n&&(i=n),h(),n&&i&&p(void 0,[],!0)})},clearPending(){a=O,o=void 0,i=void 0},continueRestoreLoads(){if(!i||!e.restoreLoads()||!e.canLoad())return;let n=$I(d(),i);n.kind===`load`&&!e.isLoading(n.node.item.key)&&e.load(n.node,n.depth)}}}let $=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=/* @__PURE__ */ new Set,this.disableKeyboardNavigation=!1,this.registry=void 0,this._zoomKey=void 0,this.restoreLoads=!0,this.#e=nL({controller:new cy(this,{kind:`treemap-list`,capture:()=>this.getViewState()}),root:()=>this.#u,zoomKey:()=>this._zoomKey,setZoom:(e,n)=>this.#C(e,n),selected:()=>this._selectedNodes,selectedNode:()=>this.selectedNode,canSelect:e=>this.#y(e),singleSelect:()=>this.interactionMode===`implicit`,setSelection:(e,n,r)=>{let i=this._selectedNodes;this._selectedNodes=new Set(e),this.selectedNode=n,r&&this.#x(i)},tickled:()=>this.tickled.tickledId,setTickled:e=>e===void 0?this.tickled.clearTickled():this.tickled.setTickled(e),isVisible:e=>this.#d().some(n=>n.node.item.key===e),restoreLoads:()=>this.restoreLoads,canLoad:()=>this.model!==void 0||this.loadChildren!==void 0,isLoading:e=>this.#n.has(e),load:(e,n)=>void this.#v(e,n)}),this.search=new Ht(this,{adapter:Gt(this,{labelSelector:`.treemap-label`,highlightKey:`incr-search-highlight`})}),this.tickled=new oe(this,{getItems:()=>this.#d().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.#d().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.#n=/* @__PURE__ */ new Set,this.#r=/* @__PURE__ */ new Map,this.#l=0}get selectedNodes(){return this._selectedNodes}get focusedNode(){if(this._zoomKey!==void 0)return WI(this.#u,this._zoomKey)}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;get#u(){return this.model?.root??this.root}#d(){return this.#f(this._zoomKey)}#f(e){return XI(this.#u,{valueAccessor:this.valueAccessor,maxDepth:this.maxDepth,zoomKey:e,tilingMethod:this.tilingMethod,hideLeaves:this.hideLeaves,presentation:this.presentation,...this.#p()})}#p(){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.#a=Xt();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.#h(),typeof ResizeObserver<`u`&&(this.#s=new ResizeObserver(()=>this.requestUpdate()),this.#s.observe(this))}disconnectedCallback(){super.disconnectedCallback(),this.#t?.(),this.#t=void 0;for(let e of this.#r.values())e.abort();this.#r.clear(),this.#n.clear(),this.#s?.disconnect(),this.#s=void 0,this.#a&&(this.#a.unregister(`select-all`),this.#a.unregister(`deselect-all`),this.#a=void 0,this.registry=void 0)}#m(){let e=this.searchModes?.trim();if(e===void 0)return[...Bt];let n=new Set(e.split(/\s+/));return Bt.filter(e=>n.has(e))}#h(){this.#a&&(this.search.setModes(this.#m()),this.#o?.(),this.#o=zt(this.#a,this.search))}willUpdate(e){(e.has(`root`)&&this.root||e.has(`model`))&&this.#g(),this.#e.reconcileIfNeeded(this._zoomKey!==void 0&&!WI(this.#u,this._zoomKey))}updated(e){if(e.has(`model`)&&(this.#t?.(),this.#t=void 0,this.model&&(this.#t=this.model._subscribe(e=>{e.type===`root`?this.#g():e.type===`invalidate`&&this.#e.invalidate(),this.requestUpdate()}))),e.has(`interactionMode`)&&e.get(`interactionMode`)!==void 0&&(this.#i=void 0,this.clearSelection()),e.has(`searchModes`)&&this.#h(),this.#_(),this.#e.continueRestoreLoads(),this.#c){let e=this.#c;this.#c=void 0,this.#T(e)}}#g(){this.#c=void 0,this.#i=void 0,this.#e.invalidate()}#_(){if(this.model||this.loadChildren)for(let e of this.#d()){let{node:n}=e;n.children!==void 0||this.#n.has(n.item.key)||this.#v(n,e.depth)}}async#v(e,n){let r=e.item.key;this.#n.add(r);let i=new AbortController;this.#r.set(r,i),this.requestUpdate();try{let r;if(r=this.model?await this.model.getChildren(e,n,i.signal):[...await Pv(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.#n.delete(r),this.#r.delete(r),i.signal.aborted||(this.#e.invalidate(),this.requestUpdate())}}#y(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}#b(){this._selectedNodes.clear(),this.selectedNode=void 0}#x(e){this.#e.selectionChanged(),this.dispatchEvent(new CustomEvent(`select`,{detail:{selected:new Set(this._selectedNodes),previous:e},bubbles:!0,composed:!0}))}select(e){if(!this.#y(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.clear(),this._selectedNodes.add(e),this.selectedNode=e,this.#x(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.#x(n),this.requestUpdate()}clearSelection(){if(this.#e.clearPendingSelection(),this._selectedNodes.size===0)return;let e=new Set(this._selectedNodes);this.#b(),this.#x(e),this.requestUpdate()}selectAll(){let e=new Set(this._selectedNodes);for(let e of this.#d())this.#y(e.node)&&this._selectedNodes.add(e.node);this.selectedNode=[...this._selectedNodes].at(-1),this.#x(e),this.requestUpdate()}deselectAll(){let e=new Set(this._selectedNodes);this.#b(),this.#x(e),this.requestUpdate()}selectMany(e){let n=new Set(this._selectedNodes);this._selectedNodes=new Set([...e].filter(e=>this.#y(e))),this.selectedNode=[...this._selectedNodes].at(-1),this.#x(n),this.requestUpdate()}zoomTo(e){if(this._zoomKey===e.item.key)return;this.#c=this.#w(e.item.key),this.#S(e.item.key),this.tickled.clearTickled();let n=GI(this.#u,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.#c=this.#w(void 0);let e=this.focusedNode,n=this._zoomKey===void 0?void 0:GI(this.#u,this._zoomKey),r=n===void 0?-1:n.length-2;this.#S(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()}#S(e){this._zoomKey=e,this.#e.zoomed(e)}#C(e,n){if(this._zoomKey=e,!n)return;let r=e===void 0?void 0:GI(this.#u,e);this.dispatchEvent(new CustomEvent(`zoom`,{detail:{node:r?.at(-1),depth:r===void 0?-1:r.length-2},bubbles:!0,composed:!0}))}#w(e){if(typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;if(e!==void 0){let n=this.#d().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.#f(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}}}#T(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})}#E(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.#u;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.#u;if(!n?.children)return!1;let r=this.#A(n.children,e);return r?this.navigateTo(r):!1}revealKey(e){let n=this.#u;if(!n?.children)return!1;let r=this.#A(n.children,n=>n.item.key===e);if(!r)return!1;if(r.length>this.maxDepth){let e=this.#k(r.slice(0,r.length-this.maxDepth));e&&this.zoomTo(e)}return this.#D(e),this.requestUpdate(),!0}#D(e){this.tickled.setTickled(e),this.#e.keyboardCursorMoved()}#O(e){let n=this.tickled.tickledId;this.tickled.handlePointerEnter(e),this.tickled.tickledId!==n&&this.#e.pointerCursorMoved()}#k(e){let n=this.#u;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}#A(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.#A(i.children,n,e);if(r)return r}}}getNodes(){return this.#d().map(e=>({node:e.node,depth:e.depth}))}getViewState(e){return this.#e.get(e)}setViewState(e){this.#e.set(e),this.requestUpdate()}clearPendingViewState(){this.#e.clearPending()}#j(e,n){return!this.filterPredicate||this.filterPredicate(e,n)?!0:e.children?.some(e=>this.#j(e,n+1))??!1}#M(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}#N(e,n){let r=this.#d(),i=this.#M(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.#M(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))}#P(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.#y(e.node)){let n=new Set(this._selectedNodes);this._selectedNodes.add(e.node),this.selectedNode=e.node,this.#x(n),this.requestUpdate()}this.#i=n}else if(this.interactionMode===`standard`&&r.shiftKey&&this.#i!==void 0){let e=this.#d(),r=Math.min(this.#i,n),i=Math.max(this.#i,n),a=new Set(this._selectedNodes);this._selectedNodes=new Set(e.slice(r,i+1).map(e=>e.node).filter(e=>this.#y(e))),this.selectedNode=[...this._selectedNodes].at(-1),this.#x(a),this.requestUpdate()}else this.interactionMode!==`manual`&&(this.select(e.node),this.#i=n);this.tickled.setTickled(e.node.item.key),this.#E(e.node)&&this.zoomTo(e.node)}#F(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}))}#I(e){if(this.disableKeyboardNavigation)return;let n=this.#d();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.#D(n.node.item.key),this.interactionMode===`implicit`&&this.select(n.node))};switch(e.key){case`ArrowLeft`:o(a?this.#N(a,`left`):n[0]);return;case`ArrowRight`:o(a?this.#N(a,`right`):n[0]);return;case`ArrowUp`:o(a?this.#N(a,`up`):n[0]);return;case`ArrowDown`:o(a?this.#N(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.#E(a.node)&&this.zoomTo(a.node);return;case`Backspace`:case`Escape`:this._zoomKey!==void 0&&(e.preventDefault(),this.zoomOut())}}#L(e){if(!e.metaKey||e.deltaY===0||(e.preventDefault(),performance.now()<this.#l))return;if(e.deltaY>0){if(this._zoomKey===void 0)return;this.#l=performance.now()+260,this.#R();return}let n=(e.target?.closest(`.tile`))?.getAttribute(`data-key`)??void 0;if(n===void 0)return;let r=this.#d().find(e=>e.node.item.key===n);r&&this.#E(r.node)&&(this.#l=performance.now()+260,this.zoomTo(r.node))}#R(){let e=this._zoomKey===void 0?void 0:GI(this.#u,this._zoomKey),n=e&&e.length>2?e[e.length-2]:void 0;n?this.zoomTo(n):this.zoomOut()}#z(){let e=this.focusedNode;return e===void 0?a:i`
|
|
14216
14217
|
<nav class="breadcrumb" part="breadcrumb" aria-label="Treemap zoom path">
|
|
14217
14218
|
<ixfx-crumb-navigation
|
|
14218
14219
|
with-up
|
|
@@ -14434,7 +14435,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
14434
14435
|
color: var(--surface-muted-text);
|
|
14435
14436
|
font-size: var(--text-s);
|
|
14436
14437
|
}
|
|
14437
|
-
`]}};E([d({type:Object})],$.prototype,`root`,void 0),E([d({attribute:!1})],$.prototype,`model`,void 0),E([d({attribute:!1})],$.prototype,`loadChildren`,void 0),E([d({reflect:!0,attribute:`exclusivity`})],$.prototype,`exclusivity`,void 0),E([d({reflect:!0,attribute:`selection-filter`})],$.prototype,`selectionFilter`,void 0),E([d({type:String,attribute:`interaction-mode`})],$.prototype,`interactionMode`,void 0),E([d({type:String,attribute:`tiling-method`})],$.prototype,`tilingMethod`,void 0),E([d({type:String,attribute:`presentation`})],$.prototype,`presentation`,void 0),E([d({type:Number,attribute:`cascade-offset`})],$.prototype,`cascadeOffset`,void 0),E([d({type:Number,attribute:`max-depth`})],$.prototype,`maxDepth`,void 0),E([d({type:Boolean,attribute:`hide-leaves`})],$.prototype,`hideLeaves`,void 0),E([d({type:Number,attribute:`min-label-area`})],$.prototype,`minLabelArea`,void 0),E([d({type:Number,attribute:`min-tile-width`})],$.prototype,`minTileWidth`,void 0),E([d({type:Number})],$.prototype,`padding`,void 0),E([d({type:Number,attribute:`min-child-area`})],$.prototype,`minChildArea`,void 0),E([d({attribute:!1})],$.prototype,`valueAccessor`,void 0),E([d({attribute:!1})],$.prototype,`categoryAccessor`,void 0),E([d({attribute:!1})],$.prototype,`selectedNode`,void 0),E([m()],$.prototype,`_selectedNodes`,void 0),E([d({attribute:!1})],$.prototype,`filterPredicate`,void 0),E([d({type:Boolean,attribute:`disable-keyboard-navigation`})],$.prototype,`disableKeyboardNavigation`,void 0),E([d({attribute:!1})],$.prototype,`registry`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],$.prototype,`searchModes`,void 0),E([m()],$.prototype,`_zoomKey`,void 0),E([d({attribute:!1})],$.prototype,`restoreLoads`,void 0),$=E([T(`ixfx-treemap-list`)],$);let uL=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.#m=new cy(this,{kind:`twosplit-layout`,capture:()=>this.getViewState()}),this.#D=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.#O),window.addEventListener(`pointermove`,this.#k)},this.#O=e=>{e.preventDefault();let n=this.getZone();n&&n.classList.remove(`user-resizing`),window.removeEventListener(`pointerup`,this.#O),window.removeEventListener(`pointermove`,this.#k),(this.sizeA!==this.#t||this.sizeB!==this.#n)&&this.#m.notify()},this.#k=e=>{let n=this.#e;if(n){if(this.layout===`horizontal`){let r=Ei((e.y-n.y)/n.height);if(this.collapsible&&this.collapsedA){if(r>(this.#d??.05)+this.#p){this.collapsedA=!1,this.#g(`A`,!1),this.#d=void 0;let{sizeA:e,sizeB:i}=this.#S(`${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.#g(`A`,!0),this.sizeA=`0px`,this.sizeB=`100%`,this.#d=r;else if(!this.collapsedA){let{sizeA:e,sizeB:i}=this.#S(`${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.#g(`B`,!1),this.#f=void 0;let{sizeA:e,sizeB:i}=this.#S(`${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.#g(`B`,!0),this.sizeA=`100%`,this.sizeB=`0px`,this.#f=r)}else{let r=Ei((e.x-n.x)/n.width);if(this.collapsible&&this.collapsedA){if(r>(this.#d??.05)+this.#p){this.collapsedA=!1,this.#g(`A`,!1),this.#d=void 0;let{sizeA:e,sizeB:i}=this.#S(`${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.#g(`A`,!0),this.sizeA=`0px`,this.sizeB=`100%`,this.#d=r;else if(!this.collapsedA){let{sizeA:e,sizeB:i}=this.#S(`${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.#g(`B`,!1),this.#f=void 0;let{sizeA:e,sizeB:i}=this.#S(`${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.#g(`B`,!0),this.sizeA=`100%`,this.sizeB=`0px`,this.#f=r)}e.preventDefault()}},this.#A=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.#y();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.#j),window.addEventListener(`pointermove`,this.#N)},this.#j=e=>{e.preventDefault();let n=this.getZone();n&&n.classList.remove(`user-resizing`);let r=this.#y();if(r){let e=r.getZone();e&&e.classList.remove(`user-resizing`),#m in r&&r.sizeA!==this.#a&&r.#m.notify()}window.removeEventListener(`pointerup`,this.#j),window.removeEventListener(`pointermove`,this.#N),(this.sizeA!==this.#t||this.sizeB!==this.#n)&&this.#m.notify()},this.#N=e=>{let n=this.#e,r=this.getZone(),i=this.#y();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.#S(`${e*100}%`,`${(1-e)*100}%`,n.width);e=this.#b(i,n.width),this.sizeA=i,this.sizeB=a,this.#u={sizeA:r,sizeB:1-r},requestAnimationFrame(()=>this.#M());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.#S(`${r*100}%`,`${(1-r)*100}%`,n.height);r=this.#b(i,n.height),this.sizeA=i,this.sizeB=a,this.#u={sizeA:e,sizeB:1-e},requestAnimationFrame(()=>this.#M());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;#m;disconnectedCallback(){super.disconnectedCallback(),this.#l?.disconnect()}firstUpdated(){this.#_()}updated(e){(e.has(`sizeA`)||e.has(`sizeB`)||e.has(`collapsedA`)||e.has(`collapsedB`))&&this.#E(),(e.has(`sizeA`)||e.has(`sizeB`)||e.has(`collapsedA`)||e.has(`collapsedB`))&&this.#h()}#h(){this.collapsedA?this.setAttribute(`data-collapsed-a`,``):this.removeAttribute(`data-collapsed-a`),this.collapsedB?this.setAttribute(`data-collapsed-b`,``):this.removeAttribute(`data-collapsed-b`)}#g(e,n){this.dispatchEvent(new CustomEvent(`ixfx-split-collapsed`,{detail:{panel:e,collapsed:n},bubbles:!0,composed:!0}))}#_(){let e=this.shadowRoot?.querySelector(`slot[name="a"]`);e&&(this.#l=new MutationObserver(()=>{this.#v()}),this.#l.observe(e,{characterData:!0,childList:!0,subtree:!0}),this.#v())}#v(){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.#E())):(this.#o=void 0,this._hasCorner=!1)}#y(){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`)}#b(e,n){return e.endsWith(`px`)?Number.parseFloat(e.replace(`px`,``))/n:e.endsWith(`%`)?Number.parseFloat(e.replace(`%`,``))/100:.5}#x(e,n){return e.endsWith(`px`)?Number.parseFloat(e.replace(`px`,``)):e.endsWith(`%`)?Number.parseFloat(e.replace(`%`,``))/100*n:null}#S(e,n,r){let i=this.#b(e,r),a=this.#b(n,r),o=this.#C(this.minSizeA,r),s=this.#C(this.minSizeB,r),c=this.#w(this.maxSizeA,r),l=this.#w(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`}}#C(e,n){if(e.length===0)return null;let r=this.#x(e,n);return r===null?e.endsWith(`%`)?Number.parseFloat(e.replace(`%`,``))/100:null:r/n}#w(e,n){if(e.length===0)return null;let r=this.#x(e,n);return r===null?e.endsWith(`%`)?Number.parseFloat(e.replace(`%`,``))/100:null:r/n}#T(){let e=this.getBoundingClientRect(),n=this.getZone();if(!n)return null;let r=this.#y();if(!r)return null;n.getBoundingClientRect();let i=this.#b(this.sizeA||`50%`,e.width),a,o;if(this.layout===`vertical`&&r.layout===`horizontal`)a=i*e.width,o=this.#b(r.sizeA||`50%`,e.height)*e.height;else if(this.layout===`horizontal`&&r.layout===`vertical`)a=this.#b(r.sizeA||`50%`,e.width)*e.width,o=i*e.height;else return null;return{x:a,y:o}}#E(){if(!this._hasCorner)return;let e=this.shadowRoot?.querySelector(`.corner-zone`);if(!e||!this.getZone())return;let n=this.#T();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.#y();a&&(this.layout===`vertical`&&a.layout===`horizontal`?e.style.cursor=`nwse-resize`:this.layout===`horizontal`&&a.layout===`vertical`&&(e.style.cursor=`nesw-resize`))}getViewState(e){return this.#m.shape({layout:{a:dL(this.sizeA,this.collapsedA),b:dL(this.sizeB,this.collapsedB)}},e)}setViewState(e){if(!this.#m.accepts(e)||!e.layout)return;let{a:n,b:r}=e.layout;this.#m.restoring(()=>{typeof n?.size==`string`&&(this.sizeA=n.size,this.collapsedA=n.collapsed===!0),typeof r?.size==`string`&&(this.sizeB=r.size,this.collapsedB=r.collapsed===!0),this.#m.notify()})}clearPendingViewState(){}getZone(){if(!this.shadowRoot)return;let e=this.shadowRoot.querySelector(`#zone`);if(e)return e}#D;#O;#k;#A;#j;#M(){if(!this.#u)return;let{sizeA:e,sizeB:n}=this.#u,r=this.#y();r&&(r.sizeA=`${e*100}%`,r.sizeB=`${n*100}%`),this.#u=null}#N;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`
|
|
14438
|
+
`]}};E([d({type:Object})],$.prototype,`root`,void 0),E([d({attribute:!1})],$.prototype,`model`,void 0),E([d({attribute:!1})],$.prototype,`loadChildren`,void 0),E([d({reflect:!0,attribute:`exclusivity`})],$.prototype,`exclusivity`,void 0),E([d({reflect:!0,attribute:`selection-filter`})],$.prototype,`selectionFilter`,void 0),E([d({type:String,attribute:`interaction-mode`})],$.prototype,`interactionMode`,void 0),E([d({type:String,attribute:`tiling-method`})],$.prototype,`tilingMethod`,void 0),E([d({type:String,attribute:`presentation`})],$.prototype,`presentation`,void 0),E([d({type:Number,attribute:`cascade-offset`})],$.prototype,`cascadeOffset`,void 0),E([d({type:Number,attribute:`max-depth`})],$.prototype,`maxDepth`,void 0),E([d({type:Boolean,attribute:`hide-leaves`})],$.prototype,`hideLeaves`,void 0),E([d({type:Number,attribute:`min-label-area`})],$.prototype,`minLabelArea`,void 0),E([d({type:Number,attribute:`min-tile-width`})],$.prototype,`minTileWidth`,void 0),E([d({type:Number})],$.prototype,`padding`,void 0),E([d({type:Number,attribute:`min-child-area`})],$.prototype,`minChildArea`,void 0),E([d({attribute:!1})],$.prototype,`valueAccessor`,void 0),E([d({attribute:!1})],$.prototype,`categoryAccessor`,void 0),E([d({attribute:!1})],$.prototype,`selectedNode`,void 0),E([m()],$.prototype,`_selectedNodes`,void 0),E([d({attribute:!1})],$.prototype,`filterPredicate`,void 0),E([d({type:Boolean,attribute:`disable-keyboard-navigation`})],$.prototype,`disableKeyboardNavigation`,void 0),E([d({attribute:!1})],$.prototype,`registry`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],$.prototype,`searchModes`,void 0),E([m()],$.prototype,`_zoomKey`,void 0),E([d({attribute:!1})],$.prototype,`restoreLoads`,void 0),$=E([T(`ixfx-treemap-list`)],$);let rL=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.#m=new cy(this,{kind:`twosplit-layout`,capture:()=>this.getViewState()}),this.#D=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.#O),window.addEventListener(`pointermove`,this.#k)},this.#O=e=>{e.preventDefault();let n=this.getZone();n&&n.classList.remove(`user-resizing`),window.removeEventListener(`pointerup`,this.#O),window.removeEventListener(`pointermove`,this.#k),(this.sizeA!==this.#t||this.sizeB!==this.#n)&&this.#m.notify()},this.#k=e=>{let n=this.#e;if(n){if(this.layout===`horizontal`){let r=Ei((e.y-n.y)/n.height);if(this.collapsible&&this.collapsedA){if(r>(this.#d??.05)+this.#p){this.collapsedA=!1,this.#g(`A`,!1),this.#d=void 0;let{sizeA:e,sizeB:i}=this.#S(`${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.#g(`A`,!0),this.sizeA=`0px`,this.sizeB=`100%`,this.#d=r;else if(!this.collapsedA){let{sizeA:e,sizeB:i}=this.#S(`${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.#g(`B`,!1),this.#f=void 0;let{sizeA:e,sizeB:i}=this.#S(`${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.#g(`B`,!0),this.sizeA=`100%`,this.sizeB=`0px`,this.#f=r)}else{let r=Ei((e.x-n.x)/n.width);if(this.collapsible&&this.collapsedA){if(r>(this.#d??.05)+this.#p){this.collapsedA=!1,this.#g(`A`,!1),this.#d=void 0;let{sizeA:e,sizeB:i}=this.#S(`${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.#g(`A`,!0),this.sizeA=`0px`,this.sizeB=`100%`,this.#d=r;else if(!this.collapsedA){let{sizeA:e,sizeB:i}=this.#S(`${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.#g(`B`,!1),this.#f=void 0;let{sizeA:e,sizeB:i}=this.#S(`${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.#g(`B`,!0),this.sizeA=`100%`,this.sizeB=`0px`,this.#f=r)}e.preventDefault()}},this.#A=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.#y();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.#j),window.addEventListener(`pointermove`,this.#N)},this.#j=e=>{e.preventDefault();let n=this.getZone();n&&n.classList.remove(`user-resizing`);let r=this.#y();if(r){let e=r.getZone();e&&e.classList.remove(`user-resizing`),#m in r&&r.sizeA!==this.#a&&r.#m.notify()}window.removeEventListener(`pointerup`,this.#j),window.removeEventListener(`pointermove`,this.#N),(this.sizeA!==this.#t||this.sizeB!==this.#n)&&this.#m.notify()},this.#N=e=>{let n=this.#e,r=this.getZone(),i=this.#y();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.#S(`${e*100}%`,`${(1-e)*100}%`,n.width);e=this.#b(i,n.width),this.sizeA=i,this.sizeB=a,this.#u={sizeA:r,sizeB:1-r},requestAnimationFrame(()=>this.#M());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.#S(`${r*100}%`,`${(1-r)*100}%`,n.height);r=this.#b(i,n.height),this.sizeA=i,this.sizeB=a,this.#u={sizeA:e,sizeB:1-e},requestAnimationFrame(()=>this.#M());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;#m;disconnectedCallback(){super.disconnectedCallback(),this.#l?.disconnect()}firstUpdated(){this.#_()}updated(e){(e.has(`sizeA`)||e.has(`sizeB`)||e.has(`collapsedA`)||e.has(`collapsedB`))&&this.#E(),(e.has(`sizeA`)||e.has(`sizeB`)||e.has(`collapsedA`)||e.has(`collapsedB`))&&this.#h()}#h(){this.collapsedA?this.setAttribute(`data-collapsed-a`,``):this.removeAttribute(`data-collapsed-a`),this.collapsedB?this.setAttribute(`data-collapsed-b`,``):this.removeAttribute(`data-collapsed-b`)}#g(e,n){this.dispatchEvent(new CustomEvent(`ixfx-split-collapsed`,{detail:{panel:e,collapsed:n},bubbles:!0,composed:!0}))}#_(){let e=this.shadowRoot?.querySelector(`slot[name="a"]`);e&&(this.#l=new MutationObserver(()=>{this.#v()}),this.#l.observe(e,{characterData:!0,childList:!0,subtree:!0}),this.#v())}#v(){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.#E())):(this.#o=void 0,this._hasCorner=!1)}#y(){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`)}#b(e,n){return e.endsWith(`px`)?Number.parseFloat(e.replace(`px`,``))/n:e.endsWith(`%`)?Number.parseFloat(e.replace(`%`,``))/100:.5}#x(e,n){return e.endsWith(`px`)?Number.parseFloat(e.replace(`px`,``)):e.endsWith(`%`)?Number.parseFloat(e.replace(`%`,``))/100*n:null}#S(e,n,r){let i=this.#b(e,r),a=this.#b(n,r),o=this.#C(this.minSizeA,r),s=this.#C(this.minSizeB,r),c=this.#w(this.maxSizeA,r),l=this.#w(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`}}#C(e,n){if(e.length===0)return null;let r=this.#x(e,n);return r===null?e.endsWith(`%`)?Number.parseFloat(e.replace(`%`,``))/100:null:r/n}#w(e,n){if(e.length===0)return null;let r=this.#x(e,n);return r===null?e.endsWith(`%`)?Number.parseFloat(e.replace(`%`,``))/100:null:r/n}#T(){let e=this.getBoundingClientRect(),n=this.getZone();if(!n)return null;let r=this.#y();if(!r)return null;n.getBoundingClientRect();let i=this.#b(this.sizeA||`50%`,e.width),a,o;if(this.layout===`vertical`&&r.layout===`horizontal`)a=i*e.width,o=this.#b(r.sizeA||`50%`,e.height)*e.height;else if(this.layout===`horizontal`&&r.layout===`vertical`)a=this.#b(r.sizeA||`50%`,e.width)*e.width,o=i*e.height;else return null;return{x:a,y:o}}#E(){if(!this._hasCorner)return;let e=this.shadowRoot?.querySelector(`.corner-zone`);if(!e||!this.getZone())return;let n=this.#T();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.#y();a&&(this.layout===`vertical`&&a.layout===`horizontal`?e.style.cursor=`nwse-resize`:this.layout===`horizontal`&&a.layout===`vertical`&&(e.style.cursor=`nesw-resize`))}getViewState(e){return this.#m.shape({layout:{a:iL(this.sizeA,this.collapsedA),b:iL(this.sizeB,this.collapsedB)}},e)}setViewState(e){if(!this.#m.accepts(e)||!e.layout)return;let{a:n,b:r}=e.layout;this.#m.restoring(()=>{typeof n?.size==`string`&&(this.sizeA=n.size,this.collapsedA=n.collapsed===!0),typeof r?.size==`string`&&(this.sizeB=r.size,this.collapsedB=r.collapsed===!0),this.#m.notify()})}clearPendingViewState(){}getZone(){if(!this.shadowRoot)return;let e=this.shadowRoot.querySelector(`#zone`);if(e)return e}#D;#O;#k;#A;#j;#M(){if(!this.#u)return;let{sizeA:e,sizeB:n}=this.#u,r=this.#y();r&&(r.sizeA=`${e*100}%`,r.sizeB=`${n*100}%`),this.#u=null}#N;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`
|
|
14438
14439
|
<div id="zone">
|
|
14439
14440
|
<slot style=${n} name="a"></slot>
|
|
14440
14441
|
${this._hasCorner?i`<div class="corner-zone" @pointerdown=${this.#A}></div>`:``}
|
|
@@ -14558,7 +14559,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
14558
14559
|
:host([data-collapsed-b]) slot[name="b"] {
|
|
14559
14560
|
display: none;
|
|
14560
14561
|
}
|
|
14561
|
-
`]}};E([d({type:String})],
|
|
14562
|
+
`]}};E([d({type:String})],rL.prototype,`layout`,void 0),E([d({type:String})],rL.prototype,`sizeA`,void 0),E([d({type:String})],rL.prototype,`sizeB`,void 0),E([d({type:Boolean})],rL.prototype,`fixedA`,void 0),E([d({type:Boolean})],rL.prototype,`fixedB`,void 0),E([d({type:Boolean})],rL.prototype,`collapsible`,void 0),E([d({type:Boolean,reflect:!0})],rL.prototype,`collapsedA`,void 0),E([d({type:Boolean,reflect:!0})],rL.prototype,`collapsedB`,void 0),E([d({type:String})],rL.prototype,`minSizeA`,void 0),E([d({type:String})],rL.prototype,`maxSizeA`,void 0),E([d({type:String})],rL.prototype,`minSizeB`,void 0),E([d({type:String})],rL.prototype,`maxSizeB`,void 0),E([m()],rL.prototype,`_hasCorner`,void 0),rL=E([T(`ixfx-twosplit-layout`)],rL);function iL(e,n){return n?{size:e,collapsed:n}:{size:e}}const aL=[{id:`B`,label:`B`,factor:1},{id:`KB`,label:`KB`,factor:1024},{id:`MB`,label:`MB`,factor:1024**2},{id:`GB`,label:`GB`,factor:1024**3}],oL=[{id:`minutes`,label:`minutes`,factor:1},{id:`hours`,label:`hours`,factor:60},{id:`days`,label:`days`,factor:1440},{id:`weeks`,label:`weeks`,factor:10080}];function sL(e,n){return e===null?null:e*(n?.factor??1)}function cL(e,n){if(n.length===0)return;let r=[...n].sort((e,n)=>(n.factor??1)-(e.factor??1)),i=r.find(n=>e!==0&&e%(n.factor??1)===0)??r[r.length-1];return{value:e/(i.factor??1),unit:i.id}}let lL=class extends n{constructor(...e){super(...e),this.value=null,this.unit=``,this.units=[],this.placeholder=``,this.disabled=!1,this.#n=e=>{e.stopPropagation();let n=e.target.value,r=n.trim()===``?NaN:Number(n);this.value=Number.isNaN(r)?null:r,this.#t()},this.#r=e=>{e.stopPropagation(),this.unit=e.target.value,this.#t()}}get baseValue(){return sL(this.value,this.#e())}setBaseValue(e){if(e===null){this.value=null;return}let n=cL(e,this.units);n===void 0?this.value=e:(this.value=n.value,this.unit=n.unit)}focus(e){this.shadowRoot?.querySelector(`input`)?.focus(e)}#e(){return this.units.find(e=>e.id===this.unit)??this.units[0]}#t(){this.dispatchEvent(new CustomEvent(`change`,{detail:{value:this.value,unit:this.#e()?.id??``,baseValue:this.baseValue},bubbles:!0,composed:!0}))}#n;#r;render(){let e=this.#e();return i`
|
|
14562
14563
|
<div class="wrap">
|
|
14563
14564
|
<input
|
|
14564
14565
|
type="number"
|
|
@@ -14641,7 +14642,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
14641
14642
|
:host([disabled]) .wrap {
|
|
14642
14643
|
opacity: var(--prominence-disabled-opacity, 0.4);
|
|
14643
14644
|
}
|
|
14644
|
-
`]}};E([d({type:Number})],
|
|
14645
|
+
`]}};E([d({type:Number})],lL.prototype,`value`,void 0),E([d({type:String})],lL.prototype,`unit`,void 0),E([d({attribute:!1})],lL.prototype,`units`,void 0),E([d({type:Number})],lL.prototype,`min`,void 0),E([d({type:Number})],lL.prototype,`max`,void 0),E([d({type:Number})],lL.prototype,`step`,void 0),E([d({type:String})],lL.prototype,`placeholder`,void 0),E([d({type:Boolean,reflect:!0})],lL.prototype,`disabled`,void 0),lL=E([T(`ixfx-unit-input`)],lL);function uL(e){return e instanceof HTMLElement&&`checked`in e}function dL(e){if(typeof e==`string`){let n=document.querySelector(e);if(!(n instanceof HTMLElement))throw TypeError(`Element not found or not HTMLElement: ${e}`);return n}return e}function fL(e,n){let r=dL(e);if(!uL(r))throw Error(`Target element is not a checkbox-like element`);let i=[];for(let e of n){let n=dL(e);uL(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 pL(e,n,r,i){return i===`linear`?(e-n)/(r-n):Math.log(e/n)/Math.log(r/n)}function mL(e,n,r,i){return i===`linear`?n+e*(r-n):n*(r/n)**e}function hL(e,n,r,i){if(!i||i<=1)return e;let a=(r-n)/i;return Math.round((e-n)/a)*a+n}let gL=class extends yC(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=/* @__PURE__ */ 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=vC(n,i,this.stepX,e),s=vC(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=hL(e,this.xMin,this.xMax,i),n=hL(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,dn,r`
|
|
14645
14646
|
:host {
|
|
14646
14647
|
display: block;
|
|
14647
14648
|
width: 200px;
|
|
@@ -14755,7 +14756,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
14755
14756
|
height:100%;
|
|
14756
14757
|
text-align:center;
|
|
14757
14758
|
}
|
|
14758
|
-
`]}_stepYByDelta(e,n){let r=this.yMax-this.yMin,i=this.stopsY??this.stops,a=vC(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=
|
|
14759
|
+
`]}_stepYByDelta(e,n){let r=this.yMax-this.yMin,i=this.stopsY??this.stops,a=vC(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=hL(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=mL(i,this.xMin,this.xMax,this.xScale),s=mL(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=hL(c,this.xMin,this.xMax,u),l=hL(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=pL(e,this.xMin,this.xMax,this.xScale)*100,i=pL(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 pL(Math.max(this.xMin,Math.min(this.xMax,this.x)),this.xMin,this.xMax,this.xScale)}getRelativeY(){return pL(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`
|
|
14759
14760
|
<div class="xy-pad-area"
|
|
14760
14761
|
tabindex=${this.disabled?-1:0}
|
|
14761
14762
|
@pointerdown=${this._onPointerDown}
|
|
@@ -14767,4 +14768,4 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
14767
14768
|
<div class="xy-pad-label-x">${this.xLabel}</div>
|
|
14768
14769
|
<div class="xy-pad-label-y">${this.yLabel}</div>
|
|
14769
14770
|
</div>
|
|
14770
|
-
`}};E([d({type:Number})],CL.prototype,`xMin`,void 0),E([d({type:Number})],CL.prototype,`xMax`,void 0),E([d({type:Number})],CL.prototype,`x`,void 0),E([d({type:Number})],CL.prototype,`yMin`,void 0),E([d({type:Number})],CL.prototype,`yMax`,void 0),E([d({type:Number})],CL.prototype,`y`,void 0),E([d({type:String})],CL.prototype,`xScale`,void 0),E([d({type:String})],CL.prototype,`yScale`,void 0),E([d({type:Number,attribute:`x-snap-step`})],CL.prototype,`xSnapStep`,void 0),E([d({type:Number,attribute:`y-snap-step`})],CL.prototype,`ySnapStep`,void 0),E([d({type:Number,attribute:`step-x`})],CL.prototype,`stepX`,void 0),E([d({type:Number,attribute:`step-y`})],CL.prototype,`stepY`,void 0),E([d({type:String})],CL.prototype,`xLabel`,void 0),E([d({type:String})],CL.prototype,`yLabel`,void 0),E([d({type:Boolean,reflect:!0,attribute:`show-crosshairs`})],CL.prototype,`showCrosshairs`,void 0),E([d({type:Boolean,reflect:!0,attribute:`show-grid`})],CL.prototype,`showGrid`,void 0),E([d({type:Boolean,reflect:!0,attribute:`hide-cursor`})],CL.prototype,`hideCursor`,void 0),E([d({type:Boolean,reflect:!0})],CL.prototype,`disabled`,void 0),E([d({type:Number})],CL.prototype,`stops`,void 0),E([d({type:Number,attribute:`stops-x`})],CL.prototype,`stopsX`,void 0),E([d({type:Number,attribute:`stops-y`})],CL.prototype,`stopsY`,void 0),CL=E([T(`ixfx-xy-pad`)],CL);function wL(){console.log(`Init`)}export{pL as AGE_UNITS,ke as AcTextElement,Jt as AcTokenElement,rn as BottomDrawerElement,pn as ButtonElement,Mr as Checkbox,Wr as CheckedSelect,B as ColourPicker,Nv as ColourPickerPopup,V as CrumbNavigationElement,my as CrumbPathController,gy as CrumbPathElement,gA as DEFAULT_FORCE_OPTIONS,zE as DEFAULT_SIBLING_SPACING,JA as DRAG_THRESHOLD_PX,je as DataController,_y as DataDisplayComponent,H as DataGridElement,cb as DataTableElement,db as DateInputElement,U as DetailListElement,tC as DockHostElement,QS as DockPanelElement,Jk as EASY_CONNECT_MARGIN,lA as EDGE_CORNER_RADIUS,ar as EMPTY_FLAGS,hn as EMPTY_GROUP_LABEL,O as EMPTY_KEYS,hC as EditableLabel,bC as EditableNumber,G as FlatListElement,YC as FormElement,BC as FormGroupElement,HC as FormOptionsElement,WC as FormPartElement,GC as FormRowElement,Y as GraphNodeElement,EA as GraphPortElement,K as GridListElement,vw as GroupedItemListerElement,J as HyperbolicTreeListElement,on as ICON_CARET_RIGHT,sn as ICON_CHECK,an as ICON_CHEVRON_DOWN,cn as ICON_CLOSE,tO as IcicleTreeListElement,Ot as IncrSearchMillerController,Ot as IncrSearchTreeController,IT as IxfxHexEditorElement,Te as IxfxIconElement,Q as IxfxTimelineElement,jt as KeyedElementIndex,Kn as LIST_ITEM_MOTION_MS,Lt as LIST_SEARCH_COMMAND_IDS,Bt as LIST_SEARCH_MODES,yO as LabelledRadialInput,kv as LabelledRangeInput,jO as LabelledSliderInput,MO as LedElement,Gn as ListDragSelectController,wb as ListGroupHeaderElement,rr as ListNativeDragController,Ht as ListSearchController,_r as ListSelectionController,KA as MARQUEE_THRESHOLD_PX,wA as MAX_BLINK_HZ,hj as MAX_FLOW_SPEED,ir as MAX_PENDING_KEYS,qA as MarqueeController,eb as Menu,KO as MillerBaseElement,YO as MillerListElement,XO as MillerTreeController,bk as MulticolListElement,jA as NODE_SHAPES,fy as NarrowedTextElement,YA as NodeDragController,Yj as NodeGraphElement,pM as NotificationManager,Xj as NotificationPillElement,vr as PARTIAL_DESCRIPTION,nb as PanTextElement,oj as PanZoomController,gw as PanelElement,vM as PanelGroupElement,PN as PlotDataSeries,X as PlotHistogram,tP as PlotMultiAxis,fP as PlotSingleAxis,pP as PlotXyAxis,CP as PolarPad,DA as RESIZE_HANDLES,vO as RadialInputElement,mn as RadioGroup,jP as RangeElement,EP as RangeInput,AP as RangeMultiElement,MP as RatingElement,Sr as SCROLL_HOVER_SUPPRESS_ATTR,fL as SIZE_UNITS,GP as SUNBURST_PATH_SEPARATOR,NP as SelectHorizElement,IP as ShapefillValueElement,AO as SliderInputElement,VP as SlidingNumberElement,UP as SnackbarElement,WP as SnapContainer,jr as SplitButton,MS as SplitLayoutElement,jS as SplitPanelElement,Z as SunburstTreeListElement,HF as SwipeElement,WF as TabController,WS as TabListElement,ZS as TabListItemElement,UF as TabPanelElement,GF as TabPanelsElement,KF as TextShimmerElement,oe as TickledController,qF as TimelineController,yI as TimelineTrackTabElement,en as TitlebarElement,qI as ToolbarElement,HI as ToolbarGroupElement,zN as TooltipElement,JI as TransitoryLabelElement,q as TreeBaseElement,YI as TreeController,Xv as TreeDataModel,Nw as TreeDropController,wr as TreeKeyboardNavController,aT as TreeListElement,$ as TreemapListElement,uL as TwoSplitLayoutElement,gL as UnitInputElement,Qv as VIEW_STATE_CHANGE,Zv as VIEW_STATE_VERSION,kC as VerticalListElement,cy as ViewStateController,Hj as WireDragController,CL as XyPad,wx as addPanelToStack,Ok as addWire,iy as anchorFromRow,$n as animateListItemIn,nr as animateListItemOut,NN as applyAgeModification,ne as applyHighlights,oE as applyIsometry,xr as applyPartialAttributes,fS as applySnapshot,Uv as applyTreeDrop,mI as attachTimelineInteractions,hL as bestUnit,ey as bindViewState,TA as blinkPeriodSeconds,tn as bottomDrawerCommandId,rj as boundsOf,ie as buildHighlightTargets,tS as buildModel,Uk as canConnect,lr as capFlags,cr as capKeys,On as captionForEntry,ty as captureElementScroll,ZT as clampToDisk,ZA as clampZoom,re as clearHighlights,wj as collapsedOffset,xx as collectContainerNames,Pv as collectDataResult,vx as collectPanelIds,Sx as collectStackPaths,UA as combineSelection,sE as composeIsometry,VE as computeCanonicalPositions,MN as computeColour,KE as computeHyperbolicLayout,JD as computeIcicleLayout,Px as computeLeafGeoms,rF as computeSunburstLayout,rL as computeTreemapLayout,Pk as connectContext,wt as createAcCompletionProvider,kt as createDataListSearchAdapter,Un as createDefaultListDragPreview,It as createElementIncrSearch,Nt as createElementListSearchAdapter,cx as createEmptyLayout,sx as createEmptyStack,Ct as createFuzzySearch,Et as createIncrSearch,nM as createPillRenderer,Cr as createScrollHoverGuard,ux as createSplit,lx as createStack,oT as createTreeListAdapter,Gt as createTreeListSearchAdapter,tF as createValueResolver,sT as createVerticalListAdapter,Fk as cycleBlockedNodes,fE as decomposeViewIsometry,gn as defaultGroupLabel,aA as defaultSide,KP as defaultSunburstValueAccessor,cS as distribute,Wv as dropTargetFor,Ek as edgeId,sA as edgeMidpoint,oA as edgePath,mA as edgeShape,Dk as ensurePort,tE as euclideanRadiusForHyperbolicDistance,iA as extendFromSide,Ax as extractStack,Wx as findEmptiedStacks,ME as findHyperbolicIdOf,NE as findHyperbolicKeyPath,PE as findHyperbolicNode,FE as findHyperbolicPath,jE as findHyperbolicPathById,qD as findIcicleKeyPath,WD as findIcicleNode,GD as findIciclePath,mx as findNode,_S as findPanelNode,hx as findParentOf,Nj as findProximityConnection,IA as findSnapTarget,gx as findStackOf,yx as findStackPathByName,$P as findSunburstId,QP as findSunburstNodeById,ZI as findTreemapNode,QI as findTreemapPath,Kk as findValidWire,nj as fitBounds,ij as fitRects,dr as flagsFromRecord,fr as flagsToRecord,$A as flowToScreen,xA as forceMovement,SA as forcePin,bA as forcePositions,_A as forceState,yA as forceStep,ub as formatDateInput,jk as fromEdges,iE as geodesicInterpolate,mE as geodesicPath,pE as geodesicSegment,hr as gestureOf,ex as getActiveDragPanelId,ye as getIcon,be as getIconEntry,Ce as getIconFont,Ix as getLeafNeighbours,xe as hasIcon,Rk as hasWire,kE as hyperbolicBranchId,DE as hyperbolicChildIds,nE as hyperbolicDistanceForEuclideanRadius,OE as hyperbolicIdDepth,WE as hyperbolicRelativeFrame,ge as iconBus,aE as identityIsometry,Ik as inDegreeOf,Yk as inEasyConnectZone,zk as incomingEdge,Bk as incomingEdges,wL as init,Dx as insertBeside,cE as invertIsometry,$b as isDragging,aj as isEditableTarget,AE as isHyperbolicDescendantId,gr as isMultiMode,MA as isNodeShape,yr as isPartialKey,OA as isResizeHandle,ox as isSplit,W as isStack,YP as isSunburstAncestorId,$v as isViewStateful,D as keyForElement,mr as keysAsFlags,pr as keysToArray,Jn as listItemFadeKeyframes,Ut as listSearchStyles,GA as marqueeStyle,Tj as measureNode,eE as mobiusAdd,$T as mobiusFromOrigin,QT as mobiusToOrigin,yL as monitorIndeterminate,zx as moveLeafNodeToEdge,Rx as moveLeafStep,XA as nodeGraphStyles,HA as nodesInRect,XT as norm,sS as normalise,Hk as normaliseConnection,UD as normaliseValue,dx as normalize,oy as onUserScrollIntent,Lk as outDegreeOf,tj as panBy,hM as panelGapIndex,kN as parseColourScaleAttr,lb as parseDateInput,Hx as parseLayout,Tk as parsePortId,yn as partitionByGroup,sr as partitionFlags,or as partitionKeys,Xk as pickStartPort,rE as poincareDistance,Yb as pointerOverAnyHost,pA as polylineMidpoint,fA as polylinePath,hA as polylineShape,wk as portId,qn as prefersReducedMotion,gS as preserveRestoreWeights,LA as proximityFactor,Hv as pruneDraggedDescendants,ON as readBaseColour,BA as rectFromPoints,Mj as rectGap,VA as rectsIntersect,ve as registerFontIcon,_e as registerIcon,zt as registerListSearchCommands,Ak as removeNode,qk as removeNodes,Tx as removePanelFromStack,kk as removeWire,qj as renderWires,AA as resizeRect,Gk as resolveConnection,oI as resolveCssVars,YF as resolveGrid,vn as resolveGroupKey,KD as resolveIcicleKeyPath,Nx as resolveLeafPath,lS as resolveTracks,ny as restoreElementScroll,uE as rotationIsometry,br as sameKeySet,gj as sanitizeFlowSpeed,QA as screenToFlow,ry as scrollToOffset,Rj as selectionAfterEdgeClick,Lj as selectionAfterNodePress,Bx as serializeLayout,Ex as setActive,Se as setIconFont,hS as setPanelRestoreWeight,zA as settled,NA as shapeSpec,RA as smoothStep,Ux as snapshotNonEmptyStacks,tr as startListItemOutAnimation,dA as stepPoints,qP as sunburstChildId,nF as sunburstHasChildren,XP as sunburstIdToPath,ZP as sunburstParentId,JP as sunburstPathToId,we as svgToDataUri,Lx as swapLeaves,C as tickledItemStyles,se as tickledStyles,vI as timelineStyles,mL as toBase,Mk as toEdges,_n as toGroupKey,Nk as toNodeGraph,uS as toSnapshot,bn as toggleInSet,WI as toolbarGapIndex,lE as translationFromOrigin,Vk as typesCompatible,dE as viewIsometry,vS as walk,WA as wantsMarquee,vj as withEntry,_j as withWireFlow,ur as withoutFlag,Ox as wrapRoot,ej as zoomAt};
|
|
14771
|
+
`}};E([d({type:Number})],gL.prototype,`xMin`,void 0),E([d({type:Number})],gL.prototype,`xMax`,void 0),E([d({type:Number})],gL.prototype,`x`,void 0),E([d({type:Number})],gL.prototype,`yMin`,void 0),E([d({type:Number})],gL.prototype,`yMax`,void 0),E([d({type:Number})],gL.prototype,`y`,void 0),E([d({type:String})],gL.prototype,`xScale`,void 0),E([d({type:String})],gL.prototype,`yScale`,void 0),E([d({type:Number,attribute:`x-snap-step`})],gL.prototype,`xSnapStep`,void 0),E([d({type:Number,attribute:`y-snap-step`})],gL.prototype,`ySnapStep`,void 0),E([d({type:Number,attribute:`step-x`})],gL.prototype,`stepX`,void 0),E([d({type:Number,attribute:`step-y`})],gL.prototype,`stepY`,void 0),E([d({type:String})],gL.prototype,`xLabel`,void 0),E([d({type:String})],gL.prototype,`yLabel`,void 0),E([d({type:Boolean,reflect:!0,attribute:`show-crosshairs`})],gL.prototype,`showCrosshairs`,void 0),E([d({type:Boolean,reflect:!0,attribute:`show-grid`})],gL.prototype,`showGrid`,void 0),E([d({type:Boolean,reflect:!0,attribute:`hide-cursor`})],gL.prototype,`hideCursor`,void 0),E([d({type:Boolean,reflect:!0})],gL.prototype,`disabled`,void 0),E([d({type:Number})],gL.prototype,`stops`,void 0),E([d({type:Number,attribute:`stops-x`})],gL.prototype,`stopsX`,void 0),E([d({type:Number,attribute:`stops-y`})],gL.prototype,`stopsY`,void 0),gL=E([T(`ixfx-xy-pad`)],gL);function _L(){console.log(`Init`)}export{oL as AGE_UNITS,ke as AcTextElement,Jt as AcTokenElement,rn as BottomDrawerElement,pn as ButtonElement,Mr as Checkbox,Wr as CheckedSelect,B as ColourPicker,Nv as ColourPickerPopup,V as CrumbNavigationElement,my as CrumbPathController,gy as CrumbPathElement,gA as DEFAULT_FORCE_OPTIONS,zE as DEFAULT_SIBLING_SPACING,JA as DRAG_THRESHOLD_PX,je as DataController,_y as DataDisplayComponent,H as DataGridElement,cb as DataTableElement,db as DateInputElement,U as DetailListElement,tC as DockHostElement,QS as DockPanelElement,Jk as EASY_CONNECT_MARGIN,lA as EDGE_CORNER_RADIUS,ar as EMPTY_FLAGS,hn as EMPTY_GROUP_LABEL,O as EMPTY_KEYS,hC as EditableLabel,bC as EditableNumber,K as FlatListElement,JC as FormElement,zC as FormGroupElement,VC as FormOptionsElement,UC as FormPartElement,WC as FormRowElement,X as GraphNodeElement,EA as GraphPortElement,q as GridListElement,vw as GroupedItemListerElement,Y as HyperbolicTreeListElement,on as ICON_CARET_RIGHT,sn as ICON_CHECK,an as ICON_CHEVRON_DOWN,cn as ICON_CLOSE,tO as IcicleTreeListElement,Ot as IncrSearchMillerController,Ot as IncrSearchTreeController,IT as IxfxHexEditorElement,Te as IxfxIconElement,Q as IxfxTimelineElement,jt as KeyedElementIndex,Kn as LIST_ITEM_MOTION_MS,Lt as LIST_SEARCH_COMMAND_IDS,Bt as LIST_SEARCH_MODES,yO as LabelledRadialInput,kv as LabelledRangeInput,jO as LabelledSliderInput,MO as LedElement,Gn as ListDragSelectController,wb as ListGroupHeaderElement,rr as ListNativeDragController,Ht as ListSearchController,_r as ListSelectionController,KA as MARQUEE_THRESHOLD_PX,wA as MAX_BLINK_HZ,hj as MAX_FLOW_SPEED,ir as MAX_PENDING_KEYS,qA as MarqueeController,eb as Menu,KO as MillerBaseElement,YO as MillerListElement,XO as MillerTreeController,bk as MulticolListElement,jA as NODE_SHAPES,fy as NarrowedTextElement,YA as NodeDragController,Yj as NodeGraphElement,oM as NotificationManager,Xj as NotificationPillElement,vr as PARTIAL_DESCRIPTION,nb as PanTextElement,oj as PanZoomController,gw as PanelElement,uM as PanelGroupElement,EN as PlotDataSeries,JN as PlotHistogram,qN as PlotMultiAxis,aP as PlotSingleAxis,oP as PlotXyAxis,gP as PolarPad,DA as RESIZE_HANDLES,vO as RadialInputElement,mn as RadioGroup,wP as RangeElement,yP as RangeInput,CP as RangeMultiElement,TP as RatingElement,Sr as SCROLL_HOVER_SUPPRESS_ATTR,aL as SIZE_UNITS,RP as SUNBURST_PATH_SEPARATOR,EP as SelectHorizElement,kP as ShapefillValueElement,AO as SliderInputElement,PP as SlidingNumberElement,IP as SnackbarElement,LP as SnapContainer,jr as SplitButton,MS as SplitLayoutElement,jS as SplitPanelElement,Z as SunburstTreeListElement,FF as SwipeElement,LF as TabController,WS as TabListElement,ZS as TabListItemElement,IF as TabPanelElement,RF as TabPanelsElement,zF as TextShimmerElement,oe as TickledController,BF as TimelineController,fI as TimelineTrackTabElement,en as TitlebarElement,BI as ToolbarElement,FI as ToolbarGroupElement,jN as TooltipElement,VI as TransitoryLabelElement,J as TreeBaseElement,HI as TreeController,Xv as TreeDataModel,Nw as TreeDropController,wr as TreeKeyboardNavController,aT as TreeListElement,$ as TreemapListElement,rL as TwoSplitLayoutElement,lL as UnitInputElement,Qv as VIEW_STATE_CHANGE,Zv as VIEW_STATE_VERSION,G as VerticalListElement,cy as ViewStateController,Hj as WireDragController,gL as XyPad,wx as addPanelToStack,Ok as addWire,iy as anchorFromRow,$n as animateListItemIn,nr as animateListItemOut,TN as applyAgeModification,ne as applyHighlights,oE as applyIsometry,xr as applyPartialAttributes,fS as applySnapshot,Uv as applyTreeDrop,sI as attachTimelineInteractions,cL as bestUnit,ey as bindViewState,TA as blinkPeriodSeconds,tn as bottomDrawerCommandId,rj as boundsOf,ie as buildHighlightTargets,tS as buildModel,Uk as canConnect,lr as capFlags,cr as capKeys,On as captionForEntry,ty as captureElementScroll,ZT as clampToDisk,ZA as clampZoom,re as clearHighlights,wj as collapsedOffset,xx as collectContainerNames,Pv as collectDataResult,vx as collectPanelIds,Sx as collectStackPaths,UA as combineSelection,sE as composeIsometry,VE as computeCanonicalPositions,wN as computeColour,KE as computeHyperbolicLayout,JD as computeIcicleLayout,Px as computeLeafGeoms,XP as computeSunburstLayout,XI as computeTreemapLayout,Pk as connectContext,wt as createAcCompletionProvider,kt as createDataListSearchAdapter,Un as createDefaultListDragPreview,It as createElementIncrSearch,Nt as createElementListSearchAdapter,cx as createEmptyLayout,sx as createEmptyStack,Ct as createFuzzySearch,Et as createIncrSearch,rM as createNotificationManager,nM as createPillRenderer,Cr as createScrollHoverGuard,ux as createSplit,lx as createStack,oT as createTreeListAdapter,Gt as createTreeListSearchAdapter,JP as createValueResolver,sT as createVerticalListAdapter,Fk as cycleBlockedNodes,fE as decomposeViewIsometry,gn as defaultGroupLabel,aA as defaultSide,zP as defaultSunburstValueAccessor,cS as distribute,Wv as dropTargetFor,Ek as edgeId,sA as edgeMidpoint,oA as edgePath,mA as edgeShape,Dk as ensurePort,tE as euclideanRadiusForHyperbolicDistance,iA as extendFromSide,Ax as extractStack,Wx as findEmptiedStacks,ME as findHyperbolicIdOf,NE as findHyperbolicKeyPath,PE as findHyperbolicNode,FE as findHyperbolicPath,jE as findHyperbolicPathById,qD as findIcicleKeyPath,WD as findIcicleNode,GD as findIciclePath,mx as findNode,_S as findPanelNode,hx as findParentOf,Nj as findProximityConnection,IA as findSnapTarget,gx as findStackOf,yx as findStackPathByName,KP as findSunburstId,GP as findSunburstNodeById,WI as findTreemapNode,GI as findTreemapPath,Kk as findValidWire,nj as fitBounds,ij as fitRects,dr as flagsFromRecord,fr as flagsToRecord,$A as flowToScreen,xA as forceMovement,SA as forcePin,bA as forcePositions,_A as forceState,yA as forceStep,ub as formatDateInput,jk as fromEdges,iE as geodesicInterpolate,mE as geodesicPath,pE as geodesicSegment,hr as gestureOf,ex as getActiveDragPanelId,ye as getIcon,be as getIconEntry,Ce as getIconFont,Ix as getLeafNeighbours,xe as hasIcon,Rk as hasWire,kE as hyperbolicBranchId,DE as hyperbolicChildIds,nE as hyperbolicDistanceForEuclideanRadius,OE as hyperbolicIdDepth,WE as hyperbolicRelativeFrame,ge as iconBus,aE as identityIsometry,Ik as inDegreeOf,Yk as inEasyConnectZone,zk as incomingEdge,Bk as incomingEdges,_L as init,Dx as insertBeside,cE as invertIsometry,$b as isDragging,aj as isEditableTarget,AE as isHyperbolicDescendantId,gr as isMultiMode,MA as isNodeShape,yr as isPartialKey,OA as isResizeHandle,ox as isSplit,W as isStack,HP as isSunburstAncestorId,$v as isViewStateful,D as keyForElement,mr as keysAsFlags,pr as keysToArray,Jn as listItemFadeKeyframes,Ut as listSearchStyles,GA as marqueeStyle,Tj as measureNode,eE as mobiusAdd,$T as mobiusFromOrigin,QT as mobiusToOrigin,fL as monitorIndeterminate,zx as moveLeafNodeToEdge,Rx as moveLeafStep,XA as nodeGraphStyles,HA as nodesInRect,XT as norm,sS as normalise,Hk as normaliseConnection,UD as normaliseValue,dx as normalize,oy as onUserScrollIntent,Lk as outDegreeOf,tj as panBy,sM as panelGapIndex,xN as parseColourScaleAttr,lb as parseDateInput,Hx as parseLayout,Tk as parsePortId,yn as partitionByGroup,sr as partitionFlags,or as partitionKeys,Xk as pickStartPort,rE as poincareDistance,Yb as pointerOverAnyHost,pA as polylineMidpoint,fA as polylinePath,hA as polylineShape,wk as portId,qn as prefersReducedMotion,gS as preserveRestoreWeights,LA as proximityFactor,Hv as pruneDraggedDescendants,bN as readBaseColour,BA as rectFromPoints,Mj as rectGap,VA as rectsIntersect,ve as registerFontIcon,_e as registerIcon,zt as registerListSearchCommands,Ak as removeNode,qk as removeNodes,Tx as removePanelFromStack,kk as removeWire,qj as renderWires,AA as resizeRect,Gk as resolveConnection,$F as resolveCssVars,HF as resolveGrid,vn as resolveGroupKey,KD as resolveIcicleKeyPath,Nx as resolveLeafPath,lS as resolveTracks,ny as restoreElementScroll,uE as rotationIsometry,br as sameKeySet,gj as sanitizeFlowSpeed,QA as screenToFlow,ry as scrollToOffset,Rj as selectionAfterEdgeClick,Lj as selectionAfterNodePress,Bx as serializeLayout,Ex as setActive,Se as setIconFont,hS as setPanelRestoreWeight,zA as settled,NA as shapeSpec,RA as smoothStep,Ux as snapshotNonEmptyStacks,tr as startListItemOutAnimation,dA as stepPoints,BP as sunburstChildId,YP as sunburstHasChildren,UP as sunburstIdToPath,WP as sunburstParentId,VP as sunburstPathToId,we as svgToDataUri,Lx as swapLeaves,C as tickledItemStyles,se as tickledStyles,dI as timelineStyles,sL as toBase,Mk as toEdges,_n as toGroupKey,Nk as toNodeGraph,uS as toSnapshot,bn as toggleInSet,LI as toolbarGapIndex,lE as translationFromOrigin,Vk as typesCompatible,dE as viewIsometry,vS as walk,WA as wantsMarquee,vj as withEntry,_j as withWireFlow,ur as withoutFlag,Ox as wrapRoot,ej as zoomAt};
|