@aquera/nile-elements 1.4.8-beta-1.0 → 1.4.8-beta-1.2
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/README.md +4 -0
- package/demo/index.html +133 -33
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +98 -71
- package/dist/nile-file-preview/nile-file-preview.css.cjs.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.css.cjs.js.map +1 -1
- package/dist/nile-file-preview/nile-file-preview.css.esm.js +7 -3
- package/dist/nile-file-preview/nile-file-preview.template.cjs.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.template.cjs.js.map +1 -1
- package/dist/nile-file-preview/nile-file-preview.template.esm.js +73 -64
- package/dist/nile-lite-tooltip/nile-lite-tooltip.cjs.js +1 -1
- package/dist/nile-lite-tooltip/nile-lite-tooltip.cjs.js.map +1 -1
- package/dist/nile-lite-tooltip/nile-lite-tooltip.esm.js +1 -1
- package/dist/nile-option/nile-option.cjs.js +1 -1
- package/dist/nile-option/nile-option.cjs.js.map +1 -1
- package/dist/nile-option/nile-option.css.cjs.js +1 -1
- package/dist/nile-option/nile-option.css.cjs.js.map +1 -1
- package/dist/nile-option/nile-option.css.esm.js +10 -0
- package/dist/nile-option/nile-option.esm.js +10 -7
- package/dist/nile-side-bar-action/index.cjs.js +1 -1
- package/dist/nile-side-bar-action/index.esm.js +1 -1
- package/dist/nile-side-bar-action/nile-side-bar-action.cjs.js +1 -1
- package/dist/nile-side-bar-action/nile-side-bar-action.cjs.js.map +1 -1
- package/dist/nile-side-bar-action/nile-side-bar-action.esm.js +4 -3
- package/dist/nile-side-bar-action/portal-manager.cjs.js +2 -0
- package/dist/nile-side-bar-action/portal-manager.cjs.js.map +1 -0
- package/dist/nile-side-bar-action/portal-manager.esm.js +1 -0
- package/dist/nile-side-bar-action/portal-utils.cjs.js +2 -0
- package/dist/nile-side-bar-action/portal-utils.cjs.js.map +1 -0
- package/dist/nile-side-bar-action/portal-utils.esm.js +1 -0
- package/dist/src/nile-file-preview/nile-file-preview.css.js +7 -3
- package/dist/src/nile-file-preview/nile-file-preview.css.js.map +1 -1
- package/dist/src/nile-file-preview/nile-file-preview.template.js +46 -37
- package/dist/src/nile-file-preview/nile-file-preview.template.js.map +1 -1
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.d.ts +2 -0
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.js +15 -0
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.js.map +1 -1
- package/dist/src/nile-option/nile-option.css.js +10 -0
- package/dist/src/nile-option/nile-option.css.js.map +1 -1
- package/dist/src/nile-option/nile-option.d.ts +1 -0
- package/dist/src/nile-option/nile-option.js +13 -5
- package/dist/src/nile-option/nile-option.js.map +1 -1
- package/dist/src/nile-side-bar-action/nile-side-bar-action.d.ts +8 -1
- package/dist/src/nile-side-bar-action/nile-side-bar-action.js +66 -12
- package/dist/src/nile-side-bar-action/nile-side-bar-action.js.map +1 -1
- package/dist/src/nile-side-bar-action/portal-manager.d.ts +43 -0
- package/dist/src/nile-side-bar-action/portal-manager.js +374 -0
- package/dist/src/nile-side-bar-action/portal-manager.js.map +1 -0
- package/dist/src/nile-side-bar-action/portal-utils.d.ts +32 -0
- package/dist/src/nile-side-bar-action/portal-utils.js +212 -0
- package/dist/src/nile-side-bar-action/portal-utils.js.map +1 -0
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-file-preview/nile-file-preview.css.ts +7 -3
- package/src/nile-file-preview/nile-file-preview.template.ts +46 -37
- package/src/nile-lite-tooltip/nile-lite-tooltip.ts +15 -0
- package/src/nile-option/nile-option.css.ts +10 -0
- package/src/nile-option/nile-option.ts +11 -5
- package/src/nile-side-bar-action/nile-side-bar-action.ts +74 -15
- package/src/nile-side-bar-action/portal-manager.ts +489 -0
- package/src/nile-side-bar-action/portal-utils.ts +270 -0
- package/vscode-html-custom-data.json +22 -3
package/dist/index.js
CHANGED
|
@@ -4869,7 +4869,7 @@ class CM{constructor(e){this._element=null;const t=e??window;this._node=t,e&&(th
|
|
|
4869
4869
|
* @license
|
|
4870
4870
|
* Copyright 2021 Google LLC
|
|
4871
4871
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
4872
|
-
*/(this._hostElement,e),this._scrollerController=new bM(this,this._clippingAncestors[0]),this._schedule(this._updateLayout),this._observeAndListen(),this._connected=!0}_observeAndListen(){this._mutationObserver.observe(this._hostElement,{childList:!0}),this._hostElementRO.observe(this._hostElement),this._scrollEventListeners.push(window),window.addEventListener("scroll",this,this._scrollEventListenerOptions),this._clippingAncestors.forEach((e=>{e.addEventListener("scroll",this,this._scrollEventListenerOptions),this._scrollEventListeners.push(e),this._hostElementRO.observe(e)})),this._hostElementRO.observe(this._scrollerController.element),this._children.forEach((e=>this._childrenRO.observe(e))),this._scrollEventListeners.forEach((e=>e.addEventListener("scroll",this,this._scrollEventListenerOptions)))}disconnected(){this._scrollEventListeners.forEach((e=>e.removeEventListener("scroll",this,this._scrollEventListenerOptions))),this._scrollEventListeners=[],this._clippingAncestors=[],this._scrollerController?.detach(this),this._scrollerController=null,this._mutationObserver?.disconnect(),this._mutationObserver=null,this._hostElementRO?.disconnect(),this._hostElementRO=null,this._childrenRO?.disconnect(),this._childrenRO=null,this._rejectLayoutCompletePromise("disconnected"),this._connected=!1}_applyVirtualizerStyles(){const e=this._hostElement.style;e.display=e.display||"block",e.position=e.position||"relative",e.contain=e.contain||"size layout",this._isScroller&&(e.overflow=e.overflow||"auto",e.minHeight=e.minHeight||"150px")}_getSizer(){const e=this._hostElement;if(!this._sizer){let t=e.querySelector(`[${UM}]`);t||(t=document.createElement("div"),t.setAttribute(UM,""),e.appendChild(t)),Object.assign(t.style,{position:"absolute",margin:"-2px 0 0 0",padding:0,visibility:"hidden",fontSize:"2px"}),t.textContent=" ",t.setAttribute(UM,""),this._sizer=t}return this._sizer}async updateLayoutConfig(e){await this._layoutInitialized;const t=e.type||YM;if("function"==typeof t&&this._layout instanceof t){const t={...e};return delete t.type,this._layout.config=t,!0}return!1}async _initLayout(e){let t,i;if("function"==typeof e.type){i=e.type;const M={...e};delete M.type,t=M}else t=e;void 0===i&&(YM=i=(await Promise.resolve().then((function(){return hQ}))).FlowLayout),this._layout=new i((e=>this._handleLayoutMessage(e)),t),this._layout.measureChildren&&"function"==typeof this._layout.updateItemSizes&&("function"==typeof this._layout.measureChildren&&(this._measureChildOverride=this._layout.measureChildren),this._measureCallback=this._layout.updateItemSizes.bind(this._layout)),this._layout.listenForChildLoadEvents&&this._hostElement.addEventListener("load",this._loadListener,!0),this._schedule(this._updateLayout)}startBenchmarking(){null===this._benchmarkStart&&(this._benchmarkStart=window.performance.now())}stopBenchmarking(){if(null!==this._benchmarkStart){const e=window.performance.now(),t=e-this._benchmarkStart,i=performance.getEntriesByName("uv-virtualizing","measure").filter((t=>t.startTime>=this._benchmarkStart&&t.startTime<e)).reduce(((e,t)=>e+t.duration),0);return this._benchmarkStart=null,{timeElapsed:t,virtualizationTime:i}}return null}_measureChildren(){const e={},t=this._children,i=this._measureChildOverride||this._measureChild;for(let M=0;M<t.length;M++){const n=t[M],o=this._first+M;(this._itemsChanged||this._toBeMeasured.has(n))&&(e[o]=i.call(this,n,this._items[o]))}this._childMeasurements=e,this._schedule(this._updateLayout),this._toBeMeasured.clear()}_measureChild(e){const{width:t,height:i}=e.getBoundingClientRect();return Object.assign({width:t,height:i},function(e){const t=window.getComputedStyle(e);return{marginTop:VM(t.marginTop),marginRight:VM(t.marginRight),marginBottom:VM(t.marginBottom),marginLeft:VM(t.marginLeft)}}(e))}async _schedule(e){this._scheduled.has(e)||(this._scheduled.add(e),await Promise.resolve(),this._scheduled.delete(e),e.call(this))}async _updateDOM(e){this._scrollSize=e.scrollSize,this._adjustRange(e.range),this._childrenPos=e.childPositions,this._scrollError=e.scrollError||null;const{_rangeChanged:t,_itemsChanged:i}=this;this._visibilityChanged&&(this._notifyVisibility(),this._visibilityChanged=!1),(t||i)&&(this._notifyRange(),this._rangeChanged=!1),this._finishDOMUpdate()}_finishDOMUpdate(){this._connected&&(this._children.forEach((e=>this._childrenRO.observe(e))),this._checkScrollIntoViewTarget(this._childrenPos),this._positionChildren(this._childrenPos),this._sizeHostElement(this._scrollSize),this._correctScrollError(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_updateLayout(){this._layout&&this._connected&&(this._layout.items=this._items,this._updateView(),null!==this._childMeasurements&&(this._measureCallback&&this._measureCallback(this._childMeasurements),this._childMeasurements=null),this._layout.reflowIfNeeded(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_handleScrollEvent(){if(this._benchmarkStart&&"mark"in window.performance){try{window.performance.measure("uv-virtualizing","uv-start","uv-end")}catch(e){console.warn("Error measuring performance data: ",e)}window.performance.mark("uv-start")}!1===this._scrollerController.correctingScrollError&&this._layout?.unpin(),this._schedule(this._updateLayout)}handleEvent(e){if("scroll"===e.type)(e.currentTarget===window||this._clippingAncestors.includes(e.currentTarget))&&this._handleScrollEvent();else console.warn("event not handled",e)}_handleLayoutMessage(e){"stateChanged"===e.type?this._updateDOM(e):"visibilityChanged"===e.type?(this._firstVisible=e.firstVisible,this._lastVisible=e.lastVisible,this._notifyVisibility()):"unpinned"===e.type&&this._hostElement.dispatchEvent(new kM)}get _children(){const e=[];let t=this._hostElement.firstElementChild;for(;t;)t.hasAttribute(UM)||e.push(t),t=t.nextElementSibling;return e}_updateView(){const e=this._hostElement,t=this._scrollerController?.element,i=this._layout;if(e&&t&&i){let M,n,o,r;const s=e.getBoundingClientRect();M=0,n=0,o=window.innerHeight,r=window.innerWidth;const a=this._clippingAncestors.map((e=>e.getBoundingClientRect()));a.unshift(s);for(const e of a)M=Math.max(M,e.top),n=Math.max(n,e.left),o=Math.min(o,e.bottom),r=Math.min(r,e.right);const l=t.getBoundingClientRect(),N={left:s.left-l.left,top:s.top-l.top},g={width:t.scrollWidth,height:t.scrollHeight},u=M-s.top+e.scrollTop,c=n-s.left+e.scrollLeft,D=Math.max(0,o-M),j=Math.max(0,r-n);i.viewportSize={width:j,height:D},i.viewportScroll={top:u,left:c},i.totalScrollSize=g,i.offsetWithinScroller=N}}_sizeHostElement(e){const t=82e5,i=e&&null!==e.width?Math.min(t,e.width):0,M=e&&null!==e.height?Math.min(t,e.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${i}px, ${M}px)`;else{const e=this._hostElement.style;e.minWidth=i?`${i}px`:"100%",e.minHeight=M?`${M}px`:"100%"}}_positionChildren(e){e&&e.forEach((({top:e,left:t,width:i,height:M,xOffset:n,yOffset:o},r)=>{const s=this._children[r-this._first];s&&(s.style.position="absolute",s.style.boxSizing="border-box",s.style.transform=`translate(${t}px, ${e}px)`,void 0!==i&&(s.style.width=i+"px"),void 0!==M&&(s.style.height=M+"px"),s.style.left=void 0===n?null:n+"px",s.style.top=void 0===o?null:o+"px")}))}async _adjustRange(e){const{_first:t,_last:i,_firstVisible:M,_lastVisible:n}=this;this._first=e.first,this._last=e.last,this._firstVisible=e.firstVisible,this._lastVisible=e.lastVisible,this._rangeChanged=this._rangeChanged||this._first!==t||this._last!==i,this._visibilityChanged=this._visibilityChanged||this._firstVisible!==M||this._lastVisible!==n}_correctScrollError(){if(this._scrollError){const{scrollTop:e,scrollLeft:t}=this._scrollerController,{top:i,left:M}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:e-i,left:t-M})}}element(e){return e===1/0&&(e=this._items.length-1),void 0===this._items?.[e]?void 0:{scrollIntoView:(t={})=>this._scrollElementIntoView({...t,index:e})}}_scrollElementIntoView(e){if(e.index>=this._first&&e.index<=this._last)this._children[e.index-this._first].scrollIntoView(e);else if(e.index=Math.min(e.index,this._items.length-1),"smooth"===e.behavior){const t=this._layout.getScrollIntoViewCoordinates(e),{behavior:i}=e;this._updateScrollIntoViewCoordinates=this._scrollerController.managedScrollTo(Object.assign(t,{behavior:i}),(()=>this._layout.getScrollIntoViewCoordinates(e)),(()=>this._scrollIntoViewTarget=null)),this._scrollIntoViewTarget=e}else this._layout.pin=e}_checkScrollIntoViewTarget(e){const{index:t}=this._scrollIntoViewTarget||{};t&&e?.has(t)&&this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget))}_notifyRange(){this._hostElement.dispatchEvent(new wM({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new QM({first:this._firstVisible,last:this._lastVisible}))}get layoutComplete(){return this._layoutCompletePromise||(this._layoutCompletePromise=new Promise(((e,t)=>{this._layoutCompleteResolver=e,this._layoutCompleteRejecter=t}))),this._layoutCompletePromise}_rejectLayoutCompletePromise(e){null!==this._layoutCompleteRejecter&&this._layoutCompleteRejecter(e),this._resetLayoutCompleteState()}_scheduleLayoutComplete(){this._layoutCompletePromise&&null===this._pendingLayoutComplete&&(this._pendingLayoutComplete=requestAnimationFrame((()=>requestAnimationFrame((()=>this._resolveLayoutCompletePromise())))))}_resolveLayoutCompletePromise(){null!==this._layoutCompleteResolver&&this._layoutCompleteResolver(),this._resetLayoutCompleteState()}_resetLayoutCompleteState(){this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null}_hostElementSizeChanged(){this._schedule(this._updateLayout)}_childLoaded(){}_childrenSizeChanged(e){if(this._layout?.measureChildren){for(const t of e)this._toBeMeasured.set(t.target,t.contentRect);this._measureChildren()}this._scheduleLayoutComplete(),this._itemsChanged=!1,this._rangeChanged=!1}}function VM(e){const t=e?parseFloat(e):NaN;return Number.isNaN(t)?0:t}function WM(e){if(null!==e.assignedSlot)return e.assignedSlot;if(null!==e.parentElement)return e.parentElement;const t=e.parentNode;return t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host||null}const PM=Ae(class extends SM{constructor(e){if(super(e),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(e,t)=>((e,t)=>R`${t}: ${JSON.stringify(e,null,2)}`)(e,t+this._first),this._keyFunction=(e,t)=>(e=>e)(e,this._first),this._items=[],e.type!==he)throw new Error("The virtualize directive can only be used in child expressions")}render(e){e&&this._setFunctions(e);const t=[];if(this._first>=0&&this._last>=this._first)for(let e=this._first;e<=this._last;e++)t.push(this._items[e]);return EM(t,this._keyFunction,this._renderItem)}update(e,[t]){this._setFunctions(t);const i=this._items!==t.items;return this._items=t.items||[],this._virtualizer?this._updateVirtualizerConfig(e,t):this._initialize(e,t),i?B:this.render()}async _updateVirtualizerConfig(e,t){if(!await this._virtualizer.updateLayoutConfig(t.layout||{})){const i=e.parentNode;this._makeVirtualizer(i,t)}this._virtualizer.items=this._items}_setFunctions(e){const{renderItem:t,keyFunction:i}=e;t&&(this._renderItem=(e,i)=>t(e,i+this._first)),i&&(this._keyFunction=(e,t)=>i(e,t+this._first))}_makeVirtualizer(e,t){this._virtualizer&&this._virtualizer.disconnected();const{layout:i,scroller:M,items:n}=t;this._virtualizer=new ZM({hostElement:e,layout:i,scroller:M}),this._virtualizer.items=n,this._virtualizer.connected()}_initialize(e,t){const i=e.parentNode;i&&1===i.nodeType&&(i.addEventListener("rangeChanged",(e=>{this._first=e.first,this._last=e.last,this.setValue(this.render())})),this._makeVirtualizer(i,t))}disconnected(){this._virtualizer?.disconnected()}reconnected(){this._virtualizer?.connected()}});class RM{static getVirtualizedContent(e,t,i,M,n,o,r,s,a,l,N){return R`
|
|
4872
|
+
*/(this._hostElement,e),this._scrollerController=new bM(this,this._clippingAncestors[0]),this._schedule(this._updateLayout),this._observeAndListen(),this._connected=!0}_observeAndListen(){this._mutationObserver.observe(this._hostElement,{childList:!0}),this._hostElementRO.observe(this._hostElement),this._scrollEventListeners.push(window),window.addEventListener("scroll",this,this._scrollEventListenerOptions),this._clippingAncestors.forEach((e=>{e.addEventListener("scroll",this,this._scrollEventListenerOptions),this._scrollEventListeners.push(e),this._hostElementRO.observe(e)})),this._hostElementRO.observe(this._scrollerController.element),this._children.forEach((e=>this._childrenRO.observe(e))),this._scrollEventListeners.forEach((e=>e.addEventListener("scroll",this,this._scrollEventListenerOptions)))}disconnected(){this._scrollEventListeners.forEach((e=>e.removeEventListener("scroll",this,this._scrollEventListenerOptions))),this._scrollEventListeners=[],this._clippingAncestors=[],this._scrollerController?.detach(this),this._scrollerController=null,this._mutationObserver?.disconnect(),this._mutationObserver=null,this._hostElementRO?.disconnect(),this._hostElementRO=null,this._childrenRO?.disconnect(),this._childrenRO=null,this._rejectLayoutCompletePromise("disconnected"),this._connected=!1}_applyVirtualizerStyles(){const e=this._hostElement.style;e.display=e.display||"block",e.position=e.position||"relative",e.contain=e.contain||"size layout",this._isScroller&&(e.overflow=e.overflow||"auto",e.minHeight=e.minHeight||"150px")}_getSizer(){const e=this._hostElement;if(!this._sizer){let t=e.querySelector(`[${UM}]`);t||(t=document.createElement("div"),t.setAttribute(UM,""),e.appendChild(t)),Object.assign(t.style,{position:"absolute",margin:"-2px 0 0 0",padding:0,visibility:"hidden",fontSize:"2px"}),t.textContent=" ",t.setAttribute(UM,""),this._sizer=t}return this._sizer}async updateLayoutConfig(e){await this._layoutInitialized;const t=e.type||YM;if("function"==typeof t&&this._layout instanceof t){const t={...e};return delete t.type,this._layout.config=t,!0}return!1}async _initLayout(e){let t,i;if("function"==typeof e.type){i=e.type;const M={...e};delete M.type,t=M}else t=e;void 0===i&&(YM=i=(await Promise.resolve().then((function(){return OQ}))).FlowLayout),this._layout=new i((e=>this._handleLayoutMessage(e)),t),this._layout.measureChildren&&"function"==typeof this._layout.updateItemSizes&&("function"==typeof this._layout.measureChildren&&(this._measureChildOverride=this._layout.measureChildren),this._measureCallback=this._layout.updateItemSizes.bind(this._layout)),this._layout.listenForChildLoadEvents&&this._hostElement.addEventListener("load",this._loadListener,!0),this._schedule(this._updateLayout)}startBenchmarking(){null===this._benchmarkStart&&(this._benchmarkStart=window.performance.now())}stopBenchmarking(){if(null!==this._benchmarkStart){const e=window.performance.now(),t=e-this._benchmarkStart,i=performance.getEntriesByName("uv-virtualizing","measure").filter((t=>t.startTime>=this._benchmarkStart&&t.startTime<e)).reduce(((e,t)=>e+t.duration),0);return this._benchmarkStart=null,{timeElapsed:t,virtualizationTime:i}}return null}_measureChildren(){const e={},t=this._children,i=this._measureChildOverride||this._measureChild;for(let M=0;M<t.length;M++){const n=t[M],o=this._first+M;(this._itemsChanged||this._toBeMeasured.has(n))&&(e[o]=i.call(this,n,this._items[o]))}this._childMeasurements=e,this._schedule(this._updateLayout),this._toBeMeasured.clear()}_measureChild(e){const{width:t,height:i}=e.getBoundingClientRect();return Object.assign({width:t,height:i},function(e){const t=window.getComputedStyle(e);return{marginTop:VM(t.marginTop),marginRight:VM(t.marginRight),marginBottom:VM(t.marginBottom),marginLeft:VM(t.marginLeft)}}(e))}async _schedule(e){this._scheduled.has(e)||(this._scheduled.add(e),await Promise.resolve(),this._scheduled.delete(e),e.call(this))}async _updateDOM(e){this._scrollSize=e.scrollSize,this._adjustRange(e.range),this._childrenPos=e.childPositions,this._scrollError=e.scrollError||null;const{_rangeChanged:t,_itemsChanged:i}=this;this._visibilityChanged&&(this._notifyVisibility(),this._visibilityChanged=!1),(t||i)&&(this._notifyRange(),this._rangeChanged=!1),this._finishDOMUpdate()}_finishDOMUpdate(){this._connected&&(this._children.forEach((e=>this._childrenRO.observe(e))),this._checkScrollIntoViewTarget(this._childrenPos),this._positionChildren(this._childrenPos),this._sizeHostElement(this._scrollSize),this._correctScrollError(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_updateLayout(){this._layout&&this._connected&&(this._layout.items=this._items,this._updateView(),null!==this._childMeasurements&&(this._measureCallback&&this._measureCallback(this._childMeasurements),this._childMeasurements=null),this._layout.reflowIfNeeded(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_handleScrollEvent(){if(this._benchmarkStart&&"mark"in window.performance){try{window.performance.measure("uv-virtualizing","uv-start","uv-end")}catch(e){console.warn("Error measuring performance data: ",e)}window.performance.mark("uv-start")}!1===this._scrollerController.correctingScrollError&&this._layout?.unpin(),this._schedule(this._updateLayout)}handleEvent(e){if("scroll"===e.type)(e.currentTarget===window||this._clippingAncestors.includes(e.currentTarget))&&this._handleScrollEvent();else console.warn("event not handled",e)}_handleLayoutMessage(e){"stateChanged"===e.type?this._updateDOM(e):"visibilityChanged"===e.type?(this._firstVisible=e.firstVisible,this._lastVisible=e.lastVisible,this._notifyVisibility()):"unpinned"===e.type&&this._hostElement.dispatchEvent(new kM)}get _children(){const e=[];let t=this._hostElement.firstElementChild;for(;t;)t.hasAttribute(UM)||e.push(t),t=t.nextElementSibling;return e}_updateView(){const e=this._hostElement,t=this._scrollerController?.element,i=this._layout;if(e&&t&&i){let M,n,o,r;const s=e.getBoundingClientRect();M=0,n=0,o=window.innerHeight,r=window.innerWidth;const a=this._clippingAncestors.map((e=>e.getBoundingClientRect()));a.unshift(s);for(const e of a)M=Math.max(M,e.top),n=Math.max(n,e.left),o=Math.min(o,e.bottom),r=Math.min(r,e.right);const l=t.getBoundingClientRect(),N={left:s.left-l.left,top:s.top-l.top},g={width:t.scrollWidth,height:t.scrollHeight},u=M-s.top+e.scrollTop,c=n-s.left+e.scrollLeft,D=Math.max(0,o-M),j=Math.max(0,r-n);i.viewportSize={width:j,height:D},i.viewportScroll={top:u,left:c},i.totalScrollSize=g,i.offsetWithinScroller=N}}_sizeHostElement(e){const t=82e5,i=e&&null!==e.width?Math.min(t,e.width):0,M=e&&null!==e.height?Math.min(t,e.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${i}px, ${M}px)`;else{const e=this._hostElement.style;e.minWidth=i?`${i}px`:"100%",e.minHeight=M?`${M}px`:"100%"}}_positionChildren(e){e&&e.forEach((({top:e,left:t,width:i,height:M,xOffset:n,yOffset:o},r)=>{const s=this._children[r-this._first];s&&(s.style.position="absolute",s.style.boxSizing="border-box",s.style.transform=`translate(${t}px, ${e}px)`,void 0!==i&&(s.style.width=i+"px"),void 0!==M&&(s.style.height=M+"px"),s.style.left=void 0===n?null:n+"px",s.style.top=void 0===o?null:o+"px")}))}async _adjustRange(e){const{_first:t,_last:i,_firstVisible:M,_lastVisible:n}=this;this._first=e.first,this._last=e.last,this._firstVisible=e.firstVisible,this._lastVisible=e.lastVisible,this._rangeChanged=this._rangeChanged||this._first!==t||this._last!==i,this._visibilityChanged=this._visibilityChanged||this._firstVisible!==M||this._lastVisible!==n}_correctScrollError(){if(this._scrollError){const{scrollTop:e,scrollLeft:t}=this._scrollerController,{top:i,left:M}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:e-i,left:t-M})}}element(e){return e===1/0&&(e=this._items.length-1),void 0===this._items?.[e]?void 0:{scrollIntoView:(t={})=>this._scrollElementIntoView({...t,index:e})}}_scrollElementIntoView(e){if(e.index>=this._first&&e.index<=this._last)this._children[e.index-this._first].scrollIntoView(e);else if(e.index=Math.min(e.index,this._items.length-1),"smooth"===e.behavior){const t=this._layout.getScrollIntoViewCoordinates(e),{behavior:i}=e;this._updateScrollIntoViewCoordinates=this._scrollerController.managedScrollTo(Object.assign(t,{behavior:i}),(()=>this._layout.getScrollIntoViewCoordinates(e)),(()=>this._scrollIntoViewTarget=null)),this._scrollIntoViewTarget=e}else this._layout.pin=e}_checkScrollIntoViewTarget(e){const{index:t}=this._scrollIntoViewTarget||{};t&&e?.has(t)&&this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget))}_notifyRange(){this._hostElement.dispatchEvent(new wM({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new QM({first:this._firstVisible,last:this._lastVisible}))}get layoutComplete(){return this._layoutCompletePromise||(this._layoutCompletePromise=new Promise(((e,t)=>{this._layoutCompleteResolver=e,this._layoutCompleteRejecter=t}))),this._layoutCompletePromise}_rejectLayoutCompletePromise(e){null!==this._layoutCompleteRejecter&&this._layoutCompleteRejecter(e),this._resetLayoutCompleteState()}_scheduleLayoutComplete(){this._layoutCompletePromise&&null===this._pendingLayoutComplete&&(this._pendingLayoutComplete=requestAnimationFrame((()=>requestAnimationFrame((()=>this._resolveLayoutCompletePromise())))))}_resolveLayoutCompletePromise(){null!==this._layoutCompleteResolver&&this._layoutCompleteResolver(),this._resetLayoutCompleteState()}_resetLayoutCompleteState(){this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null}_hostElementSizeChanged(){this._schedule(this._updateLayout)}_childLoaded(){}_childrenSizeChanged(e){if(this._layout?.measureChildren){for(const t of e)this._toBeMeasured.set(t.target,t.contentRect);this._measureChildren()}this._scheduleLayoutComplete(),this._itemsChanged=!1,this._rangeChanged=!1}}function VM(e){const t=e?parseFloat(e):NaN;return Number.isNaN(t)?0:t}function WM(e){if(null!==e.assignedSlot)return e.assignedSlot;if(null!==e.parentElement)return e.parentElement;const t=e.parentNode;return t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host||null}const PM=Ae(class extends SM{constructor(e){if(super(e),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(e,t)=>((e,t)=>R`${t}: ${JSON.stringify(e,null,2)}`)(e,t+this._first),this._keyFunction=(e,t)=>(e=>e)(e,this._first),this._items=[],e.type!==he)throw new Error("The virtualize directive can only be used in child expressions")}render(e){e&&this._setFunctions(e);const t=[];if(this._first>=0&&this._last>=this._first)for(let e=this._first;e<=this._last;e++)t.push(this._items[e]);return EM(t,this._keyFunction,this._renderItem)}update(e,[t]){this._setFunctions(t);const i=this._items!==t.items;return this._items=t.items||[],this._virtualizer?this._updateVirtualizerConfig(e,t):this._initialize(e,t),i?B:this.render()}async _updateVirtualizerConfig(e,t){if(!await this._virtualizer.updateLayoutConfig(t.layout||{})){const i=e.parentNode;this._makeVirtualizer(i,t)}this._virtualizer.items=this._items}_setFunctions(e){const{renderItem:t,keyFunction:i}=e;t&&(this._renderItem=(e,i)=>t(e,i+this._first)),i&&(this._keyFunction=(e,t)=>i(e,t+this._first))}_makeVirtualizer(e,t){this._virtualizer&&this._virtualizer.disconnected();const{layout:i,scroller:M,items:n}=t;this._virtualizer=new ZM({hostElement:e,layout:i,scroller:M}),this._virtualizer.items=n,this._virtualizer.connected()}_initialize(e,t){const i=e.parentNode;i&&1===i.nodeType&&(i.addEventListener("rangeChanged",(e=>{this._first=e.first,this._last=e.last,this.setValue(this.render())})),this._makeVirtualizer(i,t))}disconnected(){this._virtualizer?.disconnected()}reconnected(){this._virtualizer?.connected()}});class RM{static getVirtualizedContent(e,t,i,M,n,o,r,s,a,l,N){return R`
|
|
4873
4873
|
<div part="select-options" class="select__options ${t?"select__options__search-enabled":""} ${l?"loading":""}">
|
|
4874
4874
|
${s&&!l?R`
|
|
4875
4875
|
<div part="select-no-results" class="select__no-results">
|
|
@@ -5532,7 +5532,17 @@ class CM{constructor(e){this._element=null;const t=e??window;this._node=t,e&&(th
|
|
|
5532
5532
|
outline-offset: -1px;
|
|
5533
5533
|
}
|
|
5534
5534
|
}
|
|
5535
|
-
|
|
5535
|
+
|
|
5536
|
+
.option__label-container {
|
|
5537
|
+
display: flex;
|
|
5538
|
+
flex-direction: column;
|
|
5539
|
+
}
|
|
5540
|
+
|
|
5541
|
+
.option__description {
|
|
5542
|
+
font-size: var(--nile-type-scale-2, var(--ng-font-size-text-sm));
|
|
5543
|
+
color: var(--nile-colors-dark-500, var(--ng-colors-text-tertiary-600));
|
|
5544
|
+
}
|
|
5545
|
+
`;let tn=class extends Re{constructor(){super(...arguments),this.current=!1,this.hasHover=!1,this.hidden=!1,this.isMultipleSelect=!1,this.value="",this.showCheckbox=!1,this.disabled=!1,this.selected=!1,this.groupName="",this.description=""}connectedCallback(){super.connectedCallback(),this.setAttribute("role","option"),this.setAttribute("aria-selected","false"),this.checkIfMultipleSelect()}checkIfMultipleSelect(){const e=this.closest("nile-select");e&&e.hasAttribute("multiple")?e.hasAttribute("multiple")&&""===e.getAttribute("multiple")||"true"===e.getAttribute("multiple")?this.isMultipleSelect=!0:this.isMultipleSelect=!1:this.isMultipleSelect=this.showCheckbox}updated(e){this.checkIfMultipleSelect()}handleDefaultSlotChange(){const e=this.getTextLabel();void 0!==this.cachedTextLabel?e!==this.cachedTextLabel&&(this.cachedTextLabel=e,this.emit("slotchange")):this.cachedTextLabel=e}handleMouseEnter(){this.hasHover=!0}handleMouseLeave(){this.hasHover=!1}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleSelectedChange(){this.setAttribute("aria-selected",this.selected?"true":"false")}handleValueChange(){"string"!=typeof this.value&&(this.value=String(this.value))}getTextLabel(){const e=this.querySelector("label");return e?e.textContent?.trim()??"":(this.textContent??"").trim()}render(){return R`
|
|
5536
5546
|
${this.hidden?"":R` <div
|
|
5537
5547
|
part="base"
|
|
5538
5548
|
class=${pe({option:!0,"option--single-select":!this.isMultipleSelect,"option--current":this.selected&&!this.isMultipleSelect,"option--disabled":this.disabled,"option--selected":this.selected&&!this.isMultipleSelect,"option--hover":this.hasHover})}
|
|
@@ -5543,14 +5553,17 @@ class CM{constructor(e){this._element=null;const t=e??window;this._node=t,e&&(th
|
|
|
5543
5553
|
${this.isMultipleSelect?R`<nile-checkbox part="checkbox" class="option--checkbox" .checked=${this.selected}></nile-checkbox>`:""}
|
|
5544
5554
|
|
|
5545
5555
|
<slot part="prefix" name="prefix" class="option__prefix"></slot>
|
|
5546
|
-
<
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
|
|
5556
|
+
<div class="option__label-container" part="option_label_container">
|
|
5557
|
+
<slot
|
|
5558
|
+
part="label"
|
|
5559
|
+
class="option__label"
|
|
5560
|
+
@slotchange=${this.handleDefaultSlotChange}
|
|
5561
|
+
></slot>
|
|
5562
|
+
${this.description?R`<span part="option_description" class="option__description">${this.description}</span>`:""}
|
|
5563
|
+
</div>
|
|
5551
5564
|
<slot part="suffix" name="suffix" class="option__suffix"></slot>
|
|
5552
5565
|
</div>`}
|
|
5553
|
-
`}};tn.styles=en,e([Ie(".option__label")],tn.prototype,"defaultSlot",void 0),e([De()],tn.prototype,"current",void 0),e([De()],tn.prototype,"hasHover",void 0),e([ce({type:Boolean,reflect:!0,attribute:!0})],tn.prototype,"hidden",void 0),e([De()],tn.prototype,"isMultipleSelect",void 0),e([ce({reflect:!0})],tn.prototype,"value",void 0),e([ce({type:Boolean,reflect:!0,attribute:!0})],tn.prototype,"showCheckbox",void 0),e([ce({type:Boolean,reflect:!0})],tn.prototype,"disabled",void 0),e([ce({type:Boolean,reflect:!0})],tn.prototype,"selected",void 0),e([ce({type:String,reflect:!0,attribute:!0})],tn.prototype,"groupName",void 0),e([We("disabled")],tn.prototype,"handleDisabledChange",null),e([We("selected")],tn.prototype,"handleSelectedChange",null),e([We("value")],tn.prototype,"handleValueChange",null),tn=e([Ne("nile-option")],tn);const Mn=r`
|
|
5566
|
+
`}};tn.styles=en,e([Ie(".option__label")],tn.prototype,"defaultSlot",void 0),e([De()],tn.prototype,"current",void 0),e([De()],tn.prototype,"hasHover",void 0),e([ce({type:Boolean,reflect:!0,attribute:!0})],tn.prototype,"hidden",void 0),e([De()],tn.prototype,"isMultipleSelect",void 0),e([ce({reflect:!0})],tn.prototype,"value",void 0),e([ce({type:Boolean,reflect:!0,attribute:!0})],tn.prototype,"showCheckbox",void 0),e([ce({type:Boolean,reflect:!0})],tn.prototype,"disabled",void 0),e([ce({type:Boolean,reflect:!0})],tn.prototype,"selected",void 0),e([ce({type:String,reflect:!0,attribute:!0})],tn.prototype,"groupName",void 0),e([ce({type:String,reflect:!0,attribute:!0})],tn.prototype,"description",void 0),e([We("disabled")],tn.prototype,"handleDisabledChange",null),e([We("selected")],tn.prototype,"handleSelectedChange",null),e([We("value")],tn.prototype,"handleValueChange",null),tn=e([Ne("nile-option")],tn);const Mn=r`
|
|
5554
5567
|
:host {
|
|
5555
5568
|
box-sizing: border-box;
|
|
5556
5569
|
-webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));
|
|
@@ -5748,7 +5761,7 @@ class CM{constructor(e){this._element=null;const t=e??window;this._node=t,e&&(th
|
|
|
5748
5761
|
max-width: var(--auto-size-available-width) !important;
|
|
5749
5762
|
max-height: var(--auto-size-available-height) !important;
|
|
5750
5763
|
}
|
|
5751
|
-
`;let rn=class{static calculateAvailableSpace(e){const t=e.getBoundingClientRect(),i=window.innerHeight,M=window.innerWidth,n=i-t.bottom,o=t.top,r=M-t.right;return{spaceAbove:o,spaceBelow:n,spaceLeft:t.left,spaceRight:r,viewportHeight:i,viewportWidth:M}}static getOptimalPlacement(e){const{spaceAbove:t,spaceBelow:i,spaceLeft:M,spaceRight:n}=this.calculateAvailableSpace(e);return i>=200&&i>=t?"bottom":t>=200&&t>i?"top":n>=200&&n>=M?"right":M>=200?"left":"bottom"}static findBoundaryElements(e){const t=[];let i=e.parentElement;for(;i&&i!==document.body;){const e=window.getComputedStyle(i),M=e.overflow,n=e.overflowY,o=e.overflowX;"auto"!==M&&"scroll"!==M&&"auto"!==n&&"scroll"!==n&&"auto"!==o&&"scroll"!==o||t.push(i),(i.hasAttribute("data-floating-boundary")||i.classList.contains("floating-boundary")||i.classList.contains("scroll-container"))&&t.push(i),i=i.parentElement}return t.length>0?t:void 0}static calculateOptimalHeight(e,t,i){const M=t-(e.y+e.height),n=e.y;return i.startsWith("top")?Math.max(n-20,100):i.startsWith("bottom")?Math.max(M-20,100):(i.startsWith("left")||i.startsWith("right"),Math.max(Math.min(n,M)-20,100))}static extractStylesAsCSS(e){return"string"==typeof e?e:Array.isArray(e)?e.map((e=>this.extractStylesAsCSS(e))).join("\n"):e&&"object"==typeof e&&e.cssText?e.cssText:""}static generateStyleId(){return`nile-dropdown-styles-${Math.random().toString(36).substring(2,11)}`}static isPositioningOptimal(e,t){const{spaceAbove:i,spaceBelow:M,spaceLeft:n,spaceRight:o}=this.calculateAvailableSpace(t),r=e.startsWith("top"),s=e.startsWith("bottom"),a=e.startsWith("left"),l=e.startsWith("right");return!(r&&M>i)&&(!(s&&i>M)&&(!(a&&o>n)&&!(l&&n>o)))}static applyCollisionData(e,t,i){if(t.flip){const{overflows:M}=t.flip;if(e.setAttribute("data-placement",i),M&&M.length>0){const t=M.map((e=>e.placement)).join(",");e.setAttribute("data-overflow",t)}else e.removeAttribute("data-overflow")}if(t.shift){const{x:i,y:M}=t.shift;void 0===i||void 0===M||0===i&&0===M?e.removeAttribute("data-shift"):e.setAttribute("data-shift",`${i},${M}`)}if(t.size){const{availableWidth:i,availableHeight:M}=t.size;void 0!==i&&e.setAttribute("data-available-width",i.toString()),void 0!==M&&e.setAttribute("data-available-height",M.toString())}}},sn=class{static createPortalPanel(e){const t=e.shadowRoot?.querySelector(".dropdown__panel");if(!t){const t=e.querySelector("[slot]");if(!t||"trigger"===t.getAttribute("slot"))return document.createElement("div")}let i=t?.assignedElements({flatten:!0})||[];if(0===i.length){i=Array.from(e.children).filter((e=>{const t=e.getAttribute("slot");return!t||"trigger"!==t}))}const M=document.createElement("div");return M.className="dropdown__panel",M.setAttribute("part","panel"),M.setAttribute("aria-hidden","false"),M.setAttribute("aria-labelledby","dropdown"),i.forEach((e=>{const t=e.cloneNode(!0);this.processInlineEventHandlers(t),M.appendChild(t)})),M}static updatePortalPanel(e,t){if(!e)return;e.innerHTML="";const i=t.shadowRoot?.querySelector(".dropdown__panel");let M=i?.assignedElements({flatten:!0})||[];if(0===M.length){M=Array.from(t.children).filter((e=>{const t=e.getAttribute("slot");return!t||"trigger"!==t}))}M.forEach((t=>{const i=t.cloneNode(!0);this.processInlineEventHandlers(i),e.appendChild(i)}))}static processInlineEventHandlers(e){["onclick","onchange","oninput","onsubmit","onfocus","onblur","onkeydown","onkeyup"].forEach((t=>{e.removeAttribute(t),e.querySelectorAll(`[${t}]`).forEach((e=>{e.removeAttribute(t)}))}))}},an=class{static setupPortalEventListeners(e,t){e&&(this.setupMenuSelectListeners(e,t),this.setupKeyDownListeners(e,t),this.setupEventForwarding(e,t))}static setupMenuSelectListeners(e,t){e&&e.addEventListener("nile-select",(e=>{const i=e;t.handlePanelSelect&&t.handlePanelSelect(i)}))}static setupKeyDownListeners(e,t){e&&e.addEventListener("keydown",(e=>{t.handleKeyDown&&t.handleKeyDown(e)}))}static setupEventForwarding(e,t){if(!e)return;const i=t.shadowRoot?.querySelector(".dropdown__panel");if(!i)return;let M=i.assignedElements({flatten:!0})||[];if(0===M.length){M=Array.from(t.children).filter((e=>{const t=e.getAttribute("slot");return!t||"trigger"!==t}))}const n=M[0];if(!n)return;const o=t=>{const i=t.closest("nile-menu-item");if(i){const M=Array.from(e.querySelectorAll("nile-menu-item")),o=Array.from(n.querySelectorAll("nile-menu-item"))[M.indexOf(i)];if(o){if(t===i)return o;const e=t.tagName.toLowerCase(),M=Array.from(i.querySelectorAll(e)),n=Array.from(o.querySelectorAll(e)),r=M.indexOf(t);return r>=0&&n[r]?n[r]:o}}return null},r=(e,t)=>{const i=e;let M;M=i instanceof MouseEvent?new MouseEvent(e.type,{bubbles:!0,cancelable:!0,composed:!0,button:i.button,buttons:i.buttons,clientX:i.clientX,clientY:i.clientY,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,altKey:i.altKey,metaKey:i.metaKey}):i instanceof KeyboardEvent?new KeyboardEvent(e.type,{bubbles:!0,cancelable:!0,composed:!0,key:i.key,code:i.code,keyCode:i.keyCode,which:i.which,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,altKey:i.altKey,metaKey:i.metaKey}):i instanceof CustomEvent?new CustomEvent(e.type,{bubbles:!0,cancelable:!0,composed:!0,detail:i.detail}):new Event(e.type,{bubbles:!0,cancelable:!0,composed:!0}),t.dispatchEvent(M)},s=(e,t)=>{if("nile-checkbox"===e.tagName.toLowerCase()&&"nile-checkbox"===t.tagName.toLowerCase()){const i=e,M=t;"checked"in M&&"checked"in i&&(i.checked=M.checked),"indeterminate"in M&&"indeterminate"in i&&(i.indeterminate=M.indeterminate)}};["click","change","input","submit","focus","blur","keydown","keyup","mousedown","mouseup"].forEach((t=>{e.addEventListener(t,(e=>{const i=e.target;if(!i)return;const M=o(i);if(M)if("click"===t)if("nile-checkbox"===i.tagName.toLowerCase()){e.stopImmediatePropagation(),e.preventDefault();const t=M;t&&"function"==typeof t.click?(t.click(),setTimeout((()=>{s(i,M)}),10)):(r(e,M),setTimeout((()=>{s(i,M)}),10))}else e.stopImmediatePropagation(),e.preventDefault(),r(e,M);else r(e,M)}),!0)}));const a=Array.from(e.querySelectorAll("nile-checkbox")),l=Array.from(n.querySelectorAll("nile-checkbox"));a.forEach(((e,t)=>{const i=l[t];i&&i.addEventListener("nile-change",(()=>{s(e,i)}))})),e.addEventListener("nile-change",(e=>{const t=e.target;if(!t)return;const i=o(t);if(i){const M=e;if("nile-checkbox"===t.tagName.toLowerCase()&&void 0!==M.detail?.checked){t.checked=M.detail.checked}const n=new CustomEvent("nile-change",{bubbles:!0,cancelable:!0,composed:!0,detail:M.detail});i.dispatchEvent(n)}}),!0)}};class ln{constructor(e){this.portalContainer=null,this.measuredPanelHeight=null,this.clonedPanel=null,this.cleanupAutoUpdate=null,this.currentPlacement="bottom-start",this.currentMiddlewareData=null,this.boundHandleWindowResize=null,this.component=e}createPortalAppendContainer(){const e=document.createElement("div");return e.style.position="absolute",e.style.zIndex="9999",e.style.pointerEvents="none",e.style.width="auto",e.style.maxWidth="none",e.style.minWidth="auto",e.className="nile-dropdown-portal-append",e}positionPortalAppend(){this.portalContainer&&this.component.open&&(this.measurePanelHeight(),this.computeFloatingUIPosition())}measurePanelHeight(){!this.measuredPanelHeight&&this.portalContainer&&(this.portalContainer.style.position="absolute",this.portalContainer.style.visibility="hidden",this.portalContainer.style.top="0px",this.portalContainer.style.left="0px",this.portalContainer.offsetHeight,this.measuredPanelHeight=this.portalContainer.offsetHeight,this.portalContainer.style.visibility="")}async computeFloatingUIPosition(){if(!this.portalContainer)return;const e=this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component,t=this.portalContainer;try{const{x:i,y:M,placement:n,middlewareData:o}=await this.calculateFloatingUIPosition(e,t);this.applyFloatingUIPosition(t,e,i,M,n,o)}catch(e){console.warn("Floating UI positioning failed, falling back to simple positioning:",e),this.fallbackPositioning()}}async calculateFloatingUIPosition(e,t){const i=rn.findBoundaryElements(e),M=this.getInitialPlacement(),n=this.createFloatingUIMiddleware(i);return await Ji(e,t,{placement:M,strategy:"fixed",middleware:n,platform:this.createCustomPlatform()})}getInitialPlacement(){return this.component.placement||"bottom-start"}createFloatingUIMiddleware(e){const t=[Bi(this.component.distance||0)];return this.component.sync&&t.push(Fi({apply:this.handleSizeMiddleware.bind(this),padding:10,boundary:e})),t.push(_i({fallbackPlacements:this.getFallbackPlacements(),fallbackStrategy:"bestFit",padding:10,boundary:e})),t.push(Gi({padding:10,crossAxis:!0,boundary:e})),t}handleSizeMiddleware({availableWidth:e,availableHeight:t,elements:i,rects:M}){const n=rn.calculateOptimalHeight(M.reference,window.innerHeight,this.currentPlacement);"width"!==this.component.sync&&"both"!==this.component.sync||(i.floating.style.width=`${M.reference.width}px`),"height"!==this.component.sync&&"both"!==this.component.sync||(i.floating.style.height=`${M.reference.height}px`),i.floating.style.maxHeight=`${n}px`,i.floating.style.setProperty("--auto-size-available-width",`${e}px`),i.floating.style.setProperty("--auto-size-available-height",`${n}px`)}getFallbackPlacements(){const e=this.component.placement||"bottom-start",t=[];return e.startsWith("top")?t.push("bottom-start","bottom","bottom-end","top","top-end","right-start","left-start"):e.startsWith("bottom")?t.push("top-start","top","top-end","bottom","bottom-end","right-start","left-start"):e.startsWith("left")?t.push("right-start","right","right-end","left","left-end","top-start","bottom-start"):e.startsWith("right")&&t.push("left-start","left","left-end","right","right-end","top-start","bottom-start"),t}createCustomPlatform(){return Wi}applyFloatingUIPosition(e,t,i,M,n,o){const r=t.getBoundingClientRect();Object.assign(e.style,{left:`${i}px`,top:`${M}px`,position:"fixed",pointerEvents:"auto",width:"auto",minWidth:"auto"}),"width"!==this.component.sync&&"both"!==this.component.sync||(e.style.width=`${r.width}px`),this.currentPlacement=n,this.currentMiddlewareData=o,rn.applyCollisionData(e,o,n);const s=n.split("-")[0];e.className=`nile-dropdown-portal-append dropdown--open dropdown__panel--${s}`}fallbackPositioning(){if(!this.portalContainer)return;const e=(this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component).getBoundingClientRect(),t=window.innerHeight,i=window.innerWidth,M=t-e.bottom,n=e.top,o=i-e.right,r=e.left;let s,a,l,N=e.left;const g=this.component.placement||"bottom-start";g.startsWith("bottom")?(l=Math.max(M-20,100),s=e.bottom+(this.component.distance||0),a="bottom"):g.startsWith("top")?(l=Math.max(n-20,100),s=Math.max(e.top-l-(this.component.distance||0),10),a="top"):g.startsWith("right")?(l=Math.max(Math.min(o,M,n)-20,100),s=e.top,N=e.right+(this.component.distance||0),a="right"):(l=Math.max(Math.min(r,M,n)-20,100),s=e.top,N=Math.max(e.left-200-(this.component.distance||0),10),a="left"),this.portalContainer.style.left=`${N}px`,this.portalContainer.style.top=`${s}px`,this.portalContainer.style.maxHeight=`${l}px`,this.portalContainer.style.pointerEvents="auto",this.portalContainer.style.width="auto",this.portalContainer.style.minWidth="auto","width"!==this.component.sync&&"both"!==this.component.sync||(this.portalContainer.style.width=`${e.width}px`),this.portalContainer.className=`nile-dropdown-portal-append dropdown__panel--${a}`,this.calculateAndSetAutoSizeProperties(e,s,a)}calculateAndSetAutoSizeProperties(e,t,i){if(!this.portalContainer)return;const M=window.innerHeight,n=window.innerWidth;let o,r=n-e.left-10;"top"===i?o=e.top-10:"bottom"===i?o=M-e.bottom-10:"left"===i?(o=Math.min(M-e.top,e.bottom),r=e.left-10):(o=Math.min(M-e.top,e.bottom),r=n-e.right-10),this.portalContainer.style.setProperty("--auto-size-available-height",`${Math.max(o,100)}px`),this.portalContainer.style.setProperty("--auto-size-available-width",`${Math.max(r,200)}px`)}updatePortalAppendPosition(){this.component.portal&&this.portalContainer&&this.positionPortalAppend()}handleWindowResize(){this.component.portal&&this.portalContainer&&this.positionPortalAppend()}setupAutoUpdatePositioning(){if(!this.portalContainer||!this.component)return;this.cleanupAutoUpdatePositioning();const e=this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component;this.cleanupAutoUpdate=Ri(e,this.portalContainer,(()=>{this.computeFloatingUIPosition()}),{ancestorScroll:!0,ancestorResize:!0,elementResize:!0,layoutShift:!0,animationFrame:!0})}cleanupAutoUpdatePositioning(){this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null)}injectStylesToDocument(){if(!this.portalContainer)return;const e=rn.generateStyleId();if(document.getElementById(e))return;const t=this.component.constructor.styles;if(!t)return;const i=document.createElement("style");i.id=e,i.textContent=rn.extractStylesAsCSS(t),document.head.appendChild(i),this.portalContainer.__injectedStyleId=e}adoptStylesToPortalAppend(){this.portalContainer&&this.injectStylesToDocument()}setupPortalAppend(){this.component.portal&&this.component.updateComplete.then((()=>{setTimeout((()=>{this.component.open&&(this.clonedPanel=this.createPortalPanel(),this.portalContainer=this.createPortalAppendContainer(),this.portalContainer.appendChild(this.clonedPanel),document.body.appendChild(this.portalContainer),this.adoptStylesToPortalAppend(),this.clonedPanel.style.display="",this.positionPortalAppend(),this.setupPortalEventListeners(),this.setupAutoUpdatePositioning(),this.boundHandleWindowResize=this.handleWindowResize.bind(this),window.addEventListener("resize",this.boundHandleWindowResize))}),10)}))}createPortalPanel(){return sn.createPortalPanel(this.component)}setupPortalEventListeners(){an.setupPortalEventListeners(this.clonedPanel,this.component)}cleanupPortalAppend(){if(this.cleanupAutoUpdatePositioning(),this.portalContainer&&this.portalContainer.parentNode){const e=this.portalContainer.__injectedStyleId;if(e){const t=document.getElementById(e);t&&t.remove()}this.portalContainer.parentNode.removeChild(this.portalContainer)}this.boundHandleWindowResize&&(window.removeEventListener("resize",this.boundHandleWindowResize),this.boundHandleWindowResize=null),this.portalContainer=null,this.clonedPanel=null,this.measuredPanelHeight=null,this.currentPlacement="bottom-start",this.currentMiddlewareData=null}get portalContainerElement(){return this.portalContainer}resetMeasuredHeight(){this.measuredPanelHeight=null}forceReposition(){this.portalContainer&&this.computeFloatingUIPosition()}getCurrentPlacement(){return this.currentPlacement}getCurrentMiddlewareData(){return this.currentMiddlewareData}isUsingFloatingUI(){return null!==this.cleanupAutoUpdate}isPositioningOptimal(){if(!this.portalContainer||!this.currentMiddlewareData)return!0;const e=(this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component).getBoundingClientRect(),t=window.innerHeight-e.bottom,i=e.top,M=this.currentPlacement.startsWith("top"),n=this.currentPlacement.startsWith("bottom");return!(M&&t>i)&&!(n&&i>t)}updatePortalPanel(){this.portalContainer&&this.clonedPanel&&(sn.updatePortalPanel(this.clonedPanel,this.component),this.setupPortalEventListeners(),this.forceReposition())}}let Nn=class extends Re{constructor(){super(...arguments),this.open=!1,this.placement="bottom-start",this.disabled=!1,this.stayOpenOnSelect=!1,this.distance=0,this.noOpenOnClick=!1,this.skidding=0,this.hoist=!1,this.portal=!1,this.enableVisibilityEffect=!1,this.enableTabClose=!1,this.portalManager=null}connectedCallback(){super.connectedCallback(),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.containingElement||(this.containingElement=this),this.emit("nile-init"),requestAnimationFrame((()=>{this.portal&&!this.portalManager&&(this.portalManager=new ln(this))}))}async firstUpdated(e){this.panel.hidden=!this.open,this.open&&(this.addOpenListeners(),this.popup.active=!0),await this.updateComplete;const t=this.trigger.assignedElements({flatten:!0})[0];this.visibilityManager=new tM({host:this,target:t||null,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:()=>this.open,onAnchorOutOfView:()=>{this.hide(),this.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"})},onDocumentHidden:()=>{this.hide(),this.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"})},emit:(e,t)=>this.emit(`nile-${e}`,t)})}disconnectedCallback(){super.disconnectedCallback(),this.visibilityManager?.cleanup(),this.removeOpenListeners(),this.hide(),this.emit("nile-destroy"),this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null)}focusOnTrigger(){const e=this.trigger.assignedElements({flatten:!0})[0];"function"==typeof e?.focus&&e.focus()}getMenu(){return this.panel.assignedElements({flatten:!0}).find((e=>"nile-menu"===e.tagName.toLowerCase()))}handleKeyDown(e){this.open&&"Escape"===e.key&&(e.stopPropagation(),this.hide(),this.focusOnTrigger())}handleDocumentKeyDown(e){if("Escape"===e.key&&this.open)return e.stopPropagation(),this.focusOnTrigger(),void this.hide();if("Tab"===e.key){if(this.open&&"nile-menu-item"===document.activeElement?.tagName.toLowerCase())return e.preventDefault(),this.hide(),void this.focusOnTrigger();setTimeout((()=>{const e=this.containingElement?.getRootNode()instanceof ShadowRoot?document.activeElement?.shadowRoot?.activeElement:document.activeElement,t=this.containingElement&&e?.closest(this.containingElement.tagName.toLowerCase())===this.containingElement,i=this.portal&&this.portalManager?.portalContainerElement&&(e===this.portalManager.portalContainerElement||e?.closest(".nile-dropdown-portal-append")===this.portalManager.portalContainerElement);t||i||this.hide()}))}}handleDocumentMouseDown(e){const t=e.composedPath(),i=this.containingElement&&t.includes(this.containingElement),M=this.portal&&this.portalManager?.portalContainerElement&&t.includes(this.portalManager.portalContainerElement);i||M||this.hide()}handlePanelSelect(e){const t=e.target;this.stayOpenOnSelect||"nile-menu"!==t.tagName.toLowerCase()?this.stayOpenOnSelect&&"nile-menu"===t.tagName.toLowerCase()&&(this.show(),this.focusOnTrigger()):(this.hide(),this.focusOnTrigger())}handleTriggerClick(){this.noOpenOnClick||(this.open?this.hide():(this.show(),this.focusOnTrigger()))}handleTriggerKeyDown(e){const t=this.getMenu();if(t){const i=t.getAllItems(),M=i[0],n=i[i.length-1];["ArrowDown","ArrowUp","Home","End"].includes(e.key)&&(e.preventDefault(),this.open||this.show(),i.length>0&&this.updateComplete.then((()=>{"ArrowDown"!==e.key&&"Home"!==e.key||(t.setCurrentItem(M),M.focus()),"ArrowUp"!==e.key&&"End"!==e.key||(t.setCurrentItem(n),n.focus())})))}}handleTriggerKeyUp(e){" "===e.key&&e.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}updateAccessibleTrigger(){const e=this.trigger.assignedElements({flatten:!0}).find((e=>Et(e).start));let t;if(e){switch(e.tagName.toLowerCase()){case"nile-button":case"nile-icon-button":t=e.button;break;default:t=e}t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded",this.open?"true":"false")}}async show(){if(!this.open)return this.open=!0,St(this,"nile-after-show")}async hide(){if(this.open)return this.open=!1,St(this,"nile-after-hide")}reposition(){this.popup.reposition()}addOpenListeners(){this.panel.addEventListener("nile-select",this.handlePanelSelect),this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){this.panel&&(this.panel.removeEventListener("nile-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}updated(e){super.updated(e),e.has("portal")&&(this.portal&&!this.portalManager?(this.portalManager=new ln(this),this.open&&this.portalManager.setupPortalAppend()):!this.portal&&this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null))}async handleOpenChange(){if(this.visibilityManager?.setup(),this.disabled)this.open=!1;else if(this.updateAccessibleTrigger(),this.open){if(this.emit("nile-show"),this.addOpenListeners(),this.portal&&this.portalManager?this.portalManager.setupPortalAppend():this.portal&&!this.portalManager&&(this.portalManager=new ln(this),this.portalManager.setupPortalAppend()),await jt(this),!this.portal){this.panel.hidden=!1,this.popup.active=!0;const{keyframes:e,options:t}=yt(this,"dropdown.show",{dir:""});await ut(this.popup.popup,e,t)}this.emit("nile-after-show")}else{if(this.emit("nile-hide"),this.removeOpenListeners(),this.visibilityManager?.cleanup(),this.portal&&this.portalManager&&this.portalManager.cleanupPortalAppend(),await jt(this),!this.portal){const{keyframes:e,options:t}=yt(this,"dropdown.hide",{dir:""});await ut(this.popup.popup,e,t),this.panel.hidden=!0,this.popup.active=!1}this.emit("nile-after-hide")}}render(){return R`
|
|
5764
|
+
`;let rn=class{static calculateAvailableSpace(e){const t=e.getBoundingClientRect(),i=window.innerHeight,M=window.innerWidth,n=i-t.bottom,o=t.top,r=M-t.right;return{spaceAbove:o,spaceBelow:n,spaceLeft:t.left,spaceRight:r,viewportHeight:i,viewportWidth:M}}static getOptimalPlacement(e){const{spaceAbove:t,spaceBelow:i,spaceLeft:M,spaceRight:n}=this.calculateAvailableSpace(e);return i>=200&&i>=t?"bottom":t>=200&&t>i?"top":n>=200&&n>=M?"right":M>=200?"left":"bottom"}static findBoundaryElements(e){const t=[];let i=e.parentElement;for(;i&&i!==document.body;){const e=window.getComputedStyle(i),M=e.overflow,n=e.overflowY,o=e.overflowX;"auto"!==M&&"scroll"!==M&&"auto"!==n&&"scroll"!==n&&"auto"!==o&&"scroll"!==o||t.push(i),(i.hasAttribute("data-floating-boundary")||i.classList.contains("floating-boundary")||i.classList.contains("scroll-container"))&&t.push(i),i=i.parentElement}return t.length>0?t:void 0}static calculateOptimalHeight(e,t,i){const M=t-(e.y+e.height),n=e.y;return i.startsWith("top")?Math.max(n-20,100):i.startsWith("bottom")?Math.max(M-20,100):(i.startsWith("left")||i.startsWith("right"),Math.max(Math.min(n,M)-20,100))}static extractStylesAsCSS(e){return"string"==typeof e?e:Array.isArray(e)?e.map((e=>this.extractStylesAsCSS(e))).join("\n"):e&&"object"==typeof e&&e.cssText?e.cssText:""}static generateStyleId(){return`nile-dropdown-styles-${Math.random().toString(36).substring(2,11)}`}static isPositioningOptimal(e,t){const{spaceAbove:i,spaceBelow:M,spaceLeft:n,spaceRight:o}=this.calculateAvailableSpace(t),r=e.startsWith("top"),s=e.startsWith("bottom"),a=e.startsWith("left"),l=e.startsWith("right");return!(r&&M>i)&&(!(s&&i>M)&&(!(a&&o>n)&&!(l&&n>o)))}static applyCollisionData(e,t,i){if(t.flip){const{overflows:M}=t.flip;if(e.setAttribute("data-placement",i),M&&M.length>0){const t=M.map((e=>e.placement)).join(",");e.setAttribute("data-overflow",t)}else e.removeAttribute("data-overflow")}if(t.shift){const{x:i,y:M}=t.shift;void 0===i||void 0===M||0===i&&0===M?e.removeAttribute("data-shift"):e.setAttribute("data-shift",`${i},${M}`)}if(t.size){const{availableWidth:i,availableHeight:M}=t.size;void 0!==i&&e.setAttribute("data-available-width",i.toString()),void 0!==M&&e.setAttribute("data-available-height",M.toString())}}},sn=class{static createPortalPanel(e){const t=e.shadowRoot?.querySelector(".dropdown__panel");if(!t){const t=e.querySelector("[slot]");if(!t||"trigger"===t.getAttribute("slot"))return document.createElement("div")}let i=t?.assignedElements({flatten:!0})||[];if(0===i.length){i=Array.from(e.children).filter((e=>{const t=e.getAttribute("slot");return!t||"trigger"!==t}))}const M=document.createElement("div");return M.className="dropdown__panel",M.setAttribute("part","panel"),M.setAttribute("aria-hidden","false"),M.setAttribute("aria-labelledby","dropdown"),i.forEach((e=>{const t=e.cloneNode(!0);this.processInlineEventHandlers(t),M.appendChild(t)})),M}static updatePortalPanel(e,t){if(!e)return;e.innerHTML="";const i=t.shadowRoot?.querySelector(".dropdown__panel");let M=i?.assignedElements({flatten:!0})||[];if(0===M.length){M=Array.from(t.children).filter((e=>{const t=e.getAttribute("slot");return!t||"trigger"!==t}))}M.forEach((t=>{const i=t.cloneNode(!0);this.processInlineEventHandlers(i),e.appendChild(i)}))}static processInlineEventHandlers(e){["onclick","onchange","oninput","onsubmit","onfocus","onblur","onkeydown","onkeyup"].forEach((t=>{e.removeAttribute(t),e.querySelectorAll(`[${t}]`).forEach((e=>{e.removeAttribute(t)}))}))}},an=class{static setupPortalEventListeners(e,t){e&&(this.setupMenuSelectListeners(e,t),this.setupKeyDownListeners(e,t),this.setupEventForwarding(e,t))}static setupMenuSelectListeners(e,t){e&&e.addEventListener("nile-select",(e=>{const i=e;t.handlePanelSelect&&t.handlePanelSelect(i)}))}static setupKeyDownListeners(e,t){e&&e.addEventListener("keydown",(e=>{t.handleKeyDown&&t.handleKeyDown(e)}))}static setupEventForwarding(e,t){if(!e)return;const i=t.shadowRoot?.querySelector(".dropdown__panel");if(!i)return;let M=i.assignedElements({flatten:!0})||[];if(0===M.length){M=Array.from(t.children).filter((e=>{const t=e.getAttribute("slot");return!t||"trigger"!==t}))}const n=M[0];if(!n)return;const o=t=>{const i=t.closest("nile-menu-item");if(i){const M=Array.from(e.querySelectorAll("nile-menu-item")),o=Array.from(n.querySelectorAll("nile-menu-item"))[M.indexOf(i)];if(o){if(t===i)return o;const e=t.tagName.toLowerCase(),M=Array.from(i.querySelectorAll(e)),n=Array.from(o.querySelectorAll(e)),r=M.indexOf(t);return r>=0&&n[r]?n[r]:o}}return null},r=(e,t)=>{const i=e;let M;M=i instanceof MouseEvent?new MouseEvent(e.type,{bubbles:!0,cancelable:!0,composed:!0,button:i.button,buttons:i.buttons,clientX:i.clientX,clientY:i.clientY,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,altKey:i.altKey,metaKey:i.metaKey}):i instanceof KeyboardEvent?new KeyboardEvent(e.type,{bubbles:!0,cancelable:!0,composed:!0,key:i.key,code:i.code,keyCode:i.keyCode,which:i.which,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,altKey:i.altKey,metaKey:i.metaKey}):i instanceof CustomEvent?new CustomEvent(e.type,{bubbles:!0,cancelable:!0,composed:!0,detail:i.detail}):new Event(e.type,{bubbles:!0,cancelable:!0,composed:!0}),t.dispatchEvent(M)},s=(e,t)=>{if("nile-checkbox"===e.tagName.toLowerCase()&&"nile-checkbox"===t.tagName.toLowerCase()){const i=e,M=t;"checked"in M&&"checked"in i&&(i.checked=M.checked),"indeterminate"in M&&"indeterminate"in i&&(i.indeterminate=M.indeterminate)}};["click","change","input","submit","focus","blur","keydown","keyup","mousedown","mouseup"].forEach((t=>{e.addEventListener(t,(e=>{const i=e.target;if(!i)return;const M=o(i);if(M)if("click"===t)if("nile-checkbox"===i.tagName.toLowerCase()){e.stopImmediatePropagation(),e.preventDefault();const t=M;t&&"function"==typeof t.click?(t.click(),setTimeout((()=>{s(i,M)}),10)):(r(e,M),setTimeout((()=>{s(i,M)}),10))}else e.stopImmediatePropagation(),e.preventDefault(),r(e,M);else r(e,M)}),!0)}));const a=Array.from(e.querySelectorAll("nile-checkbox")),l=Array.from(n.querySelectorAll("nile-checkbox"));a.forEach(((e,t)=>{const i=l[t];i&&i.addEventListener("nile-change",(()=>{s(e,i)}))})),e.addEventListener("nile-change",(e=>{const t=e.target;if(!t)return;const i=o(t);if(i){const M=e;if("nile-checkbox"===t.tagName.toLowerCase()&&void 0!==M.detail?.checked){t.checked=M.detail.checked}const n=new CustomEvent("nile-change",{bubbles:!0,cancelable:!0,composed:!0,detail:M.detail});i.dispatchEvent(n)}}),!0)}},ln=class{constructor(e){this.portalContainer=null,this.measuredPanelHeight=null,this.clonedPanel=null,this.cleanupAutoUpdate=null,this.currentPlacement="bottom-start",this.currentMiddlewareData=null,this.boundHandleWindowResize=null,this.component=e}createPortalAppendContainer(){const e=document.createElement("div");return e.style.position="absolute",e.style.zIndex="9999",e.style.pointerEvents="none",e.style.width="auto",e.style.maxWidth="none",e.style.minWidth="auto",e.className="nile-dropdown-portal-append",e}positionPortalAppend(){this.portalContainer&&this.component.open&&(this.measurePanelHeight(),this.computeFloatingUIPosition())}measurePanelHeight(){!this.measuredPanelHeight&&this.portalContainer&&(this.portalContainer.style.position="absolute",this.portalContainer.style.visibility="hidden",this.portalContainer.style.top="0px",this.portalContainer.style.left="0px",this.portalContainer.offsetHeight,this.measuredPanelHeight=this.portalContainer.offsetHeight,this.portalContainer.style.visibility="")}async computeFloatingUIPosition(){if(!this.portalContainer)return;const e=this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component,t=this.portalContainer;try{const{x:i,y:M,placement:n,middlewareData:o}=await this.calculateFloatingUIPosition(e,t);this.applyFloatingUIPosition(t,e,i,M,n,o)}catch(e){console.warn("Floating UI positioning failed, falling back to simple positioning:",e),this.fallbackPositioning()}}async calculateFloatingUIPosition(e,t){const i=rn.findBoundaryElements(e),M=this.getInitialPlacement(),n=this.createFloatingUIMiddleware(i);return await Ji(e,t,{placement:M,strategy:"fixed",middleware:n,platform:this.createCustomPlatform()})}getInitialPlacement(){return this.component.placement||"bottom-start"}createFloatingUIMiddleware(e){const t=[Bi(this.component.distance||0)];return this.component.sync&&t.push(Fi({apply:this.handleSizeMiddleware.bind(this),padding:10,boundary:e})),t.push(_i({fallbackPlacements:this.getFallbackPlacements(),fallbackStrategy:"bestFit",padding:10,boundary:e})),t.push(Gi({padding:10,crossAxis:!0,boundary:e})),t}handleSizeMiddleware({availableWidth:e,availableHeight:t,elements:i,rects:M}){const n=rn.calculateOptimalHeight(M.reference,window.innerHeight,this.currentPlacement);"width"!==this.component.sync&&"both"!==this.component.sync||(i.floating.style.width=`${M.reference.width}px`),"height"!==this.component.sync&&"both"!==this.component.sync||(i.floating.style.height=`${M.reference.height}px`),i.floating.style.maxHeight=`${n}px`,i.floating.style.setProperty("--auto-size-available-width",`${e}px`),i.floating.style.setProperty("--auto-size-available-height",`${n}px`)}getFallbackPlacements(){const e=this.component.placement||"bottom-start",t=[];return e.startsWith("top")?t.push("bottom-start","bottom","bottom-end","top","top-end","right-start","left-start"):e.startsWith("bottom")?t.push("top-start","top","top-end","bottom","bottom-end","right-start","left-start"):e.startsWith("left")?t.push("right-start","right","right-end","left","left-end","top-start","bottom-start"):e.startsWith("right")&&t.push("left-start","left","left-end","right","right-end","top-start","bottom-start"),t}createCustomPlatform(){return Wi}applyFloatingUIPosition(e,t,i,M,n,o){const r=t.getBoundingClientRect();Object.assign(e.style,{left:`${i}px`,top:`${M}px`,position:"fixed",pointerEvents:"auto",width:"auto",minWidth:"auto"}),"width"!==this.component.sync&&"both"!==this.component.sync||(e.style.width=`${r.width}px`),this.currentPlacement=n,this.currentMiddlewareData=o,rn.applyCollisionData(e,o,n);const s=n.split("-")[0];e.className=`nile-dropdown-portal-append dropdown--open dropdown__panel--${s}`}fallbackPositioning(){if(!this.portalContainer)return;const e=(this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component).getBoundingClientRect(),t=window.innerHeight,i=window.innerWidth,M=t-e.bottom,n=e.top,o=i-e.right,r=e.left;let s,a,l,N=e.left;const g=this.component.placement||"bottom-start";g.startsWith("bottom")?(l=Math.max(M-20,100),s=e.bottom+(this.component.distance||0),a="bottom"):g.startsWith("top")?(l=Math.max(n-20,100),s=Math.max(e.top-l-(this.component.distance||0),10),a="top"):g.startsWith("right")?(l=Math.max(Math.min(o,M,n)-20,100),s=e.top,N=e.right+(this.component.distance||0),a="right"):(l=Math.max(Math.min(r,M,n)-20,100),s=e.top,N=Math.max(e.left-200-(this.component.distance||0),10),a="left"),this.portalContainer.style.left=`${N}px`,this.portalContainer.style.top=`${s}px`,this.portalContainer.style.maxHeight=`${l}px`,this.portalContainer.style.pointerEvents="auto",this.portalContainer.style.width="auto",this.portalContainer.style.minWidth="auto","width"!==this.component.sync&&"both"!==this.component.sync||(this.portalContainer.style.width=`${e.width}px`),this.portalContainer.className=`nile-dropdown-portal-append dropdown__panel--${a}`,this.calculateAndSetAutoSizeProperties(e,s,a)}calculateAndSetAutoSizeProperties(e,t,i){if(!this.portalContainer)return;const M=window.innerHeight,n=window.innerWidth;let o,r=n-e.left-10;"top"===i?o=e.top-10:"bottom"===i?o=M-e.bottom-10:"left"===i?(o=Math.min(M-e.top,e.bottom),r=e.left-10):(o=Math.min(M-e.top,e.bottom),r=n-e.right-10),this.portalContainer.style.setProperty("--auto-size-available-height",`${Math.max(o,100)}px`),this.portalContainer.style.setProperty("--auto-size-available-width",`${Math.max(r,200)}px`)}updatePortalAppendPosition(){this.component.portal&&this.portalContainer&&this.positionPortalAppend()}handleWindowResize(){this.component.portal&&this.portalContainer&&this.positionPortalAppend()}setupAutoUpdatePositioning(){if(!this.portalContainer||!this.component)return;this.cleanupAutoUpdatePositioning();const e=this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component;this.cleanupAutoUpdate=Ri(e,this.portalContainer,(()=>{this.computeFloatingUIPosition()}),{ancestorScroll:!0,ancestorResize:!0,elementResize:!0,layoutShift:!0,animationFrame:!0})}cleanupAutoUpdatePositioning(){this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null)}injectStylesToDocument(){if(!this.portalContainer)return;const e=rn.generateStyleId();if(document.getElementById(e))return;const t=this.component.constructor.styles;if(!t)return;const i=document.createElement("style");i.id=e,i.textContent=rn.extractStylesAsCSS(t),document.head.appendChild(i),this.portalContainer.__injectedStyleId=e}adoptStylesToPortalAppend(){this.portalContainer&&this.injectStylesToDocument()}setupPortalAppend(){this.component.portal&&this.component.updateComplete.then((()=>{setTimeout((()=>{this.component.open&&(this.clonedPanel=this.createPortalPanel(),this.portalContainer=this.createPortalAppendContainer(),this.portalContainer.appendChild(this.clonedPanel),document.body.appendChild(this.portalContainer),this.adoptStylesToPortalAppend(),this.clonedPanel.style.display="",this.positionPortalAppend(),this.setupPortalEventListeners(),this.setupAutoUpdatePositioning(),this.boundHandleWindowResize=this.handleWindowResize.bind(this),window.addEventListener("resize",this.boundHandleWindowResize))}),10)}))}createPortalPanel(){return sn.createPortalPanel(this.component)}setupPortalEventListeners(){an.setupPortalEventListeners(this.clonedPanel,this.component)}cleanupPortalAppend(){if(this.cleanupAutoUpdatePositioning(),this.portalContainer&&this.portalContainer.parentNode){const e=this.portalContainer.__injectedStyleId;if(e){const t=document.getElementById(e);t&&t.remove()}this.portalContainer.parentNode.removeChild(this.portalContainer)}this.boundHandleWindowResize&&(window.removeEventListener("resize",this.boundHandleWindowResize),this.boundHandleWindowResize=null),this.portalContainer=null,this.clonedPanel=null,this.measuredPanelHeight=null,this.currentPlacement="bottom-start",this.currentMiddlewareData=null}get portalContainerElement(){return this.portalContainer}resetMeasuredHeight(){this.measuredPanelHeight=null}forceReposition(){this.portalContainer&&this.computeFloatingUIPosition()}getCurrentPlacement(){return this.currentPlacement}getCurrentMiddlewareData(){return this.currentMiddlewareData}isUsingFloatingUI(){return null!==this.cleanupAutoUpdate}isPositioningOptimal(){if(!this.portalContainer||!this.currentMiddlewareData)return!0;const e=(this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component).getBoundingClientRect(),t=window.innerHeight-e.bottom,i=e.top,M=this.currentPlacement.startsWith("top"),n=this.currentPlacement.startsWith("bottom");return!(M&&t>i)&&!(n&&i>t)}updatePortalPanel(){this.portalContainer&&this.clonedPanel&&(sn.updatePortalPanel(this.clonedPanel,this.component),this.setupPortalEventListeners(),this.forceReposition())}},Nn=class extends Re{constructor(){super(...arguments),this.open=!1,this.placement="bottom-start",this.disabled=!1,this.stayOpenOnSelect=!1,this.distance=0,this.noOpenOnClick=!1,this.skidding=0,this.hoist=!1,this.portal=!1,this.enableVisibilityEffect=!1,this.enableTabClose=!1,this.portalManager=null}connectedCallback(){super.connectedCallback(),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.containingElement||(this.containingElement=this),this.emit("nile-init"),requestAnimationFrame((()=>{this.portal&&!this.portalManager&&(this.portalManager=new ln(this))}))}async firstUpdated(e){this.panel.hidden=!this.open,this.open&&(this.addOpenListeners(),this.popup.active=!0),await this.updateComplete;const t=this.trigger.assignedElements({flatten:!0})[0];this.visibilityManager=new tM({host:this,target:t||null,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:()=>this.open,onAnchorOutOfView:()=>{this.hide(),this.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"})},onDocumentHidden:()=>{this.hide(),this.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"})},emit:(e,t)=>this.emit(`nile-${e}`,t)})}disconnectedCallback(){super.disconnectedCallback(),this.visibilityManager?.cleanup(),this.removeOpenListeners(),this.hide(),this.emit("nile-destroy"),this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null)}focusOnTrigger(){const e=this.trigger.assignedElements({flatten:!0})[0];"function"==typeof e?.focus&&e.focus()}getMenu(){return this.panel.assignedElements({flatten:!0}).find((e=>"nile-menu"===e.tagName.toLowerCase()))}handleKeyDown(e){this.open&&"Escape"===e.key&&(e.stopPropagation(),this.hide(),this.focusOnTrigger())}handleDocumentKeyDown(e){if("Escape"===e.key&&this.open)return e.stopPropagation(),this.focusOnTrigger(),void this.hide();if("Tab"===e.key){if(this.open&&"nile-menu-item"===document.activeElement?.tagName.toLowerCase())return e.preventDefault(),this.hide(),void this.focusOnTrigger();setTimeout((()=>{const e=this.containingElement?.getRootNode()instanceof ShadowRoot?document.activeElement?.shadowRoot?.activeElement:document.activeElement,t=this.containingElement&&e?.closest(this.containingElement.tagName.toLowerCase())===this.containingElement,i=this.portal&&this.portalManager?.portalContainerElement&&(e===this.portalManager.portalContainerElement||e?.closest(".nile-dropdown-portal-append")===this.portalManager.portalContainerElement);t||i||this.hide()}))}}handleDocumentMouseDown(e){const t=e.composedPath(),i=this.containingElement&&t.includes(this.containingElement),M=this.portal&&this.portalManager?.portalContainerElement&&t.includes(this.portalManager.portalContainerElement);i||M||this.hide()}handlePanelSelect(e){const t=e.target;this.stayOpenOnSelect||"nile-menu"!==t.tagName.toLowerCase()?this.stayOpenOnSelect&&"nile-menu"===t.tagName.toLowerCase()&&(this.show(),this.focusOnTrigger()):(this.hide(),this.focusOnTrigger())}handleTriggerClick(){this.noOpenOnClick||(this.open?this.hide():(this.show(),this.focusOnTrigger()))}handleTriggerKeyDown(e){const t=this.getMenu();if(t){const i=t.getAllItems(),M=i[0],n=i[i.length-1];["ArrowDown","ArrowUp","Home","End"].includes(e.key)&&(e.preventDefault(),this.open||this.show(),i.length>0&&this.updateComplete.then((()=>{"ArrowDown"!==e.key&&"Home"!==e.key||(t.setCurrentItem(M),M.focus()),"ArrowUp"!==e.key&&"End"!==e.key||(t.setCurrentItem(n),n.focus())})))}}handleTriggerKeyUp(e){" "===e.key&&e.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}updateAccessibleTrigger(){const e=this.trigger.assignedElements({flatten:!0}).find((e=>Et(e).start));let t;if(e){switch(e.tagName.toLowerCase()){case"nile-button":case"nile-icon-button":t=e.button;break;default:t=e}t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded",this.open?"true":"false")}}async show(){if(!this.open)return this.open=!0,St(this,"nile-after-show")}async hide(){if(this.open)return this.open=!1,St(this,"nile-after-hide")}reposition(){this.popup.reposition()}addOpenListeners(){this.panel.addEventListener("nile-select",this.handlePanelSelect),this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){this.panel&&(this.panel.removeEventListener("nile-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}updated(e){super.updated(e),e.has("portal")&&(this.portal&&!this.portalManager?(this.portalManager=new ln(this),this.open&&this.portalManager.setupPortalAppend()):!this.portal&&this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null))}async handleOpenChange(){if(this.visibilityManager?.setup(),this.disabled)this.open=!1;else if(this.updateAccessibleTrigger(),this.open){if(this.emit("nile-show"),this.addOpenListeners(),this.portal&&this.portalManager?this.portalManager.setupPortalAppend():this.portal&&!this.portalManager&&(this.portalManager=new ln(this),this.portalManager.setupPortalAppend()),await jt(this),!this.portal){this.panel.hidden=!1,this.popup.active=!0;const{keyframes:e,options:t}=yt(this,"dropdown.show",{dir:""});await ut(this.popup.popup,e,t)}this.emit("nile-after-show")}else{if(this.emit("nile-hide"),this.removeOpenListeners(),this.visibilityManager?.cleanup(),this.portal&&this.portalManager&&this.portalManager.cleanupPortalAppend(),await jt(this),!this.portal){const{keyframes:e,options:t}=yt(this,"dropdown.hide",{dir:""});await ut(this.popup.popup,e,t),this.panel.hidden=!0,this.popup.active=!1}this.emit("nile-after-hide")}}render(){return R`
|
|
5752
5765
|
<nile-popup
|
|
5753
5766
|
part="base"
|
|
5754
5767
|
id="dropdown"
|
|
@@ -9786,7 +9799,7 @@ function*(e,t){if(void 0!==e){let i=0;for(const M of e)yield t(M,i++)}}
|
|
|
9786
9799
|
border: solid 1px var(--nile-colors-dark-200, var(--ng-colors-border-secondary-alt));
|
|
9787
9800
|
box-shadow: var(--nile-box-shadow-2, var(--ng-shadow-lg));
|
|
9788
9801
|
}
|
|
9789
|
-
`;class wp{static calculateAvailableSpace(e){const t=e.getBoundingClientRect(),i=window.innerHeight,M=window.innerWidth,n=i-t.bottom,o=t.top,r=M-t.right;return{spaceAbove:o,spaceBelow:n,spaceLeft:t.left,spaceRight:r,viewportHeight:i,viewportWidth:M}}static getOptimalPlacement(e){const{spaceAbove:t,spaceBelow:i,spaceLeft:M,spaceRight:n}=this.calculateAvailableSpace(e);return i>=200&&i>=t?"bottom":t>=200&&t>i?"top":n>=200&&n>=M?"right":M>=200?"left":"bottom"}static findBoundaryElements(e){const t=[];let i=e.parentElement;for(;i&&i!==document.body;){const e=window.getComputedStyle(i),M=e.overflow,n=e.overflowY,o=e.overflowX;"auto"!==M&&"scroll"!==M&&"auto"!==n&&"scroll"!==n&&"auto"!==o&&"scroll"!==o||t.push(i),(i.hasAttribute("data-floating-boundary")||i.classList.contains("floating-boundary")||i.classList.contains("scroll-container"))&&t.push(i),i=i.parentElement}return t.length>0?t:void 0}static calculateOptimalHeight(e,t,i){const M=t-(e.y+e.height),n=e.y;return i.startsWith("top")?Math.max(n-20,100):i.startsWith("bottom")?Math.max(M-20,100):(i.startsWith("left")||i.startsWith("right"),Math.max(Math.min(n,M)-20,100))}static extractStylesAsCSS(e){return"string"==typeof e?e:Array.isArray(e)?e.map((e=>this.extractStylesAsCSS(e))).join("\n"):e&&"object"==typeof e&&e.cssText?e.cssText:""}static generateStyleId(){return`nile-popover-styles-${Math.random().toString(36).substring(2,11)}`}static isPositioningOptimal(e,t){const{spaceAbove:i,spaceBelow:M,spaceLeft:n,spaceRight:o}=this.calculateAvailableSpace(t),r=e.startsWith("top"),s=e.startsWith("bottom"),a=e.startsWith("left"),l=e.startsWith("right");return!(r&&M>i)&&(!(s&&i>M)&&(!(a&&o>n)&&!(l&&n>o)))}static applyCollisionData(e,t,i){if(t.flip){const{overflows:M}=t.flip;if(e.setAttribute("data-placement",i),M&&M.length>0){const t=M.map((e=>e.placement)).join(",");e.setAttribute("data-overflow",t)}else e.removeAttribute("data-overflow")}if(t.shift){const{x:i,y:M}=t.shift;void 0===i||void 0===M||0===i&&0===M?e.removeAttribute("data-shift"):e.setAttribute("data-shift",`${i},${M}`)}if(t.size){const{availableWidth:i,availableHeight:M}=t.size;void 0!==i&&e.setAttribute("data-available-width",i.toString()),void 0!==M&&e.setAttribute("data-available-height",M.toString())}}}class Qp{static createBasePopover(e){const t=document.createElement("div");return t.className="popover__box",t.setAttribute("part","popover"),t}static addTitleSection(e,t){if(!t.title)return;const i=document.createElement("div");i.className="popover__title",i.textContent=t.title,e.appendChild(i)}static addContentSection(e,t){const i=document.createElement("div");i.setAttribute("part","base"),i.style.display="contents";Array.from(t.children).forEach((e=>{const t=e.getAttribute("slot");if(!t||"anchor"!==t&&"title"!==t&&"action"!==t){const t=e.cloneNode(!0);i.appendChild(t)}})),e.appendChild(i)}static cloneContent(e,t){Array.from(e.childNodes).forEach((e=>{const i=e.cloneNode(!0);t.appendChild(i)})),Array.from(e.attributes).forEach((e=>{t.setAttribute(e.name,e.value)}))}static addActionSection(e,t){const i=document.createElement("div");i.className="popover__action";t.querySelectorAll('[slot="action"]').forEach((e=>{const t=e.cloneNode(!0);i.appendChild(t)})),e.appendChild(i)}static addArrowElement(e,t){const i=document.createElement("div");i.className="popup__arrow",i.setAttribute("part","arrow"),i.setAttribute("role","presentation"),e.appendChild(i)}static createPortalPopover(e){const t=this.createBasePopover(e);return this.addTitleSection(t,e),this.addContentSection(t,e),this.addActionSection(t,e),e.arrow&&this.addArrowElement(t,e),t}static updatePortalContent(e,t){if(!e)return;const i=e.querySelector(".popover__title");i&&t.title&&(i.textContent=t.title);const M=e.querySelector('[part="base"]');if(M){M.innerHTML="";Array.from(t.children).forEach((e=>{const t=e.getAttribute("slot");if(!t||"anchor"!==t&&"title"!==t&&"action"!==t){const t=e.cloneNode(!0);M.appendChild(t)}}))}const n=e.querySelector(".popover__action");if(n){n.innerHTML="";t.querySelectorAll('[slot="action"]').forEach((e=>{const t=e.cloneNode(!0);n.appendChild(t)}))}}}class kp{static setupPortalEventListeners(e,t){e&&(this.setupClickListeners(e,t),this.setupContentListeners(e,t),this.setupActionListeners(e,t))}static setupClickListeners(e,t){e&&e.addEventListener("click",(e=>{e.stopPropagation()}))}static setupContentListeners(e,t){if(!e)return;const i=e.querySelector('[part="base"]');i&&(i.addEventListener("nile-click",(e=>{t.handleContentClick&&t.handleContentClick(e)})),i.addEventListener("nile-input",(e=>{t.handleContentInput&&t.handleContentInput(e)})),i.addEventListener("nile-change",(e=>{t.handleContentChange&&t.handleContentChange(e)})))}static setupActionListeners(e,t){if(!e)return;const i=e.querySelector(".popover__action");i&&(i.addEventListener("click",(e=>{const i=e.target;("BUTTON"===i.tagName||i.closest("button"))&&t.handleActionClick&&t.handleActionClick(e)})),i.addEventListener("nile-click",(e=>{t.handleActionClick&&t.handleActionClick(e)})))}static forwardEventToOriginal(e,t,i){const M=new CustomEvent(i,{bubbles:!0,cancelable:!0,detail:e.detail});t.dispatchEvent(M)}}class Cp{constructor(e){this.portalContainer=null,this.measuredPopoverHeight=null,this.clonedPopover=null,this.cleanupAutoUpdate=null,this.currentPlacement="top",this.currentMiddlewareData=null,this.boundHandleWindowResize=null,this.component=e}createPortalAppendContainer(){const e=document.createElement("div");return e.style.position="absolute",e.style.zIndex="9999",e.style.pointerEvents="none",e.style.width="auto",e.style.maxWidth="none",e.style.minWidth="200px",e.className="nile-popover-portal-append",e}positionPortalAppend(){this.portalContainer&&this.component.isShow&&(this.measurePopoverHeight(),this.computeFloatingUIPosition())}measurePopoverHeight(){!this.measuredPopoverHeight&&this.portalContainer&&(this.portalContainer.style.position="absolute",this.portalContainer.style.visibility="hidden",this.portalContainer.style.top="0px",this.portalContainer.style.left="0px",this.portalContainer.offsetHeight,this.measuredPopoverHeight=this.portalContainer.offsetHeight,this.portalContainer.style.visibility="")}async computeFloatingUIPosition(){if(!this.portalContainer)return;const e=this.component.querySelector('[slot="anchor"]')||this.component,t=this.portalContainer;try{const{x:i,y:M,placement:n,middlewareData:o}=await this.calculateFloatingUIPosition(e,t);this.applyFloatingUIPosition(t,e,i,M,n,o)}catch(e){console.warn("Floating UI positioning failed, falling back to simple positioning:",e),this.fallbackPositioning()}}async calculateFloatingUIPosition(e,t){const i=wp.findBoundaryElements(e),M=this.getInitialPlacement(),n=this.createFloatingUIMiddleware(i);return await Ji(e,t,{placement:M,strategy:"fixed",middleware:n,platform:this.createCustomPlatform()})}getInitialPlacement(){return this.component.placement||"top"}createFloatingUIMiddleware(e){return[Bi(this.component.distance||18),_i({fallbackPlacements:this.getFallbackPlacements(),fallbackStrategy:"bestFit",padding:10,boundary:e}),Gi({padding:10,crossAxis:!0,boundary:e})]}getFallbackPlacements(){const e=this.component.placement||"top",t=[];return e.startsWith("top")?t.push("bottom","right","left","top-start","top-end","bottom-start","bottom-end"):e.startsWith("bottom")?t.push("top","right","left","bottom-start","bottom-end","top-start","top-end"):e.startsWith("left")?t.push("right","top","bottom","left-start","left-end","right-start","right-end"):e.startsWith("right")&&t.push("left","top","bottom","right-start","right-end","left-start","left-end"),t}createCustomPlatform(){return Wi}positionArrow(e,t,i){if(!this.component.arrow)return;const M=e.querySelector(".popup__arrow");if(!M)return;const n=t.getBoundingClientRect(),o=e.getBoundingClientRect();let r="",s="",a="",l="";switch(i.split("-")[0]){case"top":a="calc(var(--arrow-size-diagonal) * -1)",l=this.calculateArrowXPosition(n,o,i,18);break;case"bottom":r="calc(var(--arrow-size-diagonal) * -1)",l=this.calculateArrowXPosition(n,o,i,18);break;case"left":s="calc(var(--arrow-size-diagonal) * -1)",r=this.calculateArrowYPosition(n,o,i,18);break;case"right":l="calc(var(--arrow-size-diagonal) * -1)",r=this.calculateArrowYPosition(n,o,i,18)}Object.assign(M.style,{top:r,right:s,bottom:a,left:l})}calculateArrowXPosition(e,t,i,M){const n=e.left+e.width/2-t.left-M;return i.includes("start")?`${M}px`:i.includes("end")?`calc(100% - ${2*M}px)`:`${Math.max(M,Math.min(n,t.width-2*M))}px`}calculateArrowYPosition(e,t,i,M){const n=e.top+e.height/2-t.top-M;return i.includes("start")?`${M}px`:i.includes("end")?`calc(100% - ${2*M}px)`:`${Math.max(M,Math.min(n,t.height-2*M))}px`}applyFloatingUIPosition(e,t,i,M,n,o){Object.assign(e.style,{left:`${i}px`,top:`${M}px`,position:"fixed",pointerEvents:"auto",width:"auto",maxWidth:"none",minWidth:"200px"}),this.currentPlacement=n,this.currentMiddlewareData=o,wp.applyCollisionData(e,o,n),e.className="nile-popover-portal-append";const r=t.getBoundingClientRect();e.style.minWidth=`${Math.max(r.width,200)}px`,this.positionArrow(e,t,n)}fallbackPositioning(){if(!this.portalContainer)return;const e=this.component.querySelector('[slot="anchor"]')||this.component,t=e.getBoundingClientRect(),i=window.innerHeight,M=window.innerWidth,n=i-t.bottom,o=t.top,r=M-t.right,s=t.left;let a,l,N,g=t.left;n>o&&n>200?(N=Math.max(n-20,100),a=t.bottom+(this.component.distance||18),l="bottom"):o>n&&o>200?(N=Math.max(o-20,100),a=Math.max(t.top-N-(this.component.distance||18),10),l="top"):r>s&&r>200?(N=Math.max(Math.min(r,n,o)-20,100),a=t.top,g=t.right+(this.component.distance||18),l="right"):(N=Math.max(Math.min(s,n,o)-20,100),a=t.top,g=Math.max(t.left-200-(this.component.distance||18),10),l="left"),"left"===l||"right"===l?(this.portalContainer.style.left=`${g}px`,this.portalContainer.style.top=`${a}px`):(this.portalContainer.style.left=`${t.left}px`,this.portalContainer.style.top=`${a}px`),this.portalContainer.style.maxHeight=`${N}px`,this.portalContainer.style.pointerEvents="auto",this.portalContainer.style.width="auto",this.portalContainer.style.maxWidth="none",this.portalContainer.style.minWidth="200px",this.portalContainer.className=`nile-popover-portal-append popover__box popover__box--${l}`,this.calculateAndSetAutoSizeProperties(t,a,l),this.positionArrow(this.portalContainer,e,l)}calculateAndSetAutoSizeProperties(e,t,i){if(!this.portalContainer)return;const M=window.innerHeight,n=window.innerWidth;let o,r=n-e.left-10;"top"===i?o=e.top-10:"bottom"===i?o=M-e.bottom-10:"left"===i?(o=Math.min(M-e.top,e.bottom),r=e.left-10):(o=Math.min(M-e.top,e.bottom),r=n-e.right-10),this.portalContainer.style.setProperty("--auto-size-available-height",`${Math.max(o,100)}px`),this.portalContainer.style.setProperty("--auto-size-available-width",`${Math.max(r,200)}px`)}updatePortalAppendPosition(){this.component.portal&&this.portalContainer&&this.positionPortalAppend()}handleWindowResize(){this.component.portal&&this.portalContainer&&this.positionPortalAppend()}setupAutoUpdatePositioning(){this.portalContainer&&this.component&&(this.cleanupAutoUpdatePositioning(),this.cleanupAutoUpdate=Ri(this.component,this.portalContainer,(()=>{this.computeFloatingUIPosition()}),{ancestorScroll:!0,ancestorResize:!0,elementResize:!0,layoutShift:!0,animationFrame:!0}))}cleanupAutoUpdatePositioning(){this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null)}injectStylesToDocument(){if(!this.portalContainer)return;const e=wp.generateStyleId();if(document.getElementById(e))return;const t=this.component.constructor.styles;if(!t)return;const i=document.createElement("style");i.id=e,i.textContent=wp.extractStylesAsCSS(t),document.head.appendChild(i),this.portalContainer.__injectedStyleId=e}adoptStylesToPortalAppend(){this.portalContainer&&this.injectStylesToDocument()}setupPortalAppend(){this.component.portal&&this.component.updateComplete.then((()=>{setTimeout((()=>{this.component.isShow&&(this.clonedPopover=this.createPortalPopover(),this.portalContainer=this.createPortalAppendContainer(),this.portalContainer.appendChild(this.clonedPopover),document.body.appendChild(this.portalContainer),this.adoptStylesToPortalAppend(),this.clonedPopover.style.display="",this.positionPortalAppend(),this.setupPortalEventListeners(),this.setupAutoUpdatePositioning(),this.boundHandleWindowResize=this.handleWindowResize.bind(this),window.addEventListener("resize",this.boundHandleWindowResize))}),10)}))}createPortalPopover(){return Qp.createPortalPopover(this.component)}setupPortalEventListeners(){kp.setupPortalEventListeners(this.clonedPopover,this.component)}cleanupPortalAppend(){if(this.cleanupAutoUpdatePositioning(),this.portalContainer&&this.portalContainer.parentNode){const e=this.portalContainer.__injectedStyleId;if(e){const t=document.getElementById(e);t&&t.remove()}this.portalContainer.parentNode.removeChild(this.portalContainer)}this.boundHandleWindowResize&&(window.removeEventListener("resize",this.boundHandleWindowResize),this.boundHandleWindowResize=null),this.portalContainer=null,this.clonedPopover=null,this.measuredPopoverHeight=null,this.currentPlacement="top",this.currentMiddlewareData=null}get portalContainerElement(){return this.portalContainer}resetMeasuredHeight(){this.measuredPopoverHeight=null}forceReposition(){this.portalContainer&&this.computeFloatingUIPosition()}getCurrentPlacement(){return this.currentPlacement}getCurrentMiddlewareData(){return this.currentMiddlewareData}isUsingFloatingUI(){return null!==this.cleanupAutoUpdate}updatePositioningConfig(e){this.forceReposition()}handleViewportChange(){this.portalContainer&&(this.resetMeasuredHeight(),this.forceReposition())}isPositioningOptimal(){if(!this.portalContainer||!this.currentMiddlewareData)return!0;const e=(this.component.querySelector('[slot="anchor"]')||this.component).getBoundingClientRect(),t=window.innerHeight-e.bottom,i=e.top,M=this.currentPlacement.startsWith("top"),n=this.currentPlacement.startsWith("bottom");return!(M&&t>i)&&!(n&&i>t)}}let bp=class extends Re{constructor(){super(...arguments),this.placement="top",this.distance=18,this.preventOverlayClose=!1,this.arrow=!0,this.title="",this.open=!1,this.isShow=!1,this.arrowPlacement="anchor",this.portalManager=null,this.enableVisibilityEffect=!1,this.enableTabClose=!1,this.hoist=!1,this.portal=!1,this.flip=!1,this.handleClick=()=>{this.isShow=!this.isShow;document.querySelectorAll("nile-popover").forEach((e=>{e!==this&&(e.isShow=!1)}))},this.handleDocumentClick=()=>{this.isShow&&!this.preventOverlayClose&&(this.isShow=!1)}}static get styles(){return[Ep]}connectedCallback(){super.connectedCallback(),this.emit("nile-init"),document.addEventListener("click",this.handleDocumentClick),requestAnimationFrame((()=>{this.portal&&!this.portalManager&&(this.portalManager=new Cp(this))}))}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy"),this.visibilityManager?.cleanup(),document.removeEventListener("click",this.handleDocumentClick),this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null)}async firstUpdated(e){await this.updateComplete;const t=this.renderRoot.querySelector('slot[name="anchor"]'),i=t?.assignedElements({flatten:!0})[0];this.visibilityManager=new tM({host:this,target:i||null,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:()=>this.isShow,onAnchorOutOfView:()=>{this.isShow=!1,this.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"})},onDocumentHidden:()=>{this.isShow=!1,this.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"})},emit:(e,t)=>this.emit(`nile-${e}`,t)})}updated(e){e.has("open")&&(this.isShow=this.open),e.has("portal")&&(this.portal&&!this.portalManager?this.portalManager=new Cp(this):!this.portal&&this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null))}handleShowHide(){this.isShow?(this.emit("nile-show"),this.visibilityManager?.setup(),this.portal&&this.portalManager?this.portalManager.setupPortalAppend():this.portal&&!this.portalManager&&(this.portalManager=new Cp(this),this.portalManager.setupPortalAppend())):(this.emit("nile-hide"),this.visibilityManager?.cleanup(),this.portal&&this.portalManager&&this.portalManager.cleanupPortalAppend())}render(){const e=this.isShow&&!(this.portal&&this.portalManager);return R`
|
|
9802
|
+
`;let wp=class{static calculateAvailableSpace(e){const t=e.getBoundingClientRect(),i=window.innerHeight,M=window.innerWidth,n=i-t.bottom,o=t.top,r=M-t.right;return{spaceAbove:o,spaceBelow:n,spaceLeft:t.left,spaceRight:r,viewportHeight:i,viewportWidth:M}}static getOptimalPlacement(e){const{spaceAbove:t,spaceBelow:i,spaceLeft:M,spaceRight:n}=this.calculateAvailableSpace(e);return i>=200&&i>=t?"bottom":t>=200&&t>i?"top":n>=200&&n>=M?"right":M>=200?"left":"bottom"}static findBoundaryElements(e){const t=[];let i=e.parentElement;for(;i&&i!==document.body;){const e=window.getComputedStyle(i),M=e.overflow,n=e.overflowY,o=e.overflowX;"auto"!==M&&"scroll"!==M&&"auto"!==n&&"scroll"!==n&&"auto"!==o&&"scroll"!==o||t.push(i),(i.hasAttribute("data-floating-boundary")||i.classList.contains("floating-boundary")||i.classList.contains("scroll-container"))&&t.push(i),i=i.parentElement}return t.length>0?t:void 0}static calculateOptimalHeight(e,t,i){const M=t-(e.y+e.height),n=e.y;return i.startsWith("top")?Math.max(n-20,100):i.startsWith("bottom")?Math.max(M-20,100):(i.startsWith("left")||i.startsWith("right"),Math.max(Math.min(n,M)-20,100))}static extractStylesAsCSS(e){return"string"==typeof e?e:Array.isArray(e)?e.map((e=>this.extractStylesAsCSS(e))).join("\n"):e&&"object"==typeof e&&e.cssText?e.cssText:""}static generateStyleId(){return`nile-popover-styles-${Math.random().toString(36).substring(2,11)}`}static isPositioningOptimal(e,t){const{spaceAbove:i,spaceBelow:M,spaceLeft:n,spaceRight:o}=this.calculateAvailableSpace(t),r=e.startsWith("top"),s=e.startsWith("bottom"),a=e.startsWith("left"),l=e.startsWith("right");return!(r&&M>i)&&(!(s&&i>M)&&(!(a&&o>n)&&!(l&&n>o)))}static applyCollisionData(e,t,i){if(t.flip){const{overflows:M}=t.flip;if(e.setAttribute("data-placement",i),M&&M.length>0){const t=M.map((e=>e.placement)).join(",");e.setAttribute("data-overflow",t)}else e.removeAttribute("data-overflow")}if(t.shift){const{x:i,y:M}=t.shift;void 0===i||void 0===M||0===i&&0===M?e.removeAttribute("data-shift"):e.setAttribute("data-shift",`${i},${M}`)}if(t.size){const{availableWidth:i,availableHeight:M}=t.size;void 0!==i&&e.setAttribute("data-available-width",i.toString()),void 0!==M&&e.setAttribute("data-available-height",M.toString())}}},Qp=class{static createBasePopover(e){const t=document.createElement("div");return t.className="popover__box",t.setAttribute("part","popover"),t}static addTitleSection(e,t){if(!t.title)return;const i=document.createElement("div");i.className="popover__title",i.textContent=t.title,e.appendChild(i)}static addContentSection(e,t){const i=document.createElement("div");i.setAttribute("part","base"),i.style.display="contents";Array.from(t.children).forEach((e=>{const t=e.getAttribute("slot");if(!t||"anchor"!==t&&"title"!==t&&"action"!==t){const t=e.cloneNode(!0);i.appendChild(t)}})),e.appendChild(i)}static cloneContent(e,t){Array.from(e.childNodes).forEach((e=>{const i=e.cloneNode(!0);t.appendChild(i)})),Array.from(e.attributes).forEach((e=>{t.setAttribute(e.name,e.value)}))}static addActionSection(e,t){const i=document.createElement("div");i.className="popover__action";t.querySelectorAll('[slot="action"]').forEach((e=>{const t=e.cloneNode(!0);i.appendChild(t)})),e.appendChild(i)}static addArrowElement(e,t){const i=document.createElement("div");i.className="popup__arrow",i.setAttribute("part","arrow"),i.setAttribute("role","presentation"),e.appendChild(i)}static createPortalPopover(e){const t=this.createBasePopover(e);return this.addTitleSection(t,e),this.addContentSection(t,e),this.addActionSection(t,e),e.arrow&&this.addArrowElement(t,e),t}static updatePortalContent(e,t){if(!e)return;const i=e.querySelector(".popover__title");i&&t.title&&(i.textContent=t.title);const M=e.querySelector('[part="base"]');if(M){M.innerHTML="";Array.from(t.children).forEach((e=>{const t=e.getAttribute("slot");if(!t||"anchor"!==t&&"title"!==t&&"action"!==t){const t=e.cloneNode(!0);M.appendChild(t)}}))}const n=e.querySelector(".popover__action");if(n){n.innerHTML="";t.querySelectorAll('[slot="action"]').forEach((e=>{const t=e.cloneNode(!0);n.appendChild(t)}))}}},kp=class{static setupPortalEventListeners(e,t){e&&(this.setupClickListeners(e,t),this.setupContentListeners(e,t),this.setupActionListeners(e,t))}static setupClickListeners(e,t){e&&e.addEventListener("click",(e=>{e.stopPropagation()}))}static setupContentListeners(e,t){if(!e)return;const i=e.querySelector('[part="base"]');i&&(i.addEventListener("nile-click",(e=>{t.handleContentClick&&t.handleContentClick(e)})),i.addEventListener("nile-input",(e=>{t.handleContentInput&&t.handleContentInput(e)})),i.addEventListener("nile-change",(e=>{t.handleContentChange&&t.handleContentChange(e)})))}static setupActionListeners(e,t){if(!e)return;const i=e.querySelector(".popover__action");i&&(i.addEventListener("click",(e=>{const i=e.target;("BUTTON"===i.tagName||i.closest("button"))&&t.handleActionClick&&t.handleActionClick(e)})),i.addEventListener("nile-click",(e=>{t.handleActionClick&&t.handleActionClick(e)})))}static forwardEventToOriginal(e,t,i){const M=new CustomEvent(i,{bubbles:!0,cancelable:!0,detail:e.detail});t.dispatchEvent(M)}};class Cp{constructor(e){this.portalContainer=null,this.measuredPopoverHeight=null,this.clonedPopover=null,this.cleanupAutoUpdate=null,this.currentPlacement="top",this.currentMiddlewareData=null,this.boundHandleWindowResize=null,this.component=e}createPortalAppendContainer(){const e=document.createElement("div");return e.style.position="absolute",e.style.zIndex="9999",e.style.pointerEvents="none",e.style.width="auto",e.style.maxWidth="none",e.style.minWidth="200px",e.className="nile-popover-portal-append",e}positionPortalAppend(){this.portalContainer&&this.component.isShow&&(this.measurePopoverHeight(),this.computeFloatingUIPosition())}measurePopoverHeight(){!this.measuredPopoverHeight&&this.portalContainer&&(this.portalContainer.style.position="absolute",this.portalContainer.style.visibility="hidden",this.portalContainer.style.top="0px",this.portalContainer.style.left="0px",this.portalContainer.offsetHeight,this.measuredPopoverHeight=this.portalContainer.offsetHeight,this.portalContainer.style.visibility="")}async computeFloatingUIPosition(){if(!this.portalContainer)return;const e=this.component.querySelector('[slot="anchor"]')||this.component,t=this.portalContainer;try{const{x:i,y:M,placement:n,middlewareData:o}=await this.calculateFloatingUIPosition(e,t);this.applyFloatingUIPosition(t,e,i,M,n,o)}catch(e){console.warn("Floating UI positioning failed, falling back to simple positioning:",e),this.fallbackPositioning()}}async calculateFloatingUIPosition(e,t){const i=wp.findBoundaryElements(e),M=this.getInitialPlacement(),n=this.createFloatingUIMiddleware(i);return await Ji(e,t,{placement:M,strategy:"fixed",middleware:n,platform:this.createCustomPlatform()})}getInitialPlacement(){return this.component.placement||"top"}createFloatingUIMiddleware(e){return[Bi(this.component.distance||18),_i({fallbackPlacements:this.getFallbackPlacements(),fallbackStrategy:"bestFit",padding:10,boundary:e}),Gi({padding:10,crossAxis:!0,boundary:e})]}getFallbackPlacements(){const e=this.component.placement||"top",t=[];return e.startsWith("top")?t.push("bottom","right","left","top-start","top-end","bottom-start","bottom-end"):e.startsWith("bottom")?t.push("top","right","left","bottom-start","bottom-end","top-start","top-end"):e.startsWith("left")?t.push("right","top","bottom","left-start","left-end","right-start","right-end"):e.startsWith("right")&&t.push("left","top","bottom","right-start","right-end","left-start","left-end"),t}createCustomPlatform(){return Wi}positionArrow(e,t,i){if(!this.component.arrow)return;const M=e.querySelector(".popup__arrow");if(!M)return;const n=t.getBoundingClientRect(),o=e.getBoundingClientRect();let r="",s="",a="",l="";switch(i.split("-")[0]){case"top":a="calc(var(--arrow-size-diagonal) * -1)",l=this.calculateArrowXPosition(n,o,i,18);break;case"bottom":r="calc(var(--arrow-size-diagonal) * -1)",l=this.calculateArrowXPosition(n,o,i,18);break;case"left":s="calc(var(--arrow-size-diagonal) * -1)",r=this.calculateArrowYPosition(n,o,i,18);break;case"right":l="calc(var(--arrow-size-diagonal) * -1)",r=this.calculateArrowYPosition(n,o,i,18)}Object.assign(M.style,{top:r,right:s,bottom:a,left:l})}calculateArrowXPosition(e,t,i,M){const n=e.left+e.width/2-t.left-M;return i.includes("start")?`${M}px`:i.includes("end")?`calc(100% - ${2*M}px)`:`${Math.max(M,Math.min(n,t.width-2*M))}px`}calculateArrowYPosition(e,t,i,M){const n=e.top+e.height/2-t.top-M;return i.includes("start")?`${M}px`:i.includes("end")?`calc(100% - ${2*M}px)`:`${Math.max(M,Math.min(n,t.height-2*M))}px`}applyFloatingUIPosition(e,t,i,M,n,o){Object.assign(e.style,{left:`${i}px`,top:`${M}px`,position:"fixed",pointerEvents:"auto",width:"auto",maxWidth:"none",minWidth:"200px"}),this.currentPlacement=n,this.currentMiddlewareData=o,wp.applyCollisionData(e,o,n),e.className="nile-popover-portal-append";const r=t.getBoundingClientRect();e.style.minWidth=`${Math.max(r.width,200)}px`,this.positionArrow(e,t,n)}fallbackPositioning(){if(!this.portalContainer)return;const e=this.component.querySelector('[slot="anchor"]')||this.component,t=e.getBoundingClientRect(),i=window.innerHeight,M=window.innerWidth,n=i-t.bottom,o=t.top,r=M-t.right,s=t.left;let a,l,N,g=t.left;n>o&&n>200?(N=Math.max(n-20,100),a=t.bottom+(this.component.distance||18),l="bottom"):o>n&&o>200?(N=Math.max(o-20,100),a=Math.max(t.top-N-(this.component.distance||18),10),l="top"):r>s&&r>200?(N=Math.max(Math.min(r,n,o)-20,100),a=t.top,g=t.right+(this.component.distance||18),l="right"):(N=Math.max(Math.min(s,n,o)-20,100),a=t.top,g=Math.max(t.left-200-(this.component.distance||18),10),l="left"),"left"===l||"right"===l?(this.portalContainer.style.left=`${g}px`,this.portalContainer.style.top=`${a}px`):(this.portalContainer.style.left=`${t.left}px`,this.portalContainer.style.top=`${a}px`),this.portalContainer.style.maxHeight=`${N}px`,this.portalContainer.style.pointerEvents="auto",this.portalContainer.style.width="auto",this.portalContainer.style.maxWidth="none",this.portalContainer.style.minWidth="200px",this.portalContainer.className=`nile-popover-portal-append popover__box popover__box--${l}`,this.calculateAndSetAutoSizeProperties(t,a,l),this.positionArrow(this.portalContainer,e,l)}calculateAndSetAutoSizeProperties(e,t,i){if(!this.portalContainer)return;const M=window.innerHeight,n=window.innerWidth;let o,r=n-e.left-10;"top"===i?o=e.top-10:"bottom"===i?o=M-e.bottom-10:"left"===i?(o=Math.min(M-e.top,e.bottom),r=e.left-10):(o=Math.min(M-e.top,e.bottom),r=n-e.right-10),this.portalContainer.style.setProperty("--auto-size-available-height",`${Math.max(o,100)}px`),this.portalContainer.style.setProperty("--auto-size-available-width",`${Math.max(r,200)}px`)}updatePortalAppendPosition(){this.component.portal&&this.portalContainer&&this.positionPortalAppend()}handleWindowResize(){this.component.portal&&this.portalContainer&&this.positionPortalAppend()}setupAutoUpdatePositioning(){this.portalContainer&&this.component&&(this.cleanupAutoUpdatePositioning(),this.cleanupAutoUpdate=Ri(this.component,this.portalContainer,(()=>{this.computeFloatingUIPosition()}),{ancestorScroll:!0,ancestorResize:!0,elementResize:!0,layoutShift:!0,animationFrame:!0}))}cleanupAutoUpdatePositioning(){this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null)}injectStylesToDocument(){if(!this.portalContainer)return;const e=wp.generateStyleId();if(document.getElementById(e))return;const t=this.component.constructor.styles;if(!t)return;const i=document.createElement("style");i.id=e,i.textContent=wp.extractStylesAsCSS(t),document.head.appendChild(i),this.portalContainer.__injectedStyleId=e}adoptStylesToPortalAppend(){this.portalContainer&&this.injectStylesToDocument()}setupPortalAppend(){this.component.portal&&this.component.updateComplete.then((()=>{setTimeout((()=>{this.component.isShow&&(this.clonedPopover=this.createPortalPopover(),this.portalContainer=this.createPortalAppendContainer(),this.portalContainer.appendChild(this.clonedPopover),document.body.appendChild(this.portalContainer),this.adoptStylesToPortalAppend(),this.clonedPopover.style.display="",this.positionPortalAppend(),this.setupPortalEventListeners(),this.setupAutoUpdatePositioning(),this.boundHandleWindowResize=this.handleWindowResize.bind(this),window.addEventListener("resize",this.boundHandleWindowResize))}),10)}))}createPortalPopover(){return Qp.createPortalPopover(this.component)}setupPortalEventListeners(){kp.setupPortalEventListeners(this.clonedPopover,this.component)}cleanupPortalAppend(){if(this.cleanupAutoUpdatePositioning(),this.portalContainer&&this.portalContainer.parentNode){const e=this.portalContainer.__injectedStyleId;if(e){const t=document.getElementById(e);t&&t.remove()}this.portalContainer.parentNode.removeChild(this.portalContainer)}this.boundHandleWindowResize&&(window.removeEventListener("resize",this.boundHandleWindowResize),this.boundHandleWindowResize=null),this.portalContainer=null,this.clonedPopover=null,this.measuredPopoverHeight=null,this.currentPlacement="top",this.currentMiddlewareData=null}get portalContainerElement(){return this.portalContainer}resetMeasuredHeight(){this.measuredPopoverHeight=null}forceReposition(){this.portalContainer&&this.computeFloatingUIPosition()}getCurrentPlacement(){return this.currentPlacement}getCurrentMiddlewareData(){return this.currentMiddlewareData}isUsingFloatingUI(){return null!==this.cleanupAutoUpdate}updatePositioningConfig(e){this.forceReposition()}handleViewportChange(){this.portalContainer&&(this.resetMeasuredHeight(),this.forceReposition())}isPositioningOptimal(){if(!this.portalContainer||!this.currentMiddlewareData)return!0;const e=(this.component.querySelector('[slot="anchor"]')||this.component).getBoundingClientRect(),t=window.innerHeight-e.bottom,i=e.top,M=this.currentPlacement.startsWith("top"),n=this.currentPlacement.startsWith("bottom");return!(M&&t>i)&&!(n&&i>t)}}let bp=class extends Re{constructor(){super(...arguments),this.placement="top",this.distance=18,this.preventOverlayClose=!1,this.arrow=!0,this.title="",this.open=!1,this.isShow=!1,this.arrowPlacement="anchor",this.portalManager=null,this.enableVisibilityEffect=!1,this.enableTabClose=!1,this.hoist=!1,this.portal=!1,this.flip=!1,this.handleClick=()=>{this.isShow=!this.isShow;document.querySelectorAll("nile-popover").forEach((e=>{e!==this&&(e.isShow=!1)}))},this.handleDocumentClick=()=>{this.isShow&&!this.preventOverlayClose&&(this.isShow=!1)}}static get styles(){return[Ep]}connectedCallback(){super.connectedCallback(),this.emit("nile-init"),document.addEventListener("click",this.handleDocumentClick),requestAnimationFrame((()=>{this.portal&&!this.portalManager&&(this.portalManager=new Cp(this))}))}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy"),this.visibilityManager?.cleanup(),document.removeEventListener("click",this.handleDocumentClick),this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null)}async firstUpdated(e){await this.updateComplete;const t=this.renderRoot.querySelector('slot[name="anchor"]'),i=t?.assignedElements({flatten:!0})[0];this.visibilityManager=new tM({host:this,target:i||null,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:()=>this.isShow,onAnchorOutOfView:()=>{this.isShow=!1,this.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"})},onDocumentHidden:()=>{this.isShow=!1,this.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"})},emit:(e,t)=>this.emit(`nile-${e}`,t)})}updated(e){e.has("open")&&(this.isShow=this.open),e.has("portal")&&(this.portal&&!this.portalManager?this.portalManager=new Cp(this):!this.portal&&this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null))}handleShowHide(){this.isShow?(this.emit("nile-show"),this.visibilityManager?.setup(),this.portal&&this.portalManager?this.portalManager.setupPortalAppend():this.portal&&!this.portalManager&&(this.portalManager=new Cp(this),this.portalManager.setupPortalAppend())):(this.emit("nile-hide"),this.visibilityManager?.cleanup(),this.portal&&this.portalManager&&this.portalManager.cleanupPortalAppend())}render(){const e=this.isShow&&!(this.portal&&this.portalManager);return R`
|
|
9790
9803
|
<nile-popup
|
|
9791
9804
|
active
|
|
9792
9805
|
.arrow="${this.arrow&&this.isShow&&!this.portal}"
|
|
@@ -13724,6 +13737,7 @@ nile-badge::part(content) {
|
|
|
13724
13737
|
`;case IL.ERROR:return((e,t,i,M,n,o,r)=>QL(e,t,i,!1,M,n,o,r))(this.browseFiles,this.title,this.subtitle,this.dragHandler,this.errorMessage,this.allowedTypes,this);default:return kL(this.browseFiles,this.title,this.subtitle,this.dragHandler,this.errorMessage,this.allowedTypes,this)}var e,t,i,M,n,o}disconnectedCallback(){this.emit(hL.NILE_DESTROY)}};e([ce({type:String})],CL.prototype,"size",void 0),e([ce({type:Boolean})],CL.prototype,"error",void 0),e([ce({type:String})],CL.prototype,"errorMessage",void 0),e([ce({type:Boolean})],CL.prototype,"allowMultiple",void 0),e([ce({type:Boolean})],CL.prototype,"allowDuplicates",void 0),e([ce({type:Array})],CL.prototype,"allowedTypes",void 0),e([ce({type:Array})],CL.prototype,"uploadedFiles",void 0),e([ce({type:String})],CL.prototype,"title",void 0),e([ce({type:String})],CL.prototype,"subtitle",void 0),e([ce({type:String})],CL.prototype,"state",void 0),e([ce({type:String})],CL.prototype,"variant",void 0),e([ce({type:String})],CL.prototype,"fileUploadUrl",void 0),e([ce({type:Boolean})],CL.prototype,"autoUpload",void 0),e([Ie("input")],CL.prototype,"input",void 0),CL=e([Ne("nile-file-upload")],CL);const bL=r`
|
|
13725
13738
|
:host {
|
|
13726
13739
|
display: inline-block;
|
|
13740
|
+
width: 100%;
|
|
13727
13741
|
}
|
|
13728
13742
|
|
|
13729
13743
|
* {
|
|
@@ -13747,7 +13761,7 @@ nile-badge::part(content) {
|
|
|
13747
13761
|
|
|
13748
13762
|
.horizontal-div {
|
|
13749
13763
|
max-height: 62px;
|
|
13750
|
-
width:
|
|
13764
|
+
width: 100%;
|
|
13751
13765
|
min-width: 230px;
|
|
13752
13766
|
padding: 12px;
|
|
13753
13767
|
display: flex;
|
|
@@ -13974,7 +13988,7 @@ nile-badge::part(content) {
|
|
|
13974
13988
|
white-space: nowrap;
|
|
13975
13989
|
text-overflow: ellipsis;
|
|
13976
13990
|
overflow: hidden;
|
|
13977
|
-
width:
|
|
13991
|
+
width: 100%;
|
|
13978
13992
|
}
|
|
13979
13993
|
|
|
13980
13994
|
.preview-file-info p:last-of-type{
|
|
@@ -13985,7 +13999,7 @@ nile-badge::part(content) {
|
|
|
13985
13999
|
white-space: nowrap;
|
|
13986
14000
|
text-overflow: ellipsis;
|
|
13987
14001
|
overflow: hidden;
|
|
13988
|
-
width:
|
|
14002
|
+
width: 100%;
|
|
13989
14003
|
}
|
|
13990
14004
|
|
|
13991
14005
|
.no-preview > nile-icon:hover {
|
|
@@ -14295,19 +14309,22 @@ nile-badge::part(content) {
|
|
|
14295
14309
|
li {
|
|
14296
14310
|
list-style-type: none;
|
|
14297
14311
|
}
|
|
14312
|
+
.preview-file-info p {
|
|
14313
|
+
width: 100%;
|
|
14314
|
+
}
|
|
14298
14315
|
`;var fL,vL,UL,YL;!function(e){e.DEFAULT="default",e.UPLOADING="uploading",e.PREVIEW="preview",e.NO_PREVIEW="no-preview",e.ERROR="error"}(fL||(fL={})),function(e){e.HORIZONTAL="horizontal",e.VERTICAL="vertical"}(vL||(vL={})),function(e){e.INVALID_FORMAT="Invalid File Format. Please try again.",e.SIZE_LIMIT="File exceeds size limit.",e.FAILED_TO_LOAD="Failed to load file from URL",e.UNKNOWN_FILE_NAME="unknown-file",e.UPLOAD_CANCEL="File upload cancelled.",e.NO_FILE_SELECTED="No file selected.",e.UNABLE_TO_GENEARTE_URL="Unable to generate the url.",e.NETWORK_ERROR="Network error! Please try again later.",e.CUSTOM_ERROR="Error Occured!"}(UL||(UL={})),function(e){e.NILE_INIT="nile-init",e.NILE_RECEIVE="nile-receive",e.NILE_REMOVE="nile-remove",e.NILE_CANCEL_UPLOAD="nile-cancel-upload",e.NILE_DESTROY="nile-destroy"}(YL||(YL={}));const ZL=(e,t,i)=>{t.target&&t.target.dispatchEvent(new CustomEvent(YL.NILE_REMOVE,{detail:{value:e,url:i},bubbles:!0,composed:!0}))},VL=(e,t)=>{t.target&&t.target.dispatchEvent(new CustomEvent(YL.NILE_CANCEL_UPLOAD,{detail:{file:e},bubbles:!0,composed:!0}))},WL=e=>{const t=e/1024,i=t/1024,M=i/1024;return M>=1?M.toFixed(2)+" GB":i>=1?i.toFixed(2)+" MB":t>=1?t.toFixed(2)+" KB":e+" B"},PL=e=>e.split("/")[1].toUpperCase(),RL=e=>{("vertical"===e.variant&&e.errorMessage.length>34||"horizontal"===e.variant&&e.errorMessage.length>96)&&(e.isStringTruncated=!0,e.requestUpdate())};function BL(e,t){return R`
|
|
14299
14316
|
<div class="uploading" part="horizontal-uploading-state">
|
|
14300
14317
|
<nile-loader width="24" height="24"></nile-loader>
|
|
14301
|
-
<div class="progress-bar-container">
|
|
14302
|
-
<div class="progress-bar-percent">
|
|
14303
|
-
<p>Uploading File...</p>
|
|
14304
|
-
<p>${t}%</p>
|
|
14318
|
+
<div class="progress-bar-container" part="horizontal-progress-bar-container">
|
|
14319
|
+
<div class="progress-bar-percent" part="horizontal-progress-bar-percent">
|
|
14320
|
+
<p part="horizontal-progress-bar-percent-text">Uploading File...</p>
|
|
14321
|
+
<p part="horizontal-progress-bar-percent-value">${t}%</p>
|
|
14305
14322
|
</div>
|
|
14306
14323
|
<nile-progress-bar
|
|
14307
14324
|
part="horizontal-progress-bar"
|
|
14308
14325
|
value="${t}"
|
|
14309
14326
|
></nile-progress-bar>
|
|
14310
|
-
<p class="horizontal-file-name">${e.name}</p>
|
|
14327
|
+
<p class="horizontal-file-name" part="horizontal-file-name">${e.name}</p>
|
|
14311
14328
|
</div>
|
|
14312
14329
|
<slot @click=${t=>VL(e,t)} name="cancelIcon">
|
|
14313
14330
|
<nile-icon
|
|
@@ -14319,38 +14336,40 @@ nile-badge::part(content) {
|
|
|
14319
14336
|
</div>
|
|
14320
14337
|
`}function GL(e,t,i){return R`
|
|
14321
14338
|
<div class="preview horizontal-div" part="horizontal-preview-state">
|
|
14322
|
-
<div class="preview-inner">
|
|
14323
|
-
<div class="preview-image-container">
|
|
14339
|
+
<div class="preview-inner" part="horizontal-preview-inner">
|
|
14340
|
+
<div class="preview-image-container" part="horizontal-preview-image-container">
|
|
14324
14341
|
<img
|
|
14325
14342
|
class="image-preview"
|
|
14326
14343
|
src=${e}
|
|
14327
14344
|
alt=${t.name}
|
|
14345
|
+
part="horizontal-preview-image"
|
|
14328
14346
|
/>
|
|
14329
14347
|
</div>
|
|
14330
|
-
<div class="preview-file-info">
|
|
14331
|
-
<p>${t.name}</p>
|
|
14332
|
-
<p>${PL(t.type)} • ${WL(Number(t.size))}</p>
|
|
14348
|
+
<div class="preview-file-info" part="horizontal-preview-file-info">
|
|
14349
|
+
<p part="horizontal-preview-file-info-name">${t.name}</p>
|
|
14350
|
+
<p part="horizontal-preview-file-info-type">${PL(t.type)} • ${WL(Number(t.size))}</p>
|
|
14333
14351
|
</div>
|
|
14334
14352
|
</div>
|
|
14335
|
-
<div class="preview-actions">
|
|
14353
|
+
<div class="preview-actions" part="horizontal-preview-actions">
|
|
14336
14354
|
<slot @click=${e=>ZL(t,e,i)} name="cancel-icon">
|
|
14337
14355
|
<nile-icon
|
|
14338
14356
|
name="trash"
|
|
14339
14357
|
size="14"
|
|
14340
14358
|
class="icon"
|
|
14359
|
+
part="horizontal-preview-actions-icon"
|
|
14341
14360
|
></nile-icon>
|
|
14342
14361
|
</slot>
|
|
14343
14362
|
</div>
|
|
14344
14363
|
</div>
|
|
14345
14364
|
`}function _L(e,t){return R`
|
|
14346
14365
|
<div class="no-preview horizontal-div" part="horizontal-no-preview-state">
|
|
14347
|
-
<div class="no-preview-container">
|
|
14348
|
-
<div class="document-icon">
|
|
14366
|
+
<div class="no-preview-container" part="horizontal-no-preview-container">
|
|
14367
|
+
<div class="document-icon" part="horizontal-no-preview-document-icon">
|
|
14349
14368
|
<nile-icon name="general" size="20" color="var(--nile-colors-blue-500)"></nile-icon>
|
|
14350
14369
|
</div>
|
|
14351
|
-
<div class="preview-file-info">
|
|
14352
|
-
<p>${e.name}</p>
|
|
14353
|
-
<p>${PL(e.type)} • ${WL(Number(e.size))}</p>
|
|
14370
|
+
<div class="preview-file-info" part="horizontal-no-preview-file-info">
|
|
14371
|
+
<p part="horizontal-no-preview-file-info-name">${e.name}</p>
|
|
14372
|
+
<p part="horizontal-no-preview-file-info-type">${PL(e.type)} • ${WL(Number(e.size))}</p>
|
|
14354
14373
|
</div>
|
|
14355
14374
|
</div>
|
|
14356
14375
|
<div>
|
|
@@ -14359,18 +14378,19 @@ nile-badge::part(content) {
|
|
|
14359
14378
|
name="trash"
|
|
14360
14379
|
size="14"
|
|
14361
14380
|
class="icon"
|
|
14381
|
+
part="horizontal-no-preview-actions-icon"
|
|
14362
14382
|
></nile-icon>
|
|
14363
14383
|
</slot>
|
|
14364
14384
|
</div>
|
|
14365
14385
|
</div>
|
|
14366
14386
|
`}function FL(e,t,i,M){return RL(M),R`
|
|
14367
14387
|
<div class="error horizontal-div" part="horizontal-error-state">
|
|
14368
|
-
<div class="error-container">
|
|
14369
|
-
<div class="error-icon">
|
|
14388
|
+
<div class="error-container" part="horizontal-error-container">
|
|
14389
|
+
<div class="error-icon" part="horizontal-error-icon">
|
|
14370
14390
|
<nile-icon name="info-icon" size="20" color="var(--nile-colors-red-700)"></nile-icon>
|
|
14371
14391
|
</div>
|
|
14372
|
-
<div class="file-info">
|
|
14373
|
-
<p class="horizontal-file-name">${e.name}</p>
|
|
14392
|
+
<div class="file-info" part="horizontal-error-file-info">
|
|
14393
|
+
<p class="horizontal-file-name" part="horizontal-error-file-info-name">${e.name}</p>
|
|
14374
14394
|
${M.isStringTruncated?R`<nile-tooltip content=${t}>
|
|
14375
14395
|
<span>${t}</span>
|
|
14376
14396
|
</nile-tooltip>`:R`<span>${t}</span>`}
|
|
@@ -14381,22 +14401,23 @@ nile-badge::part(content) {
|
|
|
14381
14401
|
name="close"
|
|
14382
14402
|
size="14"
|
|
14383
14403
|
class="icon"
|
|
14404
|
+
part="horizontal-error-actions-icon"
|
|
14384
14405
|
></nile-icon>
|
|
14385
14406
|
</slot>
|
|
14386
14407
|
</div>
|
|
14387
14408
|
`}function HL(e,t){return R`
|
|
14388
14409
|
<div class="vertical-div vertical-uploading" part="vertical-uploading-state">
|
|
14389
|
-
<div class="loading">
|
|
14410
|
+
<div class="loading" part="vertical-loading">
|
|
14390
14411
|
<nile-loader width="24" height="24"></nile-loader>
|
|
14391
14412
|
</div>
|
|
14392
14413
|
|
|
14393
|
-
<div class="progress-bar-container">
|
|
14394
|
-
<div class="progress-bar-percent">
|
|
14395
|
-
<p>Uploading...</p>
|
|
14396
|
-
<p>${t}%</p>
|
|
14414
|
+
<div class="progress-bar-container" part="vertical-progress-bar-container">
|
|
14415
|
+
<div class="progress-bar-percent" part="vertical-progress-bar-percent">
|
|
14416
|
+
<p part="vertical-progress-bar-percent-text">Uploading...</p>
|
|
14417
|
+
<p part="vertical-progress-bar-percent-value">${t}%</p>
|
|
14397
14418
|
</div>
|
|
14398
14419
|
<nile-progress-bar value=${t}></nile-progress-bar>
|
|
14399
|
-
<p class="vertical-file-name">${e.name}</p>
|
|
14420
|
+
<p class="vertical-file-name" part="vertical-file-name">${e.name}</p>
|
|
14400
14421
|
</div>
|
|
14401
14422
|
|
|
14402
14423
|
<slot @click=${t=>VL(e,t)} name="cancelIcon">
|
|
@@ -14404,22 +14425,24 @@ nile-badge::part(content) {
|
|
|
14404
14425
|
name="close"
|
|
14405
14426
|
size="14"
|
|
14406
14427
|
class="icon corner-icon"
|
|
14428
|
+
part="vertical-uploading-actions-icon"
|
|
14407
14429
|
></nile-icon>
|
|
14408
14430
|
</slot>
|
|
14409
14431
|
</div>
|
|
14410
14432
|
`}function JL(e,t,i){return R`
|
|
14411
14433
|
<div class="vertical-div vertical-preview" part="vertical-preview-state">
|
|
14412
|
-
<div>
|
|
14434
|
+
<div part="vertical-preview-image-container">
|
|
14413
14435
|
<img
|
|
14414
14436
|
class="image-preview"
|
|
14437
|
+
part="vertical-preview-image"
|
|
14415
14438
|
src=${e}
|
|
14416
14439
|
alt=${t.name}
|
|
14417
14440
|
/>
|
|
14418
14441
|
</div>
|
|
14419
14442
|
|
|
14420
|
-
<div class="content-container">
|
|
14421
|
-
<p>${t.name}</p>
|
|
14422
|
-
<p>${PL(t.type)} • ${WL(Number(t.size))}</p>
|
|
14443
|
+
<div class="content-container" part="vertical-preview-file-info">
|
|
14444
|
+
<p part="vertical-preview-file-info-name">${t.name}</p>
|
|
14445
|
+
<p part="vertical-preview-file-info-type">${PL(t.type)} • ${WL(Number(t.size))}</p>
|
|
14423
14446
|
</div>
|
|
14424
14447
|
|
|
14425
14448
|
<slot @click=${e=>ZL(t,e,i)} name="cancelIcon">
|
|
@@ -14427,18 +14450,19 @@ nile-badge::part(content) {
|
|
|
14427
14450
|
name="trash"
|
|
14428
14451
|
size="14"
|
|
14429
14452
|
class="icon corner-icon"
|
|
14453
|
+
part="vertical-preview-actions-icon"
|
|
14430
14454
|
></nile-icon>
|
|
14431
14455
|
</slot>
|
|
14432
14456
|
</div>
|
|
14433
14457
|
`}function $L(e,t){return R`
|
|
14434
14458
|
<div class="vertical-div vertical-no-preview" part="vertical-no-preview-state">
|
|
14435
|
-
<div class="vertical-document-icon">
|
|
14459
|
+
<div class="vertical-document-icon" part="vertical-no-preview-document-icon">
|
|
14436
14460
|
<nile-icon name="general" size="20" color="var(--nile-colors-blue-500)"></nile-icon>
|
|
14437
14461
|
</div>
|
|
14438
14462
|
|
|
14439
|
-
<div class="content-container">
|
|
14440
|
-
<p>${e.name}</p>
|
|
14441
|
-
<p>${PL(e.type)} • ${WL(Number(e.size))}</p>
|
|
14463
|
+
<div class="content-container" part="vertical-no-preview-file-info">
|
|
14464
|
+
<p part="vertical-no-preview-file-info-name">${e.name}</p>
|
|
14465
|
+
<p part="vertical-no-preview-file-info-type">${PL(e.type)} • ${WL(Number(e.size))}</p>
|
|
14442
14466
|
</div>
|
|
14443
14467
|
|
|
14444
14468
|
<slot @click=${i=>ZL(e,i,t)} name="cancelIcon">
|
|
@@ -14446,17 +14470,18 @@ nile-badge::part(content) {
|
|
|
14446
14470
|
name="trash"
|
|
14447
14471
|
size="14"
|
|
14448
14472
|
class="icon corner-icon"
|
|
14473
|
+
part="vertical-no-preview-actions-icon"
|
|
14449
14474
|
></nile-icon>
|
|
14450
14475
|
</slot>
|
|
14451
14476
|
</div>
|
|
14452
14477
|
`}function XL(e,t,i,M){return RL(M),R`
|
|
14453
14478
|
<div class="vertical-div vertical-error" part="vertical-error-state">
|
|
14454
|
-
<div class="vertical-document-icon error-bg">
|
|
14479
|
+
<div class="vertical-document-icon error-bg" part="vertical-error-document-icon">
|
|
14455
14480
|
<nile-icon name="info-icon" size="20" color="var(--nile-colors-red-700)"></nile-icon>
|
|
14456
14481
|
</div>
|
|
14457
14482
|
|
|
14458
|
-
<div class="file-info-vertical-state">
|
|
14459
|
-
<p class="vertical-file-name">${e.name}</p>
|
|
14483
|
+
<div class="file-info-vertical-state" part="vertical-error-file-info">
|
|
14484
|
+
<p class="vertical-file-name" part="vertical-error-file-info-name">${e.name}</p>
|
|
14460
14485
|
${M.isStringTruncated?R`<nile-tooltip content=${t}>
|
|
14461
14486
|
<span>${t}</span>
|
|
14462
14487
|
</nile-tooltip>`:R`<span>${t}</span>`}
|
|
@@ -14467,6 +14492,7 @@ nile-badge::part(content) {
|
|
|
14467
14492
|
name="close"
|
|
14468
14493
|
size="14"
|
|
14469
14494
|
class="icon corner-icon"
|
|
14495
|
+
part="vertical-error-actions-icon"
|
|
14470
14496
|
></nile-icon>
|
|
14471
14497
|
</slot>
|
|
14472
14498
|
</div>
|
|
@@ -15137,7 +15163,7 @@ nile-rte-toolbar-item nile-button[data-active]::part(base):hover {
|
|
|
15137
15163
|
|
|
15138
15164
|
|
|
15139
15165
|
|
|
15140
|
-
`,qS={bold:"format_bold",italic:"format_italic",underline:"format_underline",link:"link_2",left:"format_align_left",center:"format_align_middle",right:"format_align_right",justify:"format_align_justify",ul:"format_list_bulleted",ol:"format_list_numbered",clear:"format_clear"},KS=["font-weight","font-style","text-decoration","color","background-color","font-size","font-family","text-align","line-height","letter-spacing","white-space","vertical-align","list-style-position","padding-inline-start"];let em=class extends ae{constructor(){super(...arguments),this.value="",this.noStyles=!1,this.singleLineEditor=!1,this.placeholder="",this.mentions={},this.whitelist=[],this.content="",this.previewEl=null,this.toolbarEl=null,this.lastRange=null,this.buttonMap=new Map,this.headingSelect=null,this.fontSelect=null,this.colorInput=null,this.bgColorInput=null,this.colorSwatchEl=null,this.bgSwatchEl=null,this.containerEl=null,this.mentionsEl=null,this.onEditorKeydown=e=>{if(this.singleLineEditor&&"Enter"===e.key&&e.shiftKey)return void e.preventDefault();if(e.ctrlKey&&"i"===e.key.toLowerCase()&&(e.preventDefault(),RS(this.editorEl,"em"),this.updateContent(),this.updateToolbarState()),this.singleLineEditor&&"Enter"===e.key)return void e.preventDefault();if("Tab"!==e.key)return;e.preventDefault(),this.focusAndRestore();const t=window.getSelection();if(!t||0===t.rangeCount)return;const i=t.getRangeAt(0);if(e.shiftKey){if(i.collapsed&&i.startContainer.nodeType===Node.TEXT_NODE){const e=i.startContainer,M=i.startOffset,n=e.data.slice(0,M),o=n.replace(/(\t|[ \u00a0]{2})$/,"");if(o.length!==n.length){e.data=o+e.data.slice(M);const i=document.createRange();i.setStart(e,o.length),i.collapse(!0),t.removeAllRanges(),t.addRange(i),this.updateContent(),this.updateToolbarState()}}return}i.deleteContents();const M=document.createTextNode("\t");i.insertNode(M);const n=document.createRange();n.setStartAfter(M),n.collapse(!0),t.removeAllRanges(),t.addRange(n),this.updateContent(),this.updateToolbarState()},this.onSelectionChange=()=>{if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);this.editorEl.contains(t.commonAncestorContainer)&&(this.lastRange=t.cloneRange(),this.updateToolbarState())}}createRenderRoot(){return this}injectCss(e){if(this.querySelector("style[data-rte-style]"))return;const t=document.createElement("style");t.setAttribute("data-rte-style","true"),t.textContent=e,this.insertBefore(t,this.firstChild)}connectedCallback(){super.connectedCallback(),this.injectCss(XS.cssText),this.ensureStructure(),this.placeholder&&this.editorEl&&(this.editorEl.dataset.placeholder=this.placeholder),this.value&&!this.editorEl.innerHTML.trim()&&(this.editorEl.innerHTML=this.value),this.content=this.editorEl.innerHTML,this.toolbarEl&&this.wireAuthoredToolbar(this.toolbarEl),this.mentionsEl=this.querySelector("nile-rte-mentions"),this.mentionsEl&&(this.mentionsEl.attach?.(this.editorEl,this),this.mentionsEl.setExternalConfig?.(this.mentions)),this.wireEditor(),document.addEventListener("selectionchange",this.onSelectionChange,{passive:!0}),this.updateToolbarState(),this.syncPreview()}ensureStructure(){this.toolbarEl=this.querySelector("nile-rte-toolbar"),this.previewEl=this.querySelector("nile-rte-preview"),this.containerEl=this.querySelector(".rte-container"),this.containerEl||(this.containerEl=document.createElement("div"),this.containerEl.className="rte-container",this.appendChild(this.containerEl)),this.ensureEditor(),this.toolbarEl&&this.toolbarEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.toolbarEl),this.editorEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.editorEl),this.previewEl&&(this.previewEl.parentElement!==this&&this.appendChild(this.previewEl),this.previewEl.previousElementSibling!==this.containerEl&&this.insertBefore(this.previewEl,this.containerEl.nextSibling))}updateContentWithMention(e){this.updateContent(),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content,mention:e},bubbles:!0,composed:!0}))}disconnectedCallback(){document.removeEventListener("selectionchange",this.onSelectionChange),this.mentionsEl&&this.mentionsEl.detach&&this.mentionsEl.detach(),super.disconnectedCallback()}updated(e){e.has("value")&&this.editorEl&&this.value!==this.editorEl.innerHTML&&(this.editorEl.innerHTML=this.value||"<p><br></p>",this.content=this.editorEl.innerHTML,this.syncPreview()),e.has("singleLineEditor")&&(this.editorEl&&this.editorEl.classList.toggle("single-line",this.singleLineEditor),this.previewEl&&this.previewEl.classList.toggle("single-line",this.singleLineEditor))}ensureEditor(){if(this.editorEl=this.querySelector(".editor"),!this.editorEl){const e=document.createElement("article");e.className="editor",e.setAttribute("contenteditable","true"),this.editorEl=e}this.placeholder&&(this.editorEl.dataset.placeholder=this.placeholder),this.editorEl.innerHTML.trim()||(this.editorEl.innerHTML="<p><br></p>")}unwrapMention(e,t=!0){const i=e.parentNode;if(!i)return;const M=t?(e.textContent??"").replace(/\u200B/g,""):"",n=document.createTextNode(M);i.insertBefore(n,e),i.removeChild(e);const o=document.createRange();o.setStartAfter(n),o.collapse(!0);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(o)}scrubBrokenMentions(){if(!this.editorEl)return;this.editorEl.querySelectorAll("span.mention").forEach((e=>{const t=e,i=t.getAttribute("data-mention-key"),M=t.getAttribute("data-mention-label"),n=t.getAttribute("data-mention-trigger")||"",o=(t.textContent??"").replace(/\u200B/g,"").trim(),r=!!i&&!!M&&o.length>0&&o.startsWith(n)&&o.includes(M);o&&r||this.unwrapMention(t,!0)}))}wireEditor(){this.editorEl.addEventListener("input",(()=>{this.ensureAtLeastOneParagraph(),this.scrubBrokenMentions(),this.updateContent(),this.updateToolbarState()})),this.editorEl.addEventListener("mouseup",(()=>{this.saveSelection(),this.updateToolbarState()})),this.editorEl.addEventListener("keyup",(e=>{this.saveSelection(),["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key)&&this.updateToolbarState()})),this.editorEl.addEventListener("keydown",this.onEditorKeydown)}wireAuthoredToolbar(e){this.buttonMap.clear(),this.headingSelect=null,this.fontSelect=null,this.colorInput=null,Array.from(e.children).forEach((e=>{const t=e.tagName.toLowerCase();if("nile-rte-select"!==t||"align"!==e.getAttribute("type")){if("nile-rte-link"===t)return e.editorEl=this.editorEl,void e.addEventListener("link-changed",(()=>{this.updateContent(),this.updateToolbarState()}));if("nile-rte-toolbar-item"===t){let t=e.querySelector(":scope > nile-button");const i=e.getAttribute("name")||"",M=e.getAttribute("label")||i,n=e.getAttribute("icon"),o=e.innerHTML.trim().length>0;if(t||(t=document.createElement("nile-button"),t.variant="tertiary",t.size="small"),n)t.innerHTML=`<nile-icon name="${n}" aria-label="${M}"></nile-icon>`,e.innerHTML="";else if(o)t.innerHTML=e.innerHTML,e.innerHTML="";else{const n=qS[i];n?t.innerHTML=`<nile-icon name="${n}" size="20" color="black" aria-label="${M}"></nile-icon>`:t.textContent=M||i,e.innerHTML=""}if(!t.isConnected){const i=document.createElement("nile-lite-tooltip");i.setAttribute("content",M),i.appendChild(t),e.appendChild(i)}t.setAttribute("aria-label",M),t.addEventListener("mousedown",(e=>e.preventDefault())),t.addEventListener("click",(()=>this.onToolbarCommand(i)));const r=this.buttonMap.get(i)??[];return r.push(t),void this.buttonMap.set(i,r)}if("nile-rte-select"!==t)"nile-rte-color"!==t||e.addEventListener("change",(e=>{this.focusAndRestore();const{mode:t,value:i}=e.detail;"backColor"===t?FS(this.editorEl,"backgroundColor",i,"data-rte-bg"):function(e,t){FS(e,"color",t,"data-rte-color")}(this.editorEl,i),this.updateContent(),this.updateToolbarState()}));else{const t=e.getAttribute("type")||"";e.addEventListener("change",(e=>{this.focusAndRestore();const i=e.detail;"heading"===t?function(e,t){const i=document.getSelection();if(!i||0===i.rangeCount)return;const M=WS(i.getRangeAt(0).startContainer,e);if(!M)return;if(M.tagName.toLowerCase()===t)return;const n=document.createElement(t);for(;M.firstChild;)n.appendChild(M.firstChild);M.replaceWith(n);const o=document.createRange();o.selectNodeContents(n),o.collapse(!0),i.removeAllRanges(),i.addRange(o)}(this.editorEl,i):"font"===t&&GS(this.editorEl,i),this.updateContent(),this.updateToolbarState()}))}}else e.addEventListener("change",(e=>{this.focusAndRestore();const t=e.detail;PS(this.editorEl,t),this.updateContent(),this.updateToolbarState()}))}))}saveSelection(){const e=window.getSelection();e&&e.rangeCount&&(this.lastRange=e.getRangeAt(0).cloneRange())}restoreSelection(){if(!this.lastRange)return;const e=document.getSelection();e&&(e.removeAllRanges(),e.addRange(this.lastRange))}focusAndRestore(){this.editorEl?.focus(),this.restoreSelection()}getCleanContent(){const e=this.editorEl.cloneNode(!0);return e.querySelectorAll("*").forEach((e=>{e.removeAttribute("style")})),e.innerHTML}insertList(e){if(this.restoreSelection(),!this.lastRange)return;const t=document.createElement(e),i=this.lastRange.extractContents(),M=document.createElement("div");M.appendChild(i),Array.from(M.childNodes).forEach((e=>{if(e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim())return;const i=document.createElement("li");i.appendChild(e),t.appendChild(i)})),this.lastRange.insertNode(t),this.afterListEdit(t)}afterListEdit(e){const t=document.createRange();t.setStartAfter(e),t.collapse(!0);const i=window.getSelection();i?.removeAllRanges(),i?.addRange(t),this.saveSelection(),this.updateContent(),this.updateToolbarState()}ensureAtLeastOneParagraph(){const e=this.editorEl;if(!e)return;const t=""===(e.textContent??"").replace(/\u200B/g,"").trim();if(0===e.childNodes.length||t)return void(e.innerHTML="<p><br></p>");if(!e.querySelector("p,h1,h2,h3,h4,h5,h6,ul,ol,table,blockquote,pre")){const t=document.createElement("p");for(;e.firstChild;)t.appendChild(e.firstChild);return t.hasChildNodes()||t.appendChild(document.createElement("br")),void e.appendChild(t)}e.querySelectorAll("p").forEach((e=>{""===(e.textContent??"").replace(/\u200B/g,"")&&(e.innerHTML.toLowerCase().includes("<br")||(e.innerHTML="<br>"))}))}onToolbarCommand(e){switch(this.focusAndRestore(),e){case"bold":RS(this.editorEl,"strong");break;case"italic":RS(this.editorEl,"em");break;case"underline":RS(this.editorEl,"u");break;case"left":PS(this.editorEl,"left");break;case"center":PS(this.editorEl,"center");break;case"right":PS(this.editorEl,"right");break;case"justify":PS(this.editorEl,"justify");break;case"ul":$S(this.editorEl,"ul"),this.updateContent(),this.updateToolbarState();break;case"ol":$S(this.editorEl,"ol"),this.updateContent(),this.updateToolbarState();break;case"link":break;case"clear":const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),t=[];for(;e.nextNode();){const i=e.currentNode;i.removeAttribute("style"),["B","STRONG","I","EM","U","SPAN","FONT"].includes(i.tagName)&&t.push(i)}for(const e of t){for(;e.firstChild;)e.parentNode?.insertBefore(e.firstChild,e);e.remove()}this.ensureAtLeastOneParagraph()}this.updateContent(),this.updateToolbarState()}setBtnActive(e,t){const i=this.buttonMap.get(e);if(i)for(const e of i)e.toggleAttribute("data-active",!!t)}updateToolbarState(){if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);if(!this.editorEl.contains(t.commonAncestorContainer))return;const i=function(e){for(;e&&!(e instanceof HTMLElement);)e=e.parentNode;return e}(t.startContainer)||this.editorEl,M=getComputedStyle(i),n=WS(t.startContainer,this.editorEl)||this.editorEl,o=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("strong"===t||"b"===t)return!0;const i=getComputedStyle(e).fontWeight;if(parseInt(i,10)>=600)return!0}e=e.parentNode}return!1})(),r=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("em"===t||"i"===t)return!0;if("italic"===getComputedStyle(e).fontStyle)return!0}e=e.parentNode}return!1})(),s=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=getComputedStyle(e).textDecorationLine;if(t&&t.includes("underline"))return!0;if("u"===e.tagName.toLowerCase())return!0}e=e.parentNode}return!1})(),a=!!i.closest("a"),l=n.style.textAlign||getComputedStyle(n).textAlign||"start",N="start"===l?"left":l,g=!!i.closest("li")&&i.closest("ul,ol")?.tagName.toLowerCase()||"";if(this.setBtnActive("bold",o),this.setBtnActive("italic",r),this.setBtnActive("underline",s),this.setBtnActive("link",a),this.setBtnActive("left","left"===N&&!["center","right","justify"].includes(N)),this.setBtnActive("center","center"===N),this.setBtnActive("right","right"===N),this.setBtnActive("justify","justify"===N),this.setBtnActive("ul","ul"===g),this.setBtnActive("ol","ol"===g),this.headingSelect){const e=n.tagName.toLowerCase(),t=["h1","h2","h3"].includes(e)?e:"p";this.headingSelect.value!==t&&(this.headingSelect.value=t)}if(this.fontSelect){const e=(M.fontFamily||"").replace(/["']/g,"").split(",")[0].trim().toLowerCase();if(e)for(const t of Array.from(this.fontSelect.options))if(t.value.toLowerCase()===e){this.fontSelect.value=t.value;break}}if(this.colorInput){const e=BS(M.color);e&&this.colorInput.value.toLowerCase()!==e.toLowerCase()&&(this.colorInput.value=e),this.colorSwatchEl&&(this.colorSwatchEl.style.backgroundColor=this.colorInput.value)}if(this.bgColorInput){const e=getComputedStyle(i).backgroundColor;if(e&&!/transparent|rgba\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e)){const t=BS(e);t&&this.bgColorInput.value.toLowerCase()!==t.toLowerCase()&&(this.bgColorInput.value=t)}this.bgSwatchEl&&(this.bgSwatchEl.style.backgroundColor=this.bgColorInput.value)}}syncPreview(){this.updateContent()}getComputedImportantProps(){return Array.from(new Set([...KS,...this.whitelist??[]]))}updateContent(){if(!this.editorEl)return;this.ensureAtLeastOneParagraph();const e=""===(this.editorEl.textContent??"").trim();this.editorEl.classList.toggle("empty",e);const t=this.editorEl.cloneNode(!0);if(this.noStyles)t.querySelectorAll("[style]").forEach((e=>e.removeAttribute("style")));else{const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT),M=this.getComputedImportantProps();for(;e.nextNode()&&i.nextNode();){const t=e.currentNode,n=i.currentNode,o=window.getComputedStyle(t),r=M.map((e=>`${e}:${o.getPropertyValue(e)}`)).join(";");r.trim()&&n.setAttribute("style",r)}}this.content=t.innerHTML,this.previewEl&&(this.previewEl.innerHTML=this.content),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content},bubbles:!0,composed:!0}))}};e([ce({type:String,attribute:!0,reflect:!0})],em.prototype,"value",void 0),e([ce({type:Boolean,attribute:!0,reflect:!0})],em.prototype,"noStyles",void 0),e([ce({type:Boolean,attribute:"singlelineeditor",reflect:!0})],em.prototype,"singleLineEditor",void 0),e([ce({type:String})],em.prototype,"placeholder",void 0),e([ce({attribute:"mentions",reflect:!0,converter:{fromAttribute:e=>{try{const t=JSON.parse(e),i={};for(const e of Object.keys(t)){const M=t[e];Array.isArray(M)&&(i[e]=M.filter((e=>e&&"string"==typeof e.key&&"string"==typeof e.label)).map((e=>({key:e.key,label:e.label}))))}return i}catch{return{}}},toAttribute:e=>JSON.stringify(e)}})],em.prototype,"mentions",void 0),e([ce({attribute:"whitelist",reflect:!1,converter:{fromAttribute:e=>{try{const t=JSON.parse(e);return Array.isArray(t)?t.filter((e=>"string"==typeof e)):[]}catch{return[]}}}})],em.prototype,"whitelist",void 0),e([De()],em.prototype,"content",void 0),em=e([Ne("nile-rich-text-editor")],em);"undefined"!=typeof window&&(window.nileElementsVersion='"1.4.8-beta-1.0"',window.nileVersion="__NILE_VERSION__",window.process=window.process||{env:{NODE_ENV:"production"}});const tm=r`
|
|
15166
|
+
`,qS={bold:"format_bold",italic:"format_italic",underline:"format_underline",link:"link_2",left:"format_align_left",center:"format_align_middle",right:"format_align_right",justify:"format_align_justify",ul:"format_list_bulleted",ol:"format_list_numbered",clear:"format_clear"},KS=["font-weight","font-style","text-decoration","color","background-color","font-size","font-family","text-align","line-height","letter-spacing","white-space","vertical-align","list-style-position","padding-inline-start"];let em=class extends ae{constructor(){super(...arguments),this.value="",this.noStyles=!1,this.singleLineEditor=!1,this.placeholder="",this.mentions={},this.whitelist=[],this.content="",this.previewEl=null,this.toolbarEl=null,this.lastRange=null,this.buttonMap=new Map,this.headingSelect=null,this.fontSelect=null,this.colorInput=null,this.bgColorInput=null,this.colorSwatchEl=null,this.bgSwatchEl=null,this.containerEl=null,this.mentionsEl=null,this.onEditorKeydown=e=>{if(this.singleLineEditor&&"Enter"===e.key&&e.shiftKey)return void e.preventDefault();if(e.ctrlKey&&"i"===e.key.toLowerCase()&&(e.preventDefault(),RS(this.editorEl,"em"),this.updateContent(),this.updateToolbarState()),this.singleLineEditor&&"Enter"===e.key)return void e.preventDefault();if("Tab"!==e.key)return;e.preventDefault(),this.focusAndRestore();const t=window.getSelection();if(!t||0===t.rangeCount)return;const i=t.getRangeAt(0);if(e.shiftKey){if(i.collapsed&&i.startContainer.nodeType===Node.TEXT_NODE){const e=i.startContainer,M=i.startOffset,n=e.data.slice(0,M),o=n.replace(/(\t|[ \u00a0]{2})$/,"");if(o.length!==n.length){e.data=o+e.data.slice(M);const i=document.createRange();i.setStart(e,o.length),i.collapse(!0),t.removeAllRanges(),t.addRange(i),this.updateContent(),this.updateToolbarState()}}return}i.deleteContents();const M=document.createTextNode("\t");i.insertNode(M);const n=document.createRange();n.setStartAfter(M),n.collapse(!0),t.removeAllRanges(),t.addRange(n),this.updateContent(),this.updateToolbarState()},this.onSelectionChange=()=>{if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);this.editorEl.contains(t.commonAncestorContainer)&&(this.lastRange=t.cloneRange(),this.updateToolbarState())}}createRenderRoot(){return this}injectCss(e){if(this.querySelector("style[data-rte-style]"))return;const t=document.createElement("style");t.setAttribute("data-rte-style","true"),t.textContent=e,this.insertBefore(t,this.firstChild)}connectedCallback(){super.connectedCallback(),this.injectCss(XS.cssText),this.ensureStructure(),this.placeholder&&this.editorEl&&(this.editorEl.dataset.placeholder=this.placeholder),this.value&&!this.editorEl.innerHTML.trim()&&(this.editorEl.innerHTML=this.value),this.content=this.editorEl.innerHTML,this.toolbarEl&&this.wireAuthoredToolbar(this.toolbarEl),this.mentionsEl=this.querySelector("nile-rte-mentions"),this.mentionsEl&&(this.mentionsEl.attach?.(this.editorEl,this),this.mentionsEl.setExternalConfig?.(this.mentions)),this.wireEditor(),document.addEventListener("selectionchange",this.onSelectionChange,{passive:!0}),this.updateToolbarState(),this.syncPreview()}ensureStructure(){this.toolbarEl=this.querySelector("nile-rte-toolbar"),this.previewEl=this.querySelector("nile-rte-preview"),this.containerEl=this.querySelector(".rte-container"),this.containerEl||(this.containerEl=document.createElement("div"),this.containerEl.className="rte-container",this.appendChild(this.containerEl)),this.ensureEditor(),this.toolbarEl&&this.toolbarEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.toolbarEl),this.editorEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.editorEl),this.previewEl&&(this.previewEl.parentElement!==this&&this.appendChild(this.previewEl),this.previewEl.previousElementSibling!==this.containerEl&&this.insertBefore(this.previewEl,this.containerEl.nextSibling))}updateContentWithMention(e){this.updateContent(),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content,mention:e},bubbles:!0,composed:!0}))}disconnectedCallback(){document.removeEventListener("selectionchange",this.onSelectionChange),this.mentionsEl&&this.mentionsEl.detach&&this.mentionsEl.detach(),super.disconnectedCallback()}updated(e){e.has("value")&&this.editorEl&&this.value!==this.editorEl.innerHTML&&(this.editorEl.innerHTML=this.value||"<p><br></p>",this.content=this.editorEl.innerHTML,this.syncPreview()),e.has("singleLineEditor")&&(this.editorEl&&this.editorEl.classList.toggle("single-line",this.singleLineEditor),this.previewEl&&this.previewEl.classList.toggle("single-line",this.singleLineEditor))}ensureEditor(){if(this.editorEl=this.querySelector(".editor"),!this.editorEl){const e=document.createElement("article");e.className="editor",e.setAttribute("contenteditable","true"),this.editorEl=e}this.placeholder&&(this.editorEl.dataset.placeholder=this.placeholder),this.editorEl.innerHTML.trim()||(this.editorEl.innerHTML="<p><br></p>")}unwrapMention(e,t=!0){const i=e.parentNode;if(!i)return;const M=t?(e.textContent??"").replace(/\u200B/g,""):"",n=document.createTextNode(M);i.insertBefore(n,e),i.removeChild(e);const o=document.createRange();o.setStartAfter(n),o.collapse(!0);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(o)}scrubBrokenMentions(){if(!this.editorEl)return;this.editorEl.querySelectorAll("span.mention").forEach((e=>{const t=e,i=t.getAttribute("data-mention-key"),M=t.getAttribute("data-mention-label"),n=t.getAttribute("data-mention-trigger")||"",o=(t.textContent??"").replace(/\u200B/g,"").trim(),r=!!i&&!!M&&o.length>0&&o.startsWith(n)&&o.includes(M);o&&r||this.unwrapMention(t,!0)}))}wireEditor(){this.editorEl.addEventListener("input",(()=>{this.ensureAtLeastOneParagraph(),this.scrubBrokenMentions(),this.updateContent(),this.updateToolbarState()})),this.editorEl.addEventListener("mouseup",(()=>{this.saveSelection(),this.updateToolbarState()})),this.editorEl.addEventListener("keyup",(e=>{this.saveSelection(),["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key)&&this.updateToolbarState()})),this.editorEl.addEventListener("keydown",this.onEditorKeydown)}wireAuthoredToolbar(e){this.buttonMap.clear(),this.headingSelect=null,this.fontSelect=null,this.colorInput=null,Array.from(e.children).forEach((e=>{const t=e.tagName.toLowerCase();if("nile-rte-select"!==t||"align"!==e.getAttribute("type")){if("nile-rte-link"===t)return e.editorEl=this.editorEl,void e.addEventListener("link-changed",(()=>{this.updateContent(),this.updateToolbarState()}));if("nile-rte-toolbar-item"===t){let t=e.querySelector(":scope > nile-button");const i=e.getAttribute("name")||"",M=e.getAttribute("label")||i,n=e.getAttribute("icon"),o=e.innerHTML.trim().length>0;if(t||(t=document.createElement("nile-button"),t.variant="tertiary",t.size="small"),n)t.innerHTML=`<nile-icon name="${n}" aria-label="${M}"></nile-icon>`,e.innerHTML="";else if(o)t.innerHTML=e.innerHTML,e.innerHTML="";else{const n=qS[i];n?t.innerHTML=`<nile-icon name="${n}" size="20" color="black" aria-label="${M}"></nile-icon>`:t.textContent=M||i,e.innerHTML=""}if(!t.isConnected){const i=document.createElement("nile-lite-tooltip");i.setAttribute("content",M),i.appendChild(t),e.appendChild(i)}t.setAttribute("aria-label",M),t.addEventListener("mousedown",(e=>e.preventDefault())),t.addEventListener("click",(()=>this.onToolbarCommand(i)));const r=this.buttonMap.get(i)??[];return r.push(t),void this.buttonMap.set(i,r)}if("nile-rte-select"!==t)"nile-rte-color"!==t||e.addEventListener("change",(e=>{this.focusAndRestore();const{mode:t,value:i}=e.detail;"backColor"===t?FS(this.editorEl,"backgroundColor",i,"data-rte-bg"):function(e,t){FS(e,"color",t,"data-rte-color")}(this.editorEl,i),this.updateContent(),this.updateToolbarState()}));else{const t=e.getAttribute("type")||"";e.addEventListener("change",(e=>{this.focusAndRestore();const i=e.detail;"heading"===t?function(e,t){const i=document.getSelection();if(!i||0===i.rangeCount)return;const M=WS(i.getRangeAt(0).startContainer,e);if(!M)return;if(M.tagName.toLowerCase()===t)return;const n=document.createElement(t);for(;M.firstChild;)n.appendChild(M.firstChild);M.replaceWith(n);const o=document.createRange();o.selectNodeContents(n),o.collapse(!0),i.removeAllRanges(),i.addRange(o)}(this.editorEl,i):"font"===t&&GS(this.editorEl,i),this.updateContent(),this.updateToolbarState()}))}}else e.addEventListener("change",(e=>{this.focusAndRestore();const t=e.detail;PS(this.editorEl,t),this.updateContent(),this.updateToolbarState()}))}))}saveSelection(){const e=window.getSelection();e&&e.rangeCount&&(this.lastRange=e.getRangeAt(0).cloneRange())}restoreSelection(){if(!this.lastRange)return;const e=document.getSelection();e&&(e.removeAllRanges(),e.addRange(this.lastRange))}focusAndRestore(){this.editorEl?.focus(),this.restoreSelection()}getCleanContent(){const e=this.editorEl.cloneNode(!0);return e.querySelectorAll("*").forEach((e=>{e.removeAttribute("style")})),e.innerHTML}insertList(e){if(this.restoreSelection(),!this.lastRange)return;const t=document.createElement(e),i=this.lastRange.extractContents(),M=document.createElement("div");M.appendChild(i),Array.from(M.childNodes).forEach((e=>{if(e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim())return;const i=document.createElement("li");i.appendChild(e),t.appendChild(i)})),this.lastRange.insertNode(t),this.afterListEdit(t)}afterListEdit(e){const t=document.createRange();t.setStartAfter(e),t.collapse(!0);const i=window.getSelection();i?.removeAllRanges(),i?.addRange(t),this.saveSelection(),this.updateContent(),this.updateToolbarState()}ensureAtLeastOneParagraph(){const e=this.editorEl;if(!e)return;const t=""===(e.textContent??"").replace(/\u200B/g,"").trim();if(0===e.childNodes.length||t)return void(e.innerHTML="<p><br></p>");if(!e.querySelector("p,h1,h2,h3,h4,h5,h6,ul,ol,table,blockquote,pre")){const t=document.createElement("p");for(;e.firstChild;)t.appendChild(e.firstChild);return t.hasChildNodes()||t.appendChild(document.createElement("br")),void e.appendChild(t)}e.querySelectorAll("p").forEach((e=>{""===(e.textContent??"").replace(/\u200B/g,"")&&(e.innerHTML.toLowerCase().includes("<br")||(e.innerHTML="<br>"))}))}onToolbarCommand(e){switch(this.focusAndRestore(),e){case"bold":RS(this.editorEl,"strong");break;case"italic":RS(this.editorEl,"em");break;case"underline":RS(this.editorEl,"u");break;case"left":PS(this.editorEl,"left");break;case"center":PS(this.editorEl,"center");break;case"right":PS(this.editorEl,"right");break;case"justify":PS(this.editorEl,"justify");break;case"ul":$S(this.editorEl,"ul"),this.updateContent(),this.updateToolbarState();break;case"ol":$S(this.editorEl,"ol"),this.updateContent(),this.updateToolbarState();break;case"link":break;case"clear":const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),t=[];for(;e.nextNode();){const i=e.currentNode;i.removeAttribute("style"),["B","STRONG","I","EM","U","SPAN","FONT"].includes(i.tagName)&&t.push(i)}for(const e of t){for(;e.firstChild;)e.parentNode?.insertBefore(e.firstChild,e);e.remove()}this.ensureAtLeastOneParagraph()}this.updateContent(),this.updateToolbarState()}setBtnActive(e,t){const i=this.buttonMap.get(e);if(i)for(const e of i)e.toggleAttribute("data-active",!!t)}updateToolbarState(){if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);if(!this.editorEl.contains(t.commonAncestorContainer))return;const i=function(e){for(;e&&!(e instanceof HTMLElement);)e=e.parentNode;return e}(t.startContainer)||this.editorEl,M=getComputedStyle(i),n=WS(t.startContainer,this.editorEl)||this.editorEl,o=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("strong"===t||"b"===t)return!0;const i=getComputedStyle(e).fontWeight;if(parseInt(i,10)>=600)return!0}e=e.parentNode}return!1})(),r=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("em"===t||"i"===t)return!0;if("italic"===getComputedStyle(e).fontStyle)return!0}e=e.parentNode}return!1})(),s=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=getComputedStyle(e).textDecorationLine;if(t&&t.includes("underline"))return!0;if("u"===e.tagName.toLowerCase())return!0}e=e.parentNode}return!1})(),a=!!i.closest("a"),l=n.style.textAlign||getComputedStyle(n).textAlign||"start",N="start"===l?"left":l,g=!!i.closest("li")&&i.closest("ul,ol")?.tagName.toLowerCase()||"";if(this.setBtnActive("bold",o),this.setBtnActive("italic",r),this.setBtnActive("underline",s),this.setBtnActive("link",a),this.setBtnActive("left","left"===N&&!["center","right","justify"].includes(N)),this.setBtnActive("center","center"===N),this.setBtnActive("right","right"===N),this.setBtnActive("justify","justify"===N),this.setBtnActive("ul","ul"===g),this.setBtnActive("ol","ol"===g),this.headingSelect){const e=n.tagName.toLowerCase(),t=["h1","h2","h3"].includes(e)?e:"p";this.headingSelect.value!==t&&(this.headingSelect.value=t)}if(this.fontSelect){const e=(M.fontFamily||"").replace(/["']/g,"").split(",")[0].trim().toLowerCase();if(e)for(const t of Array.from(this.fontSelect.options))if(t.value.toLowerCase()===e){this.fontSelect.value=t.value;break}}if(this.colorInput){const e=BS(M.color);e&&this.colorInput.value.toLowerCase()!==e.toLowerCase()&&(this.colorInput.value=e),this.colorSwatchEl&&(this.colorSwatchEl.style.backgroundColor=this.colorInput.value)}if(this.bgColorInput){const e=getComputedStyle(i).backgroundColor;if(e&&!/transparent|rgba\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e)){const t=BS(e);t&&this.bgColorInput.value.toLowerCase()!==t.toLowerCase()&&(this.bgColorInput.value=t)}this.bgSwatchEl&&(this.bgSwatchEl.style.backgroundColor=this.bgColorInput.value)}}syncPreview(){this.updateContent()}getComputedImportantProps(){return Array.from(new Set([...KS,...this.whitelist??[]]))}updateContent(){if(!this.editorEl)return;this.ensureAtLeastOneParagraph();const e=""===(this.editorEl.textContent??"").trim();this.editorEl.classList.toggle("empty",e);const t=this.editorEl.cloneNode(!0);if(this.noStyles)t.querySelectorAll("[style]").forEach((e=>e.removeAttribute("style")));else{const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT),M=this.getComputedImportantProps();for(;e.nextNode()&&i.nextNode();){const t=e.currentNode,n=i.currentNode,o=window.getComputedStyle(t),r=M.map((e=>`${e}:${o.getPropertyValue(e)}`)).join(";");r.trim()&&n.setAttribute("style",r)}}this.content=t.innerHTML,this.previewEl&&(this.previewEl.innerHTML=this.content),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content},bubbles:!0,composed:!0}))}};e([ce({type:String,attribute:!0,reflect:!0})],em.prototype,"value",void 0),e([ce({type:Boolean,attribute:!0,reflect:!0})],em.prototype,"noStyles",void 0),e([ce({type:Boolean,attribute:"singlelineeditor",reflect:!0})],em.prototype,"singleLineEditor",void 0),e([ce({type:String})],em.prototype,"placeholder",void 0),e([ce({attribute:"mentions",reflect:!0,converter:{fromAttribute:e=>{try{const t=JSON.parse(e),i={};for(const e of Object.keys(t)){const M=t[e];Array.isArray(M)&&(i[e]=M.filter((e=>e&&"string"==typeof e.key&&"string"==typeof e.label)).map((e=>({key:e.key,label:e.label}))))}return i}catch{return{}}},toAttribute:e=>JSON.stringify(e)}})],em.prototype,"mentions",void 0),e([ce({attribute:"whitelist",reflect:!1,converter:{fromAttribute:e=>{try{const t=JSON.parse(e);return Array.isArray(t)?t.filter((e=>"string"==typeof e)):[]}catch{return[]}}}})],em.prototype,"whitelist",void 0),e([De()],em.prototype,"content",void 0),em=e([Ne("nile-rich-text-editor")],em);"undefined"!=typeof window&&(window.nileElementsVersion='"1.4.8-beta-1.2"',window.nileVersion="__NILE_VERSION__",window.process=window.process||{env:{NODE_ENV:"production"}});const tm=r`
|
|
15141
15167
|
:host {
|
|
15142
15168
|
|
|
15143
15169
|
top: 0;
|
|
@@ -15754,7 +15780,7 @@ border: none;
|
|
|
15754
15780
|
max-width: var(--auto-size-available-width) !important;
|
|
15755
15781
|
max-height: var(--auto-size-available-height) !important;
|
|
15756
15782
|
}
|
|
15757
|
-
`;let Am=class extends Re{constructor(){super(...arguments),this.open=!1,this.placement="bottom-start",this.disabled=!1,this.stayOpenOnSelect=!1,this.distance=0,this.skidding=0,this.hoist=!1,this.triggerDropdown="click"}connectedCallback(){super.connectedCallback(),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.handleTriggerMouseEnter=this.handleTriggerMouseEnter.bind(this),this.handleTriggerMouseLeave=this.handleTriggerMouseLeave.bind(this),this.containingElement||(this.containingElement=this),this.emit("nile-init")}firstUpdated(){if(this.panel.hidden=!this.open,"hover"===this.triggerDropdown){const e=this.trigger;e&&(e.addEventListener("mouseenter",this.handleTriggerMouseEnter),e.addEventListener("mouseleave",this.handleTriggerMouseLeave)),this.panel&&(this.panel.addEventListener("mouseenter",this.handleTriggerMouseEnter),this.panel.addEventListener("mouseleave",this.handleTriggerMouseLeave))}this.open&&(this.addOpenListeners(),this.popup.active=!0)}handleTriggerMouseEnter(){clearTimeout(this.hoverTimeout),this.show()}handleTriggerMouseLeave(){clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.hide()),200)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.hide(),this.emit("nile-destroy")}focusOnTrigger(){const e=this.trigger.assignedElements({flatten:!0})[0];"function"==typeof e?.focus&&e.focus()}getMenu(){return this.panel.assignedElements({flatten:!0}).find((e=>"nile-menu"===e.tagName.toLowerCase()))}handleKeyDown(e){this.open&&"Escape"===e.key&&(e.stopPropagation(),this.hide(),this.focusOnTrigger())}handleDocumentKeyDown(e){if("Escape"===e.key&&this.open)return e.stopPropagation(),this.focusOnTrigger(),void this.hide();"Tab"===e.key&&setTimeout((()=>{const e=this.containingElement?.getRootNode()instanceof ShadowRoot?document.activeElement?.shadowRoot?.activeElement:document.activeElement;this.containingElement&&e?.closest(this.containingElement.tagName.toLowerCase())===this.containingElement||this.hide()}))}handleDocumentMouseDown(e){const t=e.composedPath();this.containingElement&&!t.includes(this.containingElement)&&this.hide()}handlePanelSelect(e){const t=e.target;this.stayOpenOnSelect||"nile-menu"!==t.tagName.toLowerCase()||(this.hide(),this.focusOnTrigger())}handleTriggerClick(){this.open?this.hide():(this.show(),this.focusOnTrigger())}handleTriggerKeyDown(e){const t=this.getMenu();if(t){const i=t.getAllItems(),M=i[0],n=i[i.length-1];["ArrowDown","ArrowUp","Home","End"].includes(e.key)&&(e.preventDefault(),this.open||this.show(),i.length>0&&this.updateComplete.then((()=>{"ArrowDown"!==e.key&&"Home"!==e.key||(t.setCurrentItem(M),M.focus()),"ArrowUp"!==e.key&&"End"!==e.key||(t.setCurrentItem(n),n.focus())})))}}handleTriggerKeyUp(e){" "===e.key&&e.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}updateAccessibleTrigger(){const e=this.trigger.assignedElements({flatten:!0}).find((e=>Et(e).start));let t;if(e){switch(e.tagName.toLowerCase()){case"nile-button":case"nile-icon-button":t=e.button;break;default:t=e}t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded",this.open?"true":"false")}}async show(){if(!this.open)return this.open=!0,St(this,"nile-after-show")}async hide(){if(this.open)return this.open=!1,St(this,"nile-after-hide")}reposition(){this.popup.reposition()}addOpenListeners(){this.panel.addEventListener("nile-select",this.handlePanelSelect),this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){this.panel&&(this.panel.removeEventListener("nile-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}async handleOpenChange(){if(this.disabled)this.open=!1;else if(this.updateAccessibleTrigger(),this.open){this.emit("nile-show"),this.addOpenListeners(),await jt(this),this.panel.hidden=!1,this.popup.active=!0;const{keyframes:e,options:t}=yt(this,"dropdown.show",{dir:""});await ut(this.popup.popup,e,t),this.emit("nile-after-show")}else{this.emit("nile-hide"),this.removeOpenListeners(),await jt(this);const{keyframes:e,options:t}=yt(this,"dropdown.hide",{dir:""});await ut(this.popup.popup,e,t),this.panel.hidden=!0,this.popup.active=!1,this.emit("nile-after-hide")}}render(){return R`
|
|
15783
|
+
`;class Am{static calculateAvailableSpace(e){const t=e.getBoundingClientRect(),i=window.innerHeight,M=window.innerWidth,n=i-t.bottom,o=t.top,r=M-t.right;return{spaceAbove:o,spaceBelow:n,spaceLeft:t.left,spaceRight:r,viewportHeight:i,viewportWidth:M}}static getOptimalPlacement(e){const{spaceAbove:t,spaceBelow:i,spaceLeft:M,spaceRight:n}=this.calculateAvailableSpace(e);return i>=200&&i>=t?"bottom":t>=200&&t>i?"top":n>=200&&n>=M?"right":M>=200?"left":"bottom"}static findBoundaryElements(e){const t=[];let i=e.parentElement;for(;i&&i!==document.body;){const e=window.getComputedStyle(i),M=e.overflow,n=e.overflowY,o=e.overflowX;"auto"!==M&&"scroll"!==M&&"auto"!==n&&"scroll"!==n&&"auto"!==o&&"scroll"!==o||t.push(i),(i.hasAttribute("data-floating-boundary")||i.classList.contains("floating-boundary")||i.classList.contains("scroll-container"))&&t.push(i),i=i.parentElement}return t.length>0?t:void 0}static calculateOptimalHeight(e,t,i){const M=t-(e.y+e.height),n=e.y;return i.startsWith("top")?Math.max(n-20,100):i.startsWith("bottom")?Math.max(M-20,100):(i.startsWith("left")||i.startsWith("right"),Math.max(Math.min(n,M)-20,100))}static extractStylesAsCSS(e){return"string"==typeof e?e:Array.isArray(e)?e.map((e=>this.extractStylesAsCSS(e))).join("\n"):e&&"object"==typeof e&&e.cssText?e.cssText:""}static generateStyleId(){return`nile-dropdown-styles-${Math.random().toString(36).substring(2,11)}`}static isPositioningOptimal(e,t){const{spaceAbove:i,spaceBelow:M,spaceLeft:n,spaceRight:o}=this.calculateAvailableSpace(t),r=e.startsWith("top"),s=e.startsWith("bottom"),a=e.startsWith("left"),l=e.startsWith("right");return!(r&&M>i)&&(!(s&&i>M)&&(!(a&&o>n)&&!(l&&n>o)))}static applyCollisionData(e,t,i){if(t.flip){const{overflows:M}=t.flip;if(e.setAttribute("data-placement",i),M&&M.length>0){const t=M.map((e=>e.placement)).join(",");e.setAttribute("data-overflow",t)}else e.removeAttribute("data-overflow")}if(t.shift){const{x:i,y:M}=t.shift;void 0===i||void 0===M||0===i&&0===M?e.removeAttribute("data-shift"):e.setAttribute("data-shift",`${i},${M}`)}if(t.size){const{availableWidth:i,availableHeight:M}=t.size;void 0!==i&&e.setAttribute("data-available-width",i.toString()),void 0!==M&&e.setAttribute("data-available-height",M.toString())}}}class Om{static createPortalPanel(e){const t=e.shadowRoot?.querySelector(".dropdown__panel");if(!t){const t=e.querySelector("[slot]");if(!t||"trigger"===t.getAttribute("slot"))return document.createElement("div")}let i=t?.assignedElements({flatten:!0})||[];if(0===i.length){i=Array.from(e.children).filter((e=>{const t=e.getAttribute("slot");return!t||"trigger"!==t}))}const M=document.createElement("div");return M.className="dropdown__panel",M.setAttribute("part","panel"),M.setAttribute("aria-hidden","false"),M.setAttribute("aria-labelledby","dropdown"),i.forEach((e=>{const t=e.cloneNode(!0);M.appendChild(t)})),M}static updatePortalPanel(e,t){if(!e)return;e.innerHTML="";const i=t.shadowRoot?.querySelector(".dropdown__panel");let M=i?.assignedElements({flatten:!0})||[];if(0===M.length){M=Array.from(t.children).filter((e=>{const t=e.getAttribute("slot");return!t||"trigger"!==t}))}M.forEach((t=>{const i=t.cloneNode(!0);e.appendChild(i)}))}}class pm{static setupPortalEventListeners(e,t){e&&(this.setupMenuSelectListeners(e,t),this.setupKeyDownListeners(e,t))}static setupMenuSelectListeners(e,t){e&&e.addEventListener("nile-select",(e=>{const i=e;t.handlePanelSelect&&t.handlePanelSelect(i)}))}static setupKeyDownListeners(e,t){e&&e.addEventListener("keydown",(e=>{t.handleKeyDown&&t.handleKeyDown(e)}))}}class xm{constructor(e){this.portalContainer=null,this.measuredPanelHeight=null,this.clonedPanel=null,this.cleanupAutoUpdate=null,this.currentPlacement="bottom-start",this.currentMiddlewareData=null,this.boundHandleWindowResize=null,this.component=e}createPortalAppendContainer(){const e=document.createElement("div");return e.style.position="absolute",e.style.zIndex="9999",e.style.pointerEvents="none",e.style.width="auto",e.style.maxWidth="none",e.style.minWidth="auto",e.className="nile-dropdown-portal-append",e}positionPortalAppend(){this.portalContainer&&this.component.open&&(this.measurePanelHeight(),this.computeFloatingUIPosition())}measurePanelHeight(){!this.measuredPanelHeight&&this.portalContainer&&(this.portalContainer.style.position="absolute",this.portalContainer.style.visibility="hidden",this.portalContainer.style.top="0px",this.portalContainer.style.left="0px",this.portalContainer.offsetHeight,this.measuredPanelHeight=this.portalContainer.offsetHeight,this.portalContainer.style.visibility="")}async computeFloatingUIPosition(){if(!this.portalContainer)return;const e=this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component,t=this.portalContainer;try{const{x:i,y:M,placement:n,middlewareData:o}=await this.calculateFloatingUIPosition(e,t);this.applyFloatingUIPosition(t,e,i,M,n,o)}catch(e){console.warn("Floating UI positioning failed, falling back to simple positioning:",e),this.fallbackPositioning()}}async calculateFloatingUIPosition(e,t){const i=Am.findBoundaryElements(e),M=this.getInitialPlacement(),n=this.createFloatingUIMiddleware(i);return await Ji(e,t,{placement:M,strategy:"fixed",middleware:n,platform:this.createCustomPlatform()})}getInitialPlacement(){return this.component.placement||"bottom-start"}createFloatingUIMiddleware(e){const t=[Bi(this.component.distance||0)];return this.component.sync&&t.push(Fi({apply:this.handleSizeMiddleware.bind(this),padding:10,boundary:e})),t.push(_i({fallbackPlacements:this.getFallbackPlacements(),fallbackStrategy:"bestFit",padding:10,boundary:e})),t.push(Gi({padding:10,crossAxis:!0,boundary:e})),t}handleSizeMiddleware({availableWidth:e,availableHeight:t,elements:i,rects:M}){const n=Am.calculateOptimalHeight(M.reference,window.innerHeight,this.currentPlacement);"width"!==this.component.sync&&"both"!==this.component.sync||(i.floating.style.width=`${M.reference.width}px`),"height"!==this.component.sync&&"both"!==this.component.sync||(i.floating.style.height=`${M.reference.height}px`),i.floating.style.maxHeight=`${n}px`,i.floating.style.setProperty("--auto-size-available-width",`${e}px`),i.floating.style.setProperty("--auto-size-available-height",`${n}px`)}getFallbackPlacements(){const e=this.component.placement||"bottom-start",t=[];return e.startsWith("top")?t.push("bottom-start","bottom","bottom-end","top","top-end","right-start","left-start"):e.startsWith("bottom")?t.push("top-start","top","top-end","bottom","bottom-end","right-start","left-start"):e.startsWith("left")?t.push("right-start","right","right-end","left","left-end","top-start","bottom-start"):e.startsWith("right")&&t.push("left-start","left","left-end","right","right-end","top-start","bottom-start"),t}createCustomPlatform(){return Wi}applyFloatingUIPosition(e,t,i,M,n,o){const r=t.getBoundingClientRect();Object.assign(e.style,{left:`${i}px`,top:`${M}px`,position:"fixed",pointerEvents:"auto",width:"auto",minWidth:"auto"}),"width"!==this.component.sync&&"both"!==this.component.sync||(e.style.width=`${r.width}px`),this.currentPlacement=n,this.currentMiddlewareData=o,Am.applyCollisionData(e,o,n);const s=n.split("-")[0];e.className=`nile-dropdown-portal-append dropdown--open dropdown__panel--${s}`}fallbackPositioning(){if(!this.portalContainer)return;const e=(this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component).getBoundingClientRect(),t=window.innerHeight,i=window.innerWidth,M=t-e.bottom,n=e.top,o=i-e.right,r=e.left;let s,a,l,N=e.left;const g=this.component.placement||"bottom-start";g.startsWith("bottom")?(l=Math.max(M-20,100),s=e.bottom+(this.component.distance||0),a="bottom"):g.startsWith("top")?(l=Math.max(n-20,100),s=Math.max(e.top-l-(this.component.distance||0),10),a="top"):g.startsWith("right")?(l=Math.max(Math.min(o,M,n)-20,100),s=e.top,N=e.right+(this.component.distance||0),a="right"):(l=Math.max(Math.min(r,M,n)-20,100),s=e.top,N=Math.max(e.left-200-(this.component.distance||0),10),a="left"),this.portalContainer.style.left=`${N}px`,this.portalContainer.style.top=`${s}px`,this.portalContainer.style.maxHeight=`${l}px`,this.portalContainer.style.pointerEvents="auto",this.portalContainer.style.width="auto",this.portalContainer.style.minWidth="auto","width"!==this.component.sync&&"both"!==this.component.sync||(this.portalContainer.style.width=`${e.width}px`),this.portalContainer.className=`nile-dropdown-portal-append dropdown__panel--${a}`,this.calculateAndSetAutoSizeProperties(e,s,a)}calculateAndSetAutoSizeProperties(e,t,i){if(!this.portalContainer)return;const M=window.innerHeight,n=window.innerWidth;let o,r=n-e.left-10;"top"===i?o=e.top-10:"bottom"===i?o=M-e.bottom-10:"left"===i?(o=Math.min(M-e.top,e.bottom),r=e.left-10):(o=Math.min(M-e.top,e.bottom),r=n-e.right-10),this.portalContainer.style.setProperty("--auto-size-available-height",`${Math.max(o,100)}px`),this.portalContainer.style.setProperty("--auto-size-available-width",`${Math.max(r,200)}px`)}updatePortalAppendPosition(){this.component.portal&&this.portalContainer&&this.positionPortalAppend()}handleWindowResize(){this.component.portal&&this.portalContainer&&this.positionPortalAppend()}setupAutoUpdatePositioning(){if(!this.portalContainer||!this.component)return;this.cleanupAutoUpdatePositioning();const e=this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component;this.cleanupAutoUpdate=Ri(e,this.portalContainer,(()=>{this.computeFloatingUIPosition()}),{ancestorScroll:!0,ancestorResize:!0,elementResize:!0,layoutShift:!0,animationFrame:!0})}cleanupAutoUpdatePositioning(){this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null)}injectStylesToDocument(){if(!this.portalContainer)return;const e=Am.generateStyleId();if(document.getElementById(e))return;const t=this.component.constructor.styles;if(!t)return;const i=document.createElement("style");i.id=e,i.textContent=Am.extractStylesAsCSS(t),document.head.appendChild(i),this.portalContainer.__injectedStyleId=e}adoptStylesToPortalAppend(){this.portalContainer&&this.injectStylesToDocument()}setupPortalAppend(){this.component.portal&&this.component.updateComplete.then((()=>{setTimeout((()=>{this.component.open&&(this.clonedPanel=this.createPortalPanel(),this.portalContainer=this.createPortalAppendContainer(),this.portalContainer.appendChild(this.clonedPanel),document.body.appendChild(this.portalContainer),this.adoptStylesToPortalAppend(),this.clonedPanel.style.display="",this.positionPortalAppend(),this.setupPortalEventListeners(),this.setupAutoUpdatePositioning(),this.boundHandleWindowResize=this.handleWindowResize.bind(this),window.addEventListener("resize",this.boundHandleWindowResize))}),10)}))}createPortalPanel(){return Om.createPortalPanel(this.component)}setupPortalEventListeners(){pm.setupPortalEventListeners(this.clonedPanel,this.component)}cleanupPortalAppend(){if(this.cleanupAutoUpdatePositioning(),this.portalContainer&&this.portalContainer.parentNode){const e=this.portalContainer.__injectedStyleId;if(e){const t=document.getElementById(e);t&&t.remove()}this.portalContainer.parentNode.removeChild(this.portalContainer)}this.boundHandleWindowResize&&(window.removeEventListener("resize",this.boundHandleWindowResize),this.boundHandleWindowResize=null),this.portalContainer=null,this.clonedPanel=null,this.measuredPanelHeight=null,this.currentPlacement="bottom-start",this.currentMiddlewareData=null}get portalContainerElement(){return this.portalContainer}resetMeasuredHeight(){this.measuredPanelHeight=null}forceReposition(){this.portalContainer&&this.computeFloatingUIPosition()}getCurrentPlacement(){return this.currentPlacement}getCurrentMiddlewareData(){return this.currentMiddlewareData}isUsingFloatingUI(){return null!==this.cleanupAutoUpdate}isPositioningOptimal(){if(!this.portalContainer||!this.currentMiddlewareData)return!0;const e=(this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component).getBoundingClientRect(),t=window.innerHeight-e.bottom,i=e.top,M=this.currentPlacement.startsWith("top"),n=this.currentPlacement.startsWith("bottom");return!(M&&t>i)&&!(n&&i>t)}updatePortalPanel(){this.portalContainer&&this.clonedPanel&&(Om.updatePortalPanel(this.clonedPanel,this.component),this.forceReposition())}}let Lm=class extends Re{constructor(){super(...arguments),this.open=!1,this.placement="bottom-start",this.disabled=!1,this.stayOpenOnSelect=!1,this.distance=0,this.skidding=0,this.hoist=!1,this.portal=!1,this.portalManager=null,this.triggerDropdown="click"}connectedCallback(){super.connectedCallback(),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.handleTriggerMouseEnter=this.handleTriggerMouseEnter.bind(this),this.handleTriggerMouseLeave=this.handleTriggerMouseLeave.bind(this),this.containingElement||(this.containingElement=this),this.emit("nile-init"),requestAnimationFrame((()=>{this.portal&&!this.portalManager&&(this.portalManager=new xm(this))}))}firstUpdated(){if(this.panel.hidden=!this.open,"hover"===this.triggerDropdown){const e=this.trigger;e&&(e.addEventListener("mouseenter",this.handleTriggerMouseEnter),e.addEventListener("mouseleave",this.handleTriggerMouseLeave)),this.panel&&(this.panel.addEventListener("mouseenter",this.handleTriggerMouseEnter),this.panel.addEventListener("mouseleave",this.handleTriggerMouseLeave))}this.open&&(this.addOpenListeners(),this.popup.active=!0)}handleTriggerMouseEnter(){clearTimeout(this.hoverTimeout),this.show()}handleTriggerMouseLeave(){clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.hide()),200)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.hide(),this.emit("nile-destroy"),this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null)}focusOnTrigger(){const e=this.trigger.assignedElements({flatten:!0})[0];"function"==typeof e?.focus&&e.focus()}getMenu(){return this.panel.assignedElements({flatten:!0}).find((e=>"nile-menu"===e.tagName.toLowerCase()))}handleKeyDown(e){this.open&&"Escape"===e.key&&(e.stopPropagation(),this.hide(),this.focusOnTrigger())}handleDocumentKeyDown(e){if("Escape"===e.key&&this.open)return e.stopPropagation(),this.focusOnTrigger(),void this.hide();"Tab"===e.key&&setTimeout((()=>{const e=this.containingElement?.getRootNode()instanceof ShadowRoot?document.activeElement?.shadowRoot?.activeElement:document.activeElement,t=this.containingElement&&e?.closest(this.containingElement.tagName.toLowerCase())===this.containingElement,i=this.portal&&this.portalManager?.portalContainerElement&&(e===this.portalManager.portalContainerElement||e?.closest(".nile-dropdown-portal-append")===this.portalManager.portalContainerElement);t||i||this.hide()}))}handleDocumentMouseDown(e){const t=e.composedPath(),i=this.containingElement&&t.includes(this.containingElement),M=this.portal&&this.portalManager?.portalContainerElement&&t.includes(this.portalManager.portalContainerElement);i||M||this.hide()}handlePanelSelect(e){const t=e.target;this.stayOpenOnSelect||"nile-menu"!==t.tagName.toLowerCase()||(this.hide(),this.focusOnTrigger())}handleTriggerClick(){this.open?this.hide():(this.show(),this.focusOnTrigger())}handleTriggerKeyDown(e){const t=this.getMenu();if(t){const i=t.getAllItems(),M=i[0],n=i[i.length-1];["ArrowDown","ArrowUp","Home","End"].includes(e.key)&&(e.preventDefault(),this.open||this.show(),i.length>0&&this.updateComplete.then((()=>{"ArrowDown"!==e.key&&"Home"!==e.key||(t.setCurrentItem(M),M.focus()),"ArrowUp"!==e.key&&"End"!==e.key||(t.setCurrentItem(n),n.focus())})))}}handleTriggerKeyUp(e){" "===e.key&&e.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}updateAccessibleTrigger(){const e=this.trigger.assignedElements({flatten:!0}).find((e=>Et(e).start));let t;if(e){switch(e.tagName.toLowerCase()){case"nile-button":case"nile-icon-button":t=e.button;break;default:t=e}t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded",this.open?"true":"false")}}async show(){if(!this.open)return this.open=!0,St(this,"nile-after-show")}async hide(){if(this.open)return this.open=!1,St(this,"nile-after-hide")}reposition(){this.popup.reposition()}addOpenListeners(){this.panel.addEventListener("nile-select",this.handlePanelSelect),this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){this.panel&&(this.panel.removeEventListener("nile-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}updated(e){super.updated(e),e.has("portal")&&(this.portal&&!this.portalManager?(this.portalManager=new xm(this),this.open&&this.portalManager.setupPortalAppend()):!this.portal&&this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null))}async handleOpenChange(){if(this.disabled)this.open=!1;else if(this.updateAccessibleTrigger(),this.open){if(this.emit("nile-show"),this.addOpenListeners(),this.portal&&this.portalManager?this.portalManager.setupPortalAppend():this.portal&&!this.portalManager&&(this.portalManager=new xm(this),this.portalManager.setupPortalAppend()),await jt(this),!this.portal){this.panel.hidden=!1,this.popup.active=!0;const{keyframes:e,options:t}=yt(this,"dropdown.show",{dir:""});await ut(this.popup.popup,e,t)}this.emit("nile-after-show")}else{if(this.emit("nile-hide"),this.removeOpenListeners(),this.portal&&this.portalManager&&this.portalManager.cleanupPortalAppend(),await jt(this),!this.portal){const{keyframes:e,options:t}=yt(this,"dropdown.hide",{dir:""});await ut(this.popup.popup,e,t),this.panel.hidden=!0,this.popup.active=!1}this.emit("nile-after-hide")}}render(){return R`
|
|
15758
15784
|
<nile-popup
|
|
15759
15785
|
part="base"
|
|
15760
15786
|
id="sidebar-action-dropdown"
|
|
@@ -15785,9 +15811,10 @@ border: none;
|
|
|
15785
15811
|
class="dropdown__panel"
|
|
15786
15812
|
aria-hidden=${this.open?"false":"true"}
|
|
15787
15813
|
aria-labelledby="sidebar-action-dropdown"
|
|
15814
|
+
style=${this.portal&&this.portalManager?"display: none;":""}
|
|
15788
15815
|
></slot>
|
|
15789
15816
|
</nile-popup>
|
|
15790
|
-
`}};
|
|
15817
|
+
`}};Lm.styles=[ym],e([Ie(".dropdown")],Lm.prototype,"popup",void 0),e([Ie(".dropdown__trigger")],Lm.prototype,"trigger",void 0),e([Ie(".dropdown__panel")],Lm.prototype,"panel",void 0),e([ce({type:Boolean,reflect:!0})],Lm.prototype,"open",void 0),e([ce({reflect:!0})],Lm.prototype,"placement",void 0),e([ce({type:Boolean,reflect:!0})],Lm.prototype,"disabled",void 0),e([ce({attribute:"stay-open-on-select",type:Boolean,reflect:!0})],Lm.prototype,"stayOpenOnSelect",void 0),e([ce({attribute:!1})],Lm.prototype,"containingElement",void 0),e([ce({type:Number})],Lm.prototype,"distance",void 0),e([ce({type:Number})],Lm.prototype,"skidding",void 0),e([ce()],Lm.prototype,"sync",void 0),e([ce({type:Boolean})],Lm.prototype,"hoist",void 0),e([ce({type:Boolean,reflect:!0})],Lm.prototype,"portal",void 0),e([ce({reflect:!0})],Lm.prototype,"triggerDropdown",void 0),e([We("open",{waitUntilFirstUpdate:!0})],Lm.prototype,"handleOpenChange",null),Lm=e([Ne("nile-side-bar-action")],Lm),Tt("dropdown.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),Tt("dropdown.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});const Sm=r`
|
|
15791
15818
|
:host {
|
|
15792
15819
|
display: block;
|
|
15793
15820
|
line-height: 20px;
|
|
@@ -15816,12 +15843,12 @@ border: none;
|
|
|
15816
15843
|
overflow: hidden;
|
|
15817
15844
|
text-overflow: ellipsis;
|
|
15818
15845
|
}
|
|
15819
|
-
`;let
|
|
15846
|
+
`;let mm=class extends Re{constructor(){super(...arguments),this.text="",this.subtext=""}static get styles(){return[Sm]}render(){return R`
|
|
15820
15847
|
<div class="footer-text" part="footer-text">
|
|
15821
15848
|
<div class="main" part="main">${this.text}</div>
|
|
15822
15849
|
${this.subtext?R`<div class="sub" part="sub">${this.subtext}</div>`:null}
|
|
15823
15850
|
</div>
|
|
15824
|
-
`}};e([ce({type:String})],
|
|
15851
|
+
`}};e([ce({type:String})],mm.prototype,"text",void 0),e([ce({type:String})],mm.prototype,"subtext",void 0),mm=e([Ne("nile-side-bar-footer-text")],mm);const Em=r`
|
|
15825
15852
|
:host {
|
|
15826
15853
|
box-sizing: border-box;
|
|
15827
15854
|
-webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));
|
|
@@ -15948,7 +15975,7 @@ border: none;
|
|
|
15948
15975
|
}
|
|
15949
15976
|
|
|
15950
15977
|
}
|
|
15951
|
-
`;let
|
|
15978
|
+
`;let wm=class extends Re{constructor(){super(...arguments),this.type="normal",this.checked=!1,this.value="",this.disabled=!1,this.hasSubMenu=!1}connectedCallback(){super.connectedCallback(),this.handleHostClick=this.handleHostClick.bind(this),this.addEventListener("click",this.handleHostClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleHostClick)}handleDefaultSlotChange(){const e=this.getTextLabel();void 0!==this.cachedTextLabel?e!==this.cachedTextLabel&&(this.cachedTextLabel=e,this.emit("slotchange")):this.cachedTextLabel=e}handleHostClick(e){this.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}handleCheckedChange(){if(this.checked&&"checkbox"!==this.type)return this.checked=!1,void console.error('The checked attribute can only be used on menu items with type="checkbox"',this);"checkbox"===this.type?this.setAttribute("aria-checked",this.checked?"true":"false"):this.removeAttribute("aria-checked")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleTypeChange(){"checkbox"===this.type?(this.setAttribute("role","menuitemcheckbox"),this.setAttribute("aria-checked",this.checked?"true":"false")):(this.setAttribute("role","menuitem"),this.removeAttribute("aria-checked"))}getTextLabel(){return Ze(this.defaultSlot)}render(){return R`
|
|
15952
15979
|
<div
|
|
15953
15980
|
part="base"
|
|
15954
15981
|
class=${pe({"menu-item":!0,"menu-item--checked":this.checked,"menu-item--disabled":this.disabled,"menu-item--has-submenu":this.hasSubMenu})}
|
|
@@ -15984,7 +16011,7 @@ border: none;
|
|
|
15984
16011
|
></nile-icon>
|
|
15985
16012
|
</span>`:""}
|
|
15986
16013
|
</div>
|
|
15987
|
-
`}};
|
|
16014
|
+
`}};wm.styles=Em,e([Ie("slot:not([name])")],wm.prototype,"defaultSlot",void 0),e([Ie(".menu-item")],wm.prototype,"menuItem",void 0),e([ce()],wm.prototype,"type",void 0),e([ce({type:Boolean,reflect:!0})],wm.prototype,"checked",void 0),e([ce()],wm.prototype,"value",void 0),e([ce({type:Boolean,reflect:!0})],wm.prototype,"disabled",void 0),e([ce({type:Boolean,reflect:!0})],wm.prototype,"hasSubMenu",void 0),e([We("checked")],wm.prototype,"handleCheckedChange",null),e([We("disabled")],wm.prototype,"handleDisabledChange",null),e([We("type")],wm.prototype,"handleTypeChange",null),wm=e([Ne("nile-side-bar-action-menu-item")],wm);const Qm=r`
|
|
15988
16015
|
:host {
|
|
15989
16016
|
display: block;
|
|
15990
16017
|
position: relative;
|
|
@@ -16044,7 +16071,7 @@ border: none;
|
|
|
16044
16071
|
.menu__footer:hover {
|
|
16045
16072
|
background-color:var(--nile-menu-item-background-color, var(--ng-colors-bg-secondary));
|
|
16046
16073
|
}
|
|
16047
|
-
`;let
|
|
16074
|
+
`;let km=class extends Re{constructor(){super(...arguments),this.searchValue="",this.searchWidth=0,this.searchEnabled=!1,this.customSearch=!1,this.showNoResults=!1,this.allowSpaceKey=!1,this.noResultsMessage="No results found",this.hasSlotController=new Ye(this,"menu__footer","menu__header")}connectedCallback(){super.connectedCallback(),this.setAttribute("role","menu")}handleClick(e){const t=e.target.closest("nile-menu-item");t?.hasSubMenu||t&&!t.disabled&&("checkbox"===t.type&&(t.checked=!t.checked),this.emit("nile-select",{value:t.value}))}handleKeyDown(e){if("Enter"===e.key){const t=this.getCurrentItem();e.preventDefault(),t?.click()}if(this.allowSpaceKey||" "!==e.key||e.preventDefault(),["ArrowDown","ArrowUp","Home","End"].includes(e.key)){const t=this.getAllItems(),i=this.getCurrentItem();let M=i?t.indexOf(i):0;t.length>0&&(e.preventDefault(),"ArrowDown"===e.key?M++:"ArrowUp"===e.key?M--:"Home"===e.key?M=0:"End"===e.key&&(M=t.length-1),M<0&&(M=t.length-1),M>t.length-1&&(M=0),this.setCurrentItem(t[M]),t[M].focus())}}handleMouseDown(e){const t=e.target;this.isMenuItem(t)&&this.setCurrentItem(t)}handleSlotChange(){const e=this.getAllItems();e.length>0&&this.setCurrentItem(e[0])}isMenuItem(e){return"nile-menu-item"===e.tagName.toLowerCase()||["menuitem","menuitemcheckbox","menuitemradio"].includes(e.getAttribute("role")??"")}getAllItems(){return[...this.defaultSlot.assignedElements({flatten:!0})].filter((e=>!!this.isMenuItem(e)))}getCurrentItem(){return this.getAllItems().find((e=>"0"===e.getAttribute("tabindex")))}setCurrentItem(e){this.getAllItems().forEach((t=>{t.setAttribute("tabindex",t===e?"0":"-1")}))}handleSearchChange(e){let t=this.getAllItems(),i=e.target.value;if(this.customSearch)return void this.emit("nile-search-value",{value:i});let M=0;t.map((t=>{this.searchWidth=Math.max(this.searchWidth,t.offsetWidth),t.innerText.toLowerCase().includes(e.target.value.toLowerCase())?(t.style.display="block",M++):t.style.display="none"})),this.showNoResults=0===M}render(){return R`
|
|
16048
16075
|
<slot name="menu__pre-header" part="menu__pre-header" @click=${e=>{e.stopPropagation()}}></slot>
|
|
16049
16076
|
${this.searchEnabled?R`<div class="search__wrapper" part="search__wrapper">
|
|
16050
16077
|
<nile-input
|
|
@@ -16084,7 +16111,7 @@ border: none;
|
|
|
16084
16111
|
class="menu__footer"
|
|
16085
16112
|
></slot>`:null}
|
|
16086
16113
|
|
|
16087
|
-
`}};
|
|
16114
|
+
`}};km.styles=Qm,e([De()],km.prototype,"searchValue",void 0),e([De()],km.prototype,"searchWidth",void 0),e([ce({type:Boolean,reflect:!0})],km.prototype,"searchEnabled",void 0),e([ce({type:Boolean,reflect:!0})],km.prototype,"customSearch",void 0),e([ce({type:Boolean})],km.prototype,"showNoResults",void 0),e([ce({type:Boolean})],km.prototype,"allowSpaceKey",void 0),e([ce({type:String})],km.prototype,"noResultsMessage",void 0),e([Ie("slot:not([name])")],km.prototype,"defaultSlot",void 0),km=e([Ne("nile-side-bar-action-menu")],km);const Cm=r`
|
|
16088
16115
|
:host {
|
|
16089
16116
|
display: block;
|
|
16090
16117
|
}
|
|
@@ -16116,7 +16143,7 @@ border: none;
|
|
|
16116
16143
|
flex-direction: column;
|
|
16117
16144
|
gap: var(--nile-spacing-xs);
|
|
16118
16145
|
}
|
|
16119
|
-
`;let
|
|
16146
|
+
`;let bm=class extends Re{constructor(){super(...arguments),this.label="",this.divider=!1}static get styles(){return[Cm]}render(){return R`
|
|
16120
16147
|
<div class="group">
|
|
16121
16148
|
${this.label||this.hasLabelSlot()?R`
|
|
16122
16149
|
<div class="group-label">
|
|
@@ -16127,7 +16154,7 @@ border: none;
|
|
|
16127
16154
|
<slot></slot>
|
|
16128
16155
|
</div>
|
|
16129
16156
|
</div>
|
|
16130
|
-
`}hasLabelSlot(){const e=this.shadowRoot?.querySelector('slot[name="label"]');return!!e}};e([ce({type:String})],
|
|
16157
|
+
`}hasLabelSlot(){const e=this.shadowRoot?.querySelector('slot[name="label"]');return!!e}};e([ce({type:String})],bm.prototype,"label",void 0),e([ce({type:Boolean,reflect:!0})],bm.prototype,"divider",void 0),bm=e([Ne("nile-inline-sidebar-group")],bm);const fm=r`
|
|
16131
16158
|
:host {
|
|
16132
16159
|
display: block;
|
|
16133
16160
|
height: 100%;
|
|
@@ -16223,7 +16250,7 @@ border: none;
|
|
|
16223
16250
|
pointer-events: auto;
|
|
16224
16251
|
transition-delay: 0ms;
|
|
16225
16252
|
}
|
|
16226
|
-
`;let
|
|
16253
|
+
`;let vm=class extends Re{constructor(){super(...arguments),this.collapsed=!1,this.fixed=!1,this.showTooltip=!1,this.activeIndex=-1,this.handleItemSelect=e=>{const t=e.detail.item,i=this.sidebarItems.indexOf(t);this.sidebarItems.forEach(((e,t)=>e.active=t===i)),this.activeIndex=i,this.dispatchEvent(new CustomEvent("nile-change",{detail:{selectedItem:t,index:i},bubbles:!0,composed:!0})),this.requestUpdate()}}static get styles(){return[fm]}get sidebarItems(){if(!this.defaultSlot)return[];return this.defaultSlot.assignedElements({flatten:!0}).flatMap((e=>"nile-inline-sidebar-item"===e.tagName.toLowerCase()?[e]:Array.from(e.querySelectorAll("nile-inline-sidebar-item"))))}connectedCallback(){super.connectedCallback(),this.addEventListener("nile-click",this.handleItemSelect),this.mutationObserver=new MutationObserver((()=>this.syncActiveFromItems()))}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver?.disconnect(),this.removeEventListener("nile-click",this.handleItemSelect)}firstUpdated(){this.observeSidebarItems(),this.syncActiveFromItems(),this.fixed&&(this.collapsed=!1)}observeSidebarItems(){this.sidebarItems?.length&&this.mutationObserver&&this.sidebarItems.forEach((e=>this.mutationObserver.observe(e,{attributes:!0,attributeFilter:["active"]})))}syncActiveFromItems(){if(!this.sidebarItems?.length)return;const e=this.sidebarItems.findIndex((e=>e.hasAttribute("active")));-1!==e&&e!==this.activeIndex&&(this.activeIndex=e,this.requestUpdate())}toggleCollapse(){this.fixed||(this.collapsed=!this.collapsed,this.dispatchEvent(new CustomEvent("nile-toggle",{detail:{collapsed:this.collapsed},bubbles:!0,composed:!0})))}handleMenuItemClick(e){const t=this.sidebarItems[e];if(!t||t.hasAttribute("disabled"))return;this.sidebarItems.forEach(((t,i)=>t.active=i===e)),this.activeIndex=e;const i=t.textContent?.trim()||"",M=t.href;this.dispatchEvent(new CustomEvent("nile-click",{detail:{item:t,href:M,text:i},bubbles:!0,composed:!0})),M&&(window.location.href=M),this.requestUpdate()}get menuItemsTemplate(){return this.sidebarItems?.length?this.sidebarItems.map(((e,t)=>{const i=e.tooltip,M=e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight,n=R`
|
|
16227
16254
|
<nile-side-bar-action-menu-item
|
|
16228
16255
|
?disabled=${e.hasAttribute("disabled")}
|
|
16229
16256
|
?active=${this.activeIndex===t}
|
|
@@ -16283,7 +16310,7 @@ border: none;
|
|
|
16283
16310
|
></slot>
|
|
16284
16311
|
</nav>
|
|
16285
16312
|
</div>
|
|
16286
|
-
`}};e([ce({type:Boolean,reflect:!0})],
|
|
16313
|
+
`}};e([ce({type:Boolean,reflect:!0})],vm.prototype,"collapsed",void 0),e([ce({type:Boolean,reflect:!0,attribute:!0})],vm.prototype,"fixed",void 0),e([ce({type:Boolean,reflect:!0})],vm.prototype,"showTooltip",void 0),e([De()],vm.prototype,"activeIndex",void 0),e([Ie("slot")],vm.prototype,"defaultSlot",void 0),vm=e([Ne("nile-inline-sidebar")],vm);const Um=r`
|
|
16287
16314
|
:host {
|
|
16288
16315
|
display: block;
|
|
16289
16316
|
font-family: var(--nile-font-family-sans-serif);
|
|
@@ -16341,11 +16368,11 @@ a {
|
|
|
16341
16368
|
|
|
16342
16369
|
|
|
16343
16370
|
|
|
16344
|
-
`;let
|
|
16371
|
+
`;let Ym=class extends Re{constructor(){super(...arguments),this.active=!1,this.disabled=!1,this.tooltip=!1}static get styles(){return[Um]}handleClick(e){if(this.disabled)return e.preventDefault(),void e.stopPropagation();const t=this.closest("nile-inline-sidebar");if(t){t.querySelectorAll("nile-inline-sidebar-item").forEach((e=>e.active=e===this))}const i=this.textContent?.trim()||"";this.dispatchEvent(new CustomEvent("nile-click",{detail:{item:this,href:this.href,text:i},bubbles:!0,composed:!0})),this.href&&(window.location.href=this.href)}render(){return R`
|
|
16345
16372
|
<div class="item" @click=${this.handleClick} role="button" tabindex="0">
|
|
16346
16373
|
${this.href?R`<a href=${this.href} @click=${e=>e.preventDefault()}><slot></slot></a>`:R`<slot></slot>`}
|
|
16347
16374
|
</div>
|
|
16348
|
-
`}};e([ce({type:Boolean,reflect:!0})],
|
|
16375
|
+
`}};e([ce({type:Boolean,reflect:!0})],Ym.prototype,"active",void 0),e([ce({type:Boolean,reflect:!0})],Ym.prototype,"disabled",void 0),e([ce({type:String})],Ym.prototype,"href",void 0),e([ce({type:Boolean,reflect:!0})],Ym.prototype,"tooltip",void 0),Ym=e([Ne("nile-inline-sidebar-item")],Ym);const Zm=r`
|
|
16349
16376
|
:host { }
|
|
16350
16377
|
|
|
16351
16378
|
.tippy-box[data-animation=fade][data-state=hidden] { opacity: 0; }
|
|
@@ -16447,29 +16474,29 @@ a {
|
|
|
16447
16474
|
.tippy-svg-arrow > svg {
|
|
16448
16475
|
position: absolute;
|
|
16449
16476
|
}
|
|
16450
|
-
`;!function(){const e="nile-lite-tooltip-styles";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent=fm.cssText,document.head.appendChild(t)}();var vm="top",Um="bottom",Ym="right",Zm="left",Vm="auto",Wm=[vm,Um,Ym,Zm],Pm="start",Rm="end",Bm="viewport",Gm="popper",_m=Wm.reduce((function(e,t){return e.concat([t+"-"+Pm,t+"-"+Rm])}),[]),Fm=[].concat(Wm,[Vm]).reduce((function(e,t){return e.concat([t,t+"-"+Pm,t+"-"+Rm])}),[]),Hm=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Jm(e){return e?(e.nodeName||"").toLowerCase():null}function $m(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Xm(e){return e instanceof $m(e).Element||e instanceof Element}function qm(e){return e instanceof $m(e).HTMLElement||e instanceof HTMLElement}function Km(e){return"undefined"!=typeof ShadowRoot&&(e instanceof $m(e).ShadowRoot||e instanceof ShadowRoot)}var eE={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var i=t.styles[e]||{},M=t.attributes[e]||{},n=t.elements[e];qm(n)&&Jm(n)&&(Object.assign(n.style,i),Object.keys(M).forEach((function(e){var t=M[e];!1===t?n.removeAttribute(e):n.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach((function(e){var M=t.elements[e],n=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:i[e]).reduce((function(e,t){return e[t]="",e}),{});qm(M)&&Jm(M)&&(Object.assign(M.style,o),Object.keys(n).forEach((function(e){M.removeAttribute(e)})))}))}},requires:["computeStyles"]};function tE(e){return e.split("-")[0]}var iE=Math.max,ME=Math.min,nE=Math.round;function oE(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function rE(){return!/^((?!chrome|android).)*safari/i.test(oE())}function sE(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1);var M=e.getBoundingClientRect(),n=1,o=1;t&&qm(e)&&(n=e.offsetWidth>0&&nE(M.width)/e.offsetWidth||1,o=e.offsetHeight>0&&nE(M.height)/e.offsetHeight||1);var r=(Xm(e)?$m(e):window).visualViewport,s=!rE()&&i,a=(M.left+(s&&r?r.offsetLeft:0))/n,l=(M.top+(s&&r?r.offsetTop:0))/o,N=M.width/n,g=M.height/o;return{width:N,height:g,top:l,right:a+N,bottom:l+g,left:a,x:a,y:l}}function aE(e){var t=sE(e),i=e.offsetWidth,M=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-M)<=1&&(M=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:M}}function lE(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&Km(i)){var M=t;do{if(M&&e.isSameNode(M))return!0;M=M.parentNode||M.host}while(M)}return!1}function NE(e){return $m(e).getComputedStyle(e)}function gE(e){return["table","td","th"].indexOf(Jm(e))>=0}function uE(e){return((Xm(e)?e.ownerDocument:e.document)||window.document).documentElement}function cE(e){return"html"===Jm(e)?e:e.assignedSlot||e.parentNode||(Km(e)?e.host:null)||uE(e)}function DE(e){return qm(e)&&"fixed"!==NE(e).position?e.offsetParent:null}function jE(e){for(var t=$m(e),i=DE(e);i&&gE(i)&&"static"===NE(i).position;)i=DE(i);return i&&("html"===Jm(i)||"body"===Jm(i)&&"static"===NE(i).position)?t:i||function(e){var t=/firefox/i.test(oE());if(/Trident/i.test(oE())&&qm(e)&&"fixed"===NE(e).position)return null;var i=cE(e);for(Km(i)&&(i=i.host);qm(i)&&["html","body"].indexOf(Jm(i))<0;){var M=NE(i);if("none"!==M.transform||"none"!==M.perspective||"paint"===M.contain||-1!==["transform","perspective"].indexOf(M.willChange)||t&&"filter"===M.willChange||t&&M.filter&&"none"!==M.filter)return i;i=i.parentNode}return null}(e)||t}function IE(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function zE(e,t,i){return iE(e,ME(t,i))}function dE(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function hE(e,t){return t.reduce((function(t,i){return t[i]=e,t}),{})}var TE={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,i=e.state,M=e.name,n=e.options,o=i.elements.arrow,r=i.modifiersData.popperOffsets,s=tE(i.placement),a=IE(s),l=[Zm,Ym].indexOf(s)>=0?"height":"width";if(o&&r){var N=function(e,t){return dE("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:hE(e,Wm))}(n.padding,i),g=aE(o),u="y"===a?vm:Zm,c="y"===a?Um:Ym,D=i.rects.reference[l]+i.rects.reference[a]-r[a]-i.rects.popper[l],j=r[a]-i.rects.reference[a],I=jE(o),z=I?"y"===a?I.clientHeight||0:I.clientWidth||0:0,d=D/2-j/2,h=N[u],T=z-g[l]-N[c],y=z/2-g[l]/2+d,A=zE(h,y,T),O=a;i.modifiersData[M]=((t={})[O]=A,t.centerOffset=A-y,t)}},effect:function(e){var t=e.state,i=e.options.element,M=void 0===i?"[data-popper-arrow]":i;null!=M&&("string"!=typeof M||(M=t.elements.popper.querySelector(M)))&&lE(t.elements.popper,M)&&(t.elements.arrow=M)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function yE(e){return e.split("-")[1]}var AE={top:"auto",right:"auto",bottom:"auto",left:"auto"};function OE(e){var t,i=e.popper,M=e.popperRect,n=e.placement,o=e.variation,r=e.offsets,s=e.position,a=e.gpuAcceleration,l=e.adaptive,N=e.roundOffsets,g=e.isFixed,u=r.x,c=void 0===u?0:u,D=r.y,j=void 0===D?0:D,I="function"==typeof N?N({x:c,y:j}):{x:c,y:j};c=I.x,j=I.y;var z=r.hasOwnProperty("x"),d=r.hasOwnProperty("y"),h=Zm,T=vm,y=window;if(l){var A=jE(i),O="clientHeight",p="clientWidth";if(A===$m(i)&&"static"!==NE(A=uE(i)).position&&"absolute"===s&&(O="scrollHeight",p="scrollWidth"),n===vm||(n===Zm||n===Ym)&&o===Rm)T=Um,j-=(g&&A===y&&y.visualViewport?y.visualViewport.height:A[O])-M.height,j*=a?1:-1;if(n===Zm||(n===vm||n===Um)&&o===Rm)h=Ym,c-=(g&&A===y&&y.visualViewport?y.visualViewport.width:A[p])-M.width,c*=a?1:-1}var x,L=Object.assign({position:s},l&&AE),S=!0===N?function(e,t){var i=e.x,M=e.y,n=t.devicePixelRatio||1;return{x:nE(i*n)/n||0,y:nE(M*n)/n||0}}({x:c,y:j},$m(i)):{x:c,y:j};return c=S.x,j=S.y,a?Object.assign({},L,((x={})[T]=d?"0":"",x[h]=z?"0":"",x.transform=(y.devicePixelRatio||1)<=1?"translate("+c+"px, "+j+"px)":"translate3d("+c+"px, "+j+"px, 0)",x)):Object.assign({},L,((t={})[T]=d?j+"px":"",t[h]=z?c+"px":"",t.transform="",t))}var pE={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,i=e.options,M=i.gpuAcceleration,n=void 0===M||M,o=i.adaptive,r=void 0===o||o,s=i.roundOffsets,a=void 0===s||s,l={placement:tE(t.placement),variation:yE(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:n,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,OE(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:r,roundOffsets:a})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,OE(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},xE={passive:!0};var LE={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,i=e.instance,M=e.options,n=M.scroll,o=void 0===n||n,r=M.resize,s=void 0===r||r,a=$m(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&l.forEach((function(e){e.addEventListener("scroll",i.update,xE)})),s&&a.addEventListener("resize",i.update,xE),function(){o&&l.forEach((function(e){e.removeEventListener("scroll",i.update,xE)})),s&&a.removeEventListener("resize",i.update,xE)}},data:{}},SE={left:"right",right:"left",bottom:"top",top:"bottom"};function mE(e){return e.replace(/left|right|bottom|top/g,(function(e){return SE[e]}))}var EE={start:"end",end:"start"};function wE(e){return e.replace(/start|end/g,(function(e){return EE[e]}))}function QE(e){var t=$m(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function kE(e){return sE(uE(e)).left+QE(e).scrollLeft}function CE(e){var t=NE(e),i=t.overflow,M=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+n+M)}function bE(e){return["html","body","#document"].indexOf(Jm(e))>=0?e.ownerDocument.body:qm(e)&&CE(e)?e:bE(cE(e))}function fE(e,t){var i;void 0===t&&(t=[]);var M=bE(e),n=M===(null==(i=e.ownerDocument)?void 0:i.body),o=$m(M),r=n?[o].concat(o.visualViewport||[],CE(M)?M:[]):M,s=t.concat(r);return n?s:s.concat(fE(cE(r)))}function vE(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function UE(e,t,i){return t===Bm?vE(function(e,t){var i=$m(e),M=uE(e),n=i.visualViewport,o=M.clientWidth,r=M.clientHeight,s=0,a=0;if(n){o=n.width,r=n.height;var l=rE();(l||!l&&"fixed"===t)&&(s=n.offsetLeft,a=n.offsetTop)}return{width:o,height:r,x:s+kE(e),y:a}}(e,i)):Xm(t)?function(e,t){var i=sE(e,!1,"fixed"===t);return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}(t,i):vE(function(e){var t,i=uE(e),M=QE(e),n=null==(t=e.ownerDocument)?void 0:t.body,o=iE(i.scrollWidth,i.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),r=iE(i.scrollHeight,i.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),s=-M.scrollLeft+kE(e),a=-M.scrollTop;return"rtl"===NE(n||i).direction&&(s+=iE(i.clientWidth,n?n.clientWidth:0)-o),{width:o,height:r,x:s,y:a}}(uE(e)))}function YE(e,t,i,M){var n="clippingParents"===t?function(e){var t=fE(cE(e)),i=["absolute","fixed"].indexOf(NE(e).position)>=0&&qm(e)?jE(e):e;return Xm(i)?t.filter((function(e){return Xm(e)&&lE(e,i)&&"body"!==Jm(e)})):[]}(e):[].concat(t),o=[].concat(n,[i]),r=o[0],s=o.reduce((function(t,i){var n=UE(e,i,M);return t.top=iE(n.top,t.top),t.right=ME(n.right,t.right),t.bottom=ME(n.bottom,t.bottom),t.left=iE(n.left,t.left),t}),UE(e,r,M));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function ZE(e){var t,i=e.reference,M=e.element,n=e.placement,o=n?tE(n):null,r=n?yE(n):null,s=i.x+i.width/2-M.width/2,a=i.y+i.height/2-M.height/2;switch(o){case vm:t={x:s,y:i.y-M.height};break;case Um:t={x:s,y:i.y+i.height};break;case Ym:t={x:i.x+i.width,y:a};break;case Zm:t={x:i.x-M.width,y:a};break;default:t={x:i.x,y:i.y}}var l=o?IE(o):null;if(null!=l){var N="y"===l?"height":"width";switch(r){case Pm:t[l]=t[l]-(i[N]/2-M[N]/2);break;case Rm:t[l]=t[l]+(i[N]/2-M[N]/2)}}return t}function VE(e,t){void 0===t&&(t={});var i=t,M=i.placement,n=void 0===M?e.placement:M,o=i.strategy,r=void 0===o?e.strategy:o,s=i.boundary,a=void 0===s?"clippingParents":s,l=i.rootBoundary,N=void 0===l?Bm:l,g=i.elementContext,u=void 0===g?Gm:g,c=i.altBoundary,D=void 0!==c&&c,j=i.padding,I=void 0===j?0:j,z=dE("number"!=typeof I?I:hE(I,Wm)),d=u===Gm?"reference":Gm,h=e.rects.popper,T=e.elements[D?d:u],y=YE(Xm(T)?T:T.contextElement||uE(e.elements.popper),a,N,r),A=sE(e.elements.reference),O=ZE({reference:A,element:h,strategy:"absolute",placement:n}),p=vE(Object.assign({},h,O)),x=u===Gm?p:A,L={top:y.top-x.top+z.top,bottom:x.bottom-y.bottom+z.bottom,left:y.left-x.left+z.left,right:x.right-y.right+z.right},S=e.modifiersData.offset;if(u===Gm&&S){var m=S[n];Object.keys(L).forEach((function(e){var t=[Ym,Um].indexOf(e)>=0?1:-1,i=[vm,Um].indexOf(e)>=0?"y":"x";L[e]+=m[i]*t}))}return L}function WE(e,t){void 0===t&&(t={});var i=t,M=i.placement,n=i.boundary,o=i.rootBoundary,r=i.padding,s=i.flipVariations,a=i.allowedAutoPlacements,l=void 0===a?Fm:a,N=yE(M),g=N?s?_m:_m.filter((function(e){return yE(e)===N})):Wm,u=g.filter((function(e){return l.indexOf(e)>=0}));0===u.length&&(u=g);var c=u.reduce((function(t,i){return t[i]=VE(e,{placement:i,boundary:n,rootBoundary:o,padding:r})[tE(i)],t}),{});return Object.keys(c).sort((function(e,t){return c[e]-c[t]}))}var PE={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,M=e.name;if(!t.modifiersData[M]._skip){for(var n=i.mainAxis,o=void 0===n||n,r=i.altAxis,s=void 0===r||r,a=i.fallbackPlacements,l=i.padding,N=i.boundary,g=i.rootBoundary,u=i.altBoundary,c=i.flipVariations,D=void 0===c||c,j=i.allowedAutoPlacements,I=t.options.placement,z=tE(I),d=a||(z===I||!D?[mE(I)]:function(e){if(tE(e)===Vm)return[];var t=mE(e);return[wE(e),t,wE(t)]}(I)),h=[I].concat(d).reduce((function(e,i){return e.concat(tE(i)===Vm?WE(t,{placement:i,boundary:N,rootBoundary:g,padding:l,flipVariations:D,allowedAutoPlacements:j}):i)}),[]),T=t.rects.reference,y=t.rects.popper,A=new Map,O=!0,p=h[0],x=0;x<h.length;x++){var L=h[x],S=tE(L),m=yE(L)===Pm,E=[vm,Um].indexOf(S)>=0,w=E?"width":"height",Q=VE(t,{placement:L,boundary:N,rootBoundary:g,altBoundary:u,padding:l}),k=E?m?Ym:Zm:m?Um:vm;T[w]>y[w]&&(k=mE(k));var C=mE(k),b=[];if(o&&b.push(Q[S]<=0),s&&b.push(Q[k]<=0,Q[C]<=0),b.every((function(e){return e}))){p=L,O=!1;break}A.set(L,b)}if(O)for(var f=function(e){var t=h.find((function(t){var i=A.get(t);if(i)return i.slice(0,e).every((function(e){return e}))}));if(t)return p=t,"break"},v=D?3:1;v>0;v--){if("break"===f(v))break}t.placement!==p&&(t.modifiersData[M]._skip=!0,t.placement=p,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function RE(e,t,i){return void 0===i&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function BE(e){return[vm,Ym,Um,Zm].some((function(t){return e[t]>=0}))}var GE={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,i=e.name,M=t.rects.reference,n=t.rects.popper,o=t.modifiersData.preventOverflow,r=VE(t,{elementContext:"reference"}),s=VE(t,{altBoundary:!0}),a=RE(r,M),l=RE(s,n,o),N=BE(a),g=BE(l);t.modifiersData[i]={referenceClippingOffsets:a,popperEscapeOffsets:l,isReferenceHidden:N,hasPopperEscaped:g},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":N,"data-popper-escaped":g})}};var _E={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,i=e.options,M=e.name,n=i.offset,o=void 0===n?[0,0]:n,r=Fm.reduce((function(e,i){return e[i]=function(e,t,i){var M=tE(e),n=[Zm,vm].indexOf(M)>=0?-1:1,o="function"==typeof i?i(Object.assign({},t,{placement:e})):i,r=o[0],s=o[1];return r=r||0,s=(s||0)*n,[Zm,Ym].indexOf(M)>=0?{x:s,y:r}:{x:r,y:s}}(i,t.rects,o),e}),{}),s=r[t.placement],a=s.x,l=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=a,t.modifiersData.popperOffsets.y+=l),t.modifiersData[M]=r}};var FE={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,i=e.name;t.modifiersData[i]=ZE({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var HE={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,M=e.name,n=i.mainAxis,o=void 0===n||n,r=i.altAxis,s=void 0!==r&&r,a=i.boundary,l=i.rootBoundary,N=i.altBoundary,g=i.padding,u=i.tether,c=void 0===u||u,D=i.tetherOffset,j=void 0===D?0:D,I=VE(t,{boundary:a,rootBoundary:l,padding:g,altBoundary:N}),z=tE(t.placement),d=yE(t.placement),h=!d,T=IE(z),y="x"===T?"y":"x",A=t.modifiersData.popperOffsets,O=t.rects.reference,p=t.rects.popper,x="function"==typeof j?j(Object.assign({},t.rects,{placement:t.placement})):j,L="number"==typeof x?{mainAxis:x,altAxis:x}:Object.assign({mainAxis:0,altAxis:0},x),S=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,m={x:0,y:0};if(A){if(o){var E,w="y"===T?vm:Zm,Q="y"===T?Um:Ym,k="y"===T?"height":"width",C=A[T],b=C+I[w],f=C-I[Q],v=c?-p[k]/2:0,U=d===Pm?O[k]:p[k],Y=d===Pm?-p[k]:-O[k],Z=t.elements.arrow,V=c&&Z?aE(Z):{width:0,height:0},W=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},P=W[w],R=W[Q],B=zE(0,O[k],V[k]),G=h?O[k]/2-v-B-P-L.mainAxis:U-B-P-L.mainAxis,_=h?-O[k]/2+v+B+R+L.mainAxis:Y+B+R+L.mainAxis,F=t.elements.arrow&&jE(t.elements.arrow),H=F?"y"===T?F.clientTop||0:F.clientLeft||0:0,J=null!=(E=null==S?void 0:S[T])?E:0,$=C+_-J,X=zE(c?ME(b,C+G-J-H):b,C,c?iE(f,$):f);A[T]=X,m[T]=X-C}if(s){var q,K="x"===T?vm:Zm,ee="x"===T?Um:Ym,te=A[y],ie="y"===y?"height":"width",Me=te+I[K],ne=te-I[ee],oe=-1!==[vm,Zm].indexOf(z),re=null!=(q=null==S?void 0:S[y])?q:0,se=oe?Me:te-O[ie]-p[ie]-re+L.altAxis,ae=oe?te+O[ie]+p[ie]-re-L.altAxis:ne,le=c&&oe?function(e,t,i){var M=zE(e,t,i);return M>i?i:M}(se,te,ae):zE(c?se:Me,te,c?ae:ne);A[y]=le,m[y]=le-te}t.modifiersData[M]=m}},requiresIfExists:["offset"]};function JE(e,t,i){void 0===i&&(i=!1);var M,n,o=qm(t),r=qm(t)&&function(e){var t=e.getBoundingClientRect(),i=nE(t.width)/e.offsetWidth||1,M=nE(t.height)/e.offsetHeight||1;return 1!==i||1!==M}(t),s=uE(t),a=sE(e,r,i),l={scrollLeft:0,scrollTop:0},N={x:0,y:0};return(o||!o&&!i)&&(("body"!==Jm(t)||CE(s))&&(l=(M=t)!==$m(M)&&qm(M)?{scrollLeft:(n=M).scrollLeft,scrollTop:n.scrollTop}:QE(M)),qm(t)?((N=sE(t,!0)).x+=t.clientLeft,N.y+=t.clientTop):s&&(N.x=kE(s))),{x:a.left+l.scrollLeft-N.x,y:a.top+l.scrollTop-N.y,width:a.width,height:a.height}}function $E(e){var t=new Map,i=new Set,M=[];function n(e){i.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!i.has(e)){var M=t.get(e);M&&n(M)}})),M.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){i.has(e.name)||n(e)})),M}var XE={placement:"bottom",modifiers:[],strategy:"absolute"};function qE(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function KE(e){void 0===e&&(e={});var t=e,i=t.defaultModifiers,M=void 0===i?[]:i,n=t.defaultOptions,o=void 0===n?XE:n;return function(e,t,i){void 0===i&&(i=o);var n,r,s={placement:"bottom",orderedModifiers:[],options:Object.assign({},XE,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},a=[],l=!1,N={state:s,setOptions:function(i){var n="function"==typeof i?i(s.options):i;g(),s.options=Object.assign({},o,s.options,n),s.scrollParents={reference:Xm(e)?fE(e):e.contextElement?fE(e.contextElement):[],popper:fE(t)};var r=function(e){var t=$E(e);return Hm.reduce((function(e,i){return e.concat(t.filter((function(e){return e.phase===i})))}),[])}(function(e){var t=e.reduce((function(e,t){var i=e[t.name];return e[t.name]=i?Object.assign({},i,t,{options:Object.assign({},i.options,t.options),data:Object.assign({},i.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(M,s.options.modifiers)));return s.orderedModifiers=r.filter((function(e){return e.enabled})),s.orderedModifiers.forEach((function(e){var t=e.name,i=e.options,M=void 0===i?{}:i,n=e.effect;if("function"==typeof n){var o=n({state:s,name:t,instance:N,options:M}),r=function(){};a.push(o||r)}})),N.update()},forceUpdate:function(){if(!l){var e=s.elements,t=e.reference,i=e.popper;if(qE(t,i)){s.rects={reference:JE(t,jE(i),"fixed"===s.options.strategy),popper:aE(i)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(e){return s.modifiersData[e.name]=Object.assign({},e.data)}));for(var M=0;M<s.orderedModifiers.length;M++)if(!0!==s.reset){var n=s.orderedModifiers[M],o=n.fn,r=n.options,a=void 0===r?{}:r,g=n.name;"function"==typeof o&&(s=o({state:s,options:a,name:g,instance:N})||s)}else s.reset=!1,M=-1}}},update:(n=function(){return new Promise((function(e){N.forceUpdate(),e(s)}))},function(){return r||(r=new Promise((function(e){Promise.resolve().then((function(){r=void 0,e(n())}))}))),r}),destroy:function(){g(),l=!0}};if(!qE(e,t))return N;function g(){a.forEach((function(e){return e()})),a=[]}return N.setOptions(i).then((function(e){!l&&i.onFirstUpdate&&i.onFirstUpdate(e)})),N}}var ew=KE({defaultModifiers:[LE,FE,pE,eE,_E,PE,HE,TE,GE]}),tw='<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>',iw="tippy-content",Mw="tippy-arrow",nw="tippy-svg-arrow",ow={passive:!0,capture:!0},rw=function(){return document.body};function sw(e,t,i){if(Array.isArray(e)){var M=e[t];return null==M?Array.isArray(i)?i[t]:i:M}return e}function aw(e,t){var i={}.toString.call(e);return 0===i.indexOf("[object")&&i.indexOf(t+"]")>-1}function lw(e,t){return"function"==typeof e?e.apply(void 0,t):e}function Nw(e,t){return 0===t?e:function(M){clearTimeout(i),i=setTimeout((function(){e(M)}),t)};var i}function gw(e,t){var i=Object.assign({},e);return t.forEach((function(e){delete i[e]})),i}function uw(e){return[].concat(e)}function cw(e,t){-1===e.indexOf(t)&&e.push(t)}function Dw(e){return[].slice.call(e)}function jw(e){return Object.keys(e).reduce((function(t,i){return void 0!==e[i]&&(t[i]=e[i]),t}),{})}function Iw(){return document.createElement("div")}function zw(e){return["Element","Fragment"].some((function(t){return aw(e,t)}))}function dw(e){return aw(e,"MouseEvent")}function hw(e){return zw(e)?[e]:function(e){return aw(e,"NodeList")}(e)?Dw(e):Array.isArray(e)?e:Dw(document.querySelectorAll(e))}function Tw(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function yw(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Aw(e){var t,i=uw(e)[0];return null!=i&&null!=(t=i.ownerDocument)&&t.body?i.ownerDocument:document}function Ow(e,t,i){var M=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[M](t,i)}))}function pw(e,t){for(var i=t;i;){var M;if(e.contains(i))return!0;i=null==i.getRootNode||null==(M=i.getRootNode())?void 0:M.host}return!1}var xw={isTouch:!1},Lw=0;function Sw(){xw.isTouch||(xw.isTouch=!0,window.performance&&document.addEventListener("mousemove",mw))}function mw(){var e=performance.now();e-Lw<20&&(xw.isTouch=!1,document.removeEventListener("mousemove",mw)),Lw=e}function Ew(){var e,t=document.activeElement;if((e=t)&&e._tippy&&e._tippy.reference===e){var i=t._tippy;t.blur&&!i.state.isVisible&&t.blur()}}var ww,Qw=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;function kw(e){return[e+"() was called on a"+("destroy"===e?"n already-":" ")+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function Cw(e){return e.replace(/[ \t]{2,}/g," ").replace(/^[ \t]*/gm,"").trim()}function bw(e){return Cw("\n %ctippy.js\n\n %c"+Cw(e)+"\n\n %c👷 This is a development-only message. It will be removed in production.\n ")}function fw(e){return[bw(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}function vw(e,t){var i;e&&!ww.has(t)&&(ww.add(t),(i=console).warn.apply(i,fw(t)))}function Uw(e,t){var i;e&&!ww.has(t)&&(ww.add(t),(i=console).error.apply(i,fw(t)))}"production"!==process.env.NODE_ENV&&(ww=new Set);var Yw={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Zw=Object.assign({appendTo:rw,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Yw,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Vw=Object.keys(Zw);function Ww(e){var t=(e.plugins||[]).reduce((function(t,i){var M,n=i.name,o=i.defaultValue;n&&(t[n]=void 0!==e[n]?e[n]:null!=(M=Zw[n])?M:o);return t}),{});return Object.assign({},e,t)}function Pw(e,t){var i=Object.assign({},t,{content:lw(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Ww(Object.assign({},Zw,{plugins:t}))):Vw).reduce((function(t,i){var M=(e.getAttribute("data-tippy-"+i)||"").trim();if(!M)return t;if("content"===i)t[i]=M;else try{t[i]=JSON.parse(M)}catch(e){t[i]=M}return t}),{})}(e,t.plugins));return i.aria=Object.assign({},Zw.aria,i.aria),i.aria={expanded:"auto"===i.aria.expanded?t.interactive:i.aria.expanded,content:"auto"===i.aria.content?t.interactive?null:"describedby":i.aria.content},i}function Rw(e,t){void 0===e&&(e={}),void 0===t&&(t=[]),Object.keys(e).forEach((function(e){var i,M,n=gw(Zw,Object.keys(Yw)),o=(i=n,M=e,!{}.hasOwnProperty.call(i,M));o&&(o=0===t.filter((function(t){return t.name===e})).length),vw(o,["`"+e+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.","\n\n","All props: https://atomiks.github.io/tippyjs/v6/all-props/\n","Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))}))}function Bw(e,t){e.innerHTML=t}function Gw(e){var t=Iw();return!0===e?t.className=Mw:(t.className=nw,zw(e)?t.appendChild(e):Bw(t,e)),t}function _w(e,t){zw(t.content)?(Bw(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Bw(e,t.content):e.textContent=t.content)}function Fw(e){var t=e.firstElementChild,i=Dw(t.children);return{box:t,content:i.find((function(e){return e.classList.contains(iw)})),arrow:i.find((function(e){return e.classList.contains(Mw)||e.classList.contains(nw)})),backdrop:i.find((function(e){return e.classList.contains("tippy-backdrop")}))}}function Hw(e){var t=Iw(),i=Iw();i.className="tippy-box",i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var M=Iw();function n(i,M){var n=Fw(t),o=n.box,r=n.content,s=n.arrow;M.theme?o.setAttribute("data-theme",M.theme):o.removeAttribute("data-theme"),"string"==typeof M.animation?o.setAttribute("data-animation",M.animation):o.removeAttribute("data-animation"),M.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof M.maxWidth?M.maxWidth+"px":M.maxWidth,M.role?o.setAttribute("role",M.role):o.removeAttribute("role"),i.content===M.content&&i.allowHTML===M.allowHTML||_w(r,e.props),M.arrow?s?i.arrow!==M.arrow&&(o.removeChild(s),o.appendChild(Gw(M.arrow))):o.appendChild(Gw(M.arrow)):s&&o.removeChild(s)}return M.className=iw,M.setAttribute("data-state","hidden"),_w(M,e.props),t.appendChild(i),i.appendChild(M),n(e.props,e.props),{popper:t,onUpdate:n}}Hw.$$tippy=!0;var Jw=1,$w=[],Xw=[];function qw(e,t){var i,M,n,o,r,s,a,l,N=Pw(e,Object.assign({},Zw,Ww(jw(t)))),g=!1,u=!1,c=!1,D=!1,j=[],I=Nw(F,N.interactiveDebounce),z=Jw++,d=(l=N.plugins).filter((function(e,t){return l.indexOf(e)===t})),h={id:z,reference:e,popper:Iw(),popperInstance:null,props:N,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:d,clearDelayTimeouts:function(){clearTimeout(i),clearTimeout(M),cancelAnimationFrame(n)},setProps:function(t){"production"!==process.env.NODE_ENV&&vw(h.state.isDestroyed,kw("setProps"));if(h.state.isDestroyed)return;C("onBeforeUpdate",[h,t]),G();var i=h.props,M=Pw(e,Object.assign({},i,jw(t),{ignoreAttributes:!0}));h.props=M,B(),i.interactiveDebounce!==M.interactiveDebounce&&(v(),I=Nw(F,M.interactiveDebounce));i.triggerTarget&&!M.triggerTarget?uw(i.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):M.triggerTarget&&e.removeAttribute("aria-expanded");f(),k(),A&&A(i,M);h.popperInstance&&(X(),K().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));C("onAfterUpdate",[h,t])},setContent:function(e){h.setProps({content:e})},show:function(){"production"!==process.env.NODE_ENV&&vw(h.state.isDestroyed,kw("show"));var e=h.state.isVisible,t=h.state.isDestroyed,i=!h.state.isEnabled,M=xw.isTouch&&!h.props.touch,n=sw(h.props.duration,0,Zw.duration);if(e||t||i||M)return;if(m().hasAttribute("disabled"))return;if(C("onShow",[h],!1),!1===h.props.onShow(h))return;h.state.isVisible=!0,S()&&(y.style.visibility="visible");k(),V(),h.state.isMounted||(y.style.transition="none");if(S()){var o=w();Tw([o.box,o.content],0)}s=function(){var e;if(h.state.isVisible&&!D){if(D=!0,y.offsetHeight,y.style.transition=h.props.moveTransition,S()&&h.props.animation){var t=w(),i=t.box,M=t.content;Tw([i,M],n),yw([i,M],"visible")}b(),f(),cw(Xw,h),null==(e=h.popperInstance)||e.forceUpdate(),C("onMount",[h]),h.props.animation&&S()&&function(e,t){P(e,t)}(n,(function(){h.state.isShown=!0,C("onShown",[h])}))}},function(){var e,t=h.props.appendTo,i=m();e=h.props.interactive&&t===rw||"parent"===t?i.parentNode:lw(t,[i]);e.contains(y)||e.appendChild(y);h.state.isMounted=!0,X(),"production"!==process.env.NODE_ENV&&vw(h.props.interactive&&t===Zw.appendTo&&i.nextElementSibling!==y,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.","\n\n","Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.","\n\n","Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.","\n\n","See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}()},hide:function(){"production"!==process.env.NODE_ENV&&vw(h.state.isDestroyed,kw("hide"));var e=!h.state.isVisible,t=h.state.isDestroyed,i=!h.state.isEnabled,M=sw(h.props.duration,1,Zw.duration);if(e||t||i)return;if(C("onHide",[h],!1),!1===h.props.onHide(h))return;h.state.isVisible=!1,h.state.isShown=!1,D=!1,g=!1,S()&&(y.style.visibility="hidden");if(v(),W(),k(!0),S()){var n=w(),o=n.box,r=n.content;h.props.animation&&(Tw([o,r],M),yw([o,r],"hidden"))}b(),f(),h.props.animation?S()&&function(e,t){P(e,(function(){!h.state.isVisible&&y.parentNode&&y.parentNode.contains(y)&&t()}))}(M,h.unmount):h.unmount()},hideWithInteractivity:function(e){"production"!==process.env.NODE_ENV&&vw(h.state.isDestroyed,kw("hideWithInteractivity"));E().addEventListener("mousemove",I),cw($w,I),I(e)},enable:function(){h.state.isEnabled=!0},disable:function(){h.hide(),h.state.isEnabled=!1},unmount:function(){"production"!==process.env.NODE_ENV&&vw(h.state.isDestroyed,kw("unmount"));h.state.isVisible&&h.hide();if(!h.state.isMounted)return;q(),K().forEach((function(e){e._tippy.unmount()})),y.parentNode&&y.parentNode.removeChild(y);Xw=Xw.filter((function(e){return e!==h})),h.state.isMounted=!1,C("onHidden",[h])},destroy:function(){"production"!==process.env.NODE_ENV&&vw(h.state.isDestroyed,kw("destroy"));if(h.state.isDestroyed)return;h.clearDelayTimeouts(),h.unmount(),G(),delete e._tippy,h.state.isDestroyed=!0,C("onDestroy",[h])}};if(!N.render)return"production"!==process.env.NODE_ENV&&Uw(!0,"render() function has not been supplied."),h;var T=N.render(h),y=T.popper,A=T.onUpdate;y.setAttribute("data-tippy-root",""),y.id="tippy-"+h.id,h.popper=y,e._tippy=h,y._tippy=h;var O=d.map((function(e){return e.fn(h)})),p=e.hasAttribute("aria-expanded");return B(),f(),k(),C("onCreate",[h]),N.showOnCreate&&ee(),y.addEventListener("mouseenter",(function(){h.props.interactive&&h.state.isVisible&&h.clearDelayTimeouts()})),y.addEventListener("mouseleave",(function(){h.props.interactive&&h.props.trigger.indexOf("mouseenter")>=0&&E().addEventListener("mousemove",I)})),h;function x(){var e=h.props.touch;return Array.isArray(e)?e:[e,0]}function L(){return"hold"===x()[0]}function S(){var e;return!(null==(e=h.props.render)||!e.$$tippy)}function m(){return a||e}function E(){var e=m().parentNode;return e?Aw(e):document}function w(){return Fw(y)}function Q(e){return h.state.isMounted&&!h.state.isVisible||xw.isTouch||o&&"focus"===o.type?0:sw(h.props.delay,e?0:1,Zw.delay)}function k(e){void 0===e&&(e=!1),y.style.pointerEvents=h.props.interactive&&!e?"":"none",y.style.zIndex=""+h.props.zIndex}function C(e,t,i){var M;(void 0===i&&(i=!0),O.forEach((function(i){i[e]&&i[e].apply(i,t)})),i)&&(M=h.props)[e].apply(M,t)}function b(){var t=h.props.aria;if(t.content){var i="aria-"+t.content,M=y.id;uw(h.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(i);if(h.state.isVisible)e.setAttribute(i,t?t+" "+M:M);else{var n=t&&t.replace(M,"").trim();n?e.setAttribute(i,n):e.removeAttribute(i)}}))}}function f(){!p&&h.props.aria.expanded&&uw(h.props.triggerTarget||e).forEach((function(e){h.props.interactive?e.setAttribute("aria-expanded",h.state.isVisible&&e===m()?"true":"false"):e.removeAttribute("aria-expanded")}))}function v(){E().removeEventListener("mousemove",I),$w=$w.filter((function(e){return e!==I}))}function U(t){if(!xw.isTouch||!c&&"mousedown"!==t.type){var i=t.composedPath&&t.composedPath()[0]||t.target;if(!h.props.interactive||!pw(y,i)){if(uw(h.props.triggerTarget||e).some((function(e){return pw(e,i)}))){if(xw.isTouch)return;if(h.state.isVisible&&h.props.trigger.indexOf("click")>=0)return}else C("onClickOutside",[h,t]);!0===h.props.hideOnClick&&(h.clearDelayTimeouts(),h.hide(),u=!0,setTimeout((function(){u=!1})),h.state.isMounted||W())}}}function Y(){c=!0}function Z(){c=!1}function V(){var e=E();e.addEventListener("mousedown",U,!0),e.addEventListener("touchend",U,ow),e.addEventListener("touchstart",Z,ow),e.addEventListener("touchmove",Y,ow)}function W(){var e=E();e.removeEventListener("mousedown",U,!0),e.removeEventListener("touchend",U,ow),e.removeEventListener("touchstart",Z,ow),e.removeEventListener("touchmove",Y,ow)}function P(e,t){var i=w().box;function M(e){e.target===i&&(Ow(i,"remove",M),t())}if(0===e)return t();Ow(i,"remove",r),Ow(i,"add",M),r=M}function R(t,i,M){void 0===M&&(M=!1),uw(h.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,i,M),j.push({node:e,eventType:t,handler:i,options:M})}))}function B(){var e;L()&&(R("touchstart",_,{passive:!0}),R("touchend",H,{passive:!0})),(e=h.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(R(e,_),e){case"mouseenter":R("mouseleave",H);break;case"focus":R(Qw?"focusout":"blur",J);break;case"focusin":R("focusout",J)}}))}function G(){j.forEach((function(e){var t=e.node,i=e.eventType,M=e.handler,n=e.options;t.removeEventListener(i,M,n)})),j=[]}function _(e){var t,i=!1;if(h.state.isEnabled&&!$(e)&&!u){var M="focus"===(null==(t=o)?void 0:t.type);o=e,a=e.currentTarget,f(),!h.state.isVisible&&dw(e)&&$w.forEach((function(t){return t(e)})),"click"===e.type&&(h.props.trigger.indexOf("mouseenter")<0||g)&&!1!==h.props.hideOnClick&&h.state.isVisible?i=!0:ee(e),"click"===e.type&&(g=!i),i&&!M&&te(e)}}function F(e){var t=e.target,i=m().contains(t)||y.contains(t);if("mousemove"!==e.type||!i){var M=K().concat(y).map((function(e){var t,i=null==(t=e._tippy.popperInstance)?void 0:t.state;return i?{popperRect:e.getBoundingClientRect(),popperState:i,props:N}:null})).filter(Boolean);(function(e,t){var i=t.clientX,M=t.clientY;return e.every((function(e){var t=e.popperRect,n=e.popperState,o=e.props.interactiveBorder,r=n.placement.split("-")[0],s=n.modifiersData.offset;if(!s)return!0;var a="bottom"===r?s.top.y:0,l="top"===r?s.bottom.y:0,N="right"===r?s.left.x:0,g="left"===r?s.right.x:0,u=t.top-M+a>o,c=M-t.bottom-l>o,D=t.left-i+N>o,j=i-t.right-g>o;return u||c||D||j}))})(M,e)&&(v(),te(e))}}function H(e){$(e)||h.props.trigger.indexOf("click")>=0&&g||(h.props.interactive?h.hideWithInteractivity(e):te(e))}function J(e){h.props.trigger.indexOf("focusin")<0&&e.target!==m()||h.props.interactive&&e.relatedTarget&&y.contains(e.relatedTarget)||te(e)}function $(e){return!!xw.isTouch&&L()!==e.type.indexOf("touch")>=0}function X(){q();var t=h.props,i=t.popperOptions,M=t.placement,n=t.offset,o=t.getReferenceClientRect,r=t.moveTransition,a=S()?Fw(y).arrow:null,l=o?{getBoundingClientRect:o,contextElement:o.contextElement||m()}:e,N={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(S()){var i=w().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?i.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?i.setAttribute("data-"+e,""):i.removeAttribute("data-"+e)})),t.attributes.popper={}}}},g=[{name:"offset",options:{offset:n}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!r}},N];S()&&a&&g.push({name:"arrow",options:{element:a,padding:3}}),g.push.apply(g,(null==i?void 0:i.modifiers)||[]),h.popperInstance=ew(l,y,Object.assign({},i,{placement:M,onFirstUpdate:s,modifiers:g}))}function q(){h.popperInstance&&(h.popperInstance.destroy(),h.popperInstance=null)}function K(){return Dw(y.querySelectorAll("[data-tippy-root]"))}function ee(e){h.clearDelayTimeouts(),e&&C("onTrigger",[h,e]),V();var t=Q(!0),M=x(),n=M[0],o=M[1];xw.isTouch&&"hold"===n&&o&&(t=o),t?i=setTimeout((function(){h.show()}),t):h.show()}function te(e){if(h.clearDelayTimeouts(),C("onUntrigger",[h,e]),h.state.isVisible){if(!(h.props.trigger.indexOf("mouseenter")>=0&&h.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&g)){var t=Q(!1);t?M=setTimeout((function(){h.state.isVisible&&h.hide()}),t):n=requestAnimationFrame((function(){h.hide()}))}}else W()}}function Kw(e,t){void 0===t&&(t={});var i=Zw.plugins.concat(t.plugins||[]);"production"!==process.env.NODE_ENV&&(!function(e){var t=!e,i="[object Object]"===Object.prototype.toString.call(e)&&!e.addEventListener;Uw(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),Uw(i,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}(e),Rw(t,i)),document.addEventListener("touchstart",Sw,ow),window.addEventListener("blur",Ew);var M=Object.assign({},t,{plugins:i}),n=hw(e);if("production"!==process.env.NODE_ENV){var o=zw(M.content),r=n.length>1;vw(o&&r,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.","\n\n","Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.","\n\n","1) content: element.innerHTML\n","2) content: () => element.cloneNode(true)"].join(" "))}var s=n.reduce((function(e,t){var i=t&&qw(t,M);return i&&e.push(i),e}),[]);return zw(e)?s[0]:s}Kw.defaultProps=Zw,Kw.setDefaultProps=function(e){"production"!==process.env.NODE_ENV&&Rw(e,[]),Object.keys(e).forEach((function(t){Zw[t]=e[t]}))},Kw.currentInput=xw;var eQ=Object.assign({},eE,{effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow)}}),tQ=function(e,t){var i;void 0===t&&(t={}),"production"!==process.env.NODE_ENV&&Uw(!Array.isArray(e),["The first argument passed to createSingleton() must be an array of","tippy instances. The passed value was",String(e)].join(" "));var M,n=e,o=[],r=[],s=t.overrides,a=[],l=!1;function N(){r=n.map((function(e){return uw(e.props.triggerTarget||e.reference)})).reduce((function(e,t){return e.concat(t)}),[])}function g(){o=n.map((function(e){return e.reference}))}function u(e){n.forEach((function(t){e?t.enable():t.disable()}))}function c(e){return n.map((function(t){var i=t.setProps;return t.setProps=function(n){i(n),t.reference===M&&e.setProps(n)},function(){t.setProps=i}}))}function D(e,t){var i=r.indexOf(t);if(t!==M){M=t;var a=(s||[]).concat("content").reduce((function(e,t){return e[t]=n[i].props[t],e}),{});e.setProps(Object.assign({},a,{getReferenceClientRect:"function"==typeof a.getReferenceClientRect?a.getReferenceClientRect:function(){var e;return null==(e=o[i])?void 0:e.getBoundingClientRect()}}))}}u(!1),g(),N();var j={fn:function(){return{onDestroy:function(){u(!0)},onHidden:function(){M=null},onClickOutside:function(e){e.props.showOnCreate&&!l&&(l=!0,M=null)},onShow:function(e){e.props.showOnCreate&&!l&&(l=!0,D(e,o[0]))},onTrigger:function(e,t){D(e,t.currentTarget)}}}},I=Kw(Iw(),Object.assign({},gw(t,["overrides"]),{plugins:[j].concat(t.plugins||[]),triggerTarget:r,popperOptions:Object.assign({},t.popperOptions,{modifiers:[].concat((null==(i=t.popperOptions)?void 0:i.modifiers)||[],[eQ])})})),z=I.show;I.show=function(e){if(z(),!M&&null==e)return D(I,o[0]);if(!M||null!=e){if("number"==typeof e)return o[e]&&D(I,o[e]);if(n.indexOf(e)>=0){var t=e.reference;return D(I,t)}return o.indexOf(e)>=0?D(I,e):void 0}},I.showNext=function(){var e=o[0];if(!M)return I.show(0);var t=o.indexOf(M);I.show(o[t+1]||e)},I.showPrevious=function(){var e=o[o.length-1];if(!M)return I.show(e);var t=o.indexOf(M),i=o[t-1]||e;I.show(i)};var d=I.setProps;return I.setProps=function(e){s=e.overrides||s,d(e)},I.setInstances=function(e){u(!0),a.forEach((function(e){return e()})),n=e,u(!1),g(),N(),a=c(I),I.setProps({triggerTarget:r})},a=c(I),I},iQ={clientX:0,clientY:0},MQ=[];function nQ(e){var t=e.clientX,i=e.clientY;iQ={clientX:t,clientY:i}}var oQ={name:"followCursor",defaultValue:!1,fn:function(e){var t=e.reference,i=Aw(e.props.triggerTarget||t),M=!1,n=!1,o=!0,r=e.props;function s(){return"initial"===e.props.followCursor&&e.state.isVisible}function a(){i.addEventListener("mousemove",g)}function l(){i.removeEventListener("mousemove",g)}function N(){M=!0,e.setProps({getReferenceClientRect:null}),M=!1}function g(i){var M=!i.target||t.contains(i.target),n=e.props.followCursor,o=i.clientX,r=i.clientY,s=t.getBoundingClientRect(),a=o-s.left,l=r-s.top;!M&&e.props.interactive||e.setProps({getReferenceClientRect:function(){var e=t.getBoundingClientRect(),i=o,M=r;"initial"===n&&(i=e.left+a,M=e.top+l);var s="horizontal"===n?e.top:M,N="vertical"===n?e.right:i,g="horizontal"===n?e.bottom:M,u="vertical"===n?e.left:i;return{width:N-u,height:g-s,top:s,right:N,bottom:g,left:u}}})}function u(){e.props.followCursor&&(MQ.push({instance:e,doc:i}),function(e){e.addEventListener("mousemove",nQ)}(i))}function c(){0===(MQ=MQ.filter((function(t){return t.instance!==e}))).filter((function(e){return e.doc===i})).length&&function(e){e.removeEventListener("mousemove",nQ)}(i)}return{onCreate:u,onDestroy:c,onBeforeUpdate:function(){r=e.props},onAfterUpdate:function(t,i){var o=i.followCursor;M||void 0!==o&&r.followCursor!==o&&(c(),o?(u(),!e.state.isMounted||n||s()||a()):(l(),N()))},onMount:function(){e.props.followCursor&&!n&&(o&&(g(iQ),o=!1),s()||a())},onTrigger:function(e,t){dw(t)&&(iQ={clientX:t.clientX,clientY:t.clientY}),n="focus"===t.type},onHidden:function(){e.props.followCursor&&(N(),l(),o=!0)}}}};function rQ(e){return!0===e||"true"===e||!1!==e&&"false"!==e&&(!!["initial","horizontal","vertical"].includes(String(e))&&e)}function sQ(e){if(Array.isArray(e))return e;if("number"==typeof e)return e;if("string"==typeof e){if(e.includes(",")){const t=e.split(",").map((e=>parseInt(e.trim(),10)));return t}const t=parseInt(e,10);if(!isNaN(t))return t}return 200}Kw.setDefaultProps({render:Hw});let aQ=class extends Re{static get styles(){return[fm]}createRenderRoot(){return this}constructor(){super(),this.for=null,this.content="",this.size="small",this.duration=200,this.interactive=!1,this.placement="top",this.disabled=!1,this.distance=8,this.skidding=0,this.open=!1,this.trigger="mouseenter focus",this.allowHTML=!1,this.followCursor=!1,this.arrow="default",this.singleton=!1,this.enableRecursiveMode=!1,this.delay=0,this.maxWidth="auto",this.zIndex=9999,this.hideOnClick=!0,this.inertia=!1,this.interactiveBorder=2,this.enableVisibilityEffect=!1,this.enableTabClose=!1}firstUpdated(){this.attachTooltip();const e=this.for&&document.getElementById(this.for)||this.firstElementChild;this.visibilityManager=new tM({host:this,target:e,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:()=>this.open,onAnchorOutOfView:()=>{this.open=!1,this.hideAllTooltips(),this.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"})},onDocumentHidden:()=>{this.open=!1,this.hideAllTooltips(),this.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"})},emit:(e,t)=>this.emit(`nile-${e}`,t)})}refresh(){this.attachTooltip()}hasValidContent(){const e=this.content??this.getAttribute("data-tippy-content")??"";return"string"==typeof e&&e.trim().length>0}attachTooltip(){if(this.destroyTooltips(),this.disabled||!this.hasValidContent())return;const e={content:this.content||this.getAttribute("data-tippy-content")||void 0,placement:this.placement,trigger:this.trigger,offset:[this.skidding,this.distance],theme:"lite",animation:"fade",interactive:this.interactive,arrow:tw,duration:sQ(this.duration),allowHTML:this.allowHTML,delay:this.delay,maxWidth:this.maxWidth,zIndex:this.zIndex,hideOnClick:!1,inertia:this.inertia,interactiveBorder:this.interactiveBorder,appendTo:document.body,followCursor:rQ(this.followCursor),plugins:rQ(this.followCursor)?[oQ]:[],onShow:e=>{this.open=!0,this.dispatchEvent(new CustomEvent("nile-show",{detail:{instance:e,target:e.reference}})),this.dispatchEvent(new CustomEvent("nile-toggle",{detail:{open:!0,instance:e,target:e.reference}}))},onHide:e=>{this.open=!1,this.dispatchEvent(new CustomEvent("nile-hide",{detail:{instance:e,target:e.reference}})),this.dispatchEvent(new CustomEvent("nile-toggle",{detail:{open:!1,instance:e,target:e.reference}}))}};if(this.for){if(this.singleton&&!this.for.startsWith("#")&&!document.getElementById(this.for)){const t=Array.from(document.querySelectorAll(`.${this.for}`));if(t.length>0)return this.tooltipInstances=t.map((t=>{const i=Kw(t,{...e,content:t.getAttribute("content")||this.content});return i.popper.querySelector(".tippy-box")?.classList.add(this.size),i})),this.singletonInstance=tQ(this.tooltipInstances,{delay:[75,0],arrow:tw,moveTransition:"transform 0.15s ease-out"}),void(this.open&&queueMicrotask((()=>this.singletonInstance?.show())))}const t=document.getElementById(this.for);if(this.singleton&&t){const i=Array.from(t.querySelectorAll("[content]"));if(i.length>0)return this.tooltipInstances=i.map((t=>{const i=Kw(t,{...e,content:t.getAttribute("content")||this.content});return i.popper.querySelector(".tippy-box")?.classList.add(this.size),i})),this.singletonInstance=tQ(this.tooltipInstances,{delay:[75,0],arrow:tw,moveTransition:"transform 0.15s ease-out"}),void(this.open&&queueMicrotask((()=>this.singletonInstance?.show())))}if(this.targetEl=document.getElementById(this.for),!this.targetEl)return;this.id||(this.generatedId=`nile-tooltip-${Math.random().toString(36).slice(2,9)}`,this.id=this.generatedId),this.prevDescribedby=this.targetEl.getAttribute("aria-describedby");const i=this.prevDescribedby?`${this.prevDescribedby} ${this.id}`:this.id;return this.targetEl.setAttribute("aria-describedby",i),this.singleInstance=Kw(this.targetEl,e),this.size&&this.singleInstance.popper.querySelector(".tippy-box")?.classList.add(this.size),void(this.open&&queueMicrotask((()=>this.singleInstance?.show())))}if(this.enableRecursiveMode){const t=Array.from(this.querySelectorAll("*"));t.length>0&&(this.tooltipInstances=t.map((t=>{const i=t,M=i.getAttribute("content")||this.content,n=Kw(i,{...e,content:M});return n.popper.querySelector(".tippy-box")?.classList.add(this.size),n})),this.singleton&&this.tooltipInstances.length>1&&(this.singletonInstance=tQ(this.tooltipInstances,{delay:[75,0],arrow:tw,moveTransition:"transform 0.15s ease-out"})),this.open&&(this.singletonInstance?this.singletonInstance.show():this.tooltipInstances.forEach((e=>e.show()))))}else{const t=this.firstElementChild;if(t){const i=t.getAttribute("content")||this.content,M=Kw(t,{...e,content:i});M.popper.querySelector(".tippy-box")?.classList.add(this.size),this.tooltipInstances=[M],this.open&&M.show()}}}destroyTooltips(){if(this.tooltipInstances?.forEach((e=>e.destroy())),this.singleInstance?.destroy(),this.singletonInstance?.destroy(),this.tooltipInstances=void 0,this.singleInstance=void 0,this.singletonInstance=void 0,this.targetEl&&this.id){const e=this.targetEl.getAttribute("aria-describedby")?.split(" ").filter((e=>e!==this.id)).join(" ").trim();e?this.targetEl.setAttribute("aria-describedby",e):this.targetEl.removeAttribute("aria-describedby")}}hideAllTooltips(){this.singleInstance?.hide(),this.singletonInstance?.hide(),this.tooltipInstances?.forEach((e=>e.hide()))}disconnectedCallback(){super.disconnectedCallback(),this.visibilityManager?.cleanup(),this.destroyTooltips()}updated(e){super.updated(e),["for","content","placement","distance","skidding","trigger","disabled","hoist","size","arrow","singleton"].some((t=>e.has(t)))&&this.attachTooltip(),e.has("open")&&(this.open?(this.visibilityManager?.setup(),this.singleInstance?.show(),this.singletonInstance?.show(),this.tooltipInstances?.forEach((e=>e.show()))):(this.visibilityManager?.cleanup(),this.singleInstance?.hide(),this.singletonInstance?.hide(),this.tooltipInstances?.forEach((e=>e.hide()))))}};e([ce({type:String,attribute:"for"})],aQ.prototype,"for",void 0),e([ce({type:String,reflect:!0})],aQ.prototype,"content",void 0),e([ce({type:String,reflect:!0})],aQ.prototype,"size",void 0),e([ce({type:String,reflect:!0})],aQ.prototype,"duration",void 0),e([ce({type:Boolean,reflect:!0})],aQ.prototype,"interactive",void 0),e([ce({type:String})],aQ.prototype,"placement",void 0),e([ce({type:Boolean})],aQ.prototype,"disabled",void 0),e([ce({type:Number})],aQ.prototype,"distance",void 0),e([ce({type:Number})],aQ.prototype,"skidding",void 0),e([ce({type:Boolean,reflect:!0})],aQ.prototype,"open",void 0),e([ce({type:String})],aQ.prototype,"trigger",void 0),e([ce({type:Boolean,reflect:!0})],aQ.prototype,"allowHTML",void 0),e([ce({type:String,reflect:!0,attribute:!0})],aQ.prototype,"followCursor",void 0),e([ce({type:String,reflect:!0,attribute:!0})],aQ.prototype,"arrow",void 0),e([ce({type:Boolean,reflect:!0})],aQ.prototype,"singleton",void 0),e([ce({type:Boolean,reflect:!0})],aQ.prototype,"enableRecursiveMode",void 0),e([ce({type:String,reflect:!0})],aQ.prototype,"delay",void 0),e([ce({type:String,reflect:!0})],aQ.prototype,"maxWidth",void 0),e([ce({type:Number})],aQ.prototype,"zIndex",void 0),e([ce({type:[Boolean,String],reflect:!0})],aQ.prototype,"hideOnClick",void 0),e([ce({type:Boolean,reflect:!0})],aQ.prototype,"inertia",void 0),e([ce({type:Number})],aQ.prototype,"interactiveBorder",void 0),e([ce({type:Boolean,reflect:!0})],aQ.prototype,"enableVisibilityEffect",void 0),e([ce({type:Boolean,reflect:!0})],aQ.prototype,"enableTabClose",void 0),aQ=e([Ne("nile-lite-tooltip")],aQ);const lQ=r`
|
|
16477
|
+
`;!function(){const e="nile-lite-tooltip-styles";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent=Zm.cssText,document.head.appendChild(t)}();var Vm="top",Wm="bottom",Pm="right",Rm="left",Bm="auto",Gm=[Vm,Wm,Pm,Rm],_m="start",Fm="end",Hm="viewport",Jm="popper",$m=Gm.reduce((function(e,t){return e.concat([t+"-"+_m,t+"-"+Fm])}),[]),Xm=[].concat(Gm,[Bm]).reduce((function(e,t){return e.concat([t,t+"-"+_m,t+"-"+Fm])}),[]),qm=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Km(e){return e?(e.nodeName||"").toLowerCase():null}function eE(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function tE(e){return e instanceof eE(e).Element||e instanceof Element}function iE(e){return e instanceof eE(e).HTMLElement||e instanceof HTMLElement}function ME(e){return"undefined"!=typeof ShadowRoot&&(e instanceof eE(e).ShadowRoot||e instanceof ShadowRoot)}var nE={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var i=t.styles[e]||{},M=t.attributes[e]||{},n=t.elements[e];iE(n)&&Km(n)&&(Object.assign(n.style,i),Object.keys(M).forEach((function(e){var t=M[e];!1===t?n.removeAttribute(e):n.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach((function(e){var M=t.elements[e],n=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:i[e]).reduce((function(e,t){return e[t]="",e}),{});iE(M)&&Km(M)&&(Object.assign(M.style,o),Object.keys(n).forEach((function(e){M.removeAttribute(e)})))}))}},requires:["computeStyles"]};function oE(e){return e.split("-")[0]}var rE=Math.max,sE=Math.min,aE=Math.round;function lE(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function NE(){return!/^((?!chrome|android).)*safari/i.test(lE())}function gE(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1);var M=e.getBoundingClientRect(),n=1,o=1;t&&iE(e)&&(n=e.offsetWidth>0&&aE(M.width)/e.offsetWidth||1,o=e.offsetHeight>0&&aE(M.height)/e.offsetHeight||1);var r=(tE(e)?eE(e):window).visualViewport,s=!NE()&&i,a=(M.left+(s&&r?r.offsetLeft:0))/n,l=(M.top+(s&&r?r.offsetTop:0))/o,N=M.width/n,g=M.height/o;return{width:N,height:g,top:l,right:a+N,bottom:l+g,left:a,x:a,y:l}}function uE(e){var t=gE(e),i=e.offsetWidth,M=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-M)<=1&&(M=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:M}}function cE(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&ME(i)){var M=t;do{if(M&&e.isSameNode(M))return!0;M=M.parentNode||M.host}while(M)}return!1}function DE(e){return eE(e).getComputedStyle(e)}function jE(e){return["table","td","th"].indexOf(Km(e))>=0}function IE(e){return((tE(e)?e.ownerDocument:e.document)||window.document).documentElement}function zE(e){return"html"===Km(e)?e:e.assignedSlot||e.parentNode||(ME(e)?e.host:null)||IE(e)}function dE(e){return iE(e)&&"fixed"!==DE(e).position?e.offsetParent:null}function hE(e){for(var t=eE(e),i=dE(e);i&&jE(i)&&"static"===DE(i).position;)i=dE(i);return i&&("html"===Km(i)||"body"===Km(i)&&"static"===DE(i).position)?t:i||function(e){var t=/firefox/i.test(lE());if(/Trident/i.test(lE())&&iE(e)&&"fixed"===DE(e).position)return null;var i=zE(e);for(ME(i)&&(i=i.host);iE(i)&&["html","body"].indexOf(Km(i))<0;){var M=DE(i);if("none"!==M.transform||"none"!==M.perspective||"paint"===M.contain||-1!==["transform","perspective"].indexOf(M.willChange)||t&&"filter"===M.willChange||t&&M.filter&&"none"!==M.filter)return i;i=i.parentNode}return null}(e)||t}function TE(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function yE(e,t,i){return rE(e,sE(t,i))}function AE(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function OE(e,t){return t.reduce((function(t,i){return t[i]=e,t}),{})}var pE={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,i=e.state,M=e.name,n=e.options,o=i.elements.arrow,r=i.modifiersData.popperOffsets,s=oE(i.placement),a=TE(s),l=[Rm,Pm].indexOf(s)>=0?"height":"width";if(o&&r){var N=function(e,t){return AE("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:OE(e,Gm))}(n.padding,i),g=uE(o),u="y"===a?Vm:Rm,c="y"===a?Wm:Pm,D=i.rects.reference[l]+i.rects.reference[a]-r[a]-i.rects.popper[l],j=r[a]-i.rects.reference[a],I=hE(o),z=I?"y"===a?I.clientHeight||0:I.clientWidth||0:0,d=D/2-j/2,h=N[u],T=z-g[l]-N[c],y=z/2-g[l]/2+d,A=yE(h,y,T),O=a;i.modifiersData[M]=((t={})[O]=A,t.centerOffset=A-y,t)}},effect:function(e){var t=e.state,i=e.options.element,M=void 0===i?"[data-popper-arrow]":i;null!=M&&("string"!=typeof M||(M=t.elements.popper.querySelector(M)))&&cE(t.elements.popper,M)&&(t.elements.arrow=M)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function xE(e){return e.split("-")[1]}var LE={top:"auto",right:"auto",bottom:"auto",left:"auto"};function SE(e){var t,i=e.popper,M=e.popperRect,n=e.placement,o=e.variation,r=e.offsets,s=e.position,a=e.gpuAcceleration,l=e.adaptive,N=e.roundOffsets,g=e.isFixed,u=r.x,c=void 0===u?0:u,D=r.y,j=void 0===D?0:D,I="function"==typeof N?N({x:c,y:j}):{x:c,y:j};c=I.x,j=I.y;var z=r.hasOwnProperty("x"),d=r.hasOwnProperty("y"),h=Rm,T=Vm,y=window;if(l){var A=hE(i),O="clientHeight",p="clientWidth";if(A===eE(i)&&"static"!==DE(A=IE(i)).position&&"absolute"===s&&(O="scrollHeight",p="scrollWidth"),n===Vm||(n===Rm||n===Pm)&&o===Fm)T=Wm,j-=(g&&A===y&&y.visualViewport?y.visualViewport.height:A[O])-M.height,j*=a?1:-1;if(n===Rm||(n===Vm||n===Wm)&&o===Fm)h=Pm,c-=(g&&A===y&&y.visualViewport?y.visualViewport.width:A[p])-M.width,c*=a?1:-1}var x,L=Object.assign({position:s},l&&LE),S=!0===N?function(e,t){var i=e.x,M=e.y,n=t.devicePixelRatio||1;return{x:aE(i*n)/n||0,y:aE(M*n)/n||0}}({x:c,y:j},eE(i)):{x:c,y:j};return c=S.x,j=S.y,a?Object.assign({},L,((x={})[T]=d?"0":"",x[h]=z?"0":"",x.transform=(y.devicePixelRatio||1)<=1?"translate("+c+"px, "+j+"px)":"translate3d("+c+"px, "+j+"px, 0)",x)):Object.assign({},L,((t={})[T]=d?j+"px":"",t[h]=z?c+"px":"",t.transform="",t))}var mE={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,i=e.options,M=i.gpuAcceleration,n=void 0===M||M,o=i.adaptive,r=void 0===o||o,s=i.roundOffsets,a=void 0===s||s,l={placement:oE(t.placement),variation:xE(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:n,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,SE(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:r,roundOffsets:a})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,SE(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},EE={passive:!0};var wE={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,i=e.instance,M=e.options,n=M.scroll,o=void 0===n||n,r=M.resize,s=void 0===r||r,a=eE(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&l.forEach((function(e){e.addEventListener("scroll",i.update,EE)})),s&&a.addEventListener("resize",i.update,EE),function(){o&&l.forEach((function(e){e.removeEventListener("scroll",i.update,EE)})),s&&a.removeEventListener("resize",i.update,EE)}},data:{}},QE={left:"right",right:"left",bottom:"top",top:"bottom"};function kE(e){return e.replace(/left|right|bottom|top/g,(function(e){return QE[e]}))}var CE={start:"end",end:"start"};function bE(e){return e.replace(/start|end/g,(function(e){return CE[e]}))}function fE(e){var t=eE(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function vE(e){return gE(IE(e)).left+fE(e).scrollLeft}function UE(e){var t=DE(e),i=t.overflow,M=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+n+M)}function YE(e){return["html","body","#document"].indexOf(Km(e))>=0?e.ownerDocument.body:iE(e)&&UE(e)?e:YE(zE(e))}function ZE(e,t){var i;void 0===t&&(t=[]);var M=YE(e),n=M===(null==(i=e.ownerDocument)?void 0:i.body),o=eE(M),r=n?[o].concat(o.visualViewport||[],UE(M)?M:[]):M,s=t.concat(r);return n?s:s.concat(ZE(zE(r)))}function VE(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function WE(e,t,i){return t===Hm?VE(function(e,t){var i=eE(e),M=IE(e),n=i.visualViewport,o=M.clientWidth,r=M.clientHeight,s=0,a=0;if(n){o=n.width,r=n.height;var l=NE();(l||!l&&"fixed"===t)&&(s=n.offsetLeft,a=n.offsetTop)}return{width:o,height:r,x:s+vE(e),y:a}}(e,i)):tE(t)?function(e,t){var i=gE(e,!1,"fixed"===t);return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}(t,i):VE(function(e){var t,i=IE(e),M=fE(e),n=null==(t=e.ownerDocument)?void 0:t.body,o=rE(i.scrollWidth,i.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),r=rE(i.scrollHeight,i.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),s=-M.scrollLeft+vE(e),a=-M.scrollTop;return"rtl"===DE(n||i).direction&&(s+=rE(i.clientWidth,n?n.clientWidth:0)-o),{width:o,height:r,x:s,y:a}}(IE(e)))}function PE(e,t,i,M){var n="clippingParents"===t?function(e){var t=ZE(zE(e)),i=["absolute","fixed"].indexOf(DE(e).position)>=0&&iE(e)?hE(e):e;return tE(i)?t.filter((function(e){return tE(e)&&cE(e,i)&&"body"!==Km(e)})):[]}(e):[].concat(t),o=[].concat(n,[i]),r=o[0],s=o.reduce((function(t,i){var n=WE(e,i,M);return t.top=rE(n.top,t.top),t.right=sE(n.right,t.right),t.bottom=sE(n.bottom,t.bottom),t.left=rE(n.left,t.left),t}),WE(e,r,M));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function RE(e){var t,i=e.reference,M=e.element,n=e.placement,o=n?oE(n):null,r=n?xE(n):null,s=i.x+i.width/2-M.width/2,a=i.y+i.height/2-M.height/2;switch(o){case Vm:t={x:s,y:i.y-M.height};break;case Wm:t={x:s,y:i.y+i.height};break;case Pm:t={x:i.x+i.width,y:a};break;case Rm:t={x:i.x-M.width,y:a};break;default:t={x:i.x,y:i.y}}var l=o?TE(o):null;if(null!=l){var N="y"===l?"height":"width";switch(r){case _m:t[l]=t[l]-(i[N]/2-M[N]/2);break;case Fm:t[l]=t[l]+(i[N]/2-M[N]/2)}}return t}function BE(e,t){void 0===t&&(t={});var i=t,M=i.placement,n=void 0===M?e.placement:M,o=i.strategy,r=void 0===o?e.strategy:o,s=i.boundary,a=void 0===s?"clippingParents":s,l=i.rootBoundary,N=void 0===l?Hm:l,g=i.elementContext,u=void 0===g?Jm:g,c=i.altBoundary,D=void 0!==c&&c,j=i.padding,I=void 0===j?0:j,z=AE("number"!=typeof I?I:OE(I,Gm)),d=u===Jm?"reference":Jm,h=e.rects.popper,T=e.elements[D?d:u],y=PE(tE(T)?T:T.contextElement||IE(e.elements.popper),a,N,r),A=gE(e.elements.reference),O=RE({reference:A,element:h,strategy:"absolute",placement:n}),p=VE(Object.assign({},h,O)),x=u===Jm?p:A,L={top:y.top-x.top+z.top,bottom:x.bottom-y.bottom+z.bottom,left:y.left-x.left+z.left,right:x.right-y.right+z.right},S=e.modifiersData.offset;if(u===Jm&&S){var m=S[n];Object.keys(L).forEach((function(e){var t=[Pm,Wm].indexOf(e)>=0?1:-1,i=[Vm,Wm].indexOf(e)>=0?"y":"x";L[e]+=m[i]*t}))}return L}function GE(e,t){void 0===t&&(t={});var i=t,M=i.placement,n=i.boundary,o=i.rootBoundary,r=i.padding,s=i.flipVariations,a=i.allowedAutoPlacements,l=void 0===a?Xm:a,N=xE(M),g=N?s?$m:$m.filter((function(e){return xE(e)===N})):Gm,u=g.filter((function(e){return l.indexOf(e)>=0}));0===u.length&&(u=g);var c=u.reduce((function(t,i){return t[i]=BE(e,{placement:i,boundary:n,rootBoundary:o,padding:r})[oE(i)],t}),{});return Object.keys(c).sort((function(e,t){return c[e]-c[t]}))}var _E={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,M=e.name;if(!t.modifiersData[M]._skip){for(var n=i.mainAxis,o=void 0===n||n,r=i.altAxis,s=void 0===r||r,a=i.fallbackPlacements,l=i.padding,N=i.boundary,g=i.rootBoundary,u=i.altBoundary,c=i.flipVariations,D=void 0===c||c,j=i.allowedAutoPlacements,I=t.options.placement,z=oE(I),d=a||(z===I||!D?[kE(I)]:function(e){if(oE(e)===Bm)return[];var t=kE(e);return[bE(e),t,bE(t)]}(I)),h=[I].concat(d).reduce((function(e,i){return e.concat(oE(i)===Bm?GE(t,{placement:i,boundary:N,rootBoundary:g,padding:l,flipVariations:D,allowedAutoPlacements:j}):i)}),[]),T=t.rects.reference,y=t.rects.popper,A=new Map,O=!0,p=h[0],x=0;x<h.length;x++){var L=h[x],S=oE(L),m=xE(L)===_m,E=[Vm,Wm].indexOf(S)>=0,w=E?"width":"height",Q=BE(t,{placement:L,boundary:N,rootBoundary:g,altBoundary:u,padding:l}),k=E?m?Pm:Rm:m?Wm:Vm;T[w]>y[w]&&(k=kE(k));var C=kE(k),b=[];if(o&&b.push(Q[S]<=0),s&&b.push(Q[k]<=0,Q[C]<=0),b.every((function(e){return e}))){p=L,O=!1;break}A.set(L,b)}if(O)for(var f=function(e){var t=h.find((function(t){var i=A.get(t);if(i)return i.slice(0,e).every((function(e){return e}))}));if(t)return p=t,"break"},v=D?3:1;v>0;v--){if("break"===f(v))break}t.placement!==p&&(t.modifiersData[M]._skip=!0,t.placement=p,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function FE(e,t,i){return void 0===i&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function HE(e){return[Vm,Pm,Wm,Rm].some((function(t){return e[t]>=0}))}var JE={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,i=e.name,M=t.rects.reference,n=t.rects.popper,o=t.modifiersData.preventOverflow,r=BE(t,{elementContext:"reference"}),s=BE(t,{altBoundary:!0}),a=FE(r,M),l=FE(s,n,o),N=HE(a),g=HE(l);t.modifiersData[i]={referenceClippingOffsets:a,popperEscapeOffsets:l,isReferenceHidden:N,hasPopperEscaped:g},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":N,"data-popper-escaped":g})}};var $E={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,i=e.options,M=e.name,n=i.offset,o=void 0===n?[0,0]:n,r=Xm.reduce((function(e,i){return e[i]=function(e,t,i){var M=oE(e),n=[Rm,Vm].indexOf(M)>=0?-1:1,o="function"==typeof i?i(Object.assign({},t,{placement:e})):i,r=o[0],s=o[1];return r=r||0,s=(s||0)*n,[Rm,Pm].indexOf(M)>=0?{x:s,y:r}:{x:r,y:s}}(i,t.rects,o),e}),{}),s=r[t.placement],a=s.x,l=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=a,t.modifiersData.popperOffsets.y+=l),t.modifiersData[M]=r}};var XE={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,i=e.name;t.modifiersData[i]=RE({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var qE={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,M=e.name,n=i.mainAxis,o=void 0===n||n,r=i.altAxis,s=void 0!==r&&r,a=i.boundary,l=i.rootBoundary,N=i.altBoundary,g=i.padding,u=i.tether,c=void 0===u||u,D=i.tetherOffset,j=void 0===D?0:D,I=BE(t,{boundary:a,rootBoundary:l,padding:g,altBoundary:N}),z=oE(t.placement),d=xE(t.placement),h=!d,T=TE(z),y="x"===T?"y":"x",A=t.modifiersData.popperOffsets,O=t.rects.reference,p=t.rects.popper,x="function"==typeof j?j(Object.assign({},t.rects,{placement:t.placement})):j,L="number"==typeof x?{mainAxis:x,altAxis:x}:Object.assign({mainAxis:0,altAxis:0},x),S=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,m={x:0,y:0};if(A){if(o){var E,w="y"===T?Vm:Rm,Q="y"===T?Wm:Pm,k="y"===T?"height":"width",C=A[T],b=C+I[w],f=C-I[Q],v=c?-p[k]/2:0,U=d===_m?O[k]:p[k],Y=d===_m?-p[k]:-O[k],Z=t.elements.arrow,V=c&&Z?uE(Z):{width:0,height:0},W=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},P=W[w],R=W[Q],B=yE(0,O[k],V[k]),G=h?O[k]/2-v-B-P-L.mainAxis:U-B-P-L.mainAxis,_=h?-O[k]/2+v+B+R+L.mainAxis:Y+B+R+L.mainAxis,F=t.elements.arrow&&hE(t.elements.arrow),H=F?"y"===T?F.clientTop||0:F.clientLeft||0:0,J=null!=(E=null==S?void 0:S[T])?E:0,$=C+_-J,X=yE(c?sE(b,C+G-J-H):b,C,c?rE(f,$):f);A[T]=X,m[T]=X-C}if(s){var q,K="x"===T?Vm:Rm,ee="x"===T?Wm:Pm,te=A[y],ie="y"===y?"height":"width",Me=te+I[K],ne=te-I[ee],oe=-1!==[Vm,Rm].indexOf(z),re=null!=(q=null==S?void 0:S[y])?q:0,se=oe?Me:te-O[ie]-p[ie]-re+L.altAxis,ae=oe?te+O[ie]+p[ie]-re-L.altAxis:ne,le=c&&oe?function(e,t,i){var M=yE(e,t,i);return M>i?i:M}(se,te,ae):yE(c?se:Me,te,c?ae:ne);A[y]=le,m[y]=le-te}t.modifiersData[M]=m}},requiresIfExists:["offset"]};function KE(e,t,i){void 0===i&&(i=!1);var M,n,o=iE(t),r=iE(t)&&function(e){var t=e.getBoundingClientRect(),i=aE(t.width)/e.offsetWidth||1,M=aE(t.height)/e.offsetHeight||1;return 1!==i||1!==M}(t),s=IE(t),a=gE(e,r,i),l={scrollLeft:0,scrollTop:0},N={x:0,y:0};return(o||!o&&!i)&&(("body"!==Km(t)||UE(s))&&(l=(M=t)!==eE(M)&&iE(M)?{scrollLeft:(n=M).scrollLeft,scrollTop:n.scrollTop}:fE(M)),iE(t)?((N=gE(t,!0)).x+=t.clientLeft,N.y+=t.clientTop):s&&(N.x=vE(s))),{x:a.left+l.scrollLeft-N.x,y:a.top+l.scrollTop-N.y,width:a.width,height:a.height}}function ew(e){var t=new Map,i=new Set,M=[];function n(e){i.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!i.has(e)){var M=t.get(e);M&&n(M)}})),M.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){i.has(e.name)||n(e)})),M}var tw={placement:"bottom",modifiers:[],strategy:"absolute"};function iw(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function Mw(e){void 0===e&&(e={});var t=e,i=t.defaultModifiers,M=void 0===i?[]:i,n=t.defaultOptions,o=void 0===n?tw:n;return function(e,t,i){void 0===i&&(i=o);var n,r,s={placement:"bottom",orderedModifiers:[],options:Object.assign({},tw,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},a=[],l=!1,N={state:s,setOptions:function(i){var n="function"==typeof i?i(s.options):i;g(),s.options=Object.assign({},o,s.options,n),s.scrollParents={reference:tE(e)?ZE(e):e.contextElement?ZE(e.contextElement):[],popper:ZE(t)};var r=function(e){var t=ew(e);return qm.reduce((function(e,i){return e.concat(t.filter((function(e){return e.phase===i})))}),[])}(function(e){var t=e.reduce((function(e,t){var i=e[t.name];return e[t.name]=i?Object.assign({},i,t,{options:Object.assign({},i.options,t.options),data:Object.assign({},i.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(M,s.options.modifiers)));return s.orderedModifiers=r.filter((function(e){return e.enabled})),s.orderedModifiers.forEach((function(e){var t=e.name,i=e.options,M=void 0===i?{}:i,n=e.effect;if("function"==typeof n){var o=n({state:s,name:t,instance:N,options:M}),r=function(){};a.push(o||r)}})),N.update()},forceUpdate:function(){if(!l){var e=s.elements,t=e.reference,i=e.popper;if(iw(t,i)){s.rects={reference:KE(t,hE(i),"fixed"===s.options.strategy),popper:uE(i)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(e){return s.modifiersData[e.name]=Object.assign({},e.data)}));for(var M=0;M<s.orderedModifiers.length;M++)if(!0!==s.reset){var n=s.orderedModifiers[M],o=n.fn,r=n.options,a=void 0===r?{}:r,g=n.name;"function"==typeof o&&(s=o({state:s,options:a,name:g,instance:N})||s)}else s.reset=!1,M=-1}}},update:(n=function(){return new Promise((function(e){N.forceUpdate(),e(s)}))},function(){return r||(r=new Promise((function(e){Promise.resolve().then((function(){r=void 0,e(n())}))}))),r}),destroy:function(){g(),l=!0}};if(!iw(e,t))return N;function g(){a.forEach((function(e){return e()})),a=[]}return N.setOptions(i).then((function(e){!l&&i.onFirstUpdate&&i.onFirstUpdate(e)})),N}}var nw=Mw({defaultModifiers:[wE,XE,mE,nE,$E,_E,qE,pE,JE]}),ow='<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>',rw="tippy-content",sw="tippy-arrow",aw="tippy-svg-arrow",lw={passive:!0,capture:!0},Nw=function(){return document.body};function gw(e,t,i){if(Array.isArray(e)){var M=e[t];return null==M?Array.isArray(i)?i[t]:i:M}return e}function uw(e,t){var i={}.toString.call(e);return 0===i.indexOf("[object")&&i.indexOf(t+"]")>-1}function cw(e,t){return"function"==typeof e?e.apply(void 0,t):e}function Dw(e,t){return 0===t?e:function(M){clearTimeout(i),i=setTimeout((function(){e(M)}),t)};var i}function jw(e,t){var i=Object.assign({},e);return t.forEach((function(e){delete i[e]})),i}function Iw(e){return[].concat(e)}function zw(e,t){-1===e.indexOf(t)&&e.push(t)}function dw(e){return[].slice.call(e)}function hw(e){return Object.keys(e).reduce((function(t,i){return void 0!==e[i]&&(t[i]=e[i]),t}),{})}function Tw(){return document.createElement("div")}function yw(e){return["Element","Fragment"].some((function(t){return uw(e,t)}))}function Aw(e){return uw(e,"MouseEvent")}function Ow(e){return yw(e)?[e]:function(e){return uw(e,"NodeList")}(e)?dw(e):Array.isArray(e)?e:dw(document.querySelectorAll(e))}function pw(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function xw(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Lw(e){var t,i=Iw(e)[0];return null!=i&&null!=(t=i.ownerDocument)&&t.body?i.ownerDocument:document}function Sw(e,t,i){var M=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[M](t,i)}))}function mw(e,t){for(var i=t;i;){var M;if(e.contains(i))return!0;i=null==i.getRootNode||null==(M=i.getRootNode())?void 0:M.host}return!1}var Ew={isTouch:!1},ww=0;function Qw(){Ew.isTouch||(Ew.isTouch=!0,window.performance&&document.addEventListener("mousemove",kw))}function kw(){var e=performance.now();e-ww<20&&(Ew.isTouch=!1,document.removeEventListener("mousemove",kw)),ww=e}function Cw(){var e,t=document.activeElement;if((e=t)&&e._tippy&&e._tippy.reference===e){var i=t._tippy;t.blur&&!i.state.isVisible&&t.blur()}}var bw,fw=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;function vw(e){return[e+"() was called on a"+("destroy"===e?"n already-":" ")+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function Uw(e){return e.replace(/[ \t]{2,}/g," ").replace(/^[ \t]*/gm,"").trim()}function Yw(e){return Uw("\n %ctippy.js\n\n %c"+Uw(e)+"\n\n %c👷 This is a development-only message. It will be removed in production.\n ")}function Zw(e){return[Yw(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}function Vw(e,t){var i;e&&!bw.has(t)&&(bw.add(t),(i=console).warn.apply(i,Zw(t)))}function Ww(e,t){var i;e&&!bw.has(t)&&(bw.add(t),(i=console).error.apply(i,Zw(t)))}"production"!==process.env.NODE_ENV&&(bw=new Set);var Pw={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Rw=Object.assign({appendTo:Nw,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Pw,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Bw=Object.keys(Rw);function Gw(e){var t=(e.plugins||[]).reduce((function(t,i){var M,n=i.name,o=i.defaultValue;n&&(t[n]=void 0!==e[n]?e[n]:null!=(M=Rw[n])?M:o);return t}),{});return Object.assign({},e,t)}function _w(e,t){var i=Object.assign({},t,{content:cw(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Gw(Object.assign({},Rw,{plugins:t}))):Bw).reduce((function(t,i){var M=(e.getAttribute("data-tippy-"+i)||"").trim();if(!M)return t;if("content"===i)t[i]=M;else try{t[i]=JSON.parse(M)}catch(e){t[i]=M}return t}),{})}(e,t.plugins));return i.aria=Object.assign({},Rw.aria,i.aria),i.aria={expanded:"auto"===i.aria.expanded?t.interactive:i.aria.expanded,content:"auto"===i.aria.content?t.interactive?null:"describedby":i.aria.content},i}function Fw(e,t){void 0===e&&(e={}),void 0===t&&(t=[]),Object.keys(e).forEach((function(e){var i,M,n=jw(Rw,Object.keys(Pw)),o=(i=n,M=e,!{}.hasOwnProperty.call(i,M));o&&(o=0===t.filter((function(t){return t.name===e})).length),Vw(o,["`"+e+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.","\n\n","All props: https://atomiks.github.io/tippyjs/v6/all-props/\n","Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))}))}function Hw(e,t){e.innerHTML=t}function Jw(e){var t=Tw();return!0===e?t.className=sw:(t.className=aw,yw(e)?t.appendChild(e):Hw(t,e)),t}function $w(e,t){yw(t.content)?(Hw(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Hw(e,t.content):e.textContent=t.content)}function Xw(e){var t=e.firstElementChild,i=dw(t.children);return{box:t,content:i.find((function(e){return e.classList.contains(rw)})),arrow:i.find((function(e){return e.classList.contains(sw)||e.classList.contains(aw)})),backdrop:i.find((function(e){return e.classList.contains("tippy-backdrop")}))}}function qw(e){var t=Tw(),i=Tw();i.className="tippy-box",i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var M=Tw();function n(i,M){var n=Xw(t),o=n.box,r=n.content,s=n.arrow;M.theme?o.setAttribute("data-theme",M.theme):o.removeAttribute("data-theme"),"string"==typeof M.animation?o.setAttribute("data-animation",M.animation):o.removeAttribute("data-animation"),M.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof M.maxWidth?M.maxWidth+"px":M.maxWidth,M.role?o.setAttribute("role",M.role):o.removeAttribute("role"),i.content===M.content&&i.allowHTML===M.allowHTML||$w(r,e.props),M.arrow?s?i.arrow!==M.arrow&&(o.removeChild(s),o.appendChild(Jw(M.arrow))):o.appendChild(Jw(M.arrow)):s&&o.removeChild(s)}return M.className=rw,M.setAttribute("data-state","hidden"),$w(M,e.props),t.appendChild(i),i.appendChild(M),n(e.props,e.props),{popper:t,onUpdate:n}}qw.$$tippy=!0;var Kw=1,eQ=[],tQ=[];function iQ(e,t){var i,M,n,o,r,s,a,l,N=_w(e,Object.assign({},Rw,Gw(hw(t)))),g=!1,u=!1,c=!1,D=!1,j=[],I=Dw(F,N.interactiveDebounce),z=Kw++,d=(l=N.plugins).filter((function(e,t){return l.indexOf(e)===t})),h={id:z,reference:e,popper:Tw(),popperInstance:null,props:N,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:d,clearDelayTimeouts:function(){clearTimeout(i),clearTimeout(M),cancelAnimationFrame(n)},setProps:function(t){"production"!==process.env.NODE_ENV&&Vw(h.state.isDestroyed,vw("setProps"));if(h.state.isDestroyed)return;C("onBeforeUpdate",[h,t]),G();var i=h.props,M=_w(e,Object.assign({},i,hw(t),{ignoreAttributes:!0}));h.props=M,B(),i.interactiveDebounce!==M.interactiveDebounce&&(v(),I=Dw(F,M.interactiveDebounce));i.triggerTarget&&!M.triggerTarget?Iw(i.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):M.triggerTarget&&e.removeAttribute("aria-expanded");f(),k(),A&&A(i,M);h.popperInstance&&(X(),K().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));C("onAfterUpdate",[h,t])},setContent:function(e){h.setProps({content:e})},show:function(){"production"!==process.env.NODE_ENV&&Vw(h.state.isDestroyed,vw("show"));var e=h.state.isVisible,t=h.state.isDestroyed,i=!h.state.isEnabled,M=Ew.isTouch&&!h.props.touch,n=gw(h.props.duration,0,Rw.duration);if(e||t||i||M)return;if(m().hasAttribute("disabled"))return;if(C("onShow",[h],!1),!1===h.props.onShow(h))return;h.state.isVisible=!0,S()&&(y.style.visibility="visible");k(),V(),h.state.isMounted||(y.style.transition="none");if(S()){var o=w();pw([o.box,o.content],0)}s=function(){var e;if(h.state.isVisible&&!D){if(D=!0,y.offsetHeight,y.style.transition=h.props.moveTransition,S()&&h.props.animation){var t=w(),i=t.box,M=t.content;pw([i,M],n),xw([i,M],"visible")}b(),f(),zw(tQ,h),null==(e=h.popperInstance)||e.forceUpdate(),C("onMount",[h]),h.props.animation&&S()&&function(e,t){P(e,t)}(n,(function(){h.state.isShown=!0,C("onShown",[h])}))}},function(){var e,t=h.props.appendTo,i=m();e=h.props.interactive&&t===Nw||"parent"===t?i.parentNode:cw(t,[i]);e.contains(y)||e.appendChild(y);h.state.isMounted=!0,X(),"production"!==process.env.NODE_ENV&&Vw(h.props.interactive&&t===Rw.appendTo&&i.nextElementSibling!==y,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.","\n\n","Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.","\n\n","Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.","\n\n","See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}()},hide:function(){"production"!==process.env.NODE_ENV&&Vw(h.state.isDestroyed,vw("hide"));var e=!h.state.isVisible,t=h.state.isDestroyed,i=!h.state.isEnabled,M=gw(h.props.duration,1,Rw.duration);if(e||t||i)return;if(C("onHide",[h],!1),!1===h.props.onHide(h))return;h.state.isVisible=!1,h.state.isShown=!1,D=!1,g=!1,S()&&(y.style.visibility="hidden");if(v(),W(),k(!0),S()){var n=w(),o=n.box,r=n.content;h.props.animation&&(pw([o,r],M),xw([o,r],"hidden"))}b(),f(),h.props.animation?S()&&function(e,t){P(e,(function(){!h.state.isVisible&&y.parentNode&&y.parentNode.contains(y)&&t()}))}(M,h.unmount):h.unmount()},hideWithInteractivity:function(e){"production"!==process.env.NODE_ENV&&Vw(h.state.isDestroyed,vw("hideWithInteractivity"));E().addEventListener("mousemove",I),zw(eQ,I),I(e)},enable:function(){h.state.isEnabled=!0},disable:function(){h.hide(),h.state.isEnabled=!1},unmount:function(){"production"!==process.env.NODE_ENV&&Vw(h.state.isDestroyed,vw("unmount"));h.state.isVisible&&h.hide();if(!h.state.isMounted)return;q(),K().forEach((function(e){e._tippy.unmount()})),y.parentNode&&y.parentNode.removeChild(y);tQ=tQ.filter((function(e){return e!==h})),h.state.isMounted=!1,C("onHidden",[h])},destroy:function(){"production"!==process.env.NODE_ENV&&Vw(h.state.isDestroyed,vw("destroy"));if(h.state.isDestroyed)return;h.clearDelayTimeouts(),h.unmount(),G(),delete e._tippy,h.state.isDestroyed=!0,C("onDestroy",[h])}};if(!N.render)return"production"!==process.env.NODE_ENV&&Ww(!0,"render() function has not been supplied."),h;var T=N.render(h),y=T.popper,A=T.onUpdate;y.setAttribute("data-tippy-root",""),y.id="tippy-"+h.id,h.popper=y,e._tippy=h,y._tippy=h;var O=d.map((function(e){return e.fn(h)})),p=e.hasAttribute("aria-expanded");return B(),f(),k(),C("onCreate",[h]),N.showOnCreate&&ee(),y.addEventListener("mouseenter",(function(){h.props.interactive&&h.state.isVisible&&h.clearDelayTimeouts()})),y.addEventListener("mouseleave",(function(){h.props.interactive&&h.props.trigger.indexOf("mouseenter")>=0&&E().addEventListener("mousemove",I)})),h;function x(){var e=h.props.touch;return Array.isArray(e)?e:[e,0]}function L(){return"hold"===x()[0]}function S(){var e;return!(null==(e=h.props.render)||!e.$$tippy)}function m(){return a||e}function E(){var e=m().parentNode;return e?Lw(e):document}function w(){return Xw(y)}function Q(e){return h.state.isMounted&&!h.state.isVisible||Ew.isTouch||o&&"focus"===o.type?0:gw(h.props.delay,e?0:1,Rw.delay)}function k(e){void 0===e&&(e=!1),y.style.pointerEvents=h.props.interactive&&!e?"":"none",y.style.zIndex=""+h.props.zIndex}function C(e,t,i){var M;(void 0===i&&(i=!0),O.forEach((function(i){i[e]&&i[e].apply(i,t)})),i)&&(M=h.props)[e].apply(M,t)}function b(){var t=h.props.aria;if(t.content){var i="aria-"+t.content,M=y.id;Iw(h.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(i);if(h.state.isVisible)e.setAttribute(i,t?t+" "+M:M);else{var n=t&&t.replace(M,"").trim();n?e.setAttribute(i,n):e.removeAttribute(i)}}))}}function f(){!p&&h.props.aria.expanded&&Iw(h.props.triggerTarget||e).forEach((function(e){h.props.interactive?e.setAttribute("aria-expanded",h.state.isVisible&&e===m()?"true":"false"):e.removeAttribute("aria-expanded")}))}function v(){E().removeEventListener("mousemove",I),eQ=eQ.filter((function(e){return e!==I}))}function U(t){if(!Ew.isTouch||!c&&"mousedown"!==t.type){var i=t.composedPath&&t.composedPath()[0]||t.target;if(!h.props.interactive||!mw(y,i)){if(Iw(h.props.triggerTarget||e).some((function(e){return mw(e,i)}))){if(Ew.isTouch)return;if(h.state.isVisible&&h.props.trigger.indexOf("click")>=0)return}else C("onClickOutside",[h,t]);!0===h.props.hideOnClick&&(h.clearDelayTimeouts(),h.hide(),u=!0,setTimeout((function(){u=!1})),h.state.isMounted||W())}}}function Y(){c=!0}function Z(){c=!1}function V(){var e=E();e.addEventListener("mousedown",U,!0),e.addEventListener("touchend",U,lw),e.addEventListener("touchstart",Z,lw),e.addEventListener("touchmove",Y,lw)}function W(){var e=E();e.removeEventListener("mousedown",U,!0),e.removeEventListener("touchend",U,lw),e.removeEventListener("touchstart",Z,lw),e.removeEventListener("touchmove",Y,lw)}function P(e,t){var i=w().box;function M(e){e.target===i&&(Sw(i,"remove",M),t())}if(0===e)return t();Sw(i,"remove",r),Sw(i,"add",M),r=M}function R(t,i,M){void 0===M&&(M=!1),Iw(h.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,i,M),j.push({node:e,eventType:t,handler:i,options:M})}))}function B(){var e;L()&&(R("touchstart",_,{passive:!0}),R("touchend",H,{passive:!0})),(e=h.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(R(e,_),e){case"mouseenter":R("mouseleave",H);break;case"focus":R(fw?"focusout":"blur",J);break;case"focusin":R("focusout",J)}}))}function G(){j.forEach((function(e){var t=e.node,i=e.eventType,M=e.handler,n=e.options;t.removeEventListener(i,M,n)})),j=[]}function _(e){var t,i=!1;if(h.state.isEnabled&&!$(e)&&!u){var M="focus"===(null==(t=o)?void 0:t.type);o=e,a=e.currentTarget,f(),!h.state.isVisible&&Aw(e)&&eQ.forEach((function(t){return t(e)})),"click"===e.type&&(h.props.trigger.indexOf("mouseenter")<0||g)&&!1!==h.props.hideOnClick&&h.state.isVisible?i=!0:ee(e),"click"===e.type&&(g=!i),i&&!M&&te(e)}}function F(e){var t=e.target,i=m().contains(t)||y.contains(t);if("mousemove"!==e.type||!i){var M=K().concat(y).map((function(e){var t,i=null==(t=e._tippy.popperInstance)?void 0:t.state;return i?{popperRect:e.getBoundingClientRect(),popperState:i,props:N}:null})).filter(Boolean);(function(e,t){var i=t.clientX,M=t.clientY;return e.every((function(e){var t=e.popperRect,n=e.popperState,o=e.props.interactiveBorder,r=n.placement.split("-")[0],s=n.modifiersData.offset;if(!s)return!0;var a="bottom"===r?s.top.y:0,l="top"===r?s.bottom.y:0,N="right"===r?s.left.x:0,g="left"===r?s.right.x:0,u=t.top-M+a>o,c=M-t.bottom-l>o,D=t.left-i+N>o,j=i-t.right-g>o;return u||c||D||j}))})(M,e)&&(v(),te(e))}}function H(e){$(e)||h.props.trigger.indexOf("click")>=0&&g||(h.props.interactive?h.hideWithInteractivity(e):te(e))}function J(e){h.props.trigger.indexOf("focusin")<0&&e.target!==m()||h.props.interactive&&e.relatedTarget&&y.contains(e.relatedTarget)||te(e)}function $(e){return!!Ew.isTouch&&L()!==e.type.indexOf("touch")>=0}function X(){q();var t=h.props,i=t.popperOptions,M=t.placement,n=t.offset,o=t.getReferenceClientRect,r=t.moveTransition,a=S()?Xw(y).arrow:null,l=o?{getBoundingClientRect:o,contextElement:o.contextElement||m()}:e,N={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(S()){var i=w().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?i.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?i.setAttribute("data-"+e,""):i.removeAttribute("data-"+e)})),t.attributes.popper={}}}},g=[{name:"offset",options:{offset:n}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!r}},N];S()&&a&&g.push({name:"arrow",options:{element:a,padding:3}}),g.push.apply(g,(null==i?void 0:i.modifiers)||[]),h.popperInstance=nw(l,y,Object.assign({},i,{placement:M,onFirstUpdate:s,modifiers:g}))}function q(){h.popperInstance&&(h.popperInstance.destroy(),h.popperInstance=null)}function K(){return dw(y.querySelectorAll("[data-tippy-root]"))}function ee(e){h.clearDelayTimeouts(),e&&C("onTrigger",[h,e]),V();var t=Q(!0),M=x(),n=M[0],o=M[1];Ew.isTouch&&"hold"===n&&o&&(t=o),t?i=setTimeout((function(){h.show()}),t):h.show()}function te(e){if(h.clearDelayTimeouts(),C("onUntrigger",[h,e]),h.state.isVisible){if(!(h.props.trigger.indexOf("mouseenter")>=0&&h.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&g)){var t=Q(!1);t?M=setTimeout((function(){h.state.isVisible&&h.hide()}),t):n=requestAnimationFrame((function(){h.hide()}))}}else W()}}function MQ(e,t){void 0===t&&(t={});var i=Rw.plugins.concat(t.plugins||[]);"production"!==process.env.NODE_ENV&&(!function(e){var t=!e,i="[object Object]"===Object.prototype.toString.call(e)&&!e.addEventListener;Ww(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),Ww(i,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}(e),Fw(t,i)),document.addEventListener("touchstart",Qw,lw),window.addEventListener("blur",Cw);var M=Object.assign({},t,{plugins:i}),n=Ow(e);if("production"!==process.env.NODE_ENV){var o=yw(M.content),r=n.length>1;Vw(o&&r,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.","\n\n","Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.","\n\n","1) content: element.innerHTML\n","2) content: () => element.cloneNode(true)"].join(" "))}var s=n.reduce((function(e,t){var i=t&&iQ(t,M);return i&&e.push(i),e}),[]);return yw(e)?s[0]:s}MQ.defaultProps=Rw,MQ.setDefaultProps=function(e){"production"!==process.env.NODE_ENV&&Fw(e,[]),Object.keys(e).forEach((function(t){Rw[t]=e[t]}))},MQ.currentInput=Ew;var nQ=Object.assign({},nE,{effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow)}}),oQ=function(e,t){var i;void 0===t&&(t={}),"production"!==process.env.NODE_ENV&&Ww(!Array.isArray(e),["The first argument passed to createSingleton() must be an array of","tippy instances. The passed value was",String(e)].join(" "));var M,n=e,o=[],r=[],s=t.overrides,a=[],l=!1;function N(){r=n.map((function(e){return Iw(e.props.triggerTarget||e.reference)})).reduce((function(e,t){return e.concat(t)}),[])}function g(){o=n.map((function(e){return e.reference}))}function u(e){n.forEach((function(t){e?t.enable():t.disable()}))}function c(e){return n.map((function(t){var i=t.setProps;return t.setProps=function(n){i(n),t.reference===M&&e.setProps(n)},function(){t.setProps=i}}))}function D(e,t){var i=r.indexOf(t);if(t!==M){M=t;var a=(s||[]).concat("content").reduce((function(e,t){return e[t]=n[i].props[t],e}),{});e.setProps(Object.assign({},a,{getReferenceClientRect:"function"==typeof a.getReferenceClientRect?a.getReferenceClientRect:function(){var e;return null==(e=o[i])?void 0:e.getBoundingClientRect()}}))}}u(!1),g(),N();var j={fn:function(){return{onDestroy:function(){u(!0)},onHidden:function(){M=null},onClickOutside:function(e){e.props.showOnCreate&&!l&&(l=!0,M=null)},onShow:function(e){e.props.showOnCreate&&!l&&(l=!0,D(e,o[0]))},onTrigger:function(e,t){D(e,t.currentTarget)}}}},I=MQ(Tw(),Object.assign({},jw(t,["overrides"]),{plugins:[j].concat(t.plugins||[]),triggerTarget:r,popperOptions:Object.assign({},t.popperOptions,{modifiers:[].concat((null==(i=t.popperOptions)?void 0:i.modifiers)||[],[nQ])})})),z=I.show;I.show=function(e){if(z(),!M&&null==e)return D(I,o[0]);if(!M||null!=e){if("number"==typeof e)return o[e]&&D(I,o[e]);if(n.indexOf(e)>=0){var t=e.reference;return D(I,t)}return o.indexOf(e)>=0?D(I,e):void 0}},I.showNext=function(){var e=o[0];if(!M)return I.show(0);var t=o.indexOf(M);I.show(o[t+1]||e)},I.showPrevious=function(){var e=o[o.length-1];if(!M)return I.show(e);var t=o.indexOf(M),i=o[t-1]||e;I.show(i)};var d=I.setProps;return I.setProps=function(e){s=e.overrides||s,d(e)},I.setInstances=function(e){u(!0),a.forEach((function(e){return e()})),n=e,u(!1),g(),N(),a=c(I),I.setProps({triggerTarget:r})},a=c(I),I},rQ={clientX:0,clientY:0},sQ=[];function aQ(e){var t=e.clientX,i=e.clientY;rQ={clientX:t,clientY:i}}var lQ={name:"followCursor",defaultValue:!1,fn:function(e){var t=e.reference,i=Lw(e.props.triggerTarget||t),M=!1,n=!1,o=!0,r=e.props;function s(){return"initial"===e.props.followCursor&&e.state.isVisible}function a(){i.addEventListener("mousemove",g)}function l(){i.removeEventListener("mousemove",g)}function N(){M=!0,e.setProps({getReferenceClientRect:null}),M=!1}function g(i){var M=!i.target||t.contains(i.target),n=e.props.followCursor,o=i.clientX,r=i.clientY,s=t.getBoundingClientRect(),a=o-s.left,l=r-s.top;!M&&e.props.interactive||e.setProps({getReferenceClientRect:function(){var e=t.getBoundingClientRect(),i=o,M=r;"initial"===n&&(i=e.left+a,M=e.top+l);var s="horizontal"===n?e.top:M,N="vertical"===n?e.right:i,g="horizontal"===n?e.bottom:M,u="vertical"===n?e.left:i;return{width:N-u,height:g-s,top:s,right:N,bottom:g,left:u}}})}function u(){e.props.followCursor&&(sQ.push({instance:e,doc:i}),function(e){e.addEventListener("mousemove",aQ)}(i))}function c(){0===(sQ=sQ.filter((function(t){return t.instance!==e}))).filter((function(e){return e.doc===i})).length&&function(e){e.removeEventListener("mousemove",aQ)}(i)}return{onCreate:u,onDestroy:c,onBeforeUpdate:function(){r=e.props},onAfterUpdate:function(t,i){var o=i.followCursor;M||void 0!==o&&r.followCursor!==o&&(c(),o?(u(),!e.state.isMounted||n||s()||a()):(l(),N()))},onMount:function(){e.props.followCursor&&!n&&(o&&(g(rQ),o=!1),s()||a())},onTrigger:function(e,t){Aw(t)&&(rQ={clientX:t.clientX,clientY:t.clientY}),n="focus"===t.type},onHidden:function(){e.props.followCursor&&(N(),l(),o=!0)}}}};function NQ(e){return!0===e||"true"===e||!1!==e&&"false"!==e&&(!!["initial","horizontal","vertical"].includes(String(e))&&e)}function gQ(e){if(Array.isArray(e))return e;if("number"==typeof e)return e;if("string"==typeof e){if(e.includes(",")){const t=e.split(",").map((e=>parseInt(e.trim(),10)));return t}const t=parseInt(e,10);if(!isNaN(t))return t}return 200}MQ.setDefaultProps({render:qw});let uQ=class extends Re{static get styles(){return[Zm]}createRenderRoot(){return this}constructor(){super(),this.for=null,this.content="",this.size="small",this.duration=200,this.interactive=!1,this.placement="top",this.disabled=!1,this.distance=8,this.skidding=0,this.open=!1,this.trigger="mouseenter focus",this.allowHTML=!1,this.followCursor=!1,this.arrow="default",this.singleton=!1,this.enableRecursiveMode=!1,this.delay=0,this.maxWidth="auto",this.zIndex=9999,this.hideOnClick=!0,this.inertia=!1,this.interactiveBorder=2,this.enableVisibilityEffect=!1,this.enableTabClose=!1}firstUpdated(){this.attachTooltip();const e=this.for&&document.getElementById(this.for)||this.firstElementChild;this.visibilityManager=new tM({host:this,target:e,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:()=>this.open,onAnchorOutOfView:()=>{this.open=!1,this.hideAllTooltips(),this.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"})},onDocumentHidden:()=>{this.open=!1,this.hideAllTooltips(),this.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"})},emit:(e,t)=>this.emit(`nile-${e}`,t)})}refresh(){this.attachTooltip()}hasValidContent(){const e=this.content??this.getAttribute("data-tippy-content")??"";return"string"==typeof e&&e.trim().length>0}attachTooltip(){if(this.destroyTooltips(),this.disabled||!this.hasValidContent())return;const e={content:this.content||this.getAttribute("data-tippy-content")||void 0,placement:this.placement,trigger:this.trigger,offset:[this.skidding,this.distance],theme:"lite",animation:"fade",interactive:this.interactive,arrow:ow,duration:gQ(this.duration),allowHTML:this.allowHTML,delay:this.delay,maxWidth:this.maxWidth,zIndex:this.zIndex,hideOnClick:!1,inertia:this.inertia,interactiveBorder:this.interactiveBorder,appendTo:document.body,followCursor:NQ(this.followCursor),plugins:NQ(this.followCursor)?[lQ]:[],onShow:e=>{this.open=!0;const t=e.popper.querySelector(".tippy-content");t&&(this.width&&(t.style.width=this.width),this.height&&(t.style.height=this.height,t.style.overflow="auto")),this.dispatchEvent(new CustomEvent("nile-show",{detail:{instance:e,target:e.reference}})),this.dispatchEvent(new CustomEvent("nile-toggle",{detail:{open:!0,instance:e,target:e.reference}}))},onHide:e=>{this.open=!1,this.dispatchEvent(new CustomEvent("nile-hide",{detail:{instance:e,target:e.reference}})),this.dispatchEvent(new CustomEvent("nile-toggle",{detail:{open:!1,instance:e,target:e.reference}}))}};if(this.for){if(this.singleton&&!this.for.startsWith("#")&&!document.getElementById(this.for)){const t=Array.from(document.querySelectorAll(`.${this.for}`));if(t.length>0)return this.tooltipInstances=t.map((t=>{const i=MQ(t,{...e,content:t.getAttribute("content")||this.content});return i.popper.querySelector(".tippy-box")?.classList.add(this.size),i})),this.singletonInstance=oQ(this.tooltipInstances,{delay:[75,0],arrow:ow,moveTransition:"transform 0.15s ease-out"}),void(this.open&&queueMicrotask((()=>this.singletonInstance?.show())))}const t=document.getElementById(this.for);if(this.singleton&&t){const i=Array.from(t.querySelectorAll("[content]"));if(i.length>0)return this.tooltipInstances=i.map((t=>{const i=MQ(t,{...e,content:t.getAttribute("content")||this.content});return i.popper.querySelector(".tippy-box")?.classList.add(this.size),i})),this.singletonInstance=oQ(this.tooltipInstances,{delay:[75,0],arrow:ow,moveTransition:"transform 0.15s ease-out"}),void(this.open&&queueMicrotask((()=>this.singletonInstance?.show())))}if(this.targetEl=document.getElementById(this.for),!this.targetEl)return;this.id||(this.generatedId=`nile-tooltip-${Math.random().toString(36).slice(2,9)}`,this.id=this.generatedId),this.prevDescribedby=this.targetEl.getAttribute("aria-describedby");const i=this.prevDescribedby?`${this.prevDescribedby} ${this.id}`:this.id;return this.targetEl.setAttribute("aria-describedby",i),this.singleInstance=MQ(this.targetEl,e),this.size&&this.singleInstance.popper.querySelector(".tippy-box")?.classList.add(this.size),void(this.open&&queueMicrotask((()=>this.singleInstance?.show())))}if(this.enableRecursiveMode){const t=Array.from(this.querySelectorAll("*"));t.length>0&&(this.tooltipInstances=t.map((t=>{const i=t,M=i.getAttribute("content")||this.content,n=MQ(i,{...e,content:M});return n.popper.querySelector(".tippy-box")?.classList.add(this.size),n})),this.singleton&&this.tooltipInstances.length>1&&(this.singletonInstance=oQ(this.tooltipInstances,{delay:[75,0],arrow:ow,moveTransition:"transform 0.15s ease-out"})),this.open&&(this.singletonInstance?this.singletonInstance.show():this.tooltipInstances.forEach((e=>e.show()))))}else{const t=this.firstElementChild;if(t){const i=t.getAttribute("content")||this.content,M=MQ(t,{...e,content:i});M.popper.querySelector(".tippy-box")?.classList.add(this.size),this.tooltipInstances=[M],this.open&&M.show()}}}destroyTooltips(){if(this.tooltipInstances?.forEach((e=>e.destroy())),this.singleInstance?.destroy(),this.singletonInstance?.destroy(),this.tooltipInstances=void 0,this.singleInstance=void 0,this.singletonInstance=void 0,this.targetEl&&this.id){const e=this.targetEl.getAttribute("aria-describedby")?.split(" ").filter((e=>e!==this.id)).join(" ").trim();e?this.targetEl.setAttribute("aria-describedby",e):this.targetEl.removeAttribute("aria-describedby")}}hideAllTooltips(){this.singleInstance?.hide(),this.singletonInstance?.hide(),this.tooltipInstances?.forEach((e=>e.hide()))}disconnectedCallback(){super.disconnectedCallback(),this.visibilityManager?.cleanup(),this.destroyTooltips()}updated(e){super.updated(e),["for","content","placement","distance","skidding","trigger","disabled","hoist","size","arrow","singleton"].some((t=>e.has(t)))&&this.attachTooltip(),e.has("open")&&(this.open?(this.visibilityManager?.setup(),this.singleInstance?.show(),this.singletonInstance?.show(),this.tooltipInstances?.forEach((e=>e.show()))):(this.visibilityManager?.cleanup(),this.singleInstance?.hide(),this.singletonInstance?.hide(),this.tooltipInstances?.forEach((e=>e.hide()))))}};e([ce({type:String,attribute:"for"})],uQ.prototype,"for",void 0),e([ce({type:String,reflect:!0})],uQ.prototype,"content",void 0),e([ce({type:String,reflect:!0})],uQ.prototype,"size",void 0),e([ce({type:String,reflect:!0})],uQ.prototype,"duration",void 0),e([ce({type:Boolean,reflect:!0})],uQ.prototype,"interactive",void 0),e([ce({type:String})],uQ.prototype,"placement",void 0),e([ce({type:Boolean})],uQ.prototype,"disabled",void 0),e([ce({type:Number})],uQ.prototype,"distance",void 0),e([ce({type:Number})],uQ.prototype,"skidding",void 0),e([ce({type:Boolean,reflect:!0})],uQ.prototype,"open",void 0),e([ce({type:String})],uQ.prototype,"trigger",void 0),e([ce({type:Boolean,reflect:!0})],uQ.prototype,"allowHTML",void 0),e([ce({type:String,reflect:!0,attribute:!0})],uQ.prototype,"followCursor",void 0),e([ce({type:String,reflect:!0,attribute:!0})],uQ.prototype,"arrow",void 0),e([ce({type:Boolean,reflect:!0})],uQ.prototype,"singleton",void 0),e([ce({type:Boolean,reflect:!0})],uQ.prototype,"enableRecursiveMode",void 0),e([ce({type:String,reflect:!0})],uQ.prototype,"delay",void 0),e([ce({type:String,reflect:!0})],uQ.prototype,"maxWidth",void 0),e([ce({type:Number})],uQ.prototype,"zIndex",void 0),e([ce({type:[Boolean,String],reflect:!0})],uQ.prototype,"hideOnClick",void 0),e([ce({type:Boolean,reflect:!0})],uQ.prototype,"inertia",void 0),e([ce({type:Number})],uQ.prototype,"interactiveBorder",void 0),e([ce({type:Boolean,reflect:!0})],uQ.prototype,"enableVisibilityEffect",void 0),e([ce({type:Boolean,reflect:!0})],uQ.prototype,"enableTabClose",void 0),e([ce({type:String,reflect:!0})],uQ.prototype,"width",void 0),e([ce({type:String,reflect:!0})],uQ.prototype,"height",void 0),uQ=e([Ne("nile-lite-tooltip")],uQ);const cQ=r`
|
|
16451
16478
|
:host {
|
|
16452
16479
|
width: 100%;
|
|
16453
16480
|
height: 100%;
|
|
16454
16481
|
overflow-y: auto;
|
|
16455
16482
|
}
|
|
16456
16483
|
|
|
16457
|
-
`;let
|
|
16484
|
+
`;let DQ=class extends Re{static get styles(){return[cQ]}render(){return R`
|
|
16458
16485
|
<slot> </slot>
|
|
16459
|
-
`}};
|
|
16486
|
+
`}};DQ=e([Ne("nile-side-bar-panel")],DQ);
|
|
16460
16487
|
/**
|
|
16461
16488
|
* @license
|
|
16462
16489
|
* Copyright 2021 Google LLC
|
|
16463
16490
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
16464
16491
|
*/
|
|
16465
|
-
class
|
|
16492
|
+
class jQ{constructor(e){this._map=new Map,this._roundAverageSize=!1,this.totalSize=0,!0===e?.roundAverageSize&&(this._roundAverageSize=!0)}set(e,t){const i=this._map.get(e)||0;this._map.set(e,t),this.totalSize+=t-i}get averageSize(){if(this._map.size>0){const e=this.totalSize/this._map.size;return this._roundAverageSize?Math.round(e):e}return 0}getSize(e){return this._map.get(e)}clear(){this._map.clear(),this.totalSize=0}}
|
|
16466
16493
|
/**
|
|
16467
16494
|
* @license
|
|
16468
16495
|
* Copyright 2021 Google LLC
|
|
16469
16496
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
16470
|
-
*/function
|
|
16497
|
+
*/function IQ(e){return"horizontal"===e?"width":"height"}class zQ{_getDefaultConfig(){return{direction:"vertical"}}constructor(e,t){this._latestCoords={left:0,top:0},this._direction=null,this._viewportSize={width:0,height:0},this.totalScrollSize={width:0,height:0},this.offsetWithinScroller={left:0,top:0},this._pendingReflow=!1,this._pendingLayoutUpdate=!1,this._pin=null,this._firstVisible=0,this._lastVisible=0,this._physicalMin=0,this._physicalMax=0,this._first=-1,this._last=-1,this._sizeDim="height",this._secondarySizeDim="width",this._positionDim="top",this._secondaryPositionDim="left",this._scrollPosition=0,this._scrollError=0,this._items=[],this._scrollSize=1,this._overhang=1e3,this._hostSink=e,Promise.resolve().then((()=>this.config=t||this._getDefaultConfig()))}set config(e){Object.assign(this,Object.assign({},this._getDefaultConfig(),e))}get config(){return{direction:this.direction}}get items(){return this._items}set items(e){this._setItems(e)}_setItems(e){e!==this._items&&(this._items=e,this._scheduleReflow())}get direction(){return this._direction}set direction(e){(e="horizontal"===e?e:"vertical")!==this._direction&&(this._direction=e,this._sizeDim="horizontal"===e?"width":"height",this._secondarySizeDim="horizontal"===e?"height":"width",this._positionDim="horizontal"===e?"left":"top",this._secondaryPositionDim="horizontal"===e?"top":"left",this._triggerReflow())}get viewportSize(){return this._viewportSize}set viewportSize(e){const{_viewDim1:t,_viewDim2:i}=this;Object.assign(this._viewportSize,e),i!==this._viewDim2?this._scheduleLayoutUpdate():t!==this._viewDim1&&this._checkThresholds()}get viewportScroll(){return this._latestCoords}set viewportScroll(e){Object.assign(this._latestCoords,e);const t=this._scrollPosition;this._scrollPosition=this._latestCoords[this._positionDim];Math.abs(t-this._scrollPosition)>=1&&this._checkThresholds()}reflowIfNeeded(e=!1){(e||this._pendingReflow)&&(this._pendingReflow=!1,this._reflow())}set pin(e){this._pin=e,this._triggerReflow()}get pin(){if(null!==this._pin){const{index:e,block:t}=this._pin;return{index:Math.max(0,Math.min(e,this.items.length-1)),block:t}}return null}_clampScrollPosition(e){return Math.max(-this.offsetWithinScroller[this._positionDim],Math.min(e,this.totalScrollSize[IQ(this.direction)]-this._viewDim1))}unpin(){null!==this._pin&&(this._sendUnpinnedMessage(),this._pin=null)}_updateLayout(){}get _viewDim1(){return this._viewportSize[this._sizeDim]}get _viewDim2(){return this._viewportSize[this._secondarySizeDim]}_scheduleReflow(){this._pendingReflow=!0}_scheduleLayoutUpdate(){this._pendingLayoutUpdate=!0,this._scheduleReflow()}_triggerReflow(){this._scheduleLayoutUpdate(),Promise.resolve().then((()=>this.reflowIfNeeded()))}_reflow(){this._pendingLayoutUpdate&&(this._updateLayout(),this._pendingLayoutUpdate=!1),this._updateScrollSize(),this._setPositionFromPin(),this._getActiveItems(),this._updateVisibleIndices(),this._sendStateChangedMessage()}_setPositionFromPin(){if(null!==this.pin){const e=this._scrollPosition,{index:t,block:i}=this.pin;this._scrollPosition=this._calculateScrollIntoViewPosition({index:t,block:i||"start"})-this.offsetWithinScroller[this._positionDim],this._scrollError=e-this._scrollPosition}}_calculateScrollIntoViewPosition(e){const{block:t}=e,i=Math.min(this.items.length,Math.max(0,e.index)),M=this._getItemPosition(i)[this._positionDim];let n=M;if("start"!==t){const e=this._getItemSize(i)[this._sizeDim];if("center"===t)n=M-.5*this._viewDim1+.5*e;else{const i=M-this._viewDim1+e;if("end"===t)n=i;else{const e=this._scrollPosition;n=Math.abs(e-M)<Math.abs(e-i)?M:i}}}return n+=this.offsetWithinScroller[this._positionDim],this._clampScrollPosition(n)}getScrollIntoViewCoordinates(e){return{[this._positionDim]:this._calculateScrollIntoViewPosition(e)}}_sendUnpinnedMessage(){this._hostSink({type:"unpinned"})}_sendVisibilityChangedMessage(){this._hostSink({type:"visibilityChanged",firstVisible:this._firstVisible,lastVisible:this._lastVisible})}_sendStateChangedMessage(){const e=new Map;if(-1!==this._first&&-1!==this._last)for(let t=this._first;t<=this._last;t++)e.set(t,this._getItemPosition(t));const t={type:"stateChanged",scrollSize:{[this._sizeDim]:this._scrollSize,[this._secondarySizeDim]:null},range:{first:this._first,last:this._last,firstVisible:this._firstVisible,lastVisible:this._lastVisible},childPositions:e};this._scrollError&&(t.scrollError={[this._positionDim]:this._scrollError,[this._secondaryPositionDim]:0},this._scrollError=0),this._hostSink(t)}get _num(){return-1===this._first||-1===this._last?0:this._last-this._first+1}_checkThresholds(){if(0===this._viewDim1&&this._num>0||null!==this._pin)this._scheduleReflow();else{const e=Math.max(0,this._scrollPosition-this._overhang),t=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang);this._physicalMin>e||this._physicalMax<t?this._scheduleReflow():this._updateVisibleIndices({emit:!0})}}_updateVisibleIndices(e){if(-1===this._first||-1===this._last)return;let t=this._first;for(;t<this._last&&Math.round(this._getItemPosition(t)[this._positionDim]+this._getItemSize(t)[this._sizeDim])<=Math.round(this._scrollPosition);)t++;let i=this._last;for(;i>this._first&&Math.round(this._getItemPosition(i)[this._positionDim])>=Math.round(this._scrollPosition+this._viewDim1);)i--;t===this._firstVisible&&i===this._lastVisible||(this._firstVisible=t,this._lastVisible=i,e&&e.emit&&this._sendVisibilityChangedMessage())}}
|
|
16471
16498
|
/**
|
|
16472
16499
|
* @license
|
|
16473
16500
|
* Copyright 2021 Google LLC
|
|
16474
16501
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
16475
|
-
*/function
|
|
16502
|
+
*/function dQ(e){return"horizontal"===e?"marginLeft":"marginTop"}function hQ(e){return"horizontal"===e?"marginRight":"marginBottom"}function TQ(e){return"horizontal"===e?"xOffset":"yOffset"}function yQ(e,t){const i=[e,t].sort();return i[1]<=0?Math.min(...i):i[0]>=0?Math.max(...i):i[0]+i[1]}class AQ{constructor(){this._childSizeCache=new jQ,this._marginSizeCache=new jQ,this._metricsCache=new Map}update(e,t){const i=new Set;Object.keys(e).forEach((M=>{const n=Number(M);this._metricsCache.set(n,e[n]),this._childSizeCache.set(n,e[n][IQ(t)]),i.add(n),i.add(n+1)}));for(const e of i){const i=this._metricsCache.get(e)?.[dQ(t)]||0,M=this._metricsCache.get(e-1)?.[hQ(t)]||0;this._marginSizeCache.set(e,yQ(i,M))}}get averageChildSize(){return this._childSizeCache.averageSize}get totalChildSize(){return this._childSizeCache.totalSize}get averageMarginSize(){return this._marginSizeCache.averageSize}get totalMarginSize(){return this._marginSizeCache.totalSize}getLeadingMarginValue(e,t){return this._metricsCache.get(e)?.[dQ(t)]||0}getChildSize(e){return this._childSizeCache.getSize(e)}getMarginSize(e){return this._marginSizeCache.getSize(e)}clear(){this._childSizeCache.clear(),this._marginSizeCache.clear(),this._metricsCache.clear()}}var OQ=Object.freeze({__proto__:null,FlowLayout:class extends zQ{constructor(){super(...arguments),this._itemSize={width:100,height:100},this._physicalItems=new Map,this._newPhysicalItems=new Map,this._metricsCache=new AQ,this._anchorIdx=null,this._anchorPos=null,this._stable=!0,this._measureChildren=!0,this._estimate=!0}get measureChildren(){return this._measureChildren}updateItemSizes(e){this._metricsCache.update(e,this.direction),this._scheduleReflow()}_getPhysicalItem(e){return this._newPhysicalItems.get(e)??this._physicalItems.get(e)}_getSize(e){return this._getPhysicalItem(e)&&this._metricsCache.getChildSize(e)}_getAverageSize(){return this._metricsCache.averageChildSize||this._itemSize[this._sizeDim]}_estimatePosition(e){const t=this._metricsCache;if(-1===this._first||-1===this._last)return t.averageMarginSize+e*(t.averageMarginSize+this._getAverageSize());if(e<this._first){const i=this._first-e;return this._getPhysicalItem(this._first).pos-(t.getMarginSize(this._first-1)||t.averageMarginSize)-(i*t.averageChildSize+(i-1)*t.averageMarginSize)}{const i=e-this._last;return this._getPhysicalItem(this._last).pos+(t.getChildSize(this._last)||t.averageChildSize)+(t.getMarginSize(this._last)||t.averageMarginSize)+i*(t.averageChildSize+t.averageMarginSize)}}_getPosition(e){const t=this._getPhysicalItem(e),{averageMarginSize:i}=this._metricsCache;return 0===e?this._metricsCache.getMarginSize(0)??i:t?t.pos:this._estimatePosition(e)}_calculateAnchor(e,t){return e<=0?0:t>this._scrollSize-this._viewDim1?this.items.length-1:Math.max(0,Math.min(this.items.length-1,Math.floor((e+t)/2/this._delta)))}_getAnchor(e,t){if(0===this._physicalItems.size)return this._calculateAnchor(e,t);if(this._first<0)return this._calculateAnchor(e,t);if(this._last<0)return this._calculateAnchor(e,t);const i=this._getPhysicalItem(this._first),M=this._getPhysicalItem(this._last),n=i.pos;if(M.pos+this._metricsCache.getChildSize(this._last)<e)return this._calculateAnchor(e,t);if(n>t)return this._calculateAnchor(e,t);let o=this._firstVisible-1,r=-1/0;for(;r<e;){r=this._getPhysicalItem(++o).pos+this._metricsCache.getChildSize(o)}return o}_getActiveItems(){0===this._viewDim1||0===this.items.length?this._clearItems():this._getItems()}_clearItems(){this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;const e=this._newPhysicalItems;this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=e,this._stable=!0}_getItems(){const e=this._newPhysicalItems;let t,i;if(this._stable=!0,null!==this.pin){const{index:e}=this.pin;this._anchorIdx=e,this._anchorPos=this._getPosition(e)}if(t=this._scrollPosition-this._overhang,i=this._scrollPosition+this._viewDim1+this._overhang,i<0||t>this._scrollSize)return void this._clearItems();null!==this._anchorIdx&&null!==this._anchorPos||(this._anchorIdx=this._getAnchor(t,i),this._anchorPos=this._getPosition(this._anchorIdx));let M=this._getSize(this._anchorIdx);void 0===M&&(this._stable=!1,M=this._getAverageSize());const n=this._metricsCache.getMarginSize(this._anchorIdx)??this._metricsCache.averageMarginSize,o=this._metricsCache.getMarginSize(this._anchorIdx+1)??this._metricsCache.averageMarginSize;0===this._anchorIdx&&(this._anchorPos=n),this._anchorIdx===this.items.length-1&&(this._anchorPos=this._scrollSize-o-M);let r=0;for(this._anchorPos+M+o<t&&(r=t-(this._anchorPos+M+o)),this._anchorPos-n>i&&(r=i-(this._anchorPos-n)),r&&(this._scrollPosition-=r,t-=r,i-=r,this._scrollError+=r),e.set(this._anchorIdx,{pos:this._anchorPos,size:M}),this._first=this._last=this._anchorIdx,this._physicalMin=this._anchorPos-n,this._physicalMax=this._anchorPos+M+o;this._physicalMin>t&&this._first>0;){let t=this._getSize(--this._first);void 0===t&&(this._stable=!1,t=this._getAverageSize());let i=this._metricsCache.getMarginSize(this._first);void 0===i&&(this._stable=!1,i=this._metricsCache.averageMarginSize),this._physicalMin-=t;const M=this._physicalMin;if(e.set(this._first,{pos:M,size:t}),this._physicalMin-=i,!1===this._stable&&!1===this._estimate)break}for(;this._physicalMax<i&&this._last<this.items.length-1;){let t=this._getSize(++this._last);void 0===t&&(this._stable=!1,t=this._getAverageSize());let i=this._metricsCache.getMarginSize(this._last);void 0===i&&(this._stable=!1,i=this._metricsCache.averageMarginSize);const M=this._physicalMax;if(e.set(this._last,{pos:M,size:t}),this._physicalMax+=t+i,!this._stable&&!this._estimate)break}const s=this._calculateError();s&&(this._physicalMin-=s,this._physicalMax-=s,this._anchorPos-=s,this._scrollPosition-=s,e.forEach((e=>e.pos-=s)),this._scrollError+=s),this._stable&&(this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=e)}_calculateError(){return 0===this._first?this._physicalMin:this._physicalMin<=0?this._physicalMin-this._first*this._delta:this._last===this.items.length-1?this._physicalMax-this._scrollSize:this._physicalMax>=this._scrollSize?this._physicalMax-this._scrollSize+(this.items.length-1-this._last)*this._delta:0}_reflow(){const{_first:e,_last:t}=this;super._reflow(),(-1===this._first&&-1==this._last||this._first===e&&this._last===t)&&this._resetReflowState()}_resetReflowState(){this._anchorIdx=null,this._anchorPos=null,this._stable=!0}_updateScrollSize(){const{averageMarginSize:e}=this._metricsCache;this._scrollSize=Math.max(1,this.items.length*(e+this._getAverageSize())+e)}get _delta(){const{averageMarginSize:e}=this._metricsCache;return this._getAverageSize()+e}_getItemPosition(e){return{[this._positionDim]:this._getPosition(e),[this._secondaryPositionDim]:0,[TQ(this.direction)]:-(this._metricsCache.getLeadingMarginValue(e,this.direction)??this._metricsCache.averageMarginSize)}}_getItemSize(e){return{[this._sizeDim]:this._getSize(e)||this._getAverageSize(),[this._secondarySizeDim]:this._itemSize[this._secondarySizeDim]}}_viewDim2Changed(){this._metricsCache.clear(),this._scheduleReflow()}}});export{kx as NileAccordion,In as NileAutoComplete,ex as NileAvatar,gt as NileBadge,Ip as NileBreadcrumb,dp as NileBreadcrumbItem,_e as NileButton,vp as NileButtonFilter,Zn as NileButtonToggle,Wn as NileButtonToggleGroup,Cn as NileCalendar,Ap as NileCard,mp as NileCarousel,pp as NileCarouselItem,ft as NileCheckbox,dn as NileChip,Yp as NileCircularProgressbar,Np as NileCodeEditor,$n as NileContentEditor,pn as NileDatePicker,qn as NileDialog,bx as NileDivider,Ct as NileDrawer,Nn as NileDropdown,nx as NileEmptyState,Ln as NileErrorMessage,eo as NileErrorNotification,qL as NileFilePreview,CL as NileFileUpload,nL as NileFilterChip,Kx as NileFloatingPanel,mn as NileFormErrorMessage,Tp as NileFormGroup,wn as NileFormHelpText,Ix as NileFormatDate,TS as NileGrid,AS as NileGridBody,mS as NileGridCellItem,wS as NileGridHead,LS as NileGridHeadItem,pS as NileGridRow,Fe as NileHeading,rx as NileHero,ux as NileHeroHeader,Qe as NileIcon,Nt as NileIconButton,Gx as NileInlineEdit,vm as NileInlineSidebar,bm as NileInlineSidebarGroup,Ym as NileInlineSidebarItem,ot as NileInput,vn as NileLink,wx as NileList,mx as NileListItem,rM as NileLoader,st as NileMenu,nn as NileMenuItem,tn as NileOption,eS as NileOptionGroup,ix as NilePageHeader,sL as NilePagination,bp as NilePopover,Ki as NilePopup,aM as NileProgressBar,Ut as NileRadio,Zt as NileRadioGroup,em as NileRichTextEditor,Yx as NileSectionMessage,KM as NileSelect,im as NileSideBar,Lm as NileSideBarAction,km as NileSideBarActionMenu,wm as NileSideBarActionMenuItem,am as NileSideBarExpand,dm as NileSideBarFooter,Tm as NileSideBarFooterItem,mm as NileSideBarFooterText,Nm as NileSideBarGroup,um as NileSideBarGroupItem,Dm as NileSideBarGroupItemIcon,Im as NileSideBarGroupItemText,nm as NileSideBarHeader,rm as NileSideBarLogo,DQ as NileSideBarPanel,uM as NileSkeletonLoader,nM as NileSlideToggle,DL as NileSlider,NM as NileSpinner,dx as NileSplitPanel,Nx as NileStepper,ax as NileStepperItem,Fn as NileSwitcher,oo as NileTab,io as NileTabGroup,ao as NileTabPanel,tL as NileTable,$p as NileTableBody,_p as NileTableCellItem,qp as NileTableHeaderItem,Hp as NileTableRow,jM as NileTag,Tn as NileTextarea,vx as NileTitle,Dp as NileToast,Vx as NileToolbar,iM as NileTooltip,Lx as NileTree,Ox as NileTreeItem,Dx as NileVerticalStepperItem,$M as NileVirtualSelect,uQ as NileliteTooltip};
|