@deephaven/embed-grid 0.16.1-vite.18 → 0.16.1-vite.20
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/build/assets/helpers.162e09a8.js +1 -0
- package/build/assets/{index.eed734c9.js → index.bec35f8e.js} +1 -1
- package/build/assets/{monaco.22308852.js → monaco.e2075ada.js} +3 -3
- package/build/assets/{plotly.c6ec3640.js → plotly.7ac8f807.js} +1 -1
- package/build/assets/{vendor.33ac93ab.js → vendor.5ad3dc6e.js} +1 -1
- package/build/index.html +6 -5
- package/package.json +15 -14
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as D,z as R,R as Q,P as Xa,B as u,C as rt,D as z,E as T,F as Vo,G as ue,H as Tt,I as G,J as Ne,K as Qt,L as Ya,M as Qa,N as Wi,O as Xs,Q as ja,S as Uo,$ as Tl,T as Ys,U as lt,V as Fo,W as De,X as Mr,Y as dt,Z as Za,_ as xo,a0 as Ks,a1 as El}from"./vendor.33ac93ab.js";import{e as pn,W as Ja,l as bs,K as bn,b as Dr,d as Gt,f as xi}from"./monaco.22308852.js";import{P as Oi,b as ec,h as tc,p as nc,o as sc,s as ic,t as oc,c as po}from"./plotly.c6ec3640.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();const rc="#1a171a",lc="#f0f0ee",ac="#fcd65b",cc="#9edc6f",dc="#76d9e4",hc="#aa9af4",uc="#f37e3f",mc="#f95d84",pc="#4878ea",gc="#5b5a5c",fc="#9edc6f",Cc="#fcd65b",bc="#f37e3f",wc="#f95d84",Sc="#fcfcfa",vc="#929192",Tc="#373438",Ec="#f0f0ee",yc="#1a171a",Rc="#2d2a2e",Ic="#1a171a",Mc="#f0f0ee",Dc="0.15s",Nc={"gray-100":"#fcfcfa","gray-200":"#f0f0ee","gray-300":"#c0bfbf","gray-400":"#929192","gray-500":"#5b5a5c","gray-600":"#555356","gray-700":"#403e41","gray-800":"#373438","gray-850":"#322f33","gray-900":"#211f22",black:rc,white:lc,yellow:ac,green:cc,blue:dc,purple:hc,orange:uc,red:mc,primary:pc,"primary-hover":"#235de6","primary-dark":"#343e5d",secondary:gc,success:fc,info:Cc,warning:bc,danger:wc,light:Sc,mid:vc,dark:Tc,"text-muted":"#929192",interfacewhite:Ec,interfaceblack:yc,interfacegray:Rc,"content-bg":"#2d2a2e",background:Ic,foreground:Mc,transition:Dc},Rt=Object.freeze({transitionMs:150,transitionMidMs:200,transitionLongMs:300,transitionSlowMs:1e3,...Nc});class fn extends R.exports.Component{constructor(t){super(t),this.handleEnter=this.handleEnter.bind(this),this.handleExit=this.handleExit.bind(this),this.handleBlur=this.handleBlur.bind(this),this.element=document.createElement("div"),this.element.className="popper-container",this.container=Q.createRef(),this.rAF=0;const{isShown:n}=this.props;this.state={show:n,popper:null}}componentDidUpdate(t){const{isShown:n}=this.props;t.isShown!==n&&(n?(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{this.show()})):this.hide())}componentWillUnmount(){this.destroyPopper(!1)}getVisibleElement(t){return t==null||t.clientHeight>0||t.clientWidth>0?t:this.getVisibleElement(t.parentElement)}initPopper(){let{popper:t}=this.state;const{closeOnBlur:n,referenceObject:s}=this.props;if(t||this.container.current===null)return;let{options:i}=this.props;i={placement:"auto",...i},document.body.appendChild(this.element);let o=this.getVisibleElement(this.container.current);o==null&&(o=this.container.current),t=new Xa(s||o,this.element,i),t.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(n&&!this.element.contains(document.activeElement)){const r=this.element.firstElementChild;r instanceof HTMLElement&&r.focus()}}),this.setState({popper:t})}destroyPopper(t=!0){cancelAnimationFrame(this.rAF);const{popper:n}=this.state;!n||(n.destroy(),document.body.contains(this.element)&&document.body.removeChild(this.element),t&&this.setState({popper:null}))}show(){this.initPopper(),this.setState({show:!0})}hide(){this.setState({show:!1})}scheduleUpdate(){const{popper:t}=this.state;t&&t.scheduleUpdate()}handleBlur(t){t.relatedTarget instanceof HTMLElement&&(this.element.contains(t.relatedTarget)||this.hide())}handleEnter(){const{onEntered:t}=this.props;t()}handleExit(){const{onExited:t}=this.props,{show:n}=this.state;n||this.destroyPopper(),t()}renderContent(){const{className:t,children:n,timeout:s,interactive:i,closeOnBlur:o}=this.props,{show:r}=this.state;return u(rt,{in:r,timeout:s,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,children:u("div",{onClick:l=>{l.stopPropagation()},onKeyDown:l=>{l.key==="Escape"&&this.hide()},className:z("popper",{interactive:i},t),onBlur:o?this.handleBlur:void 0,tabIndex:o?-1:void 0,role:"presentation",children:T("div",{className:"popper-content",children:[n,u("div",{className:"popper-arrow","x-arrow":""})]})})})}render(){const{popper:t}=this.state,{"data-testid":n}=this.props;return u("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":n,children:t&&Vo.createPortal(this.renderContent(),this.element)})}}fn.propTypes={children:D.exports.node.isRequired,options:D.exports.shape({}),className:D.exports.string,timeout:D.exports.number,onEntered:D.exports.func,onExited:D.exports.func,isShown:D.exports.bool,closeOnBlur:D.exports.bool,interactive:D.exports.bool,referenceObject:D.exports.shape({}),"data-testid":D.exports.string};fn.defaultProps={options:{},className:"",timeout:Rt.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0};const Fc=-1,yl=0,Rl=1,Bo=2,Il=3,Ml=4;Object.freeze({SILENT:Fc,ERROR:yl,WARN:Rl,INFO:Bo,DEBUG:Il,DEBUG2:Ml});const xt=()=>{};class Nr{constructor(t,n){this.name=t,this.prefix=t?`[${t}]`:"",this.error=xt,this.warn=xt,this.log=xt,this.info=xt,this.debug=xt,this.debug2=xt,this.level=n,this.setLogLevel(n)}setLogLevel(t){if(!Number.isFinite(t)){console.warn(`Expected a number for log level. Received: ${t}. Ignoring`);return}this.level=t,this.error=t>=yl?console.error.bind(console,this.prefix):xt,this.warn=t>=Rl?console.warn.bind(console,this.prefix):xt,this.log=t>=Bo?console.log.bind(console,this.prefix):xt,this.info=this.log,this.debug=t>=Il?console.debug.bind(console,this.prefix):xt,this.debug2=t>=Ml?console.debug.bind(console,this.prefix):xt}}class xc extends Nr{constructor(t=Bo){super(null,t),this.modules={}}module(t){return this.modules[t]||(this.modules[t]=new Nr(t,this.level)),this.modules[t]}setLogLevel(t){if(super.setLogLevel(t),!this.modules)return;const n=Object.keys(this.modules);for(let s=0;s<n.length;s+=1)this.modules[n[s]].setLogLevel(t)}}const te=new xc,Oc=te.module("Tooltip"),Ct=class extends R.exports.Component{constructor(e){super(e),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowMouseMove=this.handleWindowMouseMove.bind(this),this.handleWheel=this.handleWheel.bind(this),this.handleTimeout=this.handleTimeout.bind(this),this.handleExited=this.handleExited.bind(this),this.stopShowingTooltip=this.stopShowingTooltip.bind(this),this.container=Q.createRef(),this.popper=Q.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}static handleHidden(){Ct.shownTooltipCount-=1,Ct.shownTooltipCount===0&&(Ct.lastHiddenTime=Date.now())}static handleShown(){Ct.shownTooltipCount+=1}componentDidMount(){this.startListening();const{timeout:e}=this.props;e===0&&this.show()}componentDidUpdate(e,t){const{isShown:n}=t,{isShown:s}=this.state;s!==n&&(s?Ct.handleShown():Ct.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();const{isShown:e}=this.state;e&&Ct.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){Oc.error("Tooltip doesn't have a container or a parent set!");return}this.parent=this.container.current.parentElement,this.parent.addEventListener("mousemove",this.handleMouseMove),this.parent.addEventListener("mouseleave",this.handleMouseLeave),this.parent.addEventListener("mousedown",this.stopShowingTooltip)}stopListening(){!this.parent||(this.parent.removeEventListener("mousemove",this.handleMouseMove),this.parent.removeEventListener("mouseleave",this.handleMouseLeave),this.parent.removeEventListener("mousedown",this.stopShowingTooltip))}startListeningWindow(){window.addEventListener("mousemove",this.handleWindowMouseMove,!0),window.addEventListener("contextmenu",this.stopShowingTooltip,!0),window.addEventListener("wheel",this.handleWheel)}stopListeningWindow(){window.removeEventListener("mousemove",this.handleWindowMouseMove,!0),window.removeEventListener("contextmenu",this.stopShowingTooltip,!0),window.removeEventListener("wheel",this.handleWheel)}handleMouseMove(){this.startTimer()}handleWheel(){const{isShown:e}=this.state;this.popper.current&&this.parent&&e&&!this.popper.current.element.matches(":hover")&&!this.parent.matches(":hover")&&(this.stopTimer(),this.hide())}handleMouseLeave(){const{isShown:e}=this.state;this.stopTimer();const{interactive:t}=this.props;!t&&e&&this.hide()}handleTimeout(){this.show()}handleWindowMouseMove(e){const t=e.clientX,n=e.clientY,{isShown:s}=this.state;if(!this.popper.current||!this.parent)return;const i=this.popper.current.element.getBoundingClientRect(),o=this.parent.getBoundingClientRect();t>=i.left&&t<=i.left+i.width&&n>=i.top&&n<=i.top+i.height?this.handleMouseMove():t>=o.left&&t<=o.left+o.width&&n>=o.top&&n<=o.top+o.height?this.handleMouseMove():s&&(this.stopTimer(),this.hide())}startTimer(){this.stopTimer();const{timeout:e,reshowTimeout:t}=this.props;let n=e;(Ct.shownTooltipCount>0||Date.now()-Ct.lastHiddenTime<Ct.triggerReshowThreshold)&&(n=t),this.timer=window.setTimeout(this.handleTimeout,n)}stopTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}show(){var t;const{isShown:e}=this.state;if(this.stopTimer(),!e){(t=this.popper.current)==null||t.show(),this.setState({isShown:!0});const{interactive:n}=this.props;n&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)==null||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)==null||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});const{onExited:e}=this.props;e()}stopShowingTooltip(){const{isShown:e}=this.state;this.stopTimer(),e&&this.hide()}render(){const{interactive:e,children:t,options:n,referenceObject:s,popperClassName:i,"data-testid":o,onEntered:r}=this.props,{isShown:l}=this.state;return u("div",{ref:this.container,style:{display:"none"},"data-testid":o,children:u(fn,{className:z(i),options:n,ref:this.popper,onEntered:r,onExited:this.handleExited,interactive:e,referenceObject:s,children:T("div",{className:"tooltip-content",children:[" ",l&&t]})})})}};let me=Ct;me.defaultTimeout=500;me.defaultReshowTimeout=100;me.triggerReshowThreshold=300;me.shownTooltipCount=0;me.lastHiddenTime=Date.now();me.defaultProps={interactive:!1,options:{},popperClassName:"",reshowTimeout:Ct.defaultReshowTimeout,timeout:Ct.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0};const Ac=100;var Dl=(e=>(e.UP="UP",e.DOWN="DOWN",e))(Dl||{});const Qn=class extends R.exports.Component{constructor(e){super(e),this.getCachedFilteredOptions=ue((n,s)=>n.filter(i=>i.title.toLowerCase().indexOf(s.toLowerCase())>=0));let{popperOptions:t}=this.props;t={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...t},this.state={title:"",filteredOptions:[],keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,invalid:!1,popperOptions:t},this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handelInputFocus=this.handelInputFocus.bind(this),this.handleInputClick=this.handleInputClick.bind(this),this.updateInputValue=Tt(this.updateInputValue,Ac),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=Q.createRef(),this.cbContainer=Q.createRef(),this.menuContainer=Q.createRef(),this.input=Q.createRef()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}getValueAndValidate(e){if(!e)return this.setState({invalid:!1}),{value:e,isValid:!1};const{options:t}=this.props,n=t.filter(s=>s.title.toLowerCase()===e.toLowerCase());return n.length<1?(this.setState({invalid:!0}),{value:e,isValid:!1}):(this.setState({invalid:!1}),{value:n[0].value,isValid:!0})}updateInputValue(e){const{menuIsOpen:t}=this.state,{value:n,isValid:s}=this.getValueAndValidate(e);t&&this.processFilterChange(e),this.fireOnChange(n,s)}fireOnChange(e,t=!0){const{onChange:n}=this.props;n(e,t)}processFilterChange(e){var o;const{options:t}=this.props,{menuIsOpen:n}=this.state,s=e?this.getCachedFilteredOptions(t,e):t,i=s.length===1&&s[0].title===e;if(this.setState({filteredOptions:s,keyboardOptionIndex:0}),i&&n){this.closeMenu();return}(o=this.popper.current)==null||o.scheduleUpdate()}resetValue(){this.setState({title:""}),this.fireOnChange("")}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var i;const{filteredOptions:t,keyboardOptionIndex:n}=this.state,s=t[n];switch(e.key){case"Enter":case"ArrowRight":e.stopPropagation(),e.preventDefault(),s&&(this.setState({title:s.title,invalid:!1}),this.fireOnChange(s.value)),this.closeMenu(),(i=this.input.current)==null||i.focus();break;case"ArrowUp":e.stopPropagation(),e.preventDefault(),this.navigateMenu(Qn.MENU_NAVIGATION_DIRECTION.UP);break;case"ArrowDown":e.stopPropagation(),e.preventDefault(),this.navigateMenu(Qn.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Tab":if(e.stopPropagation(),e.preventDefault(),e.shiftKey){this.navigateMenu(Qn.MENU_NAVIGATION_DIRECTION.UP);break}this.navigateMenu(Qn.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Escape":e.preventDefault(),e.stopPropagation(),this.closeMenu();break}}navigateMenu(e){const{filteredOptions:t,keyboardOptionIndex:n}=this.state;let s=n;e===Qn.MENU_NAVIGATION_DIRECTION.UP?n>0?(s=(s-1)%t.length,this.setState({keyboardOptionIndex:s})):n===0&&(s=t.length-1,this.setState({keyboardOptionIndex:s})):e===Qn.MENU_NAVIGATION_DIRECTION.DOWN&&n<t.length&&(s=(s+1)%t.length,this.setState({keyboardOptionIndex:s})),this.scrollOptionIntoView(s)}handleInputKeyDown(e){const{onEnter:t}=this.props,{menuIsOpen:n}=this.state;n?this.handleMenuKeyDown(e):e.key==="Enter"?t():e.key==="Escape"?(this.resetValue(),e.preventDefault(),e.stopPropagation()):e.key==="ArrowRight"||e.key==="ArrowLeft"||e.key==="Tab"||e.key==="Shift"||this.openMenu()}handleInputChange(e){this.setState({title:e.target.value}),this.updateInputValue(e.target.value)}handleOptionClick(e){var t;this.setState({title:e.title,invalid:!1}),this.fireOnChange(e.value),this.closeMenu(),(t=this.input.current)==null||t.focus()}handelInputFocus(){const{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputClick(){const{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputBlur(e){var n;const{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&((n=this.popper.current)==null?void 0:n.element.contains(e.relatedTarget))||this.closeMenu(!1)}handleMenuBlur(e){var t;e.relatedTarget===this.input.current||e.relatedTarget instanceof Element&&((t=this.popper.current)==null?void 0:t.element.contains(e.relatedTarget))||this.closeMenu(!1)}handleMenuOpened(){var e;(e=this.input.current)==null||e.focus()}handleMenuExited(){const{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}openMenu(){const{title:e}=this.state;this.processFilterChange(e),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var t;(t=this.popper.current)==null||t.show()})}closeMenu(e=!0){var t,n;this.setState({menuIsOpen:!1,keyboardOptionIndex:0}),e&&((t=this.input.current)==null||t.focus()),(n=this.popper.current)==null||n.hide()}scrollOptionIntoView(e){var t;this.menuContainer.current&&((t=this.menuContainer.current.children.item(e))==null||t.scrollIntoView({behavior:"smooth",block:"nearest"}))}renderMenuElement(){const{inputWidth:e}=this.state;return u("div",{className:z("aci-options"),ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,style:{width:e},onBlur:this.handleMenuBlur,children:this.renderOptions()})}renderOptions(){const{noMatchText:e}=this.props,{title:t,filteredOptions:n}=this.state;return t&&n.length===0?u("div",{className:"no-match",children:e}):n.map((s,i)=>this.renderOption(s,i))}renderOption(e,t){const{keyboardOptionIndex:n}=this.state,s=`option-${t}-${e.value}`;return u("button",{type:"button",className:z("aci-option-btn",{"keyboard-active":n===t}),onClick:()=>this.handleOptionClick(e),onFocus:()=>this.setState({keyboardOptionIndex:t}),children:e.title},s)}render(){const{options:e,inputPlaceholder:t,disabled:n,className:s,defaultTitle:i,spellCheck:o,"data-testid":r}=this.props,{title:l,menuIsOpen:a,popperOptions:c,invalid:d}=this.state;return T("div",{className:"aci-container",ref:this.cbContainer,children:[u("input",{value:l||i,className:z("form-control",s,"aci-input",{"is-invalid":d&&!a}),ref:this.input,onChange:this.handleInputChange,placeholder:t||e[0].title,disabled:n,onFocus:this.handelInputFocus,onClick:this.handleInputClick,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:o,"data-testid":r}),u(fn,{ref:this.popper,options:c,className:z("aci-options-popper interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})}};let Wo=Qn;Wo.propTypes={options:D.exports.arrayOf(D.exports.shape({title:D.exports.string.isRequired,value:D.exports.string.isRequired})).isRequired,popperOptions:D.exports.shape({}),onChange:D.exports.func,inputPlaceholder:D.exports.string,disabled:D.exports.bool,className:D.exports.string,defaultTitle:D.exports.string,spellCheck:D.exports.bool,onEnter:D.exports.func,noMatchText:D.exports.string,"data-testid":D.exports.string};Wo.defaultProps={onChange(){},inputPlaceholder:"",disabled:!1,className:"",defaultTitle:"",popperOptions:null,spellCheck:!0,onEnter(){},noMatchText:"No matching items found","data-testid":void 0};Wo.MENU_NAVIGATION_DIRECTION=Dl;D.exports.string.isRequired,D.exports.func.isRequired,D.exports.string,D.exports.string,D.exports.bool,D.exports.bool,D.exports.string,D.exports.string,D.exports.string;D.exports.node.isRequired,D.exports.string,D.exports.object,D.exports.string;const kc=["primary","secondary","tertiary","success","danger","inline","ghost"],Lc=["group-end"];function Pc(e,t){switch(e){case"primary":return"btn-primary";case"secondary":return"btn-outline-primary";case"tertiary":return"btn-secondary";case"success":return"btn-success";case"danger":return"btn-danger";case"inline":return"btn-inline";case"ghost":return z("btn-link",{"btn-link-icon":t,"px-2":t})}}function Hc(e){switch(e){case"group-end":return z("pl-2","pr-3")}}const Ie=Q.forwardRef((e,t)=>{const{kind:n,variant:s,type:i,tooltip:o,icon:r,disabled:l,active:a,onClick:c,className:d,style:h,children:m,"data-testid":p}=e,f=Pc(n,r&&!m);let b;s&&(b=Hc(s));let C;r&&(C=Q.isValidElement(r)?r:u(G,{icon:r}));let w;o&&(w=typeof o=="string"?u(me,{children:o}):o);const S=T("button",{"data-testid":p,ref:t,type:i,className:z("btn",f,b,{active:a},d),onClick:c,style:h,disabled:l,children:[r&&C,m,o&&!l&&w]});return l?T("span",{className:"btn-disabled-wrapper",children:[S,o&&w]}):S});Ie.displayName="Button";Ie.propTypes={kind:D.exports.oneOf(kc).isRequired,variant:D.exports.oneOf(Lc),type:D.exports.oneOf(["submit","reset","button"]),tooltip(e){const{tooltip:t,icon:n,children:s}=e;return!t&&n&&!s?new Error("Tooltip is required for icon only buttons"):null},icon(e){const{children:t,icon:n}=e;return!n&&!t?new Error("Icon is required if no children are provided"):!t&&!Q.isValidElement(n)&&!(n!=null&&n.iconName)?new Error("Icon must be react element or fontawesome IconDefinition"):null},disabled:D.exports.bool,active:D.exports.bool,onClick(e){const{onClick:t,type:n}=e;return n==="button"&&typeof t!="function"?new Error("type button requires an onClick function"):t!==void 0&&typeof t!="function"?new Error("onClick must be a function"):null},children:D.exports.node,className:D.exports.string,style:D.exports.object,"data-testid":D.exports.string};Ie.defaultProps={type:"button",onClick:void 0,variant:void 0,tooltip:void 0,icon:void 0,disabled:!1,active:void 0,children:void 0,className:void 0,style:{},"data-testid":void 0};const _c=({className:e="theme-bg-light",children:t,role:n="role",keyboard:s=!0,isOpen:i=!1,centered:o=!1,size:r,onOpened:l,onClosed:a,toggle:c,"data-testid":d})=>{const h=R.exports.useRef(),m=R.exports.useCallback(g=>{switch(g.key){case"Escape":c==null||c();break}},[c]);R.exports.useEffect(function(){if(i&&s)return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[m,i,s]),R.exports.useEffect(function(){i&&l&&l()},[l,i]),R.exports.useEffect(function(){!i&&a&&a()},[a,i]),i&&!h.current&&(h.current=document.createElement("div"),h.current.setAttribute("style","padding-right: 15px; display: block"),h.current.setAttribute("role","presentation"),document.body.appendChild(h.current));const p=()=>{h.current&&(document.body.removeChild(h.current),h.current=void 0)};return h.current?Vo.createPortal(T(Ne,{children:[u(rt,{appear:!0,mountOnEnter:!0,unmountOnExit:!0,in:i,classNames:{appearActive:"show",appearDone:"show"},timeout:Rt.transitionMs,onExited:p,children:u("div",{className:z("modal-backdrop fade"),style:{zIndex:1050}})}),u(rt,{appear:!0,mountOnEnter:!0,unmountOnExit:!0,in:i,classNames:{appearDone:"show"},timeout:Rt.transitionMs,onExited:p,children:u("div",{className:"modal fade",onClick:c,role:"dialog",style:{display:"block"},children:u("div",{className:z(`modal-dialog ${e}`,{"modal-lg":r==="lg","modal-sm":r==="sm","modal-xl":r==="xl","modal-dialog-centered":o}),style:{zIndex:1040},children:u("div",{className:"modal-content",onClick:g=>g.stopPropagation(),role:"presentation","data-testid":d,children:t})})})})]}),h.current):u(Ne,{})},Vc=({className:e="modal-body",style:t,children:n,"data-testid":s})=>u("div",{className:e,"data-testid":s,style:t,children:n}),Uc=({className:e,children:t,closeButton:n=!0,style:s,toggle:i,"data-testid":o})=>T("div",{className:`modal-header ${e}`,style:s,children:[u("h5",{className:"modal-title",children:t}),n&&u("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":"Close",onClick:i,children:u("span",{"aria-hidden":"true",children:"\xD7"})})]});D.exports.bool.isRequired,D.exports.string.isRequired,D.exports.oneOfType([D.exports.string,D.exports.func]).isRequired,D.exports.func,D.exports.func.isRequired,D.exports.func,D.exports.func,D.exports.string,D.exports.string,D.exports.string,D.exports.node,D.exports.string;const zi=Q.forwardRef((e,t)=>{const{children:n,className:s,disabled:i,onClick:o,style:r,id:l}=e;return u("button",{ref:t,type:"button",className:z("btn",s),onClick:o,style:r,disabled:i,id:l,children:n})});zi.displayName="Button";zi.propTypes={children:D.exports.node,className:D.exports.string,disabled:D.exports.bool,onClick:D.exports.func,style:D.exports.shape({}),id:D.exports.string};zi.defaultProps={children:null,className:"",disabled:!1,onClick:()=>null,style:{},id:""};function go(e){return e.then!==void 0}const Dn=class{static disableAllActions(){Dn.actionsDisabled=!0}static enableAllActions(){Dn.actionsDisabled=!1}static isContextActionEvent(e){return Array.isArray(e.contextActions)}static compareActions(e,t){return e.group!==t.group?(e.group||0)>(t.group||0)?1:-1:e.order!==t.order?(e.order||0)>(t.order||0)?1:-1:e.title!==t.title?(e.title||"")>(t.title||"")?1:-1:e!==t?e>t?1:-1:0}static sortActions(e){if(!e||!Array.isArray(e))return[];const t=e.slice();return t.sort(Dn.compareActions),t}static isMacPlatform(){const{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return Dn.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){const t=Dn.getModifierKey();return e[t]}static copyToClipboard(e){const{clipboard:t}=navigator;return t===void 0?(Dn.copyToClipboardExecCommand(e),Promise.resolve()):navigator.clipboard.writeText(e).catch(()=>{Dn.copyToClipboardExecCommand(e)})}static copyToClipboardExecCommand(e){const t=document.activeElement,n=document.createElement("textarea");if(n.value=e,document.body.appendChild(n),n.focus(),n.select(),!document.execCommand("copy"))throw new Error("Unable to execute copy command");document.body.removeChild(n),t instanceof HTMLElement&&t.focus()}static getMenuItems(e,t=!0){let n=[],s=e;Array.isArray(s)||(s=[s]);for(let i=0;i<s.length;i+=1){const o=s[i];let r;typeof o=="function"?r=o():r=o,r!=null&&(r instanceof Promise?t&&n.push(r):Array.isArray(r)?n=n.concat(r):n.push(r))}return n=n.filter(i=>i.title||i.then||i.menuElement),n}static getNextMenuItem(e,t,n){let s=e;s<0&&t<0&&(s=n.length);for(let i=1;i<n.length+1;i+=1){const o=(s+t*i+n.length)%n.length,r=n[o];if(!(r instanceof Promise)&&r.disabled!==!0)return o}return e}};let Se=Dn;Se.actionsDisabled=!1;const Fr=te.module("GlobalContextAction");class Bc extends R.exports.Component{constructor(t){super(t),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}componentDidMount(){document.body.addEventListener("contextmenu",this.handleContextMenu),document.body.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.body.removeEventListener("contextmenu",this.handleContextMenu),document.body.removeEventListener("keydown",this.handleKeyDown)}handleContextMenu(t){const n=t;n.contextActions||(n.contextActions=[]);const{action:s}=this.props;!s.title&&!s.menuElement||(n.contextActions||(n.contextActions=[]),n.contextActions.push(s),Fr.debug("Received context menu event at global action! Menu items are now: ",n.contextActions))}handleKeyDown(t){var s,i;const{action:n}=this.props;if(!Se.actionsDisabled&&((s=n.shortcut)==null?void 0:s.matchesEvent(t))){Fr.debug("Global hotkey matched!",t);const o=(i=n.action)==null?void 0:i.call(n,t);(o||o===void 0)&&(t.preventDefault(),t.stopPropagation())}}render(){return null}}class Wc extends R.exports.Component{render(){const{actions:t,"data-testid":n}=this.props,s=[];for(let i=0;i<t.length;i+=1){const o=t[i],{shortcut:r}=o;if(o.title||o.menuElement||r){const l=u(Bc,{action:o,"data-testid":n},`${o.title}.${r==null?void 0:r.id}`);s.push(l)}}return s}}const Ci=te.module("ContextActions");class se extends R.exports.Component{constructor(t){super(t),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=Q.createRef(),this.state={globalActions:[],keyboardActions:[]}}static triggerMenu(t,n,s,i){if(!t||!n||!s||!i)return;const o=new MouseEvent("contextmenu",{clientX:n,clientY:s,bubbles:!0,cancelable:!0});o.contextActions=i,t.dispatchEvent(o)}static getDerivedStateFromProps(t){if(!t.actions||!Array.isArray(t.actions))return{globalActions:[],keyboardActions:[]};const n=t.actions.filter(i=>!go(i)&&typeof i!="function"&&i.isGlobal),s=t.actions.filter(i=>!go(i)&&typeof i!="function"&&!i.isGlobal&&i.shortcut!=null);return{globalActions:n,keyboardActions:s}}componentDidMount(){var t;(t=this.container.current)!=null&&t.parentElement&&(this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.addEventListener("keydown",this.handleKeyDown))}componentWillUnmount(){var t;(t=this.container.current)!=null&&t.parentElement&&(this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.removeEventListener("keydown",this.handleKeyDown))}handleContextMenu(t){const{ignoreClassNames:n=[]}=this.props;if(n.length>0){let i=t.target;for(;i!=null;){const{classList:o}=i,r=n.find(l=>o.contains(l));if(r!==void 0){Ci.debug2(`Contextmenu event ignored based on the target className "${r}"`);return}i=i.parentElement}}if(Se.isContextActionEvent(t)||(t.contextActions=[]),!Se.isContextActionEvent(t))return;const{actions:s}=this.props;if(s){let i=s;Array.isArray(i)&&(i=i.filter(o=>go(o)||typeof o=="function"||!o.isGlobal)),t.contextActions=t.contextActions.concat(i)}Ci.debug("Received context menu event! Menu items are now: ",t.contextActions)}handleKeyDown(t){var s,i;const{keyboardActions:n}=this.state;for(let o=0;o<n.length;o+=1){const r=n[o];if(!Se.actionsDisabled&&((s=r.shortcut)==null?void 0:s.matchesEvent(t))){Ci.debug("Context hotkey matched!",t);const l=(i=r.action)==null?void 0:i.call(r,t);if(l||l===void 0){t.stopPropagation(),t.preventDefault();return}Ci.debug2("Matched hotkey returned false, key event not consumed")}}}render(){const{"data-testid":t}=this.props,{globalActions:n}=this.state;return u("div",{className:"context-actions-listener",ref:this.container,"data-testid":t,children:u(Wc,{actions:n})})}}se.groups={default:null,high:100,medium:5e3,low:1e4,global:1e5,edit:100};var zc={prefix:"vs",iconName:"arrow-left",icon:[512,512,[],"f000","m224 98.976 -160 160V281.6l160 160 22.624 -22.624 -132.672 -132.704H448v-32H113.92L246.656 121.6 224 98.976z"]},rs={prefix:"vs",iconName:"check",icon:[512,512,[],"f000","m461.792 106.336 -271.04 320 -25.28 -1.152 -107.2 -152.64 26.176 -18.368 95.296 135.68 257.632 -304.192 24.448 20.672z"]},$c={prefix:"vs",iconName:"chevron-down",icon:[512,512,[],"f000","m255.232 322.304 139.424 -139.424 19.84 19.776L265.088 352h-19.776L96 202.656l19.808 -19.776 139.424 139.424z"]},Gc={prefix:"vs",iconName:"chevron-left",icon:[512,512,[],"f000","m189.696 255.232 139.424 139.424 -19.776 19.84L160 265.088v-19.776L309.344 96l19.776 19.808 -139.424 139.424z"]},Nl={prefix:"vs",iconName:"chevron-right",icon:[512,512,[],"f000","M322.304 256.768 182.88 117.344l19.776 -19.84L352 246.912v19.776L202.656 416l-19.776 -19.808 139.424 -139.424z"]},qc={prefix:"vs",iconName:"chevron-up",icon:[512,512,[],"f000","m256.768 189.696 -139.424 139.424 -19.84 -19.776L246.912 160h19.776L416 309.344l-19.808 19.776 -139.424 -139.424z"]},zo={prefix:"vs",iconName:"circle-large-filled",icon:[512,512,[],"f000","M256 32a217.6 217.6 0 0 1 59.52 8.096 220.768 220.768 0 0 1 98.656 57.76 220.896 220.896 0 0 1 57.728 98.656C477.312 215.616 480 235.424 480 256s-2.688 40.384 -8.096 59.52a220.8 220.8 0 0 1 -22.528 53.568 229.024 229.024 0 0 1 -80.512 80.288 222.912 222.912 0 0 1 -53.376 22.72A223.488 223.488 0 0 1 256 480a223.488 223.488 0 0 1 -59.52 -7.872 227.136 227.136 0 0 1 -53.568 -22.752 233.6 233.6 0 0 1 -45.28 -35.008 233.44 233.44 0 0 1 -35.008 -45.28 227.136 227.136 0 0 1 -22.72 -53.6A223.52 223.52 0 0 1 32 256c0 -20.576 2.624 -40.384 7.872 -59.52a222.976 222.976 0 0 1 22.752 -53.344 228.992 228.992 0 0 1 80.288 -80.512 220.64 220.64 0 0 1 53.6 -22.528A217.856 217.856 0 0 1 256 32z"]},Kc={prefix:"vs",iconName:"circle-large-outline",icon:[512,512,[],"f000","M306.816 70.88A185.856 185.856 0 0 0 256 64c-17.728 0 -34.624 2.336 -50.816 6.88l-0.192 0.064c-16.448 4.512 -31.68 10.944 -45.824 19.232A196.992 196.992 0 0 0 90.24 159.36l-0.064 0.128A190.944 190.944 0 0 0 70.72 205.12 191.552 191.552 0 0 0 64 256c0 17.76 2.24 34.72 6.72 50.912a193.6 193.6 0 0 0 49.536 84.832c11.84 11.68 24.768 21.664 38.912 30.08a195.2 195.2 0 0 0 45.92 19.488A192.64 192.64 0 0 0 256 448c17.76 0 34.72 -2.24 50.912 -6.72 16.48 -4.64 31.68 -11.136 45.632 -19.424l0.128 -0.064a197.12 197.12 0 0 0 69.152 -68.96 187.2 187.2 0 0 0 19.2 -45.824l0.096 -0.192A185.824 185.824 0 0 0 448 256c0 -17.728 -2.304 -34.624 -6.88 -50.816l-0.064 -0.192a184.704 184.704 0 0 0 -19.2 -45.536l-0.064 -0.128a188.8 188.8 0 0 0 -30.144 -38.72l-0.256 -0.256a188.864 188.864 0 0 0 -38.72 -30.144l-0.128 -0.064a184.704 184.704 0 0 0 -45.536 -19.2l-0.192 -0.064zm142.56 298.24a229.024 229.024 0 0 1 -80.512 80.256 222.912 222.912 0 0 1 -53.376 22.72A223.488 223.488 0 0 1 256 480a223.488 223.488 0 0 1 -59.52 -7.872 227.136 227.136 0 0 1 -53.568 -22.752 233.6 233.6 0 0 1 -45.28 -35.008 233.44 233.44 0 0 1 -35.008 -45.28 227.136 227.136 0 0 1 -22.72 -53.6A223.52 223.52 0 0 1 32 256c0 -20.576 2.624 -40.384 7.872 -59.52a222.976 222.976 0 0 1 22.752 -53.344 228.992 228.992 0 0 1 80.288 -80.512 220.64 220.64 0 0 1 53.6 -22.528A217.856 217.856 0 0 1 256 32a217.6 217.6 0 0 1 59.52 8.096 220.768 220.768 0 0 1 98.656 57.76 220.896 220.896 0 0 1 57.728 98.656C477.312 215.616 480 235.424 480 256s-2.688 40.384 -8.096 59.52a220.8 220.8 0 0 1 -22.528 53.568z"]},xr={prefix:"vs",iconName:"clippy",icon:[512,512,[],"f000","M224 447.744H128v-288h256v64h32v-80l-16 -16H352v-32h-32a64 64 0 0 0 -128 0H158.08v32H112l-16 16v320l16 16H224v-32zm0 -358.4a32 32 0 0 1 25.6 -25.6 32 32 0 0 1 18.56 1.92 30.08 30.08 0 0 1 14.4 11.52 32 32 0 1 1 -56 30.08 32 32 0 0 1 -2.56 -17.92zm226.56 302.72L416 426.944v-171.2h-32v170.88l-34.56 -34.56 -22.72 22.72 62.08 61.76h22.72l61.76 -61.76 -22.72 -22.72zm-189.44 -133.12h22.72l61.76 61.76 -22.72 22.72 -34.56 -34.56v170.88h-32v-171.2l-34.56 34.88 -22.72 -22.72 62.08 -61.76z"]},$i={prefix:"vs",iconName:"close",icon:[512,512,[],"f000","m256 278.624 116.672 116.704 22.656 -22.624L278.624 256l116.704 -116.672 -22.624 -22.656L256 233.376 139.328 116.672l-22.624 22.656L233.376 256l-116.672 116.672 22.624 22.656L256 278.624z"]},Xc={prefix:"vs",iconName:"cloud-download",icon:[512,512,[],"f000","M382.624 192h1.6a95.68 95.68 0 0 1 67.712 28.128 96.096 96.096 0 0 1 0 135.744 95.68 95.68 0 0 1 -67.744 28.128v-32a64.064 64.064 0 0 0 0 -128h-29.248l-3.936 -27.424a79.68 79.68 0 0 0 -68.032 -67.904A79.296 79.296 0 0 0 199.392 176l-10.656 24.384 -25.888 -6.048A79.68 79.68 0 0 0 144.736 192c-21.184 0 -41.504 8.416 -56.448 23.424A80.096 80.096 0 0 0 144.736 352h15.936v32h-15.936a111.552 111.552 0 0 1 -84.096 -37.12 112.064 112.064 0 0 1 62.656 -184.96 110.784 110.784 0 0 1 46.976 1.28 111.552 111.552 0 0 1 117.024 -65.92A111.328 111.328 0 0 1 382.624 192zm-168 163.872 42.048 42.048V224h31.808v172.8l40.896 -40.928 22.624 22.624 -68.672 68.704h-22.656L192 378.528l22.624 -22.656z"]},Fl={prefix:"vs",iconName:"copy",icon:[512,512,[],"f000","m128 128 32 -32h173.248L448 210.752V448l-32 32H160l-32 -32V128zm288 96 -96 -96H160v320h256V224zM96 32 64 64v320l32 32V64h205.248l-32 -32H96z"]},xl={prefix:"vs",iconName:"edit",icon:[512,512,[],"f000","M423.36 32h-46.72L112.64 296l-5.12 7.04L32 434.88 77.12 480l131.84 -75.52 7.04 -5.12L480 135.36V88.64L423.36 32zM77.12 434.88l48.32 -96 46.4 46.4 -94.72 49.6zm122.56 -65.92L143.04 312.32l256 -256 56.64 56.64 -256 256z"]},Or={prefix:"vs",iconName:"file-code",icon:[512,512,[],"f000","m338.24 36.48 104.96 105.6 4.8 11.52v310.4l-16 16h-352l-16 -16v-416l16 -16h247.04l11.2 4.48zM320 160h96l-96 -96v96zM96 64v384h320V192H304L288 176V64H96zm65.984 241.056 58.144 -58.496L197.44 224 128 293.728v22.624l69.472 69.568 22.624 -22.624 -58.112 -58.24zM281.6 246.848l22.4 -22.688 70.048 69.6v22.688L304 385.984l-22.56 -22.688 58.592 -58.24L281.6 246.848z"]},Yc={prefix:"vs",iconName:"file-zip",icon:[512,512,[],"f000","M80 32h352l16 16v160l-4.8 11.2 -27.2 27.52v217.28l-16 16h-320l-16 -16v-416l16 -16zM192 64H160v64h32V64zm0 384h128V245.76l-27.2 -27.2L288 207.04V64H224v80l-16 16H192v32H160V160h-16L128 144V64H96v384h64v-32h32v32zm0 -64v32h32v-32H192zm0 -32v32H160v-32h32zm0 -32h32v32H192v-32zm0 -32v32H160V288h32zm0 -32h32v32H192V256zm0 -32v32H160V224h32zm0 0h32V192H192v32zm196.8 4.8 27.2 -27.52V64h-96v136.64l27.2 27.2 4.8 11.2V448h32V240l4.8 -11.2z"]},Qc={prefix:"vs",iconName:"files",icon:[512,512,[],"f000","M373.333 0h-192L149.333 32V128H53.333L21.333 160v321.493L53.333 512h257.493L341.333 481.493V384h100.267l27.733 -30.507V96L373.333 0zm0 45.227 50.773 50.773H373.333V45.227zm-64 434.773h-256v-320H149.333v193.493L181.333 384h128v96zm128 -128h-256v-320H341.333V128h96v224z"]},Ai={prefix:"vs",iconName:"filter",icon:[512,512,[],"f000","M480 64v53.44l-160 152.288V448H192V269.728l-160 -152.32V64h448zM224 256v160h64V256l160 -152.32V96H64v7.68L224 256z"]},jc={prefix:"vs",iconName:"gear",icon:[512,512,[],"f000","M291.2 140.8 275.2 64H236.8l-16 76.8 -22.4 9.6 -64 -41.6 -28.8 25.6 41.6 64 -6.4 22.4 -76.8 16v38.4l76.8 16 9.6 25.6 -41.6 64 25.6 25.6 64 -41.6 25.6 9.6 12.8 73.6h38.4l16 -76.8 25.6 -9.6 64 41.6 25.6 -25.6 -41.6 -64 9.6 -25.6 73.6 -12.8V236.8l-76.8 -16 -9.6 -25.6 41.6 -64 -25.6 -25.6 -64 41.6 -22.4 -6.4zM300.8 32l16 76.8L384 67.2l64 64 -44.8 67.2 76.8 12.8v89.6l-76.8 16L448 384l-64 64 -67.2 -44.8 -16 76.8H211.2l-16 -76.8L128 444.8l-64 -64 44.8 -67.2L32 300.8V211.2l76.8 -16L67.2 128l64 -64 67.2 44.8 12.8 -76.8h89.6zm19.2 224c0 35.2 -28.8 64 -64 64s-64 -28.8 -64 -64 28.8 -64 64 -64 64 28.8 64 64zM256 288c19.2 0 32 -12.8 32 -32s-12.8 -32 -32 -32 -32 12.8 -32 32 12.8 32 32 32z"]},Ol={prefix:"vs",iconName:"graph",icon:[512,512,[],"f000","M48 448H480v-32H64V0H32v432l16 16zM96 368v-256l16 -16h64l16 16v256l-16 16h-64l-16 -16zm64 -16V128H128v224h32zm192 -304v320l16 16h64l16 -16v-320l-16 -16h-64l-16 16zm64 16v288h-32V64h32zm-192 304v-192l16 -16h64l16 16v192l-16 16h-64l-16 -16zm64 -16V192H256v160h32z"]},Gi={prefix:"vs",iconName:"gripper",icon:[512,512,[],"f000","M160 96h64v64H160zm0 128h64v64H160zm0 128h64v64H160zm128 -256h64v64H288zm0 128h64v64H288zm0 128h64v64H288z"]},Zc={prefix:"vs",iconName:"json",icon:[512,512,[],"f000","M192 95.488V64h-2.88c-10.016 0 -19.712 1.984 -29.088 5.92a74.56 74.56 0 0 0 -24.8 16.96 71.36 71.36 0 0 0 -15.776 24.096v0.032a113.344 113.344 0 0 0 -6.336 26.56v0.064a194.56 194.56 0 0 0 -0.768 27.616c0.384 9.28 0.576 18.56 0.576 27.808 0 6.496 -1.28 12.576 -3.744 18.304v0.032a48.128 48.128 0 0 1 -24.48 25.184 44.032 44.032 0 0 1 -17.856 3.68H64v31.488h2.88c6.24 0 12.16 1.28 17.792 3.872l0.032 0.032c5.696 2.496 10.528 5.888 14.56 10.176l0.064 0.064c4.16 4.16 7.456 9.12 9.824 14.88l0.032 0.064c2.496 5.76 3.744 11.776 3.744 18.112 0 9.28 -0.192 18.56 -0.576 27.808 -0.384 9.472 -0.128 18.72 0.768 27.84v0.032c1.056 9.056 3.168 17.856 6.304 26.368v0.032c3.392 8.736 8.672 16.768 15.808 24.096 7.136 7.36 15.424 13.024 24.8 16.96 9.376 3.936 19.072 5.92 29.12 5.92H192v-31.488h-2.88c-6.4 0 -12.384 -1.216 -18.016 -3.68a51.616 51.616 0 0 1 -14.624 -10.24 53.088 53.088 0 0 1 -9.888 -14.944c-2.368 -5.76 -3.52 -11.84 -3.52 -18.336 0 -7.296 0.096 -14.496 0.352 -21.504 0.256 -7.296 0.256 -14.4 0 -21.28a148.448 148.448 0 0 0 -1.76 -20.48 85.824 85.824 0 0 0 -5.376 -19.488A73.088 73.088 0 0 0 112.704 256a73.088 73.088 0 0 0 23.616 -30.56c2.56 -6.144 4.32 -12.576 5.376 -19.264 1.056 -6.72 1.632 -13.536 1.76 -20.48 0.256 -7.04 0.256 -14.144 0 -21.312 -0.256 -7.168 -0.384 -14.4 -0.384 -21.696a47.04 47.04 0 0 1 28.064 -43.328 42.56 42.56 0 0 1 18.016 -3.872H192zm128 321.024V448h2.88c10.016 0 19.712 -1.984 29.088 -5.92 9.376 -3.936 17.664 -9.6 24.8 -16.96 7.136 -7.36 12.416 -15.36 15.776 -24.096v-0.032c3.2 -8.512 5.28 -17.376 6.336 -26.56v-0.064c0.896 -8.96 1.152 -18.144 0.768 -27.616 -0.384 -9.28 -0.576 -18.56 -0.576 -27.808 0 -6.496 1.28 -12.576 3.744 -18.304v-0.032a48.064 48.064 0 0 1 24.48 -25.184 44.16 44.16 0 0 1 17.856 -3.68H448v-31.488h-2.88c-6.272 0 -12.192 -1.28 -17.824 -3.872l-0.032 -0.032a44.032 44.032 0 0 1 -14.56 -10.176l-0.064 -0.064a45.28 45.28 0 0 1 -9.824 -14.88v-0.064a44.96 44.96 0 0 1 -3.776 -18.112c0 -9.28 0.192 -18.56 0.576 -27.808a197.568 197.568 0 0 0 -0.768 -27.84v-0.032a113.184 113.184 0 0 0 -6.304 -26.368v-0.032a71.36 71.36 0 0 0 -15.808 -24.096 74.592 74.592 0 0 0 -24.8 -16.96 74.4 74.4 0 0 0 -29.12 -5.92H320v31.488h2.88c6.4 0 12.384 1.216 17.984 3.68 5.568 2.624 10.432 6.016 14.624 10.24 4.064 4.288 7.36 9.28 9.888 14.944 2.368 5.76 3.52 11.84 3.52 18.336 0 7.296 -0.096 14.464 -0.352 21.504 -0.256 7.296 -0.256 14.4 0 21.28 0.128 7.104 0.704 13.92 1.76 20.48 1.056 6.848 2.848 13.312 5.376 19.488a73.12 73.12 0 0 0 23.616 30.56 73.12 73.12 0 0 0 -23.616 30.56 86.048 86.048 0 0 0 -5.376 19.264c-1.056 6.72 -1.632 13.536 -1.76 20.48a292.8 292.8 0 0 0 0 21.312c0.256 7.168 0.384 14.4 0.384 21.696a47.072 47.072 0 0 1 -28.064 43.328 42.56 42.56 0 0 1 -18.016 3.872H320z"]},Jc={prefix:"vs",iconName:"kebab-vertical",icon:[512,512,[],"f000","M238.208 442.624a32 32 0 1 0 35.552 -53.216 32 32 0 0 0 -35.52 53.184zM256 288a32 32 0 1 1 0 -64 32 32 0 0 1 0 64zm0 -160a32 32 0 1 1 0 -64 32 32 0 0 1 0 64z"]},ed={prefix:"vs",iconName:"link-external",icon:[512,512,[],"f000","M48 32H192v32H64v384h384v-128h32v144l-16 16h-416l-16 -16v-416l16 -16zm432 16V256h-32V86.624L231.776 302.88l-22.624 -22.656L425.376 64H256V32h208l16 16z"]},Al={prefix:"vs",iconName:"link",icon:[512,512,[],"f000","M140.8 96h98.72a108.8 108.8 0 0 1 108.8 108.8v6.56A108.8 108.8 0 0 1 239.52 320H224V288h15.52A76.8 76.8 0 0 0 316.16 211.52V204.8A76.8 76.8 0 0 0 239.68 128H140.8A76.8 76.8 0 0 0 64 204.8v6.56A76.608 76.608 0 0 0 128 286.72v32a108.8 108.8 0 0 1 -96 -107.2V204.8A108.96 108.96 0 0 1 140.8 96zM384 225.28v-32a108.8 108.8 0 0 1 96 107.52v6.56A108.96 108.96 0 0 1 371.36 416h-98.88A108.8 108.8 0 0 1 163.84 307.52V300.8A108.8 108.8 0 0 1 272.48 192H288v32h-15.52A76.8 76.8 0 0 0 195.84 300.8v6.56A76.8 76.8 0 0 0 272.48 384h98.88A76.8 76.8 0 0 0 448 307.52V300.8a76.608 76.608 0 0 0 -64 -75.52z"]},td={prefix:"vs",iconName:"list-ordered",icon:[512,512,[],"f000","M73.184 74.432 86.144 64h21.664v96h-22.656V89.344l-11.968 8.992v-23.904zM160 96h320v32H160V96zm0 128h320v32H160V224zm320 128H160v32h320v-32zM119.744 244.032l0.928 -1.248 2.08 -2.88a26.88 26.88 0 0 0 4.992 -16.224c0 -3.84 -0.64 -7.68 -1.824 -11.328a27.136 27.136 0 0 0 -15.744 -16.928 35.936 35.936 0 0 0 -14.464 -2.624 35.008 35.008 0 0 0 -14.656 2.784 27.744 27.744 0 0 0 -15.328 16.704A33.216 33.216 0 0 0 64 222.624v1.6h25.92v-1.6a9.6 9.6 0 0 1 1.472 -5.024 5.568 5.568 0 0 1 1.824 -1.728 6.08 6.08 0 0 1 5.504 0 6.016 6.016 0 0 1 1.792 1.92 7.68 7.68 0 0 1 0.992 2.592 14.24 14.24 0 0 1 -1.152 9.28 41.888 41.888 0 0 1 -3.84 5.824l-32 36.416 -0.384 0.416v17.28h63.616v-22.4h-28.8l20.8 -23.168zm-1.184 122.144c1.472 1.024 2.752 2.24 3.84 3.648a26.912 26.912 0 0 1 5.344 17.6c0 3.424 -0.544 6.816 -1.6 10.048a25.344 25.344 0 0 1 -15.584 16 41.216 41.216 0 0 1 -15.36 2.528c-3.68 0 -7.36 -0.512 -10.912 -1.568a30.08 30.08 0 0 1 -8.256 -3.936 24.032 24.032 0 0 1 -5.824 -5.664 34.016 34.016 0 0 1 -3.712 -6.4A33.216 33.216 0 0 1 64 386.496v-1.568h26.048v1.568c0 0.864 0.096 1.76 0.288 2.624a6.624 6.624 0 0 0 0.96 2.368 4.48 4.48 0 0 0 1.696 1.664 6.4 6.4 0 0 0 5.024 0.256 5.088 5.088 0 0 0 1.792 -1.248 7.04 7.04 0 0 0 1.344 -2.4 13.344 13.344 0 0 0 0.544 -4.032 15.456 15.456 0 0 0 -0.704 -5.216 6.4 6.4 0 0 0 -1.632 -2.56 4.416 4.416 0 0 0 -1.92 -0.928 17.184 17.184 0 0 0 -2.464 -0.224h-5.152v-20.64h5.376a7.712 7.712 0 0 0 2.208 -0.352 5.248 5.248 0 0 0 2.08 -1.088 5.6 5.6 0 0 0 1.536 -2.144 9.152 9.152 0 0 0 0.672 -3.872 8.96 8.96 0 0 0 -0.512 -3.2 5.312 5.312 0 0 0 -3.104 -3.168 6.4 6.4 0 0 0 -4.992 0.224 5.248 5.248 0 0 0 -1.76 1.696 11.008 11.008 0 0 0 -1.28 4.992v1.568H64v-1.568a31.584 31.584 0 0 1 5.76 -17.408 25.6 25.6 0 0 1 5.728 -5.952 27.84 27.84 0 0 1 8.384 -4.256c3.648 -1.152 7.488 -1.696 11.328 -1.632 3.712 -0.032 7.392 0.32 11.008 1.152 2.944 0.672 5.76 1.76 8.416 3.2a24.224 24.224 0 0 1 10.24 10.176 23.36 23.36 0 0 1 2.88 11.104 25.92 25.92 0 0 1 -5.344 16.896 17.984 17.984 0 0 1 -3.84 3.648z"]},kl={prefix:"vs",iconName:"loading",icon:[512,512,[],"f000","M445.344 224A192.064 192.064 0 0 0 66.656 224H34.272a224.064 224.064 0 0 1 443.456 0h-32.384z"]},nd={prefix:"vs",iconName:"lock",icon:[512,512,[],"f000","M416 224h-32V160a128 128 0 1 0 -256 0v64H96L64 256v192l32 32h320l32 -32V256l-32 -32zM160 160a96 96 0 1 1 192 0v64H160V160zm256 288H96V256h320v192z"]},sd={prefix:"vs",iconName:"menu",icon:[512,512,[],"f000","M512 160H0V128h512v32zm0 256H0v-32h512v32zm0 -128.256H0V256h512v31.744z"]},id={prefix:"vs",iconName:"new-file",icon:[512,512,[],"f000","m304 35.2 108.8 112 3.2 12.8v64h-32V192H256V64H96v352h128v32H80l-16 -16v-384l16 -16h214.4l9.6 3.2zM288 64v96h92.8L288 64zm128 448h-32v-96H288v-32h96V288h32v96h96v32h-96v96z"]},Ll={prefix:"vs",iconName:"pass-filled",icon:[512,512,[],"f000","M256 480A224 224 0 1 0 256 32a224 224 0 0 0 0 448zm-32.64 -132.16h-22.72L128 275.2l22.72 -22.72 61.44 61.44 134.4 -134.72 22.72 22.72 -145.92 145.92z"]},Pl={prefix:"vs",iconName:"pass",icon:[512,512,[],"f000","M200.64 347.84h22.72l145.92 -145.92 -22.72 -22.72 -134.4 134.72 -61.44 -61.44L128 275.2l72.64 72.64zM275.2 32c51.2 3.2 99.2 28.8 134.4 64 41.6 44.8 64 99.2 64 163.2 0 51.2 -19.2 99.2 -51.2 140.8 -32 38.4 -76.8 67.2 -128 76.8 -51.2 9.6 -102.4 3.2 -147.2 -22.4 -44.8 -25.6 -80 -64 -99.2 -112C28.8 294.4 25.6 240 41.6 192c16 -51.2 44.8 -92.8 89.6 -121.6C172.8 41.6 224 28.8 275.2 32zm16 412.8c41.6 -9.6 80 -32 108.8 -67.2 25.6 -35.2 41.6 -76.8 38.4 -121.6 0 -51.2 -19.2 -102.4 -54.4 -137.6 -32 -32 -70.4 -51.2 -115.2 -54.4 -41.6 -3.2 -86.4 6.4 -121.6 32 -35.2 25.6 -60.8 60.8 -73.6 105.6 -12.8 41.6 -12.8 86.4 6.4 128 19.2 41.6 48 73.6 86.4 96 38.4 22.4 83.2 28.8 124.8 19.2z"]},od={prefix:"vs",iconName:"play",icon:[512,512,[],"f000","M120.96 64 96 77.12v384l24.96 13.44 288 -192V256l-288 -192zM128 431.36V107.2l243.2 162.24L128 431.36z"]},rd={prefix:"vs",iconName:"preview",icon:[512,512,[],"f000","M64 64h384l32 32v320l-32 32H64l-32 -32V96l32 -32zm0 352h384V96H64v320zm352 -288H96v96h320V128zm-32 64H128V160h256v32zm-96 192h128V256H288v128zm32 -96h64v64h-64V288zM224 256H96v32h128V256zm-128 96h128v32H96v-32z"]},nn={prefix:"vs",iconName:"remove",icon:[512,512,[],"f000","M480 256H32V224h448v32z"]},ld={prefix:"vs",iconName:"reply",icon:[512,512,[],"f000","m201.792 68.672 -128.64 128.64v22.656l128.64 128.64 22.656 -22.624L121.824 223.36H182.08c90.016 0 147.36 19.36 182.56 55.328 35.264 36 51.68 92.064 51.68 173.472v11.2h32v-11.2c0 -84.672 -16.864 -151.04 -60.8 -195.872C343.52 211.36 275.744 191.36 182.08 191.36H124.384l100.064 -100.032 -22.656 -22.656z"]},ad={prefix:"vs",iconName:"ruby",icon:[512,512,[],"f000","m32 230.08 212.48 212.48h23.04L480 230.08v-23.04l-106.24 -106.24 -11.52 -4.8H149.76l-11.52 4.8L32 207.04v23.04zm224 177.92L66.56 218.56 156.48 128h199.04l89.92 90.56L256 408zm0 -247.36h86.08l57.92 57.92 -144 140.8V160.64z"]},Hl={prefix:"vs",iconName:"search",icon:[512,512,[],"f000","M325.333 0a176 176 0 0 0 -131.84 292.693L21.333 488.107l23.893 21.333 171.733 -194.56A176.021 176.021 0 1 0 325.333 0.213V0zm0 320a144 144 0 1 1 0 -288 144 144 0 0 1 0 288z"]},cd={prefix:"vs",iconName:"split-horizontal",icon:[512,512,[],"f000","M448 32H96L64 64v352l32 32h352l32 -32V64l-32 -32zM256 416H96V64h160v352zm192 0H288V64h160v352z"]},dd={prefix:"vs",iconName:"symbol-operator",icon:[512,512,[],"f000","M91.936 35.2c10.72 4.352 19.264 12.736 23.84 23.36 2.304 5.44 3.488 11.264 3.424 17.184a42.88 42.88 0 0 1 -19.52 36.32 43.488 43.488 0 0 1 -24.096 7.136A43.36 43.36 0 0 1 32 75.584a43.36 43.36 0 0 1 26.56 -40.192A43.84 43.84 0 0 1 91.936 35.2zm-9.536 56.48a17.632 17.632 0 0 0 10.624 -16 17.536 17.536 0 1 0 -10.624 16zM205.76 35.488 35.52 205.76l21.952 21.984 170.24 -170.24 -21.952 -21.984zM368 288h32v80H480v32h-80V480h-32v-80H288v-32h80V288zm-183.424 16.8 22.624 22.624L150.624 384l56.576 56.576 -22.624 22.624L128 406.624l-56.576 56.576 -22.624 -22.624L105.376 384l-56.576 -56.576 22.624 -22.624L128 361.376l56.576 -56.576zm43.2 -134.24a43.296 43.296 0 0 0 -40.192 -26.56 43.36 43.36 0 0 0 -40.192 26.56 43.584 43.584 0 0 0 40.224 60.64A43.456 43.456 0 0 0 227.776 170.56zm-24.096 23.84a17.696 17.696 0 0 1 -9.248 9.28 17.504 17.504 0 0 1 -19.168 -3.744 16.928 16.928 0 0 1 -3.744 -5.536 17.408 17.408 0 0 1 22.912 -22.88 18.08 18.08 0 0 1 5.536 3.712 17.568 17.568 0 0 1 3.712 19.168zM448 96h-128v32h128V96z"]},Ar={prefix:"vs",iconName:"terminal",icon:[512,512,[],"f000","M64 32 32 64v384L64 480h384l32 -32V64L448 32H64zM64 448V64h384v384H64zm120.661 -85.547 22.144 22.635 112.213 -111.851v-19.456l-112.213 -112.213 -22.08 22.613 97.92 100.309 -97.984 97.963z"]},hd={prefix:"vs",iconName:"tools",icon:[512,512,[],"f000","m472.736 111.52 -24.96 -5.888 -67.456 67.072 -38.208 -38.912 65.792 -69.024 -5.76 -25.344a141.44 141.44 0 0 0 -43.104 -7.296 116.48 116.48 0 0 0 -46.624 8.96 122.368 122.368 0 0 0 -37.952 26.88 119.552 119.552 0 0 0 -28 40.48 126.016 126.016 0 0 0 0 94.912 10730.912 10730.912 0 0 0 -197.536 199.488c-6.72 8.8 -9.92 19.776 -9.088 30.816a44.896 44.896 0 0 0 14.848 30.944c3.968 4.32 8.704 7.904 13.984 10.496 5.44 2.4 11.296 3.776 17.216 4.064 10.112 -0.192 19.808 -4.032 27.328 -10.784 49.536 -46.624 144.448 -142.4 198.368 -198.528 14.624 6.208 30.336 9.408 46.208 9.376a119.552 119.552 0 0 0 85.664 -36.256 124.32 124.32 0 0 0 35.552 -87.36 134.752 134.752 0 0 0 -6.272 -44.096zM93.856 445.696a9.92 9.92 0 0 1 -4.32 2.24 13.984 13.984 0 0 1 -4.768 0 11.072 11.072 0 0 1 -4.608 -1.824 10.752 10.752 0 0 1 -3.648 -3.52c-4.48 -4.576 -8.672 -13.28 -4.48 -18.176 43.84 -46.624 134.112 -137.76 190.56 -193.472 3.2 4.224 6.72 8.256 10.496 12.032 3.776 3.936 7.84 7.584 12.16 10.912 -54.592 56 -143.616 146.048 -191.36 191.808zm355.776 -290.08c0.064 24.48 -9.472 48 -26.624 65.536a91.552 91.552 0 0 1 -128.224 0 95.744 95.744 0 0 1 -20.32 -100.384A87.936 87.936 0 0 1 324.48 69.76a88.32 88.32 0 0 1 34.304 -6.848h8.128L308.768 122.848v22.272l60.64 60.352h21.12l59.104 -58.112v8.256zM103.68 214.016h48.992l22.56 22.944 21.696 -21.568 -21.28 -21.696V192.32l1.824 -52.768 -7.04 -13.984 -91.52 -60.224 -18.912 2.112 -26.592 27.168 -2.112 19.168 58.816 93.376 13.568 6.88zm-30.24 -116.224L147.488 146.56 146.24 182.496H111.808L64.064 106.912l9.376 -9.12zm227.36 222.72 21.568 -21.536 99.392 101.92a47.328 47.328 0 0 1 0 65.248 44.928 44.928 0 0 1 -49.568 10.08 41.92 41.92 0 0 1 -13.984 -10.08l-100.544 -102.496 21.728 -21.696 100.224 102.208a12.864 12.864 0 0 0 4.896 3.36 15.264 15.264 0 0 0 11.488 0 12.896 12.896 0 0 0 4.896 -3.36 13.952 13.952 0 0 0 3.2 -4.896 16.8 16.8 0 0 0 1.152 -5.888 17.504 17.504 0 0 0 -1.12 -5.888 13.952 13.952 0 0 0 -3.2 -4.896L300.8 320.512z"]},Pn={prefix:"vs",iconName:"trash",icon:[512,512,[],"f000","M320 96h96v32h-32v288l-32 32H128l-32 -32V128H64V96h96V64a32 32 0 0 1 32 -32h96a32 32 0 0 1 32 32v32zM288 64H192v32h96V64zM128 416h224V128H128v288zm64 -256H160v224h32V160zm32 0h32v224H224V160zm64 0h32v224H288V160z"]},Fn={prefix:"vs",iconName:"triangle-down",icon:[512,512,[],"f000","M64 177.92 77.216 160h358.208l12.576 17.28L267.936 352h-26.464L64 177.92z"]},_l={prefix:"vs",iconName:"triangle-right",icon:[512,512,[],"f000","M177.92 448 160 434.784V76.576L177.28 64 352 244.064v26.464L177.92 448z"]},cs={prefix:"vs",iconName:"warning",icon:[512,512,[],"f000","M241.92 32h28.16l209.28 392.32 -14.08 23.68H46.08L32 424.32 241.92 32zM256 72.96 72.96 416H438.4L256 72.96zM276 384v-32h-40v32h40zm-40 -64V192h40v128h-40z"]},ud={prefix:"dh",iconName:"arrow-to-bottom",icon:[512,512,[],"f000","m99.2 224 160 160h22.4l160 -160 -22.4 -22.4L288 332.8V64H256v268.8L124.8 201.6l-25.6 22.4zM96 416h352v32H96z"]},md={prefix:"dh",iconName:"arrow-to-top",icon:[512,512,[],"f000","m444.8 288 -160 -160h-22.4l-160 160 22.4 22.4L256 179.2V448h32V179.2l131.2 131.2 25.6 -22.4zm3.2 -192H96V64h352v32z"]},pd={prefix:"dh",iconName:"check-square",icon:[512,512,[],"f000","M425.6 64H86.4l-22.4 22.4v342.4l22.4 19.2h342.4l22.4 -22.4V86.4l-25.6 -22.4zm-188.8 284.8h-22.4L144 278.4l22.4 -22.4 60.8 60.8 134.4 -134.4 22.4 22.4 -147.2 144z"]},gd={prefix:"dh",iconName:"exclamation",icon:[512,512,[],"f000","M275.2 384v-32H236.8v32h38.4zm-38.4 -64V128h38.4v192H236.8z"]},kr={prefix:"dh",iconName:"eye-slash",icon:[512,512,[],"f000","M480 256c0 -32 -99.2 -160 -224 -160 -32 0 -64 9.6 -92.8 22.4L70.4 25.6 25.6 70.4 435.2 480l44.8 -44.8 -76.8 -76.8C451.2 320 480 272 480 256zM256 131.2c96 0 176 92.8 188.8 124.8 -6.4 16 -32 48 -67.2 76.8L316.8 272c3.2 -6.4 3.2 -9.6 3.2 -16 0 -35.2 -28.8 -64 -64 -64 -6.4 0 -9.6 0 -16 3.2L192 147.2c19.2 -9.6 41.6 -16 64 -16zm0 249.6C160 380.8 80 288 67.2 256c6.4 -9.6 19.2 -32 41.6 -54.4l-25.6 -25.6C51.2 208 32 243.2 32 256c0 32 99.2 160 224 160 19.2 0 38.4 -3.2 57.6 -9.6l-28.8 -28.8c-9.6 3.2 -19.2 3.2 -28.8 3.2z"]},Oo={prefix:"dh",iconName:"eye",icon:[512,512,[],"f000","M256 96C131.2 96 32 224 32 256s99.2 160 224 160 224 -128 224 -160 -99.2 -160 -224 -160zm0 284.8C160 380.8 80 288 67.2 256 80 227.2 160 131.2 256 131.2S432 224 444.8 256c-12.8 28.8 -92.8 124.8 -188.8 124.8zM256 192c-35.2 0 -64 28.8 -64 64s28.8 64 64 64 64 -28.8 64 -64 -28.8 -64 -64 -64zm0 92.8c-16 0 -28.8 -12.8 -28.8 -28.8s12.8 -28.8 28.8 -28.8 28.8 12.8 28.8 28.8 -12.8 28.8 -28.8 28.8z"]},fd={prefix:"dh",iconName:"file-csv",icon:[512,512,[],"f000","m444.8 140.8 -105.6 -105.6 -12.8 -3.2H80l-16 16V224h32V64h192v112l16 16H416v32h32V153.6l-3.2 -12.8zM320 160V64l96 96h-96zM80 256l-16 16v192l16 16h352l16 -16v-192l-16 -16h-352zM416 416v32H96V288h320v128zm-217.6 -3.2c-6.4 3.2 -16 3.2 -25.6 3.2 -16 0 -25.6 -3.2 -35.2 -12.8 -9.6 -6.4 -12.8 -19.2 -12.8 -32 0 -16 3.2 -28.8 12.8 -38.4 9.6 -9.6 22.4 -12.8 38.4 -12.8 9.6 0 16 0 22.4 3.2v19.2c-6.4 -3.2 -12.8 -6.4 -22.4 -6.4 -9.6 0 -16 3.2 -22.4 9.6 -6.4 6.4 -9.6 12.8 -9.6 22.4 0 9.6 3.2 16 6.4 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16 -3.2 22.4 -6.4v19.2zm19.2 0v-22.4c3.2 3.2 9.6 6.4 12.8 6.4 3.2 3.2 9.6 3.2 12.8 3.2h6.4c3.2 0 3.2 0 6.4 -3.2l3.2 -3.2v-3.2c0 -3.2 0 -3.2 -3.2 -6.4 3.2 0 0 0 0 -3.2 -3.2 0 -3.2 -3.2 -6.4 -3.2s-6.4 -3.2 -9.6 -3.2c-6.4 -3.2 -12.8 -6.4 -16 -12.8 -3.2 -3.2 -6.4 -9.6 -6.4 -16s0 -9.6 3.2 -12.8c3.2 -3.2 3.2 -6.4 9.6 -9.6 3.2 0 6.4 -3.2 12.8 -3.2h25.6c3.2 0 6.4 0 9.6 3.2v19.2s-3.2 -3.2 -6.4 -3.2 -3.2 0 -6.4 -3.2h-19.2c-3.2 0 -3.2 0 -6.4 3.2l-3.2 3.2v6.4l3.2 3.2s3.2 3.2 6.4 3.2 3.2 3.2 6.4 3.2c3.2 3.2 6.4 3.2 9.6 6.4 3.2 3.2 6.4 3.2 6.4 6.4 3.2 3.2 3.2 6.4 6.4 6.4 0 3.2 3.2 6.4 3.2 9.6 0 6.4 0 9.6 -3.2 12.8 -3.2 3.2 -3.2 6.4 -9.6 9.6 3.2 3.2 0 6.4 -3.2 6.4h-32c-3.2 0 -6.4 -3.2 -12.8 -3.2zm169.6 -92.8 -32 96h-25.6l-32 -96h22.4l19.2 67.2c0 3.2 3.2 6.4 3.2 9.6 0 -3.2 0 -6.4 3.2 -9.6l19.2 -67.2h22.4z"]},Cd={prefix:"dh",iconName:"file-download",icon:[512,512,[],"f000","m438.4 137.6 -96 -96L320 32H128L96 64v384l32 32h288l32 -32V160l-9.6 -22.4zM416 448H128V64h160v128h128v256zm-96 -288V64l96 96h-96zm-134.4 182.4 76.8 76.8h22.4l76.8 -76.8 -25.6 -22.4L288 368V227.2H256v140.8L208 320l-22.4 22.4z"]},bd={prefix:"dh",iconName:"file-spreadsheet",icon:[512,512,[],"f000","m438.4 137.6 -96 -96L320 32H128L96 64v384l32 32h288l32 -32V160l-9.6 -22.4zM416 448H128V64h160v128h128v256zm-96 -288V64l96 96h-96zm64 99.2 -19.2 -19.2H179.2l-19.2 19.2v137.6l19.2 19.2h185.6l19.2 -19.2V259.2zm-150.4 134.4H182.4v-48h51.2v48zm0 -115.2v48H182.4V278.4m115.2 115.2H246.4v-48h48v48zm0 -64H246.4V278.4h48v51.2zm64 64H310.4v-48h48v48zm-51.2 -64V278.4h48v48H310.4z"]},$o={prefix:"dh",iconName:"filter-filled",icon:[512,512,[],"f000","M480 64v54.4l-160 153.6V448H192V268.8L32 118.4V64h448z"]},wd={prefix:"dh",iconName:"freeze",icon:[512,512,[],"f000","m438.4 300.8 -19.2 -28.8 -60.8 35.2L272 256l86.4 -51.2 60.8 35.2 19.2 -28.8 -44.8 -25.6 48 -28.8 -16 -25.6 -48 28.8V108.8h-35.2v67.2L256 227.2V128l60.8 -35.2 -16 -28.8 -44.8 25.6V32H224v57.6L179.2 64l-16 28.8L224 128v99.2L137.6 176V108.8H102.4V160l-48 -28.8 -16 25.6 48 28.8 -44.8 25.6 19.2 28.8 60.8 -35.2L208 256 121.6 307.2 60.8 272l-19.2 28.8 44.8 25.6 -48 28.8 16 25.6 48 -28.8v51.2h35.2v-67.2L224 284.8V384l-60.8 35.2 16 28.8 44.8 -25.6V480h32v-57.6l44.8 25.6 16 -28.8L256 384V284.8l86.4 51.2v67.2h35.2V352l48 28.8 16 -25.6 -48 -28.8z"]},fo={prefix:"dh",iconName:"gear-filled",icon:[512,512,[],"f000","m480 211.2 -76.8 -12.8L448 131.2l-64 -64 -67.2 41.6L300.8 32H211.2l-12.8 76.8L131.2 64l-64 64 41.6 67.2 -76.8 16v89.6l76.8 12.8L64 380.8l64 64 67.2 -41.6 16 76.8h89.6l16 -76.8L384 448l64 -64 -44.8 -67.2 76.8 -16V211.2zM256 320c-38.4 0 -64 -25.6 -64 -64s25.6 -64 64 -64 64 25.6 64 64 -25.6 64 -64 64z"]},Sd={prefix:"dh",iconName:"graph-line-down",icon:[512,512,[],"f000","M64 416V0H32v432l16 16H480v-32zm67.2 -291.2 -22.4 22.4 108.8 112 70.4 -64 108.8 124.8H320v32h112l16 -16V224h-32v70.4L288 150.4l-70.4 64z"]},vd={prefix:"dh",iconName:"graph-line-up",icon:[512,512,[],"f000","M64 416V0H32v432l16 16H480v-32zm153.6 -150.4 70.4 64 128 -144V256h32V144l-16 -16H320v32h76.8L288 284.8l-70.4 -64 -108.8 112 22.4 22.4z"]},Rs={prefix:"dh",iconName:"new-circle-large-filled",icon:[512,512,[],"f000","M240 0C108.8 0 0 108.8 0 240S108.8 480 240 480 480 371.2 480 240 371.2 0 240 0zM352 256H256v96H224V256H128V224h96V128h32v96h96v32z"]},Td={prefix:"dh",iconName:"pandas",icon:[512,512,[],"f000","M185.6 28.8h54.4v115.2H185.6V28.8zm0 240h54.4V384H185.6V268.8zm0 -89.6h54.4v54.4H185.6V179.2zM96 124.8h54.4V512H96V124.8zm176 240h54.4V480H272v-115.2zm0 -240h54.4v115.2H272V124.8zm0 150.4h54.4v54.4H272V275.2zM361.6 0H416v387.2h-54.4V0z"]},Ed={prefix:"dh",iconName:"refresh",icon:[512,512,[],"f000","m313.6 73.6 -9.6 32c83.2 25.6 131.2 118.4 102.4 201.6 -19.2 64 -80 108.8 -150.4 108.8 -89.6 0 -160 -70.4 -160 -160 0 -51.2 22.4 -96 64 -128v64h32V80L176 64H64v32h86.4c-76.8 51.2 -108.8 150.4 -70.4 236.8C112 403.2 179.2 448 256 448c105.6 0 192 -86.4 192 -192 0 -83.2 -54.4 -156.8 -134.4 -182.4z"]},yd={prefix:"dh",iconName:"remove-square-filled",icon:[512,512,[],"f000","M432 32h-384l-16 16v384l16 16h384l16 -16v-384l-16 -16zM352 256H128V224h224v32z"]},Go={prefix:"dh",iconName:"sort-alpha-down",icon:[512,512,[],"f000","M236.8 368 156.8 448h-22.4l-80 -80 22.4 -22.4L128 396.8V64h32v332.8l51.2 -51.2 25.6 22.4zM371.2 224l-6.4 -28.8H316.8l-9.6 28.8H256l54.4 -160h60.8l51.2 160h-51.2zm-32 -124.8c0 3.2 -3.2 3.2 -3.2 9.6s-3.2 19.2 -12.8 51.2h32l-9.6 -44.8c-3.2 -6.4 -6.4 -9.6 -6.4 -16zm-6.4 310.4h73.6V448H272v-32l73.6 -89.6H275.2V288h128v32l-70.4 89.6z"]},qo={prefix:"dh",iconName:"sort-alpha-up",icon:[512,512,[],"f000","M51.2 144 131.2 64h22.4l80 80 -22.4 22.4L160 115.2V448H128V115.2L76.8 166.4l-25.6 -22.4zm320 304 -6.4 -28.8H316.8l-9.6 28.8H256l54.4 -160h60.8l51.2 160h-51.2zm-32 -124.8c0 3.2 -3.2 3.2 -3.2 9.6 0 6.4 -3.2 19.2 -12.8 51.2h32l-9.6 -44.8c-3.2 -6.4 -6.4 -9.6 -6.4 -16zm-6.4 -137.6h73.6V224H272V192l73.6 -89.6H275.2V64h128v32l-70.4 89.6z"]},Lr={prefix:"dh",iconName:"sort-amount-down",icon:[512,512,[],"f000","M204.8 368 124.8 448h-22.4L22.4 368l22.4 -22.4L96 396.8V64h32v332.8l51.2 -51.2 25.6 22.4zM256 64h256v64H256zm0 105.6h192v64H256zm0 108.8h128v64H256zM256 384h64v64H256z"]},Rd={prefix:"dh",iconName:"sort-down",icon:[512,512,[],"f000","m128 288 -12.8 25.6 128 118.4h25.6l128 -118.4L384 288H128z"]},Id={prefix:"dh",iconName:"sort-up",icon:[512,512,[],"f000","m128 224 -12.8 -25.6 128 -118.4h25.6l128 118.4 -12.8 25.6H128z"]},Ko={prefix:"dh",iconName:"sort",icon:[512,512,[],"f000","m128 224 -12.8 -25.6 128 -118.4h25.6l128 118.4 -12.8 25.6H128zm0 64 -12.8 25.6 128 118.4h25.6l128 -118.4L384 288H128z"]},Pr={prefix:"dh",iconName:"square-filled",icon:[512,512,[],"f000","M432 32h-384l-16 16v384l16 16h384l16 -16v-384l-16 -16z"]},Xo={prefix:"dh",iconName:"table",icon:[512,512,[],"f000","M432 64h-384l-16 16v352l16 16h384l16 -16v-352l-16 -16zM160 416H64v-64h96v64zm0 -96H64V256h96v64zm0 -96H64V160h96v64zm128 192H192v-64h96v64zm0 -96H192V256h96v64zm0 -96H192V160h96v64zm128 192h-96v-64h96v64zm0 -96h-96V256h96v64zm0 -96h-96V160h96v64z"]},Md={prefix:"dh",iconName:"trash-undo",icon:[512,512,[],"f000","M320 96h96v32h-32v288l-32 32H128l-32 -32V128H64V96h96V64c0 -19.2 12.8 -32 32 -32h96c19.2 0 32 12.8 32 32v32zM288 64H192v32h96V64zM128 416h224V128H128v288zm112 -64L160 272v-22.4l80 -80 22.4 22.4 -51.2 54.4H320v32H211.2l51.2 51.2 -22.4 22.4z"]},Dd={prefix:"dh",iconName:"triangle-down-square",icon:[512,512,[],"f000","M425.6 64H86.4l-22.4 22.4v342.4l22.4 19.2h342.4l22.4 -22.4V86.4l-25.6 -22.4zm-160 288h-22.4L99.2 208l9.6 -16h291.2l9.6 12.8L265.6 352z"]},Nd={prefix:"dh",iconName:"unlink",icon:[512,512,[],"f000","M32 211.2v-6.4C32 144 80 96 140.8 96h99.2c12.8 0 25.6 3.2 38.4 6.4l-25.6 25.6H140.8C99.2 128 64 163.2 64 204.8v6.4c0 28.8 16 54.4 38.4 67.2l-22.4 22.4C51.2 281.6 32 249.6 32 211.2zM403.2 6.4l-38.4 38.4 -67.2 67.2 -22.4 25.6 -150.4 147.2 -25.6 25.6 -54.4 54.4 -38.4 38.4L51.2 448 448 51.2 403.2 6.4zM384 192v32c38.4 6.4 64 38.4 64 76.8v6.4c0 41.6 -35.2 76.8 -76.8 76.8H272c-32 0 -60.8 -22.4 -73.6 -51.2l-25.6 25.6c19.2 35.2 54.4 60.8 96 60.8h99.2c60.8 0 108.8 -48 108.8 -108.8v-9.6C480 246.4 438.4 198.4 384 192zM246.4 288l-22.4 19.2v12.8h16c60.8 0 108.8 -48 108.8 -108.8v-6.4c0 -6.4 0 -12.8 -3.2 -19.2l-32 32c0 38.4 -32 67.2 -67.2 70.4z"]},Hr={prefix:"dh",iconName:"warning-circle-filled",icon:[512,512,[],"f000","M470.4 195.2c-9.6 -38.4 -28.8 -70.4 -57.6 -99.2 -25.6 -25.6 -60.8 -44.8 -96 -54.4C297.6 35.2 275.2 32 256 32c-19.2 0 -41.6 3.2 -60.8 9.6 -16 3.2 -35.2 9.6 -51.2 22.4 -35.2 19.2 -60.8 44.8 -80 80 -12.8 16 -19.2 35.2 -25.6 51.2C35.2 214.4 32 236.8 32 256c0 19.2 3.2 41.6 6.4 60.8 6.4 16 12.8 35.2 25.6 51.2 9.6 16 22.4 32 35.2 44.8 12.8 16 28.8 25.6 44.8 35.2 16 9.6 35.2 16 54.4 22.4 16 6.4 38.4 9.6 57.6 9.6 19.2 0 41.6 -3.2 60.8 -6.4 19.2 -6.4 35.2 -12.8 54.4 -22.4 32 -19.2 60.8 -48 80 -80 9.6 -16 16 -35.2 22.4 -54.4 3.2 -19.2 6.4 -41.6 6.4 -60.8s-3.2 -41.6 -9.6 -60.8zM275.2 352H236.8v-32h38.4v32zm0 -64H236.8V160h38.4v128z"]},Vl={prefix:"dh",iconName:"warning-filled",icon:[512,512,[],"f000","M268.8 32h-25.6L32 425.6l12.8 22.4h419.2l12.8 -22.4L268.8 32zm6.4 352H236.8v-32h38.4v32zm0 -64H236.8V192h38.4v128z"]};const qi=Q.forwardRef((e,t)=>{var b;function n(C){const{menuItem:w,onMenuItemClick:S}=e;S(w,C)}function s(C){const{menuItem:w,onMenuItemMouseMove:S}=e;S(w,C)}function i(C){const{menuItem:w,onMenuItemContextMenu:S}=e;S(w,C)}function o(C,w,S){if(typeof C.type=="string")return C;const{closeMenu:I,menuItem:v,isKeyboardSelected:E,isMouseSelected:M,"data-testid":F}=e,k={menuItem:v,closeMenu:I,isKeyboardSelected:E,isMouseSelected:M,iconElement:w,displayShortcut:S,"data-testid":F};return Q.cloneElement(C,{forwardedProps:k})}const{children:r,menuItem:l,isKeyboardSelected:a,isMouseSelected:c,"data-testid":d}=e,h=(b=l.shortcut)==null?void 0:b.getDisplayText();let m=null;if(l.icon){const C=l.icon;if(Q.isValidElement(C))m=C;else{let w;l.iconColor&&!l.disabled&&(w={color:l.iconColor}),m=u(G,{icon:C,style:w})}}let p=null;const g=!!r;l.actions&&(p=u(G,{icon:Nl}));let f=null;if(l.menuElement)f=u("div",{className:"custom-menu-item",onMouseMove:s,children:o(l.menuElement,m,h)});else{const C=l.disabled,w=l.iconOutline;f=u("button",{type:"button",className:z("btn-context-menu",{disabled:C},{active:(g||c)&&!C},{"keyboard-active":a&&!C}),onClick:n,onMouseMove:s,onContextMenu:i,title:l.description||"",children:T("div",{className:"btn-context-menu-wrapper",children:[u("span",{className:z("icon",{outline:w}),children:m}),u("span",{className:"title",children:l.title}),h&&u("span",{className:"shortcut",children:h}),p&&u("span",{className:z("submenu-indicator",{disabled:C}),children:p})]})})}return T("div",{className:"context-menu-item",ref:t,"data-testid":d,children:[r,f]})});qi.displayName="ContextMenuItem";qi.defaultProps={children:null,isKeyboardSelected:!1,isMouseSelected:!1,"data-testid":void 0};class vs extends Error{constructor(){super(...arguments),this.isCanceled=!0}}class Yo{static isDark(t){const n=document.createElement("div");n.style.display="none",n.style.color=t;const s=getComputedStyle(document.body.appendChild(n)).color,i=s.match(/\d+/g);let o=[];if(i)o=i.map(l=>parseInt(l,10));else throw new Error(`Invalid color received. Got ${s}`);return document.body.removeChild(n),Yo.getBrightness(o)<125}static getBrightness(t){return Math.round((t[0]*299+t[1]*587+t[2]*114)/1e3)}}const Fd="table_",Ul="column_",xd=new Set(["in","not","i","ii","k"]),Od=new Set(["abstract","continue","for","new","switch","assert","default","if","package","synchronized","boolean","do","goto","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","null","true","false"]),Ad=/[^a-zA-Z0-9_$+@-]/g,kd=/[^A-Za-z0-9_$]/g,Is=class{};let Hn=Is;Hn.legalize=(e,t,n,s,i)=>{let o=e.trim().replace(/[- ]/g,"_");return s&&(xd.has(o)||Od.has(o))&&(o=t+o),o=o.replace(n,""),o||(o=t+i),Number.isNaN(Number(o.charAt(0)))||(o=t+o),o};Hn.legalizeTableName=e=>Is.legalize(e,Fd,Ad,!1,0);Hn.legalizeColumnNames=e=>{const t=[];return e.forEach((n,s)=>{let i=Is.legalizeColumnName(n,s);t.includes(i)&&(i=Ul+s),t.push(i)}),t};Hn.legalizeColumnName=(e,t=0)=>Is.legalize(e,Ul,kd,!0,t);Hn.isValidTableName=e=>Is.legalizeTableName(e)===e;Hn.isValidColumnName=e=>Is.legalizeColumnName(e)===e;function Ld(e,t){return e?e.closest(`.${t}`):null}const Pd={getClosestByClassName:Ld};class Ee extends CustomEvent{constructor(t,n){super(t,n)}}class Bl extends Error{constructor(){super(...arguments),this.isTimeout=!0}}class He{static makeCancelable(t,n){let s=!1,i;const o=new Promise((r,l)=>{Promise.resolve(t).then(a=>{s?(n&&n(a),l(new vs)):(i=a,r(a))},a=>l(s?new vs:a))});return o.cancel=()=>{s=!0,i!=null&&n&&n(i)},o}static isCanceled(t){return t instanceof vs}static isTimedOut(t){return t instanceof Bl}}class Ki{constructor(){this.pending=[],this.resolved=[]}add(t,n){const s=He.makeCancelable(t,n);return this.pending.push(s),s.then(()=>{this.resolve(s)},()=>{this.resolve(s)}),s}remove(t){for(let n=0;n<this.pending.length;n+=1)if(this.pending[n]===t){this.pending.splice(n,1);return}}resolve(t){this.remove(t),this.resolved.push(t)}cancel(){const t=[...this.pending,...this.resolved];for(let n=0;n<t.length;n+=1)t[n].cancel();this.pending=[],this.resolved=[]}}function O(e){if(e==null)throw new Error("Value is null or undefined")}class $t{static isValidRange(t){return t!=null&&t.length===2&&Number.isInteger(t[0])&&Number.isInteger(t[1])&&t[0]<=t[1]}static validateRange(t){if(!$t.isValidRange(t))throw new Error(`Invalid range! ${t}`)}static isSelected(t,n){for(let s=0;s<t.length;s+=1){const i=t[s],o=i[0],r=i[1];if(o<=n&&n<=r)return!0}return!1}static selectRange(t,n){let[s,i]=n;const o=[...t];for(let r=o.length-1;r>=0;r-=1){const l=o[r],a=l[0],c=l[1];if(a<=s&&i<=c)return o;s<=c&&a<=i&&(s=Math.min(s,a),i=Math.max(i,c),o.splice(r,1))}return o.push([s,i]),o}static deselectRange(t,n){const[s,i]=n,o=[...t];for(let r=o.length-1;r>=0;r-=1){const l=o[r],a=l[0],c=l[1];if(!(i<a||c<s))if(a<s&&i<c){o[r]=[a,s-1],o.splice(r+1,0,[i+1,c]);break}else s<=a&&c<=i?o.splice(r,1):a<s?o[r]=[a,s-1]:o[r]=[i+1,c]}return o}static count(t){return t.reduce((n,s)=>n+(s[1]-s[0]+1),0)}}class Qo{static join(t,n="and"){if(t==null||t.length===0)return"";if(t.length===1)return t[0];if(t.length===2)return`${t[0]} ${n} ${t[1]}`;const s=t.slice(0,t.length-1).join(", "),i=t[t.length-1];return`${s}, ${n} ${i}`}static toLower(t,n=!0){if(t==null){if(n)return"";throw new Error("Null string passed in to TextUtils.toLower")}return t.toLowerCase()}static sort(t,n,s=!0){return t<n?s?-1:1:t>n?s?1:-1:0}}const Wl=class{static formatElapsedTime(e){if(typeof e!="number"||!Number.isInteger(e))throw new Error(`${e} is not a number that can be expressed as a formatted time`);const t=Math.floor(e/3600),n=Math.floor(e%3600/60),s=e%60;return`${t>0?`${t}h `:""}${n>0||t>0?`${n}m `:""}${e>=60?`${s}s`.padStart(3,"0"):`${s}s`}`}static formatTime(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new Error(`${e} is not a number that can be expressed as a formatted time`);const t=String(Math.floor(e/(60*60))).padStart(2,"0"),n=e%(60*60),s=String(Math.floor(n/60)).padStart(2,"0"),i=n%60,o=String(Math.ceil(i)).padStart(2,"0");return`${t}:${s}:${o}`}static isTimeString(e){return new RegExp(Wl.TIME_PATTERN).test(e)}static parseTime(e){if(!e||typeof e!="string")throw new Error(`${e} is not a valid string`);const t=e.split(":");if(t.length!==3)throw new Error(`${e} is not a time string that can be parsed`);return Number(t[0])*60*60+Number(t[1])*60+Number(t[2])}};let Kt=Wl;Kt.TIME_PATTERN="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]";Kt.TIME_ZONES=Object.freeze([{label:"Tokyo UTC+9 No DST",value:"Asia/Tokyo"},{label:"Seoul UTC+9 No DST",value:"Asia/Seoul"},{label:"Hong Kong UTC+8 No DST",value:"Asia/Hong_Kong"},{label:"Singapore UTC+8 No DST",value:"Asia/Singapore"},{label:"Kolkata UTC+5:30 No DST",value:"Asia/Kolkata"},{label:"Berlin UTC+1",value:"Europe/Berlin"},{label:"UTC UTC\xB10 No DST",value:"UTC"},{label:"London UTC\xB10",value:"Europe/London"},{label:"Sao Paulo UTC-2",value:"America/Sao_Paulo"},{label:"Newfoundland UTC-3:30",value:"America/St_Johns"},{label:"Halifax UTC-4",value:"America/Halifax"},{label:"New York UTC\u22125",value:"America/New_York"},{label:"Chicago UTC-6",value:"America/Chicago"},{label:"Denver UTC-7",value:"America/Denver"},{label:"Los Angeles UTC-8",value:"America/Los_Angeles"},{label:"Anchorage UTC-9",value:"America/Anchorage"},{label:"Honolulu UTC-10 No DST",value:"Pacific/Honolulu"},{label:"Zurich UTC+1",value:"Europe/Zurich"},{label:"Amsterdam UTC+1",value:"Europe/Amsterdam"},{label:"Taipei UTC+8 No DST",value:"Asia/Taipei"},{label:"Sydney UTC+10",value:"Australia/Sydney"}]);class Hd extends Error{constructor(){super(...arguments),this.isInvalid=!0}}const Pt=({className:e="","data-testid":t})=>T("div",{className:z("loading-spinner fa-layers",e),"data-testid":t,children:[u(G,{icon:Kc,className:"text-white-50"}),u(G,{icon:kl,className:"text-primary",spin:!0})]}),_r=te.module("ContextMenu"),Ao=class extends R.exports.PureComponent{constructor(e){super(e),this.handleBlur=this.handleBlur.bind(this),this.handleCloseSubMenu=this.handleCloseSubMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMenuItemClick=this.handleMenuItemClick.bind(this),this.handleMenuItemContextMenu=this.handleMenuItemContextMenu.bind(this),this.handleMenuItemMouseMove=this.handleMenuItemMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowResize=this.handleWindowResize.bind(this),this.container=Q.createRef(),this.oldFocus=document.activeElement,this.activeSubMenuRef=Q.createRef(),this.subMenuTimer=0,this.rAF=0,this.initialPosition={top:e.top,left:e.left},this.state={menuItems:[],pendingItems:[],activeSubMenu:null,hasOverflow:!1,subMenuTop:null,subMenuLeft:null,subMenuParentWidth:0,subMenuParentHeight:0,keyboardIndex:-1,mouseIndex:-1}}static handleContextMenu(e){e.metaKey||(e.stopPropagation(),e.preventDefault())}componentDidMount(){this.initMenu(),this.verifyPosition(),window.addEventListener("resize",this.handleWindowResize),this.rAF=window.requestAnimationFrame(()=>{var t;(t=this.container.current)==null||t.focus();const{onMenuOpened:e}=this.props;e(this)})}componentDidUpdate(e,t){var i,o,r;const{actions:n}=this.props,{activeSubMenu:s}=this.state;s!==t.activeSubMenu&&(s==null?(i=this.container.current)==null||i.focus():this.setActiveSubMenuPosition()),e.actions!==n&&(this.initMenu(),(o=this.container.current)!=null&&o.contains(document.activeElement)||(r=this.container.current)==null||r.focus()),this.verifyPosition()}componentWillUnmount(){this.cancelPromises(),window.removeEventListener("resize",this.handleWindowResize),cancelAnimationFrame(this.rAF)}getKeyboardIndex(){const{options:e}=this.props;if(e.separateKeyboardMouse){const{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){const{options:t}=this.props;t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){const{mouseIndex:e}=this.state;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){this.cancelPromises(),cancelAnimationFrame(this.rAF);const{options:e}=this.props;let t=e.initialKeyboardIndex;t===void 0&&(t=-1);const{actions:n}=this.props,s=Se.getMenuItems(n),i=[];for(let o=s.length-1;o>=0;o-=1){const r=s[o];r instanceof Promise?this.initMenuPromise(r):i.push(r)}this.setState({mouseIndex:-1,keyboardIndex:t,activeSubMenu:null,menuItems:Se.sortActions(i)})}initMenuPromise(e){const t=He.makeCancelable(e);this.setState(n=>({pendingItems:n.pendingItems.concat(t)})),t.then(n=>{this.setState(s=>{const i=s.pendingItems.indexOf(t);if(i>=0){const o=s.pendingItems.slice();return o.splice(i,1),{menuItems:Se.sortActions(s.menuItems.concat(n)),pendingItems:o}}return null})},n=>{He.isCanceled(n)||(this.setState(s=>{const i=s.pendingItems.indexOf(t);if(i>=0){const o=s.pendingItems.slice();return o.splice(i,1),{pendingItems:o}}return null}),_r.error(n))})}cancelPromises(){const{pendingItems:e}=this.state;e.map(t=>t.cancel())}setActiveSubMenuPosition(){if(this.activeSubMenuRef.current===null)return;const e=this.activeSubMenuRef.current.getBoundingClientRect();this.setState({subMenuTop:e.top,subMenuLeft:e.right,subMenuParentHeight:e.height,subMenuParentWidth:e.width})}verifyPosition(){var h,m,p,g;const{options:e,updatePosition:t,subMenuParentWidth:n,subMenuParentHeight:s,top:i,left:o}=this.props;if(!this.container.current||e.doNotVerifyPosition)return;let{top:r,left:l}=this.initialPosition;const{width:a,height:c}=(m=(h=this.container.current)==null?void 0:h.getBoundingClientRect())!=null?m:{width:0,height:0},d=((g=(p=this.container.current)==null?void 0:p.scrollHeight)!=null?g:0)>window.innerHeight;c===0||a===0||(r+c>window.innerHeight&&(r-c-s>0?r-=c-s:r=window.innerHeight-c),l+a>window.innerWidth&&(l=l-a-n),(o!==l||i!==r)&&(this.setState({hasOverflow:d}),t(r,l)))}handleWindowResize(){!this.container.current||this.closeMenu(!0)}handleBlur(e){if(!this.container.current){_r.warn("Container is null!");return}if(!this.container.current.contains(e.relatedTarget)){let t=e.relatedTarget,n=!1;for(;t&&!n;)n=t.hasAttribute("data-dh-context-menu"),t=t.parentElement;n||this.closeMenu(!0)}}isEscapeKey(e){const{left:t}=this.props;return e==="Escape"||t<0&&e==="ArrowRight"||e==="ArrowLeft"}handleKeyDown(e){const{menuItems:t}=this.state,n=this.getKeyboardIndex();let s=n,i=!1;if(e.key==="Enter"||e.key===" "){n>=0&&n<t.length&&this.handleMenuItemClick(t[n],e);return}if(e.key==="ArrowRight"?n>=0&&n<=t.length?i=!0:s=0:this.isEscapeKey(e.key)?s=null:e.key==="ArrowUp"||e.shiftKey&&e.key==="Tab"?s=Se.getNextMenuItem(s,-1,t):(e.key==="ArrowDown"||e.key==="Tab")&&(s=Se.getNextMenuItem(s,1,t)),i){this.openSubMenu(n),e.preventDefault(),e.stopPropagation();return}n!==s&&(s!==null?this.setKeyboardIndex(s):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}openSubMenu(e){const{menuItems:t,activeSubMenu:n}=this.state,s=t[e].actions?e:null;n!==s&&this.setState({activeSubMenu:s,subMenuTop:null,subMenuLeft:null})}closeMenu(e=!1){const{closeMenu:t,onMenuClosed:n}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),n(this)})}closeSubMenu(){this.setState({activeSubMenu:null})}handleCloseSubMenu(e){e?this.closeMenu(!0):this.closeSubMenu()}handleMenuItemClick(e,t){t.preventDefault(),t.stopPropagation();const{menuItems:n}=this.state;e!=null&&!e.disabled&&(e.actions!=null?this.openSubMenu(n.indexOf(e)):e.action!=null&&(e.action(),this.closeMenu(!0)))}handleMenuItemContextMenu(e,t){t.metaKey||this.handleMenuItemClick(e,t)}handleMenuItemMouseMove(e){const{menuItems:t}=this.state,n=t.indexOf(e);this.setMouseIndex(n),n>=0&&n<t.length&&!e.disabled&&this.openSubMenu(n)}handleMouseLeave(){this.setMouseIndex(-1)}render(){const e=[],{top:t,left:n}=this.props,{activeSubMenu:s,hasOverflow:i,keyboardIndex:o,menuItems:r,mouseIndex:l,pendingItems:a,subMenuTop:c,subMenuLeft:d,subMenuParentWidth:h,subMenuParentHeight:m}=this.state;for(let C=0;C<r.length;C+=1){const w=r[C];C>0&&w.group!==r[C-1].group&&e.push(u("hr",{},`${C}.separator`));const S=u(qi,{ref:s===C?this.activeSubMenuRef:null,isKeyboardSelected:o===C,isMouseSelected:l===C,menuItem:w,closeMenu:this.handleCloseSubMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:this.handleMenuItemContextMenu},C);e.push(S)}let p=null;a.length>0&&(p=u("div",{className:"loading",children:u(Pt,{})}));const{menuStyle:g,"data-testid":f}=this.props,b=s!==null&&c!==null&&d!==null;return T(Ne,{children:[T("div",{className:z({"has-overflow":i},"context-menu-container"),style:{top:t,left:n,...g},ref:this.container,"data-dh-context-menu":!0,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,onContextMenu:Ao.handleContextMenu,role:"menuitem",tabIndex:0,"data-testid":f,children:[e,p]}),b&&s!==null&&c!==null&&d!==null&&u(Ao,{actions:r[s].actions||[],closeMenu:this.handleCloseSubMenu,top:c,left:d,updatePosition:(C,w)=>{this.setState({subMenuTop:C,subMenuLeft:w})},subMenuParentWidth:h,subMenuParentHeight:m},`sub-${s}`)]})}};let zl=Ao;zl.defaultProps={subMenuParentWidth:0,subMenuParentHeight:0,closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0};class _d extends R.exports.Component{constructor(t){super(t),this.handleMenuClose=this.handleMenuClose.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.container=Q.createRef(),this.openMenu=Q.createRef(),this.state={actions:null,left:0,top:0}}componentDidMount(){var t;(t=this.container.current)!=null&&t.parentElement&&this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu)}componentWillUnmount(){var t;(t=this.container.current)!=null&&t.parentElement&&this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu)}handleContextMenu(t){if(!Se.isContextActionEvent(t)||!this.container.current||t.metaKey||t.ctrlKey)return;const n=Se.getMenuItems(t.contextActions),s=this.container.current.getBoundingClientRect(),i=t.clientY-s.top,o=t.clientX-s.left;if(n.length===0){if(t.target===this.container.current){t.preventDefault(),this.setState({actions:null},()=>{const r=document.elementFromPoint(o,i),l=new MouseEvent("contextmenu",{clientX:t.clientX,clientY:t.clientY,bubbles:!0,cancelable:!0});r==null||r.dispatchEvent(l)});return}return}t.preventDefault(),this.setState({actions:n,top:i,left:o})}handleMenuClose(t){t===this.openMenu.current&&this.setState({actions:null})}render(){let t=null;const{"data-testid":n}=this.props,{actions:s,top:i,left:o}=this.state;return s&&(t=u(zl,{ref:this.openMenu,actions:s,onMenuClosed:this.handleMenuClose,top:i,left:o,updatePosition:(r,l)=>{this.setState({top:r,left:l})},"data-testid":n})),u("div",{className:z("context-menu-root",{active:s}),ref:this.container,children:t})}}const jn=class extends R.exports.Component{static handleEnter(e){const t=e;t.style.height="0"}static handleEntering(e){const t=e;t.style.height=`${jn.getHeight(t)}px`}static handleExiting(e){const t=e;t.style.height="0"}static handleExit(e){const t=e;t.style.height=`${jn.getHeight(t)}px`}static getHeight(e){const t=e.scrollWidth-e.clientWidth;return e.scrollHeight-t}constructor(e){super(e),this.handleEntered=this.handleEntered.bind(this)}handleEntered(e){const t=e;t.style.height="";const{autoFocusOnShow:n}=this.props;if(n){const s=t.querySelector("input, select, textarea");s&&s.focus()}}render(){const{children:e,className:t,in:n,"data-testid":s}=this.props;return u(rt,{in:n,classNames:{enterActive:"collapsing",enterDone:"collapse show",exitActive:"collapsing",exitDone:"collapse"},onEnter:jn.handleEnter,onEntering:jn.handleEntering,onEntered:this.handleEntered,onExit:jn.handleExit,onExiting:jn.handleExiting,timeout:350,children:i=>u("div",{className:z({collapse:i==="exited"},t),"data-testid":s,children:e})})}};let $l=jn;$l.propTypes={className:D.exports.string,in:D.exports.bool.isRequired,children:D.exports.node.isRequired,autoFocusOnShow:D.exports.bool,"data-testid":D.exports.string};$l.defaultProps={className:"",autoFocusOnShow:!1,"data-testid":void 0};function jo(e){const t=R.exports.useRef();return R.exports.useEffect(function(){t.current=e}),t.current}function Gl(e){const t=R.exports.useRef(null);return R.exports.useEffect(function(){!e||(typeof e=="function"?e(t.current):e.current=t.current)}),t}const It=Q.forwardRef((e,t)=>{const{checked:n=!1,children:s,className:i,disabled:o,inputClassName:r,isInvalid:l,labelClassName:a,name:c,onChange:d,"data-testid":h}=e,[m]=R.exports.useState(Qt()),p=Gl(t);R.exports.useEffect(function(){p.current&&(p.current.indeterminate=n===null)},[p,n]);const g=R.exports.useCallback(f=>{p.current&&(p.current.indeterminate=n===null),d&&d(f)},[p,n,d]);return T("div",{className:z("custom-control custom-checkbox",i),children:[u("input",{type:"checkbox",ref:p,checked:n!=null?n:!1,className:z("custom-control-input",r,{"is-invalid":l}),disabled:o,id:m,name:c,onChange:g,"data-testid":h}),u("label",{className:z("custom-control-label",a),htmlFor:m,children:s})]})});It.displayName="Checkbox";It.propTypes={checked:(e,t)=>{const{[t]:n}=e;return n!==null&&typeof n!="boolean"?new Error("Checked must be a boolean or null for indeterminate"):null},children:D.exports.node.isRequired,className:D.exports.string,disabled:D.exports.bool,inputClassName:D.exports.string,isInvalid:D.exports.bool,labelClassName:D.exports.string,name:D.exports.string,onChange:D.exports.func,"data-testid":D.exports.string};It.defaultProps={checked:!1,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};class _n extends R.exports.PureComponent{constructor(t){super(t),this.inputField=Q.createRef()}focus(){var t;(t=this.inputField.current)==null||t.focus()}render(){const{value:t,placeholder:n,onChange:s,className:i,matchCount:o,id:r,onKeyDown:l,"data-testid":a}=this.props;return T("div",{className:z("search-group",i),children:[u("input",{type:"search",value:t,onChange:s,onKeyDown:l,className:"form-control",placeholder:n,ref:this.inputField,id:r,"data-testid":a}),o!=null&&u("span",{className:"search-match",children:o}),u("span",{className:"search-icon",children:u(G,{icon:Hl})})]})}}_n.defaultProps={placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0};var ql=(e=>(e.UP="UP",e.DOWN="DOWN",e))(ql||{});const Bs=class extends R.exports.Component{constructor(e){super(e),this.getCachedFilteredOptions=ue((t,n)=>t.filter(s=>s.title.toLowerCase().indexOf(n.toLowerCase())>=0||s.value.toLowerCase().indexOf(n.toLowerCase())>=0)),this.state={value:"",filter:"",filteredOptions:e.options,keyboardOptionIndex:-1,menuIsOpen:!1,inputWidth:100},this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handleFilterChange=this.handleFilterChange.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleOptionFocus=this.handleOptionFocus.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=Q.createRef(),this.cbContainer=Q.createRef(),this.toggleButton=Q.createRef(),this.menuContainer=Q.createRef(),this.input=Q.createRef(),this.searchInput=Q.createRef()}componentDidUpdate(){const{menuIsOpen:e,keyboardOptionIndex:t}=this.state;e&&t>=0&&this.scrollOptionIntoView()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.input.current)==null||e.focus()}resetValue(){this.setState({value:""})}updateInputValue(e){const{onChange:t}=this.props;this.setState({value:e}),t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var r,l;const{filter:t,filteredOptions:n,keyboardOptionIndex:s}=this.state,{options:i}=this.props,o=t?n:i;switch(e.key){case"Enter":((r=o[s])==null?void 0:r.value)!=null&&this.updateInputValue(o[s].value),this.closeMenu(),(l=this.input.current)==null||l.focus(),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(Bs.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(Bs.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":t!==""?(this.setState({filter:""}),e.stopPropagation()):this.closeMenu();break;case"Tab":!e.shiftKey&&s===o.length-1&&this.closeMenu();break}}handleMenuNavigation(e){const{filter:t,filteredOptions:n,keyboardOptionIndex:s}=this.state,{options:i}=this.props,r=(t?n:i).length;let l=0;switch(e){case Bs.MENU_NAVIGATION_DIRECTION.UP:l=-1;break;case Bs.MENU_NAVIGATION_DIRECTION.DOWN:l=1;break}l!==0&&this.setState({keyboardOptionIndex:(s+l+r)%r})}handleInputKeyDown(e){const{onEnter:t}=this.props,{menuIsOpen:n}=this.state;e.key==="ArrowDown"||e.key==="ArrowUp"?n||this.openMenu():e.key==="Enter"&&t()}handleInputChange(e){this.updateInputValue(e.target.value)}handleOptionClick(e){var r;const t=Number(e.currentTarget.value),{filter:n,filteredOptions:s}=this.state,{options:i}=this.props,o=n?s:i;this.updateInputValue(o[t].value),this.closeMenu(),(r=this.input.current)==null||r.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleFilterChange(e){var i;const{options:t}=this.props,n=e.target.value,s=this.getCachedFilteredOptions(t,n);this.setState({filter:n,filteredOptions:s,keyboardOptionIndex:0}),(i=this.popper.current)==null||i.scheduleUpdate()}handleMenuBlur(e){var t;e.relatedTarget instanceof Element&&((t=this.popper.current)==null?void 0:t.element.contains(e.relatedTarget))||e.relatedTarget===this.toggleButton.current||this.closeMenu(!1)}handleInputBlur(e){var n;const{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&((n=this.popper.current)==null?void 0:n.element.contains(e.relatedTarget))||this.closeMenu(!1)}handleMenuOpened(){var e;this.scrollOptionIntoView(),(e=this.searchInput.current)==null||e.focus()}handleMenuExited(){var t;const{menuIsOpen:e}=this.state;e&&(this.setState({menuIsOpen:!1}),(t=this.popper.current)==null||t.hide()),this.setState({filter:""})}toggleMenu(e){const{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var e;(e=this.popper.current)==null||e.show()})}closeMenu(e=!0){var t,n;this.setState({menuIsOpen:!1}),e&&((t=this.input.current)==null||t.focus()),(n=this.popper.current)==null||n.hide()}updateKeyboardIndex(){const{value:e,filter:t,filteredOptions:n}=this.state,{options:s}=this.props,o=(t?n:s).findIndex(r=>r.value===e);this.setState({keyboardOptionIndex:o})}scrollOptionIntoView(){var t;const e=(t=this.menuContainer.current)==null?void 0:t.querySelector(".cb-option-btn.keyboard-active");e instanceof HTMLElement&&e.scrollIntoView({block:"nearest",inline:"nearest"})}renderMenuElement(){const{searchPlaceholder:e}=this.props,{filter:t,inputWidth:n}=this.state;return T("div",{className:"cb-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:s=>{s.stopPropagation()},style:{width:n},onBlur:this.handleMenuBlur,children:[u("div",{className:"cb-search-input-container",children:u(_n,{value:t,ref:this.searchInput,onChange:this.handleFilterChange,className:"cb-search-input",placeholder:e})}),u("div",{className:"cb-options-container",children:u("div",{className:"cb-options",children:this.renderOptions()})})]})}renderOptions(){const{options:e}=this.props,{keyboardOptionIndex:t,filter:n,filteredOptions:s}=this.state;return(n?s:e).map((o,r)=>{const l=`option-${r}-${o.value}`;return u("button",{type:"button",value:r,className:z("cb-option-btn",{"keyboard-active":t===r}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:o.title},l)})}render(){const{options:e,inputPlaceholder:t,disabled:n,className:s,defaultValue:i,spellCheck:o,"data-testid":r}=this.props,{value:l}=this.state;let{popperOptions:a}=this.props;return a={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...a},T("div",{className:"input-group cb-container",ref:this.cbContainer,children:[u("input",{value:l||i,className:z("form-control",s,"cb-input"),ref:this.input,onChange:this.handleInputChange,placeholder:t||e[0]&&e[0].title,disabled:n,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:o,"data-testid":r?`${r}-input`:void 0}),u("div",{className:"input-group-append cb-dropdown",children:T("button",{type:"button",className:"btn cb-btn form-control",ref:this.toggleButton,onClick:this.toggleMenu,onKeyDown:this.handleInputKeyDown,disabled:n,"data-testid":r?`${r}-btn`:void 0,children:[u(G,{icon:Fn}),u(fn,{ref:this.popper,options:a,className:z("combobox interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})})]})}};let Ms=Bs;Ms.MENU_NAVIGATION_DIRECTION=ql;Ms.DROP_DOWN_MENU_HEIGHT=200;Ms.propTypes={options:D.exports.arrayOf(D.exports.shape({title:D.exports.string.isRequired,value:D.exports.string.isRequired})).isRequired,popperOptions:D.exports.shape({title:D.exports.string.isRequired,value:D.exports.string.isRequired}),onChange:D.exports.func,inputPlaceholder:D.exports.string,searchPlaceholder:D.exports.string,disabled:D.exports.bool,className:D.exports.string,defaultValue:D.exports.string,spellCheck:D.exports.bool,onEnter:D.exports.func,"data-testid":D.exports.string};Ms.defaultProps={onChange(){},inputPlaceholder:"",searchPlaceholder:"Search",disabled:!1,className:"",defaultValue:"",popperOptions:null,spellCheck:!0,onEnter(){},"data-testid":void 0};const Ot=te.module("MaskedInput"),Ls={FORWARD:"forward",BACKWARD:"backward",NONE:"none"},Co="\u2007";function Zo(e,t,n){return e.substring(0,t)+n+e.substring(t+1)}const Kl=Q.forwardRef((e,t)=>{const{className:n,example:s,getNextSegmentValue:i=(P,L,N)=>N,getPreferredReplacementString:o=Zo,onChange:r=()=>!1,onSelect:l=()=>!1,pattern:a,selection:c,value:d,onFocus:h=()=>!1,onBlur:m=()=>!1,"data-testid":p}=e,g=Gl(t),f=R.exports.useMemo(()=>Array.isArray(s)?s:[s],[s]);R.exports.useEffect(function(){var L;if(c!=null){Ot.debug("setting selection...",c);const{selectionStart:N,selectionEnd:B,selectionDirection:U}=c;(L=g.current)==null||L.setSelectionRange(N,B,U),Ot.debug("selection set!")}},[c,g]);const b=R.exports.useCallback(P=>{let L=P,N=P;const B=f.length>0?f[0]:d;for(let H=L-1;H>=0&&/[a-zA-Z0-9]/g.test(B.charAt(H));H-=1)L=H;for(let H=N;H<B.length&&/[a-zA-Z0-9]/g.test(B.charAt(H));H+=1)N=H+1;const U=L===N?Ls.NONE:Ls.BACKWARD;return{selectionStart:L,selectionEnd:N,selectionDirection:U}},[f,d]);function C(P,L,N=P.length){let B="";for(let U=0;U<N;U+=1)P.charAt(U)!==Co?B=B.concat(P[U]):B=B.concat(L[U]);return B=B.concat(L.substring(N)),B}function w(P,L=P.length){const N=new RegExp(a);if(N.test(P))return!0;for(let B=0;B<f.length;B+=1){const U=C(P,f[B],L);if(N.test(U))return!0}return!1}function S(P){const L=b(P),N=L.selectionEnd+1;return N>=d.length?L:b(N)}function I(P){const L=b(P),N=L.selectionStart-1;return N<=0?L:b(N)}function v(P,L){const N=b(P),B=d.substring(N.selectionStart,N.selectionEnd),U=i(N,L,B,d),H=d.substring(0,N.selectionStart)+U+d.substring(N.selectionEnd);w(H,N.selectionEnd)&&(r(H),l(N))}const E=R.exports.useCallback(P=>{const{selectionStart:L=0,selectionEnd:N=0,selectionDirection:B="none"}=P.target;if(L===null||N===null||B===null){Ot.error("Selection attempted on non-text input element",P.target);return}if(Ot.debug2("handleSelect",L,N,B),!(c!=null&&L===c.selectionStart&&N===c.selectionEnd)){if(c!=null&&L===d.length&&N===d.length&&P.nativeEvent.type!=="mouseup"){l({...c});return}if(L===N){const U=b(L);Ot.debug("Selection segment from ",L,N,"=>",U),l(U)}else l({selectionStart:L,selectionEnd:N,selectionDirection:B})}},[b,l,c,d]),M=R.exports.useCallback(P=>{if(!g.current)return;Ot.debug("handleSelectCapture",P);const L=g.current.selectionStart||0;L===d.length&&c!=null&&L!==c.selectionStart&&(P.preventDefault(),P.stopPropagation())},[g,c,d]);function F(P){if(P.preventDefault(),P.stopPropagation(),!g.current)return;const{key:L}=P,{selectionStart:N=0,selectionEnd:B=0}=g.current;if(N===null||B===null){Ot.error("Selection arrow nvaigation attempted on non-text input element",P.target);return}L==="ArrowLeft"?l(I(N)):L==="ArrowRight"?l(S(B)):L==="ArrowUp"?v(N,-1):L==="ArrowDown"&&v(N,1)}function k(P){if(!g.current)return;Ot.debug("handleKeyDown",P);const{key:L}=P,{selectionStart:N=0,selectionEnd:B=0}=g.current;if(N===null||B===null){Ot.error("Selection key event on non-text input element",P.target);return}if(L.startsWith("Arrow")){F(P);return}if(L==="Delete"||L==="Backspace"){if(P.preventDefault(),P.stopPropagation(),N!==B){const H=d.substring(0,N)+d.substring(N,B).replace(/[a-zA-Z0-9]/g,Co)+d.substring(B);Ot.debug("Range ",N,B,"deleted, setting value",H),r(H),l({selectionStart:N,selectionEnd:N,selectionDirection:Ls.NONE})}else if(N>0)for(let H=N-1;H>=0;H-=1){const _=d.substring(0,H)+d.substring(H,N).replace(/[a-zA-Z0-9]/g,Co)+d.substring(N);if(_!==d){r(_),l({selectionStart:H,selectionEnd:H,selectionDirection:Ls.NONE});return}}return}if(P.altKey||P.metaKey||P.ctrlKey||L.length>1)return;P.preventDefault(),P.stopPropagation();const U=Array.from(new Set([L,L.toUpperCase(),L.toLowerCase()]));for(let H=0;H<U.length;H+=1){const _=U[H],$=/[a-zA-Z0-9]/g.test(_)?d.length-1:N;for(let K=N;K<=$;K+=1){const j=o(d,K,_,N,B);if(w(j,K+1)){const re=b(K),ne=K+1;let ge={selectionStart:ne,selectionEnd:ne,selectionDirection:Ls.NONE};if(ne>=re.selectionEnd){const ce=S(K);ce.selectionStart!==re.selectionStart&&(ge=ce)}Ot.debug("handleKeyDown",L,"=>",j,ge),r(j),l(ge);return}}}}return u("input",{ref:g,className:z("form-control masked-input",n),type:"text",pattern:a,value:d,onChange:()=>{},onKeyDown:k,onSelect:E,onSelectCapture:M,onFocus:h,onBlur:m,"data-testid":p})});Kl.defaultProps={className:"",onChange(){},onSelect(){},getNextSegmentValue:(e,t,n)=>n,getPreferredReplacementString:Zo,selection:void 0,onFocus(){},onBlur(){},"data-testid":void 0};const Vd=te.module("TimeInput"),Ud="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]",Bd=["00:00:00","12:34:56","23:59:59"],Xl=Q.forwardRef((e,t)=>{const{allowValueWrapping:n=!0,className:s="",onChange:i=()=>!1,value:o=0,onFocus:r=()=>!1,onBlur:l=()=>!1,onSelect:a=()=>!1,"data-testid":c}=e,[d,h]=R.exports.useState(Kt.formatTime(o)),[m,p]=R.exports.useState(),g=R.exports.useRef(null);R.exports.useImperativeHandle(t,()=>({focus:()=>{var S;(S=g.current)==null||S.focus()},setSelection:S=>{var I;(I=g.current)==null||I.focus(),p(S)}}),[]),R.exports.useEffect(function(){h(Kt.formatTime(o))},[o]);function f(S,I,v){const E=S.selectionStart===0?24:60;let M=parseInt(v,10)-I;return Number.isNaN(M)?M=0:n?M=(M%E+E)%E:M=Math.min(Math.max(0,M),E-1),`${M}`.padStart(2,"0")}function b(S,I,v,E,M){return E===0&&M===2&&I===1&&parseInt(v,10)>1?`0${v}${S.substring(2)}`:Zo(S,I,v)}function C(S){Vd.debug("handleChange",S),h(S),Kt.isTimeString(S)&&i(Kt.parseTime(S))}const w=R.exports.useCallback(S=>{p(S),a(S)},[a]);return u(Kl,{ref:g,className:s,example:Bd,getNextSegmentValue:f,getPreferredReplacementString:b,onChange:C,onSelect:w,pattern:Ud,selection:m,value:d,onFocus:r,onBlur:l,"data-testid":c})});Xl.defaultProps={allowValueWrapping:!0,className:"",onChange:()=>!1,onSelect:()=>!1,value:0,onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};class Yl extends R.exports.PureComponent{constructor(t){var i;super(t),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMenuItemClick=this.handleMenuItemClick.bind(this),this.handleMenuItemMouseMove=this.handleMenuItemMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.container=Q.createRef(),this.oldFocus=document.activeElement,this.rAF=0;const{options:n}=t,s=(i=n.initialKeyboardIndex)!=null?i:-1;this.state={menuItems:[],keyboardIndex:s,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.rAF=window.requestAnimationFrame(()=>{var n;(n=this.container.current)==null||n.focus();const{onMenuOpened:t}=this.props;t(this)})}componentDidUpdate(t){const{actions:n}=this.props;t.actions!==n&&this.initMenu()}componentWillUnmount(){cancelAnimationFrame(this.rAF)}getKeyboardIndex(){const{options:t}=this.props;if(t.separateKeyboardMouse){const{keyboardIndex:n}=this.state;return n}return this.getMouseIndex()}setKeyboardIndex(t){const{options:n}=this.props;n.separateKeyboardMouse?this.setState({keyboardIndex:t}):this.setMouseIndex(t)}getMouseIndex(){const{mouseIndex:t}=this.state;return t}setMouseIndex(t){this.setState({mouseIndex:t})}initMenu(){cancelAnimationFrame(this.rAF),this.setState({menuItems:[]});const{actions:t}=this.props,n=Se.getMenuItems(t,!1);n.length>0&&this.setState(s=>({menuItems:Se.sortActions(s.menuItems.concat(n))}))}handleKeyDown(t){const{menuItems:n}=this.state,s=this.getKeyboardIndex();let i=s;if(t.key==="Enter"||t.key===" "){s!=null&&s>=0&&s<n.length&&this.handleMenuItemClick(n[s],t);return}t.key==="Escape"?i=null:t.key==="ArrowUp"||t.key==="Tab"&&t.shiftKey===!0?i=Se.getNextMenuItem(i!=null?i:0,-1,n):(t.key==="ArrowDown"||t.key==="Tab"&&t.shiftKey===!1)&&(i=Se.getNextMenuItem(i!=null?i:0,1,n)),s!==i&&(i!==null?this.setKeyboardIndex(i):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),t.preventDefault(),t.stopPropagation())}closeMenu(t=!1){const{closeMenu:n,onMenuClosed:s}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{n(t),s(this)})}handleCloseMenu(){this.closeMenu()}handleMenuItemClick(t,n){n.preventDefault(),n.stopPropagation(),t!=null&&!t.disabled&&t.action!=null&&(t.action(),this.closeMenu(!0))}handleMenuItemMouseMove(t){const{menuItems:n}=this.state,s=n.indexOf(t);this.setMouseIndex(s)}handleMouseLeave(){this.setMouseIndex(-1)}render(){const t=[],{"data-testid":n}=this.props,{keyboardIndex:s,menuItems:i,mouseIndex:o}=this.state;for(let l=0;l<i.length;l+=1){const a=i[l];l>0&&a.group!==i[l-1].group&&t.push(u("hr",{},`${l}.separator`));const c=u(qi,{isKeyboardSelected:s===l,isMouseSelected:o===l,menuItem:a,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},l);t.push(c)}const{menuStyle:r}=this.props;return u("div",{className:"context-menu-container",style:{...r},ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":n,children:t})}}Yl.defaultProps={closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0};class An extends R.exports.PureComponent{constructor(t){super(t),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=Q.createRef(),this.parent=null,this.popper=Q.createRef(),this.isOpen=!1}componentDidMount(){var n;const{isShown:t}=this.props;t===null?(n=this.container.current)!=null&&n.parentElement&&(this.parent=this.container.current.parentElement,this.parent.addEventListener("click",this.handleClick)):t&&this.openMenu()}componentDidUpdate(t){const{isShown:n}=this.props;t.isShown!==n&&(n?window.requestAnimationFrame(()=>{this.openMenu()}):this.closeMenu())}componentWillUnmount(){this.parent&&this.parent.removeEventListener("click",this.handleClick)}closeMenu(){var t;(t=this.popper.current)==null||t.hide()}openMenu(){this.popper.current&&!this.isOpen&&(this.popper.current.show(),this.isOpen=!0)}scheduleUpdate(){var t;(t=this.popper.current)==null||t.scheduleUpdate()}handleClick(t){t.preventDefault(),t.stopPropagation(),this.openMenu()}handleCloseMenu(){this.closeMenu()}handleExited(){this.isOpen=!1;const{onMenuClosed:t}=this.props;t()}render(){const{actions:t,onMenuOpened:n,popperClassName:s,"data-testid":i}=this.props,{menuStyle:o}=this.props;let{options:r,popperOptions:l}=this.props;return l={placement:"bottom",...l},r={separateKeyboardMouse:!0,...r},u("div",{className:"menu-actions-listener",ref:this.container,"data-testid":i,children:u(fn,{ref:this.popper,options:l,className:z("menu-popper",s),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:u(Yl,{actions:t,closeMenu:this.handleCloseMenu,onMenuOpened:n,options:r,menuStyle:o})})})}}An.defaultProps={isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0};const Vr=-1;var Ql=(e=>(e.UP="UP",e.DOWN="DOWN",e))(Ql||{});const rn=class extends R.exports.Component{constructor(e){super(e);const{value:t,valueToTime:n}=e;this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleOptionFocus=this.handleOptionFocus.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.handleCustomInput=this.handleCustomInput.bind(this),this.csContainer=Q.createRef(),this.menuContainer=Q.createRef(),this.button=Q.createRef(),this.input=Q.createRef(),this.state={keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,customTime:n(t),inputFocused:!1}}getSelectedText(){const{options:e,value:t,placeholder:n}=this.props,{customTime:s}=this.state;if(t===null)return n;for(let i=0;i<e.length;i+=1){const o=e[i];if(o.value===t)return o.title}return Kt.formatTime(s)}setInputWidth(){this.csContainer.current&&this.setState({inputWidth:this.csContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.button.current)==null||e.focus()}updateInputValue(e){const{onChange:t}=this.props;t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var i;const{keyboardOptionIndex:t,inputFocused:n}=this.state,{options:s}=this.props;switch(e.key){case"Enter":case" ":n?this.updateFromCustom():this.updateInputValue(s[t].value),this.closeMenu(),(i=this.button.current)==null||i.focus(),e.stopPropagation(),e.preventDefault();break;case"Tab":e.shiftKey?this.handleMenuNavigation(rn.MENU_NAVIGATION_DIRECTION.UP):this.handleMenuNavigation(rn.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(rn.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(rn.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":this.closeMenu();break}}handleMenuNavigation(e){const{keyboardOptionIndex:t,inputFocused:n}=this.state,{options:s}=this.props,i=s.length;let o=t;switch(e){case rn.MENU_NAVIGATION_DIRECTION.UP:if(!n&&t===0){this.focusInput();break}else n&&this.focusOption(t);t>0&&!n?(o=(o-1)%i,this.setState({keyboardOptionIndex:o})):t===0&&(o=i-1,this.setState({keyboardOptionIndex:o})),this.scrollOptionIntoView(o);break;case rn.MENU_NAVIGATION_DIRECTION.DOWN:if(!n&&t===i-1){this.focusInput();break}else n&&this.focusOption(t);t<i&&!(n&&t===0)&&(o=(o+1)%i,this.setState({keyboardOptionIndex:o})),this.scrollOptionIntoView(o);break}}handleOptionClick(e){const t=Number(e.currentTarget.value),{options:n,timeToValue:s}=this.props,{customTime:i}=this.state;if(t===Vr){const o=s(i);this.updateAndClose(o)}else this.updateAndClose(n[t].value)}updateAndClose(e){var t;this.updateInputValue(e),this.closeMenu(),(t=this.button.current)==null||t.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleMenuOpened(){var o;const{options:e,value:t}=this.props,{keyboardOptionIndex:n}=this.state;this.scrollOptionIntoView(n);const s=(o=this.menuContainer.current)==null?void 0:o.querySelector(".cs-option-btn.keyboard-active");if(s instanceof HTMLElement&&s.focus(),t===null)return;e.map(r=>r.value).indexOf(t)<0&&this.focusInput()}focusInput(){var e;(e=this.input.current)==null||e.focus()}focusOption(e){var n;const t=(n=this.menuContainer.current)==null?void 0:n.querySelector(".cs-options");if(t&&t.children){const s=t.children.item(e);s instanceof HTMLElement&&s.focus()}}handleMenuExited(){const{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}handleCustomInput(e){const{timeToValue:t}=this.props,n=t(e);this.updateInputValue(n),this.setState({customTime:e})}updateFromCustom(){const{timeToValue:e}=this.props,{customTime:t}=this.state,n=e(t);this.updateInputValue(n)}toggleMenu(e){const{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0})}closeMenu(e=!0){var t;this.setState({menuIsOpen:!1}),e&&((t=this.button.current)==null||t.focus())}updateKeyboardIndex(){const{options:e,value:t}=this.props;if(t===null)return;const n=e.map(s=>s.value).indexOf(t);n>0&&this.setState({keyboardOptionIndex:n})}scrollOptionIntoView(e){var n;const t=(n=this.menuContainer.current)==null?void 0:n.querySelector(".cs-options");if(t&&t.children){const s=t.children.item(e);s instanceof HTMLElement&&s.offsetTop>rn.DROP_DOWN_MENU_HEIGHT?t.scrollTop=s.offsetTop-rn.DROP_DOWN_MENU_HEIGHT:(s instanceof HTMLElement&&s.offsetTop<0||e===0)&&(t.scrollTop=0)}}renderMenuElement(){const{inputWidth:e}=this.state;return u("div",{className:"cs-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:t=>{t.stopPropagation()},style:{width:e},children:u("div",{className:"cs-options-container",children:u("div",{className:"cs-options",children:this.renderOptions()})})})}renderOptions(){const{options:e,value:t,icon:n,customText:s}=this.props,{keyboardOptionIndex:i,customTime:o,inputFocused:r}=this.state;let l=!1;const a=[];for(let c=0;c<e.length;c+=1){const d=e[c],h=`option-${c}-${d.value}`;l=l||d.value===t,a.push(T("button",{type:"button",value:c,className:z("cs-option-btn",{"keyboard-active":i===c&&!r}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[d.value===t&&u(G,{icon:n,className:"mr-2"}),d.value!==t&&u("span",{className:"mr-4"}),d.title]},h))}return a.push(u("hr",{className:"cs-divider"},"option-divider")),a.push(T("button",{type:"button",value:Vr,className:z("cs-option-btn",{"keyboard-active":r}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[!l&&t!==null?u(G,{icon:n,className:"mr-2"}):u("span",{className:"mr-4"}),s]},"option-custom-label")),a.push(T("div",{className:"cs-custom-container",children:[u("span",{className:"mr-2"}),u(Xl,{ref:this.input,onChange:this.handleCustomInput,value:o,onFocus:()=>this.setState({inputFocused:!0}),onBlur:()=>this.setState({inputFocused:!1})},"option-input"),u("span",{className:"ml-2"})]},"cs-custom-container")),a.push(u("hr",{className:"mb-2"},"option-end")),a}render(){const{disabled:e,invalid:t,value:n,"data-testid":s}=this.props,{menuIsOpen:i}=this.state;let{popperOptions:o}=this.props;return o={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...o},u("div",{className:"input-group cs-container context-menu",ref:this.csContainer,"data-testid":s,children:u("div",{className:z("input-group-append cs-dropdown",{"cs-dropdown-invalid":t}),children:T("button",{type:"button",className:z("btn cs-btn form-control",{"cs-btn-invalid":t}),ref:this.button,onClick:this.toggleMenu,disabled:e,children:[u("span",{className:z({"text-muted":n===null}),children:this.getSelectedText()}),u("span",{children:u(G,{icon:Ko,className:"cs-caret"})}),u(An,{isShown:i,actions:{menuElement:this.renderMenuElement()},popperOptions:o,popperClassName:"CustomTimeSelect",onMenuOpened:this.handleMenuOpened,onMenuClosed:this.handleMenuExited,menuStyle:{maxWidth:"100rem"}})]})})})}};let Jo=rn;Jo.MENU_NAVIGATION_DIRECTION=Ql;Jo.DROP_DOWN_MENU_HEIGHT=125;Jo.defaultProps={onChange(){},value:null,disabled:!1,popperOptions:{},icon:rs,customText:"Custom",placeholder:"Select a time",valueToTime:e=>e===null?0:Math.round(e/1e3),timeToValue:e=>e*1e3,invalid:!1,"data-testid":void 0};class Wd extends R.exports.PureComponent{constructor(t){super(t),this.searchInput=Q.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=Tt(this.sendUpdate.bind(this),t.debounceMs),this.state={value:t.value}}componentDidUpdate(t){const{value:n}=this.props;t.value!==n&&this.setState({value:n})}focus(){var t;(t=this.searchInput.current)==null||t.focus()}handleChange(t){this.setState({value:t.target.value},this.sendUpdate)}sendUpdate(){const{onChange:t}=this.props,{value:n}=this.state;t(n)}render(){const{placeholder:t,className:n,matchCount:s,id:i,"data-testid":o}=this.props,{value:r}=this.state;return u(_n,{value:r,placeholder:t,onChange:this.handleChange,className:n,matchCount:s,ref:this.searchInput,id:i,"data-testid":o})}}Wd.defaultProps={placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0};const zd=({className:e="",show:t=!0,"data-testid":n})=>T("div",{className:z("dh-loader",e,{show:t}),"data-testid":n,children:[u("svg",{className:"dh-outer-shape",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("path",{d:"M82.7429,0L82.7429,41.3714L45.2571,41.3714L45.2571,0L0,0L0,128L45.2571,128L45.2571,86.6286L82.5143,86.6286L82.5143,128L128,128L128,0L82.7429,0ZM41.3714,124.114L4.11429,124.114L4.11429,86.6286L41.3714,86.6286L41.3714,124.114ZM41.3714,82.7429L4.11429,82.7429L4.11429,45.2571L41.3714,45.2571L41.3714,82.7429ZM41.3714,41.3714L4.11429,41.3714L4.11429,4.11429L41.3714,4.11429L41.3714,41.3714ZM45.2571,82.7429L45.2571,45.2571L82.5143,45.2571L82.5143,82.5143L45.2571,82.5143ZM124.114,124.114L86.6286,124.114L86.6286,86.6286L123.886,86.6286L123.886,124.114ZM124.114,82.7429L86.6286,82.7429L86.6286,45.2571L123.886,45.2571L123.886,82.7429ZM86.6286,41.3714L86.6286,4.11429L123.886,4.11429L123.886,41.3714L86.6286,41.3714Z",fill:"#f0f0ee"})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-3",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.3438",height:"37.6389",fill:"#5189e5",transform:"translate(-21.9838,29.7957) translate(21.9838,15.3027)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-2",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.2755",height:"37.4675",fill:"#5189e5",transform:"translate(-21.9838,69.7957) translate(22.0822,16.7783)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-5",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.3512",height:"41.3781",fill:"#35618c",transform:"translate(18.0162,72.7957) translate(23.1643,13.7278)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-6",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.2483",height:"37.5869",fill:"#35618c",transform:"translate(59.0162,29.7957) translate(23.6379,15.3564)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-7",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.5664",height:"41.2747",fill:"#35618c",transform:"translate(17.0162,-13.2043) translate(24.2531,13.2043)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-4",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.2854",height:"37.3014",fill:"#5189e5",transform:"translate(-21.9838,-13.2043) translate(22.0822,17.1792)"})})})})]});const $d=te.module("ItemListItem"),jl=class extends R.exports.Component{constructor(e){super(e),this.handleBlur=this.handleBlur.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleClick=this.handleClick.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleDragStart=this.handleDragStart.bind(this),this.handleDrag=this.handleDrag.bind(this),this.handleDragOver=this.handleDragOver.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.handleDrop=this.handleDrop.bind(this),this.handleDoubleClick=this.handleDoubleClick.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.itemRef=Q.createRef()}static handleKeyDown(){return $d.log("ItemListItem.handleKeyDown false"),!1}handleBlur(e){const{itemIndex:t,onBlur:n}=this.props;n(t,e)}handleFocus(e){const{itemIndex:t,onFocus:n}=this.props;n(t,e)}handleClick(e){const{itemIndex:t,onClick:n}=this.props;n(t,e)}handleContextMenu(e){const{itemIndex:t,onContextMenu:n}=this.props;n(t,e)}handleDragStart(e){const{itemIndex:t,onDragStart:n}=this.props;n(t,e)}handleDrag(e){const{itemIndex:t,onDrag:n}=this.props;n(t,e)}handleDragOver(e){e.preventDefault();const{itemIndex:t,onDragOver:n}=this.props;n(t,e)}handleDragEnd(e){const{itemIndex:t,onDragEnd:n}=this.props;n(t,e)}handleDrop(e){const{itemIndex:t,onDrop:n}=this.props;n(t,e)}handleDoubleClick(e){const{itemIndex:t,onDoubleClick:n}=this.props;n(t,e)}handleMouseMove(e){const{itemIndex:t,onMouseMove:n}=this.props;n(t,e)}handleMouseDown(e){const{itemIndex:t,onMouseDown:n}=this.props;n(t,e)}handleMouseUp(e){const{itemIndex:t,onMouseUp:n}=this.props;n(t,e)}render(){const{isDraggable:e,isFocused:t,isSelected:n,style:s,children:i,"data-testid":o}=this.props;return u("div",{className:z("item-list-item",{active:n},{"is-focused":t},{"is-draggable":e}),onKeyDown:jl.handleKeyDown,onContextMenu:this.handleContextMenu,onClick:this.handleClick,onDrag:this.handleDrag,onDragStart:this.handleDragStart,onDragOver:this.handleDragOver,onDragEnd:this.handleDragEnd,onDrop:this.handleDrop,onDoubleClick:this.handleDoubleClick,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseUp:this.handleMouseUp,tabIndex:-1,ref:this.itemRef,role:"presentation",style:s,onFocus:this.handleFocus,onBlur:this.handleBlur,draggable:e,"data-testid":o,children:i})}};let Zl=jl;Zl.defaultProps={children:null,isDraggable:!1,isFocused:!1,isSelected:!1,itemIndex:0,disableSelect:!1,"data-testid":void 0,onBlur(){},onClick(){},onContextMenu(){},onDragStart(){},onDrag(){},onDragOver(){},onDragEnd(){},onDrop(){},onDoubleClick(){},onFocus(){},onMouseDown(){},onMouseMove(){},onMouseUp(){},style:{}};const Ur=te.module("ItemList"),Ts=class extends R.exports.PureComponent{constructor(e){super(e),this.getItemSelected=ue((s,i)=>$t.isSelected(i,s),{max:Ts.CACHE_SIZE}),this.getCachedItem=ue((s,i,o,r,l,a,c,d)=>{const h=a({item:o,itemIndex:s,isFocused:r,isSelected:l,style:c});return u(Zl,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:d,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:r,isSelected:l,itemIndex:s,style:c,children:h},i)},{max:Ts.CACHE_SIZE}),this.getOuterElement=ue(s=>{const i=Q.forwardRef((o,r)=>u("div",{ref:r,tabIndex:-1,onKeyDown:s,role:"presentation",...o}));return i.displayName="ItemListOuterElement",i}),this.getInnerElement=ue(()=>{const s=Q.forwardRef((i,o)=>u("div",{className:"item-list-inner-element",ref:o,...i}));return s.displayName="ItemListInnerElement",s}),this.getItemData=ue((s,i,o)=>({items:s,selectedRanges:i,renderItem:o})),this.handleItemBlur=this.handleItemBlur.bind(this),this.handleItemContextMenu=this.handleItemContextMenu.bind(this),this.handleItemFocus=this.handleItemFocus.bind(this),this.handleItemDoubleClick=this.handleItemDoubleClick.bind(this),this.handleItemMouseDown=this.handleItemMouseDown.bind(this),this.handleItemMouseMove=this.handleItemMouseMove.bind(this),this.handleItemMouseUp=this.handleItemMouseUp.bind(this),this.handleItemsRendered=this.handleItemsRendered.bind(this),this.handleWindowMouseUp=this.handleWindowMouseUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleScroll=this.handleScroll.bind(this),this.handleResize=this.handleResize.bind(this),this.renderInnerElement=this.renderInnerElement.bind(this),this.list=Q.createRef(),this.listContainer=Q.createRef();const{isStickyBottom:t,selectedRanges:n}=e;this.state={focusIndex:null,mouseDownIndex:null,selectedRanges:n,overscanStartIndex:0,height:null,isDragging:!1,isStuckToBottom:t,scrollOffset:null}}static renderItem({item:e}){return u("div",{className:"item-list-item-content",children:e&&(e.displayValue||e.value||`${e}`)})}componentDidMount(){const{isStickyBottom:e}=this.props;e&&!this.isListAtBottom()&&this.scrollToBottom()}componentDidUpdate(e,t){const{selectedRanges:n}=this.props,{focusIndex:s,isStuckToBottom:i,scrollOffset:o,height:r,selectedRanges:l}=this.state;if(i&&!this.isListAtBottom()&&this.scrollToBottom(),(o!==t.scrollOffset||r!==t.height)&&this.sendViewportUpdate(),n!==e.selectedRanges&&n!==l)this.setSelectedRanges(n);else if(l!==t.selectedRanges){const{onSelectionChange:a}=this.props;a(l)}if(s!==t.focusIndex){const{onFocusChange:a}=this.props;a(s)}}componentWillUnmount(){window.removeEventListener("mouseup",this.handleWindowMouseUp)}focus(){var e;(e=this.listContainer.current)==null||e.focus()}getElement(e){if(this.listContainer.current==null)return null;const{focusSelector:t}=this.props,{overscanStartIndex:n}=this.state,s=this.listContainer.current.querySelectorAll(t),i=e-n;return s[i]}focusItem(e){const{disableSelect:t}=this.props;if(t)return;this.setState({focusIndex:e});const n=this.getElement(e);n instanceof HTMLElement&&n.focus()}scrollToItem(e){const t=this.getElement(e);t!=null&&t.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){const{selectedRanges:n}=this.state,i=$t.isSelected(n,e)||Se.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,i,!1)}handleItemDoubleClick(e,t){const{isDoubleClickSelect:n,onSelect:s}=this.props;n&&this.setState(({selectedRanges:i})=>({selectedRanges:$t.selectRange(i,[e,e])}),()=>{s(e,t)})}handleItemMouseDown(e,t){const{selectedRanges:n}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(t.button===2&&n.length===0){this.focusItem(e),this.selectItem(e);return}t.button!=null&&t.button!==0||(this.setState({mouseDownIndex:e}),window.addEventListener("mouseup",this.handleWindowMouseUp))}}handleItemBlur(e,t){Ur.debug2("item blur",e,t.currentTarget,t.relatedTarget),(!t.relatedTarget||this.listContainer.current&&t.relatedTarget instanceof HTMLElement&&!this.listContainer.current.contains(t.relatedTarget))&&this.setState({focusIndex:null})}handleItemFocus(e,t){Ur.debug2("item focus",e,t.target),this.setState(n=>{const{focusIndex:s}=n;return s!==e?{focusIndex:e}:null})}handleItemMouseMove(e,t){const{isDragSelect:n,isMultiSelect:s,disableSelect:i}=this.props,{mouseDownIndex:o,selectedRanges:r}=this.state;o==null||i||(this.setState({isDragging:!0}),(n||o===e)&&(this.focusItem(e),s?(!n&&!this.getItemSelected(e,r)&&!Se.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(o,e),Math.max(o,e)])):this.toggleSelect(e,t.shiftKey,Se.isModifierKeyDown(t),!1)))}handleItemMouseUp(e,t){const{isDeselectOnClick:n,isDoubleClickSelect:s,onSelect:i}=this.props,{mouseDownIndex:o,isDragging:r}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(o===e&&!r){const l=t.shiftKey,a=Se.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,l,a,n),!s&&!l&&!a&&i(e,t)}this.resetMouseState()}}handleItemsRendered({overscanStartIndex:e}){this.setState({overscanStartIndex:e})}handleResize({height:e}){this.setState({height:e})}handleMouseLeave(){this.setState({mouseDownIndex:null})}handleWindowMouseUp(){this.resetMouseState(),window.removeEventListener("mouseup",this.handleWindowMouseUp)}handleKeyDown(e){var r;const{isMultiSelect:t,itemCount:n,onSelect:s}=this.props,{focusIndex:i}=this.state;let o=i;if(e.key==="Enter"||e.key===" "){!t&&o!=null&&this.setState({selectedRanges:[[o,o]]},()=>{o!=null&&s(o,e)});return}if(e.key==="ArrowUp")o!=null&&o>=0?o=Math.max(0,o-1):o=n-1;else if(e.key==="ArrowDown")o!=null&&o>=0?o=Math.min(o+1,n-1):o=0;else return;if(i!==o){e.stopPropagation(),e.preventDefault(),this.focusItem(o);const{selectedRanges:l}=this.state;if(e.shiftKey&&l.length>0){const a=l[l.length-1];this.selectRange([Math.min(o,a[0]),Math.max(o,a[1])])}else this.deselectAll(),o!==null?this.selectItem(o):(r=this.listContainer.current)==null||r.focus();this.scrollIntoView(o)}}handleScroll({scrollUpdateWasRequested:e,scrollOffset:t}){this.setState(n=>{if(e)return{scrollOffset:t};const{isStickyBottom:s}=this.props,{height:i}=n;return{isStuckToBottom:s&&this.isListAtBottom({scrollOffset:t,height:i}),scrollOffset:t}})}resetMouseState(){this.setState({mouseDownIndex:null,isDragging:!1})}scrollToBottom(){const{itemCount:e}=this.props;this.list.current&&this.list.current.scrollToItem(e)}scrollIntoView(e){this.list.current&&this.list.current.scrollToItem(e)}toggleSelect(e,t,n,s=!0){const{isMultiSelect:i}=this.props,{selectedRanges:o}=this.state;if(i&&t&&o.length>0){const r=o[o.length-1];this.selectRange([Math.min(r[0],e),Math.max(e,r[1])])}else i&&o.length===1&&o[0][0]===e&&o[0][1]===e?s&&this.deselectItem(e):i&&n?this.getItemSelected(e,o)?s&&this.deselectItem(e):this.selectItem(e):(this.deselectAll(),this.selectItem(e))}deselectAll(){const{itemCount:e}=this.props;this.deselectRange([0,e])}deselectItem(e){this.deselectRange([e,e])}deselectRange(e){$t.validateRange(e),this.setState(({selectedRanges:t})=>({selectedRanges:$t.deselectRange(t,e)}))}selectItem(e){const{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){$t.validateRange(e),this.setState(({selectedRanges:t})=>({selectedRanges:$t.selectRange(t,e)}))}setSelectedRanges(e){this.setState({selectedRanges:e})}sendViewportUpdate(){const{scrollOffset:e,height:t}=this.state;if(e!=null&&t!=null){const{onViewportChange:n,rowHeight:s}=this.props,i=Math.floor(e/s),o=i+Math.ceil(t/s);n(i,o)}}isListAtBottom({scrollOffset:e,height:t}=this.state){if(t==null||e==null)return!1;const{itemCount:n,rowHeight:s}=this.props;return e+t>=n*s}renderInnerElement({index:e,style:t}){const{items:n,offset:s,renderItem:i,disableSelect:o}=this.props,{focusIndex:r,selectedRanges:l}=this.state;if(e<s||e>=s+n.length)return null;const a=n[e-s];return this.getCachedItem(e,e,a,e===r&&!o,this.getItemSelected(e,l),i,t,o)}render(){const{items:e,itemCount:t,overscanCount:n,renderItem:s,rowHeight:i,"data-testid":o}=this.props,{selectedRanges:r}=this.state;return u(Ya,{className:"item-list-auto-sizer",onResize:this.handleResize,children:({width:l,height:a})=>u(Qa,{className:"item-list-scroll-pane",height:a,width:l,itemCount:t,itemSize:i,itemData:this.getItemData(e,r,s),onScroll:this.handleScroll,onItemsRendered:this.handleItemsRendered,ref:this.list,outerElementType:this.getOuterElement(this.handleKeyDown),outerRef:this.listContainer,innerElementType:this.getInnerElement(),overscanCount:n,"data-testid":o,children:this.renderInnerElement})})}};let jt=Ts;jt.CACHE_SIZE=1e3;jt.DEFAULT_ROW_HEIGHT=20;jt.DEFAULT_OVERSCAN=10;jt.defaultProps={offset:0,items:[],rowHeight:Ts.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:Ts.DEFAULT_OVERSCAN,renderItem:Ts.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0};const is=class extends R.exports.PureComponent{constructor(e){super(e),this.getCachedDraggableItem=ue((t,n,s,i,o,r,l,a)=>u(Wi,{draggableId:is.getDraggableId(t,i),index:i,isDragDisabled:l,children:c=>u("div",{role:"menuitem",className:"draggable-item-list-item",ref:c.innerRef,tabIndex:-1,...c.draggableProps,...c.dragHandleProps,children:n({item:s,itemIndex:i,isFocused:o,isSelected:r,style:a,isClone:!1})})},i),{max:jt.CACHE_SIZE}),this.getCachedRenderDraggableItem=ue((t,n,s)=>({item:i,itemIndex:o,isFocused:r,isSelected:l,style:a})=>this.getCachedDraggableItem(t,s,i,o,r,l,n,a),{max:1}),this.getCachedRenderClone=ue((t,n,s,i)=>(o,r,l)=>{const{selectedCount:a}=this.state,{index:c}=l.source,d=n[c-s];return u("div",{className:z("draggable-item-list-dragging-item-container",t),...o.draggableProps,...o.dragHandleProps,ref:o.innerRef,children:u("div",{className:z("draggable-item-list-dragging-item",{"two-dragged":a===2},{"multiple-dragged":a>2}),children:i({item:d,itemIndex:c,isFocused:!1,isSelected:!0,style:{},isClone:!0,selectedCount:a})})})},{max:1}),this.handleSelectionChange=this.handleSelectionChange.bind(this),this.itemList=Q.createRef(),this.state={selectedCount:0}}static renderHandle(){return T("div",{children:[u(me,{children:"Drag to re-order"}),u(G,{icon:Gi})]})}static renderBadge({text:e}){return e?u("span",{className:"number-badge",children:e}):null}static renderTextItem({text:e,badgeText:t="",className:n=""}){return T("div",{className:z("item-list-item-content","draggable-item-list-item-content",n),children:[u("span",{className:"title",children:e}),is.renderBadge({text:t}),is.renderHandle()]})}static renderItem({item:e,isClone:t,selectedCount:n}){const s=e&&(e.displayValue||e.value||`${e}`),i=t?`${n}`:"",o=t?"item-list-item-clone":"";return is.renderTextItem({text:s,badgeText:i,className:o})}static getDraggableId(e,t){return`${e}/${t}`}static getDraggableIndex(e){return parseInt(e.split("/").pop()||"",10)}selectItem(e){var t;(t=this.itemList.current)==null||t.selectItem(e)}focusItem(e){var t;(t=this.itemList.current)==null||t.focusItem(e)}scrollToItem(e){var t;(t=this.itemList.current)==null||t.scrollToItem(e)}handleSelectionChange(e){this.setState({selectedCount:$t.count(e)});const{onSelectionChange:t}=this.props;t(e)}render(){const{className:e,draggablePrefix:t,draggingItemClassName:n,droppableId:s,isDoubleClickSelect:i,isDragDisabled:o,isDropDisabled:r,isMultiSelect:l,isStickyBottom:a,itemCount:c,items:d,offset:h,onFocusChange:m,onSelect:p,onViewportChange:g,renderItem:f,rowHeight:b,selectedRanges:C,style:w,"data-testid":S}=this.props;return u(Xs,{isDropDisabled:r,droppableId:s,mode:"virtual",renderClone:this.getCachedRenderClone(n,d,h,f),"data-testid":S,children:(I,v)=>u("div",{role:"menu",className:z("draggable-item-list",e,{"is-drop-disabled":r,"is-drag-disabled":o,"is-dragging-from-this":v.draggingFromThisWith,"is-dragging-over":v.isDraggingOver,"is-dropping":v.draggingOverWith}),style:w,ref:I.innerRef,...I.droppableProps,children:u(jt,{focusSelector:".draggable-item-list-item",isDoubleClickSelect:i,isDragSelect:!1,isMultiSelect:l,isStickyBottom:a,itemCount:c,items:d,onFocusChange:m,onSelect:p,onSelectionChange:this.handleSelectionChange,onViewportChange:g,offset:h,ref:this.itemList,renderItem:this.getCachedRenderDraggableItem(t,o,f),rowHeight:b,selectedRanges:C})})})}};let bt=is;bt.DEFAULT_ROW_HEIGHT=30;bt.defaultProps={className:"",draggingItemClassName:"",offset:0,items:[],rowHeight:is.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!0,isDropDisabled:!1,isDragDisabled:!1,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,style:null,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},renderItem:is.renderItem,selectedRanges:[],draggablePrefix:"draggable-item",droppableId:"droppable-item-list","data-testid":void 0};class ht{static reorder(t,n,s,i){const o=t===s?ht.adjustDestinationIndex(i,n):i,r=ht.removeItems(t,n);return s.splice(o,0,...r),r}static removeItems(t,n){const s=[],i=n.map((o,r)=>({range:o,index:r})).sort((o,r)=>r.range[0]-o.range[0]);for(let o=0;o<i.length;o+=1){const{range:r,index:l}=i[o],[a,c]=r;s[l]=t.splice(a,c-a+1)}return ja(s)}static adjustDestinationIndex(t,n){let s=t;for(let i=0;i<n.length;i+=1){const[o,r]=n[i];if(o>t)break;s-=Math.min(r,t-1)-o+1}return s}static startDragging(){document.documentElement.classList.add("drag-pointer-events-none")}static stopDragging(){document.documentElement.classList.remove("drag-pointer-events-none")}}const Di=class extends R.exports.Component{static isParentSelected(e,t){const n=t.get(e);if(n===void 0)return!1;if(typeof n=="boolean")return n;const s=Array.from(n.values()).includes(!0),i=Array.from(n.values()).includes(!1);return s&&i?null:s}constructor(e){super(e),this.toggleMenu=this.toggleMenu.bind(this),this.toggleValueFor=this.toggleValueFor.bind(this),this.selectAll=this.selectAll.bind(this),this.clear=this.clear.bind(this),this.state={menuIsOpen:!1}}toggleMenu(e){e.stopPropagation(),e.preventDefault(),this.setState(t=>{const{menuIsOpen:n}=t;return{menuIsOpen:!n}})}toggleValueFor(e,t){const{valueMap:n,onUpdateValueMap:s}=this.props,i=new Map(n),o=i.get(e);if(o instanceof Map){const l=new Map(o);if(t!=null)l.set(t,!o.get(t));else{const a=!Di.isParentSelected(e,i);o.forEach((c,d)=>l.set(d,a))}i.set(e,l)}else i.set(e,!o);const r=i.get(e);t===void 0&&r!==void 0&&typeof r!="boolean"&&(Di.isParentSelected(e,n)?r.forEach((l,a)=>r.set(a,!1)):r.forEach((l,a)=>r.set(a,!0))),s(i)}setAllValues(e){const{valueMap:t,onUpdateValueMap:n}=this.props,s=new Map;t.forEach((i,o)=>{if(typeof i=="boolean")s.set(o,e);else{const r=new Map;i.forEach((l,a)=>r.set(a,e)),s.set(o,r)}}),n(s)}selectAll(){this.setAllValues(!0)}clear(){this.setAllValues(!1)}renderMenuElement(){const{valueMap:e,"data-testid":t}=this.props;return T("div",{className:"hcm-menu-container",children:[Array.from(e.entries()).map(([n,s])=>T("div",{children:[u(It,{className:"hcm-parent",checked:Di.isParentSelected(n,e),onChange:()=>this.toggleValueFor(n),children:n}),s!==void 0&&typeof s!="boolean"&&Array.from(s.entries()).map(([i,o])=>u(It,{className:"hcm-child",checked:o,onChange:()=>this.toggleValueFor(n,i),children:i},i))]},n)),u("button",{type:"button",className:"btn btn-link",onClick:this.selectAll,"data-testid":t?`${t}-btn-select-all`:void 0,children:"Select All"}),u("button",{type:"button",className:"btn btn-link",onClick:this.clear,"data-testid":t?`${t}-btn-clear`:void 0,children:"Clear"})]})}render(){const{menuText:e,className:t,icon:n,id:s,"data-testid":i}=this.props,{menuIsOpen:o}=this.state;return T("button",{type:"button",className:z("btn hcm-btn",t),onClick:this.toggleMenu,id:s,"data-testid":i,children:[T("span",{children:[n&&u(G,{icon:n,className:"hcm-icon mr-1"}),e]}),u(G,{icon:Ko,className:"hcm-icon ml-1"}),u(fn,{options:{placement:"bottom"},isShown:o,onExited:()=>{this.setState({menuIsOpen:!1})},closeOnBlur:!0,interactive:!0,children:this.renderMenuElement()})]})}};let Gd=Di;Gd.defaultProps={className:"",icon:null,id:"","data-testid":void 0};const Jl=({isLoaded:e=!1,isLoading:t=!0,errorMessage:n=null,"data-testid":s})=>u(rt,{in:!!n||!e||t,timeout:Rt.transitionMs,classNames:e?"fade":"",mountOnEnter:!0,unmountOnExit:!0,children:u("div",{className:"fill-parent-absolute","data-testid":s,children:u("div",{className:z("iris-panel-message-overlay","fill-parent-absolute",{"iris-panel-scrim-background":e}),children:T("div",{className:"message-content",children:[T("div",{className:"message-icon",children:[t&&u(Pt,{}),!t&&n&&u(G,{icon:cs})]}),u("div",{className:"message-text",children:n})]})})})});const ea=({on:e,id:t,className:n,isInvalid:s,disabled:i=!1,onClick:o,"data-testid":r})=>u("button",{type:"button",className:z("btn","btn-switch",n,{active:e},{"is-invalid":s}),id:t,onClick:o,disabled:i,"data-testid":r,children:u("div",{className:"handle"})});function Br(e){return e.isOn!==void 0}const qd=({item:e,onSelect:t=()=>{},"data-testid":n})=>{const{icon:s,subtitle:i,title:o}=e,r=R.exports.useMemo(()=>Br(e)?()=>{e.onChange(!e.isOn)}:t,[e,t]);return T("div",{className:"btn btn-navigation-menu-item","data-testid":`menu-item-${o}`,onClick:r,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&r()},tabIndex:0,role:"menuitem",children:[s&&u("div",{className:"icon",children:u(G,{icon:s})}),u("div",{className:"title",children:o}),i&&u("div",{className:"shortcut",children:i}),u("div",{className:"accessory","data-testid":n,children:Br(e)&&u(ea,{on:e.isOn,onClick:l=>{l.stopPropagation(),r()}})||u(G,{icon:Nl})})]})};const ta=({items:e,onSelect:t=()=>{},"data-testid":n})=>u("div",{className:"navigation-menu-view","data-testid":n,children:u("ul",{className:"navigation-menu-list",children:e.map((s,i)=>u("li",{children:u(qd,{item:s,onSelect:()=>{t(i)}})},s.title))})});const Wr=({children:e,onBack:t,onClose:n,title:s,"data-testid":i})=>T("div",{className:"navigation-page","data-testid":i,children:[T("div",{className:"navigation-title-bar",children:[u("div",{className:"navigation-left-buttons",children:t!==void 0&&T("button",{className:"btn btn-link btn-back","data-testid":"btn-page-back",type:"button",onClick:t,children:[u(G,{icon:Gc}),"Back"]})}),u("div",{className:"navigation-title",children:s}),u("div",{className:"navigation-right-buttons",children:n!==void 0&&u("button",{className:"btn btn-link btn-link-icon btn-close px-2 m-1","data-testid":"btn-page-close",type:"button",onClick:n,children:u(G,{icon:$i})})})]}),u("div",{className:"navigation-content",children:e})]});const Kd=({children:e,"data-testid":t})=>{const n=R.exports.useMemo(()=>Q.Children.toArray(e),[e]),s=jo(n),[i,o]=R.exports.useState(n[n.length-1]),[r,l]=R.exports.useState(null),[a,c]=R.exports.useState(null);R.exports.useEffect(function(){if(s===void 0||n===s)return;const p=n[n.length-1];n.length===s.length||s.length===0||r!==null||a!==null?r!==null&&p!==r?l(p):p!==a&&p!==i&&o(p):n.length>s.length?l(p):n.length<s.length&&(o(p),c(s[s.length-1]))},[n,s,r,a,i]);const d=R.exports.useCallback(()=>{o(r),l(null)},[r]),h=R.exports.useCallback(()=>{c(null)},[]);return T("div",{className:"navigation-stack",children:[u("div",{className:"main-view","data-testid":t,children:i}),u(rt,{in:a!=null,timeout:Rt.transitionMidMs,classNames:"slide-right",onEntered:h,children:u(Ne,{children:a&&u("div",{className:"popping-view",children:a})})}),u(rt,{in:r!=null,timeout:Rt.transitionMidMs,classNames:"slide-left",onEntered:d,children:u(Ne,{children:r&&u("div",{className:"pushing-view",children:r})})})]})},Xd=({children:e,disabled:t,value:n,"data-testid":s})=>u("option",{value:n,disabled:t,"data-testid":s,children:e}),er=e=>{const{children:t,disabled:n=!1,name:s,onChange:i,value:o="","data-testid":r}=e,[l]=R.exports.useState(s||Qt());return u(Ne,{children:Q.Children.map(t,a=>a?Q.cloneElement(a,{name:l,onChange:a.props.onChange||i,checked:o===a.props.value,disabled:a.props.disabled||n,"data-testid":r}):null)})},gn=Q.forwardRef((e,t)=>{const{checked:n,children:s,className:i="",disabled:o=!1,inputClassName:r="",isInvalid:l=!1,labelClassName:a="",name:c,onChange:d,value:h,"data-testid":m}=e,[p]=R.exports.useState(Qt());return T("div",{className:z("custom-control custom-radio",i),children:[u("input",{type:"radio",id:p,"data-testid":m,name:c,ref:t,className:z("custom-control-input",r,{"is-invalid":l}),checked:n,disabled:o,value:h,onChange:d}),u("label",{className:z("custom-control-label",a),htmlFor:p,children:s})]})});gn.displayName="RadioItem";gn.defaultProps={checked:void 0,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const Yd=({children:e,onBlur:t,onChange:n,className:s,defaultValue:i,name:o,value:r,disabled:l,"data-testid":a})=>{const c=R.exports.useCallback(d=>{n(d.target.value)},[n]);return u("select",{className:z("custom-select",s),onBlur:t,onChange:c,defaultValue:i,value:r,name:o,disabled:l,"data-testid":a,children:e})};class na extends R.exports.PureComponent{constructor(t){super(t),this.getCachedItem=ue((n,s,i,o,r,l,a)=>{const c={height:r},d=o!=null?o:i;return u("li",{className:"value-list-item",style:c,children:u(It,{checked:l,disabled:a,onChange:()=>this.handleSelect(n),children:d})},s)},{max:1e3}),this.getCachedItems=ue((n,s,i,o)=>{const r=[];for(let l=0;l<n.length;l+=1){const a=n[l],{value:c,displayValue:d,isSelected:h}=a,m=i+l,p=m,g=this.getCachedItem(m,p,c,d,s,h,o);r.push(g)}return r},{max:1}),this.handleScroll=this.handleScroll.bind(this),this.handleSelect=this.handleSelect.bind(this),this.list=Q.createRef(),this.topRow=null,this.bottomRow=null}componentDidMount(){this.sendViewportUpdate()}componentDidUpdate(){this.sendViewportUpdate()}handleScroll(){this.sendViewportUpdate()}handleSelect(t){const{items:n,offset:s,onSelect:i}=this.props,o=t-s;if(o>=0&&o<n.length){const r=n[o],{value:l}=r;i(t,l)}else i(t,null)}sendViewportUpdate(){if(!this.list.current||this.list.current.clientHeight===0)return;const{onViewportChange:t,rowHeight:n}=this.props,s=this.list.current.scrollTop,i=s+this.list.current.clientHeight,o=Math.floor(s/n),r=Math.ceil(i/n);(this.topRow!==o||this.bottomRow!==r)&&(this.topRow=o,this.bottomRow=r,t(o,r))}render(){const{className:t,disabled:n,isInvalid:s,items:i,itemCount:o,offset:r,rowHeight:l,"data-testid":a}=this.props,c=this.getCachedItems(i,l,r,n);return u("div",{className:z("select-value-list-scroll-pane h-100 w-100",{"is-invalid":s},t),onScroll:this.handleScroll,ref:this.list,"data-testid":a,children:u("div",{className:"select-value-list",style:{height:o*l},children:u("ol",{className:"select-value-list-content",style:{position:"absolute",height:i.length*l,top:r*l,left:0},children:c})})})}}na.defaultProps={disabled:!1,rowHeight:21,"data-testid":void 0};const zr=te.module("Shortcut");var ie=(e=>(e.CTRL="MODIFIER_CTRL",e.CMD="MODIFIER_CMD",e.ALT="MODIFIER_ALT",e.OPTION="MODIFIER_OPTION",e.SHIFT="MODIFIER_SHIFT",e))(ie||{}),ae=(e=>(e.A="A",e.B="B",e.C="C",e.D="D",e.E="E",e.F="F",e.G="G",e.H="H",e.I="I",e.J="J",e.K="K",e.L="L",e.M="M",e.N="N",e.O="O",e.P="P",e.Q="Q",e.R="R",e.S="S",e.T="T",e.U="U",e.V="V",e.W="W",e.X="X",e.Y="Y",e.Z="Z",e.ZERO="0",e.ONE="1",e.TWO="2",e.THREE="3",e.FOUR="4",e.FIVE="5",e.SIX="6",e.SEVEN="7",e.EIGHT="8",e.NINE="9",e.BACKSPACE="Backspace",e.ESCAPE="Escape",e.ENTER="Enter",e.DELETE="Delete",e.SLASH="/",e.QUESTION_MARK="?",e.BACKSLASH="\\",e.PIPE="|",e.MINUS="-",e.UNDERSCORE="_",e.EQUALS="=",e.PLUS="+",e.BACKTICK="`",e.TILDE="~",e.COMMA=",",e.LEFT_CHEVRON="<",e.PERIOD=".",e.RIGHT_CHEVRON=">",e.SEMICOLON=";",e.COLON=":",e.SINGLE_QUOTE="'",e.DOUBLE_QUOTE='"',e.LEFT_BRACKET="[",e.RIGHT_BRACKET="]",e.LEFT_CURLY="{",e.RIGHT_CURLY="}",e.F1="F1",e.F2="F2",e.F3="F3",e.F4="F4",e.F5="F5",e.F6="F6",e.F7="F7",e.F8="F8",e.F9="F9",e.F10="F10",e.F11="F11",e.F12="F12",e))(ae||{});const Qd=new Set(["Enter","Delete","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"]),qe=class extends Uo{constructor({id:e,shortcut:t,macShortcut:n,isEditable:s=!0,name:i,tooltip:o}){super(),this.id=e,this.name=i,this.tooltip=o,this.isEditable=s;const l=qe.isMacPlatform?n:t;this.defaultKeyState=qe.createKeyState(l),this.keyState=this.defaultKeyState}static isAllowedKey(e){return Object.values(ae).includes(e)}static isValidKeyState(e){const{keyValue:t}=e;return t===null?!0:!qe.isMacPlatform&&e.metaKey||!qe.isAllowedKey(t)?!1:!(!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey)||Qd.has(t)}static createKeyState(e){const t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(n=>{switch(n){case"MODIFIER_CTRL":t.ctrlKey=!0;break;case"MODIFIER_ALT":case"MODIFIER_OPTION":t.altKey=!0;break;case"MODIFIER_CMD":t.metaKey=!0;break;case"MODIFIER_SHIFT":t.shiftKey=!0;break}}),t}static getKeyStateFromEvent(e){const{key:t,keyCode:n}=e;let s="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?s="":!qe.isAllowedKey(t)&&qe.isAllowedKey(String.fromCharCode(n))?s=String.fromCharCode(n):s=t,{keyValue:s,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey}}static getWindowsDisplayText(e){let t="";return e.ctrlKey&&(t+="Ctrl+"),e.altKey&&(t+="Alt+"),e.shiftKey&&(t+="Shift+"),e.keyValue==="Escape"?t+="Esc":e.keyValue!==null&&(t+=e.keyValue),t}static getMacDisplayText(e){let t="";switch(e.ctrlKey&&(t+="\u2303"),e.altKey&&(t+="\u2325"),e.shiftKey&&(t+="\u21E7"),e.metaKey&&(t+="\u2318"),e.keyValue){case"Enter":t+="\u23CE";break;case"Escape":t+="\u238B";break;case"Backspace":t+="\u232B";break;case"Delete":t+="\u2326";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){var n,s;return((n=e.keyValue)==null?void 0:n.toUpperCase())===((s=t.keyValue)==null?void 0:s.toUpperCase())&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey&&e.shiftKey===t.shiftKey}static getDisplayText(e){return e.keyValue===null?"":qe.isMacPlatform?qe.getMacDisplayText(e):qe.getWindowsDisplayText(e)}getDisplayText(){return qe.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){qe.isValidKeyState(e)?(zr.debug2(`Shortcut ${this.id} updated to ${JSON.stringify(e)}`),this.keyState=e,this.dispatchEvent(new Ee("onUpdate",{detail:this}))):zr.debug2(`Shortcut ${this.id} tried to update to invalid keyState ${JSON.stringify(e)}`)}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return qe.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState(qe.NULL_KEY_STATE)}isNull(){return qe.doKeyStatesMatch(this.keyState,qe.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return qe.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState(qe.getKeyStateFromEvent(e))}};let tr=qe;tr.NULL_KEY_STATE={metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null};tr.isMacPlatform=Se.isMacPlatform();const $r=te.module("ShortcutRegistry");class jd extends Uo{constructor(){super(...arguments),this.shortcutMap=new Map,this.shortcutsByCategory=new Map}createAndAdd(t){const n=new tr(t);return this.add(n)}add(t){var i;const n=this.shortcutMap.get(t.id);if(n)return $r.warn(`Skipping attempt to add duplicate shortcut ID to registry: ${t.id}`),n;$r.debug2(`Adding shortcut to registry: ${t.id}`),t.addEventListener("onUpdate",({detail:o})=>this.dispatchEvent(new Ee("onUpdate",{detail:o})));const s=t.id.split(".")[0];return this.shortcutMap.set(t.id,t),this.shortcutsByCategory.has(s)?(i=this.shortcutsByCategory.get(s))==null||i.push(t):this.shortcutsByCategory.set(s,[t]),t}get(t){return this.shortcutMap.get(t)}getConflictingShortcuts(t){return Array.from(this.shortcutMap.values()).filter(n=>!n.isNull()&&n.matchesKeyState(t))}}const Me=Object.freeze(new jd),nr={COPY:Me.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[ie.CTRL,ae.C],macShortcut:[ie.CMD,ae.C],isEditable:!1}),PASTE:Me.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[ie.CTRL,ae.V],macShortcut:[ie.CMD,ae.V],isEditable:!1}),SAVE:Me.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[ie.CTRL,ae.S],macShortcut:[ie.CMD,ae.S],isEditable:!1}),SELECT_ALL:Me.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[ie.CTRL,ae.A],macShortcut:[ie.CMD,ae.A],isEditable:!1}),LINKER:Me.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[ie.CTRL,ae.L],macShortcut:[ie.CMD,ae.L]}),LINKER_CLOSE:Me.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[ae.ESCAPE],macShortcut:[ae.ESCAPE],isEditable:!1})};const sa=Q.forwardRef((e,t)=>{const{children:n,className:s,disabled:i,isLinked:o,isLinkedSource:r,isInvalid:l,onClick:a,onMouseEnter:c,onMouseLeave:d,style:h,"data-testid":m}=e;return T("button",{ref:t,type:"button",className:z("btn-socketed",{"btn-socketed-linked":o||r},{"btn-socketed-linked-source":r},{"is-invalid":l},s),onClick:a,onMouseEnter:c,onMouseLeave:d,style:h,disabled:i,"data-testid":m,children:[n,u(G,{icon:Al,className:"linked btn-socketed-icon",transform:"down-1"}),u(G,{icon:gd,className:"is-invalid btn-socketed-icon"})]})});sa.displayName="SocketedButton";sa.defaultProps={children:void 0,className:"",disabled:!1,isLinked:!1,isLinkedSource:!1,isInvalid:!1,onClick:void 0,onMouseEnter:void 0,onMouseLeave:void 0,style:void 0,"data-testid":void 0};const Zd="_track_xvu02_28",Jd="_handle_xvu02_11",eh="_ticks_xvu02_96",ia={"handle-size":"15px","popover-width":"90px","time-slider":"_time-slider_xvu02_1","time-slider-popovers":"_time-slider-popovers_xvu02_6","handle-popper":"_handle-popper_xvu02_11","flex-spacer":"_flex-spacer_xvu02_24",track:Zd,"track-fills":"_track-fills_xvu02_35","track-fill":"_track-fill_xvu02_35","track-fill-start":"_track-fill-start_xvu02_53","track-fill-middle":"_track-fill-middle_xvu02_54","track-fill-end":"_track-fill-end_xvu02_57","handle-track":"_handle-track_xvu02_60",handle:Jd,ticks:eh,"tick-labels":"_tick-labels_xvu02_114","tick-label":"_tick-label_xvu02_114","tick-label-wrapper":"_tick-label-wrapper_xvu02_130"};parseInt(ia["handle-size"],10);parseInt(ia["popover-width"],10);Object.freeze({ERROR:"error"});window.$=Tl;window.jQuery=Tl;var ds=(e=>(e.FILTER_CONTROL_CHANGE_CLEARS_ALL_FILTERS="filter-control-change-clears-all-filters",e.LINK_CHANGE_CLEARS_ALL_FILTERS="link-change-clears-all-filters",e))(ds||{});Object.freeze([[ds.FILTER_CONTROL_CHANGE_CLEARS_ALL_FILTERS,!1],[ds.LINK_CHANGE_CLEARS_ALL_FILTERS,!1]]);var we=(e=>(e.COUNT="Count",e.MIN="Min",e.MAX="Max",e.SUM="Sum",e.ABS_SUM="AbsSum",e.VAR="Var",e.AVG="Avg",e.STD="Std",e.FIRST="First",e.LAST="Last",e.SKIP="Skip",e.COUNT_DISTINCT="CountDistinct",e.DISTINCT="Distinct",e.UNIQUE="Unique",e))(we||{});class ke{static isValid(t){return!0}static isSameFormat(t,n){throw new Error("isSameFormat not implemented")}static makeFormat(t,n,s){return{label:t,formatString:n,type:s}}format(t,n){return""}}ke.TYPE_GLOBAL="type-global";ke.TYPE_CONTEXT_PRESET="type-context-preset";ke.TYPE_CONTEXT_CUSTOM="type-context-custom";class th extends ke{format(t){switch(t){case 1:case!0:return"true";case 0:case!1:return"false";default:return""}}}class nh extends ke{format(t){return String.fromCharCode(t)}}const{dh:y}=globalThis,Xi=D.exports.shape({name:D.exports.string.isRequired,type:D.exports.string.isRequired,description:D.exports.string,constituentType:D.exports.string}),oa=D.exports.shape({not:D.exports.func.isRequired,and:D.exports.func.isRequired,or:D.exports.func.isRequired}),sh=D.exports.shape({asc:D.exports.func.isRequired,desc:D.exports.func.isRequired,abs:D.exports.func.isRequired,column:Xi.isRequired,direction:D.exports.string.isRequired,isAbs:D.exports.bool.isRequired}),ih=D.exports.shape({columns:D.exports.arrayOf(Xi).isRequired,customColumns:D.exports.arrayOf(D.exports.string).isRequired,filter:D.exports.arrayOf(oa),addEventListener:D.exports.func.isRequired,removeEventListener:D.exports.func.isRequired,size:D.exports.number.isRequired,sort:D.exports.arrayOf(D.exports.any),copy:D.exports.func.isRequired,applyFilter:D.exports.func.isRequired,applySort:D.exports.func.isRequired,applyCustomColumns:D.exports.func.isRequired,description:D.exports.string}),oh=D.exports.shape({columns:D.exports.arrayOf(Xi),filter:D.exports.arrayOf(D.exports.any),isExpanded:D.exports.func.isRequired,saveExpandedState:D.exports.func.isRequired,addEventListener:D.exports.func.isRequired,removeEventListener:D.exports.func.isRequired,size:D.exports.number.isRequired,sort:D.exports.arrayOf(D.exports.any),applyFilter:D.exports.func.isRequired,applySort:D.exports.func.isRequired}),Ni=D.exports.shape({name:D.exports.string.isRequired,type:D.exports.string.isRequired}),rh=D.exports.shape({created:D.exports.arrayOf(Ni).isRequired,updated:D.exports.arrayOf(Ni).isRequired,removed:D.exports.arrayOf(Ni).isRequired}),lh=D.exports.shape({groupingColumns:D.exports.arrayOf(D.exports.string),aggregations:D.exports.shape({}),includeConstituents:D.exports.bool,includeOriginalColumns:D.exports.bool,includeDescriptions:D.exports.bool}),ah=D.exports.shape({addEventListener:D.exports.func.isRequired,removeEventListener:D.exports.func.isRequired,onLogMessage:D.exports.func,getTable:D.exports.func.isRequired,runCode:D.exports.func.isRequired});Object.freeze({Column:Xi,FilterCondition:oa,IdeSession:ah,RollupConfig:lh,Sort:sh,Table:ih,TreeTable:oh,VariableChanges:rh,VariableDefinition:Ni});const Gr=te.module("DateTimeColumnFormatter"),Zn=class extends ke{constructor({timeZone:e="",showTimeZone:t=!0,showTSeparator:n=!1,defaultDateTimeFormatString:s=Zn.DEFAULT_DATETIME_FORMAT_STRING}={}){super();const i=e||Zn.DEFAULT_TIME_ZONE_ID;try{this.dhTimeZone=y.i18n.TimeZone.getTimeZone(i)}catch{Gr.error("Unsupported time zone id",i),this.dhTimeZone=y.i18n.TimeZone.getTimeZone(Zn.DEFAULT_TIME_ZONE_ID)}this.defaultDateTimeFormatString=s,this.showTimeZone=t,this.showTSeparator=n,this.formatStringMap=Zn.makeFormatStringMap(t,n)}static isValid(e){try{return y.i18n.DateTimeFormat.format(e.formatString,new Date),!0}catch{return!1}}static makeFormat(e,t,n=ke.TYPE_CONTEXT_PRESET){return{label:e,formatString:t,type:n}}static isSameFormat(e,t){return e===t||e!==null&&t!==null&&e.type===t.type&&e.formatString===t.formatString}static makeGlobalFormatStringMap(e,t){const n=t?"'T'":" ",s=e?" z":"";return new Map([["yyyy-MM-dd HH:mm:ss",`yyyy-MM-dd${n}HH:mm:ss${s}`],["yyyy-MM-dd HH:mm:ss.SSS",`yyyy-MM-dd${n}HH:mm:ss.SSS${s}`],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS",`yyyy-MM-dd${n}HH:mm:ss.SSSSSSSSS${s}`]])}static getGlobalFormats(e,t){return[...Zn.makeGlobalFormatStringMap(e,t).keys()]}static makeFormatStringMap(e,t){const n=t?"'T'":" ",s=e?" z":"";return new Map([["yyyy-MM-dd",`yyyy-MM-dd${s}`],["MM-dd-yyyy",`MM-dd-yyyy${s}`],["HH:mm:ss",`HH:mm:ss${s}`],["HH:mm:ss.SSS",`HH:mm:ss.SSS${s}`],["HH:mm:ss.SSSSSSSSS",`HH:mm:ss.SSSSSSSSS${s}`],["yyyy-MM-dd HH:mm:ss",`yyyy-MM-dd${n}HH:mm:ss${s}`],["yyyy-MM-dd HH:mm:ss.SSS",`yyyy-MM-dd${n}HH:mm:ss.SSS${s}`],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS",`yyyy-MM-dd${n}HH:mm:ss.SSSSSSSSS${s}`]])}static getFormats(e,t){return[...Zn.makeFormatStringMap(e,t).keys()]}getEffectiveFormatString(e){return this.formatStringMap.get(e)||e}format(e,t){const n=t&&t.formatString||this.defaultDateTimeFormatString,s=this.getEffectiveFormatString(n);try{return y.i18n.DateTimeFormat.format(s,e,this.dhTimeZone)}catch{Gr.error("Invalid format arguments")}return""}};let kn=Zn;kn.DEFAULT_DATETIME_FORMAT_STRING="yyyy-MM-dd HH:mm:ss.SSS";kn.DEFAULT_TIME_ZONE_ID="America/New_York";const ch=te.module("DecimalColumnFormatter"),Xt=class extends ke{constructor({defaultFormatString:e=Xt.DEFAULT_FORMAT_STRING}={}){super(),this.defaultFormatString=e}static isValid(e){try{return y.i18n.NumberFormat.format(e.formatString,0),!0}catch{return!1}}static makeFormat(e,t,n=ke.TYPE_CONTEXT_PRESET,s){return{label:e,type:n,formatString:t,multiplier:s}}static makePresetFormat(e,t="",n){return Xt.makeFormat(e,t,ke.TYPE_CONTEXT_PRESET,n)}static makeCustomFormat(e="",t){return Xt.makeFormat("Custom Format",e,ke.TYPE_CONTEXT_CUSTOM,t)}static isSameFormat(e,t){return e===t||e!=null&&t!=null&&e.type===t.type&&e.formatString===t.formatString&&e.multiplier===t.multiplier}format(e,t){const n=t&&t.formatString||this.defaultFormatString,s=t&&t.multiplier?e*t.multiplier:e;try{return y.i18n.NumberFormat.format(n,s)}catch{ch.error("Invalid format arguments")}return""}};let ze=Xt;ze.DEFAULT_FORMAT_STRING="###,##0.0000";ze.FORMAT_PERCENT=Xt.makePresetFormat("Percent","##0.00%");ze.FORMAT_BASIS_POINTS=Xt.makePresetFormat("Basis Points","###,##0 bp",1e4);ze.FORMAT_MILLIONS=Xt.makePresetFormat("Millions","###,##0.000 mm",1e-6);ze.FORMAT_ROUND=Xt.makePresetFormat("Round","###,##0");ze.FORMAT_ROUND_TWO_DECIMALS=Xt.makePresetFormat("0.00","###,##0.00");ze.FORMAT_ROUND_FOUR_DECIMALS=Xt.makePresetFormat("0.0000","###,##0.0000");class hh extends ke{format(t){return`${t}`}}const uh=te.module("IntegerColumnFormatter"),Gs=class extends ke{constructor({defaultFormatString:e=Gs.DEFAULT_FORMAT_STRING}={}){super(),this.defaultFormatString=e}static isValid(e){try{return y.i18n.NumberFormat.format(e.formatString,0),!0}catch{return!1}}static makeFormat(e,t,n=ke.TYPE_CONTEXT_PRESET,s){return{label:e,type:n,formatString:t,multiplier:s}}static makePresetFormat(e,t="",n){return Gs.makeFormat(e,t,ke.TYPE_CONTEXT_PRESET,n)}static makeCustomFormat(e="",t){return Gs.makeFormat("Custom Format",e,ke.TYPE_CONTEXT_CUSTOM,t)}static isSameFormat(e,t){return e===t||e!=null&&t!=null&&e.type===t.type&&e.formatString===t.formatString&&e.multiplier===t.multiplier}format(e,t){const n=t&&t.formatString||this.defaultFormatString,s=t&&t.multiplier?e*t.multiplier:e;try{return y.i18n.NumberFormat.format(n,s)}catch{uh.error("Invalid format arguments")}return""}};let un=Gs;un.DEFAULT_FORMAT_STRING="###,##0";un.FORMAT_MILLIONS=Gs.makePresetFormat("Millions","###,##0.000 mm",1e-6);class mh extends ke{format(t){return t}}const ct=class{static makeDateWrapper(e,t,n=0,s=1,i=0,o=0,r=0,l=0){if(!e)throw new Error("No timezone provided");const a=`${t}`.padStart(4,"0"),c=`${n+1}`.padStart(2,"0"),d=`${s}`.padStart(2,"0"),h=`${i}`.padStart(2,"0"),m=`${o}`.padStart(2,"0"),p=`${r}`.padStart(2,"0"),g=`${l}`.padStart(9,"0"),f=`${a}-${c}-${d} ${h}:${m}:${p}.${g}`;return y.i18n.DateTimeFormat.parse(ct.FULL_DATE_FORMAT,f,y.i18n.TimeZone.getTimeZone(e))}static getNextNanos(e){const t=parseInt(e,10),n="0".repeat(9-e.length),s=`${t+1}${n}`;return parseInt(s,10)}static getNextDate(e,t,n){let{year:s,month:i,date:o,hours:r,minutes:l,seconds:a,nanos:c}=t;if(e.nanos!=null){if(e.nanos.length===9)return null;c=ct.getNextNanos(e.nanos),c>999999999&&(a+=1,c=0)}else e.seconds!=null?a+=1:e.minutes!=null?l+=1:e.hours!=null?r+=1:e.date!=null?o+=1:e.month!=null?i+=1:s+=1;const d=new Date(s,i,o,r,l,a);return ct.makeDateWrapper(n,d.getFullYear(),d.getMonth(),d.getDate(),d.getHours(),d.getMinutes(),d.getSeconds(),c)}static parseMonth(e){const t=parseInt(e,10);if(!Number.isNaN(t))return t>=1&&t<=12?t-1:NaN;const n=e.trim().toLowerCase();if(n.length>=3){for(let s=0;s<ct.months.length;s+=1)if(ct.months[s].startsWith(n))return s}return NaN}static parseDateValues(e,t,n,s,i,o,r){const l=parseInt(e,10),a=t!=null?this.parseMonth(t):0,c=n!=null?parseInt(n,10):1,d=s!=null?parseInt(s,10):0,h=i!=null?parseInt(i,10):0,m=o!=null?parseInt(o,10):0,p=r!=null?parseInt(r.padEnd(9,"0"),10):0;return Number.isNaN(l)||Number.isNaN(a)||Number.isNaN(c)||Number.isNaN(d)||Number.isNaN(h)||Number.isNaN(m)||Number.isNaN(p)?null:{year:l,month:a,date:c,hours:d,minutes:h,seconds:m,nanos:p}}static parseDateTimeString(e){const n=/\s*(\d{4})([-./]([\da-z]+))?([-./](\d{1,2}))?([tT\s](\d{2})([:](\d{2}))?([:](\d{2}))?([.](\d{1,9}))?)?(.*)/.exec(e);if(n==null)throw new Error(`Unexpected date string: ${e}`);const[,s,,i,,o,,r,,l,,a,,c,d]=n;if(d!=null&&d.length>0)throw new Error(`Unexpected characters after date string '${e}': ${d}`);return{year:s,month:i,date:o,hours:r,minutes:l,seconds:a,nanos:c}}static parseDateRange(e,t){const n=e.trim().toLowerCase();if(n.length===0)throw new Error("Cannot parse date range from empty string");if(n==="null")return[null,null];if(n==="today"){const l=new Date(Date.now()),a=ct.makeDateWrapper(t,l.getFullYear(),l.getMonth(),l.getDate()),c=ct.makeDateWrapper(t,l.getFullYear(),l.getMonth(),l.getDate()+1);return[a,c]}if(n==="yesterday"){const l=new Date(Date.now()),a=ct.makeDateWrapper(t,l.getFullYear(),l.getMonth(),l.getDate()-1),c=ct.makeDateWrapper(t,l.getFullYear(),l.getMonth(),l.getDate());return[a,c]}if(n==="now"){const l=new Date(Date.now());return[y.DateWrapper.ofJsDate(l),null]}const s=ct.parseDateTimeString(n);if(s.year==null&&s.month==null&&s.date==null)throw new Error(`Unable to extract year, month, or day ${n}`);const i=ct.parseDateValues(s.year,s.month,s.date,s.hours,s.minutes,s.seconds,s.nanos);if(i==null)throw new Error(`Unable to extract date values from ${s}`);const o=ct.makeDateWrapper(t,i.year,i.month,i.date,i.hours,i.minutes,i.seconds,i.nanos),r=ct.getNextDate(s,i,t);return[o,r]}static getJsDate(e){return typeof e=="number"?new Date(e):e.asDate()}};let Ln=ct;Ln.FULL_DATE_FORMAT="yyyy-MM-dd HH:mm:ss.SSSSSSSSS";Ln.months=["january","february","march","april","may","june","july","august","september","october","november","december"];class qt{}qt.not="not";qt.and="and";qt.or="or";function ph(e){if(!(e==="not"||e==="and"||e==="or"))throw new Error("operator is not a valid FilterOperatorValue")}class W{}W.eq="eq";W.eqIgnoreCase="eqIgnoreCase";W.notEq="notEq";W.notEqIgnoreCase="notEqIgnoreCase";W.greaterThan="greaterThan";W.greaterThanOrEqualTo="greaterThanOrEqualTo";W.lessThan="lessThan";W.lessThanOrEqualTo="lessThanOrEqualTo";W.in="in";W.inIgnoreCase="inIgnoreCase";W.notIn="notIn";W.notInIgnoreCase="notInIgnoreCase";W.isTrue="isTrue";W.isFalse="isFalse";W.isNull="isNull";W.invoke="invoke";W.contains="contains";W.notContains="notContains";W.startsWith="startsWith";W.endsWith="endsWith";W.containsAny="containsAny";function gh(e){switch(e){case W.eq:return"is exactly";case W.eqIgnoreCase:return"is exactly (ignore case)";case W.notEq:return"is not exactly";case W.notEqIgnoreCase:return"is not exactly (ignore case)";case W.contains:return"contains";case W.notContains:return"does not contain";case W.startsWith:return"starts with";case W.endsWith:return"ends with";default:throw new Error(`Unrecognized text filter type ${e}`)}}function fh(e){switch(e){case W.eq:return"is equal to";case W.notEq:return"is not equal to";case W.greaterThan:return"greater than";case W.greaterThanOrEqualTo:return"greater than or equal to";case W.lessThan:return"less than";case W.lessThanOrEqualTo:return"less than or equal to";default:throw new Error(`Unrecognized number filter type ${e}`)}}function Ch(e){switch(e){case W.eq:return"date is";case W.notEq:return"date is not";case W.notEqIgnoreCase:case W.greaterThan:return"date is after";case W.greaterThanOrEqualTo:return"date is after or equal";case W.lessThan:return"date is before";case W.lessThanOrEqualTo:return"date is before or equal";default:throw new Error(`Unrecognized date filter type ${e}`)}}function bh(e){switch(e){case W.isTrue:return"Is True";case W.isFalse:return"Is False";case W.isNull:return"Is Null";default:throw new Error(`Unrecognized boolean filter type ${e}`)}}const sn=te.module("TableUtils"),X=class{static getSortIndex(e,t){var n;for(let s=0;s<e.length;s+=1)if(((n=e[s].column)==null?void 0:n.index)===t)return s;return null}static getSortForColumn(e,t){const n=X.getSortIndex(e,t);return n!=null?e[n]:null}static getFilterText(e){return e?e.toString():null}static getFilterTypes(e){return X.isBooleanType(e)?[W.isTrue,W.isFalse,W.isNull]:X.isCharType(e)||X.isNumberType(e)||X.isDateType(e)?[W.eq,W.notEq,W.greaterThan,W.greaterThanOrEqualTo,W.lessThan,W.lessThanOrEqualTo]:X.isTextType(e)?[W.eq,W.eqIgnoreCase,W.notEq,W.notEqIgnoreCase,W.contains,W.notContains,W.startsWith,W.endsWith]:[]}static getNextSort(e,t,n){if(!e||n<0||n>=e.length)return null;const s=X.getSortForColumn(t,n);return s===null?e[n].sort().asc():s.direction===X.sortDirection.ascending?s.desc():null}static makeColumnSort(e,t,n,s){if(!e||t<0||t>=e.length||n===X.sortDirection.none)return null;let i=e[t].sort();switch(n){case X.sortDirection.ascending:i=i.asc();break;case X.sortDirection.descending:i=i.desc();break}return s&&(i=i.abs()),i}static toggleSortForColumn(e,t,n,s=!1){if(n<0||n>=t.length)return[];const i=X.getNextSort(t,e,n);return X.setSortForColumn(e,n,i,s)}static sortColumn(e,t,n,s,i,o){if(!e||n<0||n>=t.length)return[];const r=X.makeColumnSort(t,n,s,i);return X.setSortForColumn(e,n,r,o)}static setSortForColumn(e,t,n,s=!1){const i=X.getSortIndex(e,t);let o=[];return s&&(o=o.concat(e.filter(({direction:r})=>r!==X.sortDirection.reverse)),i!==null&&o.splice(i,1)),n!==null&&o.push(n),o}static getNormalizedType(e){switch(e){case"boolean":case"java.lang.Boolean":case X.dataType.BOOLEAN:return X.dataType.BOOLEAN;case"char":case"java.lang.Character":case X.dataType.CHAR:return X.dataType.CHAR;case"java.lang.String":case X.dataType.STRING:return X.dataType.STRING;case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":case X.dataType.DATETIME:return X.dataType.DATETIME;case"double":case"java.lang.Double":case"float":case"java.lang.Float":case"java.math.BigDecimal":case X.dataType.DECIMAL:return X.dataType.DECIMAL;case"int":case"java.lang.Integer":case"long":case"java.lang.Long":case"short":case"java.lang.Short":case"byte":case"java.lang.Byte":case"java.math.BigInteger":case X.dataType.INT:return X.dataType.INT;default:return X.dataType.UNKNOWN}}static isLongType(e){switch(e){case"long":case"java.lang.Long":return!0;default:return!1}}static isDateType(e){switch(e){case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":return!0;default:return!1}}static isNumberType(e){return X.isIntegerType(e)||X.isDecimalType(e)}static isIntegerType(e){switch(e){case"int":case"java.lang.Integer":case"java.math.BigInteger":case"long":case"java.lang.Long":case"short":case"java.lang.Short":case"byte":case"java.lang.Byte":return!0;default:return!1}}static isDecimalType(e){switch(e){case"double":case"java.lang.Double":case"java.math.BigDecimal":case"float":case"java.lang.Float":return!0;default:return!1}}static isBooleanType(e){switch(e){case"boolean":case"java.lang.Boolean":return!0;default:return!1}}static isCharType(e){switch(e){case"char":case"java.lang.Character":return!0;default:return!1}}static isStringType(e){switch(e){case"java.lang.String":return!0;default:return!1}}static isTextType(e){return this.isStringType(e)||this.isCharType(e)}static getBaseType(e){return e.split("[]")[0]}static isCompatibleType(e,t){return X.getNormalizedType(e)===X.getNormalizedType(t)}static makeQuickFilter(e,t,n){const s=t.split("||");let i=null;for(let o=0;o<s.length;o+=1){const l=s[o].split("&&");let a=null;for(let c=0;c<l.length;c+=1){const d=l[c].trim();if(d.length>0){const h=X.makeQuickFilterFromComponent(e,d,n);if(h)a?a=a.and(h):a=h;else throw new Error(`Unable to parse quick filter from text ${t}`)}}i&&a?i=i.or(a):i=a}return i}static makeQuickFilterFromComponent(e,t,n){const{type:s}=e;return X.isNumberType(s)?this.makeQuickNumberFilter(e,t):X.isBooleanType(s)?this.makeQuickBooleanFilter(e,t):n&&X.isDateType(s)?this.makeQuickDateFilter(e,t,n):X.isCharType(s)?this.makeQuickCharFilter(e,t):this.makeQuickTextFilter(e,t)}static makeQuickNumberFilter(e,t){if(t==null)return null;const n=e.filter();let s=null;const o=/\s*(>=|<=|=>|=<|>|<|!=|=|!)?(\s*-\s*)?(\s*\d*(?:,\d{3})*(?:\.\d*)?\s*)?(null|nan|infinity|inf|\u221E)?(.*)/i.exec(t);let r=null,l=null,a=null,c=null,d=null;if(o!==null&&o.length>3&&([,r,l,a,c,d]=o),d!=null&&d.trim().length>0)return null;if(r==null&&(r="="),c!=null){if(!(r==="="||r==="!"||r==="!="))return null;switch(c=c.trim().toLowerCase(),c){case"null":s=n.isNull();break;case"nan":s=y.FilterCondition.invoke("isNaN",n);break;case"infinity":case"inf":case"\u221E":l!=null?s=y.FilterCondition.invoke("isInf",n).and(n.lessThan(y.FilterValue.ofNumber(0))):s=y.FilterCondition.invoke("isInf",n).and(n.greaterThan(y.FilterValue.ofNumber(0)));break}return s!==null&&(r==="!"||r==="!=")&&(s=s.not()),s}if(a==null)return null;if(a=X.removeCommas(a),X.isLongType(e.type))try{a=y.FilterValue.ofNumber(y.LongWrapper.ofString(`${l!=null?"-":""}${a}`))}catch(h){return sn.warn("Unable to create long filter",h),null}else{if(a=parseFloat(a),a==null||Number.isNaN(a))return null;a=y.FilterValue.ofNumber(l!=null?0-a:a)}return s=e.filter(),X.makeRangeFilterWithOperation(s,r,a)}static makeQuickTextFilter(e,t){if(t==null)return null;const n=`${t}`.trim(),i=/^(!~|!=|~|=|!)?(.*)/.exec(n);let o=null,r=null;if(i!==null&&i.length>2&&([,o,r]=i,r!=null&&(r=r.trim())),r==null||r.length===0)return null;o==null&&(o="=");const l=e.filter();if(r.toLowerCase()==="null")switch(o){case"=":return l.isNull();case"!=":case"!":return l.isNull().not();default:return null}let a=null,c=null;switch(r.startsWith("*")?(a="*",r=r.substring(1)):r.endsWith("*")&&!r.endsWith("\\*")&&(c="*",r=r.substring(0,r.length-1)),r=r.replace("\\",""),o){case"~":return l.isNull().not().and(l.invoke("matches",y.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E.*`)));case"!~":return l.isNull().or(l.invoke("matches",y.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E.*`)).not());case"!=":return a==="*"?l.isNull().or(l.invoke("matches",y.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E$`)).not()):c==="*"?l.isNull().or(l.invoke("matches",y.FilterValue.ofString(`(?s)(?i)^\\Q${r}\\E.*`)).not()):l.notEqIgnoreCase(y.FilterValue.ofString(r.toLowerCase()));case"=":return a==="*"?l.isNull().not().and(l.invoke("matches",y.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E$`))):c==="*"?l.isNull().not().and(l.invoke("matches",y.FilterValue.ofString(`(?s)(?i)^\\Q${r}\\E.*`))):l.eqIgnoreCase(y.FilterValue.ofString(r.toLowerCase()))}return null}static makeQuickBooleanFilter(e,t){if(t==null)return null;const s=/^(!=|=|!)?(.*)/.exec(`${t}`.trim());if(s===null)return null;const[,i,o]=s,r=i==="!"||i==="!=",l=o.trim().toLowerCase();let a=e.filter();try{const c=X.makeBooleanValue(l);return c?a=a.isTrue():c===null?a=a.isNull():a=a.isFalse(),r?a.not():a}catch{return null}}static makeQuickDateFilter(e,t,n){const s=t.trim(),o=/\s*(>=|<=|=>|=<|>|<|!=|!|=)?(.*)/.exec(s);if(o==null||o.length<=2)throw new Error(`Unable to parse date filter: ${t}`);let r=null,l=null;[,r,l]=o;let a=W.eq;switch(r){case"<":a=W.lessThan;break;case"<=":case"=<":a=W.lessThanOrEqualTo;break;case">":a=W.greaterThan;break;case">=":case"=>":a=W.greaterThanOrEqualTo;break;case"!=":case"!":a=W.notEq;break;case"=":case"==":default:a=W.eq;break}return X.makeQuickDateFilterWithOperation(e,l,a,n)}static makeQuickDateFilterWithOperation(e,t,n=W.eq,s){if(e==null)throw new Error("Column is null");const[i,o]=Ln.parseDateRange(t,s),r=i!=null?y.FilterValue.ofNumber(i):null,l=o!=null?y.FilterValue.ofNumber(o):null,a=e.filter();if(r==null)return n===W.notEq?a.isNull().not():a.isNull();switch(n){case W.eq:{if(l!=null){const c=a.greaterThanOrEqualTo(r),d=a.lessThan(l);return c.and(d)}return a.eq(r)}case W.lessThan:return a.lessThan(r);case W.lessThanOrEqualTo:return l!=null?a.lessThan(l):a.lessThanOrEqualTo(r);case W.greaterThan:return l!=null?a.greaterThanOrEqualTo(l):a.greaterThan(r);case W.greaterThanOrEqualTo:return a.greaterThanOrEqualTo(r);case W.notEq:{if(l!=null){const c=a.lessThan(r),d=a.greaterThanOrEqualTo(l);return c.or(d)}return a.notEq(r)}default:throw new Error(`Invalid operator: ${n}`)}}static quoteValue(e){return e.length>=2&&(e.charAt(0)==='"'&&e.charAt(e.length-1)==='"'||e.charAt(0)==="'"&&e.charAt(e.length-1)==="'")?e:`"${e}"`}static isRangeOperation(e){switch(e){case"<":case"<=":case"=<":case">":case">=":case"=>":return!0;default:return!1}}static makeQuickCharFilter(e,t){if(t==null)return null;const n=`${t}`.trim(),i=/^(>=|<=|=>|=<|>|<|!=|=|!)?(null|"."|'.'|.)?(.*)/.exec(n);let o=null,r=null,l=null;if(i!==null&&i.length>3&&([,o,r,l]=i),l!=null&&l.trim().length>0||r==null||r.length===0)return null;o==null&&(o="=");const a=e.filter();if(r.toLowerCase()==="null")switch(o){case"=":return a.isNull();case"!=":case"!":return a.isNull().not();default:return null}const c=y.FilterValue.ofString(X.isRangeOperation(o)?X.quoteValue(r):r);return X.makeRangeFilterWithOperation(a,o,c)}static makeRangeFilterWithOperation(e,t,n){switch(t){case"=":return e.eq(n);case"<":return e.lessThan(n);case"<=":case"=<":return e.lessThanOrEqualTo(n);case">":return e.greaterThan(n);case">=":case"=>":return e.greaterThanOrEqualTo(n);case"!=":case"!":return e.notEq(n);default:return null}}static makeCancelableTablePromise(e){return He.makeCancelable(e,t=>{t.close()})}static makeCancelableTableEventPromise(e,t,n=0,s=null){let i,o,r=!0;const l=new Promise((a,c)=>{o=setTimeout(()=>{i(),r=!1,c(new Bl(`Event "${t}" timed out.`))},n),i=e.addEventListener(t,d=>{if(s!=null&&!s(d)){sn.debug2("Event triggered, but matcher returned false.");return}sn.debug2("Event triggered, resolving."),i(),clearTimeout(o),r=!1,a(d)})});return l.cancel=()=>{if(r){sn.debug2("Pending promise cleanup."),i(),clearTimeout(o),r=!1;return}sn.debug2("Ignoring non-pending promise cancel.")},l}static makeAdvancedFilter(e,t,n){const{filterItems:s,filterOperators:i,invertSelection:o,selectedValues:r}=t;let l=null;for(let c=0;c<s.length;c+=1){const d=s[c],{selectedType:h,value:m}=d;if(h!=null&&h.length>0&&m!=null&&m.length>0)try{const p=X.makeAdvancedValueFilter(e,h,m,n);if(p!=null){if(c===0)l=p;else if(l!==null&&c-1<i.length){const g=i[c-1];if(g===qt.and)l=l.and(p);else if(g===qt.or)l=l.or(p);else{sn.error("Unexpected filter operator",g,p),l=null;break}}}else sn.debug2("Empty filter ignored for",h,m)}catch(p){sn.error("Unable to create filter",p),l=null;break}}const a=X.makeSelectValueFilter(e,r,o);return a!=null&&(l!=null?l=l.and(a):l=a),l}static removeCommas(e){return e.replace(/[\s|,]/g,"")}static makeFilterValue(e,t){const n=X.getBaseType(e);return X.isTextType(n)?y.FilterValue.ofString(t):X.isLongType(n)?y.FilterValue.ofNumber(y.LongWrapper.ofString(X.removeCommas(t))):y.FilterValue.ofNumber(X.removeCommas(t))}static makeFilterRawValue(e,t){return X.isTextType(e)?y.FilterValue.ofString(t):X.isBooleanType(e)?y.FilterValue.ofBoolean(t):y.FilterValue.ofNumber(t)}static makeValue(e,t,n){if(t==null||t==="null")return null;if(X.isTextType(e))return t;if(X.isLongType(e))return y.LongWrapper.ofString(X.removeCommas(t));if(X.isBooleanType(e))return X.makeBooleanValue(t,!0);if(X.isDateType(e)){const[s]=Ln.parseDateRange(t,n);return s}return X.isNumberType(e)?X.makeNumberValue(t):(sn.error("Unexpected column type",e),null)}static makeBooleanValue(e,t=!1){if(e===""&&t)return null;switch(e==null?void 0:e.toLowerCase()){case"null":return null;case"0":case"f":case"fa":case"fal":case"fals":case"false":case"n":case"no":return!1;case"1":case"t":case"tr":case"tru":case"true":case"y":case"ye":case"yes":return!0;default:throw new Error(`Invalid boolean '${e}'`)}}static makeNumberValue(e){if(e==null||e==="null"||e==="")return null;const t=e.toLowerCase().trim();if(t==="\u221E"||t==="infinity"||t==="inf")return Number.POSITIVE_INFINITY;if(t==="-\u221E"||t==="-infinity"||t==="-inf")return Number.NEGATIVE_INFINITY;const n=X.removeCommas(t);if(X.NUMBER_REGEX.test(n))return parseFloat(n);throw new Error(`Invalid number '${e}'`)}static getFilterOperatorString(e){switch(e){case W.eq:return"=";case W.notEq:return"!=";case W.greaterThan:return">";case W.greaterThanOrEqualTo:return">=";case W.lessThan:return"<";case W.lessThanOrEqualTo:return"<=";case W.contains:return"~";case W.notContains:return"!~";default:throw new Error(`Unexpected filter type ${e}`)}}static makeAdvancedValueFilter(e,t,n,s){if(X.isDateType(e.type))return X.makeQuickDateFilterWithOperation(e,n,t,s);if(X.isNumberType(e.type)||X.isCharType(e.type))return X.makeQuickFilter(e,`${X.getFilterOperatorString(t)}${n}`);const i=X.makeFilterValue(e.type,n),o=e.filter();switch(t){case W.eq:return o.eq(i);case W.eqIgnoreCase:return o.eqIgnoreCase(i);case W.notEq:return o.notEq(i);case W.notEqIgnoreCase:return o.notEqIgnoreCase(i);case W.greaterThan:return o.greaterThan(i);case W.greaterThanOrEqualTo:return o.greaterThanOrEqualTo(i);case W.lessThan:return o.lessThan(i);case W.lessThanOrEqualTo:return o.lessThanOrEqualTo(i);case W.isTrue:return o.isTrue();case W.isFalse:return o.isFalse();case W.isNull:return o.isNull();case W.contains:return o.isNull().not().and(o.invoke("matches",y.FilterValue.ofString(`(?s)(?i).*\\Q${n}\\E.*`)));case W.notContains:return o.isNull().or(o.invoke("matches",y.FilterValue.ofString(`(?s)(?i).*\\Q${n}\\E.*`)).not());case W.startsWith:return o.isNull().not().and(o.invoke("matches",y.FilterValue.ofString(`(?s)(?i)^\\Q${n}\\E.*`)));case W.endsWith:return o.isNull().not().and(o.invoke("matches",y.FilterValue.ofString(`(?s)(?i).*\\Q${n}\\E$`)));case W.in:case W.inIgnoreCase:case W.notIn:case W.notInIgnoreCase:case W.invoke:default:throw new Error(`Unexpected filter operation: ${t}`)}}static makeSelectValueFilter(e,t,n){if(t.length===0){if(n)return null;let o=null;X.isTextType(e.type)?o=y.FilterValue.ofString("a"):X.isBooleanType(e.type)?o=y.FilterValue.ofBoolean(!0):X.isDateType(e.type)?o=y.FilterValue.ofNumber(y.DateWrapper.ofJsDate(new Date)):o=y.FilterValue.ofNumber(0);const r=e.filter().eq(o),l=e.filter().notEq(o);return r.and(l)}const s=[];let i=!1;for(let o=0;o<t.length;o+=1){const r=t[o];r==null?i=!0:X.isTextType(e.type)?s.push(y.FilterValue.ofString(typeof r=="number"?String.fromCharCode(r):r)):X.isBooleanType(e.type)?s.push(y.FilterValue.ofBoolean(!!r)):s.push(y.FilterValue.ofNumber(r))}return i?s.length>0?n?e.filter().isNull().not().and(e.filter().notIn(s)):e.filter().isNull().or(e.filter().in(s)):n?e.filter().isNull().not():e.filter().isNull():n?e.filter().notIn(s):e.filter().in(s)}static isTreeTable(e){return e!=null&&e.expand!==void 0&&e.collapse!==void 0}static sortColumns(e,t=!0){return[...e].sort((n,s)=>{const i=n.name.toUpperCase(),o=s.name.toUpperCase();return Qo.sort(i,o,t)})}};let x=X;x.dataType={BOOLEAN:"boolean",CHAR:"char",DATETIME:"datetime",DECIMAL:"decimal",INT:"int",STRING:"string",UNKNOWN:"unknown"};x.sortDirection={ascending:"ASC",descending:"DESC",reverse:"REVERSE",none:null};x.REVERSE_TYPE=Object.freeze({NONE:"none",PRE_SORT:"pre-sort",POST_SORT:"post-sort"});x.NUMBER_REGEX=/^-?\d+(\.\d+)?$/;class Yt{static makeColumnFormatMap(t){return t==null?new Map:t.reduce((n,s)=>{const i=x.getNormalizedType(s.columnType);if(i===null)return n;n.has(i)||n.set(i,new Map);const o=n.get(i);return o==null||o.set(s.columnName,s.format),n},new Map)}static makeColumnFormattingRule(t,n,s){return{columnType:t,columnName:n,format:s}}constructor(t=[],n,s,i,o=!1){this.defaultColumnFormatter=new hh,this.typeFormatterMap=new Map([[x.dataType.BOOLEAN,new th],[x.dataType.CHAR,new nh],[x.dataType.DATETIME,new kn(n)],[x.dataType.DECIMAL,new ze(s)],[x.dataType.INT,new un(i)],[x.dataType.STRING,new mh]]),this.columnFormatMap=Yt.makeColumnFormatMap(t),this.truncateNumbersWithPound=o}getColumnFormatMapForType(t,n=!1){const s=x.getNormalizedType(t);if(s!==null)return n&&!this.columnFormatMap.has(s)&&this.columnFormatMap.set(s,new Map),this.columnFormatMap.get(s)}getColumnFormat(t,n){var i;const s=this.getColumnFormatMapForType(t);return(i=s==null?void 0:s.get(n))!=null?i:null}getColumnTypeFormatter(t){var i;const n=x.getNormalizedType(t);let s=this.defaultColumnFormatter;return n&&(s=(i=this.typeFormatterMap.get(n))!=null?i:s),s}getFormattedString(t,n,s="",i){if(t==null)return"";const o=this.getColumnTypeFormatter(n),r=i||this.getColumnFormat(n,s);return o.format(t,r!=null?r:void 0)}get timeZone(){var n;const t=this.typeFormatterMap.get(x.dataType.DATETIME);return(n=t==null?void 0:t.dhTimeZone)==null?void 0:n.id}}function wh(e){if(e&&e.formatter){const{formatter:t}=e;return t}}function Sh(e){return{timeZone:e==null?void 0:e.timeZone,defaultDateTimeFormatString:e==null?void 0:e.defaultDateTimeFormat,showTimeZone:e==null?void 0:e.showTimeZone,showTSeparator:e==null?void 0:e.showTSeparator}}function vh(e,t,n){const s=e.getColumnFormat(n,t);return s!=null&&(s.type===ke.TYPE_CONTEXT_PRESET||s.type===ke.TYPE_CONTEXT_CUSTOM)}const ls={getColumnFormats:wh,getDateTimeFormatterOptions:Sh,isCustomColumnFormatDefined:vh},Th=e=>{switch(e){default:return!1}},Eh=(e,t)=>{switch(e){case we.COUNT:case we.FIRST:case we.LAST:case we.COUNT_DISTINCT:case we.DISTINCT:case we.UNIQUE:return!0;case we.MIN:case we.MAX:return x.isNumberType(t)||x.isDateType(t)||x.isTextType(t);case we.SUM:case we.ABS_SUM:case we.VAR:case we.AVG:case we.STD:return x.isNumberType(t);case we.SKIP:return!1}},sr=(e,t)=>e.filter(n=>Eh(t,n.type)),yh=(e,t,n,s)=>sr(e,t).map(({name:i})=>i).filter(i=>n.includes(i)?!s:s),xn={isRollupOperation:Th,filterValidColumns:sr,getOperationColumnNames:yh};const qr=te.module("Aggregations"),Rh=[we.SUM,we.ABS_SUM,we.MIN,we.MAX,we.VAR,we.AVG,we.STD,we.FIRST,we.LAST,we.COUNT_DISTINCT,we.DISTINCT,we.COUNT,we.UNIQUE],Ih=({isRollup:e,settings:t,onChange:n,onEdit:s})=>{const{aggregations:i,showOnTop:o}=t,r=R.exports.useMemo(()=>Rh.filter(k=>!i.some(P=>P.operation===k)),[i]),[l,a]=R.exports.useState(r[0]),[c,d]=R.exports.useState([]),h=R.exports.useCallback(k=>{n({...t,...k})},[n,t]),m=R.exports.useCallback(k=>{h({aggregations:k})},[h]),p=R.exports.useCallback(k=>{h({showOnTop:k})},[h]),g=R.exports.useCallback(()=>{qr.debug("handleDragStart"),ht.startDragging()},[]),f=R.exports.useCallback(({destination:k,source:P})=>{if(qr.debug("handleDragEnd",k,P),ht.stopDragging(),k===null)return;let L=k.index;P.index<k.index&&(L+=1);const N=[...i],B=ht.reorder(N,c,N,L),U=ht.adjustDestinationIndex(L,c),H=[[U,U+B.length-1]];m(N),d(H)},[m,i,c,d]),b=R.exports.useCallback(k=>{a(k)},[a]),C=R.exports.useCallback(()=>{m([...i,{operation:l,selected:[],invert:!0}])},[i,l,m]),w=R.exports.useCallback(k=>{m(i.filter((P,L)=>L!==k))},[i,m]),S=R.exports.useCallback(k=>{d(k)},[d]),I=R.exports.useCallback(k=>{const P=i[k];xn.isRollupOperation(P.operation)||s(P)},[i,s]),v=R.exports.useCallback(k=>{p(k.target.value==="true")},[p]);R.exports.useEffect(function(){r.length>0&&!r.includes(l)&&a(r[0])},[r,l]);const E=R.exports.useCallback(({item:k,itemIndex:P,isClone:L,selectedCount:N})=>{const B=k.operation,U=L?`${N}`:void 0,H=L?"item-list-item-clone":void 0,_=xn.isRollupOperation(k.operation),$=!L&&!_;return T(Ne,{children:[T("div",{className:z("item-list-item-content","draggable-item-list-item-content",H),children:[T("span",{className:"title",children:[B,!e&&_&&T("span",{className:"small text-warning",children:[u(G,{icon:Vl})," Requires rollup"]})]}),bt.renderBadge({text:U}),bt.renderHandle()]}),!L&&T(Ne,{children:[u(Ie,{kind:"ghost",className:"btn-edit",icon:xl,tooltip:"Edit Columns",onClick:()=>s(k),disabled:!$}),u(Ie,{kind:"ghost",className:"btn-delete",icon:Pn,tooltip:"Delete Aggregation",onClick:()=>w(P)})]})]})},[w,s,e]),M=r.length>0,F=i.length>0;return T("div",{className:"aggregations",children:[M&&T("div",{className:"form-inline",children:[u(Yd,{onChange:b,value:l,children:r.map(k=>u(Xd,{value:k,children:k},k))}),T("button",{type:"button",className:"btn btn-link btn-add",onClick:C,children:[u(G,{icon:Rs}),"Add Aggregation"]})]}),M&&F&&u("hr",{}),F&&T(Ne,{children:[!e&&T("div",{className:"form-inline",children:[u("label",{children:"Placement:\xA0"}),T(er,{onChange:v,value:`${o}`,children:[u(gn,{value:"true",children:"Top"}),u(gn,{value:"false",children:"Bottom"})]})]}),u(Ys,{onDragStart:g,onDragEnd:f,children:u(bt,{className:"selected-aggregations",itemCount:i.length,items:i,renderItem:E,offset:0,onSelectionChange:S,onSelect:I,selectedRanges:c,isMultiSelect:!0})})]})]})};const Mh=30,Dh=({aggregation:e,columns:t,onChange:n})=>{const[s,i]=R.exports.useState(-1),[o,r]=R.exports.useState(-1),[l,a]=R.exports.useState(0),{invert:c,selected:d}=e,h=R.exports.useRef(null),m=R.exports.useCallback(v=>d.includes(v)?!c:c,[c,d]),p=R.exports.useMemo(()=>{let v=sr(t,e.operation);return l!==0&&(v=x.sortColumns(v,l===1)),v},[t,e.operation,l]),g=R.exports.useMemo(()=>s>=0?p.slice(s,o+1).map(v=>({value:v.name,displayValue:v.name,isSelected:m(v.name)})):[],[p,m,o,s]),f=R.exports.useCallback(v=>{const{name:E}=p[v],M=d.indexOf(E);let F=[...d],k=c;M>=0?F.splice(M,1):(F.push(E),F.length===p.length&&(F=[],k=!c)),n({...e,selected:F,invert:k})},[e,c,p,d,n]),b=R.exports.useCallback(()=>{a(0),n({...e,selected:[],invert:!0})},[e,n]),C=R.exports.useCallback((v,E)=>{i(v),r(E)},[i,r]),w=R.exports.useCallback(()=>{d.length===0?n({...e,invert:!c}):n({...e,selected:[],invert:!0})},[e,c,n,d]),S=d.length===0?c:null,I=d.length!==0||!c||l!==0;return T("div",{role:"menu",className:"aggregation-edit",children:[u("div",{className:"top-menu",children:T("div",{className:"form-inline",children:[u(It,{checked:S,onChange:w,children:"Toggle All"}),u("div",{className:"spacer"}),u(rt,{in:I,timeout:Rt.transitionSlowMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:u(Ie,{kind:"ghost",className:"btn-reset",onClick:b,children:"Reset"})}),u(Ie,{kind:"ghost",className:z({active:l===1}),icon:Go,tooltip:"Sort ascending",onClick:()=>a(1)}),u(Ie,{kind:"ghost",className:z({active:l===2}),icon:qo,tooltip:"Sort descending",onClick:()=>a(2)})]})}),u("div",{className:"aggregation-edit-item-list",children:u(jt,{itemCount:p.length,items:g,offset:s,renderItem:({item:v})=>u(It,{checked:m(v.value),children:v.displayValue}),onSelect:f,onViewportChange:C,rowHeight:Mh,focusSelector:"input",ref:h})})]})};function Nh(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:T("g",{fill:"none",fillRule:"evenodd",children:[u("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),u("path",{fill:"#7DA4FF",d:"M8 26h4v15H8zM15 17h4v24h-4zM22 21h4v20h-4zM29 17h4v24h-4zM36 11h4v30h-4z"})]})})}function Fh(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:T("g",{fill:"none",fillRule:"evenodd",children:[u("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),u("path",{fill:"#7DA4FF",d:"M7 34h4v8H7zM12 31h4v11h-4zM17 27h4v15h-4zM22 22h4v20h-4zM27 27h4v15h-4zM32 29h4v13h-4zM37 31h4v11h-4z"})]})})}function xh(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:T("g",{fill:"none",fillRule:"evenodd",children:[u("path",{fill:"#C1C0C0",d:"M4 4h1v40H4zM44 43v1H5v-1z"}),u("path",{stroke:"#7DA4FF",d:"M7.984 32.44l7.982-11.378 5.273 3.739 9.952-10.838 2.826 1.894 7.45-5.802"}),u("path",{stroke:"#BECDEF",d:"M8.244 37.926L17 33.496l5 .87 10.637-10.35 10.615-1.381"})]})})}function Oh(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:T("g",{fill:"none",fillRule:"evenodd",children:[u("path",{d:"M24 10c7.732 0 14 6.268 14 14s-6.268 14-14 14-14-6.268-14-14h14V10z",fill:"#80A6FF"}),u("path",{d:"M10 24c0-7.732 6.268-14 14-14v14H10z",fill:"#C1C0C0"})]})})}function Ah(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:T("g",{fill:"none",fillRule:"evenodd",children:[u("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),u("path",{fill:"#939293",d:"M44 34v1H4v-1zM44 25v1H4v-1zM44 16v1H4v-1z"}),u("circle",{fill:"#7DA4FF",cx:9.5,cy:37.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:16.5,cy:30.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:22.5,cy:36.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:28.5,cy:30.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:15.5,cy:38.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:23.5,cy:25.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:19.5,cy:19.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:29.5,cy:19.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:32.5,cy:26.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:36.5,cy:13.5,r:1.5})]})})}function kh(e){return T("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u("rect",{width:"48",height:"48",fill:"none"}),u("rect",{x:"26",y:"10",width:"15",height:"4",fill:"#9FDE70"}),u("rect",{x:"26",y:"22",width:"15",height:"4",fill:"#9FDE70"}),u("rect",{x:"26",y:"28",width:"15",height:"4",fill:"#FFD95C"}),u("rect",{x:"26",y:"34",width:"15",height:"4",fill:"#9FDE70"})]})}function Lh(e){return T("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u("rect",{width:"48",height:"48",fill:"none"}),u("rect",{x:"4",y:"16",width:"40",height:"4",fill:"#FFD95C"}),u("rect",{x:"4",y:"10",width:"40",height:"4",fill:"#78DCE8"}),u("rect",{x:"4",y:"34",width:"40",height:"4",fill:"#78DCE8"})]})}const Kr=te.module("ChartBuilder"),Ke=class extends R.exports.PureComponent{static getTypeName(e){switch(e){case y.plot.SeriesPlotStyle.LINE:return"Line";case y.plot.SeriesPlotStyle.BAR:return"Bar";case y.plot.SeriesPlotStyle.SCATTER:return"Scatter";case y.plot.SeriesPlotStyle.PIE:return"Pie";case y.plot.SeriesPlotStyle.HISTOGRAM:return"Histogram";default:return e}}static getTypeIcon(e){switch(e){case y.plot.SeriesPlotStyle.LINE:return u(xh,{});case y.plot.SeriesPlotStyle.BAR:return u(Nh,{});case y.plot.SeriesPlotStyle.SCATTER:return u(Ah,{});case y.plot.SeriesPlotStyle.PIE:return u(Oh,{});case y.plot.SeriesPlotStyle.HISTOGRAM:return u(Fh,{});default:return null}}static getMaxSeriesCount(e){switch(e){case y.plot.SeriesPlotStyle.PIE:return 1;case y.plot.SeriesPlotStyle.HISTOGRAM:return 0;default:return 100}}static getXAxisLabel(e){switch(e){case y.plot.SeriesPlotStyle.PIE:return"Labels";case y.plot.SeriesPlotStyle.HISTOGRAM:return"Data";default:return"X-Axis"}}static getSeriesLabel(e){switch(e){case y.plot.SeriesPlotStyle.PIE:return"Values";default:return"Series"}}static makeSeriesItem(e){return{id:Qt.generate(),value:e}}static makeDefaultSeriesItems(e,t){if(Ke.getMaxSeriesCount(e)===0||t==null||t.length===0)return[];const s=t.length>1?t[1].name:t[0].name;return[Ke.makeSeriesItem(s)]}static getDefaultXAxis(e,t){return t!=null&&t.length>0?t[0].name:null}constructor(e){super(e),this.handleAddSeries=this.handleAddSeries.bind(this),this.handleLinkStateChange=this.handleLinkStateChange.bind(this),this.handleReset=this.handleReset.bind(this),this.handleSeriesChange=this.handleSeriesChange.bind(this),this.handleSeriesDeleteClick=this.handleSeriesDeleteClick.bind(this),this.handleSubmit=this.handleSubmit.bind(this),this.handleTypeClick=this.handleTypeClick.bind(this),this.handleXAxisChange=this.handleXAxisChange.bind(this),this.sendChange=this.sendChange.bind(this);const{model:t}=e,{columns:n}=t,s=Ke.types[0],i=Ke.getDefaultXAxis(s,n),o=Ke.makeDefaultSeriesItems(s,n);this.state={type:s,seriesItems:o,xAxis:i,isLinked:!0}}handleAddSeries(){this.setState(e=>{let{seriesItems:t}=e;t=[...t];const{model:n}=this.props,{columns:s}=n;return t.push({id:Qt.generate(),value:s[0].name}),{seriesItems:t}},this.sendChange)}handleLinkStateChange(e){this.setState({isLinked:e.target.value==="true"},this.sendChange)}handleReset(){const{model:e}=this.props,{columns:t}=e,n=Ke.types[0],s=Ke.getDefaultXAxis(n,t),i=Ke.makeDefaultSeriesItems(n,t),o=!0;this.setState({type:n,seriesItems:i,xAxis:s,isLinked:o},this.sendChange)}handleSeriesChange(e){const{value:t}=e.target,n=e.target.getAttribute("data-index"),s=parseInt(n,10);this.setState(i=>{let{seriesItems:o}=i;return o=[...o],o[s].value=t,{seriesItems:o}},this.sendChange)}handleSeriesDeleteClick(e){const n=e.target.getAttribute("data-index"),s=parseInt(n,10);this.setState(i=>{let{seriesItems:o}=i;return o=[...o],o.splice(s,1),{seriesItems:o}},this.sendChange)}handleSubmit(e){e.preventDefault();const{onSubmit:t}=this.props,{type:n,seriesItems:s,xAxis:i,isLinked:o}=this.state,r=s.map(l=>l.value);t({type:`${n}`,series:r,xAxis:i,isLinked:o})}handleTypeClick(e){const n=e.target.getAttribute("data-index"),s=parseInt(n,10),i=Ke.types[s];Kr.debug2("handleTypeSelect",i),this.setState(o=>{const r=Ke.getMaxSeriesCount(i);let{seriesItems:l}=o;if(l=l.slice(0,r),l.length===0&&r>0){const{model:a}=this.props,{columns:c}=a;l=Ke.makeDefaultSeriesItems(i,c)}return{type:i,seriesItems:l}},this.sendChange)}handleXAxisChange(e){const t=e.target.value;Kr.debug2("x-axis change",t),this.setState({xAxis:t},this.sendChange)}sendChange(){const{onChange:e}=this.props,{isLinked:t,type:n,seriesItems:s,xAxis:i}=this.state,o=s.map(r=>r.value);e({type:n,series:o,xAxis:i,isLinked:t})}render(){const{model:e}=this.props,{columns:t}=e,{seriesItems:n,type:s,xAxis:i,isLinked:o}=this.state,r=Ke.getMaxSeriesCount(s),l=Ke.getXAxisLabel(s),a=Ke.getSeriesLabel(s),c=n.length>0,d=n.length<r;return u("div",{className:"chart-builder",children:T("form",{onSubmit:this.handleSubmit,children:[T("div",{className:"form-row",children:[u("label",{children:"Select Chart Type"}),u("div",{className:"form-row",children:Ke.types.map((h,m)=>{const p=h;return u("div",{className:"col col-chart-type",children:T("button",{type:"button",className:z("btn","btn-icon","btn-chart-type",{active:h===s}),"data-index":m,onClick:this.handleTypeClick,children:[Ke.getTypeIcon(h),Ke.getTypeName(h)]})},p)})})]}),u("hr",{}),T("div",{className:"form-row form-inline",children:[u("label",{className:"col-2 label-left",children:l}),u("select",{className:"form-control custom-select select-x-axis col",value:i,onChange:this.handleXAxisChange,children:t.map(h=>u("option",{value:h.name,children:h.name},h.name))})]}),c&&u("hr",{}),n.map((h,m)=>T("div",{className:"form-row form-inline form-series-item","data-testid":`form-series-item-${m}`,children:[u("label",{className:"col-2 label-left",children:m===0?a:""}),u("select",{className:"form-control custom-select select-series col",value:h.value,onChange:this.handleSeriesChange,"data-testid":`select-series-item-${m}`,"data-index":m,children:t.map(p=>u("option",{value:p.name,"data-index":m,children:p.name},p.name))}),n.length>1&&u("button",{type:"button",className:"btn btn-link btn-link-icon btn-delete-series ml-2 px-2","data-index":m,"data-testid":`delete-series-${m}`,onClick:this.handleSeriesDeleteClick,children:u(G,{icon:Pn})})]},h.id)),d&&T("div",{className:"form-row",children:[u("div",{className:"col-2"}),T("button",{type:"button",className:"btn btn-link btn-add-series mt-1",onClick:this.handleAddSeries,children:[u(G,{icon:Rs}),"Add Series"]})]}),T("div",{className:"form-row chart-builder-link",children:[u("label",{className:"col-2 label-right",children:T("div",{className:"fa-md fa-layers",children:[u(G,{mask:Xo,icon:zo,transform:"right-5 down-5"}),u(G,{icon:o?Al:Nd,transform:"grow-2 right-8 down-6"})]})}),T(er,{onChange:this.handleLinkStateChange,value:`${o}`,children:[u(gn,{value:"true",children:"Sync State"}),u(gn,{value:"false",children:"Freeze State"})]})]}),T("div",{className:"form-row",children:[u("div",{className:"col-2 label-right"}),u("div",{className:"col chart-builder-link-info",children:o?"Charts with synced state will update to match any filters or user modifications applied to the parent table.":"Freeze State disconnects the chart state from the parent table. New filters or user modifications on the parent table will not be applied."})]}),T("div",{className:z("form-row","justify-content-end","my-3"),children:[u("button",{type:"button",className:"btn btn-outline-primary btn-reset",onClick:this.handleReset,children:"Reset"}),u("button",{type:"submit",className:"btn btn-primary btn-submit",children:"Create"})]})]})})}};let ra=Ke;ra.types=[y.plot.SeriesPlotStyle.LINE,y.plot.SeriesPlotStyle.BAR,y.plot.SeriesPlotStyle.SCATTER,y.plot.SeriesPlotStyle.PIE];class la extends R.exports.Component{constructor(t){super(t),this.handleContentChanged=this.handleContentChanged.bind(this),this.handleEditorFocus=this.handleEditorFocus.bind(this),this.handleEditorBlur=this.handleEditorBlur.bind(this),this.handleContainerClick=this.handleContainerClick.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.state={isEditorFocused:!1,isEditorEmpty:!0},this.editorContainer=null}componentDidMount(){this.initEditor()}componentWillUnmount(){this.destroyEditor()}initEditor(){var i;const{value:t,editorSettings:n}=this.props,s={copyWithSyntaxHighlighting:"false",fixedOverflowWidgets:!0,folding:!1,fontFamily:"Fira Mono",glyphMargin:!1,language:"groovyDB",lineDecorationsWidth:8,lineNumbers:"off",minimap:{enabled:!1},renderLineHighlight:"none",scrollbar:{arrowSize:0,horizontal:"hidden",horizontalScrollbarSize:0},scrollBeyondLastLine:!1,padding:{top:6,bottom:6},tabCompletion:"off",useTabStops:!0,value:t,wordWrap:"on",automaticLayout:!0,...n};if(!this.editorContainer)throw new Error("editorContainer is null");this.editor=pn.create(this.editorContainer,s),this.editor.layout(),(i=this.editor.getModel())==null||i.updateOptions({tabSize:0}),this.editor.onDidChangeModelContent(this.handleContentChanged),this.editor.onDidFocusEditorText(this.handleEditorFocus),this.editor.onDidBlurEditorText(this.handleEditorBlur)}destroyEditor(){var t;(t=this.editor)==null||t.dispose(),this.editor=void 0}handleContentChanged(){var s,i;const{onContentChanged:t}=this.props,n=(i=(s=this.editor)==null?void 0:s.getModel())==null?void 0:i.getValue();n&&this.setState({isEditorEmpty:n.length===0}),t(n)}handleEditorFocus(){this.setState({isEditorFocused:!0})}handleEditorBlur(){var n,s;const t=(s=(n=this.editor)==null?void 0:n.getModel())==null?void 0:s.getValue();if(!t)throw new Error("value is undefined");this.setState({isEditorEmpty:t.length===0,isEditorFocused:!1})}handleContainerClick(){var n;const{isEditorFocused:t}=this.state;t||(n=this.editor)==null||n.focus()}handleKeyDown(t){const{onTab:n,editorIndex:s}=this.props;t.key==="Tab"&&n(s,t.shiftKey)}render(){const{value:t,invalid:n}=this.props,{isEditorFocused:s,isEditorEmpty:i}=this.state;return T("div",{className:z("input-editor-wrapper",{focused:s,invalid:n}),onKeyDown:this.handleKeyDown,role:"presentation",onClick:this.handleContainerClick,children:[u("div",{className:"editor-container",ref:o=>{this.editorContainer=o}}),i&&!t&&u("div",{className:"editor-placeholder text-muted",children:"Column Formula"})]})}}la.defaultProps={value:"",onContentChanged:()=>{},editorSettings:{},editorIndex:0,onTab:()=>{},invalid:!1};const ko=class extends R.exports.PureComponent{constructor(e){super(e),this.handleFormulaEditorContentChanged=this.handleFormulaEditorContentChanged.bind(this)}handleFormulaEditorContentChanged(e){const{onChange:t,eventKey:n}=this.props;e&&(e.replace(/(\r\n|\n|\r)/gm,""),t(n,ko.INPUT_TYPE.FORMULA,e))}render(){const{eventKey:e,name:t,formula:n,onChange:s,onDeleteColumn:i,inputIndex:o,onTabInEditor:r,invalid:l}=this.props;return u(Wi,{draggableId:e,index:o,disableInteractiveElementBlocking:!0,children:(a,c)=>T("div",{className:z("draggable-container",{dragging:c.isDragging}),ref:a.innerRef,...a.draggableProps,children:[T("div",{className:"custom-column-input-container",children:[T("div",{className:"d-flex flex-row pb-3 custom-column-name",children:[u("input",{className:z("form-control custom-column-input",{"is-invalid":l}),placeholder:"Column Name",value:t,onChange:d=>{s(e,ko.INPUT_TYPE.NAME,d.target.value)}}),T("button",{type:"button",className:"btn btn-link btn-link-icon ml-1 px-2",onClick:()=>{i(e)},children:[u(me,{children:"Delete custom column"}),u(G,{icon:Pn})]}),T("button",{type:"button",className:"btn btn-link btn-link-icon px-2 btn-drag-handle",...a.dragHandleProps,children:[u(me,{children:"Drag column to re-order"}),u(G,{icon:Gi})]})]}),u(la,{editorSettings:{language:"deephavenDb"},editorIndex:o,value:n,onContentChanged:this.handleFormulaEditorContentChanged,onTab:r,invalid:l})]}),u("hr",{})]})})}};let ir=ko;ir.INPUT_TYPE={NAME:"name",FORMULA:"formula"};ir.defaultProps={name:"",inputIndex:0,formula:"",onChange:()=>{},onDeleteColumn:()=>{},onTabInEditor:()=>{},invalid:!1};class aa extends Error{constructor(){super(...arguments),this.isAssertionFailed=!0}}function Xr(e){if(e==null)throw new aa(`Expected 'val' to be defined, but received ${e}`)}class bo extends Error{constructor(){super(...arguments),this.isPasteError=!0}}function Ae(e){return(e==null?void 0:e.isEditable)!==void 0}function Yr(e){if(!Ae(e))throw new aa(`Expected 'model' to be editable, but received ${e}`)}function Xe(e){return(e==null?void 0:e.hasExpandableRows)!==void 0}var Lt=(e=>(e.DOWN="DOWN",e.UP="UP",e.LEFT="LEFT",e.RIGHT="RIGHT",e))(Lt||{});const de=class{static normalize(e,t,n,s){let i=e,o=t,r=n,l=s;return i!=null&&r!=null&&r<i&&(i=r,r=e),o!=null&&l!=null&&l<o&&(o=l,l=t),[i,o,r,l]}static makeNormalized(e,t,n,s){return new de(...de.normalize(e,t,n,s))}static makeCell(e,t){return new de(e,t,e,t)}static makeColumn(e){return new de(e,null,e,null)}static makeRow(e){return new de(null,e,null,e)}static minOrNull(e,t){return e==null||t==null?null:Math.min(e,t)}static maxOrNull(e,t){return e==null||t==null?null:Math.max(e,t)}static consolidate(e){const t=e.slice();let n=!0;for(;n;){n=!1;for(let s=0;s<t.length&&!n;s+=1){const i=t[s];for(let o=t.length-1;o>s;o-=1){const r=t[o];if(i.contains(r))t.splice(o,1);else if(r.contains(i)){n=!0,t[s]=r,t.splice(o,1);break}else if(i.startRow===r.startRow&&i.endRow===r.endRow){if(i.touches(r)){const{startRow:l,endRow:a}=i,c=de.minOrNull(i.startColumn,r.startColumn),d=de.maxOrNull(i.endColumn,r.endColumn);n=!0,t[s]=new de(c,l,d,a),t.splice(o,1);break}}else if(i.startColumn===r.startColumn&&i.endColumn===r.endColumn&&i.touches(r)){const{startColumn:l,endColumn:a}=i,c=de.minOrNull(i.startRow,r.startRow),d=de.maxOrNull(i.endRow,r.endRow);n=!0,t[s]=new de(l,c,a,d),t.splice(o,1);break}}}}return t}static isAxisRangeTouching(e,t,n,s){return e==null?t==null||n==null?!0:n<=t+1:t==null?s==null?!0:s>=e-1:n==null?s==null?!0:e<=s+1:s==null?t>=n-1:n>=e-1?n<=t+1:s>=e-1}static rangeArraysEqual(e,t){if(e===t)return!0;if(e==null||t==null||e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!e[n].equals(t[n]))return!1;return!0}static intersection(e,t){if(e.equals(t))return e;let{startColumn:n,startRow:s,endColumn:i,endRow:o}=e;return n=n!=null&&t.startColumn!=null?Math.max(n,t.startColumn):n!=null?n:t.startColumn,i=i!=null&&t.endColumn!=null?Math.min(i,t.endColumn):i!=null?i:t.endColumn,s=s!=null&&t.startRow!=null?Math.max(s,t.startRow):s!=null?s:t.startRow,o=o!=null&&t.endRow!=null?Math.min(o,t.endRow):o!=null?o:t.endRow,n!=null&&n>(i!=null?i:-1)||s!=null&&s>(o!=null?o:-1)?null:new de(n,s,i,o)}static subtractFromRange(e,t){const n=[],s=de.intersection(e,t);return s==null?[e]:(s.startRow!=null&&(e.startRow==null||e.startRow<s.startRow)&&n.push(new de(e.startColumn,e.startRow,e.endColumn,s.startRow-1)),s.startColumn!=null&&(e.startColumn==null||e.startColumn<s.startColumn)&&n.push(new de(e.startColumn,s.startRow,s.startColumn-1,s.endRow)),s.endColumn!=null&&(e.endColumn==null||e.endColumn>s.endColumn)&&n.push(new de(s.endColumn+1,s.startRow,e.endColumn,s.endRow)),s.endRow!=null&&(e.endRow==null||e.endRow>s.endRow)&&n.push(new de(e.startColumn,s.endRow+1,e.endColumn,e.endRow)),n)}static subtractFromRanges(e,t){const n=[];for(let s=0;s<e.length;s+=1)n.push(...de.subtractFromRange(e[s],t));return n}static subtractRangesFromRanges(e,t){if(!t||t.length===0)return e;let n=[...e];for(let s=0;s<t.length;s+=1)n=de.subtractFromRanges(n,t[s]);return n}static isBounded(e){return e.startRow!=null&&e.startColumn!=null&&e.endRow!=null&&e.endColumn!=null}static boundedRange(e,t,n){var s,i,o,r;return de.isBounded(e)?e:new de((s=e.startColumn)!=null?s:0,(i=e.startRow)!=null?i:0,(o=e.endColumn)!=null?o:t-1,(r=e.endRow)!=null?r:n-1)}static boundedRanges(e,t,n){return e.map(s=>de.boundedRange(s,t,n))}static offset(e,t,n){return new de(e.startColumn!=null?e.startColumn+t:null,e.startRow!=null?e.startRow+n:null,e.endColumn!=null?e.endColumn+t:null,e.endRow!=null?e.endRow+n:null)}static nextCell(e,t=null,n=null,s=de.SELECTION_DIRECTION.DOWN){if(e.length===0)return null;let i=-1;if(t!=null&&n!=null&&(i=e.findIndex(o=>o.containsCell(t,n)),i>=0)){const r=e[i].nextCell(t,n,s);if(r!=null)return r}switch(s){case de.SELECTION_DIRECTION.DOWN:case de.SELECTION_DIRECTION.RIGHT:{const o=i<e.length-1?i+1:0;return e[o].startCell(s)}case de.SELECTION_DIRECTION.LEFT:case de.SELECTION_DIRECTION.UP:{const o=i>0?i-1:e.length-1;return e[o].startCell(s)}default:throw new Error(`Invalid direction: ${s}`)}}static cellCount(e){return e.reduce((t,n)=>{var s,i,o,r;return t+(((s=n.endRow)!=null?s:NaN)-((i=n.startRow)!=null?i:NaN)+1)*(((o=n.endColumn)!=null?o:NaN)-((r=n.startColumn)!=null?r:NaN)+1)},0)}static rowCount(e){return e.reduce((t,n)=>{var s,i;return t+((s=n.endRow)!=null?s:NaN)-((i=n.startRow)!=null?i:NaN)+1},0)}static columnCount(e){return e.reduce((t,n)=>{var s,i;return t+((s=n.endColumn)!=null?s:NaN)-((i=n.startColumn)!=null?i:NaN)+1},0)}static containsCell(e,t,n){for(let s=0;s<e.length;s+=1)if(e[s].containsCell(t,n))return!0;return!1}static forEachCell(e,t,n=de.SELECTION_DIRECTION.RIGHT){for(let s=0;s<e.length;s+=1)e[s].forEach(t,n)}constructor(e,t,n,s){this.startColumn=e,this.startRow=t,this.endColumn=n,this.endRow=s}equals(e){return this.startColumn===e.startColumn&&this.startRow===e.startRow&&this.endColumn===e.endColumn&&this.endRow===e.endRow}contains(e){return(this.startColumn==null||e.startColumn!=null&&this.startColumn<=e.startColumn)&&(this.startRow==null||e.startRow!=null&&this.startRow<=e.startRow)&&(this.endColumn==null||e.endColumn!=null&&this.endColumn>=e.endColumn)&&(this.endRow==null||e.endRow!=null&&this.endRow>=e.endRow)}containsCell(e,t){return e==null||t==null?!1:(this.startColumn==null||this.startColumn<=e)&&(this.endColumn==null||this.endColumn>=e)&&(this.startRow==null||this.startRow<=t)&&(this.endRow==null||this.endRow>=t)}touches(e){return de.isAxisRangeTouching(this.startRow,this.endRow,e.startRow,e.endRow)&&de.isAxisRangeTouching(this.startColumn,this.endColumn,e.startColumn,e.endColumn)}subtract(e){return de.subtractFromRange(this,e)}startCell(e=de.SELECTION_DIRECTION.DOWN){if(!de.isBounded(this))throw new Error("Cannot get the startCell of an unbounded range");switch(e){case de.SELECTION_DIRECTION.DOWN:case de.SELECTION_DIRECTION.RIGHT:return{column:this.startColumn,row:this.startRow};case de.SELECTION_DIRECTION.LEFT:case de.SELECTION_DIRECTION.UP:return{column:this.endColumn,row:this.endRow};default:throw new Error(`Invalid direction: ${e}`)}}nextCell(e,t,n){if(!de.isBounded(this))throw new Error("Bounded range required");if(e==null||t==null)throw new Error("Require a non-null cursor");const{startColumn:s,endColumn:i,startRow:o,endRow:r}=this;switch(n){case de.SELECTION_DIRECTION.DOWN:if(t<r)return{column:e,row:Math.max(t+1,o)};if(e<i)return{column:Math.max(e+1,s),row:o};break;case de.SELECTION_DIRECTION.UP:if(t>o)return{column:e,row:Math.min(t-1,r)};if(e>s)return{column:Math.min(e-1,i),row:r};break;case de.SELECTION_DIRECTION.RIGHT:if(e<i)return{column:Math.max(e+1,s),row:t};if(t<r)return{column:s,row:Math.max(t+1,o)};break;case de.SELECTION_DIRECTION.LEFT:if(e>s)return{column:Math.min(e-1,i),row:t};if(t>o)return{column:i,row:Math.min(t-1,r)};break;default:throw new Error(`Invalid direction: ${n}`)}return null}forEach(e,t=de.SELECTION_DIRECTION.RIGHT){var o;let n=0,{column:s,row:i}=this.startCell(t);for(;s!=null&&i!=null;)e(s,i,n),n+=1,{column:s,row:i}=(o=this.nextCell(s,i,t))!=null?o:{}}};let Y=de;Y.SELECTION_DIRECTION=Lt;function Ph(e){return Array.isArray(e)&&e.length===2&&(e[0]===null||typeof e[0]=="number")&&(e[1]===null||typeof e[1]=="number")}function wo(e){return Ph(e)&&e[0]!=null&&e[1]!=null}const Ce=class{static getGridPointFromXY(e,t,n){const s=Ce.getColumnAtX(e,n),i=Ce.getRowAtY(t,n),o=Ce.getColumnHeaderDepthAtY(t,n);return{x:e,y:t,row:i,column:s,columnHeaderDepth:o}}static getCellInfoFromXY(e,t,n){const{row:s,column:i}=Ce.getGridPointFromXY(e,t,n),{visibleColumnWidths:o,visibleRowHeights:r,visibleColumnXs:l,visibleRowYs:a,modelColumns:c,modelRows:d}=n,h=s!==null?d.get(s):null,m=i!==null?c.get(i):null,p=i!==null?l.get(i):null,g=s!==null?a.get(s):null,f=i!==null?o.get(i):null,b=s!==null?r.get(s):null;return{row:s,column:i,modelRow:h!=null?h:null,modelColumn:m!=null?m:null,left:p!=null?p:null,top:g!=null?g:null,columnWidth:f!=null?f:null,rowHeight:b!=null?b:null}}static getColumnHeaderDepthAtY(e,t){const n=Ce.getRowAtY(e,t),{columnHeaderHeight:s,columnHeaderMaxDepth:i}=t;if(n===null&&e<=s*i)return lt(i-Math.ceil(e/s),0,i-1)}static iterateFloatingStart(e,t,n){for(let s=0;s<e&&s<t;s+=1){const i=n(s);if(i!==void 0)return i}}static iterateFloatingEnd(e,t,n){for(let s=0;s<e&&t-(e-s)>=0;s+=1){const i=n(t-(e-s));if(i!==void 0)return i}}static iterateFloating(e,t,n,s){const i=Ce.iterateFloatingStart(e,n,s);return i!==void 0?i:Ce.iterateFloatingEnd(t,n,s)}static iterateAllItems(e,t,n,s,i,o){const r=Math.max(e,n),l=Math.min(t,i-s-1);let a=Ce.iterateFloating(n,s,i,o);if(a!==void 0)return a;for(let c=r;c<=l;c+=1)if(a=o(c),a!==void 0)return a}static isInItem(e,t,n,s){var r,l;const i=(r=t.get(e))!=null?r:0,o=(l=n.get(e))!=null?l:0;return i<=s&&s<=i+o}static getItemAtOffset(e,t,n,s,i,o,r,l=!1){const a=l?void 0:Ce.iterateFloating(n,s,t,c=>{if(Ce.isInItem(c,o,r,e))return c});if(!l&&a!==void 0)return a;for(let c=0;c<i.length;c+=1){const d=i[c];if(Ce.isInItem(d,o,r,e))return d}return null}static getColumnAtX(e,t,n=!1){const{columnCount:s,floatingLeftColumnCount:i,floatingRightColumnCount:o,visibleColumns:r,visibleColumnXs:l,visibleColumnWidths:a,gridX:c}=t;return e<c?null:this.getItemAtOffset(e-c,s,i,o,r,l,a,n)}static getRowAtY(e,t){const{floatingTopRowCount:n,floatingBottomRowCount:s,rowCount:i,visibleRows:o,visibleRowYs:r,visibleRowHeights:l,gridY:a}=t;return e<a?null:this.getItemAtOffset(e-a,i,n,s,o,r,l)}static getNextShownItem(e,t,n,s){let i=n.findIndex(o=>o===e)||0;for(i-=1;i!=null&&i>=0;){const o=n[i],r=t.get(o);if(r!=null&&s.get(r)!==0)return o;i-=1}return null}static getNextShownColumn(e,t){const{modelColumns:n,visibleColumns:s,userColumnWidths:i}=t;return Ce.getNextShownItem(e,n,s,i)}static getNextShownRow(e,t){const{modelRows:n,visibleRows:s,userRowHeights:i}=t;return Ce.getNextShownItem(e,n,s,i)}static getColumnSeparatorIndex(e,t,n,s){var C,w,S,I;const{rowHeaderWidth:i,columnHeaderHeight:o,floatingColumns:r,floatingLeftWidth:l,visibleColumns:a,visibleColumnXs:c,visibleColumnWidths:d,columnHeaderMaxDepth:h}=n,{allowColumnResize:m,headerSeparatorHandleSize:p}=s;if(h*o<t||!m||p<=0)return null;const g=e-i,f=p*.5;let b=!1;for(let v=r.length-1;v>=0;v-=1){const E=r[v],M=(C=c.get(E))!=null?C:0,F=(w=d.get(E))!=null?w:0,k=F===0;if(!b||!k){let P=M+F;k?P+=f:b&&(P-=f);const L=P-f,N=P+f;if(L<=g&&g<=N)return E;b=k}}b=!1;for(let v=a.length-1;v>=0;v-=1){const E=a[v],M=(S=c.get(E))!=null?S:0,F=(I=d.get(E))!=null?I:0,k=F===0;if(M<l-F)return null;if(!b||!k){let P=M+F;k?P+=f:b&&(P-=f);const L=P-f,N=P+f;if(L<=g&&g<=N)return E;b=k}}return null}static isItemHidden(e,t){return t.get(e)===0}static isColumnHidden(e,t){const{visibleColumnWidths:n}=t;return Ce.isItemHidden(e,n)}static isFloatingRow(e,t){if(e==null)return!1;const{floatingTopRowCount:n,floatingBottomRowCount:s,rowCount:i}=t;return e<n||e>=i-s}static isFloatingColumn(e,t){if(e==null)return!1;const{floatingLeftColumnCount:n,floatingRightColumnCount:s,columnCount:i}=t;return e<n||e>=i-s}static getHiddenItems(e,t,n){if(!Ce.isItemHidden(e,t))return[];const s=[e],i=n.findIndex(o=>o===e);for(let o=i-1;o>=0;o-=1){const r=n[o];if(!Ce.isItemHidden(r,t))break;s.push(r)}return s}static getHiddenColumns(e,t){const{visibleColumns:n,visibleColumnWidths:s}=t;return Ce.getHiddenItems(e,s,n)}static getRowSeparatorIndex(e,t,n,s){var g,f;const{rowHeaderWidth:i,columnHeaderHeight:o,visibleRows:r,visibleRowYs:l,visibleRowHeights:a}=n,{allowRowResize:c,headerSeparatorHandleSize:d}=s;if(i<e||!c||d<=0)return null;const h=t-o,m=d*.5;let p=!1;for(let b=r.length-1;b>=0;b-=1){const C=r[b],w=(g=l.get(C))!=null?g:0,S=(f=a.get(C))!=null?f:0,I=S===0;if(!p||!I){let v=w+S;I?v+=m:p&&(v-=m);const E=v-m,M=v+m;if(E<=h&&h<=M)return C;p=I}}return null}static isRowHidden(e,t){const{visibleRowHeights:n}=t;return Ce.isItemHidden(e,n)}static getHiddenRows(e,t){const{visibleRows:n,visibleRowHeights:s}=t;return Ce.getHiddenItems(e,s,n)}static moveItem(e,t,n){if(e===t)return n;const s=[...n],i=s[s.length-1];return i&&!wo(i.from)&&i.to===e?i.from===t?s.pop():s[s.length-1]={...i,to:t}:s.push({from:e,to:t}),s}static moveRange(e,t,n){if(e[0]===t)return n;const s=[...n],i=s[s.length-1];return i&&wo(i.from)&&i.from[1]-i.from[0]===e[1]-e[0]&&i.to===e[0]?i.from[0]===t?s.pop():s[s.length-1]={...i,to:t}:s.push({from:e,to:t}),s[s.length-1].from===s[s.length-1].to&&s.pop(),s}static applyItemMoves(e,t,n,s=!1){var o,r;let i=[[e,t]];for(let l=s?n.length-1:0;s?l>=0:l<n.length;s?l-=1:l+=1){const{from:a,to:c}=n[l];let d=1,h;wo(a)?(d=a[1]-a[0]+1,[h]=a):h=a;const m=s?c:h,p=m+d-1,g=s?h:c,f=g-m,b=[];for(let C=0;C<i.length;C+=1){const w=(o=i[C][0])!=null?o:Number.NEGATIVE_INFINITY,S=(r=i[C][1])!=null?r:Number.POSITIVE_INFINITY;let I;const v=[[w,m-1],[m,p],[p+1,S]].map(([E,M])=>[Math.max(E,w),Math.min(M,S)]).filter(([E,M])=>E<=M).map(E=>{const[M,F]=E;return m<=M&&p>=F?(I=[M+f,F+f],I):p<M?[M-d,F-d]:E}).map(E=>{const[M,F]=E;return g>M&&g<=F?[[M,g-1],[g+d,F+d]]:E===I?[E]:g<=M?[[M+d,F+d]]:[E]}).flat();b.push(...v)}i=b.map(([C,w])=>[Number.isFinite(C)?C:null,Number.isFinite(w)?w:null])}return i}static translateRange(e,t,n,s){const i=Ce.applyItemMoves(e.startColumn,e.endColumn,t,s),o=Ce.applyItemMoves(e.startRow,e.endRow,n,s),r=[];for(let l=0;l<i.length;l+=1){const a=i[l];for(let c=0;c<o.length;c+=1){const d=o[c];r.push(new Y(a[0],d[0],a[1],d[1]))}}return r}static getModelIndex(e,t){return Ce.applyItemMoves(e,e,t,!0)[0][0]}static getModelIndexes(e,t){return e.map(n=>Ce.getModelIndex(n,t))}static getModelRangeIndexes(e,t,n){return Ce.applyItemMoves(e,t,n,!0)}static getModelRange(e,t=[],n=[]){return Ce.translateRange(e,t,n,!0)}static getModelRanges(e,t=[],n=[]){const s=[];for(let i=0;i<e.length;i+=1)s.push(...Ce.getModelRange(e[i],t,n));return s}static getVisibleRangeIndexes(e,t,n){return Ce.applyItemMoves(e,t,n,!1)}static getVisibleRange(e,t=[],n=[]){return this.translateRange(e,t,n,!1)}static getVisibleRanges(e,t=[],n=[]){const s=[];for(let i=0;i<e.length;i+=1)s.push(...Ce.getVisibleRange(e[i],t,n));return s}static getVisibleIndex(e,t){return Ce.applyItemMoves(e,e,t)[0][0]}static getVisibleIndexes(e,t){return e.map(n=>Ce.getVisibleIndex(n,t))}static isMacPlatform(){const{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return Ce.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){const t=Ce.getModifierKey();return e[t]}static checkColumnHidden(e,t){return t.get(e)===0}static checkAllColumnsHidden(e,t){return t.size===0?!1:e.every(n=>t.get(n)===0)}static getScrollDragBounds(e,t,n){const{gridX:s,gridY:i,width:o,height:r,floatingTopRowCount:l,floatingBottomRowCount:a,floatingLeftColumnCount:c,floatingRightColumnCount:d,floatingLeftWidth:h,floatingRightWidth:m,floatingTopHeight:p,floatingBottomHeight:g,columnCount:f,rowCount:b}=e;let C=s,w=i,S=o,I=r;return n!=null&&(n>c&&(C+=h),n<f-d&&(S-=m)),t!=null&&(t>l&&(w+=p),t<b-a&&(I-=g)),{x1:C,y1:w,x2:S,y2:I}}static getScrollDelta(e,t=1024,n=768,s=20,i=20){let{deltaX:o,deltaY:r}=e;return!Ce.isMacPlatform()&&e.shiftKey&&e.deltaX===0&&e.deltaY!==0&&(o=e.deltaY,r=e.deltaX),(e==null?void 0:e.deltaMode)===WheelEvent.DOM_DELTA_PAGE?(o*=t,r*=n):(e==null?void 0:e.deltaMode)===WheelEvent.DOM_DELTA_LINE&&(Ce.isMacPlatform()?(o=Math.round(o*s),r=Math.round(r*i)):(o=Math.round(o*this.PIXELS_PER_LINE),r=Math.round(r*this.PIXELS_PER_LINE))),{deltaX:o,deltaY:r}}static compareRanges(e,t){return e[0]==null||e[1]==null||t[0]==null||t[1]==null?0:e[0]!==t[0]?e[0]-t[0]:e[1]-t[1]}static mergeSortedRanges(e){const t=[];for(let n=0;n<e.length;n+=1){const s=e[n],i=s[0],o=s[1];n===0?t.push([i,o]):i-1<=t[t.length-1][1]?t[t.length-1][1]=Math.max(t[t.length-1][1],o):t.push([i,o])}return t}};let V=Ce;V.PIXELS_PER_LINE=100/3;function A(e,t,n=void 0){var i;const s=(i=e.get(t))!=null?i:n;if(s!==void 0)return s;throw new Error(`Missing value for key ${t}`)}function bi(e,t=Qs.CACHE_SIZE,n=Math.floor(t/2)){if(e.size>t){const s=e.keys();for(;e.size>n;)e.delete(s.next().value)}}function Qr(e,t,n,s,i){const o=new Map;let r=0;for(let l=0;l<e&&l<n;l+=1)o.set(l,r),r+=A(i,l);r=s;for(let l=0;l<t&&n-l-1>=0;l+=1)r-=A(i,n-l-1),o.set(n-l-1,r);return o}const ca=class{constructor({userColumnWidths:e=new Map,userRowHeights:t=new Map,calculatedColumnWidths:n=new Map,calculatedRowHeights:s=new Map,fontWidths:i=new Map,modelRows:o=new Map,modelColumns:r=new Map,movedRows:l=[],movedColumns:a=[]}={}){this.userColumnWidths=e,this.userRowHeights=t,this.calculatedRowHeights=s,this.calculatedColumnWidths=n,this.fontWidths=i,this.modelRows=o,this.modelColumns=r,this.movedRows=l,this.movedColumns=a}getMetrics(e){const{left:t,top:n,leftOffset:s,topOffset:i,width:o,height:r,theme:l,model:a,movedRows:c,movedColumns:d,draggingColumn:h}=e,{rowHeight:m,rowHeaderWidth:p,rowFooterWidth:g,columnWidth:f,columnHeaderHeight:b,minScrollHandleSize:C,scrollBarSize:w}=l;c!==this.movedRows&&(this.movedRows=c,this.modelRows.clear()),d!==this.movedColumns&&(this.movedColumns=d,this.modelColumns.clear());const{columnCount:S,rowCount:I,floatingTopRowCount:v,floatingBottomRowCount:E,floatingLeftColumnCount:M,floatingRightColumnCount:F,columnHeaderMaxDepth:k}=a,P=this.getFirstRow(e),L=this.getFirstColumn(e),N=this.getGridX(e),B=this.getGridY(e),U=Xe(a)&&a.hasExpandableRows?this.calculateTreePaddingX(e):0,H=0;let _=this.getVisibleRowHeights(e),$=this.getVisibleColumnWidths(e,L,U);const K=Array.from(_.keys()),j=Array.from($.keys());_=new Map([..._,...this.getFloatingRowHeights(e)]),$=new Map([...$,...this.getFloatingColumnWidths(e)]);let re=this.getVisibleColumnXs($,j,s),ne=this.getVisibleRowYs(_,K,i);const ge=K.length>0?K[K.length-1]:n,ce=j.length>0?j[j.length-1]:t,Fe=this.getBottomViewport(e,K,ne,_),Ye=this.getRightViewport(e,j,re,$),$e=this.getFloatingTopHeight(e,_),_e=this.getFloatingBottomHeight(e,_),Ue=this.getFloatingLeftWidth(e,$),Je=this.getFloatingRightWidth(e,$),Le=Array.from($.values()),Ht=Array.from(_.values()),Vn=Le.reduce((We,ps)=>We+ps,0)-s,Jt=Ht.reduce((We,ps)=>We+ps,0)-i,st=this.getLastLeft(e,null,o-N-w-g),pe=this.getLastTop(e,null,r-B-w-_e),Ge=s+Vn+g,Be=i+Jt,ut=o-N,Mt=r-B,Dt=st>0||Ge>ut,mt=Dt?w:0,Un=pe>0||Be>Mt-mt,Nt=Un?w:0,Ft=o-p-Nt,Bn=r-b-mt,to=p,no=b,so=S===1?Ft/Ge:(S-st)/S,ti=I===1?Bn/Be:(I-pe)/I,ni=Dt?lt(Ft*so,C,Ft-1):0,si=Un?lt(Bn*ti,C,Bn-1):0,ii=A($,t,0),oi=A(_,n,0),ri=ii>0?s/ii:0,li=oi>0?i/oi:0,io=S===1?s/(Ge-ut):(t+ri)/st,oo=I===1?i/(Be-Mt):(n+li)/pe,Wn=Dt?io*(Ft-ni):0,ro=Un?oo*(Bn-si):0;let ms=[];(v>0||E>0)&&(ms=[...Array(v).keys(),...[...Array(E).keys()].map(We=>I-We-1)],ne=new Map([...ne,...this.getFloatingRowYs(e,_,Math.floor(r-B-mt))]));let xs=[];(M>0||F>0)&&(xs=[...Array(M).keys(),...[...Array(F).keys()].map(We=>S-We-1)],re=new Map([...re,...this.getFloatingColumnXs(e,$,Math.floor(o-N-Nt))]));const ai=[];if(h)for(let We=h.range[0];We<=h.range[1];We+=1)ai.push(We),$.has(We)||$.set(We,this.getVisibleColumnWidth(We,e)),re.has(We)||re.set(We,0);const ci=K.concat(ms),Os=j.concat(xs).concat(ai),As=this.getModelRows(ci,e),lo=this.getModelColumns(Os,e),ao=this.getVisibleRowTreeBoxes(_,As,e),di=this.getTopVisible(e,ne,_,K),co=this.getLeftVisible(e,re,$,j),hi=pe>0?this.getBottomVisible(e,ne,_,K,B):ge,ui=st>0?this.getRightVisible(e,re,$,j,N):ce,{fontWidths:mi,userColumnWidths:pi,userRowHeights:gi,calculatedRowHeights:ho,calculatedColumnWidths:uo}=this;return{rowHeight:m,rowHeaderWidth:p,rowFooterWidth:g,rowCount:I,columnWidth:f,columnCount:S,columnHeaderHeight:b,floatingTopRowCount:v,floatingBottomRowCount:E,floatingLeftColumnCount:M,floatingRightColumnCount:F,gridX:N,gridY:B,firstRow:P,firstColumn:L,treePaddingX:U,treePaddingY:H,left:t,top:n,bottom:ge,right:ce,topOffset:i,leftOffset:s,topVisible:di,leftVisible:co,bottomVisible:hi,rightVisible:ui,bottomViewport:Fe,rightViewport:Ye,width:o,height:r,maxX:Vn,maxY:Jt,lastLeft:st,lastTop:pe,barHeight:Bn,barTop:no,barWidth:Ft,barLeft:to,handleHeight:si,handleWidth:ni,hasHorizontalBar:Dt,hasVerticalBar:Un,verticalBarWidth:Nt,horizontalBarHeight:mt,scrollX:Wn,scrollY:ro,scrollableContentWidth:Ge,scrollableContentHeight:Be,scrollableViewportWidth:ut,scrollableViewportHeight:Mt,visibleRows:K,visibleColumns:j,floatingRows:ms,floatingColumns:xs,allRows:ci,allColumns:Os,visibleRowHeights:_,visibleColumnWidths:$,floatingTopHeight:$e,floatingBottomHeight:_e,floatingLeftWidth:Ue,floatingRightWidth:Je,visibleRowYs:ne,visibleColumnXs:re,visibleRowTreeBoxes:ao,modelRows:As,modelColumns:lo,movedRows:c,movedColumns:d,fontWidths:mi,userColumnWidths:pi,userRowHeights:gi,calculatedRowHeights:ho,calculatedColumnWidths:uo,columnHeaderMaxDepth:k}}getGridX(e){const{theme:t}=e,{rowHeaderWidth:n}=t;return n}getGridY(e){const{theme:t,model:n}=e,{columnHeaderHeight:s}=t,{columnHeaderMaxDepth:i}=n;return i*s}getVisibleHeight(e,t=this.getFloatingRowHeights(e)){const{height:n,theme:s}=e,{scrollBarSize:i}=s,o=this.getGridY(e),r=this.getFloatingBottomHeight(e,t),l=this.getFloatingTopHeight(e,t);return n-r-l-o-i}getVisibleWidth(e,t=this.getFloatingColumnWidths(e)){const{width:n,theme:s}=e,{scrollBarSize:i,rowFooterWidth:o}=s,r=this.getGridX(e),l=this.getFloatingRightWidth(e,t),a=this.getFloatingLeftWidth(e,t);return n-a-l-r-i-o}getFirstIndex(e,t,n){const s=e.size+1;for(let i=0;i<s;i+=1){const o=t(i,n);if(e.get(o)!==0)return i}return 0}getFirstColumn(e){return this.getFirstIndex(this.userColumnWidths,this.getModelColumn.bind(this),e)}getFirstRow(e){return this.getFirstIndex(this.userRowHeights,this.getModelRow.bind(this),e)}getLastLeft(e,t=null,n=this.getVisibleWidth(e)){const{model:s}=e,{columnCount:i}=s;let o=i-1;t!=null&&(o=t);let r=0;for(;o>=0;){if(r+=this.getVisibleColumnWidth(o,e),r>=n)return Math.min(o+1,i-1);o-=1}return 0}getLastTop(e,t=null,n=this.getVisibleHeight(e)){const{model:s}=e,{rowCount:i,floatingBottomRowCount:o}=s;let r=Math.max(0,i-o-1);t!=null&&(r=t);let l=0;for(;r>0;){if(l+=this.getVisibleRowHeight(r,e),l>=n)return Math.min(r+1,i-1);r-=1}return 0}getTopForTopVisible(e,t){const n=this.getFloatingTopHeight(e);let s=t,i=0;for(;s>0&&i<n;)s-=1,i+=this.getVisibleRowHeight(s,e);return s}getTopForBottomVisible(e,t){const{height:n}=e,s=this.getGridY(e),i=this.getFloatingBottomHeight(e),o=n-s-i;return this.getLastTop(e,t,o)}getLeftForLeftVisible(e,t){const n=this.getFloatingLeftWidth(e);let s=t,i=0;for(;s>0&&i<n;)s-=1,i+=this.getVisibleColumnWidth(s,e);return s}getLeftForRightVisible(e,t){const{width:n}=e,s=this.getGridX(e),i=this.getFloatingRightWidth(e),o=n-s-i;return this.getLastLeft(e,t,o)}getFloatingRowHeights(e){const{model:t}=e,{floatingTopRowCount:n,floatingBottomRowCount:s,rowCount:i}=t,o=new Map;for(let r=0;r<n&&r<i;r+=1)o.set(r,this.getVisibleRowHeight(r,e));for(let r=0;r<s&&i-r-1>=0;r+=1){const l=i-r-1;o.set(l,this.getVisibleRowHeight(l,e))}return o}getVisibleRowHeights(e){const{top:t,topOffset:n,height:s,model:i}=e;let o=0,r=t;const l=new Map,{rowCount:a}=i;for(;o<s+n&&r<a;){const c=this.getVisibleRowHeight(r,e);l.set(r,c),o+=c,r+=1}return l}getFloatingColumnWidths(e,t=this.getFirstColumn(e),n=this.calculateTreePaddingX(e)){const{model:s}=e,{columnCount:i,floatingLeftColumnCount:o,floatingRightColumnCount:r}=s,l=new Map;for(let a=0;a<o&&a<i;a+=1)l.set(a,this.getVisibleColumnWidth(a,e,t,n));for(let a=0;a<r&&i-a-1>=0;a+=1){const c=i-a-1;l.set(c,this.getVisibleColumnWidth(c,e,t,n))}return l}getVisibleColumnWidths(e,t=this.getFirstColumn(e),n=this.calculateTreePaddingX(e)){const{left:s,leftOffset:i,width:o,model:r}=e;let l=0,a=s;const c=new Map,{columnCount:d}=r;for(;l<o+i&&a<d;){const h=this.getVisibleColumnWidth(a,e,t,n);c.set(a,h),l+=h,a+=1}return c}getFloatingColumnXs(e,t,n){const{model:s}=e,{columnCount:i,floatingLeftColumnCount:o,floatingRightColumnCount:r}=s;return Qr(o,r,i,n,t)}getVisibleColumnXs(e,t,n){const s=new Map;let i=-n;for(let o=0;o<t.length;o+=1){const r=t[o],l=A(e,r);s.set(r,i),i+=l}return s}getFloatingRowYs(e,t,n){const{model:s}=e,{floatingTopRowCount:i,floatingBottomRowCount:o,rowCount:r}=s;return Qr(i,o,r,n,t)}getVisibleRowYs(e,t,n){const s=new Map;let i=-n;for(let o=0;o<t.length;o+=1){const r=t[o],l=A(e,r);s.set(r,i),i+=l}return s}getVisibleRowTreeBoxes(e,t,n){const s=new Map,{model:i,theme:o}=n,{treeDepthIndent:r,treeHorizontalPadding:l}=o;return Xe(i)&&i.hasExpandableRows&&e.forEach((a,c)=>{const d=A(t,c);if(i.isRowExpandable(d)){const h=i.depthForRow(d),m=h*r+l,p=(h+1)*r+l,g=0,f=a;s.set(c,{x1:m,y1:g,x2:p,y2:f})}}),s}getFloatingLeftWidth(e,t=this.getFloatingColumnWidths(e)){const{model:n}=e,{floatingLeftColumnCount:s}=n;let i=0;for(let o=0;o<s;o+=1)i+=A(t,o);return i}getFloatingRightWidth(e,t=this.getFloatingColumnWidths(e)){const{model:n}=e,{floatingRightColumnCount:s,columnCount:i}=n;let o=0;for(let r=0;r<s;r+=1)o+=A(t,i-r-1);return o}getFloatingTopHeight(e,t=this.getFloatingRowHeights(e)){const{model:n}=e,{floatingTopRowCount:s}=n;let i=0;for(let o=0;o<s;o+=1)i+=A(t,o);return i}getFloatingBottomHeight(e,t=this.getFloatingRowHeights(e)){const{model:n}=e,{floatingBottomRowCount:s,rowCount:i}=n;let o=0;for(let r=0;r<s;r+=1)o+=A(t,i-r-1);return o}getTopVisible(e,t,n,s){const i=this.getFloatingTopHeight(e,n);for(let o=0;o<s.length;o+=1){const r=s[o];if(A(t,r)>=i)return r}return 0}getLeftVisible(e,t,n,s){const i=this.getFloatingLeftWidth(e,n);for(let o=0;o<s.length;o+=1){const r=s[o];if(A(t,r)>=i)return r}return 0}getBottomVisible(e,t,n,s,i){const{height:o,theme:r}=e,{scrollBarSize:l}=r,a=this.getFloatingBottomHeight(e,n),c=o-i-l-a;for(let d=s.length-1;d>=0;d-=1){const h=s[d],m=A(t,h),p=A(n,h);if(m+p<=c)return h}return 0}getRightVisible(e,t,n,s,i){const{width:o,theme:r}=e,{scrollBarSize:l}=r,a=this.getFloatingRightWidth(e,n),c=o-i-l-a;for(let d=s.length-1;d>=0;d-=1){const h=s[d],m=A(t,h),p=A(n,h);if(m+p<=c)return h}return 0}getBottomViewport(e,t,n,s){const{height:i,theme:o}=e,{rowHeight:r}=o;return this.getLastIndexViewport(t,n,s,i,r)}getRightViewport(e,t,n,s){const{width:i,theme:o}=e,{columnWidth:r}=o;return this.getLastIndexViewport(t,n,s,i,r)}getLastIndexViewport(e,t,n,s,i){let o=0,r=0;return e.length>0&&(o=e[e.length-1],r=A(t,o)+A(n,o)),r<s&&(o+=Math.ceil((s-r)/i)),o}getVisibleItemSize(e,t,n){var i;const s=n();return(i=t.get(e))!=null?i:s}getVisibleRowHeight(e,t){const n=this.getModelRow(e,t);return this.getVisibleItemSize(n,this.userRowHeights,()=>this.calculateRowHeight(e,n,t))}getVisibleColumnWidth(e,t,n=this.getFirstColumn(t),s=this.calculateTreePaddingX(t)){const i=this.getModelColumn(e,t);return this.getVisibleItemSize(i,this.userColumnWidths,()=>this.calculateColumnWidth(e,i,t,n,s))}getModelRows(e,t){const n=new Map;for(let s=0;s<e.length;s+=1){const i=e[s],o=this.getModelRow(i,t);n.set(i,o)}return n}getModelRow(e,t){if(this.modelRows.has(e))return A(this.modelRows,e);const{movedRows:n}=t,s=V.getModelIndex(e,n);return this.modelRows.set(e,s),s}getModelColumns(e,t){const n=new Map;for(let s=0;s<e.length;s+=1){const i=e[s],o=this.getModelColumn(i,t);n.set(i,o)}return n}getModelColumn(e,t){if(this.modelColumns.has(e))return A(this.modelColumns,e);const{movedColumns:n}=t,s=V.getModelIndex(e,n);return this.modelColumns.set(e,s),s}calculateRowHeight(e,t,n){const{theme:s}=n,{autoSizeRows:i,rowHeight:o}=s;if(!i)return o;const r=this.calculatedRowHeights.get(t);return r!=null?r:(this.calculatedRowHeights.set(t,Math.ceil(o)),bi(this.calculatedRowHeights),o)}calculateColumnWidth(e,t,n,s=this.getFirstColumn(n),i=this.calculateTreePaddingX(n)){const{theme:o}=n,{autoSizeColumns:r,minColumnWidth:l}=o;if(!r){const{columnWidth:m}=o;return m}const a=this.calculateColumnHeaderWidth(t,n),c=this.calculateColumnDataWidth(t,n),d=this.calculatedColumnWidths.get(t);let h=Math.ceil(Math.max(a,c));return h=Math.max(l,h),d!=null&&d>h?h=d:(this.calculatedColumnWidths.set(t,h),bi(this.calculatedColumnWidths)),e===s&&(h+=i),h}calculateColumnHeaderWidth(e,t){const{model:n,theme:s}=t,{headerFont:i,headerHorizontalPadding:o}=s,r=n.textForColumnHeader(e,0);if(r){const l=this.getWidthForFont(i,t);return r.length*l+o*2}return o*2}calculateColumnDataWidth(e,t){const{top:n,height:s,width:i,model:o,theme:r}=t,{floatingTopRowCount:l,floatingBottomRowCount:a,rowCount:c}=o,{font:d,cellHorizontalPadding:h,rowHeight:m,rowHeaderWidth:p,rowFooterWidth:g,scrollBarSize:f}=r;let b=0;const C=this.getWidthForFont(d,t),w=s/m,S=Math.ceil(n+w);return V.iterateAllItems(n,S,l,a,c,I=>{const v=this.getModelRow(I,t),E=o.textForCell(e,v);if(E){const M=h*2;b=Math.max(b,E.length*C+M)}}),b=Math.max(Math.min(b,(i-p-f-g)*ca.MAX_COLUMN_WIDTH),h*2),b}calculateTreePaddingX(e){const{top:t,height:n,model:s,theme:i}=e,{rowHeight:o,treeDepthIndent:r}=i;if(!Xe(s)||!s.hasExpandableRows)return 0;let l=0;const a=n/o,c=Math.ceil(t+a);for(let d=t;d<=c;d+=1){const h=this.getModelRow(d,e),m=s.depthForRow(h);l=Math.max(l,r*(m+1))}return l}getWidthForFont(e,t){if(this.fontWidths.has(e))return A(this.fontWidths,e);const{context:n}=t;n.font=e;const s=n.measureText("8"),{width:i}=s;return this.fontWidths.set(e,i),this.fontWidths.set(n.font,i),i}setColumnWidth(e,t){const n=new Map(this.userColumnWidths);n.set(e,Math.ceil(t)),bi(n),this.userColumnWidths=n}resetColumnWidth(e){const t=new Map(this.userColumnWidths);t.delete(e),this.userColumnWidths=t}setRowHeight(e,t){const n=new Map(this.userRowHeights);n.set(e,Math.ceil(t)),bi(n),this.userRowHeights=n}resetRowHeight(e){const t=new Map(this.userRowHeights);t.delete(e),this.userRowHeights=t,this.calculatedRowHeights.delete(e)}};let Qs=ca;Qs.CACHE_SIZE=1e4;Qs.MAX_COLUMN_WIDTH=.8;const Hh=Object.freeze({allowColumnResize:!0,allowRowResize:!0,autoSelectRow:!1,autoSelectColumn:!1,autoSizeColumns:!0,autoSizeRows:!0,backgroundColor:"#000000",cellHorizontalPadding:5,headerHorizontalPadding:5,font:"12px Arial, sans serif",gridColumnColor:"#8f8f8f66",gridRowColor:"#8f8f8f66",headerBackgroundColor:"#222222",headerSeparatorColor:"#000000",headerSeparatorHoverColor:"#888888",headerSeparatorHandleSize:5,headerHiddenSeparatorSize:5,headerHiddenSeparatorHoverColor:"#8888FF",headerColor:"#d5d5d5",headerFont:"10px Arial, sans serif",columnHoverBackgroundColor:"#444444",selectedColumnHoverBackgroundColor:"#494949",rowBackgroundColors:"#333333 #222222",rowHoverBackgroundColor:"#444444",selectedRowHoverBackgroundColor:"#494949",minScrollHandleSize:50,scrollBarBackgroundColor:"#111111",scrollBarHoverBackgroundColor:"#333333",scrollBarCasingColor:"#000000",scrollBarCornerColor:"#000000",scrollBarColor:"#555555",scrollBarHoverColor:"#888888",scrollBarActiveColor:"#AAAAAA",scrollBarSize:12,scrollBarHoverSize:16,scrollBarCasingWidth:1,scrollSnapToColumn:!1,scrollSnapToRow:!1,selectionColor:"#4286f433",selectionOutlineColor:"#4286f4",selectionOutlineCasingColor:"#222222",scrollBarSelectionTick:!0,scrollBarSelectionTickColor:"#4286f433",scrollBarActiveSelectionTickColor:"#4286f480",shadowBlur:8,shadowColor:"#000000",textColor:"#ffffff",maxDepth:6,treeDepthIndent:10,treeHorizontalPadding:5,treeLineColor:"#888888",treeMarkerColor:"#cccccc",treeMarkerHoverColor:"#ffffff",rowHeight:20,columnWidth:100,minRowHeight:20,minColumnWidth:55,columnHeaderHeight:20,rowHeaderWidth:30,rowFooterWidth:0,headerResizeSnapThreshold:10,headerResizeHiddenSnapThreshold:8,allowColumnReorder:!0,allowRowReorder:!0,reorderOffset:2,floatingGridColumnColor:"#8f8f8f66",floatingGridRowColor:"#8f8f8f66",floatingRowBackgroundColors:"#393939 #292929",floatingDividerOuterColor:"#000000",floatingDividerInnerColor:"#cccccc"}),yt=(e,t)=>{let n=!1;const s=ue(e,{...t,dispose:()=>{n||(n=!0,s.clear(),n=!1)}});return s};function _h(e,t,n=6){const s=Fo.hex.lab.raw(e);return s[0]=Math.max(s[0]-s[0]/n*t,0),`#${Fo.lab.hex(s)}`}function Vh(e,t){const[n,s,i]=Fo.hex.rgb(e);return`rgba(${n}, ${s}, ${i}, ${t})`}const jr={colorWithAlpha:Vh,darkenForDepth:_h};class Ze{constructor(t=5e3){this.cursor=null,this.order=t}onDown(t,n,s){return!1}onMove(t,n,s){return!1}onDrag(t,n,s){return!1}onLeave(t,n,s){return!1}onClick(t,n,s){return!1}onContextMenu(t,n,s){return!1}onDoubleClick(t,n,s){return!1}onUp(t,n,s){return!1}onWheel(t,n,s){return!1}}class da extends Ze{constructor(){super(...arguments),this.resizingItems=[],this.hiddenItems=[],this.targetSizes=new Map,this.dragOffset=0}onDown(t,n){const{metrics:s}=n,{model:i}=n.props,o=n.getTheme();if(!s)throw new Error("metrics not set");const r=this.getSeparator(t,s,i,o);if(r!=null){const l=r.index;return this.dragOffset=0,this.draggingIndex=l,this.resizingItems=[l],this.hiddenItems=this.getHiddenItems(l,s).reverse(),this.targetSizes.clear(),this.addTargetSize(s,l),this.updateCursor(s,l),this.updateSeparator(n,r),!0}return!1}onMove(t,n){const{metrics:s}=n,{model:i}=n.props,o=n.getTheme();if(!s)throw new Error("metrics not set");const r=this.getSeparator(t,s,i,o);return r!=null?(this.updateCursor(s,r.index),!0):!1}onDrag(t,n){var f;if(this.draggingIndex==null)return!1;const s=t[this.pointProperty],{metricCalculator:i,metrics:o}=n;if(!o)throw new Error("metrics not set");const r=n.getTheme(),l=o[this.visibleOffsetProperty],a=o[this.marginProperty],c=o[this.calculatedSizesProperty],d=o[this.modelIndexesProperty],h=o[this.firstIndexProperty],m=o[this.treePaddingProperty],p=new Map;let g=this.resizingItems[this.resizingItems.length-1];for(;g!=null;){const b=A(l,g),C=s-a-b-this.dragOffset,w=A(d,g),S=this.targetSizes.get(w),I=this.resizingItems.length>1,v=this.hiddenItems.indexOf(g);let E=A(c,w);g===h&&(E+=m);let M=C;Math.abs(C-E)<=r.headerResizeSnapThreshold?M=null:S!==void 0&&C>S&&(I&&v!==0||v>0)?M=S:C<=r.headerResizeHiddenSnapThreshold&&(M=0),M!==E?p.set(w,M):p.set(w,null),C<-r.headerResizeSnapThreshold&&M===0?v>=0&&I?(this.resizingItems.pop(),this.removeTargetSize(o,g),g=this.resizingItems[this.resizingItems.length-1],this.dragOffset-=(f=this.targetSizes.get(A(d,g)))!=null?f:0):(g=this.getNextShownItem(g,o),g!==null&&(this.resizingItems.push(g),this.addTargetSize(o,g))):S!==void 0&&C>S+r.headerResizeSnapThreshold&&M===S?v>0?(this.dragOffset+=M,g=this.hiddenItems[v-1],this.resizingItems.push(g),this.addTargetSize(o,g)):I?(this.resizingItems.pop(),this.removeTargetSize(o,g),g=this.resizingItems[this.resizingItems.length-1]):g=null:g=null}return p.forEach((b,C)=>{b!==null?this.setSize(i,C,b):this.resetSize(i,C)}),this.updateCursor(o,this.draggingIndex),!0}onUp(t,n){return this.draggingIndex!=null&&(this.draggingIndex=void 0,this.resizingItems=[],this.hiddenItems=[],this.targetSizes.clear(),this.updateSeparator(n,null)),!1}onDoubleClick(t,n){const{metrics:s,metricCalculator:i}=n,{model:o}=n.props,r=n.getTheme();if(!s)throw new Error("metrics not set");const l=this.getSeparator(t,s,o,r);if(l!=null){const a=s[this.modelIndexesProperty],c=A(a,l.index);return this.resetSize(i,c),n.forceUpdate(),!0}return!1}updateCursor(t,n){const s=t[this.visibleSizesProperty];A(s,n)===0?this.cursor=this.hiddenCursor:this.cursor=this.defaultCursor}addTargetSize(t,n){const s=t[this.modelIndexesProperty],i=t[this.userSizesProperty],o=t[this.calculatedSizesProperty],r=n===0?t[this.treePaddingProperty]:0,l=A(s,n);let a=i.get(l);(a==null||a===0)&&(a=A(o,l)+r),this.targetSizes.set(l,a)}removeTargetSize(t,n){const s=t[this.modelIndexesProperty],i=A(s,n);this.targetSizes.delete(i)}}class Yi extends da{constructor(){super(...arguments),this.hiddenCursor="e-resize",this.defaultCursor="col-resize",this.pointProperty="x",this.userSizesProperty="userColumnWidths",this.visibleOffsetProperty="visibleColumnXs",this.visibleSizesProperty="visibleColumnWidths",this.marginProperty="rowHeaderWidth",this.calculatedSizesProperty="calculatedColumnWidths",this.modelIndexesProperty="modelColumns",this.firstIndexProperty="firstColumn",this.treePaddingProperty="treePaddingX",this.getHiddenItems=V.getHiddenColumns,this.getNextShownItem=V.getNextShownColumn,this.getSeparator=Yi.getColumnSeparator}static getColumnSeparator(t,n,s,i){if(!i.allowColumnResize)return null;const{x:o,y:r,columnHeaderDepth:l}=t,{modelColumns:a}=n,c=V.getColumnSeparatorIndex(o,r,n,i);return c==null||l==null||l>0?null:a.get(c)!=null?{index:c,depth:0}:null}setSize(t,n,s){t.setColumnWidth(n,s)}resetSize(t,n){t.resetColumnWidth(n)}updateSeparator(t,n){t.setState({draggingColumnSeparator:n,isDragging:n!==null})}}const ln=class{constructor(){this.getCachedTruncatedString=yt((e,t,n,s,i)=>ln.truncateToWidth(e,t,n,s,i),{max:1e4}),this.getCachedBackgroundColors=yt((e,t)=>e.split(" ").map(n=>{const s=[];for(let i=0;i<t;i+=1)s.push(jr.darkenForDepth(n,i,t));return s}),{max:1e3}),this.getCachedColorWithAlpha=yt((e,t)=>jr.colorWithAlpha(e,t),{max:1e3})}static truncate(e,t){return t<e.length?e.substr(0,t)+"\u2026":e}static binaryTruncateToWidth(e,t,n,s=0,i=t.length,o){if(i>=t.length&&e.measureText(t).width<=n)return t;if(o){const c=e.measureText(o).width;return o.repeat(Math.max(1,Math.floor(n/c)))}let r=s,l=Math.min(t.length-1,i),a=t;for(;l>=r;){const c=Math.ceil((l+r)/2),d=ln.truncate(t,c);if(e.measureText(d).width<=n){if(a=d,r===c)break;r=c}else if(c===0){a=d;break}else l=c-1}return a}static truncateToWidth(e,t,n,s=ln.DEFAULT_FONT_WIDTH,i){if(n<=0||t.length<=0)return"";const o=Math.min(Math.max(0,Math.floor(n/s/2)-5),t.length),r=Math.min(Math.ceil(n/s*2),t.length);return ln.binaryTruncateToWidth(e,t,n,o,r,i)}drawCanvas(e){const{context:t}=e;t.save(),this.configureContext(t,e),this.drawBackground(t,e),this.drawGrid(t,e),this.drawHeaders(t,e),this.drawFooters(t,e),this.drawDraggingColumn(t,e),this.drawDraggingRow(t,e),this.drawScrollBars(t,e),t.restore()}configureContext(e,t){const{theme:n}=t;e.font=n.font,e.textBaseline="middle",e.lineCap="butt"}drawBackground(e,t){const{theme:n,metrics:s}=t,{width:i,height:o}=s;e.fillStyle=n.backgroundColor,e.fillRect(0,0,i,o)}drawGrid(e,t){const{metrics:n,draggingRow:s,draggingColumn:i}=t,{gridX:o,gridY:r}=n;e.translate(o,r),this.drawGridBackground(e,t,s==null&&i==null),this.drawCellContents(e,t),this.drawFloatingRows(e,t),this.drawFloatingColumns(e,t),e.translate(-o,-r)}drawFloatingRows(e,t){const{draggingRow:n,draggingColumn:s,metrics:i,theme:o}=t,{floatingTopRowCount:r,floatingBottomRowCount:l,floatingRows:a,rowCount:c,visibleColumns:d,visibleRowYs:h,visibleRowHeights:m}=i;if(a.length!==0){o.floatingRowBackgroundColors&&this.drawRowStripesForRows(e,t,a,o.floatingRowBackgroundColors),n==null&&s==null&&this.drawFloatingMouseRowHover(e,t),this.drawGridLinesForItems(e,t,d,a,o.floatingGridColumnColor,o.floatingGridRowColor),this.drawCellBackgroundsForItems(e,t,d,a),this.drawFloatingBorders(e,t),r>0&&this.drawSelectedRanges(e,t,{top:0,bottom:r-1,maxY:A(h,r-1)+A(m,r-1)-.5}),l>0&&this.drawSelectedRanges(e,t,{top:c-l-1,bottom:c-1,minY:A(h,c-l)+.5,maxY:A(h,c-1)+A(m,c-1)-.5});for(let p=0;p<d.length;p+=1){const g=d[p];for(let f=0;f<a.length;f+=1){const b=a[f];this.drawCellContent(e,t,g,b)}}}}drawFloatingColumns(e,t){const{draggingRow:n,draggingColumn:s,metrics:i,theme:o}=t,{floatingLeftColumnCount:r,floatingRightColumnCount:l,floatingLeftWidth:a,floatingRightWidth:c,floatingColumns:d,gridX:h,maxX:m,columnCount:p,visibleRows:g,visibleColumnXs:f,visibleColumnWidths:b,width:C,height:w}=i;if(d.length!==0){o.floatingRowBackgroundColors&&(this.drawRowStripesForRows(e,t,g,o.floatingRowBackgroundColors,0,a),this.drawRowStripesForRows(e,t,g,o.floatingRowBackgroundColors,C-h-c,m)),n==null&&s==null&&this.drawFloatingMouseRowHover(e,t),e.save(),e.beginPath(),e.rect(0,0,a,w),e.clip(),this.drawGridLinesForItems(e,t,d,g,o.floatingGridColumnColor,o.floatingGridRowColor),e.restore(),this.drawCellBackgroundsForItems(e,t,d,g),this.drawFloatingBorders(e,t),r>0&&this.drawSelectedRanges(e,t,{left:0,maxX:A(f,r-1)+A(b,r-1)}),l>0&&this.drawSelectedRanges(e,t,{left:p-l,right:p-1,minX:A(f,p-l)+.5,maxX:A(f,p-1)+A(b,p-1)});for(let S=0;S<d.length;S+=1){const I=d[S];for(let v=0;v<g.length;v+=1){const E=g[v];this.drawCellContent(e,t,I,E)}}}}drawFloatingBorders(e,t){const{metrics:n,theme:s}=t,{floatingTopRowCount:i,floatingBottomRowCount:o,floatingLeftColumnCount:r,floatingRightColumnCount:l,rowCount:a,columnCount:c,visibleRowYs:d,visibleColumnXs:h,visibleRowHeights:m,visibleColumnWidths:p,maxX:g,maxY:f}=n,{floatingDividerOuterColor:b,floatingDividerInnerColor:C}=s;if(e.lineWidth=3,e.beginPath(),e.strokeStyle=b,i>0){const w=A(d,i-1)+A(m,i-1)+.5;e.moveTo(0,w),e.lineTo(g,w)}if(o>0){const w=A(d,a-o)-.5;e.moveTo(0,w),e.lineTo(g,w)}if(r>0){const w=A(h,r-1)+A(p,r-1)+.5;e.moveTo(w,0),e.lineTo(w,f)}if(l>0){const w=A(h,c-l)-.5;e.moveTo(w,0),e.lineTo(w,f)}if(e.stroke(),e.beginPath(),e.lineWidth=1,e.strokeStyle=C,i>0){const w=A(d,i-1)+A(m,i-1)+.5;e.moveTo(0,w),e.lineTo(g,w)}if(o>0){const w=A(d,a-o)-.5;e.moveTo(0,w),e.lineTo(g,w)}if(r>0){const w=A(h,r-1)+A(p,r-1)+.5;e.moveTo(w,0),e.lineTo(w,f)}if(l>0){const w=A(h,c-l)-.5;e.moveTo(w,0),e.lineTo(w,f)}e.stroke()}drawGridBackground(e,t,n=!1){this.drawRowStripes(e,t),n&&(this.drawMouseColumnHover(e,t),this.drawMouseRowHover(e,t)),this.drawGridLines(e,t),this.drawCellBackgrounds(e,t);const{metrics:s}=t,{bottom:i,right:o,floatingBottomRowCount:r,floatingLeftColumnCount:l,floatingRightColumnCount:a,floatingTopRowCount:c,columnCount:d,rowCount:h,visibleRowHeights:m,visibleRowYs:p,visibleColumnXs:g,visibleColumnWidths:f,width:b,height:C}=s;this.drawSelectedRanges(e,t,{bottom:Math.min(i,h-r-1),right:Math.min(o,d-a-1),minX:l>0&&g.has(l+1)?A(g,l+1):-10,minY:c>0&&p.has(c+1)?A(p,c+1):-10,maxX:a>0&&g.has(d-a-1)?A(g,d-a-1)+A(f,d-a-1)-.5:b+10,maxY:r>0&&p.has(h-r-1)?A(p,h-r-1)+A(m,h-r-1)-.5:C+10})}drawRowStripes(e,t){const{metrics:n,theme:s}=t,{visibleRows:i}=n,{rowBackgroundColors:o}=s;!o||this.drawRowStripesForRows(e,t,i,o)}drawRowStripesForRows(e,t,n,s,i=0,o=t.metrics.maxX){const{theme:r,metrics:l,model:a}=t,{maxDepth:c,shadowBlur:d,shadowColor:h}=r,m=this.getCachedBackgroundColors(s,c),{visibleRowYs:p,visibleRowHeights:g}=l,f=new Map,b=[],C=[],w=(S,I)=>{const v=Xe(a)?a.depthForRow(S):0,E=m[S%m.length],M=E[Math.min(v,E.length-1)];if(f.has(M)||f.set(M,[]),f.get(M).push(S),I!=null){const F=Xe(a)?a.depthForRow(I):0;F<v?b.push(S):F>v&&C.push(I)}};for(let S=0;S<n.length;S+=1){const I=n[S],v=S>0?n[S-1]:void 0;w(I,v)}if(f.forEach((S,I)=>{e.fillStyle=I,e.beginPath();for(let v=0;v<S.length;v+=1){const E=S[v],M=A(p,E),F=A(g,E);e.rect(i,M,o,F)}e.fill()}),b.length>0){e.save();const S=this.getCachedColorWithAlpha(h,.15),I=this.getCachedColorWithAlpha(h,0),v=e.createLinearGradient(0,0,0,d);v.addColorStop(0,S),v.addColorStop(1,I),e.fillStyle=v;for(let E=0;E<b.length;E+=1){const M=b[E],F=A(p,M);e.translate(0,F),e.fillRect(i,0,o,d),e.translate(0,-F)}e.restore()}if(C.length>0){e.save();const S=this.getCachedColorWithAlpha(h,0),I=this.getCachedColorWithAlpha(h,.15),v=e.createLinearGradient(0,0,0,d);v.addColorStop(0,S),v.addColorStop(1,I),e.fillStyle=v;for(let E=0;E<C.length;E+=1){const M=C[E],F=A(p,M),k=A(g,M),P=F+k-d;e.translate(0,P),e.fillRect(i,0,o,d),e.translate(0,-P)}e.restore()}}drawMouseColumnHover(e,t){const{mouseX:n,mouseY:s,theme:i,metrics:o}=t;if(n==null||s==null)return;const r=V.getColumnAtX(n,o);if(r==null||!i.columnHoverBackgroundColor)return;const{visibleColumnWidths:l,visibleColumnXs:a,maxY:c}=o;if(s>c)return;const d=A(a,r),h=A(l,r);e.fillStyle=i.columnHoverBackgroundColor,e.fillRect(d,0,h,c)}drawMouseRowHover(e,t){const{mouseX:n,mouseY:s,theme:i,metrics:o}=t;if(n==null||s==null)return;const{maxX:r}=o;if(n>r||!i.rowHoverBackgroundColor)return;const l=V.getRowAtY(s,o);l!=null&&this.drawMouseRowHoverForRow(e,t,l)}drawFloatingMouseRowHover(e,t){const{mouseX:n,mouseY:s,theme:i,metrics:o}=t,{maxX:r,floatingTopRowCount:l,floatingBottomRowCount:a,rowCount:c,rowFooterWidth:d}=o;if(n==null||s==null||n>r+d||!i.rowHoverBackgroundColor)return;const h=V.getRowAtY(s,o);h!=null&&(h<l||c-a<=h)&&this.drawMouseRowHoverForRow(e,t,h)}drawMouseRowHoverForRow(e,t,n){const{metrics:s,selectedRanges:i,theme:o}=t,{visibleRowHeights:r,visibleRowYs:l,maxX:a}=s,c=A(l,n),d=A(r,n);o.rowHoverBackgroundColor&&(e.fillStyle=o.rowHoverBackgroundColor);for(let h=0;h<i.length;h+=1){const{startRow:m,endRow:p}=i[h];if(m!=null&&p!=null&&m<=n&&p>=n){o.selectedRowHoverBackgroundColor&&(e.fillStyle=o.selectedRowHoverBackgroundColor);break}}e.fillRect(0,c,a,d)}drawGridLines(e,t){const{metrics:n,theme:s}=t,{visibleColumns:i,visibleRows:o}=n;this.drawGridLinesForItems(e,t,i,o,s.gridColumnColor,s.gridRowColor)}drawGridLinesForItems(e,t,n,s,i,o){!i&&!o||(e.lineWidth=1,e.beginPath(),i&&(e.strokeStyle=i,this.drawGridLinesForColumns(e,t,n)),o&&(e.strokeStyle=o,this.drawGridLinesForRows(e,t,s)),e.stroke())}drawGridLinesForColumns(e,t,n){const{metrics:s}=t,{visibleColumnXs:i,maxY:o}=s;for(let r=0;r<n.length;r+=1){const l=n[r],a=A(i,l)+.5;e.moveTo(a,0),e.lineTo(a,o)}}drawGridLinesForRows(e,t,n){const{metrics:s}=t,{visibleRowYs:i,maxX:o}=s,r=o;for(let l=0;l<n.length;l+=1){const a=n[l],c=A(i,a)+.5;e.moveTo(.5,c),e.lineTo(r-.5,c)}}drawCellBackgrounds(e,t){const{metrics:n}=t,{visibleColumns:s,visibleRows:i}=n;this.drawCellBackgroundsForItems(e,t,s,i)}drawCellBackgroundsForItems(e,t,n,s){e.save();for(let i=0;i<n.length;i+=1){const o=n[i];for(let r=0;r<s.length;r+=1){const l=s[r],a=r+1<s.length?s[r+1]:void 0;this.drawCellBackground(e,t,o,l,a)}}e.restore()}drawCellBackground(e,t,n,s,i){const{metrics:o,model:r,theme:l}=t,{firstColumn:a,modelColumns:c,modelRows:d,visibleColumnXs:h,visibleColumnWidths:m,visibleRowYs:p,visibleRowHeights:g}=o,f=A(d,s),b=A(c,n),C=r.backgroundColorForCell(b,f,l),w=n===a,S=Xe(r)&&r.hasExpandableRows;if(C){const I=A(h,n)+1,v=A(p,s)+1,E=A(m,n)-1,M=A(g,s)-1;e.fillStyle=C,e.fillRect(I,v,E,M)}w&&S&&this.drawCellRowTreeDepthLines(e,t,s,i)}drawCellContents(e,t){const{metrics:n}=t,{visibleColumns:s}=n;for(let i=0;i<s.length;i+=1){const o=s[i];this.drawColumnCellContents(e,t,o)}}drawColumnCellContents(e,t,n){const{metrics:s}=t,{visibleColumnXs:i,visibleColumnWidths:o,visibleRows:r,height:l}=s,a=A(i,n),c=A(o,n);e.save(),e.beginPath(),e.rect(a,0,c,l),e.clip();for(let d=0;d<r.length;d+=1){const h=r[d];this.drawCellContent(e,t,n,h)}e.restore()}getTextRenderMetrics(e,t,n,s){const{textAlign:i}=e,{metrics:o,model:r,theme:l}=t,{firstColumn:a,visibleColumnXs:c,visibleColumnWidths:d,visibleRowYs:h,visibleRowHeights:m}=o,{cellHorizontalPadding:p,treeDepthIndent:g,treeHorizontalPadding:f}=l,b=A(c,n),C=A(h,s),w=A(d,n),S=A(m,s),I=n===a;let v=0;Xe(r)&&r.hasExpandableRows&&I&&(v=g*(r.depthForRow(s)+1)+f);const E=w-v;let M=b+p;const F=C+S*.5;return i==="right"?M=b+E-p:i==="center"&&(M=b+E*.5),M+=v,{width:E-p*2,x:M,y:F}}drawCellContent(e,t,n,s,i){var I;const{metrics:o,model:r,theme:l}=t,{firstColumn:a,fontWidths:c,modelColumns:d,modelRows:h,visibleRowHeights:m}=o,{textColor:p}=l,g=A(m,s),f=A(h,s),b=A(d,n),C=i!=null?i:r.textForCell(b,f),w=r.truncationCharForCell(b,f),S=n===a;if(C&&g>0){const v=r.textAlignForCell(b,f)||"left";e.textAlign=v;const E=r.colorForCell(b,f,l)||p;e.fillStyle=E;const{width:M,x:F,y:k}=this.getTextRenderMetrics(e,t,n,s),P=(I=c.get(e.font))!=null?I:ln.DEFAULT_FONT_WIDTH,L=this.getCachedTruncatedString(e,C,M,P,w);L&&e.fillText(L,F,k)}S&&Xe(r)&&r.hasExpandableRows&&this.drawCellRowTreeMarker(e,t,s)}drawCellRowTreeMarker(e,t,n){const{metrics:s,model:i,mouseX:o,mouseY:r,theme:l}=t,{firstColumn:a,gridX:c,gridY:d,visibleColumnXs:h,visibleColumnWidths:m,visibleRowYs:p,visibleRowHeights:g,visibleRowTreeBoxes:f}=s,{treeMarkerColor:b,treeMarkerHoverColor:C}=l,w=A(h,a),S=A(m,a),I=A(p,n),v=A(g,n);if(!Xe(i)||!i.isRowExpandable(n))return;const E=A(f,n),M=o!=null&&r!=null&&o>=c+w&&o<=c+w+S&&r>=d+I&&r<=d+I+v?C:b;this.drawTreeMarker(e,t,w,I,E,M,i.isRowExpanded(n))}drawTreeMarker(e,t,n,s,i,o,r){const{x1:l,y1:a,x2:c,y2:d}=i,h=r?"\u229F":"\u229E",m=n+(l+c)*.5+.5,p=s+(a+d)*.5+.5;e.fillStyle=o,e.textAlign="center",e.fillText(h,m,p)}drawCellRowTreeDepthLines(e,t,n,s){const{metrics:i,model:o,theme:r}=t;if(!Xe(o))return;const l=o.depthForRow(n);if(l===0)return;const{firstColumn:a,visibleColumnXs:c,visibleRowYs:d,visibleRowHeights:h}=i,{treeDepthIndent:m,treeHorizontalPadding:p,treeLineColor:g}=r,f=A(c,a),b=A(d,n),C=A(h,n),w=s!==void 0?o.depthForRow(s):0,S=l>w?l-w:0;if(e.strokeStyle=g,e.lineWidth=1,l-S>0){e.beginPath();for(let I=0;I<l-S;I+=1){const v=f+I*m+m*.5+p+.5;e.moveTo(v,b),e.lineTo(v,b+C)}e.stroke()}if(S>0){e.beginPath();for(let I=l-S;I<l;I+=1){const v=f+I*m+m*.5+p+.5;e.moveTo(v,b),e.lineTo(v,b+Math.ceil(C/2)),e.moveTo(v-.5,b+Math.ceil(C/2)+.5),e.lineTo(v+m-.5,b+Math.ceil(C/2)+.5)}e.stroke()}}drawHeaders(e,t){const{theme:n}=t;e.font=n.headerFont,this.drawColumnHeaders(e,t),this.drawRowHeaders(e,t)}drawFooters(e,t){const{theme:n}=t;e.font=n.headerFont,this.drawRowFooters(e,t)}drawColumnHeaders(e,t){const{mouseX:n,mouseY:s,theme:i,metrics:o,draggingColumnSeparator:r,isDragging:l,model:a}=t,{columnHeaderHeight:c,floatingColumns:d,gridX:h,width:m,visibleColumns:p,visibleColumnWidths:g,visibleColumnXs:f,floatingLeftColumnCount:b,floatingLeftWidth:C,floatingRightWidth:w,modelColumns:S,columnHeaderMaxDepth:I}=o;if(c<=0)return;const{headerHiddenSeparatorSize:v,headerHiddenSeparatorHoverColor:E,headerSeparatorColor:M,headerSeparatorHoverColor:F}=i,k=c*.5,P=c*(I-1)+c*.5-k*.5,L=b>0;if(e.save(),this.drawColumnHeadersForRange(e,t,[p[0],p[p.length-1]],{minX:h+C,maxX:m-w}),L&&this.drawColumnHeadersForRange(e,t,[d[0],d[d.length-1]],{minX:h,maxX:h+C}),M){e.strokeStyle=M;const N=[...g.entries()].filter(([B,U])=>U===0).map(([B])=>B);e.beginPath(),e.fillStyle=M;for(let B=0;B<N.length;B+=1){const U=N[B],H=A(f,U),_=A(g,U),$=h+H+_+.5-v*.5;e.rect($,P,v,k)}e.fill()}if(F){let{index:N,depth:B}=r!=null?r:{};if(N==null&&n!=null&&s!=null){const H=Yi.getColumnSeparator(V.getGridPointFromXY(n,s,o),o,a,i);N=H==null?void 0:H.index,B=H==null?void 0:H.depth}let U;if(N==null)U=!1;else{const H=S.get(N),_=S.get(N+1);H==null||_==null?U=!1:U=a.textForColumnHeader(H,B)!==a.textForColumnHeader(_,B)}if(U&&N!=null&&B!=null&&(!l||r!=null)){e.strokeStyle=F;const H=A(f,N),_=A(g,N),$=h+H+_+.5,K=p.indexOf(N),j=K<p.length-1?p[K+1]:null,re=j!=null?g.get(j):null,ne=_===0,ge=re!=null&&re===0;ne?(e.strokeStyle=E,e.fillStyle=E,e.fillRect($,P,v*.5,k)):ge&&(e.fillStyle=F,e.fillRect($-v*.5,P,v*.5,k)),e.beginPath(),e.moveTo($,(I-B-1)*c),e.lineTo($,(I-B)*c-1),e.stroke()}}e.restore()}drawColumnHeadersForRange(e,t,n,s){const{model:i}=t,{columnHeaderMaxDepth:o}=i;if(o!==0)for(let r=0;r<=o;r+=1)this.drawColumnHeadersAtDepth(e,t,n,s,r)}drawColumnHeadersAtDepth(e,t,n,s,i){var P,L,N,B,U,H;const{metrics:o,model:r,theme:l}=t,{modelColumns:a,visibleColumnXs:c,gridX:d,calculatedColumnWidths:h,userColumnWidths:m,visibleColumnWidths:p,movedColumns:g}=o,{headerBackgroundColor:f,headerColor:b,headerSeparatorColor:C,columnHeaderHeight:w,columnWidth:S}=l,{columnHeaderMaxDepth:I}=r,{minX:v,maxX:E}=s,M=E-v;if(I===0)return;const F=n[0],k=n[1];if(e.save(),e.translate(0,(I-i-1)*w),i===0){this.drawColumnHeader(e,t,"",v,E,{backgroundColor:f,separatorColor:C});for(let _=F;_<=k;_+=1)this.drawColumnHeaderAtIndex(e,t,_,s)}if(i>0){let _=F;for(;_<=k;){const{columnCount:$}=o,K=A(a,_),j=r.textForColumnHeader(K,i),re=r.colorForColumnHeader(K,i);let ne=A(c,_)+d,ge=ne+A(p,_);if(j!=null){let ce=_-1;for(;ce>=0&&(ge-ne<M||ne>v);){const _e=(P=a.get(ce))!=null?P:V.getModelIndex(ce,g);if(_e==null||r.textForColumnHeader(_e,i)!==j)break;ne-=(N=(L=m.get(_e))!=null?L:h.get(_e))!=null?N:S,ce-=1}let Fe=_+1;for(;Fe<$&&(ge-ne<M||ge<E);){const _e=(B=a.get(Fe))!=null?B:V.getModelIndex(Fe,g);if(r.textForColumnHeader(_e,i)!==j)break;ge+=(H=(U=m.get(_e))!=null?U:h.get(_e))!=null?H:S,Fe+=1}_=Fe-1;const Ye=ge-ne>=M;let $e=ne;Ye&&(ge<E?$e=ge-M:ne<v&&($e=v)),this.drawColumnHeader(e,t,j,$e,Math.min(ge-ne,M),{backgroundColor:re!=null?re:f,textColor:b,separatorColor:C},s)}_+=1}}e.restore()}drawColumnHeaderAtIndex(e,t,n,s){var w;const{metrics:i,model:o,theme:r}=t,{modelColumns:l,visibleColumnWidths:a,visibleColumnXs:c,gridX:d}=i,h=A(a,n),m=A(c,n)+d,p=A(l,n),g=o.textForColumnHeader(p),{headerBackgroundColor:f,headerColor:b,headerSeparatorColor:C}=r;g!=null&&this.drawColumnHeader(e,t,g,m,h,{backgroundColor:(w=o.colorForColumnHeader(p))!=null?w:f,textColor:b,separatorColor:C},s)}drawColumnHeader(e,t,n,s,i,o,r){if(i<=0)return;const{metrics:l,theme:a}=t,{headerHorizontalPadding:c,columnHeaderHeight:d}=a,{fontWidths:h,width:m}=l,p=h.get(e.font)||ln.DEFAULT_FONT_WIDTH,f=(i-c*2)/p,{backgroundColor:b,textColor:C="#ffffff",separatorColor:w}=o!=null?o:{};let{minX:S=0,maxX:I=m}=r!=null?r:{};e.save(),e.rect(S,0,I-S,d),e.clip(),b&&(e.fillStyle=b,e.fillRect(s,0,i,d)),w&&(e.strokeStyle=w,e.beginPath(),s>0&&(e.moveTo(s+.5,0),e.lineTo(s+.5,d)),e.moveTo(s+i+.5,0),e.lineTo(s+i+.5,d),e.moveTo(s,d-.5),e.lineTo(s+i,d-.5),e.stroke()),e.beginPath(),e.rect(s,0,i,d),e.clip(),e.fillStyle=C;let v=n;f<=0?v="":v.length>f&&(v=`${v.substring(0,f-1)}\u2026`);const E=v.length*p;let M=s+i*.5;const F=d*.5;S+=c,I-=c;const k=s+c,P=lt(k,S,I),L=s+i-c,B=lt(L,S,I)-P,U=M-E*.5<S,H=M+E*.5>I;U?E<B?M=S+E*.5:M=L-E*.5:H&&(E<B?M=I-E*.5:M=k+E*.5),e.textAlign="center",e.fillText(v,M,F),e.restore()}drawRowHeaders(e,t){const{mouseX:n,mouseY:s,metrics:i,theme:o,draggingRowSeparator:r}=t,{gridY:l,rowHeaderWidth:a,height:c,visibleRows:d,visibleRowHeights:h,visibleRowYs:m}=i;if(a<=0)return;const{headerBackgroundColor:p,headerColor:g,headerHiddenSeparatorSize:f,headerHiddenSeparatorHoverColor:b,headerSeparatorColor:C,headerSeparatorHoverColor:w}=o,S=a*.5,I=a*.5-S*.5;if(e.save(),e.beginPath(),e.fillStyle=p,e.fillRect(0,0,a,c),C){e.strokeStyle=C,e.beginPath(),e.moveTo(0,l+.5),e.lineTo(a,l+.5);const v=[];let E=!1;for(let M=0;M<d.length;M+=1){const F=d[M],k=A(m,F),P=A(h,F);if(P>0){const L=l+k+P+.5;e.moveTo(0,L),e.lineTo(a,L),E=!1}else E||(E=!0,v.push(F))}e.moveTo(a-.5,0),e.lineTo(a-.5,c),e.stroke(),e.beginPath(),e.fillStyle=C;for(let M=0;M<v.length;M+=1){const F=v[M],k=A(m,F),P=A(h,F),L=l+k+P+.5-f*.5;e.rect(I,L,S,f)}e.fill()}if(w){let{index:v=null}=r!=null?r:{};if(v==null&&n!=null&&s!=null&&(v=V.getRowSeparatorIndex(n,s,i,o)),v!=null){e.strokeStyle=w;const E=A(m,v),M=A(h,v),F=l+E+M+.5,k=d.indexOf(v),P=k<d.length-1?d[k+1]:null,L=P!=null?h.get(P):null,N=M===0,B=L!=null&&L===0;N?(e.strokeStyle=b,e.fillStyle=b,e.fillRect(I,F,S,f*.5)):B&&(e.fillStyle=w,e.fillRect(I,F-f*.5,S,f*.5)),e.beginPath(),e.moveTo(.5,F),e.lineTo(a+.5,F),e.stroke()}}e.beginPath(),e.rect(0,l,a,c),e.clip(),e.fillStyle=g,e.textAlign="right";for(let v=0;v<d.length;v+=1){const E=d[v],M=A(h,E),F=A(m,E)+l;this.drawRowHeader(e,t,E,F,M)}e.restore()}drawRowHeader(e,t,n,s,i){if(i<=0)return;const{metrics:o,model:r,theme:l}=t,{modelRows:a,rowHeaderWidth:c}=o,d=A(a,n),h=c-l.cellHorizontalPadding,m=s+i*.5;e.fillText(r.textForRowHeader(d),h,m)}drawRowFooters(e,t){const{mouseX:n,mouseY:s,metrics:i,model:o,theme:r,draggingRowSeparator:l}=t,{gridY:a,gridX:c,maxX:d,modelRows:h,rowFooterWidth:m,height:p,verticalBarWidth:g,visibleRows:f,visibleRowHeights:b,visibleRowYs:C,width:w}=i;if(m<=0)return;const{cellHorizontalPadding:S,headerBackgroundColor:I,headerColor:v,headerHiddenSeparatorSize:E,headerHiddenSeparatorHoverColor:M,headerSeparatorColor:F,headerSeparatorHoverColor:k}=r,P=m*.5,L=m*.5-P*.5,N=Math.min(c+d,w-m-g);if(e.save(),e.beginPath(),e.fillStyle=I,e.fillRect(N,a,m,p),F){e.strokeStyle=F,e.beginPath(),e.moveTo(N,a+.5),e.lineTo(m,a+.5);const U=[];let H=!1;for(let _=0;_<f.length;_+=1){const $=f[_],K=A(C,$),j=A(b,$);if(j>0){const re=a+K+j+.5;e.moveTo(N+.5,re),e.lineTo(N+m-.5,re),H=!1}else H||(H=!0,U.push($))}e.moveTo(N+.5,a),e.lineTo(N+.5,p),e.stroke(),e.beginPath(),e.fillStyle=F;for(let _=0;_<U.length;_+=1){const $=U[_],K=A(C,$),j=A(b,$),re=a+K+j+.5-E*.5;e.rect(N+L,re,P,E)}e.fill()}if(k){let{index:U=null}=l!=null?l:{};if(U==null&&n!=null&&s!=null&&(U=V.getRowSeparatorIndex(n,s,i,r)),U!=null){e.strokeStyle=k;const H=A(C,U),_=A(b,U),$=a+H+_+.5,K=f.indexOf(U),j=K<f.length-1?f[K+1]:null,re=j!=null?b.get(j):null,ne=_===0,ge=re!=null&&re===0;ne?(e.strokeStyle=M,e.fillStyle=M,e.fillRect(L,$,P,E*.5)):ge&&(e.fillStyle=k,e.fillRect(L,$-E*.5,P,E*.5)),e.beginPath(),e.moveTo(N+.5,$),e.lineTo(N+m+.5,$),e.stroke()}}e.beginPath(),e.rect(N,a,m,p),e.clip(),e.fillStyle=v,e.textAlign="left";const B=N+S;for(let U=0;U<f.length;U+=1){const H=f[U],_=A(b,H);if(_>0){const $=A(C,H)+a,K=A(h,H),j=$+_*.5;e.fillText(o.textForRowFooter(K),B,j)}}e.restore()}drawSelectedRanges(e,t,n={}){const{cursorColumn:s,cursorRow:i,draggingRow:o,draggingColumn:r,editingCell:l,metrics:a,model:c,selectedRanges:d,theme:h}=t,{visibleColumnWidths:m,visibleColumnXs:p,visibleRowHeights:g,visibleRowYs:f,width:b,height:C}=a,{left:w=a.left,top:S=a.top,right:I=a.right,bottom:v=a.bottom,minY:E=-10,maxY:M=C+10,minX:F=-10,maxX:k=b+10}=n;if(d.length===0)return;const P=Ae(c)&&c.isEditable&&l==null&&o==null&&r==null&&s!=null&&i!=null&&p.has(s)&&f.has(i);if(P){const L=A(p,s),N=A(f,i),B=A(m,s),U=A(g,i);e.save(),e.beginPath(),e.rect(0,0,b,C),e.rect(L,N,B,U),e.clip("evenodd")}e.beginPath();for(let L=0;L<d.length;L+=1){const N=d[L],B=N.startColumn!==null?N.startColumn:w,U=N.startRow!==null?N.startRow:S,H=N.endColumn!==null?N.endColumn:I,_=N.endRow!==null?N.endRow:v;if(_>=S&&v>=U&&H>=w&&I>=B){const $=B>=w&&p.has(B)?Math.round(A(p,B))+.5:F,K=U>=S&&f.has(U)?Math.max(Math.round(A(f,U))+.5,.5):E,j=H<=I&&p.has(H)?Math.round(A(p,H)+A(m,H))-.5:k,re=_<=v&&f.has(_)?Math.round(A(f,_)+A(g,_))-.5:M;e.rect($,K,j-$,re-K)}e.fillStyle=h.selectionColor,e.fill(),e.save(),e.clip(),e.strokeStyle=h.selectionOutlineCasingColor,e.lineWidth=3,e.stroke(),e.restore(),e.strokeStyle=h.selectionOutlineColor,e.lineWidth=1,e.stroke()}P&&s!=null&&i!=null&&(e.restore(),this.drawActiveCell(e,t,s,i))}drawActiveCell(e,t,n,s,i=ln.ACTIVE_CELL_BORDER_WIDTH){const{metrics:o,theme:r}=t,{visibleColumnWidths:l,visibleColumnXs:a,visibleRowHeights:c,visibleRowYs:d}=o,h=A(a,n),m=A(d,s),p=A(l,n),g=A(c,s);let f=h-i*.5,b=m-i*.5,C=p+i,w=g+i;f<=0&&(C+=f-1,f=1),b<=0&&(w+=b-1,b=1);const{lineWidth:S}=e;e.beginPath(),e.lineWidth=i,e.strokeStyle=r.selectionOutlineColor,this.drawRoundedRect(e,f,b,C,w),e.stroke(),e.lineWidth=S}drawRoundedRect(e,t,n,s,i,o=ln.DEFAULT_EDGE_RADIUS){e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+s-o,n),e.quadraticCurveTo(t+s,n,t+s,n+o),e.lineTo(t+s,n+i-o),e.quadraticCurveTo(t+s,n+i,t+s-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath()}drawDraggingColumn(e,t){var re;const{draggingColumn:n,metrics:s,mouseX:i,theme:o,model:r}=t;if(n==null||i==null)return;const{range:l,depth:a}=n,{gridX:c,gridY:d,visibleColumnXs:h,visibleColumnWidths:m,height:p,width:g,columnHeaderMaxDepth:f,columnHeaderHeight:b,movedColumns:C,modelColumns:w,floatingLeftWidth:S}=s,I=(re=w.get(l[0]))!=null?re:V.getModelIndex(l[0],C),v=r.getColumnHeaderGroup(I,a);if(a>0&&!v)return;const[E,M]=l,F=A(h,E),P=A(h,M)+A(m,M)-F,L=n.left,{backgroundColor:N,font:B,headerFont:U,reorderOffset:H,shadowBlur:_,shadowColor:$}=o,K=(f-a-1)*b;e.save(),e.translate(c,0),e.save(),e.beginPath(),e.rect(S,0,g,p),e.clip(),e.fillStyle=N,e.fillRect(F,K,P,p),e.restore(),e.translate(0,H),e.save(),e.shadowColor=$,e.shadowBlur=_,e.fillStyle=N,e.fillRect(n.left,K+H,n.width,p),e.restore(),e.beginPath(),e.rect(n.left,K,n.width+1,p),e.clip(),e.translate(L-F,0),e.font=U;const j=[];for(let ne=n.range[0];ne<=n.range[1];ne+=1)j.push(ne);this.drawColumnHeaders(e,t),this.drawColumnHeadersForRange(e,t,[j[0],j[j.length-1]],{minX:F,maxX:g}),e.translate(0,d),e.font=B,this.drawGridBackground(e,t);for(let ne=E;ne<=M;ne+=1)this.drawColumnCellContents(e,t,ne);e.restore()}drawDraggingRow(e,t){const{draggingRow:n,draggingRowOffset:s,metrics:i,mouseY:o,theme:r}=t;if(n==null||o==null)return;const{gridX:l,gridY:a,visibleRowYs:c,visibleRowHeights:d,width:h}=i,m=A(c,n),p=A(d,n)+1,{backgroundColor:g,font:f,headerFont:b,reorderOffset:C,shadowBlur:w,shadowColor:S}=r;e.save(),e.translate(0,a),e.fillStyle=g,e.fillRect(0,m,h,p),e.translate(l+C,o-m-a-(s!=null?s:0)),e.save(),e.shadowColor=S,e.shadowBlur=w,e.fillStyle=g,e.fillRect(-l,m,h,p),e.restore(),e.beginPath(),e.rect(-l,m,h,p),e.clip(),e.font=f,this.drawGridBackground(e,t),this.drawCellContents(e,t),e.translate(-l,-a),e.font=b,this.drawRowHeaders(e,t),e.restore()}drawScrollBars(e,t){const{isDraggingHorizontalScrollBar:n,isDraggingVerticalScrollBar:s,isDragging:i,metrics:o,mouseX:r,mouseY:l,theme:a}=t;if(a.scrollBarSize<=0)return;const{rowHeaderWidth:c,columnHeaderHeight:d,width:h,height:m,handleHeight:p,handleWidth:g,scrollX:f,scrollY:b,hasHorizontalBar:C,hasVerticalBar:w,barWidth:S,barHeight:I}=o,{scrollBarBackgroundColor:v,scrollBarHoverBackgroundColor:E,scrollBarCasingColor:M,scrollBarCornerColor:F,scrollBarColor:k,scrollBarHoverColor:P,scrollBarActiveColor:L,scrollBarSize:N,scrollBarHoverSize:B,scrollBarCasingWidth:U,scrollBarSelectionTick:H,scrollBarSelectionTickColor:_,scrollBarActiveSelectionTickColor:$,autoSelectRow:K,autoSelectColumn:j}=a,re=r!=null&&l!=null&&r<=h&&l<=m,ne=s||w&&!n&&!i&&r!=null&&l!=null&&r>=h-B&&l<=I+d&&re,ge=n||C&&!s&&!i&&!ne&&r!=null&&l!=null&&l>=m-B&&r<=S-c&&re,ce=ge?B:N,Fe=ne?B:N;if(e.translate(c,d),C&&w&&(e.fillStyle=M,e.fillRect(h-c-N,m-d-N,N,N),e.fillStyle=F,e.fillRect(h-c-N+U,m-d-N+U,N-U,N-U)),C){const Ye=f,$e=m-d-ce;if(e.fillStyle=M,e.fillRect(0,$e,S,ce-U),e.fillStyle=ge?E:v,e.fillRect(0,$e+U,S,ce-U),n?e.fillStyle=L:ge?e.fillStyle=P:e.fillStyle=k,e.fillRect(Ye,$e+U,g,ce-U),!K&&H&&_!=null&&$!=null){e.fillStyle=_;const{selectedRanges:_e,cursorColumn:Ue}=t,{lastLeft:Je,columnCount:Le}=o,Vn=[..._e].filter(pe=>pe.startColumn!=null&&pe.endColumn!=null).map(pe=>[pe.startColumn,pe.endColumn]).sort(V.compareRanges),Jt=V.mergeSortedRanges(Vn),st=pe=>pe<=Je?pe/Je*(S-g):S-g+(pe-Je)/(Le-Je)*g;for(let pe=0;pe<Jt.length;pe+=1){const Ge=Jt[pe],Be=Ge[0],ut=Ge[1];if(Be!=null&&ut!=null&&(Be!==Ue||ut!==Ue)){const Mt=st(Be),Dt=Math.max(1,Math.round(st(ut+1)-Mt)),mt=ce-U;e.fillRect(Mt,$e+U+Math.round(mt/3),Dt,Math.round(mt/3))}}if(Ue!=null){const pe=st(Ue),Ge=2,Be=ce-U;e.fillStyle=$,e.fillRect(pe,$e+U,Ge,Be)}}}if(w){const Ye=h-c-Fe,$e=b;if(e.fillStyle=M,e.fillRect(Ye,0,Fe-U,I),e.fillStyle=ne?E:v,e.fillRect(Ye+U,0,Fe-U,I),s?e.fillStyle=L:ne?e.fillStyle=P:e.fillStyle=k,e.fillRect(Ye+U,$e,Fe-U,p),!j&&H&&_!=null&&$!=null){const{selectedRanges:_e,cursorRow:Ue}=t,{lastTop:Je,rowCount:Le}=o,Ht=pe=>pe<=Je?pe/Je*(I-p):I-p+(pe-Je)/(Le-Je)*p;e.fillStyle=_;const Jt=[..._e].filter(pe=>pe.startRow!=null&&pe.endRow!=null).map(pe=>[pe.startRow,pe.endRow]).sort(V.compareRanges),st=V.mergeSortedRanges(Jt);for(let pe=0;pe<st.length;pe+=1){const Ge=st[pe],Be=Ge[0],ut=Ge[1];if(Be!=null&&ut!=null&&(Be!==Ue||ut!==Ue)){const Mt=Ht(Be),Dt=Fe-U,mt=Math.max(1,Math.round(Ht(ut+1)-Mt));e.fillRect(Ye+U+Math.round(Dt/3),Mt,Math.round(Dt/3),mt)}}if(Ue!=null){const pe=Math.round(Ht(Ue)),Ge=Fe-U,Be=2;e.fillStyle=$,e.fillRect(Ye+U,pe,Ge,Be)}}}e.translate(-c,-d)}};let Es=ln;Es.DEFAULT_FONT_WIDTH=10;Es.DEFAULT_EDGE_RADIUS=2;Es.ACTIVE_CELL_BORDER_WIDTH=2;const Zr=100;class Uh extends Ze{constructor(){super(...arguments),this.hasExtendedFloating=!1}onDown(t,n,s){const{x:i,y:o,column:r,row:l}=t,{metrics:a}=n;if(!a)throw new Error("metrics not set");const{gridX:c,gridY:d,maxX:h,maxY:m}=a,p=i-c,g=o-d;if(p<0||g<0||r==null&&p>h||l==null&&g>m)return!1;const f=V.isModifierKeyDown(s),b=s.shiftKey;f||(b?n.trimSelectedRanges():n.clearSelectedRanges());const C=n.getTheme(),{autoSelectRow:w,autoSelectColumn:S}=C;return(r!==null||!S)&&(l!==null||!w)&&(n.focus(),n.moveCursorToPosition(r,l,b,!1,b&&f)),this.startPoint=t,this.hasExtendedFloating=!1,this.dragBounds=V.getScrollDragBounds(a,l,r),!0}onDrag(t,n){if(this.startPoint===void 0)return!1;this.stopTimer();const{row:s,column:i}=this.startPoint,{x:o,y:r}=t;let{row:l,column:a}=t;const{metrics:c}=n;if(!c)throw new Error("metrics not set");const{left:d,lastLeft:h,top:m,lastTop:p,columnWidth:g,rowHeight:f}=c,b=V.getScrollDragBounds(c,s,i);let C=0,w=0;if(d<h&&(o<b.x1?C=o-b.x1:o>b.x2&&(C=o-b.x2)),m<p&&(r<b.y1?w=r-b.y1:r>b.y2&&(w=r-b.y2)),C!==0||w!==0)this.startTimer(n,t,C>0?Math.ceil(C/g):Math.floor(C/g),w>0?Math.ceil(w/f):Math.floor(w/f));else if(l!=null&&a!=null){const{floatingTopRowCount:S,floatingBottomRowCount:I,floatingLeftColumnCount:v,floatingRightColumnCount:E,columnCount:M,rowCount:F,bottom:k,right:P,topVisible:L,bottomVisible:N,leftVisible:B,rightVisible:U}=c;this.hasExtendedFloating||(s!==null&&s<S&&l>=S?(l=S,this.hasExtendedFloating=!0):s!==null&&s>=F-I&&l<F-I&&(l=F-I-1,this.hasExtendedFloating=!0),i!==null&&i<v&&a>=v?(a=v,this.hasExtendedFloating=!0):i!==null&&i>=M-E&&a<M-E&&(a=M-E-1,this.hasExtendedFloating=!0)),s!==null&&!V.isFloatingRow(s,c)&&V.isFloatingRow(l,c)&&(s>l&&l<m?l=L-1:s<l&&l>k&&(l=N+1)),i!==null&&!V.isFloatingColumn(i,c)&&V.isFloatingColumn(a,c)&&(i>a&&a<d?a=B-1:i<a&&a>P&&(a=U+1)),n.moveCursorToPosition(a,l,!0,!0)}return!0}onUp(t,n){return this.startPoint!==void 0&&(this.startPoint=void 0,this.dragBounds=void 0,this.stopTimer(),n.commitSelection()),!1}moveSelection(t,n,s,i){const{row:o,column:r}=n,{metrics:l}=t;if(!l)throw new Error("metrics not set");const{selectionEndRow:a,selectionEndColumn:c}=t.state;if(a==null||c==null)throw new Error("selection not set");const{rowCount:d,columnCount:h}=l,m=s<0&&r!=null?r:0,p=s>0&&r!=null?r:h-1,g=i<0&&o!=null?o:0,f=i>0&&o!=null?o:d-1;t.moveCursorToPosition(Math.min(Math.max(m,c+s),p),Math.min(Math.max(g,a+i),f),!0),this.lastTriggerTime=Date.now()}startTimer(t,n,s,i){this.stopTimer();const o=this.lastTriggerTime!=null?Zr-Math.min(Zr,Date.now()-this.lastTriggerTime):0;this.timer=setTimeout(()=>{this.moveSelection(t,n,s,i),this.startTimer(t,n,s,i)},o)}stopTimer(){this.timer!==void 0&&(clearTimeout(this.timer),this.timer=void 0)}}const Jr=5,Bh=1e3/60,wi=10;function wn(e,t,n,s){var S,I,v,E,M,F,k;const{modelColumns:i,movedColumns:o,visibleColumnXs:r,columnCount:l,visibleColumnWidths:a,userColumnWidths:c,calculatedColumnWidths:d,floatingLeftWidth:h,maxX:m}=n;if(t==null||e==null||e>l||e<0)return null;const p=(S=i.get(e))!=null?S:V.getModelIndex(e,o),g=s.getColumnHeaderGroup(p,t),f=g!=null;let b,C,w;if(g!=null){const[P,L]=g.getVisibleRange(o);b=(I=r.get(P))!=null?I:h,C=((v=r.get(L))!=null?v:m)+((E=a.get(L))!=null?E:0),w=[P,L]}else{const P=r.get(e);if(P==null)return null;b=P,C=b+((k=(F=(M=a.get(e))!=null?M:c.get(p))!=null?F:d.get(p))!=null?k:0),w=[e,e]}return{visibleIndex:e,modelIndex:p,left:b,right:C,width:C-b,isColumnGroup:f,range:w,depth:t}}class Wh extends Ze{constructor(){super(...arguments),this.cursor=null,this.draggingColumn=null}setScrollInterval(t,n){this.scrollingInterval!=null&&n===this.scrollingDirection||(this.scrollingDirection=n,this.scrollingInterval=window.setInterval(()=>{var f,b;const{metrics:s}=t;if(!s)return;const{left:i,lastLeft:o,leftOffset:r,userColumnWidths:l,calculatedColumnWidths:a,movedColumns:c,visibleColumnWidths:d}=s;let h=i,m=r;if(n==="left")for(m-=wi;m<0;){h-=1;const C=V.getModelIndex(i-1,c),w=(f=l.get(C))!=null?f:a.get(C);w===void 0?m=0:m+=w,h<0&&(m=0,h=0)}else{m+=wi;let C=d.get(i);for(;C!==void 0&&m>C;){h+=1,m-=C;const w=V.getModelIndex(i+1,c);C=(b=l.get(w))!=null?b:a.get(w),h>o&&(m=0,h=o)}}const{mouseX:p,mouseY:g}=t.state;!s||p==null||g==null||(this.moveDraggingColumn(p,t,n==="left"?-wi:wi),t.setState({left:h,leftOffset:m}),(n==="left"&&h===0&&r===0||n==="right"&&h===o)&&this.clearScrollInterval())},Bh))}clearScrollInterval(){this.scrollingDirection=void 0,window.clearInterval(this.scrollingInterval),this.scrollingInterval=void 0}onLeave(){return this.clearScrollInterval(),!1}onDown(t,n){const{model:s}=n.props,{x:i,column:o,columnHeaderDepth:r}=t,{metrics:l}=n;if(!l)throw new Error("Metrics not set");const a=wn(o,r,l,s);if(o==null||a==null||r==null||r>0&&!a.isColumnGroup)return!1;const{rowHeaderWidth:c}=l;return this.initialGridPoint=t,this.draggingColumn=null,this.cursor=null,a.modelIndex!=null&&r!=null&&s.isColumnMovable(a.modelIndex,r)&&(this.draggingOffset=i-a.left-c,this.initialOffset=this.draggingOffset),!1}onDrag(t,n,s){if(this.draggingOffset===void 0||this.initialGridPoint===void 0||this.initialOffset===void 0)return!1;const{x:i,y:o}=t,{columnHeaderDepth:r}=this.initialGridPoint,{model:l}=n.props;let{draggingColumn:a}=this;const{metrics:c}=n;if(!c)throw new Error("Metrics not set");if(!a&&Math.abs(this.initialGridPoint.x-i)<Jr&&Math.abs(this.initialGridPoint.y-o)<Jr)return!1;if(a==null){const d=wn(this.initialGridPoint.column,r,c,l);if(!d||r==null||!l.isColumnMovable(d.modelIndex)||r>0&&!d.isColumnGroup||d.range[0]==null)return!1;a={range:d.range,depth:r,left:d.left,width:d.width};const h=wn(a.range[0],0,c,l),m=wn(a.range[1],0,c,l);if(!h||!m)return!1;this.draggingColumn=a,n.setState({draggingColumn:a,isDragging:!0})}return this.cursor="move",this.moveDraggingColumn(t.x,n,s.movementX),!0}moveDraggingColumn(t,n,s){var M,F,k,P,L;if(this.draggingOffset===void 0||this.initialGridPoint===void 0||this.initialOffset===void 0||this.draggingColumn==null||s===0)return;if(this.initialOffset!==this.draggingOffset){this.draggingOffset<this.initialOffset&&this.initialOffset<this.draggingOffset+s||this.draggingOffset>this.initialOffset&&this.initialOffset>this.draggingOffset+s?this.draggingOffset=this.initialOffset:this.draggingOffset+=s,this.draggingColumn={...this.draggingColumn,left:t-this.draggingOffset},n.setState({draggingColumn:this.draggingColumn});return}const{depth:i}=this.draggingColumn,{model:o}=n.props,{movedColumns:r}=n.state,{metrics:l}=n;if(!l)throw new Error("Metrics not set");const{floatingLeftWidth:a,width:c,columnHeaderMaxDepth:d,visibleColumnXs:h}=l,m=s<0,p=wn(this.draggingColumn.range[0],i,l,o);if(!p)return;const g=t-this.draggingOffset,f=g+p.width;this.draggingColumn={...this.draggingColumn,left:g},n.setState({draggingColumn:this.draggingColumn});const b=wn(V.getColumnAtX(lt(m?g:f,a,c),l,!0),i,l,o),C=o.getColumnHeaderParentGroup(p.modelIndex,p.depth);if(!b)return;if(C){const N=C.getVisibleRange(r);if(b.visibleIndex<N[0]){const B=this.moveColumn(p,N[0],r);this.draggingOffset=t-((M=h.get(N[0]))!=null?M:0),this.draggingColumn={...this.draggingColumn,left:t-this.draggingOffset},this.clearScrollInterval(),n.setState({draggingColumn:this.draggingColumn,movedColumns:B});return}if(b.visibleIndex>N[1]){const B=this.moveColumn(p,N[1]-(p.range[1]-p.range[0]),r),{right:U=0}=(F=wn(N[1],0,l,o))!=null?F:{};this.draggingOffset=t-(U-p.width),this.draggingColumn={...this.draggingColumn,left:t-this.draggingOffset},this.clearScrollInterval(),n.setState({draggingColumn:this.draggingColumn,movedColumns:B});return}}if(!o.isColumnMovable(b.modelIndex)){let N=b.visibleIndex;if(m)for(N+=1;N<p.visibleIndex&&!o.isColumnMovable(V.getModelIndex(N,r));)N+=1;else for(N-=1;N>p.visibleIndex&&!o.isColumnMovable(V.getModelIndex(N,r));)N-=1;if(N!==p.visibleIndex){m||(N-=p.range[1]-p.range[0]);const U=this.moveColumn(p,N,r);n.setState({movedColumns:U,draggingColumn:this.draggingColumn})}const B=wn(N,0,l,o);m?this.draggingOffset=t-((k=B==null?void 0:B.left)!=null?k:0):this.draggingOffset=t-(((P=B==null?void 0:B.right)!=null?P:0)-p.width),this.draggingColumn={...this.draggingColumn,left:t-this.draggingOffset},n.setState({draggingColumn:this.draggingColumn});return}if(g<=a?this.setScrollInterval(n,"left"):f>c?this.setScrollInterval(n,"right"):this.clearScrollInterval(),b.visibleIndex===p.visibleIndex||m&&p.visibleIndex<b.visibleIndex||!m&&p.visibleIndex>b.visibleIndex)return;const w=b.left+b.width*.5,S=o.getColumnHeaderParentGroup(p.modelIndex,p.depth);let I,v=((L=S==null?void 0:S.depth)!=null?L:d)-1;for(;v>=0&&I===void 0;)I=o.getColumnHeaderGroup(b.modelIndex,v),v-=1;let E;m&&g<w&&(!I||b.visibleIndex===I.getVisibleRange(r)[0])&&(E=this.moveColumn(p,b.range[0],r)),!m&&f>w&&(!I||b.visibleIndex===I.getVisibleRange(r)[1])&&(E=this.moveColumn(p,b.range[1]-(p.range[1]-p.range[0]),r)),E&&(this.draggingColumn={...this.draggingColumn,left:g},n.setState({movedColumns:E,draggingColumn:this.draggingColumn}))}moveColumn(t,n,s){const i=t.isColumnGroup?V.moveRange(t.range,n,s):V.moveItem(t.visibleIndex,n,s),o=n-t.range[0],r=[t.range[0]+o,t.range[1]+o];return this.draggingColumn&&(this.draggingColumn={...this.draggingColumn,range:r}),i}onUp(t,n){return this.cursor=null,this.clearScrollInterval(),this.draggingOffset!=null?(this.draggingOffset=void 0,n.setState({draggingColumn:null,isDragging:!1}),!0):!1}}class or extends Ze{constructor(){super(...arguments),this.cursor="default"}static getLeftWithOffsetFromRawLeft(t,n){const s=t.getTheme(),{metrics:i,metricCalculator:o}=t;if(!i)throw new Error("metrics not set");if(s.scrollSnapToColumn)return{left:Math.round(n),leftOffset:0};const r=Math.floor(n),l=n-r;let a=i.visibleColumnWidths.get(r);if(a==null){const d=t.getMetricState();a=o.getVisibleColumnWidth(r,d)}const c=a*l;return{left:r,leftOffset:c}}isInScrollBar(t,n){const s=n.getTheme(),{scrollBarSize:i,scrollBarHoverSize:o}=s,{metrics:r}=n;if(!r)throw new Error("metrics not set");const{x:l,y:a}=t,{barLeft:c,barWidth:d,height:h,hasHorizontalBar:m}=r;return m&&i>0&&a>=h-o&&a<h&&l>c&&l<c+d}getLeftWithOffset(t,n){var f;const{metrics:s}=n;if(!s)throw new Error("metrics not set");const{x:i}=t,{barWidth:o,handleWidth:r,lastLeft:l,barLeft:a,columnCount:c,scrollableContentWidth:d,scrollableViewportWidth:h}=s,m=i-a,p=lt((m-((f=this.dragOffset)!=null?f:0))/(o-r),0,1);if(c===1)return{left:0,leftOffset:p*(d-h)};const g=p*l;return or.getLeftWithOffsetFromRawLeft(n,g)}onDown(t,n){const{metrics:s}=n;if(!s)throw new Error("metrics not set");const{x:i}=t,{handleWidth:o,barLeft:r,scrollX:l}=s;if(!this.isInScrollBar(t,n))return!1;const a=i-r;if(a>=l&&a<=l+o)this.dragOffset=a-l,n.setState({isDraggingHorizontalScrollBar:!0});else{this.dragOffset=0;const{left:c,leftOffset:d}=this.getLeftWithOffset(t,n);n.setViewState({left:c,leftOffset:d,isDraggingHorizontalScrollBar:!0,isDragging:!0})}return!0}onDrag(t,n){if(this.dragOffset!=null){const{left:s,leftOffset:i}=this.getLeftWithOffset(t,n);return n.setViewState({left:s,leftOffset:i,isDraggingHorizontalScrollBar:!0,isDragging:!0}),!0}return!1}onMove(t,n){return this.isInScrollBar(t,n)}onUp(t,n){return this.dragOffset!==void 0&&(this.dragOffset=void 0,n.setState({isDraggingHorizontalScrollBar:!1,isDragging:!1})),this.isInScrollBar(t,n)}onClick(t,n){return this.isInScrollBar(t,n)}}class zh extends Ze{constructor(){super(...arguments),this.cursor="move"}onDown(t,n){const{model:s}=n.props,{x:i,y:o,row:r}=t,{metrics:l}=n;if(!l)throw new Error("metrics not set");const{columnHeaderHeight:a,rowHeaderWidth:c,visibleRowYs:d}=l;if(i<=c&&r!==null&&s.isRowMovable(r)){const h=A(d,r);this.draggingOffset=o-h-a,n.setState({draggingRowOffset:this.draggingOffset})}return!1}onDrag(t,n){if(this.draggingOffset==null)return!1;const{model:s}=n.props;let{draggingRow:i}=n.state;const{mouseX:o,mouseY:r}=n.state;if(o==null||r==null)return!1;if(i==null){const{row:E}=n.getGridPointFromXY(o,r);if(E!=null&&!s.isRowMovable(E)||(i=E,n.setState({draggingRow:i,isDragging:!0}),i==null))return!1}const{metrics:l}=n;if(!l)throw new Error("metrics not set");const{top:a,lastTop:c,bottom:d,bottomVisible:h,rowCount:m,columnHeaderHeight:p,visibleRowHeights:g,visibleRowYs:f,height:b}=l;let C=p;if(a<i){const E=i-1;C=A(f,E)+A(g,E)*.5+p}let w=b;if(i<d){const E=i+1;w=A(f,E)+A(g,E)*.5+p}let{movedRows:S}=n.state;r<C&&i>0&&s.isRowMovable(i-1)?(S=V.moveItem(i,i-1,S),i-=1):w<r&&i<m-1&&s.isRowMovable(i+1)&&(S=V.moveItem(i,i+1,S),i+=1),n.setState({movedRows:S,draggingRow:i});const I=p+A(g,a)*.5,v=p+A(f,h)+A(g,h)*.5;return r<I&&a>0?n.setState({top:a-1}):r>v&&a<c&&n.setState({top:a+1}),!0}onUp(t,n){return this.draggingOffset!==void 0?(this.draggingOffset=void 0,n.setState({draggingRowOffset:null,draggingRow:null,isDragging:!1}),!0):!1}}class rr extends da{constructor(){super(...arguments),this.hiddenCursor="s-resize",this.defaultCursor="row-resize",this.pointProperty="y",this.userSizesProperty="userRowHeights",this.visibleOffsetProperty="visibleRowYs",this.visibleSizesProperty="visibleRowHeights",this.marginProperty="columnHeaderHeight",this.calculatedSizesProperty="calculatedRowHeights",this.modelIndexesProperty="modelRows",this.firstIndexProperty="firstRow",this.treePaddingProperty="treePaddingY",this.getHiddenItems=V.getHiddenRows,this.getNextShownItem=V.getNextShownRow,this.getSeparator=rr.getRowSeparator}static getRowSeparator(t,n,s,i){if(!i.allowRowResize)return null;const{x:o,y:r}=t,l=V.getRowSeparatorIndex(o,r,n,i);return l!=null?{index:l,depth:0}:null}setSize(t,n,s){t.setRowHeight(n,s)}resetSize(t,n){t.resetRowHeight(n)}updateSeparator(t,n){t.setState({draggingRowSeparator:n,isDragging:n!==null})}}class ki extends Ze{static isInTreeBox(t,n){const{column:s,row:i,x:o,y:r}=t,{metrics:l}=n;if(!l)throw new Error("metrics not set");const{gridX:a,gridY:c,firstColumn:d,visibleColumnXs:h,visibleColumnWidths:m,visibleRowHeights:p,visibleRowYs:g,visibleRowTreeBoxes:f}=l;if(s===d&&i!=null&&f.get(i)!=null&&o>a&&r>c){const b=A(h,s),C=A(m,s),w=A(g,i),S=A(p,i);if(o>=a+b&&o<=a+b+C&&r>=c+w&&r<=c+w+S)return!0}return!1}onDown(t,n){return ki.isInTreeBox(t,n)}onClick(t,n){if(ki.isInTreeBox(t,n)){const{row:s}=t;if(s!==null)return n.toggleRowExpanded(s),!0}return!1}}class $h extends Ze{isInCorner(t,n){const s=n.getTheme(),{scrollBarSize:i}=s,{metrics:o}=n;if(!o)throw new Error("metrics not set");const{x:r,y:l}=t,{width:a,height:c,hasVerticalBar:d,hasHorizontalBar:h}=o;return i>0&&d&&h&&r>=a-i&&l>=c-i&&r<=a&&l<=c}onDown(t,n){return this.isInCorner(t,n)}onUp(t,n){return this.isInCorner(t,n)}onClick(t,n){return this.isInCorner(t,n)}}class lr extends Ze{constructor(){super(...arguments),this.cursor="default"}static getTopWithOffsetFromRawTop(t,n){const s=t.getTheme(),{metrics:i,metricCalculator:o}=t;if(!i)throw new Error("metrics not set");if(s.scrollSnapToRow)return{top:Math.round(n),topOffset:0};const r=Math.floor(n),l=n-r;let a=i.visibleRowHeights.get(r);if(a==null){const d=t.getMetricState();a=o.getVisibleRowHeight(r,d)}const c=a*l;return{top:r,topOffset:c}}isInScrollBar(t,n){const s=n.getTheme(),{scrollBarSize:i,scrollBarHoverSize:o}=s,{metrics:r}=n;if(!r)throw new Error("metrics not set");const{x:l,y:a}=t,{barTop:c,barHeight:d,width:h,hasVerticalBar:m}=r;return m&&i>0&&l>=h-o&&l<h&&a>c&&a<c+d}getTopWithOffset(t,n){var f;const{metrics:s}=n;if(!s)throw new Error("metrics not set");const{y:i}=t,{barHeight:o,handleHeight:r,lastTop:l,barTop:a,rowCount:c,scrollableContentHeight:d,scrollableViewportHeight:h}=s,m=i-a,p=lt((m-((f=this.dragOffset)!=null?f:0))/(o-r),0,1);if(c===1)return{top:0,topOffset:p*(d-h)};const g=p*l;return lr.getTopWithOffsetFromRawTop(n,g)}onDown(t,n){const{metrics:s}=n;if(!s)throw new Error("metrics not set");const{y:i}=t,{handleHeight:o,barTop:r,scrollY:l}=s;if(!this.isInScrollBar(t,n))return!1;const a=i-r;if(a>=l&&a<=l+o)this.dragOffset=a-l,n.setState({isDraggingVerticalScrollBar:!0});else{this.dragOffset=0;const{top:c,topOffset:d}=this.getTopWithOffset(t,n);n.setViewState({top:c,topOffset:d,isDraggingVerticalScrollBar:!0,isDragging:!0})}return!0}onMove(t,n){return this.isInScrollBar(t,n)}onDrag(t,n){if(this.dragOffset!=null){const{top:s,topOffset:i}=this.getTopWithOffset(t,n);return n.setViewState({top:s,topOffset:i,isDraggingVerticalScrollBar:!0,isDragging:!0}),!0}return!1}onUp(t,n){return this.dragOffset!==void 0&&(this.dragOffset=void 0,n.setState({isDraggingVerticalScrollBar:!1,isDragging:!1})),this.isInScrollBar(t,n)}onClick(t,n){return this.isInScrollBar(t,n)}}class Gh extends Ze{onDoubleClick({column:t,row:n},s){const{model:i}=s.props;return Ae(i)&&t!=null&&n!=null&&i.isEditableRange(Y.makeCell(t,n))?(s.startEditing(t,n),!0):!1}}class us{constructor(t=5e3){this.order=t}onDown(t,n){return!1}}class qh extends us{onDown(t,n){switch(t.key){case"a":if(V.isModifierKeyDown(t))return n.selectAll(),!0;break;case"ArrowUp":return this.handleArrowMove(0,-1,t,n);case"ArrowDown":return this.handleArrowMove(0,1,t,n);case"ArrowRight":return this.handleArrowMove(1,0,t,n);case"ArrowLeft":return this.handleArrowMove(-1,0,t,n);case"k":case"K":return V.isModifierKeyDown(t)?!1:this.handlePageUp(t,n);case"j":case"J":return V.isModifierKeyDown(t)?!1:this.handlePageDown(t,n);case"h":case"H":return V.isModifierKeyDown(t)?!1:(t.shiftKey||n.clearSelectedRanges(),n.moveCursorToPosition(0,n.state.cursorRow,t.shiftKey),!0);case"l":case"L":{if(V.isModifierKeyDown(t))return!1;const{model:s}=n.props,{columnCount:i}=s;return t.shiftKey||n.clearSelectedRanges(),n.moveCursorToPosition(i-1,n.state.cursorRow,t.shiftKey),!0}case"PageDown":return this.handlePageDown(t,n);case"PageUp":return this.handlePageUp(t,n);case"Home":return t.shiftKey||n.clearSelectedRanges(),n.moveCursorToPosition(V.isModifierKeyDown(t)?n.state.cursorColumn:0,V.isModifierKeyDown(t)?0:n.state.cursorRow,t.shiftKey,!0,!0),!0;case"End":{const{model:s}=n.props,{columnCount:i,rowCount:o}=s;return t.shiftKey||n.clearSelectedRanges(),n.moveCursorToPosition(V.isModifierKeyDown(t)?n.state.cursorColumn:i-1,V.isModifierKeyDown(t)?o-1:n.state.cursorRow,t.shiftKey,!0,!0),!0}case"Escape":return n.clearSelectedRanges(),!0;case"Enter":if(n.state.selectedRanges.length>0)return n.moveCursorInDirection(t.shiftKey?Y.SELECTION_DIRECTION.UP:Y.SELECTION_DIRECTION.DOWN),!0;break;case"Tab":if(n.state.selectedRanges.length>0)return n.moveCursorInDirection(t.shiftKey?Y.SELECTION_DIRECTION.LEFT:Y.SELECTION_DIRECTION.RIGHT),!0;break}return!1}handleArrowMove(t,n,s,i){const o=s.shiftKey,r=V.isModifierKeyDown(s);o?i.trimSelectedRanges():i.clearSelectedRanges();const{cursorRow:l,cursorColumn:a,selectionEndColumn:c,selectionEndRow:d}=i.state,h=o?c:a,m=o?d:l;if(r){const{model:p}=i.props,{columnCount:g,rowCount:f}=p,b=r&&o;let C=null,w=null;t<0?(C=0,w=m):t>0?(C=g-1,w=m):n<0?(C=h,w=0):n>0&&(C=h,w=f-1),C!=null&&w!=null&&i.moveCursorToPosition(C,w,o,!0,b)}else{if(!i.metrics)throw new Error("grid.metrics are not set");const{theme:p}=i.props,{autoSelectRow:g,autoSelectColumn:f}=p;if(g&&t!==0){const{lastLeft:b}=i.metrics;let{left:C}=i.state;C=lt(C+t,0,b),i.moveCursorToPosition(C,l,o,!1),i.setViewState({left:C})}else if(f&&n!==0){const{lastTop:b}=i.metrics;let{top:C}=i.state;C=lt(C+n,0,b),i.moveCursorToPosition(C,a,o,!1),i.setViewState({top:C})}else i.moveCursor(t,n,o)}return!0}handlePageUp(t,n){const s=t.shiftKey;s?n.trimSelectedRanges():n.clearSelectedRanges();const{cursorColumn:i,selectionEndRow:o}=n.state,r=o,l=i;if(r==null)return!1;const a=n.getMetricState(),{metricCalculator:c}=n,{bottomVisible:d,topVisible:h,hasHorizontalBar:m}=c.getMetrics(a);let p=r-(d-h);p-=m?0:1,p=Math.max(p,0);const g=Math.max(p-(r-h),0);return n.moveCursorToPosition(l,p,s,!1),n.setViewState({top:g}),!0}handlePageDown(t,n){const s=t.shiftKey;s?n.trimSelectedRanges():n.clearSelectedRanges();const{selectionEndRow:i,cursorColumn:o}=n.state,r=i,l=o;if(r===null)return!1;const a=n.getMetricState(),{metricCalculator:c}=n,{bottomVisible:d,topVisible:h,hasHorizontalBar:m,rowCount:p,lastTop:g}=c.getMetrics(a),f=p-1;let b=d-h+r;b+=m?0:1,b=Math.min(b,f);const C=Math.min(g,b-(r-h));return n.moveCursorToPosition(l,b,s,!1),n.setViewState({top:C}),!0}}class Kh extends us{onDown(t,n){switch(t.key){case"Enter":case" ":return this.handleExpandKey(t,n)}return!1}handleExpandKey(t,n){const{selectedRanges:s}=n.state;if(s.length===1){const i=s[0];if(i.startRow===i.endRow&&i.startColumn===i.endColumn){if(!n.metrics)throw new Error("grid.metrics not set");const{model:o}=n.props,{startRow:r,startColumn:l}=i;if(r!=null){const a=n.getModelRow(r);if((l===0||l==null)&&Xe(o)&&o.isRowExpandable(a))return n.toggleRowExpanded(r),!0}}}return!1}}class Xh extends us{onDown(t,n){if(V.isModifierKeyDown(t))return!1;const{model:s}=n.props,{cursorColumn:i,cursorRow:o}=n.state;if(i==null||o==null||!Ae(s)||!s.isEditableRange(Y.makeCell(i,o)))return!1;const r=i,l=o;return r==null||l==null?!1:t.key.length===1?(n.startEditing(r,l,!0,[1,1],t.key),!0):t.key==="F2"?(n.startEditing(r,l),!0):t.key==="Backspace"?(n.startEditing(r,l,!0,void 0,""),!0):t.key==="Delete"?(n.setValueForCell(r,l,""),!0):!1}}function Yh(e){var s,i;const t=[],n=e.querySelectorAll("tr");for(let o=0;o<n.length;o+=1){const l=n[o].querySelectorAll("td"),a=[];for(let c=0;c<l.length;c+=1){const d=l[c];a.push((i=(s=d.textContent)==null?void 0:s.trim())!=null?i:"")}t.push(a)}return t}function Qh(e){const t=[];return e.forEach(n=>{var i;const s=(i=n.textContent)!=null?i:"";s.length>0&&t.push(s.split(/\t|\u00a0\u00a0 \u00a0/))}),t}function jh(e){var s,i,o;const t=e.querySelector("table");if(t!=null)return Yh(t);const n=(i=(s=e.textContent)==null?void 0:s.trim())!=null?i:"";if(n.length>0){const{childNodes:r}=e,l=n.includes(" "),a=n.includes("\xA0\xA0 \xA0");return l&&r.length!==0&&(r.length===1||r.length>1&&!((o=r[0].textContent)!=null&&o.includes(" ")))?n.split(`
|
|
1
|
+
import{A as D,z as R,R as Q,P as Xa,B as u,C as rt,D as z,E as T,F as Vo,G as ue,H as Tt,I as G,J as Ne,K as Qt,L as Ya,M as Qa,N as Wi,O as Xs,Q as ja,S as Uo,$ as Tl,T as Ys,U as lt,V as Fo,W as De,X as Mr,Y as dt,Z as Za,_ as xo,a0 as Ks,a1 as El}from"./vendor.5ad3dc6e.js";import{e as pn,W as Ja,l as bs,K as bn,a as Dr,b as Gt,c as xi}from"./monaco.e2075ada.js";import{P as Oi,b as ec,h as tc,p as nc,o as sc,s as ic,t as oc,c as po}from"./plotly.7ac8f807.js";import"./helpers.162e09a8.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();const rc="#1a171a",lc="#f0f0ee",ac="#fcd65b",cc="#9edc6f",dc="#76d9e4",hc="#aa9af4",uc="#f37e3f",mc="#f95d84",pc="#4878ea",gc="#5b5a5c",fc="#9edc6f",Cc="#fcd65b",bc="#f37e3f",wc="#f95d84",Sc="#fcfcfa",vc="#929192",Tc="#373438",Ec="#f0f0ee",yc="#1a171a",Rc="#2d2a2e",Ic="#1a171a",Mc="#f0f0ee",Dc="0.15s",Nc={"gray-100":"#fcfcfa","gray-200":"#f0f0ee","gray-300":"#c0bfbf","gray-400":"#929192","gray-500":"#5b5a5c","gray-600":"#555356","gray-700":"#403e41","gray-800":"#373438","gray-850":"#322f33","gray-900":"#211f22",black:rc,white:lc,yellow:ac,green:cc,blue:dc,purple:hc,orange:uc,red:mc,primary:pc,"primary-hover":"#235de6","primary-dark":"#343e5d",secondary:gc,success:fc,info:Cc,warning:bc,danger:wc,light:Sc,mid:vc,dark:Tc,"text-muted":"#929192",interfacewhite:Ec,interfaceblack:yc,interfacegray:Rc,"content-bg":"#2d2a2e",background:Ic,foreground:Mc,transition:Dc},Rt=Object.freeze({transitionMs:150,transitionMidMs:200,transitionLongMs:300,transitionSlowMs:1e3,...Nc});class fn extends R.exports.Component{constructor(t){super(t),this.handleEnter=this.handleEnter.bind(this),this.handleExit=this.handleExit.bind(this),this.handleBlur=this.handleBlur.bind(this),this.element=document.createElement("div"),this.element.className="popper-container",this.container=Q.createRef(),this.rAF=0;const{isShown:n}=this.props;this.state={show:n,popper:null}}componentDidUpdate(t){const{isShown:n}=this.props;t.isShown!==n&&(n?(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{this.show()})):this.hide())}componentWillUnmount(){this.destroyPopper(!1)}getVisibleElement(t){return t==null||t.clientHeight>0||t.clientWidth>0?t:this.getVisibleElement(t.parentElement)}initPopper(){let{popper:t}=this.state;const{closeOnBlur:n,referenceObject:s}=this.props;if(t||this.container.current===null)return;let{options:i}=this.props;i={placement:"auto",...i},document.body.appendChild(this.element);let o=this.getVisibleElement(this.container.current);o==null&&(o=this.container.current),t=new Xa(s||o,this.element,i),t.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(n&&!this.element.contains(document.activeElement)){const r=this.element.firstElementChild;r instanceof HTMLElement&&r.focus()}}),this.setState({popper:t})}destroyPopper(t=!0){cancelAnimationFrame(this.rAF);const{popper:n}=this.state;!n||(n.destroy(),document.body.contains(this.element)&&document.body.removeChild(this.element),t&&this.setState({popper:null}))}show(){this.initPopper(),this.setState({show:!0})}hide(){this.setState({show:!1})}scheduleUpdate(){const{popper:t}=this.state;t&&t.scheduleUpdate()}handleBlur(t){t.relatedTarget instanceof HTMLElement&&(this.element.contains(t.relatedTarget)||this.hide())}handleEnter(){const{onEntered:t}=this.props;t()}handleExit(){const{onExited:t}=this.props,{show:n}=this.state;n||this.destroyPopper(),t()}renderContent(){const{className:t,children:n,timeout:s,interactive:i,closeOnBlur:o}=this.props,{show:r}=this.state;return u(rt,{in:r,timeout:s,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,children:u("div",{onClick:l=>{l.stopPropagation()},onKeyDown:l=>{l.key==="Escape"&&this.hide()},className:z("popper",{interactive:i},t),onBlur:o?this.handleBlur:void 0,tabIndex:o?-1:void 0,role:"presentation",children:T("div",{className:"popper-content",children:[n,u("div",{className:"popper-arrow","x-arrow":""})]})})})}render(){const{popper:t}=this.state,{"data-testid":n}=this.props;return u("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":n,children:t&&Vo.createPortal(this.renderContent(),this.element)})}}fn.propTypes={children:D.exports.node.isRequired,options:D.exports.shape({}),className:D.exports.string,timeout:D.exports.number,onEntered:D.exports.func,onExited:D.exports.func,isShown:D.exports.bool,closeOnBlur:D.exports.bool,interactive:D.exports.bool,referenceObject:D.exports.shape({}),"data-testid":D.exports.string};fn.defaultProps={options:{},className:"",timeout:Rt.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0};const Fc=-1,yl=0,Rl=1,Bo=2,Il=3,Ml=4;Object.freeze({SILENT:Fc,ERROR:yl,WARN:Rl,INFO:Bo,DEBUG:Il,DEBUG2:Ml});const xt=()=>{};class Nr{constructor(t,n){this.name=t,this.prefix=t?`[${t}]`:"",this.error=xt,this.warn=xt,this.log=xt,this.info=xt,this.debug=xt,this.debug2=xt,this.level=n,this.setLogLevel(n)}setLogLevel(t){if(!Number.isFinite(t)){console.warn(`Expected a number for log level. Received: ${t}. Ignoring`);return}this.level=t,this.error=t>=yl?console.error.bind(console,this.prefix):xt,this.warn=t>=Rl?console.warn.bind(console,this.prefix):xt,this.log=t>=Bo?console.log.bind(console,this.prefix):xt,this.info=this.log,this.debug=t>=Il?console.debug.bind(console,this.prefix):xt,this.debug2=t>=Ml?console.debug.bind(console,this.prefix):xt}}class xc extends Nr{constructor(t=Bo){super(null,t),this.modules={}}module(t){return this.modules[t]||(this.modules[t]=new Nr(t,this.level)),this.modules[t]}setLogLevel(t){if(super.setLogLevel(t),!this.modules)return;const n=Object.keys(this.modules);for(let s=0;s<n.length;s+=1)this.modules[n[s]].setLogLevel(t)}}const te=new xc,Oc=te.module("Tooltip"),Ct=class extends R.exports.Component{constructor(e){super(e),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowMouseMove=this.handleWindowMouseMove.bind(this),this.handleWheel=this.handleWheel.bind(this),this.handleTimeout=this.handleTimeout.bind(this),this.handleExited=this.handleExited.bind(this),this.stopShowingTooltip=this.stopShowingTooltip.bind(this),this.container=Q.createRef(),this.popper=Q.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}static handleHidden(){Ct.shownTooltipCount-=1,Ct.shownTooltipCount===0&&(Ct.lastHiddenTime=Date.now())}static handleShown(){Ct.shownTooltipCount+=1}componentDidMount(){this.startListening();const{timeout:e}=this.props;e===0&&this.show()}componentDidUpdate(e,t){const{isShown:n}=t,{isShown:s}=this.state;s!==n&&(s?Ct.handleShown():Ct.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();const{isShown:e}=this.state;e&&Ct.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){Oc.error("Tooltip doesn't have a container or a parent set!");return}this.parent=this.container.current.parentElement,this.parent.addEventListener("mousemove",this.handleMouseMove),this.parent.addEventListener("mouseleave",this.handleMouseLeave),this.parent.addEventListener("mousedown",this.stopShowingTooltip)}stopListening(){!this.parent||(this.parent.removeEventListener("mousemove",this.handleMouseMove),this.parent.removeEventListener("mouseleave",this.handleMouseLeave),this.parent.removeEventListener("mousedown",this.stopShowingTooltip))}startListeningWindow(){window.addEventListener("mousemove",this.handleWindowMouseMove,!0),window.addEventListener("contextmenu",this.stopShowingTooltip,!0),window.addEventListener("wheel",this.handleWheel)}stopListeningWindow(){window.removeEventListener("mousemove",this.handleWindowMouseMove,!0),window.removeEventListener("contextmenu",this.stopShowingTooltip,!0),window.removeEventListener("wheel",this.handleWheel)}handleMouseMove(){this.startTimer()}handleWheel(){const{isShown:e}=this.state;this.popper.current&&this.parent&&e&&!this.popper.current.element.matches(":hover")&&!this.parent.matches(":hover")&&(this.stopTimer(),this.hide())}handleMouseLeave(){const{isShown:e}=this.state;this.stopTimer();const{interactive:t}=this.props;!t&&e&&this.hide()}handleTimeout(){this.show()}handleWindowMouseMove(e){const t=e.clientX,n=e.clientY,{isShown:s}=this.state;if(!this.popper.current||!this.parent)return;const i=this.popper.current.element.getBoundingClientRect(),o=this.parent.getBoundingClientRect();t>=i.left&&t<=i.left+i.width&&n>=i.top&&n<=i.top+i.height?this.handleMouseMove():t>=o.left&&t<=o.left+o.width&&n>=o.top&&n<=o.top+o.height?this.handleMouseMove():s&&(this.stopTimer(),this.hide())}startTimer(){this.stopTimer();const{timeout:e,reshowTimeout:t}=this.props;let n=e;(Ct.shownTooltipCount>0||Date.now()-Ct.lastHiddenTime<Ct.triggerReshowThreshold)&&(n=t),this.timer=window.setTimeout(this.handleTimeout,n)}stopTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}show(){var t;const{isShown:e}=this.state;if(this.stopTimer(),!e){(t=this.popper.current)==null||t.show(),this.setState({isShown:!0});const{interactive:n}=this.props;n&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)==null||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)==null||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});const{onExited:e}=this.props;e()}stopShowingTooltip(){const{isShown:e}=this.state;this.stopTimer(),e&&this.hide()}render(){const{interactive:e,children:t,options:n,referenceObject:s,popperClassName:i,"data-testid":o,onEntered:r}=this.props,{isShown:l}=this.state;return u("div",{ref:this.container,style:{display:"none"},"data-testid":o,children:u(fn,{className:z(i),options:n,ref:this.popper,onEntered:r,onExited:this.handleExited,interactive:e,referenceObject:s,children:T("div",{className:"tooltip-content",children:[" ",l&&t]})})})}};let me=Ct;me.defaultTimeout=500;me.defaultReshowTimeout=100;me.triggerReshowThreshold=300;me.shownTooltipCount=0;me.lastHiddenTime=Date.now();me.defaultProps={interactive:!1,options:{},popperClassName:"",reshowTimeout:Ct.defaultReshowTimeout,timeout:Ct.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0};const Ac=100;var Dl=(e=>(e.UP="UP",e.DOWN="DOWN",e))(Dl||{});const Qn=class extends R.exports.Component{constructor(e){super(e),this.getCachedFilteredOptions=ue((n,s)=>n.filter(i=>i.title.toLowerCase().indexOf(s.toLowerCase())>=0));let{popperOptions:t}=this.props;t={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...t},this.state={title:"",filteredOptions:[],keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,invalid:!1,popperOptions:t},this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handelInputFocus=this.handelInputFocus.bind(this),this.handleInputClick=this.handleInputClick.bind(this),this.updateInputValue=Tt(this.updateInputValue,Ac),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=Q.createRef(),this.cbContainer=Q.createRef(),this.menuContainer=Q.createRef(),this.input=Q.createRef()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}getValueAndValidate(e){if(!e)return this.setState({invalid:!1}),{value:e,isValid:!1};const{options:t}=this.props,n=t.filter(s=>s.title.toLowerCase()===e.toLowerCase());return n.length<1?(this.setState({invalid:!0}),{value:e,isValid:!1}):(this.setState({invalid:!1}),{value:n[0].value,isValid:!0})}updateInputValue(e){const{menuIsOpen:t}=this.state,{value:n,isValid:s}=this.getValueAndValidate(e);t&&this.processFilterChange(e),this.fireOnChange(n,s)}fireOnChange(e,t=!0){const{onChange:n}=this.props;n(e,t)}processFilterChange(e){var o;const{options:t}=this.props,{menuIsOpen:n}=this.state,s=e?this.getCachedFilteredOptions(t,e):t,i=s.length===1&&s[0].title===e;if(this.setState({filteredOptions:s,keyboardOptionIndex:0}),i&&n){this.closeMenu();return}(o=this.popper.current)==null||o.scheduleUpdate()}resetValue(){this.setState({title:""}),this.fireOnChange("")}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var i;const{filteredOptions:t,keyboardOptionIndex:n}=this.state,s=t[n];switch(e.key){case"Enter":case"ArrowRight":e.stopPropagation(),e.preventDefault(),s&&(this.setState({title:s.title,invalid:!1}),this.fireOnChange(s.value)),this.closeMenu(),(i=this.input.current)==null||i.focus();break;case"ArrowUp":e.stopPropagation(),e.preventDefault(),this.navigateMenu(Qn.MENU_NAVIGATION_DIRECTION.UP);break;case"ArrowDown":e.stopPropagation(),e.preventDefault(),this.navigateMenu(Qn.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Tab":if(e.stopPropagation(),e.preventDefault(),e.shiftKey){this.navigateMenu(Qn.MENU_NAVIGATION_DIRECTION.UP);break}this.navigateMenu(Qn.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Escape":e.preventDefault(),e.stopPropagation(),this.closeMenu();break}}navigateMenu(e){const{filteredOptions:t,keyboardOptionIndex:n}=this.state;let s=n;e===Qn.MENU_NAVIGATION_DIRECTION.UP?n>0?(s=(s-1)%t.length,this.setState({keyboardOptionIndex:s})):n===0&&(s=t.length-1,this.setState({keyboardOptionIndex:s})):e===Qn.MENU_NAVIGATION_DIRECTION.DOWN&&n<t.length&&(s=(s+1)%t.length,this.setState({keyboardOptionIndex:s})),this.scrollOptionIntoView(s)}handleInputKeyDown(e){const{onEnter:t}=this.props,{menuIsOpen:n}=this.state;n?this.handleMenuKeyDown(e):e.key==="Enter"?t():e.key==="Escape"?(this.resetValue(),e.preventDefault(),e.stopPropagation()):e.key==="ArrowRight"||e.key==="ArrowLeft"||e.key==="Tab"||e.key==="Shift"||this.openMenu()}handleInputChange(e){this.setState({title:e.target.value}),this.updateInputValue(e.target.value)}handleOptionClick(e){var t;this.setState({title:e.title,invalid:!1}),this.fireOnChange(e.value),this.closeMenu(),(t=this.input.current)==null||t.focus()}handelInputFocus(){const{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputClick(){const{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputBlur(e){var n;const{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&((n=this.popper.current)==null?void 0:n.element.contains(e.relatedTarget))||this.closeMenu(!1)}handleMenuBlur(e){var t;e.relatedTarget===this.input.current||e.relatedTarget instanceof Element&&((t=this.popper.current)==null?void 0:t.element.contains(e.relatedTarget))||this.closeMenu(!1)}handleMenuOpened(){var e;(e=this.input.current)==null||e.focus()}handleMenuExited(){const{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}openMenu(){const{title:e}=this.state;this.processFilterChange(e),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var t;(t=this.popper.current)==null||t.show()})}closeMenu(e=!0){var t,n;this.setState({menuIsOpen:!1,keyboardOptionIndex:0}),e&&((t=this.input.current)==null||t.focus()),(n=this.popper.current)==null||n.hide()}scrollOptionIntoView(e){var t;this.menuContainer.current&&((t=this.menuContainer.current.children.item(e))==null||t.scrollIntoView({behavior:"smooth",block:"nearest"}))}renderMenuElement(){const{inputWidth:e}=this.state;return u("div",{className:z("aci-options"),ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,style:{width:e},onBlur:this.handleMenuBlur,children:this.renderOptions()})}renderOptions(){const{noMatchText:e}=this.props,{title:t,filteredOptions:n}=this.state;return t&&n.length===0?u("div",{className:"no-match",children:e}):n.map((s,i)=>this.renderOption(s,i))}renderOption(e,t){const{keyboardOptionIndex:n}=this.state,s=`option-${t}-${e.value}`;return u("button",{type:"button",className:z("aci-option-btn",{"keyboard-active":n===t}),onClick:()=>this.handleOptionClick(e),onFocus:()=>this.setState({keyboardOptionIndex:t}),children:e.title},s)}render(){const{options:e,inputPlaceholder:t,disabled:n,className:s,defaultTitle:i,spellCheck:o,"data-testid":r}=this.props,{title:l,menuIsOpen:a,popperOptions:c,invalid:d}=this.state;return T("div",{className:"aci-container",ref:this.cbContainer,children:[u("input",{value:l||i,className:z("form-control",s,"aci-input",{"is-invalid":d&&!a}),ref:this.input,onChange:this.handleInputChange,placeholder:t||e[0].title,disabled:n,onFocus:this.handelInputFocus,onClick:this.handleInputClick,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:o,"data-testid":r}),u(fn,{ref:this.popper,options:c,className:z("aci-options-popper interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})}};let Wo=Qn;Wo.propTypes={options:D.exports.arrayOf(D.exports.shape({title:D.exports.string.isRequired,value:D.exports.string.isRequired})).isRequired,popperOptions:D.exports.shape({}),onChange:D.exports.func,inputPlaceholder:D.exports.string,disabled:D.exports.bool,className:D.exports.string,defaultTitle:D.exports.string,spellCheck:D.exports.bool,onEnter:D.exports.func,noMatchText:D.exports.string,"data-testid":D.exports.string};Wo.defaultProps={onChange(){},inputPlaceholder:"",disabled:!1,className:"",defaultTitle:"",popperOptions:null,spellCheck:!0,onEnter(){},noMatchText:"No matching items found","data-testid":void 0};Wo.MENU_NAVIGATION_DIRECTION=Dl;D.exports.string.isRequired,D.exports.func.isRequired,D.exports.string,D.exports.string,D.exports.bool,D.exports.bool,D.exports.string,D.exports.string,D.exports.string;D.exports.node.isRequired,D.exports.string,D.exports.object,D.exports.string;const kc=["primary","secondary","tertiary","success","danger","inline","ghost"],Lc=["group-end"];function Pc(e,t){switch(e){case"primary":return"btn-primary";case"secondary":return"btn-outline-primary";case"tertiary":return"btn-secondary";case"success":return"btn-success";case"danger":return"btn-danger";case"inline":return"btn-inline";case"ghost":return z("btn-link",{"btn-link-icon":t,"px-2":t})}}function Hc(e){switch(e){case"group-end":return z("pl-2","pr-3")}}const Ie=Q.forwardRef((e,t)=>{const{kind:n,variant:s,type:i,tooltip:o,icon:r,disabled:l,active:a,onClick:c,className:d,style:h,children:m,"data-testid":p}=e,f=Pc(n,r&&!m);let b;s&&(b=Hc(s));let C;r&&(C=Q.isValidElement(r)?r:u(G,{icon:r}));let w;o&&(w=typeof o=="string"?u(me,{children:o}):o);const S=T("button",{"data-testid":p,ref:t,type:i,className:z("btn",f,b,{active:a},d),onClick:c,style:h,disabled:l,children:[r&&C,m,o&&!l&&w]});return l?T("span",{className:"btn-disabled-wrapper",children:[S,o&&w]}):S});Ie.displayName="Button";Ie.propTypes={kind:D.exports.oneOf(kc).isRequired,variant:D.exports.oneOf(Lc),type:D.exports.oneOf(["submit","reset","button"]),tooltip(e){const{tooltip:t,icon:n,children:s}=e;return!t&&n&&!s?new Error("Tooltip is required for icon only buttons"):null},icon(e){const{children:t,icon:n}=e;return!n&&!t?new Error("Icon is required if no children are provided"):!t&&!Q.isValidElement(n)&&!(n!=null&&n.iconName)?new Error("Icon must be react element or fontawesome IconDefinition"):null},disabled:D.exports.bool,active:D.exports.bool,onClick(e){const{onClick:t,type:n}=e;return n==="button"&&typeof t!="function"?new Error("type button requires an onClick function"):t!==void 0&&typeof t!="function"?new Error("onClick must be a function"):null},children:D.exports.node,className:D.exports.string,style:D.exports.object,"data-testid":D.exports.string};Ie.defaultProps={type:"button",onClick:void 0,variant:void 0,tooltip:void 0,icon:void 0,disabled:!1,active:void 0,children:void 0,className:void 0,style:{},"data-testid":void 0};const _c=({className:e="theme-bg-light",children:t,role:n="role",keyboard:s=!0,isOpen:i=!1,centered:o=!1,size:r,onOpened:l,onClosed:a,toggle:c,"data-testid":d})=>{const h=R.exports.useRef(),m=R.exports.useCallback(g=>{switch(g.key){case"Escape":c==null||c();break}},[c]);R.exports.useEffect(function(){if(i&&s)return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[m,i,s]),R.exports.useEffect(function(){i&&l&&l()},[l,i]),R.exports.useEffect(function(){!i&&a&&a()},[a,i]),i&&!h.current&&(h.current=document.createElement("div"),h.current.setAttribute("style","padding-right: 15px; display: block"),h.current.setAttribute("role","presentation"),document.body.appendChild(h.current));const p=()=>{h.current&&(document.body.removeChild(h.current),h.current=void 0)};return h.current?Vo.createPortal(T(Ne,{children:[u(rt,{appear:!0,mountOnEnter:!0,unmountOnExit:!0,in:i,classNames:{appearActive:"show",appearDone:"show"},timeout:Rt.transitionMs,onExited:p,children:u("div",{className:z("modal-backdrop fade"),style:{zIndex:1050}})}),u(rt,{appear:!0,mountOnEnter:!0,unmountOnExit:!0,in:i,classNames:{appearDone:"show"},timeout:Rt.transitionMs,onExited:p,children:u("div",{className:"modal fade",onClick:c,role:"dialog",style:{display:"block"},children:u("div",{className:z(`modal-dialog ${e}`,{"modal-lg":r==="lg","modal-sm":r==="sm","modal-xl":r==="xl","modal-dialog-centered":o}),style:{zIndex:1040},children:u("div",{className:"modal-content",onClick:g=>g.stopPropagation(),role:"presentation","data-testid":d,children:t})})})})]}),h.current):u(Ne,{})},Vc=({className:e="modal-body",style:t,children:n,"data-testid":s})=>u("div",{className:e,"data-testid":s,style:t,children:n}),Uc=({className:e,children:t,closeButton:n=!0,style:s,toggle:i,"data-testid":o})=>T("div",{className:`modal-header ${e}`,style:s,children:[u("h5",{className:"modal-title",children:t}),n&&u("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":"Close",onClick:i,children:u("span",{"aria-hidden":"true",children:"\xD7"})})]});D.exports.bool.isRequired,D.exports.string.isRequired,D.exports.oneOfType([D.exports.string,D.exports.func]).isRequired,D.exports.func,D.exports.func.isRequired,D.exports.func,D.exports.func,D.exports.string,D.exports.string,D.exports.string,D.exports.node,D.exports.string;const zi=Q.forwardRef((e,t)=>{const{children:n,className:s,disabled:i,onClick:o,style:r,id:l}=e;return u("button",{ref:t,type:"button",className:z("btn",s),onClick:o,style:r,disabled:i,id:l,children:n})});zi.displayName="Button";zi.propTypes={children:D.exports.node,className:D.exports.string,disabled:D.exports.bool,onClick:D.exports.func,style:D.exports.shape({}),id:D.exports.string};zi.defaultProps={children:null,className:"",disabled:!1,onClick:()=>null,style:{},id:""};function go(e){return e.then!==void 0}const Dn=class{static disableAllActions(){Dn.actionsDisabled=!0}static enableAllActions(){Dn.actionsDisabled=!1}static isContextActionEvent(e){return Array.isArray(e.contextActions)}static compareActions(e,t){return e.group!==t.group?(e.group||0)>(t.group||0)?1:-1:e.order!==t.order?(e.order||0)>(t.order||0)?1:-1:e.title!==t.title?(e.title||"")>(t.title||"")?1:-1:e!==t?e>t?1:-1:0}static sortActions(e){if(!e||!Array.isArray(e))return[];const t=e.slice();return t.sort(Dn.compareActions),t}static isMacPlatform(){const{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return Dn.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){const t=Dn.getModifierKey();return e[t]}static copyToClipboard(e){const{clipboard:t}=navigator;return t===void 0?(Dn.copyToClipboardExecCommand(e),Promise.resolve()):navigator.clipboard.writeText(e).catch(()=>{Dn.copyToClipboardExecCommand(e)})}static copyToClipboardExecCommand(e){const t=document.activeElement,n=document.createElement("textarea");if(n.value=e,document.body.appendChild(n),n.focus(),n.select(),!document.execCommand("copy"))throw new Error("Unable to execute copy command");document.body.removeChild(n),t instanceof HTMLElement&&t.focus()}static getMenuItems(e,t=!0){let n=[],s=e;Array.isArray(s)||(s=[s]);for(let i=0;i<s.length;i+=1){const o=s[i];let r;typeof o=="function"?r=o():r=o,r!=null&&(r instanceof Promise?t&&n.push(r):Array.isArray(r)?n=n.concat(r):n.push(r))}return n=n.filter(i=>i.title||i.then||i.menuElement),n}static getNextMenuItem(e,t,n){let s=e;s<0&&t<0&&(s=n.length);for(let i=1;i<n.length+1;i+=1){const o=(s+t*i+n.length)%n.length,r=n[o];if(!(r instanceof Promise)&&r.disabled!==!0)return o}return e}};let Se=Dn;Se.actionsDisabled=!1;const Fr=te.module("GlobalContextAction");class Bc extends R.exports.Component{constructor(t){super(t),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}componentDidMount(){document.body.addEventListener("contextmenu",this.handleContextMenu),document.body.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.body.removeEventListener("contextmenu",this.handleContextMenu),document.body.removeEventListener("keydown",this.handleKeyDown)}handleContextMenu(t){const n=t;n.contextActions||(n.contextActions=[]);const{action:s}=this.props;!s.title&&!s.menuElement||(n.contextActions||(n.contextActions=[]),n.contextActions.push(s),Fr.debug("Received context menu event at global action! Menu items are now: ",n.contextActions))}handleKeyDown(t){var s,i;const{action:n}=this.props;if(!Se.actionsDisabled&&((s=n.shortcut)==null?void 0:s.matchesEvent(t))){Fr.debug("Global hotkey matched!",t);const o=(i=n.action)==null?void 0:i.call(n,t);(o||o===void 0)&&(t.preventDefault(),t.stopPropagation())}}render(){return null}}class Wc extends R.exports.Component{render(){const{actions:t,"data-testid":n}=this.props,s=[];for(let i=0;i<t.length;i+=1){const o=t[i],{shortcut:r}=o;if(o.title||o.menuElement||r){const l=u(Bc,{action:o,"data-testid":n},`${o.title}.${r==null?void 0:r.id}`);s.push(l)}}return s}}const Ci=te.module("ContextActions");class se extends R.exports.Component{constructor(t){super(t),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=Q.createRef(),this.state={globalActions:[],keyboardActions:[]}}static triggerMenu(t,n,s,i){if(!t||!n||!s||!i)return;const o=new MouseEvent("contextmenu",{clientX:n,clientY:s,bubbles:!0,cancelable:!0});o.contextActions=i,t.dispatchEvent(o)}static getDerivedStateFromProps(t){if(!t.actions||!Array.isArray(t.actions))return{globalActions:[],keyboardActions:[]};const n=t.actions.filter(i=>!go(i)&&typeof i!="function"&&i.isGlobal),s=t.actions.filter(i=>!go(i)&&typeof i!="function"&&!i.isGlobal&&i.shortcut!=null);return{globalActions:n,keyboardActions:s}}componentDidMount(){var t;(t=this.container.current)!=null&&t.parentElement&&(this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.addEventListener("keydown",this.handleKeyDown))}componentWillUnmount(){var t;(t=this.container.current)!=null&&t.parentElement&&(this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.removeEventListener("keydown",this.handleKeyDown))}handleContextMenu(t){const{ignoreClassNames:n=[]}=this.props;if(n.length>0){let i=t.target;for(;i!=null;){const{classList:o}=i,r=n.find(l=>o.contains(l));if(r!==void 0){Ci.debug2(`Contextmenu event ignored based on the target className "${r}"`);return}i=i.parentElement}}if(Se.isContextActionEvent(t)||(t.contextActions=[]),!Se.isContextActionEvent(t))return;const{actions:s}=this.props;if(s){let i=s;Array.isArray(i)&&(i=i.filter(o=>go(o)||typeof o=="function"||!o.isGlobal)),t.contextActions=t.contextActions.concat(i)}Ci.debug("Received context menu event! Menu items are now: ",t.contextActions)}handleKeyDown(t){var s,i;const{keyboardActions:n}=this.state;for(let o=0;o<n.length;o+=1){const r=n[o];if(!Se.actionsDisabled&&((s=r.shortcut)==null?void 0:s.matchesEvent(t))){Ci.debug("Context hotkey matched!",t);const l=(i=r.action)==null?void 0:i.call(r,t);if(l||l===void 0){t.stopPropagation(),t.preventDefault();return}Ci.debug2("Matched hotkey returned false, key event not consumed")}}}render(){const{"data-testid":t}=this.props,{globalActions:n}=this.state;return u("div",{className:"context-actions-listener",ref:this.container,"data-testid":t,children:u(Wc,{actions:n})})}}se.groups={default:null,high:100,medium:5e3,low:1e4,global:1e5,edit:100};var zc={prefix:"vs",iconName:"arrow-left",icon:[512,512,[],"f000","m224 98.976 -160 160V281.6l160 160 22.624 -22.624 -132.672 -132.704H448v-32H113.92L246.656 121.6 224 98.976z"]},rs={prefix:"vs",iconName:"check",icon:[512,512,[],"f000","m461.792 106.336 -271.04 320 -25.28 -1.152 -107.2 -152.64 26.176 -18.368 95.296 135.68 257.632 -304.192 24.448 20.672z"]},$c={prefix:"vs",iconName:"chevron-down",icon:[512,512,[],"f000","m255.232 322.304 139.424 -139.424 19.84 19.776L265.088 352h-19.776L96 202.656l19.808 -19.776 139.424 139.424z"]},Gc={prefix:"vs",iconName:"chevron-left",icon:[512,512,[],"f000","m189.696 255.232 139.424 139.424 -19.776 19.84L160 265.088v-19.776L309.344 96l19.776 19.808 -139.424 139.424z"]},Nl={prefix:"vs",iconName:"chevron-right",icon:[512,512,[],"f000","M322.304 256.768 182.88 117.344l19.776 -19.84L352 246.912v19.776L202.656 416l-19.776 -19.808 139.424 -139.424z"]},qc={prefix:"vs",iconName:"chevron-up",icon:[512,512,[],"f000","m256.768 189.696 -139.424 139.424 -19.84 -19.776L246.912 160h19.776L416 309.344l-19.808 19.776 -139.424 -139.424z"]},zo={prefix:"vs",iconName:"circle-large-filled",icon:[512,512,[],"f000","M256 32a217.6 217.6 0 0 1 59.52 8.096 220.768 220.768 0 0 1 98.656 57.76 220.896 220.896 0 0 1 57.728 98.656C477.312 215.616 480 235.424 480 256s-2.688 40.384 -8.096 59.52a220.8 220.8 0 0 1 -22.528 53.568 229.024 229.024 0 0 1 -80.512 80.288 222.912 222.912 0 0 1 -53.376 22.72A223.488 223.488 0 0 1 256 480a223.488 223.488 0 0 1 -59.52 -7.872 227.136 227.136 0 0 1 -53.568 -22.752 233.6 233.6 0 0 1 -45.28 -35.008 233.44 233.44 0 0 1 -35.008 -45.28 227.136 227.136 0 0 1 -22.72 -53.6A223.52 223.52 0 0 1 32 256c0 -20.576 2.624 -40.384 7.872 -59.52a222.976 222.976 0 0 1 22.752 -53.344 228.992 228.992 0 0 1 80.288 -80.512 220.64 220.64 0 0 1 53.6 -22.528A217.856 217.856 0 0 1 256 32z"]},Kc={prefix:"vs",iconName:"circle-large-outline",icon:[512,512,[],"f000","M306.816 70.88A185.856 185.856 0 0 0 256 64c-17.728 0 -34.624 2.336 -50.816 6.88l-0.192 0.064c-16.448 4.512 -31.68 10.944 -45.824 19.232A196.992 196.992 0 0 0 90.24 159.36l-0.064 0.128A190.944 190.944 0 0 0 70.72 205.12 191.552 191.552 0 0 0 64 256c0 17.76 2.24 34.72 6.72 50.912a193.6 193.6 0 0 0 49.536 84.832c11.84 11.68 24.768 21.664 38.912 30.08a195.2 195.2 0 0 0 45.92 19.488A192.64 192.64 0 0 0 256 448c17.76 0 34.72 -2.24 50.912 -6.72 16.48 -4.64 31.68 -11.136 45.632 -19.424l0.128 -0.064a197.12 197.12 0 0 0 69.152 -68.96 187.2 187.2 0 0 0 19.2 -45.824l0.096 -0.192A185.824 185.824 0 0 0 448 256c0 -17.728 -2.304 -34.624 -6.88 -50.816l-0.064 -0.192a184.704 184.704 0 0 0 -19.2 -45.536l-0.064 -0.128a188.8 188.8 0 0 0 -30.144 -38.72l-0.256 -0.256a188.864 188.864 0 0 0 -38.72 -30.144l-0.128 -0.064a184.704 184.704 0 0 0 -45.536 -19.2l-0.192 -0.064zm142.56 298.24a229.024 229.024 0 0 1 -80.512 80.256 222.912 222.912 0 0 1 -53.376 22.72A223.488 223.488 0 0 1 256 480a223.488 223.488 0 0 1 -59.52 -7.872 227.136 227.136 0 0 1 -53.568 -22.752 233.6 233.6 0 0 1 -45.28 -35.008 233.44 233.44 0 0 1 -35.008 -45.28 227.136 227.136 0 0 1 -22.72 -53.6A223.52 223.52 0 0 1 32 256c0 -20.576 2.624 -40.384 7.872 -59.52a222.976 222.976 0 0 1 22.752 -53.344 228.992 228.992 0 0 1 80.288 -80.512 220.64 220.64 0 0 1 53.6 -22.528A217.856 217.856 0 0 1 256 32a217.6 217.6 0 0 1 59.52 8.096 220.768 220.768 0 0 1 98.656 57.76 220.896 220.896 0 0 1 57.728 98.656C477.312 215.616 480 235.424 480 256s-2.688 40.384 -8.096 59.52a220.8 220.8 0 0 1 -22.528 53.568z"]},xr={prefix:"vs",iconName:"clippy",icon:[512,512,[],"f000","M224 447.744H128v-288h256v64h32v-80l-16 -16H352v-32h-32a64 64 0 0 0 -128 0H158.08v32H112l-16 16v320l16 16H224v-32zm0 -358.4a32 32 0 0 1 25.6 -25.6 32 32 0 0 1 18.56 1.92 30.08 30.08 0 0 1 14.4 11.52 32 32 0 1 1 -56 30.08 32 32 0 0 1 -2.56 -17.92zm226.56 302.72L416 426.944v-171.2h-32v170.88l-34.56 -34.56 -22.72 22.72 62.08 61.76h22.72l61.76 -61.76 -22.72 -22.72zm-189.44 -133.12h22.72l61.76 61.76 -22.72 22.72 -34.56 -34.56v170.88h-32v-171.2l-34.56 34.88 -22.72 -22.72 62.08 -61.76z"]},$i={prefix:"vs",iconName:"close",icon:[512,512,[],"f000","m256 278.624 116.672 116.704 22.656 -22.624L278.624 256l116.704 -116.672 -22.624 -22.656L256 233.376 139.328 116.672l-22.624 22.656L233.376 256l-116.672 116.672 22.624 22.656L256 278.624z"]},Xc={prefix:"vs",iconName:"cloud-download",icon:[512,512,[],"f000","M382.624 192h1.6a95.68 95.68 0 0 1 67.712 28.128 96.096 96.096 0 0 1 0 135.744 95.68 95.68 0 0 1 -67.744 28.128v-32a64.064 64.064 0 0 0 0 -128h-29.248l-3.936 -27.424a79.68 79.68 0 0 0 -68.032 -67.904A79.296 79.296 0 0 0 199.392 176l-10.656 24.384 -25.888 -6.048A79.68 79.68 0 0 0 144.736 192c-21.184 0 -41.504 8.416 -56.448 23.424A80.096 80.096 0 0 0 144.736 352h15.936v32h-15.936a111.552 111.552 0 0 1 -84.096 -37.12 112.064 112.064 0 0 1 62.656 -184.96 110.784 110.784 0 0 1 46.976 1.28 111.552 111.552 0 0 1 117.024 -65.92A111.328 111.328 0 0 1 382.624 192zm-168 163.872 42.048 42.048V224h31.808v172.8l40.896 -40.928 22.624 22.624 -68.672 68.704h-22.656L192 378.528l22.624 -22.656z"]},Fl={prefix:"vs",iconName:"copy",icon:[512,512,[],"f000","m128 128 32 -32h173.248L448 210.752V448l-32 32H160l-32 -32V128zm288 96 -96 -96H160v320h256V224zM96 32 64 64v320l32 32V64h205.248l-32 -32H96z"]},xl={prefix:"vs",iconName:"edit",icon:[512,512,[],"f000","M423.36 32h-46.72L112.64 296l-5.12 7.04L32 434.88 77.12 480l131.84 -75.52 7.04 -5.12L480 135.36V88.64L423.36 32zM77.12 434.88l48.32 -96 46.4 46.4 -94.72 49.6zm122.56 -65.92L143.04 312.32l256 -256 56.64 56.64 -256 256z"]},Or={prefix:"vs",iconName:"file-code",icon:[512,512,[],"f000","m338.24 36.48 104.96 105.6 4.8 11.52v310.4l-16 16h-352l-16 -16v-416l16 -16h247.04l11.2 4.48zM320 160h96l-96 -96v96zM96 64v384h320V192H304L288 176V64H96zm65.984 241.056 58.144 -58.496L197.44 224 128 293.728v22.624l69.472 69.568 22.624 -22.624 -58.112 -58.24zM281.6 246.848l22.4 -22.688 70.048 69.6v22.688L304 385.984l-22.56 -22.688 58.592 -58.24L281.6 246.848z"]},Yc={prefix:"vs",iconName:"file-zip",icon:[512,512,[],"f000","M80 32h352l16 16v160l-4.8 11.2 -27.2 27.52v217.28l-16 16h-320l-16 -16v-416l16 -16zM192 64H160v64h32V64zm0 384h128V245.76l-27.2 -27.2L288 207.04V64H224v80l-16 16H192v32H160V160h-16L128 144V64H96v384h64v-32h32v32zm0 -64v32h32v-32H192zm0 -32v32H160v-32h32zm0 -32h32v32H192v-32zm0 -32v32H160V288h32zm0 -32h32v32H192V256zm0 -32v32H160V224h32zm0 0h32V192H192v32zm196.8 4.8 27.2 -27.52V64h-96v136.64l27.2 27.2 4.8 11.2V448h32V240l4.8 -11.2z"]},Qc={prefix:"vs",iconName:"files",icon:[512,512,[],"f000","M373.333 0h-192L149.333 32V128H53.333L21.333 160v321.493L53.333 512h257.493L341.333 481.493V384h100.267l27.733 -30.507V96L373.333 0zm0 45.227 50.773 50.773H373.333V45.227zm-64 434.773h-256v-320H149.333v193.493L181.333 384h128v96zm128 -128h-256v-320H341.333V128h96v224z"]},Ai={prefix:"vs",iconName:"filter",icon:[512,512,[],"f000","M480 64v53.44l-160 152.288V448H192V269.728l-160 -152.32V64h448zM224 256v160h64V256l160 -152.32V96H64v7.68L224 256z"]},jc={prefix:"vs",iconName:"gear",icon:[512,512,[],"f000","M291.2 140.8 275.2 64H236.8l-16 76.8 -22.4 9.6 -64 -41.6 -28.8 25.6 41.6 64 -6.4 22.4 -76.8 16v38.4l76.8 16 9.6 25.6 -41.6 64 25.6 25.6 64 -41.6 25.6 9.6 12.8 73.6h38.4l16 -76.8 25.6 -9.6 64 41.6 25.6 -25.6 -41.6 -64 9.6 -25.6 73.6 -12.8V236.8l-76.8 -16 -9.6 -25.6 41.6 -64 -25.6 -25.6 -64 41.6 -22.4 -6.4zM300.8 32l16 76.8L384 67.2l64 64 -44.8 67.2 76.8 12.8v89.6l-76.8 16L448 384l-64 64 -67.2 -44.8 -16 76.8H211.2l-16 -76.8L128 444.8l-64 -64 44.8 -67.2L32 300.8V211.2l76.8 -16L67.2 128l64 -64 67.2 44.8 12.8 -76.8h89.6zm19.2 224c0 35.2 -28.8 64 -64 64s-64 -28.8 -64 -64 28.8 -64 64 -64 64 28.8 64 64zM256 288c19.2 0 32 -12.8 32 -32s-12.8 -32 -32 -32 -32 12.8 -32 32 12.8 32 32 32z"]},Ol={prefix:"vs",iconName:"graph",icon:[512,512,[],"f000","M48 448H480v-32H64V0H32v432l16 16zM96 368v-256l16 -16h64l16 16v256l-16 16h-64l-16 -16zm64 -16V128H128v224h32zm192 -304v320l16 16h64l16 -16v-320l-16 -16h-64l-16 16zm64 16v288h-32V64h32zm-192 304v-192l16 -16h64l16 16v192l-16 16h-64l-16 -16zm64 -16V192H256v160h32z"]},Gi={prefix:"vs",iconName:"gripper",icon:[512,512,[],"f000","M160 96h64v64H160zm0 128h64v64H160zm0 128h64v64H160zm128 -256h64v64H288zm0 128h64v64H288zm0 128h64v64H288z"]},Zc={prefix:"vs",iconName:"json",icon:[512,512,[],"f000","M192 95.488V64h-2.88c-10.016 0 -19.712 1.984 -29.088 5.92a74.56 74.56 0 0 0 -24.8 16.96 71.36 71.36 0 0 0 -15.776 24.096v0.032a113.344 113.344 0 0 0 -6.336 26.56v0.064a194.56 194.56 0 0 0 -0.768 27.616c0.384 9.28 0.576 18.56 0.576 27.808 0 6.496 -1.28 12.576 -3.744 18.304v0.032a48.128 48.128 0 0 1 -24.48 25.184 44.032 44.032 0 0 1 -17.856 3.68H64v31.488h2.88c6.24 0 12.16 1.28 17.792 3.872l0.032 0.032c5.696 2.496 10.528 5.888 14.56 10.176l0.064 0.064c4.16 4.16 7.456 9.12 9.824 14.88l0.032 0.064c2.496 5.76 3.744 11.776 3.744 18.112 0 9.28 -0.192 18.56 -0.576 27.808 -0.384 9.472 -0.128 18.72 0.768 27.84v0.032c1.056 9.056 3.168 17.856 6.304 26.368v0.032c3.392 8.736 8.672 16.768 15.808 24.096 7.136 7.36 15.424 13.024 24.8 16.96 9.376 3.936 19.072 5.92 29.12 5.92H192v-31.488h-2.88c-6.4 0 -12.384 -1.216 -18.016 -3.68a51.616 51.616 0 0 1 -14.624 -10.24 53.088 53.088 0 0 1 -9.888 -14.944c-2.368 -5.76 -3.52 -11.84 -3.52 -18.336 0 -7.296 0.096 -14.496 0.352 -21.504 0.256 -7.296 0.256 -14.4 0 -21.28a148.448 148.448 0 0 0 -1.76 -20.48 85.824 85.824 0 0 0 -5.376 -19.488A73.088 73.088 0 0 0 112.704 256a73.088 73.088 0 0 0 23.616 -30.56c2.56 -6.144 4.32 -12.576 5.376 -19.264 1.056 -6.72 1.632 -13.536 1.76 -20.48 0.256 -7.04 0.256 -14.144 0 -21.312 -0.256 -7.168 -0.384 -14.4 -0.384 -21.696a47.04 47.04 0 0 1 28.064 -43.328 42.56 42.56 0 0 1 18.016 -3.872H192zm128 321.024V448h2.88c10.016 0 19.712 -1.984 29.088 -5.92 9.376 -3.936 17.664 -9.6 24.8 -16.96 7.136 -7.36 12.416 -15.36 15.776 -24.096v-0.032c3.2 -8.512 5.28 -17.376 6.336 -26.56v-0.064c0.896 -8.96 1.152 -18.144 0.768 -27.616 -0.384 -9.28 -0.576 -18.56 -0.576 -27.808 0 -6.496 1.28 -12.576 3.744 -18.304v-0.032a48.064 48.064 0 0 1 24.48 -25.184 44.16 44.16 0 0 1 17.856 -3.68H448v-31.488h-2.88c-6.272 0 -12.192 -1.28 -17.824 -3.872l-0.032 -0.032a44.032 44.032 0 0 1 -14.56 -10.176l-0.064 -0.064a45.28 45.28 0 0 1 -9.824 -14.88v-0.064a44.96 44.96 0 0 1 -3.776 -18.112c0 -9.28 0.192 -18.56 0.576 -27.808a197.568 197.568 0 0 0 -0.768 -27.84v-0.032a113.184 113.184 0 0 0 -6.304 -26.368v-0.032a71.36 71.36 0 0 0 -15.808 -24.096 74.592 74.592 0 0 0 -24.8 -16.96 74.4 74.4 0 0 0 -29.12 -5.92H320v31.488h2.88c6.4 0 12.384 1.216 17.984 3.68 5.568 2.624 10.432 6.016 14.624 10.24 4.064 4.288 7.36 9.28 9.888 14.944 2.368 5.76 3.52 11.84 3.52 18.336 0 7.296 -0.096 14.464 -0.352 21.504 -0.256 7.296 -0.256 14.4 0 21.28 0.128 7.104 0.704 13.92 1.76 20.48 1.056 6.848 2.848 13.312 5.376 19.488a73.12 73.12 0 0 0 23.616 30.56 73.12 73.12 0 0 0 -23.616 30.56 86.048 86.048 0 0 0 -5.376 19.264c-1.056 6.72 -1.632 13.536 -1.76 20.48a292.8 292.8 0 0 0 0 21.312c0.256 7.168 0.384 14.4 0.384 21.696a47.072 47.072 0 0 1 -28.064 43.328 42.56 42.56 0 0 1 -18.016 3.872H320z"]},Jc={prefix:"vs",iconName:"kebab-vertical",icon:[512,512,[],"f000","M238.208 442.624a32 32 0 1 0 35.552 -53.216 32 32 0 0 0 -35.52 53.184zM256 288a32 32 0 1 1 0 -64 32 32 0 0 1 0 64zm0 -160a32 32 0 1 1 0 -64 32 32 0 0 1 0 64z"]},ed={prefix:"vs",iconName:"link-external",icon:[512,512,[],"f000","M48 32H192v32H64v384h384v-128h32v144l-16 16h-416l-16 -16v-416l16 -16zm432 16V256h-32V86.624L231.776 302.88l-22.624 -22.656L425.376 64H256V32h208l16 16z"]},Al={prefix:"vs",iconName:"link",icon:[512,512,[],"f000","M140.8 96h98.72a108.8 108.8 0 0 1 108.8 108.8v6.56A108.8 108.8 0 0 1 239.52 320H224V288h15.52A76.8 76.8 0 0 0 316.16 211.52V204.8A76.8 76.8 0 0 0 239.68 128H140.8A76.8 76.8 0 0 0 64 204.8v6.56A76.608 76.608 0 0 0 128 286.72v32a108.8 108.8 0 0 1 -96 -107.2V204.8A108.96 108.96 0 0 1 140.8 96zM384 225.28v-32a108.8 108.8 0 0 1 96 107.52v6.56A108.96 108.96 0 0 1 371.36 416h-98.88A108.8 108.8 0 0 1 163.84 307.52V300.8A108.8 108.8 0 0 1 272.48 192H288v32h-15.52A76.8 76.8 0 0 0 195.84 300.8v6.56A76.8 76.8 0 0 0 272.48 384h98.88A76.8 76.8 0 0 0 448 307.52V300.8a76.608 76.608 0 0 0 -64 -75.52z"]},td={prefix:"vs",iconName:"list-ordered",icon:[512,512,[],"f000","M73.184 74.432 86.144 64h21.664v96h-22.656V89.344l-11.968 8.992v-23.904zM160 96h320v32H160V96zm0 128h320v32H160V224zm320 128H160v32h320v-32zM119.744 244.032l0.928 -1.248 2.08 -2.88a26.88 26.88 0 0 0 4.992 -16.224c0 -3.84 -0.64 -7.68 -1.824 -11.328a27.136 27.136 0 0 0 -15.744 -16.928 35.936 35.936 0 0 0 -14.464 -2.624 35.008 35.008 0 0 0 -14.656 2.784 27.744 27.744 0 0 0 -15.328 16.704A33.216 33.216 0 0 0 64 222.624v1.6h25.92v-1.6a9.6 9.6 0 0 1 1.472 -5.024 5.568 5.568 0 0 1 1.824 -1.728 6.08 6.08 0 0 1 5.504 0 6.016 6.016 0 0 1 1.792 1.92 7.68 7.68 0 0 1 0.992 2.592 14.24 14.24 0 0 1 -1.152 9.28 41.888 41.888 0 0 1 -3.84 5.824l-32 36.416 -0.384 0.416v17.28h63.616v-22.4h-28.8l20.8 -23.168zm-1.184 122.144c1.472 1.024 2.752 2.24 3.84 3.648a26.912 26.912 0 0 1 5.344 17.6c0 3.424 -0.544 6.816 -1.6 10.048a25.344 25.344 0 0 1 -15.584 16 41.216 41.216 0 0 1 -15.36 2.528c-3.68 0 -7.36 -0.512 -10.912 -1.568a30.08 30.08 0 0 1 -8.256 -3.936 24.032 24.032 0 0 1 -5.824 -5.664 34.016 34.016 0 0 1 -3.712 -6.4A33.216 33.216 0 0 1 64 386.496v-1.568h26.048v1.568c0 0.864 0.096 1.76 0.288 2.624a6.624 6.624 0 0 0 0.96 2.368 4.48 4.48 0 0 0 1.696 1.664 6.4 6.4 0 0 0 5.024 0.256 5.088 5.088 0 0 0 1.792 -1.248 7.04 7.04 0 0 0 1.344 -2.4 13.344 13.344 0 0 0 0.544 -4.032 15.456 15.456 0 0 0 -0.704 -5.216 6.4 6.4 0 0 0 -1.632 -2.56 4.416 4.416 0 0 0 -1.92 -0.928 17.184 17.184 0 0 0 -2.464 -0.224h-5.152v-20.64h5.376a7.712 7.712 0 0 0 2.208 -0.352 5.248 5.248 0 0 0 2.08 -1.088 5.6 5.6 0 0 0 1.536 -2.144 9.152 9.152 0 0 0 0.672 -3.872 8.96 8.96 0 0 0 -0.512 -3.2 5.312 5.312 0 0 0 -3.104 -3.168 6.4 6.4 0 0 0 -4.992 0.224 5.248 5.248 0 0 0 -1.76 1.696 11.008 11.008 0 0 0 -1.28 4.992v1.568H64v-1.568a31.584 31.584 0 0 1 5.76 -17.408 25.6 25.6 0 0 1 5.728 -5.952 27.84 27.84 0 0 1 8.384 -4.256c3.648 -1.152 7.488 -1.696 11.328 -1.632 3.712 -0.032 7.392 0.32 11.008 1.152 2.944 0.672 5.76 1.76 8.416 3.2a24.224 24.224 0 0 1 10.24 10.176 23.36 23.36 0 0 1 2.88 11.104 25.92 25.92 0 0 1 -5.344 16.896 17.984 17.984 0 0 1 -3.84 3.648z"]},kl={prefix:"vs",iconName:"loading",icon:[512,512,[],"f000","M445.344 224A192.064 192.064 0 0 0 66.656 224H34.272a224.064 224.064 0 0 1 443.456 0h-32.384z"]},nd={prefix:"vs",iconName:"lock",icon:[512,512,[],"f000","M416 224h-32V160a128 128 0 1 0 -256 0v64H96L64 256v192l32 32h320l32 -32V256l-32 -32zM160 160a96 96 0 1 1 192 0v64H160V160zm256 288H96V256h320v192z"]},sd={prefix:"vs",iconName:"menu",icon:[512,512,[],"f000","M512 160H0V128h512v32zm0 256H0v-32h512v32zm0 -128.256H0V256h512v31.744z"]},id={prefix:"vs",iconName:"new-file",icon:[512,512,[],"f000","m304 35.2 108.8 112 3.2 12.8v64h-32V192H256V64H96v352h128v32H80l-16 -16v-384l16 -16h214.4l9.6 3.2zM288 64v96h92.8L288 64zm128 448h-32v-96H288v-32h96V288h32v96h96v32h-96v96z"]},Ll={prefix:"vs",iconName:"pass-filled",icon:[512,512,[],"f000","M256 480A224 224 0 1 0 256 32a224 224 0 0 0 0 448zm-32.64 -132.16h-22.72L128 275.2l22.72 -22.72 61.44 61.44 134.4 -134.72 22.72 22.72 -145.92 145.92z"]},Pl={prefix:"vs",iconName:"pass",icon:[512,512,[],"f000","M200.64 347.84h22.72l145.92 -145.92 -22.72 -22.72 -134.4 134.72 -61.44 -61.44L128 275.2l72.64 72.64zM275.2 32c51.2 3.2 99.2 28.8 134.4 64 41.6 44.8 64 99.2 64 163.2 0 51.2 -19.2 99.2 -51.2 140.8 -32 38.4 -76.8 67.2 -128 76.8 -51.2 9.6 -102.4 3.2 -147.2 -22.4 -44.8 -25.6 -80 -64 -99.2 -112C28.8 294.4 25.6 240 41.6 192c16 -51.2 44.8 -92.8 89.6 -121.6C172.8 41.6 224 28.8 275.2 32zm16 412.8c41.6 -9.6 80 -32 108.8 -67.2 25.6 -35.2 41.6 -76.8 38.4 -121.6 0 -51.2 -19.2 -102.4 -54.4 -137.6 -32 -32 -70.4 -51.2 -115.2 -54.4 -41.6 -3.2 -86.4 6.4 -121.6 32 -35.2 25.6 -60.8 60.8 -73.6 105.6 -12.8 41.6 -12.8 86.4 6.4 128 19.2 41.6 48 73.6 86.4 96 38.4 22.4 83.2 28.8 124.8 19.2z"]},od={prefix:"vs",iconName:"play",icon:[512,512,[],"f000","M120.96 64 96 77.12v384l24.96 13.44 288 -192V256l-288 -192zM128 431.36V107.2l243.2 162.24L128 431.36z"]},rd={prefix:"vs",iconName:"preview",icon:[512,512,[],"f000","M64 64h384l32 32v320l-32 32H64l-32 -32V96l32 -32zm0 352h384V96H64v320zm352 -288H96v96h320V128zm-32 64H128V160h256v32zm-96 192h128V256H288v128zm32 -96h64v64h-64V288zM224 256H96v32h128V256zm-128 96h128v32H96v-32z"]},nn={prefix:"vs",iconName:"remove",icon:[512,512,[],"f000","M480 256H32V224h448v32z"]},ld={prefix:"vs",iconName:"reply",icon:[512,512,[],"f000","m201.792 68.672 -128.64 128.64v22.656l128.64 128.64 22.656 -22.624L121.824 223.36H182.08c90.016 0 147.36 19.36 182.56 55.328 35.264 36 51.68 92.064 51.68 173.472v11.2h32v-11.2c0 -84.672 -16.864 -151.04 -60.8 -195.872C343.52 211.36 275.744 191.36 182.08 191.36H124.384l100.064 -100.032 -22.656 -22.656z"]},ad={prefix:"vs",iconName:"ruby",icon:[512,512,[],"f000","m32 230.08 212.48 212.48h23.04L480 230.08v-23.04l-106.24 -106.24 -11.52 -4.8H149.76l-11.52 4.8L32 207.04v23.04zm224 177.92L66.56 218.56 156.48 128h199.04l89.92 90.56L256 408zm0 -247.36h86.08l57.92 57.92 -144 140.8V160.64z"]},Hl={prefix:"vs",iconName:"search",icon:[512,512,[],"f000","M325.333 0a176 176 0 0 0 -131.84 292.693L21.333 488.107l23.893 21.333 171.733 -194.56A176.021 176.021 0 1 0 325.333 0.213V0zm0 320a144 144 0 1 1 0 -288 144 144 0 0 1 0 288z"]},cd={prefix:"vs",iconName:"split-horizontal",icon:[512,512,[],"f000","M448 32H96L64 64v352l32 32h352l32 -32V64l-32 -32zM256 416H96V64h160v352zm192 0H288V64h160v352z"]},dd={prefix:"vs",iconName:"symbol-operator",icon:[512,512,[],"f000","M91.936 35.2c10.72 4.352 19.264 12.736 23.84 23.36 2.304 5.44 3.488 11.264 3.424 17.184a42.88 42.88 0 0 1 -19.52 36.32 43.488 43.488 0 0 1 -24.096 7.136A43.36 43.36 0 0 1 32 75.584a43.36 43.36 0 0 1 26.56 -40.192A43.84 43.84 0 0 1 91.936 35.2zm-9.536 56.48a17.632 17.632 0 0 0 10.624 -16 17.536 17.536 0 1 0 -10.624 16zM205.76 35.488 35.52 205.76l21.952 21.984 170.24 -170.24 -21.952 -21.984zM368 288h32v80H480v32h-80V480h-32v-80H288v-32h80V288zm-183.424 16.8 22.624 22.624L150.624 384l56.576 56.576 -22.624 22.624L128 406.624l-56.576 56.576 -22.624 -22.624L105.376 384l-56.576 -56.576 22.624 -22.624L128 361.376l56.576 -56.576zm43.2 -134.24a43.296 43.296 0 0 0 -40.192 -26.56 43.36 43.36 0 0 0 -40.192 26.56 43.584 43.584 0 0 0 40.224 60.64A43.456 43.456 0 0 0 227.776 170.56zm-24.096 23.84a17.696 17.696 0 0 1 -9.248 9.28 17.504 17.504 0 0 1 -19.168 -3.744 16.928 16.928 0 0 1 -3.744 -5.536 17.408 17.408 0 0 1 22.912 -22.88 18.08 18.08 0 0 1 5.536 3.712 17.568 17.568 0 0 1 3.712 19.168zM448 96h-128v32h128V96z"]},Ar={prefix:"vs",iconName:"terminal",icon:[512,512,[],"f000","M64 32 32 64v384L64 480h384l32 -32V64L448 32H64zM64 448V64h384v384H64zm120.661 -85.547 22.144 22.635 112.213 -111.851v-19.456l-112.213 -112.213 -22.08 22.613 97.92 100.309 -97.984 97.963z"]},hd={prefix:"vs",iconName:"tools",icon:[512,512,[],"f000","m472.736 111.52 -24.96 -5.888 -67.456 67.072 -38.208 -38.912 65.792 -69.024 -5.76 -25.344a141.44 141.44 0 0 0 -43.104 -7.296 116.48 116.48 0 0 0 -46.624 8.96 122.368 122.368 0 0 0 -37.952 26.88 119.552 119.552 0 0 0 -28 40.48 126.016 126.016 0 0 0 0 94.912 10730.912 10730.912 0 0 0 -197.536 199.488c-6.72 8.8 -9.92 19.776 -9.088 30.816a44.896 44.896 0 0 0 14.848 30.944c3.968 4.32 8.704 7.904 13.984 10.496 5.44 2.4 11.296 3.776 17.216 4.064 10.112 -0.192 19.808 -4.032 27.328 -10.784 49.536 -46.624 144.448 -142.4 198.368 -198.528 14.624 6.208 30.336 9.408 46.208 9.376a119.552 119.552 0 0 0 85.664 -36.256 124.32 124.32 0 0 0 35.552 -87.36 134.752 134.752 0 0 0 -6.272 -44.096zM93.856 445.696a9.92 9.92 0 0 1 -4.32 2.24 13.984 13.984 0 0 1 -4.768 0 11.072 11.072 0 0 1 -4.608 -1.824 10.752 10.752 0 0 1 -3.648 -3.52c-4.48 -4.576 -8.672 -13.28 -4.48 -18.176 43.84 -46.624 134.112 -137.76 190.56 -193.472 3.2 4.224 6.72 8.256 10.496 12.032 3.776 3.936 7.84 7.584 12.16 10.912 -54.592 56 -143.616 146.048 -191.36 191.808zm355.776 -290.08c0.064 24.48 -9.472 48 -26.624 65.536a91.552 91.552 0 0 1 -128.224 0 95.744 95.744 0 0 1 -20.32 -100.384A87.936 87.936 0 0 1 324.48 69.76a88.32 88.32 0 0 1 34.304 -6.848h8.128L308.768 122.848v22.272l60.64 60.352h21.12l59.104 -58.112v8.256zM103.68 214.016h48.992l22.56 22.944 21.696 -21.568 -21.28 -21.696V192.32l1.824 -52.768 -7.04 -13.984 -91.52 -60.224 -18.912 2.112 -26.592 27.168 -2.112 19.168 58.816 93.376 13.568 6.88zm-30.24 -116.224L147.488 146.56 146.24 182.496H111.808L64.064 106.912l9.376 -9.12zm227.36 222.72 21.568 -21.536 99.392 101.92a47.328 47.328 0 0 1 0 65.248 44.928 44.928 0 0 1 -49.568 10.08 41.92 41.92 0 0 1 -13.984 -10.08l-100.544 -102.496 21.728 -21.696 100.224 102.208a12.864 12.864 0 0 0 4.896 3.36 15.264 15.264 0 0 0 11.488 0 12.896 12.896 0 0 0 4.896 -3.36 13.952 13.952 0 0 0 3.2 -4.896 16.8 16.8 0 0 0 1.152 -5.888 17.504 17.504 0 0 0 -1.12 -5.888 13.952 13.952 0 0 0 -3.2 -4.896L300.8 320.512z"]},Pn={prefix:"vs",iconName:"trash",icon:[512,512,[],"f000","M320 96h96v32h-32v288l-32 32H128l-32 -32V128H64V96h96V64a32 32 0 0 1 32 -32h96a32 32 0 0 1 32 32v32zM288 64H192v32h96V64zM128 416h224V128H128v288zm64 -256H160v224h32V160zm32 0h32v224H224V160zm64 0h32v224H288V160z"]},Fn={prefix:"vs",iconName:"triangle-down",icon:[512,512,[],"f000","M64 177.92 77.216 160h358.208l12.576 17.28L267.936 352h-26.464L64 177.92z"]},_l={prefix:"vs",iconName:"triangle-right",icon:[512,512,[],"f000","M177.92 448 160 434.784V76.576L177.28 64 352 244.064v26.464L177.92 448z"]},cs={prefix:"vs",iconName:"warning",icon:[512,512,[],"f000","M241.92 32h28.16l209.28 392.32 -14.08 23.68H46.08L32 424.32 241.92 32zM256 72.96 72.96 416H438.4L256 72.96zM276 384v-32h-40v32h40zm-40 -64V192h40v128h-40z"]},ud={prefix:"dh",iconName:"arrow-to-bottom",icon:[512,512,[],"f000","m99.2 224 160 160h22.4l160 -160 -22.4 -22.4L288 332.8V64H256v268.8L124.8 201.6l-25.6 22.4zM96 416h352v32H96z"]},md={prefix:"dh",iconName:"arrow-to-top",icon:[512,512,[],"f000","m444.8 288 -160 -160h-22.4l-160 160 22.4 22.4L256 179.2V448h32V179.2l131.2 131.2 25.6 -22.4zm3.2 -192H96V64h352v32z"]},pd={prefix:"dh",iconName:"check-square",icon:[512,512,[],"f000","M425.6 64H86.4l-22.4 22.4v342.4l22.4 19.2h342.4l22.4 -22.4V86.4l-25.6 -22.4zm-188.8 284.8h-22.4L144 278.4l22.4 -22.4 60.8 60.8 134.4 -134.4 22.4 22.4 -147.2 144z"]},gd={prefix:"dh",iconName:"exclamation",icon:[512,512,[],"f000","M275.2 384v-32H236.8v32h38.4zm-38.4 -64V128h38.4v192H236.8z"]},kr={prefix:"dh",iconName:"eye-slash",icon:[512,512,[],"f000","M480 256c0 -32 -99.2 -160 -224 -160 -32 0 -64 9.6 -92.8 22.4L70.4 25.6 25.6 70.4 435.2 480l44.8 -44.8 -76.8 -76.8C451.2 320 480 272 480 256zM256 131.2c96 0 176 92.8 188.8 124.8 -6.4 16 -32 48 -67.2 76.8L316.8 272c3.2 -6.4 3.2 -9.6 3.2 -16 0 -35.2 -28.8 -64 -64 -64 -6.4 0 -9.6 0 -16 3.2L192 147.2c19.2 -9.6 41.6 -16 64 -16zm0 249.6C160 380.8 80 288 67.2 256c6.4 -9.6 19.2 -32 41.6 -54.4l-25.6 -25.6C51.2 208 32 243.2 32 256c0 32 99.2 160 224 160 19.2 0 38.4 -3.2 57.6 -9.6l-28.8 -28.8c-9.6 3.2 -19.2 3.2 -28.8 3.2z"]},Oo={prefix:"dh",iconName:"eye",icon:[512,512,[],"f000","M256 96C131.2 96 32 224 32 256s99.2 160 224 160 224 -128 224 -160 -99.2 -160 -224 -160zm0 284.8C160 380.8 80 288 67.2 256 80 227.2 160 131.2 256 131.2S432 224 444.8 256c-12.8 28.8 -92.8 124.8 -188.8 124.8zM256 192c-35.2 0 -64 28.8 -64 64s28.8 64 64 64 64 -28.8 64 -64 -28.8 -64 -64 -64zm0 92.8c-16 0 -28.8 -12.8 -28.8 -28.8s12.8 -28.8 28.8 -28.8 28.8 12.8 28.8 28.8 -12.8 28.8 -28.8 28.8z"]},fd={prefix:"dh",iconName:"file-csv",icon:[512,512,[],"f000","m444.8 140.8 -105.6 -105.6 -12.8 -3.2H80l-16 16V224h32V64h192v112l16 16H416v32h32V153.6l-3.2 -12.8zM320 160V64l96 96h-96zM80 256l-16 16v192l16 16h352l16 -16v-192l-16 -16h-352zM416 416v32H96V288h320v128zm-217.6 -3.2c-6.4 3.2 -16 3.2 -25.6 3.2 -16 0 -25.6 -3.2 -35.2 -12.8 -9.6 -6.4 -12.8 -19.2 -12.8 -32 0 -16 3.2 -28.8 12.8 -38.4 9.6 -9.6 22.4 -12.8 38.4 -12.8 9.6 0 16 0 22.4 3.2v19.2c-6.4 -3.2 -12.8 -6.4 -22.4 -6.4 -9.6 0 -16 3.2 -22.4 9.6 -6.4 6.4 -9.6 12.8 -9.6 22.4 0 9.6 3.2 16 6.4 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16 -3.2 22.4 -6.4v19.2zm19.2 0v-22.4c3.2 3.2 9.6 6.4 12.8 6.4 3.2 3.2 9.6 3.2 12.8 3.2h6.4c3.2 0 3.2 0 6.4 -3.2l3.2 -3.2v-3.2c0 -3.2 0 -3.2 -3.2 -6.4 3.2 0 0 0 0 -3.2 -3.2 0 -3.2 -3.2 -6.4 -3.2s-6.4 -3.2 -9.6 -3.2c-6.4 -3.2 -12.8 -6.4 -16 -12.8 -3.2 -3.2 -6.4 -9.6 -6.4 -16s0 -9.6 3.2 -12.8c3.2 -3.2 3.2 -6.4 9.6 -9.6 3.2 0 6.4 -3.2 12.8 -3.2h25.6c3.2 0 6.4 0 9.6 3.2v19.2s-3.2 -3.2 -6.4 -3.2 -3.2 0 -6.4 -3.2h-19.2c-3.2 0 -3.2 0 -6.4 3.2l-3.2 3.2v6.4l3.2 3.2s3.2 3.2 6.4 3.2 3.2 3.2 6.4 3.2c3.2 3.2 6.4 3.2 9.6 6.4 3.2 3.2 6.4 3.2 6.4 6.4 3.2 3.2 3.2 6.4 6.4 6.4 0 3.2 3.2 6.4 3.2 9.6 0 6.4 0 9.6 -3.2 12.8 -3.2 3.2 -3.2 6.4 -9.6 9.6 3.2 3.2 0 6.4 -3.2 6.4h-32c-3.2 0 -6.4 -3.2 -12.8 -3.2zm169.6 -92.8 -32 96h-25.6l-32 -96h22.4l19.2 67.2c0 3.2 3.2 6.4 3.2 9.6 0 -3.2 0 -6.4 3.2 -9.6l19.2 -67.2h22.4z"]},Cd={prefix:"dh",iconName:"file-download",icon:[512,512,[],"f000","m438.4 137.6 -96 -96L320 32H128L96 64v384l32 32h288l32 -32V160l-9.6 -22.4zM416 448H128V64h160v128h128v256zm-96 -288V64l96 96h-96zm-134.4 182.4 76.8 76.8h22.4l76.8 -76.8 -25.6 -22.4L288 368V227.2H256v140.8L208 320l-22.4 22.4z"]},bd={prefix:"dh",iconName:"file-spreadsheet",icon:[512,512,[],"f000","m438.4 137.6 -96 -96L320 32H128L96 64v384l32 32h288l32 -32V160l-9.6 -22.4zM416 448H128V64h160v128h128v256zm-96 -288V64l96 96h-96zm64 99.2 -19.2 -19.2H179.2l-19.2 19.2v137.6l19.2 19.2h185.6l19.2 -19.2V259.2zm-150.4 134.4H182.4v-48h51.2v48zm0 -115.2v48H182.4V278.4m115.2 115.2H246.4v-48h48v48zm0 -64H246.4V278.4h48v51.2zm64 64H310.4v-48h48v48zm-51.2 -64V278.4h48v48H310.4z"]},$o={prefix:"dh",iconName:"filter-filled",icon:[512,512,[],"f000","M480 64v54.4l-160 153.6V448H192V268.8L32 118.4V64h448z"]},wd={prefix:"dh",iconName:"freeze",icon:[512,512,[],"f000","m438.4 300.8 -19.2 -28.8 -60.8 35.2L272 256l86.4 -51.2 60.8 35.2 19.2 -28.8 -44.8 -25.6 48 -28.8 -16 -25.6 -48 28.8V108.8h-35.2v67.2L256 227.2V128l60.8 -35.2 -16 -28.8 -44.8 25.6V32H224v57.6L179.2 64l-16 28.8L224 128v99.2L137.6 176V108.8H102.4V160l-48 -28.8 -16 25.6 48 28.8 -44.8 25.6 19.2 28.8 60.8 -35.2L208 256 121.6 307.2 60.8 272l-19.2 28.8 44.8 25.6 -48 28.8 16 25.6 48 -28.8v51.2h35.2v-67.2L224 284.8V384l-60.8 35.2 16 28.8 44.8 -25.6V480h32v-57.6l44.8 25.6 16 -28.8L256 384V284.8l86.4 51.2v67.2h35.2V352l48 28.8 16 -25.6 -48 -28.8z"]},fo={prefix:"dh",iconName:"gear-filled",icon:[512,512,[],"f000","m480 211.2 -76.8 -12.8L448 131.2l-64 -64 -67.2 41.6L300.8 32H211.2l-12.8 76.8L131.2 64l-64 64 41.6 67.2 -76.8 16v89.6l76.8 12.8L64 380.8l64 64 67.2 -41.6 16 76.8h89.6l16 -76.8L384 448l64 -64 -44.8 -67.2 76.8 -16V211.2zM256 320c-38.4 0 -64 -25.6 -64 -64s25.6 -64 64 -64 64 25.6 64 64 -25.6 64 -64 64z"]},Sd={prefix:"dh",iconName:"graph-line-down",icon:[512,512,[],"f000","M64 416V0H32v432l16 16H480v-32zm67.2 -291.2 -22.4 22.4 108.8 112 70.4 -64 108.8 124.8H320v32h112l16 -16V224h-32v70.4L288 150.4l-70.4 64z"]},vd={prefix:"dh",iconName:"graph-line-up",icon:[512,512,[],"f000","M64 416V0H32v432l16 16H480v-32zm153.6 -150.4 70.4 64 128 -144V256h32V144l-16 -16H320v32h76.8L288 284.8l-70.4 -64 -108.8 112 22.4 22.4z"]},Rs={prefix:"dh",iconName:"new-circle-large-filled",icon:[512,512,[],"f000","M240 0C108.8 0 0 108.8 0 240S108.8 480 240 480 480 371.2 480 240 371.2 0 240 0zM352 256H256v96H224V256H128V224h96V128h32v96h96v32z"]},Td={prefix:"dh",iconName:"pandas",icon:[512,512,[],"f000","M185.6 28.8h54.4v115.2H185.6V28.8zm0 240h54.4V384H185.6V268.8zm0 -89.6h54.4v54.4H185.6V179.2zM96 124.8h54.4V512H96V124.8zm176 240h54.4V480H272v-115.2zm0 -240h54.4v115.2H272V124.8zm0 150.4h54.4v54.4H272V275.2zM361.6 0H416v387.2h-54.4V0z"]},Ed={prefix:"dh",iconName:"refresh",icon:[512,512,[],"f000","m313.6 73.6 -9.6 32c83.2 25.6 131.2 118.4 102.4 201.6 -19.2 64 -80 108.8 -150.4 108.8 -89.6 0 -160 -70.4 -160 -160 0 -51.2 22.4 -96 64 -128v64h32V80L176 64H64v32h86.4c-76.8 51.2 -108.8 150.4 -70.4 236.8C112 403.2 179.2 448 256 448c105.6 0 192 -86.4 192 -192 0 -83.2 -54.4 -156.8 -134.4 -182.4z"]},yd={prefix:"dh",iconName:"remove-square-filled",icon:[512,512,[],"f000","M432 32h-384l-16 16v384l16 16h384l16 -16v-384l-16 -16zM352 256H128V224h224v32z"]},Go={prefix:"dh",iconName:"sort-alpha-down",icon:[512,512,[],"f000","M236.8 368 156.8 448h-22.4l-80 -80 22.4 -22.4L128 396.8V64h32v332.8l51.2 -51.2 25.6 22.4zM371.2 224l-6.4 -28.8H316.8l-9.6 28.8H256l54.4 -160h60.8l51.2 160h-51.2zm-32 -124.8c0 3.2 -3.2 3.2 -3.2 9.6s-3.2 19.2 -12.8 51.2h32l-9.6 -44.8c-3.2 -6.4 -6.4 -9.6 -6.4 -16zm-6.4 310.4h73.6V448H272v-32l73.6 -89.6H275.2V288h128v32l-70.4 89.6z"]},qo={prefix:"dh",iconName:"sort-alpha-up",icon:[512,512,[],"f000","M51.2 144 131.2 64h22.4l80 80 -22.4 22.4L160 115.2V448H128V115.2L76.8 166.4l-25.6 -22.4zm320 304 -6.4 -28.8H316.8l-9.6 28.8H256l54.4 -160h60.8l51.2 160h-51.2zm-32 -124.8c0 3.2 -3.2 3.2 -3.2 9.6 0 6.4 -3.2 19.2 -12.8 51.2h32l-9.6 -44.8c-3.2 -6.4 -6.4 -9.6 -6.4 -16zm-6.4 -137.6h73.6V224H272V192l73.6 -89.6H275.2V64h128v32l-70.4 89.6z"]},Lr={prefix:"dh",iconName:"sort-amount-down",icon:[512,512,[],"f000","M204.8 368 124.8 448h-22.4L22.4 368l22.4 -22.4L96 396.8V64h32v332.8l51.2 -51.2 25.6 22.4zM256 64h256v64H256zm0 105.6h192v64H256zm0 108.8h128v64H256zM256 384h64v64H256z"]},Rd={prefix:"dh",iconName:"sort-down",icon:[512,512,[],"f000","m128 288 -12.8 25.6 128 118.4h25.6l128 -118.4L384 288H128z"]},Id={prefix:"dh",iconName:"sort-up",icon:[512,512,[],"f000","m128 224 -12.8 -25.6 128 -118.4h25.6l128 118.4 -12.8 25.6H128z"]},Ko={prefix:"dh",iconName:"sort",icon:[512,512,[],"f000","m128 224 -12.8 -25.6 128 -118.4h25.6l128 118.4 -12.8 25.6H128zm0 64 -12.8 25.6 128 118.4h25.6l128 -118.4L384 288H128z"]},Pr={prefix:"dh",iconName:"square-filled",icon:[512,512,[],"f000","M432 32h-384l-16 16v384l16 16h384l16 -16v-384l-16 -16z"]},Xo={prefix:"dh",iconName:"table",icon:[512,512,[],"f000","M432 64h-384l-16 16v352l16 16h384l16 -16v-352l-16 -16zM160 416H64v-64h96v64zm0 -96H64V256h96v64zm0 -96H64V160h96v64zm128 192H192v-64h96v64zm0 -96H192V256h96v64zm0 -96H192V160h96v64zm128 192h-96v-64h96v64zm0 -96h-96V256h96v64zm0 -96h-96V160h96v64z"]},Md={prefix:"dh",iconName:"trash-undo",icon:[512,512,[],"f000","M320 96h96v32h-32v288l-32 32H128l-32 -32V128H64V96h96V64c0 -19.2 12.8 -32 32 -32h96c19.2 0 32 12.8 32 32v32zM288 64H192v32h96V64zM128 416h224V128H128v288zm112 -64L160 272v-22.4l80 -80 22.4 22.4 -51.2 54.4H320v32H211.2l51.2 51.2 -22.4 22.4z"]},Dd={prefix:"dh",iconName:"triangle-down-square",icon:[512,512,[],"f000","M425.6 64H86.4l-22.4 22.4v342.4l22.4 19.2h342.4l22.4 -22.4V86.4l-25.6 -22.4zm-160 288h-22.4L99.2 208l9.6 -16h291.2l9.6 12.8L265.6 352z"]},Nd={prefix:"dh",iconName:"unlink",icon:[512,512,[],"f000","M32 211.2v-6.4C32 144 80 96 140.8 96h99.2c12.8 0 25.6 3.2 38.4 6.4l-25.6 25.6H140.8C99.2 128 64 163.2 64 204.8v6.4c0 28.8 16 54.4 38.4 67.2l-22.4 22.4C51.2 281.6 32 249.6 32 211.2zM403.2 6.4l-38.4 38.4 -67.2 67.2 -22.4 25.6 -150.4 147.2 -25.6 25.6 -54.4 54.4 -38.4 38.4L51.2 448 448 51.2 403.2 6.4zM384 192v32c38.4 6.4 64 38.4 64 76.8v6.4c0 41.6 -35.2 76.8 -76.8 76.8H272c-32 0 -60.8 -22.4 -73.6 -51.2l-25.6 25.6c19.2 35.2 54.4 60.8 96 60.8h99.2c60.8 0 108.8 -48 108.8 -108.8v-9.6C480 246.4 438.4 198.4 384 192zM246.4 288l-22.4 19.2v12.8h16c60.8 0 108.8 -48 108.8 -108.8v-6.4c0 -6.4 0 -12.8 -3.2 -19.2l-32 32c0 38.4 -32 67.2 -67.2 70.4z"]},Hr={prefix:"dh",iconName:"warning-circle-filled",icon:[512,512,[],"f000","M470.4 195.2c-9.6 -38.4 -28.8 -70.4 -57.6 -99.2 -25.6 -25.6 -60.8 -44.8 -96 -54.4C297.6 35.2 275.2 32 256 32c-19.2 0 -41.6 3.2 -60.8 9.6 -16 3.2 -35.2 9.6 -51.2 22.4 -35.2 19.2 -60.8 44.8 -80 80 -12.8 16 -19.2 35.2 -25.6 51.2C35.2 214.4 32 236.8 32 256c0 19.2 3.2 41.6 6.4 60.8 6.4 16 12.8 35.2 25.6 51.2 9.6 16 22.4 32 35.2 44.8 12.8 16 28.8 25.6 44.8 35.2 16 9.6 35.2 16 54.4 22.4 16 6.4 38.4 9.6 57.6 9.6 19.2 0 41.6 -3.2 60.8 -6.4 19.2 -6.4 35.2 -12.8 54.4 -22.4 32 -19.2 60.8 -48 80 -80 9.6 -16 16 -35.2 22.4 -54.4 3.2 -19.2 6.4 -41.6 6.4 -60.8s-3.2 -41.6 -9.6 -60.8zM275.2 352H236.8v-32h38.4v32zm0 -64H236.8V160h38.4v128z"]},Vl={prefix:"dh",iconName:"warning-filled",icon:[512,512,[],"f000","M268.8 32h-25.6L32 425.6l12.8 22.4h419.2l12.8 -22.4L268.8 32zm6.4 352H236.8v-32h38.4v32zm0 -64H236.8V192h38.4v128z"]};const qi=Q.forwardRef((e,t)=>{var b;function n(C){const{menuItem:w,onMenuItemClick:S}=e;S(w,C)}function s(C){const{menuItem:w,onMenuItemMouseMove:S}=e;S(w,C)}function i(C){const{menuItem:w,onMenuItemContextMenu:S}=e;S(w,C)}function o(C,w,S){if(typeof C.type=="string")return C;const{closeMenu:I,menuItem:v,isKeyboardSelected:E,isMouseSelected:M,"data-testid":F}=e,k={menuItem:v,closeMenu:I,isKeyboardSelected:E,isMouseSelected:M,iconElement:w,displayShortcut:S,"data-testid":F};return Q.cloneElement(C,{forwardedProps:k})}const{children:r,menuItem:l,isKeyboardSelected:a,isMouseSelected:c,"data-testid":d}=e,h=(b=l.shortcut)==null?void 0:b.getDisplayText();let m=null;if(l.icon){const C=l.icon;if(Q.isValidElement(C))m=C;else{let w;l.iconColor&&!l.disabled&&(w={color:l.iconColor}),m=u(G,{icon:C,style:w})}}let p=null;const g=!!r;l.actions&&(p=u(G,{icon:Nl}));let f=null;if(l.menuElement)f=u("div",{className:"custom-menu-item",onMouseMove:s,children:o(l.menuElement,m,h)});else{const C=l.disabled,w=l.iconOutline;f=u("button",{type:"button",className:z("btn-context-menu",{disabled:C},{active:(g||c)&&!C},{"keyboard-active":a&&!C}),onClick:n,onMouseMove:s,onContextMenu:i,title:l.description||"",children:T("div",{className:"btn-context-menu-wrapper",children:[u("span",{className:z("icon",{outline:w}),children:m}),u("span",{className:"title",children:l.title}),h&&u("span",{className:"shortcut",children:h}),p&&u("span",{className:z("submenu-indicator",{disabled:C}),children:p})]})})}return T("div",{className:"context-menu-item",ref:t,"data-testid":d,children:[r,f]})});qi.displayName="ContextMenuItem";qi.defaultProps={children:null,isKeyboardSelected:!1,isMouseSelected:!1,"data-testid":void 0};class vs extends Error{constructor(){super(...arguments),this.isCanceled=!0}}class Yo{static isDark(t){const n=document.createElement("div");n.style.display="none",n.style.color=t;const s=getComputedStyle(document.body.appendChild(n)).color,i=s.match(/\d+/g);let o=[];if(i)o=i.map(l=>parseInt(l,10));else throw new Error(`Invalid color received. Got ${s}`);return document.body.removeChild(n),Yo.getBrightness(o)<125}static getBrightness(t){return Math.round((t[0]*299+t[1]*587+t[2]*114)/1e3)}}const Fd="table_",Ul="column_",xd=new Set(["in","not","i","ii","k"]),Od=new Set(["abstract","continue","for","new","switch","assert","default","if","package","synchronized","boolean","do","goto","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","null","true","false"]),Ad=/[^a-zA-Z0-9_$+@-]/g,kd=/[^A-Za-z0-9_$]/g,Is=class{};let Hn=Is;Hn.legalize=(e,t,n,s,i)=>{let o=e.trim().replace(/[- ]/g,"_");return s&&(xd.has(o)||Od.has(o))&&(o=t+o),o=o.replace(n,""),o||(o=t+i),Number.isNaN(Number(o.charAt(0)))||(o=t+o),o};Hn.legalizeTableName=e=>Is.legalize(e,Fd,Ad,!1,0);Hn.legalizeColumnNames=e=>{const t=[];return e.forEach((n,s)=>{let i=Is.legalizeColumnName(n,s);t.includes(i)&&(i=Ul+s),t.push(i)}),t};Hn.legalizeColumnName=(e,t=0)=>Is.legalize(e,Ul,kd,!0,t);Hn.isValidTableName=e=>Is.legalizeTableName(e)===e;Hn.isValidColumnName=e=>Is.legalizeColumnName(e)===e;function Ld(e,t){return e?e.closest(`.${t}`):null}const Pd={getClosestByClassName:Ld};class Ee extends CustomEvent{constructor(t,n){super(t,n)}}class Bl extends Error{constructor(){super(...arguments),this.isTimeout=!0}}class He{static makeCancelable(t,n){let s=!1,i;const o=new Promise((r,l)=>{Promise.resolve(t).then(a=>{s?(n&&n(a),l(new vs)):(i=a,r(a))},a=>l(s?new vs:a))});return o.cancel=()=>{s=!0,i!=null&&n&&n(i)},o}static isCanceled(t){return t instanceof vs}static isTimedOut(t){return t instanceof Bl}}class Ki{constructor(){this.pending=[],this.resolved=[]}add(t,n){const s=He.makeCancelable(t,n);return this.pending.push(s),s.then(()=>{this.resolve(s)},()=>{this.resolve(s)}),s}remove(t){for(let n=0;n<this.pending.length;n+=1)if(this.pending[n]===t){this.pending.splice(n,1);return}}resolve(t){this.remove(t),this.resolved.push(t)}cancel(){const t=[...this.pending,...this.resolved];for(let n=0;n<t.length;n+=1)t[n].cancel();this.pending=[],this.resolved=[]}}function O(e){if(e==null)throw new Error("Value is null or undefined")}class $t{static isValidRange(t){return t!=null&&t.length===2&&Number.isInteger(t[0])&&Number.isInteger(t[1])&&t[0]<=t[1]}static validateRange(t){if(!$t.isValidRange(t))throw new Error(`Invalid range! ${t}`)}static isSelected(t,n){for(let s=0;s<t.length;s+=1){const i=t[s],o=i[0],r=i[1];if(o<=n&&n<=r)return!0}return!1}static selectRange(t,n){let[s,i]=n;const o=[...t];for(let r=o.length-1;r>=0;r-=1){const l=o[r],a=l[0],c=l[1];if(a<=s&&i<=c)return o;s<=c&&a<=i&&(s=Math.min(s,a),i=Math.max(i,c),o.splice(r,1))}return o.push([s,i]),o}static deselectRange(t,n){const[s,i]=n,o=[...t];for(let r=o.length-1;r>=0;r-=1){const l=o[r],a=l[0],c=l[1];if(!(i<a||c<s))if(a<s&&i<c){o[r]=[a,s-1],o.splice(r+1,0,[i+1,c]);break}else s<=a&&c<=i?o.splice(r,1):a<s?o[r]=[a,s-1]:o[r]=[i+1,c]}return o}static count(t){return t.reduce((n,s)=>n+(s[1]-s[0]+1),0)}}class Qo{static join(t,n="and"){if(t==null||t.length===0)return"";if(t.length===1)return t[0];if(t.length===2)return`${t[0]} ${n} ${t[1]}`;const s=t.slice(0,t.length-1).join(", "),i=t[t.length-1];return`${s}, ${n} ${i}`}static toLower(t,n=!0){if(t==null){if(n)return"";throw new Error("Null string passed in to TextUtils.toLower")}return t.toLowerCase()}static sort(t,n,s=!0){return t<n?s?-1:1:t>n?s?1:-1:0}}const Wl=class{static formatElapsedTime(e){if(typeof e!="number"||!Number.isInteger(e))throw new Error(`${e} is not a number that can be expressed as a formatted time`);const t=Math.floor(e/3600),n=Math.floor(e%3600/60),s=e%60;return`${t>0?`${t}h `:""}${n>0||t>0?`${n}m `:""}${e>=60?`${s}s`.padStart(3,"0"):`${s}s`}`}static formatTime(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new Error(`${e} is not a number that can be expressed as a formatted time`);const t=String(Math.floor(e/(60*60))).padStart(2,"0"),n=e%(60*60),s=String(Math.floor(n/60)).padStart(2,"0"),i=n%60,o=String(Math.ceil(i)).padStart(2,"0");return`${t}:${s}:${o}`}static isTimeString(e){return new RegExp(Wl.TIME_PATTERN).test(e)}static parseTime(e){if(!e||typeof e!="string")throw new Error(`${e} is not a valid string`);const t=e.split(":");if(t.length!==3)throw new Error(`${e} is not a time string that can be parsed`);return Number(t[0])*60*60+Number(t[1])*60+Number(t[2])}};let Kt=Wl;Kt.TIME_PATTERN="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]";Kt.TIME_ZONES=Object.freeze([{label:"Tokyo UTC+9 No DST",value:"Asia/Tokyo"},{label:"Seoul UTC+9 No DST",value:"Asia/Seoul"},{label:"Hong Kong UTC+8 No DST",value:"Asia/Hong_Kong"},{label:"Singapore UTC+8 No DST",value:"Asia/Singapore"},{label:"Kolkata UTC+5:30 No DST",value:"Asia/Kolkata"},{label:"Berlin UTC+1",value:"Europe/Berlin"},{label:"UTC UTC\xB10 No DST",value:"UTC"},{label:"London UTC\xB10",value:"Europe/London"},{label:"Sao Paulo UTC-2",value:"America/Sao_Paulo"},{label:"Newfoundland UTC-3:30",value:"America/St_Johns"},{label:"Halifax UTC-4",value:"America/Halifax"},{label:"New York UTC\u22125",value:"America/New_York"},{label:"Chicago UTC-6",value:"America/Chicago"},{label:"Denver UTC-7",value:"America/Denver"},{label:"Los Angeles UTC-8",value:"America/Los_Angeles"},{label:"Anchorage UTC-9",value:"America/Anchorage"},{label:"Honolulu UTC-10 No DST",value:"Pacific/Honolulu"},{label:"Zurich UTC+1",value:"Europe/Zurich"},{label:"Amsterdam UTC+1",value:"Europe/Amsterdam"},{label:"Taipei UTC+8 No DST",value:"Asia/Taipei"},{label:"Sydney UTC+10",value:"Australia/Sydney"}]);class Hd extends Error{constructor(){super(...arguments),this.isInvalid=!0}}const Pt=({className:e="","data-testid":t})=>T("div",{className:z("loading-spinner fa-layers",e),"data-testid":t,children:[u(G,{icon:Kc,className:"text-white-50"}),u(G,{icon:kl,className:"text-primary",spin:!0})]}),_r=te.module("ContextMenu"),Ao=class extends R.exports.PureComponent{constructor(e){super(e),this.handleBlur=this.handleBlur.bind(this),this.handleCloseSubMenu=this.handleCloseSubMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMenuItemClick=this.handleMenuItemClick.bind(this),this.handleMenuItemContextMenu=this.handleMenuItemContextMenu.bind(this),this.handleMenuItemMouseMove=this.handleMenuItemMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowResize=this.handleWindowResize.bind(this),this.container=Q.createRef(),this.oldFocus=document.activeElement,this.activeSubMenuRef=Q.createRef(),this.subMenuTimer=0,this.rAF=0,this.initialPosition={top:e.top,left:e.left},this.state={menuItems:[],pendingItems:[],activeSubMenu:null,hasOverflow:!1,subMenuTop:null,subMenuLeft:null,subMenuParentWidth:0,subMenuParentHeight:0,keyboardIndex:-1,mouseIndex:-1}}static handleContextMenu(e){e.metaKey||(e.stopPropagation(),e.preventDefault())}componentDidMount(){this.initMenu(),this.verifyPosition(),window.addEventListener("resize",this.handleWindowResize),this.rAF=window.requestAnimationFrame(()=>{var t;(t=this.container.current)==null||t.focus();const{onMenuOpened:e}=this.props;e(this)})}componentDidUpdate(e,t){var i,o,r;const{actions:n}=this.props,{activeSubMenu:s}=this.state;s!==t.activeSubMenu&&(s==null?(i=this.container.current)==null||i.focus():this.setActiveSubMenuPosition()),e.actions!==n&&(this.initMenu(),(o=this.container.current)!=null&&o.contains(document.activeElement)||(r=this.container.current)==null||r.focus()),this.verifyPosition()}componentWillUnmount(){this.cancelPromises(),window.removeEventListener("resize",this.handleWindowResize),cancelAnimationFrame(this.rAF)}getKeyboardIndex(){const{options:e}=this.props;if(e.separateKeyboardMouse){const{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){const{options:t}=this.props;t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){const{mouseIndex:e}=this.state;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){this.cancelPromises(),cancelAnimationFrame(this.rAF);const{options:e}=this.props;let t=e.initialKeyboardIndex;t===void 0&&(t=-1);const{actions:n}=this.props,s=Se.getMenuItems(n),i=[];for(let o=s.length-1;o>=0;o-=1){const r=s[o];r instanceof Promise?this.initMenuPromise(r):i.push(r)}this.setState({mouseIndex:-1,keyboardIndex:t,activeSubMenu:null,menuItems:Se.sortActions(i)})}initMenuPromise(e){const t=He.makeCancelable(e);this.setState(n=>({pendingItems:n.pendingItems.concat(t)})),t.then(n=>{this.setState(s=>{const i=s.pendingItems.indexOf(t);if(i>=0){const o=s.pendingItems.slice();return o.splice(i,1),{menuItems:Se.sortActions(s.menuItems.concat(n)),pendingItems:o}}return null})},n=>{He.isCanceled(n)||(this.setState(s=>{const i=s.pendingItems.indexOf(t);if(i>=0){const o=s.pendingItems.slice();return o.splice(i,1),{pendingItems:o}}return null}),_r.error(n))})}cancelPromises(){const{pendingItems:e}=this.state;e.map(t=>t.cancel())}setActiveSubMenuPosition(){if(this.activeSubMenuRef.current===null)return;const e=this.activeSubMenuRef.current.getBoundingClientRect();this.setState({subMenuTop:e.top,subMenuLeft:e.right,subMenuParentHeight:e.height,subMenuParentWidth:e.width})}verifyPosition(){var h,m,p,g;const{options:e,updatePosition:t,subMenuParentWidth:n,subMenuParentHeight:s,top:i,left:o}=this.props;if(!this.container.current||e.doNotVerifyPosition)return;let{top:r,left:l}=this.initialPosition;const{width:a,height:c}=(m=(h=this.container.current)==null?void 0:h.getBoundingClientRect())!=null?m:{width:0,height:0},d=((g=(p=this.container.current)==null?void 0:p.scrollHeight)!=null?g:0)>window.innerHeight;c===0||a===0||(r+c>window.innerHeight&&(r-c-s>0?r-=c-s:r=window.innerHeight-c),l+a>window.innerWidth&&(l=l-a-n),(o!==l||i!==r)&&(this.setState({hasOverflow:d}),t(r,l)))}handleWindowResize(){!this.container.current||this.closeMenu(!0)}handleBlur(e){if(!this.container.current){_r.warn("Container is null!");return}if(!this.container.current.contains(e.relatedTarget)){let t=e.relatedTarget,n=!1;for(;t&&!n;)n=t.hasAttribute("data-dh-context-menu"),t=t.parentElement;n||this.closeMenu(!0)}}isEscapeKey(e){const{left:t}=this.props;return e==="Escape"||t<0&&e==="ArrowRight"||e==="ArrowLeft"}handleKeyDown(e){const{menuItems:t}=this.state,n=this.getKeyboardIndex();let s=n,i=!1;if(e.key==="Enter"||e.key===" "){n>=0&&n<t.length&&this.handleMenuItemClick(t[n],e);return}if(e.key==="ArrowRight"?n>=0&&n<=t.length?i=!0:s=0:this.isEscapeKey(e.key)?s=null:e.key==="ArrowUp"||e.shiftKey&&e.key==="Tab"?s=Se.getNextMenuItem(s,-1,t):(e.key==="ArrowDown"||e.key==="Tab")&&(s=Se.getNextMenuItem(s,1,t)),i){this.openSubMenu(n),e.preventDefault(),e.stopPropagation();return}n!==s&&(s!==null?this.setKeyboardIndex(s):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}openSubMenu(e){const{menuItems:t,activeSubMenu:n}=this.state,s=t[e].actions?e:null;n!==s&&this.setState({activeSubMenu:s,subMenuTop:null,subMenuLeft:null})}closeMenu(e=!1){const{closeMenu:t,onMenuClosed:n}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),n(this)})}closeSubMenu(){this.setState({activeSubMenu:null})}handleCloseSubMenu(e){e?this.closeMenu(!0):this.closeSubMenu()}handleMenuItemClick(e,t){t.preventDefault(),t.stopPropagation();const{menuItems:n}=this.state;e!=null&&!e.disabled&&(e.actions!=null?this.openSubMenu(n.indexOf(e)):e.action!=null&&(e.action(),this.closeMenu(!0)))}handleMenuItemContextMenu(e,t){t.metaKey||this.handleMenuItemClick(e,t)}handleMenuItemMouseMove(e){const{menuItems:t}=this.state,n=t.indexOf(e);this.setMouseIndex(n),n>=0&&n<t.length&&!e.disabled&&this.openSubMenu(n)}handleMouseLeave(){this.setMouseIndex(-1)}render(){const e=[],{top:t,left:n}=this.props,{activeSubMenu:s,hasOverflow:i,keyboardIndex:o,menuItems:r,mouseIndex:l,pendingItems:a,subMenuTop:c,subMenuLeft:d,subMenuParentWidth:h,subMenuParentHeight:m}=this.state;for(let C=0;C<r.length;C+=1){const w=r[C];C>0&&w.group!==r[C-1].group&&e.push(u("hr",{},`${C}.separator`));const S=u(qi,{ref:s===C?this.activeSubMenuRef:null,isKeyboardSelected:o===C,isMouseSelected:l===C,menuItem:w,closeMenu:this.handleCloseSubMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:this.handleMenuItemContextMenu},C);e.push(S)}let p=null;a.length>0&&(p=u("div",{className:"loading",children:u(Pt,{})}));const{menuStyle:g,"data-testid":f}=this.props,b=s!==null&&c!==null&&d!==null;return T(Ne,{children:[T("div",{className:z({"has-overflow":i},"context-menu-container"),style:{top:t,left:n,...g},ref:this.container,"data-dh-context-menu":!0,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,onContextMenu:Ao.handleContextMenu,role:"menuitem",tabIndex:0,"data-testid":f,children:[e,p]}),b&&s!==null&&c!==null&&d!==null&&u(Ao,{actions:r[s].actions||[],closeMenu:this.handleCloseSubMenu,top:c,left:d,updatePosition:(C,w)=>{this.setState({subMenuTop:C,subMenuLeft:w})},subMenuParentWidth:h,subMenuParentHeight:m},`sub-${s}`)]})}};let zl=Ao;zl.defaultProps={subMenuParentWidth:0,subMenuParentHeight:0,closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0};class _d extends R.exports.Component{constructor(t){super(t),this.handleMenuClose=this.handleMenuClose.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.container=Q.createRef(),this.openMenu=Q.createRef(),this.state={actions:null,left:0,top:0}}componentDidMount(){var t;(t=this.container.current)!=null&&t.parentElement&&this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu)}componentWillUnmount(){var t;(t=this.container.current)!=null&&t.parentElement&&this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu)}handleContextMenu(t){if(!Se.isContextActionEvent(t)||!this.container.current||t.metaKey||t.ctrlKey)return;const n=Se.getMenuItems(t.contextActions),s=this.container.current.getBoundingClientRect(),i=t.clientY-s.top,o=t.clientX-s.left;if(n.length===0){if(t.target===this.container.current){t.preventDefault(),this.setState({actions:null},()=>{const r=document.elementFromPoint(o,i),l=new MouseEvent("contextmenu",{clientX:t.clientX,clientY:t.clientY,bubbles:!0,cancelable:!0});r==null||r.dispatchEvent(l)});return}return}t.preventDefault(),this.setState({actions:n,top:i,left:o})}handleMenuClose(t){t===this.openMenu.current&&this.setState({actions:null})}render(){let t=null;const{"data-testid":n}=this.props,{actions:s,top:i,left:o}=this.state;return s&&(t=u(zl,{ref:this.openMenu,actions:s,onMenuClosed:this.handleMenuClose,top:i,left:o,updatePosition:(r,l)=>{this.setState({top:r,left:l})},"data-testid":n})),u("div",{className:z("context-menu-root",{active:s}),ref:this.container,children:t})}}const jn=class extends R.exports.Component{static handleEnter(e){const t=e;t.style.height="0"}static handleEntering(e){const t=e;t.style.height=`${jn.getHeight(t)}px`}static handleExiting(e){const t=e;t.style.height="0"}static handleExit(e){const t=e;t.style.height=`${jn.getHeight(t)}px`}static getHeight(e){const t=e.scrollWidth-e.clientWidth;return e.scrollHeight-t}constructor(e){super(e),this.handleEntered=this.handleEntered.bind(this)}handleEntered(e){const t=e;t.style.height="";const{autoFocusOnShow:n}=this.props;if(n){const s=t.querySelector("input, select, textarea");s&&s.focus()}}render(){const{children:e,className:t,in:n,"data-testid":s}=this.props;return u(rt,{in:n,classNames:{enterActive:"collapsing",enterDone:"collapse show",exitActive:"collapsing",exitDone:"collapse"},onEnter:jn.handleEnter,onEntering:jn.handleEntering,onEntered:this.handleEntered,onExit:jn.handleExit,onExiting:jn.handleExiting,timeout:350,children:i=>u("div",{className:z({collapse:i==="exited"},t),"data-testid":s,children:e})})}};let $l=jn;$l.propTypes={className:D.exports.string,in:D.exports.bool.isRequired,children:D.exports.node.isRequired,autoFocusOnShow:D.exports.bool,"data-testid":D.exports.string};$l.defaultProps={className:"",autoFocusOnShow:!1,"data-testid":void 0};function jo(e){const t=R.exports.useRef();return R.exports.useEffect(function(){t.current=e}),t.current}function Gl(e){const t=R.exports.useRef(null);return R.exports.useEffect(function(){!e||(typeof e=="function"?e(t.current):e.current=t.current)}),t}const It=Q.forwardRef((e,t)=>{const{checked:n=!1,children:s,className:i,disabled:o,inputClassName:r,isInvalid:l,labelClassName:a,name:c,onChange:d,"data-testid":h}=e,[m]=R.exports.useState(Qt()),p=Gl(t);R.exports.useEffect(function(){p.current&&(p.current.indeterminate=n===null)},[p,n]);const g=R.exports.useCallback(f=>{p.current&&(p.current.indeterminate=n===null),d&&d(f)},[p,n,d]);return T("div",{className:z("custom-control custom-checkbox",i),children:[u("input",{type:"checkbox",ref:p,checked:n!=null?n:!1,className:z("custom-control-input",r,{"is-invalid":l}),disabled:o,id:m,name:c,onChange:g,"data-testid":h}),u("label",{className:z("custom-control-label",a),htmlFor:m,children:s})]})});It.displayName="Checkbox";It.propTypes={checked:(e,t)=>{const{[t]:n}=e;return n!==null&&typeof n!="boolean"?new Error("Checked must be a boolean or null for indeterminate"):null},children:D.exports.node.isRequired,className:D.exports.string,disabled:D.exports.bool,inputClassName:D.exports.string,isInvalid:D.exports.bool,labelClassName:D.exports.string,name:D.exports.string,onChange:D.exports.func,"data-testid":D.exports.string};It.defaultProps={checked:!1,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};class _n extends R.exports.PureComponent{constructor(t){super(t),this.inputField=Q.createRef()}focus(){var t;(t=this.inputField.current)==null||t.focus()}render(){const{value:t,placeholder:n,onChange:s,className:i,matchCount:o,id:r,onKeyDown:l,"data-testid":a}=this.props;return T("div",{className:z("search-group",i),children:[u("input",{type:"search",value:t,onChange:s,onKeyDown:l,className:"form-control",placeholder:n,ref:this.inputField,id:r,"data-testid":a}),o!=null&&u("span",{className:"search-match",children:o}),u("span",{className:"search-icon",children:u(G,{icon:Hl})})]})}}_n.defaultProps={placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0};var ql=(e=>(e.UP="UP",e.DOWN="DOWN",e))(ql||{});const Bs=class extends R.exports.Component{constructor(e){super(e),this.getCachedFilteredOptions=ue((t,n)=>t.filter(s=>s.title.toLowerCase().indexOf(n.toLowerCase())>=0||s.value.toLowerCase().indexOf(n.toLowerCase())>=0)),this.state={value:"",filter:"",filteredOptions:e.options,keyboardOptionIndex:-1,menuIsOpen:!1,inputWidth:100},this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handleFilterChange=this.handleFilterChange.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleOptionFocus=this.handleOptionFocus.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=Q.createRef(),this.cbContainer=Q.createRef(),this.toggleButton=Q.createRef(),this.menuContainer=Q.createRef(),this.input=Q.createRef(),this.searchInput=Q.createRef()}componentDidUpdate(){const{menuIsOpen:e,keyboardOptionIndex:t}=this.state;e&&t>=0&&this.scrollOptionIntoView()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.input.current)==null||e.focus()}resetValue(){this.setState({value:""})}updateInputValue(e){const{onChange:t}=this.props;this.setState({value:e}),t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var r,l;const{filter:t,filteredOptions:n,keyboardOptionIndex:s}=this.state,{options:i}=this.props,o=t?n:i;switch(e.key){case"Enter":((r=o[s])==null?void 0:r.value)!=null&&this.updateInputValue(o[s].value),this.closeMenu(),(l=this.input.current)==null||l.focus(),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(Bs.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(Bs.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":t!==""?(this.setState({filter:""}),e.stopPropagation()):this.closeMenu();break;case"Tab":!e.shiftKey&&s===o.length-1&&this.closeMenu();break}}handleMenuNavigation(e){const{filter:t,filteredOptions:n,keyboardOptionIndex:s}=this.state,{options:i}=this.props,r=(t?n:i).length;let l=0;switch(e){case Bs.MENU_NAVIGATION_DIRECTION.UP:l=-1;break;case Bs.MENU_NAVIGATION_DIRECTION.DOWN:l=1;break}l!==0&&this.setState({keyboardOptionIndex:(s+l+r)%r})}handleInputKeyDown(e){const{onEnter:t}=this.props,{menuIsOpen:n}=this.state;e.key==="ArrowDown"||e.key==="ArrowUp"?n||this.openMenu():e.key==="Enter"&&t()}handleInputChange(e){this.updateInputValue(e.target.value)}handleOptionClick(e){var r;const t=Number(e.currentTarget.value),{filter:n,filteredOptions:s}=this.state,{options:i}=this.props,o=n?s:i;this.updateInputValue(o[t].value),this.closeMenu(),(r=this.input.current)==null||r.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleFilterChange(e){var i;const{options:t}=this.props,n=e.target.value,s=this.getCachedFilteredOptions(t,n);this.setState({filter:n,filteredOptions:s,keyboardOptionIndex:0}),(i=this.popper.current)==null||i.scheduleUpdate()}handleMenuBlur(e){var t;e.relatedTarget instanceof Element&&((t=this.popper.current)==null?void 0:t.element.contains(e.relatedTarget))||e.relatedTarget===this.toggleButton.current||this.closeMenu(!1)}handleInputBlur(e){var n;const{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&((n=this.popper.current)==null?void 0:n.element.contains(e.relatedTarget))||this.closeMenu(!1)}handleMenuOpened(){var e;this.scrollOptionIntoView(),(e=this.searchInput.current)==null||e.focus()}handleMenuExited(){var t;const{menuIsOpen:e}=this.state;e&&(this.setState({menuIsOpen:!1}),(t=this.popper.current)==null||t.hide()),this.setState({filter:""})}toggleMenu(e){const{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var e;(e=this.popper.current)==null||e.show()})}closeMenu(e=!0){var t,n;this.setState({menuIsOpen:!1}),e&&((t=this.input.current)==null||t.focus()),(n=this.popper.current)==null||n.hide()}updateKeyboardIndex(){const{value:e,filter:t,filteredOptions:n}=this.state,{options:s}=this.props,o=(t?n:s).findIndex(r=>r.value===e);this.setState({keyboardOptionIndex:o})}scrollOptionIntoView(){var t;const e=(t=this.menuContainer.current)==null?void 0:t.querySelector(".cb-option-btn.keyboard-active");e instanceof HTMLElement&&e.scrollIntoView({block:"nearest",inline:"nearest"})}renderMenuElement(){const{searchPlaceholder:e}=this.props,{filter:t,inputWidth:n}=this.state;return T("div",{className:"cb-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:s=>{s.stopPropagation()},style:{width:n},onBlur:this.handleMenuBlur,children:[u("div",{className:"cb-search-input-container",children:u(_n,{value:t,ref:this.searchInput,onChange:this.handleFilterChange,className:"cb-search-input",placeholder:e})}),u("div",{className:"cb-options-container",children:u("div",{className:"cb-options",children:this.renderOptions()})})]})}renderOptions(){const{options:e}=this.props,{keyboardOptionIndex:t,filter:n,filteredOptions:s}=this.state;return(n?s:e).map((o,r)=>{const l=`option-${r}-${o.value}`;return u("button",{type:"button",value:r,className:z("cb-option-btn",{"keyboard-active":t===r}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:o.title},l)})}render(){const{options:e,inputPlaceholder:t,disabled:n,className:s,defaultValue:i,spellCheck:o,"data-testid":r}=this.props,{value:l}=this.state;let{popperOptions:a}=this.props;return a={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...a},T("div",{className:"input-group cb-container",ref:this.cbContainer,children:[u("input",{value:l||i,className:z("form-control",s,"cb-input"),ref:this.input,onChange:this.handleInputChange,placeholder:t||e[0]&&e[0].title,disabled:n,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:o,"data-testid":r?`${r}-input`:void 0}),u("div",{className:"input-group-append cb-dropdown",children:T("button",{type:"button",className:"btn cb-btn form-control",ref:this.toggleButton,onClick:this.toggleMenu,onKeyDown:this.handleInputKeyDown,disabled:n,"data-testid":r?`${r}-btn`:void 0,children:[u(G,{icon:Fn}),u(fn,{ref:this.popper,options:a,className:z("combobox interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})})]})}};let Ms=Bs;Ms.MENU_NAVIGATION_DIRECTION=ql;Ms.DROP_DOWN_MENU_HEIGHT=200;Ms.propTypes={options:D.exports.arrayOf(D.exports.shape({title:D.exports.string.isRequired,value:D.exports.string.isRequired})).isRequired,popperOptions:D.exports.shape({title:D.exports.string.isRequired,value:D.exports.string.isRequired}),onChange:D.exports.func,inputPlaceholder:D.exports.string,searchPlaceholder:D.exports.string,disabled:D.exports.bool,className:D.exports.string,defaultValue:D.exports.string,spellCheck:D.exports.bool,onEnter:D.exports.func,"data-testid":D.exports.string};Ms.defaultProps={onChange(){},inputPlaceholder:"",searchPlaceholder:"Search",disabled:!1,className:"",defaultValue:"",popperOptions:null,spellCheck:!0,onEnter(){},"data-testid":void 0};const Ot=te.module("MaskedInput"),Ls={FORWARD:"forward",BACKWARD:"backward",NONE:"none"},Co="\u2007";function Zo(e,t,n){return e.substring(0,t)+n+e.substring(t+1)}const Kl=Q.forwardRef((e,t)=>{const{className:n,example:s,getNextSegmentValue:i=(P,L,N)=>N,getPreferredReplacementString:o=Zo,onChange:r=()=>!1,onSelect:l=()=>!1,pattern:a,selection:c,value:d,onFocus:h=()=>!1,onBlur:m=()=>!1,"data-testid":p}=e,g=Gl(t),f=R.exports.useMemo(()=>Array.isArray(s)?s:[s],[s]);R.exports.useEffect(function(){var L;if(c!=null){Ot.debug("setting selection...",c);const{selectionStart:N,selectionEnd:B,selectionDirection:U}=c;(L=g.current)==null||L.setSelectionRange(N,B,U),Ot.debug("selection set!")}},[c,g]);const b=R.exports.useCallback(P=>{let L=P,N=P;const B=f.length>0?f[0]:d;for(let H=L-1;H>=0&&/[a-zA-Z0-9]/g.test(B.charAt(H));H-=1)L=H;for(let H=N;H<B.length&&/[a-zA-Z0-9]/g.test(B.charAt(H));H+=1)N=H+1;const U=L===N?Ls.NONE:Ls.BACKWARD;return{selectionStart:L,selectionEnd:N,selectionDirection:U}},[f,d]);function C(P,L,N=P.length){let B="";for(let U=0;U<N;U+=1)P.charAt(U)!==Co?B=B.concat(P[U]):B=B.concat(L[U]);return B=B.concat(L.substring(N)),B}function w(P,L=P.length){const N=new RegExp(a);if(N.test(P))return!0;for(let B=0;B<f.length;B+=1){const U=C(P,f[B],L);if(N.test(U))return!0}return!1}function S(P){const L=b(P),N=L.selectionEnd+1;return N>=d.length?L:b(N)}function I(P){const L=b(P),N=L.selectionStart-1;return N<=0?L:b(N)}function v(P,L){const N=b(P),B=d.substring(N.selectionStart,N.selectionEnd),U=i(N,L,B,d),H=d.substring(0,N.selectionStart)+U+d.substring(N.selectionEnd);w(H,N.selectionEnd)&&(r(H),l(N))}const E=R.exports.useCallback(P=>{const{selectionStart:L=0,selectionEnd:N=0,selectionDirection:B="none"}=P.target;if(L===null||N===null||B===null){Ot.error("Selection attempted on non-text input element",P.target);return}if(Ot.debug2("handleSelect",L,N,B),!(c!=null&&L===c.selectionStart&&N===c.selectionEnd)){if(c!=null&&L===d.length&&N===d.length&&P.nativeEvent.type!=="mouseup"){l({...c});return}if(L===N){const U=b(L);Ot.debug("Selection segment from ",L,N,"=>",U),l(U)}else l({selectionStart:L,selectionEnd:N,selectionDirection:B})}},[b,l,c,d]),M=R.exports.useCallback(P=>{if(!g.current)return;Ot.debug("handleSelectCapture",P);const L=g.current.selectionStart||0;L===d.length&&c!=null&&L!==c.selectionStart&&(P.preventDefault(),P.stopPropagation())},[g,c,d]);function F(P){if(P.preventDefault(),P.stopPropagation(),!g.current)return;const{key:L}=P,{selectionStart:N=0,selectionEnd:B=0}=g.current;if(N===null||B===null){Ot.error("Selection arrow nvaigation attempted on non-text input element",P.target);return}L==="ArrowLeft"?l(I(N)):L==="ArrowRight"?l(S(B)):L==="ArrowUp"?v(N,-1):L==="ArrowDown"&&v(N,1)}function k(P){if(!g.current)return;Ot.debug("handleKeyDown",P);const{key:L}=P,{selectionStart:N=0,selectionEnd:B=0}=g.current;if(N===null||B===null){Ot.error("Selection key event on non-text input element",P.target);return}if(L.startsWith("Arrow")){F(P);return}if(L==="Delete"||L==="Backspace"){if(P.preventDefault(),P.stopPropagation(),N!==B){const H=d.substring(0,N)+d.substring(N,B).replace(/[a-zA-Z0-9]/g,Co)+d.substring(B);Ot.debug("Range ",N,B,"deleted, setting value",H),r(H),l({selectionStart:N,selectionEnd:N,selectionDirection:Ls.NONE})}else if(N>0)for(let H=N-1;H>=0;H-=1){const _=d.substring(0,H)+d.substring(H,N).replace(/[a-zA-Z0-9]/g,Co)+d.substring(N);if(_!==d){r(_),l({selectionStart:H,selectionEnd:H,selectionDirection:Ls.NONE});return}}return}if(P.altKey||P.metaKey||P.ctrlKey||L.length>1)return;P.preventDefault(),P.stopPropagation();const U=Array.from(new Set([L,L.toUpperCase(),L.toLowerCase()]));for(let H=0;H<U.length;H+=1){const _=U[H],$=/[a-zA-Z0-9]/g.test(_)?d.length-1:N;for(let K=N;K<=$;K+=1){const j=o(d,K,_,N,B);if(w(j,K+1)){const re=b(K),ne=K+1;let ge={selectionStart:ne,selectionEnd:ne,selectionDirection:Ls.NONE};if(ne>=re.selectionEnd){const ce=S(K);ce.selectionStart!==re.selectionStart&&(ge=ce)}Ot.debug("handleKeyDown",L,"=>",j,ge),r(j),l(ge);return}}}}return u("input",{ref:g,className:z("form-control masked-input",n),type:"text",pattern:a,value:d,onChange:()=>{},onKeyDown:k,onSelect:E,onSelectCapture:M,onFocus:h,onBlur:m,"data-testid":p})});Kl.defaultProps={className:"",onChange(){},onSelect(){},getNextSegmentValue:(e,t,n)=>n,getPreferredReplacementString:Zo,selection:void 0,onFocus(){},onBlur(){},"data-testid":void 0};const Vd=te.module("TimeInput"),Ud="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]",Bd=["00:00:00","12:34:56","23:59:59"],Xl=Q.forwardRef((e,t)=>{const{allowValueWrapping:n=!0,className:s="",onChange:i=()=>!1,value:o=0,onFocus:r=()=>!1,onBlur:l=()=>!1,onSelect:a=()=>!1,"data-testid":c}=e,[d,h]=R.exports.useState(Kt.formatTime(o)),[m,p]=R.exports.useState(),g=R.exports.useRef(null);R.exports.useImperativeHandle(t,()=>({focus:()=>{var S;(S=g.current)==null||S.focus()},setSelection:S=>{var I;(I=g.current)==null||I.focus(),p(S)}}),[]),R.exports.useEffect(function(){h(Kt.formatTime(o))},[o]);function f(S,I,v){const E=S.selectionStart===0?24:60;let M=parseInt(v,10)-I;return Number.isNaN(M)?M=0:n?M=(M%E+E)%E:M=Math.min(Math.max(0,M),E-1),`${M}`.padStart(2,"0")}function b(S,I,v,E,M){return E===0&&M===2&&I===1&&parseInt(v,10)>1?`0${v}${S.substring(2)}`:Zo(S,I,v)}function C(S){Vd.debug("handleChange",S),h(S),Kt.isTimeString(S)&&i(Kt.parseTime(S))}const w=R.exports.useCallback(S=>{p(S),a(S)},[a]);return u(Kl,{ref:g,className:s,example:Bd,getNextSegmentValue:f,getPreferredReplacementString:b,onChange:C,onSelect:w,pattern:Ud,selection:m,value:d,onFocus:r,onBlur:l,"data-testid":c})});Xl.defaultProps={allowValueWrapping:!0,className:"",onChange:()=>!1,onSelect:()=>!1,value:0,onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};class Yl extends R.exports.PureComponent{constructor(t){var i;super(t),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMenuItemClick=this.handleMenuItemClick.bind(this),this.handleMenuItemMouseMove=this.handleMenuItemMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.container=Q.createRef(),this.oldFocus=document.activeElement,this.rAF=0;const{options:n}=t,s=(i=n.initialKeyboardIndex)!=null?i:-1;this.state={menuItems:[],keyboardIndex:s,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.rAF=window.requestAnimationFrame(()=>{var n;(n=this.container.current)==null||n.focus();const{onMenuOpened:t}=this.props;t(this)})}componentDidUpdate(t){const{actions:n}=this.props;t.actions!==n&&this.initMenu()}componentWillUnmount(){cancelAnimationFrame(this.rAF)}getKeyboardIndex(){const{options:t}=this.props;if(t.separateKeyboardMouse){const{keyboardIndex:n}=this.state;return n}return this.getMouseIndex()}setKeyboardIndex(t){const{options:n}=this.props;n.separateKeyboardMouse?this.setState({keyboardIndex:t}):this.setMouseIndex(t)}getMouseIndex(){const{mouseIndex:t}=this.state;return t}setMouseIndex(t){this.setState({mouseIndex:t})}initMenu(){cancelAnimationFrame(this.rAF),this.setState({menuItems:[]});const{actions:t}=this.props,n=Se.getMenuItems(t,!1);n.length>0&&this.setState(s=>({menuItems:Se.sortActions(s.menuItems.concat(n))}))}handleKeyDown(t){const{menuItems:n}=this.state,s=this.getKeyboardIndex();let i=s;if(t.key==="Enter"||t.key===" "){s!=null&&s>=0&&s<n.length&&this.handleMenuItemClick(n[s],t);return}t.key==="Escape"?i=null:t.key==="ArrowUp"||t.key==="Tab"&&t.shiftKey===!0?i=Se.getNextMenuItem(i!=null?i:0,-1,n):(t.key==="ArrowDown"||t.key==="Tab"&&t.shiftKey===!1)&&(i=Se.getNextMenuItem(i!=null?i:0,1,n)),s!==i&&(i!==null?this.setKeyboardIndex(i):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),t.preventDefault(),t.stopPropagation())}closeMenu(t=!1){const{closeMenu:n,onMenuClosed:s}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{n(t),s(this)})}handleCloseMenu(){this.closeMenu()}handleMenuItemClick(t,n){n.preventDefault(),n.stopPropagation(),t!=null&&!t.disabled&&t.action!=null&&(t.action(),this.closeMenu(!0))}handleMenuItemMouseMove(t){const{menuItems:n}=this.state,s=n.indexOf(t);this.setMouseIndex(s)}handleMouseLeave(){this.setMouseIndex(-1)}render(){const t=[],{"data-testid":n}=this.props,{keyboardIndex:s,menuItems:i,mouseIndex:o}=this.state;for(let l=0;l<i.length;l+=1){const a=i[l];l>0&&a.group!==i[l-1].group&&t.push(u("hr",{},`${l}.separator`));const c=u(qi,{isKeyboardSelected:s===l,isMouseSelected:o===l,menuItem:a,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},l);t.push(c)}const{menuStyle:r}=this.props;return u("div",{className:"context-menu-container",style:{...r},ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":n,children:t})}}Yl.defaultProps={closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0};class An extends R.exports.PureComponent{constructor(t){super(t),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=Q.createRef(),this.parent=null,this.popper=Q.createRef(),this.isOpen=!1}componentDidMount(){var n;const{isShown:t}=this.props;t===null?(n=this.container.current)!=null&&n.parentElement&&(this.parent=this.container.current.parentElement,this.parent.addEventListener("click",this.handleClick)):t&&this.openMenu()}componentDidUpdate(t){const{isShown:n}=this.props;t.isShown!==n&&(n?window.requestAnimationFrame(()=>{this.openMenu()}):this.closeMenu())}componentWillUnmount(){this.parent&&this.parent.removeEventListener("click",this.handleClick)}closeMenu(){var t;(t=this.popper.current)==null||t.hide()}openMenu(){this.popper.current&&!this.isOpen&&(this.popper.current.show(),this.isOpen=!0)}scheduleUpdate(){var t;(t=this.popper.current)==null||t.scheduleUpdate()}handleClick(t){t.preventDefault(),t.stopPropagation(),this.openMenu()}handleCloseMenu(){this.closeMenu()}handleExited(){this.isOpen=!1;const{onMenuClosed:t}=this.props;t()}render(){const{actions:t,onMenuOpened:n,popperClassName:s,"data-testid":i}=this.props,{menuStyle:o}=this.props;let{options:r,popperOptions:l}=this.props;return l={placement:"bottom",...l},r={separateKeyboardMouse:!0,...r},u("div",{className:"menu-actions-listener",ref:this.container,"data-testid":i,children:u(fn,{ref:this.popper,options:l,className:z("menu-popper",s),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:u(Yl,{actions:t,closeMenu:this.handleCloseMenu,onMenuOpened:n,options:r,menuStyle:o})})})}}An.defaultProps={isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0};const Vr=-1;var Ql=(e=>(e.UP="UP",e.DOWN="DOWN",e))(Ql||{});const rn=class extends R.exports.Component{constructor(e){super(e);const{value:t,valueToTime:n}=e;this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleOptionFocus=this.handleOptionFocus.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.handleCustomInput=this.handleCustomInput.bind(this),this.csContainer=Q.createRef(),this.menuContainer=Q.createRef(),this.button=Q.createRef(),this.input=Q.createRef(),this.state={keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,customTime:n(t),inputFocused:!1}}getSelectedText(){const{options:e,value:t,placeholder:n}=this.props,{customTime:s}=this.state;if(t===null)return n;for(let i=0;i<e.length;i+=1){const o=e[i];if(o.value===t)return o.title}return Kt.formatTime(s)}setInputWidth(){this.csContainer.current&&this.setState({inputWidth:this.csContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.button.current)==null||e.focus()}updateInputValue(e){const{onChange:t}=this.props;t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var i;const{keyboardOptionIndex:t,inputFocused:n}=this.state,{options:s}=this.props;switch(e.key){case"Enter":case" ":n?this.updateFromCustom():this.updateInputValue(s[t].value),this.closeMenu(),(i=this.button.current)==null||i.focus(),e.stopPropagation(),e.preventDefault();break;case"Tab":e.shiftKey?this.handleMenuNavigation(rn.MENU_NAVIGATION_DIRECTION.UP):this.handleMenuNavigation(rn.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(rn.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(rn.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":this.closeMenu();break}}handleMenuNavigation(e){const{keyboardOptionIndex:t,inputFocused:n}=this.state,{options:s}=this.props,i=s.length;let o=t;switch(e){case rn.MENU_NAVIGATION_DIRECTION.UP:if(!n&&t===0){this.focusInput();break}else n&&this.focusOption(t);t>0&&!n?(o=(o-1)%i,this.setState({keyboardOptionIndex:o})):t===0&&(o=i-1,this.setState({keyboardOptionIndex:o})),this.scrollOptionIntoView(o);break;case rn.MENU_NAVIGATION_DIRECTION.DOWN:if(!n&&t===i-1){this.focusInput();break}else n&&this.focusOption(t);t<i&&!(n&&t===0)&&(o=(o+1)%i,this.setState({keyboardOptionIndex:o})),this.scrollOptionIntoView(o);break}}handleOptionClick(e){const t=Number(e.currentTarget.value),{options:n,timeToValue:s}=this.props,{customTime:i}=this.state;if(t===Vr){const o=s(i);this.updateAndClose(o)}else this.updateAndClose(n[t].value)}updateAndClose(e){var t;this.updateInputValue(e),this.closeMenu(),(t=this.button.current)==null||t.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleMenuOpened(){var o;const{options:e,value:t}=this.props,{keyboardOptionIndex:n}=this.state;this.scrollOptionIntoView(n);const s=(o=this.menuContainer.current)==null?void 0:o.querySelector(".cs-option-btn.keyboard-active");if(s instanceof HTMLElement&&s.focus(),t===null)return;e.map(r=>r.value).indexOf(t)<0&&this.focusInput()}focusInput(){var e;(e=this.input.current)==null||e.focus()}focusOption(e){var n;const t=(n=this.menuContainer.current)==null?void 0:n.querySelector(".cs-options");if(t&&t.children){const s=t.children.item(e);s instanceof HTMLElement&&s.focus()}}handleMenuExited(){const{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}handleCustomInput(e){const{timeToValue:t}=this.props,n=t(e);this.updateInputValue(n),this.setState({customTime:e})}updateFromCustom(){const{timeToValue:e}=this.props,{customTime:t}=this.state,n=e(t);this.updateInputValue(n)}toggleMenu(e){const{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0})}closeMenu(e=!0){var t;this.setState({menuIsOpen:!1}),e&&((t=this.button.current)==null||t.focus())}updateKeyboardIndex(){const{options:e,value:t}=this.props;if(t===null)return;const n=e.map(s=>s.value).indexOf(t);n>0&&this.setState({keyboardOptionIndex:n})}scrollOptionIntoView(e){var n;const t=(n=this.menuContainer.current)==null?void 0:n.querySelector(".cs-options");if(t&&t.children){const s=t.children.item(e);s instanceof HTMLElement&&s.offsetTop>rn.DROP_DOWN_MENU_HEIGHT?t.scrollTop=s.offsetTop-rn.DROP_DOWN_MENU_HEIGHT:(s instanceof HTMLElement&&s.offsetTop<0||e===0)&&(t.scrollTop=0)}}renderMenuElement(){const{inputWidth:e}=this.state;return u("div",{className:"cs-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:t=>{t.stopPropagation()},style:{width:e},children:u("div",{className:"cs-options-container",children:u("div",{className:"cs-options",children:this.renderOptions()})})})}renderOptions(){const{options:e,value:t,icon:n,customText:s}=this.props,{keyboardOptionIndex:i,customTime:o,inputFocused:r}=this.state;let l=!1;const a=[];for(let c=0;c<e.length;c+=1){const d=e[c],h=`option-${c}-${d.value}`;l=l||d.value===t,a.push(T("button",{type:"button",value:c,className:z("cs-option-btn",{"keyboard-active":i===c&&!r}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[d.value===t&&u(G,{icon:n,className:"mr-2"}),d.value!==t&&u("span",{className:"mr-4"}),d.title]},h))}return a.push(u("hr",{className:"cs-divider"},"option-divider")),a.push(T("button",{type:"button",value:Vr,className:z("cs-option-btn",{"keyboard-active":r}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[!l&&t!==null?u(G,{icon:n,className:"mr-2"}):u("span",{className:"mr-4"}),s]},"option-custom-label")),a.push(T("div",{className:"cs-custom-container",children:[u("span",{className:"mr-2"}),u(Xl,{ref:this.input,onChange:this.handleCustomInput,value:o,onFocus:()=>this.setState({inputFocused:!0}),onBlur:()=>this.setState({inputFocused:!1})},"option-input"),u("span",{className:"ml-2"})]},"cs-custom-container")),a.push(u("hr",{className:"mb-2"},"option-end")),a}render(){const{disabled:e,invalid:t,value:n,"data-testid":s}=this.props,{menuIsOpen:i}=this.state;let{popperOptions:o}=this.props;return o={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...o},u("div",{className:"input-group cs-container context-menu",ref:this.csContainer,"data-testid":s,children:u("div",{className:z("input-group-append cs-dropdown",{"cs-dropdown-invalid":t}),children:T("button",{type:"button",className:z("btn cs-btn form-control",{"cs-btn-invalid":t}),ref:this.button,onClick:this.toggleMenu,disabled:e,children:[u("span",{className:z({"text-muted":n===null}),children:this.getSelectedText()}),u("span",{children:u(G,{icon:Ko,className:"cs-caret"})}),u(An,{isShown:i,actions:{menuElement:this.renderMenuElement()},popperOptions:o,popperClassName:"CustomTimeSelect",onMenuOpened:this.handleMenuOpened,onMenuClosed:this.handleMenuExited,menuStyle:{maxWidth:"100rem"}})]})})})}};let Jo=rn;Jo.MENU_NAVIGATION_DIRECTION=Ql;Jo.DROP_DOWN_MENU_HEIGHT=125;Jo.defaultProps={onChange(){},value:null,disabled:!1,popperOptions:{},icon:rs,customText:"Custom",placeholder:"Select a time",valueToTime:e=>e===null?0:Math.round(e/1e3),timeToValue:e=>e*1e3,invalid:!1,"data-testid":void 0};class Wd extends R.exports.PureComponent{constructor(t){super(t),this.searchInput=Q.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=Tt(this.sendUpdate.bind(this),t.debounceMs),this.state={value:t.value}}componentDidUpdate(t){const{value:n}=this.props;t.value!==n&&this.setState({value:n})}focus(){var t;(t=this.searchInput.current)==null||t.focus()}handleChange(t){this.setState({value:t.target.value},this.sendUpdate)}sendUpdate(){const{onChange:t}=this.props,{value:n}=this.state;t(n)}render(){const{placeholder:t,className:n,matchCount:s,id:i,"data-testid":o}=this.props,{value:r}=this.state;return u(_n,{value:r,placeholder:t,onChange:this.handleChange,className:n,matchCount:s,ref:this.searchInput,id:i,"data-testid":o})}}Wd.defaultProps={placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0};const zd=({className:e="",show:t=!0,"data-testid":n})=>T("div",{className:z("dh-loader",e,{show:t}),"data-testid":n,children:[u("svg",{className:"dh-outer-shape",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("path",{d:"M82.7429,0L82.7429,41.3714L45.2571,41.3714L45.2571,0L0,0L0,128L45.2571,128L45.2571,86.6286L82.5143,86.6286L82.5143,128L128,128L128,0L82.7429,0ZM41.3714,124.114L4.11429,124.114L4.11429,86.6286L41.3714,86.6286L41.3714,124.114ZM41.3714,82.7429L4.11429,82.7429L4.11429,45.2571L41.3714,45.2571L41.3714,82.7429ZM41.3714,41.3714L4.11429,41.3714L4.11429,4.11429L41.3714,4.11429L41.3714,41.3714ZM45.2571,82.7429L45.2571,45.2571L82.5143,45.2571L82.5143,82.5143L45.2571,82.5143ZM124.114,124.114L86.6286,124.114L86.6286,86.6286L123.886,86.6286L123.886,124.114ZM124.114,82.7429L86.6286,82.7429L86.6286,45.2571L123.886,45.2571L123.886,82.7429ZM86.6286,41.3714L86.6286,4.11429L123.886,4.11429L123.886,41.3714L86.6286,41.3714Z",fill:"#f0f0ee"})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-3",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.3438",height:"37.6389",fill:"#5189e5",transform:"translate(-21.9838,29.7957) translate(21.9838,15.3027)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-2",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.2755",height:"37.4675",fill:"#5189e5",transform:"translate(-21.9838,69.7957) translate(22.0822,16.7783)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-5",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.3512",height:"41.3781",fill:"#35618c",transform:"translate(18.0162,72.7957) translate(23.1643,13.7278)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-6",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.2483",height:"37.5869",fill:"#35618c",transform:"translate(59.0162,29.7957) translate(23.6379,15.3564)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-7",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.5664",height:"41.2747",fill:"#35618c",transform:"translate(17.0162,-13.2043) translate(24.2531,13.2043)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-4",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.2854",height:"37.3014",fill:"#5189e5",transform:"translate(-21.9838,-13.2043) translate(22.0822,17.1792)"})})})})]});const $d=te.module("ItemListItem"),jl=class extends R.exports.Component{constructor(e){super(e),this.handleBlur=this.handleBlur.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleClick=this.handleClick.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleDragStart=this.handleDragStart.bind(this),this.handleDrag=this.handleDrag.bind(this),this.handleDragOver=this.handleDragOver.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.handleDrop=this.handleDrop.bind(this),this.handleDoubleClick=this.handleDoubleClick.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.itemRef=Q.createRef()}static handleKeyDown(){return $d.log("ItemListItem.handleKeyDown false"),!1}handleBlur(e){const{itemIndex:t,onBlur:n}=this.props;n(t,e)}handleFocus(e){const{itemIndex:t,onFocus:n}=this.props;n(t,e)}handleClick(e){const{itemIndex:t,onClick:n}=this.props;n(t,e)}handleContextMenu(e){const{itemIndex:t,onContextMenu:n}=this.props;n(t,e)}handleDragStart(e){const{itemIndex:t,onDragStart:n}=this.props;n(t,e)}handleDrag(e){const{itemIndex:t,onDrag:n}=this.props;n(t,e)}handleDragOver(e){e.preventDefault();const{itemIndex:t,onDragOver:n}=this.props;n(t,e)}handleDragEnd(e){const{itemIndex:t,onDragEnd:n}=this.props;n(t,e)}handleDrop(e){const{itemIndex:t,onDrop:n}=this.props;n(t,e)}handleDoubleClick(e){const{itemIndex:t,onDoubleClick:n}=this.props;n(t,e)}handleMouseMove(e){const{itemIndex:t,onMouseMove:n}=this.props;n(t,e)}handleMouseDown(e){const{itemIndex:t,onMouseDown:n}=this.props;n(t,e)}handleMouseUp(e){const{itemIndex:t,onMouseUp:n}=this.props;n(t,e)}render(){const{isDraggable:e,isFocused:t,isSelected:n,style:s,children:i,"data-testid":o}=this.props;return u("div",{className:z("item-list-item",{active:n},{"is-focused":t},{"is-draggable":e}),onKeyDown:jl.handleKeyDown,onContextMenu:this.handleContextMenu,onClick:this.handleClick,onDrag:this.handleDrag,onDragStart:this.handleDragStart,onDragOver:this.handleDragOver,onDragEnd:this.handleDragEnd,onDrop:this.handleDrop,onDoubleClick:this.handleDoubleClick,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseUp:this.handleMouseUp,tabIndex:-1,ref:this.itemRef,role:"presentation",style:s,onFocus:this.handleFocus,onBlur:this.handleBlur,draggable:e,"data-testid":o,children:i})}};let Zl=jl;Zl.defaultProps={children:null,isDraggable:!1,isFocused:!1,isSelected:!1,itemIndex:0,disableSelect:!1,"data-testid":void 0,onBlur(){},onClick(){},onContextMenu(){},onDragStart(){},onDrag(){},onDragOver(){},onDragEnd(){},onDrop(){},onDoubleClick(){},onFocus(){},onMouseDown(){},onMouseMove(){},onMouseUp(){},style:{}};const Ur=te.module("ItemList"),Ts=class extends R.exports.PureComponent{constructor(e){super(e),this.getItemSelected=ue((s,i)=>$t.isSelected(i,s),{max:Ts.CACHE_SIZE}),this.getCachedItem=ue((s,i,o,r,l,a,c,d)=>{const h=a({item:o,itemIndex:s,isFocused:r,isSelected:l,style:c});return u(Zl,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:d,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:r,isSelected:l,itemIndex:s,style:c,children:h},i)},{max:Ts.CACHE_SIZE}),this.getOuterElement=ue(s=>{const i=Q.forwardRef((o,r)=>u("div",{ref:r,tabIndex:-1,onKeyDown:s,role:"presentation",...o}));return i.displayName="ItemListOuterElement",i}),this.getInnerElement=ue(()=>{const s=Q.forwardRef((i,o)=>u("div",{className:"item-list-inner-element",ref:o,...i}));return s.displayName="ItemListInnerElement",s}),this.getItemData=ue((s,i,o)=>({items:s,selectedRanges:i,renderItem:o})),this.handleItemBlur=this.handleItemBlur.bind(this),this.handleItemContextMenu=this.handleItemContextMenu.bind(this),this.handleItemFocus=this.handleItemFocus.bind(this),this.handleItemDoubleClick=this.handleItemDoubleClick.bind(this),this.handleItemMouseDown=this.handleItemMouseDown.bind(this),this.handleItemMouseMove=this.handleItemMouseMove.bind(this),this.handleItemMouseUp=this.handleItemMouseUp.bind(this),this.handleItemsRendered=this.handleItemsRendered.bind(this),this.handleWindowMouseUp=this.handleWindowMouseUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleScroll=this.handleScroll.bind(this),this.handleResize=this.handleResize.bind(this),this.renderInnerElement=this.renderInnerElement.bind(this),this.list=Q.createRef(),this.listContainer=Q.createRef();const{isStickyBottom:t,selectedRanges:n}=e;this.state={focusIndex:null,mouseDownIndex:null,selectedRanges:n,overscanStartIndex:0,height:null,isDragging:!1,isStuckToBottom:t,scrollOffset:null}}static renderItem({item:e}){return u("div",{className:"item-list-item-content",children:e&&(e.displayValue||e.value||`${e}`)})}componentDidMount(){const{isStickyBottom:e}=this.props;e&&!this.isListAtBottom()&&this.scrollToBottom()}componentDidUpdate(e,t){const{selectedRanges:n}=this.props,{focusIndex:s,isStuckToBottom:i,scrollOffset:o,height:r,selectedRanges:l}=this.state;if(i&&!this.isListAtBottom()&&this.scrollToBottom(),(o!==t.scrollOffset||r!==t.height)&&this.sendViewportUpdate(),n!==e.selectedRanges&&n!==l)this.setSelectedRanges(n);else if(l!==t.selectedRanges){const{onSelectionChange:a}=this.props;a(l)}if(s!==t.focusIndex){const{onFocusChange:a}=this.props;a(s)}}componentWillUnmount(){window.removeEventListener("mouseup",this.handleWindowMouseUp)}focus(){var e;(e=this.listContainer.current)==null||e.focus()}getElement(e){if(this.listContainer.current==null)return null;const{focusSelector:t}=this.props,{overscanStartIndex:n}=this.state,s=this.listContainer.current.querySelectorAll(t),i=e-n;return s[i]}focusItem(e){const{disableSelect:t}=this.props;if(t)return;this.setState({focusIndex:e});const n=this.getElement(e);n instanceof HTMLElement&&n.focus()}scrollToItem(e){const t=this.getElement(e);t!=null&&t.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){const{selectedRanges:n}=this.state,i=$t.isSelected(n,e)||Se.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,i,!1)}handleItemDoubleClick(e,t){const{isDoubleClickSelect:n,onSelect:s}=this.props;n&&this.setState(({selectedRanges:i})=>({selectedRanges:$t.selectRange(i,[e,e])}),()=>{s(e,t)})}handleItemMouseDown(e,t){const{selectedRanges:n}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(t.button===2&&n.length===0){this.focusItem(e),this.selectItem(e);return}t.button!=null&&t.button!==0||(this.setState({mouseDownIndex:e}),window.addEventListener("mouseup",this.handleWindowMouseUp))}}handleItemBlur(e,t){Ur.debug2("item blur",e,t.currentTarget,t.relatedTarget),(!t.relatedTarget||this.listContainer.current&&t.relatedTarget instanceof HTMLElement&&!this.listContainer.current.contains(t.relatedTarget))&&this.setState({focusIndex:null})}handleItemFocus(e,t){Ur.debug2("item focus",e,t.target),this.setState(n=>{const{focusIndex:s}=n;return s!==e?{focusIndex:e}:null})}handleItemMouseMove(e,t){const{isDragSelect:n,isMultiSelect:s,disableSelect:i}=this.props,{mouseDownIndex:o,selectedRanges:r}=this.state;o==null||i||(this.setState({isDragging:!0}),(n||o===e)&&(this.focusItem(e),s?(!n&&!this.getItemSelected(e,r)&&!Se.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(o,e),Math.max(o,e)])):this.toggleSelect(e,t.shiftKey,Se.isModifierKeyDown(t),!1)))}handleItemMouseUp(e,t){const{isDeselectOnClick:n,isDoubleClickSelect:s,onSelect:i}=this.props,{mouseDownIndex:o,isDragging:r}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(o===e&&!r){const l=t.shiftKey,a=Se.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,l,a,n),!s&&!l&&!a&&i(e,t)}this.resetMouseState()}}handleItemsRendered({overscanStartIndex:e}){this.setState({overscanStartIndex:e})}handleResize({height:e}){this.setState({height:e})}handleMouseLeave(){this.setState({mouseDownIndex:null})}handleWindowMouseUp(){this.resetMouseState(),window.removeEventListener("mouseup",this.handleWindowMouseUp)}handleKeyDown(e){var r;const{isMultiSelect:t,itemCount:n,onSelect:s}=this.props,{focusIndex:i}=this.state;let o=i;if(e.key==="Enter"||e.key===" "){!t&&o!=null&&this.setState({selectedRanges:[[o,o]]},()=>{o!=null&&s(o,e)});return}if(e.key==="ArrowUp")o!=null&&o>=0?o=Math.max(0,o-1):o=n-1;else if(e.key==="ArrowDown")o!=null&&o>=0?o=Math.min(o+1,n-1):o=0;else return;if(i!==o){e.stopPropagation(),e.preventDefault(),this.focusItem(o);const{selectedRanges:l}=this.state;if(e.shiftKey&&l.length>0){const a=l[l.length-1];this.selectRange([Math.min(o,a[0]),Math.max(o,a[1])])}else this.deselectAll(),o!==null?this.selectItem(o):(r=this.listContainer.current)==null||r.focus();this.scrollIntoView(o)}}handleScroll({scrollUpdateWasRequested:e,scrollOffset:t}){this.setState(n=>{if(e)return{scrollOffset:t};const{isStickyBottom:s}=this.props,{height:i}=n;return{isStuckToBottom:s&&this.isListAtBottom({scrollOffset:t,height:i}),scrollOffset:t}})}resetMouseState(){this.setState({mouseDownIndex:null,isDragging:!1})}scrollToBottom(){const{itemCount:e}=this.props;this.list.current&&this.list.current.scrollToItem(e)}scrollIntoView(e){this.list.current&&this.list.current.scrollToItem(e)}toggleSelect(e,t,n,s=!0){const{isMultiSelect:i}=this.props,{selectedRanges:o}=this.state;if(i&&t&&o.length>0){const r=o[o.length-1];this.selectRange([Math.min(r[0],e),Math.max(e,r[1])])}else i&&o.length===1&&o[0][0]===e&&o[0][1]===e?s&&this.deselectItem(e):i&&n?this.getItemSelected(e,o)?s&&this.deselectItem(e):this.selectItem(e):(this.deselectAll(),this.selectItem(e))}deselectAll(){const{itemCount:e}=this.props;this.deselectRange([0,e])}deselectItem(e){this.deselectRange([e,e])}deselectRange(e){$t.validateRange(e),this.setState(({selectedRanges:t})=>({selectedRanges:$t.deselectRange(t,e)}))}selectItem(e){const{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){$t.validateRange(e),this.setState(({selectedRanges:t})=>({selectedRanges:$t.selectRange(t,e)}))}setSelectedRanges(e){this.setState({selectedRanges:e})}sendViewportUpdate(){const{scrollOffset:e,height:t}=this.state;if(e!=null&&t!=null){const{onViewportChange:n,rowHeight:s}=this.props,i=Math.floor(e/s),o=i+Math.ceil(t/s);n(i,o)}}isListAtBottom({scrollOffset:e,height:t}=this.state){if(t==null||e==null)return!1;const{itemCount:n,rowHeight:s}=this.props;return e+t>=n*s}renderInnerElement({index:e,style:t}){const{items:n,offset:s,renderItem:i,disableSelect:o}=this.props,{focusIndex:r,selectedRanges:l}=this.state;if(e<s||e>=s+n.length)return null;const a=n[e-s];return this.getCachedItem(e,e,a,e===r&&!o,this.getItemSelected(e,l),i,t,o)}render(){const{items:e,itemCount:t,overscanCount:n,renderItem:s,rowHeight:i,"data-testid":o}=this.props,{selectedRanges:r}=this.state;return u(Ya,{className:"item-list-auto-sizer",onResize:this.handleResize,children:({width:l,height:a})=>u(Qa,{className:"item-list-scroll-pane",height:a,width:l,itemCount:t,itemSize:i,itemData:this.getItemData(e,r,s),onScroll:this.handleScroll,onItemsRendered:this.handleItemsRendered,ref:this.list,outerElementType:this.getOuterElement(this.handleKeyDown),outerRef:this.listContainer,innerElementType:this.getInnerElement(),overscanCount:n,"data-testid":o,children:this.renderInnerElement})})}};let jt=Ts;jt.CACHE_SIZE=1e3;jt.DEFAULT_ROW_HEIGHT=20;jt.DEFAULT_OVERSCAN=10;jt.defaultProps={offset:0,items:[],rowHeight:Ts.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:Ts.DEFAULT_OVERSCAN,renderItem:Ts.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0};const is=class extends R.exports.PureComponent{constructor(e){super(e),this.getCachedDraggableItem=ue((t,n,s,i,o,r,l,a)=>u(Wi,{draggableId:is.getDraggableId(t,i),index:i,isDragDisabled:l,children:c=>u("div",{role:"menuitem",className:"draggable-item-list-item",ref:c.innerRef,tabIndex:-1,...c.draggableProps,...c.dragHandleProps,children:n({item:s,itemIndex:i,isFocused:o,isSelected:r,style:a,isClone:!1})})},i),{max:jt.CACHE_SIZE}),this.getCachedRenderDraggableItem=ue((t,n,s)=>({item:i,itemIndex:o,isFocused:r,isSelected:l,style:a})=>this.getCachedDraggableItem(t,s,i,o,r,l,n,a),{max:1}),this.getCachedRenderClone=ue((t,n,s,i)=>(o,r,l)=>{const{selectedCount:a}=this.state,{index:c}=l.source,d=n[c-s];return u("div",{className:z("draggable-item-list-dragging-item-container",t),...o.draggableProps,...o.dragHandleProps,ref:o.innerRef,children:u("div",{className:z("draggable-item-list-dragging-item",{"two-dragged":a===2},{"multiple-dragged":a>2}),children:i({item:d,itemIndex:c,isFocused:!1,isSelected:!0,style:{},isClone:!0,selectedCount:a})})})},{max:1}),this.handleSelectionChange=this.handleSelectionChange.bind(this),this.itemList=Q.createRef(),this.state={selectedCount:0}}static renderHandle(){return T("div",{children:[u(me,{children:"Drag to re-order"}),u(G,{icon:Gi})]})}static renderBadge({text:e}){return e?u("span",{className:"number-badge",children:e}):null}static renderTextItem({text:e,badgeText:t="",className:n=""}){return T("div",{className:z("item-list-item-content","draggable-item-list-item-content",n),children:[u("span",{className:"title",children:e}),is.renderBadge({text:t}),is.renderHandle()]})}static renderItem({item:e,isClone:t,selectedCount:n}){const s=e&&(e.displayValue||e.value||`${e}`),i=t?`${n}`:"",o=t?"item-list-item-clone":"";return is.renderTextItem({text:s,badgeText:i,className:o})}static getDraggableId(e,t){return`${e}/${t}`}static getDraggableIndex(e){return parseInt(e.split("/").pop()||"",10)}selectItem(e){var t;(t=this.itemList.current)==null||t.selectItem(e)}focusItem(e){var t;(t=this.itemList.current)==null||t.focusItem(e)}scrollToItem(e){var t;(t=this.itemList.current)==null||t.scrollToItem(e)}handleSelectionChange(e){this.setState({selectedCount:$t.count(e)});const{onSelectionChange:t}=this.props;t(e)}render(){const{className:e,draggablePrefix:t,draggingItemClassName:n,droppableId:s,isDoubleClickSelect:i,isDragDisabled:o,isDropDisabled:r,isMultiSelect:l,isStickyBottom:a,itemCount:c,items:d,offset:h,onFocusChange:m,onSelect:p,onViewportChange:g,renderItem:f,rowHeight:b,selectedRanges:C,style:w,"data-testid":S}=this.props;return u(Xs,{isDropDisabled:r,droppableId:s,mode:"virtual",renderClone:this.getCachedRenderClone(n,d,h,f),"data-testid":S,children:(I,v)=>u("div",{role:"menu",className:z("draggable-item-list",e,{"is-drop-disabled":r,"is-drag-disabled":o,"is-dragging-from-this":v.draggingFromThisWith,"is-dragging-over":v.isDraggingOver,"is-dropping":v.draggingOverWith}),style:w,ref:I.innerRef,...I.droppableProps,children:u(jt,{focusSelector:".draggable-item-list-item",isDoubleClickSelect:i,isDragSelect:!1,isMultiSelect:l,isStickyBottom:a,itemCount:c,items:d,onFocusChange:m,onSelect:p,onSelectionChange:this.handleSelectionChange,onViewportChange:g,offset:h,ref:this.itemList,renderItem:this.getCachedRenderDraggableItem(t,o,f),rowHeight:b,selectedRanges:C})})})}};let bt=is;bt.DEFAULT_ROW_HEIGHT=30;bt.defaultProps={className:"",draggingItemClassName:"",offset:0,items:[],rowHeight:is.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!0,isDropDisabled:!1,isDragDisabled:!1,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,style:null,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},renderItem:is.renderItem,selectedRanges:[],draggablePrefix:"draggable-item",droppableId:"droppable-item-list","data-testid":void 0};class ht{static reorder(t,n,s,i){const o=t===s?ht.adjustDestinationIndex(i,n):i,r=ht.removeItems(t,n);return s.splice(o,0,...r),r}static removeItems(t,n){const s=[],i=n.map((o,r)=>({range:o,index:r})).sort((o,r)=>r.range[0]-o.range[0]);for(let o=0;o<i.length;o+=1){const{range:r,index:l}=i[o],[a,c]=r;s[l]=t.splice(a,c-a+1)}return ja(s)}static adjustDestinationIndex(t,n){let s=t;for(let i=0;i<n.length;i+=1){const[o,r]=n[i];if(o>t)break;s-=Math.min(r,t-1)-o+1}return s}static startDragging(){document.documentElement.classList.add("drag-pointer-events-none")}static stopDragging(){document.documentElement.classList.remove("drag-pointer-events-none")}}const Di=class extends R.exports.Component{static isParentSelected(e,t){const n=t.get(e);if(n===void 0)return!1;if(typeof n=="boolean")return n;const s=Array.from(n.values()).includes(!0),i=Array.from(n.values()).includes(!1);return s&&i?null:s}constructor(e){super(e),this.toggleMenu=this.toggleMenu.bind(this),this.toggleValueFor=this.toggleValueFor.bind(this),this.selectAll=this.selectAll.bind(this),this.clear=this.clear.bind(this),this.state={menuIsOpen:!1}}toggleMenu(e){e.stopPropagation(),e.preventDefault(),this.setState(t=>{const{menuIsOpen:n}=t;return{menuIsOpen:!n}})}toggleValueFor(e,t){const{valueMap:n,onUpdateValueMap:s}=this.props,i=new Map(n),o=i.get(e);if(o instanceof Map){const l=new Map(o);if(t!=null)l.set(t,!o.get(t));else{const a=!Di.isParentSelected(e,i);o.forEach((c,d)=>l.set(d,a))}i.set(e,l)}else i.set(e,!o);const r=i.get(e);t===void 0&&r!==void 0&&typeof r!="boolean"&&(Di.isParentSelected(e,n)?r.forEach((l,a)=>r.set(a,!1)):r.forEach((l,a)=>r.set(a,!0))),s(i)}setAllValues(e){const{valueMap:t,onUpdateValueMap:n}=this.props,s=new Map;t.forEach((i,o)=>{if(typeof i=="boolean")s.set(o,e);else{const r=new Map;i.forEach((l,a)=>r.set(a,e)),s.set(o,r)}}),n(s)}selectAll(){this.setAllValues(!0)}clear(){this.setAllValues(!1)}renderMenuElement(){const{valueMap:e,"data-testid":t}=this.props;return T("div",{className:"hcm-menu-container",children:[Array.from(e.entries()).map(([n,s])=>T("div",{children:[u(It,{className:"hcm-parent",checked:Di.isParentSelected(n,e),onChange:()=>this.toggleValueFor(n),children:n}),s!==void 0&&typeof s!="boolean"&&Array.from(s.entries()).map(([i,o])=>u(It,{className:"hcm-child",checked:o,onChange:()=>this.toggleValueFor(n,i),children:i},i))]},n)),u("button",{type:"button",className:"btn btn-link",onClick:this.selectAll,"data-testid":t?`${t}-btn-select-all`:void 0,children:"Select All"}),u("button",{type:"button",className:"btn btn-link",onClick:this.clear,"data-testid":t?`${t}-btn-clear`:void 0,children:"Clear"})]})}render(){const{menuText:e,className:t,icon:n,id:s,"data-testid":i}=this.props,{menuIsOpen:o}=this.state;return T("button",{type:"button",className:z("btn hcm-btn",t),onClick:this.toggleMenu,id:s,"data-testid":i,children:[T("span",{children:[n&&u(G,{icon:n,className:"hcm-icon mr-1"}),e]}),u(G,{icon:Ko,className:"hcm-icon ml-1"}),u(fn,{options:{placement:"bottom"},isShown:o,onExited:()=>{this.setState({menuIsOpen:!1})},closeOnBlur:!0,interactive:!0,children:this.renderMenuElement()})]})}};let Gd=Di;Gd.defaultProps={className:"",icon:null,id:"","data-testid":void 0};const Jl=({isLoaded:e=!1,isLoading:t=!0,errorMessage:n=null,"data-testid":s})=>u(rt,{in:!!n||!e||t,timeout:Rt.transitionMs,classNames:e?"fade":"",mountOnEnter:!0,unmountOnExit:!0,children:u("div",{className:"fill-parent-absolute","data-testid":s,children:u("div",{className:z("iris-panel-message-overlay","fill-parent-absolute",{"iris-panel-scrim-background":e}),children:T("div",{className:"message-content",children:[T("div",{className:"message-icon",children:[t&&u(Pt,{}),!t&&n&&u(G,{icon:cs})]}),u("div",{className:"message-text",children:n})]})})})});const ea=({on:e,id:t,className:n,isInvalid:s,disabled:i=!1,onClick:o,"data-testid":r})=>u("button",{type:"button",className:z("btn","btn-switch",n,{active:e},{"is-invalid":s}),id:t,onClick:o,disabled:i,"data-testid":r,children:u("div",{className:"handle"})});function Br(e){return e.isOn!==void 0}const qd=({item:e,onSelect:t=()=>{},"data-testid":n})=>{const{icon:s,subtitle:i,title:o}=e,r=R.exports.useMemo(()=>Br(e)?()=>{e.onChange(!e.isOn)}:t,[e,t]);return T("div",{className:"btn btn-navigation-menu-item","data-testid":`menu-item-${o}`,onClick:r,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&r()},tabIndex:0,role:"menuitem",children:[s&&u("div",{className:"icon",children:u(G,{icon:s})}),u("div",{className:"title",children:o}),i&&u("div",{className:"shortcut",children:i}),u("div",{className:"accessory","data-testid":n,children:Br(e)&&u(ea,{on:e.isOn,onClick:l=>{l.stopPropagation(),r()}})||u(G,{icon:Nl})})]})};const ta=({items:e,onSelect:t=()=>{},"data-testid":n})=>u("div",{className:"navigation-menu-view","data-testid":n,children:u("ul",{className:"navigation-menu-list",children:e.map((s,i)=>u("li",{children:u(qd,{item:s,onSelect:()=>{t(i)}})},s.title))})});const Wr=({children:e,onBack:t,onClose:n,title:s,"data-testid":i})=>T("div",{className:"navigation-page","data-testid":i,children:[T("div",{className:"navigation-title-bar",children:[u("div",{className:"navigation-left-buttons",children:t!==void 0&&T("button",{className:"btn btn-link btn-back","data-testid":"btn-page-back",type:"button",onClick:t,children:[u(G,{icon:Gc}),"Back"]})}),u("div",{className:"navigation-title",children:s}),u("div",{className:"navigation-right-buttons",children:n!==void 0&&u("button",{className:"btn btn-link btn-link-icon btn-close px-2 m-1","data-testid":"btn-page-close",type:"button",onClick:n,children:u(G,{icon:$i})})})]}),u("div",{className:"navigation-content",children:e})]});const Kd=({children:e,"data-testid":t})=>{const n=R.exports.useMemo(()=>Q.Children.toArray(e),[e]),s=jo(n),[i,o]=R.exports.useState(n[n.length-1]),[r,l]=R.exports.useState(null),[a,c]=R.exports.useState(null);R.exports.useEffect(function(){if(s===void 0||n===s)return;const p=n[n.length-1];n.length===s.length||s.length===0||r!==null||a!==null?r!==null&&p!==r?l(p):p!==a&&p!==i&&o(p):n.length>s.length?l(p):n.length<s.length&&(o(p),c(s[s.length-1]))},[n,s,r,a,i]);const d=R.exports.useCallback(()=>{o(r),l(null)},[r]),h=R.exports.useCallback(()=>{c(null)},[]);return T("div",{className:"navigation-stack",children:[u("div",{className:"main-view","data-testid":t,children:i}),u(rt,{in:a!=null,timeout:Rt.transitionMidMs,classNames:"slide-right",onEntered:h,children:u(Ne,{children:a&&u("div",{className:"popping-view",children:a})})}),u(rt,{in:r!=null,timeout:Rt.transitionMidMs,classNames:"slide-left",onEntered:d,children:u(Ne,{children:r&&u("div",{className:"pushing-view",children:r})})})]})},Xd=({children:e,disabled:t,value:n,"data-testid":s})=>u("option",{value:n,disabled:t,"data-testid":s,children:e}),er=e=>{const{children:t,disabled:n=!1,name:s,onChange:i,value:o="","data-testid":r}=e,[l]=R.exports.useState(s||Qt());return u(Ne,{children:Q.Children.map(t,a=>a?Q.cloneElement(a,{name:l,onChange:a.props.onChange||i,checked:o===a.props.value,disabled:a.props.disabled||n,"data-testid":r}):null)})},gn=Q.forwardRef((e,t)=>{const{checked:n,children:s,className:i="",disabled:o=!1,inputClassName:r="",isInvalid:l=!1,labelClassName:a="",name:c,onChange:d,value:h,"data-testid":m}=e,[p]=R.exports.useState(Qt());return T("div",{className:z("custom-control custom-radio",i),children:[u("input",{type:"radio",id:p,"data-testid":m,name:c,ref:t,className:z("custom-control-input",r,{"is-invalid":l}),checked:n,disabled:o,value:h,onChange:d}),u("label",{className:z("custom-control-label",a),htmlFor:p,children:s})]})});gn.displayName="RadioItem";gn.defaultProps={checked:void 0,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const Yd=({children:e,onBlur:t,onChange:n,className:s,defaultValue:i,name:o,value:r,disabled:l,"data-testid":a})=>{const c=R.exports.useCallback(d=>{n(d.target.value)},[n]);return u("select",{className:z("custom-select",s),onBlur:t,onChange:c,defaultValue:i,value:r,name:o,disabled:l,"data-testid":a,children:e})};class na extends R.exports.PureComponent{constructor(t){super(t),this.getCachedItem=ue((n,s,i,o,r,l,a)=>{const c={height:r},d=o!=null?o:i;return u("li",{className:"value-list-item",style:c,children:u(It,{checked:l,disabled:a,onChange:()=>this.handleSelect(n),children:d})},s)},{max:1e3}),this.getCachedItems=ue((n,s,i,o)=>{const r=[];for(let l=0;l<n.length;l+=1){const a=n[l],{value:c,displayValue:d,isSelected:h}=a,m=i+l,p=m,g=this.getCachedItem(m,p,c,d,s,h,o);r.push(g)}return r},{max:1}),this.handleScroll=this.handleScroll.bind(this),this.handleSelect=this.handleSelect.bind(this),this.list=Q.createRef(),this.topRow=null,this.bottomRow=null}componentDidMount(){this.sendViewportUpdate()}componentDidUpdate(){this.sendViewportUpdate()}handleScroll(){this.sendViewportUpdate()}handleSelect(t){const{items:n,offset:s,onSelect:i}=this.props,o=t-s;if(o>=0&&o<n.length){const r=n[o],{value:l}=r;i(t,l)}else i(t,null)}sendViewportUpdate(){if(!this.list.current||this.list.current.clientHeight===0)return;const{onViewportChange:t,rowHeight:n}=this.props,s=this.list.current.scrollTop,i=s+this.list.current.clientHeight,o=Math.floor(s/n),r=Math.ceil(i/n);(this.topRow!==o||this.bottomRow!==r)&&(this.topRow=o,this.bottomRow=r,t(o,r))}render(){const{className:t,disabled:n,isInvalid:s,items:i,itemCount:o,offset:r,rowHeight:l,"data-testid":a}=this.props,c=this.getCachedItems(i,l,r,n);return u("div",{className:z("select-value-list-scroll-pane h-100 w-100",{"is-invalid":s},t),onScroll:this.handleScroll,ref:this.list,"data-testid":a,children:u("div",{className:"select-value-list",style:{height:o*l},children:u("ol",{className:"select-value-list-content",style:{position:"absolute",height:i.length*l,top:r*l,left:0},children:c})})})}}na.defaultProps={disabled:!1,rowHeight:21,"data-testid":void 0};const zr=te.module("Shortcut");var ie=(e=>(e.CTRL="MODIFIER_CTRL",e.CMD="MODIFIER_CMD",e.ALT="MODIFIER_ALT",e.OPTION="MODIFIER_OPTION",e.SHIFT="MODIFIER_SHIFT",e))(ie||{}),ae=(e=>(e.A="A",e.B="B",e.C="C",e.D="D",e.E="E",e.F="F",e.G="G",e.H="H",e.I="I",e.J="J",e.K="K",e.L="L",e.M="M",e.N="N",e.O="O",e.P="P",e.Q="Q",e.R="R",e.S="S",e.T="T",e.U="U",e.V="V",e.W="W",e.X="X",e.Y="Y",e.Z="Z",e.ZERO="0",e.ONE="1",e.TWO="2",e.THREE="3",e.FOUR="4",e.FIVE="5",e.SIX="6",e.SEVEN="7",e.EIGHT="8",e.NINE="9",e.BACKSPACE="Backspace",e.ESCAPE="Escape",e.ENTER="Enter",e.DELETE="Delete",e.SLASH="/",e.QUESTION_MARK="?",e.BACKSLASH="\\",e.PIPE="|",e.MINUS="-",e.UNDERSCORE="_",e.EQUALS="=",e.PLUS="+",e.BACKTICK="`",e.TILDE="~",e.COMMA=",",e.LEFT_CHEVRON="<",e.PERIOD=".",e.RIGHT_CHEVRON=">",e.SEMICOLON=";",e.COLON=":",e.SINGLE_QUOTE="'",e.DOUBLE_QUOTE='"',e.LEFT_BRACKET="[",e.RIGHT_BRACKET="]",e.LEFT_CURLY="{",e.RIGHT_CURLY="}",e.F1="F1",e.F2="F2",e.F3="F3",e.F4="F4",e.F5="F5",e.F6="F6",e.F7="F7",e.F8="F8",e.F9="F9",e.F10="F10",e.F11="F11",e.F12="F12",e))(ae||{});const Qd=new Set(["Enter","Delete","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"]),qe=class extends Uo{constructor({id:e,shortcut:t,macShortcut:n,isEditable:s=!0,name:i,tooltip:o}){super(),this.id=e,this.name=i,this.tooltip=o,this.isEditable=s;const l=qe.isMacPlatform?n:t;this.defaultKeyState=qe.createKeyState(l),this.keyState=this.defaultKeyState}static isAllowedKey(e){return Object.values(ae).includes(e)}static isValidKeyState(e){const{keyValue:t}=e;return t===null?!0:!qe.isMacPlatform&&e.metaKey||!qe.isAllowedKey(t)?!1:!(!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey)||Qd.has(t)}static createKeyState(e){const t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(n=>{switch(n){case"MODIFIER_CTRL":t.ctrlKey=!0;break;case"MODIFIER_ALT":case"MODIFIER_OPTION":t.altKey=!0;break;case"MODIFIER_CMD":t.metaKey=!0;break;case"MODIFIER_SHIFT":t.shiftKey=!0;break}}),t}static getKeyStateFromEvent(e){const{key:t,keyCode:n}=e;let s="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?s="":!qe.isAllowedKey(t)&&qe.isAllowedKey(String.fromCharCode(n))?s=String.fromCharCode(n):s=t,{keyValue:s,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey}}static getWindowsDisplayText(e){let t="";return e.ctrlKey&&(t+="Ctrl+"),e.altKey&&(t+="Alt+"),e.shiftKey&&(t+="Shift+"),e.keyValue==="Escape"?t+="Esc":e.keyValue!==null&&(t+=e.keyValue),t}static getMacDisplayText(e){let t="";switch(e.ctrlKey&&(t+="\u2303"),e.altKey&&(t+="\u2325"),e.shiftKey&&(t+="\u21E7"),e.metaKey&&(t+="\u2318"),e.keyValue){case"Enter":t+="\u23CE";break;case"Escape":t+="\u238B";break;case"Backspace":t+="\u232B";break;case"Delete":t+="\u2326";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){var n,s;return((n=e.keyValue)==null?void 0:n.toUpperCase())===((s=t.keyValue)==null?void 0:s.toUpperCase())&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey&&e.shiftKey===t.shiftKey}static getDisplayText(e){return e.keyValue===null?"":qe.isMacPlatform?qe.getMacDisplayText(e):qe.getWindowsDisplayText(e)}getDisplayText(){return qe.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){qe.isValidKeyState(e)?(zr.debug2(`Shortcut ${this.id} updated to ${JSON.stringify(e)}`),this.keyState=e,this.dispatchEvent(new Ee("onUpdate",{detail:this}))):zr.debug2(`Shortcut ${this.id} tried to update to invalid keyState ${JSON.stringify(e)}`)}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return qe.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState(qe.NULL_KEY_STATE)}isNull(){return qe.doKeyStatesMatch(this.keyState,qe.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return qe.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState(qe.getKeyStateFromEvent(e))}};let tr=qe;tr.NULL_KEY_STATE={metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null};tr.isMacPlatform=Se.isMacPlatform();const $r=te.module("ShortcutRegistry");class jd extends Uo{constructor(){super(...arguments),this.shortcutMap=new Map,this.shortcutsByCategory=new Map}createAndAdd(t){const n=new tr(t);return this.add(n)}add(t){var i;const n=this.shortcutMap.get(t.id);if(n)return $r.warn(`Skipping attempt to add duplicate shortcut ID to registry: ${t.id}`),n;$r.debug2(`Adding shortcut to registry: ${t.id}`),t.addEventListener("onUpdate",({detail:o})=>this.dispatchEvent(new Ee("onUpdate",{detail:o})));const s=t.id.split(".")[0];return this.shortcutMap.set(t.id,t),this.shortcutsByCategory.has(s)?(i=this.shortcutsByCategory.get(s))==null||i.push(t):this.shortcutsByCategory.set(s,[t]),t}get(t){return this.shortcutMap.get(t)}getConflictingShortcuts(t){return Array.from(this.shortcutMap.values()).filter(n=>!n.isNull()&&n.matchesKeyState(t))}}const Me=Object.freeze(new jd),nr={COPY:Me.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[ie.CTRL,ae.C],macShortcut:[ie.CMD,ae.C],isEditable:!1}),PASTE:Me.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[ie.CTRL,ae.V],macShortcut:[ie.CMD,ae.V],isEditable:!1}),SAVE:Me.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[ie.CTRL,ae.S],macShortcut:[ie.CMD,ae.S],isEditable:!1}),SELECT_ALL:Me.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[ie.CTRL,ae.A],macShortcut:[ie.CMD,ae.A],isEditable:!1}),LINKER:Me.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[ie.CTRL,ae.L],macShortcut:[ie.CMD,ae.L]}),LINKER_CLOSE:Me.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[ae.ESCAPE],macShortcut:[ae.ESCAPE],isEditable:!1})};const sa=Q.forwardRef((e,t)=>{const{children:n,className:s,disabled:i,isLinked:o,isLinkedSource:r,isInvalid:l,onClick:a,onMouseEnter:c,onMouseLeave:d,style:h,"data-testid":m}=e;return T("button",{ref:t,type:"button",className:z("btn-socketed",{"btn-socketed-linked":o||r},{"btn-socketed-linked-source":r},{"is-invalid":l},s),onClick:a,onMouseEnter:c,onMouseLeave:d,style:h,disabled:i,"data-testid":m,children:[n,u(G,{icon:Al,className:"linked btn-socketed-icon",transform:"down-1"}),u(G,{icon:gd,className:"is-invalid btn-socketed-icon"})]})});sa.displayName="SocketedButton";sa.defaultProps={children:void 0,className:"",disabled:!1,isLinked:!1,isLinkedSource:!1,isInvalid:!1,onClick:void 0,onMouseEnter:void 0,onMouseLeave:void 0,style:void 0,"data-testid":void 0};const Zd="_track_xvu02_28",Jd="_handle_xvu02_11",eh="_ticks_xvu02_96",ia={"handle-size":"15px","popover-width":"90px","time-slider":"_time-slider_xvu02_1","time-slider-popovers":"_time-slider-popovers_xvu02_6","handle-popper":"_handle-popper_xvu02_11","flex-spacer":"_flex-spacer_xvu02_24",track:Zd,"track-fills":"_track-fills_xvu02_35","track-fill":"_track-fill_xvu02_35","track-fill-start":"_track-fill-start_xvu02_53","track-fill-middle":"_track-fill-middle_xvu02_54","track-fill-end":"_track-fill-end_xvu02_57","handle-track":"_handle-track_xvu02_60",handle:Jd,ticks:eh,"tick-labels":"_tick-labels_xvu02_114","tick-label":"_tick-label_xvu02_114","tick-label-wrapper":"_tick-label-wrapper_xvu02_130"};parseInt(ia["handle-size"],10);parseInt(ia["popover-width"],10);Object.freeze({ERROR:"error"});window.$=Tl;window.jQuery=Tl;var ds=(e=>(e.FILTER_CONTROL_CHANGE_CLEARS_ALL_FILTERS="filter-control-change-clears-all-filters",e.LINK_CHANGE_CLEARS_ALL_FILTERS="link-change-clears-all-filters",e))(ds||{});Object.freeze([[ds.FILTER_CONTROL_CHANGE_CLEARS_ALL_FILTERS,!1],[ds.LINK_CHANGE_CLEARS_ALL_FILTERS,!1]]);var we=(e=>(e.COUNT="Count",e.MIN="Min",e.MAX="Max",e.SUM="Sum",e.ABS_SUM="AbsSum",e.VAR="Var",e.AVG="Avg",e.STD="Std",e.FIRST="First",e.LAST="Last",e.SKIP="Skip",e.COUNT_DISTINCT="CountDistinct",e.DISTINCT="Distinct",e.UNIQUE="Unique",e))(we||{});class ke{static isValid(t){return!0}static isSameFormat(t,n){throw new Error("isSameFormat not implemented")}static makeFormat(t,n,s){return{label:t,formatString:n,type:s}}format(t,n){return""}}ke.TYPE_GLOBAL="type-global";ke.TYPE_CONTEXT_PRESET="type-context-preset";ke.TYPE_CONTEXT_CUSTOM="type-context-custom";class th extends ke{format(t){switch(t){case 1:case!0:return"true";case 0:case!1:return"false";default:return""}}}class nh extends ke{format(t){return String.fromCharCode(t)}}const{dh:y}=globalThis,Xi=D.exports.shape({name:D.exports.string.isRequired,type:D.exports.string.isRequired,description:D.exports.string,constituentType:D.exports.string}),oa=D.exports.shape({not:D.exports.func.isRequired,and:D.exports.func.isRequired,or:D.exports.func.isRequired}),sh=D.exports.shape({asc:D.exports.func.isRequired,desc:D.exports.func.isRequired,abs:D.exports.func.isRequired,column:Xi.isRequired,direction:D.exports.string.isRequired,isAbs:D.exports.bool.isRequired}),ih=D.exports.shape({columns:D.exports.arrayOf(Xi).isRequired,customColumns:D.exports.arrayOf(D.exports.string).isRequired,filter:D.exports.arrayOf(oa),addEventListener:D.exports.func.isRequired,removeEventListener:D.exports.func.isRequired,size:D.exports.number.isRequired,sort:D.exports.arrayOf(D.exports.any),copy:D.exports.func.isRequired,applyFilter:D.exports.func.isRequired,applySort:D.exports.func.isRequired,applyCustomColumns:D.exports.func.isRequired,description:D.exports.string}),oh=D.exports.shape({columns:D.exports.arrayOf(Xi),filter:D.exports.arrayOf(D.exports.any),isExpanded:D.exports.func.isRequired,saveExpandedState:D.exports.func.isRequired,addEventListener:D.exports.func.isRequired,removeEventListener:D.exports.func.isRequired,size:D.exports.number.isRequired,sort:D.exports.arrayOf(D.exports.any),applyFilter:D.exports.func.isRequired,applySort:D.exports.func.isRequired}),Ni=D.exports.shape({name:D.exports.string.isRequired,type:D.exports.string.isRequired}),rh=D.exports.shape({created:D.exports.arrayOf(Ni).isRequired,updated:D.exports.arrayOf(Ni).isRequired,removed:D.exports.arrayOf(Ni).isRequired}),lh=D.exports.shape({groupingColumns:D.exports.arrayOf(D.exports.string),aggregations:D.exports.shape({}),includeConstituents:D.exports.bool,includeOriginalColumns:D.exports.bool,includeDescriptions:D.exports.bool}),ah=D.exports.shape({addEventListener:D.exports.func.isRequired,removeEventListener:D.exports.func.isRequired,onLogMessage:D.exports.func,getTable:D.exports.func.isRequired,runCode:D.exports.func.isRequired});Object.freeze({Column:Xi,FilterCondition:oa,IdeSession:ah,RollupConfig:lh,Sort:sh,Table:ih,TreeTable:oh,VariableChanges:rh,VariableDefinition:Ni});const Gr=te.module("DateTimeColumnFormatter"),Zn=class extends ke{constructor({timeZone:e="",showTimeZone:t=!0,showTSeparator:n=!1,defaultDateTimeFormatString:s=Zn.DEFAULT_DATETIME_FORMAT_STRING}={}){super();const i=e||Zn.DEFAULT_TIME_ZONE_ID;try{this.dhTimeZone=y.i18n.TimeZone.getTimeZone(i)}catch{Gr.error("Unsupported time zone id",i),this.dhTimeZone=y.i18n.TimeZone.getTimeZone(Zn.DEFAULT_TIME_ZONE_ID)}this.defaultDateTimeFormatString=s,this.showTimeZone=t,this.showTSeparator=n,this.formatStringMap=Zn.makeFormatStringMap(t,n)}static isValid(e){try{return y.i18n.DateTimeFormat.format(e.formatString,new Date),!0}catch{return!1}}static makeFormat(e,t,n=ke.TYPE_CONTEXT_PRESET){return{label:e,formatString:t,type:n}}static isSameFormat(e,t){return e===t||e!==null&&t!==null&&e.type===t.type&&e.formatString===t.formatString}static makeGlobalFormatStringMap(e,t){const n=t?"'T'":" ",s=e?" z":"";return new Map([["yyyy-MM-dd HH:mm:ss",`yyyy-MM-dd${n}HH:mm:ss${s}`],["yyyy-MM-dd HH:mm:ss.SSS",`yyyy-MM-dd${n}HH:mm:ss.SSS${s}`],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS",`yyyy-MM-dd${n}HH:mm:ss.SSSSSSSSS${s}`]])}static getGlobalFormats(e,t){return[...Zn.makeGlobalFormatStringMap(e,t).keys()]}static makeFormatStringMap(e,t){const n=t?"'T'":" ",s=e?" z":"";return new Map([["yyyy-MM-dd",`yyyy-MM-dd${s}`],["MM-dd-yyyy",`MM-dd-yyyy${s}`],["HH:mm:ss",`HH:mm:ss${s}`],["HH:mm:ss.SSS",`HH:mm:ss.SSS${s}`],["HH:mm:ss.SSSSSSSSS",`HH:mm:ss.SSSSSSSSS${s}`],["yyyy-MM-dd HH:mm:ss",`yyyy-MM-dd${n}HH:mm:ss${s}`],["yyyy-MM-dd HH:mm:ss.SSS",`yyyy-MM-dd${n}HH:mm:ss.SSS${s}`],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS",`yyyy-MM-dd${n}HH:mm:ss.SSSSSSSSS${s}`]])}static getFormats(e,t){return[...Zn.makeFormatStringMap(e,t).keys()]}getEffectiveFormatString(e){return this.formatStringMap.get(e)||e}format(e,t){const n=t&&t.formatString||this.defaultDateTimeFormatString,s=this.getEffectiveFormatString(n);try{return y.i18n.DateTimeFormat.format(s,e,this.dhTimeZone)}catch{Gr.error("Invalid format arguments")}return""}};let kn=Zn;kn.DEFAULT_DATETIME_FORMAT_STRING="yyyy-MM-dd HH:mm:ss.SSS";kn.DEFAULT_TIME_ZONE_ID="America/New_York";const ch=te.module("DecimalColumnFormatter"),Xt=class extends ke{constructor({defaultFormatString:e=Xt.DEFAULT_FORMAT_STRING}={}){super(),this.defaultFormatString=e}static isValid(e){try{return y.i18n.NumberFormat.format(e.formatString,0),!0}catch{return!1}}static makeFormat(e,t,n=ke.TYPE_CONTEXT_PRESET,s){return{label:e,type:n,formatString:t,multiplier:s}}static makePresetFormat(e,t="",n){return Xt.makeFormat(e,t,ke.TYPE_CONTEXT_PRESET,n)}static makeCustomFormat(e="",t){return Xt.makeFormat("Custom Format",e,ke.TYPE_CONTEXT_CUSTOM,t)}static isSameFormat(e,t){return e===t||e!=null&&t!=null&&e.type===t.type&&e.formatString===t.formatString&&e.multiplier===t.multiplier}format(e,t){const n=t&&t.formatString||this.defaultFormatString,s=t&&t.multiplier?e*t.multiplier:e;try{return y.i18n.NumberFormat.format(n,s)}catch{ch.error("Invalid format arguments")}return""}};let ze=Xt;ze.DEFAULT_FORMAT_STRING="###,##0.0000";ze.FORMAT_PERCENT=Xt.makePresetFormat("Percent","##0.00%");ze.FORMAT_BASIS_POINTS=Xt.makePresetFormat("Basis Points","###,##0 bp",1e4);ze.FORMAT_MILLIONS=Xt.makePresetFormat("Millions","###,##0.000 mm",1e-6);ze.FORMAT_ROUND=Xt.makePresetFormat("Round","###,##0");ze.FORMAT_ROUND_TWO_DECIMALS=Xt.makePresetFormat("0.00","###,##0.00");ze.FORMAT_ROUND_FOUR_DECIMALS=Xt.makePresetFormat("0.0000","###,##0.0000");class hh extends ke{format(t){return`${t}`}}const uh=te.module("IntegerColumnFormatter"),Gs=class extends ke{constructor({defaultFormatString:e=Gs.DEFAULT_FORMAT_STRING}={}){super(),this.defaultFormatString=e}static isValid(e){try{return y.i18n.NumberFormat.format(e.formatString,0),!0}catch{return!1}}static makeFormat(e,t,n=ke.TYPE_CONTEXT_PRESET,s){return{label:e,type:n,formatString:t,multiplier:s}}static makePresetFormat(e,t="",n){return Gs.makeFormat(e,t,ke.TYPE_CONTEXT_PRESET,n)}static makeCustomFormat(e="",t){return Gs.makeFormat("Custom Format",e,ke.TYPE_CONTEXT_CUSTOM,t)}static isSameFormat(e,t){return e===t||e!=null&&t!=null&&e.type===t.type&&e.formatString===t.formatString&&e.multiplier===t.multiplier}format(e,t){const n=t&&t.formatString||this.defaultFormatString,s=t&&t.multiplier?e*t.multiplier:e;try{return y.i18n.NumberFormat.format(n,s)}catch{uh.error("Invalid format arguments")}return""}};let un=Gs;un.DEFAULT_FORMAT_STRING="###,##0";un.FORMAT_MILLIONS=Gs.makePresetFormat("Millions","###,##0.000 mm",1e-6);class mh extends ke{format(t){return t}}const ct=class{static makeDateWrapper(e,t,n=0,s=1,i=0,o=0,r=0,l=0){if(!e)throw new Error("No timezone provided");const a=`${t}`.padStart(4,"0"),c=`${n+1}`.padStart(2,"0"),d=`${s}`.padStart(2,"0"),h=`${i}`.padStart(2,"0"),m=`${o}`.padStart(2,"0"),p=`${r}`.padStart(2,"0"),g=`${l}`.padStart(9,"0"),f=`${a}-${c}-${d} ${h}:${m}:${p}.${g}`;return y.i18n.DateTimeFormat.parse(ct.FULL_DATE_FORMAT,f,y.i18n.TimeZone.getTimeZone(e))}static getNextNanos(e){const t=parseInt(e,10),n="0".repeat(9-e.length),s=`${t+1}${n}`;return parseInt(s,10)}static getNextDate(e,t,n){let{year:s,month:i,date:o,hours:r,minutes:l,seconds:a,nanos:c}=t;if(e.nanos!=null){if(e.nanos.length===9)return null;c=ct.getNextNanos(e.nanos),c>999999999&&(a+=1,c=0)}else e.seconds!=null?a+=1:e.minutes!=null?l+=1:e.hours!=null?r+=1:e.date!=null?o+=1:e.month!=null?i+=1:s+=1;const d=new Date(s,i,o,r,l,a);return ct.makeDateWrapper(n,d.getFullYear(),d.getMonth(),d.getDate(),d.getHours(),d.getMinutes(),d.getSeconds(),c)}static parseMonth(e){const t=parseInt(e,10);if(!Number.isNaN(t))return t>=1&&t<=12?t-1:NaN;const n=e.trim().toLowerCase();if(n.length>=3){for(let s=0;s<ct.months.length;s+=1)if(ct.months[s].startsWith(n))return s}return NaN}static parseDateValues(e,t,n,s,i,o,r){const l=parseInt(e,10),a=t!=null?this.parseMonth(t):0,c=n!=null?parseInt(n,10):1,d=s!=null?parseInt(s,10):0,h=i!=null?parseInt(i,10):0,m=o!=null?parseInt(o,10):0,p=r!=null?parseInt(r.padEnd(9,"0"),10):0;return Number.isNaN(l)||Number.isNaN(a)||Number.isNaN(c)||Number.isNaN(d)||Number.isNaN(h)||Number.isNaN(m)||Number.isNaN(p)?null:{year:l,month:a,date:c,hours:d,minutes:h,seconds:m,nanos:p}}static parseDateTimeString(e){const n=/\s*(\d{4})([-./]([\da-z]+))?([-./](\d{1,2}))?([tT\s](\d{2})([:](\d{2}))?([:](\d{2}))?([.](\d{1,9}))?)?(.*)/.exec(e);if(n==null)throw new Error(`Unexpected date string: ${e}`);const[,s,,i,,o,,r,,l,,a,,c,d]=n;if(d!=null&&d.length>0)throw new Error(`Unexpected characters after date string '${e}': ${d}`);return{year:s,month:i,date:o,hours:r,minutes:l,seconds:a,nanos:c}}static parseDateRange(e,t){const n=e.trim().toLowerCase();if(n.length===0)throw new Error("Cannot parse date range from empty string");if(n==="null")return[null,null];if(n==="today"){const l=new Date(Date.now()),a=ct.makeDateWrapper(t,l.getFullYear(),l.getMonth(),l.getDate()),c=ct.makeDateWrapper(t,l.getFullYear(),l.getMonth(),l.getDate()+1);return[a,c]}if(n==="yesterday"){const l=new Date(Date.now()),a=ct.makeDateWrapper(t,l.getFullYear(),l.getMonth(),l.getDate()-1),c=ct.makeDateWrapper(t,l.getFullYear(),l.getMonth(),l.getDate());return[a,c]}if(n==="now"){const l=new Date(Date.now());return[y.DateWrapper.ofJsDate(l),null]}const s=ct.parseDateTimeString(n);if(s.year==null&&s.month==null&&s.date==null)throw new Error(`Unable to extract year, month, or day ${n}`);const i=ct.parseDateValues(s.year,s.month,s.date,s.hours,s.minutes,s.seconds,s.nanos);if(i==null)throw new Error(`Unable to extract date values from ${s}`);const o=ct.makeDateWrapper(t,i.year,i.month,i.date,i.hours,i.minutes,i.seconds,i.nanos),r=ct.getNextDate(s,i,t);return[o,r]}static getJsDate(e){return typeof e=="number"?new Date(e):e.asDate()}};let Ln=ct;Ln.FULL_DATE_FORMAT="yyyy-MM-dd HH:mm:ss.SSSSSSSSS";Ln.months=["january","february","march","april","may","june","july","august","september","october","november","december"];class qt{}qt.not="not";qt.and="and";qt.or="or";function ph(e){if(!(e==="not"||e==="and"||e==="or"))throw new Error("operator is not a valid FilterOperatorValue")}class W{}W.eq="eq";W.eqIgnoreCase="eqIgnoreCase";W.notEq="notEq";W.notEqIgnoreCase="notEqIgnoreCase";W.greaterThan="greaterThan";W.greaterThanOrEqualTo="greaterThanOrEqualTo";W.lessThan="lessThan";W.lessThanOrEqualTo="lessThanOrEqualTo";W.in="in";W.inIgnoreCase="inIgnoreCase";W.notIn="notIn";W.notInIgnoreCase="notInIgnoreCase";W.isTrue="isTrue";W.isFalse="isFalse";W.isNull="isNull";W.invoke="invoke";W.contains="contains";W.notContains="notContains";W.startsWith="startsWith";W.endsWith="endsWith";W.containsAny="containsAny";function gh(e){switch(e){case W.eq:return"is exactly";case W.eqIgnoreCase:return"is exactly (ignore case)";case W.notEq:return"is not exactly";case W.notEqIgnoreCase:return"is not exactly (ignore case)";case W.contains:return"contains";case W.notContains:return"does not contain";case W.startsWith:return"starts with";case W.endsWith:return"ends with";default:throw new Error(`Unrecognized text filter type ${e}`)}}function fh(e){switch(e){case W.eq:return"is equal to";case W.notEq:return"is not equal to";case W.greaterThan:return"greater than";case W.greaterThanOrEqualTo:return"greater than or equal to";case W.lessThan:return"less than";case W.lessThanOrEqualTo:return"less than or equal to";default:throw new Error(`Unrecognized number filter type ${e}`)}}function Ch(e){switch(e){case W.eq:return"date is";case W.notEq:return"date is not";case W.notEqIgnoreCase:case W.greaterThan:return"date is after";case W.greaterThanOrEqualTo:return"date is after or equal";case W.lessThan:return"date is before";case W.lessThanOrEqualTo:return"date is before or equal";default:throw new Error(`Unrecognized date filter type ${e}`)}}function bh(e){switch(e){case W.isTrue:return"Is True";case W.isFalse:return"Is False";case W.isNull:return"Is Null";default:throw new Error(`Unrecognized boolean filter type ${e}`)}}const sn=te.module("TableUtils"),X=class{static getSortIndex(e,t){var n;for(let s=0;s<e.length;s+=1)if(((n=e[s].column)==null?void 0:n.index)===t)return s;return null}static getSortForColumn(e,t){const n=X.getSortIndex(e,t);return n!=null?e[n]:null}static getFilterText(e){return e?e.toString():null}static getFilterTypes(e){return X.isBooleanType(e)?[W.isTrue,W.isFalse,W.isNull]:X.isCharType(e)||X.isNumberType(e)||X.isDateType(e)?[W.eq,W.notEq,W.greaterThan,W.greaterThanOrEqualTo,W.lessThan,W.lessThanOrEqualTo]:X.isTextType(e)?[W.eq,W.eqIgnoreCase,W.notEq,W.notEqIgnoreCase,W.contains,W.notContains,W.startsWith,W.endsWith]:[]}static getNextSort(e,t,n){if(!e||n<0||n>=e.length)return null;const s=X.getSortForColumn(t,n);return s===null?e[n].sort().asc():s.direction===X.sortDirection.ascending?s.desc():null}static makeColumnSort(e,t,n,s){if(!e||t<0||t>=e.length||n===X.sortDirection.none)return null;let i=e[t].sort();switch(n){case X.sortDirection.ascending:i=i.asc();break;case X.sortDirection.descending:i=i.desc();break}return s&&(i=i.abs()),i}static toggleSortForColumn(e,t,n,s=!1){if(n<0||n>=t.length)return[];const i=X.getNextSort(t,e,n);return X.setSortForColumn(e,n,i,s)}static sortColumn(e,t,n,s,i,o){if(!e||n<0||n>=t.length)return[];const r=X.makeColumnSort(t,n,s,i);return X.setSortForColumn(e,n,r,o)}static setSortForColumn(e,t,n,s=!1){const i=X.getSortIndex(e,t);let o=[];return s&&(o=o.concat(e.filter(({direction:r})=>r!==X.sortDirection.reverse)),i!==null&&o.splice(i,1)),n!==null&&o.push(n),o}static getNormalizedType(e){switch(e){case"boolean":case"java.lang.Boolean":case X.dataType.BOOLEAN:return X.dataType.BOOLEAN;case"char":case"java.lang.Character":case X.dataType.CHAR:return X.dataType.CHAR;case"java.lang.String":case X.dataType.STRING:return X.dataType.STRING;case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":case X.dataType.DATETIME:return X.dataType.DATETIME;case"double":case"java.lang.Double":case"float":case"java.lang.Float":case"java.math.BigDecimal":case X.dataType.DECIMAL:return X.dataType.DECIMAL;case"int":case"java.lang.Integer":case"long":case"java.lang.Long":case"short":case"java.lang.Short":case"byte":case"java.lang.Byte":case"java.math.BigInteger":case X.dataType.INT:return X.dataType.INT;default:return X.dataType.UNKNOWN}}static isLongType(e){switch(e){case"long":case"java.lang.Long":return!0;default:return!1}}static isDateType(e){switch(e){case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":return!0;default:return!1}}static isNumberType(e){return X.isIntegerType(e)||X.isDecimalType(e)}static isIntegerType(e){switch(e){case"int":case"java.lang.Integer":case"java.math.BigInteger":case"long":case"java.lang.Long":case"short":case"java.lang.Short":case"byte":case"java.lang.Byte":return!0;default:return!1}}static isDecimalType(e){switch(e){case"double":case"java.lang.Double":case"java.math.BigDecimal":case"float":case"java.lang.Float":return!0;default:return!1}}static isBooleanType(e){switch(e){case"boolean":case"java.lang.Boolean":return!0;default:return!1}}static isCharType(e){switch(e){case"char":case"java.lang.Character":return!0;default:return!1}}static isStringType(e){switch(e){case"java.lang.String":return!0;default:return!1}}static isTextType(e){return this.isStringType(e)||this.isCharType(e)}static getBaseType(e){return e.split("[]")[0]}static isCompatibleType(e,t){return X.getNormalizedType(e)===X.getNormalizedType(t)}static makeQuickFilter(e,t,n){const s=t.split("||");let i=null;for(let o=0;o<s.length;o+=1){const l=s[o].split("&&");let a=null;for(let c=0;c<l.length;c+=1){const d=l[c].trim();if(d.length>0){const h=X.makeQuickFilterFromComponent(e,d,n);if(h)a?a=a.and(h):a=h;else throw new Error(`Unable to parse quick filter from text ${t}`)}}i&&a?i=i.or(a):i=a}return i}static makeQuickFilterFromComponent(e,t,n){const{type:s}=e;return X.isNumberType(s)?this.makeQuickNumberFilter(e,t):X.isBooleanType(s)?this.makeQuickBooleanFilter(e,t):n&&X.isDateType(s)?this.makeQuickDateFilter(e,t,n):X.isCharType(s)?this.makeQuickCharFilter(e,t):this.makeQuickTextFilter(e,t)}static makeQuickNumberFilter(e,t){if(t==null)return null;const n=e.filter();let s=null;const o=/\s*(>=|<=|=>|=<|>|<|!=|=|!)?(\s*-\s*)?(\s*\d*(?:,\d{3})*(?:\.\d*)?\s*)?(null|nan|infinity|inf|\u221E)?(.*)/i.exec(t);let r=null,l=null,a=null,c=null,d=null;if(o!==null&&o.length>3&&([,r,l,a,c,d]=o),d!=null&&d.trim().length>0)return null;if(r==null&&(r="="),c!=null){if(!(r==="="||r==="!"||r==="!="))return null;switch(c=c.trim().toLowerCase(),c){case"null":s=n.isNull();break;case"nan":s=y.FilterCondition.invoke("isNaN",n);break;case"infinity":case"inf":case"\u221E":l!=null?s=y.FilterCondition.invoke("isInf",n).and(n.lessThan(y.FilterValue.ofNumber(0))):s=y.FilterCondition.invoke("isInf",n).and(n.greaterThan(y.FilterValue.ofNumber(0)));break}return s!==null&&(r==="!"||r==="!=")&&(s=s.not()),s}if(a==null)return null;if(a=X.removeCommas(a),X.isLongType(e.type))try{a=y.FilterValue.ofNumber(y.LongWrapper.ofString(`${l!=null?"-":""}${a}`))}catch(h){return sn.warn("Unable to create long filter",h),null}else{if(a=parseFloat(a),a==null||Number.isNaN(a))return null;a=y.FilterValue.ofNumber(l!=null?0-a:a)}return s=e.filter(),X.makeRangeFilterWithOperation(s,r,a)}static makeQuickTextFilter(e,t){if(t==null)return null;const n=`${t}`.trim(),i=/^(!~|!=|~|=|!)?(.*)/.exec(n);let o=null,r=null;if(i!==null&&i.length>2&&([,o,r]=i,r!=null&&(r=r.trim())),r==null||r.length===0)return null;o==null&&(o="=");const l=e.filter();if(r.toLowerCase()==="null")switch(o){case"=":return l.isNull();case"!=":case"!":return l.isNull().not();default:return null}let a=null,c=null;switch(r.startsWith("*")?(a="*",r=r.substring(1)):r.endsWith("*")&&!r.endsWith("\\*")&&(c="*",r=r.substring(0,r.length-1)),r=r.replace("\\",""),o){case"~":return l.isNull().not().and(l.invoke("matches",y.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E.*`)));case"!~":return l.isNull().or(l.invoke("matches",y.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E.*`)).not());case"!=":return a==="*"?l.isNull().or(l.invoke("matches",y.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E$`)).not()):c==="*"?l.isNull().or(l.invoke("matches",y.FilterValue.ofString(`(?s)(?i)^\\Q${r}\\E.*`)).not()):l.notEqIgnoreCase(y.FilterValue.ofString(r.toLowerCase()));case"=":return a==="*"?l.isNull().not().and(l.invoke("matches",y.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E$`))):c==="*"?l.isNull().not().and(l.invoke("matches",y.FilterValue.ofString(`(?s)(?i)^\\Q${r}\\E.*`))):l.eqIgnoreCase(y.FilterValue.ofString(r.toLowerCase()))}return null}static makeQuickBooleanFilter(e,t){if(t==null)return null;const s=/^(!=|=|!)?(.*)/.exec(`${t}`.trim());if(s===null)return null;const[,i,o]=s,r=i==="!"||i==="!=",l=o.trim().toLowerCase();let a=e.filter();try{const c=X.makeBooleanValue(l);return c?a=a.isTrue():c===null?a=a.isNull():a=a.isFalse(),r?a.not():a}catch{return null}}static makeQuickDateFilter(e,t,n){const s=t.trim(),o=/\s*(>=|<=|=>|=<|>|<|!=|!|=)?(.*)/.exec(s);if(o==null||o.length<=2)throw new Error(`Unable to parse date filter: ${t}`);let r=null,l=null;[,r,l]=o;let a=W.eq;switch(r){case"<":a=W.lessThan;break;case"<=":case"=<":a=W.lessThanOrEqualTo;break;case">":a=W.greaterThan;break;case">=":case"=>":a=W.greaterThanOrEqualTo;break;case"!=":case"!":a=W.notEq;break;case"=":case"==":default:a=W.eq;break}return X.makeQuickDateFilterWithOperation(e,l,a,n)}static makeQuickDateFilterWithOperation(e,t,n=W.eq,s){if(e==null)throw new Error("Column is null");const[i,o]=Ln.parseDateRange(t,s),r=i!=null?y.FilterValue.ofNumber(i):null,l=o!=null?y.FilterValue.ofNumber(o):null,a=e.filter();if(r==null)return n===W.notEq?a.isNull().not():a.isNull();switch(n){case W.eq:{if(l!=null){const c=a.greaterThanOrEqualTo(r),d=a.lessThan(l);return c.and(d)}return a.eq(r)}case W.lessThan:return a.lessThan(r);case W.lessThanOrEqualTo:return l!=null?a.lessThan(l):a.lessThanOrEqualTo(r);case W.greaterThan:return l!=null?a.greaterThanOrEqualTo(l):a.greaterThan(r);case W.greaterThanOrEqualTo:return a.greaterThanOrEqualTo(r);case W.notEq:{if(l!=null){const c=a.lessThan(r),d=a.greaterThanOrEqualTo(l);return c.or(d)}return a.notEq(r)}default:throw new Error(`Invalid operator: ${n}`)}}static quoteValue(e){return e.length>=2&&(e.charAt(0)==='"'&&e.charAt(e.length-1)==='"'||e.charAt(0)==="'"&&e.charAt(e.length-1)==="'")?e:`"${e}"`}static isRangeOperation(e){switch(e){case"<":case"<=":case"=<":case">":case">=":case"=>":return!0;default:return!1}}static makeQuickCharFilter(e,t){if(t==null)return null;const n=`${t}`.trim(),i=/^(>=|<=|=>|=<|>|<|!=|=|!)?(null|"."|'.'|.)?(.*)/.exec(n);let o=null,r=null,l=null;if(i!==null&&i.length>3&&([,o,r,l]=i),l!=null&&l.trim().length>0||r==null||r.length===0)return null;o==null&&(o="=");const a=e.filter();if(r.toLowerCase()==="null")switch(o){case"=":return a.isNull();case"!=":case"!":return a.isNull().not();default:return null}const c=y.FilterValue.ofString(X.isRangeOperation(o)?X.quoteValue(r):r);return X.makeRangeFilterWithOperation(a,o,c)}static makeRangeFilterWithOperation(e,t,n){switch(t){case"=":return e.eq(n);case"<":return e.lessThan(n);case"<=":case"=<":return e.lessThanOrEqualTo(n);case">":return e.greaterThan(n);case">=":case"=>":return e.greaterThanOrEqualTo(n);case"!=":case"!":return e.notEq(n);default:return null}}static makeCancelableTablePromise(e){return He.makeCancelable(e,t=>{t.close()})}static makeCancelableTableEventPromise(e,t,n=0,s=null){let i,o,r=!0;const l=new Promise((a,c)=>{o=setTimeout(()=>{i(),r=!1,c(new Bl(`Event "${t}" timed out.`))},n),i=e.addEventListener(t,d=>{if(s!=null&&!s(d)){sn.debug2("Event triggered, but matcher returned false.");return}sn.debug2("Event triggered, resolving."),i(),clearTimeout(o),r=!1,a(d)})});return l.cancel=()=>{if(r){sn.debug2("Pending promise cleanup."),i(),clearTimeout(o),r=!1;return}sn.debug2("Ignoring non-pending promise cancel.")},l}static makeAdvancedFilter(e,t,n){const{filterItems:s,filterOperators:i,invertSelection:o,selectedValues:r}=t;let l=null;for(let c=0;c<s.length;c+=1){const d=s[c],{selectedType:h,value:m}=d;if(h!=null&&h.length>0&&m!=null&&m.length>0)try{const p=X.makeAdvancedValueFilter(e,h,m,n);if(p!=null){if(c===0)l=p;else if(l!==null&&c-1<i.length){const g=i[c-1];if(g===qt.and)l=l.and(p);else if(g===qt.or)l=l.or(p);else{sn.error("Unexpected filter operator",g,p),l=null;break}}}else sn.debug2("Empty filter ignored for",h,m)}catch(p){sn.error("Unable to create filter",p),l=null;break}}const a=X.makeSelectValueFilter(e,r,o);return a!=null&&(l!=null?l=l.and(a):l=a),l}static removeCommas(e){return e.replace(/[\s|,]/g,"")}static makeFilterValue(e,t){const n=X.getBaseType(e);return X.isTextType(n)?y.FilterValue.ofString(t):X.isLongType(n)?y.FilterValue.ofNumber(y.LongWrapper.ofString(X.removeCommas(t))):y.FilterValue.ofNumber(X.removeCommas(t))}static makeFilterRawValue(e,t){return X.isTextType(e)?y.FilterValue.ofString(t):X.isBooleanType(e)?y.FilterValue.ofBoolean(t):y.FilterValue.ofNumber(t)}static makeValue(e,t,n){if(t==null||t==="null")return null;if(X.isTextType(e))return t;if(X.isLongType(e))return y.LongWrapper.ofString(X.removeCommas(t));if(X.isBooleanType(e))return X.makeBooleanValue(t,!0);if(X.isDateType(e)){const[s]=Ln.parseDateRange(t,n);return s}return X.isNumberType(e)?X.makeNumberValue(t):(sn.error("Unexpected column type",e),null)}static makeBooleanValue(e,t=!1){if(e===""&&t)return null;switch(e==null?void 0:e.toLowerCase()){case"null":return null;case"0":case"f":case"fa":case"fal":case"fals":case"false":case"n":case"no":return!1;case"1":case"t":case"tr":case"tru":case"true":case"y":case"ye":case"yes":return!0;default:throw new Error(`Invalid boolean '${e}'`)}}static makeNumberValue(e){if(e==null||e==="null"||e==="")return null;const t=e.toLowerCase().trim();if(t==="\u221E"||t==="infinity"||t==="inf")return Number.POSITIVE_INFINITY;if(t==="-\u221E"||t==="-infinity"||t==="-inf")return Number.NEGATIVE_INFINITY;const n=X.removeCommas(t);if(X.NUMBER_REGEX.test(n))return parseFloat(n);throw new Error(`Invalid number '${e}'`)}static getFilterOperatorString(e){switch(e){case W.eq:return"=";case W.notEq:return"!=";case W.greaterThan:return">";case W.greaterThanOrEqualTo:return">=";case W.lessThan:return"<";case W.lessThanOrEqualTo:return"<=";case W.contains:return"~";case W.notContains:return"!~";default:throw new Error(`Unexpected filter type ${e}`)}}static makeAdvancedValueFilter(e,t,n,s){if(X.isDateType(e.type))return X.makeQuickDateFilterWithOperation(e,n,t,s);if(X.isNumberType(e.type)||X.isCharType(e.type))return X.makeQuickFilter(e,`${X.getFilterOperatorString(t)}${n}`);const i=X.makeFilterValue(e.type,n),o=e.filter();switch(t){case W.eq:return o.eq(i);case W.eqIgnoreCase:return o.eqIgnoreCase(i);case W.notEq:return o.notEq(i);case W.notEqIgnoreCase:return o.notEqIgnoreCase(i);case W.greaterThan:return o.greaterThan(i);case W.greaterThanOrEqualTo:return o.greaterThanOrEqualTo(i);case W.lessThan:return o.lessThan(i);case W.lessThanOrEqualTo:return o.lessThanOrEqualTo(i);case W.isTrue:return o.isTrue();case W.isFalse:return o.isFalse();case W.isNull:return o.isNull();case W.contains:return o.isNull().not().and(o.invoke("matches",y.FilterValue.ofString(`(?s)(?i).*\\Q${n}\\E.*`)));case W.notContains:return o.isNull().or(o.invoke("matches",y.FilterValue.ofString(`(?s)(?i).*\\Q${n}\\E.*`)).not());case W.startsWith:return o.isNull().not().and(o.invoke("matches",y.FilterValue.ofString(`(?s)(?i)^\\Q${n}\\E.*`)));case W.endsWith:return o.isNull().not().and(o.invoke("matches",y.FilterValue.ofString(`(?s)(?i).*\\Q${n}\\E$`)));case W.in:case W.inIgnoreCase:case W.notIn:case W.notInIgnoreCase:case W.invoke:default:throw new Error(`Unexpected filter operation: ${t}`)}}static makeSelectValueFilter(e,t,n){if(t.length===0){if(n)return null;let o=null;X.isTextType(e.type)?o=y.FilterValue.ofString("a"):X.isBooleanType(e.type)?o=y.FilterValue.ofBoolean(!0):X.isDateType(e.type)?o=y.FilterValue.ofNumber(y.DateWrapper.ofJsDate(new Date)):o=y.FilterValue.ofNumber(0);const r=e.filter().eq(o),l=e.filter().notEq(o);return r.and(l)}const s=[];let i=!1;for(let o=0;o<t.length;o+=1){const r=t[o];r==null?i=!0:X.isTextType(e.type)?s.push(y.FilterValue.ofString(typeof r=="number"?String.fromCharCode(r):r)):X.isBooleanType(e.type)?s.push(y.FilterValue.ofBoolean(!!r)):s.push(y.FilterValue.ofNumber(r))}return i?s.length>0?n?e.filter().isNull().not().and(e.filter().notIn(s)):e.filter().isNull().or(e.filter().in(s)):n?e.filter().isNull().not():e.filter().isNull():n?e.filter().notIn(s):e.filter().in(s)}static isTreeTable(e){return e!=null&&e.expand!==void 0&&e.collapse!==void 0}static sortColumns(e,t=!0){return[...e].sort((n,s)=>{const i=n.name.toUpperCase(),o=s.name.toUpperCase();return Qo.sort(i,o,t)})}};let x=X;x.dataType={BOOLEAN:"boolean",CHAR:"char",DATETIME:"datetime",DECIMAL:"decimal",INT:"int",STRING:"string",UNKNOWN:"unknown"};x.sortDirection={ascending:"ASC",descending:"DESC",reverse:"REVERSE",none:null};x.REVERSE_TYPE=Object.freeze({NONE:"none",PRE_SORT:"pre-sort",POST_SORT:"post-sort"});x.NUMBER_REGEX=/^-?\d+(\.\d+)?$/;class Yt{static makeColumnFormatMap(t){return t==null?new Map:t.reduce((n,s)=>{const i=x.getNormalizedType(s.columnType);if(i===null)return n;n.has(i)||n.set(i,new Map);const o=n.get(i);return o==null||o.set(s.columnName,s.format),n},new Map)}static makeColumnFormattingRule(t,n,s){return{columnType:t,columnName:n,format:s}}constructor(t=[],n,s,i,o=!1){this.defaultColumnFormatter=new hh,this.typeFormatterMap=new Map([[x.dataType.BOOLEAN,new th],[x.dataType.CHAR,new nh],[x.dataType.DATETIME,new kn(n)],[x.dataType.DECIMAL,new ze(s)],[x.dataType.INT,new un(i)],[x.dataType.STRING,new mh]]),this.columnFormatMap=Yt.makeColumnFormatMap(t),this.truncateNumbersWithPound=o}getColumnFormatMapForType(t,n=!1){const s=x.getNormalizedType(t);if(s!==null)return n&&!this.columnFormatMap.has(s)&&this.columnFormatMap.set(s,new Map),this.columnFormatMap.get(s)}getColumnFormat(t,n){var i;const s=this.getColumnFormatMapForType(t);return(i=s==null?void 0:s.get(n))!=null?i:null}getColumnTypeFormatter(t){var i;const n=x.getNormalizedType(t);let s=this.defaultColumnFormatter;return n&&(s=(i=this.typeFormatterMap.get(n))!=null?i:s),s}getFormattedString(t,n,s="",i){if(t==null)return"";const o=this.getColumnTypeFormatter(n),r=i||this.getColumnFormat(n,s);return o.format(t,r!=null?r:void 0)}get timeZone(){var n;const t=this.typeFormatterMap.get(x.dataType.DATETIME);return(n=t==null?void 0:t.dhTimeZone)==null?void 0:n.id}}function wh(e){if(e&&e.formatter){const{formatter:t}=e;return t}}function Sh(e){return{timeZone:e==null?void 0:e.timeZone,defaultDateTimeFormatString:e==null?void 0:e.defaultDateTimeFormat,showTimeZone:e==null?void 0:e.showTimeZone,showTSeparator:e==null?void 0:e.showTSeparator}}function vh(e,t,n){const s=e.getColumnFormat(n,t);return s!=null&&(s.type===ke.TYPE_CONTEXT_PRESET||s.type===ke.TYPE_CONTEXT_CUSTOM)}const ls={getColumnFormats:wh,getDateTimeFormatterOptions:Sh,isCustomColumnFormatDefined:vh},Th=e=>{switch(e){default:return!1}},Eh=(e,t)=>{switch(e){case we.COUNT:case we.FIRST:case we.LAST:case we.COUNT_DISTINCT:case we.DISTINCT:case we.UNIQUE:return!0;case we.MIN:case we.MAX:return x.isNumberType(t)||x.isDateType(t)||x.isTextType(t);case we.SUM:case we.ABS_SUM:case we.VAR:case we.AVG:case we.STD:return x.isNumberType(t);case we.SKIP:return!1}},sr=(e,t)=>e.filter(n=>Eh(t,n.type)),yh=(e,t,n,s)=>sr(e,t).map(({name:i})=>i).filter(i=>n.includes(i)?!s:s),xn={isRollupOperation:Th,filterValidColumns:sr,getOperationColumnNames:yh};const qr=te.module("Aggregations"),Rh=[we.SUM,we.ABS_SUM,we.MIN,we.MAX,we.VAR,we.AVG,we.STD,we.FIRST,we.LAST,we.COUNT_DISTINCT,we.DISTINCT,we.COUNT,we.UNIQUE],Ih=({isRollup:e,settings:t,onChange:n,onEdit:s})=>{const{aggregations:i,showOnTop:o}=t,r=R.exports.useMemo(()=>Rh.filter(k=>!i.some(P=>P.operation===k)),[i]),[l,a]=R.exports.useState(r[0]),[c,d]=R.exports.useState([]),h=R.exports.useCallback(k=>{n({...t,...k})},[n,t]),m=R.exports.useCallback(k=>{h({aggregations:k})},[h]),p=R.exports.useCallback(k=>{h({showOnTop:k})},[h]),g=R.exports.useCallback(()=>{qr.debug("handleDragStart"),ht.startDragging()},[]),f=R.exports.useCallback(({destination:k,source:P})=>{if(qr.debug("handleDragEnd",k,P),ht.stopDragging(),k===null)return;let L=k.index;P.index<k.index&&(L+=1);const N=[...i],B=ht.reorder(N,c,N,L),U=ht.adjustDestinationIndex(L,c),H=[[U,U+B.length-1]];m(N),d(H)},[m,i,c,d]),b=R.exports.useCallback(k=>{a(k)},[a]),C=R.exports.useCallback(()=>{m([...i,{operation:l,selected:[],invert:!0}])},[i,l,m]),w=R.exports.useCallback(k=>{m(i.filter((P,L)=>L!==k))},[i,m]),S=R.exports.useCallback(k=>{d(k)},[d]),I=R.exports.useCallback(k=>{const P=i[k];xn.isRollupOperation(P.operation)||s(P)},[i,s]),v=R.exports.useCallback(k=>{p(k.target.value==="true")},[p]);R.exports.useEffect(function(){r.length>0&&!r.includes(l)&&a(r[0])},[r,l]);const E=R.exports.useCallback(({item:k,itemIndex:P,isClone:L,selectedCount:N})=>{const B=k.operation,U=L?`${N}`:void 0,H=L?"item-list-item-clone":void 0,_=xn.isRollupOperation(k.operation),$=!L&&!_;return T(Ne,{children:[T("div",{className:z("item-list-item-content","draggable-item-list-item-content",H),children:[T("span",{className:"title",children:[B,!e&&_&&T("span",{className:"small text-warning",children:[u(G,{icon:Vl})," Requires rollup"]})]}),bt.renderBadge({text:U}),bt.renderHandle()]}),!L&&T(Ne,{children:[u(Ie,{kind:"ghost",className:"btn-edit",icon:xl,tooltip:"Edit Columns",onClick:()=>s(k),disabled:!$}),u(Ie,{kind:"ghost",className:"btn-delete",icon:Pn,tooltip:"Delete Aggregation",onClick:()=>w(P)})]})]})},[w,s,e]),M=r.length>0,F=i.length>0;return T("div",{className:"aggregations",children:[M&&T("div",{className:"form-inline",children:[u(Yd,{onChange:b,value:l,children:r.map(k=>u(Xd,{value:k,children:k},k))}),T("button",{type:"button",className:"btn btn-link btn-add",onClick:C,children:[u(G,{icon:Rs}),"Add Aggregation"]})]}),M&&F&&u("hr",{}),F&&T(Ne,{children:[!e&&T("div",{className:"form-inline",children:[u("label",{children:"Placement:\xA0"}),T(er,{onChange:v,value:`${o}`,children:[u(gn,{value:"true",children:"Top"}),u(gn,{value:"false",children:"Bottom"})]})]}),u(Ys,{onDragStart:g,onDragEnd:f,children:u(bt,{className:"selected-aggregations",itemCount:i.length,items:i,renderItem:E,offset:0,onSelectionChange:S,onSelect:I,selectedRanges:c,isMultiSelect:!0})})]})]})};const Mh=30,Dh=({aggregation:e,columns:t,onChange:n})=>{const[s,i]=R.exports.useState(-1),[o,r]=R.exports.useState(-1),[l,a]=R.exports.useState(0),{invert:c,selected:d}=e,h=R.exports.useRef(null),m=R.exports.useCallback(v=>d.includes(v)?!c:c,[c,d]),p=R.exports.useMemo(()=>{let v=sr(t,e.operation);return l!==0&&(v=x.sortColumns(v,l===1)),v},[t,e.operation,l]),g=R.exports.useMemo(()=>s>=0?p.slice(s,o+1).map(v=>({value:v.name,displayValue:v.name,isSelected:m(v.name)})):[],[p,m,o,s]),f=R.exports.useCallback(v=>{const{name:E}=p[v],M=d.indexOf(E);let F=[...d],k=c;M>=0?F.splice(M,1):(F.push(E),F.length===p.length&&(F=[],k=!c)),n({...e,selected:F,invert:k})},[e,c,p,d,n]),b=R.exports.useCallback(()=>{a(0),n({...e,selected:[],invert:!0})},[e,n]),C=R.exports.useCallback((v,E)=>{i(v),r(E)},[i,r]),w=R.exports.useCallback(()=>{d.length===0?n({...e,invert:!c}):n({...e,selected:[],invert:!0})},[e,c,n,d]),S=d.length===0?c:null,I=d.length!==0||!c||l!==0;return T("div",{role:"menu",className:"aggregation-edit",children:[u("div",{className:"top-menu",children:T("div",{className:"form-inline",children:[u(It,{checked:S,onChange:w,children:"Toggle All"}),u("div",{className:"spacer"}),u(rt,{in:I,timeout:Rt.transitionSlowMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:u(Ie,{kind:"ghost",className:"btn-reset",onClick:b,children:"Reset"})}),u(Ie,{kind:"ghost",className:z({active:l===1}),icon:Go,tooltip:"Sort ascending",onClick:()=>a(1)}),u(Ie,{kind:"ghost",className:z({active:l===2}),icon:qo,tooltip:"Sort descending",onClick:()=>a(2)})]})}),u("div",{className:"aggregation-edit-item-list",children:u(jt,{itemCount:p.length,items:g,offset:s,renderItem:({item:v})=>u(It,{checked:m(v.value),children:v.displayValue}),onSelect:f,onViewportChange:C,rowHeight:Mh,focusSelector:"input",ref:h})})]})};function Nh(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:T("g",{fill:"none",fillRule:"evenodd",children:[u("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),u("path",{fill:"#7DA4FF",d:"M8 26h4v15H8zM15 17h4v24h-4zM22 21h4v20h-4zM29 17h4v24h-4zM36 11h4v30h-4z"})]})})}function Fh(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:T("g",{fill:"none",fillRule:"evenodd",children:[u("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),u("path",{fill:"#7DA4FF",d:"M7 34h4v8H7zM12 31h4v11h-4zM17 27h4v15h-4zM22 22h4v20h-4zM27 27h4v15h-4zM32 29h4v13h-4zM37 31h4v11h-4z"})]})})}function xh(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:T("g",{fill:"none",fillRule:"evenodd",children:[u("path",{fill:"#C1C0C0",d:"M4 4h1v40H4zM44 43v1H5v-1z"}),u("path",{stroke:"#7DA4FF",d:"M7.984 32.44l7.982-11.378 5.273 3.739 9.952-10.838 2.826 1.894 7.45-5.802"}),u("path",{stroke:"#BECDEF",d:"M8.244 37.926L17 33.496l5 .87 10.637-10.35 10.615-1.381"})]})})}function Oh(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:T("g",{fill:"none",fillRule:"evenodd",children:[u("path",{d:"M24 10c7.732 0 14 6.268 14 14s-6.268 14-14 14-14-6.268-14-14h14V10z",fill:"#80A6FF"}),u("path",{d:"M10 24c0-7.732 6.268-14 14-14v14H10z",fill:"#C1C0C0"})]})})}function Ah(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:T("g",{fill:"none",fillRule:"evenodd",children:[u("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),u("path",{fill:"#939293",d:"M44 34v1H4v-1zM44 25v1H4v-1zM44 16v1H4v-1z"}),u("circle",{fill:"#7DA4FF",cx:9.5,cy:37.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:16.5,cy:30.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:22.5,cy:36.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:28.5,cy:30.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:15.5,cy:38.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:23.5,cy:25.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:19.5,cy:19.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:29.5,cy:19.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:32.5,cy:26.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:36.5,cy:13.5,r:1.5})]})})}function kh(e){return T("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u("rect",{width:"48",height:"48",fill:"none"}),u("rect",{x:"26",y:"10",width:"15",height:"4",fill:"#9FDE70"}),u("rect",{x:"26",y:"22",width:"15",height:"4",fill:"#9FDE70"}),u("rect",{x:"26",y:"28",width:"15",height:"4",fill:"#FFD95C"}),u("rect",{x:"26",y:"34",width:"15",height:"4",fill:"#9FDE70"})]})}function Lh(e){return T("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u("rect",{width:"48",height:"48",fill:"none"}),u("rect",{x:"4",y:"16",width:"40",height:"4",fill:"#FFD95C"}),u("rect",{x:"4",y:"10",width:"40",height:"4",fill:"#78DCE8"}),u("rect",{x:"4",y:"34",width:"40",height:"4",fill:"#78DCE8"})]})}const Kr=te.module("ChartBuilder"),Ke=class extends R.exports.PureComponent{static getTypeName(e){switch(e){case y.plot.SeriesPlotStyle.LINE:return"Line";case y.plot.SeriesPlotStyle.BAR:return"Bar";case y.plot.SeriesPlotStyle.SCATTER:return"Scatter";case y.plot.SeriesPlotStyle.PIE:return"Pie";case y.plot.SeriesPlotStyle.HISTOGRAM:return"Histogram";default:return e}}static getTypeIcon(e){switch(e){case y.plot.SeriesPlotStyle.LINE:return u(xh,{});case y.plot.SeriesPlotStyle.BAR:return u(Nh,{});case y.plot.SeriesPlotStyle.SCATTER:return u(Ah,{});case y.plot.SeriesPlotStyle.PIE:return u(Oh,{});case y.plot.SeriesPlotStyle.HISTOGRAM:return u(Fh,{});default:return null}}static getMaxSeriesCount(e){switch(e){case y.plot.SeriesPlotStyle.PIE:return 1;case y.plot.SeriesPlotStyle.HISTOGRAM:return 0;default:return 100}}static getXAxisLabel(e){switch(e){case y.plot.SeriesPlotStyle.PIE:return"Labels";case y.plot.SeriesPlotStyle.HISTOGRAM:return"Data";default:return"X-Axis"}}static getSeriesLabel(e){switch(e){case y.plot.SeriesPlotStyle.PIE:return"Values";default:return"Series"}}static makeSeriesItem(e){return{id:Qt.generate(),value:e}}static makeDefaultSeriesItems(e,t){if(Ke.getMaxSeriesCount(e)===0||t==null||t.length===0)return[];const s=t.length>1?t[1].name:t[0].name;return[Ke.makeSeriesItem(s)]}static getDefaultXAxis(e,t){return t!=null&&t.length>0?t[0].name:null}constructor(e){super(e),this.handleAddSeries=this.handleAddSeries.bind(this),this.handleLinkStateChange=this.handleLinkStateChange.bind(this),this.handleReset=this.handleReset.bind(this),this.handleSeriesChange=this.handleSeriesChange.bind(this),this.handleSeriesDeleteClick=this.handleSeriesDeleteClick.bind(this),this.handleSubmit=this.handleSubmit.bind(this),this.handleTypeClick=this.handleTypeClick.bind(this),this.handleXAxisChange=this.handleXAxisChange.bind(this),this.sendChange=this.sendChange.bind(this);const{model:t}=e,{columns:n}=t,s=Ke.types[0],i=Ke.getDefaultXAxis(s,n),o=Ke.makeDefaultSeriesItems(s,n);this.state={type:s,seriesItems:o,xAxis:i,isLinked:!0}}handleAddSeries(){this.setState(e=>{let{seriesItems:t}=e;t=[...t];const{model:n}=this.props,{columns:s}=n;return t.push({id:Qt.generate(),value:s[0].name}),{seriesItems:t}},this.sendChange)}handleLinkStateChange(e){this.setState({isLinked:e.target.value==="true"},this.sendChange)}handleReset(){const{model:e}=this.props,{columns:t}=e,n=Ke.types[0],s=Ke.getDefaultXAxis(n,t),i=Ke.makeDefaultSeriesItems(n,t),o=!0;this.setState({type:n,seriesItems:i,xAxis:s,isLinked:o},this.sendChange)}handleSeriesChange(e){const{value:t}=e.target,n=e.target.getAttribute("data-index"),s=parseInt(n,10);this.setState(i=>{let{seriesItems:o}=i;return o=[...o],o[s].value=t,{seriesItems:o}},this.sendChange)}handleSeriesDeleteClick(e){const n=e.target.getAttribute("data-index"),s=parseInt(n,10);this.setState(i=>{let{seriesItems:o}=i;return o=[...o],o.splice(s,1),{seriesItems:o}},this.sendChange)}handleSubmit(e){e.preventDefault();const{onSubmit:t}=this.props,{type:n,seriesItems:s,xAxis:i,isLinked:o}=this.state,r=s.map(l=>l.value);t({type:`${n}`,series:r,xAxis:i,isLinked:o})}handleTypeClick(e){const n=e.target.getAttribute("data-index"),s=parseInt(n,10),i=Ke.types[s];Kr.debug2("handleTypeSelect",i),this.setState(o=>{const r=Ke.getMaxSeriesCount(i);let{seriesItems:l}=o;if(l=l.slice(0,r),l.length===0&&r>0){const{model:a}=this.props,{columns:c}=a;l=Ke.makeDefaultSeriesItems(i,c)}return{type:i,seriesItems:l}},this.sendChange)}handleXAxisChange(e){const t=e.target.value;Kr.debug2("x-axis change",t),this.setState({xAxis:t},this.sendChange)}sendChange(){const{onChange:e}=this.props,{isLinked:t,type:n,seriesItems:s,xAxis:i}=this.state,o=s.map(r=>r.value);e({type:n,series:o,xAxis:i,isLinked:t})}render(){const{model:e}=this.props,{columns:t}=e,{seriesItems:n,type:s,xAxis:i,isLinked:o}=this.state,r=Ke.getMaxSeriesCount(s),l=Ke.getXAxisLabel(s),a=Ke.getSeriesLabel(s),c=n.length>0,d=n.length<r;return u("div",{className:"chart-builder",children:T("form",{onSubmit:this.handleSubmit,children:[T("div",{className:"form-row",children:[u("label",{children:"Select Chart Type"}),u("div",{className:"form-row",children:Ke.types.map((h,m)=>{const p=h;return u("div",{className:"col col-chart-type",children:T("button",{type:"button",className:z("btn","btn-icon","btn-chart-type",{active:h===s}),"data-index":m,onClick:this.handleTypeClick,children:[Ke.getTypeIcon(h),Ke.getTypeName(h)]})},p)})})]}),u("hr",{}),T("div",{className:"form-row form-inline",children:[u("label",{className:"col-2 label-left",children:l}),u("select",{className:"form-control custom-select select-x-axis col",value:i,onChange:this.handleXAxisChange,children:t.map(h=>u("option",{value:h.name,children:h.name},h.name))})]}),c&&u("hr",{}),n.map((h,m)=>T("div",{className:"form-row form-inline form-series-item","data-testid":`form-series-item-${m}`,children:[u("label",{className:"col-2 label-left",children:m===0?a:""}),u("select",{className:"form-control custom-select select-series col",value:h.value,onChange:this.handleSeriesChange,"data-testid":`select-series-item-${m}`,"data-index":m,children:t.map(p=>u("option",{value:p.name,"data-index":m,children:p.name},p.name))}),n.length>1&&u("button",{type:"button",className:"btn btn-link btn-link-icon btn-delete-series ml-2 px-2","data-index":m,"data-testid":`delete-series-${m}`,onClick:this.handleSeriesDeleteClick,children:u(G,{icon:Pn})})]},h.id)),d&&T("div",{className:"form-row",children:[u("div",{className:"col-2"}),T("button",{type:"button",className:"btn btn-link btn-add-series mt-1",onClick:this.handleAddSeries,children:[u(G,{icon:Rs}),"Add Series"]})]}),T("div",{className:"form-row chart-builder-link",children:[u("label",{className:"col-2 label-right",children:T("div",{className:"fa-md fa-layers",children:[u(G,{mask:Xo,icon:zo,transform:"right-5 down-5"}),u(G,{icon:o?Al:Nd,transform:"grow-2 right-8 down-6"})]})}),T(er,{onChange:this.handleLinkStateChange,value:`${o}`,children:[u(gn,{value:"true",children:"Sync State"}),u(gn,{value:"false",children:"Freeze State"})]})]}),T("div",{className:"form-row",children:[u("div",{className:"col-2 label-right"}),u("div",{className:"col chart-builder-link-info",children:o?"Charts with synced state will update to match any filters or user modifications applied to the parent table.":"Freeze State disconnects the chart state from the parent table. New filters or user modifications on the parent table will not be applied."})]}),T("div",{className:z("form-row","justify-content-end","my-3"),children:[u("button",{type:"button",className:"btn btn-outline-primary btn-reset",onClick:this.handleReset,children:"Reset"}),u("button",{type:"submit",className:"btn btn-primary btn-submit",children:"Create"})]})]})})}};let ra=Ke;ra.types=[y.plot.SeriesPlotStyle.LINE,y.plot.SeriesPlotStyle.BAR,y.plot.SeriesPlotStyle.SCATTER,y.plot.SeriesPlotStyle.PIE];class la extends R.exports.Component{constructor(t){super(t),this.handleContentChanged=this.handleContentChanged.bind(this),this.handleEditorFocus=this.handleEditorFocus.bind(this),this.handleEditorBlur=this.handleEditorBlur.bind(this),this.handleContainerClick=this.handleContainerClick.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.state={isEditorFocused:!1,isEditorEmpty:!0},this.editorContainer=null}componentDidMount(){this.initEditor()}componentWillUnmount(){this.destroyEditor()}initEditor(){var i;const{value:t,editorSettings:n}=this.props,s={copyWithSyntaxHighlighting:"false",fixedOverflowWidgets:!0,folding:!1,fontFamily:"Fira Mono",glyphMargin:!1,language:"groovyDB",lineDecorationsWidth:8,lineNumbers:"off",minimap:{enabled:!1},renderLineHighlight:"none",scrollbar:{arrowSize:0,horizontal:"hidden",horizontalScrollbarSize:0},scrollBeyondLastLine:!1,padding:{top:6,bottom:6},tabCompletion:"off",useTabStops:!0,value:t,wordWrap:"on",automaticLayout:!0,...n};if(!this.editorContainer)throw new Error("editorContainer is null");this.editor=pn.create(this.editorContainer,s),this.editor.layout(),(i=this.editor.getModel())==null||i.updateOptions({tabSize:0}),this.editor.onDidChangeModelContent(this.handleContentChanged),this.editor.onDidFocusEditorText(this.handleEditorFocus),this.editor.onDidBlurEditorText(this.handleEditorBlur)}destroyEditor(){var t;(t=this.editor)==null||t.dispose(),this.editor=void 0}handleContentChanged(){var s,i;const{onContentChanged:t}=this.props,n=(i=(s=this.editor)==null?void 0:s.getModel())==null?void 0:i.getValue();n&&this.setState({isEditorEmpty:n.length===0}),t(n)}handleEditorFocus(){this.setState({isEditorFocused:!0})}handleEditorBlur(){var n,s;const t=(s=(n=this.editor)==null?void 0:n.getModel())==null?void 0:s.getValue();if(!t)throw new Error("value is undefined");this.setState({isEditorEmpty:t.length===0,isEditorFocused:!1})}handleContainerClick(){var n;const{isEditorFocused:t}=this.state;t||(n=this.editor)==null||n.focus()}handleKeyDown(t){const{onTab:n,editorIndex:s}=this.props;t.key==="Tab"&&n(s,t.shiftKey)}render(){const{value:t,invalid:n}=this.props,{isEditorFocused:s,isEditorEmpty:i}=this.state;return T("div",{className:z("input-editor-wrapper",{focused:s,invalid:n}),onKeyDown:this.handleKeyDown,role:"presentation",onClick:this.handleContainerClick,children:[u("div",{className:"editor-container",ref:o=>{this.editorContainer=o}}),i&&!t&&u("div",{className:"editor-placeholder text-muted",children:"Column Formula"})]})}}la.defaultProps={value:"",onContentChanged:()=>{},editorSettings:{},editorIndex:0,onTab:()=>{},invalid:!1};const ko=class extends R.exports.PureComponent{constructor(e){super(e),this.handleFormulaEditorContentChanged=this.handleFormulaEditorContentChanged.bind(this)}handleFormulaEditorContentChanged(e){const{onChange:t,eventKey:n}=this.props;e&&(e.replace(/(\r\n|\n|\r)/gm,""),t(n,ko.INPUT_TYPE.FORMULA,e))}render(){const{eventKey:e,name:t,formula:n,onChange:s,onDeleteColumn:i,inputIndex:o,onTabInEditor:r,invalid:l}=this.props;return u(Wi,{draggableId:e,index:o,disableInteractiveElementBlocking:!0,children:(a,c)=>T("div",{className:z("draggable-container",{dragging:c.isDragging}),ref:a.innerRef,...a.draggableProps,children:[T("div",{className:"custom-column-input-container",children:[T("div",{className:"d-flex flex-row pb-3 custom-column-name",children:[u("input",{className:z("form-control custom-column-input",{"is-invalid":l}),placeholder:"Column Name",value:t,onChange:d=>{s(e,ko.INPUT_TYPE.NAME,d.target.value)}}),T("button",{type:"button",className:"btn btn-link btn-link-icon ml-1 px-2",onClick:()=>{i(e)},children:[u(me,{children:"Delete custom column"}),u(G,{icon:Pn})]}),T("button",{type:"button",className:"btn btn-link btn-link-icon px-2 btn-drag-handle",...a.dragHandleProps,children:[u(me,{children:"Drag column to re-order"}),u(G,{icon:Gi})]})]}),u(la,{editorSettings:{language:"deephavenDb"},editorIndex:o,value:n,onContentChanged:this.handleFormulaEditorContentChanged,onTab:r,invalid:l})]}),u("hr",{})]})})}};let ir=ko;ir.INPUT_TYPE={NAME:"name",FORMULA:"formula"};ir.defaultProps={name:"",inputIndex:0,formula:"",onChange:()=>{},onDeleteColumn:()=>{},onTabInEditor:()=>{},invalid:!1};class aa extends Error{constructor(){super(...arguments),this.isAssertionFailed=!0}}function Xr(e){if(e==null)throw new aa(`Expected 'val' to be defined, but received ${e}`)}class bo extends Error{constructor(){super(...arguments),this.isPasteError=!0}}function Ae(e){return(e==null?void 0:e.isEditable)!==void 0}function Yr(e){if(!Ae(e))throw new aa(`Expected 'model' to be editable, but received ${e}`)}function Xe(e){return(e==null?void 0:e.hasExpandableRows)!==void 0}var Lt=(e=>(e.DOWN="DOWN",e.UP="UP",e.LEFT="LEFT",e.RIGHT="RIGHT",e))(Lt||{});const de=class{static normalize(e,t,n,s){let i=e,o=t,r=n,l=s;return i!=null&&r!=null&&r<i&&(i=r,r=e),o!=null&&l!=null&&l<o&&(o=l,l=t),[i,o,r,l]}static makeNormalized(e,t,n,s){return new de(...de.normalize(e,t,n,s))}static makeCell(e,t){return new de(e,t,e,t)}static makeColumn(e){return new de(e,null,e,null)}static makeRow(e){return new de(null,e,null,e)}static minOrNull(e,t){return e==null||t==null?null:Math.min(e,t)}static maxOrNull(e,t){return e==null||t==null?null:Math.max(e,t)}static consolidate(e){const t=e.slice();let n=!0;for(;n;){n=!1;for(let s=0;s<t.length&&!n;s+=1){const i=t[s];for(let o=t.length-1;o>s;o-=1){const r=t[o];if(i.contains(r))t.splice(o,1);else if(r.contains(i)){n=!0,t[s]=r,t.splice(o,1);break}else if(i.startRow===r.startRow&&i.endRow===r.endRow){if(i.touches(r)){const{startRow:l,endRow:a}=i,c=de.minOrNull(i.startColumn,r.startColumn),d=de.maxOrNull(i.endColumn,r.endColumn);n=!0,t[s]=new de(c,l,d,a),t.splice(o,1);break}}else if(i.startColumn===r.startColumn&&i.endColumn===r.endColumn&&i.touches(r)){const{startColumn:l,endColumn:a}=i,c=de.minOrNull(i.startRow,r.startRow),d=de.maxOrNull(i.endRow,r.endRow);n=!0,t[s]=new de(l,c,a,d),t.splice(o,1);break}}}}return t}static isAxisRangeTouching(e,t,n,s){return e==null?t==null||n==null?!0:n<=t+1:t==null?s==null?!0:s>=e-1:n==null?s==null?!0:e<=s+1:s==null?t>=n-1:n>=e-1?n<=t+1:s>=e-1}static rangeArraysEqual(e,t){if(e===t)return!0;if(e==null||t==null||e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!e[n].equals(t[n]))return!1;return!0}static intersection(e,t){if(e.equals(t))return e;let{startColumn:n,startRow:s,endColumn:i,endRow:o}=e;return n=n!=null&&t.startColumn!=null?Math.max(n,t.startColumn):n!=null?n:t.startColumn,i=i!=null&&t.endColumn!=null?Math.min(i,t.endColumn):i!=null?i:t.endColumn,s=s!=null&&t.startRow!=null?Math.max(s,t.startRow):s!=null?s:t.startRow,o=o!=null&&t.endRow!=null?Math.min(o,t.endRow):o!=null?o:t.endRow,n!=null&&n>(i!=null?i:-1)||s!=null&&s>(o!=null?o:-1)?null:new de(n,s,i,o)}static subtractFromRange(e,t){const n=[],s=de.intersection(e,t);return s==null?[e]:(s.startRow!=null&&(e.startRow==null||e.startRow<s.startRow)&&n.push(new de(e.startColumn,e.startRow,e.endColumn,s.startRow-1)),s.startColumn!=null&&(e.startColumn==null||e.startColumn<s.startColumn)&&n.push(new de(e.startColumn,s.startRow,s.startColumn-1,s.endRow)),s.endColumn!=null&&(e.endColumn==null||e.endColumn>s.endColumn)&&n.push(new de(s.endColumn+1,s.startRow,e.endColumn,s.endRow)),s.endRow!=null&&(e.endRow==null||e.endRow>s.endRow)&&n.push(new de(e.startColumn,s.endRow+1,e.endColumn,e.endRow)),n)}static subtractFromRanges(e,t){const n=[];for(let s=0;s<e.length;s+=1)n.push(...de.subtractFromRange(e[s],t));return n}static subtractRangesFromRanges(e,t){if(!t||t.length===0)return e;let n=[...e];for(let s=0;s<t.length;s+=1)n=de.subtractFromRanges(n,t[s]);return n}static isBounded(e){return e.startRow!=null&&e.startColumn!=null&&e.endRow!=null&&e.endColumn!=null}static boundedRange(e,t,n){var s,i,o,r;return de.isBounded(e)?e:new de((s=e.startColumn)!=null?s:0,(i=e.startRow)!=null?i:0,(o=e.endColumn)!=null?o:t-1,(r=e.endRow)!=null?r:n-1)}static boundedRanges(e,t,n){return e.map(s=>de.boundedRange(s,t,n))}static offset(e,t,n){return new de(e.startColumn!=null?e.startColumn+t:null,e.startRow!=null?e.startRow+n:null,e.endColumn!=null?e.endColumn+t:null,e.endRow!=null?e.endRow+n:null)}static nextCell(e,t=null,n=null,s=de.SELECTION_DIRECTION.DOWN){if(e.length===0)return null;let i=-1;if(t!=null&&n!=null&&(i=e.findIndex(o=>o.containsCell(t,n)),i>=0)){const r=e[i].nextCell(t,n,s);if(r!=null)return r}switch(s){case de.SELECTION_DIRECTION.DOWN:case de.SELECTION_DIRECTION.RIGHT:{const o=i<e.length-1?i+1:0;return e[o].startCell(s)}case de.SELECTION_DIRECTION.LEFT:case de.SELECTION_DIRECTION.UP:{const o=i>0?i-1:e.length-1;return e[o].startCell(s)}default:throw new Error(`Invalid direction: ${s}`)}}static cellCount(e){return e.reduce((t,n)=>{var s,i,o,r;return t+(((s=n.endRow)!=null?s:NaN)-((i=n.startRow)!=null?i:NaN)+1)*(((o=n.endColumn)!=null?o:NaN)-((r=n.startColumn)!=null?r:NaN)+1)},0)}static rowCount(e){return e.reduce((t,n)=>{var s,i;return t+((s=n.endRow)!=null?s:NaN)-((i=n.startRow)!=null?i:NaN)+1},0)}static columnCount(e){return e.reduce((t,n)=>{var s,i;return t+((s=n.endColumn)!=null?s:NaN)-((i=n.startColumn)!=null?i:NaN)+1},0)}static containsCell(e,t,n){for(let s=0;s<e.length;s+=1)if(e[s].containsCell(t,n))return!0;return!1}static forEachCell(e,t,n=de.SELECTION_DIRECTION.RIGHT){for(let s=0;s<e.length;s+=1)e[s].forEach(t,n)}constructor(e,t,n,s){this.startColumn=e,this.startRow=t,this.endColumn=n,this.endRow=s}equals(e){return this.startColumn===e.startColumn&&this.startRow===e.startRow&&this.endColumn===e.endColumn&&this.endRow===e.endRow}contains(e){return(this.startColumn==null||e.startColumn!=null&&this.startColumn<=e.startColumn)&&(this.startRow==null||e.startRow!=null&&this.startRow<=e.startRow)&&(this.endColumn==null||e.endColumn!=null&&this.endColumn>=e.endColumn)&&(this.endRow==null||e.endRow!=null&&this.endRow>=e.endRow)}containsCell(e,t){return e==null||t==null?!1:(this.startColumn==null||this.startColumn<=e)&&(this.endColumn==null||this.endColumn>=e)&&(this.startRow==null||this.startRow<=t)&&(this.endRow==null||this.endRow>=t)}touches(e){return de.isAxisRangeTouching(this.startRow,this.endRow,e.startRow,e.endRow)&&de.isAxisRangeTouching(this.startColumn,this.endColumn,e.startColumn,e.endColumn)}subtract(e){return de.subtractFromRange(this,e)}startCell(e=de.SELECTION_DIRECTION.DOWN){if(!de.isBounded(this))throw new Error("Cannot get the startCell of an unbounded range");switch(e){case de.SELECTION_DIRECTION.DOWN:case de.SELECTION_DIRECTION.RIGHT:return{column:this.startColumn,row:this.startRow};case de.SELECTION_DIRECTION.LEFT:case de.SELECTION_DIRECTION.UP:return{column:this.endColumn,row:this.endRow};default:throw new Error(`Invalid direction: ${e}`)}}nextCell(e,t,n){if(!de.isBounded(this))throw new Error("Bounded range required");if(e==null||t==null)throw new Error("Require a non-null cursor");const{startColumn:s,endColumn:i,startRow:o,endRow:r}=this;switch(n){case de.SELECTION_DIRECTION.DOWN:if(t<r)return{column:e,row:Math.max(t+1,o)};if(e<i)return{column:Math.max(e+1,s),row:o};break;case de.SELECTION_DIRECTION.UP:if(t>o)return{column:e,row:Math.min(t-1,r)};if(e>s)return{column:Math.min(e-1,i),row:r};break;case de.SELECTION_DIRECTION.RIGHT:if(e<i)return{column:Math.max(e+1,s),row:t};if(t<r)return{column:s,row:Math.max(t+1,o)};break;case de.SELECTION_DIRECTION.LEFT:if(e>s)return{column:Math.min(e-1,i),row:t};if(t>o)return{column:i,row:Math.min(t-1,r)};break;default:throw new Error(`Invalid direction: ${n}`)}return null}forEach(e,t=de.SELECTION_DIRECTION.RIGHT){var o;let n=0,{column:s,row:i}=this.startCell(t);for(;s!=null&&i!=null;)e(s,i,n),n+=1,{column:s,row:i}=(o=this.nextCell(s,i,t))!=null?o:{}}};let Y=de;Y.SELECTION_DIRECTION=Lt;function Ph(e){return Array.isArray(e)&&e.length===2&&(e[0]===null||typeof e[0]=="number")&&(e[1]===null||typeof e[1]=="number")}function wo(e){return Ph(e)&&e[0]!=null&&e[1]!=null}const Ce=class{static getGridPointFromXY(e,t,n){const s=Ce.getColumnAtX(e,n),i=Ce.getRowAtY(t,n),o=Ce.getColumnHeaderDepthAtY(t,n);return{x:e,y:t,row:i,column:s,columnHeaderDepth:o}}static getCellInfoFromXY(e,t,n){const{row:s,column:i}=Ce.getGridPointFromXY(e,t,n),{visibleColumnWidths:o,visibleRowHeights:r,visibleColumnXs:l,visibleRowYs:a,modelColumns:c,modelRows:d}=n,h=s!==null?d.get(s):null,m=i!==null?c.get(i):null,p=i!==null?l.get(i):null,g=s!==null?a.get(s):null,f=i!==null?o.get(i):null,b=s!==null?r.get(s):null;return{row:s,column:i,modelRow:h!=null?h:null,modelColumn:m!=null?m:null,left:p!=null?p:null,top:g!=null?g:null,columnWidth:f!=null?f:null,rowHeight:b!=null?b:null}}static getColumnHeaderDepthAtY(e,t){const n=Ce.getRowAtY(e,t),{columnHeaderHeight:s,columnHeaderMaxDepth:i}=t;if(n===null&&e<=s*i)return lt(i-Math.ceil(e/s),0,i-1)}static iterateFloatingStart(e,t,n){for(let s=0;s<e&&s<t;s+=1){const i=n(s);if(i!==void 0)return i}}static iterateFloatingEnd(e,t,n){for(let s=0;s<e&&t-(e-s)>=0;s+=1){const i=n(t-(e-s));if(i!==void 0)return i}}static iterateFloating(e,t,n,s){const i=Ce.iterateFloatingStart(e,n,s);return i!==void 0?i:Ce.iterateFloatingEnd(t,n,s)}static iterateAllItems(e,t,n,s,i,o){const r=Math.max(e,n),l=Math.min(t,i-s-1);let a=Ce.iterateFloating(n,s,i,o);if(a!==void 0)return a;for(let c=r;c<=l;c+=1)if(a=o(c),a!==void 0)return a}static isInItem(e,t,n,s){var r,l;const i=(r=t.get(e))!=null?r:0,o=(l=n.get(e))!=null?l:0;return i<=s&&s<=i+o}static getItemAtOffset(e,t,n,s,i,o,r,l=!1){const a=l?void 0:Ce.iterateFloating(n,s,t,c=>{if(Ce.isInItem(c,o,r,e))return c});if(!l&&a!==void 0)return a;for(let c=0;c<i.length;c+=1){const d=i[c];if(Ce.isInItem(d,o,r,e))return d}return null}static getColumnAtX(e,t,n=!1){const{columnCount:s,floatingLeftColumnCount:i,floatingRightColumnCount:o,visibleColumns:r,visibleColumnXs:l,visibleColumnWidths:a,gridX:c}=t;return e<c?null:this.getItemAtOffset(e-c,s,i,o,r,l,a,n)}static getRowAtY(e,t){const{floatingTopRowCount:n,floatingBottomRowCount:s,rowCount:i,visibleRows:o,visibleRowYs:r,visibleRowHeights:l,gridY:a}=t;return e<a?null:this.getItemAtOffset(e-a,i,n,s,o,r,l)}static getNextShownItem(e,t,n,s){let i=n.findIndex(o=>o===e)||0;for(i-=1;i!=null&&i>=0;){const o=n[i],r=t.get(o);if(r!=null&&s.get(r)!==0)return o;i-=1}return null}static getNextShownColumn(e,t){const{modelColumns:n,visibleColumns:s,userColumnWidths:i}=t;return Ce.getNextShownItem(e,n,s,i)}static getNextShownRow(e,t){const{modelRows:n,visibleRows:s,userRowHeights:i}=t;return Ce.getNextShownItem(e,n,s,i)}static getColumnSeparatorIndex(e,t,n,s){var C,w,S,I;const{rowHeaderWidth:i,columnHeaderHeight:o,floatingColumns:r,floatingLeftWidth:l,visibleColumns:a,visibleColumnXs:c,visibleColumnWidths:d,columnHeaderMaxDepth:h}=n,{allowColumnResize:m,headerSeparatorHandleSize:p}=s;if(h*o<t||!m||p<=0)return null;const g=e-i,f=p*.5;let b=!1;for(let v=r.length-1;v>=0;v-=1){const E=r[v],M=(C=c.get(E))!=null?C:0,F=(w=d.get(E))!=null?w:0,k=F===0;if(!b||!k){let P=M+F;k?P+=f:b&&(P-=f);const L=P-f,N=P+f;if(L<=g&&g<=N)return E;b=k}}b=!1;for(let v=a.length-1;v>=0;v-=1){const E=a[v],M=(S=c.get(E))!=null?S:0,F=(I=d.get(E))!=null?I:0,k=F===0;if(M<l-F)return null;if(!b||!k){let P=M+F;k?P+=f:b&&(P-=f);const L=P-f,N=P+f;if(L<=g&&g<=N)return E;b=k}}return null}static isItemHidden(e,t){return t.get(e)===0}static isColumnHidden(e,t){const{visibleColumnWidths:n}=t;return Ce.isItemHidden(e,n)}static isFloatingRow(e,t){if(e==null)return!1;const{floatingTopRowCount:n,floatingBottomRowCount:s,rowCount:i}=t;return e<n||e>=i-s}static isFloatingColumn(e,t){if(e==null)return!1;const{floatingLeftColumnCount:n,floatingRightColumnCount:s,columnCount:i}=t;return e<n||e>=i-s}static getHiddenItems(e,t,n){if(!Ce.isItemHidden(e,t))return[];const s=[e],i=n.findIndex(o=>o===e);for(let o=i-1;o>=0;o-=1){const r=n[o];if(!Ce.isItemHidden(r,t))break;s.push(r)}return s}static getHiddenColumns(e,t){const{visibleColumns:n,visibleColumnWidths:s}=t;return Ce.getHiddenItems(e,s,n)}static getRowSeparatorIndex(e,t,n,s){var g,f;const{rowHeaderWidth:i,columnHeaderHeight:o,visibleRows:r,visibleRowYs:l,visibleRowHeights:a}=n,{allowRowResize:c,headerSeparatorHandleSize:d}=s;if(i<e||!c||d<=0)return null;const h=t-o,m=d*.5;let p=!1;for(let b=r.length-1;b>=0;b-=1){const C=r[b],w=(g=l.get(C))!=null?g:0,S=(f=a.get(C))!=null?f:0,I=S===0;if(!p||!I){let v=w+S;I?v+=m:p&&(v-=m);const E=v-m,M=v+m;if(E<=h&&h<=M)return C;p=I}}return null}static isRowHidden(e,t){const{visibleRowHeights:n}=t;return Ce.isItemHidden(e,n)}static getHiddenRows(e,t){const{visibleRows:n,visibleRowHeights:s}=t;return Ce.getHiddenItems(e,s,n)}static moveItem(e,t,n){if(e===t)return n;const s=[...n],i=s[s.length-1];return i&&!wo(i.from)&&i.to===e?i.from===t?s.pop():s[s.length-1]={...i,to:t}:s.push({from:e,to:t}),s}static moveRange(e,t,n){if(e[0]===t)return n;const s=[...n],i=s[s.length-1];return i&&wo(i.from)&&i.from[1]-i.from[0]===e[1]-e[0]&&i.to===e[0]?i.from[0]===t?s.pop():s[s.length-1]={...i,to:t}:s.push({from:e,to:t}),s[s.length-1].from===s[s.length-1].to&&s.pop(),s}static applyItemMoves(e,t,n,s=!1){var o,r;let i=[[e,t]];for(let l=s?n.length-1:0;s?l>=0:l<n.length;s?l-=1:l+=1){const{from:a,to:c}=n[l];let d=1,h;wo(a)?(d=a[1]-a[0]+1,[h]=a):h=a;const m=s?c:h,p=m+d-1,g=s?h:c,f=g-m,b=[];for(let C=0;C<i.length;C+=1){const w=(o=i[C][0])!=null?o:Number.NEGATIVE_INFINITY,S=(r=i[C][1])!=null?r:Number.POSITIVE_INFINITY;let I;const v=[[w,m-1],[m,p],[p+1,S]].map(([E,M])=>[Math.max(E,w),Math.min(M,S)]).filter(([E,M])=>E<=M).map(E=>{const[M,F]=E;return m<=M&&p>=F?(I=[M+f,F+f],I):p<M?[M-d,F-d]:E}).map(E=>{const[M,F]=E;return g>M&&g<=F?[[M,g-1],[g+d,F+d]]:E===I?[E]:g<=M?[[M+d,F+d]]:[E]}).flat();b.push(...v)}i=b.map(([C,w])=>[Number.isFinite(C)?C:null,Number.isFinite(w)?w:null])}return i}static translateRange(e,t,n,s){const i=Ce.applyItemMoves(e.startColumn,e.endColumn,t,s),o=Ce.applyItemMoves(e.startRow,e.endRow,n,s),r=[];for(let l=0;l<i.length;l+=1){const a=i[l];for(let c=0;c<o.length;c+=1){const d=o[c];r.push(new Y(a[0],d[0],a[1],d[1]))}}return r}static getModelIndex(e,t){return Ce.applyItemMoves(e,e,t,!0)[0][0]}static getModelIndexes(e,t){return e.map(n=>Ce.getModelIndex(n,t))}static getModelRangeIndexes(e,t,n){return Ce.applyItemMoves(e,t,n,!0)}static getModelRange(e,t=[],n=[]){return Ce.translateRange(e,t,n,!0)}static getModelRanges(e,t=[],n=[]){const s=[];for(let i=0;i<e.length;i+=1)s.push(...Ce.getModelRange(e[i],t,n));return s}static getVisibleRangeIndexes(e,t,n){return Ce.applyItemMoves(e,t,n,!1)}static getVisibleRange(e,t=[],n=[]){return this.translateRange(e,t,n,!1)}static getVisibleRanges(e,t=[],n=[]){const s=[];for(let i=0;i<e.length;i+=1)s.push(...Ce.getVisibleRange(e[i],t,n));return s}static getVisibleIndex(e,t){return Ce.applyItemMoves(e,e,t)[0][0]}static getVisibleIndexes(e,t){return e.map(n=>Ce.getVisibleIndex(n,t))}static isMacPlatform(){const{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return Ce.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){const t=Ce.getModifierKey();return e[t]}static checkColumnHidden(e,t){return t.get(e)===0}static checkAllColumnsHidden(e,t){return t.size===0?!1:e.every(n=>t.get(n)===0)}static getScrollDragBounds(e,t,n){const{gridX:s,gridY:i,width:o,height:r,floatingTopRowCount:l,floatingBottomRowCount:a,floatingLeftColumnCount:c,floatingRightColumnCount:d,floatingLeftWidth:h,floatingRightWidth:m,floatingTopHeight:p,floatingBottomHeight:g,columnCount:f,rowCount:b}=e;let C=s,w=i,S=o,I=r;return n!=null&&(n>c&&(C+=h),n<f-d&&(S-=m)),t!=null&&(t>l&&(w+=p),t<b-a&&(I-=g)),{x1:C,y1:w,x2:S,y2:I}}static getScrollDelta(e,t=1024,n=768,s=20,i=20){let{deltaX:o,deltaY:r}=e;return!Ce.isMacPlatform()&&e.shiftKey&&e.deltaX===0&&e.deltaY!==0&&(o=e.deltaY,r=e.deltaX),(e==null?void 0:e.deltaMode)===WheelEvent.DOM_DELTA_PAGE?(o*=t,r*=n):(e==null?void 0:e.deltaMode)===WheelEvent.DOM_DELTA_LINE&&(Ce.isMacPlatform()?(o=Math.round(o*s),r=Math.round(r*i)):(o=Math.round(o*this.PIXELS_PER_LINE),r=Math.round(r*this.PIXELS_PER_LINE))),{deltaX:o,deltaY:r}}static compareRanges(e,t){return e[0]==null||e[1]==null||t[0]==null||t[1]==null?0:e[0]!==t[0]?e[0]-t[0]:e[1]-t[1]}static mergeSortedRanges(e){const t=[];for(let n=0;n<e.length;n+=1){const s=e[n],i=s[0],o=s[1];n===0?t.push([i,o]):i-1<=t[t.length-1][1]?t[t.length-1][1]=Math.max(t[t.length-1][1],o):t.push([i,o])}return t}};let V=Ce;V.PIXELS_PER_LINE=100/3;function A(e,t,n=void 0){var i;const s=(i=e.get(t))!=null?i:n;if(s!==void 0)return s;throw new Error(`Missing value for key ${t}`)}function bi(e,t=Qs.CACHE_SIZE,n=Math.floor(t/2)){if(e.size>t){const s=e.keys();for(;e.size>n;)e.delete(s.next().value)}}function Qr(e,t,n,s,i){const o=new Map;let r=0;for(let l=0;l<e&&l<n;l+=1)o.set(l,r),r+=A(i,l);r=s;for(let l=0;l<t&&n-l-1>=0;l+=1)r-=A(i,n-l-1),o.set(n-l-1,r);return o}const ca=class{constructor({userColumnWidths:e=new Map,userRowHeights:t=new Map,calculatedColumnWidths:n=new Map,calculatedRowHeights:s=new Map,fontWidths:i=new Map,modelRows:o=new Map,modelColumns:r=new Map,movedRows:l=[],movedColumns:a=[]}={}){this.userColumnWidths=e,this.userRowHeights=t,this.calculatedRowHeights=s,this.calculatedColumnWidths=n,this.fontWidths=i,this.modelRows=o,this.modelColumns=r,this.movedRows=l,this.movedColumns=a}getMetrics(e){const{left:t,top:n,leftOffset:s,topOffset:i,width:o,height:r,theme:l,model:a,movedRows:c,movedColumns:d,draggingColumn:h}=e,{rowHeight:m,rowHeaderWidth:p,rowFooterWidth:g,columnWidth:f,columnHeaderHeight:b,minScrollHandleSize:C,scrollBarSize:w}=l;c!==this.movedRows&&(this.movedRows=c,this.modelRows.clear()),d!==this.movedColumns&&(this.movedColumns=d,this.modelColumns.clear());const{columnCount:S,rowCount:I,floatingTopRowCount:v,floatingBottomRowCount:E,floatingLeftColumnCount:M,floatingRightColumnCount:F,columnHeaderMaxDepth:k}=a,P=this.getFirstRow(e),L=this.getFirstColumn(e),N=this.getGridX(e),B=this.getGridY(e),U=Xe(a)&&a.hasExpandableRows?this.calculateTreePaddingX(e):0,H=0;let _=this.getVisibleRowHeights(e),$=this.getVisibleColumnWidths(e,L,U);const K=Array.from(_.keys()),j=Array.from($.keys());_=new Map([..._,...this.getFloatingRowHeights(e)]),$=new Map([...$,...this.getFloatingColumnWidths(e)]);let re=this.getVisibleColumnXs($,j,s),ne=this.getVisibleRowYs(_,K,i);const ge=K.length>0?K[K.length-1]:n,ce=j.length>0?j[j.length-1]:t,Fe=this.getBottomViewport(e,K,ne,_),Ye=this.getRightViewport(e,j,re,$),$e=this.getFloatingTopHeight(e,_),_e=this.getFloatingBottomHeight(e,_),Ue=this.getFloatingLeftWidth(e,$),Je=this.getFloatingRightWidth(e,$),Le=Array.from($.values()),Ht=Array.from(_.values()),Vn=Le.reduce((We,ps)=>We+ps,0)-s,Jt=Ht.reduce((We,ps)=>We+ps,0)-i,st=this.getLastLeft(e,null,o-N-w-g),pe=this.getLastTop(e,null,r-B-w-_e),Ge=s+Vn+g,Be=i+Jt,ut=o-N,Mt=r-B,Dt=st>0||Ge>ut,mt=Dt?w:0,Un=pe>0||Be>Mt-mt,Nt=Un?w:0,Ft=o-p-Nt,Bn=r-b-mt,to=p,no=b,so=S===1?Ft/Ge:(S-st)/S,ti=I===1?Bn/Be:(I-pe)/I,ni=Dt?lt(Ft*so,C,Ft-1):0,si=Un?lt(Bn*ti,C,Bn-1):0,ii=A($,t,0),oi=A(_,n,0),ri=ii>0?s/ii:0,li=oi>0?i/oi:0,io=S===1?s/(Ge-ut):(t+ri)/st,oo=I===1?i/(Be-Mt):(n+li)/pe,Wn=Dt?io*(Ft-ni):0,ro=Un?oo*(Bn-si):0;let ms=[];(v>0||E>0)&&(ms=[...Array(v).keys(),...[...Array(E).keys()].map(We=>I-We-1)],ne=new Map([...ne,...this.getFloatingRowYs(e,_,Math.floor(r-B-mt))]));let xs=[];(M>0||F>0)&&(xs=[...Array(M).keys(),...[...Array(F).keys()].map(We=>S-We-1)],re=new Map([...re,...this.getFloatingColumnXs(e,$,Math.floor(o-N-Nt))]));const ai=[];if(h)for(let We=h.range[0];We<=h.range[1];We+=1)ai.push(We),$.has(We)||$.set(We,this.getVisibleColumnWidth(We,e)),re.has(We)||re.set(We,0);const ci=K.concat(ms),Os=j.concat(xs).concat(ai),As=this.getModelRows(ci,e),lo=this.getModelColumns(Os,e),ao=this.getVisibleRowTreeBoxes(_,As,e),di=this.getTopVisible(e,ne,_,K),co=this.getLeftVisible(e,re,$,j),hi=pe>0?this.getBottomVisible(e,ne,_,K,B):ge,ui=st>0?this.getRightVisible(e,re,$,j,N):ce,{fontWidths:mi,userColumnWidths:pi,userRowHeights:gi,calculatedRowHeights:ho,calculatedColumnWidths:uo}=this;return{rowHeight:m,rowHeaderWidth:p,rowFooterWidth:g,rowCount:I,columnWidth:f,columnCount:S,columnHeaderHeight:b,floatingTopRowCount:v,floatingBottomRowCount:E,floatingLeftColumnCount:M,floatingRightColumnCount:F,gridX:N,gridY:B,firstRow:P,firstColumn:L,treePaddingX:U,treePaddingY:H,left:t,top:n,bottom:ge,right:ce,topOffset:i,leftOffset:s,topVisible:di,leftVisible:co,bottomVisible:hi,rightVisible:ui,bottomViewport:Fe,rightViewport:Ye,width:o,height:r,maxX:Vn,maxY:Jt,lastLeft:st,lastTop:pe,barHeight:Bn,barTop:no,barWidth:Ft,barLeft:to,handleHeight:si,handleWidth:ni,hasHorizontalBar:Dt,hasVerticalBar:Un,verticalBarWidth:Nt,horizontalBarHeight:mt,scrollX:Wn,scrollY:ro,scrollableContentWidth:Ge,scrollableContentHeight:Be,scrollableViewportWidth:ut,scrollableViewportHeight:Mt,visibleRows:K,visibleColumns:j,floatingRows:ms,floatingColumns:xs,allRows:ci,allColumns:Os,visibleRowHeights:_,visibleColumnWidths:$,floatingTopHeight:$e,floatingBottomHeight:_e,floatingLeftWidth:Ue,floatingRightWidth:Je,visibleRowYs:ne,visibleColumnXs:re,visibleRowTreeBoxes:ao,modelRows:As,modelColumns:lo,movedRows:c,movedColumns:d,fontWidths:mi,userColumnWidths:pi,userRowHeights:gi,calculatedRowHeights:ho,calculatedColumnWidths:uo,columnHeaderMaxDepth:k}}getGridX(e){const{theme:t}=e,{rowHeaderWidth:n}=t;return n}getGridY(e){const{theme:t,model:n}=e,{columnHeaderHeight:s}=t,{columnHeaderMaxDepth:i}=n;return i*s}getVisibleHeight(e,t=this.getFloatingRowHeights(e)){const{height:n,theme:s}=e,{scrollBarSize:i}=s,o=this.getGridY(e),r=this.getFloatingBottomHeight(e,t),l=this.getFloatingTopHeight(e,t);return n-r-l-o-i}getVisibleWidth(e,t=this.getFloatingColumnWidths(e)){const{width:n,theme:s}=e,{scrollBarSize:i,rowFooterWidth:o}=s,r=this.getGridX(e),l=this.getFloatingRightWidth(e,t),a=this.getFloatingLeftWidth(e,t);return n-a-l-r-i-o}getFirstIndex(e,t,n){const s=e.size+1;for(let i=0;i<s;i+=1){const o=t(i,n);if(e.get(o)!==0)return i}return 0}getFirstColumn(e){return this.getFirstIndex(this.userColumnWidths,this.getModelColumn.bind(this),e)}getFirstRow(e){return this.getFirstIndex(this.userRowHeights,this.getModelRow.bind(this),e)}getLastLeft(e,t=null,n=this.getVisibleWidth(e)){const{model:s}=e,{columnCount:i}=s;let o=i-1;t!=null&&(o=t);let r=0;for(;o>=0;){if(r+=this.getVisibleColumnWidth(o,e),r>=n)return Math.min(o+1,i-1);o-=1}return 0}getLastTop(e,t=null,n=this.getVisibleHeight(e)){const{model:s}=e,{rowCount:i,floatingBottomRowCount:o}=s;let r=Math.max(0,i-o-1);t!=null&&(r=t);let l=0;for(;r>0;){if(l+=this.getVisibleRowHeight(r,e),l>=n)return Math.min(r+1,i-1);r-=1}return 0}getTopForTopVisible(e,t){const n=this.getFloatingTopHeight(e);let s=t,i=0;for(;s>0&&i<n;)s-=1,i+=this.getVisibleRowHeight(s,e);return s}getTopForBottomVisible(e,t){const{height:n}=e,s=this.getGridY(e),i=this.getFloatingBottomHeight(e),o=n-s-i;return this.getLastTop(e,t,o)}getLeftForLeftVisible(e,t){const n=this.getFloatingLeftWidth(e);let s=t,i=0;for(;s>0&&i<n;)s-=1,i+=this.getVisibleColumnWidth(s,e);return s}getLeftForRightVisible(e,t){const{width:n}=e,s=this.getGridX(e),i=this.getFloatingRightWidth(e),o=n-s-i;return this.getLastLeft(e,t,o)}getFloatingRowHeights(e){const{model:t}=e,{floatingTopRowCount:n,floatingBottomRowCount:s,rowCount:i}=t,o=new Map;for(let r=0;r<n&&r<i;r+=1)o.set(r,this.getVisibleRowHeight(r,e));for(let r=0;r<s&&i-r-1>=0;r+=1){const l=i-r-1;o.set(l,this.getVisibleRowHeight(l,e))}return o}getVisibleRowHeights(e){const{top:t,topOffset:n,height:s,model:i}=e;let o=0,r=t;const l=new Map,{rowCount:a}=i;for(;o<s+n&&r<a;){const c=this.getVisibleRowHeight(r,e);l.set(r,c),o+=c,r+=1}return l}getFloatingColumnWidths(e,t=this.getFirstColumn(e),n=this.calculateTreePaddingX(e)){const{model:s}=e,{columnCount:i,floatingLeftColumnCount:o,floatingRightColumnCount:r}=s,l=new Map;for(let a=0;a<o&&a<i;a+=1)l.set(a,this.getVisibleColumnWidth(a,e,t,n));for(let a=0;a<r&&i-a-1>=0;a+=1){const c=i-a-1;l.set(c,this.getVisibleColumnWidth(c,e,t,n))}return l}getVisibleColumnWidths(e,t=this.getFirstColumn(e),n=this.calculateTreePaddingX(e)){const{left:s,leftOffset:i,width:o,model:r}=e;let l=0,a=s;const c=new Map,{columnCount:d}=r;for(;l<o+i&&a<d;){const h=this.getVisibleColumnWidth(a,e,t,n);c.set(a,h),l+=h,a+=1}return c}getFloatingColumnXs(e,t,n){const{model:s}=e,{columnCount:i,floatingLeftColumnCount:o,floatingRightColumnCount:r}=s;return Qr(o,r,i,n,t)}getVisibleColumnXs(e,t,n){const s=new Map;let i=-n;for(let o=0;o<t.length;o+=1){const r=t[o],l=A(e,r);s.set(r,i),i+=l}return s}getFloatingRowYs(e,t,n){const{model:s}=e,{floatingTopRowCount:i,floatingBottomRowCount:o,rowCount:r}=s;return Qr(i,o,r,n,t)}getVisibleRowYs(e,t,n){const s=new Map;let i=-n;for(let o=0;o<t.length;o+=1){const r=t[o],l=A(e,r);s.set(r,i),i+=l}return s}getVisibleRowTreeBoxes(e,t,n){const s=new Map,{model:i,theme:o}=n,{treeDepthIndent:r,treeHorizontalPadding:l}=o;return Xe(i)&&i.hasExpandableRows&&e.forEach((a,c)=>{const d=A(t,c);if(i.isRowExpandable(d)){const h=i.depthForRow(d),m=h*r+l,p=(h+1)*r+l,g=0,f=a;s.set(c,{x1:m,y1:g,x2:p,y2:f})}}),s}getFloatingLeftWidth(e,t=this.getFloatingColumnWidths(e)){const{model:n}=e,{floatingLeftColumnCount:s}=n;let i=0;for(let o=0;o<s;o+=1)i+=A(t,o);return i}getFloatingRightWidth(e,t=this.getFloatingColumnWidths(e)){const{model:n}=e,{floatingRightColumnCount:s,columnCount:i}=n;let o=0;for(let r=0;r<s;r+=1)o+=A(t,i-r-1);return o}getFloatingTopHeight(e,t=this.getFloatingRowHeights(e)){const{model:n}=e,{floatingTopRowCount:s}=n;let i=0;for(let o=0;o<s;o+=1)i+=A(t,o);return i}getFloatingBottomHeight(e,t=this.getFloatingRowHeights(e)){const{model:n}=e,{floatingBottomRowCount:s,rowCount:i}=n;let o=0;for(let r=0;r<s;r+=1)o+=A(t,i-r-1);return o}getTopVisible(e,t,n,s){const i=this.getFloatingTopHeight(e,n);for(let o=0;o<s.length;o+=1){const r=s[o];if(A(t,r)>=i)return r}return 0}getLeftVisible(e,t,n,s){const i=this.getFloatingLeftWidth(e,n);for(let o=0;o<s.length;o+=1){const r=s[o];if(A(t,r)>=i)return r}return 0}getBottomVisible(e,t,n,s,i){const{height:o,theme:r}=e,{scrollBarSize:l}=r,a=this.getFloatingBottomHeight(e,n),c=o-i-l-a;for(let d=s.length-1;d>=0;d-=1){const h=s[d],m=A(t,h),p=A(n,h);if(m+p<=c)return h}return 0}getRightVisible(e,t,n,s,i){const{width:o,theme:r}=e,{scrollBarSize:l}=r,a=this.getFloatingRightWidth(e,n),c=o-i-l-a;for(let d=s.length-1;d>=0;d-=1){const h=s[d],m=A(t,h),p=A(n,h);if(m+p<=c)return h}return 0}getBottomViewport(e,t,n,s){const{height:i,theme:o}=e,{rowHeight:r}=o;return this.getLastIndexViewport(t,n,s,i,r)}getRightViewport(e,t,n,s){const{width:i,theme:o}=e,{columnWidth:r}=o;return this.getLastIndexViewport(t,n,s,i,r)}getLastIndexViewport(e,t,n,s,i){let o=0,r=0;return e.length>0&&(o=e[e.length-1],r=A(t,o)+A(n,o)),r<s&&(o+=Math.ceil((s-r)/i)),o}getVisibleItemSize(e,t,n){var i;const s=n();return(i=t.get(e))!=null?i:s}getVisibleRowHeight(e,t){const n=this.getModelRow(e,t);return this.getVisibleItemSize(n,this.userRowHeights,()=>this.calculateRowHeight(e,n,t))}getVisibleColumnWidth(e,t,n=this.getFirstColumn(t),s=this.calculateTreePaddingX(t)){const i=this.getModelColumn(e,t);return this.getVisibleItemSize(i,this.userColumnWidths,()=>this.calculateColumnWidth(e,i,t,n,s))}getModelRows(e,t){const n=new Map;for(let s=0;s<e.length;s+=1){const i=e[s],o=this.getModelRow(i,t);n.set(i,o)}return n}getModelRow(e,t){if(this.modelRows.has(e))return A(this.modelRows,e);const{movedRows:n}=t,s=V.getModelIndex(e,n);return this.modelRows.set(e,s),s}getModelColumns(e,t){const n=new Map;for(let s=0;s<e.length;s+=1){const i=e[s],o=this.getModelColumn(i,t);n.set(i,o)}return n}getModelColumn(e,t){if(this.modelColumns.has(e))return A(this.modelColumns,e);const{movedColumns:n}=t,s=V.getModelIndex(e,n);return this.modelColumns.set(e,s),s}calculateRowHeight(e,t,n){const{theme:s}=n,{autoSizeRows:i,rowHeight:o}=s;if(!i)return o;const r=this.calculatedRowHeights.get(t);return r!=null?r:(this.calculatedRowHeights.set(t,Math.ceil(o)),bi(this.calculatedRowHeights),o)}calculateColumnWidth(e,t,n,s=this.getFirstColumn(n),i=this.calculateTreePaddingX(n)){const{theme:o}=n,{autoSizeColumns:r,minColumnWidth:l}=o;if(!r){const{columnWidth:m}=o;return m}const a=this.calculateColumnHeaderWidth(t,n),c=this.calculateColumnDataWidth(t,n),d=this.calculatedColumnWidths.get(t);let h=Math.ceil(Math.max(a,c));return h=Math.max(l,h),d!=null&&d>h?h=d:(this.calculatedColumnWidths.set(t,h),bi(this.calculatedColumnWidths)),e===s&&(h+=i),h}calculateColumnHeaderWidth(e,t){const{model:n,theme:s}=t,{headerFont:i,headerHorizontalPadding:o}=s,r=n.textForColumnHeader(e,0);if(r){const l=this.getWidthForFont(i,t);return r.length*l+o*2}return o*2}calculateColumnDataWidth(e,t){const{top:n,height:s,width:i,model:o,theme:r}=t,{floatingTopRowCount:l,floatingBottomRowCount:a,rowCount:c}=o,{font:d,cellHorizontalPadding:h,rowHeight:m,rowHeaderWidth:p,rowFooterWidth:g,scrollBarSize:f}=r;let b=0;const C=this.getWidthForFont(d,t),w=s/m,S=Math.ceil(n+w);return V.iterateAllItems(n,S,l,a,c,I=>{const v=this.getModelRow(I,t),E=o.textForCell(e,v);if(E){const M=h*2;b=Math.max(b,E.length*C+M)}}),b=Math.max(Math.min(b,(i-p-f-g)*ca.MAX_COLUMN_WIDTH),h*2),b}calculateTreePaddingX(e){const{top:t,height:n,model:s,theme:i}=e,{rowHeight:o,treeDepthIndent:r}=i;if(!Xe(s)||!s.hasExpandableRows)return 0;let l=0;const a=n/o,c=Math.ceil(t+a);for(let d=t;d<=c;d+=1){const h=this.getModelRow(d,e),m=s.depthForRow(h);l=Math.max(l,r*(m+1))}return l}getWidthForFont(e,t){if(this.fontWidths.has(e))return A(this.fontWidths,e);const{context:n}=t;n.font=e;const s=n.measureText("8"),{width:i}=s;return this.fontWidths.set(e,i),this.fontWidths.set(n.font,i),i}setColumnWidth(e,t){const n=new Map(this.userColumnWidths);n.set(e,Math.ceil(t)),bi(n),this.userColumnWidths=n}resetColumnWidth(e){const t=new Map(this.userColumnWidths);t.delete(e),this.userColumnWidths=t}setRowHeight(e,t){const n=new Map(this.userRowHeights);n.set(e,Math.ceil(t)),bi(n),this.userRowHeights=n}resetRowHeight(e){const t=new Map(this.userRowHeights);t.delete(e),this.userRowHeights=t,this.calculatedRowHeights.delete(e)}};let Qs=ca;Qs.CACHE_SIZE=1e4;Qs.MAX_COLUMN_WIDTH=.8;const Hh=Object.freeze({allowColumnResize:!0,allowRowResize:!0,autoSelectRow:!1,autoSelectColumn:!1,autoSizeColumns:!0,autoSizeRows:!0,backgroundColor:"#000000",cellHorizontalPadding:5,headerHorizontalPadding:5,font:"12px Arial, sans serif",gridColumnColor:"#8f8f8f66",gridRowColor:"#8f8f8f66",headerBackgroundColor:"#222222",headerSeparatorColor:"#000000",headerSeparatorHoverColor:"#888888",headerSeparatorHandleSize:5,headerHiddenSeparatorSize:5,headerHiddenSeparatorHoverColor:"#8888FF",headerColor:"#d5d5d5",headerFont:"10px Arial, sans serif",columnHoverBackgroundColor:"#444444",selectedColumnHoverBackgroundColor:"#494949",rowBackgroundColors:"#333333 #222222",rowHoverBackgroundColor:"#444444",selectedRowHoverBackgroundColor:"#494949",minScrollHandleSize:50,scrollBarBackgroundColor:"#111111",scrollBarHoverBackgroundColor:"#333333",scrollBarCasingColor:"#000000",scrollBarCornerColor:"#000000",scrollBarColor:"#555555",scrollBarHoverColor:"#888888",scrollBarActiveColor:"#AAAAAA",scrollBarSize:12,scrollBarHoverSize:16,scrollBarCasingWidth:1,scrollSnapToColumn:!1,scrollSnapToRow:!1,selectionColor:"#4286f433",selectionOutlineColor:"#4286f4",selectionOutlineCasingColor:"#222222",scrollBarSelectionTick:!0,scrollBarSelectionTickColor:"#4286f433",scrollBarActiveSelectionTickColor:"#4286f480",shadowBlur:8,shadowColor:"#000000",textColor:"#ffffff",maxDepth:6,treeDepthIndent:10,treeHorizontalPadding:5,treeLineColor:"#888888",treeMarkerColor:"#cccccc",treeMarkerHoverColor:"#ffffff",rowHeight:20,columnWidth:100,minRowHeight:20,minColumnWidth:55,columnHeaderHeight:20,rowHeaderWidth:30,rowFooterWidth:0,headerResizeSnapThreshold:10,headerResizeHiddenSnapThreshold:8,allowColumnReorder:!0,allowRowReorder:!0,reorderOffset:2,floatingGridColumnColor:"#8f8f8f66",floatingGridRowColor:"#8f8f8f66",floatingRowBackgroundColors:"#393939 #292929",floatingDividerOuterColor:"#000000",floatingDividerInnerColor:"#cccccc"}),yt=(e,t)=>{let n=!1;const s=ue(e,{...t,dispose:()=>{n||(n=!0,s.clear(),n=!1)}});return s};function _h(e,t,n=6){const s=Fo.hex.lab.raw(e);return s[0]=Math.max(s[0]-s[0]/n*t,0),`#${Fo.lab.hex(s)}`}function Vh(e,t){const[n,s,i]=Fo.hex.rgb(e);return`rgba(${n}, ${s}, ${i}, ${t})`}const jr={colorWithAlpha:Vh,darkenForDepth:_h};class Ze{constructor(t=5e3){this.cursor=null,this.order=t}onDown(t,n,s){return!1}onMove(t,n,s){return!1}onDrag(t,n,s){return!1}onLeave(t,n,s){return!1}onClick(t,n,s){return!1}onContextMenu(t,n,s){return!1}onDoubleClick(t,n,s){return!1}onUp(t,n,s){return!1}onWheel(t,n,s){return!1}}class da extends Ze{constructor(){super(...arguments),this.resizingItems=[],this.hiddenItems=[],this.targetSizes=new Map,this.dragOffset=0}onDown(t,n){const{metrics:s}=n,{model:i}=n.props,o=n.getTheme();if(!s)throw new Error("metrics not set");const r=this.getSeparator(t,s,i,o);if(r!=null){const l=r.index;return this.dragOffset=0,this.draggingIndex=l,this.resizingItems=[l],this.hiddenItems=this.getHiddenItems(l,s).reverse(),this.targetSizes.clear(),this.addTargetSize(s,l),this.updateCursor(s,l),this.updateSeparator(n,r),!0}return!1}onMove(t,n){const{metrics:s}=n,{model:i}=n.props,o=n.getTheme();if(!s)throw new Error("metrics not set");const r=this.getSeparator(t,s,i,o);return r!=null?(this.updateCursor(s,r.index),!0):!1}onDrag(t,n){var f;if(this.draggingIndex==null)return!1;const s=t[this.pointProperty],{metricCalculator:i,metrics:o}=n;if(!o)throw new Error("metrics not set");const r=n.getTheme(),l=o[this.visibleOffsetProperty],a=o[this.marginProperty],c=o[this.calculatedSizesProperty],d=o[this.modelIndexesProperty],h=o[this.firstIndexProperty],m=o[this.treePaddingProperty],p=new Map;let g=this.resizingItems[this.resizingItems.length-1];for(;g!=null;){const b=A(l,g),C=s-a-b-this.dragOffset,w=A(d,g),S=this.targetSizes.get(w),I=this.resizingItems.length>1,v=this.hiddenItems.indexOf(g);let E=A(c,w);g===h&&(E+=m);let M=C;Math.abs(C-E)<=r.headerResizeSnapThreshold?M=null:S!==void 0&&C>S&&(I&&v!==0||v>0)?M=S:C<=r.headerResizeHiddenSnapThreshold&&(M=0),M!==E?p.set(w,M):p.set(w,null),C<-r.headerResizeSnapThreshold&&M===0?v>=0&&I?(this.resizingItems.pop(),this.removeTargetSize(o,g),g=this.resizingItems[this.resizingItems.length-1],this.dragOffset-=(f=this.targetSizes.get(A(d,g)))!=null?f:0):(g=this.getNextShownItem(g,o),g!==null&&(this.resizingItems.push(g),this.addTargetSize(o,g))):S!==void 0&&C>S+r.headerResizeSnapThreshold&&M===S?v>0?(this.dragOffset+=M,g=this.hiddenItems[v-1],this.resizingItems.push(g),this.addTargetSize(o,g)):I?(this.resizingItems.pop(),this.removeTargetSize(o,g),g=this.resizingItems[this.resizingItems.length-1]):g=null:g=null}return p.forEach((b,C)=>{b!==null?this.setSize(i,C,b):this.resetSize(i,C)}),this.updateCursor(o,this.draggingIndex),!0}onUp(t,n){return this.draggingIndex!=null&&(this.draggingIndex=void 0,this.resizingItems=[],this.hiddenItems=[],this.targetSizes.clear(),this.updateSeparator(n,null)),!1}onDoubleClick(t,n){const{metrics:s,metricCalculator:i}=n,{model:o}=n.props,r=n.getTheme();if(!s)throw new Error("metrics not set");const l=this.getSeparator(t,s,o,r);if(l!=null){const a=s[this.modelIndexesProperty],c=A(a,l.index);return this.resetSize(i,c),n.forceUpdate(),!0}return!1}updateCursor(t,n){const s=t[this.visibleSizesProperty];A(s,n)===0?this.cursor=this.hiddenCursor:this.cursor=this.defaultCursor}addTargetSize(t,n){const s=t[this.modelIndexesProperty],i=t[this.userSizesProperty],o=t[this.calculatedSizesProperty],r=n===0?t[this.treePaddingProperty]:0,l=A(s,n);let a=i.get(l);(a==null||a===0)&&(a=A(o,l)+r),this.targetSizes.set(l,a)}removeTargetSize(t,n){const s=t[this.modelIndexesProperty],i=A(s,n);this.targetSizes.delete(i)}}class Yi extends da{constructor(){super(...arguments),this.hiddenCursor="e-resize",this.defaultCursor="col-resize",this.pointProperty="x",this.userSizesProperty="userColumnWidths",this.visibleOffsetProperty="visibleColumnXs",this.visibleSizesProperty="visibleColumnWidths",this.marginProperty="rowHeaderWidth",this.calculatedSizesProperty="calculatedColumnWidths",this.modelIndexesProperty="modelColumns",this.firstIndexProperty="firstColumn",this.treePaddingProperty="treePaddingX",this.getHiddenItems=V.getHiddenColumns,this.getNextShownItem=V.getNextShownColumn,this.getSeparator=Yi.getColumnSeparator}static getColumnSeparator(t,n,s,i){if(!i.allowColumnResize)return null;const{x:o,y:r,columnHeaderDepth:l}=t,{modelColumns:a}=n,c=V.getColumnSeparatorIndex(o,r,n,i);return c==null||l==null||l>0?null:a.get(c)!=null?{index:c,depth:0}:null}setSize(t,n,s){t.setColumnWidth(n,s)}resetSize(t,n){t.resetColumnWidth(n)}updateSeparator(t,n){t.setState({draggingColumnSeparator:n,isDragging:n!==null})}}const ln=class{constructor(){this.getCachedTruncatedString=yt((e,t,n,s,i)=>ln.truncateToWidth(e,t,n,s,i),{max:1e4}),this.getCachedBackgroundColors=yt((e,t)=>e.split(" ").map(n=>{const s=[];for(let i=0;i<t;i+=1)s.push(jr.darkenForDepth(n,i,t));return s}),{max:1e3}),this.getCachedColorWithAlpha=yt((e,t)=>jr.colorWithAlpha(e,t),{max:1e3})}static truncate(e,t){return t<e.length?e.substr(0,t)+"\u2026":e}static binaryTruncateToWidth(e,t,n,s=0,i=t.length,o){if(i>=t.length&&e.measureText(t).width<=n)return t;if(o){const c=e.measureText(o).width;return o.repeat(Math.max(1,Math.floor(n/c)))}let r=s,l=Math.min(t.length-1,i),a=t;for(;l>=r;){const c=Math.ceil((l+r)/2),d=ln.truncate(t,c);if(e.measureText(d).width<=n){if(a=d,r===c)break;r=c}else if(c===0){a=d;break}else l=c-1}return a}static truncateToWidth(e,t,n,s=ln.DEFAULT_FONT_WIDTH,i){if(n<=0||t.length<=0)return"";const o=Math.min(Math.max(0,Math.floor(n/s/2)-5),t.length),r=Math.min(Math.ceil(n/s*2),t.length);return ln.binaryTruncateToWidth(e,t,n,o,r,i)}drawCanvas(e){const{context:t}=e;t.save(),this.configureContext(t,e),this.drawBackground(t,e),this.drawGrid(t,e),this.drawHeaders(t,e),this.drawFooters(t,e),this.drawDraggingColumn(t,e),this.drawDraggingRow(t,e),this.drawScrollBars(t,e),t.restore()}configureContext(e,t){const{theme:n}=t;e.font=n.font,e.textBaseline="middle",e.lineCap="butt"}drawBackground(e,t){const{theme:n,metrics:s}=t,{width:i,height:o}=s;e.fillStyle=n.backgroundColor,e.fillRect(0,0,i,o)}drawGrid(e,t){const{metrics:n,draggingRow:s,draggingColumn:i}=t,{gridX:o,gridY:r}=n;e.translate(o,r),this.drawGridBackground(e,t,s==null&&i==null),this.drawCellContents(e,t),this.drawFloatingRows(e,t),this.drawFloatingColumns(e,t),e.translate(-o,-r)}drawFloatingRows(e,t){const{draggingRow:n,draggingColumn:s,metrics:i,theme:o}=t,{floatingTopRowCount:r,floatingBottomRowCount:l,floatingRows:a,rowCount:c,visibleColumns:d,visibleRowYs:h,visibleRowHeights:m}=i;if(a.length!==0){o.floatingRowBackgroundColors&&this.drawRowStripesForRows(e,t,a,o.floatingRowBackgroundColors),n==null&&s==null&&this.drawFloatingMouseRowHover(e,t),this.drawGridLinesForItems(e,t,d,a,o.floatingGridColumnColor,o.floatingGridRowColor),this.drawCellBackgroundsForItems(e,t,d,a),this.drawFloatingBorders(e,t),r>0&&this.drawSelectedRanges(e,t,{top:0,bottom:r-1,maxY:A(h,r-1)+A(m,r-1)-.5}),l>0&&this.drawSelectedRanges(e,t,{top:c-l-1,bottom:c-1,minY:A(h,c-l)+.5,maxY:A(h,c-1)+A(m,c-1)-.5});for(let p=0;p<d.length;p+=1){const g=d[p];for(let f=0;f<a.length;f+=1){const b=a[f];this.drawCellContent(e,t,g,b)}}}}drawFloatingColumns(e,t){const{draggingRow:n,draggingColumn:s,metrics:i,theme:o}=t,{floatingLeftColumnCount:r,floatingRightColumnCount:l,floatingLeftWidth:a,floatingRightWidth:c,floatingColumns:d,gridX:h,maxX:m,columnCount:p,visibleRows:g,visibleColumnXs:f,visibleColumnWidths:b,width:C,height:w}=i;if(d.length!==0){o.floatingRowBackgroundColors&&(this.drawRowStripesForRows(e,t,g,o.floatingRowBackgroundColors,0,a),this.drawRowStripesForRows(e,t,g,o.floatingRowBackgroundColors,C-h-c,m)),n==null&&s==null&&this.drawFloatingMouseRowHover(e,t),e.save(),e.beginPath(),e.rect(0,0,a,w),e.clip(),this.drawGridLinesForItems(e,t,d,g,o.floatingGridColumnColor,o.floatingGridRowColor),e.restore(),this.drawCellBackgroundsForItems(e,t,d,g),this.drawFloatingBorders(e,t),r>0&&this.drawSelectedRanges(e,t,{left:0,maxX:A(f,r-1)+A(b,r-1)}),l>0&&this.drawSelectedRanges(e,t,{left:p-l,right:p-1,minX:A(f,p-l)+.5,maxX:A(f,p-1)+A(b,p-1)});for(let S=0;S<d.length;S+=1){const I=d[S];for(let v=0;v<g.length;v+=1){const E=g[v];this.drawCellContent(e,t,I,E)}}}}drawFloatingBorders(e,t){const{metrics:n,theme:s}=t,{floatingTopRowCount:i,floatingBottomRowCount:o,floatingLeftColumnCount:r,floatingRightColumnCount:l,rowCount:a,columnCount:c,visibleRowYs:d,visibleColumnXs:h,visibleRowHeights:m,visibleColumnWidths:p,maxX:g,maxY:f}=n,{floatingDividerOuterColor:b,floatingDividerInnerColor:C}=s;if(e.lineWidth=3,e.beginPath(),e.strokeStyle=b,i>0){const w=A(d,i-1)+A(m,i-1)+.5;e.moveTo(0,w),e.lineTo(g,w)}if(o>0){const w=A(d,a-o)-.5;e.moveTo(0,w),e.lineTo(g,w)}if(r>0){const w=A(h,r-1)+A(p,r-1)+.5;e.moveTo(w,0),e.lineTo(w,f)}if(l>0){const w=A(h,c-l)-.5;e.moveTo(w,0),e.lineTo(w,f)}if(e.stroke(),e.beginPath(),e.lineWidth=1,e.strokeStyle=C,i>0){const w=A(d,i-1)+A(m,i-1)+.5;e.moveTo(0,w),e.lineTo(g,w)}if(o>0){const w=A(d,a-o)-.5;e.moveTo(0,w),e.lineTo(g,w)}if(r>0){const w=A(h,r-1)+A(p,r-1)+.5;e.moveTo(w,0),e.lineTo(w,f)}if(l>0){const w=A(h,c-l)-.5;e.moveTo(w,0),e.lineTo(w,f)}e.stroke()}drawGridBackground(e,t,n=!1){this.drawRowStripes(e,t),n&&(this.drawMouseColumnHover(e,t),this.drawMouseRowHover(e,t)),this.drawGridLines(e,t),this.drawCellBackgrounds(e,t);const{metrics:s}=t,{bottom:i,right:o,floatingBottomRowCount:r,floatingLeftColumnCount:l,floatingRightColumnCount:a,floatingTopRowCount:c,columnCount:d,rowCount:h,visibleRowHeights:m,visibleRowYs:p,visibleColumnXs:g,visibleColumnWidths:f,width:b,height:C}=s;this.drawSelectedRanges(e,t,{bottom:Math.min(i,h-r-1),right:Math.min(o,d-a-1),minX:l>0&&g.has(l+1)?A(g,l+1):-10,minY:c>0&&p.has(c+1)?A(p,c+1):-10,maxX:a>0&&g.has(d-a-1)?A(g,d-a-1)+A(f,d-a-1)-.5:b+10,maxY:r>0&&p.has(h-r-1)?A(p,h-r-1)+A(m,h-r-1)-.5:C+10})}drawRowStripes(e,t){const{metrics:n,theme:s}=t,{visibleRows:i}=n,{rowBackgroundColors:o}=s;!o||this.drawRowStripesForRows(e,t,i,o)}drawRowStripesForRows(e,t,n,s,i=0,o=t.metrics.maxX){const{theme:r,metrics:l,model:a}=t,{maxDepth:c,shadowBlur:d,shadowColor:h}=r,m=this.getCachedBackgroundColors(s,c),{visibleRowYs:p,visibleRowHeights:g}=l,f=new Map,b=[],C=[],w=(S,I)=>{const v=Xe(a)?a.depthForRow(S):0,E=m[S%m.length],M=E[Math.min(v,E.length-1)];if(f.has(M)||f.set(M,[]),f.get(M).push(S),I!=null){const F=Xe(a)?a.depthForRow(I):0;F<v?b.push(S):F>v&&C.push(I)}};for(let S=0;S<n.length;S+=1){const I=n[S],v=S>0?n[S-1]:void 0;w(I,v)}if(f.forEach((S,I)=>{e.fillStyle=I,e.beginPath();for(let v=0;v<S.length;v+=1){const E=S[v],M=A(p,E),F=A(g,E);e.rect(i,M,o,F)}e.fill()}),b.length>0){e.save();const S=this.getCachedColorWithAlpha(h,.15),I=this.getCachedColorWithAlpha(h,0),v=e.createLinearGradient(0,0,0,d);v.addColorStop(0,S),v.addColorStop(1,I),e.fillStyle=v;for(let E=0;E<b.length;E+=1){const M=b[E],F=A(p,M);e.translate(0,F),e.fillRect(i,0,o,d),e.translate(0,-F)}e.restore()}if(C.length>0){e.save();const S=this.getCachedColorWithAlpha(h,0),I=this.getCachedColorWithAlpha(h,.15),v=e.createLinearGradient(0,0,0,d);v.addColorStop(0,S),v.addColorStop(1,I),e.fillStyle=v;for(let E=0;E<C.length;E+=1){const M=C[E],F=A(p,M),k=A(g,M),P=F+k-d;e.translate(0,P),e.fillRect(i,0,o,d),e.translate(0,-P)}e.restore()}}drawMouseColumnHover(e,t){const{mouseX:n,mouseY:s,theme:i,metrics:o}=t;if(n==null||s==null)return;const r=V.getColumnAtX(n,o);if(r==null||!i.columnHoverBackgroundColor)return;const{visibleColumnWidths:l,visibleColumnXs:a,maxY:c}=o;if(s>c)return;const d=A(a,r),h=A(l,r);e.fillStyle=i.columnHoverBackgroundColor,e.fillRect(d,0,h,c)}drawMouseRowHover(e,t){const{mouseX:n,mouseY:s,theme:i,metrics:o}=t;if(n==null||s==null)return;const{maxX:r}=o;if(n>r||!i.rowHoverBackgroundColor)return;const l=V.getRowAtY(s,o);l!=null&&this.drawMouseRowHoverForRow(e,t,l)}drawFloatingMouseRowHover(e,t){const{mouseX:n,mouseY:s,theme:i,metrics:o}=t,{maxX:r,floatingTopRowCount:l,floatingBottomRowCount:a,rowCount:c,rowFooterWidth:d}=o;if(n==null||s==null||n>r+d||!i.rowHoverBackgroundColor)return;const h=V.getRowAtY(s,o);h!=null&&(h<l||c-a<=h)&&this.drawMouseRowHoverForRow(e,t,h)}drawMouseRowHoverForRow(e,t,n){const{metrics:s,selectedRanges:i,theme:o}=t,{visibleRowHeights:r,visibleRowYs:l,maxX:a}=s,c=A(l,n),d=A(r,n);o.rowHoverBackgroundColor&&(e.fillStyle=o.rowHoverBackgroundColor);for(let h=0;h<i.length;h+=1){const{startRow:m,endRow:p}=i[h];if(m!=null&&p!=null&&m<=n&&p>=n){o.selectedRowHoverBackgroundColor&&(e.fillStyle=o.selectedRowHoverBackgroundColor);break}}e.fillRect(0,c,a,d)}drawGridLines(e,t){const{metrics:n,theme:s}=t,{visibleColumns:i,visibleRows:o}=n;this.drawGridLinesForItems(e,t,i,o,s.gridColumnColor,s.gridRowColor)}drawGridLinesForItems(e,t,n,s,i,o){!i&&!o||(e.lineWidth=1,e.beginPath(),i&&(e.strokeStyle=i,this.drawGridLinesForColumns(e,t,n)),o&&(e.strokeStyle=o,this.drawGridLinesForRows(e,t,s)),e.stroke())}drawGridLinesForColumns(e,t,n){const{metrics:s}=t,{visibleColumnXs:i,maxY:o}=s;for(let r=0;r<n.length;r+=1){const l=n[r],a=A(i,l)+.5;e.moveTo(a,0),e.lineTo(a,o)}}drawGridLinesForRows(e,t,n){const{metrics:s}=t,{visibleRowYs:i,maxX:o}=s,r=o;for(let l=0;l<n.length;l+=1){const a=n[l],c=A(i,a)+.5;e.moveTo(.5,c),e.lineTo(r-.5,c)}}drawCellBackgrounds(e,t){const{metrics:n}=t,{visibleColumns:s,visibleRows:i}=n;this.drawCellBackgroundsForItems(e,t,s,i)}drawCellBackgroundsForItems(e,t,n,s){e.save();for(let i=0;i<n.length;i+=1){const o=n[i];for(let r=0;r<s.length;r+=1){const l=s[r],a=r+1<s.length?s[r+1]:void 0;this.drawCellBackground(e,t,o,l,a)}}e.restore()}drawCellBackground(e,t,n,s,i){const{metrics:o,model:r,theme:l}=t,{firstColumn:a,modelColumns:c,modelRows:d,visibleColumnXs:h,visibleColumnWidths:m,visibleRowYs:p,visibleRowHeights:g}=o,f=A(d,s),b=A(c,n),C=r.backgroundColorForCell(b,f,l),w=n===a,S=Xe(r)&&r.hasExpandableRows;if(C){const I=A(h,n)+1,v=A(p,s)+1,E=A(m,n)-1,M=A(g,s)-1;e.fillStyle=C,e.fillRect(I,v,E,M)}w&&S&&this.drawCellRowTreeDepthLines(e,t,s,i)}drawCellContents(e,t){const{metrics:n}=t,{visibleColumns:s}=n;for(let i=0;i<s.length;i+=1){const o=s[i];this.drawColumnCellContents(e,t,o)}}drawColumnCellContents(e,t,n){const{metrics:s}=t,{visibleColumnXs:i,visibleColumnWidths:o,visibleRows:r,height:l}=s,a=A(i,n),c=A(o,n);e.save(),e.beginPath(),e.rect(a,0,c,l),e.clip();for(let d=0;d<r.length;d+=1){const h=r[d];this.drawCellContent(e,t,n,h)}e.restore()}getTextRenderMetrics(e,t,n,s){const{textAlign:i}=e,{metrics:o,model:r,theme:l}=t,{firstColumn:a,visibleColumnXs:c,visibleColumnWidths:d,visibleRowYs:h,visibleRowHeights:m}=o,{cellHorizontalPadding:p,treeDepthIndent:g,treeHorizontalPadding:f}=l,b=A(c,n),C=A(h,s),w=A(d,n),S=A(m,s),I=n===a;let v=0;Xe(r)&&r.hasExpandableRows&&I&&(v=g*(r.depthForRow(s)+1)+f);const E=w-v;let M=b+p;const F=C+S*.5;return i==="right"?M=b+E-p:i==="center"&&(M=b+E*.5),M+=v,{width:E-p*2,x:M,y:F}}drawCellContent(e,t,n,s,i){var I;const{metrics:o,model:r,theme:l}=t,{firstColumn:a,fontWidths:c,modelColumns:d,modelRows:h,visibleRowHeights:m}=o,{textColor:p}=l,g=A(m,s),f=A(h,s),b=A(d,n),C=i!=null?i:r.textForCell(b,f),w=r.truncationCharForCell(b,f),S=n===a;if(C&&g>0){const v=r.textAlignForCell(b,f)||"left";e.textAlign=v;const E=r.colorForCell(b,f,l)||p;e.fillStyle=E;const{width:M,x:F,y:k}=this.getTextRenderMetrics(e,t,n,s),P=(I=c.get(e.font))!=null?I:ln.DEFAULT_FONT_WIDTH,L=this.getCachedTruncatedString(e,C,M,P,w);L&&e.fillText(L,F,k)}S&&Xe(r)&&r.hasExpandableRows&&this.drawCellRowTreeMarker(e,t,s)}drawCellRowTreeMarker(e,t,n){const{metrics:s,model:i,mouseX:o,mouseY:r,theme:l}=t,{firstColumn:a,gridX:c,gridY:d,visibleColumnXs:h,visibleColumnWidths:m,visibleRowYs:p,visibleRowHeights:g,visibleRowTreeBoxes:f}=s,{treeMarkerColor:b,treeMarkerHoverColor:C}=l,w=A(h,a),S=A(m,a),I=A(p,n),v=A(g,n);if(!Xe(i)||!i.isRowExpandable(n))return;const E=A(f,n),M=o!=null&&r!=null&&o>=c+w&&o<=c+w+S&&r>=d+I&&r<=d+I+v?C:b;this.drawTreeMarker(e,t,w,I,E,M,i.isRowExpanded(n))}drawTreeMarker(e,t,n,s,i,o,r){const{x1:l,y1:a,x2:c,y2:d}=i,h=r?"\u229F":"\u229E",m=n+(l+c)*.5+.5,p=s+(a+d)*.5+.5;e.fillStyle=o,e.textAlign="center",e.fillText(h,m,p)}drawCellRowTreeDepthLines(e,t,n,s){const{metrics:i,model:o,theme:r}=t;if(!Xe(o))return;const l=o.depthForRow(n);if(l===0)return;const{firstColumn:a,visibleColumnXs:c,visibleRowYs:d,visibleRowHeights:h}=i,{treeDepthIndent:m,treeHorizontalPadding:p,treeLineColor:g}=r,f=A(c,a),b=A(d,n),C=A(h,n),w=s!==void 0?o.depthForRow(s):0,S=l>w?l-w:0;if(e.strokeStyle=g,e.lineWidth=1,l-S>0){e.beginPath();for(let I=0;I<l-S;I+=1){const v=f+I*m+m*.5+p+.5;e.moveTo(v,b),e.lineTo(v,b+C)}e.stroke()}if(S>0){e.beginPath();for(let I=l-S;I<l;I+=1){const v=f+I*m+m*.5+p+.5;e.moveTo(v,b),e.lineTo(v,b+Math.ceil(C/2)),e.moveTo(v-.5,b+Math.ceil(C/2)+.5),e.lineTo(v+m-.5,b+Math.ceil(C/2)+.5)}e.stroke()}}drawHeaders(e,t){const{theme:n}=t;e.font=n.headerFont,this.drawColumnHeaders(e,t),this.drawRowHeaders(e,t)}drawFooters(e,t){const{theme:n}=t;e.font=n.headerFont,this.drawRowFooters(e,t)}drawColumnHeaders(e,t){const{mouseX:n,mouseY:s,theme:i,metrics:o,draggingColumnSeparator:r,isDragging:l,model:a}=t,{columnHeaderHeight:c,floatingColumns:d,gridX:h,width:m,visibleColumns:p,visibleColumnWidths:g,visibleColumnXs:f,floatingLeftColumnCount:b,floatingLeftWidth:C,floatingRightWidth:w,modelColumns:S,columnHeaderMaxDepth:I}=o;if(c<=0)return;const{headerHiddenSeparatorSize:v,headerHiddenSeparatorHoverColor:E,headerSeparatorColor:M,headerSeparatorHoverColor:F}=i,k=c*.5,P=c*(I-1)+c*.5-k*.5,L=b>0;if(e.save(),this.drawColumnHeadersForRange(e,t,[p[0],p[p.length-1]],{minX:h+C,maxX:m-w}),L&&this.drawColumnHeadersForRange(e,t,[d[0],d[d.length-1]],{minX:h,maxX:h+C}),M){e.strokeStyle=M;const N=[...g.entries()].filter(([B,U])=>U===0).map(([B])=>B);e.beginPath(),e.fillStyle=M;for(let B=0;B<N.length;B+=1){const U=N[B],H=A(f,U),_=A(g,U),$=h+H+_+.5-v*.5;e.rect($,P,v,k)}e.fill()}if(F){let{index:N,depth:B}=r!=null?r:{};if(N==null&&n!=null&&s!=null){const H=Yi.getColumnSeparator(V.getGridPointFromXY(n,s,o),o,a,i);N=H==null?void 0:H.index,B=H==null?void 0:H.depth}let U;if(N==null)U=!1;else{const H=S.get(N),_=S.get(N+1);H==null||_==null?U=!1:U=a.textForColumnHeader(H,B)!==a.textForColumnHeader(_,B)}if(U&&N!=null&&B!=null&&(!l||r!=null)){e.strokeStyle=F;const H=A(f,N),_=A(g,N),$=h+H+_+.5,K=p.indexOf(N),j=K<p.length-1?p[K+1]:null,re=j!=null?g.get(j):null,ne=_===0,ge=re!=null&&re===0;ne?(e.strokeStyle=E,e.fillStyle=E,e.fillRect($,P,v*.5,k)):ge&&(e.fillStyle=F,e.fillRect($-v*.5,P,v*.5,k)),e.beginPath(),e.moveTo($,(I-B-1)*c),e.lineTo($,(I-B)*c-1),e.stroke()}}e.restore()}drawColumnHeadersForRange(e,t,n,s){const{model:i}=t,{columnHeaderMaxDepth:o}=i;if(o!==0)for(let r=0;r<=o;r+=1)this.drawColumnHeadersAtDepth(e,t,n,s,r)}drawColumnHeadersAtDepth(e,t,n,s,i){var P,L,N,B,U,H;const{metrics:o,model:r,theme:l}=t,{modelColumns:a,visibleColumnXs:c,gridX:d,calculatedColumnWidths:h,userColumnWidths:m,visibleColumnWidths:p,movedColumns:g}=o,{headerBackgroundColor:f,headerColor:b,headerSeparatorColor:C,columnHeaderHeight:w,columnWidth:S}=l,{columnHeaderMaxDepth:I}=r,{minX:v,maxX:E}=s,M=E-v;if(I===0)return;const F=n[0],k=n[1];if(e.save(),e.translate(0,(I-i-1)*w),i===0){this.drawColumnHeader(e,t,"",v,E,{backgroundColor:f,separatorColor:C});for(let _=F;_<=k;_+=1)this.drawColumnHeaderAtIndex(e,t,_,s)}if(i>0){let _=F;for(;_<=k;){const{columnCount:$}=o,K=A(a,_),j=r.textForColumnHeader(K,i),re=r.colorForColumnHeader(K,i);let ne=A(c,_)+d,ge=ne+A(p,_);if(j!=null){let ce=_-1;for(;ce>=0&&(ge-ne<M||ne>v);){const _e=(P=a.get(ce))!=null?P:V.getModelIndex(ce,g);if(_e==null||r.textForColumnHeader(_e,i)!==j)break;ne-=(N=(L=m.get(_e))!=null?L:h.get(_e))!=null?N:S,ce-=1}let Fe=_+1;for(;Fe<$&&(ge-ne<M||ge<E);){const _e=(B=a.get(Fe))!=null?B:V.getModelIndex(Fe,g);if(r.textForColumnHeader(_e,i)!==j)break;ge+=(H=(U=m.get(_e))!=null?U:h.get(_e))!=null?H:S,Fe+=1}_=Fe-1;const Ye=ge-ne>=M;let $e=ne;Ye&&(ge<E?$e=ge-M:ne<v&&($e=v)),this.drawColumnHeader(e,t,j,$e,Math.min(ge-ne,M),{backgroundColor:re!=null?re:f,textColor:b,separatorColor:C},s)}_+=1}}e.restore()}drawColumnHeaderAtIndex(e,t,n,s){var w;const{metrics:i,model:o,theme:r}=t,{modelColumns:l,visibleColumnWidths:a,visibleColumnXs:c,gridX:d}=i,h=A(a,n),m=A(c,n)+d,p=A(l,n),g=o.textForColumnHeader(p),{headerBackgroundColor:f,headerColor:b,headerSeparatorColor:C}=r;g!=null&&this.drawColumnHeader(e,t,g,m,h,{backgroundColor:(w=o.colorForColumnHeader(p))!=null?w:f,textColor:b,separatorColor:C},s)}drawColumnHeader(e,t,n,s,i,o,r){if(i<=0)return;const{metrics:l,theme:a}=t,{headerHorizontalPadding:c,columnHeaderHeight:d}=a,{fontWidths:h,width:m}=l,p=h.get(e.font)||ln.DEFAULT_FONT_WIDTH,f=(i-c*2)/p,{backgroundColor:b,textColor:C="#ffffff",separatorColor:w}=o!=null?o:{};let{minX:S=0,maxX:I=m}=r!=null?r:{};e.save(),e.rect(S,0,I-S,d),e.clip(),b&&(e.fillStyle=b,e.fillRect(s,0,i,d)),w&&(e.strokeStyle=w,e.beginPath(),s>0&&(e.moveTo(s+.5,0),e.lineTo(s+.5,d)),e.moveTo(s+i+.5,0),e.lineTo(s+i+.5,d),e.moveTo(s,d-.5),e.lineTo(s+i,d-.5),e.stroke()),e.beginPath(),e.rect(s,0,i,d),e.clip(),e.fillStyle=C;let v=n;f<=0?v="":v.length>f&&(v=`${v.substring(0,f-1)}\u2026`);const E=v.length*p;let M=s+i*.5;const F=d*.5;S+=c,I-=c;const k=s+c,P=lt(k,S,I),L=s+i-c,B=lt(L,S,I)-P,U=M-E*.5<S,H=M+E*.5>I;U?E<B?M=S+E*.5:M=L-E*.5:H&&(E<B?M=I-E*.5:M=k+E*.5),e.textAlign="center",e.fillText(v,M,F),e.restore()}drawRowHeaders(e,t){const{mouseX:n,mouseY:s,metrics:i,theme:o,draggingRowSeparator:r}=t,{gridY:l,rowHeaderWidth:a,height:c,visibleRows:d,visibleRowHeights:h,visibleRowYs:m}=i;if(a<=0)return;const{headerBackgroundColor:p,headerColor:g,headerHiddenSeparatorSize:f,headerHiddenSeparatorHoverColor:b,headerSeparatorColor:C,headerSeparatorHoverColor:w}=o,S=a*.5,I=a*.5-S*.5;if(e.save(),e.beginPath(),e.fillStyle=p,e.fillRect(0,0,a,c),C){e.strokeStyle=C,e.beginPath(),e.moveTo(0,l+.5),e.lineTo(a,l+.5);const v=[];let E=!1;for(let M=0;M<d.length;M+=1){const F=d[M],k=A(m,F),P=A(h,F);if(P>0){const L=l+k+P+.5;e.moveTo(0,L),e.lineTo(a,L),E=!1}else E||(E=!0,v.push(F))}e.moveTo(a-.5,0),e.lineTo(a-.5,c),e.stroke(),e.beginPath(),e.fillStyle=C;for(let M=0;M<v.length;M+=1){const F=v[M],k=A(m,F),P=A(h,F),L=l+k+P+.5-f*.5;e.rect(I,L,S,f)}e.fill()}if(w){let{index:v=null}=r!=null?r:{};if(v==null&&n!=null&&s!=null&&(v=V.getRowSeparatorIndex(n,s,i,o)),v!=null){e.strokeStyle=w;const E=A(m,v),M=A(h,v),F=l+E+M+.5,k=d.indexOf(v),P=k<d.length-1?d[k+1]:null,L=P!=null?h.get(P):null,N=M===0,B=L!=null&&L===0;N?(e.strokeStyle=b,e.fillStyle=b,e.fillRect(I,F,S,f*.5)):B&&(e.fillStyle=w,e.fillRect(I,F-f*.5,S,f*.5)),e.beginPath(),e.moveTo(.5,F),e.lineTo(a+.5,F),e.stroke()}}e.beginPath(),e.rect(0,l,a,c),e.clip(),e.fillStyle=g,e.textAlign="right";for(let v=0;v<d.length;v+=1){const E=d[v],M=A(h,E),F=A(m,E)+l;this.drawRowHeader(e,t,E,F,M)}e.restore()}drawRowHeader(e,t,n,s,i){if(i<=0)return;const{metrics:o,model:r,theme:l}=t,{modelRows:a,rowHeaderWidth:c}=o,d=A(a,n),h=c-l.cellHorizontalPadding,m=s+i*.5;e.fillText(r.textForRowHeader(d),h,m)}drawRowFooters(e,t){const{mouseX:n,mouseY:s,metrics:i,model:o,theme:r,draggingRowSeparator:l}=t,{gridY:a,gridX:c,maxX:d,modelRows:h,rowFooterWidth:m,height:p,verticalBarWidth:g,visibleRows:f,visibleRowHeights:b,visibleRowYs:C,width:w}=i;if(m<=0)return;const{cellHorizontalPadding:S,headerBackgroundColor:I,headerColor:v,headerHiddenSeparatorSize:E,headerHiddenSeparatorHoverColor:M,headerSeparatorColor:F,headerSeparatorHoverColor:k}=r,P=m*.5,L=m*.5-P*.5,N=Math.min(c+d,w-m-g);if(e.save(),e.beginPath(),e.fillStyle=I,e.fillRect(N,a,m,p),F){e.strokeStyle=F,e.beginPath(),e.moveTo(N,a+.5),e.lineTo(m,a+.5);const U=[];let H=!1;for(let _=0;_<f.length;_+=1){const $=f[_],K=A(C,$),j=A(b,$);if(j>0){const re=a+K+j+.5;e.moveTo(N+.5,re),e.lineTo(N+m-.5,re),H=!1}else H||(H=!0,U.push($))}e.moveTo(N+.5,a),e.lineTo(N+.5,p),e.stroke(),e.beginPath(),e.fillStyle=F;for(let _=0;_<U.length;_+=1){const $=U[_],K=A(C,$),j=A(b,$),re=a+K+j+.5-E*.5;e.rect(N+L,re,P,E)}e.fill()}if(k){let{index:U=null}=l!=null?l:{};if(U==null&&n!=null&&s!=null&&(U=V.getRowSeparatorIndex(n,s,i,r)),U!=null){e.strokeStyle=k;const H=A(C,U),_=A(b,U),$=a+H+_+.5,K=f.indexOf(U),j=K<f.length-1?f[K+1]:null,re=j!=null?b.get(j):null,ne=_===0,ge=re!=null&&re===0;ne?(e.strokeStyle=M,e.fillStyle=M,e.fillRect(L,$,P,E*.5)):ge&&(e.fillStyle=k,e.fillRect(L,$-E*.5,P,E*.5)),e.beginPath(),e.moveTo(N+.5,$),e.lineTo(N+m+.5,$),e.stroke()}}e.beginPath(),e.rect(N,a,m,p),e.clip(),e.fillStyle=v,e.textAlign="left";const B=N+S;for(let U=0;U<f.length;U+=1){const H=f[U],_=A(b,H);if(_>0){const $=A(C,H)+a,K=A(h,H),j=$+_*.5;e.fillText(o.textForRowFooter(K),B,j)}}e.restore()}drawSelectedRanges(e,t,n={}){const{cursorColumn:s,cursorRow:i,draggingRow:o,draggingColumn:r,editingCell:l,metrics:a,model:c,selectedRanges:d,theme:h}=t,{visibleColumnWidths:m,visibleColumnXs:p,visibleRowHeights:g,visibleRowYs:f,width:b,height:C}=a,{left:w=a.left,top:S=a.top,right:I=a.right,bottom:v=a.bottom,minY:E=-10,maxY:M=C+10,minX:F=-10,maxX:k=b+10}=n;if(d.length===0)return;const P=Ae(c)&&c.isEditable&&l==null&&o==null&&r==null&&s!=null&&i!=null&&p.has(s)&&f.has(i);if(P){const L=A(p,s),N=A(f,i),B=A(m,s),U=A(g,i);e.save(),e.beginPath(),e.rect(0,0,b,C),e.rect(L,N,B,U),e.clip("evenodd")}e.beginPath();for(let L=0;L<d.length;L+=1){const N=d[L],B=N.startColumn!==null?N.startColumn:w,U=N.startRow!==null?N.startRow:S,H=N.endColumn!==null?N.endColumn:I,_=N.endRow!==null?N.endRow:v;if(_>=S&&v>=U&&H>=w&&I>=B){const $=B>=w&&p.has(B)?Math.round(A(p,B))+.5:F,K=U>=S&&f.has(U)?Math.max(Math.round(A(f,U))+.5,.5):E,j=H<=I&&p.has(H)?Math.round(A(p,H)+A(m,H))-.5:k,re=_<=v&&f.has(_)?Math.round(A(f,_)+A(g,_))-.5:M;e.rect($,K,j-$,re-K)}e.fillStyle=h.selectionColor,e.fill(),e.save(),e.clip(),e.strokeStyle=h.selectionOutlineCasingColor,e.lineWidth=3,e.stroke(),e.restore(),e.strokeStyle=h.selectionOutlineColor,e.lineWidth=1,e.stroke()}P&&s!=null&&i!=null&&(e.restore(),this.drawActiveCell(e,t,s,i))}drawActiveCell(e,t,n,s,i=ln.ACTIVE_CELL_BORDER_WIDTH){const{metrics:o,theme:r}=t,{visibleColumnWidths:l,visibleColumnXs:a,visibleRowHeights:c,visibleRowYs:d}=o,h=A(a,n),m=A(d,s),p=A(l,n),g=A(c,s);let f=h-i*.5,b=m-i*.5,C=p+i,w=g+i;f<=0&&(C+=f-1,f=1),b<=0&&(w+=b-1,b=1);const{lineWidth:S}=e;e.beginPath(),e.lineWidth=i,e.strokeStyle=r.selectionOutlineColor,this.drawRoundedRect(e,f,b,C,w),e.stroke(),e.lineWidth=S}drawRoundedRect(e,t,n,s,i,o=ln.DEFAULT_EDGE_RADIUS){e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+s-o,n),e.quadraticCurveTo(t+s,n,t+s,n+o),e.lineTo(t+s,n+i-o),e.quadraticCurveTo(t+s,n+i,t+s-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath()}drawDraggingColumn(e,t){var re;const{draggingColumn:n,metrics:s,mouseX:i,theme:o,model:r}=t;if(n==null||i==null)return;const{range:l,depth:a}=n,{gridX:c,gridY:d,visibleColumnXs:h,visibleColumnWidths:m,height:p,width:g,columnHeaderMaxDepth:f,columnHeaderHeight:b,movedColumns:C,modelColumns:w,floatingLeftWidth:S}=s,I=(re=w.get(l[0]))!=null?re:V.getModelIndex(l[0],C),v=r.getColumnHeaderGroup(I,a);if(a>0&&!v)return;const[E,M]=l,F=A(h,E),P=A(h,M)+A(m,M)-F,L=n.left,{backgroundColor:N,font:B,headerFont:U,reorderOffset:H,shadowBlur:_,shadowColor:$}=o,K=(f-a-1)*b;e.save(),e.translate(c,0),e.save(),e.beginPath(),e.rect(S,0,g,p),e.clip(),e.fillStyle=N,e.fillRect(F,K,P,p),e.restore(),e.translate(0,H),e.save(),e.shadowColor=$,e.shadowBlur=_,e.fillStyle=N,e.fillRect(n.left,K+H,n.width,p),e.restore(),e.beginPath(),e.rect(n.left,K,n.width+1,p),e.clip(),e.translate(L-F,0),e.font=U;const j=[];for(let ne=n.range[0];ne<=n.range[1];ne+=1)j.push(ne);this.drawColumnHeaders(e,t),this.drawColumnHeadersForRange(e,t,[j[0],j[j.length-1]],{minX:F,maxX:g}),e.translate(0,d),e.font=B,this.drawGridBackground(e,t);for(let ne=E;ne<=M;ne+=1)this.drawColumnCellContents(e,t,ne);e.restore()}drawDraggingRow(e,t){const{draggingRow:n,draggingRowOffset:s,metrics:i,mouseY:o,theme:r}=t;if(n==null||o==null)return;const{gridX:l,gridY:a,visibleRowYs:c,visibleRowHeights:d,width:h}=i,m=A(c,n),p=A(d,n)+1,{backgroundColor:g,font:f,headerFont:b,reorderOffset:C,shadowBlur:w,shadowColor:S}=r;e.save(),e.translate(0,a),e.fillStyle=g,e.fillRect(0,m,h,p),e.translate(l+C,o-m-a-(s!=null?s:0)),e.save(),e.shadowColor=S,e.shadowBlur=w,e.fillStyle=g,e.fillRect(-l,m,h,p),e.restore(),e.beginPath(),e.rect(-l,m,h,p),e.clip(),e.font=f,this.drawGridBackground(e,t),this.drawCellContents(e,t),e.translate(-l,-a),e.font=b,this.drawRowHeaders(e,t),e.restore()}drawScrollBars(e,t){const{isDraggingHorizontalScrollBar:n,isDraggingVerticalScrollBar:s,isDragging:i,metrics:o,mouseX:r,mouseY:l,theme:a}=t;if(a.scrollBarSize<=0)return;const{rowHeaderWidth:c,columnHeaderHeight:d,width:h,height:m,handleHeight:p,handleWidth:g,scrollX:f,scrollY:b,hasHorizontalBar:C,hasVerticalBar:w,barWidth:S,barHeight:I}=o,{scrollBarBackgroundColor:v,scrollBarHoverBackgroundColor:E,scrollBarCasingColor:M,scrollBarCornerColor:F,scrollBarColor:k,scrollBarHoverColor:P,scrollBarActiveColor:L,scrollBarSize:N,scrollBarHoverSize:B,scrollBarCasingWidth:U,scrollBarSelectionTick:H,scrollBarSelectionTickColor:_,scrollBarActiveSelectionTickColor:$,autoSelectRow:K,autoSelectColumn:j}=a,re=r!=null&&l!=null&&r<=h&&l<=m,ne=s||w&&!n&&!i&&r!=null&&l!=null&&r>=h-B&&l<=I+d&&re,ge=n||C&&!s&&!i&&!ne&&r!=null&&l!=null&&l>=m-B&&r<=S-c&&re,ce=ge?B:N,Fe=ne?B:N;if(e.translate(c,d),C&&w&&(e.fillStyle=M,e.fillRect(h-c-N,m-d-N,N,N),e.fillStyle=F,e.fillRect(h-c-N+U,m-d-N+U,N-U,N-U)),C){const Ye=f,$e=m-d-ce;if(e.fillStyle=M,e.fillRect(0,$e,S,ce-U),e.fillStyle=ge?E:v,e.fillRect(0,$e+U,S,ce-U),n?e.fillStyle=L:ge?e.fillStyle=P:e.fillStyle=k,e.fillRect(Ye,$e+U,g,ce-U),!K&&H&&_!=null&&$!=null){e.fillStyle=_;const{selectedRanges:_e,cursorColumn:Ue}=t,{lastLeft:Je,columnCount:Le}=o,Vn=[..._e].filter(pe=>pe.startColumn!=null&&pe.endColumn!=null).map(pe=>[pe.startColumn,pe.endColumn]).sort(V.compareRanges),Jt=V.mergeSortedRanges(Vn),st=pe=>pe<=Je?pe/Je*(S-g):S-g+(pe-Je)/(Le-Je)*g;for(let pe=0;pe<Jt.length;pe+=1){const Ge=Jt[pe],Be=Ge[0],ut=Ge[1];if(Be!=null&&ut!=null&&(Be!==Ue||ut!==Ue)){const Mt=st(Be),Dt=Math.max(1,Math.round(st(ut+1)-Mt)),mt=ce-U;e.fillRect(Mt,$e+U+Math.round(mt/3),Dt,Math.round(mt/3))}}if(Ue!=null){const pe=st(Ue),Ge=2,Be=ce-U;e.fillStyle=$,e.fillRect(pe,$e+U,Ge,Be)}}}if(w){const Ye=h-c-Fe,$e=b;if(e.fillStyle=M,e.fillRect(Ye,0,Fe-U,I),e.fillStyle=ne?E:v,e.fillRect(Ye+U,0,Fe-U,I),s?e.fillStyle=L:ne?e.fillStyle=P:e.fillStyle=k,e.fillRect(Ye+U,$e,Fe-U,p),!j&&H&&_!=null&&$!=null){const{selectedRanges:_e,cursorRow:Ue}=t,{lastTop:Je,rowCount:Le}=o,Ht=pe=>pe<=Je?pe/Je*(I-p):I-p+(pe-Je)/(Le-Je)*p;e.fillStyle=_;const Jt=[..._e].filter(pe=>pe.startRow!=null&&pe.endRow!=null).map(pe=>[pe.startRow,pe.endRow]).sort(V.compareRanges),st=V.mergeSortedRanges(Jt);for(let pe=0;pe<st.length;pe+=1){const Ge=st[pe],Be=Ge[0],ut=Ge[1];if(Be!=null&&ut!=null&&(Be!==Ue||ut!==Ue)){const Mt=Ht(Be),Dt=Fe-U,mt=Math.max(1,Math.round(Ht(ut+1)-Mt));e.fillRect(Ye+U+Math.round(Dt/3),Mt,Math.round(Dt/3),mt)}}if(Ue!=null){const pe=Math.round(Ht(Ue)),Ge=Fe-U,Be=2;e.fillStyle=$,e.fillRect(Ye+U,pe,Ge,Be)}}}e.translate(-c,-d)}};let Es=ln;Es.DEFAULT_FONT_WIDTH=10;Es.DEFAULT_EDGE_RADIUS=2;Es.ACTIVE_CELL_BORDER_WIDTH=2;const Zr=100;class Uh extends Ze{constructor(){super(...arguments),this.hasExtendedFloating=!1}onDown(t,n,s){const{x:i,y:o,column:r,row:l}=t,{metrics:a}=n;if(!a)throw new Error("metrics not set");const{gridX:c,gridY:d,maxX:h,maxY:m}=a,p=i-c,g=o-d;if(p<0||g<0||r==null&&p>h||l==null&&g>m)return!1;const f=V.isModifierKeyDown(s),b=s.shiftKey;f||(b?n.trimSelectedRanges():n.clearSelectedRanges());const C=n.getTheme(),{autoSelectRow:w,autoSelectColumn:S}=C;return(r!==null||!S)&&(l!==null||!w)&&(n.focus(),n.moveCursorToPosition(r,l,b,!1,b&&f)),this.startPoint=t,this.hasExtendedFloating=!1,this.dragBounds=V.getScrollDragBounds(a,l,r),!0}onDrag(t,n){if(this.startPoint===void 0)return!1;this.stopTimer();const{row:s,column:i}=this.startPoint,{x:o,y:r}=t;let{row:l,column:a}=t;const{metrics:c}=n;if(!c)throw new Error("metrics not set");const{left:d,lastLeft:h,top:m,lastTop:p,columnWidth:g,rowHeight:f}=c,b=V.getScrollDragBounds(c,s,i);let C=0,w=0;if(d<h&&(o<b.x1?C=o-b.x1:o>b.x2&&(C=o-b.x2)),m<p&&(r<b.y1?w=r-b.y1:r>b.y2&&(w=r-b.y2)),C!==0||w!==0)this.startTimer(n,t,C>0?Math.ceil(C/g):Math.floor(C/g),w>0?Math.ceil(w/f):Math.floor(w/f));else if(l!=null&&a!=null){const{floatingTopRowCount:S,floatingBottomRowCount:I,floatingLeftColumnCount:v,floatingRightColumnCount:E,columnCount:M,rowCount:F,bottom:k,right:P,topVisible:L,bottomVisible:N,leftVisible:B,rightVisible:U}=c;this.hasExtendedFloating||(s!==null&&s<S&&l>=S?(l=S,this.hasExtendedFloating=!0):s!==null&&s>=F-I&&l<F-I&&(l=F-I-1,this.hasExtendedFloating=!0),i!==null&&i<v&&a>=v?(a=v,this.hasExtendedFloating=!0):i!==null&&i>=M-E&&a<M-E&&(a=M-E-1,this.hasExtendedFloating=!0)),s!==null&&!V.isFloatingRow(s,c)&&V.isFloatingRow(l,c)&&(s>l&&l<m?l=L-1:s<l&&l>k&&(l=N+1)),i!==null&&!V.isFloatingColumn(i,c)&&V.isFloatingColumn(a,c)&&(i>a&&a<d?a=B-1:i<a&&a>P&&(a=U+1)),n.moveCursorToPosition(a,l,!0,!0)}return!0}onUp(t,n){return this.startPoint!==void 0&&(this.startPoint=void 0,this.dragBounds=void 0,this.stopTimer(),n.commitSelection()),!1}moveSelection(t,n,s,i){const{row:o,column:r}=n,{metrics:l}=t;if(!l)throw new Error("metrics not set");const{selectionEndRow:a,selectionEndColumn:c}=t.state;if(a==null||c==null)throw new Error("selection not set");const{rowCount:d,columnCount:h}=l,m=s<0&&r!=null?r:0,p=s>0&&r!=null?r:h-1,g=i<0&&o!=null?o:0,f=i>0&&o!=null?o:d-1;t.moveCursorToPosition(Math.min(Math.max(m,c+s),p),Math.min(Math.max(g,a+i),f),!0),this.lastTriggerTime=Date.now()}startTimer(t,n,s,i){this.stopTimer();const o=this.lastTriggerTime!=null?Zr-Math.min(Zr,Date.now()-this.lastTriggerTime):0;this.timer=setTimeout(()=>{this.moveSelection(t,n,s,i),this.startTimer(t,n,s,i)},o)}stopTimer(){this.timer!==void 0&&(clearTimeout(this.timer),this.timer=void 0)}}const Jr=5,Bh=1e3/60,wi=10;function wn(e,t,n,s){var S,I,v,E,M,F,k;const{modelColumns:i,movedColumns:o,visibleColumnXs:r,columnCount:l,visibleColumnWidths:a,userColumnWidths:c,calculatedColumnWidths:d,floatingLeftWidth:h,maxX:m}=n;if(t==null||e==null||e>l||e<0)return null;const p=(S=i.get(e))!=null?S:V.getModelIndex(e,o),g=s.getColumnHeaderGroup(p,t),f=g!=null;let b,C,w;if(g!=null){const[P,L]=g.getVisibleRange(o);b=(I=r.get(P))!=null?I:h,C=((v=r.get(L))!=null?v:m)+((E=a.get(L))!=null?E:0),w=[P,L]}else{const P=r.get(e);if(P==null)return null;b=P,C=b+((k=(F=(M=a.get(e))!=null?M:c.get(p))!=null?F:d.get(p))!=null?k:0),w=[e,e]}return{visibleIndex:e,modelIndex:p,left:b,right:C,width:C-b,isColumnGroup:f,range:w,depth:t}}class Wh extends Ze{constructor(){super(...arguments),this.cursor=null,this.draggingColumn=null}setScrollInterval(t,n){this.scrollingInterval!=null&&n===this.scrollingDirection||(this.scrollingDirection=n,this.scrollingInterval=window.setInterval(()=>{var f,b;const{metrics:s}=t;if(!s)return;const{left:i,lastLeft:o,leftOffset:r,userColumnWidths:l,calculatedColumnWidths:a,movedColumns:c,visibleColumnWidths:d}=s;let h=i,m=r;if(n==="left")for(m-=wi;m<0;){h-=1;const C=V.getModelIndex(i-1,c),w=(f=l.get(C))!=null?f:a.get(C);w===void 0?m=0:m+=w,h<0&&(m=0,h=0)}else{m+=wi;let C=d.get(i);for(;C!==void 0&&m>C;){h+=1,m-=C;const w=V.getModelIndex(i+1,c);C=(b=l.get(w))!=null?b:a.get(w),h>o&&(m=0,h=o)}}const{mouseX:p,mouseY:g}=t.state;!s||p==null||g==null||(this.moveDraggingColumn(p,t,n==="left"?-wi:wi),t.setState({left:h,leftOffset:m}),(n==="left"&&h===0&&r===0||n==="right"&&h===o)&&this.clearScrollInterval())},Bh))}clearScrollInterval(){this.scrollingDirection=void 0,window.clearInterval(this.scrollingInterval),this.scrollingInterval=void 0}onLeave(){return this.clearScrollInterval(),!1}onDown(t,n){const{model:s}=n.props,{x:i,column:o,columnHeaderDepth:r}=t,{metrics:l}=n;if(!l)throw new Error("Metrics not set");const a=wn(o,r,l,s);if(o==null||a==null||r==null||r>0&&!a.isColumnGroup)return!1;const{rowHeaderWidth:c}=l;return this.initialGridPoint=t,this.draggingColumn=null,this.cursor=null,a.modelIndex!=null&&r!=null&&s.isColumnMovable(a.modelIndex,r)&&(this.draggingOffset=i-a.left-c,this.initialOffset=this.draggingOffset),!1}onDrag(t,n,s){if(this.draggingOffset===void 0||this.initialGridPoint===void 0||this.initialOffset===void 0)return!1;const{x:i,y:o}=t,{columnHeaderDepth:r}=this.initialGridPoint,{model:l}=n.props;let{draggingColumn:a}=this;const{metrics:c}=n;if(!c)throw new Error("Metrics not set");if(!a&&Math.abs(this.initialGridPoint.x-i)<Jr&&Math.abs(this.initialGridPoint.y-o)<Jr)return!1;if(a==null){const d=wn(this.initialGridPoint.column,r,c,l);if(!d||r==null||!l.isColumnMovable(d.modelIndex)||r>0&&!d.isColumnGroup||d.range[0]==null)return!1;a={range:d.range,depth:r,left:d.left,width:d.width};const h=wn(a.range[0],0,c,l),m=wn(a.range[1],0,c,l);if(!h||!m)return!1;this.draggingColumn=a,n.setState({draggingColumn:a,isDragging:!0})}return this.cursor="move",this.moveDraggingColumn(t.x,n,s.movementX),!0}moveDraggingColumn(t,n,s){var M,F,k,P,L;if(this.draggingOffset===void 0||this.initialGridPoint===void 0||this.initialOffset===void 0||this.draggingColumn==null||s===0)return;if(this.initialOffset!==this.draggingOffset){this.draggingOffset<this.initialOffset&&this.initialOffset<this.draggingOffset+s||this.draggingOffset>this.initialOffset&&this.initialOffset>this.draggingOffset+s?this.draggingOffset=this.initialOffset:this.draggingOffset+=s,this.draggingColumn={...this.draggingColumn,left:t-this.draggingOffset},n.setState({draggingColumn:this.draggingColumn});return}const{depth:i}=this.draggingColumn,{model:o}=n.props,{movedColumns:r}=n.state,{metrics:l}=n;if(!l)throw new Error("Metrics not set");const{floatingLeftWidth:a,width:c,columnHeaderMaxDepth:d,visibleColumnXs:h}=l,m=s<0,p=wn(this.draggingColumn.range[0],i,l,o);if(!p)return;const g=t-this.draggingOffset,f=g+p.width;this.draggingColumn={...this.draggingColumn,left:g},n.setState({draggingColumn:this.draggingColumn});const b=wn(V.getColumnAtX(lt(m?g:f,a,c),l,!0),i,l,o),C=o.getColumnHeaderParentGroup(p.modelIndex,p.depth);if(!b)return;if(C){const N=C.getVisibleRange(r);if(b.visibleIndex<N[0]){const B=this.moveColumn(p,N[0],r);this.draggingOffset=t-((M=h.get(N[0]))!=null?M:0),this.draggingColumn={...this.draggingColumn,left:t-this.draggingOffset},this.clearScrollInterval(),n.setState({draggingColumn:this.draggingColumn,movedColumns:B});return}if(b.visibleIndex>N[1]){const B=this.moveColumn(p,N[1]-(p.range[1]-p.range[0]),r),{right:U=0}=(F=wn(N[1],0,l,o))!=null?F:{};this.draggingOffset=t-(U-p.width),this.draggingColumn={...this.draggingColumn,left:t-this.draggingOffset},this.clearScrollInterval(),n.setState({draggingColumn:this.draggingColumn,movedColumns:B});return}}if(!o.isColumnMovable(b.modelIndex)){let N=b.visibleIndex;if(m)for(N+=1;N<p.visibleIndex&&!o.isColumnMovable(V.getModelIndex(N,r));)N+=1;else for(N-=1;N>p.visibleIndex&&!o.isColumnMovable(V.getModelIndex(N,r));)N-=1;if(N!==p.visibleIndex){m||(N-=p.range[1]-p.range[0]);const U=this.moveColumn(p,N,r);n.setState({movedColumns:U,draggingColumn:this.draggingColumn})}const B=wn(N,0,l,o);m?this.draggingOffset=t-((k=B==null?void 0:B.left)!=null?k:0):this.draggingOffset=t-(((P=B==null?void 0:B.right)!=null?P:0)-p.width),this.draggingColumn={...this.draggingColumn,left:t-this.draggingOffset},n.setState({draggingColumn:this.draggingColumn});return}if(g<=a?this.setScrollInterval(n,"left"):f>c?this.setScrollInterval(n,"right"):this.clearScrollInterval(),b.visibleIndex===p.visibleIndex||m&&p.visibleIndex<b.visibleIndex||!m&&p.visibleIndex>b.visibleIndex)return;const w=b.left+b.width*.5,S=o.getColumnHeaderParentGroup(p.modelIndex,p.depth);let I,v=((L=S==null?void 0:S.depth)!=null?L:d)-1;for(;v>=0&&I===void 0;)I=o.getColumnHeaderGroup(b.modelIndex,v),v-=1;let E;m&&g<w&&(!I||b.visibleIndex===I.getVisibleRange(r)[0])&&(E=this.moveColumn(p,b.range[0],r)),!m&&f>w&&(!I||b.visibleIndex===I.getVisibleRange(r)[1])&&(E=this.moveColumn(p,b.range[1]-(p.range[1]-p.range[0]),r)),E&&(this.draggingColumn={...this.draggingColumn,left:g},n.setState({movedColumns:E,draggingColumn:this.draggingColumn}))}moveColumn(t,n,s){const i=t.isColumnGroup?V.moveRange(t.range,n,s):V.moveItem(t.visibleIndex,n,s),o=n-t.range[0],r=[t.range[0]+o,t.range[1]+o];return this.draggingColumn&&(this.draggingColumn={...this.draggingColumn,range:r}),i}onUp(t,n){return this.cursor=null,this.clearScrollInterval(),this.draggingOffset!=null?(this.draggingOffset=void 0,n.setState({draggingColumn:null,isDragging:!1}),!0):!1}}class or extends Ze{constructor(){super(...arguments),this.cursor="default"}static getLeftWithOffsetFromRawLeft(t,n){const s=t.getTheme(),{metrics:i,metricCalculator:o}=t;if(!i)throw new Error("metrics not set");if(s.scrollSnapToColumn)return{left:Math.round(n),leftOffset:0};const r=Math.floor(n),l=n-r;let a=i.visibleColumnWidths.get(r);if(a==null){const d=t.getMetricState();a=o.getVisibleColumnWidth(r,d)}const c=a*l;return{left:r,leftOffset:c}}isInScrollBar(t,n){const s=n.getTheme(),{scrollBarSize:i,scrollBarHoverSize:o}=s,{metrics:r}=n;if(!r)throw new Error("metrics not set");const{x:l,y:a}=t,{barLeft:c,barWidth:d,height:h,hasHorizontalBar:m}=r;return m&&i>0&&a>=h-o&&a<h&&l>c&&l<c+d}getLeftWithOffset(t,n){var f;const{metrics:s}=n;if(!s)throw new Error("metrics not set");const{x:i}=t,{barWidth:o,handleWidth:r,lastLeft:l,barLeft:a,columnCount:c,scrollableContentWidth:d,scrollableViewportWidth:h}=s,m=i-a,p=lt((m-((f=this.dragOffset)!=null?f:0))/(o-r),0,1);if(c===1)return{left:0,leftOffset:p*(d-h)};const g=p*l;return or.getLeftWithOffsetFromRawLeft(n,g)}onDown(t,n){const{metrics:s}=n;if(!s)throw new Error("metrics not set");const{x:i}=t,{handleWidth:o,barLeft:r,scrollX:l}=s;if(!this.isInScrollBar(t,n))return!1;const a=i-r;if(a>=l&&a<=l+o)this.dragOffset=a-l,n.setState({isDraggingHorizontalScrollBar:!0});else{this.dragOffset=0;const{left:c,leftOffset:d}=this.getLeftWithOffset(t,n);n.setViewState({left:c,leftOffset:d,isDraggingHorizontalScrollBar:!0,isDragging:!0})}return!0}onDrag(t,n){if(this.dragOffset!=null){const{left:s,leftOffset:i}=this.getLeftWithOffset(t,n);return n.setViewState({left:s,leftOffset:i,isDraggingHorizontalScrollBar:!0,isDragging:!0}),!0}return!1}onMove(t,n){return this.isInScrollBar(t,n)}onUp(t,n){return this.dragOffset!==void 0&&(this.dragOffset=void 0,n.setState({isDraggingHorizontalScrollBar:!1,isDragging:!1})),this.isInScrollBar(t,n)}onClick(t,n){return this.isInScrollBar(t,n)}}class zh extends Ze{constructor(){super(...arguments),this.cursor="move"}onDown(t,n){const{model:s}=n.props,{x:i,y:o,row:r}=t,{metrics:l}=n;if(!l)throw new Error("metrics not set");const{columnHeaderHeight:a,rowHeaderWidth:c,visibleRowYs:d}=l;if(i<=c&&r!==null&&s.isRowMovable(r)){const h=A(d,r);this.draggingOffset=o-h-a,n.setState({draggingRowOffset:this.draggingOffset})}return!1}onDrag(t,n){if(this.draggingOffset==null)return!1;const{model:s}=n.props;let{draggingRow:i}=n.state;const{mouseX:o,mouseY:r}=n.state;if(o==null||r==null)return!1;if(i==null){const{row:E}=n.getGridPointFromXY(o,r);if(E!=null&&!s.isRowMovable(E)||(i=E,n.setState({draggingRow:i,isDragging:!0}),i==null))return!1}const{metrics:l}=n;if(!l)throw new Error("metrics not set");const{top:a,lastTop:c,bottom:d,bottomVisible:h,rowCount:m,columnHeaderHeight:p,visibleRowHeights:g,visibleRowYs:f,height:b}=l;let C=p;if(a<i){const E=i-1;C=A(f,E)+A(g,E)*.5+p}let w=b;if(i<d){const E=i+1;w=A(f,E)+A(g,E)*.5+p}let{movedRows:S}=n.state;r<C&&i>0&&s.isRowMovable(i-1)?(S=V.moveItem(i,i-1,S),i-=1):w<r&&i<m-1&&s.isRowMovable(i+1)&&(S=V.moveItem(i,i+1,S),i+=1),n.setState({movedRows:S,draggingRow:i});const I=p+A(g,a)*.5,v=p+A(f,h)+A(g,h)*.5;return r<I&&a>0?n.setState({top:a-1}):r>v&&a<c&&n.setState({top:a+1}),!0}onUp(t,n){return this.draggingOffset!==void 0?(this.draggingOffset=void 0,n.setState({draggingRowOffset:null,draggingRow:null,isDragging:!1}),!0):!1}}class rr extends da{constructor(){super(...arguments),this.hiddenCursor="s-resize",this.defaultCursor="row-resize",this.pointProperty="y",this.userSizesProperty="userRowHeights",this.visibleOffsetProperty="visibleRowYs",this.visibleSizesProperty="visibleRowHeights",this.marginProperty="columnHeaderHeight",this.calculatedSizesProperty="calculatedRowHeights",this.modelIndexesProperty="modelRows",this.firstIndexProperty="firstRow",this.treePaddingProperty="treePaddingY",this.getHiddenItems=V.getHiddenRows,this.getNextShownItem=V.getNextShownRow,this.getSeparator=rr.getRowSeparator}static getRowSeparator(t,n,s,i){if(!i.allowRowResize)return null;const{x:o,y:r}=t,l=V.getRowSeparatorIndex(o,r,n,i);return l!=null?{index:l,depth:0}:null}setSize(t,n,s){t.setRowHeight(n,s)}resetSize(t,n){t.resetRowHeight(n)}updateSeparator(t,n){t.setState({draggingRowSeparator:n,isDragging:n!==null})}}class ki extends Ze{static isInTreeBox(t,n){const{column:s,row:i,x:o,y:r}=t,{metrics:l}=n;if(!l)throw new Error("metrics not set");const{gridX:a,gridY:c,firstColumn:d,visibleColumnXs:h,visibleColumnWidths:m,visibleRowHeights:p,visibleRowYs:g,visibleRowTreeBoxes:f}=l;if(s===d&&i!=null&&f.get(i)!=null&&o>a&&r>c){const b=A(h,s),C=A(m,s),w=A(g,i),S=A(p,i);if(o>=a+b&&o<=a+b+C&&r>=c+w&&r<=c+w+S)return!0}return!1}onDown(t,n){return ki.isInTreeBox(t,n)}onClick(t,n){if(ki.isInTreeBox(t,n)){const{row:s}=t;if(s!==null)return n.toggleRowExpanded(s),!0}return!1}}class $h extends Ze{isInCorner(t,n){const s=n.getTheme(),{scrollBarSize:i}=s,{metrics:o}=n;if(!o)throw new Error("metrics not set");const{x:r,y:l}=t,{width:a,height:c,hasVerticalBar:d,hasHorizontalBar:h}=o;return i>0&&d&&h&&r>=a-i&&l>=c-i&&r<=a&&l<=c}onDown(t,n){return this.isInCorner(t,n)}onUp(t,n){return this.isInCorner(t,n)}onClick(t,n){return this.isInCorner(t,n)}}class lr extends Ze{constructor(){super(...arguments),this.cursor="default"}static getTopWithOffsetFromRawTop(t,n){const s=t.getTheme(),{metrics:i,metricCalculator:o}=t;if(!i)throw new Error("metrics not set");if(s.scrollSnapToRow)return{top:Math.round(n),topOffset:0};const r=Math.floor(n),l=n-r;let a=i.visibleRowHeights.get(r);if(a==null){const d=t.getMetricState();a=o.getVisibleRowHeight(r,d)}const c=a*l;return{top:r,topOffset:c}}isInScrollBar(t,n){const s=n.getTheme(),{scrollBarSize:i,scrollBarHoverSize:o}=s,{metrics:r}=n;if(!r)throw new Error("metrics not set");const{x:l,y:a}=t,{barTop:c,barHeight:d,width:h,hasVerticalBar:m}=r;return m&&i>0&&l>=h-o&&l<h&&a>c&&a<c+d}getTopWithOffset(t,n){var f;const{metrics:s}=n;if(!s)throw new Error("metrics not set");const{y:i}=t,{barHeight:o,handleHeight:r,lastTop:l,barTop:a,rowCount:c,scrollableContentHeight:d,scrollableViewportHeight:h}=s,m=i-a,p=lt((m-((f=this.dragOffset)!=null?f:0))/(o-r),0,1);if(c===1)return{top:0,topOffset:p*(d-h)};const g=p*l;return lr.getTopWithOffsetFromRawTop(n,g)}onDown(t,n){const{metrics:s}=n;if(!s)throw new Error("metrics not set");const{y:i}=t,{handleHeight:o,barTop:r,scrollY:l}=s;if(!this.isInScrollBar(t,n))return!1;const a=i-r;if(a>=l&&a<=l+o)this.dragOffset=a-l,n.setState({isDraggingVerticalScrollBar:!0});else{this.dragOffset=0;const{top:c,topOffset:d}=this.getTopWithOffset(t,n);n.setViewState({top:c,topOffset:d,isDraggingVerticalScrollBar:!0,isDragging:!0})}return!0}onMove(t,n){return this.isInScrollBar(t,n)}onDrag(t,n){if(this.dragOffset!=null){const{top:s,topOffset:i}=this.getTopWithOffset(t,n);return n.setViewState({top:s,topOffset:i,isDraggingVerticalScrollBar:!0,isDragging:!0}),!0}return!1}onUp(t,n){return this.dragOffset!==void 0&&(this.dragOffset=void 0,n.setState({isDraggingVerticalScrollBar:!1,isDragging:!1})),this.isInScrollBar(t,n)}onClick(t,n){return this.isInScrollBar(t,n)}}class Gh extends Ze{onDoubleClick({column:t,row:n},s){const{model:i}=s.props;return Ae(i)&&t!=null&&n!=null&&i.isEditableRange(Y.makeCell(t,n))?(s.startEditing(t,n),!0):!1}}class us{constructor(t=5e3){this.order=t}onDown(t,n){return!1}}class qh extends us{onDown(t,n){switch(t.key){case"a":if(V.isModifierKeyDown(t))return n.selectAll(),!0;break;case"ArrowUp":return this.handleArrowMove(0,-1,t,n);case"ArrowDown":return this.handleArrowMove(0,1,t,n);case"ArrowRight":return this.handleArrowMove(1,0,t,n);case"ArrowLeft":return this.handleArrowMove(-1,0,t,n);case"k":case"K":return V.isModifierKeyDown(t)?!1:this.handlePageUp(t,n);case"j":case"J":return V.isModifierKeyDown(t)?!1:this.handlePageDown(t,n);case"h":case"H":return V.isModifierKeyDown(t)?!1:(t.shiftKey||n.clearSelectedRanges(),n.moveCursorToPosition(0,n.state.cursorRow,t.shiftKey),!0);case"l":case"L":{if(V.isModifierKeyDown(t))return!1;const{model:s}=n.props,{columnCount:i}=s;return t.shiftKey||n.clearSelectedRanges(),n.moveCursorToPosition(i-1,n.state.cursorRow,t.shiftKey),!0}case"PageDown":return this.handlePageDown(t,n);case"PageUp":return this.handlePageUp(t,n);case"Home":return t.shiftKey||n.clearSelectedRanges(),n.moveCursorToPosition(V.isModifierKeyDown(t)?n.state.cursorColumn:0,V.isModifierKeyDown(t)?0:n.state.cursorRow,t.shiftKey,!0,!0),!0;case"End":{const{model:s}=n.props,{columnCount:i,rowCount:o}=s;return t.shiftKey||n.clearSelectedRanges(),n.moveCursorToPosition(V.isModifierKeyDown(t)?n.state.cursorColumn:i-1,V.isModifierKeyDown(t)?o-1:n.state.cursorRow,t.shiftKey,!0,!0),!0}case"Escape":return n.clearSelectedRanges(),!0;case"Enter":if(n.state.selectedRanges.length>0)return n.moveCursorInDirection(t.shiftKey?Y.SELECTION_DIRECTION.UP:Y.SELECTION_DIRECTION.DOWN),!0;break;case"Tab":if(n.state.selectedRanges.length>0)return n.moveCursorInDirection(t.shiftKey?Y.SELECTION_DIRECTION.LEFT:Y.SELECTION_DIRECTION.RIGHT),!0;break}return!1}handleArrowMove(t,n,s,i){const o=s.shiftKey,r=V.isModifierKeyDown(s);o?i.trimSelectedRanges():i.clearSelectedRanges();const{cursorRow:l,cursorColumn:a,selectionEndColumn:c,selectionEndRow:d}=i.state,h=o?c:a,m=o?d:l;if(r){const{model:p}=i.props,{columnCount:g,rowCount:f}=p,b=r&&o;let C=null,w=null;t<0?(C=0,w=m):t>0?(C=g-1,w=m):n<0?(C=h,w=0):n>0&&(C=h,w=f-1),C!=null&&w!=null&&i.moveCursorToPosition(C,w,o,!0,b)}else{if(!i.metrics)throw new Error("grid.metrics are not set");const{theme:p}=i.props,{autoSelectRow:g,autoSelectColumn:f}=p;if(g&&t!==0){const{lastLeft:b}=i.metrics;let{left:C}=i.state;C=lt(C+t,0,b),i.moveCursorToPosition(C,l,o,!1),i.setViewState({left:C})}else if(f&&n!==0){const{lastTop:b}=i.metrics;let{top:C}=i.state;C=lt(C+n,0,b),i.moveCursorToPosition(C,a,o,!1),i.setViewState({top:C})}else i.moveCursor(t,n,o)}return!0}handlePageUp(t,n){const s=t.shiftKey;s?n.trimSelectedRanges():n.clearSelectedRanges();const{cursorColumn:i,selectionEndRow:o}=n.state,r=o,l=i;if(r==null)return!1;const a=n.getMetricState(),{metricCalculator:c}=n,{bottomVisible:d,topVisible:h,hasHorizontalBar:m}=c.getMetrics(a);let p=r-(d-h);p-=m?0:1,p=Math.max(p,0);const g=Math.max(p-(r-h),0);return n.moveCursorToPosition(l,p,s,!1),n.setViewState({top:g}),!0}handlePageDown(t,n){const s=t.shiftKey;s?n.trimSelectedRanges():n.clearSelectedRanges();const{selectionEndRow:i,cursorColumn:o}=n.state,r=i,l=o;if(r===null)return!1;const a=n.getMetricState(),{metricCalculator:c}=n,{bottomVisible:d,topVisible:h,hasHorizontalBar:m,rowCount:p,lastTop:g}=c.getMetrics(a),f=p-1;let b=d-h+r;b+=m?0:1,b=Math.min(b,f);const C=Math.min(g,b-(r-h));return n.moveCursorToPosition(l,b,s,!1),n.setViewState({top:C}),!0}}class Kh extends us{onDown(t,n){switch(t.key){case"Enter":case" ":return this.handleExpandKey(t,n)}return!1}handleExpandKey(t,n){const{selectedRanges:s}=n.state;if(s.length===1){const i=s[0];if(i.startRow===i.endRow&&i.startColumn===i.endColumn){if(!n.metrics)throw new Error("grid.metrics not set");const{model:o}=n.props,{startRow:r,startColumn:l}=i;if(r!=null){const a=n.getModelRow(r);if((l===0||l==null)&&Xe(o)&&o.isRowExpandable(a))return n.toggleRowExpanded(r),!0}}}return!1}}class Xh extends us{onDown(t,n){if(V.isModifierKeyDown(t))return!1;const{model:s}=n.props,{cursorColumn:i,cursorRow:o}=n.state;if(i==null||o==null||!Ae(s)||!s.isEditableRange(Y.makeCell(i,o)))return!1;const r=i,l=o;return r==null||l==null?!1:t.key.length===1?(n.startEditing(r,l,!0,[1,1],t.key),!0):t.key==="F2"?(n.startEditing(r,l),!0):t.key==="Backspace"?(n.startEditing(r,l,!0,void 0,""),!0):t.key==="Delete"?(n.setValueForCell(r,l,""),!0):!1}}function Yh(e){var s,i;const t=[],n=e.querySelectorAll("tr");for(let o=0;o<n.length;o+=1){const l=n[o].querySelectorAll("td"),a=[];for(let c=0;c<l.length;c+=1){const d=l[c];a.push((i=(s=d.textContent)==null?void 0:s.trim())!=null?i:"")}t.push(a)}return t}function Qh(e){const t=[];return e.forEach(n=>{var i;const s=(i=n.textContent)!=null?i:"";s.length>0&&t.push(s.split(/\t|\u00a0\u00a0 \u00a0/))}),t}function jh(e){var s,i,o;const t=e.querySelector("table");if(t!=null)return Yh(t);const n=(i=(s=e.textContent)==null?void 0:s.trim())!=null?i:"";if(n.length>0){const{childNodes:r}=e,l=n.includes(" "),a=n.includes("\xA0\xA0 \xA0");return l&&r.length!==0&&(r.length===1||r.length>1&&!((o=r[0].textContent)!=null&&o.includes(" ")))?n.split(`
|
|
2
2
|
`).map(c=>c.split(" ")):r.length>1||a?Qh(e.childNodes):n}return null}class Zh extends us{onDown(t,n){switch(t.key){case"v":if(V.isModifierKeyDown(t)){const s=document.createElement("div");document.body.appendChild(s),s.setAttribute("contenteditable","true"),s.setAttribute("style",'clip-path: "inset(50%)"; height: 1px; width: 1px; margin: -1px; overflow: hidden; padding 0; position: absolute;');const i=()=>{s.removeEventListener("input",i),s.remove(),n.focus();const o=jh(s);o!=null&&n.pasteValue(o)};return s.addEventListener("input",i),s.focus(),{preventDefault:!1,stopPropagation:!0}}break}return!1}}const Jh=e=>{switch(e){case"ArrowDown":return Lt.DOWN;case"ArrowUp":return Lt.UP;case"ArrowLeft":return Lt.LEFT;case"ArrowRight":return Lt.RIGHT;default:return}},ar=({selectionRange:e=void 0,className:t="",disabled:n=!1,value:s="",isQuickEdit:i=!0,onChange:o=()=>{},onCancel:r=()=>{},onDone:l=()=>{},onContextMenu:a=()=>{},style:c={}})=>{const d=R.exports.useRef(null),h=R.exports.useRef(!1),[m]=R.exports.useState(s),[p,g]=R.exports.useState(!1),[f,b]=R.exports.useState(i),[C,w]=R.exports.useState(s);R.exports.useEffect(function(){const{current:N}=d;N!=null&&(N.focus(),e?N.setSelectionRange(e[0],e[1]):N.setSelectionRange(N.value.length,N.value.length))},[e]);const S=R.exports.useCallback(L=>{o(L)},[o]),I=R.exports.useCallback(L=>{const{value:N}=L.target;w(N),g(!0),S(N)},[S,w,g]),v=R.exports.useCallback(()=>{h.current=!0,p&&S(m),g(!1),r()},[m,p,r,S]),E=R.exports.useCallback(()=>{b(!1)},[b]),M=R.exports.useCallback((L,N=!1)=>{l(C,{direction:L,fillRange:N})},[l,C]),F=R.exports.useCallback(()=>{h.current||M(null)},[h,M]),k=R.exports.useCallback(L=>{switch(L.stopPropagation(),L.key){case"Escape":L.preventDefault(),v();break;case"Enter":if(L.preventDefault(),V.isModifierKeyDown(L))M(void 0,!0);else if(L.altKey){const N=`${C}
|
|
3
3
|
`;w(N),g(!0),S(N)}else M(L.shiftKey?Lt.UP:Lt.DOWN);break;case"Tab":L.preventDefault(),M(L.shiftKey?Lt.LEFT:Lt.RIGHT);break;case"ArrowDown":case"ArrowUp":case"ArrowLeft":case"ArrowRight":f&&(L.preventDefault(),M(Jh(L.key)));break}},[v,M,f,w,g,S,C]),P=R.exports.useCallback(L=>{a(L)},[a]);return u("textarea",{ref:d,className:z("grid-cell-input-field",t),value:C,onBlur:F,onChange:I,onKeyDown:k,onContextMenu:P,onClick:E,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false",disabled:n,style:c})};ar.propTypes={selectionRange:D.exports.arrayOf(D.exports.number),className:D.exports.string,disabled:D.exports.bool,isQuickEdit:D.exports.bool,value:D.exports.string,onChange:D.exports.func,onCancel:D.exports.func,onDone:D.exports.func,onContextMenu:D.exports.func,style:D.exports.shape({})};ar.defaultProps={selectionRange:null,className:"",disabled:!1,value:"",isQuickEdit:!0,onChange:()=>{},onCancel:()=>{},onDone:()=>{},onContextMenu:()=>{},style:{}};const eu=Q.createContext({}),Jn=class extends R.exports.PureComponent{constructor(e){super(e),this.getCachedKeyHandlers=De(l=>[...l,...this.keyHandlers].sort((a,c)=>a.order-c.order)),this.getCachedMouseHandlers=De(l=>[...l,...this.mouseHandlers].sort((a,c)=>a.order-c.order)),this.handleClick=this.handleClick.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleEditCellCancel=this.handleEditCellCancel.bind(this),this.handleEditCellChange=this.handleEditCellChange.bind(this),this.handleEditCellCommit=this.handleEditCellCommit.bind(this),this.handleDoubleClick=this.handleDoubleClick.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseDrag=this.handleMouseDrag.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleResize=this.handleResize.bind(this),this.handleWheel=this.handleWheel.bind(this);const{isStuckToBottom:t,isStuckToRight:n,metricCalculator:s,movedColumns:i,movedRows:o,renderer:r}=e;this.renderer=r||new Es,this.metricCalculator=s||new Qs,this.canvas=null,this.canvasContext=null,this.animationFrame=null,this.prevMetrics=null,this.metrics=null,this.documentCursor=null,this.dragTimer=null,this.keyHandlers=[new Xh(400),new Zh(450),new qh(500),new Kh(900)],this.mouseHandlers=[new rr(100),new Yi(200),new zh(300),new Wh(400),new Gh(450),new lr(500),new or(600),new $h(700),new ki(800),new Uh(900)],this.state={top:0,left:0,topOffset:0,leftOffset:0,draggingColumn:null,draggingRow:null,draggingRowOffset:null,draggingColumnSeparator:null,draggingRowSeparator:null,isDraggingHorizontalScrollBar:!1,isDraggingVerticalScrollBar:!1,isDragging:!1,mouseX:null,mouseY:null,movedColumns:i,movedRows:o,cursorRow:null,cursorColumn:null,selectionStartRow:null,selectionStartColumn:null,selectionEndRow:null,selectionEndColumn:null,selectedRanges:[],lastSelectedRanges:[],cursor:null,editingCell:null,isStuckToBottom:t,isStuckToRight:n}}static getScale(e){const t=window.devicePixelRatio||1,n=e,s=n.webkitBackingStorePixelRatio||n.mozBackingStorePixelRatio||n.msBackingStorePixelRatio||n.oBackingStorePixelRatio||n.backingStorePixelRatio||1;return t/s}static getCursorClassName(e){return e?`grid-cursor-${e}`:null}componentDidMount(){var e;this.initContext(),(e=this.canvas)==null||e.addEventListener("wheel",this.handleWheel,{passive:!1}),window.addEventListener("resize",this.handleResize),this.updateCanvasScale(),this.updateCanvas()}componentDidUpdate(e,t){const{isStickyBottom:n,isStickyRight:s,movedColumns:i,movedRows:o,onMovedColumnsChanged:r,onMoveColumnComplete:l,onMovedRowsChanged:a,onMoveRowComplete:c}=this.props,{isStickyBottom:d,isStickyRight:h,movedColumns:m,movedRows:p}=e,{movedColumns:g,movedRows:f}=t,{draggingColumn:b,draggingRow:C,movedColumns:w,movedRows:S}=this.state;if(m!==i&&this.setState({movedColumns:i}),p!==o&&this.setState({movedRows:o}),g!==w&&r(w),t.draggingColumn!=null&&b==null&&l(w),f!==S&&a(S),t.draggingRow!=null&&C==null&&c(S),n!==d&&this.setState({isStuckToBottom:!1}),s!==h&&this.setState({isStuckToRight:!1}),this.updateMetrics(),this.requestUpdateCanvas(),!this.metrics||!this.prevMetrics)return;const{bottomVisible:I,rightVisible:v,rowCount:E,columnCount:M,top:F,left:k,height:P,width:L}=this.metrics,{rowCount:N,columnCount:B,height:U,width:H}=this.prevMetrics,_=this.getMetricState();if(N!==E||P!==U){const $=this.metricCalculator.getLastTop(_),{isStuckToBottom:K}=this.state;(K&&I<E-1&&I>0||F>$)&&this.setState({top:$})}if(B!==M||L!==H){const $=this.metricCalculator.getLastLeft(_),{isStuckToRight:K}=this.state;(K&&v<M-1&&v>0||k>$)&&this.setState({left:$})}this.validateSelection()&&this.checkSelectionChange(t)}componentWillUnmount(){var e;this.animationFrame!=null&&cancelAnimationFrame(this.animationFrame),(e=this.canvas)==null||e.removeEventListener("wheel",this.handleWheel),window.removeEventListener("mousemove",this.handleMouseDrag,!0),window.removeEventListener("mouseup",this.handleMouseUp,!0),window.removeEventListener("resize",this.handleResize),this.stopDragTimer()}getTheme(){const{theme:e}=this.props;return Jn.getTheme(this.context,e)}getGridPointFromEvent(e){Xr(this.canvas);const t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left,s=e.clientY-t.top;return this.getGridPointFromXY(n,s)}getGridPointFromXY(e,t){if(!this.metrics)throw new Error("metrics must be set");return V.getGridPointFromXY(e,t,this.metrics)}getMetricState(e=this.state){const t=this.getTheme(),{model:n,stateOverride:s}=this.props;if(!this.canvasContext||!this.canvas)throw new Error("Canvas and context must be defined to get metrics");const i=this.canvasContext,o=this.canvas.clientWidth,r=this.canvas.clientHeight,{left:l,top:a,leftOffset:c,topOffset:d,movedColumns:h,movedRows:m,isDraggingHorizontalScrollBar:p,isDraggingVerticalScrollBar:g,draggingColumn:f}=e;return{left:l,top:a,leftOffset:c,topOffset:d,width:o,height:r,context:i,theme:t,model:n,movedColumns:h,movedRows:m,isDraggingHorizontalScrollBar:p,isDraggingVerticalScrollBar:g,draggingColumn:f,...s}}getKeyHandlers(){const{keyHandlers:e}=this.props;return this.getCachedKeyHandlers(e)}getMouseHandlers(){const{mouseHandlers:e}=this.props;return this.getCachedMouseHandlers(e)}getModelColumn(e){var n,s;const t=(s=(n=this.metrics)==null?void 0:n.modelColumns)==null?void 0:s.get(e);if(t===void 0)throw new Error(`Unable to get ModelIndex for column ${e}`);return t}getModelRow(e){var n,s;const t=(s=(n=this.metrics)==null?void 0:n.modelRows)==null?void 0:s.get(e);if(t===void 0)throw new Error(`Unable to get ModelIndex for row ${e}`);return t}toggleRowExpanded(e){const t=this.getModelRow(e),{model:n}=this.props;Xe(n)&&n.isRowExpandable(t)&&n.setRowExpanded(t,!n.isRowExpanded(t)),this.clearSelectedRanges(),this.commitSelection(),this.moveCursorToPosition(0,e),this.commitSelection(),this.setState({isStuckToBottom:!1})}setSelectedRanges(e){const{model:t}=this.props,{columnCount:n,rowCount:s}=t,{cursorRow:i,cursorColumn:o,selectedRanges:r}=this.state;if(this.setState({selectedRanges:e,lastSelectedRanges:r}),e.length>0){const l=Y.boundedRange(e[0],n,s);let a=i,c=o;l.containsCell(o,i)||({row:a,column:c}=l.startCell()),this.setState({selectionStartColumn:l.startColumn,selectionStartRow:l.startRow,selectionEndColumn:l.endColumn,selectionEndRow:l.endRow,cursorColumn:c,cursorRow:a})}}initContext(){const{canvas:e}=this,{canvasOptions:t}=this.props;if(!e)throw new Error("Canvas not set");this.canvasContext=e.getContext("2d",t)}requestUpdateCanvas(){this.animationFrame==null&&(this.animationFrame=requestAnimationFrame(()=>{if(this.animationFrame=null,!this.metrics)throw new Error("Metrics not set");this.updateCanvas(this.metrics)}))}updateCanvas(e=this.updateMetrics()){this.updateCanvasScale();const{onViewChanged:t}=this.props;t(e),this.drawCanvas(e)}updateCanvasScale(){const{canvas:e,canvasContext:t}=this;if(!e)throw new Error("canvas not set");if(!t)throw new Error("canvasContext not set");if(!e.parentElement)throw new Error("Canvas has no parent element");const n=Jn.getScale(t),s=e.parentElement.getBoundingClientRect(),i=Math.floor(s.width),o=Math.floor(s.height);e.style.width=`${i}px`,e.style.height=`${o}px`,e.width=i*n,e.height=o*n,t.scale(n,n)}updateMetrics(e=this.state){this.prevMetrics=this.metrics;const{metricCalculator:t}=this,n=this.getMetricState(e);return this.metrics=t.getMetrics(n),this.metrics}checkSelectionChange(e){const{selectedRanges:t}=e,{selectedRanges:n}=this.state;if(n!==t){const{onSelectionChanged:s}=this.props;s(n)}}validateSelection(){const{model:e}=this.props,{selectedRanges:t}=this.state,{columnCount:n,rowCount:s}=e;for(let i=0;i<t.length;i+=1){const o=t[i];if(o.endColumn!=null&&o.endColumn>=n||o.endRow!=null&&o.endRow>=s)return this.setState({selectedRanges:[],lastSelectedRanges:[]}),!1}return!0}clearSelectedRanges(){const{selectedRanges:e}=this.state;this.setState({selectedRanges:[],lastSelectedRanges:e})}trimSelectedRanges(){const{selectedRanges:e}=this.state;e.length>0&&this.setState({selectedRanges:e.slice(e.length-1)})}beginSelection(e,t){this.setState({selectionStartColumn:e,selectionStartRow:t,selectionEndColumn:e,selectionEndRow:t,cursorColumn:e,cursorRow:t})}moveSelection(e,t,n=!1,s=!1){this.setState(i=>{var g,f,b,C;const{selectedRanges:o,selectionStartRow:r,selectionStartColumn:l}=i,{theme:a}=this.props,{autoSelectRow:c,autoSelectColumn:d}=a;if(n&&o.length>0){const w=o[o.length-1];let S=null,I=null,v=null,E=null;s?(S=c?null:Math.min(e!=null?e:0,(g=w.startColumn)!=null?g:0),I=d?null:Math.min(t!=null?t:0,(f=w.startRow)!=null?f:0),v=c?null:Math.max(e!=null?e:0,(b=w.endColumn)!=null?b:0),E=d?null:Math.max(t!=null?t:0,(C=w.endRow)!=null?C:0)):(S=w.startColumn,I=w.startRow,(l!=null||r!=null)&&(c||(S=l),d||(I=r)),v=c?null:e,E=d?null:t);const M=Y.makeNormalized(S,I,v,E);if(w.equals(M))return null;const F=[...o];return F[F.length-1]=M,{selectedRanges:F,selectionEndColumn:e,selectionEndRow:t}}const h=[...o],m=c?null:e,p=d?null:t;return h.push(Y.makeNormalized(m,p,m,p)),{selectedRanges:h,selectionEndColumn:e,selectionEndRow:t}})}commitSelection(){this.setState(e=>{const{theme:t}=this.props,{autoSelectRow:n}=t,{selectedRanges:s,lastSelectedRanges:i,cursorRow:o,cursorColumn:r}=e;if(s.length===1&&(n?Y.rowCount(s)===1:Y.cellCount(s)===1)&&Y.rangeArraysEqual(s,i))return{selectedRanges:[],lastSelectedRanges:[],cursorColumn:r,cursorRow:o};let l=s.slice();if(l.length>1){const d=l[l.length-1];for(let h=0;h<l.length-1;h+=1){const m=l[h];if(m.contains(d)){const p=m.subtract(d);l.pop(),l.splice(h,1),l=l.concat(p);break}}l=Y.consolidate(l)}let a=r,c=o;if(!Y.containsCell(l,r,o)){const{model:d}=this.props,{columnCount:h,rowCount:m}=d,p=Y.nextCell(Y.boundedRanges(s,h,m));p!=null?{column:a,row:c}=p:(a=null,c=null)}return{cursorRow:c,cursorColumn:a,selectedRanges:l,lastSelectedRanges:s}})}setFocusRow(e){var h;if(!this.metrics||!this.prevMetrics)return;const{gridY:t,height:n,lastTop:s,userRowHeights:i,rowHeight:o}=this.metrics,r=n-t,l=Math.round(r/2)+((h=i.get(e))!=null?h:o),a=this.getMetricState(),c=this.metricCalculator.getLastTop(a,e+1,l);this.setState({top:Math.min(s,c),selectedRanges:[new Y(null,e,null,e)]});const{cursorColumn:d}=this.state;this.moveCursorToPosition(d,e,!1,!1)}selectAll(){const{model:e,theme:t}=this.props,{autoSelectRow:n,autoSelectColumn:s}=t,i=s?null:0,o=s?null:e.rowCount-1,r=n?null:0,l=n?null:e.columnCount-1;this.setSelectedRanges([new Y(r,i,l,o)])}moveCursor(e,t,n){const{cursorRow:s,cursorColumn:i,selectionEndColumn:o,selectionEndRow:r}=this.state,l=n?o:i,a=n?r:s;if(a===null||l===null){const{left:c,top:d}=this.state;this.moveCursorToPosition(c,d,n)}else{const{model:c}=this.props,{columnCount:d,rowCount:h}=c,m=lt(l+e,0,d-1),p=lt(a+t,0,h-1);this.moveCursorToPosition(m,p,n)}}moveCursorInDirection(e=Y.SELECTION_DIRECTION.DOWN){var c;const{model:t}=this.props,{columnCount:n,rowCount:s}=t,{cursorRow:i,cursorColumn:o,selectedRanges:r}=this.state,l=r.length>0?r:[Y.makeCell(o,i)];let a=null;if(l.length===1&&Y.cellCount(l)===1){const d=new Y(0,0,n-1,s-1);a=(c=d.nextCell(o,i,e))!=null?c:d.startCell(e)}else a=Y.nextCell(Y.boundedRanges(l,n,s),o,i,e);if(a!=null){const{column:d,row:h}=a;this.setState({cursorColumn:d,cursorRow:h}),Y.containsCell(r,d,h)||this.setState({selectedRanges:[Y.makeCell(d,h)],selectionStartColumn:d,selectionStartRow:h,selectionEndColumn:d,selectionEndRow:h}),this.moveViewToCell(a.column,a.row)}}moveCursorToPosition(e,t,n=!1,s=!0,i=!1){n||this.beginSelection(e,t),this.moveSelection(e,t,n,i),s&&this.moveViewToCell(e,t)}moveViewToCell(e,t){if(!this.metrics)throw new Error("metrics not set");const{metricCalculator:n}=this,{bottomVisible:s,rightVisible:i,topVisible:o,leftVisible:r}=this.metrics,l=this.getMetricState(this.state);let{top:a,left:c,topOffset:d,leftOffset:h}=this.state;t!=null&&!V.isFloatingRow(t,this.metrics)&&(t<o?(a=n.getTopForTopVisible(l,t),d=0):t>s&&(a=n.getTopForBottomVisible(l,t),d=0)),e!=null&&!V.isFloatingColumn(e,this.metrics)&&(e<r?(c=n.getLeftForLeftVisible(l,e),h=0):e>i&&(c=n.getLeftForRightVisible(l,e),h=0)),this.setViewState({top:a,left:c,topOffset:d,leftOffset:h})}setViewState(e,t=!1){if(!this.metrics)throw new Error("metrics not set");const{isStickyBottom:n,isStickyRight:s}=this.props,{top:i,left:o}=e,{lastTop:r,lastLeft:l}=this.metrics;i!=null&&this.setState({isStuckToBottom:n&&i>=r}),o!=null&&this.setState({isStuckToRight:s&&o>=l}),this.setState(e),t&&this.forceUpdate()}startEditing(e,t,n=!1,s,i){const{model:o}=this.props;if(!Ae(o))throw new Error("model is not editable");const r=this.getModelColumn(e),l=this.getModelRow(t),a={column:e,row:t,selectionRange:s,value:i!==void 0?i:o.editValueForCell(r,l),isQuickEdit:n};this.setState({editingCell:a,cursorColumn:e,cursorRow:t}),this.moveViewToCell(e,t)}isValidForCell(e,t,n){const{model:s}=this.props,i=this.getModelColumn(e),o=this.getModelRow(t);return Ae(s)&&s.isValidForCell(i,o,n)}async pasteValue(e){const{model:t}=this.props,{movedColumns:n,movedRows:s,selectedRanges:i}=this.state;try{if(Yr(t),!t.isEditable||!i.every(h=>t.isEditableRange(h)))throw new bo("Can't paste in to read-only area.");if(i.length<=0)throw new bo("Select an area to paste to.");if(typeof e=="string"){const h=[],m=V.getModelRanges(i,n,s);Y.forEachCell(m,(p,g)=>{h.push({column:p,row:g,text:e})}),await t.setValues(h);return}const o=e.length,r=e[0].length,{columnCount:l,rowCount:a}=t;let c=i;if(c.every(h=>{var m,p;return Y.cellCount([h])===1&&((m=h.startColumn)!=null?m:0)+r<=l&&((p=h.startRow)!=null?p:0)+o<=a})&&(c=c.map(h=>{var m,p;return new Y(h.startColumn,h.startRow,((m=h.startColumn)!=null?m:0)+r-1,((p=h.startRow)!=null?p:0)+o-1)}),this.setSelectedRanges(c)),!c.every(h=>Y.rowCount([h])===o&&Y.columnCount([h])===r))throw new bo("Copy and paste area are not same size.");const d=[];c.forEach(h=>{var m,p;for(let g=0;g<r;g+=1)for(let f=0;f<o;f+=1)d.push({column:((m=h.startColumn)!=null?m:0)+g,row:((p=h.startRow)!=null?p:0)+f,text:e[f][g]})}),await t.setValues(d)}catch(o){const{onError:r}=this.props;r(o instanceof Error?o:new Error(`${o}`))}}setValueForCell(e,t,n){const{model:s}=this.props;Yr(s);const i=this.getModelColumn(e),o=this.getModelRow(t);return s.isValidForCell(i,o,n)?(s.setValueForCell(i,o,n),!0):!1}setValueForRanges(e,t){const{model:n}=this.props,{movedColumns:s,movedRows:i}=this.state,o=V.getModelRanges(e,s,i);Ae(n)&&n.setValueForRanges(o,t)}isSelected(e,t){var s,i;const{selectedRanges:n}=this.state;for(let o=0;o<n.length;o+=1){const r=n[o],l=r.startRow===null||r.startRow<=e&&e<=((s=r.endRow)!=null?s:0),a=r.startColumn===null||r.startColumn<=t&&t<=((i=r.endColumn)!=null?i:0);if(l&&a)return!0}return!1}addDocumentCursor(e=null){this.documentCursor!==Jn.getCursorClassName(e)&&(this.documentCursor&&document.documentElement.classList.remove(this.documentCursor),this.documentCursor=Jn.getCursorClassName(e),this.documentCursor&&document.documentElement.classList.add(this.documentCursor),document.documentElement.classList.add("grid-block-events"))}removeDocumentCursor(){this.documentCursor&&(document.documentElement.classList.remove(this.documentCursor),document.documentElement.classList.remove("grid-block-events"),this.documentCursor=null)}startDragTimer(e){this.stopDragTimer();const t=new MouseEvent("custom",e.nativeEvent);this.dragTimer=setTimeout(()=>{this.handleMouseDrag(t)},Jn.dragTimeout)}stopDragTimer(){this.dragTimer&&(clearTimeout(this.dragTimer),this.dragTimer=null)}drawCanvas(e=this.updateMetrics()){if(!this.canvas)throw new Error("canvas is not set");if(!this.canvasContext)throw new Error("context not set");const{left:t,top:n,cursorColumn:s,cursorRow:i,draggingColumn:o,draggingColumnSeparator:r,draggingRow:l,draggingRowOffset:a,draggingRowSeparator:c,editingCell:d,isDraggingHorizontalScrollBar:h,isDraggingVerticalScrollBar:m,isDragging:p,mouseX:g,mouseY:f,selectedRanges:b}=this.state,{model:C,stateOverride:w}=this.props,{renderer:S}=this,I=this.canvasContext,v=this.getTheme(),E=this.canvas.clientWidth,M=this.canvas.clientHeight,F={left:t,top:n,width:E,height:M,context:I,theme:v,model:C,metrics:e,mouseX:g,mouseY:f,selectedRanges:b,draggingColumn:o,draggingColumnSeparator:r,draggingRow:l,draggingRowOffset:a,draggingRowSeparator:c,editingCell:d,isDraggingHorizontalScrollBar:h,isDraggingVerticalScrollBar:m,isDragging:p,cursorColumn:s,cursorRow:i,...w};I.save(),S.drawCanvas(F),I.restore()}focus(){var e;(e=this.canvas)==null||e.focus()}isFocused(){return document.activeElement===this.canvas}handleClick(e){var s;const t=this.getGridPointFromEvent(e),n=this.getMouseHandlers();for(let i=0;i<n.length;i+=1)if(n[i].onClick(t,this,e)){e.stopPropagation(),e.preventDefault();break}(s=this.canvas)==null||s.focus()}handleContextMenu(e){const t=this.getGridPointFromEvent(e),n=this.getMouseHandlers();for(let s=0;s<n.length;s+=1)if(n[s].onContextMenu(t,this,e)){e.stopPropagation(),e.preventDefault();break}}handleKeyDown(e){var n,s;const t=this.getKeyHandlers();for(let i=0;i<t.length;i+=1){const r=t[i].onDown(e,this);if(r){const l=r;((n=l==null?void 0:l.stopPropagation)==null||n)&&e.stopPropagation(),((s=l==null?void 0:l.preventDefault)==null||s)&&e.preventDefault();break}}}notifyMouseHandlers(e,t,n=!0,s=!1){var l,a;const i=this.getGridPointFromEvent(t),o=this.getMouseHandlers();let r=null;for(let c=0;c<o.length;c+=1){const d=o[c],h=d[e]&&d[e](i,this,t);if(h){d.cursor!=null&&({cursor:r}=d,s&&this.addDocumentCursor(r));const m=h;((l=m==null?void 0:m.stopPropagation)==null||l)&&t.stopPropagation(),((a=m==null?void 0:m.preventDefault)==null||a)&&t.preventDefault();break}}if(this.setState({cursor:r}),n){const{x:c,y:d}=i;this.setState({mouseX:c,mouseY:d})}}handleMouseDown(e){window.addEventListener("mousemove",this.handleMouseDrag,!0),window.addEventListener("mouseup",this.handleMouseUp,!0),!(e.button!=null&&e.button!==0)&&(this.notifyMouseHandlers("onDown",e),this.startDragTimer(e))}handleDoubleClick(e){this.notifyMouseHandlers("onDoubleClick",e)}handleMouseMove(e){this.notifyMouseHandlers("onMove",e)}handleMouseLeave(e){this.notifyMouseHandlers("onLeave",e,!1),this.setState({mouseX:null,mouseY:null})}handleMouseDrag(e){this.setState({isDragging:!0}),this.notifyMouseHandlers("onDrag",e,!0,!0),this.stopDragTimer()}handleMouseUp(e){window.removeEventListener("mousemove",this.handleMouseDrag,!0),window.removeEventListener("mouseup",this.handleMouseUp,!0),!(e.button!=null&&e.button!==0)&&(this.notifyMouseHandlers("onUp",e,!1),this.stopDragTimer(),this.removeDocumentCursor())}handleResize(){if(this.updateCanvasScale(),this.updateCanvas(),!this.metrics)throw new Error("metrics not set");const{left:e,top:t}=this.state,{lastLeft:n,lastTop:s}=this.metrics;e>n&&this.setState({left:n,leftOffset:0}),t>s&&this.setState({top:s,topOffset:0}),this.forceUpdate()}handleWheel(e){var v,E,M,F;if(this.notifyMouseHandlers("onWheel",e),e.defaultPrevented)return;const{metricCalculator:t,metrics:n}=this,s=this.getMetricState();if(!n)throw new Error("metrics not set");const{lastTop:i,lastLeft:o,columnCount:r,rowCount:l,scrollableContentWidth:a,scrollableViewportWidth:c,scrollableContentHeight:d,scrollableViewportHeight:h,hasHorizontalBar:m,hasVerticalBar:p}=n;let{top:g,left:f,topOffset:b,leftOffset:C}=n;const w=this.getTheme();let{deltaX:S,deltaY:I}=V.getScrollDelta(e,n.barWidth,n.barHeight,n.rowHeight,n.rowHeight);for(;m&&S!==0;){if(C+=S,S=0,r>1){if(C>0&&f>=o||C<0&&f<=0){C=0;break}}else{if(C<=0){C=0;break}const k=a-c;if(C>=k){C=k;break}}if(C>0){const k=(v=n.visibleColumnWidths.get(f))!=null?v:t.getVisibleColumnWidth(f,s);C>=k?(S=C-k,C=0,f+=1):w.scrollSnapToColumn&&r>1&&(C=0,f+=1)}else if(C<0){const k=(E=n.visibleColumnWidths.get(f-1))!=null?E:t.getVisibleColumnWidth(f-1,s);Math.abs(C)<=k&&w.scrollSnapToColumn&&r>1?(C=0,f-=1):(S=C+k,C=0,f-=1)}}for(;p&&I!==0;){if(b+=I,I=0,l>1){if(b>0&&g>=i||b<0&&g<=0){b=0;break}}else{if(b<=0){b=0;break}const k=d-h;if(b>=k){b=k;break}}if(b>0){const k=(M=n.visibleRowHeights.get(g))!=null?M:t.getVisibleRowHeight(g,s);b>=k?(I=b-k,b=0,g+=1):w.scrollSnapToRow&&l>1&&(b=0,g+=1)}else if(b<0){const k=(F=n.visibleRowHeights.get(g-1))!=null?F:t.getVisibleRowHeight(g-1,s);Math.abs(b)<=k&&w.scrollSnapToRow&&l>1?(b=0,g-=1):(I=b+k,b=0,g-=1)}}this.setViewState({top:g,left:f,leftOffset:C,topOffset:b}),e.stopPropagation(),e.preventDefault()}handleEditCellCancel(){this.setState({editingCell:null}),this.focus()}handleEditCellChange(e){this.setState(({editingCell:t})=>{try{return Xr(t),{editingCell:{...t,value:e}}}catch(n){const{onError:s}=this.props;return s(n instanceof Error?n:new Error(`${n}`)),null}})}handleEditCellCommit(e,{direction:t=Lt.DOWN,fillRange:n=!1}={}){const{editingCell:s,selectedRanges:i}=this.state;if(!s)throw new Error("editingCell not set");const{column:o,row:r}=s;if(!this.isValidForCell(o,r,e)){t===null&&this.setState({editingCell:null});return}n?this.setValueForRanges(i,e):this.setValueForCell(o,r,e),t!==null&&this.moveCursorInDirection(t),this.setState({editingCell:null}),this.focus()}renderInputField(){const{model:e}=this.props,{editingCell:t}=this.state,{metrics:n}=this;if(t==null||n==null||!Ae(e))return null;const{selectionRange:s,value:i,isQuickEdit:o}=t,{column:r,row:l}=t,{gridX:a,gridY:c,visibleColumnXs:d,visibleRowYs:h,visibleColumnWidths:m,visibleRowHeights:p}=n,g=d.get(r),f=h.get(l),b=m.get(r),C=p.get(l),w=g!=null&&f!=null&&b!=null&&C!=null?{position:"absolute",left:a+g,top:c+f,width:b,height:C}:{opacity:0},S=this.getModelColumn(r),I=this.getModelRow(l),v=S!=null&&I!=null?{textAlign:e.textAlignForCell(S,I)}:void 0,E=e.isValidForCell(S,I,i);return u("div",{style:w,children:u(ar,{selectionRange:s,className:z({error:!E}),onCancel:this.handleEditCellCancel,onChange:this.handleEditCellChange,onDone:this.handleEditCellCommit,isQuickEdit:o,style:v,value:i},`${r},${l}`)})}render(){const{cursor:e}=this.state;return T(Ne,{children:[u("canvas",{className:z("grid-canvas",Jn.getCursorClassName(e)),ref:t=>{this.canvas=t},onClick:this.handleClick,onContextMenu:this.handleContextMenu,onDoubleClick:this.handleDoubleClick,onKeyDown:this.handleKeyDown,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,tabIndex:0,children:"Your browser does not support HTML canvas. Update your browser?"}),this.renderInputField()]})}};let Ds=Jn;Ds.contextType=eu;Ds.defaultProps={canvasOptions:{alpha:!1},isStickyBottom:!1,isStickyRight:!1,isStuckToBottom:!1,isStuckToRight:!1,keyHandlers:[],mouseHandlers:[],movedColumns:[],movedRows:[],onError:()=>{},onSelectionChanged:()=>{},onMovedColumnsChanged:e=>{},onMoveColumnComplete:()=>{},onMovedRowsChanged:()=>{},onMoveRowComplete:()=>{},onViewChanged:()=>{},stateOverride:{},theme:{autoSelectColumn:!1,autoSelectRow:!1}};Ds.pixelsPerLine=100/3;Ds.dragTimeout=1e3;Ds.getTheme=De((e,t)=>({...Hh,...e,...t}));class ha extends Uo{get floatingTopRowCount(){return 0}get floatingBottomRowCount(){return 0}get floatingLeftColumnCount(){return 0}get floatingRightColumnCount(){return 0}get columnHeaderMaxDepth(){return 1}truncationCharForCell(t,n){}textAlignForCell(t,n){return"left"}colorForCell(t,n,s){return s.textColor}backgroundColorForCell(t,n,s){return null}colorForColumnHeader(t,n=0){return null}textForRowHeader(t){return""}textForRowFooter(t){return""}isColumnMovable(t,n=0){return!0}isRowMovable(t){return!0}getColumnHeaderGroup(t,n){}getColumnHeaderParentGroup(t,n){}}class tu extends ha{constructor({rowCount:t=1e9,columnCount:n=100,floatingTopRowCount:s=0,floatingBottomRowCount:i=0,floatingLeftColumnCount:o=0,floatingRightColumnCount:r=0,isEditable:l=!1,editedData:a=[]}={}){super(),this.numRows=t,this.numColumns=n,this.floatingTop=s,this.floatingBottom=i,this.floatingLeft=o,this.floatingRight=r,this.editable=l,this.editedData=a}get rowCount(){return this.numRows}get columnCount(){return this.numColumns}get floatingTopRowCount(){return this.floatingTop}get floatingBottomRowCount(){return this.floatingBottom}get floatingLeftColumnCount(){return this.floatingLeft}get floatingRightColumnCount(){return this.floatingRight}get isEditable(){return this.editable}textForCell(t,n){var s,i;return(i=(s=this.editedData[t])==null?void 0:s[n])!=null?i:`${t},${n}`}colorForCell(t,n,s){return s.textColor}textForColumnHeader(t,n=0){return`${t}`}textForRowHeader(t){return`${t}`}textForRowFooter(t){return`${t}`}async setValueForCell(t,n,s){this.editedData[t]==null&&(this.editedData[t]=[]),this.editedData[t][n]=`${s}`}async setValueForRanges(t,n){Y.forEachCell(t,(s,i)=>{this.setValueForCell(s,i,n)})}async setValues(t){var n,s;for(let i=0;i<t.length;i+=1){const o=t[i];this.setValueForCell((n=o.column)!=null?n:o.x,(s=o.row)!=null?s:o.y,o.text)}}editValueForCell(t,n){return this.textForCell(t,n)}isValidForCell(t,n,s){return!0}isEditableRange(t){return this.isEditable}delete(t){throw new Error("Method not implemented.")}}const es=class extends tu{constructor({rowCount:e=es.DEFAULT_ROW_COUNT,columnCount:t=es.DEFAULT_COLUMN_COUNT,children:n=new Map,childRowCount:s=Math.ceil(Math.max(es.MIN_CHILD_ROW_COUNT,e*es.DEFAULT_CHILD_ROW_COUNT_FACTOR)),maxDepth:i=es.MAX_DEPTH}={}){super({rowCount:e,columnCount:t}),this.getCachedModelRowOffset=yt((o,r)=>{let l=null,a=r;const c=[...o].sort((d,h)=>d[0]-h[0]);for(let d=0;d<c.length;d+=1){const[h,m]=c[d];if(a<=h)break;const p=m.rowCount;if(a<=h+p){l=h,a=a-h-1;break}a-=p}return{key:l,offsetRow:a}}),this.getCachedTextForRowHeader=yt((o,r)=>{const{key:l,offsetRow:a}=this.getCachedModelRowOffset(o,r);if(l!=null){const c=o.get(l);if(c!==void 0)return`${l}.${c.textForRowHeader(a)}`}return`${a}`}),this.getCachedTextForCell=yt((o,r,l)=>{const{key:a,offsetRow:c}=this.getCachedModelRowOffset(o,l);if(a!=null){const d=o.get(a);if(d!==void 0)return`${a}.${d.textForCell(r,c)}`}return`${r},${c}`}),this.getCachedIsRowExpandable=yt((o,r,l)=>this.getCachedDepthForRow(o,r)<l),this.getCachedIsRowExpanded=yt((o,r)=>{const{key:l,offsetRow:a}=this.getCachedModelRowOffset(o,r);if(l!=null){const c=o.get(l);if(c!==void 0)return c.isRowExpanded(a)}return o.has(a)}),this.getCachedDepthForRow=yt((o,r)=>{const{key:l,offsetRow:a}=this.getCachedModelRowOffset(o,r);if(l!=null){const c=o.get(l);if(c!==void 0)return c.depthForRow(a)+1}return 0}),this.children=n,this.childRowCount=s,this.maxDepth=i}textForCell(e,t){return this.getCachedTextForCell(this.children,e,t)}textForRowHeader(e){return this.getCachedTextForRowHeader(this.children,e)}isRowMovable(e){return!1}get hasExpandableRows(){return!0}get floatingBottomRowCount(){return 0}isRowExpandable(e){return this.getCachedIsRowExpandable(this.children,e,this.maxDepth)}isRowExpanded(e){return this.getCachedIsRowExpanded(this.children,e)}setRowExpanded(e,t){const{key:n,offsetRow:s}=this.getCachedModelRowOffset(this.children,e),i=new Map(this.children);if(n!=null){const o=this.children.get(n);if(o!==void 0){const{rowCount:r}=o;o.setRowExpanded(s,t),this.numRows+=o.rowCount-r}}else if(t){const o=new es({rowCount:this.childRowCount,columnCount:this.numColumns});i.set(s,o),this.numRows+=o.rowCount}else{const o=i.get(s);o!==void 0&&(this.numRows-=o.rowCount,i.delete(s))}this.children=i}depthForRow(e){return this.getCachedDepthForRow(this.children,e)}};let js=es;js.DEFAULT_ROW_COUNT=1e9;js.DEFAULT_COLUMN_COUNT=100;js.DEFAULT_CHILD_ROW_COUNT_FACTOR=.01;js.MIN_CHILD_ROW_COUNT=10;js.MAX_DEPTH=10;class he extends ha{constructor(){super(),this.listenerCount=0}addEventListener(t,n,s){super.addEventListener(t,n,s),this.listenerCount+=1,this.listenerCount===1&&this.startListening()}removeEventListener(t,n,s){super.removeEventListener(t,n,s),this.listenerCount-=1,this.listenerCount===0&&this.stopListening()}startListening(){}stopListening(){}get originalColumns(){return this.columns}get movedColumns(){return[]}get movedRows(){return[]}get layoutHints(){return null}get frontColumns(){return[]}get backColumns(){return[]}get frozenColumns(){return[]}isColumnFrozen(t){return!1}get isFilterRequired(){return!1}get isReversible(){return!0}get isColumnStatisticsAvailable(){return!1}get description(){return""}get isCustomColumnsAvailable(){return!1}get isFormatColumnsAvailable(){return!1}get isExportAvailable(){return!1}get isValuesTableAvailable(){return!1}get isChartBuilderAvailable(){return!1}get isRollupAvailable(){return!1}get isSelectDistinctAvailable(){return!1}get isTotalsAvailable(){return!1}isFilterable(t){return!1}close(){}isRowMovable(){return!1}}he.EVENT=Object.freeze({UPDATED:"UPDATED",FORMATTER_UPDATED:"FORMATTER_UPDATED",REQUEST_FAILED:"REQUEST_FAILED",COLUMNS_CHANGED:"COLUMNS_CHANGED",TABLE_CHANGED:"TABLE_CHANGED",FILTERS_CHANGED:"FILTERS_CHANGED",SORTS_CHANGED:"SORTS_CHANGED",DISCONNECT:"DISCONNECT",RECONNECT:"RECONNECT",TOTALS_UPDATED:"TOTALS_UPDATED",PENDING_DATA_UPDATED:"PENDING_DATA_UPDATED"});const ws=class extends R.exports.Component{constructor(e){super(e),this.getInput=De((t,n)=>t.find(s=>s.eventKey===n)),this.getInputIndex=De((t,n)=>t.findIndex(s=>s.eventKey===n)),this.handleAddColumnClick=this.handleAddColumnClick.bind(this),this.handleSaveClick=this.handleSaveClick.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleDeleteColumn=this.handleDeleteColumn.bind(this),this.handleCustomColumnUpdated=this.handleCustomColumnUpdated.bind(this),this.handleRequestFailed=this.handleRequestFailed.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.resetRequestFailed=this.resetRequestFailed.bind(this),this.handleEditorTabNavigation=this.handleEditorTabNavigation.bind(this),this.state={inputs:[],isCustomColumnApplying:!1,errorMessage:null,hasRequestFailed:!1,isSuccessShowing:!1},this.container=null,this.successButtonTimer=null}static makeCustomColumnInputEventKey(){return Qt.generate()}static createCustomColumnInput(){return{eventKey:Qt.generate(),name:"",formula:""}}componentDidMount(){const{customColumns:e}=this.props;this.parseCustomColumns(e),this.startListening()}componentWillUnmount(){this.stopListening(),this.messageTimer&&clearTimeout(this.messageTimer),this.successButtonTimer&&clearTimeout(this.successButtonTimer)}resetErrorMessage(){this.setState({errorMessage:null})}startListening(){const{model:e}=this.props;e.addEventListener(he.EVENT.COLUMNS_CHANGED,this.handleCustomColumnUpdated),e.addEventListener(he.EVENT.UPDATED,this.handleCustomColumnUpdated),e.addEventListener(he.EVENT.REQUEST_FAILED,this.handleRequestFailed)}stopListening(){const{model:e}=this.props;e.removeEventListener(he.EVENT.COLUMNS_CHANGED,this.handleCustomColumnUpdated),e.removeEventListener(he.EVENT.UPDATED,this.handleCustomColumnUpdated),e.removeEventListener(he.EVENT.REQUEST_FAILED,this.handleRequestFailed)}parseCustomColumns(e){if(e.length>0){const t=e.map(n=>{const s=n.split(/=(.+)/,2);return{eventKey:ws.makeCustomColumnInputEventKey(),name:s[0],formula:s[1]}});this.setState({inputs:t})}else this.setState({inputs:[ws.createCustomColumnInput()]})}handleAddColumnClick(){const{inputs:e}=this.state,t=[...e];t.push(ws.createCustomColumnInput()),this.setState({inputs:t})}handleDeleteColumn(e){const{inputs:t}=this.state,n=this.getInputIndex(t,e),s=[...t];s.splice(n,1),s.length===0&&s.push(ws.createCustomColumnInput()),this.setState({inputs:s})}handleInputChange(e,t,n){const{inputs:s}=this.state,i=this.getInputIndex(s,e),r={...this.getInput(s,e)};r[t]=n;const l=[...s];l.splice(i,1,r),this.setState({inputs:l})}handleCustomColumnUpdated(){const{isCustomColumnApplying:e}=this.state;!e||this.setState({isCustomColumnApplying:!1,isSuccessShowing:!0},()=>{this.successButtonTimer=setTimeout(()=>this.setState({isSuccessShowing:!1}),ws.SUCCESS_SHOW_DURATION)})}handleRequestFailed(e){const t=e,{isCustomColumnApplying:n}=this.state;!n||this.setState({isCustomColumnApplying:!1,errorMessage:T(Ne,{children:[T("p",{children:[u(G,{icon:cs})," Failed to apply custom columns."]}),T("div",{className:"error-box",children:[t.detail.errorMessage,u("br",{}),"Table configuration:"," ",JSON.stringify(t.detail.configuration)]})]}),hasRequestFailed:!0})}handleDragEnd(e){if(ht.stopDragging(),!e.destination)return;const{inputs:t}=this.state,n=e.source.index,s=e.destination.index,i=[...t],o=t[n];i.splice(n,1),i.splice(s,0,o),this.setState({inputs:i})}handleEditorTabNavigation(e,t){var s,i,o;const{inputs:n}=this.state;if(t){((s=this.container)==null?void 0:s.querySelectorAll(".btn-drag-handle")[e]).focus();return}if(e===n.length-1)((i=this.container)==null?void 0:i.querySelectorAll(".btn-add-column")[e]).focus();else{const r=e+1;((o=this.container)==null?void 0:o.querySelectorAll(".custom-column-input")[r]).focus()}}handleSaveClick(){const{onSave:e}=this.props,{inputs:t,isCustomColumnApplying:n}=this.state;if(n)return;const s=[];t.forEach(i=>{const{name:o,formula:r}=i;o&&r&&s.push(`${o}=${r}`)}),this.resetErrorMessage(),this.setState({isCustomColumnApplying:!0}),e(s)}resetRequestFailed(){this.setState(({hasRequestFailed:e})=>e?{hasRequestFailed:!1}:null)}renderInputs(){const{inputs:e,hasRequestFailed:t}=this.state;return e.map((n,s)=>{const{eventKey:i,name:o,formula:r}=n;return u(ir,{inputIndex:s,eventKey:i,name:o,formula:r,onChange:this.handleInputChange,onDeleteColumn:this.handleDeleteColumn,onTabInEditor:this.handleEditorTabNavigation,invalid:t},i)})}renderSaveButton(){const{inputs:e,isCustomColumnApplying:t,isSuccessShowing:n}=this.state,s=e.length>1?"Save Columns":"Save Column";return T("button",{type:"button",className:z("btn btn-apply",{"btn-spinner":t},n?"btn-success":"btn-primary"),disabled:n||t,onClick:this.handleSaveClick,children:[t&&T("span",{children:[u(Pt,{}),u("span",{className:"btn-normal-content",children:"Applying"}),u("span",{className:"btn-hover-content",children:"Applying"})]}),!n&&!t&&s,n&&T(Ne,{children:[u(G,{icon:Pl})," Success"]})]})}render(){const{onCancel:e}=this.props,{errorMessage:t}=this.state;return T("div",{role:"presentation",className:"custom-column-builder-container",ref:n=>{this.container=n},onClick:this.resetRequestFailed,onFocus:this.resetRequestFailed,children:[u("div",{className:"section-title",children:"Custom Column Name and Formula"}),u("hr",{}),u(Ys,{onDragStart:ht.startDragging,onDragEnd:this.handleDragEnd,children:u(Xs,{droppableId:"droppable-custom-columns",children:(n,s)=>T("div",{ref:n.innerRef,...n.droppableProps,className:z("droppable-container",{dragging:s.draggingFromThisWith}),children:[this.renderInputs(),n.placeholder]})})}),u("div",{className:"pt-1 px-3",children:T("button",{type:"button",className:"btn btn-link btn-add-column",onClick:this.handleAddColumnClick,children:[u(G,{icon:Rs}),"Add Another Column"]})}),T("div",{className:"custom-column-builder-footer",children:[t&&u("div",{className:"error-message",children:t}),T("div",{className:"d-flex justify-content-end",children:[u("button",{type:"button",className:"btn btn-outline-primary mr-2",onClick:e,children:"Cancel"}),this.renderSaveButton()]})]})]})}};let cr=ws;cr.SUCCESS_SHOW_DURATION=750;cr.defaultProps={customColumns:[],onSave:()=>{},onCancel:()=>{}};var be=(e=>(e.ADVANCED_SETTINGS="ADVANCED_SETTINGS",e.AGGREGATIONS="AGGREGATIONS",e.AGGREGATION_EDIT="AGGREGATIONS_EDIT",e.CHART_BUILDER="CHART_BUILDER",e.CUSTOM_COLUMN_BUILDER="CUSTOM_COLUMN_BUILDER",e.QUICK_FILTERS="QUICK_FILTERS",e.ROLLUP_ROWS="ROLLUP_ROWS",e.SEARCH_BAR="SEARCH_BAR",e.SELECT_DISTINCT="SELECT_DISTINCT",e.TABLE_EXPORTER="TABLE_EXPORTER",e.VISIBILITY_ORDERING_BUILDER="VISIBILITY_ORDERING_BUILDER",e.CONDITIONAL_FORMATTING="CONDITIONAL_FORMATTING",e.CONDITIONAL_FORMATTING_EDIT="CONDITIONAL_FORMATTING_EDIT",e.GOTO="GOTO",e))(be||{});const Ps=te.module("RollupRows"),nu=150,Si="grouped-rollup-rows",vi="ungrouped-rollup-rows",At=class extends R.exports.Component{constructor(e){super(e),this.search=Tt(o=>{const r=this.getSortedUngroupedColumns(),l=[];let a=null;for(let c=0;c<r.length;c+=1)r[c].name.toLowerCase().includes(o.toLowerCase())&&(a==null&&(a=c),l.push([c,c]));O(a),this.setState({ungroupedSelectedRanges:l}),l.length>0&&this.ungroupedList.current&&this.ungroupedList.current.scrollToItem(a)},nu),this.getCachedUngroupedColumns=ue((o,r)=>o.filter(l=>At.isGroupable(l)&&!r.find(a=>a===l.name))),this.getCachedSortedColumns=ue((o,r)=>r==null?[...o]:x.sortColumns(o,r===At.SORT.ASCENDING)),this.search=this.search.bind(this),this.handleDeleteClicked=this.handleDeleteClicked.bind(this),this.handleSearchChange=this.handleSearchChange.bind(this),this.handleUngroupedSelect=this.handleUngroupedSelect.bind(this),this.handleUngroupedSelectionChange=this.handleUngroupedSelectionChange.bind(this),this.handleDragStart=this.handleDragStart.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.handleGroupedSelectionChange=this.handleGroupedSelectionChange.bind(this),this.handleShowConstituentsChange=this.handleShowConstituentsChange.bind(this),this.handleShowNonAggregatedColumnsChange=this.handleShowNonAggregatedColumnsChange.bind(this),this.handleSortAscending=this.handleSortAscending.bind(this),this.handleSortDescending=this.handleSortDescending.bind(this),this.renderGroupedItem=this.renderGroupedItem.bind(this),this.ungroupedList=Q.createRef(),this.groupedList=Q.createRef();const{config:t}=e,{columns:n=[],showConstituents:s=!0,showNonAggregatedColumns:i=!0}=t!=null?t:{};this.state={ungroupedSelectedRanges:[],columns:n,groupedSelectedRanges:[],searchFilter:"",showConstituents:s,showNonAggregatedColumns:i,dragSource:null,sort:null}}static renderColumn({item:e,isClone:t,selectedCount:n}){const s=e&&e.name,i=t?`${n}`:void 0,o=t?"item-list-item-clone":"";return bt.renderTextItem({text:s,badgeText:i,className:o})}static addGroupings(e,t,n=e.length){if(t==null||t.length===0)return e;let s=n;const i=e.filter((o,r)=>t.includes(o)?(r<s&&(s-=1),!1):!0);return i.splice(s,0,...t),i}static isGroupable(e){return!x.isDecimalType(e.type)}componentDidUpdate(e,t){const{config:n}=this.props,{columns:s,showConstituents:i,showNonAggregatedColumns:o}=this.state;n!==e.config?this.updateFromConfig():(s!==t.columns||i!==t.showConstituents||o!==t.showNonAggregatedColumns)&&(n==null||s!==n.columns||i!==n.showConstituents||o!==n.showNonAggregatedColumns)&&this.sendChange()}componentWillUnmount(){this.search.cancel()}handleSearchChange(e){const t=e.target.value;if(this.setState({searchFilter:t}),!t){this.search.cancel(),this.resetSelection();return}this.search(t)}handleSortAscending(){this.setState(({sort:e})=>({sort:e===At.SORT.ASCENDING?null:At.SORT.ASCENDING}))}handleSortDescending(){this.setState(({sort:e})=>({sort:e===At.SORT.DESCENDING?null:At.SORT.DESCENDING}))}resetSelection(){this.setState({ungroupedSelectedRanges:[],groupedSelectedRanges:[]})}handleDragStart(e){Ps.debug("handleDragStart",e),document.documentElement.classList.add("drag-pointer-events-none"),this.setState({dragSource:e.source})}handleDragEnd(e){Ps.debug("handleDragEnd",e),document.documentElement.classList.remove("drag-pointer-events-none"),this.setState({dragSource:null});const{destination:t,source:n}=e;if(t==null||n==null)return;if(t.droppableId===vi){this.setState(({groupedSelectedRanges:o,columns:r})=>{const l=[...r];return ht.reorder(l,o,[],0),{columns:l,ungroupedSelectedRanges:[],groupedSelectedRanges:[]}});return}const s=n.droppableId===Si;let i=t.index;s&&n.index<t.index&&(i+=1),this.setState(({columns:o,ungroupedSelectedRanges:r,groupedSelectedRanges:l})=>{const a=[...o],c=s?a:this.getSortedUngroupedColumns().map(g=>g.name),d=s?l:r,h=ht.reorder(c,d,a,i),m=s?ht.adjustDestinationIndex(i,l):i,p=[[m,m+h.length-1]];return{columns:a,ungroupedSelectedRanges:[],groupedSelectedRanges:p}}),this.resetSelection()}handleUngroupedSelect(e){Ps.debug("handleUngroupedSelect"),this.setState(({columns:t})=>({columns:At.addGroupings(t,[this.getSortedUngroupedColumns()[e].name]),ungroupedSelectedRanges:[],groupedSelectedRanges:[]}))}handleUngroupedSelectionChange(e){Ps.debug2("handleUngroupedSelectionChange",e),this.setState(({ungroupedSelectedRanges:t})=>e===t?null:{ungroupedSelectedRanges:e,groupedSelectedRanges:[]})}handleGroupedSelectionChange(e){Ps.debug2("handleGroupedSelectedRanges",e),this.setState(({groupedSelectedRanges:t})=>e===t?null:{groupedSelectedRanges:e,ungroupedSelectedRanges:[]})}handleDeleteClicked(e){this.setState(({columns:t})=>{const n=t.slice();return n.splice(e,1),{columns:n}})}handleShowConstituentsChange(){this.setState(({showConstituents:e})=>({showConstituents:!e}))}handleShowNonAggregatedColumnsChange(){this.setState(({showNonAggregatedColumns:e})=>({showNonAggregatedColumns:!e}))}updateFromConfig(){const{config:e}=this.props,{columns:t=[],showConstituents:n=!0,showNonAggregatedColumns:s=!0}=e!=null?e:{};this.setState({columns:t,showConstituents:n,showNonAggregatedColumns:s})}sendChange(){const{onChange:e}=this.props,{columns:t,showConstituents:n,showNonAggregatedColumns:s}=this.state;e({columns:t,showConstituents:n,showNonAggregatedColumns:s})}getUngroupedColumns(){const{model:e}=this.props,{columns:t}=this.state,{originalColumns:n}=e;return this.getCachedUngroupedColumns(n,t)}getSortedUngroupedColumns(){const{sort:e}=this.state,t=this.getUngroupedColumns();return this.getCachedSortedColumns(t,e)}renderGroupedItem({item:e,itemIndex:t,isClone:n,selectedCount:s}){const o=`${n?"":"\xA0\xA0".repeat(t)}${e}`,r=n?`${s}`:void 0,l=n?"item-list-item-clone":"";return T(Ne,{children:[bt.renderTextItem({text:o,badgeText:r,className:l}),!n&&u(Ie,{kind:"ghost",className:"btn btn-link btn-link-icon btn-delete-grouping float-right",onClick:()=>this.handleDeleteClicked(t),children:u(G,{icon:Pn})})]})}render(){const{columns:e,dragSource:t,searchFilter:n,groupedSelectedRanges:s,ungroupedSelectedRanges:i,showConstituents:o,showNonAggregatedColumns:r,sort:l}=this.state,a=this.getSortedUngroupedColumns();let c=e.length*bt.DEFAULT_ROW_HEIGHT;(t==null?void 0:t.droppableId)===vi&&(c+=bt.DEFAULT_ROW_HEIGHT);const d=a.length*bt.DEFAULT_ROW_HEIGHT+10,h=Math.min(3*bt.DEFAULT_ROW_HEIGHT,d);return u("div",{role:"menu",className:z("rollup-rows",{"is-dragging":t!=null}),tabIndex:0,children:T(Ys,{onDragEnd:this.handleDragEnd,onDragStart:this.handleDragStart,children:[T("div",{className:"rollup-rows-group-by",children:[u("div",{className:"section-title",children:"Group By"}),e.length===0&&u(Xs,{isDropDisabled:!0,droppableId:"placeholder",children:(m,p)=>u("div",{className:z("placeholder","text-muted",{"is-dragging-from-this":p.draggingFromThisWith,"is-dragging-over":p.isDraggingOver,"is-dropping":p.draggingOverWith}),ref:m.innerRef,...m.droppableProps,children:"Create rollup by dragging columns here, from the available columns list below."})}),e.length>0&&u(bt,{draggingItemClassName:"rollup-rows-dragging-grouped-item",draggablePrefix:Si,droppableId:Si,itemCount:e.length,items:e,offset:0,onSelectionChange:this.handleGroupedSelectionChange,ref:this.groupedList,renderItem:this.renderGroupedItem,selectedRanges:s,style:{height:c},isMultiSelect:!0})]}),T("div",{className:"rollup-rows-available-columns",children:[u("div",{className:"section-title",children:"Available Grouping Columns"}),T("div",{className:"top-menu",children:[u(_n,{className:"w-100",value:n,matchCount:n?i.length:void 0,placeholder:"Find column...",onChange:this.handleSearchChange}),T(Ie,{kind:"ghost",className:z("btn-link btn-link-icon",{active:l===At.SORT.ASCENDING}),onClick:this.handleSortAscending,children:[u(G,{icon:Go}),u(me,{children:"Sort ascending"})]}),T(Ie,{kind:"ghost",className:z("btn-link btn-link-icon",{active:l===At.SORT.DESCENDING}),onClick:this.handleSortDescending,children:[u(G,{icon:qo}),u(me,{children:"Sort descending"})]})]}),u(bt,{className:"rollup-available-grouping-columns",draggablePrefix:vi,droppableId:vi,itemCount:a.length,items:a,renderItem:At.renderColumn,offset:0,onSelect:this.handleUngroupedSelect,onSelectionChange:this.handleUngroupedSelectionChange,ref:this.ungroupedList,selectedRanges:i,style:{maxHeight:d,minHeight:h},isDropDisabled:(t==null?void 0:t.droppableId)!==Si,isMultiSelect:!0}),T("div",{className:"bottom-menu",children:[u("div",{className:"label",children:"Show:"}),u(It,{checked:o,onChange:this.handleShowConstituentsChange,children:"Constituents"}),u(It,{checked:r,onChange:this.handleShowNonAggregatedColumnsChange,children:"Non-Aggregated Columns"})]})]})]})})}};let dr=At;dr.SORT=Object.freeze({ASCENDING:"ASCENDING",DESCENDING:"DESCENDING"});dr.defaultProps={config:null,onChange:()=>{}};const ye=class extends R.exports.Component{static getDateString(){return y.i18n.DateTimeFormat.format(ye.FILENAME_DATE_FORMAT,new Date)}constructor(e){super(e),this.handleDownloadClick=this.handleDownloadClick.bind(this),this.handleDownloadOptionChanged=this.handleDownloadOptionChanged.bind(this),this.handleCustomizedDownloadOptionChanged=this.handleCustomizedDownloadOptionChanged.bind(this),this.handleCustomizedDownloadRowsChanged=this.handleCustomizedDownloadRowsChanged.bind(this);const{name:t}=e;this.state={fileName:`${t}-${ye.getDateString()}.csv`,downloadOption:ye.DOWNLOAD_OPTIONS.ALL_ROWS,customizedDownloadOption:ye.CUSTOMIZED_ROWS_OPTIONS.FIRST,customizedDownloadRows:ye.DEFAULT_DOWNLOAD_ROWS,errorMessage:null,id:Qt.generate()}}getSnapshotRanges(){const{model:e,selectedRanges:t}=this.props,{downloadOption:n,customizedDownloadOption:s,customizedDownloadRows:i}=this.state,{rowCount:o}=e;let r=[];switch(n){case ye.DOWNLOAD_OPTIONS.ALL_ROWS:r.push(new Y(null,0,null,o-1));break;case ye.DOWNLOAD_OPTIONS.SELECTED_ROWS:r=[...t].sort((l,a)=>l.startRow&&a.startRow?l.startRow-a.startRow:0);break;case ye.DOWNLOAD_OPTIONS.CUSTOMIZED_ROWS:switch(s){case ye.CUSTOMIZED_ROWS_OPTIONS.FIRST:r.push(new Y(null,0,null,Math.min(i-1,o-1)));break;case ye.CUSTOMIZED_ROWS_OPTIONS.LAST:r.push(new Y(null,Math.max(0,o-i),null,o-1));break}break}return r}resetDownloadState(){this.setState({errorMessage:null})}handleDownloadClick(){const{model:e,isDownloading:t,onDownloadStart:n,onDownload:s,onCancel:i}=this.props,{fileName:o}=this.state;if(t){i();return}this.resetDownloadState();const r=this.getSnapshotRanges();this.validateOptionInput()&&(n(),e.export().then(l=>{const a=l.setViewport(0,0);a.getViewportData().then(()=>{s(o,l,a,r)})}))}handleDownloadOptionChanged(e){this.setState({downloadOption:e.target.value})}handleCustomizedDownloadOptionChanged(e){this.setState({customizedDownloadOption:e.target.value})}handleCustomizedDownloadRowsChanged(e){this.setState({customizedDownloadRows:parseInt(e.target.value,10)})}validateOptionInput(){const{selectedRanges:e}=this.props,{downloadOption:t,customizedDownloadRows:n}=this.state;return t===ye.DOWNLOAD_OPTIONS.SELECTED_ROWS&&e.length===0?(this.setState({errorMessage:T("p",{children:[u(G,{icon:cs})," No rows selected. Please select some rows in the table."]})}),!1):t===ye.DOWNLOAD_OPTIONS.CUSTOMIZED_ROWS&&n<=0?(this.setState({errorMessage:T("p",{children:[u(G,{icon:cs})," Number of rows to output must be greater than 0"]})}),!1):!0}render(){const{model:e,isDownloading:t,tableDownloadProgress:n,tableDownloadEstimatedTime:s,selectedRanges:i,tableDownloadStatus:o}=this.props,{fileName:r,downloadOption:l,customizedDownloadOption:a,customizedDownloadRows:c,errorMessage:d,id:h}=this.state,{rowCount:m}=e;return T("div",{className:"table-csv-exporter",children:[u("div",{className:"section-title",children:"Download Rows"}),u("div",{className:"form-group",children:T(er,{onChange:this.handleDownloadOptionChanged,value:l,disabled:t,children:[T(gn,{value:ye.DOWNLOAD_OPTIONS.ALL_ROWS,"data-testid":"radio-csv-exporter-download-all",children:["All Rows",u("span",{className:"text-muted ml-2",children:`(${m.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")} rows)`})]}),T(gn,{value:ye.DOWNLOAD_OPTIONS.SELECTED_ROWS,"data-testid":"radio-csv-exporter-only-selected",children:["Only Selected Rows",u("span",{className:"text-muted ml-2",children:i.length>0?`(${Y.rowCount(i).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")} rows)`:null})]}),u(gn,{value:ye.DOWNLOAD_OPTIONS.CUSTOMIZED_ROWS,"data-testid":"radio-csv-exporter-customized-rows",children:T("div",{className:"radio-input-row",role:"presentation",onClick:()=>{this.setState({downloadOption:ye.DOWNLOAD_OPTIONS.CUSTOMIZED_ROWS})},children:[T("select",{value:a,"data-testid":"select-csv-exporter-customized-rows",className:"custom-select",disabled:t,onChange:this.handleCustomizedDownloadOptionChanged,children:[u("option",{value:"FIRST",children:"First"}),u("option",{value:"LAST",children:"Last"})]}),u("input",{type:"number",className:"form-control",id:`customizedRows-${h}`,"data-testid":"input-csv-exporter-customized-rows",name:`customizedRows-${h}`,placeholder:"100",value:c,disabled:t,onChange:this.handleCustomizedDownloadRowsChanged}),u("div",{children:"Rows"})]})})]})}),T("div",{className:"form-group",children:[u("label",{htmlFor:`customizedRows-${h}`,children:"File Name"}),u("input",{type:"text",className:"form-control",id:`filename-${h}`,"data-testid":"input-csv-exporter-file-name",name:`filename-${h}`,value:r,onChange:p=>{this.setState({fileName:p.target.value})},disabled:t})]}),T("div",{className:"section-footer flex-column",children:[d&&u("div",{className:"error-message",children:d}),o&&T("div",{className:"download-status",children:[(o===ye.DOWNLOAD_STATUS.DOWNLOADING||o===ye.DOWNLOAD_STATUS.INITIATING)&&T(Ne,{children:[o===ye.DOWNLOAD_STATUS.INITIATING&&u("div",{className:"text-muted",children:"Starting Download..."}),o===ye.DOWNLOAD_STATUS.DOWNLOADING&&T("div",{className:"text-muted d-flex justify-content-between",children:[u("span",{children:s||s===0?`Estimated time: ${Kt.formatElapsedTime(s)}`:null}),u("span",{children:`${n}%`})]})]}),o===ye.DOWNLOAD_STATUS.FINISHED&&u("div",{className:"text-muted text-right",children:"Download Completed"}),o===ye.DOWNLOAD_STATUS.CANCELED&&u("div",{className:"text-muted",children:"Download Canceled"}),(o===ye.DOWNLOAD_STATUS.DOWNLOADING||o===ye.DOWNLOAD_STATUS.INITIATING)&&u("div",{className:"progress",children:u("div",{className:"progress-bar progress-bar-striped progress-bar-animated",style:{width:`${n}%`}})}),o===ye.DOWNLOAD_STATUS.FINISHED&&u("div",{className:"progress",children:u("div",{className:"progress-bar bg-success",style:{width:`${n}%`}})})]}),T("button",{type:"button","data-testid":"btn-csv-exporter-download",className:z("btn btn-primary btn-downloading",{"btn-spinner btn-cancelable":t}),onClick:this.handleDownloadClick,children:[t&&T("span",{children:[u(Pt,{}),u("span",{className:"btn-normal-content",children:"Downloading"}),u("span",{className:"btn-hover-content",children:"Cancel"})]}),!t&&"Download"]})]})]})}};let St=ye;St.FILENAME_DATE_FORMAT="yyyy-MM-dd-HHmmss";St.DOWNLOAD_STATUS={INITIATING:"INITIATING",DOWNLOADING:"DOWNLOADING",FINISHED:"FINISHED",CANCELED:"CANCELED"};St.DOWNLOAD_OPTIONS={ALL_ROWS:"ALL_ROWS",SELECTED_ROWS:"SELECTED_ROWS",CUSTOMIZED_ROWS:"CUSTOMIZED_ROWS"};St.CUSTOMIZED_ROWS_OPTIONS={FIRST:"FIRST",LAST:"LAST"};St.DEFAULT_DOWNLOAD_ROWS=100;St.defaultProps={onDownloadStart:()=>{},isDownloading:!1,tableDownloadStatus:"",tableDownloadProgress:0,tableDownloadEstimatedTime:null,selectedRanges:[]};const on=te.module("TableSaver");function su(e){return e.added!==void 0}function iu(e){if(!su(e))throw new Error("event is not UpdateEventData")}const Nn=class extends R.exports.PureComponent{constructor(e){super(e),this.WritableStream=window.WritableStream||Mr,this.getCachedCustomColumnFormatFlag=yt(ls.isCustomColumnFormatDefined,{max:1e4}),this.handlePortMessage=this.handlePortMessage.bind(this),this.handleSnapshotResolved=this.handleSnapshotResolved.bind(this),this.handleDownloadTimeout=this.handleDownloadTimeout.bind(this),this.state={},this.gridRanges=[],this.gridRangeCounter=0,this.rangedSnapshotsTotal=[],this.rangedSnapshotCounter=0,this.snapshotsTotal=0,this.snapshotCounter=0,this.snapshotsBuffer=new Map,this.currentSnapshotIndex=0,this.snapshotPending=0,this.cancelableSnapshots=[],this.WritableStream=window.WritableStream||Mr,this.iframes=[],this.useBlobFallback=!1}static csvEscapeString(e){return`"${e.replace(/"/g,'""')}"`}componentDidMount(){const{getDownloadWorker:e}=this.props;e().then(t=>{on.info("found active service worker"),this.sw=t,this.sw.postMessage("ping")}).catch(t=>{on.warn("Download csv is not optimized.",t),this.useBlobFallback=!0})}componentWillUnmount(){this.iframes.length>0&&this.iframes.forEach(e=>{e.remove()}),this.streamTimeout&&clearTimeout(this.streamTimeout),this.snapshotHandlerTimeout&&clearTimeout(this.snapshotHandlerTimeout)}createWriterStream(e){const t=this.useBlobFallback,n=[];let s=null;t&&(s=TextEncoder.prototype.encode.bind(new TextEncoder));const{fileName:i}=this,o={};return t?(o.write=r=>{O(s),r.header!==void 0&&n.push(s(r.header)),r.rows!==void 0&&n.push(s(r.rows))},o.close=()=>{O(i);const r=new Blob(n,{type:"application/octet-stream; charset=utf-8"}),l=document.createElement("a");l.href=URL.createObjectURL(r),l.download=i,l.click()},o.abort=()=>{e.postMessage({cancel:!0}),e.close()}):(o.write=r=>{e.postMessage(r)},o.close=()=>{e.postMessage({end:!0}),e.close()},o.abort=()=>{e.postMessage({cancel:!0}),e.close()}),new this.WritableStream(o)}startDownload(e,t,n,s){const{isDownloading:i}=this.props;if(i)return;this.downloadStartTime=Date.now(),on.info(`start downloading ${e}`),this.table=t,this.columns=t.columns,this.tableSubscription=n,this.gridRanges=s;const o=encodeURIComponent(e.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A"),r=new MessageChannel;if(this.port=r.port1,this.fileName=e,this.fileWriter=this.createWriterStream(this.port).getWriter(),this.useBlobFallback){this.writeCsvTable();return}this.sw&&this.sw.postMessage({encodedFileName:o},[r.port2]),this.port.onmessage=this.handlePortMessage}finishDownload(){this.table&&this.table.close(),this.tableSubscription&&this.tableSubscription.close(),this.fileWriter&&this.fileWriter.close();const{onDownloadCompleted:e}=this.props;e(),this.resetTableSaver(),this.downloadStartTime&&on.info(`download finished, total elapsed time ${(Date.now()-this.downloadStartTime)/1e3} seconds`)}cancelDownload(){this.table&&this.table.close(),this.tableSubscription&&this.tableSubscription.close(),this.fileWriter&&this.fileWriter.abort(),this.cancelableSnapshots.forEach(t=>{t&&(t.catch(()=>null),t.cancel())});const{onDownloadCanceled:e}=this.props;e(),this.resetTableSaver()}resetTableSaver(){this.table=void 0,this.tableSubscription=void 0,this.columns=void 0,this.chunkRows=void 0,this.gridRanges=[],this.gridRangeCounter=0,this.rangedSnapshotsTotal=[],this.rangedSnapshotCounter=0,this.snapshotsTotal=0,this.snapshotCounter=0,this.snapshotsBuffer=new Map,this.currentSnapshotIndex=0,this.snapshotPending=0,this.cancelableSnapshots=[],this.streamTimeout!=null&&clearTimeout(this.streamTimeout),this.snapshotHandlerTimeout!=null&&clearTimeout(this.snapshotHandlerTimeout),this.streamTimeout=void 0,this.snapshotHandlerTimeout=void 0}handleDownloadTimeout(){on.info("download canceled"),this.cancelDownload()}writeTableHeader(){var t;let e="";if(this.columns)for(let n=0;n<this.columns.length;n+=1)e+=this.columns[n].name,e+=n===this.columns.length-1?`
|
|
4
4
|
`:",";(t=this.fileWriter)==null||t.write({header:e}).then(()=>null)}startWriteTableBody(){this.columns&&this.gridRanges&&(this.chunkRows=Math.floor(Nn.DOWNLOAD_CELL_CHUNK/this.columns.length),this.rangedSnapshotsTotal=this.gridRanges.map(e=>(O(e.endRow),O(e.startRow),O(this.chunkRows),Math.ceil((e.endRow-e.startRow+1)/this.chunkRows))),this.snapshotsTotal=this.rangedSnapshotsTotal.reduce((e,t)=>e+t),on.info("start writing table, total snapshots: ",this.snapshotsTotal),this.makeSnapshot(Math.min(Nn.SNAPSHOT_BUFFER_SIZE,this.snapshotsTotal)))}writeCsvTable(){this.writeTableHeader(),this.startWriteTableBody()}writeSnapshot(e,t,n){if(this.currentSnapshotIndex===e&&this.fileWriter){for(;this.snapshotsBuffer.has(this.currentSnapshotIndex);){const s=this.snapshotsBuffer.get(this.currentSnapshotIndex);O(s),this.fileWriter.write({rows:this.convertSnapshotIntoCsv(s)}),this.snapshotsBuffer.delete(this.currentSnapshotIndex),this.currentSnapshotIndex+=1,this.updateDownloadProgress(e)}if(this.snapshotsTotal&&this.currentSnapshotIndex>=this.snapshotsTotal){this.finishDownload();return}}this.snapshotCounter&&this.snapshotsTotal&&this.snapshotCounter<this.snapshotsTotal&&(on.debug2(`
|