@deephaven/embed-chart 0.70.1-alpha-picker-table.35 → 0.70.1-beta.6

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.
Files changed (21) hide show
  1. package/build/assets/{App-6b2a6fb7.js → App-e9e3923f.js} +2 -2
  2. package/build/assets/{App-6b2a6fb7.js.map → App-e9e3923f.js.map} +1 -1
  3. package/build/assets/{Chart-9faa0a01.js → Chart-544f88ca.js} +2 -2
  4. package/build/assets/{Chart-9faa0a01.js.map → Chart-544f88ca.js.map} +1 -1
  5. package/build/assets/{IrisGrid-f939ed99.js → IrisGrid-f7cf10a1.js} +2 -2
  6. package/build/assets/{IrisGrid-f939ed99.js.map → IrisGrid-f7cf10a1.js.map} +1 -1
  7. package/build/assets/{MarkdownEditor-ad338195.js → MarkdownEditor-218535d6.js} +2 -2
  8. package/build/assets/{MarkdownEditor-ad338195.js.map → MarkdownEditor-218535d6.js.map} +1 -1
  9. package/build/assets/{MarkdownNotebook-5a61f9aa.js → MarkdownNotebook-073ebe84.js} +2 -2
  10. package/build/assets/{MarkdownNotebook-5a61f9aa.js.map → MarkdownNotebook-073ebe84.js.map} +1 -1
  11. package/build/assets/{index-b7f9f94d.js → index-685f4927.js} +20 -20
  12. package/build/assets/index-685f4927.js.map +1 -0
  13. package/build/assets/{index-44b25ef3.js → index-9cceedf7.js} +2 -2
  14. package/build/assets/{index-44b25ef3.js.map → index-9cceedf7.js.map} +1 -1
  15. package/build/assets/{useChartTheme-bde778d8.js → useChartTheme-0c5d9e2d.js} +2 -2
  16. package/build/assets/{useChartTheme-bde778d8.js.map → useChartTheme-0c5d9e2d.js.map} +1 -1
  17. package/build/assets/{useConnection-d1a53635.js → useConnection-8d5cefb1.js} +2 -2
  18. package/build/assets/{useConnection-d1a53635.js.map → useConnection-8d5cefb1.js.map} +1 -1
  19. package/build/index.html +1 -1
  20. package/package.json +13 -13
  21. package/build/assets/index-b7f9f94d.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{r as Z,H as X,D as b,F as re,G as ye,a4 as Ee,_ as He,bE as Le,L as _e,V as U}from"./vendor-7d0187fb.js";import{k as qe,L as ie,w as Ke,X as Ge,a as $e,n as ee}from"./index-44b25ef3.js";var Qt=Object.freeze([]),Zt=new Map,Jt=()=>{};function ce(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return e.filter(r=>r!=null)}function Xe(i,e,t){return e=ze(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function ze(i){var e=Ye(i,"string");return typeof e=="symbol"?e:String(e)}function Ye(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class Qe extends Error{constructor(){super(...arguments),Xe(this,"isCanceled",!0)}}const Se=Qe;function Re(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=Ze(i,e);t.forEach(r=>{i[r]=i[r].bind(i)})}function Ze(i,e){for(var t=new Set,r=i,n=0;r!=null&&r!==Object.prototype&&(n<=1||e);){for(var a of Object.getOwnPropertyNames(r))a!=="constructor"&&typeof r[a]=="function"&&t.add(a);r=Object.getPrototypeOf(r),n+=1}return[...t.keys()]}function Je(i,e,t){return e=Ue(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Ue(i){var e=et(i,"string");return typeof e=="symbol"?e:String(e)}function et(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class tt extends Error{constructor(){super(...arguments),Je(this,"isTimeout",!0)}}const ke=tt;class he{static makeCancelable(e,t){var r=!1,n,a,o=new Promise((s,l)=>{a=l,Promise.resolve(e).then(u=>{r?t&&t(u):(n=u,s(u))}).catch(u=>l(u))});return o.cancel=()=>{r=!0,a(new Se),n!=null&&t&&t(n)},o}static isCanceled(e){return e instanceof Se}static isTimedOut(e){return e instanceof ke}static withTimeout(e,t){return new Promise((r,n)=>{setTimeout(()=>{try{r(t())}catch(a){n(a)}},e)})}}class rt{static join(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"and";if(e==null||e.length===0)return"";if(e.length===1)return e[0];if(e.length===2)return"".concat(e[0]," ").concat(t," ").concat(e[1]);var r=e.slice(0,e.length-1).join(", "),n=e[e.length-1];return"".concat(r,", ").concat(t," ").concat(n)}static toLower(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==null){if(t)return"";throw new Error("Null string passed in to TextUtils.toLower")}return e.toLowerCase()}static sort(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e<t?r?-1:1:e>t?r?1:-1:0}}const nt=rt;var Ut=24,er=32,at="DH_ITEM_KEY",tr=32,rr=4,nr=33,ar=150,ir=200,sr=500,or=250,lr={spellCheck:!1};function Ve(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"No value available in context. Was code wrapped in a provider?",t=Z.useContext(i);if(t==null)throw new Error(e);return t}function it(i,e,t){return e=st(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function st(i){var e=ot(i,"string");return typeof e=="symbol"?e:String(e)}function ot(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function ur(i){return i.then!==void 0}class K{static disableAllActions(){K.actionsDisabled=!0}static enableAllActions(){K.actionsDisabled=!1}static isContextActionEvent(e){return Array.isArray(e.contextActions)}static compareActions(e,t){if(e.group!==t.group){var r,n;return((r=e.group)!==null&&r!==void 0?r:0)>((n=t.group)!==null&&n!==void 0?n:0)?1:-1}if(e.order!==t.order){var a,o;return((a=e.order)!==null&&a!==void 0?a:0)>((o=t.order)!==null&&o!==void 0?o:0)?1:-1}if(e.title!==t.title){var s,l;return((s=e.title)!==null&&s!==void 0?s:"")>((l=t.title)!==null&&l!==void 0?l:"")?1:-1}return e!==t?e>t?1:-1:0}static sortActions(e){if(e==null||!Array.isArray(e))return[];var t=e.slice();return t.sort(K.compareActions),t}static isMacPlatform(){var{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return K.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){var t=K.getModifierKey();return e[t]}static getMenuItems(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=[],n=e;Array.isArray(n)||(n=[n]);for(var a=0;a<n.length;a+=1){var o=n[a],s=void 0;typeof o=="function"?s=o():s=o,s!=null&&(s instanceof Promise?t&&r.push(s):Array.isArray(s)?r=r.concat(s):r.push(s))}return r=r.filter(l=>l.title!==void 0||l.then!=null||l.menuElement),r}static getNextMenuItem(e,t,r){var n=e;n<0&&t<0&&(n=r.length);for(var a=1;a<r.length+1;a+=1){var o=(n+t*a+r.length)%r.length,s=r[o];if(!(s instanceof Promise)&&s.disabled!==!0)return o}return e}}it(K,"actionsDisabled",!1);const $=K;var fe=X.forwardRef((i,e)=>{var t,r;function n(P){var{menuItem:w,onMenuItemClick:O}=i;O(w,P)}function a(P){var{menuItem:w,onMenuItemMouseMove:O}=i;O(w,P)}function o(P){var{menuItem:w,onMenuItemContextMenu:O}=i;O(w,P)}function s(P,w,O){if(typeof P.type=="string")return P;var{closeMenu:L,menuItem:H,isKeyboardSelected:B,isMouseSelected:Y,"data-testid":Q}=i,G={menuItem:H,closeMenu:L,isKeyboardSelected:B,isMouseSelected:Y,iconElement:w,displayShortcut:O,"data-testid":Q};return X.cloneElement(P,{forwardedProps:G})}var{children:l,menuItem:u,isKeyboardSelected:c=!1,isMouseSelected:d=!1,"data-testid":f}=i,m=(t=u.shortcutText)!==null&&t!==void 0?t:(r=u.shortcut)===null||r===void 0?void 0:r.getDisplayText(),p=null;if(u.icon){var y=u.icon;if(X.isValidElement(y))p=y;else{var E;u.iconColor!=null&&(u.disabled===void 0||!u.disabled)&&(E={color:u.iconColor}),p=b.jsx(ye,{icon:y,style:E})}}var S=null,A=!!l;u.actions&&(S=b.jsx(ye,{icon:qe}));var T=null;if(u.menuElement)T=b.jsx("div",{className:"custom-menu-item",onMouseMove:a,children:s(u.menuElement,p,m)});else{var N,D=u.disabled,C=u.iconOutline;T=b.jsx("button",{type:"button",className:re("btn-context-menu",{disabled:D},{active:(A||d)&&(D===void 0||!D)},{"keyboard-active":c&&(D===void 0||!D)}),onClick:n,onMouseMove:a,onContextMenu:o,title:(N=u.description)!==null&&N!==void 0?N:"",children:b.jsxs("div",{className:"btn-context-menu-wrapper",children:[b.jsx("span",{className:re("icon",{outline:C}),children:p}),b.jsx("span",{className:"title",children:u.title}),m!==void 0&&b.jsx("span",{className:"shortcut",children:m}),S&&b.jsx("span",{className:re("submenu-indicator",{disabled:D}),children:S})]})})}return b.jsxs("div",{className:"context-menu-item",ref:e,"data-testid":f,children:[l,T]})});fe.displayName="ContextMenuItem";fe.defaultProps={children:null,isKeyboardSelected:!1,isMouseSelected:!1,"data-testid":void 0};const lt=fe;function Te(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),t.push.apply(t,r)}return t}function ut(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Te(Object(t),!0).forEach(function(r){q(i,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Te(Object(t)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))})}return i}function q(i,e,t){return e=ct(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function ct(i){var e=dt(i,"string");return typeof e=="symbol"?e:String(e)}function dt(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var Ae=ie.module("ContextMenu");class ne extends Z.PureComponent{static handleContextMenu(e){e.metaKey||(e.stopPropagation(),e.preventDefault())}constructor(e){super(e),q(this,"container",void 0),q(this,"oldFocus",void 0),q(this,"activeSubMenuRef",void 0),q(this,"subMenuTimer",void 0),q(this,"rAF",void 0),q(this,"initialPosition",void 0),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=X.createRef(),this.oldFocus=document.activeElement,this.activeSubMenuRef=X.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}}componentDidMount(){this.initMenu(),this.verifyPosition(),window.addEventListener("resize",this.handleWindowResize),this.rAF=window.requestAnimationFrame(()=>{var e;(e=this.container.current)===null||e===void 0||e.focus();var{onMenuOpened:t}=this.props;t(this)})}componentDidUpdate(e,t){var{actions:r}=this.props,{activeSubMenu:n}=this.state;if(n!==t.activeSubMenu)if(n==null){var a;(a=this.container.current)===null||a===void 0||a.focus()}else this.setActiveSubMenuPosition();if(e.actions!==r&&(this.initMenu(),this.container.current==null||!this.container.current.contains(document.activeElement))){var o;(o=this.container.current)===null||o===void 0||o.focus()}this.verifyPosition()}componentWillUnmount(){this.cancelPromises(),window.removeEventListener("resize",this.handleWindowResize),cancelAnimationFrame(this.rAF)}getKeyboardIndex(){var{options:e}=this.props;if(e.separateKeyboardMouse!==void 0&&e.separateKeyboardMouse){var{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){var{options:t}=this.props;t.separateKeyboardMouse!==void 0&&t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){var{mouseIndex:e}=this.state;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){this.cancelPromises(),cancelAnimationFrame(this.rAF);var{options:e}=this.props,t=e.initialKeyboardIndex;t===void 0&&(t=-1);for(var{actions:r}=this.props,n=$.getMenuItems(r),a=[],o=n.length-1;o>=0;o-=1){var s=n[o];s instanceof Promise?this.initMenuPromise(s):a.push(s)}this.setState({mouseIndex:-1,keyboardIndex:t,activeSubMenu:null,menuItems:$.sortActions(a)})}initMenuPromise(e){var t=he.makeCancelable(e);this.setState(r=>({pendingItems:r.pendingItems.concat(t)})),t.then(r=>{this.setState(n=>{var a=n.pendingItems.indexOf(t);if(a>=0){var o=n.pendingItems.slice();return o.splice(a,1),{menuItems:$.sortActions(n.menuItems.concat(r)),pendingItems:o}}return null})},r=>{he.isCanceled(r)||(this.setState(n=>{var a=n.pendingItems.indexOf(t);if(a>=0){var o=n.pendingItems.slice();return o.splice(a,1),{pendingItems:o}}return null}),Ae.error(r))})}cancelPromises(){var{pendingItems:e}=this.state;e.map(t=>t.cancel())}setActiveSubMenuPosition(){if(this.activeSubMenuRef.current!==null){var e=this.activeSubMenuRef.current.getBoundingClientRect();this.setState({subMenuTop:e.top,subMenuLeft:e.right,subMenuParentHeight:e.height,subMenuParentWidth:e.width})}}verifyPosition(){var e,t,r,n,{options:a,updatePosition:o,subMenuParentWidth:s,subMenuParentHeight:l,top:u,left:c}=this.props;if(!(!this.container.current||a.doNotVerifyPosition!=null&&a.doNotVerifyPosition)){var{top:d,left:f}=this.initialPosition,{width:m,height:p}=(e=(t=this.container.current)===null||t===void 0?void 0:t.getBoundingClientRect())!==null&&e!==void 0?e:{width:0,height:0},y=((r=(n=this.container.current)===null||n===void 0?void 0:n.scrollHeight)!==null&&r!==void 0?r:0)>window.innerHeight;p===0||m===0||(d+p>window.innerHeight&&(d-p-l>0?d-=p-l:d=window.innerHeight-p),f+m>window.innerWidth&&(f=f-m-s),(c!==f||u!==d)&&(this.setState({hasOverflow:y}),o(d,f)))}}handleWindowResize(){this.container.current&&this.closeMenu(!0)}handleBlur(e){if(!this.container.current){Ae.warn("Container is null!");return}if(!this.container.current.contains(e.relatedTarget)){for(var t=e.relatedTarget,r=!1;t&&!r;)r=t.hasAttribute("data-dh-context-menu"),t=t.parentElement;r||this.closeMenu(!0)}}isEscapeKey(e){var{left:t}=this.props;return e==="Escape"||t<0&&e==="ArrowRight"||e==="ArrowLeft"}handleKeyDown(e){var{menuItems:t}=this.state,r=this.getKeyboardIndex(),n=r,a=!1;if(e.key==="Enter"||e.key===" "){r>=0&&r<t.length&&this.handleMenuItemClick(t[r],e);return}if(e.key==="ArrowRight"?r>=0&&r<=t.length?a=!0:n=0:this.isEscapeKey(e.key)?n=null:e.key==="ArrowUp"||e.shiftKey&&e.key==="Tab"?n=$.getNextMenuItem(n,-1,t):(e.key==="ArrowDown"||e.key==="Tab")&&(n=$.getNextMenuItem(n,1,t)),a){this.openSubMenu(r),e.preventDefault(),e.stopPropagation();return}r!==n&&(n!==null?this.setKeyboardIndex(n):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}openSubMenu(e){var{menuItems:t,activeSubMenu:r}=this.state,n=t[e].actions?e:null;r!==n&&this.setState({activeSubMenu:n,subMenuTop:null,subMenuLeft:null})}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,{closeMenu:t,onMenuClosed:r}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),r(this)})}closeSubMenu(){this.setState({activeSubMenu:null})}handleCloseSubMenu(e){e?this.closeMenu(!0):this.closeSubMenu()}handleMenuItemClick(e,t){t.preventDefault(),t.stopPropagation();var{menuItems:r}=this.state;e!=null&&(e.disabled===void 0||!e.disabled)&&(e.actions!=null?this.openSubMenu(r.indexOf(e)):e.action!=null&&(e.action(t.nativeEvent),this.closeMenu(!0)))}handleMenuItemContextMenu(e,t){t.metaKey||this.handleMenuItemClick(e,t)}handleMenuItemMouseMove(e){var{menuItems:t}=this.state,r=t.indexOf(e);this.setMouseIndex(r),r>=0&&r<t.length&&(e.disabled===void 0||!e.disabled)&&this.openSubMenu(r)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{top:t,left:r}=this.props,{activeSubMenu:n,hasOverflow:a,keyboardIndex:o,menuItems:s,mouseIndex:l,pendingItems:u,subMenuTop:c,subMenuLeft:d,subMenuParentWidth:f,subMenuParentHeight:m}=this.state,p=0;p<s.length;p+=1){var y=s[p];p>0&&y.group!==s[p-1].group&&e.push(b.jsx("hr",{},"".concat(p,".separator")));var E=b.jsx(lt,{ref:n===p?this.activeSubMenuRef:null,isKeyboardSelected:o===p,isMouseSelected:l===p,menuItem:y,closeMenu:this.handleCloseSubMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:this.handleMenuItemContextMenu},p);e.push(E)}var S=null;u.length>0&&(S=b.jsx("div",{className:"loading",children:b.jsx(Ke,{className:"loading-spinner-vertical-align"})}));var{menuStyle:A,"data-testid":T}=this.props,N=n!==null&&c!==null&&d!==null;return b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:re({"has-overflow":a},"context-menu-container"),style:ut({top:t,left:r},A),ref:this.container,"data-dh-context-menu":!0,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,onContextMenu:ne.handleContextMenu,role:"menuitem",tabIndex:0,"data-testid":T,children:[e,S]}),N&&n!==null&&c!==null&&d!==null&&b.jsx(ne,{actions:s[n].actions||[],closeMenu:this.handleCloseSubMenu,top:c,left:d,updatePosition:(D,C)=>{this.setState({subMenuTop:D,subMenuLeft:C})},subMenuParentWidth:f,subMenuParentHeight:m},"sub-".concat(n))]})}}q(ne,"defaultProps",{subMenuParentWidth:0,subMenuParentHeight:0,closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});const ht=ne;function Ne(i,e,t){return e=ft(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function ft(i){var e=vt(i,"string");return typeof e=="symbol"?e:String(e)}function vt(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class gt extends Z.Component{constructor(e){super(e),Ne(this,"container",void 0),Ne(this,"openMenu",void 0),this.handleMenuClose=this.handleMenuClose.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.container=X.createRef(),this.openMenu=X.createRef(),this.state={actions:null,left:0,top:0}}componentDidMount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu)}componentWillUnmount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu)}handleContextMenu(e){if(this.container.current){var t=this.container.current.getBoundingClientRect(),r=e.clientY-t.top,n=e.clientX-t.left,{actions:a}=this.state;if(a!=null&&e.target===this.container.current){e.preventDefault(),this.setState({actions:null},()=>{var s=document.elementFromPoint(n,r),l=new MouseEvent("contextmenu",{clientX:e.clientX,clientY:e.clientY,bubbles:!0,cancelable:!0});s==null||s.dispatchEvent(l)});return}if($.isContextActionEvent(e)&&!(e.metaKey||e.ctrlKey)){var o=$.getMenuItems(e.contextActions);o.length!==0&&(e.preventDefault(),this.setState({actions:o,top:r,left:n}))}}}handleMenuClose(e){e===this.openMenu.current&&this.setState({actions:null})}render(){var e=null,{"data-testid":t}=this.props,{actions:r,top:n,left:a}=this.state;return r&&(e=b.jsx(ht,{ref:this.openMenu,actions:r,onMenuClosed:this.handleMenuClose,top:n,left:a,updatePosition:(o,s)=>{this.setState({top:o,left:s})},"data-testid":t})),b.jsx("div",{className:re("context-menu-root",{active:r}),ref:this.container,children:e})}}const cr=gt;function dr(){return Ve(Ge,"No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?")}function We(i,e,t){return e=pt(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function pt(i){var e=mt(i,"string");return typeof e=="symbol"?e:String(e)}function mt(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class x{static makeDateWrapper(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:1,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:0,l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:0,u=arguments.length>8&&arguments[8]!==void 0?arguments[8]:0;if(!t)throw new Error("No timezone provided");var c="".concat(r).padStart(4,"0"),d="".concat(n+1).padStart(2,"0"),f="".concat(a).padStart(2,"0"),m="".concat(o).padStart(2,"0"),p="".concat(s).padStart(2,"0"),y="".concat(l).padStart(2,"0"),E="".concat(u).padStart(9,"0"),S="".concat(c,"-").concat(d,"-").concat(f," ").concat(m,":").concat(p,":").concat(y,".").concat(E);return e.i18n.DateTimeFormat.parse(x.FULL_DATE_FORMAT,S,e.i18n.TimeZone.getTimeZone(t))}static getNextNanos(e){var t=parseInt(e,10),r="0".repeat(9-e.length),n="".concat(t+1).concat(r);return parseInt(n,10)}static getNextDate(e,t,r,n){var{year:a,month:o,date:s,hours:l,minutes:u,seconds:c,nanos:d}=r;if(t.nanos!=null){if(t.nanos.length===9)return null;d=x.getNextNanos(t.nanos),d>999999999&&(c+=1,d=0)}else t.seconds!=null?c+=1:t.minutes!=null?u+=1:t.hours!=null?l+=1:t.date!=null?s+=1:t.month!=null?o+=1:a+=1;var f=new Date(a,o,s,l,u,c);return x.makeDateWrapper(e,n,f.getFullYear(),f.getMonth(),f.getDate(),f.getHours(),f.getMinutes(),f.getSeconds(),d)}static parseMonth(e){var t=parseInt(e,10);if(!Number.isNaN(t))return t>=1&&t<=12?t-1:NaN;var r=e.trim().toLowerCase();if(r.length>=3){for(var n=0;n<x.months.length;n+=1)if(x.months[n].startsWith(r))return n}return NaN}static parseDateValues(e,t,r,n,a,o,s){var l=parseInt(e,10),u=t!=null?this.parseMonth(t):0,c=r!=null?parseInt(r,10):1,d=n!=null?parseInt(n,10):0,f=a!=null?parseInt(a,10):0,m=o!=null?parseInt(o,10):0,p=s!=null?parseInt(s.padEnd(9,"0"),10):0;return Number.isNaN(l)||Number.isNaN(u)||Number.isNaN(c)||Number.isNaN(d)||Number.isNaN(f)||Number.isNaN(m)||Number.isNaN(p)?null:{year:l,month:u,date:c,hours:d,minutes:f,seconds:m,nanos:p}}static parseDateTimeString(e){var t=/\s*(\d{4})([-./]([\da-z]+))?([-./](\d{1,2}))?([tT\s](\d{2})([:](\d{2}))?([:](\d{2}))?([.](\d{1,9}))?)?(.*)/,r=t.exec(e);if(r==null)throw new Error("Unexpected date string: ".concat(e));var[,n,,a,,o,,s,,l,,u,,c,d]=r;if(d!=null&&d.length>0)throw new Error("Unexpected characters after date string '".concat(e,"': ").concat(d));return{year:n,month:a,date:o,hours:s,minutes:l,seconds:u,nanos:c}}static parseDateRange(e,t,r){var n=t.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"){var a=new Date(Date.now()),o=x.makeDateWrapper(e,r,a.getFullYear(),a.getMonth(),a.getDate()),s=new Date(a.getFullYear(),a.getMonth(),a.getDate()+1),l=x.makeDateWrapper(e,r,s.getFullYear(),s.getMonth(),s.getDate());return[o,l]}if(n==="yesterday"){var u=new Date(Date.now()),c=new Date(u.getFullYear(),u.getMonth(),u.getDate()-1),d=x.makeDateWrapper(e,r,c.getFullYear(),c.getMonth(),c.getDate()),f=x.makeDateWrapper(e,r,u.getFullYear(),u.getMonth(),u.getDate());return[d,f]}if(n==="now"){var m=new Date(Date.now()),p=e.DateWrapper.ofJsDate(m);return[p,null]}var y=x.parseDateTimeString(n);if(y.year==null&&y.month==null&&y.date==null)throw new Error("Unable to extract year, month, or day ".concat(n));var E=x.parseDateValues(y.year,y.month,y.date,y.hours,y.minutes,y.seconds,y.nanos);if(E==null)throw new Error("Unable to extract date values from ".concat(y));var S=x.makeDateWrapper(e,r,E.year,E.month,E.date,E.hours,E.minutes,E.seconds,E.nanos),A=x.getNextDate(e,y,E,r);return[S,A]}static getJsDate(e){return typeof e=="number"?new Date(e):e.asDate()}}We(x,"FULL_DATE_FORMAT","yyyy-MM-dd HH:mm:ss.SSSSSSSSS");We(x,"months",["january","february","march","april","may","june","july","august","september","october","november","december"]);function hr(i,e){return i===e?{operator:"notEq",value:""}:{operator:"eq",value:i}}function fr(i,e,t){return function(n){var a=t.trim();if(a==="")return null;var o=Be(e,s=>s.filter().containsIgnoreCase(i.makeFilterValue(s.type,a)),"or");return o(n)}}function Be(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"or";return function(n){var a=n==null?void 0:n.findColumns(typeof i=="string"?[i]:i);if(a==null||a.length===0)return null;var o=a.map(e);return o.reduce((s,l)=>s[t](l))}}function yt(i,e,t,r){return Be(e,n=>n.filter()[r](i.makeFilterValue(n.type,t)),"or")}function vr(i,e,t,r,n){return function(o){var s=o==null?void 0:o.findColumn(e),l=t==="all"||r&&t.size===0;return s==null||l?null:i.makeSelectValueFilter(s,[...t.keys()],n)}}function gr(i){return function(t){return t.filter().isNull().not().and(t.filter().notEq(i.makeFilterValue(t.type,"")))}}function pr(i,e){return function(r){var n=r.filter(),a=i.makeFilterValue(r.type,""),o=n.eq(a);return e?n.isNull().or(o):o.or(n.notEq(a))}}function ve(i,e,t){return e=Et(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Et(i){var e=St(i,"string");return typeof e=="symbol"?e:String(e)}function St(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class ae{}ve(ae,"not","not");ve(ae,"and","and");ve(ae,"or","or");function mr(i){if(!(i==="not"||i==="and"||i==="or"))throw new Error("operator is not a valid FilterOperatorValue")}function M(i,e,t){return e=Tt(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Tt(i){var e=At(i,"string");return typeof e=="symbol"?e:String(e)}function At(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class v{}M(v,"eq","eq");M(v,"eqIgnoreCase","eqIgnoreCase");M(v,"notEq","notEq");M(v,"notEqIgnoreCase","notEqIgnoreCase");M(v,"greaterThan","greaterThan");M(v,"greaterThanOrEqualTo","greaterThanOrEqualTo");M(v,"lessThan","lessThan");M(v,"lessThanOrEqualTo","lessThanOrEqualTo");M(v,"in","in");M(v,"inIgnoreCase","inIgnoreCase");M(v,"notIn","notIn");M(v,"notInIgnoreCase","notInIgnoreCase");M(v,"isTrue","isTrue");M(v,"isFalse","isFalse");M(v,"isNull","isNull");M(v,"invoke","invoke");M(v,"contains","contains");M(v,"notContains","notContains");M(v,"containsIgnoreCase","containsIgnoreCase");M(v,"startsWith","startsWith");M(v,"endsWith","endsWith");M(v,"containsAny","containsAny");var De=ie.module("ViewportDataUtils");function je(i){return"".concat(at,"_").concat(i)}function Nt(i,e){return je(i.offsetInSnapshot+e)}function yr(i,e){var{bulkUpdate:t}=i;return function(n){var{columns:a,offset:o,rows:s}=n.detail;De.debug("table updated",n.detail);var l=new Map;s.forEach(u=>{var c=e(u,a),d=Nt(u,o);l.set(d,{key:d,item:c})}),De.debug("update keys",l),t(l)}}function Er(i,e){return e.reduce((t,r)=>(t[r.name]=i.get(r),t),{})}function*Sr(i,e){for(var t=i;t<=e;++t)yield{key:je(t)}}function Dt(i){return i==null||bt(i)?0:i.size}function bt(i){return"isClosed"in i?i.isClosed:!1}function Tr(i,e,t,r){var n=i+e-1,[a,o]=[0,r-1],s=Ee(i-t,a,o),l=Ee(n+t,a,o);return[s,l]}function be(i,e,t,r,n,a,o){try{var s=i[a](o),l=s.value}catch(u){t(u);return}s.done?e(l):Promise.resolve(l).then(r,n)}function _(i){return function(){var e=this,t=arguments;return new Promise(function(r,n){var a=i.apply(e,t);function o(l){be(a,r,n,o,s,"next",l)}function s(l){be(a,r,n,o,s,"throw",l)}o(void 0)})}}function z(i,e,t){return e=Pt(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Pt(i){var e=Mt(i,"string");return typeof e=="symbol"?e:String(e)}function Mt(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var j=ie.module("TableUtils");function Ar(i){return i===h.sortDirection.ascending||i===h.sortDirection.descending||i===h.sortDirection.reverse||i===h.sortDirection.none}class h{static copyTableAndApplyFilters(e){var t=arguments;return _(function*(){if(e==null)return null;for(var r=yield e.copy(),n=t.length,a=new Array(n>1?n-1:0),o=1;o<n;o++)a[o-1]=t[o];return r.applyFilter(ce(...a.map(s=>s(r)))),r})()}static getSortIndex(e,t){for(var r=0;r<e.length;r+=1){var n,a=e[r];if(((n=a.column)===null||n===void 0?void 0:n.name)===t)return r}return null}static getSortForColumn(e,t){var r=h.getSortIndex(e,t);return r!=null?e[r]:null}static getFilterText(e){return e?e.toString():null}static getFilterTypes(e){return h.isBooleanType(e)?[v.isTrue,v.isFalse,v.isNull]:h.isCharType(e)||h.isNumberType(e)||h.isDateType(e)?[v.eq,v.notEq,v.greaterThan,v.greaterThanOrEqualTo,v.lessThan,v.lessThanOrEqualTo]:h.isTextType(e)?[v.eq,v.eqIgnoreCase,v.notEq,v.notEqIgnoreCase,v.contains,v.notContains,v.startsWith,v.endsWith]:[]}static getNextSort(e,t,r){if(r<0||r>=e.length)return null;var n=h.getSortForColumn(t,e[r].name);return n===null?e[r].sort().asc():n.direction===h.sortDirection.ascending?n.desc():null}static makeColumnSort(e,t,r,n){if(t<0||t>=e.length||r===h.sortDirection.none)return null;var a=e[t].sort();switch(r){case h.sortDirection.ascending:a=a.asc();break;case h.sortDirection.descending:a=a.desc();break}return n&&(a=a.abs()),a}static toggleSortForColumn(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(r<0||r>=t.length)return[];var a=h.getNextSort(t,e,r);return h.setSortForColumn(e,t[r].name,a,n)}static sortColumn(e,t,r,n,a,o){if(r<0||r>=t.length)return[];var s=h.makeColumnSort(t,r,n,a);return h.setSortForColumn(e,t[r].name,s,o)}static setSortForColumn(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,a=h.getSortIndex(e,t),o=[];return n&&(o=o.concat(e.filter(s=>{var{direction:l}=s;return l!==h.sortDirection.reverse})),a!==null&&o.splice(a,1)),r!==null&&o.push(r),o}static getNormalizedType(e){switch(e){case"boolean":case"java.lang.Boolean":case h.dataType.BOOLEAN:return h.dataType.BOOLEAN;case"char":case"java.lang.Character":case h.dataType.CHAR:return h.dataType.CHAR;case"java.lang.String":case h.dataType.STRING:return h.dataType.STRING;case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":case"java.time.Instant":case"java.time.ZonedDateTime":case h.dataType.DATETIME:return h.dataType.DATETIME;case"double":case"java.lang.Double":case"float":case"java.lang.Float":case"java.math.BigDecimal":case h.dataType.DECIMAL:return h.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 h.dataType.INT:return h.dataType.INT;default:return h.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"java.time.Instant":case"java.time.ZonedDateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":return!0;default:return!1}}static isNumberType(e){return h.isIntegerType(e)||h.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 isBigDecimalType(e){switch(e){case"java.math.BigDecimal":return!0;default:return!1}}static isBigIntegerType(e){switch(e){case"java.math.BigInteger":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 h.getNormalizedType(e)===h.getNormalizedType(t)}static quoteValue(e){return e.length>=2&&(e.charAt(0)==='"'&&e.charAt(e.length-1)==='"'||e.charAt(0)==="'"&&e.charAt(e.length-1)==="'")?e:'"'.concat(e,'"')}static isRangeOperation(e){switch(e){case"<":case"<=":case"=<":case">":case">=":case"=>":return!0;default:return!1}}static makeRangeFilterWithOperation(e,t,r){switch(t){case"=":return e.eq(r);case"<":return e.lessThan(r);case"<=":case"=<":return e.lessThanOrEqualTo(r);case">":return e.greaterThan(r);case">=":case"=>":return e.greaterThanOrEqualTo(r);case"!=":case"!":return e.notEq(r);default:return null}}static makeCancelableTablePromise(e){return he.makeCancelable(e,t=>{t.close()})}static makeCancelableTableEventPromise(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,a,o,s=!0,l=new Promise((u,c)=>{o=setTimeout(()=>{a(),s=!1,c(new ke('Event "'.concat(t,'" timed out.')))},r),a=e.addEventListener(t,d=>{if(n!=null&&!n(d)){j.debug2("Event triggered, but matcher returned false.");return}j.debug2("Event triggered, resolving."),a(),clearTimeout(o),s=!1,u(d)})});return l.cancel=()=>{if(s){j.debug2("Pending promise cleanup."),a(),clearTimeout(o),s=!1;return}j.debug2("Ignoring non-pending promise cancel.")},l}static removeCommas(e){return e.replace(/[\s|,]/g,"")}static makeBooleanValue(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!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 '".concat(e,"'"))}}static makeNumberValue(e){if(e==="null"||e==="")return null;var t=e.toLowerCase().trim();if(t==="∞"||t==="infinity"||t==="inf")return Number.POSITIVE_INFINITY;if(t==="-∞"||t==="-infinity"||t==="-inf")return Number.NEGATIVE_INFINITY;var r=h.removeCommas(t);if(h.NUMBER_REGEX.test(r))return parseFloat(r);throw new Error("Invalid number '".concat(e,"'"))}static getFilterOperatorString(e){switch(e){case v.eq:return"=";case v.notEq:return"!=";case v.greaterThan:return">";case v.greaterThanOrEqualTo:return">=";case v.lessThan:return"<";case v.lessThanOrEqualTo:return"<=";case v.contains:return"~";case v.notContains:return"!~";default:throw new Error("Unexpected filter type ".concat(e))}}static isPartitionedTable(e){return e!=null&&e.getMergedTable!==void 0&&e.getKeyTable!==void 0&&e.getKeys!==void 0}static isTreeTable(e){return e!=null&&e.expand!==void 0&&e.collapse!==void 0}static sortColumns(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return[...e].sort((r,n)=>{var a=r.name.toUpperCase(),o=n.name.toUpperCase();return nt.sort(a,o,t)})}constructor(e){z(this,"dh",void 0),this.dh=e,Re(this)}createDistinctSortedColumnTable(e,t,r){var n=arguments,a=this;return _(function*(){if(e==null)return null;for(var o=e,s=n.length,l=new Array(s>3?s-3:0),u=3;u<s;u++)l[u-3]=n[u];l.length>0&&(o=yield e.copy(),yield o.applyFilter(ce(...l.map(m=>m(o)))));var c=o.findColumn(t),d=yield o.selectDistinct([c]);o!==e&&o.close();var f=d.findColumn(t).sort()[r]();return a.applySort(d,[f])})()}doesColumnValueExist(e,t,r,n){var a=this;return _(function*(){if(e==null)return null;var o=yt(a,t,r,n?"eq":"eqIgnoreCase"),s=yield e.copy();yield a.applyFilter(s,ce(o(s)));var l=Dt(s);return s.close(),l>0})()}getValueType(e){if(e==null)return this.dh.ValueType.STRING;var t=h.getNormalizedType(e);switch(t){case h.dataType.BOOLEAN:return this.dh.ValueType.BOOLEAN;case h.dataType.CHAR:case h.dataType.STRING:return this.dh.ValueType.STRING;case h.dataType.DATETIME:return this.dh.ValueType.DATETIME;case h.dataType.DECIMAL:case h.dataType.INT:return h.isBigDecimalType(e)||h.isBigIntegerType(e)?this.dh.ValueType.STRING:this.dh.ValueType.NUMBER;default:return this.dh.ValueType.STRING}}makeQuickFilter(e,t,r){for(var n=t.split("||"),a=null,o=0;o<n.length;o+=1){for(var s=n[o],l=s.split("&&"),u=null,c=0;c<l.length;c+=1){var d=l[c].trim();if(d.length>0){var f=this.makeQuickFilterFromComponent(e,d,r);if(f)u?u=u.and(f):u=f;else throw new Error("Unable to parse quick filter from text ".concat(t))}}a&&u?a=a.or(u):a=u}return a}makeQuickFilterFromComponent(e,t,r){var{type:n}=e;return h.isNumberType(n)?this.makeQuickNumberFilter(e,t):h.isBooleanType(n)?this.makeQuickBooleanFilter(e,t):r!=null&&h.isDateType(n)?this.makeQuickDateFilter(e,t,r):h.isCharType(n)?this.makeQuickCharFilter(e,t):this.makeQuickTextFilter(e,t)}makeQuickNumberFilter(e,t){var r=e.filter(),{dh:n}=this,a=null,o=/\s*(>=|<=|=>|=<|>|<|!=|=|!)?(\s*-\s*)?(\s*\d*(?:,\d{3})*(?:\.\d*)?\s*)?(null|nan|infinity|inf|\u221E)?(.*)/i,s=o.exec(t),l=null,u=null,c=null,d=null,f=null;if(s!==null&&s.length>3&&([,l,u,c,d,f]=s),f!=null&&f.trim().length>0)return null;if(l==null&&(l="="),d!=null){if(!(l==="="||l==="!"||l==="!="))return null;switch(d=d.trim().toLowerCase(),d){case"null":a=r.isNull();break;case"nan":a=n.FilterCondition.invoke("isNaN",r);break;case"infinity":case"inf":case"∞":u!=null?a=n.FilterCondition.invoke("isInf",r).and(r.lessThan(n.FilterValue.ofNumber(0))):a=n.FilterCondition.invoke("isInf",r).and(r.greaterThan(n.FilterValue.ofNumber(0)));break}return a!==null&&(l==="!"||l==="!=")&&(a=a.not()),a}if(c==null)return null;if(c=h.removeCommas(c),h.isLongType(e.type))try{c=n.FilterValue.ofNumber(n.LongWrapper.ofString("".concat(u!=null?"-":"").concat(c)))}catch(m){return j.warn("Unable to create long filter",m),null}else{if(c=parseFloat(c),c==null||Number.isNaN(c))return null;c=n.FilterValue.ofNumber(u!=null?0-c:c)}return a=e.filter(),h.makeRangeFilterWithOperation(a,l,c)}static escapeQuickTextFilter(e){var t,r;if(e==null)return null;var n=/^(!~|!=|~|=|!)?(.*)/,a=/^\\*null$/,o=n.exec(e),s=null,l=null;if(o!==null&&o.length>2&&([,s,l]=o),s!=null){var u;return"\\".concat(s).concat((u=l)!==null&&u!==void 0?u:"")}return l!=null&&a.test(l.toLowerCase())||l!=null&&l.startsWith("*")?"\\".concat(l):l!=null&&l.endsWith("*")&&!l.endsWith("\\*")?(l=l.substring(0,l.length-1),"".concat(l,"\\*")):"".concat((t=s)!==null&&t!==void 0?t:"").concat((r=l)!==null&&r!==void 0?r:"")}static unescapeQuickTextFilter(e){var t,r,n=/^(\\!~|\\!=|\\~|\\=|\\!)?(.*)/,a=/^\\*null$/,o=n.exec(e),s=null,l=null;return o!==null&&o.length>2&&([,s,l]=o),s!=null&&(s=s.replace("\\","")),l!=null&&a.test(l.toLowerCase())&&(l=l.replace("\\","")),s==null&&l!=null&&l.startsWith("\\*")&&(l=l.substring(1)),s==null&&l!=null&&l.endsWith("\\*")?(l=l.substring(0,l.length-2),"".concat(l,"*")):"".concat((t=s)!==null&&t!==void 0?t:"").concat((r=l)!==null&&r!==void 0?r:"")}makeQuickTextFilter(e,t){var{dh:r}=this,n="".concat(t).trim(),a=/^(!~|!=|~|=|!)?(.*)/,o=a.exec(n),s=null,l=null;if(o!==null&&o.length>2&&([,s,l]=o,l!=null&&(l=l.trim())),l==null||l.length===0&&!(s==="="||s==="!="))return null;s==null&&(s="=");var u=e.filter();if(l.toLowerCase()==="null")switch(s){case"=":return u.isNull();case"!=":case"!":return u.isNull().not()}var c=null,d=null;switch(l.startsWith("*")?(c="*",l=l.substring(1)):l.endsWith("*")&&!l.endsWith("\\*")&&(d="*",l=l.substring(0,l.length-1)),l=h.unescapeQuickTextFilter(l),s){case"~":return u.isNull().not().and(u.invoke("matches",r.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E.*"))));case"!~":return u.isNull().or(u.invoke("matches",r.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E.*"))).not());case"!=":return c==="*"?u.isNull().or(u.invoke("matches",r.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E$"))).not()):d==="*"?u.isNull().or(u.invoke("matches",r.FilterValue.ofString("(?s)(?i)^\\Q".concat(l,"\\E.*"))).not()):u.notEqIgnoreCase(r.FilterValue.ofString(l.toLowerCase()));case"=":return c==="*"?u.isNull().not().and(u.invoke("matches",r.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E$")))):d==="*"?u.isNull().not().and(u.invoke("matches",r.FilterValue.ofString("(?s)(?i)^\\Q".concat(l,"\\E.*")))):u.eqIgnoreCase(r.FilterValue.ofString(l.toLowerCase()))}return null}makeQuickBooleanFilter(e,t){var r=/^(!=|=|!)?(.*)/,n=r.exec("".concat(t).trim());if(n===null)return null;var[,a,o]=n,s=a==="!"||a==="!=",l=o.trim().toLowerCase(),u=e.filter();try{var c=h.makeBooleanValue(l);return c!=null&&c?u=u.isTrue():c===null?u=u.isNull():u=u.isFalse(),s?u.not():u}catch{return null}}makeQuickDateFilter(e,t,r){var n=t.trim(),a=/\s*(>=|<=|=>|=<|>|<|!=|!|=)?(.*)/,o=a.exec(n);if(o==null||o.length<=2)throw new Error("Unable to parse date filter: ".concat(t));var s=null,l=null;[,s,l]=o;var u=v.eq;switch(s){case"<":u=v.lessThan;break;case"<=":case"=<":u=v.lessThanOrEqualTo;break;case">":u=v.greaterThan;break;case">=":case"=>":u=v.greaterThanOrEqualTo;break;case"!=":case"!":u=v.notEq;break;case"=":case"==":default:u=v.eq;break}return this.makeQuickDateFilterWithOperation(e,l,u,r)}makeQuickDateFilterWithOperation(e,t,r,n){var{dh:a}=this,[o,s]=x.parseDateRange(a,t,n),l=o!=null?a.FilterValue.ofNumber(o):null,u=s!=null?a.FilterValue.ofNumber(s):null,c=e.filter();if(l==null)return r===v.notEq?c.isNull().not():c.isNull();switch(r){case v.eq:{if(u!=null){var d=c.greaterThanOrEqualTo(l),f=c.lessThan(u);return d.and(f)}return c.eq(l)}case v.lessThan:return c.lessThan(l);case v.lessThanOrEqualTo:return u!=null?c.lessThan(u):c.lessThanOrEqualTo(l);case v.greaterThan:return u!=null?c.greaterThanOrEqualTo(u):c.greaterThan(l);case v.greaterThanOrEqualTo:return c.greaterThanOrEqualTo(l);case v.notEq:{if(u!=null){var m=c.lessThan(l),p=c.greaterThanOrEqualTo(u);return m.or(p)}return c.notEq(l)}default:throw new Error("Invalid operator: ".concat(r))}}makeQuickCharFilter(e,t){var{dh:r}=this,n="".concat(t).trim(),a=/^(>=|<=|=>|=<|>|<|!=|=|!)?(null|"."|'.'|.)?(.*)/,o=a.exec(n),s=null,l=null,u=null;if(o!==null&&o.length>3&&([,s,l,u]=o),u!=null&&u.trim().length>0||l==null||l.length===0)return null;s==null&&(s="=");var c=e.filter();if(l.toLowerCase()==="null")switch(s){case"=":return c.isNull();case"!=":case"!":return c.isNull().not();default:return null}var d=r.FilterValue.ofString(h.isRangeOperation(s)?h.quoteValue(l):l);return h.makeRangeFilterWithOperation(c,s,d)}makeAdvancedFilter(e,t,r){for(var{filterItems:n,filterOperators:a,invertSelection:o,selectedValues:s}=t,l=null,u=0;u<n.length;u+=1){var c=n[u],{selectedType:d,value:f}=c;if(d!=null&&d.length>0&&f!=null&&f.length>0)try{var m=this.makeAdvancedValueFilter(e,d,f,r);if(m!=null){if(u===0)l=m;else if(l!==null&&u-1<a.length){var p=a[u-1];if(p===ae.and)l=l.and(m);else if(p===ae.or)l=l.or(m);else{j.error("Unexpected filter operator",p,m),l=null;break}}}else j.debug2("Empty filter ignored for",d,f)}catch(E){j.error("Unable to create filter",E),l=null;break}}var y=this.makeSelectValueFilter(e,s,o);return y!=null&&(l!=null?l=l.and(y):l=y),l}makeAdvancedValueFilter(e,t,r,n){var{dh:a}=this;if(h.isDateType(e.type))return this.makeQuickDateFilterWithOperation(e,r,t,n);if(h.isNumberType(e.type)||h.isCharType(e.type))return this.makeQuickFilter(e,"".concat(h.getFilterOperatorString(t)).concat(r));var o=this.makeFilterValue(e.type,r),s=e.filter();switch(t){case v.eq:return s.eq(o);case v.eqIgnoreCase:return s.eqIgnoreCase(o);case v.notEq:return s.notEq(o);case v.notEqIgnoreCase:return s.notEqIgnoreCase(o);case v.greaterThan:return s.greaterThan(o);case v.greaterThanOrEqualTo:return s.greaterThanOrEqualTo(o);case v.lessThan:return s.lessThan(o);case v.lessThanOrEqualTo:return s.lessThanOrEqualTo(o);case v.isTrue:return s.isTrue();case v.isFalse:return s.isFalse();case v.isNull:return s.isNull();case v.contains:return s.isNull().not().and(s.invoke("matches",a.FilterValue.ofString("(?s)(?i).*\\Q".concat(r,"\\E.*"))));case v.notContains:return s.isNull().or(s.invoke("matches",a.FilterValue.ofString("(?s)(?i).*\\Q".concat(r,"\\E.*"))).not());case v.startsWith:return s.isNull().not().and(s.invoke("matches",a.FilterValue.ofString("(?s)(?i)^\\Q".concat(r,"\\E.*"))));case v.endsWith:return s.isNull().not().and(s.invoke("matches",a.FilterValue.ofString("(?s)(?i).*\\Q".concat(r,"\\E$"))));case v.in:case v.inIgnoreCase:case v.notIn:case v.notInIgnoreCase:case v.invoke:default:throw new Error("Unexpected filter operation: ".concat(t))}}applyNeverFilter(e,t){var r=arguments,n=this;return _(function*(){var a=r.length>2&&r[2]!==void 0?r[2]:h.APPLY_TABLE_CHANGE_TIMEOUT_MS;if(e==null)return null;var o=e.findColumn(t),s=[n.makeNeverFilter(o)];return yield n.applyFilter(e,s,a),e})()}applyCustomColumns(e,t){var r=arguments,n=this;return _(function*(){var a=r.length>2&&r[2]!==void 0?r[2]:h.APPLY_TABLE_CHANGE_TIMEOUT_MS,{dh:o}=n;return h.executeAndWaitForEvent(s=>s==null?void 0:s.applyCustomColumns(t),e,o.Table.EVENT_CUSTOMCOLUMNSCHANGED,a)})()}applyFilter(e,t){var r=arguments,n=this;return _(function*(){var a=r.length>2&&r[2]!==void 0?r[2]:h.APPLY_TABLE_CHANGE_TIMEOUT_MS,{dh:o}=n;return h.executeAndWaitForEvent(s=>s==null?void 0:s.applyFilter(t),e,o.Table.EVENT_FILTERCHANGED,a)})()}applySort(e,t){var r=arguments,n=this;return _(function*(){var a=r.length>2&&r[2]!==void 0?r[2]:h.APPLY_TABLE_CHANGE_TIMEOUT_MS,{dh:o}=n;return h.executeAndWaitForEvent(s=>s==null?void 0:s.applySort(t),e,o.Table.EVENT_SORTCHANGED,a)})()}makeNeverFilter(e){var{dh:t}=this,r=null;h.isTextType(e.type)?r=t.FilterValue.ofString("a"):h.isBooleanType(e.type)?r=t.FilterValue.ofBoolean(!0):h.isDateType(e.type)?r=t.FilterValue.ofNumber(t.DateWrapper.ofJsDate(new Date)):r=t.FilterValue.ofNumber(0);var n=e.filter().eq(r),a=e.filter().notEq(r);return n.and(a)}makeFilterValue(e,t){var{dh:r}=this,n=h.getBaseType(e);return h.isTextType(n)?r.FilterValue.ofString(t):h.isLongType(n)?r.FilterValue.ofNumber(r.LongWrapper.ofString(h.removeCommas(t))):r.FilterValue.ofNumber(h.removeCommas(t))}makeFilterRawValue(e,t){var{dh:r}=this;return h.isCharType(e)?r.FilterValue.ofString(typeof t=="number"?String.fromCharCode(t):t):h.isTextType(e)?r.FilterValue.ofString(t):h.isBooleanType(e)?r.FilterValue.ofBoolean(t):r.FilterValue.ofNumber(t)}makeValue(e,t,r){var{dh:n}=this;if(t==="null")return null;if(h.isTextType(e))return t;if(h.isLongType(e))return n.LongWrapper.ofString(h.removeCommas(t));if(h.isBooleanType(e))return h.makeBooleanValue(t,!0);if(h.isDateType(e)){var[a]=x.parseDateRange(n,t,r);return a}return h.isNumberType(e)?h.makeNumberValue(t):(j.error("Unexpected column type",e),null)}makeSelectValueFilter(e,t,r){var{dh:n}=this;if(t.length===0)return r?null:this.makeNeverFilter(e);for(var a=[],o=!1,s=0;s<t.length;s+=1){var l=t[s];l==null?o=!0:h.isTextType(e.type)?a.push(n.FilterValue.ofString(typeof l=="number"?String.fromCharCode(l):l)):h.isBooleanType(e.type)?a.push(n.FilterValue.ofBoolean(!!l)):a.push(n.FilterValue.ofNumber(l))}return o?a.length>0?r?e.filter().isNull().not().and(e.filter().notIn(a)):e.filter().isNull().or(e.filter().in(a)):r?e.filter().isNull().not():e.filter().isNull():r?e.filter().notIn(a):e.filter().in(a)}}z(h,"dataType",{BOOLEAN:"boolean",CHAR:"char",DATETIME:"datetime",DECIMAL:"decimal",INT:"int",STRING:"string",UNKNOWN:"unknown"});z(h,"sortDirection",{ascending:"ASC",descending:"DESC",reverse:"REVERSE",none:null});z(h,"APPLY_TABLE_CHANGE_TIMEOUT_MS",3e4);z(h,"REVERSE_TYPE",Object.freeze({NONE:"none",PRE_SORT:"pre-sort",POST_SORT:"post-sort"}));z(h,"NUMBER_REGEX",/^-?\d+(\.\d+)?$/);z(h,"executeAndWaitForEvent",function(){var i=_(function*(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:h.APPLY_TABLE_CHANGE_TIMEOUT_MS;if(t==null)return null;var a=h.makeCancelableTableEventPromise(t,r,n);return e(t),yield a,t});return function(e,t,r){return i.apply(this,arguments)}}());function Pe(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),t.push.apply(t,r)}return t}function Ft(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Pe(Object(t),!0).forEach(function(r){wt(i,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Pe(Object(t)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))})}return i}function wt(i,e,t){return e=Ot(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Ot(i){var e=It(i,"string");return typeof e=="symbol"?e:String(e)}function It(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var Ct=Z.lazy(()=>He(()=>import("./Chart-9faa0a01.js"),["./Chart-9faa0a01.js","./vendor-7d0187fb.js","./helpers-de833af9.js","./vendor-a4479904.css","./index-44b25ef3.js","./index-7535fde1.css","./Plotly-da68c98c.js","./plotly-d72b6537.js","./useChartTheme-bde778d8.js","./useChartTheme-bb495fb2.css","./Chart-b27697ef.css"],import.meta.url));function Nr(i){return b.jsx(Z.Suspense,{fallback:b.jsx($e,{}),children:b.jsx(Ct,Ft({},i))})}function Me(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),t.push.apply(t,r)}return t}function le(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Me(Object(t),!0).forEach(function(r){k(i,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Me(Object(t)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))})}return i}function k(i,e,t){return e=xt(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function xt(i){var e=Lt(i,"string");return typeof e=="symbol"?e:String(e)}function Lt(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var te=ie.module("ChartUtils"),Fe="io.deephaven.time.DateTime",Rt=36e5,kt=1e6;function Vt(i){return i.asDate!==void 0}function Wt(i){return i.asNumber!==void 0}function we(i){return i.dhTimeZone!==void 0}function Bt(i){return i!=null&&i.range!=null&&(i.autorange===!1||i.autorange===void 0)}function jt(){var i=document.createElement("canvas"),e=i.getContext("webgl")||i.getContext("experimental-webgl");return e!=null&&e instanceof WebGLRenderingContext}var Ht=jt();class g{static getPlotlyErrorBars(e,t,r){var n=r.map((o,s)=>o-e[s]),a=t.map((o,s)=>e[s]-o);return{type:"data",symmetric:!1,array:n,arrayminus:a}}static convertNumberPrefix(e){return e.replace(/\u00A4\u00A4/g,"USD").replace(/\u00A4/g,"$")}static getPlotlyNumberFormat(e,t,r){if(r==null||r==="")return null;var n=r.split(";"),a=n[0].match(/^([^#,0.]*)([#,]*)([0,]*)(\.?)(0*)(#*)(E?0*)(%?)(.*)/);ee(a);var[,o,s,l,,u,c,d,f,m]=a,p=l.replace(",","").length,y=s.indexOf(",")>=0||l.indexOf(",")>=0,E=y?",":"",S=d!=null&&d!==""?"e":"f",A=f!==""?f:S,T=u.length+c.length,N="",D="0".concat(p).concat(E,".").concat(T).concat(N).concat(A),C=g.convertNumberPrefix(o),P=g.convertNumberPrefix(m);return{tickformat:D,tickprefix:C,ticksuffix:P,automargin:!0}}static addTickSpacing(e,t,r){var{gapBetweenMajorTicks:n}=t;if(n!=null&&n>0){var a=e||{},o=n;return r&&(o=n/kt),t.log&&(o=Math.log(o)),a.tickmode="linear",a.dtick=o,a}return e}static getSourceForAxis(e,t){for(var r=0;r<e.series.length;r+=1)for(var n=e.series[r],a=0;a<n.sources.length;a+=1){var o=n.sources[a];if(o.axis===t)return o}return null}static getSeriesVisibility(e,t){return t!=null&&t.hiddenSeries!=null&&t.hiddenSeries.includes(e)?"legendonly":!0}static getHiddenLabels(e){return e!=null&&e.hiddenSeries?[...e.hiddenSeries]:[]}static makeSeriesData(e,t,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:g.ORIENTATION.VERTICAL;return{type:e,mode:t,name:r,orientation:a,showlegend:n??void 0}}static getMarkerSymbol(e){switch(e){case"SQUARE":return"square";case"CIRCLE":return"circle";case"DIAMOND":return"diamond";case"UP_TRIANGLE":return"triangle-up";case"DOWN_TRIANGLE":return"triangle-down";case"RIGHT_TRIANGLE":return"triangle-right";case"LEFT_TRIANGLE":return"triangle-left";case"ELLIPSE":case"HORIZONTAL_RECTANGLE":case"VERTICAL_RECTANGLE":default:throw new Error("Unrecognized shape ".concat(e))}}static getAllAxes(e){return e.charts.reduce((t,r)=>[...t,...r.axes],[])}static getAxisTypeMap(e){var t=g.getAllAxes(e);return g.groupArray(t,"type")}static getChartForSeries(e,t){for(var{charts:r}=e,n=0;n<r.length;n+=1)for(var a=r[n],o=0;o<a.series.length;o+=1)if(t===a.series[o])return a;return null}static getLayoutRanges(e){for(var t={},r=Object.keys(e).filter(s=>s.indexOf("axis")>=0),n=0;n<r.length;n+=1){var a=r[n],o=e[a];Bt(o)&&(t[a]=[...o.range])}return t}static getAxisLayoutProperty(e,t){var r=t>0?"".concat(t+1):"";return"".concat(e??"","axis").concat(r)}static periodToDecimal(e){var t=e.split(":");return Number(t[0])+Number(t[1])/60}static groupArray(e,t){return e.reduce((r,n)=>{var a,o=n[t],s=(a=r.get(o))!==null&&a!==void 0?a:[];return s.push(n),r.set(o,s),r},new Map)}static normalizeColorway(e){if(e!=null){if(Array.isArray(e))return e;if(typeof e=="string")return e.split(" ");te.warn("Unexpected colorway format: ".concat(e))}}static titleFromSettings(e){var{series:t,xAxis:r,title:n="".concat((t??[]).join(", ")," by ").concat(r)}=e;return n}constructor(e){k(this,"dh",void 0),k(this,"daysOfWeek",void 0),this.dh=e,this.daysOfWeek=Object.freeze(e.calendar.DayOfWeek.values()),Re(this)}getAxisFormats(e,t){for(var r=this,n=new Map,a={tickformat:null,ticksuffix:null},o=g.getAllAxes(e),s=g.groupArray(o,"type"),{charts:l}=e,u=0;u<l.length;u+=1)for(var c=l[u],d=0;d<c.series.length;d+=1)for(var f=c.series[d],{sources:m}=f,p=m.filter(A=>A.axis),y=function(){var T=p[E],{axis:N}=T,{type:D}=N,C=s.get(D);ee(C);var P=C.indexOf(N),w=r.getAxisPropertyName(D);if(w!=null){var O=g.getAxisLayoutProperty(w,P);if(n.has(O))te.debug("".concat(O," already added."));else{te.debug("Adding ".concat(O," to axisFormats."));var L=r.getPlotlyAxisFormat(T,t);if(L===null)n.set(O,a);else{n.set(O,L);var{businessCalendar:H}=N;if(H!=null){var B=[],{businessPeriods:Y,businessDays:Q,holidays:G,timeZone:J}=H,pe=t==null?void 0:t.getColumnTypeFormatter(Fe),se;we(pe)&&(se=pe.dhTimeZone);var me=se?(J.standardOffset-se.standardOffset)/60:0;G.length>0&&B.push(...r.createRangeBreakValuesFromHolidays(G,J,se)),Y.forEach(oe=>B.push({pattern:"hour",bounds:[g.periodToDecimal(oe.close)+me,g.periodToDecimal(oe.open)+me]})),Q.length<r.daysOfWeek.length&&r.createBoundsFromDays(Q).forEach(oe=>B.push({pattern:"day of week",bounds:oe})),L.rangebreaks=B}if(n.size===c.axes.length)return{v:n}}}}},E=0;E<p.length;E+=1){var S=y();if(typeof S=="object")return S.v}return n}getPlotlyChartType(e,t){var{dh:r}=this;switch(e){case r.plot.SeriesPlotStyle.SCATTER:case r.plot.SeriesPlotStyle.LINE:return!t&&Ht?"scattergl":"scatter";case r.plot.SeriesPlotStyle.BAR:case r.plot.SeriesPlotStyle.STACKED_BAR:return"bar";case r.plot.SeriesPlotStyle.PIE:return"pie";case r.plot.SeriesPlotStyle.TREEMAP:return"treemap";case r.plot.SeriesPlotStyle.HISTOGRAM:return"histogram";case r.plot.SeriesPlotStyle.OHLC:return"ohlc";default:return}}getPlotlyChartMode(e,t,r){var{dh:n}=this,a=new Set;switch(e){case n.plot.SeriesPlotStyle.SCATTER:(t??!1)&&a.add(g.MODE_LINES),(r??!0)&&a.add(g.MODE_MARKERS);break;case n.plot.SeriesPlotStyle.LINE:(t??!0)&&a.add(g.MODE_LINES),(r??!1)&&a.add(g.MODE_MARKERS);break}return a.size>0?[...a].join("+"):void 0}getPlotlyProperty(e,t){var{dh:r}=this;switch(e){case r.plot.SeriesPlotStyle.PIE:switch(t){case r.plot.SourceType.X:return"labels";case r.plot.SourceType.Y:return"values"}break;case r.plot.SeriesPlotStyle.OHLC:switch(t){case r.plot.SourceType.TIME:return"x"}break;case r.plot.SeriesPlotStyle.TREEMAP:switch(t){case r.plot.SourceType.X:return"ids";case r.plot.SourceType.Y:return"values";case r.plot.SourceType.LABEL:return"labels";case r.plot.SourceType.PARENT:return"parents";case r.plot.SourceType.COLOR:return"marker.colors"}break}switch(t){case r.plot.SourceType.X:return"x";case r.plot.SourceType.Y:return"y";case r.plot.SourceType.Z:return"z";case r.plot.SourceType.X_LOW:return"xLow";case r.plot.SourceType.X_HIGH:return"xHigh";case r.plot.SourceType.Y_LOW:return"yLow";case r.plot.SourceType.Y_HIGH:return"yHigh";case r.plot.SourceType.TIME:return"time";case r.plot.SourceType.OPEN:return"open";case r.plot.SourceType.HIGH:return"high";case r.plot.SourceType.LOW:return"low";case r.plot.SourceType.CLOSE:return"close";case r.plot.SourceType.SHAPE:return"shape";case r.plot.SourceType.SIZE:return"size";case r.plot.SourceType.LABEL:return"label";case r.plot.SourceType.COLOR:return"color";case r.plot.SourceType.PARENT:return"parent";case r.plot.SourceType.HOVER_TEXT:return"hovertext";case r.plot.SourceType.TEXT:return"text";default:throw new Error("Unrecognized source type: ".concat(t))}}getPlotlySeriesOrientation(e){var t,r,{dh:n}=this,{sources:a}=e;return a.length===2&&((t=a[0])===null||t===void 0||(r=t.axis)===null||r===void 0?void 0:r.type)===n.plot.AxisType.Y?g.ORIENTATION.HORIZONTAL:g.ORIENTATION.VERTICAL}makeSeriesDataFromSeries(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,{name:a,isLinesVisible:o,isShapesVisible:s,plotStyle:l,lineColor:u,shapeColor:c,sources:d,shape:f,shapeSize:m}=e,p=d.some(T=>{var N;return(N=T.axis)===null||N===void 0?void 0:N.businessCalendar}),y=this.getChartType(l,p),E=this.getPlotlyChartMode(l,o??void 0,s??void 0),S=this.getPlotlySeriesOrientation(e),A=g.makeSeriesData(y,E,a,n,S);return this.addSourcesToSeriesData(A,l,d,t),this.addStylingToSeriesData(A,l,u,c,f,m,r),A}addSourcesToSeriesData(e,t,r,n){for(var a=e,o=0;o<r.length;o+=1){var s=r[o],{axis:l,type:u}=s,c=this.getPlotlyProperty(t,u);Le(a,c,[]);var d=l!=null?this.getAxisPropertyName(l.type):null;if(d!=null){var f=n.get(l.type);if(f){var m=f.indexOf(l),p=m>0?"".concat(m+1):"";a["".concat(d,"axis")]="".concat(d).concat(p)}}}}addStylingToSeriesData(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:null,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null,{dh:l}=this,u=e;if(u.marker={line:{}},u.line={width:1},t===l.plot.SeriesPlotStyle.AREA?u.fill="tozeroy":t===l.plot.SeriesPlotStyle.STACKED_AREA?u.stackgroup="stack":t===l.plot.SeriesPlotStyle.STEP?u.line.shape="hv":t===l.plot.SeriesPlotStyle.HISTOGRAM?u.width=[]:t===l.plot.SeriesPlotStyle.PIE?u.textinfo="label+percent":t===l.plot.SeriesPlotStyle.TREEMAP&&(u.hoverinfo="text",u.textinfo="label+text",u.tiling={packing:"squarify",pad:0},u.textposition="middle center"),r!=null&&(t===l.plot.SeriesPlotStyle.BAR?u.marker.color=r:u.line.color=r),n!=null&&(u.marker.color=n),a!=null&&a.length>0)try{u.marker.symbol=g.getMarkerSymbol(a)}catch(c){te.warn("Unable to handle shape",a,":",c)}o!=null&&(u.marker.size=o*g.DEFAULT_MARKER_SIZE),s!=null&&t!==l.plot.SeriesPlotStyle.PIE&&(u.visible=s)}getChartType(e,t){var{dh:r}=this;switch(e){case r.plot.SeriesPlotStyle.HISTOGRAM:return"bar";default:return this.getPlotlyChartType(e,t)}}getAxisPropertyName(e){var{dh:t}=this;switch(e){case t.plot.AxisType.X:return"x";case t.plot.AxisType.Y:return"y";default:return null}}getAxisSide(e){var{dh:t}=this;switch(e){case t.plot.AxisPosition.BOTTOM:return"bottom";case t.plot.AxisPosition.TOP:return"top";case t.plot.AxisPosition.LEFT:return"left";case t.plot.AxisPosition.RIGHT:return"right";default:return}}updateFigureAxes(e,t,r){for(var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=e,s=g.getAllAxes(t),l=0;l<t.charts.length;l+=1){var u=t.charts[l],c=r==null?void 0:r(u),d=this.getChartBounds(t,u,n,a);this.updateLayoutAxes(o,u.axes,s,n,a,d,c)}this.removeStaleAxes(o,s)}getChartBounds(e,t,r,n){var a,{dh:o}=this,{cols:s,rows:l}=e,{column:u,colspan:c,row:d,rowspan:f}=t,m=u+c,p=d+f,y=1/s,E=1/l,S=g.AXIS_SIZE_PX/r,A=g.AXIS_SIZE_PX/n,T={bottom:(l-p)*E+(p<l?A/2:0),top:(l-d)*E-(d>0?A/2:0),left:u*y+(u>0?S/2:0),right:m*y-(m<s?S/2:0)},N=g.groupArray(t.axes,"position"),D=(a=N.get(o.plot.AxisPosition.RIGHT))!==null&&a!==void 0?a:[];return D.length>0&&(r>0?T.right-=(T.right-T.left)*Math.max(0,Math.min(g.LEGEND_WIDTH_PX/r,g.MAX_LEGEND_SIZE)):T.right-=(T.right-T.left)*g.DEFAULT_AXIS_SIZE),T}getPlotlyDateFormat(e,t,r){var{dh:n}=this,a=r==null?void 0:r.replace("%","%%").replace(/S{9}/g,"%9f").replace(/S{8}/g,"%8f").replace(/S{7}/g,"%7f").replace(/S{6}/g,"%6f").replace(/S{5}/g,"%5f").replace(/S{4}/g,"%4f").replace(/S{3}/g,"%3f").replace(/S{2}/g,"%2f").replace(/S{1}/g,"%1f").replace(/y{4}/g,"%Y").replace(/y{2}/g,"%y").replace(/M{4}/g,"%B").replace(/M{3}/g,"%b").replace(/M{2}/g,"%m").replace(/M{1}/g,"%-m").replace(/E{4,}/g,"%A").replace(/E{1,}/g,"%a").replace(/d{2}/g,"%d").replace(/([^%]|^)d{1}/g,"$1%-d").replace(/H{2}/g,"%H").replace(/h{2}/g,"%I").replace(/h{1}/g,"%-I").replace(/m{2}/g,"%M").replace(/s{2}/g,"%S").replace("'T'","T").replace(" z",""),o,s=e==null?void 0:e.getColumnTypeFormatter(t);return s!=null&&we(s)&&s.dhTimeZone!=null&&s.showTimeZone&&(o=n.i18n.DateTimeFormat.format(" z",new Date,s.dhTimeZone)),{tickformat:a,ticksuffix:o,automargin:!0}}getPlotlyAxisFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,{dh:r}=this,{axis:n,columnType:a}=e,{formatPattern:o}=n,s=null;return h.isDateType(a)?(s=this.getPlotlyDateFormat(t,a,o),s=g.addTickSpacing(s,n,!0)):h.isNumberType(a)&&(s=g.getPlotlyNumberFormat(t,a,o),s=g.addTickSpacing(s,n,!1)),n.formatType===r.plot.AxisFormatType.CATEGORY&&(s?s.type="category":s={type:"category",tickformat:void 0,ticksuffix:void 0}),s}updateLayoutAxes(e,t,r){for(var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{left:0,top:0,right:1,bottom:1},s=arguments.length>6?arguments[6]:void 0,{dh:l}=this,u=n>0?Math.max(g.MIN_AXIS_SIZE,Math.min(g.AXIS_SIZE_PX/a,g.MAX_AXIS_SIZE)):g.DEFAULT_AXIS_SIZE,c=a>0?Math.max(g.MIN_AXIS_SIZE,Math.min(g.AXIS_SIZE_PX/n,g.MAX_AXIS_SIZE)):g.DEFAULT_AXIS_SIZE,d=e,f=g.groupArray(t,"position"),m=g.groupArray(t,"type"),p=[...m.keys()],y=g.groupArray(r,"type"),E=0;E<p.length;E+=1){var S=p[E],A=this.getAxisPropertyName(S);if(A!=null){var T=m.get(S),N=y.get(S),D=S===l.plot.AxisType.Y,C=D?a:n;ee(T),ee(N);for(var P=0;P<T.length;P+=1){var w=T[P],O=N.indexOf(w),L=g.getAxisLayoutProperty(A,O);d[L]==null&&(d[L]={});var H=d[L];if(H!=null){this.updateLayoutAxis(H,w,P,f,u,c,o);var{range:B,autorange:Y}=H;if(s!=null&&B!==void 0&&(Y===void 0||Y===!1)){var Q=s(w),[G,J]=Q(B);te.debug("Setting downsample range",C,G,J),w.range(C,G,J)}else w.range(C)}}}}}removeStaleAxes(e,t){for(var r=e,n=g.groupArray(t,"type"),a=[...n.keys()],o=0;o<a.length;o+=1){var s=a[o],l=n.get(s);ee(l);var u=l.length,c=this.getAxisPropertyName(s);if(c!=null)for(var d=g.getAxisLayoutProperty(c,u);r[d]!=null;)delete r[d],u+=1,d=g.getAxisLayoutProperty(c,u)}}updateLayoutAxis(e,t,r,n,a,o,s){var l,{dh:u}=this,c=t.type===u.plot.AxisType.Y,d=c?o:a,f=e,m=(l=t.label)!==null&&l!==void 0?l:"";if(f.title!==void 0&&typeof f.title!="string"?f.title.text=m:f.title={text:m},t.log&&(f.type="log"),f.side=this.getAxisSide(t.position),r>0){var p,y;f.overlaying=(p=this.getAxisPropertyName(t.type))!==null&&p!==void 0?p:void 0;var E=(y=n.get(t.position))!==null&&y!==void 0?y:[],S=E.indexOf(t);S>0&&(f.anchor="free",t.position===u.plot.AxisPosition.RIGHT?f.position=s.right+(S-E.length+1)*d:t.position===u.plot.AxisPosition.TOP?f.position=s.top+(S-E.length+1)*d:t.position===u.plot.AxisPosition.BOTTOM?f.position=s.bottom+(E.length-S+1)*d:t.position===u.plot.AxisPosition.LEFT&&(f.position=s.left+(E.length-S+1)*d))}else if(t.type===u.plot.AxisType.X){var A=n.get(u.plot.AxisPosition.LEFT)||[],T=n.get(u.plot.AxisPosition.RIGHT)||[],N=Math.max(s.left,s.left+(A.length-1)*o),D=Math.min(s.right-(T.length-1)*o,s.right);f.domain=[N,D]}else if(t.type===u.plot.AxisType.Y){var C=n.get(u.plot.AxisPosition.BOTTOM)||[],P=n.get(u.plot.AxisPosition.TOP)||[],w=Math.max(s.bottom,s.bottom+(C.length-1)*a),O=Math.min(s.top-(P.length-1)*a,s.top);f.domain=[w,O]}}createBoundsFromDays(e){var t=e.map(o=>this.daysOfWeek.indexOf(o)),r=this.daysOfWeek.filter(o=>!e.includes(o)).map(o=>this.daysOfWeek.indexOf(o)),n=new Set;r.forEach(o=>{for(var s=o+1;s<o+this.daysOfWeek.length;s+=1){var l=s%this.daysOfWeek.length;if(t.includes(l)){n.add(l);break}}});var a=[];return n.forEach(o=>{for(var s=o-1;s>o-this.daysOfWeek.length;s-=1){var l=s<0?s+this.daysOfWeek.length:s;if(t.includes(l)){var u=(l+1)%7;a.push([u,o]);break}}}),a}createRangeBreakValuesFromHolidays(e,t,r){var n=[],a=[];return e.forEach(o=>{o.businessPeriods.length>0?a.push(...this.createPartialHoliday(o,t,r)):n.push(this.createFullHoliday(o,t,r))}),[{values:n},...a]}createFullHoliday(e,t,r){return this.adjustDateForTimeZone("".concat(e.date.toString()," 00:00:00.000000"),t,r)}createPartialHoliday(e,t,r){var n=e.date.toString(),a=["00:00"];e.businessPeriods.forEach(f=>{a.push(f.open),a.push(f.close)}),a.push("24:00");for(var o=[],s=0;s<a.length;s+=2){var l=a[s],u=a[s+1];if(l!==u){var c=[this.adjustDateForTimeZone("".concat(n," ").concat(l,":00.000000"),t,r)],d=Rt*(g.periodToDecimal(u)-g.periodToDecimal(l));o.push({values:c,dvalue:d})}}return o}adjustDateForTimeZone(e,t,r){return r&&r.standardOffset!==t.standardOffset?this.unwrapValue(this.wrapValue(e,Fe,t),r):e}makeFigureSettings(e,t){var{dh:r}=this,{series:n,xAxis:a,type:o}=e,s=g.titleFromSettings(e),l={formatType:"".concat(r.plot.AxisFormatType.NUMBER),type:"".concat(r.plot.AxisType.X),position:"".concat(r.plot.AxisPosition.BOTTOM)},u={formatType:"".concat(r.plot.AxisFormatType.NUMBER),type:"".concat(r.plot.AxisType.Y),position:"".concat(r.plot.AxisPosition.LEFT)};return{charts:[{chartType:"".concat(r.plot.ChartType.XY),axes:[l,u],series:(n??[]).map(c=>({plotStyle:"".concat(o),name:c,dataSources:[{type:"".concat(r.plot.SourceType.X),columnName:a??"",axis:l,table:t},{type:"".concat(r.plot.SourceType.Y),columnName:c,axis:u,table:t}]}))}],title:s}}unwrapValue(e,t){var{dh:r}=this;if(e!=null){if(Vt(e))return r.i18n.DateTimeFormat.format(g.DATE_FORMAT,e,t);if(Wt(e))return e.asNumber()}return e}wrapValue(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,{dh:n}=this;if(h.isDateType(t)&&typeof e=="string"){var a=e,o=g.DATE_FORMAT.substr(0,e.length),s=n.i18n.DateTimeFormat.parse(o,a);if(!r)return s;var l="".concat(o," Z"),u=n.i18n.DateTimeFormat.format("Z",s,r),c=n.i18n.DateTimeFormat.parse(l,"".concat(a," ").concat(u)),d=n.i18n.DateTimeFormat.format("Z",c,r);return n.i18n.DateTimeFormat.parse(l,"".concat(a," ").concat(d))}return e}makeLayoutAxis(e,t){var{dh:r}=this,n={automargin:!0,gridcolor:t.gridcolor,linecolor:t.linecolor,rangeslider:{visible:!1},showline:!0,ticks:"outside",ticklen:5,tickcolor:t.paper_bgcolor,tickfont:{color:t.zerolinecolor},title:{font:{color:t.title_color}},legend:{font:{color:t.legend_color}}};return e===r.plot.AxisType.X?Object.assign(n,{showgrid:!0}):e===r.plot.AxisType.Y&&Object.assign(n,{zerolinecolor:t.zerolinecolor,zerolinewidth:2}),n}makeDefaultTemplate(e){var{error_band_line_color:t,ohlc_increasing:r,ohlc_decreasing:n,title_color:a}=e;return{data:{bar:[{marker:{line:{color:"transparent"}}}],scatter:[{error_x:{color:t},error_y:{color:t}}],ohlc:[{increasing:{line:{color:r}},decreasing:{line:{color:n}}}],pie:[{outsidetextfont:{color:a}}],treemap:[{outsidetextfont:{color:a}}]},layout:this.makeDefaultLayout(e)}}makeDefaultLayout(e){var{dh:t}=this,{paper_bgcolor:r,plot_bgcolor:n,title_color:a,coastline_color:o,land_color:s,ocean_color:l,lake_color:u,river_color:c}=e,d={paper_bgcolor:r,plot_bgcolor:n,autosize:!0,colorway:g.normalizeColorway(e==null?void 0:e.colorway),font:{family:"'Fira Sans', sans-serif",color:a},title:{font:{color:a},xanchor:"center",xref:"paper",yanchor:"top",pad:le({},g.DEFAULT_TITLE_PADDING),y:1},legend:{font:{color:a}},margin:le({},g.DEFAULT_MARGIN),xaxis:this.makeLayoutAxis(t.plot.AxisType.X,e),yaxis:this.makeLayoutAxis(t.plot.AxisType.Y,e),polar:{angularaxis:this.makeLayoutAxis(t.plot.AxisType.SHAPE,e),radialaxis:this.makeLayoutAxis(t.plot.AxisType.SHAPE,e),bgcolor:e.plot_bgcolor},scene:{xaxis:this.makeLayoutAxis(t.plot.AxisType.X,e),yaxis:this.makeLayoutAxis(t.plot.AxisType.Y,e),zaxis:this.makeLayoutAxis(null,e)},geo:{showcoastlines:!0,showframe:!1,showland:!0,showocean:!0,showlakes:!0,showrivers:!0,bgcolor:r,coastlinecolor:o,landcolor:s,oceancolor:l,lakecolor:u,rivercolor:c}};return d.datarevision=0,d}hydrateSettings(e){var{dh:t}=this;return le(le({},e),{},{type:e.type!=null?t.plot.SeriesPlotStyle[e.type]:void 0})}}k(g,"DEFAULT_AXIS_SIZE",.15);k(g,"MIN_AXIS_SIZE",.025);k(g,"MAX_AXIS_SIZE",.2);k(g,"AXIS_SIZE_PX",75);k(g,"LEGEND_WIDTH_PX",50);k(g,"MAX_LEGEND_SIZE",.25);k(g,"ORIENTATION",Object.freeze({HORIZONTAL:"h",VERTICAL:"v"}));k(g,"DATE_FORMAT","yyyy-MM-dd HH:mm:ss.SSSSSS");k(g,"DEFAULT_MARGIN",Object.freeze({l:60,r:50,t:30,b:60,pad:0}));k(g,"DEFAULT_TITLE_PADDING",Object.freeze({t:8}));k(g,"SUBTITLE_LINE_HEIGHT",25);k(g,"DEFAULT_MARKER_SIZE",6);k(g,"MODE_MARKERS","markers");k(g,"MODE_LINES","lines");const W=g;function V(i,e,t){return e=_t(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function _t(i){var e=qt(i,"string");return typeof e=="symbol"?e:String(e)}function qt(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class I{constructor(e){V(this,"dh",void 0),V(this,"listeners",void 0),V(this,"formatter",void 0),V(this,"rect",void 0),V(this,"isDownsamplingDisabled",void 0),V(this,"title",void 0),this.dh=e,this.listeners=[],this.isDownsamplingDisabled=!1}getData(){return[]}getDefaultTitle(){return""}getLayout(){return{}}getFilterColumnMap(){return new Map}isFilterRequired(){return!1}setFilter(e){}close(){}setFormatter(e){this.formatter=e}setDownsamplingDisabled(e){this.isDownsamplingDisabled=e}setDimensions(e){this.rect=e}setTitle(e){this.title=e}subscribe(e){this.listeners.push(e)}unsubscribe(e){this.listeners=this.listeners.filter(t=>t!==e)}fireEvent(e){for(var t=0;t<this.listeners.length;t+=1)this.listeners[t](e)}fireUpdate(e){this.fireEvent(new CustomEvent(I.EVENT_UPDATED,{detail:e}))}fireDisconnect(){this.fireEvent(new CustomEvent(I.EVENT_DISCONNECT))}fireReconnect(){this.fireEvent(new CustomEvent(I.EVENT_RECONNECT))}fireDownsampleStart(e){this.fireEvent(new CustomEvent(I.EVENT_DOWNSAMPLESTARTED,{detail:e}))}fireDownsampleFinish(e){this.fireEvent(new CustomEvent(I.EVENT_DOWNSAMPLEFINISHED,{detail:e}))}fireDownsampleFail(e){this.fireEvent(new CustomEvent(I.EVENT_DOWNSAMPLEFAILED,{detail:e}))}fireDownsampleNeeded(e){this.fireEvent(new CustomEvent(I.EVENT_DOWNSAMPLENEEDED,{detail:e}))}fireLoadFinished(){this.fireEvent(new CustomEvent(I.EVENT_LOADFINISHED))}fireError(e){this.fireEvent(new CustomEvent(I.EVENT_ERROR,{detail:e}))}}V(I,"EVENT_UPDATED","ChartModel.EVENT_UPDATED");V(I,"EVENT_DISCONNECT","ChartModel.EVENT_DISCONNECT");V(I,"EVENT_RECONNECT","ChartModel.EVENT_RECONNECT");V(I,"EVENT_DOWNSAMPLESTARTED","ChartModel.EVENT_DOWNSAMPLESTARTED");V(I,"EVENT_DOWNSAMPLEFINISHED","ChartModel.EVENT_DOWNSAMPLEFINISHED");V(I,"EVENT_DOWNSAMPLEFAILED","ChartModel.EVENT_DOWNSAMPLEFAILED");V(I,"EVENT_DOWNSAMPLENEEDED","ChartModel.EVENT_DOWNSAMPLENEEDED");V(I,"EVENT_LOADFINISHED","ChartModel.EVENT_LOADFINISHED");V(I,"EVENT_ERROR","ChartModel.EVENT_ERROR");const Kt=I;function Oe(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),t.push.apply(t,r)}return t}function Ie(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Oe(Object(t),!0).forEach(function(r){F(i,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Oe(Object(t)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))})}return i}function F(i,e,t){return e=Gt(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Gt(i){var e=$t(i,"string");return typeof e=="symbol"?e:String(e)}function $t(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var R=ie.module("FigureChartModel");class ue extends Kt{constructor(e,t){var r,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};super(e),r=this,F(this,"chartUtils",void 0),F(this,"dh",void 0),F(this,"figure",void 0),F(this,"settings",void 0),F(this,"data",void 0),F(this,"layout",void 0),F(this,"seriesDataMap",void 0),F(this,"pendingSeries",void 0),F(this,"oneClicks",void 0),F(this,"filterColumnMap",void 0),F(this,"lastFilter",void 0),F(this,"isConnected",void 0),F(this,"seriesToProcess",void 0),F(this,"addPendingSeries",_e(()=>{for(var a=W.getAxisTypeMap(this.figure),{pendingSeries:o}=this,s=function(){var c,d=o[l],f=r.figure.charts.find(m=>m.series.includes(d));r.addSeries(d,a,(c=f==null?void 0:f.showLegend)!==null&&c!==void 0?c:null),d.subscribe()},l=0;l<o.length;l+=1)s();this.pendingSeries=[]},ue.ADD_SERIES_DEBOUNCE)),F(this,"getTimeZone",U((a,o)=>{if(o!=null){var s=o.getColumnTypeFormatter(a);if(s!=null)return s.dhTimeZone}})),F(this,"getValueTranslator",U((a,o)=>{var s=this.getTimeZone(a,o);return l=>this.chartUtils.unwrapValue(l,s)})),F(this,"getValueParser",U((a,o)=>{var s=this.getTimeZone(a,o);return l=>this.chartUtils.wrapValue(l,a,s)})),F(this,"getRangeParser",U((a,o)=>s=>{var[l,u]=s,c=this.getValueParser(a,o);return l=c(l),u=c(u),[l,u]})),F(this,"getAxisRangeParser",U((a,o)=>s=>{var l=W.getSourceForAxis(a,s);return l!=null?this.getRangeParser(l.columnType,o):u=>u})),this.handleFigureUpdated=this.handleFigureUpdated.bind(this),this.handleFigureDisconnected=this.handleFigureDisconnected.bind(this),this.handleFigureReconnected=this.handleFigureReconnected.bind(this),this.handleFigureSeriesAdded=this.handleFigureSeriesAdded.bind(this),this.handleDownsampleStart=this.handleDownsampleStart.bind(this),this.handleDownsampleFinish=this.handleDownsampleFinish.bind(this),this.handleDownsampleFail=this.handleDownsampleFail.bind(this),this.handleDownsampleNeeded=this.handleDownsampleNeeded.bind(this),this.handleRequestFailed=this.handleRequestFailed.bind(this),this.dh=e,this.chartUtils=new W(e),this.figure=t,this.settings=n,this.data=[],this.layout={grid:{rows:t.rows,columns:t.cols,pattern:"independent"}},this.seriesDataMap=new Map,this.pendingSeries=[],this.oneClicks=[],this.filterColumnMap=new Map,this.lastFilter=new Map,this.isConnected=!0,this.seriesToProcess=new Set,this.setTitle(this.getDefaultTitle()),this.initAllSeries(),this.updateAxisPositions(),this.startListeningFigure()}close(){this.figure.close(),this.addPendingSeries.cancel(),this.stopListeningFigure()}getDefaultTitle(){if(this.figure.title!=null&&this.figure.title.length>0)return this.figure.title;if(this.figure.charts.length===1){var e;return(e=this.figure.charts[0].title)!==null&&e!==void 0?e:""}return""}initAllSeries(){var e=this;this.oneClicks=[],this.filterColumnMap.clear();var{charts:t}=this.figure,r=W.getAxisTypeMap(this.figure),n=[];this.seriesToProcess=new Set;for(var a=function(){for(var f=t[o],m=0;m<f.series.length;m+=1){var p=f.series[m];n.push(p.name),e.addSeries(p,r,f.showLegend)}var{axes:y,title:E}=f;if(E!=null&&E.length>0&&(t.length>1||e.figure.title!=null)){var S=y.find(L=>L.type===e.dh.plot.AxisType.X),A=y.find(L=>L.type===e.dh.plot.AxisType.Y);if(S==null||A==null)R.warn("Chart title provided, but unknown how to map to the correct axes for this chart type",f);else{var T,N,D,C,P=((T=(N=r.get(S.type))===null||N===void 0?void 0:N.findIndex(L=>L===S))!==null&&T!==void 0?T:0)+1,w=((D=(C=r.get(A.type))===null||C===void 0?void 0:C.findIndex(L=>L===A))!==null&&D!==void 0?D:0)+1,O={align:"center",x:.5,y:1,yshift:17,text:E,showarrow:!1,xref:"x".concat(P," domain"),yref:"y".concat(w," domain")};e.layout.annotations==null?e.layout.annotations=[O]:e.layout.annotations.push(O)}}},o=0;o<t.length;o+=1)a();for(var s=[...this.seriesDataMap.keys()],l=s.filter(d=>n.indexOf(d)<0),u=0;u<l.length;u+=1){var c=l[u];this.seriesDataMap.delete(c)}}addSeries(e,t,r){var{dh:n}=this,a=this.chartUtils.makeSeriesDataFromSeries(e,t,W.getSeriesVisibility(e.name,this.settings),r);if(this.seriesDataMap.set(e.name,a),this.seriesToProcess.add(e.name),this.data=[...this.seriesDataMap.values()],e.plotStyle===n.plot.SeriesPlotStyle.STACKED_BAR?this.layout.barmode="stack":e.plotStyle===n.plot.SeriesPlotStyle.PIE&&(this.layout.hiddenlabels=W.getHiddenLabels(this.settings)),this.layout.showlegend=this.data.length>1||e.plotStyle===n.plot.SeriesPlotStyle.PIE?r??void 0:!1,e.oneClick!=null){for(var{oneClick:o}=e,{columns:s}=o,l=0;l<s.length;l+=1)this.filterColumnMap.set(s[l].name,s[l]);this.oneClicks.push(o)}this.updateLayoutFormats()}subscribe(e){super.subscribe(e),this.listeners.length===1&&(this.initAllSeries(),this.subscribeFigure())}unsubscribe(e){super.unsubscribe(e),this.listeners.length===0&&this.unsubscribeFigure()}subscribeFigure(){if(!this.isConnected){R.debug("Ignoring subscribe when figure in disconnected state");return}this.figure.subscribe(this.isDownsamplingDisabled?this.dh.plot.DownsampleOptions.DISABLE:this.dh.plot.DownsampleOptions.DEFAULT),this.figure.errors.length>0&&(R.error("Errors in figure",this.figure.errors),this.fireError(this.figure.errors))}unsubscribeFigure(){this.figure.unsubscribe()}startListeningFigure(){var{dh:e}=this;this.figure.addEventListener(e.plot.Figure.EVENT_UPDATED,this.handleFigureUpdated),this.figure.addEventListener(e.plot.Figure.EVENT_SERIES_ADDED,this.handleFigureSeriesAdded),this.figure.addEventListener(e.plot.Figure.EVENT_DISCONNECT,this.handleFigureDisconnected),this.figure.addEventListener(e.plot.Figure.EVENT_RECONNECT,this.handleFigureReconnected),this.figure.addEventListener(e.plot.Figure.EVENT_DOWNSAMPLESTARTED,this.handleDownsampleStart),this.figure.addEventListener(e.plot.Figure.EVENT_DOWNSAMPLEFINISHED,this.handleDownsampleFinish),this.figure.addEventListener(e.plot.Figure.EVENT_DOWNSAMPLEFAILED,this.handleDownsampleFail),this.figure.addEventListener(e.plot.Figure.EVENT_DOWNSAMPLENEEDED,this.handleDownsampleNeeded),this.figure.addEventListener(e.Client.EVENT_REQUEST_FAILED,this.handleRequestFailed)}stopListeningFigure(){var{dh:e}=this;this.figure.removeEventListener(e.plot.Figure.EVENT_UPDATED,this.handleFigureUpdated),this.figure.removeEventListener(e.plot.Figure.EVENT_SERIES_ADDED,this.handleFigureSeriesAdded),this.figure.removeEventListener(e.plot.Figure.EVENT_DISCONNECT,this.handleFigureDisconnected),this.figure.removeEventListener(e.plot.Figure.EVENT_RECONNECT,this.handleFigureReconnected),this.figure.removeEventListener(e.plot.Figure.EVENT_DOWNSAMPLESTARTED,this.handleDownsampleStart),this.figure.removeEventListener(e.plot.Figure.EVENT_DOWNSAMPLEFINISHED,this.handleDownsampleFinish),this.figure.removeEventListener(e.plot.Figure.EVENT_DOWNSAMPLEFAILED,this.handleDownsampleFail),this.figure.removeEventListener(e.plot.Figure.EVENT_DOWNSAMPLENEEDED,this.handleDownsampleNeeded),this.figure.removeEventListener(e.Client.EVENT_REQUEST_FAILED,this.handleRequestFailed)}handleDownsampleStart(e){R.debug("Downsample started",e),this.fireDownsampleStart(e.detail)}handleDownsampleFinish(e){R.debug("Downsample finished",e),this.fireDownsampleFinish(e.detail)}handleDownsampleFail(e){R.error("Downsample failed",e),this.fireDownsampleFail(e.detail)}handleDownsampleNeeded(e){R.info("Downsample needed",e),this.fireDownsampleNeeded(e.detail)}handleFigureUpdated(e){var{detail:t}=e,{series:r}=t;R.debug2("handleFigureUpdated",r);for(var n=0;n<r.length;n+=1){var a=r[n];R.debug2("handleFigureUpdated updating series",a.name);for(var{sources:o}=a,s=0;s<o.length;s+=1){var l=o[s],{columnType:u,type:c}=l,d=this.getValueTranslator(u,this.formatter),f=t.getArray(a,c,d);this.setDataArrayForSeries(a,c,f)}this.seriesToProcess.delete(a.name),this.cleanSeries(a)}this.seriesToProcess.size===0&&this.fireLoadFinished();var{data:m}=this;this.fireUpdate(m)}handleRequestFailed(e){R.error("Request failed",e),this.fireError(["".concat(e.detail)])}resubscribe(){this.listeners.length>0&&(this.unsubscribeFigure(),this.subscribeFigure())}setFormatter(e){super.setFormatter(e),this.updateLayoutFormats(),this.resubscribe()}setDownsamplingDisabled(e){super.setDownsamplingDisabled(e),this.resubscribe()}handleFigureDisconnected(e){R.debug("Figure disconnected",e),this.isConnected=!1,this.listeners.length>0&&this.unsubscribeFigure(),this.fireDisconnect()}handleFigureReconnected(e){R.debug("Figure reconnected",e),this.isConnected=!0,this.initAllSeries(),this.fireReconnect(),this.listeners.length>0&&this.subscribeFigure()}handleFigureSeriesAdded(e){var{detail:t}=e;R.debug("handleFigureSeriesAdded",t),this.pendingSeries.push(t),this.addPendingSeries()}setDimensions(e){super.setDimensions(e),this.updateAxisPositions()}setTitle(e){var t,r;super.setTitle(e);var n=(t=(r=(e??"").match(/<br>/g))===null||r===void 0?void 0:r.length)!==null&&t!==void 0?t:0,a=W.DEFAULT_MARGIN.t+n*W.SUBTITLE_LINE_HEIGHT;this.layout.margin?this.layout.margin.t=a:this.layout.margin={t:a},typeof this.layout.title=="string"?this.layout.title=e:(this.layout.title=Ie({},this.layout.title),this.layout.title.text=e,this.layout.title.pad=Ie({},this.layout.title.pad),this.layout.title.pad.t=W.DEFAULT_TITLE_PADDING.t+n*W.SUBTITLE_LINE_HEIGHT*.5)}getPlotWidth(){var e,t,r,n;return!this.rect||!this.rect.width?0:Math.max(this.rect.width-((e=(t=this.layout.margin)===null||t===void 0?void 0:t.l)!==null&&e!==void 0?e:0)-((r=(n=this.layout.margin)===null||n===void 0?void 0:n.r)!==null&&r!==void 0?r:0),0)}getPlotHeight(){var e,t,r,n;return!this.rect||!this.rect.height?0:Math.max(this.rect.height-((e=(t=this.layout.margin)===null||t===void 0?void 0:t.t)!==null&&e!==void 0?e:0)-((r=(n=this.layout.margin)===null||n===void 0?void 0:n.b)!==null&&r!==void 0?r:0),0)}updateAxisPositions(){var e=this.getPlotWidth(),t=this.getPlotHeight();this.chartUtils.updateFigureAxes(this.layout,this.figure,r=>this.getAxisRangeParser(r,this.formatter),e,t)}updateLayoutFormats(){if(this.formatter){var e=this.chartUtils.getAxisFormats(this.figure,this.formatter);e.forEach((t,r)=>{R.debug("Assigning ".concat(r),this.layout[r],t);var n=this.layout[r];n!=null?Object.assign(n,t):R.debug("Ignoring null layout.".concat(r))})}}setDataArrayForSeries(e,t,r){var{name:n,plotStyle:a}=e,o=this.seriesDataMap.get(n),s=this.chartUtils.getPlotlyProperty(a,t);o&&Le(o,s,r)}cleanSeries(e){var{dh:t}=this,{name:r,plotStyle:n}=e,a=this.seriesDataMap.get(r);if(a!=null){if(n===t.plot.SeriesPlotStyle.HISTOGRAM){var{xLow:o,xHigh:s}=a;if(o&&s&&o.length===s.length){for(var l=[],u=0;u<o.length;u+=1)l.push(s[u]-o[u]);a.width=l}}else if(n===t.plot.SeriesPlotStyle.LINE||n===t.plot.SeriesPlotStyle.ERROR_BAR||n===t.plot.SeriesPlotStyle.BAR){var{x:c,xLow:d,xHigh:f,y:m,yLow:p,yHigh:y}=a;d&&f&&d!==c&&(a.error_x=W.getPlotlyErrorBars(c,d,f)),p&&y&&p!==m&&(a.error_y=W.getPlotlyErrorBars(m,p,y))}else if(n===t.plot.SeriesPlotStyle.TREEMAP){var{ids:E,labels:S}=a;E!==void 0&&S===void 0&&(a.labels=E)}}}getData(){return this.data}getLayout(){return this.layout}getFilterColumnMap(){return new Map(this.filterColumnMap)}isFilterRequired(){return this.oneClicks.find(e=>e.requireAllFiltersToDisplay)!=null}setFilter(e){var t=this;if(this.oneClicks.length===0){R.warn("Trying to set a filter, but no one click!");return}R.debug("setFilter",e);for(var r=function(){var o=t.oneClicks[n],{columns:s}=o,l=new Set([...e.keys(),...t.lastFilter.keys()]);l.forEach(u=>{var c=e.get(u);t.lastFilter.get(u)!==c&&s.find(d=>d.name===u)!=null&&o.setValueForColumn(u,c)})},n=0;n<this.oneClicks.length;n+=1)r();this.lastFilter=new Map(e)}setFigure(e){this.close(),this.figure=e,this.setTitle(this.getDefaultTitle()),this.initAllSeries(),this.updateAxisPositions(),this.startListeningFigure(),this.listeners.length>0&&this.subscribeFigure()}updateSettings(e){this.settings=e}}F(ue,"ADD_SERIES_DEBOUNCE",50);const Ce=ue;function xe(i,e,t,r,n,a,o){try{var s=i[a](o),l=s.value}catch(u){t(u);return}s.done?e(l):Promise.resolve(l).then(r,n)}function de(i){return function(){var e=this,t=arguments;return new Promise(function(r,n){var a=i.apply(e,t);function o(l){xe(a,r,n,o,s,"next",l)}function s(l){xe(a,r,n,o,s,"throw",l)}o(void 0)})}}class ge{static makeModelFromSettings(e,t,r){return de(function*(){var n=yield ge.makeFigureFromSettings(e,t,r);return new Ce(e,n,t)})()}static makeFigureFromSettings(e,t,r){return de(function*(){var n=yield r.copy();return n.applyCustomColumns(r.customColumns),n.applyFilter(r.filter),n.applySort(r.sort),e.plot.Figure.create(new W(e).makeFigureSettings(t,n))})()}static makeModel(e,t,r){return de(function*(){return new Ce(e,r,t)})()}}const Dr=ge;var Xt=Z.createContext(null);function br(){return Ve(Xt,"No IdeConnection available in useConnection. Was code wrapped in ConnectionContext.Provider?")}export{Ut as A,Tr as B,cr as C,x as D,Jt as E,ar as F,Qt as G,ce as H,ir as I,nr as J,or as K,Nr as L,er as M,Se as N,Kt as O,he as P,W as Q,Ce as R,lr as S,ke as T,Re as U,sr as V,Zt as W,nt as X,Xt as Y,ae as Z,mr as _,dr as a,Dr as b,Ve as c,$ as d,lt as e,tr as f,rr as g,v as h,ur as i,h as j,hr as k,Be as l,Nt as m,je as n,gr as o,yr as p,fr as q,vr as r,pr as s,yt as t,br as u,Er as v,Sr as w,Dt as x,bt as y,Ar as z};
2
- //# sourceMappingURL=useConnection-d1a53635.js.map
1
+ import{r as Z,H as X,D as b,F as re,G as ye,a4 as Ee,_ as He,bE as Le,L as _e,V as U}from"./vendor-7d0187fb.js";import{k as qe,L as ie,w as Ke,X as Ge,a as $e,n as ee}from"./index-9cceedf7.js";var Qt=Object.freeze([]),Zt=new Map,Jt=()=>{};function ce(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return e.filter(r=>r!=null)}function Xe(i,e,t){return e=ze(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function ze(i){var e=Ye(i,"string");return typeof e=="symbol"?e:String(e)}function Ye(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class Qe extends Error{constructor(){super(...arguments),Xe(this,"isCanceled",!0)}}const Se=Qe;function Re(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=Ze(i,e);t.forEach(r=>{i[r]=i[r].bind(i)})}function Ze(i,e){for(var t=new Set,r=i,n=0;r!=null&&r!==Object.prototype&&(n<=1||e);){for(var a of Object.getOwnPropertyNames(r))a!=="constructor"&&typeof r[a]=="function"&&t.add(a);r=Object.getPrototypeOf(r),n+=1}return[...t.keys()]}function Je(i,e,t){return e=Ue(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Ue(i){var e=et(i,"string");return typeof e=="symbol"?e:String(e)}function et(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class tt extends Error{constructor(){super(...arguments),Je(this,"isTimeout",!0)}}const ke=tt;class he{static makeCancelable(e,t){var r=!1,n,a,o=new Promise((s,l)=>{a=l,Promise.resolve(e).then(u=>{r?t&&t(u):(n=u,s(u))}).catch(u=>l(u))});return o.cancel=()=>{r=!0,a(new Se),n!=null&&t&&t(n)},o}static isCanceled(e){return e instanceof Se}static isTimedOut(e){return e instanceof ke}static withTimeout(e,t){return new Promise((r,n)=>{setTimeout(()=>{try{r(t())}catch(a){n(a)}},e)})}}class rt{static join(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"and";if(e==null||e.length===0)return"";if(e.length===1)return e[0];if(e.length===2)return"".concat(e[0]," ").concat(t," ").concat(e[1]);var r=e.slice(0,e.length-1).join(", "),n=e[e.length-1];return"".concat(r,", ").concat(t," ").concat(n)}static toLower(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==null){if(t)return"";throw new Error("Null string passed in to TextUtils.toLower")}return e.toLowerCase()}static sort(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e<t?r?-1:1:e>t?r?1:-1:0}}const nt=rt;var Ut=24,er=32,at="DH_ITEM_KEY",tr=32,rr=4,nr=33,ar=150,ir=200,sr=500,or=250,lr={spellCheck:!1};function Ve(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"No value available in context. Was code wrapped in a provider?",t=Z.useContext(i);if(t==null)throw new Error(e);return t}function it(i,e,t){return e=st(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function st(i){var e=ot(i,"string");return typeof e=="symbol"?e:String(e)}function ot(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function ur(i){return i.then!==void 0}class K{static disableAllActions(){K.actionsDisabled=!0}static enableAllActions(){K.actionsDisabled=!1}static isContextActionEvent(e){return Array.isArray(e.contextActions)}static compareActions(e,t){if(e.group!==t.group){var r,n;return((r=e.group)!==null&&r!==void 0?r:0)>((n=t.group)!==null&&n!==void 0?n:0)?1:-1}if(e.order!==t.order){var a,o;return((a=e.order)!==null&&a!==void 0?a:0)>((o=t.order)!==null&&o!==void 0?o:0)?1:-1}if(e.title!==t.title){var s,l;return((s=e.title)!==null&&s!==void 0?s:"")>((l=t.title)!==null&&l!==void 0?l:"")?1:-1}return e!==t?e>t?1:-1:0}static sortActions(e){if(e==null||!Array.isArray(e))return[];var t=e.slice();return t.sort(K.compareActions),t}static isMacPlatform(){var{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return K.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){var t=K.getModifierKey();return e[t]}static getMenuItems(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=[],n=e;Array.isArray(n)||(n=[n]);for(var a=0;a<n.length;a+=1){var o=n[a],s=void 0;typeof o=="function"?s=o():s=o,s!=null&&(s instanceof Promise?t&&r.push(s):Array.isArray(s)?r=r.concat(s):r.push(s))}return r=r.filter(l=>l.title!==void 0||l.then!=null||l.menuElement),r}static getNextMenuItem(e,t,r){var n=e;n<0&&t<0&&(n=r.length);for(var a=1;a<r.length+1;a+=1){var o=(n+t*a+r.length)%r.length,s=r[o];if(!(s instanceof Promise)&&s.disabled!==!0)return o}return e}}it(K,"actionsDisabled",!1);const $=K;var fe=X.forwardRef((i,e)=>{var t,r;function n(P){var{menuItem:w,onMenuItemClick:O}=i;O(w,P)}function a(P){var{menuItem:w,onMenuItemMouseMove:O}=i;O(w,P)}function o(P){var{menuItem:w,onMenuItemContextMenu:O}=i;O(w,P)}function s(P,w,O){if(typeof P.type=="string")return P;var{closeMenu:L,menuItem:H,isKeyboardSelected:B,isMouseSelected:Y,"data-testid":Q}=i,G={menuItem:H,closeMenu:L,isKeyboardSelected:B,isMouseSelected:Y,iconElement:w,displayShortcut:O,"data-testid":Q};return X.cloneElement(P,{forwardedProps:G})}var{children:l,menuItem:u,isKeyboardSelected:c=!1,isMouseSelected:d=!1,"data-testid":f}=i,m=(t=u.shortcutText)!==null&&t!==void 0?t:(r=u.shortcut)===null||r===void 0?void 0:r.getDisplayText(),p=null;if(u.icon){var y=u.icon;if(X.isValidElement(y))p=y;else{var E;u.iconColor!=null&&(u.disabled===void 0||!u.disabled)&&(E={color:u.iconColor}),p=b.jsx(ye,{icon:y,style:E})}}var S=null,A=!!l;u.actions&&(S=b.jsx(ye,{icon:qe}));var T=null;if(u.menuElement)T=b.jsx("div",{className:"custom-menu-item",onMouseMove:a,children:s(u.menuElement,p,m)});else{var N,D=u.disabled,C=u.iconOutline;T=b.jsx("button",{type:"button",className:re("btn-context-menu",{disabled:D},{active:(A||d)&&(D===void 0||!D)},{"keyboard-active":c&&(D===void 0||!D)}),onClick:n,onMouseMove:a,onContextMenu:o,title:(N=u.description)!==null&&N!==void 0?N:"",children:b.jsxs("div",{className:"btn-context-menu-wrapper",children:[b.jsx("span",{className:re("icon",{outline:C}),children:p}),b.jsx("span",{className:"title",children:u.title}),m!==void 0&&b.jsx("span",{className:"shortcut",children:m}),S&&b.jsx("span",{className:re("submenu-indicator",{disabled:D}),children:S})]})})}return b.jsxs("div",{className:"context-menu-item",ref:e,"data-testid":f,children:[l,T]})});fe.displayName="ContextMenuItem";fe.defaultProps={children:null,isKeyboardSelected:!1,isMouseSelected:!1,"data-testid":void 0};const lt=fe;function Te(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),t.push.apply(t,r)}return t}function ut(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Te(Object(t),!0).forEach(function(r){q(i,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Te(Object(t)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))})}return i}function q(i,e,t){return e=ct(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function ct(i){var e=dt(i,"string");return typeof e=="symbol"?e:String(e)}function dt(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var Ae=ie.module("ContextMenu");class ne extends Z.PureComponent{static handleContextMenu(e){e.metaKey||(e.stopPropagation(),e.preventDefault())}constructor(e){super(e),q(this,"container",void 0),q(this,"oldFocus",void 0),q(this,"activeSubMenuRef",void 0),q(this,"subMenuTimer",void 0),q(this,"rAF",void 0),q(this,"initialPosition",void 0),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=X.createRef(),this.oldFocus=document.activeElement,this.activeSubMenuRef=X.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}}componentDidMount(){this.initMenu(),this.verifyPosition(),window.addEventListener("resize",this.handleWindowResize),this.rAF=window.requestAnimationFrame(()=>{var e;(e=this.container.current)===null||e===void 0||e.focus();var{onMenuOpened:t}=this.props;t(this)})}componentDidUpdate(e,t){var{actions:r}=this.props,{activeSubMenu:n}=this.state;if(n!==t.activeSubMenu)if(n==null){var a;(a=this.container.current)===null||a===void 0||a.focus()}else this.setActiveSubMenuPosition();if(e.actions!==r&&(this.initMenu(),this.container.current==null||!this.container.current.contains(document.activeElement))){var o;(o=this.container.current)===null||o===void 0||o.focus()}this.verifyPosition()}componentWillUnmount(){this.cancelPromises(),window.removeEventListener("resize",this.handleWindowResize),cancelAnimationFrame(this.rAF)}getKeyboardIndex(){var{options:e}=this.props;if(e.separateKeyboardMouse!==void 0&&e.separateKeyboardMouse){var{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){var{options:t}=this.props;t.separateKeyboardMouse!==void 0&&t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){var{mouseIndex:e}=this.state;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){this.cancelPromises(),cancelAnimationFrame(this.rAF);var{options:e}=this.props,t=e.initialKeyboardIndex;t===void 0&&(t=-1);for(var{actions:r}=this.props,n=$.getMenuItems(r),a=[],o=n.length-1;o>=0;o-=1){var s=n[o];s instanceof Promise?this.initMenuPromise(s):a.push(s)}this.setState({mouseIndex:-1,keyboardIndex:t,activeSubMenu:null,menuItems:$.sortActions(a)})}initMenuPromise(e){var t=he.makeCancelable(e);this.setState(r=>({pendingItems:r.pendingItems.concat(t)})),t.then(r=>{this.setState(n=>{var a=n.pendingItems.indexOf(t);if(a>=0){var o=n.pendingItems.slice();return o.splice(a,1),{menuItems:$.sortActions(n.menuItems.concat(r)),pendingItems:o}}return null})},r=>{he.isCanceled(r)||(this.setState(n=>{var a=n.pendingItems.indexOf(t);if(a>=0){var o=n.pendingItems.slice();return o.splice(a,1),{pendingItems:o}}return null}),Ae.error(r))})}cancelPromises(){var{pendingItems:e}=this.state;e.map(t=>t.cancel())}setActiveSubMenuPosition(){if(this.activeSubMenuRef.current!==null){var e=this.activeSubMenuRef.current.getBoundingClientRect();this.setState({subMenuTop:e.top,subMenuLeft:e.right,subMenuParentHeight:e.height,subMenuParentWidth:e.width})}}verifyPosition(){var e,t,r,n,{options:a,updatePosition:o,subMenuParentWidth:s,subMenuParentHeight:l,top:u,left:c}=this.props;if(!(!this.container.current||a.doNotVerifyPosition!=null&&a.doNotVerifyPosition)){var{top:d,left:f}=this.initialPosition,{width:m,height:p}=(e=(t=this.container.current)===null||t===void 0?void 0:t.getBoundingClientRect())!==null&&e!==void 0?e:{width:0,height:0},y=((r=(n=this.container.current)===null||n===void 0?void 0:n.scrollHeight)!==null&&r!==void 0?r:0)>window.innerHeight;p===0||m===0||(d+p>window.innerHeight&&(d-p-l>0?d-=p-l:d=window.innerHeight-p),f+m>window.innerWidth&&(f=f-m-s),(c!==f||u!==d)&&(this.setState({hasOverflow:y}),o(d,f)))}}handleWindowResize(){this.container.current&&this.closeMenu(!0)}handleBlur(e){if(!this.container.current){Ae.warn("Container is null!");return}if(!this.container.current.contains(e.relatedTarget)){for(var t=e.relatedTarget,r=!1;t&&!r;)r=t.hasAttribute("data-dh-context-menu"),t=t.parentElement;r||this.closeMenu(!0)}}isEscapeKey(e){var{left:t}=this.props;return e==="Escape"||t<0&&e==="ArrowRight"||e==="ArrowLeft"}handleKeyDown(e){var{menuItems:t}=this.state,r=this.getKeyboardIndex(),n=r,a=!1;if(e.key==="Enter"||e.key===" "){r>=0&&r<t.length&&this.handleMenuItemClick(t[r],e);return}if(e.key==="ArrowRight"?r>=0&&r<=t.length?a=!0:n=0:this.isEscapeKey(e.key)?n=null:e.key==="ArrowUp"||e.shiftKey&&e.key==="Tab"?n=$.getNextMenuItem(n,-1,t):(e.key==="ArrowDown"||e.key==="Tab")&&(n=$.getNextMenuItem(n,1,t)),a){this.openSubMenu(r),e.preventDefault(),e.stopPropagation();return}r!==n&&(n!==null?this.setKeyboardIndex(n):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}openSubMenu(e){var{menuItems:t,activeSubMenu:r}=this.state,n=t[e].actions?e:null;r!==n&&this.setState({activeSubMenu:n,subMenuTop:null,subMenuLeft:null})}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,{closeMenu:t,onMenuClosed:r}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),r(this)})}closeSubMenu(){this.setState({activeSubMenu:null})}handleCloseSubMenu(e){e?this.closeMenu(!0):this.closeSubMenu()}handleMenuItemClick(e,t){t.preventDefault(),t.stopPropagation();var{menuItems:r}=this.state;e!=null&&(e.disabled===void 0||!e.disabled)&&(e.actions!=null?this.openSubMenu(r.indexOf(e)):e.action!=null&&(e.action(t.nativeEvent),this.closeMenu(!0)))}handleMenuItemContextMenu(e,t){t.metaKey||this.handleMenuItemClick(e,t)}handleMenuItemMouseMove(e){var{menuItems:t}=this.state,r=t.indexOf(e);this.setMouseIndex(r),r>=0&&r<t.length&&(e.disabled===void 0||!e.disabled)&&this.openSubMenu(r)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{top:t,left:r}=this.props,{activeSubMenu:n,hasOverflow:a,keyboardIndex:o,menuItems:s,mouseIndex:l,pendingItems:u,subMenuTop:c,subMenuLeft:d,subMenuParentWidth:f,subMenuParentHeight:m}=this.state,p=0;p<s.length;p+=1){var y=s[p];p>0&&y.group!==s[p-1].group&&e.push(b.jsx("hr",{},"".concat(p,".separator")));var E=b.jsx(lt,{ref:n===p?this.activeSubMenuRef:null,isKeyboardSelected:o===p,isMouseSelected:l===p,menuItem:y,closeMenu:this.handleCloseSubMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:this.handleMenuItemContextMenu},p);e.push(E)}var S=null;u.length>0&&(S=b.jsx("div",{className:"loading",children:b.jsx(Ke,{className:"loading-spinner-vertical-align"})}));var{menuStyle:A,"data-testid":T}=this.props,N=n!==null&&c!==null&&d!==null;return b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:re({"has-overflow":a},"context-menu-container"),style:ut({top:t,left:r},A),ref:this.container,"data-dh-context-menu":!0,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,onContextMenu:ne.handleContextMenu,role:"menuitem",tabIndex:0,"data-testid":T,children:[e,S]}),N&&n!==null&&c!==null&&d!==null&&b.jsx(ne,{actions:s[n].actions||[],closeMenu:this.handleCloseSubMenu,top:c,left:d,updatePosition:(D,C)=>{this.setState({subMenuTop:D,subMenuLeft:C})},subMenuParentWidth:f,subMenuParentHeight:m},"sub-".concat(n))]})}}q(ne,"defaultProps",{subMenuParentWidth:0,subMenuParentHeight:0,closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});const ht=ne;function Ne(i,e,t){return e=ft(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function ft(i){var e=vt(i,"string");return typeof e=="symbol"?e:String(e)}function vt(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class gt extends Z.Component{constructor(e){super(e),Ne(this,"container",void 0),Ne(this,"openMenu",void 0),this.handleMenuClose=this.handleMenuClose.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.container=X.createRef(),this.openMenu=X.createRef(),this.state={actions:null,left:0,top:0}}componentDidMount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu)}componentWillUnmount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu)}handleContextMenu(e){if(this.container.current){var t=this.container.current.getBoundingClientRect(),r=e.clientY-t.top,n=e.clientX-t.left,{actions:a}=this.state;if(a!=null&&e.target===this.container.current){e.preventDefault(),this.setState({actions:null},()=>{var s=document.elementFromPoint(n,r),l=new MouseEvent("contextmenu",{clientX:e.clientX,clientY:e.clientY,bubbles:!0,cancelable:!0});s==null||s.dispatchEvent(l)});return}if($.isContextActionEvent(e)&&!(e.metaKey||e.ctrlKey)){var o=$.getMenuItems(e.contextActions);o.length!==0&&(e.preventDefault(),this.setState({actions:o,top:r,left:n}))}}}handleMenuClose(e){e===this.openMenu.current&&this.setState({actions:null})}render(){var e=null,{"data-testid":t}=this.props,{actions:r,top:n,left:a}=this.state;return r&&(e=b.jsx(ht,{ref:this.openMenu,actions:r,onMenuClosed:this.handleMenuClose,top:n,left:a,updatePosition:(o,s)=>{this.setState({top:o,left:s})},"data-testid":t})),b.jsx("div",{className:re("context-menu-root",{active:r}),ref:this.container,children:e})}}const cr=gt;function dr(){return Ve(Ge,"No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?")}function We(i,e,t){return e=pt(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function pt(i){var e=mt(i,"string");return typeof e=="symbol"?e:String(e)}function mt(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class x{static makeDateWrapper(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:1,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:0,l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:0,u=arguments.length>8&&arguments[8]!==void 0?arguments[8]:0;if(!t)throw new Error("No timezone provided");var c="".concat(r).padStart(4,"0"),d="".concat(n+1).padStart(2,"0"),f="".concat(a).padStart(2,"0"),m="".concat(o).padStart(2,"0"),p="".concat(s).padStart(2,"0"),y="".concat(l).padStart(2,"0"),E="".concat(u).padStart(9,"0"),S="".concat(c,"-").concat(d,"-").concat(f," ").concat(m,":").concat(p,":").concat(y,".").concat(E);return e.i18n.DateTimeFormat.parse(x.FULL_DATE_FORMAT,S,e.i18n.TimeZone.getTimeZone(t))}static getNextNanos(e){var t=parseInt(e,10),r="0".repeat(9-e.length),n="".concat(t+1).concat(r);return parseInt(n,10)}static getNextDate(e,t,r,n){var{year:a,month:o,date:s,hours:l,minutes:u,seconds:c,nanos:d}=r;if(t.nanos!=null){if(t.nanos.length===9)return null;d=x.getNextNanos(t.nanos),d>999999999&&(c+=1,d=0)}else t.seconds!=null?c+=1:t.minutes!=null?u+=1:t.hours!=null?l+=1:t.date!=null?s+=1:t.month!=null?o+=1:a+=1;var f=new Date(a,o,s,l,u,c);return x.makeDateWrapper(e,n,f.getFullYear(),f.getMonth(),f.getDate(),f.getHours(),f.getMinutes(),f.getSeconds(),d)}static parseMonth(e){var t=parseInt(e,10);if(!Number.isNaN(t))return t>=1&&t<=12?t-1:NaN;var r=e.trim().toLowerCase();if(r.length>=3){for(var n=0;n<x.months.length;n+=1)if(x.months[n].startsWith(r))return n}return NaN}static parseDateValues(e,t,r,n,a,o,s){var l=parseInt(e,10),u=t!=null?this.parseMonth(t):0,c=r!=null?parseInt(r,10):1,d=n!=null?parseInt(n,10):0,f=a!=null?parseInt(a,10):0,m=o!=null?parseInt(o,10):0,p=s!=null?parseInt(s.padEnd(9,"0"),10):0;return Number.isNaN(l)||Number.isNaN(u)||Number.isNaN(c)||Number.isNaN(d)||Number.isNaN(f)||Number.isNaN(m)||Number.isNaN(p)?null:{year:l,month:u,date:c,hours:d,minutes:f,seconds:m,nanos:p}}static parseDateTimeString(e){var t=/\s*(\d{4})([-./]([\da-z]+))?([-./](\d{1,2}))?([tT\s](\d{2})([:](\d{2}))?([:](\d{2}))?([.](\d{1,9}))?)?(.*)/,r=t.exec(e);if(r==null)throw new Error("Unexpected date string: ".concat(e));var[,n,,a,,o,,s,,l,,u,,c,d]=r;if(d!=null&&d.length>0)throw new Error("Unexpected characters after date string '".concat(e,"': ").concat(d));return{year:n,month:a,date:o,hours:s,minutes:l,seconds:u,nanos:c}}static parseDateRange(e,t,r){var n=t.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"){var a=new Date(Date.now()),o=x.makeDateWrapper(e,r,a.getFullYear(),a.getMonth(),a.getDate()),s=new Date(a.getFullYear(),a.getMonth(),a.getDate()+1),l=x.makeDateWrapper(e,r,s.getFullYear(),s.getMonth(),s.getDate());return[o,l]}if(n==="yesterday"){var u=new Date(Date.now()),c=new Date(u.getFullYear(),u.getMonth(),u.getDate()-1),d=x.makeDateWrapper(e,r,c.getFullYear(),c.getMonth(),c.getDate()),f=x.makeDateWrapper(e,r,u.getFullYear(),u.getMonth(),u.getDate());return[d,f]}if(n==="now"){var m=new Date(Date.now()),p=e.DateWrapper.ofJsDate(m);return[p,null]}var y=x.parseDateTimeString(n);if(y.year==null&&y.month==null&&y.date==null)throw new Error("Unable to extract year, month, or day ".concat(n));var E=x.parseDateValues(y.year,y.month,y.date,y.hours,y.minutes,y.seconds,y.nanos);if(E==null)throw new Error("Unable to extract date values from ".concat(y));var S=x.makeDateWrapper(e,r,E.year,E.month,E.date,E.hours,E.minutes,E.seconds,E.nanos),A=x.getNextDate(e,y,E,r);return[S,A]}static getJsDate(e){return typeof e=="number"?new Date(e):e.asDate()}}We(x,"FULL_DATE_FORMAT","yyyy-MM-dd HH:mm:ss.SSSSSSSSS");We(x,"months",["january","february","march","april","may","june","july","august","september","october","november","december"]);function hr(i,e){return i===e?{operator:"notEq",value:""}:{operator:"eq",value:i}}function fr(i,e,t){return function(n){var a=t.trim();if(a==="")return null;var o=Be(e,s=>s.filter().containsIgnoreCase(i.makeFilterValue(s.type,a)),"or");return o(n)}}function Be(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"or";return function(n){var a=n==null?void 0:n.findColumns(typeof i=="string"?[i]:i);if(a==null||a.length===0)return null;var o=a.map(e);return o.reduce((s,l)=>s[t](l))}}function yt(i,e,t,r){return Be(e,n=>n.filter()[r](i.makeFilterValue(n.type,t)),"or")}function vr(i,e,t,r,n){return function(o){var s=o==null?void 0:o.findColumn(e),l=t==="all"||r&&t.size===0;return s==null||l?null:i.makeSelectValueFilter(s,[...t.keys()],n)}}function gr(i){return function(t){return t.filter().isNull().not().and(t.filter().notEq(i.makeFilterValue(t.type,"")))}}function pr(i,e){return function(r){var n=r.filter(),a=i.makeFilterValue(r.type,""),o=n.eq(a);return e?n.isNull().or(o):o.or(n.notEq(a))}}function ve(i,e,t){return e=Et(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Et(i){var e=St(i,"string");return typeof e=="symbol"?e:String(e)}function St(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class ae{}ve(ae,"not","not");ve(ae,"and","and");ve(ae,"or","or");function mr(i){if(!(i==="not"||i==="and"||i==="or"))throw new Error("operator is not a valid FilterOperatorValue")}function M(i,e,t){return e=Tt(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Tt(i){var e=At(i,"string");return typeof e=="symbol"?e:String(e)}function At(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class v{}M(v,"eq","eq");M(v,"eqIgnoreCase","eqIgnoreCase");M(v,"notEq","notEq");M(v,"notEqIgnoreCase","notEqIgnoreCase");M(v,"greaterThan","greaterThan");M(v,"greaterThanOrEqualTo","greaterThanOrEqualTo");M(v,"lessThan","lessThan");M(v,"lessThanOrEqualTo","lessThanOrEqualTo");M(v,"in","in");M(v,"inIgnoreCase","inIgnoreCase");M(v,"notIn","notIn");M(v,"notInIgnoreCase","notInIgnoreCase");M(v,"isTrue","isTrue");M(v,"isFalse","isFalse");M(v,"isNull","isNull");M(v,"invoke","invoke");M(v,"contains","contains");M(v,"notContains","notContains");M(v,"containsIgnoreCase","containsIgnoreCase");M(v,"startsWith","startsWith");M(v,"endsWith","endsWith");M(v,"containsAny","containsAny");var De=ie.module("ViewportDataUtils");function je(i){return"".concat(at,"_").concat(i)}function Nt(i,e){return je(i.offsetInSnapshot+e)}function yr(i,e){var{bulkUpdate:t}=i;return function(n){var{columns:a,offset:o,rows:s}=n.detail;De.debug("table updated",n.detail);var l=new Map;s.forEach(u=>{var c=e(u,a),d=Nt(u,o);l.set(d,{key:d,item:c})}),De.debug("update keys",l),t(l)}}function Er(i,e){return e.reduce((t,r)=>(t[r.name]=i.get(r),t),{})}function*Sr(i,e){for(var t=i;t<=e;++t)yield{key:je(t)}}function Dt(i){return i==null||bt(i)?0:i.size}function bt(i){return"isClosed"in i?i.isClosed:!1}function Tr(i,e,t,r){var n=i+e-1,[a,o]=[0,r-1],s=Ee(i-t,a,o),l=Ee(n+t,a,o);return[s,l]}function be(i,e,t,r,n,a,o){try{var s=i[a](o),l=s.value}catch(u){t(u);return}s.done?e(l):Promise.resolve(l).then(r,n)}function _(i){return function(){var e=this,t=arguments;return new Promise(function(r,n){var a=i.apply(e,t);function o(l){be(a,r,n,o,s,"next",l)}function s(l){be(a,r,n,o,s,"throw",l)}o(void 0)})}}function z(i,e,t){return e=Pt(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Pt(i){var e=Mt(i,"string");return typeof e=="symbol"?e:String(e)}function Mt(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var j=ie.module("TableUtils");function Ar(i){return i===h.sortDirection.ascending||i===h.sortDirection.descending||i===h.sortDirection.reverse||i===h.sortDirection.none}class h{static copyTableAndApplyFilters(e){var t=arguments;return _(function*(){if(e==null)return null;for(var r=yield e.copy(),n=t.length,a=new Array(n>1?n-1:0),o=1;o<n;o++)a[o-1]=t[o];return r.applyFilter(ce(...a.map(s=>s(r)))),r})()}static getSortIndex(e,t){for(var r=0;r<e.length;r+=1){var n,a=e[r];if(((n=a.column)===null||n===void 0?void 0:n.name)===t)return r}return null}static getSortForColumn(e,t){var r=h.getSortIndex(e,t);return r!=null?e[r]:null}static getFilterText(e){return e?e.toString():null}static getFilterTypes(e){return h.isBooleanType(e)?[v.isTrue,v.isFalse,v.isNull]:h.isCharType(e)||h.isNumberType(e)||h.isDateType(e)?[v.eq,v.notEq,v.greaterThan,v.greaterThanOrEqualTo,v.lessThan,v.lessThanOrEqualTo]:h.isTextType(e)?[v.eq,v.eqIgnoreCase,v.notEq,v.notEqIgnoreCase,v.contains,v.notContains,v.startsWith,v.endsWith]:[]}static getNextSort(e,t,r){if(r<0||r>=e.length)return null;var n=h.getSortForColumn(t,e[r].name);return n===null?e[r].sort().asc():n.direction===h.sortDirection.ascending?n.desc():null}static makeColumnSort(e,t,r,n){if(t<0||t>=e.length||r===h.sortDirection.none)return null;var a=e[t].sort();switch(r){case h.sortDirection.ascending:a=a.asc();break;case h.sortDirection.descending:a=a.desc();break}return n&&(a=a.abs()),a}static toggleSortForColumn(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(r<0||r>=t.length)return[];var a=h.getNextSort(t,e,r);return h.setSortForColumn(e,t[r].name,a,n)}static sortColumn(e,t,r,n,a,o){if(r<0||r>=t.length)return[];var s=h.makeColumnSort(t,r,n,a);return h.setSortForColumn(e,t[r].name,s,o)}static setSortForColumn(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,a=h.getSortIndex(e,t),o=[];return n&&(o=o.concat(e.filter(s=>{var{direction:l}=s;return l!==h.sortDirection.reverse})),a!==null&&o.splice(a,1)),r!==null&&o.push(r),o}static getNormalizedType(e){switch(e){case"boolean":case"java.lang.Boolean":case h.dataType.BOOLEAN:return h.dataType.BOOLEAN;case"char":case"java.lang.Character":case h.dataType.CHAR:return h.dataType.CHAR;case"java.lang.String":case h.dataType.STRING:return h.dataType.STRING;case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":case"java.time.Instant":case"java.time.ZonedDateTime":case h.dataType.DATETIME:return h.dataType.DATETIME;case"double":case"java.lang.Double":case"float":case"java.lang.Float":case"java.math.BigDecimal":case h.dataType.DECIMAL:return h.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 h.dataType.INT:return h.dataType.INT;default:return h.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"java.time.Instant":case"java.time.ZonedDateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":return!0;default:return!1}}static isNumberType(e){return h.isIntegerType(e)||h.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 isBigDecimalType(e){switch(e){case"java.math.BigDecimal":return!0;default:return!1}}static isBigIntegerType(e){switch(e){case"java.math.BigInteger":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 h.getNormalizedType(e)===h.getNormalizedType(t)}static quoteValue(e){return e.length>=2&&(e.charAt(0)==='"'&&e.charAt(e.length-1)==='"'||e.charAt(0)==="'"&&e.charAt(e.length-1)==="'")?e:'"'.concat(e,'"')}static isRangeOperation(e){switch(e){case"<":case"<=":case"=<":case">":case">=":case"=>":return!0;default:return!1}}static makeRangeFilterWithOperation(e,t,r){switch(t){case"=":return e.eq(r);case"<":return e.lessThan(r);case"<=":case"=<":return e.lessThanOrEqualTo(r);case">":return e.greaterThan(r);case">=":case"=>":return e.greaterThanOrEqualTo(r);case"!=":case"!":return e.notEq(r);default:return null}}static makeCancelableTablePromise(e){return he.makeCancelable(e,t=>{t.close()})}static makeCancelableTableEventPromise(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,a,o,s=!0,l=new Promise((u,c)=>{o=setTimeout(()=>{a(),s=!1,c(new ke('Event "'.concat(t,'" timed out.')))},r),a=e.addEventListener(t,d=>{if(n!=null&&!n(d)){j.debug2("Event triggered, but matcher returned false.");return}j.debug2("Event triggered, resolving."),a(),clearTimeout(o),s=!1,u(d)})});return l.cancel=()=>{if(s){j.debug2("Pending promise cleanup."),a(),clearTimeout(o),s=!1;return}j.debug2("Ignoring non-pending promise cancel.")},l}static removeCommas(e){return e.replace(/[\s|,]/g,"")}static makeBooleanValue(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!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 '".concat(e,"'"))}}static makeNumberValue(e){if(e==="null"||e==="")return null;var t=e.toLowerCase().trim();if(t==="∞"||t==="infinity"||t==="inf")return Number.POSITIVE_INFINITY;if(t==="-∞"||t==="-infinity"||t==="-inf")return Number.NEGATIVE_INFINITY;var r=h.removeCommas(t);if(h.NUMBER_REGEX.test(r))return parseFloat(r);throw new Error("Invalid number '".concat(e,"'"))}static getFilterOperatorString(e){switch(e){case v.eq:return"=";case v.notEq:return"!=";case v.greaterThan:return">";case v.greaterThanOrEqualTo:return">=";case v.lessThan:return"<";case v.lessThanOrEqualTo:return"<=";case v.contains:return"~";case v.notContains:return"!~";default:throw new Error("Unexpected filter type ".concat(e))}}static isPartitionedTable(e){return e!=null&&e.getMergedTable!==void 0&&e.getKeyTable!==void 0&&e.getKeys!==void 0}static isTreeTable(e){return e!=null&&e.expand!==void 0&&e.collapse!==void 0}static sortColumns(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return[...e].sort((r,n)=>{var a=r.name.toUpperCase(),o=n.name.toUpperCase();return nt.sort(a,o,t)})}constructor(e){z(this,"dh",void 0),this.dh=e,Re(this)}createDistinctSortedColumnTable(e,t,r){var n=arguments,a=this;return _(function*(){if(e==null)return null;for(var o=e,s=n.length,l=new Array(s>3?s-3:0),u=3;u<s;u++)l[u-3]=n[u];l.length>0&&(o=yield e.copy(),yield o.applyFilter(ce(...l.map(m=>m(o)))));var c=o.findColumn(t),d=yield o.selectDistinct([c]);o!==e&&o.close();var f=d.findColumn(t).sort()[r]();return a.applySort(d,[f])})()}doesColumnValueExist(e,t,r,n){var a=this;return _(function*(){if(e==null)return null;var o=yt(a,t,r,n?"eq":"eqIgnoreCase"),s=yield e.copy();yield a.applyFilter(s,ce(o(s)));var l=Dt(s);return s.close(),l>0})()}getValueType(e){if(e==null)return this.dh.ValueType.STRING;var t=h.getNormalizedType(e);switch(t){case h.dataType.BOOLEAN:return this.dh.ValueType.BOOLEAN;case h.dataType.CHAR:case h.dataType.STRING:return this.dh.ValueType.STRING;case h.dataType.DATETIME:return this.dh.ValueType.DATETIME;case h.dataType.DECIMAL:case h.dataType.INT:return h.isBigDecimalType(e)||h.isBigIntegerType(e)?this.dh.ValueType.STRING:this.dh.ValueType.NUMBER;default:return this.dh.ValueType.STRING}}makeQuickFilter(e,t,r){for(var n=t.split("||"),a=null,o=0;o<n.length;o+=1){for(var s=n[o],l=s.split("&&"),u=null,c=0;c<l.length;c+=1){var d=l[c].trim();if(d.length>0){var f=this.makeQuickFilterFromComponent(e,d,r);if(f)u?u=u.and(f):u=f;else throw new Error("Unable to parse quick filter from text ".concat(t))}}a&&u?a=a.or(u):a=u}return a}makeQuickFilterFromComponent(e,t,r){var{type:n}=e;return h.isNumberType(n)?this.makeQuickNumberFilter(e,t):h.isBooleanType(n)?this.makeQuickBooleanFilter(e,t):r!=null&&h.isDateType(n)?this.makeQuickDateFilter(e,t,r):h.isCharType(n)?this.makeQuickCharFilter(e,t):this.makeQuickTextFilter(e,t)}makeQuickNumberFilter(e,t){var r=e.filter(),{dh:n}=this,a=null,o=/\s*(>=|<=|=>|=<|>|<|!=|=|!)?(\s*-\s*)?(\s*\d*(?:,\d{3})*(?:\.\d*)?\s*)?(null|nan|infinity|inf|\u221E)?(.*)/i,s=o.exec(t),l=null,u=null,c=null,d=null,f=null;if(s!==null&&s.length>3&&([,l,u,c,d,f]=s),f!=null&&f.trim().length>0)return null;if(l==null&&(l="="),d!=null){if(!(l==="="||l==="!"||l==="!="))return null;switch(d=d.trim().toLowerCase(),d){case"null":a=r.isNull();break;case"nan":a=n.FilterCondition.invoke("isNaN",r);break;case"infinity":case"inf":case"∞":u!=null?a=n.FilterCondition.invoke("isInf",r).and(r.lessThan(n.FilterValue.ofNumber(0))):a=n.FilterCondition.invoke("isInf",r).and(r.greaterThan(n.FilterValue.ofNumber(0)));break}return a!==null&&(l==="!"||l==="!=")&&(a=a.not()),a}if(c==null)return null;if(c=h.removeCommas(c),h.isLongType(e.type))try{c=n.FilterValue.ofNumber(n.LongWrapper.ofString("".concat(u!=null?"-":"").concat(c)))}catch(m){return j.warn("Unable to create long filter",m),null}else{if(c=parseFloat(c),c==null||Number.isNaN(c))return null;c=n.FilterValue.ofNumber(u!=null?0-c:c)}return a=e.filter(),h.makeRangeFilterWithOperation(a,l,c)}static escapeQuickTextFilter(e){var t,r;if(e==null)return null;var n=/^(!~|!=|~|=|!)?(.*)/,a=/^\\*null$/,o=n.exec(e),s=null,l=null;if(o!==null&&o.length>2&&([,s,l]=o),s!=null){var u;return"\\".concat(s).concat((u=l)!==null&&u!==void 0?u:"")}return l!=null&&a.test(l.toLowerCase())||l!=null&&l.startsWith("*")?"\\".concat(l):l!=null&&l.endsWith("*")&&!l.endsWith("\\*")?(l=l.substring(0,l.length-1),"".concat(l,"\\*")):"".concat((t=s)!==null&&t!==void 0?t:"").concat((r=l)!==null&&r!==void 0?r:"")}static unescapeQuickTextFilter(e){var t,r,n=/^(\\!~|\\!=|\\~|\\=|\\!)?(.*)/,a=/^\\*null$/,o=n.exec(e),s=null,l=null;return o!==null&&o.length>2&&([,s,l]=o),s!=null&&(s=s.replace("\\","")),l!=null&&a.test(l.toLowerCase())&&(l=l.replace("\\","")),s==null&&l!=null&&l.startsWith("\\*")&&(l=l.substring(1)),s==null&&l!=null&&l.endsWith("\\*")?(l=l.substring(0,l.length-2),"".concat(l,"*")):"".concat((t=s)!==null&&t!==void 0?t:"").concat((r=l)!==null&&r!==void 0?r:"")}makeQuickTextFilter(e,t){var{dh:r}=this,n="".concat(t).trim(),a=/^(!~|!=|~|=|!)?(.*)/,o=a.exec(n),s=null,l=null;if(o!==null&&o.length>2&&([,s,l]=o,l!=null&&(l=l.trim())),l==null||l.length===0&&!(s==="="||s==="!="))return null;s==null&&(s="=");var u=e.filter();if(l.toLowerCase()==="null")switch(s){case"=":return u.isNull();case"!=":case"!":return u.isNull().not()}var c=null,d=null;switch(l.startsWith("*")?(c="*",l=l.substring(1)):l.endsWith("*")&&!l.endsWith("\\*")&&(d="*",l=l.substring(0,l.length-1)),l=h.unescapeQuickTextFilter(l),s){case"~":return u.isNull().not().and(u.invoke("matches",r.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E.*"))));case"!~":return u.isNull().or(u.invoke("matches",r.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E.*"))).not());case"!=":return c==="*"?u.isNull().or(u.invoke("matches",r.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E$"))).not()):d==="*"?u.isNull().or(u.invoke("matches",r.FilterValue.ofString("(?s)(?i)^\\Q".concat(l,"\\E.*"))).not()):u.notEqIgnoreCase(r.FilterValue.ofString(l.toLowerCase()));case"=":return c==="*"?u.isNull().not().and(u.invoke("matches",r.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E$")))):d==="*"?u.isNull().not().and(u.invoke("matches",r.FilterValue.ofString("(?s)(?i)^\\Q".concat(l,"\\E.*")))):u.eqIgnoreCase(r.FilterValue.ofString(l.toLowerCase()))}return null}makeQuickBooleanFilter(e,t){var r=/^(!=|=|!)?(.*)/,n=r.exec("".concat(t).trim());if(n===null)return null;var[,a,o]=n,s=a==="!"||a==="!=",l=o.trim().toLowerCase(),u=e.filter();try{var c=h.makeBooleanValue(l);return c!=null&&c?u=u.isTrue():c===null?u=u.isNull():u=u.isFalse(),s?u.not():u}catch{return null}}makeQuickDateFilter(e,t,r){var n=t.trim(),a=/\s*(>=|<=|=>|=<|>|<|!=|!|=)?(.*)/,o=a.exec(n);if(o==null||o.length<=2)throw new Error("Unable to parse date filter: ".concat(t));var s=null,l=null;[,s,l]=o;var u=v.eq;switch(s){case"<":u=v.lessThan;break;case"<=":case"=<":u=v.lessThanOrEqualTo;break;case">":u=v.greaterThan;break;case">=":case"=>":u=v.greaterThanOrEqualTo;break;case"!=":case"!":u=v.notEq;break;case"=":case"==":default:u=v.eq;break}return this.makeQuickDateFilterWithOperation(e,l,u,r)}makeQuickDateFilterWithOperation(e,t,r,n){var{dh:a}=this,[o,s]=x.parseDateRange(a,t,n),l=o!=null?a.FilterValue.ofNumber(o):null,u=s!=null?a.FilterValue.ofNumber(s):null,c=e.filter();if(l==null)return r===v.notEq?c.isNull().not():c.isNull();switch(r){case v.eq:{if(u!=null){var d=c.greaterThanOrEqualTo(l),f=c.lessThan(u);return d.and(f)}return c.eq(l)}case v.lessThan:return c.lessThan(l);case v.lessThanOrEqualTo:return u!=null?c.lessThan(u):c.lessThanOrEqualTo(l);case v.greaterThan:return u!=null?c.greaterThanOrEqualTo(u):c.greaterThan(l);case v.greaterThanOrEqualTo:return c.greaterThanOrEqualTo(l);case v.notEq:{if(u!=null){var m=c.lessThan(l),p=c.greaterThanOrEqualTo(u);return m.or(p)}return c.notEq(l)}default:throw new Error("Invalid operator: ".concat(r))}}makeQuickCharFilter(e,t){var{dh:r}=this,n="".concat(t).trim(),a=/^(>=|<=|=>|=<|>|<|!=|=|!)?(null|"."|'.'|.)?(.*)/,o=a.exec(n),s=null,l=null,u=null;if(o!==null&&o.length>3&&([,s,l,u]=o),u!=null&&u.trim().length>0||l==null||l.length===0)return null;s==null&&(s="=");var c=e.filter();if(l.toLowerCase()==="null")switch(s){case"=":return c.isNull();case"!=":case"!":return c.isNull().not();default:return null}var d=r.FilterValue.ofString(h.isRangeOperation(s)?h.quoteValue(l):l);return h.makeRangeFilterWithOperation(c,s,d)}makeAdvancedFilter(e,t,r){for(var{filterItems:n,filterOperators:a,invertSelection:o,selectedValues:s}=t,l=null,u=0;u<n.length;u+=1){var c=n[u],{selectedType:d,value:f}=c;if(d!=null&&d.length>0&&f!=null&&f.length>0)try{var m=this.makeAdvancedValueFilter(e,d,f,r);if(m!=null){if(u===0)l=m;else if(l!==null&&u-1<a.length){var p=a[u-1];if(p===ae.and)l=l.and(m);else if(p===ae.or)l=l.or(m);else{j.error("Unexpected filter operator",p,m),l=null;break}}}else j.debug2("Empty filter ignored for",d,f)}catch(E){j.error("Unable to create filter",E),l=null;break}}var y=this.makeSelectValueFilter(e,s,o);return y!=null&&(l!=null?l=l.and(y):l=y),l}makeAdvancedValueFilter(e,t,r,n){var{dh:a}=this;if(h.isDateType(e.type))return this.makeQuickDateFilterWithOperation(e,r,t,n);if(h.isNumberType(e.type)||h.isCharType(e.type))return this.makeQuickFilter(e,"".concat(h.getFilterOperatorString(t)).concat(r));var o=this.makeFilterValue(e.type,r),s=e.filter();switch(t){case v.eq:return s.eq(o);case v.eqIgnoreCase:return s.eqIgnoreCase(o);case v.notEq:return s.notEq(o);case v.notEqIgnoreCase:return s.notEqIgnoreCase(o);case v.greaterThan:return s.greaterThan(o);case v.greaterThanOrEqualTo:return s.greaterThanOrEqualTo(o);case v.lessThan:return s.lessThan(o);case v.lessThanOrEqualTo:return s.lessThanOrEqualTo(o);case v.isTrue:return s.isTrue();case v.isFalse:return s.isFalse();case v.isNull:return s.isNull();case v.contains:return s.isNull().not().and(s.invoke("matches",a.FilterValue.ofString("(?s)(?i).*\\Q".concat(r,"\\E.*"))));case v.notContains:return s.isNull().or(s.invoke("matches",a.FilterValue.ofString("(?s)(?i).*\\Q".concat(r,"\\E.*"))).not());case v.startsWith:return s.isNull().not().and(s.invoke("matches",a.FilterValue.ofString("(?s)(?i)^\\Q".concat(r,"\\E.*"))));case v.endsWith:return s.isNull().not().and(s.invoke("matches",a.FilterValue.ofString("(?s)(?i).*\\Q".concat(r,"\\E$"))));case v.in:case v.inIgnoreCase:case v.notIn:case v.notInIgnoreCase:case v.invoke:default:throw new Error("Unexpected filter operation: ".concat(t))}}applyNeverFilter(e,t){var r=arguments,n=this;return _(function*(){var a=r.length>2&&r[2]!==void 0?r[2]:h.APPLY_TABLE_CHANGE_TIMEOUT_MS;if(e==null)return null;var o=e.findColumn(t),s=[n.makeNeverFilter(o)];return yield n.applyFilter(e,s,a),e})()}applyCustomColumns(e,t){var r=arguments,n=this;return _(function*(){var a=r.length>2&&r[2]!==void 0?r[2]:h.APPLY_TABLE_CHANGE_TIMEOUT_MS,{dh:o}=n;return h.executeAndWaitForEvent(s=>s==null?void 0:s.applyCustomColumns(t),e,o.Table.EVENT_CUSTOMCOLUMNSCHANGED,a)})()}applyFilter(e,t){var r=arguments,n=this;return _(function*(){var a=r.length>2&&r[2]!==void 0?r[2]:h.APPLY_TABLE_CHANGE_TIMEOUT_MS,{dh:o}=n;return h.executeAndWaitForEvent(s=>s==null?void 0:s.applyFilter(t),e,o.Table.EVENT_FILTERCHANGED,a)})()}applySort(e,t){var r=arguments,n=this;return _(function*(){var a=r.length>2&&r[2]!==void 0?r[2]:h.APPLY_TABLE_CHANGE_TIMEOUT_MS,{dh:o}=n;return h.executeAndWaitForEvent(s=>s==null?void 0:s.applySort(t),e,o.Table.EVENT_SORTCHANGED,a)})()}makeNeverFilter(e){var{dh:t}=this,r=null;h.isTextType(e.type)?r=t.FilterValue.ofString("a"):h.isBooleanType(e.type)?r=t.FilterValue.ofBoolean(!0):h.isDateType(e.type)?r=t.FilterValue.ofNumber(t.DateWrapper.ofJsDate(new Date)):r=t.FilterValue.ofNumber(0);var n=e.filter().eq(r),a=e.filter().notEq(r);return n.and(a)}makeFilterValue(e,t){var{dh:r}=this,n=h.getBaseType(e);return h.isTextType(n)?r.FilterValue.ofString(t):h.isLongType(n)?r.FilterValue.ofNumber(r.LongWrapper.ofString(h.removeCommas(t))):r.FilterValue.ofNumber(h.removeCommas(t))}makeFilterRawValue(e,t){var{dh:r}=this;return h.isCharType(e)?r.FilterValue.ofString(typeof t=="number"?String.fromCharCode(t):t):h.isTextType(e)?r.FilterValue.ofString(t):h.isBooleanType(e)?r.FilterValue.ofBoolean(t):r.FilterValue.ofNumber(t)}makeValue(e,t,r){var{dh:n}=this;if(t==="null")return null;if(h.isTextType(e))return t;if(h.isLongType(e))return n.LongWrapper.ofString(h.removeCommas(t));if(h.isBooleanType(e))return h.makeBooleanValue(t,!0);if(h.isDateType(e)){var[a]=x.parseDateRange(n,t,r);return a}return h.isNumberType(e)?h.makeNumberValue(t):(j.error("Unexpected column type",e),null)}makeSelectValueFilter(e,t,r){var{dh:n}=this;if(t.length===0)return r?null:this.makeNeverFilter(e);for(var a=[],o=!1,s=0;s<t.length;s+=1){var l=t[s];l==null?o=!0:h.isTextType(e.type)?a.push(n.FilterValue.ofString(typeof l=="number"?String.fromCharCode(l):l)):h.isBooleanType(e.type)?a.push(n.FilterValue.ofBoolean(!!l)):a.push(n.FilterValue.ofNumber(l))}return o?a.length>0?r?e.filter().isNull().not().and(e.filter().notIn(a)):e.filter().isNull().or(e.filter().in(a)):r?e.filter().isNull().not():e.filter().isNull():r?e.filter().notIn(a):e.filter().in(a)}}z(h,"dataType",{BOOLEAN:"boolean",CHAR:"char",DATETIME:"datetime",DECIMAL:"decimal",INT:"int",STRING:"string",UNKNOWN:"unknown"});z(h,"sortDirection",{ascending:"ASC",descending:"DESC",reverse:"REVERSE",none:null});z(h,"APPLY_TABLE_CHANGE_TIMEOUT_MS",3e4);z(h,"REVERSE_TYPE",Object.freeze({NONE:"none",PRE_SORT:"pre-sort",POST_SORT:"post-sort"}));z(h,"NUMBER_REGEX",/^-?\d+(\.\d+)?$/);z(h,"executeAndWaitForEvent",function(){var i=_(function*(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:h.APPLY_TABLE_CHANGE_TIMEOUT_MS;if(t==null)return null;var a=h.makeCancelableTableEventPromise(t,r,n);return e(t),yield a,t});return function(e,t,r){return i.apply(this,arguments)}}());function Pe(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),t.push.apply(t,r)}return t}function Ft(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Pe(Object(t),!0).forEach(function(r){wt(i,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Pe(Object(t)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))})}return i}function wt(i,e,t){return e=Ot(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Ot(i){var e=It(i,"string");return typeof e=="symbol"?e:String(e)}function It(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var Ct=Z.lazy(()=>He(()=>import("./Chart-544f88ca.js"),["./Chart-544f88ca.js","./vendor-7d0187fb.js","./helpers-de833af9.js","./vendor-a4479904.css","./index-9cceedf7.js","./index-7535fde1.css","./Plotly-da68c98c.js","./plotly-d72b6537.js","./useChartTheme-0c5d9e2d.js","./useChartTheme-bb495fb2.css","./Chart-b27697ef.css"],import.meta.url));function Nr(i){return b.jsx(Z.Suspense,{fallback:b.jsx($e,{}),children:b.jsx(Ct,Ft({},i))})}function Me(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),t.push.apply(t,r)}return t}function le(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Me(Object(t),!0).forEach(function(r){k(i,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Me(Object(t)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))})}return i}function k(i,e,t){return e=xt(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function xt(i){var e=Lt(i,"string");return typeof e=="symbol"?e:String(e)}function Lt(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var te=ie.module("ChartUtils"),Fe="io.deephaven.time.DateTime",Rt=36e5,kt=1e6;function Vt(i){return i.asDate!==void 0}function Wt(i){return i.asNumber!==void 0}function we(i){return i.dhTimeZone!==void 0}function Bt(i){return i!=null&&i.range!=null&&(i.autorange===!1||i.autorange===void 0)}function jt(){var i=document.createElement("canvas"),e=i.getContext("webgl")||i.getContext("experimental-webgl");return e!=null&&e instanceof WebGLRenderingContext}var Ht=jt();class g{static getPlotlyErrorBars(e,t,r){var n=r.map((o,s)=>o-e[s]),a=t.map((o,s)=>e[s]-o);return{type:"data",symmetric:!1,array:n,arrayminus:a}}static convertNumberPrefix(e){return e.replace(/\u00A4\u00A4/g,"USD").replace(/\u00A4/g,"$")}static getPlotlyNumberFormat(e,t,r){if(r==null||r==="")return null;var n=r.split(";"),a=n[0].match(/^([^#,0.]*)([#,]*)([0,]*)(\.?)(0*)(#*)(E?0*)(%?)(.*)/);ee(a);var[,o,s,l,,u,c,d,f,m]=a,p=l.replace(",","").length,y=s.indexOf(",")>=0||l.indexOf(",")>=0,E=y?",":"",S=d!=null&&d!==""?"e":"f",A=f!==""?f:S,T=u.length+c.length,N="",D="0".concat(p).concat(E,".").concat(T).concat(N).concat(A),C=g.convertNumberPrefix(o),P=g.convertNumberPrefix(m);return{tickformat:D,tickprefix:C,ticksuffix:P,automargin:!0}}static addTickSpacing(e,t,r){var{gapBetweenMajorTicks:n}=t;if(n!=null&&n>0){var a=e||{},o=n;return r&&(o=n/kt),t.log&&(o=Math.log(o)),a.tickmode="linear",a.dtick=o,a}return e}static getSourceForAxis(e,t){for(var r=0;r<e.series.length;r+=1)for(var n=e.series[r],a=0;a<n.sources.length;a+=1){var o=n.sources[a];if(o.axis===t)return o}return null}static getSeriesVisibility(e,t){return t!=null&&t.hiddenSeries!=null&&t.hiddenSeries.includes(e)?"legendonly":!0}static getHiddenLabels(e){return e!=null&&e.hiddenSeries?[...e.hiddenSeries]:[]}static makeSeriesData(e,t,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:g.ORIENTATION.VERTICAL;return{type:e,mode:t,name:r,orientation:a,showlegend:n??void 0}}static getMarkerSymbol(e){switch(e){case"SQUARE":return"square";case"CIRCLE":return"circle";case"DIAMOND":return"diamond";case"UP_TRIANGLE":return"triangle-up";case"DOWN_TRIANGLE":return"triangle-down";case"RIGHT_TRIANGLE":return"triangle-right";case"LEFT_TRIANGLE":return"triangle-left";case"ELLIPSE":case"HORIZONTAL_RECTANGLE":case"VERTICAL_RECTANGLE":default:throw new Error("Unrecognized shape ".concat(e))}}static getAllAxes(e){return e.charts.reduce((t,r)=>[...t,...r.axes],[])}static getAxisTypeMap(e){var t=g.getAllAxes(e);return g.groupArray(t,"type")}static getChartForSeries(e,t){for(var{charts:r}=e,n=0;n<r.length;n+=1)for(var a=r[n],o=0;o<a.series.length;o+=1)if(t===a.series[o])return a;return null}static getLayoutRanges(e){for(var t={},r=Object.keys(e).filter(s=>s.indexOf("axis")>=0),n=0;n<r.length;n+=1){var a=r[n],o=e[a];Bt(o)&&(t[a]=[...o.range])}return t}static getAxisLayoutProperty(e,t){var r=t>0?"".concat(t+1):"";return"".concat(e??"","axis").concat(r)}static periodToDecimal(e){var t=e.split(":");return Number(t[0])+Number(t[1])/60}static groupArray(e,t){return e.reduce((r,n)=>{var a,o=n[t],s=(a=r.get(o))!==null&&a!==void 0?a:[];return s.push(n),r.set(o,s),r},new Map)}static normalizeColorway(e){if(e!=null){if(Array.isArray(e))return e;if(typeof e=="string")return e.split(" ");te.warn("Unexpected colorway format: ".concat(e))}}static titleFromSettings(e){var{series:t,xAxis:r,title:n="".concat((t??[]).join(", ")," by ").concat(r)}=e;return n}constructor(e){k(this,"dh",void 0),k(this,"daysOfWeek",void 0),this.dh=e,this.daysOfWeek=Object.freeze(e.calendar.DayOfWeek.values()),Re(this)}getAxisFormats(e,t){for(var r=this,n=new Map,a={tickformat:null,ticksuffix:null},o=g.getAllAxes(e),s=g.groupArray(o,"type"),{charts:l}=e,u=0;u<l.length;u+=1)for(var c=l[u],d=0;d<c.series.length;d+=1)for(var f=c.series[d],{sources:m}=f,p=m.filter(A=>A.axis),y=function(){var T=p[E],{axis:N}=T,{type:D}=N,C=s.get(D);ee(C);var P=C.indexOf(N),w=r.getAxisPropertyName(D);if(w!=null){var O=g.getAxisLayoutProperty(w,P);if(n.has(O))te.debug("".concat(O," already added."));else{te.debug("Adding ".concat(O," to axisFormats."));var L=r.getPlotlyAxisFormat(T,t);if(L===null)n.set(O,a);else{n.set(O,L);var{businessCalendar:H}=N;if(H!=null){var B=[],{businessPeriods:Y,businessDays:Q,holidays:G,timeZone:J}=H,pe=t==null?void 0:t.getColumnTypeFormatter(Fe),se;we(pe)&&(se=pe.dhTimeZone);var me=se?(J.standardOffset-se.standardOffset)/60:0;G.length>0&&B.push(...r.createRangeBreakValuesFromHolidays(G,J,se)),Y.forEach(oe=>B.push({pattern:"hour",bounds:[g.periodToDecimal(oe.close)+me,g.periodToDecimal(oe.open)+me]})),Q.length<r.daysOfWeek.length&&r.createBoundsFromDays(Q).forEach(oe=>B.push({pattern:"day of week",bounds:oe})),L.rangebreaks=B}if(n.size===c.axes.length)return{v:n}}}}},E=0;E<p.length;E+=1){var S=y();if(typeof S=="object")return S.v}return n}getPlotlyChartType(e,t){var{dh:r}=this;switch(e){case r.plot.SeriesPlotStyle.SCATTER:case r.plot.SeriesPlotStyle.LINE:return!t&&Ht?"scattergl":"scatter";case r.plot.SeriesPlotStyle.BAR:case r.plot.SeriesPlotStyle.STACKED_BAR:return"bar";case r.plot.SeriesPlotStyle.PIE:return"pie";case r.plot.SeriesPlotStyle.TREEMAP:return"treemap";case r.plot.SeriesPlotStyle.HISTOGRAM:return"histogram";case r.plot.SeriesPlotStyle.OHLC:return"ohlc";default:return}}getPlotlyChartMode(e,t,r){var{dh:n}=this,a=new Set;switch(e){case n.plot.SeriesPlotStyle.SCATTER:(t??!1)&&a.add(g.MODE_LINES),(r??!0)&&a.add(g.MODE_MARKERS);break;case n.plot.SeriesPlotStyle.LINE:(t??!0)&&a.add(g.MODE_LINES),(r??!1)&&a.add(g.MODE_MARKERS);break}return a.size>0?[...a].join("+"):void 0}getPlotlyProperty(e,t){var{dh:r}=this;switch(e){case r.plot.SeriesPlotStyle.PIE:switch(t){case r.plot.SourceType.X:return"labels";case r.plot.SourceType.Y:return"values"}break;case r.plot.SeriesPlotStyle.OHLC:switch(t){case r.plot.SourceType.TIME:return"x"}break;case r.plot.SeriesPlotStyle.TREEMAP:switch(t){case r.plot.SourceType.X:return"ids";case r.plot.SourceType.Y:return"values";case r.plot.SourceType.LABEL:return"labels";case r.plot.SourceType.PARENT:return"parents";case r.plot.SourceType.COLOR:return"marker.colors"}break}switch(t){case r.plot.SourceType.X:return"x";case r.plot.SourceType.Y:return"y";case r.plot.SourceType.Z:return"z";case r.plot.SourceType.X_LOW:return"xLow";case r.plot.SourceType.X_HIGH:return"xHigh";case r.plot.SourceType.Y_LOW:return"yLow";case r.plot.SourceType.Y_HIGH:return"yHigh";case r.plot.SourceType.TIME:return"time";case r.plot.SourceType.OPEN:return"open";case r.plot.SourceType.HIGH:return"high";case r.plot.SourceType.LOW:return"low";case r.plot.SourceType.CLOSE:return"close";case r.plot.SourceType.SHAPE:return"shape";case r.plot.SourceType.SIZE:return"size";case r.plot.SourceType.LABEL:return"label";case r.plot.SourceType.COLOR:return"color";case r.plot.SourceType.PARENT:return"parent";case r.plot.SourceType.HOVER_TEXT:return"hovertext";case r.plot.SourceType.TEXT:return"text";default:throw new Error("Unrecognized source type: ".concat(t))}}getPlotlySeriesOrientation(e){var t,r,{dh:n}=this,{sources:a}=e;return a.length===2&&((t=a[0])===null||t===void 0||(r=t.axis)===null||r===void 0?void 0:r.type)===n.plot.AxisType.Y?g.ORIENTATION.HORIZONTAL:g.ORIENTATION.VERTICAL}makeSeriesDataFromSeries(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,{name:a,isLinesVisible:o,isShapesVisible:s,plotStyle:l,lineColor:u,shapeColor:c,sources:d,shape:f,shapeSize:m}=e,p=d.some(T=>{var N;return(N=T.axis)===null||N===void 0?void 0:N.businessCalendar}),y=this.getChartType(l,p),E=this.getPlotlyChartMode(l,o??void 0,s??void 0),S=this.getPlotlySeriesOrientation(e),A=g.makeSeriesData(y,E,a,n,S);return this.addSourcesToSeriesData(A,l,d,t),this.addStylingToSeriesData(A,l,u,c,f,m,r),A}addSourcesToSeriesData(e,t,r,n){for(var a=e,o=0;o<r.length;o+=1){var s=r[o],{axis:l,type:u}=s,c=this.getPlotlyProperty(t,u);Le(a,c,[]);var d=l!=null?this.getAxisPropertyName(l.type):null;if(d!=null){var f=n.get(l.type);if(f){var m=f.indexOf(l),p=m>0?"".concat(m+1):"";a["".concat(d,"axis")]="".concat(d).concat(p)}}}}addStylingToSeriesData(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:null,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null,{dh:l}=this,u=e;if(u.marker={line:{}},u.line={width:1},t===l.plot.SeriesPlotStyle.AREA?u.fill="tozeroy":t===l.plot.SeriesPlotStyle.STACKED_AREA?u.stackgroup="stack":t===l.plot.SeriesPlotStyle.STEP?u.line.shape="hv":t===l.plot.SeriesPlotStyle.HISTOGRAM?u.width=[]:t===l.plot.SeriesPlotStyle.PIE?u.textinfo="label+percent":t===l.plot.SeriesPlotStyle.TREEMAP&&(u.hoverinfo="text",u.textinfo="label+text",u.tiling={packing:"squarify",pad:0},u.textposition="middle center"),r!=null&&(t===l.plot.SeriesPlotStyle.BAR?u.marker.color=r:u.line.color=r),n!=null&&(u.marker.color=n),a!=null&&a.length>0)try{u.marker.symbol=g.getMarkerSymbol(a)}catch(c){te.warn("Unable to handle shape",a,":",c)}o!=null&&(u.marker.size=o*g.DEFAULT_MARKER_SIZE),s!=null&&t!==l.plot.SeriesPlotStyle.PIE&&(u.visible=s)}getChartType(e,t){var{dh:r}=this;switch(e){case r.plot.SeriesPlotStyle.HISTOGRAM:return"bar";default:return this.getPlotlyChartType(e,t)}}getAxisPropertyName(e){var{dh:t}=this;switch(e){case t.plot.AxisType.X:return"x";case t.plot.AxisType.Y:return"y";default:return null}}getAxisSide(e){var{dh:t}=this;switch(e){case t.plot.AxisPosition.BOTTOM:return"bottom";case t.plot.AxisPosition.TOP:return"top";case t.plot.AxisPosition.LEFT:return"left";case t.plot.AxisPosition.RIGHT:return"right";default:return}}updateFigureAxes(e,t,r){for(var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=e,s=g.getAllAxes(t),l=0;l<t.charts.length;l+=1){var u=t.charts[l],c=r==null?void 0:r(u),d=this.getChartBounds(t,u,n,a);this.updateLayoutAxes(o,u.axes,s,n,a,d,c)}this.removeStaleAxes(o,s)}getChartBounds(e,t,r,n){var a,{dh:o}=this,{cols:s,rows:l}=e,{column:u,colspan:c,row:d,rowspan:f}=t,m=u+c,p=d+f,y=1/s,E=1/l,S=g.AXIS_SIZE_PX/r,A=g.AXIS_SIZE_PX/n,T={bottom:(l-p)*E+(p<l?A/2:0),top:(l-d)*E-(d>0?A/2:0),left:u*y+(u>0?S/2:0),right:m*y-(m<s?S/2:0)},N=g.groupArray(t.axes,"position"),D=(a=N.get(o.plot.AxisPosition.RIGHT))!==null&&a!==void 0?a:[];return D.length>0&&(r>0?T.right-=(T.right-T.left)*Math.max(0,Math.min(g.LEGEND_WIDTH_PX/r,g.MAX_LEGEND_SIZE)):T.right-=(T.right-T.left)*g.DEFAULT_AXIS_SIZE),T}getPlotlyDateFormat(e,t,r){var{dh:n}=this,a=r==null?void 0:r.replace("%","%%").replace(/S{9}/g,"%9f").replace(/S{8}/g,"%8f").replace(/S{7}/g,"%7f").replace(/S{6}/g,"%6f").replace(/S{5}/g,"%5f").replace(/S{4}/g,"%4f").replace(/S{3}/g,"%3f").replace(/S{2}/g,"%2f").replace(/S{1}/g,"%1f").replace(/y{4}/g,"%Y").replace(/y{2}/g,"%y").replace(/M{4}/g,"%B").replace(/M{3}/g,"%b").replace(/M{2}/g,"%m").replace(/M{1}/g,"%-m").replace(/E{4,}/g,"%A").replace(/E{1,}/g,"%a").replace(/d{2}/g,"%d").replace(/([^%]|^)d{1}/g,"$1%-d").replace(/H{2}/g,"%H").replace(/h{2}/g,"%I").replace(/h{1}/g,"%-I").replace(/m{2}/g,"%M").replace(/s{2}/g,"%S").replace("'T'","T").replace(" z",""),o,s=e==null?void 0:e.getColumnTypeFormatter(t);return s!=null&&we(s)&&s.dhTimeZone!=null&&s.showTimeZone&&(o=n.i18n.DateTimeFormat.format(" z",new Date,s.dhTimeZone)),{tickformat:a,ticksuffix:o,automargin:!0}}getPlotlyAxisFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,{dh:r}=this,{axis:n,columnType:a}=e,{formatPattern:o}=n,s=null;return h.isDateType(a)?(s=this.getPlotlyDateFormat(t,a,o),s=g.addTickSpacing(s,n,!0)):h.isNumberType(a)&&(s=g.getPlotlyNumberFormat(t,a,o),s=g.addTickSpacing(s,n,!1)),n.formatType===r.plot.AxisFormatType.CATEGORY&&(s?s.type="category":s={type:"category",tickformat:void 0,ticksuffix:void 0}),s}updateLayoutAxes(e,t,r){for(var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{left:0,top:0,right:1,bottom:1},s=arguments.length>6?arguments[6]:void 0,{dh:l}=this,u=n>0?Math.max(g.MIN_AXIS_SIZE,Math.min(g.AXIS_SIZE_PX/a,g.MAX_AXIS_SIZE)):g.DEFAULT_AXIS_SIZE,c=a>0?Math.max(g.MIN_AXIS_SIZE,Math.min(g.AXIS_SIZE_PX/n,g.MAX_AXIS_SIZE)):g.DEFAULT_AXIS_SIZE,d=e,f=g.groupArray(t,"position"),m=g.groupArray(t,"type"),p=[...m.keys()],y=g.groupArray(r,"type"),E=0;E<p.length;E+=1){var S=p[E],A=this.getAxisPropertyName(S);if(A!=null){var T=m.get(S),N=y.get(S),D=S===l.plot.AxisType.Y,C=D?a:n;ee(T),ee(N);for(var P=0;P<T.length;P+=1){var w=T[P],O=N.indexOf(w),L=g.getAxisLayoutProperty(A,O);d[L]==null&&(d[L]={});var H=d[L];if(H!=null){this.updateLayoutAxis(H,w,P,f,u,c,o);var{range:B,autorange:Y}=H;if(s!=null&&B!==void 0&&(Y===void 0||Y===!1)){var Q=s(w),[G,J]=Q(B);te.debug("Setting downsample range",C,G,J),w.range(C,G,J)}else w.range(C)}}}}}removeStaleAxes(e,t){for(var r=e,n=g.groupArray(t,"type"),a=[...n.keys()],o=0;o<a.length;o+=1){var s=a[o],l=n.get(s);ee(l);var u=l.length,c=this.getAxisPropertyName(s);if(c!=null)for(var d=g.getAxisLayoutProperty(c,u);r[d]!=null;)delete r[d],u+=1,d=g.getAxisLayoutProperty(c,u)}}updateLayoutAxis(e,t,r,n,a,o,s){var l,{dh:u}=this,c=t.type===u.plot.AxisType.Y,d=c?o:a,f=e,m=(l=t.label)!==null&&l!==void 0?l:"";if(f.title!==void 0&&typeof f.title!="string"?f.title.text=m:f.title={text:m},t.log&&(f.type="log"),f.side=this.getAxisSide(t.position),r>0){var p,y;f.overlaying=(p=this.getAxisPropertyName(t.type))!==null&&p!==void 0?p:void 0;var E=(y=n.get(t.position))!==null&&y!==void 0?y:[],S=E.indexOf(t);S>0&&(f.anchor="free",t.position===u.plot.AxisPosition.RIGHT?f.position=s.right+(S-E.length+1)*d:t.position===u.plot.AxisPosition.TOP?f.position=s.top+(S-E.length+1)*d:t.position===u.plot.AxisPosition.BOTTOM?f.position=s.bottom+(E.length-S+1)*d:t.position===u.plot.AxisPosition.LEFT&&(f.position=s.left+(E.length-S+1)*d))}else if(t.type===u.plot.AxisType.X){var A=n.get(u.plot.AxisPosition.LEFT)||[],T=n.get(u.plot.AxisPosition.RIGHT)||[],N=Math.max(s.left,s.left+(A.length-1)*o),D=Math.min(s.right-(T.length-1)*o,s.right);f.domain=[N,D]}else if(t.type===u.plot.AxisType.Y){var C=n.get(u.plot.AxisPosition.BOTTOM)||[],P=n.get(u.plot.AxisPosition.TOP)||[],w=Math.max(s.bottom,s.bottom+(C.length-1)*a),O=Math.min(s.top-(P.length-1)*a,s.top);f.domain=[w,O]}}createBoundsFromDays(e){var t=e.map(o=>this.daysOfWeek.indexOf(o)),r=this.daysOfWeek.filter(o=>!e.includes(o)).map(o=>this.daysOfWeek.indexOf(o)),n=new Set;r.forEach(o=>{for(var s=o+1;s<o+this.daysOfWeek.length;s+=1){var l=s%this.daysOfWeek.length;if(t.includes(l)){n.add(l);break}}});var a=[];return n.forEach(o=>{for(var s=o-1;s>o-this.daysOfWeek.length;s-=1){var l=s<0?s+this.daysOfWeek.length:s;if(t.includes(l)){var u=(l+1)%7;a.push([u,o]);break}}}),a}createRangeBreakValuesFromHolidays(e,t,r){var n=[],a=[];return e.forEach(o=>{o.businessPeriods.length>0?a.push(...this.createPartialHoliday(o,t,r)):n.push(this.createFullHoliday(o,t,r))}),[{values:n},...a]}createFullHoliday(e,t,r){return this.adjustDateForTimeZone("".concat(e.date.toString()," 00:00:00.000000"),t,r)}createPartialHoliday(e,t,r){var n=e.date.toString(),a=["00:00"];e.businessPeriods.forEach(f=>{a.push(f.open),a.push(f.close)}),a.push("24:00");for(var o=[],s=0;s<a.length;s+=2){var l=a[s],u=a[s+1];if(l!==u){var c=[this.adjustDateForTimeZone("".concat(n," ").concat(l,":00.000000"),t,r)],d=Rt*(g.periodToDecimal(u)-g.periodToDecimal(l));o.push({values:c,dvalue:d})}}return o}adjustDateForTimeZone(e,t,r){return r&&r.standardOffset!==t.standardOffset?this.unwrapValue(this.wrapValue(e,Fe,t),r):e}makeFigureSettings(e,t){var{dh:r}=this,{series:n,xAxis:a,type:o}=e,s=g.titleFromSettings(e),l={formatType:"".concat(r.plot.AxisFormatType.NUMBER),type:"".concat(r.plot.AxisType.X),position:"".concat(r.plot.AxisPosition.BOTTOM)},u={formatType:"".concat(r.plot.AxisFormatType.NUMBER),type:"".concat(r.plot.AxisType.Y),position:"".concat(r.plot.AxisPosition.LEFT)};return{charts:[{chartType:"".concat(r.plot.ChartType.XY),axes:[l,u],series:(n??[]).map(c=>({plotStyle:"".concat(o),name:c,dataSources:[{type:"".concat(r.plot.SourceType.X),columnName:a??"",axis:l,table:t},{type:"".concat(r.plot.SourceType.Y),columnName:c,axis:u,table:t}]}))}],title:s}}unwrapValue(e,t){var{dh:r}=this;if(e!=null){if(Vt(e))return r.i18n.DateTimeFormat.format(g.DATE_FORMAT,e,t);if(Wt(e))return e.asNumber()}return e}wrapValue(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,{dh:n}=this;if(h.isDateType(t)&&typeof e=="string"){var a=e,o=g.DATE_FORMAT.substr(0,e.length),s=n.i18n.DateTimeFormat.parse(o,a);if(!r)return s;var l="".concat(o," Z"),u=n.i18n.DateTimeFormat.format("Z",s,r),c=n.i18n.DateTimeFormat.parse(l,"".concat(a," ").concat(u)),d=n.i18n.DateTimeFormat.format("Z",c,r);return n.i18n.DateTimeFormat.parse(l,"".concat(a," ").concat(d))}return e}makeLayoutAxis(e,t){var{dh:r}=this,n={automargin:!0,gridcolor:t.gridcolor,linecolor:t.linecolor,rangeslider:{visible:!1},showline:!0,ticks:"outside",ticklen:5,tickcolor:t.paper_bgcolor,tickfont:{color:t.zerolinecolor},title:{font:{color:t.title_color}},legend:{font:{color:t.legend_color}}};return e===r.plot.AxisType.X?Object.assign(n,{showgrid:!0}):e===r.plot.AxisType.Y&&Object.assign(n,{zerolinecolor:t.zerolinecolor,zerolinewidth:2}),n}makeDefaultTemplate(e){var{error_band_line_color:t,ohlc_increasing:r,ohlc_decreasing:n,title_color:a}=e;return{data:{bar:[{marker:{line:{color:"transparent"}}}],scatter:[{error_x:{color:t},error_y:{color:t}}],ohlc:[{increasing:{line:{color:r}},decreasing:{line:{color:n}}}],pie:[{outsidetextfont:{color:a}}],treemap:[{outsidetextfont:{color:a}}]},layout:this.makeDefaultLayout(e)}}makeDefaultLayout(e){var{dh:t}=this,{paper_bgcolor:r,plot_bgcolor:n,title_color:a,coastline_color:o,land_color:s,ocean_color:l,lake_color:u,river_color:c}=e,d={paper_bgcolor:r,plot_bgcolor:n,autosize:!0,colorway:g.normalizeColorway(e==null?void 0:e.colorway),font:{family:"'Fira Sans', sans-serif",color:a},title:{font:{color:a},xanchor:"center",xref:"paper",yanchor:"top",pad:le({},g.DEFAULT_TITLE_PADDING),y:1},legend:{font:{color:a}},margin:le({},g.DEFAULT_MARGIN),xaxis:this.makeLayoutAxis(t.plot.AxisType.X,e),yaxis:this.makeLayoutAxis(t.plot.AxisType.Y,e),polar:{angularaxis:this.makeLayoutAxis(t.plot.AxisType.SHAPE,e),radialaxis:this.makeLayoutAxis(t.plot.AxisType.SHAPE,e),bgcolor:e.plot_bgcolor},scene:{xaxis:this.makeLayoutAxis(t.plot.AxisType.X,e),yaxis:this.makeLayoutAxis(t.plot.AxisType.Y,e),zaxis:this.makeLayoutAxis(null,e)},geo:{showcoastlines:!0,showframe:!1,showland:!0,showocean:!0,showlakes:!0,showrivers:!0,bgcolor:r,coastlinecolor:o,landcolor:s,oceancolor:l,lakecolor:u,rivercolor:c}};return d.datarevision=0,d}hydrateSettings(e){var{dh:t}=this;return le(le({},e),{},{type:e.type!=null?t.plot.SeriesPlotStyle[e.type]:void 0})}}k(g,"DEFAULT_AXIS_SIZE",.15);k(g,"MIN_AXIS_SIZE",.025);k(g,"MAX_AXIS_SIZE",.2);k(g,"AXIS_SIZE_PX",75);k(g,"LEGEND_WIDTH_PX",50);k(g,"MAX_LEGEND_SIZE",.25);k(g,"ORIENTATION",Object.freeze({HORIZONTAL:"h",VERTICAL:"v"}));k(g,"DATE_FORMAT","yyyy-MM-dd HH:mm:ss.SSSSSS");k(g,"DEFAULT_MARGIN",Object.freeze({l:60,r:50,t:30,b:60,pad:0}));k(g,"DEFAULT_TITLE_PADDING",Object.freeze({t:8}));k(g,"SUBTITLE_LINE_HEIGHT",25);k(g,"DEFAULT_MARKER_SIZE",6);k(g,"MODE_MARKERS","markers");k(g,"MODE_LINES","lines");const W=g;function V(i,e,t){return e=_t(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function _t(i){var e=qt(i,"string");return typeof e=="symbol"?e:String(e)}function qt(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class I{constructor(e){V(this,"dh",void 0),V(this,"listeners",void 0),V(this,"formatter",void 0),V(this,"rect",void 0),V(this,"isDownsamplingDisabled",void 0),V(this,"title",void 0),this.dh=e,this.listeners=[],this.isDownsamplingDisabled=!1}getData(){return[]}getDefaultTitle(){return""}getLayout(){return{}}getFilterColumnMap(){return new Map}isFilterRequired(){return!1}setFilter(e){}close(){}setFormatter(e){this.formatter=e}setDownsamplingDisabled(e){this.isDownsamplingDisabled=e}setDimensions(e){this.rect=e}setTitle(e){this.title=e}subscribe(e){this.listeners.push(e)}unsubscribe(e){this.listeners=this.listeners.filter(t=>t!==e)}fireEvent(e){for(var t=0;t<this.listeners.length;t+=1)this.listeners[t](e)}fireUpdate(e){this.fireEvent(new CustomEvent(I.EVENT_UPDATED,{detail:e}))}fireDisconnect(){this.fireEvent(new CustomEvent(I.EVENT_DISCONNECT))}fireReconnect(){this.fireEvent(new CustomEvent(I.EVENT_RECONNECT))}fireDownsampleStart(e){this.fireEvent(new CustomEvent(I.EVENT_DOWNSAMPLESTARTED,{detail:e}))}fireDownsampleFinish(e){this.fireEvent(new CustomEvent(I.EVENT_DOWNSAMPLEFINISHED,{detail:e}))}fireDownsampleFail(e){this.fireEvent(new CustomEvent(I.EVENT_DOWNSAMPLEFAILED,{detail:e}))}fireDownsampleNeeded(e){this.fireEvent(new CustomEvent(I.EVENT_DOWNSAMPLENEEDED,{detail:e}))}fireLoadFinished(){this.fireEvent(new CustomEvent(I.EVENT_LOADFINISHED))}fireError(e){this.fireEvent(new CustomEvent(I.EVENT_ERROR,{detail:e}))}}V(I,"EVENT_UPDATED","ChartModel.EVENT_UPDATED");V(I,"EVENT_DISCONNECT","ChartModel.EVENT_DISCONNECT");V(I,"EVENT_RECONNECT","ChartModel.EVENT_RECONNECT");V(I,"EVENT_DOWNSAMPLESTARTED","ChartModel.EVENT_DOWNSAMPLESTARTED");V(I,"EVENT_DOWNSAMPLEFINISHED","ChartModel.EVENT_DOWNSAMPLEFINISHED");V(I,"EVENT_DOWNSAMPLEFAILED","ChartModel.EVENT_DOWNSAMPLEFAILED");V(I,"EVENT_DOWNSAMPLENEEDED","ChartModel.EVENT_DOWNSAMPLENEEDED");V(I,"EVENT_LOADFINISHED","ChartModel.EVENT_LOADFINISHED");V(I,"EVENT_ERROR","ChartModel.EVENT_ERROR");const Kt=I;function Oe(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),t.push.apply(t,r)}return t}function Ie(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Oe(Object(t),!0).forEach(function(r){F(i,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Oe(Object(t)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))})}return i}function F(i,e,t){return e=Gt(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Gt(i){var e=$t(i,"string");return typeof e=="symbol"?e:String(e)}function $t(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var R=ie.module("FigureChartModel");class ue extends Kt{constructor(e,t){var r,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};super(e),r=this,F(this,"chartUtils",void 0),F(this,"dh",void 0),F(this,"figure",void 0),F(this,"settings",void 0),F(this,"data",void 0),F(this,"layout",void 0),F(this,"seriesDataMap",void 0),F(this,"pendingSeries",void 0),F(this,"oneClicks",void 0),F(this,"filterColumnMap",void 0),F(this,"lastFilter",void 0),F(this,"isConnected",void 0),F(this,"seriesToProcess",void 0),F(this,"addPendingSeries",_e(()=>{for(var a=W.getAxisTypeMap(this.figure),{pendingSeries:o}=this,s=function(){var c,d=o[l],f=r.figure.charts.find(m=>m.series.includes(d));r.addSeries(d,a,(c=f==null?void 0:f.showLegend)!==null&&c!==void 0?c:null),d.subscribe()},l=0;l<o.length;l+=1)s();this.pendingSeries=[]},ue.ADD_SERIES_DEBOUNCE)),F(this,"getTimeZone",U((a,o)=>{if(o!=null){var s=o.getColumnTypeFormatter(a);if(s!=null)return s.dhTimeZone}})),F(this,"getValueTranslator",U((a,o)=>{var s=this.getTimeZone(a,o);return l=>this.chartUtils.unwrapValue(l,s)})),F(this,"getValueParser",U((a,o)=>{var s=this.getTimeZone(a,o);return l=>this.chartUtils.wrapValue(l,a,s)})),F(this,"getRangeParser",U((a,o)=>s=>{var[l,u]=s,c=this.getValueParser(a,o);return l=c(l),u=c(u),[l,u]})),F(this,"getAxisRangeParser",U((a,o)=>s=>{var l=W.getSourceForAxis(a,s);return l!=null?this.getRangeParser(l.columnType,o):u=>u})),this.handleFigureUpdated=this.handleFigureUpdated.bind(this),this.handleFigureDisconnected=this.handleFigureDisconnected.bind(this),this.handleFigureReconnected=this.handleFigureReconnected.bind(this),this.handleFigureSeriesAdded=this.handleFigureSeriesAdded.bind(this),this.handleDownsampleStart=this.handleDownsampleStart.bind(this),this.handleDownsampleFinish=this.handleDownsampleFinish.bind(this),this.handleDownsampleFail=this.handleDownsampleFail.bind(this),this.handleDownsampleNeeded=this.handleDownsampleNeeded.bind(this),this.handleRequestFailed=this.handleRequestFailed.bind(this),this.dh=e,this.chartUtils=new W(e),this.figure=t,this.settings=n,this.data=[],this.layout={grid:{rows:t.rows,columns:t.cols,pattern:"independent"}},this.seriesDataMap=new Map,this.pendingSeries=[],this.oneClicks=[],this.filterColumnMap=new Map,this.lastFilter=new Map,this.isConnected=!0,this.seriesToProcess=new Set,this.setTitle(this.getDefaultTitle()),this.initAllSeries(),this.updateAxisPositions(),this.startListeningFigure()}close(){this.figure.close(),this.addPendingSeries.cancel(),this.stopListeningFigure()}getDefaultTitle(){if(this.figure.title!=null&&this.figure.title.length>0)return this.figure.title;if(this.figure.charts.length===1){var e;return(e=this.figure.charts[0].title)!==null&&e!==void 0?e:""}return""}initAllSeries(){var e=this;this.oneClicks=[],this.filterColumnMap.clear();var{charts:t}=this.figure,r=W.getAxisTypeMap(this.figure),n=[];this.seriesToProcess=new Set;for(var a=function(){for(var f=t[o],m=0;m<f.series.length;m+=1){var p=f.series[m];n.push(p.name),e.addSeries(p,r,f.showLegend)}var{axes:y,title:E}=f;if(E!=null&&E.length>0&&(t.length>1||e.figure.title!=null)){var S=y.find(L=>L.type===e.dh.plot.AxisType.X),A=y.find(L=>L.type===e.dh.plot.AxisType.Y);if(S==null||A==null)R.warn("Chart title provided, but unknown how to map to the correct axes for this chart type",f);else{var T,N,D,C,P=((T=(N=r.get(S.type))===null||N===void 0?void 0:N.findIndex(L=>L===S))!==null&&T!==void 0?T:0)+1,w=((D=(C=r.get(A.type))===null||C===void 0?void 0:C.findIndex(L=>L===A))!==null&&D!==void 0?D:0)+1,O={align:"center",x:.5,y:1,yshift:17,text:E,showarrow:!1,xref:"x".concat(P," domain"),yref:"y".concat(w," domain")};e.layout.annotations==null?e.layout.annotations=[O]:e.layout.annotations.push(O)}}},o=0;o<t.length;o+=1)a();for(var s=[...this.seriesDataMap.keys()],l=s.filter(d=>n.indexOf(d)<0),u=0;u<l.length;u+=1){var c=l[u];this.seriesDataMap.delete(c)}}addSeries(e,t,r){var{dh:n}=this,a=this.chartUtils.makeSeriesDataFromSeries(e,t,W.getSeriesVisibility(e.name,this.settings),r);if(this.seriesDataMap.set(e.name,a),this.seriesToProcess.add(e.name),this.data=[...this.seriesDataMap.values()],e.plotStyle===n.plot.SeriesPlotStyle.STACKED_BAR?this.layout.barmode="stack":e.plotStyle===n.plot.SeriesPlotStyle.PIE&&(this.layout.hiddenlabels=W.getHiddenLabels(this.settings)),this.layout.showlegend=this.data.length>1||e.plotStyle===n.plot.SeriesPlotStyle.PIE?r??void 0:!1,e.oneClick!=null){for(var{oneClick:o}=e,{columns:s}=o,l=0;l<s.length;l+=1)this.filterColumnMap.set(s[l].name,s[l]);this.oneClicks.push(o)}this.updateLayoutFormats()}subscribe(e){super.subscribe(e),this.listeners.length===1&&(this.initAllSeries(),this.subscribeFigure())}unsubscribe(e){super.unsubscribe(e),this.listeners.length===0&&this.unsubscribeFigure()}subscribeFigure(){if(!this.isConnected){R.debug("Ignoring subscribe when figure in disconnected state");return}this.figure.subscribe(this.isDownsamplingDisabled?this.dh.plot.DownsampleOptions.DISABLE:this.dh.plot.DownsampleOptions.DEFAULT),this.figure.errors.length>0&&(R.error("Errors in figure",this.figure.errors),this.fireError(this.figure.errors))}unsubscribeFigure(){this.figure.unsubscribe()}startListeningFigure(){var{dh:e}=this;this.figure.addEventListener(e.plot.Figure.EVENT_UPDATED,this.handleFigureUpdated),this.figure.addEventListener(e.plot.Figure.EVENT_SERIES_ADDED,this.handleFigureSeriesAdded),this.figure.addEventListener(e.plot.Figure.EVENT_DISCONNECT,this.handleFigureDisconnected),this.figure.addEventListener(e.plot.Figure.EVENT_RECONNECT,this.handleFigureReconnected),this.figure.addEventListener(e.plot.Figure.EVENT_DOWNSAMPLESTARTED,this.handleDownsampleStart),this.figure.addEventListener(e.plot.Figure.EVENT_DOWNSAMPLEFINISHED,this.handleDownsampleFinish),this.figure.addEventListener(e.plot.Figure.EVENT_DOWNSAMPLEFAILED,this.handleDownsampleFail),this.figure.addEventListener(e.plot.Figure.EVENT_DOWNSAMPLENEEDED,this.handleDownsampleNeeded),this.figure.addEventListener(e.Client.EVENT_REQUEST_FAILED,this.handleRequestFailed)}stopListeningFigure(){var{dh:e}=this;this.figure.removeEventListener(e.plot.Figure.EVENT_UPDATED,this.handleFigureUpdated),this.figure.removeEventListener(e.plot.Figure.EVENT_SERIES_ADDED,this.handleFigureSeriesAdded),this.figure.removeEventListener(e.plot.Figure.EVENT_DISCONNECT,this.handleFigureDisconnected),this.figure.removeEventListener(e.plot.Figure.EVENT_RECONNECT,this.handleFigureReconnected),this.figure.removeEventListener(e.plot.Figure.EVENT_DOWNSAMPLESTARTED,this.handleDownsampleStart),this.figure.removeEventListener(e.plot.Figure.EVENT_DOWNSAMPLEFINISHED,this.handleDownsampleFinish),this.figure.removeEventListener(e.plot.Figure.EVENT_DOWNSAMPLEFAILED,this.handleDownsampleFail),this.figure.removeEventListener(e.plot.Figure.EVENT_DOWNSAMPLENEEDED,this.handleDownsampleNeeded),this.figure.removeEventListener(e.Client.EVENT_REQUEST_FAILED,this.handleRequestFailed)}handleDownsampleStart(e){R.debug("Downsample started",e),this.fireDownsampleStart(e.detail)}handleDownsampleFinish(e){R.debug("Downsample finished",e),this.fireDownsampleFinish(e.detail)}handleDownsampleFail(e){R.error("Downsample failed",e),this.fireDownsampleFail(e.detail)}handleDownsampleNeeded(e){R.info("Downsample needed",e),this.fireDownsampleNeeded(e.detail)}handleFigureUpdated(e){var{detail:t}=e,{series:r}=t;R.debug2("handleFigureUpdated",r);for(var n=0;n<r.length;n+=1){var a=r[n];R.debug2("handleFigureUpdated updating series",a.name);for(var{sources:o}=a,s=0;s<o.length;s+=1){var l=o[s],{columnType:u,type:c}=l,d=this.getValueTranslator(u,this.formatter),f=t.getArray(a,c,d);this.setDataArrayForSeries(a,c,f)}this.seriesToProcess.delete(a.name),this.cleanSeries(a)}this.seriesToProcess.size===0&&this.fireLoadFinished();var{data:m}=this;this.fireUpdate(m)}handleRequestFailed(e){R.error("Request failed",e),this.fireError(["".concat(e.detail)])}resubscribe(){this.listeners.length>0&&(this.unsubscribeFigure(),this.subscribeFigure())}setFormatter(e){super.setFormatter(e),this.updateLayoutFormats(),this.resubscribe()}setDownsamplingDisabled(e){super.setDownsamplingDisabled(e),this.resubscribe()}handleFigureDisconnected(e){R.debug("Figure disconnected",e),this.isConnected=!1,this.listeners.length>0&&this.unsubscribeFigure(),this.fireDisconnect()}handleFigureReconnected(e){R.debug("Figure reconnected",e),this.isConnected=!0,this.initAllSeries(),this.fireReconnect(),this.listeners.length>0&&this.subscribeFigure()}handleFigureSeriesAdded(e){var{detail:t}=e;R.debug("handleFigureSeriesAdded",t),this.pendingSeries.push(t),this.addPendingSeries()}setDimensions(e){super.setDimensions(e),this.updateAxisPositions()}setTitle(e){var t,r;super.setTitle(e);var n=(t=(r=(e??"").match(/<br>/g))===null||r===void 0?void 0:r.length)!==null&&t!==void 0?t:0,a=W.DEFAULT_MARGIN.t+n*W.SUBTITLE_LINE_HEIGHT;this.layout.margin?this.layout.margin.t=a:this.layout.margin={t:a},typeof this.layout.title=="string"?this.layout.title=e:(this.layout.title=Ie({},this.layout.title),this.layout.title.text=e,this.layout.title.pad=Ie({},this.layout.title.pad),this.layout.title.pad.t=W.DEFAULT_TITLE_PADDING.t+n*W.SUBTITLE_LINE_HEIGHT*.5)}getPlotWidth(){var e,t,r,n;return!this.rect||!this.rect.width?0:Math.max(this.rect.width-((e=(t=this.layout.margin)===null||t===void 0?void 0:t.l)!==null&&e!==void 0?e:0)-((r=(n=this.layout.margin)===null||n===void 0?void 0:n.r)!==null&&r!==void 0?r:0),0)}getPlotHeight(){var e,t,r,n;return!this.rect||!this.rect.height?0:Math.max(this.rect.height-((e=(t=this.layout.margin)===null||t===void 0?void 0:t.t)!==null&&e!==void 0?e:0)-((r=(n=this.layout.margin)===null||n===void 0?void 0:n.b)!==null&&r!==void 0?r:0),0)}updateAxisPositions(){var e=this.getPlotWidth(),t=this.getPlotHeight();this.chartUtils.updateFigureAxes(this.layout,this.figure,r=>this.getAxisRangeParser(r,this.formatter),e,t)}updateLayoutFormats(){if(this.formatter){var e=this.chartUtils.getAxisFormats(this.figure,this.formatter);e.forEach((t,r)=>{R.debug("Assigning ".concat(r),this.layout[r],t);var n=this.layout[r];n!=null?Object.assign(n,t):R.debug("Ignoring null layout.".concat(r))})}}setDataArrayForSeries(e,t,r){var{name:n,plotStyle:a}=e,o=this.seriesDataMap.get(n),s=this.chartUtils.getPlotlyProperty(a,t);o&&Le(o,s,r)}cleanSeries(e){var{dh:t}=this,{name:r,plotStyle:n}=e,a=this.seriesDataMap.get(r);if(a!=null){if(n===t.plot.SeriesPlotStyle.HISTOGRAM){var{xLow:o,xHigh:s}=a;if(o&&s&&o.length===s.length){for(var l=[],u=0;u<o.length;u+=1)l.push(s[u]-o[u]);a.width=l}}else if(n===t.plot.SeriesPlotStyle.LINE||n===t.plot.SeriesPlotStyle.ERROR_BAR||n===t.plot.SeriesPlotStyle.BAR){var{x:c,xLow:d,xHigh:f,y:m,yLow:p,yHigh:y}=a;d&&f&&d!==c&&(a.error_x=W.getPlotlyErrorBars(c,d,f)),p&&y&&p!==m&&(a.error_y=W.getPlotlyErrorBars(m,p,y))}else if(n===t.plot.SeriesPlotStyle.TREEMAP){var{ids:E,labels:S}=a;E!==void 0&&S===void 0&&(a.labels=E)}}}getData(){return this.data}getLayout(){return this.layout}getFilterColumnMap(){return new Map(this.filterColumnMap)}isFilterRequired(){return this.oneClicks.find(e=>e.requireAllFiltersToDisplay)!=null}setFilter(e){var t=this;if(this.oneClicks.length===0){R.warn("Trying to set a filter, but no one click!");return}R.debug("setFilter",e);for(var r=function(){var o=t.oneClicks[n],{columns:s}=o,l=new Set([...e.keys(),...t.lastFilter.keys()]);l.forEach(u=>{var c=e.get(u);t.lastFilter.get(u)!==c&&s.find(d=>d.name===u)!=null&&o.setValueForColumn(u,c)})},n=0;n<this.oneClicks.length;n+=1)r();this.lastFilter=new Map(e)}setFigure(e){this.close(),this.figure=e,this.setTitle(this.getDefaultTitle()),this.initAllSeries(),this.updateAxisPositions(),this.startListeningFigure(),this.listeners.length>0&&this.subscribeFigure()}updateSettings(e){this.settings=e}}F(ue,"ADD_SERIES_DEBOUNCE",50);const Ce=ue;function xe(i,e,t,r,n,a,o){try{var s=i[a](o),l=s.value}catch(u){t(u);return}s.done?e(l):Promise.resolve(l).then(r,n)}function de(i){return function(){var e=this,t=arguments;return new Promise(function(r,n){var a=i.apply(e,t);function o(l){xe(a,r,n,o,s,"next",l)}function s(l){xe(a,r,n,o,s,"throw",l)}o(void 0)})}}class ge{static makeModelFromSettings(e,t,r){return de(function*(){var n=yield ge.makeFigureFromSettings(e,t,r);return new Ce(e,n,t)})()}static makeFigureFromSettings(e,t,r){return de(function*(){var n=yield r.copy();return n.applyCustomColumns(r.customColumns),n.applyFilter(r.filter),n.applySort(r.sort),e.plot.Figure.create(new W(e).makeFigureSettings(t,n))})()}static makeModel(e,t,r){return de(function*(){return new Ce(e,r,t)})()}}const Dr=ge;var Xt=Z.createContext(null);function br(){return Ve(Xt,"No IdeConnection available in useConnection. Was code wrapped in ConnectionContext.Provider?")}export{Ut as A,Tr as B,cr as C,x as D,Jt as E,ar as F,Qt as G,ce as H,ir as I,nr as J,or as K,Nr as L,er as M,Se as N,Kt as O,he as P,W as Q,Ce as R,lr as S,ke as T,Re as U,sr as V,Zt as W,nt as X,Xt as Y,ae as Z,mr as _,dr as a,Dr as b,Ve as c,$ as d,lt as e,tr as f,rr as g,v as h,ur as i,h as j,hr as k,Be as l,Nt as m,je as n,gr as o,yr as p,fr as q,vr as r,pr as s,yt as t,br as u,Er as v,Sr as w,Dt as x,bt as y,Ar as z};
2
+ //# sourceMappingURL=useConnection-8d5cefb1.js.map