@ixfx/components 0.14.3 → 0.14.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/index.d.ts +23 -6
- package/bundle/index.js +52 -52
- package/dist/index.d.ts +17 -0
- package/dist/index.js +18 -0
- package/docs-user/index.json +2 -2
- package/docs-user/notifier.md +16 -0
- package/package.json +1 -1
package/bundle/index.js
CHANGED
|
@@ -10273,7 +10273,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
10273
10273
|
transform: none !important;
|
|
10274
10274
|
}
|
|
10275
10275
|
}
|
|
10276
|
-
`]}};E([d({type:String,attribute:`notification-type`})],fw.prototype,`notificationType`,void 0),E([d({type:String})],fw.prototype,`message`,void 0),E([d({type:String})],fw.prototype,`icon`,void 0),E([d({type:Boolean,reflect:!0})],fw.prototype,`dismissing`,void 0),E([d({type:String,attribute:`notification-id`})],fw.prototype,`notificationId`,void 0),fw=E([T(`ixfx-notification-pill`)],fw);function pw(e){return{vertical:e.startsWith(`top`)?`top`:`bottom`,horizontal:e.endsWith(`-left`)?`left`:e.endsWith(`-right`)?`right`:`middle`}}function mw(e,n){let{vertical:r,horizontal:i}=pw(e),a=`calc(var(--space-l, 12px) + ${(r===`top`?n.top:n.bottom)??0}px)`,o=`position: fixed; `;if(o+=r===`top`?`top: ${a}; bottom: auto; `:`bottom: ${a}; top: auto; `,i===`left`){let e=`calc(var(--space-l, 12px) + ${n.left??0}px)`;o+=`left: ${e}; right: auto;`}else if(i===`right`){let e=`calc(var(--space-l, 12px) + ${n.right??0}px)`;o+=`right: ${e}; left: auto;`}else o+=`left: 50%; right: auto;`;return o}function hw(e){let n=e.vertical===`top`?-20:20;return e.horizontal===`middle`?`translateX(-50%) translate(0, ${n}px)`:`translate(${e.horizontal===`left`?-20:20}px, ${n}px)`}function gw(e,n,r){return e.horizontal===`middle`?`translateX(-50%) translate(${n}px, ${r}px)`:`translate(${n}px, ${r}px)`}function _w(e={}){let n=e.position??`top-right`,r=e.queueDisplay??`list`,i=e.safeArea??{},a=pw(n),o=
|
|
10276
|
+
`]}};E([d({type:String,attribute:`notification-type`})],fw.prototype,`notificationType`,void 0),E([d({type:String})],fw.prototype,`message`,void 0),E([d({type:String})],fw.prototype,`icon`,void 0),E([d({type:Boolean,reflect:!0})],fw.prototype,`dismissing`,void 0),E([d({type:String,attribute:`notification-id`})],fw.prototype,`notificationId`,void 0),fw=E([T(`ixfx-notification-pill`)],fw);function pw(e){return{vertical:e.startsWith(`top`)?`top`:`bottom`,horizontal:e.endsWith(`-left`)?`left`:e.endsWith(`-right`)?`right`:`middle`}}function mw(e,n){let{vertical:r,horizontal:i}=pw(e),a=`calc(var(--space-l, 12px) + ${(r===`top`?n.top:n.bottom)??0}px)`,o=`position: fixed; `;if(o+=r===`top`?`top: ${a}; bottom: auto; `:`bottom: ${a}; top: auto; `,i===`left`){let e=`calc(var(--space-l, 12px) + ${n.left??0}px)`;o+=`left: ${e}; right: auto;`}else if(i===`right`){let e=`calc(var(--space-l, 12px) + ${n.right??0}px)`;o+=`right: ${e}; left: auto;`}else o+=`left: 50%; right: auto;`;return o}function hw(e){let n=e.vertical===`top`?-20:20;return e.horizontal===`middle`?`translateX(-50%) translate(0, ${n}px)`:`translate(${e.horizontal===`left`?-20:20}px, ${n}px)`}function gw(e,n,r){return e.horizontal===`middle`?`translateX(-50%) translate(${n}px, ${r}px)`:`translate(${n}px, ${r}px)`}function _w(e){return typeof e.showPopover==`function`&&typeof e.hidePopover==`function`}function vw(e={}){let n=e.position??`top-right`,r=e.queueDisplay??`list`,i=e.safeArea??{},a=pw(n),o=e.topLayer??!0,s=null,c=null,l=new Map,u=40,d=!1;function f(){return s||(s=document.createElement(`div`),s.className=`ixfx-notification-container`,s.setAttribute(`role`,`region`),s.setAttribute(`aria-label`,`Notifications`),s.style.cssText=`pointer-events: none;`,o&&_w(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=mw(n,i),m(r,e),r.style.opacity=`0`,r.style.transform=hw(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=gw(a,c,d)})}function v(e){let n=l.get(e);if(!n)return;let r=n.element;r.setAttribute(`dismissing`,`true`);let i=()=>{r.removeEventListener(`transitionend`,i),r.remove(),l.delete(e),s&&l.size===0&&(s.remove(),s=null,d=!1,u=40)};r.addEventListener(`transitionend`,i),setTimeout(i,300)}function y(e,n){let r=f(),i=!1,a=new Set(e.map(e=>e.id));for(let n of e){let e=l.get(n.id);if(e){e.notification=n,m(e.element,n);continue}let a=h(n);l.set(n.id,{element:a,notification:n}),r.appendChild(a),i=!0,g(a)}i&&p(r);for(let[e]of l)a.has(e)||v(e);requestAnimationFrame(()=>_(e))}return{attach(e){c=e},detach(){for(let[e]of l)v(e);s&&=(s.remove(),null)},setNotifications:y}}const yw={renderer:void 0,timeout:4e3,timeoutError:8e3,queue:!0,queueSize:3,tapBehaviour:`dismiss`,tapHandlerDefault:void 0},bw=[];let xw=null,Sw=null;function Cw(){return Sw??=vw({position:`top-right`}),Sw}function ww(){return xw??Cw()}function Tw(){ww().setNotifications([...bw],yw.queueSize)}function Ew(e){e.timer!==null&&(clearTimeout(e.timer),e.timer=null)}function Dw(e){let n=e.type===`error`?yw.timeoutError:yw.timeout,r=e.wasQueued?n/yw.queueSize:n;e.timer=window.setTimeout(Aw,r,e.id)}function Ow(){let e=bw[0];e&&e.timer===null&&Dw(e)}const kw={configure(e){if(e.renderer!==void 0&&(xw?.detach?.(),xw=e.renderer,xw.attach({onTap(e){let n=bw.find(n=>n.id===e);n&&(n.onTap?n.onTap(e):yw.tapHandlerDefault?.(n),yw.tapBehaviour===`dismiss`&&Aw(e))}}),Tw()),e.timeout!==void 0&&(yw.timeout=e.timeout),e.timeoutError!==void 0&&(yw.timeoutError=e.timeoutError),e.queue!==void 0&&(yw.queue=e.queue),e.queueSize!==void 0){for(yw.queueSize=Math.max(1,e.queueSize);bw.length>yw.queueSize;)Ew(bw.shift());Ow(),Tw()}e.tapBehaviour!==void 0&&(yw.tapBehaviour=e.tapBehaviour),e.tapHandlerDefault!==void 0&&(yw.tapHandlerDefault=e.tapHandlerDefault)},notify(e){let n=crypto.randomUUID(),r=Date.now(),i=e.icon??(e.type===`error`?`error`:void 0),a={...e,icon:i,id:n,createdAt:r,updatedAt:r,timer:null,wasQueued:!1};if(yw.queue)bw.length>=yw.queueSize&&Ew(bw.shift()),a.wasQueued=bw.length>0,bw.push(a);else{for(;bw.length>0;)Ew(bw.pop());bw.push(a)}return Ow(),Tw(),n},update(e,n){let r=bw.find(n=>n.id===e);r&&(Object.assign(r,n),r.updatedAt=Date.now(),bw[0]===r&&(Ew(r),Dw(r)),Tw())},dismiss(e){Aw(e)},dismissAll(){for(let e of bw)Ew(e);bw.length=0,Tw()}};function Aw(e){let n=bw.findIndex(n=>n.id===e);n!==-1&&(Ew(bw.splice(n,1)[0]),Ow(),Tw())}function jw(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 Mw=!1;function Nw(){if(Mw)return;Mw=!0;let e=document.createElement(`style`);e.textContent=`
|
|
10277
10277
|
.ixfx-drag-ghost.ixfx-panel-group-ghost {
|
|
10278
10278
|
padding: var(--space-s, 8px) var(--space-m, 16px);
|
|
10279
10279
|
background: var(--surface-4);
|
|
@@ -10292,7 +10292,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
10292
10292
|
height: 1.25em;
|
|
10293
10293
|
flex-shrink: 0;
|
|
10294
10294
|
}
|
|
10295
|
-
`,document.head.appendChild(e)}let
|
|
10295
|
+
`,document.head.appendChild(e)}let Pw=class extends n{constructor(...e){super(...e),this.orientation=`horizontal`,this.variant=`titlebar`,this.toggleInteraction=`implicit`,this.collapsible=!0,this.accordion=!1,this.allowReorder=!1,this._dragState=null,this._suppressNextClick=!1,this._onClickCapture=e=>{this._suppressNextClick&&(this._suppressNextClick=!1,e.preventDefault(),e.stopPropagation())},this._onKeyDown=e=>{let n=this._dragState;if(e.key!==`Escape`||!n?.active)return;e.preventDefault();let r=n.pointerId;this._abortDrag(),this._endDrag(r)},this._onPointerDown=e=>{if(!this.allowReorder||e.button!==0)return;let n=this._findDragTarget(e);if(!n?.parentNode)return;let r=Array.prototype.indexOf.call(n.parentNode.children,n);r<0||(this._dragState={pointerId:e.pointerId,source:n,fromIndex:r,startX:e.clientX,startY:e.clientY,active:!1,ghost:null,gapIndex:void 0},window.addEventListener(`pointermove`,this._onPointerMove),window.addEventListener(`pointerup`,this._onPointerUp),window.addEventListener(`pointercancel`,this._onPointerCancel))},this._onPointerMove=e=>{let n=this._dragState;if(!n||e.pointerId!==n.pointerId)return;let r=Math.hypot(e.clientX-n.startX,e.clientY-n.startY);if(!n.active){if(r<5)return;this._beginDrag(e)}n.ghost?.move(e.clientX,e.clientY);let i=this._computeGapIndex(e.clientX,e.clientY);i!==n.gapIndex&&(n.gapIndex=i,this.requestUpdate())},this._onPointerUp=e=>{let n=this._dragState;if(!(!n||e.pointerId!==n.pointerId)){if(n.active){let r=this._computeGapIndex(e.clientX,e.clientY);this._commitDrag(n.source,n.fromIndex,r)}this._endDrag(e.pointerId)}},this._onPointerCancel=e=>{let n=this._dragState;!n||e.pointerId!==n.pointerId||(this._abortDrag(),this._endDrag(e.pointerId))}}_onPanelToggle(e){let n=e.target;if(!n.collapsed&&this.accordion)for(let e of this._panels)e!==n&&(e.collapsed=!0)}connectedCallback(){super.connectedCallback(),this.addEventListener(`click`,this._onClickCapture,!0)}disconnectedCallback(){this.removeEventListener(`click`,this._onClickCapture,!0),this._dragState&&(this._abortDrag(),this._endDrag(this._dragState.pointerId)),super.disconnectedCallback()}firstUpdated(){this.gap!==void 0&&this.style.setProperty(`--group-gap`,this.gap),this.updateComplete.then(()=>{this._propagateAll()})}updated(e){super.updated(e),e.has(`gap`)&&(this.gap===void 0?this.style.removeProperty(`--group-gap`):this.style.setProperty(`--group-gap`,this.gap)),(e.has(`variant`)||e.has(`toggleInteraction`)||e.has(`orientation`)||e.has(`collapsible`))&&this.updateComplete.then(()=>{this._propagateAll()})}_propagateAll(){let e=this.orientation===`horizontal`?`vertical`:`horizontal`;for(let n of this._panels)n.setAttribute(`variant`,this.variant),n.setAttribute(`toggle-interaction`,this.toggleInteraction),n.setAttribute(`orientation`,e),this.collapsible?n.setAttribute(`collapsible`,``):n.removeAttribute(`collapsible`)}_onSlotChange(){this.updateComplete.then(()=>{this._propagateAll()})}_findDragTarget(e){if(!this.allowReorder)return null;let n=e.composedPath(),r=null,i=!1;for(let e of n){if(!(e instanceof HTMLElement))continue;let n=e.tagName;if(n===`BUTTON`||n===`A`||n===`INPUT`||n===`SELECT`||n===`TEXTAREA`||e.classList.contains(`toolbar`)||e.classList.contains(`close-btn`)||e.classList.contains(`caret-btn`)||e.hasAttribute?.(`slot`)&&e.getAttribute(`slot`)===`toolbar`)return null;n===`IXFX-TITLEBAR`&&(i=!0),!r&&n===`IXFX-PANEL`&&(r=e)}return!r||!i?null:r}_beginDrag(e){let n=this._dragState;if(!(!n||n.active)){try{this.setPointerCapture(e.pointerId)}catch{}n.active=!0,this.setAttribute(`dragging`,``),n.source.setAttribute(`drag-source`,``),n.ghost=this._createGhost(n.source),n.ghost?.move(e.clientX,e.clientY)}}_abortDrag(){let e=this._dragState;e&&(e.source.removeAttribute(`drag-source`),e.gapIndex!==void 0&&(e.gapIndex=void 0,this.requestUpdate()))}_endDrag(e){let n=this._dragState;if(n){n.ghost?.destroy(),n.ghost=null,this.removeAttribute(`dragging`),this._dragState=null,window.removeEventListener(`pointermove`,this._onPointerMove),window.removeEventListener(`pointerup`,this._onPointerUp),window.removeEventListener(`pointercancel`,this._onPointerCancel);try{this.releasePointerCapture(e)}catch{}this.requestUpdate()}}_commitDrag(e,n,r){e.removeAttribute(`drag-source`);let i=(this._panels??[]).filter(n=>n!==e),a=r===void 0?i.length:Math.max(0,Math.min(r,i.length)),o=e.parentNode;if(!o)return;let s=i[a]??null;o.insertBefore(e,s);let c=Array.prototype.indexOf.call(o.children,e);c!==n&&(this._suppressNextClick=!0,this.dispatchEvent(new CustomEvent(`reorder`,{bubbles:!0,composed:!0,detail:{fromIndex:n,toIndex:c,panel:e}})))}_createGhost(e){let n=document.createElement(`span`);if(n.style.display=`inline-flex`,n.style.alignItems=`center`,n.style.padding=`0 var(--space-s, 8px)`,n.style.minWidth=`0`,e.iconName){let r=document.createElement(`ixfx-icon`);r.name=e.iconName,n.appendChild(r)}let r=document.createElement(`span`);r.textContent=(e.title||(e.textContent??``).trim()).slice(0,60),r.style.paddingLeft=`1ch`,r.style.overflow=`hidden`,r.style.textOverflow=`ellipsis`,r.style.whiteSpace=`nowrap`,n.appendChild(r);try{return Nw(),zg({anchor:e,content:n,className:`ixfx-panel-group-ghost`})}catch{return null}}_computeGapIndex(e,n){let r=this._dragState;if(!r)return;let i=(this._panels??[]).filter(e=>e!==r.source);if(i.length===0)return 0;let a=this.orientation===`horizontal`,o=a?e:n;return jw(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`
|
|
10296
10296
|
<slot
|
|
10297
10297
|
@toggle=${this._onPanelToggle}
|
|
10298
10298
|
@slotchange=${this._onSlotChange}
|
|
@@ -10356,7 +10356,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
10356
10356
|
pointer-events: none;
|
|
10357
10357
|
z-index: 1;
|
|
10358
10358
|
}
|
|
10359
|
-
`}};E([d({type:String,reflect:!0})],
|
|
10359
|
+
`}};E([d({type:String,reflect:!0})],Pw.prototype,`orientation`,void 0),E([d({type:String})],Pw.prototype,`variant`,void 0),E([d({type:String,attribute:`toggle-interaction`})],Pw.prototype,`toggleInteraction`,void 0),E([d({type:Boolean})],Pw.prototype,`collapsible`,void 0),E([d({type:Boolean,attribute:`accordion`,reflect:!0})],Pw.prototype,`accordion`,void 0),E([d({type:Boolean,attribute:`allow-reorder`,reflect:!0})],Pw.prototype,`allowReorder`,void 0),E([d()],Pw.prototype,`gap`,void 0),E([p({slot:``})],Pw.prototype,`_panels`,void 0),Pw=E([T(`ixfx-panel-group`)],Pw);var Fw=Object.defineProperty,Iw=(e,n)=>{let r={};for(var i in e)Fw(r,i,{get:e[i],enumerable:!0});return n||Fw(r,Symbol.toStringTag,{value:`Module`}),r};const Lw=Math.pow,Rw=1/Math.sqrt(2*Math.PI),zw=(e=.4)=>n=>{let r=Rw/e,i=-2.5,a=(n-.5)/e;a*=a,i*=a;let o=r*Lw(Math.E,i);return o>1?1:o<0?0:o};var Bw=Iw({arch:()=>Yw,backIn:()=>mT,backInOut:()=>_T,backOut:()=>hT,bell:()=>xT,bounceIn:()=>bT,bounceInOut:()=>CT,bounceOut:()=>Kw,circIn:()=>fT,circInOut:()=>gT,circOut:()=>pT,cubicIn:()=>iT,cubicOut:()=>aT,elasticIn:()=>vT,elasticInOut:()=>ST,elasticOut:()=>yT,expoIn:()=>cT,expoInOut:()=>dT,expoOut:()=>lT,quadIn:()=>eT,quadInOut:()=>rT,quadOut:()=>tT,quartIn:()=>oT,quartOut:()=>sT,quintIn:()=>qw,quintInOut:()=>uT,quintOut:()=>Jw,sineIn:()=>Qw,sineInOut:()=>nT,sineOut:()=>$w,smootherstep:()=>Zw,smoothstep:()=>Xw});const Vw=Math.sqrt,Hw=Math.pow,Uw=Math.cos,Ww=Math.PI,Gw=Math.sin,Kw=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},qw=e=>e*e*e*e*e,Jw=e=>1-Hw(1-e,5),Yw=e=>e*(1-e)*4,Xw=e=>e*e*(3-2*e),Zw=e=>(e*(e*6-15)+10)*e*e*e,Qw=e=>1-Uw(e*Ww/2),$w=e=>Gw(e*Ww/2),eT=e=>e*e,tT=e=>1-(1-e)*(1-e),nT=e=>-(Uw(Ww*e)-1)/2,rT=e=>e<.5?2*e*e:1-Hw(-2*e+2,2)/2,iT=e=>e*e*e,aT=e=>1-Hw(1-e,3),oT=e=>e*e*e*e,sT=e=>1-Hw(1-e,4),cT=e=>e===0?0:Hw(2,10*e-10),lT=e=>e===1?1:1-Hw(2,-10*e),uT=e=>e<.5?16*e*e*e*e*e:1-Hw(-2*e+2,5)/2,dT=e=>e===0?0:e===1?1:e<.5?Hw(2,20*e-10)/2:(2-Hw(2,-20*e+10))/2,fT=e=>1-Vw(1-Hw(e,2)),pT=e=>Vw(1-Hw(e-1,2)),mT=e=>2.70158*e*e*e-1.70158*e*e,hT=e=>1+2.70158*Hw(e-1,3)+1.70158*Hw(e-1,2),gT=e=>e<.5?(1-Vw(1-Hw(2*e,2)))/2:(Vw(1-Hw(-2*e+2,2))+1)/2,_T=e=>{let n=2.5949095;return e<.5?Hw(2*e,2)*(7.189819*e-n)/2:(Hw(2*e-2,2)*(3.5949095*(e*2-2)+n)+2)/2},vT=e=>{let n=2*Ww/3;return e===0?0:e===1?1:-Hw(2,10*e-10)*Gw((e*10-10.75)*n)},yT=e=>{let n=2*Ww/3;return e===0?0:e===1?1:Hw(2,-10*e)*Gw((e*10-.75)*n)+1},bT=e=>1-Kw(1-e),xT=zw(),ST=e=>{let n=2*Ww/4.5;return e===0?0:e===1?1:e<.5?-(Hw(2,20*e-10)*Gw((20*e-11.125)*n))/2:Hw(2,-20*e+10)*Gw((20*e-11.125)*n)/2+1},CT=e=>e<.5?(1-Kw(1-2*e))/2:(1+Kw(2*e-1))/2,wT=(e=0,n=0)=>{let r={x:oi(e,-1,1,0,1),y:oi(e,-1,1,1,0)},i=Nd.interpolate(Math.abs(e),Nd.Empty,r);e!==0&&n>0&&(i=e>0?Nd.interpolate(n,i,{x:0,y:r.x*2}):Nd.interpolate(n,i,{x:r.y*2,y:0}));let a=Ba.cubic(Nd.Empty,Nd.Unit,i,r),o=Ba.interpolator(a);return e=>o(e)},TT=(e,n)=>{O(Pr(e,`fn`));let r;return()=>(r===void 0&&(r=Tu(n,{clampValue:!0})),e(r()))},ET=(e,n)=>{O(Pr(e,`fn`));let r=Au(),i=Ao(n);if(i===void 0)throw Error(`Param 'duration' not provided`);let a=ku(i,{timer:r,clampValue:!0});return Mu(e,a)},DT=(e,n)=>{O(Pr(e,`fn`));let r;return()=>(r===void 0&&(r=Eu(n,{clampValue:!0})),e(r()))},OT=(e,n)=>{O(Pr(e,`fn`));let r=ju(),i=ku(n,{timer:r,clampValue:!0});return Mu(e,i)};var kT=Iw({Named:()=>Bw,create:()=>AT,get:()=>LT,getEasingNames:()=>zT,line:()=>wT,tickEasing:()=>PT,ticks:()=>NT,time:()=>MT,timeEasing:()=>jT});const AT=e=>{let n=FT(e.name??`quintIn`)??e.fn;if(n===void 0)throw Error(`Either 'name' or 'fn' must be set`);if(`duration`in e)return MT(n,e.duration);if(`ticks`in e)return NT(n,e.ticks);throw Error(`Expected 'duration' or 'ticks' in options`)},jT=(e,n)=>ET(FT(e),n),MT=(e,n)=>TT(FT(e),n),NT=(e,n)=>DT(FT(e),n),PT=(e,n)=>OT(FT(e),n),FT=e=>{let n=typeof e==`function`?e:LT(e);if(n===void 0)throw Error(typeof e==`string`?`Easing function not found: '${e}'`:`Easing function not found`);return n};let IT;const LT=function(e){O(Fr(e,`non-empty`,`easingName`));let n=RT().get(e.toLowerCase());if(n===void 0)throw Error(`Easing not found: '${e}'`);return n};function RT(){if(IT===void 0){IT=new Map;for(let[e,n]of Object.entries(Bw))IT.set(e.toLowerCase(),n);return IT}return IT}function*zT(){yield*RT().keys()}const BT=[`green`,`yellow`,`red`],VT=new Map;function HT(e){let n=e.join(`\0`);return VT.has(n)||VT.set(n,eg.scale(e,{stepsBetween:99})),VT.get(n)}function UT(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 WT(e){return UT(e,`--plot-color`)||`oklch(60% 0.15 140)`}function GT(e){if(!e.trim())return BT;let n=e.split(`,`).map(e=>e.trim()).filter(Boolean);return n.length>=2?n:BT}function KT(e){try{let n=eg.HslSpace.fromCss(e,{scalar:!0});return{h:n.h,s:n.s,l:n.l}}catch{return{h:.39,s:.5,l:.55}}}function qT(e,n){let r=Math.max(0,Math.min(1,e));if(n.easingName)try{return Math.max(0,Math.min(1,kT.get(n.easingName)(r)))}catch{}return n.valueMap?Math.max(0,Math.min(1,n.valueMap(r))):r}function JT(e,n,r){let i=qT(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=KT(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=KT(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=KT(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=HT(r.palette.length>=2?r.palette:BT);return{fill:e[Math.min(e.length-1,Math.floor(i*e.length))],opacity:1}}default:return{fill:n,opacity:1}}}function YT(e,n,r){if(r===`opacity`)return{...e,opacity:e.opacity*Math.max(.08,n**.6)};if(r===`desaturation`){let r=KT(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 XT=class{#e;#t;#n;#r;constructor(e={}){this.values=[],this.#e=ui(),this.#t={min:0,max:0},this.#n=null,this.#r={capacityLimit:100,persistentScaling:!0,fixedRange:null,...e},this.#r.fixedRange!==null&&(this.#n=this.#r.fixedRange)}setRange(e,n){this.#n={min:e,max:n}}unsetRange(){this.#n=null,this.#i()}get isAutoRange(){return this.#n===null}add(e){if(typeof e==`number`)this.values.push(e),this.isAutoRange&&(this.#t=this.#e.seen(e));else if(this.values.push(...e),this.isAutoRange)for(let n of e)this.#t=this.#e.seen(n);this.values.length>this.#r.capacityLimit&&(this.values=this.values.slice(this.values.length-this.#r.capacityLimit),!this.#r.persistentScaling&&this.isAutoRange&&this.#i())}#i(){this.#r.persistentScaling||(this.#e=ui());for(let e=0;e<this.values.length;e++)this.#t=this.#e.seen(this.values[e])}set(e){e.length>this.#r.capacityLimit&&(e=e.slice(e.length-this.#r.capacityLimit)),this.values=e,this.#i()}get range(){return this.#n?this.#n:this.#t}clear(){let e=this.values.length===0;return this.values=[],this.#r.persistentScaling||this.#i(),!e}};function ZT(e){if(typeof e==`number`)return!0;if(typeof e!=`string`)return!1;let n=e.trim();return n!==``&&!Number.isNaN(Number(n))}var QT;let $T=!1;function eE(){if($T)return;$T=!0;let e=document.createElement(`style`);e.textContent=`
|
|
10360
10360
|
ixfx-tooltip {
|
|
10361
10361
|
display: inline-block;
|
|
10362
10362
|
background: var(--surface-5);
|
|
@@ -10371,7 +10371,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
10371
10371
|
ixfx-tooltip .tooltip-type-number {
|
|
10372
10372
|
font-family: var(--font-mono, ui-monospace, monospace);
|
|
10373
10373
|
}
|
|
10374
|
-
`,document.head.appendChild(e)}let
|
|
10374
|
+
`,document.head.appendChild(e)}let tE=class extends n{static{QT=this}constructor(...e){super(...e),this.valueFormatTooltip=QT.defaultFormatter,this.orientation=`top`,this.anchor=`--tooltip`}connectedCallback(){super.connectedCallback(),eE()}static{this.numberFormatter=e=>Math.floor(e).toString()}static{this.defaultFormatter=e=>typeof e==`number`?Number.isInteger(e)?e.toString():e.toFixed(2):typeof e==`string`?e:JSON.stringify(e)}#e(){return this.icon?this.icon.startsWith(`<svg`)?i`<span class="tooltip-icon" style="display:inline-flex;align-items:center;margin-right:0.25em">${g(this.icon)}</span>`:be(this.icon)?i`<ixfx-icon class="tooltip-icon" style="margin-right:0.25em" name="${this.icon}"></ixfx-icon>`:a:a}render(){let e={tooltip:!0,"tooltip-orientation-top":this.orientation===`top`,"tooltip-orientation-bottom":this.orientation===`bottom`,"tooltip-orientation-right":this.orientation===`right`,"tooltip-orientation-left":this.orientation===`left`,"tooltip-type-text":!0,"tooltip-type-number":!1,"tooltip-style-bubble":!0},n=``;switch(typeof this.value){case`number`:e[`tooltip-type-number`]=!0,n=this.valueFormatTooltip(this.value);break;case`string`:ZT(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})],tE.prototype,`orientation`,void 0),E([d({type:String})],tE.prototype,`anchor`,void 0),E([d()],tE.prototype,`value`,void 0),E([d({type:String})],tE.prototype,`icon`,void 0),tE=QT=E([T(`ixfx-tooltip`)],tE);let nE=null,rE=null;function iE(){if(nE)return nE;let e=document.createElement(`div`);return e.style.cssText=`
|
|
10375
10375
|
position: fixed;
|
|
10376
10376
|
pointer-events: none;
|
|
10377
10377
|
z-index: 9999;
|
|
@@ -10385,13 +10385,13 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
10385
10385
|
font-family: ui-monospace, monospace;
|
|
10386
10386
|
opacity: 0;
|
|
10387
10387
|
transition: opacity 0.1s ease;
|
|
10388
|
-
`,document.body.appendChild(e),
|
|
10388
|
+
`,document.body.appendChild(e),nE=e,e}function aE(e,n,r,i){let a=iE();rE=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 oE(e,n,r,i){let a=iE();rE=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 sE(e){if(rE!==e)return;let n=iE();n.style.opacity=`0`,rE=null}let cE=null,lE=null;function uE(){if(cE)return cE;let e=document.createElement(`ixfx-tooltip`);return e.style.cssText=`
|
|
10389
10389
|
position: fixed;
|
|
10390
10390
|
z-index: 9999;
|
|
10391
10391
|
pointer-events: none;
|
|
10392
10392
|
opacity: 0;
|
|
10393
10393
|
transition: opacity 0.12s ease;
|
|
10394
|
-
`,document.body.appendChild(e),
|
|
10394
|
+
`,document.body.appendChild(e),cE=e,e}function dE(e,n,r,i,a){let o=uE();lE=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 fE(e){if(lE!==e)return;let n=uE();n.style.opacity=`0`,lE=null}function pE(e,n){return Math.max(1,Math.min(e,n)/25)}function mE(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 hE(e,n,r){let i=r-n;return i===0?.5:(e-n)/i}const gE=[`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 _E=class extends n{constructor(...e){super(...e),this.layout=`overlap`,this.gridMinWidth=200,this.valueFormat=e=>e?e.toFixed(2):``,this.#e=new Map,this.#t=[],this.#n=new Set,this.#r=new Map}#e;#t;#n;#r;addData(e,n,r=!1){return this.#i(e,n,r)}setData(e,n,r=!1){let[i,a]=this.#a(e);return this.#n.has(e)||(this.#n.add(e),this.#t.push(e)),i.set(n,r),a&&this.requestUpdate(),i}setObjects(e,n=!1){let r=Object.entries(e);for(let[e,n]of r)this.setData(e,n,!0);n||this.redraw()}redraw(){for(let e of this.#e.values())e.redraw()}addObject(e,n=!1){let r=Object.entries(e);for(let[e,n]of r)this.#i(e,n,!0);n||this.redraw()}styleSeries(e,n){let r={};for(let[e,i]of Object.entries(n))r[e.startsWith(`--`)?e:`--${e}`]=i;let i=this.#e.get(e);if(!i){this.#r.set(e,r);return}for(let[e,n]of Object.entries(r))i.style.setProperty(e,n)}clear(){let e=!1;for(let n of this.#e.values())e||=n.clear();return e}clearSeries(e){let n=this.#e.get(e);return n?(n.clear(),!0):!1}get series(){return[...this.#t]}#i(e,n,r=!1){let[i,a]=this.#a(e);return this.#n.has(e)||(this.#n.add(e),this.#t.push(e)),i.add(n,r),a&&this.requestUpdate(),i}#a(e){let n=this.#e.get(e);if(n)return[n,!1];n=document.createElement(`ixfx-plot-single-axis`),n.tooltips=!1,this.#e.set(e,n);let r=this.#e.size%gE.length;n.style.setProperty(`--plot-color`,gE[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){sE(this);return}let i=[];for(let[e,n]of this.#e){let a=n.getValueAt(r);if(a===void 0)continue;let o=getComputedStyle(n).getPropertyValue(`--plot-color`).trim();i.push(`<span style="color:${o}">${this.#c(e)}</span> ${this.valueFormat(a)}`)}if(i.length===0){sE(this);return}oE(this,e,n,i.join(`<br>`))}#s(){sE(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`
|
|
10395
10395
|
<div
|
|
10396
10396
|
id="container"
|
|
10397
10397
|
class="layout layout-${this.layout}"
|
|
@@ -10447,7 +10447,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
10447
10447
|
grid-template-columns: repeat(auto-fill, minmax(var(--grid-min-width, 200px), 1fr));
|
|
10448
10448
|
gap: var(--space-s, 4px);
|
|
10449
10449
|
}
|
|
10450
|
-
`}};E([d()],
|
|
10450
|
+
`}};E([d()],_E.prototype,`layout`,void 0),E([d({attribute:`grid-min-width`,type:Number})],_E.prototype,`gridMinWidth`,void 0),_E=E([T(`ixfx-plot-multi-axis`)],_E);let X=class extends n{constructor(...e){super(...e),this.orientation=`horizontal`,this.resolution=.1,this.capacity=100,this.title=``,this.paused=!1,this.valueTooltips=`hover`,this.tooltipDelay=400,this.valueUpdateInterval=500,this.interactionMode=`inspect`,this.valueFormat=(e,n,r)=>`${e.toFixed(2)} - ${n.toFixed(2)}: ${r}`,this._width=100,this._height=40,this._hoveredIndex=null,this._inlineOverlayText=null,this._coloredRangeMin=null,this._coloredRangeMax=null,this._selectionStart=null,this._selectionEnd=null,this._isDragging=!1,this._selectionOverlayText=null,this.#e=new XT({capacityLimit:100,persistentScaling:!0}),this.#t=!1,this.#p=null,this.#m=!1,this.#h=null,this.#g=null,this.#_=null,this.#v=null,this.#O=e=>{if(this.interactionMode===`select`&&this._isDragging){let n=this.#f(e.clientX,e.clientY);if(n===this._selectionEnd)return;this._selectionEnd=n;let r=Math.min(this._selectionStart,this._selectionEnd),i=Math.max(this._selectionStart,this._selectionEnd),a=this.#l();if(r<=i){let e=a[r],n=a[i];this.setColoredRange(e.valueMin,n.valueMax),this._selectionOverlayText=`Select: ${e.valueMin.toFixed(2)} – ${n.valueMax.toFixed(2)}`}this.requestUpdate(),this.#s(!1);return}if(this.interactionMode===`select`||this.valueTooltips===`none`)return;let n=this.#d(e.clientX,e.clientY),r=n>=0?n:null;this.valueTooltips===`inline`?this.#D(r):this.#T(r,e.clientX,e.clientY)},this.#k=()=>{if(this.interactionMode===`select`){this._isDragging&&(this._isDragging=!1,this._selectionOverlayText=null,this.requestUpdate(),this.#s(!0));return}this.valueTooltips!==`none`&&(this.valueTooltips===`inline`?this.#D(null):this.#T(null,0,0))},this.#A=e=>{if(this.interactionMode!==`select`)return;let n=this.#f(e.clientX,e.clientY);this._isDragging=!0,this._selectionStart=n,this._selectionEnd=n;let r=this.#l(),i=r[n],a=r[n];this.setColoredRange(i.valueMin,a.valueMax),this._selectionOverlayText=`Select: ${i.valueMin.toFixed(2)} – ${a.valueMax.toFixed(2)}`,this.requestUpdate(),this.#s(!1)},this.#j=()=>{this.interactionMode===`select`&&this._isDragging&&(this._isDragging=!1,this.#s(!0))}}#e;#t;#n(e){return e?e.trim().split(/[,\s;]+/).map(e=>Number.parseFloat(e)).filter(e=>!Number.isNaN(e)):[]}add(e){this.#t=!0,this.#e.add(e),!this.paused&&this.requestUpdate()}set(e){this.#t=!0,this.#e.set(e),!this.paused&&this.requestUpdate()}clear(){this.#e.clear(),this.requestUpdate()}setColoredRange(e,n){this._coloredRangeMin=e,this._coloredRangeMax=n,this.requestUpdate()}clearColoredRange(){this._coloredRangeMin=null,this._coloredRangeMax=null,this.requestUpdate()}setSelection(e,n){let r=this.#l(),i=Math.min(e,n),a=Math.max(e,n),o=Math.max(0,Math.min(i,r.length-1)),s=Math.max(0,Math.min(a,r.length-1));if(this._selectionStart=o,this._selectionEnd=s,o<=s){let e=r[o],n=r[s];this.setColoredRange(e.valueMin,n.valueMax)}this.requestUpdate(),this.#s(!0)}clearSelection(){let e=this._selectionStart!==null||this._selectionEnd!==null;this._selectionStart=null,this._selectionEnd=null,this.requestUpdate(),e&&this.#s(!0)}getSelectedRange(){if(this._selectionStart===null||this._selectionEnd===null)return{barIndices:null,dataValues:null};let e=this.#l(),n=Math.min(this._selectionStart,this._selectionEnd),r=Math.max(this._selectionStart,this._selectionEnd),i=Math.max(0,Math.min(n,e.length-1)),a=Math.max(0,Math.min(r,e.length-1)),o=e[i],s=e[a];return{barIndices:{start:i,end:a},dataValues:{min:o.valueMin,max:s.valueMax}}}firstUpdated(e){if(this._width=this.clientWidth||100,this._height=this.clientHeight||40,new ResizeObserver(e=>{let n=e[0];this._width=n.contentRect.width,this._height=n.contentRect.height}).observe(this),!this.#t){let e=this.#n(this.textContent??``);e.length>0&&this.#e.set(e)}let n=this.getAttribute(`title`);n!==null&&(this.title=n,this.removeAttribute(`title`))}updated(e){if(e.has(`capacity`)){let e=[...this.#e.values];this.#e=new XT({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,fE(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);dE(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,fE(this)},this.tooltipDelay));return}this.#g!==null&&(clearTimeout(this.#g),this.#g=null);let i=this.#l()[e];if(!i)return;let a=this.valueFormat(i.valueMin,i.valueMax,i.count),o=this.#C(i,n,r);if(this.#_=o,this.#m){dE(this,a,o.mainClient,o.crossClient,this.orientation),this.#b(()=>this.#w());return}this.#h!==null&&clearTimeout(this.#h),this.#h=window.setTimeout(()=>{this.#h=null,this.#m=!0,dE(this,a,o.mainClient,o.crossClient,this.orientation),this.#b(()=>this.#w())},this.tooltipDelay)}#E(e){let n=this.#l()[e];return n?this.valueFormat(n.valueMin,n.valueMax,n.count):null}#D(e){if(e!==this._hoveredIndex){if(this._hoveredIndex=e,this.#y(),e===null){this._inlineOverlayText=null;return}this._inlineOverlayText=this.#E(e),this.#b(()=>{this._hoveredIndex!==null&&(this._inlineOverlayText=this.#E(this._hoveredIndex))})}}#O;#k;#A;#j;render(){let{w:e,h:n,padding:r}=this.#c(),a=this.#l().map((e,n)=>{let r=this.#u(e)?``:`filter: grayscale(1)`;return s`
|
|
10451
10451
|
<rect class="bar" x=${e.x} y=${e.y} width=${e.width} height=${e.height}
|
|
10452
10452
|
style="--value: ${e.relativeValue}; ${r}"
|
|
10453
10453
|
@click=${()=>this.#o(n,e.valueMin,e.valueMax,e.relativeValue)} />
|
|
@@ -10496,37 +10496,37 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
10496
10496
|
dominant-baseline: hanging;
|
|
10497
10497
|
pointer-events: none;
|
|
10498
10498
|
}
|
|
10499
|
-
`}};E([d({attribute:`orientation`})],X.prototype,`orientation`,void 0),E([d({type:Number})],X.prototype,`resolution`,void 0),E([d({type:Number})],X.prototype,`min`,void 0),E([d({type:Number})],X.prototype,`max`,void 0),E([d({type:Number})],X.prototype,`capacity`,void 0),E([d({attribute:!1})],X.prototype,`title`,void 0),E([d({type:Boolean,reflect:!0})],X.prototype,`paused`,void 0),E([d({attribute:`value-tooltips`})],X.prototype,`valueTooltips`,void 0),E([d({type:Number,attribute:`tooltip-delay`})],X.prototype,`tooltipDelay`,void 0),E([d({type:Number,attribute:`value-update-interval`})],X.prototype,`valueUpdateInterval`,void 0),E([d({attribute:`interaction-mode`})],X.prototype,`interactionMode`,void 0),E([m()],X.prototype,`_width`,void 0),E([m()],X.prototype,`_height`,void 0),E([m()],X.prototype,`_hoveredIndex`,void 0),E([m()],X.prototype,`_inlineOverlayText`,void 0),E([m()],X.prototype,`_coloredRangeMin`,void 0),E([m()],X.prototype,`_coloredRangeMax`,void 0),E([m()],X.prototype,`_selectionStart`,void 0),E([m()],X.prototype,`_selectionEnd`,void 0),E([m()],X.prototype,`_isDragging`,void 0),E([m()],X.prototype,`_selectionOverlayText`,void 0),X=E([T(`ixfx-plot-histogram`)],X);function
|
|
10500
|
-
d=${
|
|
10499
|
+
`}};E([d({attribute:`orientation`})],X.prototype,`orientation`,void 0),E([d({type:Number})],X.prototype,`resolution`,void 0),E([d({type:Number})],X.prototype,`min`,void 0),E([d({type:Number})],X.prototype,`max`,void 0),E([d({type:Number})],X.prototype,`capacity`,void 0),E([d({attribute:!1})],X.prototype,`title`,void 0),E([d({type:Boolean,reflect:!0})],X.prototype,`paused`,void 0),E([d({attribute:`value-tooltips`})],X.prototype,`valueTooltips`,void 0),E([d({type:Number,attribute:`tooltip-delay`})],X.prototype,`tooltipDelay`,void 0),E([d({type:Number,attribute:`value-update-interval`})],X.prototype,`valueUpdateInterval`,void 0),E([d({attribute:`interaction-mode`})],X.prototype,`interactionMode`,void 0),E([m()],X.prototype,`_width`,void 0),E([m()],X.prototype,`_height`,void 0),E([m()],X.prototype,`_hoveredIndex`,void 0),E([m()],X.prototype,`_inlineOverlayText`,void 0),E([m()],X.prototype,`_coloredRangeMin`,void 0),E([m()],X.prototype,`_coloredRangeMax`,void 0),E([m()],X.prototype,`_selectionStart`,void 0),E([m()],X.prototype,`_selectionEnd`,void 0),E([m()],X.prototype,`_isDragging`,void 0),E([m()],X.prototype,`_selectionOverlayText`,void 0),X=E([T(`ixfx-plot-histogram`)],X);function vE(e){if(e.length===0)return``;let n=`M ${e[0].x},${e[0].y}`;for(let r=1;r<e.length;r++)n+=` L ${e[r].x},${e[r].y}`;return n}function yE(e,n,r,i){return s`<path
|
|
10500
|
+
d=${vE(e)}
|
|
10501
10501
|
fill="none"
|
|
10502
10502
|
stroke=${n.fill}
|
|
10503
10503
|
stroke-width=${r}
|
|
10504
10504
|
opacity=${n.opacity}
|
|
10505
10505
|
stroke-linecap=${i?`round`:`butt`}
|
|
10506
10506
|
stroke-linejoin=${i?`round`:`miter`}
|
|
10507
|
-
/>`}function
|
|
10507
|
+
/>`}function bE(e,n,r,i){if(e.length<2)return s``;let a=vE(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 xE(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 SE(e,n,r,i){return e.map((e,a)=>{let o=i===`size`?r*Math.max(.2,e.ageFraction):r;return s`<rect
|
|
10508
10508
|
x=${e.x-o/2} y=${e.y-o/2}
|
|
10509
10509
|
width=${o} height=${o}
|
|
10510
10510
|
fill=${n[a].fill} opacity=${n[a].opacity}
|
|
10511
|
-
/>`})}function
|
|
10511
|
+
/>`})}function CE(e,n,r,i,a){return e.map((e,o)=>{let c=a===`size`?r*Math.max(.2,e.ageFraction):r;return s`<line
|
|
10512
10512
|
x1=${e.x} y1=${i} x2=${e.x} y2=${e.y}
|
|
10513
10513
|
stroke=${n[o].fill} stroke-width=${c} opacity=${n[o].opacity}
|
|
10514
|
-
/>`})}function
|
|
10514
|
+
/>`})}function wE(e,n,r,i,a){return e.map((e,o)=>{let c=a===`size`?i*Math.max(.2,e.ageFraction):i;return s`<line
|
|
10515
10515
|
x1=${e.x-c/2} y1=${e.y} x2=${e.x+c/2} y2=${e.y}
|
|
10516
10516
|
stroke=${n[o].fill} stroke-width=${r} opacity=${n[o].opacity}
|
|
10517
|
-
/>`})}function
|
|
10517
|
+
/>`})}function TE(e,n,r,i,a){return e.map((e,o)=>{let c=a===`size`?r*Math.max(.2,e.ageFraction):r;return s`<rect
|
|
10518
10518
|
x=${e.x-c/2} y=${e.y}
|
|
10519
10519
|
width=${c} height=${Math.max(1,i-e.y)}
|
|
10520
10520
|
fill=${n[o].fill} opacity=${n[o].opacity}
|
|
10521
|
-
/>`})}function
|
|
10521
|
+
/>`})}function EE(e,n,r,i,a){return e.map((e,o)=>{let c=a===`size`?r*Math.max(.2,e.ageFraction):r;return s`<rect
|
|
10522
10522
|
x=${e.x-c/2} y=${i}
|
|
10523
10523
|
width=${c} height=${Math.max(1,e.y-i)}
|
|
10524
10524
|
fill=${n[o].fill} opacity=${n[o].opacity}
|
|
10525
|
-
/>`})}function
|
|
10525
|
+
/>`})}function DE(e,n,r,i,a){return e.map((e,o)=>{let c=a===`size`?r*Math.max(.2,e.ageFraction):r;return s`<rect
|
|
10526
10526
|
x=${e.x-c/2} y=${Math.min(e.y,i)}
|
|
10527
10527
|
width=${c} height=${Math.max(1,Math.abs(e.y-i))}
|
|
10528
10528
|
fill=${n[o].fill} opacity=${n[o].opacity}
|
|
10529
|
-
/>`})}let
|
|
10529
|
+
/>`})}let OE=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 XT,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,sE(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 XT({capacityLimit:this.capacity,persistentScaling:this.persistentScale,fixedRange:n}),e.length>0&&this.#e.set(e)}}#a(e,n){let r=this.#e.values.length;if(r===0)return-1;let i=e-n.left;if(i<0||i>n.width)return-1;let a=n.height<20?0:Math.min(4,n.height*.05),o=n.width-a*2,s=Math.floor((i-a)/(o/r));return s>=0&&s<r?s:-1}#o(e,n){if(!this.tooltips)return;let r=this.getBoundingClientRect(),i=this.#a(e,r);if(i<0){sE(this);return}aE(this,e,n,this.valueFormat(this.#e.values[i]))}#s(){this.#n!==null&&this.#r!==null&&this.#o(this.#n,this.#r)}#c;#l;#u;#d(e,n,r,i,a,o){let s=e.length,c=s>0?a/s:a,l=e=>i+(e+.5)*c;return e.map((e,a)=>{let c=$r(hE(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[bE(e,l,o,d),this.drawStyle===`line-sharp`?yE(e,l,r,!1):yE(e,l,r,!0)];switch(this.drawStyle){case`line-sharp`:return[yE(e,l,r,!1)];case`line-round`:return[yE(e,l,r,!0)];case`circles`:return xE(e,n,i,this.ageStyle);case`squares`:return SE(e,n,i*2,this.ageStyle);case`vbar`:return CE(e,n,r,o,this.ageStyle);case`hbar`:return wE(e,n,r,a,this.ageStyle);case`hist-bottom`:return TE(e,n,a,o,this.ageStyle);case`hist-top`:return EE(e,n,a,s,this.ageStyle);case`hist-middle`:return DE(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=pE(r,a),m=mE(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?WT(this):``,y={mode:this.colorMode,palette:GT(this.colorScale),easingName:this.colorEasing,valueMap:this.colorValueMap},b=this.drawStyle!==`line-sharp`&&this.drawStyle!==`line-round`,x=_.map(e=>{let n=JT(e.scaledValue,v,y);return b?YT(n,e.ageFraction,this.ageStyle):n}),S=_.length>0?this.#f(_,x,p,m,h,u,d,f):[],ee=this.title?s`<text
|
|
10530
10530
|
x=${o+2} y=${d+Math.min(10,a*.6)}
|
|
10531
10531
|
class="overlay-text"
|
|
10532
10532
|
fill=${g}
|
|
@@ -10572,7 +10572,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
10572
10572
|
dominant-baseline: hanging;
|
|
10573
10573
|
pointer-events: none;
|
|
10574
10574
|
}
|
|
10575
|
-
`}};E([d({attribute:`draw-style`})],
|
|
10575
|
+
`}};E([d({attribute:`draw-style`})],OE.prototype,`drawStyle`,void 0),E([d({attribute:`age-style`})],OE.prototype,`ageStyle`,void 0),E([d()],OE.prototype,`title`,void 0),E([d({type:Boolean})],OE.prototype,`precise`,void 0),E([d({type:Boolean})],OE.prototype,`tooltips`,void 0),E([d({type:Number})],OE.prototype,`capacity`,void 0),E([d({type:Number})],OE.prototype,`rangeMin`,void 0),E([d({type:Number})],OE.prototype,`rangeMax`,void 0),E([d({type:Boolean,attribute:`persistent-scale`})],OE.prototype,`persistentScale`,void 0),E([d({type:Boolean,reflect:!0})],OE.prototype,`paused`,void 0),E([d({type:Boolean,attribute:`click-pauses`})],OE.prototype,`clickPauses`,void 0),E([d({type:Boolean,attribute:`shaded`})],OE.prototype,`shaded`,void 0),E([d({attribute:`area-color`})],OE.prototype,`areaColor`,void 0),E([d({attribute:`color-mode`})],OE.prototype,`colorMode`,void 0),E([d({attribute:`color-easing`})],OE.prototype,`colorEasing`,void 0),E([d({attribute:`color-scale`})],OE.prototype,`colorScale`,void 0),E([m()],OE.prototype,`_width`,void 0),E([m()],OE.prototype,`_height`,void 0),OE=E([T(`ixfx-plot-single-axis`)],OE);let kE=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 XT({capacityLimit:100,persistentScaling:!0}),this.#t=new XT({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,sE(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 XT(e),this.#t=new XT(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+hE(i[f],s,c)*n,y:e+(1-hE(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:GT(this.colorScale),easingName:this.colorEasing,valueMap:this.colorValueMap};return e.map(e=>YT(JT(e.ageFraction,n,r),e.ageFraction,this.ageStyle))}#i(e,n,r,i){let a=e-i.left,o=n-i.top,s=null,c=1/0;for(let e of r){let n=e.x-a,r=e.y-o,i=n*n+r*r;i<c&&(c=i,s=e)}return s&&Math.sqrt(c)<30?s:null}#a;#o;#s;#c(e,n){if(!this.tooltips)return;let r=this.getBoundingClientRect(),i=this.#i(e,n,this.#a,r);if(!i){sE(this);return}aE(this,e,n,this.valueFormat(i.xVal,i.yVal))}#l(){this.#o!==null&&this.#s!==null&&this.#c(this.#o,this.#s)}#u;#d;#f;render(){let e=this._width,n=this._height,r=Math.min(6,Math.min(e,n)*.06),a=Math.max(1,e-r*2),o=Math.max(1,n-r*2),c=this.#n(r,a,o);this.#a=c;let l=c.length>0?WT(this):``,u=this.#r(c,l),d=mE(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
|
|
10576
10576
|
x=${r+2} y=${r+2}
|
|
10577
10577
|
class="overlay-text"
|
|
10578
10578
|
fill=${f}
|
|
@@ -10617,7 +10617,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
10617
10617
|
dominant-baseline: hanging;
|
|
10618
10618
|
pointer-events: none;
|
|
10619
10619
|
}
|
|
10620
|
-
`}};E([d({attribute:`draw-style`})],
|
|
10620
|
+
`}};E([d({attribute:`draw-style`})],kE.prototype,`drawStyle`,void 0),E([d({attribute:`age-style`})],kE.prototype,`ageStyle`,void 0),E([d()],kE.prototype,`title`,void 0),E([d({type:Boolean})],kE.prototype,`precise`,void 0),E([d({type:Boolean})],kE.prototype,`tooltips`,void 0),E([d({type:Number})],kE.prototype,`capacity`,void 0),E([d({type:Boolean,attribute:`persistent-scale`})],kE.prototype,`persistentScale`,void 0),E([d({type:Boolean,reflect:!0})],kE.prototype,`paused`,void 0),E([d({type:Boolean,attribute:`click-pauses`})],kE.prototype,`clickPauses`,void 0),E([d({attribute:`color-mode`})],kE.prototype,`colorMode`,void 0),E([d({attribute:`color-easing`})],kE.prototype,`colorEasing`,void 0),E([d({attribute:`color-scale`})],kE.prototype,`colorScale`,void 0),E([m()],kE.prototype,`_width`,void 0),E([m()],kE.prototype,`_height`,void 0),kE=E([T(`ixfx-plot-xy-axis`)],kE);const AE=Math.PI/180,jE=180/Math.PI;function ME(e,n){let r=n*50;return{x:50+Math.cos(e)*r,y:50+Math.sin(e)*r}}function NE(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 PE=e=>Math.max(0,Math.min(1,e));function FE(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 IE(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 LE(e,n){if(!n||n<=1)return e;let r=360/n,i=(e%360+360)%360;return Math.round(i/r)*r}function RE(e,n){if(!n||n<=1)return e;let r=1/n;return Math.round(e/r)*r}let zE=class extends Oy(n){constructor(...e){super(...e),this.angle=0,this.radius=.5,this.rings=0,this.rays=0,this.showRay=!1,this.showOrigin=!1,this.hideCursor=!1,this.snapValue=!1,this.disabled=!1,this._dragging=!1,this._dragStartAngle=0,this._dragStartRadius=0,this._pressedKeys=new Set,this._prevAngle=0,this._prevRadius=0,this._onPointerDown=e=>{e.preventDefault(),this.renderRoot.querySelector(`svg`)?.focus();let n=this.renderRoot.querySelector(`.polar-pad-area`);n&&n.setPointerCapture(e.pointerId),this._dragging=!0,this._dragStartAngle=this.angle,this._dragStartRadius=this.radius,this.setAttribute(`dragging`,``),this._updateFromPointer(e),globalThis.addEventListener(`pointermove`,this._onPointerMove),globalThis.addEventListener(`pointerup`,this._onPointerUp)},this._onPointerMove=e=>{this._dragging&&(e.preventDefault(),this._updateFromPointer(e))},this._onPointerUp=()=>{let e=this.angle!==this._dragStartAngle||this.radius!==this._dragStartRadius;this._dragging=!1,this.removeAttribute(`dragging`),globalThis.removeEventListener(`pointermove`,this._onPointerMove),globalThis.removeEventListener(`pointerup`,this._onPointerUp),e&&this.dispatchEvent(new CustomEvent(`change`,{detail:{angle:this.angle,radius:this.radius},bubbles:!0,composed:!0}))},this._onKeyDown=e=>{if(!this.disabled){if([`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`].includes(e.key))e.preventDefault(),this._pressedKeys.add(e.key),this._handleKeyboardMove(e.shiftKey);else if(e.key===`Home`||e.key===`End`){e.preventDefault();let n=e.key===`Home`?0:1;n!==this.radius&&(this._prevRadius=this.radius,this.radius=n,this.dispatchEvent(new CustomEvent(`input`,{detail:{angle:this.angle,radius:this.radius},bubbles:!0,composed:!0})))}}},this._onKeyUp=e=>{this._pressedKeys.delete(e.key)},this._handleKeyboardMove=e=>{let n=this.stopsAngle??this.stops,r=this.stopsRadius??this.stops,i=Dy(360,n,this.stepAngle,e),a=Dy(1,r,this.stepRadius,e);this._prevAngle=this.angle,this._prevRadius=this.radius;let o=this.angle,s=this.radius;this._pressedKeys.has(`ArrowLeft`)&&(o-=i),this._pressedKeys.has(`ArrowRight`)&&(o+=i),this._pressedKeys.has(`ArrowUp`)&&(s=Math.min(1,s+a)),this._pressedKeys.has(`ArrowDown`)&&(s=Math.max(0,s-a)),o=(o%360+360)%360;let c=FE(o,this._prevAngle,this.rays,this.snapValue),l=IE(s,this._prevRadius,this.rings,this.snapValue);c=LE(c,n),l=RE(l,r),(c!==this.angle||l!==this.radius)&&(this.angle=c,this.radius=l,this.dispatchEvent(new CustomEvent(`input`,{detail:{angle:this.angle,radius:this.radius},bubbles:!0,composed:!0})))},this._uid=Math.random().toString(36).slice(2,8)}static{this.styles=[sn,w,r`
|
|
10621
10621
|
:host {
|
|
10622
10622
|
display: block;
|
|
10623
10623
|
width: 200px;
|
|
@@ -10750,7 +10750,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
10750
10750
|
stroke: var(--accent);
|
|
10751
10751
|
stroke-width: 3;
|
|
10752
10752
|
}
|
|
10753
|
-
`]}_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}=
|
|
10753
|
+
`]}_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}=NE((e.clientX-r.left)/i*100,(e.clientY-r.top)/i*100),s=a*jE,c=PE(o);this._prevAngle=this.angle,this._prevRadius=this.radius;let l=FE(s,this._prevAngle,this.rays,this.snapValue),u=IE(c,this._prevRadius,this.rings,this.snapValue),d=this.stopsAngle??this.stops,f=this.stopsRadius??this.stops;this.angle=LE(l,d),this.radius=RE(u,f),this._prevAngle=s,this._prevRadius=c,this.dispatchEvent(new CustomEvent(`input`,{detail:{angle:this.angle,radius:this.radius},bubbles:!0,composed:!0}))}_stepRadiusByDelta(e,n){let r=this.stopsRadius??this.stops,i=Dy(1,r,this.stepRadius,n);this._prevRadius=this.radius;let a=RE(IE(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*AE}`),this.style.setProperty(`--radius-pct`,`${PE(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}=ME(this.angle*AE,PE(this.radius));return i`
|
|
10754
10754
|
<div class="polar-pad-area"
|
|
10755
10755
|
@pointerdown=${this._onPointerDown}
|
|
10756
10756
|
@keydown=${this._onKeyDown}
|
|
@@ -10789,7 +10789,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
10789
10789
|
/>
|
|
10790
10790
|
</svg>
|
|
10791
10791
|
</div>
|
|
10792
|
-
`}};E([d({type:Number})],
|
|
10792
|
+
`}};E([d({type:Number})],zE.prototype,`angle`,void 0),E([d({type:Number})],zE.prototype,`radius`,void 0),E([d({type:Number})],zE.prototype,`rings`,void 0),E([d({type:Number})],zE.prototype,`rays`,void 0),E([d({type:Boolean,reflect:!0,attribute:`show-ray`})],zE.prototype,`showRay`,void 0),E([d({type:Boolean,reflect:!0,attribute:`show-origin`})],zE.prototype,`showOrigin`,void 0),E([d({type:Boolean,reflect:!0,attribute:`hide-cursor`})],zE.prototype,`hideCursor`,void 0),E([d({type:Boolean,attribute:`snap-value`,reflect:!0})],zE.prototype,`snapValue`,void 0),E([d({type:Boolean,reflect:!0})],zE.prototype,`disabled`,void 0),E([d({type:Number})],zE.prototype,`stops`,void 0),E([d({type:Number,attribute:`stops-angle`})],zE.prototype,`stopsAngle`,void 0),E([d({type:Number,attribute:`stops-radius`})],zE.prototype,`stopsRadius`,void 0),E([d({type:Number,attribute:`step-angle`})],zE.prototype,`stepAngle`,void 0),E([d({type:Number,attribute:`step-radius`})],zE.prototype,`stepRadius`,void 0),zE=E([T(`ixfx-polar-pad`)],zE);const BE=r`
|
|
10793
10793
|
|
|
10794
10794
|
output.tooltip {
|
|
10795
10795
|
user-select: none;
|
|
@@ -10886,7 +10886,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
10886
10886
|
100% calc(50% + var(--b)/2));
|
|
10887
10887
|
}
|
|
10888
10888
|
}
|
|
10889
|
-
`;function
|
|
10889
|
+
`;function VE(e,n,r){return r===n?0:(e-n)/(r-n)}let HE=class extends Oy(n){constructor(...e){super(...e),this.min=0,this.max=1,this.value=0,this.step=.01,this.orientation=`horizontal`,this.swipeable=!1,this.tooltip=!1,this.tooltipOrientation=`top`,this._swipeModified=!1,this._onPointerDown=e=>{this.swipeable&&(e.preventDefault(),this._swipeModified=!1,this._applySwipeValue(this._valueFromPointer(e)),window.addEventListener(`pointerup`,this._onWindowPointerUp,{once:!0}))},this._onPointerMove=e=>{!this.swipeable||e.buttons===0||this._applySwipeValue(this._valueFromPointer(e))},this._onPointerEnter=e=>{!this.swipeable||e.buttons===0||(this._swipeModified=!1,this._applySwipeValue(this._valueFromPointer(e)),window.addEventListener(`pointerup`,this._onWindowPointerUp,{once:!0}))},this._onPointerLeave=e=>{!this.swipeable||!this._swipeModified||(this._swipeModified=!1,this.dispatchEvent(new CustomEvent(`change`,{detail:{value:this.value},bubbles:!0,composed:!0})))},this._onWindowPointerUp=()=>{this._swipeModified&&(this._swipeModified=!1,this.dispatchEvent(new CustomEvent(`change`,{detail:{value:this.value},bubbles:!0,composed:!0})))},this._handleInput=e=>{e.preventDefault(),e.stopImmediatePropagation();let n=e.target,r=Number.parseFloat(n.value);this.value=r,this.style.setProperty(`--value`,String(VE(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(VE(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(VE(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,VE(n,this.min,this.max));let r=this.step>=1?0:this.step>=.1?1:2;return n.toFixed(r)})}_formatTooltipLabel(){let e=VE(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`
|
|
10890
10890
|
<ixfx-tooltip
|
|
10891
10891
|
style="--tooltip-background: var(--surface-5); --tooltip-color: var(--surface-5-text)"
|
|
10892
10892
|
.orientation=${this.tooltipOrientation}
|
|
@@ -10906,7 +10906,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
10906
10906
|
@change=${this._handleChange}
|
|
10907
10907
|
>${e}
|
|
10908
10908
|
</div>
|
|
10909
|
-
`}static{this.styles=[w,
|
|
10909
|
+
`}static{this.styles=[w,BE,r`
|
|
10910
10910
|
:host {
|
|
10911
10911
|
display: block;
|
|
10912
10912
|
container-type: size;
|
|
@@ -11186,14 +11186,14 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
11186
11186
|
:host([swipeable][orientation="vertical"]):hover .range-bg {
|
|
11187
11187
|
background: var(--background-track-hover-vertical, var(--_bg-track-hover));
|
|
11188
11188
|
}
|
|
11189
|
-
`]}};E([d({type:Number})],
|
|
11189
|
+
`]}};E([d({type:Number})],HE.prototype,`min`,void 0),E([d({type:Number})],HE.prototype,`max`,void 0),E([d({type:Number})],HE.prototype,`value`,void 0),E([d({type:Number})],HE.prototype,`step`,void 0),E([d({type:String,reflect:!0})],HE.prototype,`orientation`,void 0),E([d({type:Boolean,reflect:!0})],HE.prototype,`swipeable`,void 0),E([d({type:Boolean})],HE.prototype,`tooltip`,void 0),E([d({type:String,attribute:`tooltip-orientation`})],HE.prototype,`tooltipOrientation`,void 0),E([d({attribute:!1})],HE.prototype,`labelFormatter`,void 0),E([f(`input`)],HE.prototype,`_inputEl`,void 0),E([f(`ixfx-tooltip`)],HE.prototype,`_tooltipEl`,void 0),HE=E([T(`ixfx-range-input`)],HE);function UE(e){return{client:{x:e.clientX,y:e.clientY},offset:{x:e.offsetX,y:e.offsetY}}}function WE(e,n){let r=UE(e),i=e=>{n.progress(UE(e),r)},a=e=>{document.removeEventListener(`pointermove`,i),document.removeEventListener(`pointerup`,a),n.complete(UE(e),r)};document.addEventListener(`pointermove`,i),document.addEventListener(`pointerup`,a)}function GE(e,n){let r=e-n,i=e+n;return e=>e>=r&&e<=i}let KE=class extends n{constructor(...e){super(...e),this.tooltip=!0,this.tooltipOrientation=`top`,this.crossover=`allow`,this.resizeMode=`dual`,this.orientation=`horizontal`,this.step=1,this.a=0,this.b=50,this.#e=100,this.#t=0,this.#n=e=>e,this.#r=e=>e,this.#i=e=>e,this.draggingThumb=`none`}#e;#t;#n;#r;#i;#a(){this.#n=si(this.#t,this.#e,0,100),this.#r=si(0,100,this.#t,this.#e),this.#i=ei(this.#t,this.#e),this.a=this.#i(this.a),this.b=this.#i(this.b)}set max(e){this.#e=e,this.#a()}get max(){return this.#e}set min(e){this.#t=e,this.#a()}get min(){return this.#t}_onInput(e){e.stopPropagation();let n=e.target,r=this.#r(n.valueAsNumber),i=n.id,a=this.a,o=this.b;if(this.resizeMode===`none`){let e=r-(i===`a`?this.a:this.b),s=this.a+e,c=this.b+e;if(s<this.min&&(e=this.min-this.a),c>this.max&&(e=this.max-this.b),e===0){n.valueAsNumber=this.#n(i===`a`?this.a:this.b);return}a=this.a+e,o=this.b+e}else if(this.resizeMode===`bipolar`){let e,s;if(i===`a`){let n=r-this.a;e=r,s=this.b-n}else{let n=r-this.b;e=this.a-n,s=r}if(e<this.min||s>this.max||e>this.max||s<this.min){n.valueAsNumber=this.#n(i===`a`?this.a:this.b);return}a=e,o=s}else if(this.resizeMode===`bipolar-flex`){let e,s;if(i===`a`){if(e=r,this.b<=this.min)s=this.min;else if(this.b>=this.max)s=this.max;else{let e=r-this.a;s=this.b-e}}else if(s=r,this.a<=this.min)e=this.min;else if(this.a>=this.max)e=this.max;else{let n=r-this.b;e=this.a-n}if(e<this.min&&(e=this.min),e>this.max&&(e=this.max),s<this.min&&(s=this.min),s>this.max&&(s=this.max),e>s){n.valueAsNumber=this.#n(i===`a`?this.a:this.b);return}a=e,o=s}else if(i===`a`)r>this.b&&this.crossover===`stop`?n.valueAsNumber=this.#n(this.a):a=r;else if(i===`b`)r<a&&this.crossover===`stop`?n.valueAsNumber=this.#n(this.b):o=r;else throw Error(`Expected 'a' or 'b', got: '${n.id}'`);this.setPoles(a,o)}setPoles(e,n){let r=e!==this.a,i=n!==this.b;this.a=this.#i(e),this.b=this.#i(n),this.dispatchEvent(new CustomEvent(`input`,{detail:{a:this.a,b:this.b,changed:r&&i?`both`:r?`a`:`b`}}))}_onPointerDown(e){let n=this.a,r=this.b;this.valuesAtPointerDown={a:n,b:r};let i=e.target.getBoundingClientRect(),a=this.orientation===`vertical`,o=a?i.height:i.width,s=o/(this.max-this.min),c=a?e.offsetY:e.offsetX,l=e=>a?this.max-e*s:e*s,u=e=>a?o-e*s:e*s,d=u(n),f=u(r);if(a?(this.b<this.a?c>f:c<f)||(this.b<this.a?c<d:c>d):this.b<this.a&&c<f||this.b>this.a&&c>f||this.a<this.b&&c<d||this.a>this.b&&c>d){if(this.resizeMode===`none`||this.resizeMode===`bipolar`||this.resizeMode===`bipolar-flex`){let e=l(c)-this.b;this.a+e<this.min&&(e=this.min-this.a),this.b+e>this.max&&(e=this.max-this.b);let n=this.a+e,r=this.b+e;n>=this.min&&r<=this.max&&this.setPoles(n,r)}else this.b=l(c);return}let p=GE(d,10),m=GE(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;WE(e,{progress(e,l){let d=a?e.offset.y:e.offset.x,f=(a?m-d:d-m)/s;if(h=!0,i===`a`){if(c===`bipolar`){let e=n+f,i=r-f;if(e<u||i>p||e>p||i<u)return;o(e,i)}else if(c===`bipolar-flex`){let e=n+f,i=r;if(r<=u?i=u:r>=p?i=p:(e=n+f,i=r-f),e<u&&(e=u),e>p&&(e=p),i<u&&(i=u),i>p&&(i=p),e>i)return;o(e,i)}else{let e=f;n+f<u&&(e=u-n),r+e>p&&(e=p-r);let i=n+e,a=r+e;i>=u&&a<=p&&o(i,a)}}else if(i===`b`){if(c===`bipolar`){let e=n-f,i=r+f;if(e<u||i>p||e>p||i<u)return;o(e,i)}else if(c===`bipolar-flex`){let e=n,i=r+f;if(n<=u?e=u:n>=p?e=p:(e=n-f,i=r+f),e<u&&(e=u),e>p&&(e=p),i<u&&(i=u),i>p&&(i=p),e>i)return;o(e,i)}else{let e=f;n+f<u&&(e=u-n),r+e>p&&(e=p-r);let i=n+e,a=r+e;i>=u&&a<=p&&o(i,a)}}else if(c===`bipolar`){let e=n+f,i=r+f;if(e<u||i>p)return;o(e,i)}else if(c===`bipolar-flex`){let e=n+f,i=r+f;if(e<u?(e=u,i=u+(r-n)):i>p&&(i=p,e=p-(r-n)),e<u||i>p||e>i)return;o(e,i)}else{let e=f;n+f<u&&(e=u-n),r+e>p&&(e=p-r);let i=n+e,a=r+e;i>=u&&a<=p&&o(i,a)}},complete(i,s){if(!h){let i=a?e.offsetY:e.offsetX;Math.abs(i-d)<Math.abs(i-f)?o(l(i),r):o(n,l(i))}}})};if(p(c)){if(this.draggingThumb=`a`,this.resizeMode===`dual`)return!1;e.preventDefault(),e.target.setPointerCapture(e.pointerId),h(`a`);return}if(m(c)){if(this.draggingThumb=`b`,this.resizeMode===`dual`)return!1;e.preventDefault(),e.target.setPointerCapture(e.pointerId),h(`b`);return}this.draggingThumb=`none`,e.preventDefault(),e.target.setPointerCapture(e.pointerId),h(`none`)}firstUpdated(e){this.#a()}render(){let e=this.tooltip?i`<ixfx-tooltip style="--tooltip-background: var(--surface-5); --tooltip-color: var(--surface-5-text)" anchor="--a-tooltip" .orientation=${this.tooltipOrientation} .value=${this.a}></ixfx-tooltip>`:a,n=this.tooltip?i`<ixfx-tooltip style="--tooltip-background: var(--surface-5); --tooltip-color: var(--surface-5-text)" anchor="--b-tooltip" .orientation=${this.tooltipOrientation} .value=${this.b}></ixfx-tooltip>`:a,r=this.#n(this.a),o=this.#n(this.b),s=this.orientation===`vertical`?`writing-mode: vertical-lr; direction: rtl;`:a;return i`
|
|
11190
11190
|
<div @pointerdown=${this._onPointerDown} @input=${this._onInput} style="--a: ${r}; --b: ${o}">
|
|
11191
11191
|
<input class="thumb-round" .value=${r} id="a" step=${this.step} type="range" style="${s}" anchor="--a-tooltip" />
|
|
11192
11192
|
${e}
|
|
11193
11193
|
|
|
11194
11194
|
<input class="thumb-round" .value=${o} id="b" step=${this.step} type="range" style="${s}" anchor="--b-tooltip" />
|
|
11195
11195
|
${n}
|
|
11196
|
-
</div>`}static{this.styles=[w,
|
|
11196
|
+
</div>`}static{this.styles=[w,BE,sn,r`
|
|
11197
11197
|
:host {
|
|
11198
11198
|
display: grid;
|
|
11199
11199
|
--value-label-color: unset;
|
|
@@ -11338,14 +11338,14 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
11338
11338
|
[type=range]:focus, [type=range]:focus + ixfx-tooltip, [type=range]:hover, [type=range]:hover + ixfx-tooltip {
|
|
11339
11339
|
--sel: 1 ;
|
|
11340
11340
|
}
|
|
11341
|
-
`]}};E([d({type:Boolean})],
|
|
11341
|
+
`]}};E([d({type:Boolean})],KE.prototype,`tooltip`,void 0),E([d({type:String,attribute:`tooltip-orientation`})],KE.prototype,`tooltipOrientation`,void 0),E([d({type:String})],KE.prototype,`crossover`,void 0),E([d({type:String,attribute:`resize-mode`})],KE.prototype,`resizeMode`,void 0),E([d({type:String,reflect:!0})],KE.prototype,`orientation`,void 0),E([d()],KE.prototype,`step`,void 0),E([d({type:Number})],KE.prototype,`a`,void 0),E([d({type:Number})],KE.prototype,`b`,void 0),E([d({type:Number})],KE.prototype,`max`,null),E([d({type:Number})],KE.prototype,`min`,null),E([u({capture:!0})],KE.prototype,`_onInput`,null),E([u({capture:!0})],KE.prototype,`_onPointerDown`,null),KE=E([T(`ixfx-range-multi`)],KE);let qE=class extends Oy(n){constructor(...e){super(...e),this.tooltip=!0,this.tooltipOrientation=`top`,this.orientation=`horizontal`,this.disabled=!1,this.min=0,this.max=100,this.#e=0,this.step=0}set value(e){this.#e=e}get value(){return this.#e}#e;onRangeInput(e){let n=e.target.valueAsNumber,r=e.target.value;if(this.#e=n,this.tooltip){let e=this.shadowRoot?.querySelector(`output`);e?e.value=r:console.warn(`Output element not found`)}}_applyWheelDelta(e,n){let r=this.renderRoot?.querySelector(`input[type=range]`);if(!r)return;let i=this.step>0?this.step:Math.max((this.max-this.min)/100,.01),a=this.#e+e*i,o=Math.min(this.max,Math.max(this.min,a));o!==this.#e&&(r.value=String(o),r.dispatchEvent(new Event(`input`,{bubbles:!0})),r.dispatchEvent(new Event(`change`,{bubbles:!0})))}render(){let e=this.tooltip?i`<ixfx-tooltip
|
|
11342
11342
|
style="--tooltip-background: var(--surface-5); --tooltip-color: var(--surface-5-text)"
|
|
11343
11343
|
.orientation=${this.tooltipOrientation}
|
|
11344
11344
|
anchor="--thumb-tooltip"
|
|
11345
11345
|
.value=${this.value}></ixfx-tooltip>`:a,n=this.orientation===`vertical`?`writing-mode: vertical-lr; direction: rtl;`:a;return i`
|
|
11346
11346
|
<input ?disabled=${this.disabled} step=${this.step} min=${this.min} max=${this.max} value=${this.value} @input=${this.onRangeInput} type="range" style=${n}>
|
|
11347
11347
|
${e}
|
|
11348
|
-
`}static{this.styles=[w,sn,
|
|
11348
|
+
`}static{this.styles=[w,sn,BE,r`
|
|
11349
11349
|
:host {
|
|
11350
11350
|
display: inline-block;
|
|
11351
11351
|
--value-label-color: unset;
|
|
@@ -11404,7 +11404,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
11404
11404
|
[type="range"]:focus {
|
|
11405
11405
|
outline: none;
|
|
11406
11406
|
}
|
|
11407
|
-
`]}};E([d({type:Boolean})],
|
|
11407
|
+
`]}};E([d({type:Boolean})],qE.prototype,`tooltip`,void 0),E([d({type:String,attribute:`tooltip-orientation`})],qE.prototype,`tooltipOrientation`,void 0),E([d({type:String,reflect:!0})],qE.prototype,`orientation`,void 0),E([d({type:Boolean,attribute:!0})],qE.prototype,`disabled`,void 0),E([d({type:Number})],qE.prototype,`min`,void 0),E([d({type:Number})],qE.prototype,`max`,void 0),E([d({type:Number})],qE.prototype,`value`,null),E([d({type:Number})],qE.prototype,`step`,void 0),qE=E([T(`ixfx-range`)],qE);let JE=class extends n{constructor(...e){super(...e),this.value=0,this.max=5,this.allowHalf=!1,this.disabled=!1,this.readonly=!1,this.variant=`star`,this._preview=null}static{this.styles=[sn,r`
|
|
11408
11408
|
:host {
|
|
11409
11409
|
--ixfx-rating-size: 1.5rem;
|
|
11410
11410
|
--ixfx-rating-gap: 0.2rem;
|
|
@@ -11442,7 +11442,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
11442
11442
|
@click=${e=>this._commit(this._calc(e,a))}>
|
|
11443
11443
|
<svg viewBox="0 0 24 24" class="bg" fill="currentColor"><path d=${d}></path></svg>
|
|
11444
11444
|
${s||c?i`<svg viewBox="0 0 24 24" class="fill" fill="currentColor"><path d=${d}></path></svg>`:``}
|
|
11445
|
-
</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})],
|
|
11445
|
+
</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})],JE.prototype,`value`,void 0),E([d({type:Number})],JE.prototype,`max`,void 0),E([d({type:Boolean,attribute:`allow-half`})],JE.prototype,`allowHalf`,void 0),E([d({type:Boolean,reflect:!0})],JE.prototype,`disabled`,void 0),E([d({type:Boolean,reflect:!0})],JE.prototype,`readonly`,void 0),E([d({type:String})],JE.prototype,`variant`,void 0),E([m()],JE.prototype,`_preview`,void 0),JE=E([T(`ixfx-rating`)],JE);let YE=class extends Oy(n){constructor(...e){super(...e),this._selectedIndex=-1,this._slottedItems=[],this.tickled=new ie(this,{getItems:()=>this._slottedItems.map((e,n)=>({id:n,enabled:!0})),onStateChange:()=>this._syncTickled()}),this._onSlotChange=()=>{this._slottedItems=Array.from(this.shadowRoot?.querySelector(`slot`)?.assignedElements()??[]);let e=this._slottedItems.findIndex(e=>e.hasAttribute(`selected`)),n=e>=0?e:this._selectedIndex;n>=this._slottedItems.length&&(n=this._slottedItems.length-1),n<0&&this._slottedItems.length>0&&(n=0),this.selectedIndex=n},this._syncTickled=()=>{this._slottedItems.forEach((e,n)=>{let r=this.tickled.isTickled(n);e.classList.toggle(`tickled`,r),e.tabIndex=r&&this.tickled.inputMode===`keyboard`?0:-1})},this._findSlottedItem=e=>{let n=e instanceof Element?e:null;for(;n;){if(this._slottedItems.includes(n))return n;n=n.parentElement}},this._handlePointerOver=e=>{let n=this._findSlottedItem(e.target);n&&this.tickled.handlePointerEnter(this._slottedItems.indexOf(n))},this._handleKeyDown=e=>{e.key===`ArrowLeft`?(e.preventDefault(),this.tickled.handleKeyboardNavigation(`previous`),this._applyTickledSelection()):e.key===`ArrowRight`?(e.preventDefault(),this.tickled.handleKeyboardNavigation(`next`),this._applyTickledSelection()):e.key===`Home`?(e.preventDefault(),this.tickled.handleKeyboardNavigation(`first`),this._applyTickledSelection()):e.key===`End`&&(e.preventDefault(),this.tickled.handleKeyboardNavigation(`last`),this._applyTickledSelection())},this._applyTickledSelection=()=>{let e=this.tickled.tickledId;e!==void 0&&e!==this._selectedIndex&&(this.selectedIndex=e)},this._wheelCooldown=!1,this._handleClick=e=>{e.currentTarget.focus();let n=this._findSlottedItem(e.target),r=n?this._slottedItems.indexOf(n):-1;r>=0&&r!==this._selectedIndex&&(this.selectedIndex=r)},this._updateSelectedAttribute=()=>{this._slottedItems.forEach((e,n)=>{n===this._selectedIndex?e.setAttribute(`selected`,``):e.removeAttribute(`selected`)})},this._scrollSelectedIntoView=()=>{let e=this._slottedItems[this._selectedIndex];e&&e.scrollIntoView({inline:`center`,behavior:`smooth`})},this._emitChange=()=>{this.dispatchEvent(new CustomEvent(`change`,{detail:{selectedIndex:this._selectedIndex,selectedItem:this.selectedItem,selectedValue:this.selectedValue},bubbles:!0,composed:!0}))}}static{this.styles=[w,ae,oe,Og(`x`),r`
|
|
11446
11446
|
:host {
|
|
11447
11447
|
--select-horiz-item-width: 80%;
|
|
11448
11448
|
--select-horiz-gap: var(--space-s);
|
|
@@ -11538,7 +11538,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
11538
11538
|
<slot @slotchange=${this._onSlotChange}></slot>
|
|
11539
11539
|
<div class="spacer"></div>
|
|
11540
11540
|
</div>
|
|
11541
|
-
`}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()],
|
|
11541
|
+
`}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()],YE.prototype,`_selectedIndex`,void 0),E([m()],YE.prototype,`_slottedItems`,void 0),E([d({type:Number,reflect:!0,attribute:`selected-index`})],YE.prototype,`selectedIndex`,null),E([d({type:String})],YE.prototype,`selectedValue`,null),YE=E([T(`ixfx-select-horiz`)],YE);function XE(e,n,r){return Math.min(Math.max(e,n),r)}function ZE(e,n,r,i,a){return r===n?i:i+(e-n)/(r-n)*(a-i)}let QE=class extends Oy(n){constructor(...e){super(...e),this.display=`circle`,this.fillMode=`centre`,this.value=0,this.min=0,this.max=100,this.step=void 0,this.disabled=!1,this.#e=!1,this.#t=0,this.#n=0,this.#r=0,this.#d=e=>{if(this.disabled)return;e.preventDefault();let n=this.renderRoot.querySelector(`svg`);n?.focus(),this.#e=!0,this.#t=e.clientY,this.#r=e.clientY,this.#n=this.value,this.#i=this.value,this.toggleAttribute(`dragging`,!0),n&&n.setPointerCapture(e.pointerId),window.addEventListener(`pointermove`,this.#f),window.addEventListener(`pointerup`,this.#p),window.addEventListener(`pointercancel`,this.#p)},this.#f=e=>{if(!this.#e)return;e.preventDefault(),this.value!==this.#i&&(this.#n=this.value,this.#t=this.#r,this.#i=this.value);let n=this.clientHeight*2*(e.shiftKey?10:1),r=(this.#t-e.clientY)/n*(this.max-this.min),i=ZE(this.#n+r,this.min,this.max,0,1);this.#c(XE(i,0,1),!0),this.#r=e.clientY},this.#p=()=>{this.#e=!1,this.toggleAttribute(`dragging`,!1);let e=this.renderRoot.querySelector(`svg`);e&&`hasPointerCapture`in e&&typeof e.hasPointerCapture==`function`&&e.hasPointerCapture(1)&&e.releasePointerCapture(1),window.removeEventListener(`pointermove`,this.#f),window.removeEventListener(`pointerup`,this.#p),window.removeEventListener(`pointercancel`,this.#p)},this.#m=e=>{if(this.disabled)return;let n=this.max-this.min,r=Dy(n,this.stops,this.step,e.shiftKey),i=!1;switch(e.key){case`ArrowUp`:case`ArrowRight`:this.#h(r/n,!0),i=!0;break;case`ArrowDown`:case`ArrowLeft`:this.#h(-r/n,!0),i=!0;break;case`Home`:this.#c(0,!0),i=!0;break;case`End`:this.#c(1,!0),i=!0}i&&e.preventDefault()}}#e;#t;#n;#r;#i;#a;#o(){return ZE(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=ZE(e,0,1,this.min,this.max),i=this.#s(XE(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(XE(this.#o()+e,0,1),n)}_applyWheelDelta(e,n){let r=this.max-this.min,i=Dy(r,this.stops,this.step,n.shiftKey);this.#h(e*i/r,!0)}#g(){let e=this.#o(),n=45*e,r=50;return this.fillMode===`left`?r=5+45*e:this.fillMode===`right`&&(r=95-45*e),s`
|
|
11542
11542
|
<circle class="fill" cx="${r}" cy="${50}" r="${n}" />
|
|
11543
11543
|
<circle class="outline" cx="${50}" cy="${50}" r="${45}" fill="none" />
|
|
11544
11544
|
`}#_(){let e=this.#o();if(this.fillMode===`left`||this.fillMode===`right`){let n=90*e,r=this.fillMode===`left`?5:95-n;return s`
|
|
@@ -11605,10 +11605,10 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
11605
11605
|
fill: var(--shapefill-value-fill-color, var(--accent));
|
|
11606
11606
|
transition: var(--shapefill-value-fill-transition, none);
|
|
11607
11607
|
}
|
|
11608
|
-
`]}};E([d({type:String})],
|
|
11608
|
+
`]}};E([d({type:String})],QE.prototype,`display`,void 0),E([d({type:String,attribute:`fill-mode`})],QE.prototype,`fillMode`,void 0),E([d({type:Number})],QE.prototype,`value`,void 0),E([d({type:Number})],QE.prototype,`min`,void 0),E([d({type:Number})],QE.prototype,`max`,void 0),E([d({type:Number})],QE.prototype,`step`,void 0),E([d({type:Number})],QE.prototype,`stops`,void 0),E([d({type:Boolean,reflect:!0})],QE.prototype,`disabled`,void 0),QE=E([T(`ixfx-shapefill-value`)],QE);const $E=Array.from({length:30},(e,n)=>n%10),eD={lead:0,integer:1,decimal:2,fraction:3,trail:4};function tD(e,n){return(e%n+n)%n}function nD(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 rD=class extends n{constructor(...e){super(...e),this.value=0,this.prefix=``,this.suffix=``,this.trend=`auto`,this.noAnimate=!1,this.respectMotionPreference=!0,this._cells=[],this._formatted=``,this._ready=!1,this._pendingSpins=[],this._pendingDir=`none`,this._reelAnims=new Map,this._reapTimer=0}connectedCallback(){super.connectedCallback(),this.hasAttribute(`role`)||this.setAttribute(`role`,`img`)}disconnectedCallback(){super.disconnectedCallback();for(let e of this._reelAnims.values())e.cancel();this._reelAnims.clear(),this._reapTimer&&clearTimeout(this._reapTimer)}_motionOK(){return!(this.noAnimate||this.respectMotionPreference&&typeof window<`u`&&window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches)}_timing(e){let n=getComputedStyle(this);return{duration:this._motionOK()?nD(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)=>eD[e.section]-eD[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+tD(r-n,10):i===`down`?o-tD(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`
|
|
11609
11609
|
<span class="cell digit" part="digit" data-key=${e.key} data-phase=${e.phase}>
|
|
11610
11610
|
<span class="reel" style=${`--o:${10+Number(e.char)}`}>
|
|
11611
|
-
${
|
|
11611
|
+
${$E.map(e=>i`<span>${e}</span>`)}
|
|
11612
11612
|
</span>
|
|
11613
11613
|
</span>
|
|
11614
11614
|
`:i`
|
|
@@ -11717,7 +11717,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
11717
11717
|
:host([data-static]) .cell {
|
|
11718
11718
|
transition: none;
|
|
11719
11719
|
}
|
|
11720
|
-
`}};E([d({type:Number})],
|
|
11720
|
+
`}};E([d({type:Number})],rD.prototype,`value`,void 0),E([d({type:String})],rD.prototype,`locales`,void 0),E([d({type:Object})],rD.prototype,`format`,void 0),E([d({type:String})],rD.prototype,`prefix`,void 0),E([d({type:String})],rD.prototype,`suffix`,void 0),E([d({type:String})],rD.prototype,`trend`,void 0),E([d({type:Boolean,attribute:`no-animate`})],rD.prototype,`noAnimate`,void 0),E([d({type:Boolean,attribute:!1})],rD.prototype,`respectMotionPreference`,void 0),E([m()],rD.prototype,`_cells`,void 0),rD=E([T(`ixfx-sliding-number`)],rD);let iD=0,aD=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-${++iD}`,this._addedTabindex=!1,this._addedRole=!1,this._onTargetClick=()=>this.toggle(),this._onTargetKeydown=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.toggle())},this._onTickleIn=()=>this._scheduleShow(),this._onTickleOut=()=>this._scheduleHide(),this._onPanelClick=()=>{this.dismiss===`auto`&&this.hide()},this._onToggle=e=>{let{newState:n}=e;this._isOpen=n===`open`,n===`closed`&&this.contains(document.activeElement)&&this._target?.focus()},this._onBeforeToggle=e=>{let{newState:n}=e;this._recentCloseAt=n===`closed`?performance.now():void 0}}get isOpen(){return this._isOpen}show(){if(this.popover)try{this.showPopover()}catch{}}hide(){if(this.popover)try{this.hidePopover()}catch{}}toggle(){if(this.popover){if(this._recentCloseAt!==void 0&&performance.now()-this._recentCloseAt<50){this._recentCloseAt=void 0;return}try{this.togglePopover()}catch{}}}connectedCallback(){super.connectedCallback(),this.hasAttribute(`popover`)||(this.popover=`auto`),this.classList.add(`popup-surface`),this.addEventListener(`toggle`,this._onToggle),this.addEventListener(`beforetoggle`,this._onBeforeToggle),this.addEventListener(`click`,this._onPanelClick),this.style.setProperty(`position-anchor`,this._anchorName),this._attachToTarget()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`toggle`,this._onToggle),this.removeEventListener(`beforetoggle`,this._onBeforeToggle),this.removeEventListener(`click`,this._onPanelClick),this._detachFromTarget(),this._cancelShow(),this._cancelHide()}updated(e){super.updated(e),(e.has(`for`)||e.has(`mode`))&&this._attachToTarget()}_resolveTarget(){if(this.for)return this.getRootNode().getElementById(this.for)??void 0}_attachToTarget(){this._detachFromTarget();let e=this._resolveTarget();if(!e){this.for&&console.warn(`ixfx-snackbar: no element found with id "${this.for}"`);return}if(this._target=e,e.style.setProperty(`anchor-name`,this._anchorName),this.mode===`explicit`){let n=e.tabIndex>=0;n||(e.setAttribute(`tabindex`,`0`),this._addedTabindex=!0),!e.hasAttribute(`role`)&&!n&&(e.setAttribute(`role`,`button`),this._addedRole=!0),e.setAttribute(`aria-haspopup`,`true`),e.addEventListener(`click`,this._onTargetClick),n||e.addEventListener(`keydown`,this._onTargetKeydown)}else this.mode===`implicit`&&(e.addEventListener(`pointerenter`,this._onTickleIn),e.addEventListener(`focus`,this._onTickleIn),e.addEventListener(`pointerleave`,this._onTickleOut),e.addEventListener(`blur`,this._onTickleOut),this.addEventListener(`pointerenter`,this._onTickleIn),this.addEventListener(`focusin`,this._onTickleIn),this.addEventListener(`pointerleave`,this._onTickleOut),this.addEventListener(`focusout`,this._onTickleOut))}_detachFromTarget(){let e=this._target;e&&(e.style.removeProperty(`anchor-name`),this._addedTabindex&&=(e.removeAttribute(`tabindex`),!1),this._addedRole&&=(e.removeAttribute(`role`),!1),e.removeAttribute(`aria-haspopup`),e.removeEventListener(`click`,this._onTargetClick),e.removeEventListener(`keydown`,this._onTargetKeydown),e.removeEventListener(`pointerenter`,this._onTickleIn),e.removeEventListener(`focus`,this._onTickleIn),e.removeEventListener(`pointerleave`,this._onTickleOut),e.removeEventListener(`blur`,this._onTickleOut),this.removeEventListener(`pointerenter`,this._onTickleIn),this.removeEventListener(`focusin`,this._onTickleIn),this.removeEventListener(`pointerleave`,this._onTickleOut),this.removeEventListener(`focusout`,this._onTickleOut),this._target=void 0)}_scheduleShow(){if(this._cancelHide(),this._cancelShow(),this.showDelay<=0){this.show();return}this._showTimeout=window.setTimeout(()=>this.show(),this.showDelay)}_scheduleHide(){if(this._cancelShow(),this._cancelHide(),this.hideDelay<=0){this.hide();return}this._hideTimeout=window.setTimeout(()=>this.hide(),this.hideDelay)}_cancelShow(){this._showTimeout!==void 0&&(window.clearTimeout(this._showTimeout),this._showTimeout=void 0)}_cancelHide(){this._hideTimeout!==void 0&&(window.clearTimeout(this._hideTimeout),this._hideTimeout=void 0)}static{this.styles=[w,ue,r`
|
|
11721
11721
|
:host {
|
|
11722
11722
|
display: flex;
|
|
11723
11723
|
align-items: center;
|
|
@@ -11769,7 +11769,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
11769
11769
|
position-area: inline-end;
|
|
11770
11770
|
margin-inline-start: var(--space-s);
|
|
11771
11771
|
}
|
|
11772
|
-
`]}render(){return i`<slot></slot>`}};E([d({type:String})],
|
|
11772
|
+
`]}render(){return i`<slot></slot>`}};E([d({type:String})],aD.prototype,`for`,void 0),E([d({type:String})],aD.prototype,`mode`,void 0),E([d({type:String,reflect:!0})],aD.prototype,`placement`,void 0),E([d({type:String})],aD.prototype,`dismiss`,void 0),E([d({type:Number,attribute:`show-delay`})],aD.prototype,`showDelay`,void 0),E([d({type:Number,attribute:`hide-delay`})],aD.prototype,`hideDelay`,void 0),E([m()],aD.prototype,`_isOpen`,void 0),aD=E([T(`ixfx-snackbar`)],aD);let oD=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`
|
|
11773
11773
|
:host {
|
|
11774
11774
|
display: block;
|
|
11775
11775
|
position: relative;
|
|
@@ -11833,7 +11833,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
11833
11833
|
>
|
|
11834
11834
|
<slot></slot>
|
|
11835
11835
|
</div>
|
|
11836
|
-
`}};E([d({type:String,attribute:`orientation`})],
|
|
11836
|
+
`}};E([d({type:String,attribute:`orientation`})],oD.prototype,`orientation`,void 0),E([d({type:Number,attribute:`snap-positions`})],oD.prototype,`snapPositions`,void 0),E([d({type:String,attribute:`snap-logic`})],oD.prototype,`snapLogic`,void 0),E([d({type:String,attribute:`click-snap`})],oD.prototype,`clickSnap`,void 0),E([d({type:Number})],oD.prototype,`snap`,void 0),E([m()],oD.prototype,`_dragging`,void 0),oD=E([T(`ixfx-snap-container`)],oD);let sD=class extends Oy(n){constructor(...e){super(...e),this.barSpacing=20,this.barWidth=14,this.debounceMs=200,this.retractDurationMs=400,this._startX=0,this._currentX=0,this._pointerId=null,this._componentWidth=0,this._isDragging=!1,this._offset=0,this._width=0,this._height=0,this._animRafId=null,this._debounceTimer=null,this._animStartOffset=0,this._animStartTime=null,this._resizeObserver=null,this.#e=e=>{if(e.pointerId!==this._pointerId)return;this.#r();let n=this.getBoundingClientRect();if(e.clientX>=n.left&&e.clientX<=n.right&&e.clientY>=n.top&&e.clientY<=n.bottom){let e=this._currentX-this._startX,n=Math.max(-1,Math.min(1,e/this._componentWidth));this.#n(n)}this._isDragging=!1,this._pointerId=null,this.#i()},this.#t=e=>{e.pointerId===this._pointerId&&(this.#r(),this._isDragging=!1,this._pointerId=null,this.#i())},this._onPointerDown=e=>{e.preventDefault(),this.#o(),e.target.setPointerCapture(e.pointerId),this._pointerId=e.pointerId,this._startX=e.clientX,this._currentX=e.clientX,this._componentWidth=this.getBoundingClientRect().width,this._isDragging=!0,window.addEventListener(`pointerup`,this.#e),window.addEventListener(`pointercancel`,this.#t)},this._onPointerMove=e=>{if(!this._isDragging||e.pointerId!==this._pointerId)return;this._currentX=e.clientX;let n=this._currentX-this._startX,r=Math.max(-1,Math.min(1,n/this._componentWidth));this._offset=r*this._height*.5,this.requestUpdate()}}#e;#t;#n(e){this.dispatchEvent(new CustomEvent(`input`,{detail:{value:e},bubbles:!0,composed:!0}))}_applyWheelDelta(e,n){this.#o();let r=n.shiftKey?.05:.1,i=Math.max(-1,Math.min(1,e*r));this.#n(i),this._offset=i*this._height*.5,this.requestUpdate(),this.#i()}connectedCallback(){super.connectedCallback(),this._resizeObserver=new ResizeObserver(e=>{let n=e[0];n&&(this._width=n.contentRect.width,this._height=n.contentRect.height,this.requestUpdate())}),this._resizeObserver.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver?.disconnect(),this._resizeObserver=null,this.#o(),this.#r(),this._isDragging=!1,this._pointerId=null}#r(){window.removeEventListener(`pointerup`,this.#e),window.removeEventListener(`pointercancel`,this.#t)}#i(){this._debounceTimer!==null&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>{this._debounceTimer=null,this.#a()},this.debounceMs)}#a(){this._animStartOffset=this._offset,this._animStartTime=null;let e=n=>{this._animStartTime===null&&(this._animStartTime=n);let r=n-this._animStartTime,i=Math.min(r/this.retractDurationMs,1),a=1-(1-i)**3;this._offset=this._animStartOffset*(1-a),this.requestUpdate(),i<1?this._animRafId=requestAnimationFrame(e):(this._offset=0,this._animRafId=null,this.requestUpdate())};this._animRafId=requestAnimationFrame(e)}#o(){this._animRafId!==null&&(cancelAnimationFrame(this._animRafId),this._animRafId=null),this._debounceTimer!==null&&(clearTimeout(this._debounceTimer),this._debounceTimer=null)}#s(){let e=this._width,n=this._height,r=this._offset,{barSpacing:i,barWidth:a}=this;if(e===0||n===0)return s``;let o=a/2,c=n/2,l=Math.ceil(e/i)+1;return s`${Array.from({length:l},(e,a)=>{let l=a*i,u=l-o,d=l+o,f=a%2==0?`var(--swipe-color-a, var(--surface-4))`:`var(--swipe-color-b, var(--surface-5))`,p=`M${u},0 L${d},0 L${d+r},${c} L${d},${n} L${u},${n} L${u+r},${c}Z`;return s`<path d=${p} style="fill:${f}"></path>`})}`}static{this.styles=[w,sn,r`
|
|
11837
11837
|
:host {
|
|
11838
11838
|
display: block;
|
|
11839
11839
|
user-select: none;
|
|
@@ -11869,7 +11869,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
11869
11869
|
>
|
|
11870
11870
|
<svg aria-hidden="true">${this.#s()}</svg>
|
|
11871
11871
|
</div>
|
|
11872
|
-
`}};E([d({type:Number})],
|
|
11872
|
+
`}};E([d({type:Number})],sD.prototype,`barSpacing`,void 0),E([d({type:Number})],sD.prototype,`barWidth`,void 0),E([d({type:Number})],sD.prototype,`debounceMs`,void 0),E([d({type:Number})],sD.prototype,`retractDurationMs`,void 0),sD=E([T(`ixfx-swipe`)],sD);let cD=class extends n{render(){return i`<slot></slot>`}static{this.styles=[w,r`
|
|
11873
11873
|
:host {
|
|
11874
11874
|
display:none;
|
|
11875
11875
|
height:100%;
|
|
@@ -11880,12 +11880,12 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
11880
11880
|
background: var(--surface-3);
|
|
11881
11881
|
display:block;
|
|
11882
11882
|
}
|
|
11883
|
-
`]}};
|
|
11883
|
+
`]}};cD=E([T(`ixfx-tab-panel`)],cD);var lD=class{#e;#t;#n;#r=[];#i;#a;#o;#s=new Set;constructor(e,n,r={}){this.#e=e,this.#t=n,this.#n=r,this.#o=r.commands}connect(){this.disconnect(),this.#i=new AbortController;let{signal:e}=this.#i;this.#e.addEventListener(`change`,this.#c,{signal:e}),this.#e.addEventListener(`reorder`,this.#l,{signal:e}),this.#e.addEventListener(`close`,this.#u,{signal:e}),this.#a=new MutationObserver(()=>this.#x()),this.#a.observe(this.#e,{childList:!0}),this.#a.observe(this.#t,{childList:!0}),this.#x(),this.#t.syncWithList(this.#e);for(let e of this.#r)this.#C(e)}disconnect(){this.#i?.abort(),this.#i=void 0,this.#a?.disconnect(),this.#a=void 0;for(let e of this.#r)this.#w(e);this.#s.clear(),this.#r=[]}selectTab(e){let n=this.#f(e);if(!n)return!1;let r=this.getSelected();return r?.id===n.id?(this.#t.selectPanel(n.forId),!0):(this.#e.selectElement(n.item),this.#t.selectPanel(n.forId),this.#n.onSelect?.(n,r),!0)}selectNext(){return this.#d(1)}selectPrevious(){return this.#d(-1)}getSelected(){return this.#r.find(e=>e.item.hasAttribute(`selected`))}getTabs(){return[...this.#r]}getTab(e){return this.#r.find(n=>n.id===e)}addTab(e){let{id:n,forId:r}=this.#g(e),i=document.createElement(`ixfx-tab-list-item`);i.id=n,i.setAttribute(`for`,r),i.closeable=e.closeable??!0,i.append(e.label),e.iconName&&(i.iconName=e.iconName),e.description&&(i.description=e.description);for(let n of e.toolbar??[])n.slot=`toolbar`,i.append(n);let a=document.createElement(`ixfx-tab-panel`);a.id=r,e.content!==void 0&&this.#y(a,e.content);let o=Math.max(0,Math.min(e.index??this.#r.length,this.#r.length));this.#b(this.#e,i,o),this.#b(this.#t,a,o);let s={id:n,forId:r,item:i,panel:a,label:e.label,iconName:e.iconName};return this.#r.splice(o,0,s),this.#C(s),this.#n.onAdd?.(s),(e.select??!0)&&this.selectTab(n),s}removeTab(e){let n=this.#f(e);if(!n)return!1;let r=this.#r.indexOf(n),i=n.item.hasAttribute(`selected`)?this.#m(r):void 0;return n.item.remove(),n.panel.remove(),this.#h(n),this.#w(n),this.#n.onRemove?.(n),i&&this.selectTab(i.id),!0}renameTab(e,n){let r=this.#f(e);if(!r)return!1;for(let e of[...r.item.childNodes])(e.nodeType!==Node.ELEMENT_NODE||e.slot!==`toolbar`)&&r.item.removeChild(e);return r.item.prepend(n),r.label=n,this.#T(r),!0}setTabIcon(e,n){let r=this.#f(e);return r?(n?(r.item.iconName=n,r.iconName=n):(r.item.iconName=void 0,r.item.removeAttribute(`icon-name`),r.iconName=void 0),!0):!1}#c=e=>{let n=e.detail;this.#t.selectPanel(n.for);let r=this.#r.find(e=>e.forId===n.for);if(!r)return;let i=n.previous?this.#r.find(e=>e.id===n.previous):void 0;this.#n.onSelect?.(r,i)};#l=()=>{this.#x(),this.#n.onReorder?.(this.#r)};#u=e=>{let n=e.target?.closest(`ixfx-tab-list-item`),r=n?this.#p(n):void 0;if(!r)return;let i=this.#r.indexOf(r),a=r.item.hasAttribute(`selected`)?this.#m(i):void 0;r.panel.remove(),this.#h(r),this.#w(r),this.#n.onRemove?.(r),a&&this.selectTab(a.id)};#d(e){let n=this.#r;if(n.length===0)return!1;let r=this.getSelected(),i=((r?n.indexOf(r):e===1?-1:0)+e+n.length)%n.length;return this.selectTab(n[i].id)}#f(e){if(typeof e!=`string`)return this.#r.find(n=>n.item===e);let n=e.trim().toLowerCase();return this.#r.find(n=>n.id===e)??this.#r.find(n=>n.forId===e)??this.#r.find(e=>e.label.toLowerCase()===n)}#p(e){return this.#r.find(n=>n.item===e)}#m(e){let n=this.#r;if(!(n.length<=1))return n[e+1]??n[e-1]}#h(e){let n=this.#r.indexOf(e);n>=0&&this.#r.splice(n,1)}#g(e){let n=this.#_(e.label)||`tab`;return{id:e.id??this.#v(`tab-${n}`),forId:e.forId??this.#v(`panel-${n}`)}}#_(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)}#v(e){let n=e,r=2;for(;document.getElementById(n);)n=`${e}-${r++}`;return n}#y(e,n){if(typeof n==`function`){n(e);return}if(typeof n==`string`){e.append(document.createTextNode(n));return}e.append(n)}#b(e,n,r){let i=Array.from(e.children);e.insertBefore(n,i[r]??null)}#x(){let e=new Map;for(let n of this.#t.querySelectorAll(`ixfx-tab-panel`))e.set(n.id,n);let n=[];for(let r of this.#e.querySelectorAll(`ixfx-tab-list-item`)){let i=r.getAttribute(`for`)??``,a=e.get(i);a&&n.push({id:r.id||i,forId:i,item:r,panel:a,label:this.#S(r),iconName:r.iconName})}this.#r=n}#S(e){let n=``;for(let r of e.childNodes)r instanceof Element&&r.getAttribute(`slot`)===`toolbar`||(n+=r.textContent??``);return n.trim()}#C(e){this.#o&&(e.item.commandActive||this.#o.has(e.id)||(this.#o.register({id:e.id,label:e.label,description:e.item.description??e.label,icon:e.iconName,execute:()=>{this.selectTab(e.id)}}),this.#s.add(e.id)))}#w(e){this.#o&&this.#s.has(e.id)&&(this.#o.unregister(e.id),this.#s.delete(e.id))}#T(e){if(!this.#o||!this.#s.has(e.id))return;let n=this.#o.get(e.id);n&&(this.#o.unregister(e.id),this.#o.register({...n,label:e.label}))}};let uD=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`
|
|
11884
11884
|
:host {
|
|
11885
11885
|
display: block;
|
|
11886
11886
|
}
|
|
11887
11887
|
|
|
11888
|
-
`}};E([p()],
|
|
11888
|
+
`}};E([p()],uD.prototype,`_listItems`,void 0),uD=E([T(`ixfx-tab-panels`)],uD);let dD=class extends n{constructor(...e){super(...e),this.text=``,this.paused=!1}render(){return i`<span class="shimmer" part="text"
|
|
11889
11889
|
>${this.text===``?i`<slot></slot>`:this.text}</span
|
|
11890
11890
|
>`}static{this.styles=r`
|
|
11891
11891
|
:host {
|
|
@@ -11941,7 +11941,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
11941
11941
|
-webkit-text-fill-color: var(--text-shimmer-color);
|
|
11942
11942
|
}
|
|
11943
11943
|
}
|
|
11944
|
-
`}};E([d({type:String})],uD.prototype,`text`,void 0),E([d({type:Boolean,reflect:!0})],uD.prototype,`paused`,void 0),uD=E([T(`ixfx-text-shimmer`)],uD);var dD=class{#e;#t;#n=120;#r=4;#i=4;constructor(e,n){this.#e=e,this.#t=n,e.min=n.logicalMin,e.max=n.logicalMax,n.labelFormatter&&(e.formatLabel=n.labelFormatter),e.addEventListener(`track-select`,this.#a)}setTempo(e){this.#n=e,this.#o()}setTimeSignature(e,n){this.#r=e,this.#i=n,this.#o()}setViewRange(e){this.#e.setViewRange(e)}dispose(){this.#e.removeEventListener(`track-select`,this.#a)}#a=e=>{let n=e.detail,r=this.#e.getTrackEvents(n.trackKey).map(e=>e.id);if(n.shiftKey){let e=new Set(this.#e.selectedIds);for(let n of r)e.has(n)?e.delete(n):e.add(n);this.#e.selectedIds=[...e]}else this.#e.selectedIds=r};#o(){if(this.#t.labelFormatter)return;this.#n;let e=this.#r;this.#e.formatLabel=n=>{let r=e,i=n;return`${Math.floor(i/r)+1}.${Math.floor(i%r)+1}`}}};const fD=[1,2,5,10];function pD(e,n,r,i=`adaptive`,a,o){return i===`fixed`&&a!==void 0&&o!==void 0?hD(a,o):mD(e,n,r)}function mD(e,n,r){let i=e.max-e.min;if(i<=0||r<=0)return{majorStep:100,minorDivisions:4,minorStep:25};let a=80*gD(n),o=i/Math.max(2,Math.floor(r/a)),s=10**Math.floor(Math.log10(o)),c=s;for(let e of fD){let n=e*s;if(n>=o*.8){c=n;break}}let l=c/s,u=l===5||l===10?5:4,d=c/u;return{majorStep:c,minorDivisions:u,minorStep:d}}function hD(e,n){let r=e;for(;r*n<5&&r<0xe8d4a51000;)r*=2;return{majorStep:r*4,minorDivisions:4,minorStep:r}}function gD(e){switch(e){case`x-wide`:return 2;case`wide`:return 1.5;case`normal`:return 1;case`slim`:return .7;case`x-slim`:return .5;default:return 1}}function _D(e,n,r,i,a,o){let{majorStep:s,minorStep:c}=r;if(s<=0)return;let l=n.x+n.width;if(i){e.fillStyle=a[`--timeline-alt-major-bg`]??`rgba(255,255,255,0.03)`;let r=Math.floor(n.x/s);for(let i=r;i*s<l;i++)if(i%2!=0){let r=i*s*o;e.fillRect(r,n.y,s*o,n.height)}}if(c>0){e.strokeStyle=a[`--timeline-grid-minor-color`]??`rgba(255,255,255,0.05)`,e.lineWidth=Number.parseFloat(a[`--timeline-grid-minor-width`]??`0.5`),e.beginPath();let r=Math.floor(n.x/c)*c;for(let i=r;i<l;i+=c){if(Math.abs(i%s)<c*.01)continue;let r=i*o;e.moveTo(r,n.y),e.lineTo(r,n.y+n.height)}e.stroke()}e.strokeStyle=a[`--timeline-grid-major-color`]??`rgba(255,255,255,0.12)`,e.lineWidth=Number.parseFloat(a[`--timeline-grid-major-width`]??`1`),e.beginPath();let u=Math.floor(n.x/s)*s;for(let r=u;r<l;r+=s){let i=r*o;e.moveTo(i,n.y),e.lineTo(i,n.y+n.height)}e.stroke()}function vD(e,n,r,i,a,o,s,c=0){let{majorStep:l}=r;if(l<=0||i<=0)return;let u=c,d=c+i;if(n.y+n.height<u||n.y>d)return;let f=n.x+n.width,p=i-6;e.fillStyle=o[`--timeline-bg`]??`#111`;let m=n.x*s;e.fillRect(m,u,n.width*s,p),e.strokeStyle=o[`--timeline-grid-major-color`]??`rgba(255,255,255,0.12)`,e.lineWidth=Number.parseFloat(o[`--timeline-grid-major-width`]??`1`),e.beginPath();let h=Math.ceil(n.x/l)*l;for(let n=h;n<f;n+=l){let r=n*s;e.moveTo(r,u+p),e.lineTo(r,d)}e.stroke(),e.strokeStyle=o[`--timeline-grid-major-color`]??`rgba(255,255,255,0.12)`,e.lineWidth=1,e.beginPath(),e.moveTo(m,d),e.lineTo(m+n.width*s,d),e.stroke(),e.fillStyle=o[`--timeline-axis-label-color`]??`rgba(255,255,255,0.5)`,e.font=`11px system-ui, sans-serif`,e.textBaseline=`middle`,e.textAlign=`left`;for(let n=h;n<f;n+=l){let r=n*s;e.fillText(a(n),r+4,u+p/2)}e.textAlign=`start`}function yD(e,n,r,i,a,o){let s=a[`--timeline-track-bg`]??`#1a1a1a`,c=a[`--timeline-track-bg-alt`]??`#1e1e1e`;for(let l=0;l<r.length;l++){let u=r[l];if(u.y+u.height<n.y)continue;if(u.y>n.y+n.height)break;let d=i.find(e=>e.key===u.trackKey);e.fillStyle=d?.color?`${d.color}22`:l%2==0?s:c,e.fillRect(n.x*o,u.y,n.width*o,u.height),e.strokeStyle=a[`--timeline-grid-major-color`]??`rgba(255,255,255,0.12)`,e.lineWidth=.5,e.beginPath(),e.moveTo(n.x*o,u.y+u.height),e.lineTo((n.x+n.width)*o,u.y+u.height),e.stroke()}}function bD(e,n,r,i,a,o,s,c,l){let u=c[`--timeline-event-bg`]??`#3498db`,d=c[`--timeline-event-selected-bg`]??`#5dade2`,f=c[`--timeline-event-tickled-bg`]??`#444`,p=c[`--timeline-event-label-color`]??`#fff`,m=Number.parseFloat(c[`--timeline-event-radius`]??`4`),h=n.x+n.width;for(let c of r){if(c.end<n.x||c.start>h)continue;let r=i.find(e=>e.trackKey===c.trackKey);if(!r||r.y+r.height<n.y||r.y>n.y+n.height)continue;let g=!1;(s.kind===`event-move`&&s.eventId===c.id||s.kind===`event-start`&&s.eventId===c.id||s.kind===`event-end`&&s.eventId===c.id)&&(g=!0);let _=c.start*l,v=(c.end-c.start)*l,y=r.y+3,b=r.height-6;if(v<1)continue;let x=a.has(c.id),S=o===c.id,ee;ee=x?d:S?f:c.color??u,e.fillStyle=ee,e.beginPath(),SD(e,_,y,v,b,Math.min(m,v/2,b/2)),e.fill(),g&&(e.strokeStyle=`#fff`,e.lineWidth=1.5,e.beginPath(),SD(e,_,y,v,b,Math.min(m,v/2,b/2)),e.stroke()),x&&!g&&(e.strokeStyle=d,e.lineWidth=1,e.beginPath(),SD(e,_,y,v,b,Math.min(m,v/2,b/2)),e.stroke()),v>=40&&c.label&&(e.fillStyle=p,e.font=`11px system-ui, sans-serif`,e.textBaseline=`middle`,e.save(),e.beginPath(),e.rect(_+4,y,v-8,b),e.clip(),e.fillText(c.label,_+6,y+b/2),e.restore())}}function xD(e,n,r){if(n.kind!==`marquee`)return;let i=Math.min(n.startLogicalX,n.currentLogicalX)*r,a=Math.max(n.startLogicalX,n.currentLogicalX)*r,o=Math.min(n.startY,n.currentY),s=Math.max(n.startY,n.currentY);e.fillStyle=`rgba(100, 150, 255, 0.15)`,e.fillRect(i,o,a-i,s-o),e.strokeStyle=`rgba(100, 150, 255, 0.6)`,e.lineWidth=1,e.strokeRect(i,o,a-i,s-o)}function SD(e,n,r,i,a,o){o=Math.max(0,o),e.moveTo(n+o,r),e.arcTo(n+i,r,n+i,r+a,o),e.arcTo(n+i,r+a,n,r+a,o),e.arcTo(n,r+a,n,r,o),e.arcTo(n,r,n+i,r,o),e.closePath()}const CD=[`--timeline-bg`,`--timeline-track-bg`,`--timeline-track-bg-alt`,`--timeline-alt-major-bg`,`--timeline-grid-major-color`,`--timeline-grid-minor-color`,`--timeline-grid-major-width`,`--timeline-grid-minor-width`,`--timeline-event-bg`,`--timeline-event-selected-bg`,`--timeline-event-tickled-bg`,`--timeline-event-label-color`,`--timeline-event-radius`,`--timeline-axis-label-color`];function wD(e){let n=getComputedStyle(e),r={};for(let e of CD)r[e]=n.getPropertyValue(e).trim();return r}function TD(e,n,r){return e/n+r}function ED(e){return e>0?1/e:1}function DD(e,n,r,i,a){let o=i.find(e=>n>=e.y&&n<e.y+e.height);if(!o)return{kind:`empty`,logicalX:e,y:n,trackKey:void 0};let s=8*ED(a),c=r.filter(e=>e.trackKey===o.trackKey);for(let n of c)if(!(e<n.start||e>n.end))return e<=n.start+s?{kind:`event-start`,eventId:n.id}:e>=n.end-s?{kind:`event-end`,eventId:n.id}:{kind:`event-move`,eventId:n.id,trackKey:o.trackKey,offsetX:e-n.start};return{kind:`empty`,logicalX:e,y:n,trackKey:o.trackKey}}function OD(e,n){return n.find(n=>e>=n.y&&e<n.y+n.height)?.trackKey}function kD(e,n){return Math.abs(e)>n?e-Math.sign(e)*n:0}function AD(e,n,r,i,a){let o=n*Math.exp(-a/100),s=r-(r-e)*n/o;return o>0&&(s+=-i/o),{ppu:o,viewMin:s}}function jD(e,n,r,i,a,o){let s=n-e,c=s*Math.exp(-a/100),l=i-(s>0?(i-e)/s:.5)*c;return r>0&&(l+=o/r),{vMin:l,vMax:l+c}}function MD(e,n){let r=new AbortController,i=r.signal;return n.addEventListener(`pointerdown`,r=>{let i=e.pxPerUnit,a=n.convertFromViewportToCanvas(r.offsetX,r.offsetY),o=TD(a.x,i,e.min),s=a.y,c=n.logicalScrollTop;if(s>=c&&s<c+e.axisHeight){n.setPointerCapture(r.pointerId),e._drag={kind:`axis-zoom`,anchorUnit:o,startScreenX:r.screenX,startScreenY:r.screenY,startViewMin:e._viewRange.min,startPpu:i};return}let l=DD(o,s,e._internalEvents,e._trackLayout,i);if(r.shiftKey&&l.kind===`event-move`){PD(e,l.eventId);return}if(l.kind===`event-move`){n.setPointerCapture(r.pointerId),e._drag={kind:`event-move`,eventId:l.eventId,originTrackKey:l.trackKey,offsetX:l.offsetX};return}if(l.kind===`event-start`){n.setPointerCapture(r.pointerId),e._drag={kind:`event-start`,eventId:l.eventId};return}if(l.kind===`event-end`){n.setPointerCapture(r.pointerId),e._drag={kind:`event-end`,eventId:l.eventId};return}l.kind===`empty`&&(n.setPointerCapture(r.pointerId),e._drag={kind:`marquee`,startLogicalX:o,startY:s,currentLogicalX:o,currentY:s})},{signal:i}),n.addEventListener(`pointermove`,r=>{let i=e._drag;if(i.kind===`none`){ND(e,n,r);return}let a=e.pxPerUnit,o=n.convertFromViewportToCanvas(r.offsetX,r.offsetY),s=TD(o.x,a,e.min),c=o.y;if(i.kind===`axis-zoom`){let n=r.screenX-i.startScreenX,a=r.screenY-i.startScreenY;if(Math.abs(n)+Math.abs(a)<5)return;let o=kD(n,4),s=kD(a,4),c=AD(i.startViewMin,i.startPpu,i.anchorUnit,o,s);e.setZoomPan(c.viewMin,c.ppu);return}if(i.kind===`marquee`){e._drag={...i,currentLogicalX:s,currentY:c},n.invalidateAll();return}if(i.kind===`event-move`){let r=e._internalEvents.find(e=>e.id===i.eventId);if(!r)return;let a=r.end-r.start,o=s,l=c,u=s-i.offsetX,d=u+a,f=OD(c,e._trackLayout)??r.trackKey,p=e.pxPerUnit,m=pD(e._viewRange,e.userScale,n.viewportWidth,e.gridMode,e.minorStep,p),h=e.processDrag(i.eventId,o,l,u,d,f,i.originTrackKey,m);e._internalEvents=e._internalEvents.map(e=>e.id===i.eventId?{...e,start:h.start,end:h.end,trackKey:h.trackKey}:e),n.invalidateAll();return}if(i.kind===`event-start`){let r=e._internalEvents.find(e=>e.id===i.eventId);if(!r)return;let a=Math.min(s,r.end-1);e._internalEvents=e._internalEvents.map(e=>e.id===i.eventId?{...e,start:a}:e),n.invalidateAll();return}if(i.kind===`event-end`){let r=e._internalEvents.find(e=>e.id===i.eventId);if(!r)return;let a=Math.max(s,r.start+1);e._internalEvents=e._internalEvents.map(e=>e.id===i.eventId?{...e,end:a}:e),n.invalidateAll()}},{signal:i}),n.addEventListener(`pointerup`,r=>{let i=e._drag;if(n.releasePointerCapture(r.pointerId),i.kind===`axis-zoom`){e._drag={kind:`none`};return}if(i.kind===`marquee`){let r=Math.min(i.startLogicalX,i.currentLogicalX),a=Math.max(i.startLogicalX,i.currentLogicalX),o=Math.min(i.startY,i.currentY),s=Math.max(i.startY,i.currentY);if(Math.abs(a-r)<2&&Math.abs(s-o)<2)e._selectedIds=new Set,FD(e);else{let n=new Set;for(let i of e._internalEvents){let c=e._trackLayout.find(e=>e.trackKey===i.trackKey);if(!c)continue;let l=c.y+3,u=c.y+c.height-3;i.end>=r&&i.start<=a&&u>=o&&l<=s&&n.add(i.id)}e._selectedIds=n,FD(e)}e._drag={kind:`none`},n.invalidateAll();return}if(i.kind===`event-move`){let n=e._internalEvents.find(e=>e.id===i.eventId);n&&e.dispatchEvent(new CustomEvent(`event-move`,{detail:{eventId:n.id,fromTrackKey:i.originTrackKey,toTrackKey:n.trackKey,start:n.start,end:n.end},bubbles:!0,composed:!0})),e._drag={kind:`none`};return}if(i.kind===`event-start`||i.kind===`event-end`){let n=e._internalEvents.find(e=>e.id===i.eventId);n&&e.dispatchEvent(new CustomEvent(`event-resize`,{detail:{eventId:n.id,start:n.start,end:n.end},bubbles:!0,composed:!0})),e._drag={kind:`none`};return}e._drag={kind:`none`}},{signal:i}),n.addEventListener(`pointerleave`,()=>{e._tickledId!==void 0&&(e._tickledId=void 0,n.invalidateAll())},{signal:i}),()=>r.abort()}function ND(e,n,r){let i=e.pxPerUnit,a=n.convertFromViewportToCanvas(r.offsetX,r.offsetY),o=TD(a.x,i,e.min),s=a.y,c=n.logicalScrollTop;if(s>=c&&s<c+e.axisHeight){n.style.cursor=`col-resize`,e._tickledId!==void 0&&(e._tickledId=void 0,n.invalidateAll());return}let l=DD(o,s,e._internalEvents,e._trackLayout,i),u;(l.kind===`event-move`||l.kind===`event-start`||l.kind===`event-end`)&&(u=l.eventId),l.kind===`event-start`||l.kind===`event-end`?n.style.cursor=`ew-resize`:l.kind===`event-move`?n.style.cursor=`grab`:n.style.cursor=`crosshair`,u!==e._tickledId&&(e._tickledId=u,n.invalidateAll())}function PD(e,n){let r=new Set(e._selectedIds);r.has(n)?r.delete(n):r.add(n),e._selectedIds=r,FD(e),e.getVCanvas()?.invalidateAll()}function FD(e){e.dispatchEvent(new CustomEvent(`selection-change`,{detail:{selectedIds:[...e._selectedIds]},bubbles:!0,composed:!0}))}const ID=r`
|
|
11944
|
+
`}};E([d({type:String})],dD.prototype,`text`,void 0),E([d({type:Boolean,reflect:!0})],dD.prototype,`paused`,void 0),dD=E([T(`ixfx-text-shimmer`)],dD);var fD=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 pD=[1,2,5,10];function mD(e,n,r,i=`adaptive`,a,o){return i===`fixed`&&a!==void 0&&o!==void 0?gD(a,o):hD(e,n,r)}function hD(e,n,r){let i=e.max-e.min;if(i<=0||r<=0)return{majorStep:100,minorDivisions:4,minorStep:25};let a=80*_D(n),o=i/Math.max(2,Math.floor(r/a)),s=10**Math.floor(Math.log10(o)),c=s;for(let e of pD){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 gD(e,n){let r=e;for(;r*n<5&&r<0xe8d4a51000;)r*=2;return{majorStep:r*4,minorDivisions:4,minorStep:r}}function _D(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 vD(e,n,r,i,a,o){let{majorStep:s,minorStep:c}=r;if(s<=0)return;let l=n.x+n.width;if(i){e.fillStyle=a[`--timeline-alt-major-bg`]??`rgba(255,255,255,0.03)`;let r=Math.floor(n.x/s);for(let i=r;i*s<l;i++)if(i%2!=0){let r=i*s*o;e.fillRect(r,n.y,s*o,n.height)}}if(c>0){e.strokeStyle=a[`--timeline-grid-minor-color`]??`rgba(255,255,255,0.05)`,e.lineWidth=Number.parseFloat(a[`--timeline-grid-minor-width`]??`0.5`),e.beginPath();let r=Math.floor(n.x/c)*c;for(let i=r;i<l;i+=c){if(Math.abs(i%s)<c*.01)continue;let r=i*o;e.moveTo(r,n.y),e.lineTo(r,n.y+n.height)}e.stroke()}e.strokeStyle=a[`--timeline-grid-major-color`]??`rgba(255,255,255,0.12)`,e.lineWidth=Number.parseFloat(a[`--timeline-grid-major-width`]??`1`),e.beginPath();let u=Math.floor(n.x/s)*s;for(let r=u;r<l;r+=s){let i=r*o;e.moveTo(i,n.y),e.lineTo(i,n.y+n.height)}e.stroke()}function yD(e,n,r,i,a,o,s,c=0){let{majorStep:l}=r;if(l<=0||i<=0)return;let u=c,d=c+i;if(n.y+n.height<u||n.y>d)return;let f=n.x+n.width,p=i-6;e.fillStyle=o[`--timeline-bg`]??`#111`;let m=n.x*s;e.fillRect(m,u,n.width*s,p),e.strokeStyle=o[`--timeline-grid-major-color`]??`rgba(255,255,255,0.12)`,e.lineWidth=Number.parseFloat(o[`--timeline-grid-major-width`]??`1`),e.beginPath();let h=Math.ceil(n.x/l)*l;for(let n=h;n<f;n+=l){let r=n*s;e.moveTo(r,u+p),e.lineTo(r,d)}e.stroke(),e.strokeStyle=o[`--timeline-grid-major-color`]??`rgba(255,255,255,0.12)`,e.lineWidth=1,e.beginPath(),e.moveTo(m,d),e.lineTo(m+n.width*s,d),e.stroke(),e.fillStyle=o[`--timeline-axis-label-color`]??`rgba(255,255,255,0.5)`,e.font=`11px system-ui, sans-serif`,e.textBaseline=`middle`,e.textAlign=`left`;for(let n=h;n<f;n+=l){let r=n*s;e.fillText(a(n),r+4,u+p/2)}e.textAlign=`start`}function bD(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 xD(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(),CD(e,_,y,v,b,Math.min(m,v/2,b/2)),e.fill(),g&&(e.strokeStyle=`#fff`,e.lineWidth=1.5,e.beginPath(),CD(e,_,y,v,b,Math.min(m,v/2,b/2)),e.stroke()),x&&!g&&(e.strokeStyle=d,e.lineWidth=1,e.beginPath(),CD(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 SD(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 CD(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 wD=[`--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 TD(e){let n=getComputedStyle(e),r={};for(let e of wD)r[e]=n.getPropertyValue(e).trim();return r}function ED(e,n,r){return e/n+r}function DD(e){return e>0?1/e:1}function OD(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*DD(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 kD(e,n){return n.find(n=>e>=n.y&&e<n.y+n.height)?.trackKey}function AD(e,n){return Math.abs(e)>n?e-Math.sign(e)*n:0}function jD(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 MD(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 ND(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=ED(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=OD(o,s,e._internalEvents,e._trackLayout,i);if(r.shiftKey&&l.kind===`event-move`){FD(e,l.eventId);return}if(l.kind===`event-move`){n.setPointerCapture(r.pointerId),e._drag={kind:`event-move`,eventId:l.eventId,originTrackKey:l.trackKey,offsetX:l.offsetX};return}if(l.kind===`event-start`){n.setPointerCapture(r.pointerId),e._drag={kind:`event-start`,eventId:l.eventId};return}if(l.kind===`event-end`){n.setPointerCapture(r.pointerId),e._drag={kind:`event-end`,eventId:l.eventId};return}l.kind===`empty`&&(n.setPointerCapture(r.pointerId),e._drag={kind:`marquee`,startLogicalX:o,startY:s,currentLogicalX:o,currentY:s})},{signal:i}),n.addEventListener(`pointermove`,r=>{let i=e._drag;if(i.kind===`none`){PD(e,n,r);return}let a=e.pxPerUnit,o=n.convertFromViewportToCanvas(r.offsetX,r.offsetY),s=ED(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=AD(n,4),s=AD(a,4),c=jD(i.startViewMin,i.startPpu,i.anchorUnit,o,s);e.setZoomPan(c.viewMin,c.ppu);return}if(i.kind===`marquee`){e._drag={...i,currentLogicalX:s,currentY:c},n.invalidateAll();return}if(i.kind===`event-move`){let r=e._internalEvents.find(e=>e.id===i.eventId);if(!r)return;let a=r.end-r.start,o=s,l=c,u=s-i.offsetX,d=u+a,f=kD(c,e._trackLayout)??r.trackKey,p=e.pxPerUnit,m=mD(e._viewRange,e.userScale,n.viewportWidth,e.gridMode,e.minorStep,p),h=e.processDrag(i.eventId,o,l,u,d,f,i.originTrackKey,m);e._internalEvents=e._internalEvents.map(e=>e.id===i.eventId?{...e,start:h.start,end:h.end,trackKey:h.trackKey}:e),n.invalidateAll();return}if(i.kind===`event-start`){let r=e._internalEvents.find(e=>e.id===i.eventId);if(!r)return;let a=Math.min(s,r.end-1);e._internalEvents=e._internalEvents.map(e=>e.id===i.eventId?{...e,start:a}:e),n.invalidateAll();return}if(i.kind===`event-end`){let r=e._internalEvents.find(e=>e.id===i.eventId);if(!r)return;let a=Math.max(s,r.start+1);e._internalEvents=e._internalEvents.map(e=>e.id===i.eventId?{...e,end:a}:e),n.invalidateAll()}},{signal:i}),n.addEventListener(`pointerup`,r=>{let i=e._drag;if(n.releasePointerCapture(r.pointerId),i.kind===`axis-zoom`){e._drag={kind:`none`};return}if(i.kind===`marquee`){let r=Math.min(i.startLogicalX,i.currentLogicalX),a=Math.max(i.startLogicalX,i.currentLogicalX),o=Math.min(i.startY,i.currentY),s=Math.max(i.startY,i.currentY);if(Math.abs(a-r)<2&&Math.abs(s-o)<2)e._selectedIds=new Set,ID(e);else{let n=new Set;for(let i of e._internalEvents){let c=e._trackLayout.find(e=>e.trackKey===i.trackKey);if(!c)continue;let l=c.y+3,u=c.y+c.height-3;i.end>=r&&i.start<=a&&u>=o&&l<=s&&n.add(i.id)}e._selectedIds=n,ID(e)}e._drag={kind:`none`},n.invalidateAll();return}if(i.kind===`event-move`){let n=e._internalEvents.find(e=>e.id===i.eventId);n&&e.dispatchEvent(new CustomEvent(`event-move`,{detail:{eventId:n.id,fromTrackKey:i.originTrackKey,toTrackKey:n.trackKey,start:n.start,end:n.end},bubbles:!0,composed:!0})),e._drag={kind:`none`};return}if(i.kind===`event-start`||i.kind===`event-end`){let n=e._internalEvents.find(e=>e.id===i.eventId);n&&e.dispatchEvent(new CustomEvent(`event-resize`,{detail:{eventId:n.id,start:n.start,end:n.end},bubbles:!0,composed:!0})),e._drag={kind:`none`};return}e._drag={kind:`none`}},{signal:i}),n.addEventListener(`pointerleave`,()=>{e._tickledId!==void 0&&(e._tickledId=void 0,n.invalidateAll())},{signal:i}),()=>r.abort()}function PD(e,n,r){let i=e.pxPerUnit,a=n.convertFromViewportToCanvas(r.offsetX,r.offsetY),o=ED(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=OD(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 FD(e,n){let r=new Set(e._selectedIds);r.has(n)?r.delete(n):r.add(n),e._selectedIds=r,ID(e),e.getVCanvas()?.invalidateAll()}function ID(e){e.dispatchEvent(new CustomEvent(`selection-change`,{detail:{selectedIds:[...e._selectedIds]},bubbles:!0,composed:!0}))}const LD=r`
|
|
11945
11945
|
:host {
|
|
11946
11946
|
/* Layout */
|
|
11947
11947
|
--timeline-axis-height: 24px;
|
|
@@ -12091,7 +12091,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
12091
12091
|
.meta-area.visible {
|
|
12092
12092
|
display: block;
|
|
12093
12093
|
}
|
|
12094
|
-
`;let
|
|
12094
|
+
`;let RD=class extends n{constructor(...e){super(...e),this.label=``,this.trackKey=``,this.selected=!1,this.reorderable=!1,this.resizable=!1,this.#e=!1,this.#t=0,this.#n=0,this.#r=void 0,this.#o=e=>{if(this.#e){let n=e.screenY-this.#t,r=Math.max(24,this.#n+n);this.#a(`track-resize-move`,r);return}this.#i(e)?this.style.cursor=`ns-resize`:this.style.cursor=``},this.#s=e=>{this.#i(e)&&(e.stopPropagation(),e.preventDefault(),this.#e=!0,this.#t=e.screenY,this.#n=this.offsetHeight,this.#r=e.pointerId,this.setPointerCapture(e.pointerId))},this.#c=e=>{if(!this.#e)return;let n=e.screenY-this.#t,r=Math.max(24,this.#n+n);this.#a(`track-resize`,r),this.#u(e.pointerId)},this.#l=e=>{this.#e&&this.#u(this.#r)}}static{this.styles=[w,Yt,r`
|
|
12095
12095
|
:host {
|
|
12096
12096
|
display: flex;
|
|
12097
12097
|
align-items: center;
|
|
@@ -12136,7 +12136,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
12136
12136
|
`]}#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`
|
|
12137
12137
|
<span class="handle ixfx-handle" data-handle="dotted" data-shape="spot" part="handle"></span>
|
|
12138
12138
|
<span class="label">${this.label}</span>
|
|
12139
|
-
`}#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})],
|
|
12139
|
+
`}#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})],RD.prototype,`label`,void 0),E([d({type:String,attribute:`track-key`})],RD.prototype,`trackKey`,void 0),E([d({type:Boolean,reflect:!0})],RD.prototype,`selected`,void 0),E([d({type:Boolean,reflect:!0})],RD.prototype,`reorderable`,void 0),E([d({type:Boolean,reflect:!0})],RD.prototype,`resizable`,void 0),RD=E([T(`ixfx-timeline-track-tab`)],RD);function zD(e,n,r,i,a=0,o=0){return{x:e+r-i,y:n+a-o}}function BD(e,n,r,i,a=0,o=0){return{x:e-r+i,y:n-a+o}}function VD(e,n,r){return Math.max(n,Math.min(e,r))}const HD=r`
|
|
12140
12140
|
:host {
|
|
12141
12141
|
display: block;
|
|
12142
12142
|
position: relative;
|
|
@@ -12225,7 +12225,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
12225
12225
|
scroll-timeline: --scrollfade x;
|
|
12226
12226
|
}
|
|
12227
12227
|
|
|
12228
|
-
`;function HD(e,n){return e*n}function UD(e,n){return n===0||e<=n}function WD(e,n){return e<0||n===0?0:UD(e,n)?(n-e)/2:0}function GD(e,n,r,i,a){if(n===0||e<0)return 0;let o=r+i*a;return e>=o?0:UD(r,i)?r:e+n>o?Math.max(0,o-e):n}function KD(e,n,r,i){if(r===0)return{firstTile:0,lastTile:0,tiles:[]};let a=HD(n,i.tileWidthMultiplier);if(UD(r,n))return{firstTile:0,lastTile:0,tiles:[{index:0,logicalX:0}]};let o=Math.floor(e/a),s=Math.floor((e+n-1)/a),c=Math.max(0,Math.ceil(r/a)-1),l=[],u=o,d=Math.min(s+i.tilesBuffer,c);for(let e=u;e<=d;e++){let n=e*a;if(!(n>=r)&&(l.push({index:e,logicalX:n}),l.length>=i.maxPoolSize))break}return{firstTile:Math.max(0,o),lastTile:l.length>0?l[l.length-1].index:0,tiles:l}}function qD(e,n){return e*n}function JD(e,n){return n===0||e<=n}function YD(e,n){return e<0||n===0?0:JD(e,n)?(n-e)/2:0}function XD(e,n,r,i,a){if(n===0||e<0)return 0;let o=r+i*a;return e>=o?0:JD(r,i)?r:e+n>o?Math.max(0,o-e):n}function ZD(e,n,r,i){if(r===0)return{firstRow:0,lastRow:0,rows:[]};let a=qD(n,i.tileHeightMultiplier);if(JD(r,n))return{firstRow:0,lastRow:0,rows:[{row:0,logicalY:0}]};let o=Math.floor(e/a),s=Math.floor((e+n-1)/a),c=Math.max(0,Math.ceil(r/a)-1),l=[],u=Math.min(s+i.tilesBuffer,c);for(let e=o;e<=u;e++){let n=e*a;if(!(n>=r)&&(l.push({row:e,logicalY:n}),l.length>=i.maxPoolSize))break}return{firstRow:Math.max(0,o),lastRow:l.length>0?l[l.length-1].row:0,rows:l}}function QD(e,n){let r=null,i=(...i)=>{r&&clearTimeout(r),r=setTimeout(()=>{e(...i)},n)};return i.cancel=()=>{r&&=(clearTimeout(r),null)},i}const $D=[`#FF6B6B`,`#4ECDC4`,`#45B7D1`,`#96CEB4`,`#FFEAA7`,`#DDA0DD`,`#98D8C8`,`#F7DC6F`,`#BB8FCE`,`#85C1E9`];function eO(e){return $D[e%$D.length]}function tO(e,n,r,i,a){i.fillStyle=`whitesmoke`,i.fillRect(a.x,a.y,a.width,a.height),i.fillStyle=eO(e),i.strokeStyle=eO(e),i.lineWidth=2,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(a.x+a.width,a.y+a.height),i.moveTo(a.x+a.width,a.y),i.lineTo(a.x,a.y+a.height),i.stroke(),i.font=`24pt system-ui`,i.textBaseline=`top`,i.fillText(`#${e}/${n}`,a.x+20,a.y+20),i.font=`18pt system-ui`,i.fillText(`Pos: ${Math.round(a.x)},${Math.round(a.y)}`,a.x+20,a.y+60),i.fillText(`Size: ${Math.round(a.width)}x${Math.round(a.height)}`,a.x+20,a.y+90),i.fillText(`VCanvas width: ${Math.round(r)}`,a.x+20,a.y+120);let o=a.x+a.width/2,s=a.y+a.height/2;i.beginPath(),i.moveTo(a.x,s),i.lineTo(a.x+a.width,s),i.moveTo(o,a.y),i.lineTo(o,a.y+a.height),i.stroke(),i.strokeRect(a.x,a.y,a.width,a.height)}var nO=function(e,n,r,i){var a=arguments.length,o=a<3?n:i===null?i=Object.getOwnPropertyDescriptor(n,r):i,s;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,n,r,i);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(o=(a<3?s(o):a>3?s(n,r,o):s(n,r))||o);return a>3&&o&&Object.defineProperty(n,r,o),o};const rO=(e,n)=>`${e},${n}`;let iO=class extends n{_emitScrollEndEvent(e){let n=new CustomEvent(`scrollend-virtual`,{detail:{logicalScrollLeft:this._scrollLeft,logicalScrollTop:this._scrollTop,userGesture:e,containerScrollLeft:this._scrollContainer?.scrollLeft??0,containerScrollTop:this._scrollContainer?.scrollTop??0},bubbles:!0,composed:!0});this.dispatchEvent(n)}constructor(){super(),this.debugTrace=!1,this.debugDraw=!1,this.hinting=!1,this._viewportWidth=0,this._viewportHeight=0,this._scrollLeft=0,this._scrollTop=0,this._logicalHeight=0,this._tilePool=new Map,this._visibleTiles=new Set,this._pendingDraws=new Map,this._scrollContainer=null,this._spacer=null,this._tilePoolEl=null,this._childrenContainerEl=null,this._resizeObserver=null,this._positionedChildren=new Map,this._boundOnScroll=this._onScroll.bind(this),this._renderingOptions={tileWidthMultiplier:.5,tileHeightMultiplier:.5,tilesBuffer:2,overlapPercent:.01,overscrollPadMultiplier:1,maxPoolSize:3,scrollDebounceMs:100},this._dpr=window.devicePixelRatio||1,this._logicalWidth=0,this.logicalWidth=0,this.logicalHeight=0,this.drawCallback=null,this._scrollDebounce=QD(()=>{this._requestRedrawAll(`scrollDebounce`)},this._renderingOptions.scrollDebounceMs),this._scrollEndDebounce=QD(()=>{this._emitScrollEndEvent(!0)},this._renderingOptions.scrollDebounceMs),this._resizeDebounce=QD(()=>{this._onResize()},this._renderingOptions.scrollDebounceMs)}static{this.styles=VD}connectedCallback(){super.connectedCallback(),this._setupResizeObserver()}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver?.disconnect(),this._resizeObserver=null,this._scrollEndDebounce.cancel(),this._pendingDraws.forEach(e=>e.abort()),this._tilePool.clear(),this._scrollContainer?.removeEventListener(`scroll`,this._boundOnScroll)}firstUpdated(){let e=this.shadowRoot?.querySelector(`.scroll-container`);this._scrollContainer=e,this._spacer=this.shadowRoot?.querySelector(`.spacer`),this._tilePoolEl=this.shadowRoot?.querySelector(`.tile-pool`),this._childrenContainerEl=this.shadowRoot?.querySelector(`.children-container`),this._scrollContainer&&this._scrollContainer.addEventListener(`scroll`,this._boundOnScroll),requestAnimationFrame(()=>{this._updateViewportDimensions(),this._updateSpacer(),this._updateScrollContainerClass(),this._recalculateTiles(`firstUpdated cb`),this._positionChildren(`firstUpdated cb`)})}set logicalWidth(e){this._logicalWidth=e,this._updateSpacer(),this._updateScrollContainerClass(),this.hasUpdated&&(this._updateTileWidths(`set logicalWidth`),this._recalculateTiles(`set logicalWidth`))}get logicalWidth(){return this._logicalWidth}set logicalHeight(e){this._logicalHeight=e,this._updateSpacer(),this._updateScrollContainerClass(),this.hasUpdated&&this._recalculateTiles(`set logicalHeight`)}get logicalHeight(){return this._logicalHeight}get effectiveLogicalWidth(){return this._logicalWidth||this._viewportWidth}get effectiveLogicalHeight(){return this._logicalHeight||this._viewportHeight}_setupResizeObserver(){this._resizeObserver=new ResizeObserver(()=>{this._resizeDebounce()}),this._resizeObserver.observe(this)}_onResize(){let e=this._viewportWidth,n=this._viewportHeight;this._updateViewportDimensions();let r=e!==this._viewportWidth,i=n!==this._viewportHeight;(r||i)&&(this._updateSpacer(),this._updateScrollContainerClass(),this._recalculateTiles(`onResize`))}_updateTileWidths(e){let n=this._getTileWidth();for(let e of this._tilePool.values()){let r=this._getTileClippedWidth(e.logicalX,n);e.canvas.width=r*this._dpr,e.canvas.style.width=`${r}px`,e.ctx.scale(this._dpr,this._dpr)}this._requestRedrawAll(`updateTileWidths (${e})`)}_updateViewportDimensions(){let e=this.getBoundingClientRect();this._viewportWidth=e.width,this._viewportHeight=e.height}_onScroll(){if(!this._scrollContainer)return;let e=this._scrollContainer.scrollLeft,n=this._scrollContainer.scrollTop;(e!==this._scrollLeft||n!==this._scrollTop)&&(this._scrollLeft=e,this._scrollTop=n,this._recalculateTiles(`onScroll`),this._emitScrollEvent(!0),this._scrollDebounce(),this._scrollEndDebounce())}_updateSpacer(){if(!this._spacer)return;let e=UD(this.effectiveLogicalWidth,this._viewportWidth),n=JD(this.effectiveLogicalHeight,this._viewportHeight);e&&n?this._spacer.style.display=`none`:(this._spacer.style.display=`block`,this._spacer.style.width=`${this.effectiveLogicalWidth}px`,this._spacer.style.height=`${this.effectiveLogicalHeight}px`),this._childrenContainerEl&&(this._childrenContainerEl.style.width=`${this.effectiveLogicalWidth}px`,this._childrenContainerEl.style.height=`${this.effectiveLogicalHeight}px`)}_updateScrollContainerClass(){if(!this._scrollContainer)return;let e=this.effectiveLogicalHeight>this._viewportHeight;this._scrollContainer.classList.toggle(`vertical`,e)}_getTileWidth(){return HD(this._viewportWidth,this._renderingOptions.tileWidthMultiplier)}_getTileHeight(){return qD(this._viewportHeight,this._renderingOptions.tileHeightMultiplier)}_getTileClippedWidth(e,n){return GD(e,n,this.effectiveLogicalWidth,this._viewportWidth,this._renderingOptions.overscrollPadMultiplier)}_getTileClippedHeight(e,n){return XD(e,n,this.effectiveLogicalHeight,this._viewportHeight,this._renderingOptions.overscrollPadMultiplier)}_calculateTileRange(){return KD(this._scrollLeft,this._viewportWidth,this.effectiveLogicalWidth,this._renderingOptions)}_calculateTileRowRange(){return ZD(this._scrollTop,this._viewportHeight,this.effectiveLogicalHeight,this._renderingOptions)}_recalculateTiles(e){this._updateViewportDimensions();let{tiles:n}=this._calculateTileRange(),{rows:r}=this._calculateTileRowRange(),i=new Set;for(let{index:e,logicalX:a}of n)for(let{row:n,logicalY:o}of r)i.add(rO(e,n)),this._tilePool.has(rO(e,n))||this._tilePool.set(rO(e,n),this._createTile(e,n,a,o));let a=this._renderingOptions.maxPoolSize*Math.max(1,r.length),o=[...this._tilePool.keys()].filter(e=>!i.has(e)),s=[...i].filter(e=>!this._tilePool.has(e)),c=Math.min(o.length,s.length);for(let e=0;e<c;e++){let n=o[e],r=s[e],i=this._tilePool.get(n);if(i&&r){let[e,a]=r.split(`,`),o=Number(e),s=Number(a);this._tilePool.delete(n),i.col=o,i.row=s,i.logicalX=o*this._getTileWidth(),i.logicalY=s*this._getTileHeight(),i.visible=!1,i.canvas.dataset.tileKey=r,this._tilePool.set(r,i)}}let l=[...this._tilePool.keys()];if(l.length>a){let e=l.length-a;l.filter(e=>!i.has(e)).slice(0,e).forEach(e=>{let n=this._tilePool.get(e);n&&(this._tilePool.delete(e),n.canvas.remove())})}this._updateTiles(`recalculateTiles (${e})`)}_createTile(e,n,r,i){let a=document.createElement(`canvas`),o=rO(e,n);a.dataset.tileKey=o;let s=this._getTileWidth(),c=this._getTileHeight(),l=this._getTileClippedWidth(r,s),u=this._getTileClippedHeight(i,c),d=a.getContext(`2d`);if(!d)throw Error(`Could not get canvas context`);return this._viewportHeight===0&&this.#e(`Warning: Creating tile ${o} with viewport height 0. The VCanvas component may not be properly sized or visible.`),a.width=l*this._dpr,a.height=u*this._dpr,a.style.width=`${l}px`,a.style.height=`${u}px`,d.scale(this._dpr,this._dpr),this.#e(`Created tile ${o} at logicalX ${r} logicalY ${i}`),{canvas:a,ctx:d,logicalX:r,logicalY:i,col:e,row:n,visible:!1,isInDOM:!1}}_updateTiles(e){let{tiles:n,firstTile:r,lastTile:i}=this._calculateTileRange(),{rows:a,firstRow:o,lastRow:s}=this._calculateTileRowRange(),c=this._getTileWidth(),l=this._getTileHeight(),u=UD(this.effectiveLogicalWidth,this._viewportWidth),d=JD(this.effectiveLogicalHeight,this._viewportHeight),f=WD(this.effectiveLogicalWidth,this._viewportWidth),p=YD(this.effectiveLogicalHeight,this._viewportHeight),m=this._renderingOptions.tilesBuffer,h=[];for(let e of this._tilePool.values())e.visible=!1;this._visibleTiles.clear();for(let[n,a]of this._tilePool){let g=u?a.col===0:a.col>=r-m&&a.col<=i+m,_=d?a.row===0:a.row>=o-m&&a.row<=s+m;if(g&&_){this._visibleTiles.add(n);let r=a.col*c,i=a.row*l,o=u?f:r,s=d?p:i,m=this._getTileClippedWidth(r,c),g=this._getTileClippedHeight(i,l);(!a.visible||a.logicalX!==r||a.logicalY!==i||a.canvas.style.left!==`${o}px`||a.canvas.style.top!==`${s}px`||a.canvas.width!==m*this._dpr||a.canvas.height!==g*this._dpr)&&(a.logicalX=r,a.logicalY=i,a.canvas.width=m*this._dpr,a.canvas.style.width=`${m}px`,a.canvas.height=g*this._dpr,a.canvas.style.height=`${g}px`,a.canvas.style.left=`${o}px`,a.canvas.style.top=`${s}px`,a.ctx.scale(this._dpr,this._dpr),!a.isInDOM&&this._tilePoolEl&&(this._tilePoolEl.appendChild(a.canvas),a.isInDOM=!0),a.visible||(h.push(n),this._requestTileDraw(`updateTiles(${e})`,n))),a.visible=!0}else a.visible&&(a.visible=!1,a.isInDOM=!1,a.canvas.remove())}for(let{index:r,logicalX:i}of n)for(let{row:n,logicalY:o}of a){let a=rO(r,n);if(!this._tilePool.has(a)&&this._tilePoolEl){let s=this._createTile(r,n,i,o),c=u?f:i,l=d?p:o;s.canvas.style.left=`${c}px`,s.canvas.style.top=`${l}px`,s.visible=!0,s.isInDOM=!0,this._tilePoolEl.appendChild(s.canvas),this._tilePool.set(a,s),this._visibleTiles.add(a),h.push(a),this._requestTileDraw(`updateTiles(${e})`,a)}}return h}_requestRedrawAll(e){this.#e(`Requesting _requestRedrawAll: ${e} visible tiles: ${this._visibleTiles.size} pending draws: ${this._pendingDraws.size}`),this._pendingDraws.forEach(e=>e.abort()),this._pendingDraws.clear();for(let n of this._visibleTiles)this._requestTileDraw(`requestRedrawAll(${e})`,n)}#e(e){this.debugTrace&&console.log(`[VCanvas]`,e)}_requestTileDraw(e,n,r){let i=this._tilePool.get(n);if(!i||!this.drawCallback)return;let a=new AbortController;this._pendingDraws.set(n,a);let o=this._getTileWidth(),s=this._getTileHeight(),c=UD(this.effectiveLogicalWidth,this._viewportWidth),l=JD(this.effectiveLogicalHeight,this._viewportHeight),u;if(r)u=r;else{let e=o*this._renderingOptions.overlapPercent,n=s*this._renderingOptions.overlapPercent;u={x:c?0:i.logicalX-e,y:l?0:i.logicalY-n,width:c?this.effectiveLogicalWidth:o+e*2,height:l?this.effectiveLogicalHeight:s+n*2}}i.ctx.save(),i.ctx.translate(-i.logicalX,-i.logicalY);let d=u.x-i.logicalX,f=u.y-i.logicalY;r?(i.ctx.beginPath(),i.ctx.rect(d,f,u.width,u.height),i.ctx.clip(),i.ctx.clearRect(d,f,u.width,u.height)):i.ctx.clearRect(0,0,i.canvas.width,i.canvas.height),this.debugDraw&&tO(i.col,this._tilePool.size,this.effectiveLogicalWidth,i.ctx,u);try{this.drawCallback(i.ctx,u,a.signal)}finally{i&&i.ctx.restore(),this._pendingDraws.delete(n)}}_emitScrollEvent(e){let n=new CustomEvent(`scroll-virtual`,{detail:{logicalScrollLeft:this._scrollLeft,logicalScrollTop:this._scrollTop,userGesture:e,containerScrollLeft:this._scrollContainer?.scrollLeft??0,containerScrollTop:this._scrollContainer?.scrollTop??0,viewportStartLogical:this._scrollLeft,viewportEndLogical:this._scrollLeft+this._viewportWidth,viewportStartLogicalY:this._scrollTop,viewportEndLogicalY:this._scrollTop+this._viewportHeight},bubbles:!0,composed:!0});this.dispatchEvent(n)}isRegionVisible(e){let n=this._scrollLeft,r=this._scrollLeft+this._viewportWidth,i=e.x+e.width>n&&e.x<r,a=this._scrollTop,o=this._scrollTop+this._viewportHeight,s=e.y+e.height>a&&e.y<o;return i&&s}_updateScrollPosition(e){this._scrollContainer&&(this._scrollContainer.scrollLeft=this._scrollLeft,this._scrollContainer.scrollTop=this._scrollTop),this._recalculateTiles(`updateScrollPosition`),this._emitScrollEvent(e),this._scrollDebounce()}get logicalScrollLeft(){return this._scrollLeft}set logicalScrollLeft(e){let n=this._scrollLeft,r=BD(e,0,Math.max(0,this.effectiveLogicalWidth-this._viewportWidth));r!==this._scrollLeft&&(this._scrollLeft=r,this.requestUpdate(`logicalScrollLeft`,n),this._updateScrollPosition(!1))}get logicalScrollTop(){return this._scrollTop}set logicalScrollTop(e){let n=this._scrollTop,r=BD(e,0,Math.max(0,this.effectiveLogicalHeight-this._viewportHeight));r!==this._scrollTop&&(this._scrollTop=r,this.requestUpdate(`logicalScrollTop`,n),this._updateScrollPosition(!1))}get containerScrollLeft(){return this._scrollContainer?.scrollLeft??0}get containerScrollTop(){return this._scrollContainer?.scrollTop??0}get viewportWidth(){return this._viewportWidth}get viewportHeight(){return this._viewportHeight}setRenderingOptions(e){this._renderingOptions={...this._renderingOptions,...e},this._recalculateTiles(`setRenderingOptions`)}getRenderingOptions(){return this._renderingOptions}invalidateAll(){this._requestRedrawAll(`invalidateAll`)}invalidateRegion(e,n,r,i){this.#e(`invalidateRegion: ${e},${n},${r},${i}`);let a=this._getTileWidth(),o=this._getTileHeight(),{firstTile:s,lastTile:c}=this._calculateTileRange(),{firstRow:l,lastRow:u}=this._calculateTileRowRange(),d=this._renderingOptions.overlapPercent,f=Math.floor(e/a),p=Math.ceil((e+r)/a),m=Math.floor(n/o),h=Math.ceil((n+i)/o);for(let g=Math.max(s,f);g<=Math.min(c,p);g++)for(let s=Math.max(l,m);s<=Math.min(u,h);s++){let c=rO(g,s);if(this._visibleTiles.has(c)){let s=this._tilePool.get(c);if(s){let l=a*d,u=o*d,f=s.logicalX-l,p=s.logicalX+a+l,m=s.logicalY-u,h=s.logicalY+o+u,g=Math.max(e,f),_=Math.min(e+r,p)-g,v=Math.max(n,m),y=Math.min(n+i,h)-v;if(_>0&&y>0){let e={x:g,y:v,width:_,height:y};this._requestTileDraw(`invalidateRegion`,c,e)}}}}}convertFromViewportToCanvas(e,n){let r=WD(this.effectiveLogicalWidth,this._viewportWidth),i=YD(this.effectiveLogicalHeight,this._viewportHeight);return RD(e,n,this._scrollLeft,r,this._scrollTop,i)}convertFromCanvasToViewport(e,n){let r=WD(this.effectiveLogicalWidth,this._viewportWidth),i=YD(this.effectiveLogicalHeight,this._viewportHeight);return zD(e,n,this._scrollLeft,r,this._scrollTop,i)}positionChildRange(e,n,r,i,a){if(Number.isNaN(n)||Number.isNaN(r)){console.warn(`positionChildRange: Invalid startX or endX values: ${n}, ${r}`);return}let o=Array.from(this.children).filter(n=>n.matches?.(e)),s=i??0,c=a??this.effectiveLogicalHeight;for(let e of o)this._positionedChildren.set(e,{startX:n,endX:r,startY:s,endY:c});this._positionChildren(`positionChildRange`)}manualChildPositioningUpdate(){this._positionChildren(`manualChildPositioningUpdate`)}positionChildClear(e){for(let[n]of this._positionedChildren)n.matches?.(e)&&(this._positionedChildren.delete(n),n.removeAttribute(`style`))}_positionChildren(e){if(this.#e(`_positionChildren: ${e} positionedChildren: ${this._positionedChildren.size}`),this.hasUpdated&&this._childrenContainerEl)for(let[e,n]of this._positionedChildren){let r=n.endX-n.startX,i=n.endY-n.startY;e.setAttribute(`style`,`position: absolute; left: ${n.startX}px; top: ${n.startY}px; width: ${r}px; height: ${i}px;`)}}render(){let e=v({"scroll-container":!0,scrollable:this.hinting});return i`
|
|
12228
|
+
`;function UD(e,n){return e*n}function WD(e,n){return n===0||e<=n}function GD(e,n){return e<0||n===0?0:WD(e,n)?(n-e)/2:0}function KD(e,n,r,i,a){if(n===0||e<0)return 0;let o=r+i*a;return e>=o?0:WD(r,i)?r:e+n>o?Math.max(0,o-e):n}function qD(e,n,r,i){if(r===0)return{firstTile:0,lastTile:0,tiles:[]};let a=UD(n,i.tileWidthMultiplier);if(WD(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 JD(e,n){return e*n}function YD(e,n){return n===0||e<=n}function XD(e,n){return e<0||n===0?0:YD(e,n)?(n-e)/2:0}function ZD(e,n,r,i,a){if(n===0||e<0)return 0;let o=r+i*a;return e>=o?0:YD(r,i)?r:e+n>o?Math.max(0,o-e):n}function QD(e,n,r,i){if(r===0)return{firstRow:0,lastRow:0,rows:[]};let a=JD(n,i.tileHeightMultiplier);if(YD(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 $D(e,n){let r=null,i=(...i)=>{r&&clearTimeout(r),r=setTimeout(()=>{e(...i)},n)};return i.cancel=()=>{r&&=(clearTimeout(r),null)},i}const eO=[`#FF6B6B`,`#4ECDC4`,`#45B7D1`,`#96CEB4`,`#FFEAA7`,`#DDA0DD`,`#98D8C8`,`#F7DC6F`,`#BB8FCE`,`#85C1E9`];function tO(e){return eO[e%eO.length]}function nO(e,n,r,i,a){i.fillStyle=`whitesmoke`,i.fillRect(a.x,a.y,a.width,a.height),i.fillStyle=tO(e),i.strokeStyle=tO(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 rO=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 iO=(e,n)=>`${e},${n}`;let aO=class extends n{_emitScrollEndEvent(e){let n=new CustomEvent(`scrollend-virtual`,{detail:{logicalScrollLeft:this._scrollLeft,logicalScrollTop:this._scrollTop,userGesture:e,containerScrollLeft:this._scrollContainer?.scrollLeft??0,containerScrollTop:this._scrollContainer?.scrollTop??0},bubbles:!0,composed:!0});this.dispatchEvent(n)}constructor(){super(),this.debugTrace=!1,this.debugDraw=!1,this.hinting=!1,this._viewportWidth=0,this._viewportHeight=0,this._scrollLeft=0,this._scrollTop=0,this._logicalHeight=0,this._tilePool=new Map,this._visibleTiles=new Set,this._pendingDraws=new Map,this._scrollContainer=null,this._spacer=null,this._tilePoolEl=null,this._childrenContainerEl=null,this._resizeObserver=null,this._positionedChildren=new Map,this._boundOnScroll=this._onScroll.bind(this),this._renderingOptions={tileWidthMultiplier:.5,tileHeightMultiplier:.5,tilesBuffer:2,overlapPercent:.01,overscrollPadMultiplier:1,maxPoolSize:3,scrollDebounceMs:100},this._dpr=window.devicePixelRatio||1,this._logicalWidth=0,this.logicalWidth=0,this.logicalHeight=0,this.drawCallback=null,this._scrollDebounce=$D(()=>{this._requestRedrawAll(`scrollDebounce`)},this._renderingOptions.scrollDebounceMs),this._scrollEndDebounce=$D(()=>{this._emitScrollEndEvent(!0)},this._renderingOptions.scrollDebounceMs),this._resizeDebounce=$D(()=>{this._onResize()},this._renderingOptions.scrollDebounceMs)}static{this.styles=HD}connectedCallback(){super.connectedCallback(),this._setupResizeObserver()}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver?.disconnect(),this._resizeObserver=null,this._scrollEndDebounce.cancel(),this._pendingDraws.forEach(e=>e.abort()),this._tilePool.clear(),this._scrollContainer?.removeEventListener(`scroll`,this._boundOnScroll)}firstUpdated(){let e=this.shadowRoot?.querySelector(`.scroll-container`);this._scrollContainer=e,this._spacer=this.shadowRoot?.querySelector(`.spacer`),this._tilePoolEl=this.shadowRoot?.querySelector(`.tile-pool`),this._childrenContainerEl=this.shadowRoot?.querySelector(`.children-container`),this._scrollContainer&&this._scrollContainer.addEventListener(`scroll`,this._boundOnScroll),requestAnimationFrame(()=>{this._updateViewportDimensions(),this._updateSpacer(),this._updateScrollContainerClass(),this._recalculateTiles(`firstUpdated cb`),this._positionChildren(`firstUpdated cb`)})}set logicalWidth(e){this._logicalWidth=e,this._updateSpacer(),this._updateScrollContainerClass(),this.hasUpdated&&(this._updateTileWidths(`set logicalWidth`),this._recalculateTiles(`set logicalWidth`))}get logicalWidth(){return this._logicalWidth}set logicalHeight(e){this._logicalHeight=e,this._updateSpacer(),this._updateScrollContainerClass(),this.hasUpdated&&this._recalculateTiles(`set logicalHeight`)}get logicalHeight(){return this._logicalHeight}get effectiveLogicalWidth(){return this._logicalWidth||this._viewportWidth}get effectiveLogicalHeight(){return this._logicalHeight||this._viewportHeight}_setupResizeObserver(){this._resizeObserver=new ResizeObserver(()=>{this._resizeDebounce()}),this._resizeObserver.observe(this)}_onResize(){let e=this._viewportWidth,n=this._viewportHeight;this._updateViewportDimensions();let r=e!==this._viewportWidth,i=n!==this._viewportHeight;(r||i)&&(this._updateSpacer(),this._updateScrollContainerClass(),this._recalculateTiles(`onResize`))}_updateTileWidths(e){let n=this._getTileWidth();for(let e of this._tilePool.values()){let r=this._getTileClippedWidth(e.logicalX,n);e.canvas.width=r*this._dpr,e.canvas.style.width=`${r}px`,e.ctx.scale(this._dpr,this._dpr)}this._requestRedrawAll(`updateTileWidths (${e})`)}_updateViewportDimensions(){let e=this.getBoundingClientRect();this._viewportWidth=e.width,this._viewportHeight=e.height}_onScroll(){if(!this._scrollContainer)return;let e=this._scrollContainer.scrollLeft,n=this._scrollContainer.scrollTop;(e!==this._scrollLeft||n!==this._scrollTop)&&(this._scrollLeft=e,this._scrollTop=n,this._recalculateTiles(`onScroll`),this._emitScrollEvent(!0),this._scrollDebounce(),this._scrollEndDebounce())}_updateSpacer(){if(!this._spacer)return;let e=WD(this.effectiveLogicalWidth,this._viewportWidth),n=YD(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 UD(this._viewportWidth,this._renderingOptions.tileWidthMultiplier)}_getTileHeight(){return JD(this._viewportHeight,this._renderingOptions.tileHeightMultiplier)}_getTileClippedWidth(e,n){return KD(e,n,this.effectiveLogicalWidth,this._viewportWidth,this._renderingOptions.overscrollPadMultiplier)}_getTileClippedHeight(e,n){return ZD(e,n,this.effectiveLogicalHeight,this._viewportHeight,this._renderingOptions.overscrollPadMultiplier)}_calculateTileRange(){return qD(this._scrollLeft,this._viewportWidth,this.effectiveLogicalWidth,this._renderingOptions)}_calculateTileRowRange(){return QD(this._scrollTop,this._viewportHeight,this.effectiveLogicalHeight,this._renderingOptions)}_recalculateTiles(e){this._updateViewportDimensions();let{tiles:n}=this._calculateTileRange(),{rows:r}=this._calculateTileRowRange(),i=new Set;for(let{index:e,logicalX:a}of n)for(let{row:n,logicalY:o}of r)i.add(iO(e,n)),this._tilePool.has(iO(e,n))||this._tilePool.set(iO(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=iO(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=WD(this.effectiveLogicalWidth,this._viewportWidth),d=YD(this.effectiveLogicalHeight,this._viewportHeight),f=GD(this.effectiveLogicalWidth,this._viewportWidth),p=XD(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=iO(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=WD(this.effectiveLogicalWidth,this._viewportWidth),l=YD(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&&nO(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=VD(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=VD(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=iO(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=GD(this.effectiveLogicalWidth,this._viewportWidth),i=XD(this.effectiveLogicalHeight,this._viewportHeight);return zD(e,n,this._scrollLeft,r,this._scrollTop,i)}convertFromCanvasToViewport(e,n){let r=GD(this.effectiveLogicalWidth,this._viewportWidth),i=XD(this.effectiveLogicalHeight,this._viewportHeight);return BD(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`
|
|
12229
12229
|
<div class=${e}>
|
|
12230
12230
|
<div class="spacer"></div>
|
|
12231
12231
|
<div class="tile-pool"></div>
|
|
@@ -12233,7 +12233,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
12233
12233
|
<slot></slot>
|
|
12234
12234
|
</div>
|
|
12235
12235
|
</div>
|
|
12236
|
-
`}};
|
|
12236
|
+
`}};rO([d({type:Boolean})],aO.prototype,`hinting`,void 0),rO([d()],aO.prototype,`logicalWidth`,null),rO([d()],aO.prototype,`logicalHeight`,null),rO([d({type:Number})],aO.prototype,`logicalScrollLeft`,null),rO([d({type:Number})],aO.prototype,`logicalScrollTop`,null),aO=rO([l(`x-vcanvas`)],aO);const oO=1e4;let Z=class extends n{constructor(...e){super(...e),this.tracks=[],this.events=[],this.min=0,this.max=1e3,this.trackHeight=`fixed`,this.userScale=`normal`,this.reorderable=!1,this.metaEnabled=!1,this.altMajorBg=!1,this.defaultTrackHeight=48,this.gridMode=`adaptive`,this.minorStep=10,this.onDragging=null,this.formatLabel=String,this._ppu=1,this._viewRange={min:0,max:4e3},this._vViewRange={min:0,max:1},this._vScale=1,this._selectedIds=new Set,this._tickledId=void 0,this._drag={kind:`none`},this._metaHeight=120,this._trackHeightOverrides=new Map,this._trackLayout=[],this._internalEvents=[],this._internalTracks=[],this.#e=null,this.#t={},this.#n=null,this.#r=24,this.#i=void 0,this.#a=null,this.#o=!1,this.#s=!1,this.#C=e=>{this.#s?(this._viewRange=this.#_(this._viewRange.min,this._ppu),this.#m(this._vViewRange.min,this._vViewRange.max)):(this.#s=!0,this.#v(),this.#h(),this.#E()),this.#y(),this.#S()},this.#w=(e,n,r)=>{let i=this._ppu,a={x:n.x/i+this.min,y:n.y,width:n.width/i,height:n.height};this.#t=TD(this);let o=mD(this._viewRange,this.userScale,this.#c(),this.gridMode,this.minorStep,i),s=this._internalTracks.map(e=>({key:e.key,color:e.color}));bD(e,a,this._trackLayout,s,this.#t,i),vD(e,a,o,this.altMajorBg,this.#t,i),xD(e,a,this._internalEvents,this._trackLayout,this._selectedIds,this._tickledId,this._drag,this.#t,i),SD(e,this._drag,i);let c=this.#e?.logicalScrollTop??0;yD(e,a,o,this.#r,this.formatLabel,this.#t,i,c)},this.#T=e=>{let n=e.detail;if(n.userGesture===!1)return;let r=this._ppu;if(r<=0)return;let i=n.logicalScrollLeft/r+this.min;if(this._viewRange=this.#_(i,r),this._vScale>0){let e=this._vViewRange.max-this._vViewRange.min,r=n.logicalScrollTop/this._vScale;this.#m(r,r+e)}},this.#D=e=>{let n=e.detail,r=n.b-n.a,i=this.#c();r>0&&(this._ppu=Math.max(this.#l(),Math.min(i/r,oO))),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=AD(r,4),o=AD(i,4),s=MD(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=[LD]}#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,oO)),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,oO))),this._viewRange=this.#_(e.min,this._ppu)}setZoomPan(e,n){this._ppu=Math.max(this.#l(),Math.min(n,oO)),this._viewRange=this.#_(e,this._ppu)}setVerticalZoomPan(e,n){this.#m(e,n)}selectAll(){this._selectedIds=new Set(this._internalEvents.map(e=>e.id)),this.#R(),this.#S()}deselectAll(){this._selectedIds=new Set,this.#R(),this.#S()}getTrackEvents(e){return this._internalEvents.filter(n=>n.trackKey===e)}get selectedIds(){return[...this._selectedIds]}set selectedIds(e){this._selectedIds=new Set(e),this.#R(),this.#S()}selectTrack(e,n=!1){this.dispatchEvent(new CustomEvent(`track-select`,{detail:{trackKey:e,shiftKey:n},bubbles:!0,composed:!0}))}resetTrackHeights(){this._trackHeightOverrides=new Map,this.#o=!0}static{this.defaultDragSnapping=()=>({})}static{this.gridSnapping=e=>{let{gridResolution:n,currentStart:r,currentEnd:i}=e,{minorStep:a}=n;return{start:Math.round(r/a)*a,end:Math.round(i/a)*a}}}processDrag(e,n,r,i,a,o,s,c){let l=i,u=a,d=o;if(this.onDragging){let f=this.onDragging({eventId:e,rawLogicalX:n,rawY:r,currentStart:i,currentEnd:a,currentTrackKey:o,gridResolution:c,originTrackKey:s});l=f.start??i,u=f.end??a,d=f.trackKey??o}return this.dispatchEvent(new CustomEvent(`dragging`,{detail:{eventId:e,start:l,end:u,trackKey:d,rawLogicalX:n,rawY:r,originTrackKey:s},bubbles:!0,composed:!0})),{start:l,end:u,trackKey:d}}getVCanvas(){return this.#e}get tickledEvent(){return this._tickledId===void 0?null:this._internalEvents.find(e=>e.id===this._tickledId)??null}firstUpdated(){this.#e=this.shadowRoot?.querySelector(`x-vcanvas`),this.#e&&(this.#e.drawCallback=this.#w,this.#e.addEventListener(`scroll-virtual`,this.#T),this.#n=ND(this,this.#e),this.#a=new ResizeObserver(this.#C),this.#a.observe(this.#e))}disconnectedCallback(){super.disconnectedCallback(),this.#n?.(),this.#n=null,this.#a?.disconnect(),this.#a=null}willUpdate(e){let n=!1,r=!1,i=!1;e.has(`tracks`)&&(this._internalTracks=[...this.tracks],n=!0,r=!0),e.has(`events`)&&(this._internalEvents=[...this.events]),e.has(`trackHeight`)&&(this.trackHeight!==`free`&&this._trackHeightOverrides.size>0&&(this._trackHeightOverrides=new Map),n=!0,r=!0),(e.has(`_vScale`)||e.has(`defaultTrackHeight`)||e.has(`_trackHeightOverrides`))&&(n=!0),(e.has(`min`)||e.has(`max`))&&(i=!0),this.#o&&(this.#o=!1,r=!0),i&&this.#v(),r&&this.#h(),n&&this.#E()}updated(e){(e.has(`_ppu`)||e.has(`_viewRange`)||e.has(`min`)||e.has(`max`))&&(this.#y(),this.#S()),(e.has(`events`)||e.has(`userScale`)||e.has(`altMajorBg`)||e.has(`gridMode`)||e.has(`minorStep`))&&this.#S(),e.has(`_trackLayout`)&&(this.#b(),this.#N(),this.#S()),(e.has(`_vViewRange`)||e.has(`_vScale`))&&(this.#M(),this.#S()),this._tickledId!==this.#i&&(this.#i=this._tickledId,this.dispatchEvent(new CustomEvent(`tickle-change`,{detail:{event:this.tickledEvent},bubbles:!0,composed:!0})))}render(){let e=this.#d();return i`
|
|
12237
12237
|
<div class="content-wrapper">
|
|
12238
12238
|
<div class="content-area">
|
|
12239
12239
|
<div class="v-axis-zone"
|
|
@@ -12286,7 +12286,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
12286
12286
|
|
|
12287
12287
|
<div class="meta-resizer ${this.metaEnabled?`visible`:``}"></div>
|
|
12288
12288
|
<div class="meta-area ${this.metaEnabled?`visible`:``}" style="height:${this._metaHeight}px"></div>
|
|
12289
|
-
`}#v(){let e=this.#c(),n=this.max-this.min,r=.8;this._ppu=n>0?e/(n*r):1,this._viewRange={min:this.min,max:this.min+n*r},this.#y()}#y(){if(!this.#e)return;let e=this.max-this.min;this.#e.logicalWidth=e*this._ppu,this.#b(),this.#x()}#b(){if(!this.#e)return;let e=this._trackLayout.reduce((e,n)=>e+n.height,0),n=Math.max(e,40)+this.#r;this.#e.logicalHeight=n,this.#e.logicalScrollTop=this.#g}#x(){this.#e&&(this.#e.logicalScrollLeft=(this._viewRange.min-this.min)*this._ppu)}#S(){this.#e?.invalidateAll()}#C;#w;#T;#E(){let e=[],n=this.#r;for(let r of this._internalTracks){if(r.hidden)continue;let i=this._trackHeightOverrides.get(r.key)??r.height??this.defaultTrackHeight,a=Math.round(i*this._vScale);e.push({trackKey:r.key,y:n,height:a}),n+=a}this._trackLayout=e}#D;#O;#k;#A;#j;#M(){this.#b(),this.#N()}#N(){let e=this.shadowRoot?.querySelector(`.tab-column`);if(!e)return;let n=this.#e?.logicalScrollTop??0;e.style.transform=`translateY(${-n}px)`;for(let n of this._trackLayout){let r=e.querySelector(`ixfx-timeline-track-tab[track-key="${n.trackKey}"]`);r&&(r.style.top=`${n.y}px`,r.style.height=`${n.height}px`)}}get#P(){let e=getComputedStyle(this).getPropertyValue(`--timeline-tab-width`).trim();return Number.parseInt(e,10)||120}#F;#I;#L(e,n){if(this.trackHeight===`fixed`)this.defaultTrackHeight=n;else if(this.trackHeight===`free`){let r=new Map(this._trackHeightOverrides);r.set(e,n),this._trackHeightOverrides=r}}#R(){this.dispatchEvent(new CustomEvent(`selection-change`,{detail:{selectedIds:[...this._selectedIds]},bubbles:!0,composed:!0}))}};E([d({type:Array})],Z.prototype,`tracks`,void 0),E([d({type:Array})],Z.prototype,`events`,void 0),E([d({type:Number})],Z.prototype,`min`,void 0),E([d({type:Number})],Z.prototype,`max`,void 0),E([d({type:String,attribute:`track-height`})],Z.prototype,`trackHeight`,void 0),E([d({type:String,attribute:`user-scale`})],Z.prototype,`userScale`,void 0),E([d({type:Boolean})],Z.prototype,`reorderable`,void 0),E([d({type:Boolean,attribute:`meta`})],Z.prototype,`metaEnabled`,void 0),E([d({type:Boolean,attribute:`alt-major-bg`})],Z.prototype,`altMajorBg`,void 0),E([d({type:Number,attribute:`default-track-height`})],Z.prototype,`defaultTrackHeight`,void 0),E([d({type:String,attribute:`grid-mode`})],Z.prototype,`gridMode`,void 0),E([d({type:Number,attribute:`minor-step`})],Z.prototype,`minorStep`,void 0),E([d({type:Object})],Z.prototype,`onDragging`,void 0),E([m()],Z.prototype,`_ppu`,void 0),E([m()],Z.prototype,`_viewRange`,void 0),E([m()],Z.prototype,`_vViewRange`,void 0),E([m()],Z.prototype,`_vScale`,void 0),E([m()],Z.prototype,`_selectedIds`,void 0),E([m()],Z.prototype,`_tickledId`,void 0),E([m()],Z.prototype,`_drag`,void 0),E([m()],Z.prototype,`_metaHeight`,void 0),E([m()],Z.prototype,`_trackHeightOverrides`,void 0),E([m()],Z.prototype,`_trackLayout`,void 0),E([m()],Z.prototype,`_internalEvents`,void 0),E([m()],Z.prototype,`_internalTracks`,void 0),Z=E([T(`ixfx-timeline`)],Z);let
|
|
12289
|
+
`}#v(){let e=this.#c(),n=this.max-this.min,r=.8;this._ppu=n>0?e/(n*r):1,this._viewRange={min:this.min,max:this.min+n*r},this.#y()}#y(){if(!this.#e)return;let e=this.max-this.min;this.#e.logicalWidth=e*this._ppu,this.#b(),this.#x()}#b(){if(!this.#e)return;let e=this._trackLayout.reduce((e,n)=>e+n.height,0),n=Math.max(e,40)+this.#r;this.#e.logicalHeight=n,this.#e.logicalScrollTop=this.#g}#x(){this.#e&&(this.#e.logicalScrollLeft=(this._viewRange.min-this.min)*this._ppu)}#S(){this.#e?.invalidateAll()}#C;#w;#T;#E(){let e=[],n=this.#r;for(let r of this._internalTracks){if(r.hidden)continue;let i=this._trackHeightOverrides.get(r.key)??r.height??this.defaultTrackHeight,a=Math.round(i*this._vScale);e.push({trackKey:r.key,y:n,height:a}),n+=a}this._trackLayout=e}#D;#O;#k;#A;#j;#M(){this.#b(),this.#N()}#N(){let e=this.shadowRoot?.querySelector(`.tab-column`);if(!e)return;let n=this.#e?.logicalScrollTop??0;e.style.transform=`translateY(${-n}px)`;for(let n of this._trackLayout){let r=e.querySelector(`ixfx-timeline-track-tab[track-key="${n.trackKey}"]`);r&&(r.style.top=`${n.y}px`,r.style.height=`${n.height}px`)}}get#P(){let e=getComputedStyle(this).getPropertyValue(`--timeline-tab-width`).trim();return Number.parseInt(e,10)||120}#F;#I;#L(e,n){if(this.trackHeight===`fixed`)this.defaultTrackHeight=n;else if(this.trackHeight===`free`){let r=new Map(this._trackHeightOverrides);r.set(e,n),this._trackHeightOverrides=r}}#R(){this.dispatchEvent(new CustomEvent(`selection-change`,{detail:{selectedIds:[...this._selectedIds]},bubbles:!0,composed:!0}))}};E([d({type:Array})],Z.prototype,`tracks`,void 0),E([d({type:Array})],Z.prototype,`events`,void 0),E([d({type:Number})],Z.prototype,`min`,void 0),E([d({type:Number})],Z.prototype,`max`,void 0),E([d({type:String,attribute:`track-height`})],Z.prototype,`trackHeight`,void 0),E([d({type:String,attribute:`user-scale`})],Z.prototype,`userScale`,void 0),E([d({type:Boolean})],Z.prototype,`reorderable`,void 0),E([d({type:Boolean,attribute:`meta`})],Z.prototype,`metaEnabled`,void 0),E([d({type:Boolean,attribute:`alt-major-bg`})],Z.prototype,`altMajorBg`,void 0),E([d({type:Number,attribute:`default-track-height`})],Z.prototype,`defaultTrackHeight`,void 0),E([d({type:String,attribute:`grid-mode`})],Z.prototype,`gridMode`,void 0),E([d({type:Number,attribute:`minor-step`})],Z.prototype,`minorStep`,void 0),E([d({type:Object})],Z.prototype,`onDragging`,void 0),E([m()],Z.prototype,`_ppu`,void 0),E([m()],Z.prototype,`_viewRange`,void 0),E([m()],Z.prototype,`_vViewRange`,void 0),E([m()],Z.prototype,`_vScale`,void 0),E([m()],Z.prototype,`_selectedIds`,void 0),E([m()],Z.prototype,`_tickledId`,void 0),E([m()],Z.prototype,`_drag`,void 0),E([m()],Z.prototype,`_metaHeight`,void 0),E([m()],Z.prototype,`_trackHeightOverrides`,void 0),E([m()],Z.prototype,`_trackLayout`,void 0),E([m()],Z.prototype,`_internalEvents`,void 0),E([m()],Z.prototype,`_internalTracks`,void 0),Z=E([T(`ixfx-timeline`)],Z);let sO=class extends n{constructor(...e){super(...e),this.label=``,this.grow=!1,this.reorderable=!1}static{this.styles=[w,Yt,r`
|
|
12290
12290
|
:host {
|
|
12291
12291
|
display: flex;
|
|
12292
12292
|
flex-direction: column;
|
|
@@ -12362,7 +12362,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
12362
12362
|
<slot></slot>
|
|
12363
12363
|
</div>
|
|
12364
12364
|
</div>
|
|
12365
|
-
`}};E([d({type:String})],
|
|
12365
|
+
`}};E([d({type:String})],sO.prototype,`label`,void 0),E([d({type:Boolean,reflect:!0})],sO.prototype,`grow`,void 0),E([d({type:Boolean,reflect:!0})],sO.prototype,`reorderable`,void 0),sO=E([T(`ixfx-toolbar-group`)],sO);var cO;function lO(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 uO=!1;function dO(){if(uO)return;uO=!0;let e=document.createElement(`style`);e.textContent=`
|
|
12366
12366
|
.ixfx-drag-ghost.ixfx-toolbar-group-ghost {
|
|
12367
12367
|
padding: var(--space-s, 8px) var(--space-m, 16px);
|
|
12368
12368
|
background: var(--surface-4);
|
|
@@ -12375,7 +12375,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
12375
12375
|
user-select: none;
|
|
12376
12376
|
-webkit-user-select: none;
|
|
12377
12377
|
}
|
|
12378
|
-
`,document.head.appendChild(e)}let
|
|
12378
|
+
`,document.head.appendChild(e)}let fO=class extends n{static{cO=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-${cO._cnt++}`,this._sizes=new WeakMap,this._measureQueued=!1,this._dragState=null,this._suppressNextClick=!1,this._onClickCapture=e=>{this._suppressNextClick&&(this._suppressNextClick=!1,e.preventDefault(),e.stopPropagation())},this._onKeyDown=e=>{let n=this._dragState;if(e.key!==`Escape`||!n?.active)return;e.preventDefault();let r=n.pointerId;this._abortDrag(),this._endDrag(r)},this._onPointerDown=e=>{if(!this.allowReorder||e.button!==0)return;let n=this._findDragTarget(e);n?.parentNode&&(Array.prototype.indexOf.call(n.parentNode.children,n)<0||(this._dragState={pointerId:e.pointerId,source:n,startX:e.clientX,startY:e.clientY,active:!1,ghost:null,gapIndex:void 0},window.addEventListener(`pointermove`,this._onPointerMove),window.addEventListener(`pointerup`,this._onPointerUp),window.addEventListener(`pointercancel`,this._onPointerCancel)))},this._onPointerMove=e=>{let n=this._dragState;if(!n||e.pointerId!==n.pointerId)return;let r=Math.hypot(e.clientX-n.startX,e.clientY-n.startY);if(!n.active){if(r<5)return;this._beginDrag(e)}n.ghost?.move(e.clientX,e.clientY);let i=this._computeGapIndex(e.clientX,e.clientY);i!==n.gapIndex&&(n.gapIndex=i,this.requestUpdate())},this._onPointerUp=e=>{let n=this._dragState;if(!(!n||e.pointerId!==n.pointerId)){if(n.active){let r=this._computeGapIndex(e.clientX,e.clientY);this._commitDrag(n.source,r)}this._endDrag(e.pointerId)}},this._onPointerCancel=e=>{let n=this._dragState;!n||e.pointerId!==n.pointerId||(this._abortDrag(),this._endDrag(e.pointerId))}}static{this._cnt=0}static{this.styles=[w,ue,r`
|
|
12379
12379
|
:host {
|
|
12380
12380
|
--toolbar-gap: var(--space-s);
|
|
12381
12381
|
--toolbar-group-gap: var(--space-m);
|
|
@@ -12473,7 +12473,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
12473
12473
|
pointer-events: none;
|
|
12474
12474
|
z-index: 1;
|
|
12475
12475
|
}
|
|
12476
|
-
`]}connectedCallback(){super.connectedCallback(),this.style.setProperty(`--anchor-name`,this._anchor),this.addEventListener(`click`,this._onClickCapture,!0)}firstUpdated(){this._slot.addEventListener(`slotchange`,()=>{this._updateGroups(),this._scheduleMeasure()}),this._ro=new ResizeObserver(()=>this._scheduleMeasure()),this._ro.observe(this._inner),this._popover.addEventListener(`toggle`,()=>{this._popoverOpen=this._popover.matches(`:popover-open`)}),this._scheduleMeasure(),this._updateGroups()}updated(e){(e.has(`showGroupLabels`)||e.has(`allowReorder`))&&this._updateGroups()}_mainGroups(){return Array.from(this.children).filter(e=>e.tagName===`IXFX-TOOLBAR-GROUP`&&e.getAttribute(`slot`)!==`overflow`)}_groupKey(e){return e.id||e.label||``}getGroupOrder(){return this._mainGroups().map(e=>this._groupKey(e))}setGroupOrder(e){let n=this._mainGroups();if(n.length===0)return;let r=new Set,i=[];for(let a of e){let e=n.find(e=>!r.has(e)&&e.id===a&&a!==``)??n.find(e=>!r.has(e)&&this._groupKey(e)===a);e&&(r.add(e),i.push(e))}let a=[...i,...n.filter(e=>!r.has(e))],o=a.length*a.length+1,s=!0;for(;s&&o-->0;){s=!1;for(let e=0;e+1<a.length;e++){let n=a[e],r=a[e+1];n.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_FOLLOWING||this._insertAndEmit(n,r)&&(s=!0)}}}getLayoutSnapshot(){return{version:1,order:this.getGroupOrder()}}applyLayoutSnapshot(e){if(typeof e!=`object`||!e)return!1;let{version:n,order:r}=e;return n!==1||!Array.isArray(r)||!r.every(e=>typeof e==`string`)?!1:(this.setGroupOrder(r),!0)}_insertAndEmit(e,n){let r=e.parentNode;if(!r)return!1;let i=Array.prototype.indexOf.call(r.children,e);r.insertBefore(e,n);let a=Array.prototype.indexOf.call(r.children,e);return a!==i&&(this.dispatchEvent(new CustomEvent(`reorder`,{bubbles:!0,composed:!0,detail:{fromIndex:i,toIndex:a,group:e}})),this._updateGroups(),this._scheduleMeasure(),!0)}_updateGroups(){for(let e of Array.from(this.children))e.tagName===`IXFX-TOOLBAR-GROUP`&&(this.showGroupLabels?e.setAttribute(`show-label`,``):e.removeAttribute(`show-label`),this.allowReorder&&e.getAttribute(`slot`)!==`overflow`?e.setAttribute(`reorderable`,``):e.removeAttribute(`reorderable`))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`click`,this._onClickCapture,!0),this._ro?.disconnect(),this._dragState&&(this._abortDrag(),this._endDrag(this._dragState.pointerId))}_findDragTarget(e){if(!this.allowReorder)return null;let n=e.composedPath(),r=null,i=!1;for(let e of n)e instanceof HTMLElement&&(e.classList.contains(`grab-handle`)&&(i=!0),!r&&e.tagName===`IXFX-TOOLBAR-GROUP`&&(r=e));return!r||!i||r.getAttribute(`slot`)===`overflow`?null:r}_beginDrag(e){let n=this._dragState;if(!(!n||n.active)){try{this.setPointerCapture(e.pointerId)}catch{}n.active=!0,this.setAttribute(`dragging`,``),n.source.setAttribute(`drag-source`,``),n.ghost=this._createGhost(n.source),n.ghost?.move(e.clientX,e.clientY)}}_abortDrag(){let e=this._dragState;e&&(e.source.removeAttribute(`drag-source`),e.gapIndex!==void 0&&(e.gapIndex=void 0,this.requestUpdate()))}_endDrag(e){let n=this._dragState;if(n){n.ghost?.destroy(),n.ghost=null,this.removeAttribute(`dragging`),this._dragState=null,window.removeEventListener(`pointermove`,this._onPointerMove),window.removeEventListener(`pointerup`,this._onPointerUp),window.removeEventListener(`pointercancel`,this._onPointerCancel);try{this.releasePointerCapture(e)}catch{}this.requestUpdate()}}_commitDrag(e,n){e.removeAttribute(`drag-source`);let r=this._mainGroups().filter(n=>n!==e),i=r.length,a=n===void 0?i:Math.max(0,Math.min(n,i)),o=this.orientation===`vertical-left`?i-a:a;if(!e.parentNode)return;let s=r[o]??null;this._insertAndEmit(e,s)&&(this._suppressNextClick=!0)}_createGhost(e){let n=document.createElement(`span`);n.textContent=(`label`in e&&typeof e.label==`string`&&e.label||(e.textContent??``).trim()).slice(0,60),n.style.overflow=`hidden`,n.style.textOverflow=`ellipsis`,n.style.whiteSpace=`nowrap`;try{return
|
|
12476
|
+
`]}connectedCallback(){super.connectedCallback(),this.style.setProperty(`--anchor-name`,this._anchor),this.addEventListener(`click`,this._onClickCapture,!0)}firstUpdated(){this._slot.addEventListener(`slotchange`,()=>{this._updateGroups(),this._scheduleMeasure()}),this._ro=new ResizeObserver(()=>this._scheduleMeasure()),this._ro.observe(this._inner),this._popover.addEventListener(`toggle`,()=>{this._popoverOpen=this._popover.matches(`:popover-open`)}),this._scheduleMeasure(),this._updateGroups()}updated(e){(e.has(`showGroupLabels`)||e.has(`allowReorder`))&&this._updateGroups()}_mainGroups(){return Array.from(this.children).filter(e=>e.tagName===`IXFX-TOOLBAR-GROUP`&&e.getAttribute(`slot`)!==`overflow`)}_groupKey(e){return e.id||e.label||``}getGroupOrder(){return this._mainGroups().map(e=>this._groupKey(e))}setGroupOrder(e){let n=this._mainGroups();if(n.length===0)return;let r=new Set,i=[];for(let a of e){let e=n.find(e=>!r.has(e)&&e.id===a&&a!==``)??n.find(e=>!r.has(e)&&this._groupKey(e)===a);e&&(r.add(e),i.push(e))}let a=[...i,...n.filter(e=>!r.has(e))],o=a.length*a.length+1,s=!0;for(;s&&o-->0;){s=!1;for(let e=0;e+1<a.length;e++){let n=a[e],r=a[e+1];n.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_FOLLOWING||this._insertAndEmit(n,r)&&(s=!0)}}}getLayoutSnapshot(){return{version:1,order:this.getGroupOrder()}}applyLayoutSnapshot(e){if(typeof e!=`object`||!e)return!1;let{version:n,order:r}=e;return n!==1||!Array.isArray(r)||!r.every(e=>typeof e==`string`)?!1:(this.setGroupOrder(r),!0)}_insertAndEmit(e,n){let r=e.parentNode;if(!r)return!1;let i=Array.prototype.indexOf.call(r.children,e);r.insertBefore(e,n);let a=Array.prototype.indexOf.call(r.children,e);return a!==i&&(this.dispatchEvent(new CustomEvent(`reorder`,{bubbles:!0,composed:!0,detail:{fromIndex:i,toIndex:a,group:e}})),this._updateGroups(),this._scheduleMeasure(),!0)}_updateGroups(){for(let e of Array.from(this.children))e.tagName===`IXFX-TOOLBAR-GROUP`&&(this.showGroupLabels?e.setAttribute(`show-label`,``):e.removeAttribute(`show-label`),this.allowReorder&&e.getAttribute(`slot`)!==`overflow`?e.setAttribute(`reorderable`,``):e.removeAttribute(`reorderable`))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`click`,this._onClickCapture,!0),this._ro?.disconnect(),this._dragState&&(this._abortDrag(),this._endDrag(this._dragState.pointerId))}_findDragTarget(e){if(!this.allowReorder)return null;let n=e.composedPath(),r=null,i=!1;for(let e of n)e instanceof HTMLElement&&(e.classList.contains(`grab-handle`)&&(i=!0),!r&&e.tagName===`IXFX-TOOLBAR-GROUP`&&(r=e));return!r||!i||r.getAttribute(`slot`)===`overflow`?null:r}_beginDrag(e){let n=this._dragState;if(!(!n||n.active)){try{this.setPointerCapture(e.pointerId)}catch{}n.active=!0,this.setAttribute(`dragging`,``),n.source.setAttribute(`drag-source`,``),n.ghost=this._createGhost(n.source),n.ghost?.move(e.clientX,e.clientY)}}_abortDrag(){let e=this._dragState;e&&(e.source.removeAttribute(`drag-source`),e.gapIndex!==void 0&&(e.gapIndex=void 0,this.requestUpdate()))}_endDrag(e){let n=this._dragState;if(n){n.ghost?.destroy(),n.ghost=null,this.removeAttribute(`dragging`),this._dragState=null,window.removeEventListener(`pointermove`,this._onPointerMove),window.removeEventListener(`pointerup`,this._onPointerUp),window.removeEventListener(`pointercancel`,this._onPointerCancel);try{this.releasePointerCapture(e)}catch{}this.requestUpdate()}}_commitDrag(e,n){e.removeAttribute(`drag-source`);let r=this._mainGroups().filter(n=>n!==e),i=r.length,a=n===void 0?i:Math.max(0,Math.min(n,i)),o=this.orientation===`vertical-left`?i-a:a;if(!e.parentNode)return;let s=r[o]??null;this._insertAndEmit(e,s)&&(this._suppressNextClick=!0)}_createGhost(e){let n=document.createElement(`span`);n.textContent=(`label`in e&&typeof e.label==`string`&&e.label||(e.textContent??``).trim()).slice(0,60),n.style.overflow=`hidden`,n.style.textOverflow=`ellipsis`,n.style.whiteSpace=`nowrap`;try{return dO(),zg({anchor:e,content:n,className:`ixfx-toolbar-group-ghost`})}catch{return null}}_computeGapIndex(e,n){let r=this._dragState;if(!r)return;let i=this._mainGroups().filter(e=>e!==r.source);if(i.length===0)return 0;let a=this.orientation===`vertical-left`?[...i].reverse():i,o=this.orientation===`horizontal`,s=o?e:n;return lO(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`
|
|
12477
12477
|
<div class="inner" role="toolbar" aria-orientation=${this.orientation}>
|
|
12478
12478
|
<slot @pointerdown=${this._onPointerDown} @keydown=${this._onKeyDown}></slot>
|
|
12479
12479
|
<ixfx-button class="overflow-btn" ?hidden=${!n} @click=${this._toggleOverflow} aria-label="More" aria-haspopup="true" aria-expanded=${this._popoverOpen}>⋯</ixfx-button>
|
|
@@ -12482,7 +12482,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
12482
12482
|
<slot name="overflow"></slot>
|
|
12483
12483
|
</div>
|
|
12484
12484
|
${r?i`<div class="drop-caret" style=${r}></div>`:a}
|
|
12485
|
-
`}};E([d({type:String,reflect:!0})],
|
|
12485
|
+
`}};E([d({type:String,reflect:!0})],fO.prototype,`orientation`,void 0),E([d({type:String,reflect:!0})],fO.prototype,`layout`,void 0),E([d({type:String,attribute:`vertical-writing`,reflect:!0})],fO.prototype,`verticalWriting`,void 0),E([d({type:String,attribute:`toolbar-align`,reflect:!0})],fO.prototype,`toolbarAlign`,void 0),E([d({type:Boolean,attribute:`show-group-labels`,reflect:!0})],fO.prototype,`showGroupLabels`,void 0),E([d({type:Boolean,attribute:`invisible-groups`,reflect:!0})],fO.prototype,`invisibleGroups`,void 0),E([d({type:Boolean,attribute:`allow-reorder`,reflect:!0})],fO.prototype,`allowReorder`,void 0),E([m()],fO.prototype,`_overflowCount`,void 0),E([m()],fO.prototype,`_popoverOpen`,void 0),E([f(`.inner`)],fO.prototype,`_inner`,void 0),E([f(`.overflow-popover`)],fO.prototype,`_popover`,void 0),E([f(`slot`)],fO.prototype,`_slot`,void 0),fO=cO=E([T(`ixfx-toolbar`)],fO);let pO=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`
|
|
12486
12486
|
${S(`cc${this._transitionId}`,i`
|
|
12487
12487
|
<span class="layer current char-swap">
|
|
12488
12488
|
${r.map((e,n)=>i`<span class="char in" style=${c(n)}>${e}</span>`)}
|
|
@@ -12642,7 +12642,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
12642
12642
|
from { opacity: 1; transform: translateY(0) scale(1); }
|
|
12643
12643
|
to { opacity: 0; transform: translateY(0.3em) scale(0.8); }
|
|
12644
12644
|
}
|
|
12645
|
-
`}};E([d({type:String})],fO.prototype,`text`,void 0),E([d({type:String})],fO.prototype,`effect`,void 0),E([d({type:Number})],fO.prototype,`duration`,void 0),E([d({type:String})],fO.prototype,`easing`,void 0),E([m()],fO.prototype,`_currentText`,void 0),E([m()],fO.prototype,`_outgoingText`,void 0),E([m()],fO.prototype,`_activeEffect`,void 0),E([m()],fO.prototype,`_transitionId`,void 0),fO=E([T(`ixfx-transitory-label`)],fO);var pO=class{#e;#t;#n;#r=new WeakMap;#i=new Map;#a=new Map;#o=new WeakMap;#s;constructor(e,n,r){this.#e=e,this.#t=n,this.#n=r}connect(){this.disconnect(),this.#s=new AbortController;let{signal:e}=this.#s;this.#o=new WeakMap,this.#i.clear(),this.#a.clear();let n={item:this.#c(this.#e)};this.#r.set(n,this.#e),n.children=this.#l(this.#e),this.#t.root=n,this.#t.addEventListener(`expand`,e=>{let{node:n}=e.detail,r=this.#r.get(n);r&&(n.children=this.#l(r),this.#t.invalidateStructure())},{signal:e}),this.#t.addEventListener(`collapse`,e=>{},{signal:e})}disconnect(){this.#s?.abort(),this.#s=void 0}sync(){let e=this.#t.root;e&&(this.#o=new WeakMap,this.#i.clear(),this.#a.clear(),this.#r.set(e,this.#e),e.item=this.#c(this.#e),e.children=this.#f(this.#e,e.children??[]),this.#t.invalidateStructure())}lookupByKey(e){return this.#a.get(e)}navigateToKeyPath(e,n){if(e.length===0)return!1;let r=this.#t.root?.children??[];for(let n=0;n<e.length-1;n++){let i=r.find(r=>r.item.key===e[n]);if(!i)return!1;if(i.children===void 0){let e=this.#r.get(i);e&&(i.children=this.#l(e),this.#t.invalidateStructure())}r=i.children??[]}return this.#t.navigateTo(e,n)}navigateToIdentity(e,n){let r=this.#i.get(e);if(!r)return!1;let i=[],a=this.#e.getIdentity();for(;r&&r.getIdentity()!==a;)i.unshift(this.#c(r).key),r=r.getParent();return r!==void 0&&this.navigateToKeyPath(i,n)}navigateToValue(e,n){let r=this.#p(this.#e,e);return r?this.navigateToKeyPath(r.slice(1).map(e=>this.#c(e).key),n):!1}#c(e,n){let r=e.getIdentity(),i=this.#o.get(r);return i||(i=this.#n.valueToItem(e.getValue(),e),this.#o.set(r,i)),n===void 0?i:{...i,isLeaf:i.isLeaf??n}}#l(e){return Array.from(e.children(),e=>this.#d(e))}#u(e,n){this.#r.set(e,n),this.#i.set(n.getIdentity(),n),this.#a.set(e.item.key,n)}#d(e){let n=[...e.children()];for(let e of n)this.#i.set(e.getIdentity(),e);let r={item:this.#c(e,n.length===0)};return this.#u(r,e),r}#f(e,n){let r=new Map(n.map(e=>[e.item.key,e]));return Array.from(e.children(),e=>{let n=this.#d(e),i=r.get(n.item.key);return i?(i.item=n.item,this.#u(i,e),i.children!==void 0&&(i.children=this.#f(e,i.children)),i):n})}#p(e,n,r=[]){let i=[...r,e];if(n(e.getValue()))return i;for(let r of e.children()){let e=this.#p(r,n,i);if(e)return e}}};function mO(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:0}function hO(e,n){if(e){if(e.item.key===n)return e;for(let r of e.children??[]){let e=hO(r,n);if(e)return e}}}function gO(e,n){if(e){if(e.item.key===n)return[e];for(let r of e.children??[]){let i=gO(r,n);if(i)return[e,...i]}}}function _O(e,n,r){if(e.length===0||n<=0||r<=0)return 1/0;let i=0;for(let a of e){if(a<=0)return 1/0;let e=r*r*a/(n*n);i=Math.max(i,e,1/e)}return i}function vO(e,n){let r=Array.from({length:e.length}),i=n.x,a=n.y,o=n.width,s=n.height,c=0;for(;c<e.length;){let n=Math.min(o,s),l=c+1,u=e.slice(c,l).map(e=>e.area),d=u.reduce((e,n)=>e+n,0),f=_O(u,d,n);for(;l<e.length;){let r=e.slice(c,l+1).map(e=>e.area),i=r.reduce((e,n)=>e+n,0),a=_O(r,i,n);if(a<=f)l++,u=r,d=i,f=a;else break}if(o<=s){let e=d/o,n=i;for(let i=c;i<l;i++){let o=u[i-c]/e;r[i]={x:n,y:a,width:o,height:e},n+=o}a+=e,s-=e}else{let e=d/s,n=a;for(let a=c;a<l;a++){let o=u[a-c]/e;r[a]={x:i,y:n,width:e,height:o},n+=o}i+=e,o-=e}c=l}return r}function yO(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?Math.min(e,1):0}function bO(e,n,r,i){if(e.width<=0||e.height<=0)return n.map(()=>({x:e.x,y:e.y,width:0,height:0}));let a=n.reduce((e,n)=>e+n,0),o=a>0?n.map(e=>e/a):n.map(()=>1/n.length),s=r===`dice`||r===`slice-dice`&&i%2==0,c=r===`slice`||r===`slice-dice`&&i%2==1;if(r===`squarify`){let r=o.map((e,n)=>({share:e,i:n})).filter(e=>e.share>0),i=n.map(()=>({x:e.x,y:e.y,width:0,height:0}));if(r.length>0){let n=e.width*e.height,a=vO(r.map(e=>({area:e.share*n})),e);r.forEach((e,n)=>{i[e.i]=a[n]})}return i}let l=[];if(s){let n=e.x;o.forEach(r=>{let i=e.width*r;l.push({x:n,y:e.y,width:i,height:e.height}),n+=i})}else if(c){let n=e.y;o.forEach(r=>{let i=e.height*r;l.push({x:e.x,y:n,width:e.width,height:i}),n+=i})}return l}function xO(e,n={}){if(!e?.children?.length)return[];let{maxDepth:r=1/0,valueAccessor:i=()=>1,zoomKey:a,tilingMethod:o=`squarify`,hideLeaves:s=!1,presentation:c=`nested`,cascadeOffsetX:l,cascadeOffsetY:u}=n;if(r<=0)return[];let d=c===`cascaded`,f=d?yO(l):0,p=d?yO(u):0,m=e=>{let n=e.children??[];return s?n.filter(e=>e.item.isLeaf!==!0):n},h=a===void 0?e:hO(e,a)??e,g=gO(e,h.item.key),_=g?g.length-2:-1,v=m(h);if(v.length===0)return[];let y=[],b=(e,n,a,s,c)=>{if(e.length===0||s>=r)return;let l=bO(n,e.map(e=>mO(i(e.item))),o,s),u=e.length;e.forEach((e,n)=>{let r=l[n],i=m(e);if(y.push({node:e,depth:a,relativeDepth:s,x:r.x,y:r.y,width:r.width,height:r.height,parentKey:c,index:n,setSize:u,hasChildren:i.length>0||e.children===void 0&&e.item.isLeaf!==!0}),i.length>0){let n=f<=0&&p<=0?r:{x:r.x+f,y:r.y+p,width:Math.max(0,r.width-f),height:Math.max(0,r.height-p)};b(i,n,a+1,s+1,e.item.key)}})};return b(v,{x:0,y:0,width:1,height:1},_+1,0,h.item.key),y}let Q=class extends n{constructor(...e){super(...e),this.exclusivity=`none`,this.selectionFilter=`all`,this.interactionMode=`standard`,this.tilingMethod=`squarify`,this.presentation=`nested`,this.cascadeOffset=6,this.maxDepth=4,this.hideLeaves=!1,this.minLabelArea=1600,this.minTileWidth=24,this.padding=4,this.minChildArea=400,this.valueAccessor=()=>1,this._selectedNodes=new Set,this.disableKeyboardNavigation=!1,this.registry=void 0,this._zoomKey=void 0,this.search=new Bt(this,{adapter:Ut(this,{labelSelector:`.treemap-label`,highlightKey:`incr-search-highlight`})}),this.tickled=new ie(this,{getItems:()=>this.#u().map(e=>({id:e.node.item.key,enabled:!0})),onStateChange:()=>{this.setAttribute(`data-input-mode`,this.tickled.inputMode)},onTickle:e=>{if(e===void 0)return;let n=this.#u().find(n=>n.node.item.key===e);n&&this.dispatchEvent(new CustomEvent(`tickle`,{detail:{node:n.node,depth:n.depth},bubbles:!0,composed:!0}))}}),this.#t=new Set,this.#n=new Map,this.#c=0}get selectedNodes(){return this._selectedNodes}get focusedNode(){if(this._zoomKey!==void 0)return hO(this.#l,this._zoomKey)}#e;#t;#n;#r;#i;#a;#o;#s;#c;get#l(){return this.model?.root??this.root}#u(){return this.#d(this._zoomKey)}#d(e){return xO(this.#l,{valueAccessor:this.valueAccessor,maxDepth:this.maxDepth,zoomKey:e,tilingMethod:this.tilingMethod,hideLeaves:this.hideLeaves,presentation:this.presentation,...this.#f()})}#f(){if(this.presentation!==`cascaded`||!Number.isFinite(this.cascadeOffset)||this.cascadeOffset<=0)return{};let e=this.clientWidth||0,n=this.clientHeight||0;return e<=0||n<=0?{}:{cascadeOffsetX:this.cascadeOffset/e,cascadeOffsetY:this.cascadeOffset/n}}connectedCallback(){super.connectedCallback(),this.setAttribute(`data-input-mode`,`mouse`);let e=this.#i=Jt();e.register({id:`select-all`,label:`Select All`,description:`Select all visible items`,execute:()=>this.selectAll()}),e.register({id:`deselect-all`,label:`Deselect All`,description:`Clear all selection`,execute:()=>this.deselectAll()}),this.registry=e,this.#m(),typeof ResizeObserver<`u`&&(this.#o=new ResizeObserver(()=>this.requestUpdate()),this.#o.observe(this))}disconnectedCallback(){super.disconnectedCallback(),this.#e?.(),this.#e=void 0;for(let e of this.#n.values())e.abort();this.#n.clear(),this.#t.clear(),this.#o?.disconnect(),this.#o=void 0,this.#i&&(this.#i.unregister(`select-all`),this.#i.unregister(`deselect-all`),this.#i=void 0,this.registry=void 0)}#p(){let e=this.searchModes?.trim();if(e===void 0)return[...Rt];let n=new Set(e.split(/\s+/));return Rt.filter(e=>n.has(e))}#m(){this.#i&&(this.search.setModes(this.#p()),this.#a?.(),this.#a=Lt(this.#i,this.search))}updated(e){if(e.has(`root`)&&this.root&&this.#h(),e.has(`model`)&&(this.#e?.(),this.#e=void 0,this.model&&(this.#e=this.model._subscribe(e=>{e.type===`root`?(this.#h(),this.requestUpdate()):e.type===`invalidate`&&this.requestUpdate()}),this.#h())),e.has(`interactionMode`)&&(this.#r=void 0,this.clearSelection()),e.has(`searchModes`)&&this.#m(),this._zoomKey!==void 0&&!hO(this.#l,this._zoomKey)&&(this._zoomKey=void 0),this.#g(),this.#s){let e=this.#s;this.#s=void 0,this.#S(e)}}#h(){this.#s=void 0,this.#y(),this.tickled.clearTickled(),this._zoomKey=void 0,this.#r=void 0}#g(){if(!(!this.model&&!this.loadChildren))for(let e of this.#u()){let{node:n}=e;n.children!==void 0||this.#t.has(n.item.key)||this.#_(n,e.depth)}}async#_(e,n){let r=e.item.key;this.#t.add(r);let i=new AbortController;this.#n.set(r,i),this.requestUpdate();try{let r;if(r=this.model?await this.model.getChildren(e,n,i.signal):[...await dg(this.loadChildren({node:e,depth:n},i.signal),i.signal)],i.signal.aborted)return;e.children=r}catch{if(i.signal.aborted)return;e.children=[]}finally{this.#t.delete(r),this.#n.delete(r),i.signal.aborted||this.requestUpdate()}}#v(e){return this.selectionFilter===`none`?!1:this.selectionFilter===`leaf`?e.item.isLeaf===!0:this.selectionFilter!==`branch`||e.item.isLeaf===!1||e.children!==void 0&&e.children.length>0}#y(){this._selectedNodes.clear(),this.selectedNode=void 0}#b(e){this.dispatchEvent(new CustomEvent(`select`,{detail:{selected:new Set(this._selectedNodes),previous:e},bubbles:!0,composed:!0}))}select(e){if(!this.#v(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.clear(),this._selectedNodes.add(e),this.selectedNode=e,this.#b(n),this.requestUpdate()}deselect(e){if(!this._selectedNodes.has(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.delete(e),this.selectedNode===e&&(this.selectedNode=[...this._selectedNodes].at(-1)),this.#b(n),this.requestUpdate()}clearSelection(){if(this._selectedNodes.size===0)return;let e=new Set(this._selectedNodes);this.#y(),this.#b(e),this.requestUpdate()}selectAll(){let e=new Set(this._selectedNodes);for(let e of this.#u())this.#v(e.node)&&this._selectedNodes.add(e.node);this.selectedNode=[...this._selectedNodes].at(-1),this.#b(e),this.requestUpdate()}deselectAll(){let e=new Set(this._selectedNodes);this.#y(),this.#b(e),this.requestUpdate()}selectMany(e){let n=new Set(this._selectedNodes);this._selectedNodes=new Set([...e].filter(e=>this.#v(e))),this.selectedNode=[...this._selectedNodes].at(-1),this.#b(n),this.requestUpdate()}zoomTo(e){if(this._zoomKey===e.item.key)return;this.#s=this.#x(e.item.key),this._zoomKey=e.item.key,this.tickled.clearTickled();let n=gO(this.#l,e.item.key)?.length,r=n===void 0?-1:n-2;this.dispatchEvent(new CustomEvent(`zoom`,{detail:{node:e,depth:r},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`expand`,{detail:{node:e,depth:r},bubbles:!0,composed:!0})),this.requestUpdate()}zoomOut(){if(this._zoomKey===void 0)return;this.#s=this.#x(void 0);let e=this.focusedNode,n=this._zoomKey===void 0?void 0:gO(this.#l,this._zoomKey),r=n===void 0?-1:n.length-2;this._zoomKey=void 0,this.tickled.clearTickled(),this.dispatchEvent(new CustomEvent(`zoom`,{detail:{node:void 0,depth:-1},bubbles:!0,composed:!0})),e&&this.dispatchEvent(new CustomEvent(`collapse`,{detail:{node:e,depth:r},bubbles:!0,composed:!0})),this.requestUpdate()}#x(e){if(typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;if(e!==void 0){let n=this.#u().find(n=>n.node.item.key===e);if(n)return{direction:`in`,rect:{x:n.x,y:n.y,width:n.width,height:n.height}}}let n=this._zoomKey;if(n===void 0)return;let r=this.#d(e).find(e=>e.node.item.key===n);if(r)return{direction:`out`,rect:{x:r.x,y:r.y,width:r.width,height:r.height}}}#S(e){let n=this.renderRoot.querySelector(`.viewport-inner`),r=this.renderRoot.querySelector(`.viewport`);if(!(n instanceof HTMLElement)||!(r instanceof HTMLElement))return;let i=r.clientWidth,a=r.clientHeight;if(i<=0||a<=0)return;let{rect:o,direction:s}=e,c=s===`in`?`translate(${o.x*i}px, ${o.y*a}px) scale(${Math.max(o.width,1e-4)}, ${Math.max(o.height,1e-4)})`:(()=>{let e=o.width>0?1/o.width:1,n=o.height>0?1/o.height:1;return`translate(${-o.x*e*i}px, ${-o.y*n*a}px) scale(${e}, ${n})`})();n.classList.remove(`flipping`),n.style.transform=c,n.offsetWidth,requestAnimationFrame(()=>{n.classList.add(`flipping`),n.style.transform=`none`}),n.addEventListener(`transitionend`,()=>n.classList.remove(`flipping`),{once:!0})}#C(e){return e.item.isLeaf===!0?!1:e.children===void 0?this.model!==void 0||this.loadChildren!==void 0:this.hideLeaves?e.children.some(e=>e.item.isLeaf!==!0):e.children.length>0}navigateTo(e){let n=this.#l;if(!n?.children)return!1;let r=n,i=[];for(let n of e){let e=r.children?.find(e=>e.item.key===n);if(!e)return!1;i.push(e),r=e}let a=i.at(-1);return i.length>this.maxDepth?this.zoomTo(i[i.length-this.maxDepth-1]):this._zoomKey!==void 0&&this.zoomOut(),this.select(a),this.tickled.setTickled(a.item.key),this.requestUpdate(),!0}navigateToNode(e){let n=this.#l;if(!n?.children)return!1;let r=this.#T(n.children,e);return r?this.navigateTo(r):!1}revealKey(e){let n=this.#l;if(!n?.children)return!1;let r=this.#T(n.children,n=>n.item.key===e);if(!r)return!1;if(r.length>this.maxDepth){let e=this.#w(r.slice(0,r.length-this.maxDepth));e&&this.zoomTo(e)}return this.tickled.setTickled(e),this.requestUpdate(),!0}#w(e){let n=this.#l;for(let r of e){let e=r===n?.item.key?n:n?.children?.find(e=>e.item.key===r);if(!e)return;n=e}return n}#T(e,n,r=[]){for(let i of e){let e=[...r,i.item.key];if(n(i))return e;if(i.children?.length){let r=this.#T(i.children,n,e);if(r)return r}}}getNodes(){return this.#u().map(e=>({node:e.node,depth:e.depth}))}#E(e,n){return!this.filterPredicate||this.filterPredicate(e,n)?!0:e.children?.some(e=>this.#E(e,n+1))??!1}#D(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}#O(e,n){let r=this.#u(),i=this.#D(e),a=r.filter(n=>n!==e&&n.relativeDepth===e.relativeDepth&&n.parentKey===e.parentKey),o,s=1/0;for(let e of a){let r=this.#D(e),a=r.x-i.x,c=r.y-i.y;if(!(n===`left`?a<0:n===`right`?a>0:n===`up`?c<0:c>0))continue;let l=Math.hypot(a,c);l<s&&(s=l,o=e)}return o||(n===`up`||n===`left`?e.parentKey===void 0?void 0:r.find(n=>n.node.item.key===e.parentKey):r.find(n=>n.parentKey===e.node.item.key))}#k(e,n,r){if(this.dispatchEvent(new CustomEvent(`item-click`,{detail:{node:e.node,depth:e.depth},bubbles:!0,composed:!0})),this.interactionMode===`standard`&&(r.ctrlKey||r.metaKey)){if(this._selectedNodes.has(e.node))this.deselect(e.node);else if(this.#v(e.node)){let n=new Set(this._selectedNodes);this._selectedNodes.add(e.node),this.selectedNode=e.node,this.#b(n),this.requestUpdate()}this.#r=n}else if(this.interactionMode===`standard`&&r.shiftKey&&this.#r!==void 0){let e=this.#u(),r=Math.min(this.#r,n),i=Math.max(this.#r,n),a=new Set(this._selectedNodes);this._selectedNodes=new Set(e.slice(r,i+1).map(e=>e.node).filter(e=>this.#v(e))),this.selectedNode=[...this._selectedNodes].at(-1),this.#b(a),this.requestUpdate()}else this.interactionMode!==`manual`&&(this.select(e.node),this.#r=n);this.tickled.setTickled(e.node.item.key),this.#C(e.node)&&this.zoomTo(e.node)}#A(e){this.dispatchEvent(new CustomEvent(`item-dblclick`,{detail:{node:e.node,depth:e.depth},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`activate`,{detail:{node:e.node,depth:e.depth},bubbles:!0,composed:!0}))}#j(e){if(this.disableKeyboardNavigation)return;let n=this.#u();if(n.length===0)return;let r=this.tickled.tickledId,i=r===void 0?-1:n.findIndex(e=>e.node.item.key===r),a=i>=0?n[i]:void 0,o=n=>{n&&(e.preventDefault(),this.tickled.setTickled(n.node.item.key),this.interactionMode===`implicit`&&this.select(n.node))};switch(e.key){case`ArrowLeft`:o(a?this.#O(a,`left`):n[0]);return;case`ArrowRight`:o(a?this.#O(a,`right`):n[0]);return;case`ArrowUp`:o(a?this.#O(a,`up`):n[0]);return;case`ArrowDown`:o(a?this.#O(a,`down`):n[0]);return;case`Home`:o(n[0]);return;case`End`:o(n.at(-1));return;case`Enter`:if(!a)return;e.preventDefault(),this.interactionMode!==`manual`&&this.select(a.node),this.dispatchEvent(new CustomEvent(`activate`,{detail:{node:a.node,depth:a.depth},bubbles:!0,composed:!0})),this.#C(a.node)&&this.zoomTo(a.node);return;case`Backspace`:case`Escape`:this._zoomKey!==void 0&&(e.preventDefault(),this.zoomOut())}}#M(e){if(!e.metaKey||e.deltaY===0||(e.preventDefault(),performance.now()<this.#c))return;if(e.deltaY>0){if(this._zoomKey===void 0)return;this.#c=performance.now()+260,this.#N();return}let n=(e.target?.closest(`.tile`))?.getAttribute(`data-key`)??void 0;if(n===void 0)return;let r=this.#u().find(e=>e.node.item.key===n);!r||!this.#C(r.node)||(this.#c=performance.now()+260,this.zoomTo(r.node))}#N(){let e=this._zoomKey===void 0?void 0:gO(this.#l,this._zoomKey),n=e&&e.length>2?e[e.length-2]:void 0;n?this.zoomTo(n):this.zoomOut()}#P(){let e=this.focusedNode;return e===void 0?a:i`
|
|
12645
|
+
`}};E([d({type:String})],pO.prototype,`text`,void 0),E([d({type:String})],pO.prototype,`effect`,void 0),E([d({type:Number})],pO.prototype,`duration`,void 0),E([d({type:String})],pO.prototype,`easing`,void 0),E([m()],pO.prototype,`_currentText`,void 0),E([m()],pO.prototype,`_outgoingText`,void 0),E([m()],pO.prototype,`_activeEffect`,void 0),E([m()],pO.prototype,`_transitionId`,void 0),pO=E([T(`ixfx-transitory-label`)],pO);var mO=class{#e;#t;#n;#r=new WeakMap;#i=new Map;#a=new Map;#o=new WeakMap;#s;constructor(e,n,r){this.#e=e,this.#t=n,this.#n=r}connect(){this.disconnect(),this.#s=new AbortController;let{signal:e}=this.#s;this.#o=new WeakMap,this.#i.clear(),this.#a.clear();let n={item:this.#c(this.#e)};this.#r.set(n,this.#e),n.children=this.#l(this.#e),this.#t.root=n,this.#t.addEventListener(`expand`,e=>{let{node:n}=e.detail,r=this.#r.get(n);r&&(n.children=this.#l(r),this.#t.invalidateStructure())},{signal:e}),this.#t.addEventListener(`collapse`,e=>{},{signal:e})}disconnect(){this.#s?.abort(),this.#s=void 0}sync(){let e=this.#t.root;e&&(this.#o=new WeakMap,this.#i.clear(),this.#a.clear(),this.#r.set(e,this.#e),e.item=this.#c(this.#e),e.children=this.#f(this.#e,e.children??[]),this.#t.invalidateStructure())}lookupByKey(e){return this.#a.get(e)}navigateToKeyPath(e,n){if(e.length===0)return!1;let r=this.#t.root?.children??[];for(let n=0;n<e.length-1;n++){let i=r.find(r=>r.item.key===e[n]);if(!i)return!1;if(i.children===void 0){let e=this.#r.get(i);e&&(i.children=this.#l(e),this.#t.invalidateStructure())}r=i.children??[]}return this.#t.navigateTo(e,n)}navigateToIdentity(e,n){let r=this.#i.get(e);if(!r)return!1;let i=[],a=this.#e.getIdentity();for(;r&&r.getIdentity()!==a;)i.unshift(this.#c(r).key),r=r.getParent();return r!==void 0&&this.navigateToKeyPath(i,n)}navigateToValue(e,n){let r=this.#p(this.#e,e);return r?this.navigateToKeyPath(r.slice(1).map(e=>this.#c(e).key),n):!1}#c(e,n){let r=e.getIdentity(),i=this.#o.get(r);return i||(i=this.#n.valueToItem(e.getValue(),e),this.#o.set(r,i)),n===void 0?i:{...i,isLeaf:i.isLeaf??n}}#l(e){return Array.from(e.children(),e=>this.#d(e))}#u(e,n){this.#r.set(e,n),this.#i.set(n.getIdentity(),n),this.#a.set(e.item.key,n)}#d(e){let n=[...e.children()];for(let e of n)this.#i.set(e.getIdentity(),e);let r={item:this.#c(e,n.length===0)};return this.#u(r,e),r}#f(e,n){let r=new Map(n.map(e=>[e.item.key,e]));return Array.from(e.children(),e=>{let n=this.#d(e),i=r.get(n.item.key);return i?(i.item=n.item,this.#u(i,e),i.children!==void 0&&(i.children=this.#f(e,i.children)),i):n})}#p(e,n,r=[]){let i=[...r,e];if(n(e.getValue()))return i;for(let r of e.children()){let e=this.#p(r,n,i);if(e)return e}}};function hO(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:0}function gO(e,n){if(e){if(e.item.key===n)return e;for(let r of e.children??[]){let e=gO(r,n);if(e)return e}}}function _O(e,n){if(e){if(e.item.key===n)return[e];for(let r of e.children??[]){let i=_O(r,n);if(i)return[e,...i]}}}function vO(e,n,r){if(e.length===0||n<=0||r<=0)return 1/0;let i=0;for(let a of e){if(a<=0)return 1/0;let e=r*r*a/(n*n);i=Math.max(i,e,1/e)}return i}function yO(e,n){let r=Array.from({length:e.length}),i=n.x,a=n.y,o=n.width,s=n.height,c=0;for(;c<e.length;){let n=Math.min(o,s),l=c+1,u=e.slice(c,l).map(e=>e.area),d=u.reduce((e,n)=>e+n,0),f=vO(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=vO(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 bO(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?Math.min(e,1):0}function xO(e,n,r,i){if(e.width<=0||e.height<=0)return n.map(()=>({x:e.x,y:e.y,width:0,height:0}));let a=n.reduce((e,n)=>e+n,0),o=a>0?n.map(e=>e/a):n.map(()=>1/n.length),s=r===`dice`||r===`slice-dice`&&i%2==0,c=r===`slice`||r===`slice-dice`&&i%2==1;if(r===`squarify`){let r=o.map((e,n)=>({share:e,i:n})).filter(e=>e.share>0),i=n.map(()=>({x:e.x,y:e.y,width:0,height:0}));if(r.length>0){let n=e.width*e.height,a=yO(r.map(e=>({area:e.share*n})),e);r.forEach((e,n)=>{i[e.i]=a[n]})}return i}let l=[];if(s){let n=e.x;o.forEach(r=>{let i=e.width*r;l.push({x:n,y:e.y,width:i,height:e.height}),n+=i})}else if(c){let n=e.y;o.forEach(r=>{let i=e.height*r;l.push({x:e.x,y:n,width:e.width,height:i}),n+=i})}return l}function SO(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?bO(l):0,p=d?bO(u):0,m=e=>{let n=e.children??[];return s?n.filter(e=>e.item.isLeaf!==!0):n},h=a===void 0?e:gO(e,a)??e,g=_O(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=xO(n,e.map(e=>hO(i(e.item))),o,s),u=e.length;e.forEach((e,n)=>{let r=l[n],i=m(e);if(y.push({node:e,depth:a,relativeDepth:s,x:r.x,y:r.y,width:r.width,height:r.height,parentKey:c,index:n,setSize:u,hasChildren:i.length>0||e.children===void 0&&e.item.isLeaf!==!0}),i.length>0){let n=f<=0&&p<=0?r:{x:r.x+f,y:r.y+p,width:Math.max(0,r.width-f),height:Math.max(0,r.height-p)};b(i,n,a+1,s+1,e.item.key)}})};return b(v,{x:0,y:0,width:1,height:1},_+1,0,h.item.key),y}let Q=class extends n{constructor(...e){super(...e),this.exclusivity=`none`,this.selectionFilter=`all`,this.interactionMode=`standard`,this.tilingMethod=`squarify`,this.presentation=`nested`,this.cascadeOffset=6,this.maxDepth=4,this.hideLeaves=!1,this.minLabelArea=1600,this.minTileWidth=24,this.padding=4,this.minChildArea=400,this.valueAccessor=()=>1,this._selectedNodes=new Set,this.disableKeyboardNavigation=!1,this.registry=void 0,this._zoomKey=void 0,this.search=new Bt(this,{adapter:Ut(this,{labelSelector:`.treemap-label`,highlightKey:`incr-search-highlight`})}),this.tickled=new ie(this,{getItems:()=>this.#u().map(e=>({id:e.node.item.key,enabled:!0})),onStateChange:()=>{this.setAttribute(`data-input-mode`,this.tickled.inputMode)},onTickle:e=>{if(e===void 0)return;let n=this.#u().find(n=>n.node.item.key===e);n&&this.dispatchEvent(new CustomEvent(`tickle`,{detail:{node:n.node,depth:n.depth},bubbles:!0,composed:!0}))}}),this.#t=new Set,this.#n=new Map,this.#c=0}get selectedNodes(){return this._selectedNodes}get focusedNode(){if(this._zoomKey!==void 0)return gO(this.#l,this._zoomKey)}#e;#t;#n;#r;#i;#a;#o;#s;#c;get#l(){return this.model?.root??this.root}#u(){return this.#d(this._zoomKey)}#d(e){return SO(this.#l,{valueAccessor:this.valueAccessor,maxDepth:this.maxDepth,zoomKey:e,tilingMethod:this.tilingMethod,hideLeaves:this.hideLeaves,presentation:this.presentation,...this.#f()})}#f(){if(this.presentation!==`cascaded`||!Number.isFinite(this.cascadeOffset)||this.cascadeOffset<=0)return{};let e=this.clientWidth||0,n=this.clientHeight||0;return e<=0||n<=0?{}:{cascadeOffsetX:this.cascadeOffset/e,cascadeOffsetY:this.cascadeOffset/n}}connectedCallback(){super.connectedCallback(),this.setAttribute(`data-input-mode`,`mouse`);let e=this.#i=Jt();e.register({id:`select-all`,label:`Select All`,description:`Select all visible items`,execute:()=>this.selectAll()}),e.register({id:`deselect-all`,label:`Deselect All`,description:`Clear all selection`,execute:()=>this.deselectAll()}),this.registry=e,this.#m(),typeof ResizeObserver<`u`&&(this.#o=new ResizeObserver(()=>this.requestUpdate()),this.#o.observe(this))}disconnectedCallback(){super.disconnectedCallback(),this.#e?.(),this.#e=void 0;for(let e of this.#n.values())e.abort();this.#n.clear(),this.#t.clear(),this.#o?.disconnect(),this.#o=void 0,this.#i&&(this.#i.unregister(`select-all`),this.#i.unregister(`deselect-all`),this.#i=void 0,this.registry=void 0)}#p(){let e=this.searchModes?.trim();if(e===void 0)return[...Rt];let n=new Set(e.split(/\s+/));return Rt.filter(e=>n.has(e))}#m(){this.#i&&(this.search.setModes(this.#p()),this.#a?.(),this.#a=Lt(this.#i,this.search))}updated(e){if(e.has(`root`)&&this.root&&this.#h(),e.has(`model`)&&(this.#e?.(),this.#e=void 0,this.model&&(this.#e=this.model._subscribe(e=>{e.type===`root`?(this.#h(),this.requestUpdate()):e.type===`invalidate`&&this.requestUpdate()}),this.#h())),e.has(`interactionMode`)&&(this.#r=void 0,this.clearSelection()),e.has(`searchModes`)&&this.#m(),this._zoomKey!==void 0&&!gO(this.#l,this._zoomKey)&&(this._zoomKey=void 0),this.#g(),this.#s){let e=this.#s;this.#s=void 0,this.#S(e)}}#h(){this.#s=void 0,this.#y(),this.tickled.clearTickled(),this._zoomKey=void 0,this.#r=void 0}#g(){if(!(!this.model&&!this.loadChildren))for(let e of this.#u()){let{node:n}=e;n.children!==void 0||this.#t.has(n.item.key)||this.#_(n,e.depth)}}async#_(e,n){let r=e.item.key;this.#t.add(r);let i=new AbortController;this.#n.set(r,i),this.requestUpdate();try{let r;if(r=this.model?await this.model.getChildren(e,n,i.signal):[...await dg(this.loadChildren({node:e,depth:n},i.signal),i.signal)],i.signal.aborted)return;e.children=r}catch{if(i.signal.aborted)return;e.children=[]}finally{this.#t.delete(r),this.#n.delete(r),i.signal.aborted||this.requestUpdate()}}#v(e){return this.selectionFilter===`none`?!1:this.selectionFilter===`leaf`?e.item.isLeaf===!0:this.selectionFilter!==`branch`||e.item.isLeaf===!1||e.children!==void 0&&e.children.length>0}#y(){this._selectedNodes.clear(),this.selectedNode=void 0}#b(e){this.dispatchEvent(new CustomEvent(`select`,{detail:{selected:new Set(this._selectedNodes),previous:e},bubbles:!0,composed:!0}))}select(e){if(!this.#v(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.clear(),this._selectedNodes.add(e),this.selectedNode=e,this.#b(n),this.requestUpdate()}deselect(e){if(!this._selectedNodes.has(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.delete(e),this.selectedNode===e&&(this.selectedNode=[...this._selectedNodes].at(-1)),this.#b(n),this.requestUpdate()}clearSelection(){if(this._selectedNodes.size===0)return;let e=new Set(this._selectedNodes);this.#y(),this.#b(e),this.requestUpdate()}selectAll(){let e=new Set(this._selectedNodes);for(let e of this.#u())this.#v(e.node)&&this._selectedNodes.add(e.node);this.selectedNode=[...this._selectedNodes].at(-1),this.#b(e),this.requestUpdate()}deselectAll(){let e=new Set(this._selectedNodes);this.#y(),this.#b(e),this.requestUpdate()}selectMany(e){let n=new Set(this._selectedNodes);this._selectedNodes=new Set([...e].filter(e=>this.#v(e))),this.selectedNode=[...this._selectedNodes].at(-1),this.#b(n),this.requestUpdate()}zoomTo(e){if(this._zoomKey===e.item.key)return;this.#s=this.#x(e.item.key),this._zoomKey=e.item.key,this.tickled.clearTickled();let n=_O(this.#l,e.item.key)?.length,r=n===void 0?-1:n-2;this.dispatchEvent(new CustomEvent(`zoom`,{detail:{node:e,depth:r},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`expand`,{detail:{node:e,depth:r},bubbles:!0,composed:!0})),this.requestUpdate()}zoomOut(){if(this._zoomKey===void 0)return;this.#s=this.#x(void 0);let e=this.focusedNode,n=this._zoomKey===void 0?void 0:_O(this.#l,this._zoomKey),r=n===void 0?-1:n.length-2;this._zoomKey=void 0,this.tickled.clearTickled(),this.dispatchEvent(new CustomEvent(`zoom`,{detail:{node:void 0,depth:-1},bubbles:!0,composed:!0})),e&&this.dispatchEvent(new CustomEvent(`collapse`,{detail:{node:e,depth:r},bubbles:!0,composed:!0})),this.requestUpdate()}#x(e){if(typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;if(e!==void 0){let n=this.#u().find(n=>n.node.item.key===e);if(n)return{direction:`in`,rect:{x:n.x,y:n.y,width:n.width,height:n.height}}}let n=this._zoomKey;if(n===void 0)return;let r=this.#d(e).find(e=>e.node.item.key===n);if(r)return{direction:`out`,rect:{x:r.x,y:r.y,width:r.width,height:r.height}}}#S(e){let n=this.renderRoot.querySelector(`.viewport-inner`),r=this.renderRoot.querySelector(`.viewport`);if(!(n instanceof HTMLElement)||!(r instanceof HTMLElement))return;let i=r.clientWidth,a=r.clientHeight;if(i<=0||a<=0)return;let{rect:o,direction:s}=e,c=s===`in`?`translate(${o.x*i}px, ${o.y*a}px) scale(${Math.max(o.width,1e-4)}, ${Math.max(o.height,1e-4)})`:(()=>{let e=o.width>0?1/o.width:1,n=o.height>0?1/o.height:1;return`translate(${-o.x*e*i}px, ${-o.y*n*a}px) scale(${e}, ${n})`})();n.classList.remove(`flipping`),n.style.transform=c,n.offsetWidth,requestAnimationFrame(()=>{n.classList.add(`flipping`),n.style.transform=`none`}),n.addEventListener(`transitionend`,()=>n.classList.remove(`flipping`),{once:!0})}#C(e){return e.item.isLeaf===!0?!1:e.children===void 0?this.model!==void 0||this.loadChildren!==void 0:this.hideLeaves?e.children.some(e=>e.item.isLeaf!==!0):e.children.length>0}navigateTo(e){let n=this.#l;if(!n?.children)return!1;let r=n,i=[];for(let n of e){let e=r.children?.find(e=>e.item.key===n);if(!e)return!1;i.push(e),r=e}let a=i.at(-1);return i.length>this.maxDepth?this.zoomTo(i[i.length-this.maxDepth-1]):this._zoomKey!==void 0&&this.zoomOut(),this.select(a),this.tickled.setTickled(a.item.key),this.requestUpdate(),!0}navigateToNode(e){let n=this.#l;if(!n?.children)return!1;let r=this.#T(n.children,e);return r?this.navigateTo(r):!1}revealKey(e){let n=this.#l;if(!n?.children)return!1;let r=this.#T(n.children,n=>n.item.key===e);if(!r)return!1;if(r.length>this.maxDepth){let e=this.#w(r.slice(0,r.length-this.maxDepth));e&&this.zoomTo(e)}return this.tickled.setTickled(e),this.requestUpdate(),!0}#w(e){let n=this.#l;for(let r of e){let e=r===n?.item.key?n:n?.children?.find(e=>e.item.key===r);if(!e)return;n=e}return n}#T(e,n,r=[]){for(let i of e){let e=[...r,i.item.key];if(n(i))return e;if(i.children?.length){let r=this.#T(i.children,n,e);if(r)return r}}}getNodes(){return this.#u().map(e=>({node:e.node,depth:e.depth}))}#E(e,n){return!this.filterPredicate||this.filterPredicate(e,n)?!0:e.children?.some(e=>this.#E(e,n+1))??!1}#D(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}#O(e,n){let r=this.#u(),i=this.#D(e),a=r.filter(n=>n!==e&&n.relativeDepth===e.relativeDepth&&n.parentKey===e.parentKey),o,s=1/0;for(let e of a){let r=this.#D(e),a=r.x-i.x,c=r.y-i.y;if(!(n===`left`?a<0:n===`right`?a>0:n===`up`?c<0:c>0))continue;let l=Math.hypot(a,c);l<s&&(s=l,o=e)}return o||(n===`up`||n===`left`?e.parentKey===void 0?void 0:r.find(n=>n.node.item.key===e.parentKey):r.find(n=>n.parentKey===e.node.item.key))}#k(e,n,r){if(this.dispatchEvent(new CustomEvent(`item-click`,{detail:{node:e.node,depth:e.depth},bubbles:!0,composed:!0})),this.interactionMode===`standard`&&(r.ctrlKey||r.metaKey)){if(this._selectedNodes.has(e.node))this.deselect(e.node);else if(this.#v(e.node)){let n=new Set(this._selectedNodes);this._selectedNodes.add(e.node),this.selectedNode=e.node,this.#b(n),this.requestUpdate()}this.#r=n}else if(this.interactionMode===`standard`&&r.shiftKey&&this.#r!==void 0){let e=this.#u(),r=Math.min(this.#r,n),i=Math.max(this.#r,n),a=new Set(this._selectedNodes);this._selectedNodes=new Set(e.slice(r,i+1).map(e=>e.node).filter(e=>this.#v(e))),this.selectedNode=[...this._selectedNodes].at(-1),this.#b(a),this.requestUpdate()}else this.interactionMode!==`manual`&&(this.select(e.node),this.#r=n);this.tickled.setTickled(e.node.item.key),this.#C(e.node)&&this.zoomTo(e.node)}#A(e){this.dispatchEvent(new CustomEvent(`item-dblclick`,{detail:{node:e.node,depth:e.depth},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`activate`,{detail:{node:e.node,depth:e.depth},bubbles:!0,composed:!0}))}#j(e){if(this.disableKeyboardNavigation)return;let n=this.#u();if(n.length===0)return;let r=this.tickled.tickledId,i=r===void 0?-1:n.findIndex(e=>e.node.item.key===r),a=i>=0?n[i]:void 0,o=n=>{n&&(e.preventDefault(),this.tickled.setTickled(n.node.item.key),this.interactionMode===`implicit`&&this.select(n.node))};switch(e.key){case`ArrowLeft`:o(a?this.#O(a,`left`):n[0]);return;case`ArrowRight`:o(a?this.#O(a,`right`):n[0]);return;case`ArrowUp`:o(a?this.#O(a,`up`):n[0]);return;case`ArrowDown`:o(a?this.#O(a,`down`):n[0]);return;case`Home`:o(n[0]);return;case`End`:o(n.at(-1));return;case`Enter`:if(!a)return;e.preventDefault(),this.interactionMode!==`manual`&&this.select(a.node),this.dispatchEvent(new CustomEvent(`activate`,{detail:{node:a.node,depth:a.depth},bubbles:!0,composed:!0})),this.#C(a.node)&&this.zoomTo(a.node);return;case`Backspace`:case`Escape`:this._zoomKey!==void 0&&(e.preventDefault(),this.zoomOut())}}#M(e){if(!e.metaKey||e.deltaY===0||(e.preventDefault(),performance.now()<this.#c))return;if(e.deltaY>0){if(this._zoomKey===void 0)return;this.#c=performance.now()+260,this.#N();return}let n=(e.target?.closest(`.tile`))?.getAttribute(`data-key`)??void 0;if(n===void 0)return;let r=this.#u().find(e=>e.node.item.key===n);!r||!this.#C(r.node)||(this.#c=performance.now()+260,this.zoomTo(r.node))}#N(){let e=this._zoomKey===void 0?void 0:_O(this.#l,this._zoomKey),n=e&&e.length>2?e[e.length-2]:void 0;n?this.zoomTo(n):this.zoomOut()}#P(){let e=this.focusedNode;return e===void 0?a:i`
|
|
12646
12646
|
<nav class="breadcrumb" part="breadcrumb" aria-label="Treemap zoom path">
|
|
12647
12647
|
<ixfx-crumb-navigation
|
|
12648
12648
|
with-up
|
|
@@ -12864,7 +12864,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
12864
12864
|
color: var(--surface-muted-text);
|
|
12865
12865
|
font-size: var(--text-s);
|
|
12866
12866
|
}
|
|
12867
|
-
`]}};E([d({type:Object})],Q.prototype,`root`,void 0),E([d({attribute:!1})],Q.prototype,`model`,void 0),E([d({attribute:!1})],Q.prototype,`loadChildren`,void 0),E([d({reflect:!0,attribute:`exclusivity`})],Q.prototype,`exclusivity`,void 0),E([d({reflect:!0,attribute:`selection-filter`})],Q.prototype,`selectionFilter`,void 0),E([d({type:String,attribute:`interaction-mode`})],Q.prototype,`interactionMode`,void 0),E([d({type:String,attribute:`tiling-method`})],Q.prototype,`tilingMethod`,void 0),E([d({type:String,attribute:`presentation`})],Q.prototype,`presentation`,void 0),E([d({type:Number,attribute:`cascade-offset`})],Q.prototype,`cascadeOffset`,void 0),E([d({type:Number,attribute:`max-depth`})],Q.prototype,`maxDepth`,void 0),E([d({type:Boolean,attribute:`hide-leaves`})],Q.prototype,`hideLeaves`,void 0),E([d({type:Number,attribute:`min-label-area`})],Q.prototype,`minLabelArea`,void 0),E([d({type:Number,attribute:`min-tile-width`})],Q.prototype,`minTileWidth`,void 0),E([d({type:Number})],Q.prototype,`padding`,void 0),E([d({type:Number,attribute:`min-child-area`})],Q.prototype,`minChildArea`,void 0),E([d({attribute:!1})],Q.prototype,`valueAccessor`,void 0),E([d({attribute:!1})],Q.prototype,`categoryAccessor`,void 0),E([d({attribute:!1})],Q.prototype,`selectedNode`,void 0),E([m()],Q.prototype,`_selectedNodes`,void 0),E([d({attribute:!1})],Q.prototype,`filterPredicate`,void 0),E([d({type:Boolean,attribute:`disable-keyboard-navigation`})],Q.prototype,`disableKeyboardNavigation`,void 0),E([d({attribute:!1})],Q.prototype,`registry`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],Q.prototype,`searchModes`,void 0),E([m()],Q.prototype,`_zoomKey`,void 0),Q=E([T(`ixfx-treemap-list`)],Q);let
|
|
12867
|
+
`]}};E([d({type:Object})],Q.prototype,`root`,void 0),E([d({attribute:!1})],Q.prototype,`model`,void 0),E([d({attribute:!1})],Q.prototype,`loadChildren`,void 0),E([d({reflect:!0,attribute:`exclusivity`})],Q.prototype,`exclusivity`,void 0),E([d({reflect:!0,attribute:`selection-filter`})],Q.prototype,`selectionFilter`,void 0),E([d({type:String,attribute:`interaction-mode`})],Q.prototype,`interactionMode`,void 0),E([d({type:String,attribute:`tiling-method`})],Q.prototype,`tilingMethod`,void 0),E([d({type:String,attribute:`presentation`})],Q.prototype,`presentation`,void 0),E([d({type:Number,attribute:`cascade-offset`})],Q.prototype,`cascadeOffset`,void 0),E([d({type:Number,attribute:`max-depth`})],Q.prototype,`maxDepth`,void 0),E([d({type:Boolean,attribute:`hide-leaves`})],Q.prototype,`hideLeaves`,void 0),E([d({type:Number,attribute:`min-label-area`})],Q.prototype,`minLabelArea`,void 0),E([d({type:Number,attribute:`min-tile-width`})],Q.prototype,`minTileWidth`,void 0),E([d({type:Number})],Q.prototype,`padding`,void 0),E([d({type:Number,attribute:`min-child-area`})],Q.prototype,`minChildArea`,void 0),E([d({attribute:!1})],Q.prototype,`valueAccessor`,void 0),E([d({attribute:!1})],Q.prototype,`categoryAccessor`,void 0),E([d({attribute:!1})],Q.prototype,`selectedNode`,void 0),E([m()],Q.prototype,`_selectedNodes`,void 0),E([d({attribute:!1})],Q.prototype,`filterPredicate`,void 0),E([d({type:Boolean,attribute:`disable-keyboard-navigation`})],Q.prototype,`disableKeyboardNavigation`,void 0),E([d({attribute:!1})],Q.prototype,`registry`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],Q.prototype,`searchModes`,void 0),E([m()],Q.prototype,`_zoomKey`,void 0),Q=E([T(`ixfx-treemap-list`)],Q);let CO=class extends n{constructor(...e){super(...e),this.layout=`vertical`,this.sizeA=``,this.sizeB=``,this.fixedA=!1,this.fixedB=!1,this.collapsible=!1,this.collapsedA=!1,this.collapsedB=!1,this.minSizeA=``,this.maxSizeA=``,this.minSizeB=``,this.maxSizeB=``,this._hasCorner=!1,this.#t=``,this.#n=``,this.#r=0,this.#i=0,this.#a=``,this.#u=null,this.#p=.1,this.#E=e=>{e.preventDefault();let n=this.getZone();n&&n.classList.add(`user-resizing`),this.#e=this.getBoundingClientRect(),this.#t=this.sizeA,this.#n=this.sizeB,window.addEventListener(`pointerup`,this.#D),window.addEventListener(`pointermove`,this.#O)},this.#D=e=>{e.preventDefault();let n=this.getZone();n&&n.classList.remove(`user-resizing`),window.removeEventListener(`pointerup`,this.#D),window.removeEventListener(`pointermove`,this.#O)},this.#O=e=>{let n=this.#e;if(n){if(this.layout===`horizontal`){let r=$r((e.y-n.y)/n.height);if(this.collapsible&&this.collapsedA){if(r>(this.#d??.05)+this.#p){this.collapsedA=!1,this.#h(`A`,!1),this.#d=void 0;let{sizeA:e,sizeB:i}=this.#x(`${r*100}%`,`${(1-r)*100}%`,n.height);this.sizeA=e,this.sizeB=i}}else if(this.collapsible&&!this.collapsedA&&r<5/n.height)this.collapsedA=!0,this.#h(`A`,!0),this.sizeA=`0px`,this.sizeB=`100%`,this.#d=r;else if(!this.collapsedA){let{sizeA:e,sizeB:i}=this.#x(`${r*100}%`,`${(1-r)*100}%`,n.height);this.sizeA=e,this.sizeB=i}if(this.collapsible&&this.collapsedB){if(r<(this.#f??.95)-this.#p){this.collapsedB=!1,this.#h(`B`,!1),this.#f=void 0;let{sizeA:e,sizeB:i}=this.#x(`${r*100}%`,`${(1-r)*100}%`,n.height);this.sizeA=e,this.sizeB=i}}else this.collapsible&&!this.collapsedB&&r>1-5/n.height&&(this.collapsedB=!0,this.#h(`B`,!0),this.sizeA=`100%`,this.sizeB=`0px`,this.#f=r)}else{let r=$r((e.x-n.x)/n.width);if(this.collapsible&&this.collapsedA){if(r>(this.#d??.05)+this.#p){this.collapsedA=!1,this.#h(`A`,!1),this.#d=void 0;let{sizeA:e,sizeB:i}=this.#x(`${r*100}%`,`${(1-r)*100}%`,n.width);this.sizeA=e,this.sizeB=i}}else if(this.collapsible&&!this.collapsedA&&r<5/n.width)this.collapsedA=!0,this.#h(`A`,!0),this.sizeA=`0px`,this.sizeB=`100%`,this.#d=r;else if(!this.collapsedA){let{sizeA:e,sizeB:i}=this.#x(`${r*100}%`,`${(1-r)*100}%`,n.width);this.sizeA=e,this.sizeB=i}if(this.collapsible&&this.collapsedB){if(r<(this.#f??.95)-this.#p){this.collapsedB=!1,this.#h(`B`,!1),this.#f=void 0;let{sizeA:e,sizeB:i}=this.#x(`${r*100}%`,`${(1-r)*100}%`,n.width);this.sizeA=e,this.sizeB=i}}else this.collapsible&&!this.collapsedB&&r>1-5/n.width&&(this.collapsedB=!0,this.#h(`B`,!0),this.sizeA=`100%`,this.sizeB=`0px`,this.#f=r)}e.preventDefault()}},this.#k=e=>{e.preventDefault(),e.stopPropagation();let n=this.getZone();n&&n.classList.add(`user-resizing`),this.#e=this.getBoundingClientRect(),this.#r=e.clientX,this.#i=e.clientY,this.#t=this.sizeA,this.#n=this.sizeB;let r=this.#v();if(r){this.#a=r.sizeA;let e=r.getBoundingClientRect(),n=r.shadowRoot?.querySelector(`.split-bar`);n&&(this.#s=e,this.#c=n.getBoundingClientRect());let i=r.getZone();i&&i.classList.add(`user-resizing`)}window.addEventListener(`pointerup`,this.#A),window.addEventListener(`pointermove`,this.#M)},this.#A=e=>{e.preventDefault();let n=this.getZone();n&&n.classList.remove(`user-resizing`);let r=this.#v();if(r){let e=r.getZone();e&&e.classList.remove(`user-resizing`)}window.removeEventListener(`pointerup`,this.#A),window.removeEventListener(`pointermove`,this.#M)},this.#M=e=>{let n=this.#e,r=this.getZone(),i=this.#v();if(!n||!r||!i)return;let a=r.getBoundingClientRect(),o=e.clientX-a.left,s=e.clientY-a.top;if(this.layout===`vertical`&&i.layout===`horizontal`){let e=o/n.width,r=s/n.height,{sizeA:i,sizeB:a}=this.#x(`${e*100}%`,`${(1-e)*100}%`,n.width);e=this.#y(i,n.width),this.sizeA=i,this.sizeB=a,this.#u={sizeA:r,sizeB:1-r},requestAnimationFrame(()=>this.#j());let c=this.shadowRoot?.querySelector(`.corner-zone`);c&&(c.style.left=`${o-6}px`,c.style.top=`${s-6}px`)}else if(this.layout===`horizontal`&&i.layout===`vertical`){let e=o/n.width,r=s/n.height,{sizeA:i,sizeB:a}=this.#x(`${r*100}%`,`${(1-r)*100}%`,n.height);r=this.#y(i,n.height),this.sizeA=i,this.sizeB=a,this.#u={sizeA:e,sizeB:1-e},requestAnimationFrame(()=>this.#j());let c=this.shadowRoot?.querySelector(`.corner-zone`);c&&(c.style.left=`${o-6}px`,c.style.top=`${s-6}px`)}e.preventDefault()}}get showGrabHandle(){let e=getComputedStyle(this).getPropertyValue(`--handle-size`).trim(),n=Number.parseFloat(e);return!Number.isNaN(n)&&n>3}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;disconnectedCallback(){super.disconnectedCallback(),this.#l?.disconnect()}firstUpdated(){this.#g()}updated(e){(e.has(`sizeA`)||e.has(`sizeB`)||e.has(`collapsedA`)||e.has(`collapsedB`))&&this.#T(),(e.has(`sizeA`)||e.has(`sizeB`))&&this.#m()}#m(){this.collapsedA?this.setAttribute(`data-collapsed-a`,``):this.removeAttribute(`data-collapsed-a`),this.collapsedB?this.setAttribute(`data-collapsed-b`,``):this.removeAttribute(`data-collapsed-b`)}#h(e,n){this.dispatchEvent(new CustomEvent(`ixfx-split-collapsed`,{detail:{panel:e,collapsed:n},bubbles:!0,composed:!0}))}#g(){let e=this.shadowRoot?.querySelector(`slot[name="a"]`);e&&(this.#l=new MutationObserver(()=>{this.#_()}),this.#l.observe(e,{characterData:!0,childList:!0,subtree:!0}),this.#_())}#_(){let e=this.shadowRoot?.querySelector(`slot[name="a"]`);if(!e)return;let n=e.assignedElements(),r=e=>{for(let n of e){if(n.tagName===`IXFX-SPLIT-LAYOUT`)return n;let e=r(Array.from(n.children));if(e)return e}},i=r(n);i?(this.#o=i,this._hasCorner=!0,requestAnimationFrame(()=>this.#T())):(this.#o=void 0,this._hasCorner=!1)}#v(){if(this.#o)return this.#o;let e=this.shadowRoot?.querySelector(`slot[name="a"]`);if(e)return e.assignedElements().find(e=>e.tagName===`IXFX-SPLIT-LAYOUT`)}#y(e,n){return e.endsWith(`px`)?Number.parseFloat(e.replace(`px`,``))/n:e.endsWith(`%`)?Number.parseFloat(e.replace(`%`,``))/100:.5}#b(e,n){return e.endsWith(`px`)?Number.parseFloat(e.replace(`px`,``)):e.endsWith(`%`)?Number.parseFloat(e.replace(`%`,``))/100*n:null}#x(e,n,r){let i=this.#y(e,r),a=this.#y(n,r),o=this.#S(this.minSizeA,r),s=this.#S(this.minSizeB,r),c=this.#C(this.maxSizeA,r),l=this.#C(this.maxSizeB,r);if(o!==null||s!==null){let e=(o??0)+(s??0);if(e>1){let n=1/e;o!==null&&(i=o===null?0:o*n),s!==null&&(a=s===null?0:s*n)}i<(o??0)&&(i=o??0),a<(s??0)&&(a=s??0)}c!==null&&i>c&&(i=c),l!==null&&a>l&&(a=l),a=1-i;let u=!this.sizeA.endsWith(`px`);return this.sizeB.endsWith(`px`),u?{sizeA:`${i*100}%`,sizeB:`${a*100}%`}:{sizeA:`${i*r}px`,sizeB:`${a*r}px`}}#S(e,n){if(e.length===0)return null;let r=this.#b(e,n);return r===null?e.endsWith(`%`)?Number.parseFloat(e.replace(`%`,``))/100:null:r/n}#C(e,n){if(e.length===0)return null;let r=this.#b(e,n);return r===null?e.endsWith(`%`)?Number.parseFloat(e.replace(`%`,``))/100:null:r/n}#w(){let e=this.getBoundingClientRect(),n=this.getZone();if(!n)return null;let r=this.#v();if(!r)return null;n.getBoundingClientRect();let i=this.#y(this.sizeA||`50%`,e.width),a,o;if(this.layout===`vertical`&&r.layout===`horizontal`)a=i*e.width,o=this.#y(r.sizeA||`50%`,e.height)*e.height;else if(this.layout===`horizontal`&&r.layout===`vertical`)a=this.#y(r.sizeA||`50%`,e.width)*e.width,o=i*e.height;else return null;return{x:a,y:o}}#T(){if(!this._hasCorner)return;let e=this.shadowRoot?.querySelector(`.corner-zone`);if(!e||!this.getZone())return;let n=this.#w();if(!n){e.style.display=`none`;return}let r=n.x-6,i=n.y-6;e.style.left=`${r}px`,e.style.top=`${i}px`,e.style.display=`block`;let a=this.#v();a&&(this.layout===`vertical`&&a.layout===`horizontal`?e.style.cursor=`nwse-resize`:this.layout===`horizontal`&&a.layout===`vertical`&&(e.style.cursor=`nesw-resize`))}getZone(){if(!this.shadowRoot)return;let e=this.shadowRoot.querySelector(`#zone`);if(e)return e}#E;#D;#O;#k;#A;#j(){if(!this.#u)return;let{sizeA:e,sizeB:n}=this.#u,r=this.#v();r&&(r.sizeA=`${e*100}%`,r.sizeB=`${n*100}%`),this.#u=null}#M;render(){let e=this.layout===`vertical`?`width`:`height`,n=this.sizeA,r=this.sizeB;return this.collapsedA?n=`0px`:n.length===0&&r.length===0?r=n=`50%`:n.length===0?n=`auto`:r.length===0&&(r=`auto`),this.collapsedB&&(r=`0px`),n=`${e}:${n}`,r=`${e}:${r}`,i`
|
|
12868
12868
|
<div id="zone">
|
|
12869
12869
|
<slot style=${n} name="a"></slot>
|
|
12870
12870
|
${this._hasCorner?i`<div class="corner-zone" @pointerdown=${this.#k}></div>`:``}
|
|
@@ -12988,7 +12988,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
12988
12988
|
:host([data-collapsed-b]) slot[name="b"] {
|
|
12989
12989
|
display: none;
|
|
12990
12990
|
}
|
|
12991
|
-
`]}};E([d({type:String})],
|
|
12991
|
+
`]}};E([d({type:String})],CO.prototype,`layout`,void 0),E([d({type:String})],CO.prototype,`sizeA`,void 0),E([d({type:String})],CO.prototype,`sizeB`,void 0),E([d({type:Boolean})],CO.prototype,`fixedA`,void 0),E([d({type:Boolean})],CO.prototype,`fixedB`,void 0),E([d({type:Boolean})],CO.prototype,`collapsible`,void 0),E([d({type:Boolean,reflect:!0})],CO.prototype,`collapsedA`,void 0),E([d({type:Boolean,reflect:!0})],CO.prototype,`collapsedB`,void 0),E([d({type:String})],CO.prototype,`minSizeA`,void 0),E([d({type:String})],CO.prototype,`maxSizeA`,void 0),E([d({type:String})],CO.prototype,`minSizeB`,void 0),E([d({type:String})],CO.prototype,`maxSizeB`,void 0),E([m()],CO.prototype,`_hasCorner`,void 0),CO=E([T(`ixfx-twosplit-layout`)],CO);function wO(e){return e instanceof HTMLElement&&`checked`in e}function TO(e){if(typeof e==`string`){let n=document.querySelector(e);if(!(n instanceof HTMLElement))throw Error(`Element not found or not HTMLElement: ${e}`);return n}return e}function EO(e,n){let r=TO(e);if(!wO(r))throw Error(`Target element is not a checkbox-like element`);let i=[];for(let e of n){let n=TO(e);wO(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 DO(e,n,r,i){return i===`linear`?(e-n)/(r-n):Math.log(e/n)/Math.log(r/n)}function OO(e,n,r,i){return i===`linear`?n+e*(r-n):n*(r/n)**e}function kO(e,n,r,i){if(!i||i<=1)return e;let a=(r-n)/i;return Math.round((e-n)/a)*a+n}let $=class extends Oy(n){constructor(...e){super(...e),this.xMin=1,this.xMax=100,this.x=50,this.yMin=1,this.yMax=100,this.y=50,this.xScale=`linear`,this.yScale=`linear`,this.xLabel=`X`,this.yLabel=`Y`,this.showCrosshairs=!1,this.showGrid=!1,this.hideCursor=!1,this.disabled=!1,this._dragging=!1,this._dragStartX=0,this._dragStartY=0,this._pressedKeys=new Set,this._onKeyDown=e=>{if(!this.disabled){if([`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`].includes(e.key))e.preventDefault(),this._pressedKeys.add(e.key),this._handleKeyboardMove(e.shiftKey);else if(e.key===`Home`||e.key===`End`){e.preventDefault();let n=e.key===`Home`?this.xMin:this.xMax,r=e.key===`Home`?this.yMin:this.yMax;(n!==this.x||r!==this.y)&&(this.x=n,this.y=r,this.dispatchEvent(new CustomEvent(`input`,{detail:{x:this.x,y:this.y},bubbles:!0,composed:!0})))}}},this._onKeyUp=e=>{this._pressedKeys.delete(e.key)},this._handleKeyboardMove=e=>{let n=this.xMax-this.xMin,r=this.yMax-this.yMin,i=this.stopsX??this.stops,a=this.stopsY??this.stops,o=Dy(n,i,this.stepX,e),s=Dy(r,a,this.stepY,e),c=this.x,l=this.y;if(this._pressedKeys.has(`ArrowLeft`)&&(c=Math.max(this.xMin,this.x-o)),this._pressedKeys.has(`ArrowRight`)&&(c=Math.min(this.xMax,this.x+o)),this._pressedKeys.has(`ArrowUp`)&&(l=Math.min(this.yMax,this.y+s)),this._pressedKeys.has(`ArrowDown`)&&(l=Math.max(this.yMin,this.y-s)),c!==this.x||l!==this.y){let e=this.xSnapStep&&this.xSnapStep>0?Math.round(c/this.xSnapStep)*this.xSnapStep:c,n=this.ySnapStep&&this.ySnapStep>0?Math.round(l/this.ySnapStep)*this.ySnapStep:l;e=kO(e,this.xMin,this.xMax,i),n=kO(n,this.yMin,this.yMax,a),this.x=e,this.y=n,this.dispatchEvent(new CustomEvent(`input`,{detail:{x:this.x,y:this.y},bubbles:!0,composed:!0}))}},this._onPointerDown=e=>{e.preventDefault();let n=this.renderRoot.querySelector(`.xy-pad-area`);n?.focus(),n&&n.setPointerCapture(e.pointerId),this._dragging=!0,this._dragStartX=this.x,this._dragStartY=this.y,this.setAttribute(`dragging`,``),this._updateFromPointer(e),globalThis.addEventListener(`pointermove`,this._onPointerMove),globalThis.addEventListener(`pointerup`,this._onPointerUp)},this._onPointerMove=e=>{this._dragging&&(e.preventDefault(),this._updateFromPointer(e))},this._onPointerUp=()=>{let e=this.x!==this._dragStartX||this.y!==this._dragStartY;this._dragging=!1,this.removeAttribute(`dragging`),globalThis.removeEventListener(`pointermove`,this._onPointerMove),globalThis.removeEventListener(`pointerup`,this._onPointerUp),e&&this.dispatchEvent(new CustomEvent(`change`,{detail:{x:this.x,y:this.y},bubbles:!0,composed:!0}))}}static{this.styles=[w,sn,r`
|
|
12992
12992
|
:host {
|
|
12993
12993
|
display: block;
|
|
12994
12994
|
width: 200px;
|
|
@@ -13102,7 +13102,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
13102
13102
|
height:100%;
|
|
13103
13103
|
text-align:center;
|
|
13104
13104
|
}
|
|
13105
|
-
`]}_stepYByDelta(e,n){let r=this.yMax-this.yMin,i=this.stopsY??this.stops,a=Dy(r,i,this.stepY,n),o=e===1?Math.min(this.yMax,this.y+a):Math.max(this.yMin,this.y-a);if(o===this.y)return;let s=this.ySnapStep&&this.ySnapStep>0?Math.round(o/this.ySnapStep)*this.ySnapStep:o;s=
|
|
13105
|
+
`]}_stepYByDelta(e,n){let r=this.yMax-this.yMin,i=this.stopsY??this.stops,a=Dy(r,i,this.stepY,n),o=e===1?Math.min(this.yMax,this.y+a):Math.max(this.yMin,this.y-a);if(o===this.y)return;let s=this.ySnapStep&&this.ySnapStep>0?Math.round(o/this.ySnapStep)*this.ySnapStep:o;s=kO(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=OO(i,this.xMin,this.xMax,this.xScale),s=OO(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=kO(c,this.xMin,this.xMax,u),l=kO(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=DO(e,this.xMin,this.xMax,this.xScale)*100,i=DO(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 DO(Math.max(this.xMin,Math.min(this.xMax,this.x)),this.xMin,this.xMax,this.xScale)}getRelativeY(){return DO(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`
|
|
13106
13106
|
<div class="xy-pad-area"
|
|
13107
13107
|
tabindex=${this.disabled?-1:0}
|
|
13108
13108
|
@pointerdown=${this._onPointerDown}
|
|
@@ -13114,4 +13114,4 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
13114
13114
|
<div class="xy-pad-label-x">${this.xLabel}</div>
|
|
13115
13115
|
<div class="xy-pad-label-y">${this.yLabel}</div>
|
|
13116
13116
|
</div>
|
|
13117
|
-
`}};E([d({type:Number})],$.prototype,`xMin`,void 0),E([d({type:Number})],$.prototype,`xMax`,void 0),E([d({type:Number})],$.prototype,`x`,void 0),E([d({type:Number})],$.prototype,`yMin`,void 0),E([d({type:Number})],$.prototype,`yMax`,void 0),E([d({type:Number})],$.prototype,`y`,void 0),E([d({type:String})],$.prototype,`xScale`,void 0),E([d({type:String})],$.prototype,`yScale`,void 0),E([d({type:Number,attribute:`x-snap-step`})],$.prototype,`xSnapStep`,void 0),E([d({type:Number,attribute:`y-snap-step`})],$.prototype,`ySnapStep`,void 0),E([d({type:Number,attribute:`step-x`})],$.prototype,`stepX`,void 0),E([d({type:Number,attribute:`step-y`})],$.prototype,`stepY`,void 0),E([d({type:String})],$.prototype,`xLabel`,void 0),E([d({type:String})],$.prototype,`yLabel`,void 0),E([d({type:Boolean,reflect:!0,attribute:`show-crosshairs`})],$.prototype,`showCrosshairs`,void 0),E([d({type:Boolean,reflect:!0,attribute:`show-grid`})],$.prototype,`showGrid`,void 0),E([d({type:Boolean,reflect:!0,attribute:`hide-cursor`})],$.prototype,`hideCursor`,void 0),E([d({type:Boolean,reflect:!0})],$.prototype,`disabled`,void 0),E([d({type:Number})],$.prototype,`stops`,void 0),E([d({type:Number,attribute:`stops-x`})],$.prototype,`stopsX`,void 0),E([d({type:Number,attribute:`stops-y`})],$.prototype,`stopsY`,void 0),$=E([T(`ixfx-xy-pad`)],$);function
|
|
13117
|
+
`}};E([d({type:Number})],$.prototype,`xMin`,void 0),E([d({type:Number})],$.prototype,`xMax`,void 0),E([d({type:Number})],$.prototype,`x`,void 0),E([d({type:Number})],$.prototype,`yMin`,void 0),E([d({type:Number})],$.prototype,`yMax`,void 0),E([d({type:Number})],$.prototype,`y`,void 0),E([d({type:String})],$.prototype,`xScale`,void 0),E([d({type:String})],$.prototype,`yScale`,void 0),E([d({type:Number,attribute:`x-snap-step`})],$.prototype,`xSnapStep`,void 0),E([d({type:Number,attribute:`y-snap-step`})],$.prototype,`ySnapStep`,void 0),E([d({type:Number,attribute:`step-x`})],$.prototype,`stepX`,void 0),E([d({type:Number,attribute:`step-y`})],$.prototype,`stepY`,void 0),E([d({type:String})],$.prototype,`xLabel`,void 0),E([d({type:String})],$.prototype,`yLabel`,void 0),E([d({type:Boolean,reflect:!0,attribute:`show-crosshairs`})],$.prototype,`showCrosshairs`,void 0),E([d({type:Boolean,reflect:!0,attribute:`show-grid`})],$.prototype,`showGrid`,void 0),E([d({type:Boolean,reflect:!0,attribute:`hide-cursor`})],$.prototype,`hideCursor`,void 0),E([d({type:Boolean,reflect:!0})],$.prototype,`disabled`,void 0),E([d({type:Number})],$.prototype,`stops`,void 0),E([d({type:Number,attribute:`stops-x`})],$.prototype,`stopsX`,void 0),E([d({type:Number,attribute:`stops-y`})],$.prototype,`stopsY`,void 0),$=E([T(`ixfx-xy-pad`)],$);function AO(){console.log(`Init`)}export{Oe as AcTextElement,Kt as AcTokenElement,$t as BottomDrawerElement,ln as ButtonElement,ar as Checkbox,_r as CheckedSelect,R as ColourPicker,ug as ColourPickerPopup,z as CrumbNavigationElement,Mg as CrumbPathController,B as CrumbPathElement,bS as DEFAULT_SIBLING_SPACING,Ae as DataController,Pg as DataDisplayComponent,V as DataGridElement,l_ as DataTableElement,H as DetailListElement,dy as DockHostElement,ly as DockPanelElement,dn as EMPTY_GROUP_LABEL,wy as EditableLabel,ky as EditableNumber,G as FlatListElement,Uy as FormElement,Ry as FormGroupElement,By as FormPartElement,K as GridListElement,cb as GroupedItemListerElement,J as HyperbolicTreeListElement,tn as ICON_CARET_RIGHT,nn as ICON_CHECK,en as ICON_CHEVRON_DOWN,rn as ICON_CLOSE,bC as IcicleTreeListElement,Dt as IncrSearchMillerController,Dt as IncrSearchTreeController,gx as IxfxHexEditorElement,we as IxfxIconElement,Z as IxfxTimelineElement,kt as KeyedElementIndex,Rn as LIST_ITEM_MOTION_MS,Ft as LIST_SEARCH_COMMAND_IDS,Rt as LIST_SEARCH_MODES,RC as LabelledRadialInput,og as LabelledRangeInput,YC as LabelledSliderInput,XC as LedElement,Ln as ListDragSelectController,g_ as ListGroupHeaderElement,Yn as ListNativeDragController,Bt as ListSearchController,Zn as ListSelectionController,r_ as Menu,ZC as MillerBaseElement,ew as MillerListElement,tw as MillerTreeController,dw as MulticolListElement,Ag as NarrowedTextElement,kw as NotificationManager,fw as NotificationPillElement,a_ as PanTextElement,ob as PanelElement,Pw as PanelGroupElement,XT as PlotDataSeries,X as PlotHistogram,_E as PlotMultiAxis,OE as PlotSingleAxis,kE as PlotXyAxis,zE as PolarPad,LC as RadialInputElement,un as RadioGroup,qE as RangeElement,HE as RangeInput,KE as RangeMultiElement,JE as RatingElement,YE as SelectHorizElement,QE as ShapefillValueElement,JC as SliderInputElement,rD as SlidingNumberElement,aD as SnackbarElement,oD as SnapContainer,ir as SplitButton,ny as SplitLayoutElement,ty as SplitPanelElement,sD as SwipeElement,lD as TabController,ry as TabListElement,cy as TabListItemElement,cD as TabPanelElement,uD as TabPanelsElement,dD as TextShimmerElement,ie as TickledController,fD as TimelineController,RD as TimelineTrackTabElement,Xt as TitlebarElement,fO as ToolbarElement,sO as ToolbarGroupElement,tE as TooltipElement,pO as TransitoryLabelElement,q as TreeBaseElement,mO as TreeController,Dg as TreeDataModel,yb as TreeDropController,Qn as TreeKeyboardNavController,zb as TreeListElement,Q as TreemapListElement,CO as TwoSplitLayoutElement,W as VerticalListElement,$ as XyPad,uv as addPanelToStack,Gn as animateListItemIn,Jn as animateListItemOut,YT as applyAgeModification,C as applyHighlights,Bx as applyIsometry,qv as applySnapshot,bg as applyTreeDrop,ND as attachTimelineInteractions,Zt as bottomDrawerCommandId,ne as buildHighlightTargets,Iv as buildModel,bn as captionForEntry,jx as clampToDisk,te as clearHighlights,sv as collectContainerNames,dg as collectDataResult,iv as collectPanelIds,cv as collectStackPaths,Vx as composeIsometry,SS as computeCanonicalPositions,JT as computeColour,DS as computeHyperbolicLayout,yC as computeIcicleLayout,bv as computeLeafGeoms,SO as computeTreemapLayout,Ct as createAcCompletionProvider,Ot as createDataListSearchAdapter,Fn as createDefaultListDragPreview,Pt as createElementIncrSearch,jt as createElementListSearchAdapter,J_ as createEmptyLayout,q_ as createEmptyStack,St as createFuzzySearch,Tt as createIncrSearch,vw as createPillRenderer,X_ as createSplit,Y_ as createStack,Bb as createTreeListAdapter,Ut as createTreeListSearchAdapter,Vb as createVerticalListAdapter,Kx as decomposeViewIsometry,fn as defaultGroupLabel,Uv as distribute,xg as dropTargetFor,Fx as euclideanRadiusForHyperbolicDistance,gv as extractStack,pS as findHyperbolicIdOf,mS as findHyperbolicKeyPath,hS as findHyperbolicNode,gS as findHyperbolicPath,fS as findHyperbolicPathById,_C as findIcicleNode,vC as findIciclePath,ev as findNode,Qv as findPanelNode,tv as findParentOf,nv as findStackOf,av as findStackPathByName,gO as findTreemapNode,_O as findTreemapPath,Rx as geodesicInterpolate,Jx as geodesicPath,qx as geodesicSegment,G_ as getActiveDragPanelId,ve as getIcon,ye as getIconEntry,Se as getIconFont,Sv as getLeafNeighbours,be as hasIcon,uS as hyperbolicBranchId,cS as hyperbolicChildIds,Ix as hyperbolicDistanceForEuclideanRadius,lS as hyperbolicIdDepth,TS as hyperbolicRelativeFrame,he as iconBus,zx as identityIsometry,AO as init,pv as insertBeside,Hx as invertIsometry,W_ as isDragging,dS as isHyperbolicDescendantId,Xn as isMultiMode,K_ as isSplit,U as isStack,D as keyForElement,Bn as listItemFadeKeyframes,Vt as listSearchStyles,Px as mobiusAdd,Nx as mobiusFromOrigin,Mx as mobiusToOrigin,EO as monitorIndeterminate,Tv as moveLeafNodeToEdge,wv as moveLeafStep,Ax as norm,Hv as normalise,gC as normaliseValue,Z_ as normalize,jw as panelGapIndex,GT as parseColourScaleAttr,Ov as parseLayout,hn as partitionByGroup,Lx as poincareDistance,B_ as pointerOverAnyHost,zn as prefersReducedMotion,Zv as preserveRestoreWeights,yg as pruneDraggedDescendants,WT as readBaseColour,_e as registerFontIcon,ge as registerIcon,Lt as registerListSearchCommands,dv as removePanelFromStack,TD as resolveCssVars,mD as resolveGrid,mn as resolveGroupKey,yv as resolveLeafPath,Wv as resolveTracks,Wx as rotationIsometry,Ev as serializeLayout,fv as setActive,xe as setIconFont,Xv as setPanelRestoreWeight,qn as startListItemOutAnimation,Ce as svgToDataUri,Cv as swapLeaves,oe as tickledItemStyles,ae as tickledStyles,LD as timelineStyles,pn as toGroupKey,Gv as toSnapshot,gn as toggleInSet,lO as toolbarGapIndex,Ux as translationFromOrigin,Gx as viewIsometry,$v as walk,mv as wrapRoot};
|