@deephaven/code-studio 0.81.3-query-status-cell.0 → 0.82.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/build/assets/{AppRoot-51761687.js → AppRoot-b86b5a1a.js} +3 -3
  2. package/build/assets/{AppRoot-51761687.js.map → AppRoot-b86b5a1a.js.map} +1 -1
  3. package/build/assets/{Chart-3e589767.js → Chart-94870ac9.js} +2 -2
  4. package/build/assets/{Chart-3e589767.js.map → Chart-94870ac9.js.map} +1 -1
  5. package/build/assets/{ControlType-3adc6202.js → ControlType-9276572c.js} +3 -3
  6. package/build/assets/{ControlType-3adc6202.js.map → ControlType-9276572c.js.map} +1 -1
  7. package/build/assets/{FontBootstrap-e868d6a4.js → FontBootstrap-a1193f02.js} +2 -2
  8. package/build/assets/{FontBootstrap-e868d6a4.js.map → FontBootstrap-a1193f02.js.map} +1 -1
  9. package/build/assets/{FormatterUtils-5e93ef76.js → FormatterUtils-2be601fb.js} +2 -2
  10. package/build/assets/{FormatterUtils-5e93ef76.js.map → FormatterUtils-2be601fb.js.map} +1 -1
  11. package/build/assets/{Grid-e3de940b.js → Grid-ccd563c5.js} +2 -2
  12. package/build/assets/{Grid-e3de940b.js.map → Grid-ccd563c5.js.map} +1 -1
  13. package/build/assets/GridRenderer-fd5bd825.js +2 -0
  14. package/build/assets/GridRenderer-fd5bd825.js.map +1 -0
  15. package/build/assets/{IrisGrid-33960f2e.js → IrisGrid-7d43963c.js} +3 -3
  16. package/build/assets/IrisGrid-7d43963c.js.map +1 -0
  17. package/build/assets/IrisGridModel-99a22f44.js +2 -0
  18. package/build/assets/IrisGridModel-99a22f44.js.map +1 -0
  19. package/build/assets/{IrisGridShortcuts-7171dfff.js → IrisGridShortcuts-a3f84fda.js} +2 -2
  20. package/build/assets/{IrisGridShortcuts-7171dfff.js.map → IrisGridShortcuts-a3f84fda.js.map} +1 -1
  21. package/build/assets/{IrisGridThemeProvider-a45e588b.js → IrisGridThemeProvider-8dc353b1.js} +2 -2
  22. package/build/assets/{IrisGridThemeProvider-a45e588b.js.map → IrisGridThemeProvider-8dc353b1.js.map} +1 -1
  23. package/build/assets/{MarkdownEditor-6215d9db.js → MarkdownEditor-8329e53b.js} +2 -2
  24. package/build/assets/{MarkdownEditor-6215d9db.js.map → MarkdownEditor-8329e53b.js.map} +1 -1
  25. package/build/assets/{MarkdownNotebook-36d11456.js → MarkdownNotebook-5c2380ae.js} +2 -2
  26. package/build/assets/{MarkdownNotebook-36d11456.js.map → MarkdownNotebook-5c2380ae.js.map} +1 -1
  27. package/build/assets/{MissingPartitionError-eacf8b0d.js → MissingPartitionError-089ed0e2.js} +2 -2
  28. package/build/assets/{MissingPartitionError-eacf8b0d.js.map → MissingPartitionError-089ed0e2.js.map} +1 -1
  29. package/build/assets/{StyleGuideRoot-3bfb983e.js → StyleGuideRoot-ca3a3686.js} +2 -2
  30. package/build/assets/{StyleGuideRoot-3bfb983e.js.map → StyleGuideRoot-ca3a3686.js.map} +1 -1
  31. package/build/assets/{index-b6e1b25d.js → index-c6f58d55.js} +2 -2
  32. package/build/assets/{index-b6e1b25d.js.map → index-c6f58d55.js.map} +1 -1
  33. package/build/assets/{index-bc0db8fa.js → index-cbe9b319.js} +6 -6
  34. package/build/assets/index-cbe9b319.js.map +1 -0
  35. package/build/assets/index-dd81a1cd.js +2 -0
  36. package/build/assets/index-dd81a1cd.js.map +1 -0
  37. package/build/assets/{useUser-7cf5ce1f.js → useUser-6daef947.js} +2 -2
  38. package/build/assets/{useUser-7cf5ce1f.js.map → useUser-6daef947.js.map} +1 -1
  39. package/build/index.html +2 -2
  40. package/package.json +30 -30
  41. package/build/assets/GridRenderer-60ee6d2a.js +0 -2
  42. package/build/assets/GridRenderer-60ee6d2a.js.map +0 -1
  43. package/build/assets/IrisGrid-33960f2e.js.map +0 -1
  44. package/build/assets/IrisGridModel-1899c8d1.js +0 -2
  45. package/build/assets/IrisGridModel-1899c8d1.js.map +0 -1
  46. package/build/assets/index-0178e84d.js +0 -2
  47. package/build/assets/index-0178e84d.js.map +0 -1
  48. package/build/assets/index-bc0db8fa.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{r as d,I as c,ba as Ne,ag as $e,K as L,M as A,L as K,J as ke,V as R,bb as Ke,bc as We,bd as Fe,af as Be,Z,$ as Ue,b2 as ze}from"./vendor-4601e84c.js";import{a_ as He,t as I,P as ae,aR as Ve,B as G,al as Ge,u as qe,aI as W,b5 as Xe,bF as Ye,cc as Je,bI as Qe,bK as Ze,cd as et,ab as tt,$ as nt,_ as rt,c3 as it,c5 as oe,aC as at,b4 as ot,b3 as st,a8 as ut}from"./ControlType-3adc6202.js";import{M as lt,c as ct,L as ee,I as dt,j as ft,ag as ht,ah as vt,H as te}from"./index-b6e1b25d.js";import{a as se}from"./IrisGridShortcuts-7171dfff.js";function pt(t){var e=t;t instanceof CustomEvent&&(e=t.detail);var n="";if(e instanceof Error?n=e.message:e!=null&&(n="".concat(e)),n=n.trim(),n.length>0)return n}function Me(t,e){d.useEffect(()=>{if(t!=null){var n=new window.ResizeObserver(e);return n.observe(t),()=>{t!=null&&n.unobserve(t)}}},[t,e])}function gt(t,e){var[n,r]=d.useState(!0),[i,a]=d.useState(t),[s,o]=d.useState(t),[u,l]=d.useState(e);return(t!==s||e!==u)&&(r(!0),o(t),l(e)),d.useEffect(()=>{var m=!1,v=setTimeout(()=>{m||(r(!1),a(t))},e);return()=>{m=!0,clearTimeout(v)}},[t,e]),{isDebouncing:n,value:i}}function jn(){var{selectedThemeKey:t,setSelectedThemeKey:e,themes:n}=He(),r=d.useCallback(i=>{e(i)},[e]);return c.jsx(Ne,{label:"Pick a color scheme",items:n,selectedKey:t,onSelectionChange:r,children:i=>c.jsx($e,{children:i.name},i.themeKey)})}function In(t){var{className:e,style:n}=t;return c.jsx("div",{className:L("dh-logo",e),style:n})}function Ln(t){var{blockInteraction:e=!0,children:n,debounceMs:r,isOpen:i=!1}=t,{value:a}=gt(i,r);return c.jsxs(c.Fragment,{children:[e&&i&&c.jsx("div",{className:"modal-backdrop",style:{backgroundColor:"transparent"},"data-testid":"debounced-modal-backdrop"}),A.cloneElement(n,{isOpen:i&&a})]})}function Tn(t){var{className:e,icon:n,isOpen:r=!1,subtitle:i,title:a}=t;return c.jsx(lt,{isOpen:r,className:e,children:c.jsx(ct,{children:c.jsxs("div",{className:"info-modal",children:[n!=null&&c.jsx("div",{className:"message-icon",children:c.jsx(K,{icon:n})}),c.jsx("div",{className:"message-header",children:a}),i!=null&&c.jsx("div",{className:"message-content",children:i})]})})})}function ue(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function mt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ue(Object(n),!0).forEach(function(r){j(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ue(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function j(t,e,n){return e=bt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bt(t){var e=yt(t,"string");return typeof e=="symbol"?e:String(e)}function yt(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var le=ee.module("ContextMenu");class N extends d.PureComponent{static handleContextMenu(e){e.metaKey||(e.stopPropagation(),e.preventDefault())}constructor(e){super(e),j(this,"container",void 0),j(this,"oldFocus",void 0),j(this,"activeSubMenuRef",void 0),j(this,"subMenuTimer",void 0),j(this,"rAF",void 0),j(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=A.createRef(),this.oldFocus=document.activeElement,this.activeSubMenuRef=A.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:n}=this.props;n(this)})}componentDidUpdate(e,n){var{actions:r}=this.props,{activeSubMenu:i}=this.state;if(i!==n.activeSubMenu)if(i==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 s;(s=this.container.current)===null||s===void 0||s.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:n}=this.state;return n}return this.getMouseIndex()}setKeyboardIndex(e){var{options:n}=this.props;n.separateKeyboardMouse!==void 0&&n.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,n=e.initialKeyboardIndex;n===void 0&&(n=-1);for(var{actions:r}=this.props,i=I.getMenuItems(r),a=[],s=i.length-1;s>=0;s-=1){var o=i[s];o instanceof Promise?this.initMenuPromise(o):a.push(o)}this.setState({mouseIndex:-1,keyboardIndex:n,activeSubMenu:null,menuItems:I.sortActions(a)})}initMenuPromise(e){var n=ae.makeCancelable(e);this.setState(r=>({pendingItems:r.pendingItems.concat(n)})),n.then(r=>{this.setState(i=>{var a=i.pendingItems.indexOf(n);if(a>=0){var s=i.pendingItems.slice();return s.splice(a,1),{menuItems:I.sortActions(i.menuItems.concat(r)),pendingItems:s}}return null})},r=>{ae.isCanceled(r)||(this.setState(i=>{var a=i.pendingItems.indexOf(n);if(a>=0){var s=i.pendingItems.slice();return s.splice(a,1),{pendingItems:s}}return null}),le.error(r))})}cancelPromises(){var{pendingItems:e}=this.state;e.map(n=>n.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,n,r,i,{options:a,updatePosition:s,subMenuParentWidth:o,subMenuParentHeight:u,top:l,left:m}=this.props;if(!(!this.container.current||a.doNotVerifyPosition!=null&&a.doNotVerifyPosition)){var{top:v,left:b}=this.initialPosition,{width:y,height:g}=(e=(n=this.container.current)===null||n===void 0?void 0:n.getBoundingClientRect())!==null&&e!==void 0?e:{width:0,height:0},x=((r=(i=this.container.current)===null||i===void 0?void 0:i.scrollHeight)!==null&&r!==void 0?r:0)>window.innerHeight;g===0||y===0||(v+g>window.innerHeight&&(v-g-u>0?v-=g-u:v=window.innerHeight-g),b+y>window.innerWidth&&(b=b-y-o),(m!==b||l!==v)&&(this.setState({hasOverflow:x}),s(v,b)))}}handleWindowResize(){this.container.current&&this.closeMenu(!0)}handleBlur(e){if(!this.container.current){le.warn("Container is null!");return}if(!this.container.current.contains(e.relatedTarget)){for(var n=e.relatedTarget,r=!1;n&&!r;)r=n.hasAttribute("data-dh-context-menu"),n=n.parentElement;r||this.closeMenu(!0)}}isEscapeKey(e){var{left:n}=this.props;return e==="Escape"||n<0&&e==="ArrowRight"||e==="ArrowLeft"}handleKeyDown(e){var{menuItems:n}=this.state,r=this.getKeyboardIndex(),i=r,a=!1;if(e.key==="Enter"||e.key===" "){r>=0&&r<n.length&&this.handleMenuItemClick(n[r],e);return}if(e.key==="ArrowRight"?r>=0&&r<=n.length?a=!0:i=0:this.isEscapeKey(e.key)?i=null:e.key==="ArrowUp"||e.shiftKey&&e.key==="Tab"?i=I.getNextMenuItem(i,-1,n):(e.key==="ArrowDown"||e.key==="Tab")&&(i=I.getNextMenuItem(i,1,n)),a){this.openSubMenu(r),e.preventDefault(),e.stopPropagation();return}r!==i&&(i!==null?this.setKeyboardIndex(i):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}openSubMenu(e){var{menuItems:n,activeSubMenu:r}=this.state,i=n[e].actions?e:null;r!==i&&this.setState({activeSubMenu:i,subMenuTop:null,subMenuLeft:null})}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,{closeMenu:n,onMenuClosed:r}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{n(e),r(this)})}closeSubMenu(){this.setState({activeSubMenu:null})}handleCloseSubMenu(e){e?this.closeMenu(!0):this.closeSubMenu()}handleMenuItemClick(e,n){n.preventDefault(),n.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(n.nativeEvent),this.closeMenu(!0)))}handleMenuItemContextMenu(e,n){n.metaKey||this.handleMenuItemClick(e,n)}handleMenuItemMouseMove(e){var{menuItems:n}=this.state,r=n.indexOf(e);this.setMouseIndex(r),r>=0&&r<n.length&&(e.disabled===void 0||!e.disabled)&&this.openSubMenu(r)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{top:n,left:r}=this.props,{activeSubMenu:i,hasOverflow:a,keyboardIndex:s,menuItems:o,mouseIndex:u,pendingItems:l,subMenuTop:m,subMenuLeft:v,subMenuParentWidth:b,subMenuParentHeight:y}=this.state,g=0;g<o.length;g+=1){var x=o[g];g>0&&x.group!==o[g-1].group&&e.push(c.jsx("hr",{},"".concat(g,".separator")));var p=c.jsx(Ve,{ref:i===g?this.activeSubMenuRef:null,isKeyboardSelected:s===g,isMouseSelected:u===g,menuItem:x,closeMenu:this.handleCloseSubMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:this.handleMenuItemContextMenu},g);e.push(p)}var S=null;l.length>0&&(S=c.jsx("div",{className:"loading",children:c.jsx(dt,{className:"loading-spinner-vertical-align"})}));var{menuStyle:_,"data-testid":$}=this.props,M=i!==null&&m!==null&&v!==null;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:L({"has-overflow":a},"context-menu-container"),style:mt({top:n,left:r},_),ref:this.container,"data-dh-context-menu":!0,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,onContextMenu:N.handleContextMenu,role:"menuitem",tabIndex:0,"data-testid":$,children:[e,S]}),M&&i!==null&&m!==null&&v!==null&&c.jsx(N,{actions:o[i].actions||[],closeMenu:this.handleCloseSubMenu,top:m,left:v,updatePosition:(C,D)=>{this.setState({subMenuTop:C,subMenuLeft:D})},subMenuParentWidth:b,subMenuParentHeight:y},"sub-".concat(i))]})}}j(N,"defaultProps",{subMenuParentWidth:0,subMenuParentHeight:0,closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});const wt=N;function ce(t,e,n){return e=Pt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Pt(t){var e=St(t,"string");return typeof e=="symbol"?e:String(e)}function St(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Ct extends d.Component{constructor(e){super(e),ce(this,"container",void 0),ce(this,"openMenu",void 0),this.handleMenuClose=this.handleMenuClose.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.container=A.createRef(),this.openMenu=A.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 n=this.container.current.getBoundingClientRect(),r=e.clientY-n.top,i=e.clientX-n.left,{actions:a}=this.state;if(a!=null&&e.target===this.container.current){e.preventDefault(),this.setState({actions:null},()=>{var o=document.elementFromPoint(i,r),u=new MouseEvent("contextmenu",{clientX:e.clientX,clientY:e.clientY,bubbles:!0,cancelable:!0});o?.dispatchEvent(u)});return}if(I.isContextActionEvent(e)&&!(e.metaKey||e.ctrlKey)){var s=I.getMenuItems(e.contextActions);s.length!==0&&(e.preventDefault(),this.setState({actions:s,top:r,left:i}))}}}handleMenuClose(e){e===this.openMenu.current&&this.setState({actions:null})}render(){var e=null,{"data-testid":n}=this.props,{actions:r,top:i,left:a}=this.state;return r&&(e=c.jsx(wt,{ref:this.openMenu,actions:r,onMenuClosed:this.handleMenuClose,top:i,left:a,updatePosition:(s,o)=>{this.setState({top:s,left:o})},"data-testid":n})),c.jsx("div",{className:L("context-menu-root",{active:r}),ref:this.container,children:e})}}const An=Ct;function Oe(t,e,n){return e=xt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xt(t){var e=Mt(t,"string");return typeof e=="symbol"?e:String(e)}function Mt(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class E extends d.Component{static handleEnter(e){var n=e;n.style.height="0"}static handleEntering(e){var n=e;n.style.height="".concat(E.getHeight(n),"px")}static handleExiting(e){var n=e;n.style.height="0"}static handleExit(e){var n=e;n.style.height="".concat(E.getHeight(n),"px")}static getHeight(e){var n=e.scrollWidth-e.clientWidth;return e.scrollHeight-n}constructor(e){super(e),this.handleEntered=this.handleEntered.bind(this)}handleEntered(e){var n=e;n.style.height="";var{autoFocusOnShow:r}=this.props;if(r!==void 0&&r){var i=n.querySelector("input, select, textarea");i?.focus()}}render(){var{children:e,className:n,in:r,"data-testid":i}=this.props;return c.jsx(ke,{in:r,classNames:{enterActive:"collapsing",enterDone:"collapse show",exitActive:"collapsing",exitDone:"collapse"},onEnter:E.handleEnter,onEntering:E.handleEntering,onEntered:this.handleEntered,onExit:E.handleExit,onExiting:E.handleExiting,timeout:350,children:a=>c.jsx("div",{className:L({collapse:a==="exited"},n),"data-testid":i,children:e})})}}Oe(E,"propTypes",{className:R.string,in:R.bool.isRequired,children:R.node.isRequired,autoFocusOnShow:R.bool,"data-testid":R.string});Oe(E,"defaultProps",{className:"",autoFocusOnShow:!1,"data-testid":void 0});const _n=E;function de(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function z(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?de(Object(n),!0).forEach(function(r){Ot(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):de(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Ot(t,e,n){return e=Et(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Et(t){var e=Dt(t,"string");return typeof e=="symbol"?e:String(e)}function Dt(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Ee=d.memo(t=>{var{tab:e,onClose:n,onSelect:r,isActive:i,activeRef:a,index:s,isDraggable:o,contextActions:u}=t,{key:l,isClosable:m=n!=null,title:v,icon:b}=e,y;return b!=null&&(y=A.isValidElement(b)?b:c.jsx(K,{icon:b})),c.jsx(Ke,{draggableId:l,index:s,isDragDisabled:!o,children:(g,x)=>c.jsxs("div",{className:"context-menu-wrapper",ref:i?a:null,children:[c.jsxs("div",z(z(z({ref:g.innerRef},g.draggableProps),g.dragHandleProps),{},{className:L("btn btn-link btn-nav-tab",{active:i},{dragging:x.isDragging}),"data-testid":"btn-nav-tab-".concat(v),role:"tab",tabIndex:0,onAuxClick:p=>{m&&p.button===1&&p.buttons===0&&n?.(l)},onClick:p=>{if(m&&p.button===1&&p.buttons===0){n?.(l);return}p.button===0&&p.buttons===0&&(p.target.focus(),r(l))},onKeyPress:p=>{p.key==="Enter"&&r(l)},children:[y,v,m&&c.jsx(G,{kind:"ghost",className:"btn-nav-tab-close",onClick:p=>{n?.(l),p.stopPropagation(),p.preventDefault()},icon:ft,tooltip:"Close"})]})),c.jsx(Ge,{actions:u})]})},l)});Ee.displayName="NavTab";const jt=Ee;function fe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function he(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?fe(Object(n),!0).forEach(function(r){It(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):fe(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function It(t,e,n){return e=Lt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Lt(t){var e=Tt(t,"string");return typeof e=="symbol"?e:String(e)}function Tt(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var At=500,_t=.01,Rt=5e-4;function ve(t){return t.scrollLeft===0}function pe(t){return t.scrollLeft+t.clientWidth===t.scrollWidth||t.scrollWidth===0}function Nt(t,e,n){var{isClosable:r=!1,key:i}=t,a=[];if(r&&n!=null){a.push({title:"Close",order:10,group:20,action:()=>{n(i)}});for(var s=!0,o=e.length-1;o>0&&e[o].key!==t.key;o-=1)if(e[o].isClosable===!0){s=!1;break}a.push({title:"Close to the Right",order:20,group:20,action:()=>{for(var u=e.length-1;u>0&&e[u].key!==i;u-=1)e[u].isClosable===!0&&n(e[u].key)},disabled:s}),a.push({title:"Close All",order:30,group:20,action:()=>{e.forEach(u=>{u.isClosable===!0&&n(u.key)})}})}return a}function Rn(t){var{activeKey:e,tabs:n,onSelect:r,onReorder:i,onClose:a,makeContextActions:s}=t,o=d.useRef(),[u,l]=d.useState(!0),[m,v]=d.useState(!0),[b,y]=d.useState(!0),g=d.useCallback(()=>{o.current!=null&&(o.current.clientWidth<o.current.scrollWidth&&n.length>0?l(!0):l(!1),v(ve(o.current)),y(pe(o.current)))},[n]);Me(o.current,g);var x=d.useCallback(f=>{se.stopDragging(),f.destination&&i?.(f.source.index,f.destination.index)},[i]),p=d.useCallback(()=>{if(o.current!=null){var f=ve(o.current);f!==m&&v(f);var h=pe(o.current);h!==b&&y(h)}},[m,b]),S=d.useRef({cancelClick:!1}),_=d.useCallback(()=>{if(!(o.current==null||S.current.cancelClick))for(var{children:f}=o.current,h=f.length-1;h>=0;h-=1){var w=f[h];if(w.offsetLeft<o.current.scrollLeft-5){w.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"});return}}},[]),$=d.useCallback(()=>{if(!(o.current==null||S.current.cancelClick))for(var{children:f}=o.current,h=0;h<f.length;h+=1){var w=f[h];if(w.offsetLeft+5>o.current.scrollLeft+o.current.offsetWidth){w.scrollIntoView({behavior:"smooth",block:"nearest",inline:"end"});return}}},[]),M=d.useCallback(function(f,h){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,P=arguments.length>3?arguments[3]:void 0,O=o.current;O!=null&&(S.current.cancelClick=!0,f==="left"?O.scrollLeft=h-w:f==="right"&&(O.scrollLeft=h+w),S.current.rAF=requestAnimationFrame(k=>{var re=P??k,ie=k-re,U=_t*ie+.5*Rt*ie**2;U=Math.min(U,O.scrollWidth),M(f,h,U,re)}))},[]),C=d.useCallback(()=>{var{holdTimer:f,rAF:h}=S.current;f!=null&&(clearTimeout(f),S.current.holdTimer=void 0),h!=null&&(cancelAnimationFrame(h),S.current.rAF=void 0),window.removeEventListener("mouseup",C)},[]);d.useEffect(()=>()=>window.removeEventListener("mouseup",C),[C]);var D=d.useCallback(f=>{o.current!=null&&(S.current.holdTimer=window.setTimeout(M,At,f,o.current.scrollLeft)),S.current.cancelClick=!1,window.addEventListener("mouseup",C)},[C,M]),Le=d.useCallback(()=>{D("left")},[D]),Te=d.useCallback(()=>{D("right")},[D]);d.useEffect(function(){var h,w=P=>{P.stopPropagation(),P.preventDefault();var O=P.currentTarget,k=Math.abs(P.deltaY)>Math.abs(P.deltaX)?P.deltaY:P.deltaX;O.scrollLeft+=Be(k,-30,30)};return(h=o.current)===null||h===void 0||h.addEventListener("wheel",w),()=>{var P;(P=o.current)===null||P===void 0||P.removeEventListener("wheel",w)}},[]);var Ae=d.useMemo(()=>{var f=new Map;return n.forEach(h=>{var{key:w}=h,P=[()=>Nt(h,n,a),()=>{var O;return(O=s?.(h))!==null&&O!==void 0?O:[]}];f.set(w,P)}),f},[s,n,a]),B=d.useRef(null),_e=n.find(f=>f.key===e),Re=n.map((f,h)=>{var{key:w}=f,P=f===_e;return c.jsx(jt,{tab:f,index:h,isActive:P,activeRef:B,onSelect:r,onClose:a,isDraggable:i!=null,contextActions:Ae.get(w)},w)});return d.useEffect(function(){B.current!=null&&B.current.scrollIntoView({block:"nearest",inline:"nearest"})},[e]),c.jsxs("nav",{className:"nav-container",children:[u&&c.jsx(G,{kind:"ghost",icon:c.jsx(K,{icon:ht,transform:"grow-4"}),className:"tab-controls-btn tab-controls-btn-left",tooltip:"Scroll left",onClick:_,onMouseDown:Le,disabled:m}),c.jsx(We,{onDragStart:se.startDragging,onDragEnd:x,children:c.jsx(Fe,{droppableId:"droppable-tab-navigation",direction:"horizontal",children:(f,h)=>c.jsxs("div",he(he({ref:w=>{w!=null&&(o.current=w,f.innerRef(w))}},f.droppableProps),{},{className:L("nav nav-tabs",{dragging:h.draggingFromThisWith}),role:"tablist",onScroll:p,children:[Re,f.placeholder]}))})}),u&&c.jsx(G,{kind:"ghost",icon:c.jsx(K,{icon:vt,transform:"grow-4"}),className:"tab-controls-btn tab-controls-btn-right",tooltip:"Scroll right",onClick:$,onMouseDown:Te,disabled:b})]})}function $t(t,e){var n=qe(),r=d.useMemo(()=>new n.CoreClient(t,e),[n,t,e]);return d.useEffect(()=>()=>{r.disconnect()},[r]),r}var De=d.createContext(null);function Nn(t){var{serverUrl:e,options:n,children:r}=t,i=$t(e,n);return c.jsx(De.Provider,{value:i,children:r})}function kt(){return W(De,"No Client available in useClient. Was code wrapped in ClientBootstrap or ClientContext.Provider?")}function ge(t,e,n,r,i,a,s){try{var o=t[a](s),u=o.value}catch(l){n(l);return}o.done?e(u):Promise.resolve(u).then(r,i)}function Kt(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var a=t.apply(e,n);function s(u){ge(a,r,i,s,o,"next",u)}function o(u){ge(a,r,i,s,o,"throw",u)}s(void 0)})}}var H=ee.module("MessageUtils"),$n="io.deephaven.message.LoginOptions.request",Wt="io.deephaven.message.SessionDetails.request",kn="io.deephaven.broadcast",Ft="io.deephaven.broadcast.Login",Bt="io.deephaven.broadcast.Logout";function je(t){var e=t;return e!=null&&typeof e.id=="string"&&typeof e.message=="string"}function Kn(t){return je(t)&&t.message===Ft}function Wn(t){return je(t)&&t.message===Bt}function Ut(t){var e=t;return e!=null&&typeof e.id=="string"}function zt(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Z(),n=arguments.length>2?arguments[2]:void 0;return{message:t,id:e,payload:n}}function Fn(t,e){return{id:t,payload:e}}function Ht(){return window.opener!=null?window.opener:window.parent!=null&&window.parent!==window?window.parent:null}function Vt(t){return q.apply(this,arguments)}function q(){return q=Kt(function*(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3e4,n=Ht();if(n==null)throw new Error("window parent is null, unable to send request.");return new Promise((r,i)=>{var a,s=Z(),o=u=>{var{data:l}=u;if(!Ut(l)){H.debug("Ignoring non-deephaven response",l);return}if(H.debug("Received message",l),l?.id!==s){H.debug("Ignore message, id doesn't match",l);return}window.clearTimeout(a),window.removeEventListener("message",o),r(l.payload)};window.addEventListener("message",o),a=window.setTimeout(()=>{window.removeEventListener("message",o),i(new Xe("Request timed out"))},e),n.postMessage(zt(t,s),"*")})}),q.apply(this,arguments)}function Gt(t,e,n){return e=qt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qt(t){var e=Xt(t,"string");return typeof e=="symbol"?e:String(e)}function Xt(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Yt extends Error{constructor(){super(...arguments),Gt(this,"isNoConsolesError",!0)}}function Jt(t){return t.isNoConsolesError}function me(t,e,n,r,i,a,s){try{var o=t[a](s),u=o.value}catch(l){n(l);return}o.done?e(u):Promise.resolve(u).then(r,i)}function F(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var a=t.apply(e,n);function s(u){me(a,r,i,s,o,"next",u)}function o(u){me(a,r,i,s,o,"throw",u)}s(void 0)})}}var T=ee.module("SessionUtils");function Bn(t,e){return T.info("Starting connection to '".concat(e,"'...")),new t.IdeConnection(e)}function Qt(t,e,n){return X.apply(this,arguments)}function X(){return X=F(function*(t,e,n){T.info("Getting console types...");var r=yield e.getConsoleTypes();if(r.length===0)throw new Yt("No console types available");T.info("Available types:",r);var i=r[0];T.info("Starting session with type",i);var a=yield e.startSession(i),s={type:i,id:Z()};return T.info("Console session established",s),{session:a,config:s,connection:e,details:n,dh:t}}),X.apply(this,arguments)}function Un(t,e,n){return T.info("createCoreClient",e),new t.CoreClient(e,n)}function Zt(t){return t!=null&&typeof t=="object"}function en(){return Y.apply(this,arguments)}function Y(){return Y=F(function*(){var t=yield Vt(Wt);if(!Zt(t))throw new Error("Unexpected session details response: ".concat(t));return t}),Y.apply(this,arguments)}function zn(){return J.apply(this,arguments)}function J(){return J=F(function*(){var t=new URLSearchParams(window.location.search);switch(t.get("authProvider")){case"parent":return en()}return{}}),J.apply(this,arguments)}function Hn(t,e,n){return Q.apply(this,arguments)}function Q(){return Q=F(function*(t,e,n){var r;try{r=yield Qt(t,e,n)}catch(i){if(!Jt(i))throw i}return r}),Q.apply(this,arguments)}function be(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function tn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?be(Object(n),!0).forEach(function(r){nn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):be(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function nn(t,e,n){return e=rn(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rn(t){var e=an(t,"string");return typeof e=="symbol"?e:String(e)}function an(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var on=100,V=()=>{},sn=Object.freeze({});function un(t){var{id:e="default",children:n,emptyDashboard:r,layoutConfig:i,layoutSettings:a=sn,onLayoutConfigChange:s=V,onGoldenLayoutChange:o=V,onLayoutInitialized:u=V,fallbackComponent:l=et,hydrate:m,dehydrate:v,panelWrapper:b}=t,y=d.useRef(null),[g,x]=d.useState(!1),[p,S]=d.useState();d.useEffect(function(){if(!y.current){S(void 0);return}var M=tn({},Ye.makeDefaultLayout());M.settings===void 0&&(M.settings={}),Object.assign(M.settings,a),M.content=[];var C=new Je(M,y.current),D=()=>{C.off("initialised",D),x(!0)};return C.on("initialised",D),l!=null&&C.setFallbackComponent(l),C.init(),S(C),o(C),()=>{C.destroy()}},[a,l,o,x,S]);var _=d.useMemo(()=>Ue(()=>{p!=null&&p.isInitialised&&p?.updateSize()},on),[p]);return Me(y.current,_),c.jsxs("div",{className:"dashboard-container w-100 h-100",children:[c.jsx("div",{className:"w-100 h-100",ref:y}),g&&p&&c.jsx(Qe.Provider,{value:p,children:c.jsx(Ze,{emptyDashboard:r,id:e,layout:p,layoutConfig:i,onLayoutChange:s,onLayoutInitialized:u,hydrate:m,dehydrate:v,panelWrapper:b,children:n})})]})}var ne="CREATE_DASHBOARD";function ln(t,e){try{t.off(ne,e)}catch{}}function Vn(t,e){return t.on(ne,e),()=>ln(t,e)}function Gn(t,e){t.emit(ne,e)}var cn=["id","isActive","plugins"];function ye(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function we(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ye(Object(n),!0).forEach(function(r){dn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ye(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function dn(t,e,n){return e=fn(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fn(t){var e=hn(t,"string");return typeof e=="symbol"?e:String(e)}function hn(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function vn(t,e){if(t==null)return{};var n=pn(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function pn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function gn(t){var{id:e,isActive:n,plugins:r}=t,i=vn(t,cn),[a,s]=d.useState(n),o=ze(),u=d.useCallback(l=>{o(e===tt?nt({layoutConfig:l}):rt(e,{layoutConfig:l}))},[e,o]);return!a&&n&&s(!0),a?c.jsx(un,we(we({id:e,onLayoutConfigChange:u},i),{},{children:r})):c.jsx(te,{})}function mn(t){var e=[...t.entries()].filter(n=>{var[,r]=n;return it(r)||oe(r)});return e.map(n=>{var[r,i]=n;if(oe(i)){var{DashboardPlugin:a}=i;return c.jsx(a,{},r)}var{component:s}=i;return c.jsx(s,{},r)})}function qn(){var t=at(),e=d.useMemo(()=>mn(t),[t]);return e}var Xn=d.createContext({}),Yn=d.createContext({}),bn=d.createContext(null),yn=d.createContext(null);function Pe(t,e,n,r,i,a,s){try{var o=t[a](s),u=o.value}catch(l){n(l);return}o.done?e(u):Promise.resolve(u).then(r,i)}function wn(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var a=t.apply(e,n);function s(u){Pe(a,r,i,s,o,"next",u)}function o(u){Pe(a,r,i,s,o,"throw",u)}s(void 0)})}}var Ie=d.createContext(null);function Jn(t){var{children:e}=t,n=kt(),[r,i]=d.useState(),[a,s]=d.useState();d.useEffect(function(){var l=!1;function m(){return v.apply(this,arguments)}function v(){return v=wn(function*(){try{var b=yield n.getServerConfigValues();l||i(new Map(b))}catch(y){l||s(y)}}),v.apply(this,arguments)}return m(),()=>{l=!0}},[n]);var o=r==null;return o||a!=null?c.jsx(te,{isLoading:o&&a==null,errorMessage:pt(a)}):c.jsx(Ie.Provider,{value:r,children:e})}function Qn(){return W(Ie,"No server config available in useServerConfig. Was code wrapped in ServerConfigBootstrap or ServerConfigContext.Provider?")}function Se(t,e,n,r,i,a,s){try{var o=t[a](s),u=o.value}catch(l){n(l);return}o.done?e(u):Promise.resolve(u).then(r,i)}function Pn(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var a=t.apply(e,n);function s(u){Se(a,r,i,s,o,"next",u)}function o(u){Se(a,r,i,s,o,"throw",u)}s(void 0)})}}function Ce(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function xe(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Ce(Object(n),!0).forEach(function(r){Sn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ce(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Sn(t,e,n){return e=Cn(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Cn(t){var e=xn(t,"string");return typeof e=="symbol"?e:String(e)}function xn(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Zn(t){var{dashboards:e,activeDashboard:n,onLayoutInitialized:r,onGoldenLayoutChange:i,plugins:a,emptyDashboard:s=c.jsx(te,{})}=t,o=ot(),u=d.useCallback((l,m)=>{var{metadata:v}=l;try{if(v!=null){var b=st(v);return xe(xe({fetch:function(){var y=Pn(function*(){return o(b)});function g(){return y.apply(this,arguments)}return g}()},l),{},{localDashboardId:m})}}catch{}return ut.hydrate(l,m)},[o]);return c.jsx("div",{className:"tab-content",children:e.map(l=>c.jsx("div",{className:L("tab-pane",{active:l.id===n}),children:c.jsx(gn,{id:l.id,isActive:l.id===n,emptyDashboard:s,layoutConfig:l.layoutConfig,layoutSettings:l.layoutSettings,onLayoutInitialized:r,onGoldenLayoutChange:i,hydrate:u,plugins:a},l.key)},l.id))})}function er(){return W(yn,"No IdeConnection available in useConnection. Was code wrapped in ConnectionContext.Provider?")}function tr(){return W(bn,"No user available in useUser. Was code wrapped in UserBootstrap or UserContext.Provider?")}export{Zn as A,kn as B,_n as C,Ln as D,Jt as E,Ut as F,Fn as G,Vt as H,Tn as I,un as J,ne as K,In as L,gn as M,Rn as N,Gn as O,qn as P,pt as Q,bn as R,Wt as S,jn as T,Yn as U,Xn as V,yn as W,Jn as X,Bt as a,An as b,er as c,Qn as d,tr as e,zn as f,mn as g,Hn as h,gt as i,Me as j,Nn as k,Vn as l,zt as m,De as n,Ft as o,$n as p,Yt as q,Bn as r,ln as s,Un as t,kt as u,Qt as v,Ht as w,Kn as x,Wn as y,je as z};
2
- //# sourceMappingURL=useUser-7cf5ce1f.js.map
1
+ import{r as d,I as c,ba as Ne,ag as $e,K as L,M as A,L as K,J as ke,V as R,bb as Ke,bc as We,bd as Fe,af as Be,Z,$ as Ue,b2 as ze}from"./vendor-4601e84c.js";import{a_ as He,t as I,P as ae,aR as Ve,B as G,al as Ge,u as qe,aI as W,b5 as Xe,bF as Ye,cc as Je,bI as Qe,bK as Ze,cd as et,ab as tt,$ as nt,_ as rt,c3 as it,c5 as oe,aC as at,b4 as ot,b3 as st,a8 as ut}from"./ControlType-9276572c.js";import{M as lt,c as ct,L as ee,I as dt,j as ft,ag as ht,ah as vt,H as te}from"./index-c6f58d55.js";import{a as se}from"./IrisGridShortcuts-a3f84fda.js";function pt(t){var e=t;t instanceof CustomEvent&&(e=t.detail);var n="";if(e instanceof Error?n=e.message:e!=null&&(n="".concat(e)),n=n.trim(),n.length>0)return n}function Me(t,e){d.useEffect(()=>{if(t!=null){var n=new window.ResizeObserver(e);return n.observe(t),()=>{t!=null&&n.unobserve(t)}}},[t,e])}function gt(t,e){var[n,r]=d.useState(!0),[i,a]=d.useState(t),[s,o]=d.useState(t),[u,l]=d.useState(e);return(t!==s||e!==u)&&(r(!0),o(t),l(e)),d.useEffect(()=>{var m=!1,v=setTimeout(()=>{m||(r(!1),a(t))},e);return()=>{m=!0,clearTimeout(v)}},[t,e]),{isDebouncing:n,value:i}}function jn(){var{selectedThemeKey:t,setSelectedThemeKey:e,themes:n}=He(),r=d.useCallback(i=>{e(i)},[e]);return c.jsx(Ne,{label:"Pick a color scheme",items:n,selectedKey:t,onSelectionChange:r,children:i=>c.jsx($e,{children:i.name},i.themeKey)})}function In(t){var{className:e,style:n}=t;return c.jsx("div",{className:L("dh-logo",e),style:n})}function Ln(t){var{blockInteraction:e=!0,children:n,debounceMs:r,isOpen:i=!1}=t,{value:a}=gt(i,r);return c.jsxs(c.Fragment,{children:[e&&i&&c.jsx("div",{className:"modal-backdrop",style:{backgroundColor:"transparent"},"data-testid":"debounced-modal-backdrop"}),A.cloneElement(n,{isOpen:i&&a})]})}function Tn(t){var{className:e,icon:n,isOpen:r=!1,subtitle:i,title:a}=t;return c.jsx(lt,{isOpen:r,className:e,children:c.jsx(ct,{children:c.jsxs("div",{className:"info-modal",children:[n!=null&&c.jsx("div",{className:"message-icon",children:c.jsx(K,{icon:n})}),c.jsx("div",{className:"message-header",children:a}),i!=null&&c.jsx("div",{className:"message-content",children:i})]})})})}function ue(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function mt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ue(Object(n),!0).forEach(function(r){j(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ue(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function j(t,e,n){return e=bt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bt(t){var e=yt(t,"string");return typeof e=="symbol"?e:String(e)}function yt(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var le=ee.module("ContextMenu");class N extends d.PureComponent{static handleContextMenu(e){e.metaKey||(e.stopPropagation(),e.preventDefault())}constructor(e){super(e),j(this,"container",void 0),j(this,"oldFocus",void 0),j(this,"activeSubMenuRef",void 0),j(this,"subMenuTimer",void 0),j(this,"rAF",void 0),j(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=A.createRef(),this.oldFocus=document.activeElement,this.activeSubMenuRef=A.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:n}=this.props;n(this)})}componentDidUpdate(e,n){var{actions:r}=this.props,{activeSubMenu:i}=this.state;if(i!==n.activeSubMenu)if(i==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 s;(s=this.container.current)===null||s===void 0||s.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:n}=this.state;return n}return this.getMouseIndex()}setKeyboardIndex(e){var{options:n}=this.props;n.separateKeyboardMouse!==void 0&&n.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,n=e.initialKeyboardIndex;n===void 0&&(n=-1);for(var{actions:r}=this.props,i=I.getMenuItems(r),a=[],s=i.length-1;s>=0;s-=1){var o=i[s];o instanceof Promise?this.initMenuPromise(o):a.push(o)}this.setState({mouseIndex:-1,keyboardIndex:n,activeSubMenu:null,menuItems:I.sortActions(a)})}initMenuPromise(e){var n=ae.makeCancelable(e);this.setState(r=>({pendingItems:r.pendingItems.concat(n)})),n.then(r=>{this.setState(i=>{var a=i.pendingItems.indexOf(n);if(a>=0){var s=i.pendingItems.slice();return s.splice(a,1),{menuItems:I.sortActions(i.menuItems.concat(r)),pendingItems:s}}return null})},r=>{ae.isCanceled(r)||(this.setState(i=>{var a=i.pendingItems.indexOf(n);if(a>=0){var s=i.pendingItems.slice();return s.splice(a,1),{pendingItems:s}}return null}),le.error(r))})}cancelPromises(){var{pendingItems:e}=this.state;e.map(n=>n.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,n,r,i,{options:a,updatePosition:s,subMenuParentWidth:o,subMenuParentHeight:u,top:l,left:m}=this.props;if(!(!this.container.current||a.doNotVerifyPosition!=null&&a.doNotVerifyPosition)){var{top:v,left:b}=this.initialPosition,{width:y,height:g}=(e=(n=this.container.current)===null||n===void 0?void 0:n.getBoundingClientRect())!==null&&e!==void 0?e:{width:0,height:0},x=((r=(i=this.container.current)===null||i===void 0?void 0:i.scrollHeight)!==null&&r!==void 0?r:0)>window.innerHeight;g===0||y===0||(v+g>window.innerHeight&&(v-g-u>0?v-=g-u:v=window.innerHeight-g),b+y>window.innerWidth&&(b=b-y-o),(m!==b||l!==v)&&(this.setState({hasOverflow:x}),s(v,b)))}}handleWindowResize(){this.container.current&&this.closeMenu(!0)}handleBlur(e){if(!this.container.current){le.warn("Container is null!");return}if(!this.container.current.contains(e.relatedTarget)){for(var n=e.relatedTarget,r=!1;n&&!r;)r=n.hasAttribute("data-dh-context-menu"),n=n.parentElement;r||this.closeMenu(!0)}}isEscapeKey(e){var{left:n}=this.props;return e==="Escape"||n<0&&e==="ArrowRight"||e==="ArrowLeft"}handleKeyDown(e){var{menuItems:n}=this.state,r=this.getKeyboardIndex(),i=r,a=!1;if(e.key==="Enter"||e.key===" "){r>=0&&r<n.length&&this.handleMenuItemClick(n[r],e);return}if(e.key==="ArrowRight"?r>=0&&r<=n.length?a=!0:i=0:this.isEscapeKey(e.key)?i=null:e.key==="ArrowUp"||e.shiftKey&&e.key==="Tab"?i=I.getNextMenuItem(i,-1,n):(e.key==="ArrowDown"||e.key==="Tab")&&(i=I.getNextMenuItem(i,1,n)),a){this.openSubMenu(r),e.preventDefault(),e.stopPropagation();return}r!==i&&(i!==null?this.setKeyboardIndex(i):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}openSubMenu(e){var{menuItems:n,activeSubMenu:r}=this.state,i=n[e].actions?e:null;r!==i&&this.setState({activeSubMenu:i,subMenuTop:null,subMenuLeft:null})}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,{closeMenu:n,onMenuClosed:r}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{n(e),r(this)})}closeSubMenu(){this.setState({activeSubMenu:null})}handleCloseSubMenu(e){e?this.closeMenu(!0):this.closeSubMenu()}handleMenuItemClick(e,n){n.preventDefault(),n.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(n.nativeEvent),this.closeMenu(!0)))}handleMenuItemContextMenu(e,n){n.metaKey||this.handleMenuItemClick(e,n)}handleMenuItemMouseMove(e){var{menuItems:n}=this.state,r=n.indexOf(e);this.setMouseIndex(r),r>=0&&r<n.length&&(e.disabled===void 0||!e.disabled)&&this.openSubMenu(r)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{top:n,left:r}=this.props,{activeSubMenu:i,hasOverflow:a,keyboardIndex:s,menuItems:o,mouseIndex:u,pendingItems:l,subMenuTop:m,subMenuLeft:v,subMenuParentWidth:b,subMenuParentHeight:y}=this.state,g=0;g<o.length;g+=1){var x=o[g];g>0&&x.group!==o[g-1].group&&e.push(c.jsx("hr",{},"".concat(g,".separator")));var p=c.jsx(Ve,{ref:i===g?this.activeSubMenuRef:null,isKeyboardSelected:s===g,isMouseSelected:u===g,menuItem:x,closeMenu:this.handleCloseSubMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:this.handleMenuItemContextMenu},g);e.push(p)}var S=null;l.length>0&&(S=c.jsx("div",{className:"loading",children:c.jsx(dt,{className:"loading-spinner-vertical-align"})}));var{menuStyle:_,"data-testid":$}=this.props,M=i!==null&&m!==null&&v!==null;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:L({"has-overflow":a},"context-menu-container"),style:mt({top:n,left:r},_),ref:this.container,"data-dh-context-menu":!0,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,onContextMenu:N.handleContextMenu,role:"menuitem",tabIndex:0,"data-testid":$,children:[e,S]}),M&&i!==null&&m!==null&&v!==null&&c.jsx(N,{actions:o[i].actions||[],closeMenu:this.handleCloseSubMenu,top:m,left:v,updatePosition:(C,D)=>{this.setState({subMenuTop:C,subMenuLeft:D})},subMenuParentWidth:b,subMenuParentHeight:y},"sub-".concat(i))]})}}j(N,"defaultProps",{subMenuParentWidth:0,subMenuParentHeight:0,closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});const wt=N;function ce(t,e,n){return e=Pt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Pt(t){var e=St(t,"string");return typeof e=="symbol"?e:String(e)}function St(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Ct extends d.Component{constructor(e){super(e),ce(this,"container",void 0),ce(this,"openMenu",void 0),this.handleMenuClose=this.handleMenuClose.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.container=A.createRef(),this.openMenu=A.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 n=this.container.current.getBoundingClientRect(),r=e.clientY-n.top,i=e.clientX-n.left,{actions:a}=this.state;if(a!=null&&e.target===this.container.current){e.preventDefault(),this.setState({actions:null},()=>{var o=document.elementFromPoint(i,r),u=new MouseEvent("contextmenu",{clientX:e.clientX,clientY:e.clientY,bubbles:!0,cancelable:!0});o?.dispatchEvent(u)});return}if(I.isContextActionEvent(e)&&!(e.metaKey||e.ctrlKey)){var s=I.getMenuItems(e.contextActions);s.length!==0&&(e.preventDefault(),this.setState({actions:s,top:r,left:i}))}}}handleMenuClose(e){e===this.openMenu.current&&this.setState({actions:null})}render(){var e=null,{"data-testid":n}=this.props,{actions:r,top:i,left:a}=this.state;return r&&(e=c.jsx(wt,{ref:this.openMenu,actions:r,onMenuClosed:this.handleMenuClose,top:i,left:a,updatePosition:(s,o)=>{this.setState({top:s,left:o})},"data-testid":n})),c.jsx("div",{className:L("context-menu-root",{active:r}),ref:this.container,children:e})}}const An=Ct;function Oe(t,e,n){return e=xt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xt(t){var e=Mt(t,"string");return typeof e=="symbol"?e:String(e)}function Mt(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class E extends d.Component{static handleEnter(e){var n=e;n.style.height="0"}static handleEntering(e){var n=e;n.style.height="".concat(E.getHeight(n),"px")}static handleExiting(e){var n=e;n.style.height="0"}static handleExit(e){var n=e;n.style.height="".concat(E.getHeight(n),"px")}static getHeight(e){var n=e.scrollWidth-e.clientWidth;return e.scrollHeight-n}constructor(e){super(e),this.handleEntered=this.handleEntered.bind(this)}handleEntered(e){var n=e;n.style.height="";var{autoFocusOnShow:r}=this.props;if(r!==void 0&&r){var i=n.querySelector("input, select, textarea");i?.focus()}}render(){var{children:e,className:n,in:r,"data-testid":i}=this.props;return c.jsx(ke,{in:r,classNames:{enterActive:"collapsing",enterDone:"collapse show",exitActive:"collapsing",exitDone:"collapse"},onEnter:E.handleEnter,onEntering:E.handleEntering,onEntered:this.handleEntered,onExit:E.handleExit,onExiting:E.handleExiting,timeout:350,children:a=>c.jsx("div",{className:L({collapse:a==="exited"},n),"data-testid":i,children:e})})}}Oe(E,"propTypes",{className:R.string,in:R.bool.isRequired,children:R.node.isRequired,autoFocusOnShow:R.bool,"data-testid":R.string});Oe(E,"defaultProps",{className:"",autoFocusOnShow:!1,"data-testid":void 0});const _n=E;function de(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function z(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?de(Object(n),!0).forEach(function(r){Ot(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):de(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Ot(t,e,n){return e=Et(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Et(t){var e=Dt(t,"string");return typeof e=="symbol"?e:String(e)}function Dt(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Ee=d.memo(t=>{var{tab:e,onClose:n,onSelect:r,isActive:i,activeRef:a,index:s,isDraggable:o,contextActions:u}=t,{key:l,isClosable:m=n!=null,title:v,icon:b}=e,y;return b!=null&&(y=A.isValidElement(b)?b:c.jsx(K,{icon:b})),c.jsx(Ke,{draggableId:l,index:s,isDragDisabled:!o,children:(g,x)=>c.jsxs("div",{className:"context-menu-wrapper",ref:i?a:null,children:[c.jsxs("div",z(z(z({ref:g.innerRef},g.draggableProps),g.dragHandleProps),{},{className:L("btn btn-link btn-nav-tab",{active:i},{dragging:x.isDragging}),"data-testid":"btn-nav-tab-".concat(v),role:"tab",tabIndex:0,onAuxClick:p=>{m&&p.button===1&&p.buttons===0&&n?.(l)},onClick:p=>{if(m&&p.button===1&&p.buttons===0){n?.(l);return}p.button===0&&p.buttons===0&&(p.target.focus(),r(l))},onKeyPress:p=>{p.key==="Enter"&&r(l)},children:[y,v,m&&c.jsx(G,{kind:"ghost",className:"btn-nav-tab-close",onClick:p=>{n?.(l),p.stopPropagation(),p.preventDefault()},icon:ft,tooltip:"Close"})]})),c.jsx(Ge,{actions:u})]})},l)});Ee.displayName="NavTab";const jt=Ee;function fe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function he(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?fe(Object(n),!0).forEach(function(r){It(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):fe(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function It(t,e,n){return e=Lt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Lt(t){var e=Tt(t,"string");return typeof e=="symbol"?e:String(e)}function Tt(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var At=500,_t=.01,Rt=5e-4;function ve(t){return t.scrollLeft===0}function pe(t){return t.scrollLeft+t.clientWidth===t.scrollWidth||t.scrollWidth===0}function Nt(t,e,n){var{isClosable:r=!1,key:i}=t,a=[];if(r&&n!=null){a.push({title:"Close",order:10,group:20,action:()=>{n(i)}});for(var s=!0,o=e.length-1;o>0&&e[o].key!==t.key;o-=1)if(e[o].isClosable===!0){s=!1;break}a.push({title:"Close to the Right",order:20,group:20,action:()=>{for(var u=e.length-1;u>0&&e[u].key!==i;u-=1)e[u].isClosable===!0&&n(e[u].key)},disabled:s}),a.push({title:"Close All",order:30,group:20,action:()=>{e.forEach(u=>{u.isClosable===!0&&n(u.key)})}})}return a}function Rn(t){var{activeKey:e,tabs:n,onSelect:r,onReorder:i,onClose:a,makeContextActions:s}=t,o=d.useRef(),[u,l]=d.useState(!0),[m,v]=d.useState(!0),[b,y]=d.useState(!0),g=d.useCallback(()=>{o.current!=null&&(o.current.clientWidth<o.current.scrollWidth&&n.length>0?l(!0):l(!1),v(ve(o.current)),y(pe(o.current)))},[n]);Me(o.current,g);var x=d.useCallback(f=>{se.stopDragging(),f.destination&&i?.(f.source.index,f.destination.index)},[i]),p=d.useCallback(()=>{if(o.current!=null){var f=ve(o.current);f!==m&&v(f);var h=pe(o.current);h!==b&&y(h)}},[m,b]),S=d.useRef({cancelClick:!1}),_=d.useCallback(()=>{if(!(o.current==null||S.current.cancelClick))for(var{children:f}=o.current,h=f.length-1;h>=0;h-=1){var w=f[h];if(w.offsetLeft<o.current.scrollLeft-5){w.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"});return}}},[]),$=d.useCallback(()=>{if(!(o.current==null||S.current.cancelClick))for(var{children:f}=o.current,h=0;h<f.length;h+=1){var w=f[h];if(w.offsetLeft+5>o.current.scrollLeft+o.current.offsetWidth){w.scrollIntoView({behavior:"smooth",block:"nearest",inline:"end"});return}}},[]),M=d.useCallback(function(f,h){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,P=arguments.length>3?arguments[3]:void 0,O=o.current;O!=null&&(S.current.cancelClick=!0,f==="left"?O.scrollLeft=h-w:f==="right"&&(O.scrollLeft=h+w),S.current.rAF=requestAnimationFrame(k=>{var re=P??k,ie=k-re,U=_t*ie+.5*Rt*ie**2;U=Math.min(U,O.scrollWidth),M(f,h,U,re)}))},[]),C=d.useCallback(()=>{var{holdTimer:f,rAF:h}=S.current;f!=null&&(clearTimeout(f),S.current.holdTimer=void 0),h!=null&&(cancelAnimationFrame(h),S.current.rAF=void 0),window.removeEventListener("mouseup",C)},[]);d.useEffect(()=>()=>window.removeEventListener("mouseup",C),[C]);var D=d.useCallback(f=>{o.current!=null&&(S.current.holdTimer=window.setTimeout(M,At,f,o.current.scrollLeft)),S.current.cancelClick=!1,window.addEventListener("mouseup",C)},[C,M]),Le=d.useCallback(()=>{D("left")},[D]),Te=d.useCallback(()=>{D("right")},[D]);d.useEffect(function(){var h,w=P=>{P.stopPropagation(),P.preventDefault();var O=P.currentTarget,k=Math.abs(P.deltaY)>Math.abs(P.deltaX)?P.deltaY:P.deltaX;O.scrollLeft+=Be(k,-30,30)};return(h=o.current)===null||h===void 0||h.addEventListener("wheel",w),()=>{var P;(P=o.current)===null||P===void 0||P.removeEventListener("wheel",w)}},[]);var Ae=d.useMemo(()=>{var f=new Map;return n.forEach(h=>{var{key:w}=h,P=[()=>Nt(h,n,a),()=>{var O;return(O=s?.(h))!==null&&O!==void 0?O:[]}];f.set(w,P)}),f},[s,n,a]),B=d.useRef(null),_e=n.find(f=>f.key===e),Re=n.map((f,h)=>{var{key:w}=f,P=f===_e;return c.jsx(jt,{tab:f,index:h,isActive:P,activeRef:B,onSelect:r,onClose:a,isDraggable:i!=null,contextActions:Ae.get(w)},w)});return d.useEffect(function(){B.current!=null&&B.current.scrollIntoView({block:"nearest",inline:"nearest"})},[e]),c.jsxs("nav",{className:"nav-container",children:[u&&c.jsx(G,{kind:"ghost",icon:c.jsx(K,{icon:ht,transform:"grow-4"}),className:"tab-controls-btn tab-controls-btn-left",tooltip:"Scroll left",onClick:_,onMouseDown:Le,disabled:m}),c.jsx(We,{onDragStart:se.startDragging,onDragEnd:x,children:c.jsx(Fe,{droppableId:"droppable-tab-navigation",direction:"horizontal",children:(f,h)=>c.jsxs("div",he(he({ref:w=>{w!=null&&(o.current=w,f.innerRef(w))}},f.droppableProps),{},{className:L("nav nav-tabs",{dragging:h.draggingFromThisWith}),role:"tablist",onScroll:p,children:[Re,f.placeholder]}))})}),u&&c.jsx(G,{kind:"ghost",icon:c.jsx(K,{icon:vt,transform:"grow-4"}),className:"tab-controls-btn tab-controls-btn-right",tooltip:"Scroll right",onClick:$,onMouseDown:Te,disabled:b})]})}function $t(t,e){var n=qe(),r=d.useMemo(()=>new n.CoreClient(t,e),[n,t,e]);return d.useEffect(()=>()=>{r.disconnect()},[r]),r}var De=d.createContext(null);function Nn(t){var{serverUrl:e,options:n,children:r}=t,i=$t(e,n);return c.jsx(De.Provider,{value:i,children:r})}function kt(){return W(De,"No Client available in useClient. Was code wrapped in ClientBootstrap or ClientContext.Provider?")}function ge(t,e,n,r,i,a,s){try{var o=t[a](s),u=o.value}catch(l){n(l);return}o.done?e(u):Promise.resolve(u).then(r,i)}function Kt(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var a=t.apply(e,n);function s(u){ge(a,r,i,s,o,"next",u)}function o(u){ge(a,r,i,s,o,"throw",u)}s(void 0)})}}var H=ee.module("MessageUtils"),$n="io.deephaven.message.LoginOptions.request",Wt="io.deephaven.message.SessionDetails.request",kn="io.deephaven.broadcast",Ft="io.deephaven.broadcast.Login",Bt="io.deephaven.broadcast.Logout";function je(t){var e=t;return e!=null&&typeof e.id=="string"&&typeof e.message=="string"}function Kn(t){return je(t)&&t.message===Ft}function Wn(t){return je(t)&&t.message===Bt}function Ut(t){var e=t;return e!=null&&typeof e.id=="string"}function zt(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Z(),n=arguments.length>2?arguments[2]:void 0;return{message:t,id:e,payload:n}}function Fn(t,e){return{id:t,payload:e}}function Ht(){return window.opener!=null?window.opener:window.parent!=null&&window.parent!==window?window.parent:null}function Vt(t){return q.apply(this,arguments)}function q(){return q=Kt(function*(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3e4,n=Ht();if(n==null)throw new Error("window parent is null, unable to send request.");return new Promise((r,i)=>{var a,s=Z(),o=u=>{var{data:l}=u;if(!Ut(l)){H.debug("Ignoring non-deephaven response",l);return}if(H.debug("Received message",l),l?.id!==s){H.debug("Ignore message, id doesn't match",l);return}window.clearTimeout(a),window.removeEventListener("message",o),r(l.payload)};window.addEventListener("message",o),a=window.setTimeout(()=>{window.removeEventListener("message",o),i(new Xe("Request timed out"))},e),n.postMessage(zt(t,s),"*")})}),q.apply(this,arguments)}function Gt(t,e,n){return e=qt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qt(t){var e=Xt(t,"string");return typeof e=="symbol"?e:String(e)}function Xt(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Yt extends Error{constructor(){super(...arguments),Gt(this,"isNoConsolesError",!0)}}function Jt(t){return t.isNoConsolesError}function me(t,e,n,r,i,a,s){try{var o=t[a](s),u=o.value}catch(l){n(l);return}o.done?e(u):Promise.resolve(u).then(r,i)}function F(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var a=t.apply(e,n);function s(u){me(a,r,i,s,o,"next",u)}function o(u){me(a,r,i,s,o,"throw",u)}s(void 0)})}}var T=ee.module("SessionUtils");function Bn(t,e){return T.info("Starting connection to '".concat(e,"'...")),new t.IdeConnection(e)}function Qt(t,e,n){return X.apply(this,arguments)}function X(){return X=F(function*(t,e,n){T.info("Getting console types...");var r=yield e.getConsoleTypes();if(r.length===0)throw new Yt("No console types available");T.info("Available types:",r);var i=r[0];T.info("Starting session with type",i);var a=yield e.startSession(i),s={type:i,id:Z()};return T.info("Console session established",s),{session:a,config:s,connection:e,details:n,dh:t}}),X.apply(this,arguments)}function Un(t,e,n){return T.info("createCoreClient",e),new t.CoreClient(e,n)}function Zt(t){return t!=null&&typeof t=="object"}function en(){return Y.apply(this,arguments)}function Y(){return Y=F(function*(){var t=yield Vt(Wt);if(!Zt(t))throw new Error("Unexpected session details response: ".concat(t));return t}),Y.apply(this,arguments)}function zn(){return J.apply(this,arguments)}function J(){return J=F(function*(){var t=new URLSearchParams(window.location.search);switch(t.get("authProvider")){case"parent":return en()}return{}}),J.apply(this,arguments)}function Hn(t,e,n){return Q.apply(this,arguments)}function Q(){return Q=F(function*(t,e,n){var r;try{r=yield Qt(t,e,n)}catch(i){if(!Jt(i))throw i}return r}),Q.apply(this,arguments)}function be(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function tn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?be(Object(n),!0).forEach(function(r){nn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):be(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function nn(t,e,n){return e=rn(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rn(t){var e=an(t,"string");return typeof e=="symbol"?e:String(e)}function an(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var on=100,V=()=>{},sn=Object.freeze({});function un(t){var{id:e="default",children:n,emptyDashboard:r,layoutConfig:i,layoutSettings:a=sn,onLayoutConfigChange:s=V,onGoldenLayoutChange:o=V,onLayoutInitialized:u=V,fallbackComponent:l=et,hydrate:m,dehydrate:v,panelWrapper:b}=t,y=d.useRef(null),[g,x]=d.useState(!1),[p,S]=d.useState();d.useEffect(function(){if(!y.current){S(void 0);return}var M=tn({},Ye.makeDefaultLayout());M.settings===void 0&&(M.settings={}),Object.assign(M.settings,a),M.content=[];var C=new Je(M,y.current),D=()=>{C.off("initialised",D),x(!0)};return C.on("initialised",D),l!=null&&C.setFallbackComponent(l),C.init(),S(C),o(C),()=>{C.destroy()}},[a,l,o,x,S]);var _=d.useMemo(()=>Ue(()=>{p!=null&&p.isInitialised&&p?.updateSize()},on),[p]);return Me(y.current,_),c.jsxs("div",{className:"dashboard-container w-100 h-100",children:[c.jsx("div",{className:"w-100 h-100",ref:y}),g&&p&&c.jsx(Qe.Provider,{value:p,children:c.jsx(Ze,{emptyDashboard:r,id:e,layout:p,layoutConfig:i,onLayoutChange:s,onLayoutInitialized:u,hydrate:m,dehydrate:v,panelWrapper:b,children:n})})]})}var ne="CREATE_DASHBOARD";function ln(t,e){try{t.off(ne,e)}catch{}}function Vn(t,e){return t.on(ne,e),()=>ln(t,e)}function Gn(t,e){t.emit(ne,e)}var cn=["id","isActive","plugins"];function ye(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function we(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ye(Object(n),!0).forEach(function(r){dn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ye(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function dn(t,e,n){return e=fn(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fn(t){var e=hn(t,"string");return typeof e=="symbol"?e:String(e)}function hn(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function vn(t,e){if(t==null)return{};var n=pn(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function pn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function gn(t){var{id:e,isActive:n,plugins:r}=t,i=vn(t,cn),[a,s]=d.useState(n),o=ze(),u=d.useCallback(l=>{o(e===tt?nt({layoutConfig:l}):rt(e,{layoutConfig:l}))},[e,o]);return!a&&n&&s(!0),a?c.jsx(un,we(we({id:e,onLayoutConfigChange:u},i),{},{children:r})):c.jsx(te,{})}function mn(t){var e=[...t.entries()].filter(n=>{var[,r]=n;return it(r)||oe(r)});return e.map(n=>{var[r,i]=n;if(oe(i)){var{DashboardPlugin:a}=i;return c.jsx(a,{},r)}var{component:s}=i;return c.jsx(s,{},r)})}function qn(){var t=at(),e=d.useMemo(()=>mn(t),[t]);return e}var Xn=d.createContext({}),Yn=d.createContext({}),bn=d.createContext(null),yn=d.createContext(null);function Pe(t,e,n,r,i,a,s){try{var o=t[a](s),u=o.value}catch(l){n(l);return}o.done?e(u):Promise.resolve(u).then(r,i)}function wn(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var a=t.apply(e,n);function s(u){Pe(a,r,i,s,o,"next",u)}function o(u){Pe(a,r,i,s,o,"throw",u)}s(void 0)})}}var Ie=d.createContext(null);function Jn(t){var{children:e}=t,n=kt(),[r,i]=d.useState(),[a,s]=d.useState();d.useEffect(function(){var l=!1;function m(){return v.apply(this,arguments)}function v(){return v=wn(function*(){try{var b=yield n.getServerConfigValues();l||i(new Map(b))}catch(y){l||s(y)}}),v.apply(this,arguments)}return m(),()=>{l=!0}},[n]);var o=r==null;return o||a!=null?c.jsx(te,{isLoading:o&&a==null,errorMessage:pt(a)}):c.jsx(Ie.Provider,{value:r,children:e})}function Qn(){return W(Ie,"No server config available in useServerConfig. Was code wrapped in ServerConfigBootstrap or ServerConfigContext.Provider?")}function Se(t,e,n,r,i,a,s){try{var o=t[a](s),u=o.value}catch(l){n(l);return}o.done?e(u):Promise.resolve(u).then(r,i)}function Pn(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var a=t.apply(e,n);function s(u){Se(a,r,i,s,o,"next",u)}function o(u){Se(a,r,i,s,o,"throw",u)}s(void 0)})}}function Ce(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function xe(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Ce(Object(n),!0).forEach(function(r){Sn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ce(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Sn(t,e,n){return e=Cn(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Cn(t){var e=xn(t,"string");return typeof e=="symbol"?e:String(e)}function xn(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Zn(t){var{dashboards:e,activeDashboard:n,onLayoutInitialized:r,onGoldenLayoutChange:i,plugins:a,emptyDashboard:s=c.jsx(te,{})}=t,o=ot(),u=d.useCallback((l,m)=>{var{metadata:v}=l;try{if(v!=null){var b=st(v);return xe(xe({fetch:function(){var y=Pn(function*(){return o(b)});function g(){return y.apply(this,arguments)}return g}()},l),{},{localDashboardId:m})}}catch{}return ut.hydrate(l,m)},[o]);return c.jsx("div",{className:"tab-content",children:e.map(l=>c.jsx("div",{className:L("tab-pane",{active:l.id===n}),children:c.jsx(gn,{id:l.id,isActive:l.id===n,emptyDashboard:s,layoutConfig:l.layoutConfig,layoutSettings:l.layoutSettings,onLayoutInitialized:r,onGoldenLayoutChange:i,hydrate:u,plugins:a},l.key)},l.id))})}function er(){return W(yn,"No IdeConnection available in useConnection. Was code wrapped in ConnectionContext.Provider?")}function tr(){return W(bn,"No user available in useUser. Was code wrapped in UserBootstrap or UserContext.Provider?")}export{Zn as A,kn as B,_n as C,Ln as D,Jt as E,Ut as F,Fn as G,Vt as H,Tn as I,un as J,ne as K,In as L,gn as M,Rn as N,Gn as O,qn as P,pt as Q,bn as R,Wt as S,jn as T,Yn as U,Xn as V,yn as W,Jn as X,Bt as a,An as b,er as c,Qn as d,tr as e,zn as f,mn as g,Hn as h,gt as i,Me as j,Nn as k,Vn as l,zt as m,De as n,Ft as o,$n as p,Yt as q,Bn as r,ln as s,Un as t,kt as u,Qt as v,Ht as w,Kn as x,Wn as y,je as z};
2
+ //# sourceMappingURL=useUser-6daef947.js.map