@deephaven/embed-grid 0.37.4-logout.1 → 0.37.4-logout.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/assets/{App-cdc311d6.js → App-26b6a43d.js} +2 -2
- package/build/assets/{App-cdc311d6.js.map → App-26b6a43d.js.map} +1 -1
- package/build/assets/index-4cda0b40.js +8 -0
- package/build/assets/index-4cda0b40.js.map +1 -0
- package/build/assets/{index-071555f9.js → index-a77c9858.js} +2 -2
- package/build/assets/{index-071555f9.js.map → index-a77c9858.js.map} +1 -1
- package/build/assets/{useConnection-27dd9325.js → useConnection-5630eee9.js} +2 -2
- package/build/assets/{useConnection-27dd9325.js.map → useConnection-5630eee9.js.map} +1 -1
- package/build/index.html +1 -1
- package/package.json +14 -14
- package/build/assets/index-e00abfae.js +0 -8
- package/build/assets/index-e00abfae.js.map +0 -1
package/build/index.html
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
<link rel="icon" href="./favicon-cc-app.svg" />
|
|
18
18
|
<title>Deephaven Embedded Grid</title>
|
|
19
|
-
<script type="module" crossorigin src="./assets/index-
|
|
19
|
+
<script type="module" crossorigin src="./assets/index-a77c9858.js"></script>
|
|
20
20
|
<link rel="modulepreload" crossorigin href="./assets/monaco-0851b9b6.js">
|
|
21
21
|
<link rel="modulepreload" crossorigin href="./assets/helpers-042e6b4d.js">
|
|
22
22
|
<link rel="modulepreload" crossorigin href="./assets/vendor-0f8246a9.js">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deephaven/embed-grid",
|
|
3
|
-
"version": "0.37.4-logout.
|
|
3
|
+
"version": "0.37.4-logout.2+6330d6ee",
|
|
4
4
|
"description": "Deephaven Embedded Grid",
|
|
5
5
|
"author": "Deephaven Data Labs LLC",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
"build"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@deephaven/app-utils": "^0.37.4-logout.
|
|
20
|
-
"@deephaven/components": "^0.37.4-logout.
|
|
21
|
-
"@deephaven/iris-grid": "^0.37.4-logout.
|
|
22
|
-
"@deephaven/jsapi-bootstrap": "^0.37.4-logout.
|
|
23
|
-
"@deephaven/jsapi-shim": "^0.37.4-logout.
|
|
24
|
-
"@deephaven/jsapi-utils": "^0.37.4-logout.
|
|
25
|
-
"@deephaven/log": "^0.37.4-logout.
|
|
19
|
+
"@deephaven/app-utils": "^0.37.4-logout.2+6330d6ee",
|
|
20
|
+
"@deephaven/components": "^0.37.4-logout.2+6330d6ee",
|
|
21
|
+
"@deephaven/iris-grid": "^0.37.4-logout.2+6330d6ee",
|
|
22
|
+
"@deephaven/jsapi-bootstrap": "^0.37.4-logout.2+6330d6ee",
|
|
23
|
+
"@deephaven/jsapi-shim": "^0.37.4-logout.2+6330d6ee",
|
|
24
|
+
"@deephaven/jsapi-utils": "^0.37.4-logout.2+6330d6ee",
|
|
25
|
+
"@deephaven/log": "^0.37.4-logout.2+6330d6ee",
|
|
26
26
|
"fira": "mozilla/fira#4.202",
|
|
27
27
|
"react": "^17.0.2",
|
|
28
28
|
"react-dom": "^17.0.2"
|
|
@@ -34,16 +34,16 @@
|
|
|
34
34
|
"preview": "vite preview"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@deephaven/eslint-config": "^0.37.4-logout.
|
|
38
|
-
"@deephaven/mocks": "^0.37.4-logout.
|
|
39
|
-
"@deephaven/prettier-config": "^0.37.4-logout.
|
|
40
|
-
"@deephaven/stylelint-config": "^0.37.4-logout.
|
|
41
|
-
"@deephaven/tsconfig": "^0.37.4-logout.
|
|
37
|
+
"@deephaven/eslint-config": "^0.37.4-logout.2+6330d6ee",
|
|
38
|
+
"@deephaven/mocks": "^0.37.4-logout.2+6330d6ee",
|
|
39
|
+
"@deephaven/prettier-config": "^0.37.4-logout.2+6330d6ee",
|
|
40
|
+
"@deephaven/stylelint-config": "^0.37.4-logout.2+6330d6ee",
|
|
41
|
+
"@deephaven/tsconfig": "^0.37.4-logout.2+6330d6ee",
|
|
42
42
|
"@vitejs/plugin-react-swc": "^3.2.0",
|
|
43
43
|
"vite": "^4.1.4"
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "6330d6ee814bdc23883f20f76d227ae5d15db624"
|
|
49
49
|
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
var fn=Object.defineProperty;var mn=(s,t,e)=>t in s?fn(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var N=(s,t,e)=>(mn(s,typeof t!="symbol"?t+"":t,e),e);import{E as gn,r as l,p as v,e as ve,a as A,m as vn,j as i,c as O,F as z,C as be,l as Ae,$ as bn,s as Te,J as ee,L as Cn,R as xn,N as En,O as Tn,Q as gt,T as yn,U as Nn}from"./vendor-0f8246a9.js";import{L,ab as kn,ac as In,V as Be,Z as He,W as vt,f as Sn,U as bt,I as wn,o as On,T as Z,y as jn,ad as Mn,S as Rn,aa as te,a as Ct,ae as Pn,af as An}from"./index-071555f9.js";import{A as We,B as H,_ as xt,$ as Ln,a0 as Dn,u as _n,y as ae,a1 as Ge,a2 as Et,H as Tt,a3 as Fn,x as Ke,a4 as it,w as Le,v as De,a as $n,L as Un,e as Vn,k as Bn,a5 as Hn,Y as Wn,l as Gn,N as Kn,o as qn,p as zn,G as Yn,a6 as Zn,K as Jn,M as Qn,J as Xn,a7 as es,r as ts,V as ns,R as ss,t as as,q as is,m as yt,a8 as os,S as rs,U as ls,f as cs,a9 as us,aa as ds,ab as hs,ac as Nt,ad as ps,ae as ye,af as ce,ag as fs,ah as ms,ai as gs,i as vs,D as bs,j as Cs,aj as xs,ak as Es,Q as kt,F as _e,I as Ts,al as ys,h as Ns,b as ks,Z as Is,am as Ss,an as ws,ao as Os,P as ot,ap as js,C as Ms,aq as Rs}from"./useConnection-27dd9325.js";import{ar as Ui,X as Vi}from"./useConnection-27dd9325.js";import"./helpers-042e6b4d.js";import"./monaco-0851b9b6.js";var _=(s=>(s.DEBUG="D",s.LOG="L",s.WARN="W",s.ERROR="E",s.UNCAUGHT_ERROR="U",s))(_||{});function se(s,t){return new CustomEvent(s,{detail:t})}class Ps{constructor(){N(this,"isEnabled",!1);N(this,"debug");N(this,"log");N(this,"warn");N(this,"error");N(this,"eventTarget");N(this,"handleUncaughtError",t=>{const e=[];t.error!=null&&e.push(t.error),t.message&&e.push(t.message),this.eventTarget.dispatchEvent(se("U",e))});this.debug=console.debug,this.log=console.log,this.warn=console.warn,this.error=console.error,this.eventTarget=new gn}enable(){this.isEnabled||(console.debug=(...t)=>{this.eventTarget.dispatchEvent(se("D",t)),this.debug.apply(console,t)},console.log=(...t)=>{this.eventTarget.dispatchEvent(se("L",t)),this.log.apply(console,t)},console.warn=(...t)=>{this.eventTarget.dispatchEvent(se("W",t)),this.warn.apply(console,t)},console.error=(...t)=>{this.eventTarget.dispatchEvent(se("E",t)),this.error.apply(console,t)},window.addEventListener("error",this.handleUncaughtError),L.setLogLevel(L.level),this.isEnabled=!0)}disable(){this.isEnabled&&(console.debug=this.debug,console.log=this.log,console.warn=this.warn,console.error=this.error,window.removeEventListener("error",this.handleUncaughtError),L.setLogLevel(L.level),this.isEnabled=!1)}addEventListener(t,e){this.eventTarget.addEventListener(t,e)}removeEventListener(t,e){this.eventTarget.removeEventListener(t,e)}}const As=Ps;class Ce{constructor(t){N(this,"history");N(this,"offset");N(this,"limit");N(this,"isEnabled");N(this,"proxy");this.history=[],this.offset=0,this.limit=1e4,this.isEnabled=!1,this.proxy=t,this.addHistory=this.addHistory.bind(this)}static formatMessages(t){return t.map(n=>{if(typeof n=="string")return n;let o="";try{o=JSON.stringify(n)}catch{o=n.toString()}return o==="{}"?n.toString():o}).join(" ")}static formatStack(t,e){if(t==="")return"";let n=t.split(`
|
|
2
|
-
`).map(o=>o.trim());switch(e){case _.ERROR:n=n.splice(t[0]==="Error"?4:3);break;case _.UNCAUGHT_ERROR:n=n.splice(t[0]==="Error"?3:2);break}return n!=null?` ${n.join(`
|
|
3
|
-
`)}`:""}enable(){this.isEnabled||(this.proxy.addEventListener(_.DEBUG,this.addHistory),this.proxy.addEventListener(_.LOG,this.addHistory),this.proxy.addEventListener(_.WARN,this.addHistory),this.proxy.addEventListener(_.ERROR,this.addHistory),this.proxy.addEventListener(_.UNCAUGHT_ERROR,this.addHistory),this.isEnabled=!0)}disable(){this.isEnabled&&(this.proxy.removeEventListener(_.DEBUG,this.addHistory),this.proxy.removeEventListener(_.LOG,this.addHistory),this.proxy.removeEventListener(_.WARN,this.addHistory),this.proxy.removeEventListener(_.ERROR,this.addHistory),this.proxy.removeEventListener(_.UNCAUGHT_ERROR,this.addHistory),this.isEnabled=!1)}addHistory({type:t,detail:e}){const n={type:t,messages:e,time:new Date};switch(t){case _.ERROR:case _.UNCAUGHT_ERROR:n.stack=Error().stack;break}this.history[this.offset%this.limit]=n,this.offset+=1}getHistory(){if(this.offset>this.limit){const t=this.offset%this.limit;this.history=this.history.slice(t).concat(this.history.slice(0,t)),this.offset=this.limit}return this.history}getFormattedHistory(){return this.getHistory().map(e=>`${e.time.toISOString()} ${e.type} ${Ce.formatMessages(e.messages)}`+(e.stack!=null?`
|
|
4
|
-
${Ce.formatStack(e.stack,e.type)}`:"")).join(`
|
|
5
|
-
`)}}const Ls=Ce,Ds=Object.freeze(Object.defineProperty({__proto__:null,Log:L,LogHistory:Ls,LogProxy:As,Logger:kn,LoggerLevel:In,default:L},Symbol.toStringTag,{value:"Module"}));const _s=100;var It=(s=>(s.UP="UP",s.DOWN="DOWN",s))(It||{});const G=class extends l.Component{constructor(e){super(e);N(this,"popper");N(this,"cbContainer");N(this,"menuContainer");N(this,"input");N(this,"getCachedFilteredOptions",vn((e,n)=>e.filter(o=>o.title.toLowerCase().indexOf(n.toLowerCase())>=0)));let{popperOptions:n}=this.props;n={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...n},this.state={title:"",filteredOptions:[],keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,invalid:!1,popperOptions:n},this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handelInputFocus=this.handelInputFocus.bind(this),this.handleInputClick=this.handleInputClick.bind(this),this.updateInputValue=ve(this.updateInputValue,_s),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=A.createRef(),this.cbContainer=A.createRef(),this.menuContainer=A.createRef(),this.input=A.createRef()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}getValueAndValidate(e){if(!e)return this.setState({invalid:!1}),{value:e,isValid:!1};const{options:n}=this.props,o=n.filter(a=>a.title.toLowerCase()===e.toLowerCase());return o.length<1?(this.setState({invalid:!0}),{value:e,isValid:!1}):(this.setState({invalid:!1}),{value:o[0].value,isValid:!0})}updateInputValue(e){const{menuIsOpen:n}=this.state,{value:o,isValid:a}=this.getValueAndValidate(e);n&&this.processFilterChange(e),this.fireOnChange(o,a)}fireOnChange(e,n=!0){const{onChange:o}=this.props;o(e,n)}processFilterChange(e){var c;const{options:n}=this.props,{menuIsOpen:o}=this.state,a=e?this.getCachedFilteredOptions(n,e):n,r=a.length===1&&a[0].title===e;if(this.setState({filteredOptions:a,keyboardOptionIndex:0}),r&&o){this.closeMenu();return}(c=this.popper.current)==null||c.scheduleUpdate()}resetValue(){this.setState({title:""}),this.fireOnChange("")}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var r;const{filteredOptions:n,keyboardOptionIndex:o}=this.state,a=n[o];switch(e.key){case"Enter":case"ArrowRight":e.stopPropagation(),e.preventDefault(),a!=null&&(this.setState({title:a.title,invalid:!1}),this.fireOnChange(a.value)),this.closeMenu(),(r=this.input.current)==null||r.focus();break;case"ArrowUp":e.stopPropagation(),e.preventDefault(),this.navigateMenu(G.MENU_NAVIGATION_DIRECTION.UP);break;case"ArrowDown":e.stopPropagation(),e.preventDefault(),this.navigateMenu(G.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Tab":if(e.stopPropagation(),e.preventDefault(),e.shiftKey){this.navigateMenu(G.MENU_NAVIGATION_DIRECTION.UP);break}this.navigateMenu(G.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Escape":e.preventDefault(),e.stopPropagation(),this.closeMenu();break}}navigateMenu(e){const{filteredOptions:n,keyboardOptionIndex:o}=this.state;let a=o;e===G.MENU_NAVIGATION_DIRECTION.UP?o>0?(a=(a-1)%n.length,this.setState({keyboardOptionIndex:a})):o===0&&(a=n.length-1,this.setState({keyboardOptionIndex:a})):e===G.MENU_NAVIGATION_DIRECTION.DOWN&&o<n.length&&(a=(a+1)%n.length,this.setState({keyboardOptionIndex:a})),this.scrollOptionIntoView(a)}handleInputKeyDown(e){const{onEnter:n}=this.props,{menuIsOpen:o}=this.state;o?this.handleMenuKeyDown(e):e.key==="Enter"?n():e.key==="Escape"?(this.resetValue(),e.preventDefault(),e.stopPropagation()):e.key==="ArrowRight"||e.key==="ArrowLeft"||e.key==="Tab"||e.key==="Shift"||this.openMenu()}handleInputChange(e){this.setState({title:e.target.value}),this.updateInputValue(e.target.value)}handleOptionClick(e){var n;this.setState({title:e.title,invalid:!1}),this.fireOnChange(e.value),this.closeMenu(),(n=this.input.current)==null||n.focus()}handelInputFocus(){const{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputClick(){const{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputBlur(e){const{menuIsOpen:n}=this.state;n&&e.relatedTarget instanceof Element&&this.popper.current!==null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuBlur(e){e.relatedTarget===this.input.current||e.relatedTarget instanceof Element&&this.popper.current!==null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuOpened(){var e;(e=this.input.current)==null||e.focus()}handleMenuExited(){const{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}openMenu(){const{title:e}=this.state;this.processFilterChange(e),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var n;(n=this.popper.current)==null||n.show()})}closeMenu(e=!0){var n,o;this.setState({menuIsOpen:!1,keyboardOptionIndex:0}),e&&((n=this.input.current)==null||n.focus()),(o=this.popper.current)==null||o.hide()}scrollOptionIntoView(e){var n;this.menuContainer.current&&((n=this.menuContainer.current.children.item(e))==null||n.scrollIntoView({behavior:"smooth",block:"nearest"}))}renderMenuElement(){const{inputWidth:e}=this.state;return i.jsx("div",{className:O("aci-options"),ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,style:{width:e},onBlur:this.handleMenuBlur,children:this.renderOptions()})}renderOptions(){const{noMatchText:e}=this.props,{title:n,filteredOptions:o}=this.state;return n&&o.length===0?i.jsx("div",{className:"no-match",children:e}):o.map((a,r)=>this.renderOption(a,r))}renderOption(e,n){const{keyboardOptionIndex:o}=this.state,a=`option-${n}-${e.value}`;return i.jsx("button",{type:"button",className:O("aci-option-btn",{"keyboard-active":o===n}),onClick:()=>this.handleOptionClick(e),onFocus:()=>this.setState({keyboardOptionIndex:n}),children:e.title},a)}render(){const{options:e,inputPlaceholder:n,disabled:o,className:a,defaultTitle:r,spellCheck:c,"data-testid":u}=this.props,{title:d,menuIsOpen:h,popperOptions:p,invalid:g}=this.state;return i.jsxs("div",{className:"aci-container",ref:this.cbContainer,children:[i.jsx("input",{value:d||r,className:O("form-control",a,"aci-input",{"is-invalid":g&&!h}),ref:this.input,onChange:this.handleInputChange,placeholder:n||e[0].title,disabled:o,onFocus:this.handelInputFocus,onClick:this.handleInputClick,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:c,"data-testid":u}),i.jsx(We,{ref:this.popper,options:p,className:O("aci-options-popper interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})}};let J=G;N(J,"propTypes",{options:v.arrayOf(v.shape({title:v.string.isRequired,value:v.string.isRequired})).isRequired,popperOptions:v.shape({}),onChange:v.func,inputPlaceholder:v.string,disabled:v.bool,className:v.string,defaultTitle:v.string,spellCheck:v.bool,onEnter:v.func,noMatchText:v.string,"data-testid":v.string}),N(J,"defaultProps",{onChange(){},inputPlaceholder:"",disabled:!1,className:"",defaultTitle:"",popperOptions:null,spellCheck:!0,onEnter(){},noMatchText:"No matching items found","data-testid":void 0}),N(J,"MENU_NAVIGATION_DIRECTION",It);const Fs=J;function qe({className:s="",value:t,onChange:e,spellCheck:n=!1,placeholder:o="",disabled:a=!1,delimiter:r="",id:c="","data-testid":u}){const[d,h]=l.useState(t),[p,g]=l.useState(!1),m=l.useRef(null);l.useEffect(function(){h(t)},[t]);function b(k){return k.trim().split(r).filter(T=>T).join(`
|
|
6
|
-
${r.trim()}`)}function C(k){return k.split(`
|
|
7
|
-
`).map(T=>T.trim()).join(" ")}function I(){if(!m.current)return;m.current.style.height="0";const k=m.current.scrollHeight+(m.current.offsetHeight-m.current.clientHeight);k>0&&(m.current.style.height=`${k}px`)}function j(k){let T=k.target.value;p&&(r&&(T=b(T)),g(!1)),h(T),e(T)}function P(){m.current&&(r&&(h(b(d)),I()),m.current.scrollLeft=0)}function f(){m.current&&document.activeElement!==m.current&&m.current.focus()}function S(){r&&(h(C(d)),e(C(d)))}function x(){g(!0)}return l.useEffect(function(){I()},[d]),i.jsx("textarea",{ref:m,id:c,className:O(s,"auto-resize-textarea form-control"),placeholder:o,value:d,rows:1,onChange:j,onFocus:P,onMouseDown:f,onBlur:S,onPaste:x,spellCheck:n,disabled:a,"data-testid":u})}qe.propTypes={value:v.string.isRequired,onChange:v.func.isRequired,className:v.string,placeholder:v.string,spellCheck:v.bool,disabled:v.bool,delimiter:v.string,id:v.string,"data-testid":v.string};qe.defaultProps={className:"",id:"",placeholder:"",disabled:!1,spellCheck:!1,delimiter:"","data-testid":void 0};function ue(s){const{children:t,className:e,style:n,"data-testid":o}=s;return i.jsx("div",{className:O("btn-group",e),style:n,role:"group","data-testid":o,children:t})}ue.displayName="ButtonGroup";ue.propTypes={children:v.node.isRequired,className:v.string,style:v.object,"data-testid":v.string};ue.defaultProps={className:null,style:{},"data-testid":void 0};function $s({className:s,icon:t,isOpen:e,subtitle:n,title:o}){return i.jsx(Be,{isOpen:e,className:s,children:i.jsx(He,{children:i.jsxs("div",{className:"info-modal",children:[t!=null&&i.jsx("div",{className:"message-icon",children:i.jsx(z,{icon:t})}),i.jsx("div",{className:"message-header",children:o}),n!=null&&i.jsx("div",{className:"message-content",children:n})]})})})}function St({className:s="modal-footer",children:t,"data-testid":e}){return i.jsx("div",{className:s,"data-testid":e,children:t})}function ze(s){const{isOpen:t,headerText:e,bodyText:n,onCancel:o,onConfirm:a,onDiscard:r,onModalDisable:c,cancelButtonText:u="Cancel",confirmButtonText:d="Okay",discardButtonText:h="Discard",isConfirmDanger:p=!1,children:g,"data-testid":m}=s,b=l.useRef(null),C=l.useRef(null),I=l.useCallback(()=>{C.current!==null&&C.current.checked&&c&&c(),a()},[a,c]),j=l.useCallback(()=>{var f;(f=b.current)==null||f.focus()},[]);let P="";return t&&(P=typeof n=="function"?n():n),i.jsxs(Be,{isOpen:t,className:"theme-bg-light",onOpened:j,children:[i.jsx(vt,{closeButton:!1,children:e}),i.jsx(He,{children:P}),i.jsxs(St,{children:[c&&i.jsxs("div",{className:"custom-control custom-checkbox form-group mr-auto",children:[i.jsx("input",{type:"checkbox",className:"custom-control-input",id:"move-confirmation-checkbox",defaultChecked:!1,ref:C,"data-testid":m!==void 0?`${m}-checkbox-confirm`:void 0}),i.jsx("label",{className:"custom-control-label",htmlFor:"move-confirmation-checkbox",children:"Don't ask me again"})]}),r&&i.jsx(H,{kind:"secondary",className:"mr-auto","data-dismiss":"modal",onClick:r,"data-testid":m!==void 0?`${m}-btn-discard`:void 0,children:h}),o&&i.jsx(H,{kind:"secondary","data-dismiss":"modal",onClick:o,"data-testid":m!==void 0?`${m}-btn-cancel`:void 0,children:u}),i.jsxs(ue,{children:[i.jsx(H,{kind:p?"danger":"primary",onClick:I,ref:b,"data-testid":m!==void 0?`${m}-btn-confirm`:void 0,children:d}),g]})]})]})}ze.propTypes={isOpen:v.bool.isRequired,headerText:v.string.isRequired,bodyText:v.oneOfType([v.string,v.func]).isRequired,onCancel:v.func,onConfirm:v.func.isRequired,onDiscard:v.func,onModalDisable:v.func,cancelButtonText:v.string,confirmButtonText:v.string,discardButtonText:v.string,children:v.node,"data-testid":v.string};ze.defaultProps={children:void 0,cancelButtonText:"Cancel",confirmButtonText:"Okay",discardButtonText:"Discard",onCancel:void 0,onDiscard:void 0,onModalDisable:void 0,"data-testid":void 0};const Ne=A.forwardRef((s,t)=>{const{children:e,className:n,disabled:o,onClick:a,style:r,id:c}=s;return i.jsx("button",{ref:t,type:"button",className:O("btn",n),onClick:a,style:r,disabled:o,id:c,children:e})});Ne.displayName="Button";Ne.propTypes={children:v.node,className:v.string,disabled:v.bool,onClick:v.func,style:v.shape({}),id:v.string};Ne.defaultProps={children:null,className:"",disabled:!1,onClick:()=>null,style:{},id:""};const Us=Ne;function Vs({className:s,isFlipped:t,children:e,"data-testid":n}){const o=u=>{if(e.length!==2)throw new Error("CardFlip requires 2 children to function");return e[u]},a=l.useRef(null),r=l.useCallback(u=>{u.target===u.currentTarget&&document.body.classList.add("card-flip--is-flipping")},[]),c=l.useCallback(u=>{u.target===u.currentTarget&&document.body.classList.remove("card-flip--is-flipping")},[]);return l.useEffect(function(){if(!a.current)throw Error("ref undefined");a.current.addEventListener("transitionstart",r);const d=a.current;return function(){if(d!=null)return d.removeEventListener("transitionstart",r)}},[r]),i.jsxs("div",{className:O(s,{"card-flip--show-front":t,"card-flip--show-back":!t}),"data-testid":n,children:[i.jsx("div",{className:"card-flip--back",children:o(0)}),i.jsx("div",{ref:a,className:"card-flip--front",onTransitionEnd:c,children:o(1)})]})}const K=class extends l.Component{static handleEnter(t){const e=t;e.style.height="0"}static handleEntering(t){const e=t;e.style.height=`${K.getHeight(e)}px`}static handleExiting(t){const e=t;e.style.height="0"}static handleExit(t){const e=t;e.style.height=`${K.getHeight(e)}px`}static getHeight(t){const e=t.scrollWidth-t.clientWidth;return t.scrollHeight-e}constructor(t){super(t),this.handleEntered=this.handleEntered.bind(this)}handleEntered(t){const e=t;e.style.height="";const{autoFocusOnShow:n}=this.props;if(n!==void 0&&n){const o=e.querySelector("input, select, textarea");o!=null&&o.focus()}}render(){const{children:t,className:e,in:n,"data-testid":o}=this.props;return i.jsx(be,{in:n,classNames:{enterActive:"collapsing",enterDone:"collapse show",exitActive:"collapsing",exitDone:"collapse"},onEnter:K.handleEnter,onEntering:K.handleEntering,onEntered:this.handleEntered,onExit:K.handleExit,onExiting:K.handleExiting,timeout:350,children:a=>i.jsx("div",{className:O({collapse:a==="exited"},e),"data-testid":o,children:t})})}};let ie=K;N(ie,"propTypes",{className:v.string,in:v.bool.isRequired,children:v.node.isRequired,autoFocusOnShow:v.bool,"data-testid":v.string}),N(ie,"defaultProps",{className:"",autoFocusOnShow:!1,"data-testid":void 0});const Bs=ie;function wt(s,t,{autoLoad:e=!0}={}){const[n,o]=l.useState(null),[a,r]=l.useState(null),[c,u]=l.useState(!1),d=l.useCallback(async()=>{u(!0);try{const h=await s(...t);o(h),r(null)}catch(h){o(null),r(h)}finally{u(!1)}},[s,...t]);return l.useEffect(()=>{e&&d()},[e,d]),{data:n,error:a,isError:a!=null,isLoading:c,reload:d}}const Hs=Object.freeze(Object.defineProperty({__proto__:null,useContextOrThrow:xt,useCopyToClipboard:Ln,useForwardedRef:Dn,usePrevious:_n,usePromiseFactory:wt},Symbol.toStringTag,{value:"Module"})),Ws=L.module("TimeInput"),Gs="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]",Ks=["00:00:00","12:34:56","23:59:59"],Ot=A.forwardRef((s,t)=>{const{allowValueWrapping:e=!0,className:n="",onChange:o=()=>!1,value:a=0,onFocus:r=()=>!1,onBlur:c=()=>!1,onSelect:u=()=>!1,"data-testid":d}=s,[h,p]=l.useState(ae.formatTime(a)),[g,m]=l.useState(),b=l.useRef(null);l.useImperativeHandle(t,()=>({focus:()=>{var f;(f=b.current)==null||f.focus()},setSelection:f=>{var S;(S=b.current)==null||S.focus(),m(f)}}),[]),l.useEffect(function(){p(ae.formatTime(a))},[a]);function C(f,S,x){const k=f.selectionStart===0?24:60;let T=parseInt(x,10)-S;return Number.isNaN(T)?T=0:e?T=(T%k+k)%k:T=Math.min(Math.max(0,T),k-1),`${T}`.padStart(2,"0")}function I(f,S,x,k,T){return k===0&&T===2&&S===1&&parseInt(x,10)>1?`0${x}${f.substring(2)}`:Et(f,S,x)}function j(f){Ws.debug("handleChange",f),p(f),ae.isTimeString(f)&&o(ae.parseTime(f))}const P=l.useCallback(f=>{m(f),u(f)},[u]);return i.jsx(Ge,{ref:b,className:n,example:Ks,getNextSegmentValue:C,getPreferredReplacementString:I,onChange:j,onSelect:P,pattern:Gs,selection:g,value:h,onFocus:r,onBlur:c,"data-testid":d})});Ot.defaultProps={allowValueWrapping:!0,className:"",onChange:()=>!1,onSelect:()=>!1,value:0,onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};const xe=Ot;const rt=-1;var jt=(s=>(s.UP="UP",s.DOWN="DOWN",s))(jt||{});const U=class extends l.Component{constructor(e){super(e);N(this,"csContainer");N(this,"menuContainer");N(this,"button");N(this,"input");const{value:n,valueToTime:o}=e;this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleOptionFocus=this.handleOptionFocus.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.handleCustomInput=this.handleCustomInput.bind(this),this.csContainer=A.createRef(),this.menuContainer=A.createRef(),this.button=A.createRef(),this.input=A.createRef(),this.state={keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,customTime:o(n),inputFocused:!1}}getSelectedText(){const{options:e,value:n,placeholder:o}=this.props,{customTime:a}=this.state;if(n===null)return o;for(let r=0;r<e.length;r+=1){const c=e[r];if(c.value===n)return c.title}return ae.formatTime(a)}setInputWidth(){this.csContainer.current&&this.setState({inputWidth:this.csContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.button.current)==null||e.focus()}updateInputValue(e){const{onChange:n}=this.props;n(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var r;const{keyboardOptionIndex:n,inputFocused:o}=this.state,{options:a}=this.props;switch(e.key){case"Enter":case" ":o?this.updateFromCustom():this.updateInputValue(a[n].value),this.closeMenu(),(r=this.button.current)==null||r.focus(),e.stopPropagation(),e.preventDefault();break;case"Tab":e.shiftKey?this.handleMenuNavigation(U.MENU_NAVIGATION_DIRECTION.UP):this.handleMenuNavigation(U.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(U.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(U.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":this.closeMenu();break}}handleMenuNavigation(e){const{keyboardOptionIndex:n,inputFocused:o}=this.state,{options:a}=this.props,r=a.length;let c=n;switch(e){case U.MENU_NAVIGATION_DIRECTION.UP:if(!o&&n===0){this.focusInput();break}else o&&this.focusOption(n);n>0&&!o?(c=(c-1)%r,this.setState({keyboardOptionIndex:c})):n===0&&(c=r-1,this.setState({keyboardOptionIndex:c})),this.scrollOptionIntoView(c);break;case U.MENU_NAVIGATION_DIRECTION.DOWN:if(!o&&n===r-1){this.focusInput();break}else o&&this.focusOption(n);n<r&&!(o&&n===0)&&(c=(c+1)%r,this.setState({keyboardOptionIndex:c})),this.scrollOptionIntoView(c);break}}handleOptionClick(e){const n=Number(e.currentTarget.value),{options:o,timeToValue:a}=this.props,{customTime:r}=this.state;if(n===rt){const c=a(r);this.updateAndClose(c)}else this.updateAndClose(o[n].value)}updateAndClose(e){var n;this.updateInputValue(e),this.closeMenu(),(n=this.button.current)==null||n.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleMenuOpened(){var c;const{options:e,value:n}=this.props,{keyboardOptionIndex:o}=this.state;this.scrollOptionIntoView(o);const a=(c=this.menuContainer.current)==null?void 0:c.querySelector(".cs-option-btn.keyboard-active");if(a instanceof HTMLElement&&a.focus(),n===null)return;e.map(u=>u.value).indexOf(n)<0&&this.focusInput()}focusInput(){var e;(e=this.input.current)==null||e.focus()}focusOption(e){var o;const n=(o=this.menuContainer.current)==null?void 0:o.querySelector(".cs-options");if(n&&n.children!=null){const a=n.children.item(e);a instanceof HTMLElement&&a.focus()}}handleMenuExited(){const{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}handleCustomInput(e){const{timeToValue:n}=this.props,o=n(e);this.updateInputValue(o),this.setState({customTime:e})}updateFromCustom(){const{timeToValue:e}=this.props,{customTime:n}=this.state,o=e(n);this.updateInputValue(o)}toggleMenu(e){const{menuIsOpen:n}=this.state;n?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0})}closeMenu(e=!0){var n;this.setState({menuIsOpen:!1}),e&&((n=this.button.current)==null||n.focus())}updateKeyboardIndex(){const{options:e,value:n}=this.props;if(n===null)return;const o=e.map(a=>a.value).indexOf(n);o>0&&this.setState({keyboardOptionIndex:o})}scrollOptionIntoView(e){var o;const n=(o=this.menuContainer.current)==null?void 0:o.querySelector(".cs-options");if(n&&n.children!=null){const a=n.children.item(e);a instanceof HTMLElement&&a.offsetTop>U.DROP_DOWN_MENU_HEIGHT?n.scrollTop=a.offsetTop-U.DROP_DOWN_MENU_HEIGHT:(a instanceof HTMLElement&&a.offsetTop<0||e===0)&&(n.scrollTop=0)}}renderMenuElement(){const{inputWidth:e}=this.state;return i.jsx("div",{className:"cs-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:n=>{n.stopPropagation()},style:{width:e},children:i.jsx("div",{className:"cs-options-container",children:i.jsx("div",{className:"cs-options",children:this.renderOptions()})})})}renderOptions(){const{options:e,value:n,icon:o,customText:a}=this.props,{keyboardOptionIndex:r,customTime:c,inputFocused:u}=this.state;let d=!1;const h=[];for(let p=0;p<e.length;p+=1){const g=e[p],m=`option-${p}-${g.value}`;d=d||g.value===n,h.push(i.jsxs("button",{type:"button",value:p,className:O("cs-option-btn",{"keyboard-active":r===p&&!u}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[g.value===n&&i.jsx(z,{icon:o,className:"mr-2"}),g.value!==n&&i.jsx("span",{className:"mr-4"}),g.title]},m))}return h.push(i.jsx("hr",{className:"cs-divider"},"option-divider")),h.push(i.jsxs("button",{type:"button",value:rt,className:O("cs-option-btn",{"keyboard-active":u}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[!d&&n!==null?i.jsx(z,{icon:o,className:"mr-2"}):i.jsx("span",{className:"mr-4"}),a]},"option-custom-label")),h.push(i.jsxs("div",{className:"cs-custom-container",children:[i.jsx("span",{className:"mr-2"}),i.jsx(xe,{ref:this.input,onChange:this.handleCustomInput,value:c,onFocus:()=>this.setState({inputFocused:!0}),onBlur:()=>this.setState({inputFocused:!1})},"option-input"),i.jsx("span",{className:"ml-2"})]},"cs-custom-container")),h.push(i.jsx("hr",{className:"mb-2"},"option-end")),h}render(){const{disabled:e,invalid:n,value:o,"data-testid":a}=this.props,{menuIsOpen:r}=this.state;let{popperOptions:c}=this.props;return c={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...c},i.jsx("div",{className:"input-group cs-container context-menu",ref:this.csContainer,"data-testid":a,children:i.jsx("div",{className:O("input-group-append cs-dropdown",{"cs-dropdown-invalid":n}),children:i.jsxs("button",{type:"button",className:O("btn cs-btn form-control",{"cs-btn-invalid":n}),ref:this.button,onClick:this.toggleMenu,disabled:e,children:[i.jsx("span",{className:O({"text-muted":o===null}),children:this.getSelectedText()}),i.jsx("span",{children:i.jsx(z,{icon:bt,className:"cs-caret"})}),i.jsx(Tt,{isShown:r,actions:{menuElement:this.renderMenuElement()},popperOptions:c,popperClassName:"CustomTimeSelect",onMenuOpened:this.handleMenuOpened,onMenuClosed:this.handleMenuExited,menuStyle:{maxWidth:"100rem"}})]})})})}};let Q=U;N(Q,"MENU_NAVIGATION_DIRECTION",jt),N(Q,"DROP_DOWN_MENU_HEIGHT",125),N(Q,"defaultProps",{onChange(){},value:null,disabled:!1,popperOptions:{},icon:Sn,customText:"Custom",placeholder:"Select a time",valueToTime:e=>e===null?0:Math.round(e/1e3),timeToValue:e=>e*1e3,invalid:!1,"data-testid":void 0});const qs=Q,zs=L.module("DateInput"),Ys="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",Zs=["2000-01-01","2022-12-31"],Js="YYYY-MM-DD",Ye=A.forwardRef((s,t)=>{const{className:e="",onChange:n=()=>{},defaultValue:o="",onFocus:a=()=>{},onBlur:r=()=>{},"data-testid":c}=s,[u,d]=l.useState(o),[h,p]=l.useState(),g=l.useCallback(m=>{zs.debug("handleChange",m),d(m),n(m)},[n]);return i.jsx("div",{className:"d-flex flex-row align-items-center",children:i.jsx(Ge,{ref:t,className:O(e),example:Zs,getNextSegmentValue:Fn,onChange:g,onSelect:p,pattern:Ys,placeholder:Js,selection:h,value:u,onFocus:a,onBlur:r,"data-testid":c})})});Ye.displayName="DateInput";Ye.defaultProps={className:"",onChange:()=>!1,defaultValue:"",onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};const Qs=Ye;class Mt extends l.PureComponent{constructor(e){super(e);N(this,"searchInput");this.searchInput=A.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=ve(this.sendUpdate.bind(this),e.debounceMs),this.state={value:e.value}}componentDidUpdate(e){const{value:n}=this.props;e.value!==n&&this.setState({value:n})}focus(){var e;(e=this.searchInput.current)==null||e.focus()}handleChange(e){this.setState({value:e.target.value},this.sendUpdate)}sendUpdate(){const{onChange:e}=this.props,{value:n}=this.state;e(n)}render(){const{placeholder:e,className:n,matchCount:o,id:a,"data-testid":r}=this.props,{value:c}=this.state;return i.jsx(Ke,{value:c,placeholder:e,onChange:this.handleChange,className:n,matchCount:o,ref:this.searchInput,id:a,"data-testid":r})}}N(Mt,"defaultProps",{placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0});const Xs=Mt;function ea(s){const{isInvalid:t=!1,items:e,onAdd:n=()=>{},onDelete:o=()=>{},validate:a=()=>null}=s,[r,c]=l.useState(null),[u,d]=l.useState([]),[h,p]=l.useState(""),g=l.useCallback(f=>{d(f)},[]),m=l.useCallback(()=>{o(it.getItemsInRanges(e,u)),d([])},[e,u,o]),b=l.useCallback(()=>{if(h==="")return;const f=a(h);f==null?(n(h),p("")):c(f)},[h,n,a]),C=l.useCallback(f=>{const{value:S}=f.target;p(S),c(S===""?null:a(S))},[a]),I=l.useCallback(()=>{d([])},[]),j=l.useCallback(f=>{f.key==="Enter"&&b()},[b]),P=l.useMemo(()=>14+Ae(e.length,1,6)*Le.DEFAULT_ROW_HEIGHT,[e.length]);return i.jsxs("div",{className:O("editable-item-list-container",{"is-invalid":t}),children:[i.jsx("div",{style:{height:P},children:i.jsx(Le,{itemCount:e.length,items:e.map((f,S)=>({value:f,isSelected:it.isSelected(u,S)})),offset:0,selectedRanges:u,onSelectionChange:g,isMultiSelect:!0})}),i.jsxs("div",{className:"d-flex flex-row pt-2",children:[i.jsx("div",{className:"d-flex flex-grow-1",children:i.jsx("input",{className:O("form-control",{"is-invalid":r!=null}),placeholder:"Enter value",type:"text",value:h,onChange:C,onFocus:I,onKeyDown:j})}),i.jsxs("div",{className:"d-flex align-items-start mt-1 ml-2",children:[i.jsx(H,{kind:"ghost",onClick:b,disabled:r!=null||h==="",icon:wn,tooltip:"Add new item","data-testid":"add-item-button"}),i.jsx(H,{kind:"ghost",onClick:m,disabled:u.length===0,icon:On,tooltip:"Delete selected items","data-testid":"delete-item-button"})]})]})]})}const le=class extends l.Component{static isParentSelected(t,e){const n=e.get(t);if(n===void 0)return!1;if(typeof n=="boolean")return n;const o=Array.from(n.values()).includes(!0),a=Array.from(n.values()).includes(!1);return o&&a?null:o}constructor(t){super(t),this.toggleMenu=this.toggleMenu.bind(this),this.toggleValueFor=this.toggleValueFor.bind(this),this.selectAll=this.selectAll.bind(this),this.clear=this.clear.bind(this),this.state={menuIsOpen:!1}}toggleMenu(t){t.stopPropagation(),t.preventDefault(),this.setState(e=>{const{menuIsOpen:n}=e;return{menuIsOpen:!n}})}toggleValueFor(t,e){const{valueMap:n,onUpdateValueMap:o}=this.props,a=new Map(n),r=a.get(t);if(r instanceof Map){const u=new Map(r);if(e!=null)u.set(e,r.get(e)===void 0);else{const d=le.isParentSelected(t,a),h=d==null||!d;r.forEach((p,g)=>u.set(g,h))}a.set(t,u)}else a.set(t,r==null||!r);const c=a.get(t);if(e===void 0&&c!==void 0&&typeof c!="boolean"){const u=le.isParentSelected(t,n);u!=null&&u?c.forEach((d,h)=>c.set(h,!1)):c.forEach((d,h)=>c.set(h,!0))}o(a)}setAllValues(t){const{valueMap:e,onUpdateValueMap:n}=this.props,o=new Map;e.forEach((a,r)=>{if(typeof a=="boolean")o.set(r,t);else{const c=new Map;a.forEach((u,d)=>c.set(d,t)),o.set(r,c)}}),n(o)}selectAll(){this.setAllValues(!0)}clear(){this.setAllValues(!1)}renderMenuElement(){const{valueMap:t,"data-testid":e}=this.props;return i.jsxs("div",{className:"hcm-menu-container",children:[Array.from(t.entries()).map(([n,o])=>i.jsxs("div",{children:[i.jsx(De,{className:"hcm-parent",checked:le.isParentSelected(n,t),onChange:()=>this.toggleValueFor(n),children:n}),o!==void 0&&typeof o!="boolean"&&Array.from(o.entries()).map(([a,r])=>i.jsx(De,{className:"hcm-child",checked:r,onChange:()=>this.toggleValueFor(n,a),children:a},a))]},n)),i.jsx(H,{kind:"ghost",onClick:this.selectAll,"data-testid":e!==void 0?`${e}-btn-select-all`:void 0,children:"Select All"}),i.jsx(H,{kind:"ghost",onClick:this.clear,"data-testid":e!==void 0?`${e}-btn-clear`:void 0,children:"Clear"})]})}render(){const{menuText:t,className:e,icon:n,id:o,"data-testid":a}=this.props,{menuIsOpen:r}=this.state;return i.jsxs("button",{type:"button",className:O("btn hcm-btn",e),onClick:this.toggleMenu,id:o,"data-testid":a,children:[i.jsxs("span",{children:[n&&i.jsx(z,{icon:n,className:"hcm-icon mr-1"}),t]}),i.jsx(z,{icon:bt,className:"hcm-icon ml-1"}),i.jsx(We,{options:{placement:"bottom"},isShown:r,onExited:()=>{this.setState({menuIsOpen:!1})},closeOnBlur:!0,interactive:!0,children:this.renderMenuElement()})]})}};let ge=le;N(ge,"defaultProps",{className:"",icon:null,id:"","data-testid":void 0});const ta=ge;const na=.025,sa=.9,aa=.1,ia=.618,je=Z["primary-dark"],lt=80,oa=Z["gray-800"],ra=Z["gray-900"],Y={SIZE:8,DOT_SIZE:2,FILL_OPACITY:.25},W=18,la=250,ca=60*1e3,ua=A.memo(()=>{const s=l.useRef(null),t=l.useRef(null),[e,n]=l.useState(!1),o=window.devicePixelRatio;let a,r,c,u,d,h=null,p=[];function g(){t.current!=null&&(c=t.current.offsetWidth,u=t.current.offsetHeight),s.current!=null&&(s.current.style.width=`${c}px`,s.current.style.height=`${u}px`,s.current.width=c*o,s.current.height=u*o),a==null||a.scale(o,o)}function m(){const y=document.createElement("canvas");y.width=Y.SIZE,y.height=Y.SIZE;const E=y.getContext("2d");return E!=null&&(E.fillStyle=je,E.fillRect(0,0,Y.DOT_SIZE,Y.DOT_SIZE),E.fillStyle=je+Math.round(255*Y.FILL_OPACITY).toString(16).padStart(2,"0"),E.fillRect(0,0,Y.SIZE,Y.SIZE)),E==null?void 0:E.createPattern(y,"repeat")}function b(y){const E=Math.random()-.5;let D=na*E;return y<aa?D=Math.abs(D):y>sa&&(D=-Math.abs(D)),y+D}function C(){const y=[];let E=ia;for(let D=0;D<c+W;D+=1)E=b(E),y.push(E);return y}function I(){for(;p.length>=c+W;)p.pop();for(;p.length<c+W;)p.push(b(p[p.length-1]))}function j(y,E){E.beginPath(),E.moveTo(-1,u+1),E.lineTo(-1,u*y[0]);for(let D=0;D<y.length;D+=1)E.lineTo(D,u*y[D]);E.lineTo(c+W,u*y[y.length-1]),E.lineTo(c+W,u+1),E.closePath()}function P(y){y.beginPath();for(let E=1;E<c;E+=lt)y.moveTo(E,0),y.lineTo(E,u);for(let E=1;E<u;E+=lt)y.moveTo(0,E),y.lineTo(c,E)}function f(y){h=h??y,$n(a),a.fillStyle=ra,a.fillRect(0,0,c,u),P(a),a.lineWidth=1,a.strokeStyle=oa,a.stroke();const E=((h??0)-(y??0))/(1e3/W);if(a.translate(E,0),j(p,a),a.lineWidth=2,a.strokeStyle=je,a.stroke(),a.translate(-E,0),r!=null&&(a.fillStyle=r),a.fill(),a.setTransform(o,0,0,o,0,0),(y??0)-(h??0)>1e3/W){const D=Math.floor(((y??0)-(h??0))/(1e3/W));for(let de=0;de<D;de+=1)p.shift(),p.push(b(p[p.length-1]));h=y}d!=null&&cancelAnimationFrame(d),d=requestAnimationFrame(f)}const S=ve(()=>{d=requestAnimationFrame(y=>{g(),I(),n(!1),f(y)})},la,{leading:!0});function x(){n(!0),d!=null&&cancelAnimationFrame(d),d=null,h=null}const k=ve(()=>{x()},ca);function T(){d==null&&(n(!1),g(),I(),d=requestAnimationFrame(f)),k()}function V(){document.hasFocus()&&T()}function ne(){d!=null&&cancelAnimationFrame(d),k(),S()}return l.useEffect(()=>{var y;return a=(y=s.current)==null?void 0:y.getContext("2d",{alpha:!1}),g(),p=C(),r=m(),f(),k(),window.addEventListener("resize",ne),window.addEventListener("focus",T),window.addEventListener("blur",x),window.addEventListener("mousemove",V),window.addEventListener("keydown",V),()=>{d!=null&&cancelAnimationFrame(d),window.removeEventListener("resize",ne),window.removeEventListener("focus",T),window.removeEventListener("blur",x),window.removeEventListener("mousemove",V),window.removeEventListener("keydown",V),k.cancel(),S.cancel()}},[]),i.jsx("div",{className:"random-area-plot-animation-container",ref:t,children:i.jsx("canvas",{ref:s,className:e?"shade":""})})}),Rt=ua;const Ze=A.forwardRef((s,t)=>{const{children:e,className:n,disabled:o,id:a,isLinked:r,isLinkedSource:c,isInvalid:u,onClick:d,onMouseEnter:h,onMouseLeave:p,style:g,"data-testid":m}=s;return i.jsxs("button",{ref:t,type:"button",className:O("btn-socketed",{"btn-socketed-linked":r!==void 0&&r||c},{"btn-socketed-linked-source":c},{"is-invalid":u},n),id:a,onClick:d,onMouseEnter:h,onMouseLeave:p,style:g,disabled:o,"data-testid":m,children:[e,i.jsx(z,{icon:jn,className:"linked btn-socketed-icon",transform:"down-1"}),i.jsx(z,{icon:Mn,className:"is-invalid btn-socketed-icon"})]})});Ze.displayName="SocketedButton";Ze.defaultProps={children:void 0,className:"",disabled:!1,id:void 0,isLinked:!1,isLinkedSource:!1,isInvalid:!1,onClick:void 0,onMouseEnter:void 0,onMouseLeave:void 0,style:void 0,"data-testid":void 0};const da=Ze,ha={"dh-spectrum-theme--dark":"_dh-spectrum-theme--dark_i6xja_5"},pa={"dh-spectrum-theme--light":"_dh-spectrum-theme--light_16vb7_5"},{global:fa,light:ma,dark:ga,medium:va,large:ba}=bn,Ca={global:fa,light:{...ma,...pa},dark:{...ga,...ha},medium:va,large:ba},xa="_track_535ju_30",Ea="_handle_535ju_13",Ta="_ticks_535ju_98",Pt={"handle-size":"15px","popover-width":"90px","time-slider":"_time-slider_535ju_3","time-slider-popovers":"_time-slider-popovers_535ju_8","handle-popper":"_handle-popper_535ju_13","flex-spacer":"_flex-spacer_535ju_26",track:xa,"track-fills":"_track-fills_535ju_37","track-fill":"_track-fill_535ju_37","track-fill-start":"_track-fill-start_535ju_55","track-fill-middle":"_track-fill-middle_535ju_56","track-fill-end":"_track-fill-end_535ju_59","handle-track":"_handle-track_535ju_62",handle:Ea,ticks:Ta,"tick-labels":"_tick-labels_535ju_116","tick-label":"_tick-label_535ju_116","tick-label-wrapper":"_tick-label-wrapper_535ju_132"};const fe=parseInt(Pt["handle-size"],10),ct=parseInt(Pt["popover-width"],10),F=24*60*60-1,ut=5*60;function ya({startTime:s,endTime:t,onChange:e,isStartModified:n=!1,isEndModified:o=!1,"data-testid":a}){const[r,c]=l.useState(s),[u,d]=l.useState(t),h=l.useRef(null);l.useEffect(function(){c(s),d(t)},[s,t]);const p=l.useCallback((b,C)=>{let I=b,j=C;I===j&&(j<F?j+=1:I-=1),c(I),d(j),e({startTime:I,endTime:j})},[c,d,e]),g=l.useCallback(b=>{p(b,u)},[p,u]),m=l.useCallback(b=>{p(r,b)},[p,r]);return i.jsxs("div",{className:"time-slider","data-testid":a,children:[i.jsx(Na,{startTime:r,endTime:u,onStartTimeChange:g,onEndTimeChange:m,isStartModified:n,isEndModified:o}),i.jsxs("div",{className:"track",ref:h,children:[i.jsx(ka,{startTime:r,endTime:u}),i.jsx("div",{className:"ticks",children:Array(24).fill(null).map((b,C)=>i.jsx("div",{className:"tick"},C))}),i.jsx(dt,{track:h,time:r,setTime:g}),i.jsx(dt,{track:h,time:u,setTime:m})]}),i.jsxs("div",{className:"tick-labels",children:[i.jsx("div",{className:"tick-label",children:"0:00"}),i.jsx("div",{className:"tick-label-wrapper",children:Array(24).fill(null).map((b,C)=>i.jsx("div",{className:"tick-label",children:`${C+1}:00`},C))})]})]})}function Na(s){const{startTime:t,endTime:e,onStartTimeChange:n,onEndTimeChange:o,isStartModified:a,isEndModified:r,"data-testid":c}=s,u=t>e,[d,h]=l.useState(u?e:t),[p,g]=l.useState(u?t:e),m=l.useRef(null),b=l.useRef(null),C=l.useRef(null),I=l.useRef(null);l.useEffect(function(){h(t>e?e:t),g(t>e?t:e)},[t,e]),l.useEffect(function(){var k,T;C.current!==null&&((k=b.current)==null||k.setSelection(C.current)),I.current!==null&&((T=m.current)==null||T.setSelection(I.current))},[u]);function j(x){t<=e?n(x):o(x)}function P(x){t<=e?o(x):n(x)}const f=l.useCallback(x=>{C.current=x,I.current=null},[]),S=l.useCallback(x=>{C.current=null,I.current=x},[]);return i.jsxs("div",{className:"time-slider-popovers",children:[i.jsx("div",{className:"flex",style:{flexBasis:`calc(${d/F*100}% - ${ct/2}px)`}}),i.jsxs("div",{className:"handle-popper",children:[i.jsx("label",{className:O({modified:u?r:a}),children:u?"End Time":"Start Time"}),i.jsx(xe,{ref:m,allowValueWrapping:!1,value:d,onChange:j,onSelect:f,"data-testid":c!==void 0?`${c}-input-1`:void 0})]}),i.jsx("div",{className:"flex-spacer"}),i.jsxs("div",{className:"handle-popper",children:[i.jsx("label",{className:O({modified:u?a:r}),children:u?"Start Time":"End Time"}),i.jsx(xe,{ref:b,allowValueWrapping:!1,value:p,onChange:P,onSelect:S,"data-testid":c!==void 0?`${c}-input-2`:void 0})]}),i.jsx("div",{className:"flex",style:{flexBasis:`calc(${(F-p)/F*100}% - ${ct/2}px)`}})]})}function ka(s){const{startTime:t,endTime:e,"data-testid":n}=s;return i.jsxs("div",{className:"track-fills","data-testid":n,children:[t>e&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"track-fill track-fill-start",style:{transform:`scaleX(${e/F})`}}),i.jsx("div",{className:"track-fill track-fill-end",style:{transform:`scaleX(${(F-t)/F})`}})]}),t<e&&i.jsx("div",{className:"track-fill track-fill-middle",style:{transform:`translateX(${t/F*100}%) scaleX(${(e-t)/F})`}})]})}function dt(s){const{track:t,time:e,setTime:n,"data-testid":o}=s,a=l.useMemo(()=>{let m=fe/2;return e<3600?m=e/3600*(fe/2):e>23*3600&&(m=fe/2+1/(F-23*3600)*(e-23*3600)*(fe/2)),`translateX(calc(${e/F*100}% - ${m}px))`},[e]),r=l.useCallback(g=>{if(!t.current)return 0;const m=t.current.getBoundingClientRect(),b=Math.max(g-m.left,0),C=F*Math.min(1,b/m.width),I=ut*Math.round(C/ut);return Math.min(F,I)},[t]),c=l.useCallback(({clientX:g})=>{n(r(g))},[n,r]),u=l.useCallback(({clientX:g})=>{n(r(g)),window.removeEventListener("mousemove",c),window.removeEventListener("mouseup",u),document.documentElement.classList.remove("drag-pointer-events-none")},[n,r,c]),d=l.useCallback(()=>{window.addEventListener("mousemove",c),window.addEventListener("mouseup",u),document.documentElement.classList.add("drag-pointer-events-none")},[c,u]),h=l.useCallback(()=>{window.removeEventListener("mousemove",c),window.removeEventListener("mouseup",u),document.documentElement.classList.remove("drag-pointer-events-none")},[c,u]),p=l.useCallback(()=>{d()},[d]);return l.useEffect(function(){return()=>{h()}},[h]),i.jsx("div",{className:"handle-track",style:{transform:a},children:i.jsx("button",{className:"handle",type:"button","aria-label":"Change time",onMouseDown:p,"data-testid":o})})}function At({buttons:s,isShown:t=!1,classNames:e,message:n,type:o,onClick:a,onDismiss:r,"data-testid":c}){const u=s&&s.length!==0;return i.jsx(be,{in:t,timeout:Z.transitionMs,classNames:"toast-notification-slide-up",mountOnEnter:!0,unmountOnExit:!0,children:i.jsxs("div",{className:O("toast-notification",e,o),role:"presentation",onClick:a,onKeyPress:a,"data-testid":c,children:[i.jsx("div",{className:"message-container",children:i.jsx("span",{className:"message",children:n})}),i.jsx(be,{in:u,timeout:Z.transitionSlowMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:i.jsx("div",{className:"buttons-container",children:s})}),r&&i.jsx(H,{kind:"ghost",icon:Rn,tooltip:"Close notification",className:"my-2",onClick:r})]})})}At.TYPE=Object.freeze({ERROR:"error"});function Ia(s){const{children:t,className:e,labelText:n,hintText:o,isModified:a,validationError:r,showValidationError:c=!0,"data-testid":u,id:d}=s,{current:h}=l.useRef(d??Te());return i.jsxs(i.Fragment,{children:[i.jsx("label",{className:O("validate-label",e,{modified:a}),htmlFor:h,"data-testid":u,children:n}),A.Children.toArray(t).map(p=>A.isValidElement(p)?A.cloneElement(p,{className:O(p.props.className,{"is-invalid":r})}):i.jsx("div",{className:O(e),children:p})),o!==void 0&&i.jsx("small",{className:"form-text text-muted",children:o}),r!==void 0&&c&&i.jsx("p",{className:"validate-label-error text-danger",children:r})]})}const Sa=Object.freeze(Object.defineProperty({__proto__:null,AutoCompleteInput:Fs,AutoResizeTextarea:qe,BasicModal:ze,Button:H,ButtonGroup:ue,ButtonOld:Us,CardFlip:Vs,Checkbox:De,Collapse:Bs,ComboBox:Un,ContextActionUtils:Vn,ContextActions:Bn,ContextMenuItem:Hn,ContextMenuRoot:Wn,CopyButton:Gn,CustomTimeSelect:qs,DEFAULT_GET_PREFERRED_REPLACEMENT_STRING:Et,DateInput:Qs,DateTimeInput:Kn,DebouncedSearchInput:Xs,DragUtils:qn,DraggableItemList:zn,DropdownMenu:Tt,EditableItemList:ea,GLOBAL_SHORTCUTS:Yn,HierarchicalCheckboxMenu:ta,InfoModal:$s,ItemList:Le,ItemListItem:Zn,KEY:Jn,LoadingOverlay:te,LoadingSpinner:Ct,MODIFIER:Qn,MaskedInput:Ge,Menu:Xn,MenuItem:es,Modal:Be,ModalBody:He,ModalFooter:St,ModalHeader:vt,Option:ts,Page:ns,Popper:We,RadioGroup:ss,RadioItem:as,RandomAreaPlotAnimation:Rt,SearchInput:Ke,Select:is,SelectValueList:yt,Shortcut:os,ShortcutRegistry:rs,SocketedButton:da,Stack:ls,ThemeExport:Z,TimeInput:xe,TimeSlider:ya,ToastNotification:At,Tooltip:cs,UISwitch:us,ValidateLabelInput:Ia,fillToLength:ds,themeDHDefault:Ca,trimTrailingMask:hs},Symbol.toStringTag,{value:"Module"})),wa=Object.freeze(Object.defineProperty({__proto__:null,ApiBootstrap:Pn,ApiContext:An,ClientBootstrap:Nt,ClientContext:ps,useApi:ye,useClient:ce},Symbol.toStringTag,{value:"Module"})),Me=L.module("MessageUtils"),Lt="io.deephaven.message.LoginOptions.request",Dt="io.deephaven.message.SessionDetails.request",_t="io.deephaven.broadcast",Je="io.deephaven.broadcast.Login",Ft="io.deephaven.broadcast.Logout";function ke(s){const t=s;return t!=null&&typeof t.id=="string"&&typeof t.message=="string"}function $t(s){return ke(s)&&s.message===Je}function Ut(s){return ke(s)&&s.message===Ft}function Vt(s){const t=s;return t!=null&&typeof t.id=="string"}function Qe(s,t=Te(),e){return{message:s,id:t,payload:e}}function Oa(s,t){return{id:s,payload:t}}async function Xe(s,t=3e4){if(window.opener==null)throw new Error("window.opener is null, unable to send request.");return new Promise((e,n)=>{let o;const a=Te(),r=c=>{const{data:u}=c;if(!Vt(u)){Me.debug("Ignoring non-deephaven response",u);return}if(Me.debug("Received message",u),(u==null?void 0:u.id)!==a){Me.debug("Ignore message, id doesn't match",u);return}window.clearTimeout(o),window.removeEventListener("message",r),e(u.payload)};window.addEventListener("message",r),o=window.setTimeout(()=>{window.removeEventListener("message",r),n(new fs("Request timed out"))},t),window.opener.postMessage(Qe(s,a),"*")})}class Bt extends Error{constructor(){super(...arguments);N(this,"isNoConsolesError",!0)}}function Ht(s){return s.isNoConsolesError}const X=L.module("SessionUtils");function ja(s){return X.info(`Starting connection to '${s}'...`),new dh.IdeConnection(s)}async function Wt(s,t){X.info("Getting console types...");const e=await s.getConsoleTypes();if(e.length===0)throw new Bt("No console types available");X.info("Available types:",e);const n=e[0];X.info("Starting session with type",n);const o=await s.startSession(n),a={type:n,id:Te.generate()};return X.info("Console session established",a),{session:o,config:a,connection:s,details:t}}function Ma(s,t){return X.info("createCoreClient",s),new dh.CoreClient(s,t)}async function Ra(){return Xe(Dt)}async function Pa(){switch(new URLSearchParams(window.location.search).get("authProvider")){case"parent":return Ra()}return{}}async function Aa(s,t){let e;try{e=await Wt(s,t)}catch(n){if(!Ht(n))throw n}return e}const La=L.module("ViewportDataUtils");function Gt(s,t){return String(s.offsetInSnapshot+t)}function Kt(s,t,e){return function(o){if(s==null)return;const{offset:a,rows:r}=o.detail;La.debug("table updated",o.detail),r.forEach(c=>{const u=e(c,s.columns),d={key:Gt(c,a),item:u};t.getItem(d.key)!=null?t.update(d.key,d):t.append(d)})}}function qt(s,t){return t.reduce((e,n)=>(e[n.name]=s.get(n),e),{})}function*zt(s){for(let t=0;t<s;++t)yield{key:String(t)}}function Ie(s){return s==null||et(s)?0:s.size}function et(s){return"isClosed"in s?s.isClosed:!1}function Yt(s,t,e,n){const o=s+t-1,[a,r]=[0,n-1],c=Ae(s-e,a,r),u=Ae(o+e,a,r);return[c,u]}const Da=Object.freeze(Object.defineProperty({__proto__:null,BROADCAST_CHANNEL_NAME:_t,BROADCAST_LOGIN_MESSAGE:Je,BROADCAST_LOGOUT_MESSAGE:Ft,BooleanColumnFormatter:ms,CharColumnFormatter:gs,DateTimeColumnFormatter:vs,DateUtils:bs,DecimalColumnFormatter:Cs,DefaultColumnFormatter:xs,FETCH_TIMEOUT:Es,Formatter:kt,FormatterUtils:_e,IntegerColumnFormatter:Ts,LOGIN_OPTIONS_REQUEST:Lt,NoConsolesError:Bt,SESSION_DETAILS_REQUEST:Dt,StringColumnFormatter:ys,TableColumnFormatter:Ns,TableUtils:ks,createConnection:ja,createCoreClient:Ma,createKeyFromOffsetRow:Gt,createOnTableUpdatedHandler:Kt,createSessionWrapper:Wt,defaultRowDeserializer:qt,fetchVariableDefinition:Is,generateEmptyKeyedItems:zt,getColumnFormats:Ss,getDateTimeFormatterOptions:ws,getSessionDetails:Pa,getSize:Ie,isBroadcastLoginMessage:$t,isBroadcastLogoutMessage:Ut,isClosed:et,isCustomColumnFormatDefined:Os,isMessage:ke,isNoConsolesError:Ht,isResponse:Vt,loadSessionWrapper:Aa,makeMessage:Qe,makeResponse:Oa,padFirstAndLastRow:Yt,requestParentResponse:Xe},Symbol.toStringTag,{value:"Module"})),ht=L.module("useTableListener"),_a=(s,t,e)=>l.useEffect(function(){if(s==null){ht.debug2("Emitter undefined, skipping addEventListener",t);return}return ht.debug2("Adding listener",t),s.addEventListener(t,e)},[s,t,e]),oe=_a;class Fa extends Error{constructor(){super(...arguments);N(this,"isColumnNameError",!0)}}const $a=Fa;class Ua extends Error{constructor(){super(...arguments);N(this,"isTableDisconnectError",!0)}}const Va=Ua,me=L.module("useTable"),Ba=(s,t,e,n)=>{const o=ye(),[a,r]=l.useState(void 0),[c,u]=l.useState([]),[d,h]=l.useState(null),[p,g]=l.useState(null);l.useEffect(()=>{if(n===void 0){r(s==null?void 0:s.columns),h(null);return}try{r(s==null?void 0:s.findColumns(n)),h(null)}catch(I){me.error("Column not found",I,n),h(new $a("Invalid columnNames argument"))}},[s,n]),l.useEffect(()=>{if(!a||!s){me.debug2("Table or column not initialized, skip viewport update.");return}me.debug2("Setting viewport",t,e),s.setViewport(t,e,a)},[a,s,t,e]);const m=l.useCallback(({detail:I})=>{if(!a){me.error("Columns not initialized.");return}const j=a.map(P=>I.rows.map(f=>f.get(P)));u(j)},[a]),b=l.useCallback(()=>{g(new Va("Table disconnected"))},[]),C=l.useCallback(()=>{g(null)},[]);return oe(s,o.Table.EVENT_UPDATED,m),oe(s,o.Table.EVENT_DISCONNECT,b),oe(s,o.Table.EVENT_RECONNECT,C),{columns:a,data:c,error:p??d}},Zt=Ba,Ha=(s,t,e,n)=>{const o=l.useMemo(()=>[n],[n]),{columns:a=[],data:r=[],error:c}=Zt(s,t,e,o);return{column:a[0],data:r[0],error:c}},Jt=Ha;const B=L.module("TableInput"),Re=250;function tt(s){const{className:t=void 0,columnName:e,settings:n,defaultValue:o=[],isInvalid:a=!1,onChange:r=()=>!1,onBlur:c=()=>!1,table:u}=s,d=l.useRef(null),h=l.useMemo(()=>{const M=_e.getColumnFormats(n),w=_e.getDateTimeFormatterOptions(n),{defaultDecimalFormatOptions:R={},defaultIntegerFormatOptions:$={}}=n;return new kt(M,w,R,$)},[n]),[p,g]=l.useState(""),[m,b]=l.useState(new Set(o)),[C,I]=l.useState(),j=l.useRef(null),P=Math.min((C==null?void 0:C.size)??0,Re),{column:f,data:S,error:x}=Jt(C,0,Re-1,e),k=l.useCallback(M=>f?h.getFormattedString(M,f.type,f.name):`${M}`,[f,h]),[T,V]=l.useMemo(()=>{const M=new Set(m),w=[];if(S==null)return[w,null];if(S.forEach(R=>{const $=`${R}`,pe=m.has($);pe&&M.delete($),w.push({value:$,displayValue:k(R),isSelected:pe})}),M.size>0){B.debug2("Selection has items that are missing from the viewport");const R=new Set(m);return Array.from(M).forEach($=>{R.delete($)}),[w,R]}return[w,null]},[S,m,k]);l.useEffect(()=>{V!==null&&(b(V),r(Array.from(V)))},[r,V]);const ne=l.useCallback(async M=>{try{const w=await M;B.debug("Table resolved",w),I(w)}catch(w){if(ot.isCanceled(w))return;B.error(w)}},[]);l.useEffect(()=>{const M=ot.makeCancelable(u);return ne(M),()=>{B.debug2("Cancel table promise"),M.cancel()}},[u,ne]);const y=l.useCallback(M=>{var $;const{value:w}=M.target;g(w);const R=T.findIndex(pe=>pe.displayValue.includes(w));R>-1?(B.debug2(`Found ${w} at index ${R}`),($=j.current)==null||$.scrollIntoView(R)):B.debug2(`${w} not found`)},[T,j]),E=l.useCallback(M=>{if(B.debug("handleSelect",M),M>=T.length){B.error("Invalid index",M);return}const w=T[M].value,R=new Set(m);T[M].isSelected?R.delete(w):R.add(w),b(R),r(Array.from(R))},[r,T,m]),D=l.useCallback(()=>{const M=T.map(R=>R.value),w=new Set(M);b(w),r(M)},[T,r]),de=l.useCallback(()=>{b(new Set),r([])},[r]),pn=l.useCallback(()=>{},[]),he=l.useCallback(M=>{var R;const{relatedTarget:w}=M;B.debug("handleChildBlur",w,w instanceof HTMLElement,d.current,(R=d.current)==null?void 0:R.contains(w)),(!w||d.current&&w instanceof HTMLElement&&!d.current.contains(w))&&c()},[c]),Oe=T.length===0;return i.jsxs("div",{ref:d,className:O("table-input-container d-flex flex-column position-relative",t),children:[i.jsx(Ke,{disabled:!!x||Oe,value:p,placeholder:"Search",onChange:y,className:"mb-2 d-flex",onBlur:he}),i.jsx(yt,{className:"table-input-list",disabled:C===void 0||Oe,isInvalid:a,items:Oe?[{value:"Empty",isSelected:!1}]:T,itemCount:P,offset:0,onSelect:E,onViewportChange:pn,ref:j,onBlur:he}),C&&i.jsxs("div",{className:"meta-row",children:[i.jsx("div",{className:"d-flex align-items-center text-muted small",children:C!=null&&C.size>P&&i.jsxs(i.Fragment,{children:["Table is too large, showing the first ",Re," items."]})}),i.jsxs("div",{children:[i.jsx("button",{type:"button",className:"btn btn-link",onBlur:he,onClick:D,children:"Select All"}),i.jsx("button",{type:"button",className:"btn btn-link mr-a",onBlur:he,onClick:de,children:"Clear"})]})]}),C==null||x&&i.jsx("div",{className:"h-100 w-100 position-absolute",children:i.jsx(te,{isLoaded:C!=null,isLoading:C==null&&x==null,errorMessage:(x==null?void 0:x.message)??null})})]})}tt.displayName="TableInput";tt.defaultProps={isInvalid:!1,className:void 0};const pt=L.module("useBroadcastChannel");function Se(s=js,t=_t){const e=l.useMemo(()=>new BroadcastChannel(t),[t]);return l.useEffect(()=>()=>{e.close()},[e]),l.useEffect(()=>{e.onmessage=n=>{const{data:o}=n;if(!ke(o)){pt.debug("Ignoring non-deephaven message",o);return}pt.debug("event received",o),s(n)}},[e,s]),e}function we(s,t){const e=l.useCallback(n=>{$t(n.data)?s==null||s(n.data):Ut(n.data)&&(t==null||t(n.data))},[s,t]);Se(e)}const Ee="io.deephaven.web.client.auth.refreshToken",Qt=l.createContext(null);function Fe(){const s=ee.get(Ee);return s!=null?JSON.parse(s):null}function $e(s){if(s!=null){const t=JSON.stringify({bytes:s.bytes,expiry:s.expiry}),e=new Date(s.expiry);ee.set(Ee,t,{secure:!0,sameSite:"strict",expires:e})}else ee.remove(Ee)}function Xt({children:s}){const t=ye(),e=ce(),n=Se(),[o,a]=l.useState(Fe());l.useEffect(function(){return e.addEventListener(t.CoreClient.EVENT_REFRESH_TOKEN_UPDATED,h=>{const{detail:p}=h;$e(p),a(p)})},[t,n,e,o]);const r=l.useCallback(()=>{a(Fe())},[]),c=l.useCallback(()=>{$e(null),a(null)},[]);return we(r,c),i.jsx(Qt.Provider,{value:o,children:s})}function en(s){const t=Cn({});return l.useEffect(()=>{s&&(t.items.length&&t.remove(...t.items.map(({key:e})=>e)),t.insert(0,...zt(Ie(s))))},[s]),t}function Wa(s,...t){const e=l.useCallback(async()=>(s==null?void 0:s.selectDistinct(s.findColumns(t)))??null,[s,...t]),{data:n,error:o,isError:a,isLoading:r}=wt(e,[]);return l.useEffect(()=>()=>{n==null||n.close()},[n]),{distinctTable:n,error:o,isError:a,isLoading:r}}function tn(s,t,e){return l.useCallback(function(o){const[a,r]=Yt(o,t,e,Ie(s));s==null||s.setViewport(a,r)},[s,e,t])}function Ga({table:s,viewportSize:t=10,viewportPadding:e=50,deserializeRow:n=qt}){const o=en(s),a=tn(s,t,e);return oe(s,dh.Table.EVENT_UPDATED,Kt(s,o,n)),l.useEffect(()=>{s&&!et(s)&&a(0)},[s,a]),{viewportData:o,size:Ie(s),setViewport:a}}const Ka=Object.freeze(Object.defineProperty({__proto__:null,REFRESH_TOKEN_KEY:Ee,RefreshTokenBootstrap:Xt,RefreshTokenContext:Qt,TableInput:tt,readRefreshToken:Fe,storeRefreshToken:$e,useBroadcastChannel:Se,useBroadcastLoginListener:we,useInitializeViewportData:en,useSelectDistinctTable:Wa,useSetPaddedViewportCallback:tn,useTable:Zt,useTableColumn:Jt,useTableListener:oe,useViewportData:Ga},Symbol.toStringTag,{value:"Module"})),nn=l.createContext(!1);function qa({fontClassNames:s=["fira-sans-regular","fira-sans-bold","fira-mono"],children:t}){const[e,n]=l.useState(!1);return l.useEffect(function(){document.fonts.ready.then(()=>{n(!0)})},[]),i.jsxs(i.Fragment,{children:[i.jsx(nn.Provider,{value:e,children:t}),i.jsx("div",{id:"preload-fonts",style:{visibility:"hidden",position:"absolute",top:-1e4},children:s.map(o=>i.jsx("p",{className:o,children:"preload"},o))})]})}function sn(s){if(s==null)return!1;const t=s;return t.Component!==void 0&&typeof t.isAvailable=="function"}const an="io.deephaven.auth.AnonymousAuthenticationHandler",za="io.deephaven.authentication.psk.PskAuthenticationHandler",ft=L.module("AuthPluginBase");function nt({children:s,getLoginOptions:t}){const e=ce(),[n,o]=l.useState(),[a,r]=l.useState(!1);return l.useEffect(()=>{let c=!1;function u(){if(c)throw new Ms("Login canceled.")}async function d(){try{const h=await t();u(),ft.info("Logging in..."),await e.login(h),u(),r(!0)}catch(h){c||(ft.error("Unable to login:",h),o(h),r(!1))}}return d(),()=>{c=!0}},[e,t]),a?i.jsx(i.Fragment,{children:s}):i.jsx(te,{"data-testid":"auth-base-loading",isLoading:n==null,isLoaded:!1,errorMessage:n!=null?`${n}`:null})}const Ya=l.createContext({}),st=l.createContext({}),Za={canLogout:!1};function Ja({children:s}){const t=ye(),e=l.useCallback(async()=>({type:t.CoreClient.LOGIN_TYPE_ANONYMOUS}),[t]);return i.jsx(nt,{getLoginOptions:e,children:i.jsx(st.Provider,{value:Za,children:s})})}const Qa={Component:Ja,isAvailable:s=>s.includes(an)},on=Qa,Xa=L.module("AuthPluginParent"),ei={canLogout:!1};function ti(){return Xa.info("Logging in by delegating to parent window..."),Xe(Lt)}function ni(){return new URLSearchParams(window.location.search).get("authProvider")??""}function si({children:s}){return i.jsx(nt,{getLoginOptions:ti,children:i.jsx(st.Provider,{value:ei,children:s})})}const ai={Component:si,isAvailable:()=>window.opener!=null&&ni()==="parent"},rn=ai;function ln({children:s,errorMessage:t,isLoggingIn:e=!1,onSubmit:n}){return i.jsxs("form",{className:"login-form",onSubmit:o=>{o.preventDefault(),o.stopPropagation(),n==null||n(o)},children:[i.jsx("div",{className:"flex-spacer"}),i.jsxs("div",{className:"flex-wrapper",children:[i.jsx("fieldset",{disabled:e,className:"container-fluid",children:s}),i.jsx("div",{className:"form-group d-flex justify-content-end align-items-center mb-0",children:i.jsxs("button",{type:"submit",className:O("btn btn-primary",{"btn-spinner":e},{"btn-cancelable":e}),"data-testid":"btn-login",children:[e&&i.jsxs("span",{children:[i.jsx(Ct,{}),i.jsx("span",{className:"btn-normal-content",children:"Logging in"}),i.jsx("span",{className:"btn-hover-content",children:"Cancel"})]}),!e&&"Login"]})})]}),i.jsx("div",{className:"flex-spacer",children:t!=null&&i.jsx("p",{className:"error-message mb-0",role:"alert",children:`${t}`})})]})}function cn({children:s}){return i.jsxs("div",{className:"login-container",children:[i.jsx(Rt,{}),i.jsxs("div",{className:"login-box",children:[i.jsx("div",{className:"logo",children:i.jsx("img",{src:"/logo",alt:"Deephaven Data Labs"})}),s,i.jsxs("p",{className:"footer",children:["© 2016-",new Date().getFullYear()," Deephaven Data Labs LLC. Patent Pending."]})]})]})}const Ue="io.deephaven.authentication.psk.PskAuthenticationHandler",un="psk",Ve="io.deephaven.web.client.auth.psk.token",re=L.module("AuthPluginPsk");function ii(){return new URLSearchParams(window.location.search).get(un)}function oi(){re.debug2("clearWindowToken");const s=new URLSearchParams(window.location.search);s.delete(un);let t=`${s}`;t.length>0&&(t=`?${t}`);const e=`${window.location.pathname}${t}${window.location.hash}`;window.history.replaceState(null,"",e)}function mt(){return ee.get(Ve)??null}function Pe(s){re.debug2("Storing token in cookie",s),s!=null?ee.set(Ve,s,{secure:!0,sameSite:"strict"}):ee.remove(Ve)}function ri({children:s}){const t=ce(),e=l.useRef(null),n=l.useRef(null),[o,a]=l.useState(),[r,c]=l.useState(!1),[u,d]=l.useState(!1),[h,p]=l.useState(!1),[g,m]=l.useState(""),b=l.useCallback(async(f,S=!0)=>{re.info("Logging in..."),p(!0);let x=null;try{if(x=t.login({type:Ue,token:f}),n.current=x,await x,re.info("Logged in successfully"),n.current!==x)return;Pe(f),d(!0)}catch(k){if(n.current!==x)return;c(!0),S&&a((k==null?void 0:k.detail)??"Unable to login: Verify credentials.")}p(!1)},[t]),C=l.useCallback(()=>{n.current=null,p(!1)},[]),I=l.useCallback(async()=>{re.debug("onLogin");const f=mt();u||h||f==null||b(f,!1)},[u,h,b]),j=l.useCallback(()=>{Pe(null)},[]);we(I,j),l.useEffect(()=>{let f=!1;async function S(){const x=ii()??mt();if(oi(),x==null){c(!0);return}p(!0);try{await t.login({type:Ue,token:x}),f||(Pe(x),d(!0),p(!1))}catch{f||(c(!0),p(!1))}}return S(),()=>{f=!0}},[t]);const P=l.useCallback(()=>{h?C():b(g)},[C,h,b,g]);return l.useEffect(function(){var S;(S=e.current)==null||S.focus()},[e,r]),i.jsxs(i.Fragment,{children:[u&&s,r&&i.jsx(be,{in:!u,timeout:Z.transitionMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:i.jsx(cn,{children:i.jsx(ln,{errorMessage:o!=null?`${o}`:void 0,isLoggingIn:h,onSubmit:P,children:i.jsxs("div",{className:"form-group",children:[i.jsx("label",{htmlFor:"auth-psk-token-input",children:"Token"}),i.jsx("input",{id:"auth-psk-token-input",name:"token",className:"input-token form-control",type:"text",autoComplete:"username",autoCapitalize:"none",autoCorrect:"off",spellCheck:"false",ref:e,value:g,onChange:f=>{a(void 0),m(f.target.value)}})]})})})}),i.jsx(te,{"data-testid":"auth-psk-loading",isLoaded:u||r,isLoading:!u&&!r})]})}const li={Component:ri,isAvailable:s=>s.includes(Ue)},dn=li,ci=Object.freeze(Object.defineProperty({__proto__:null,AUTH_HANDLER_TYPE_ANONYMOUS:an,AUTH_HANDLER_TYPE_PSK:za,AuthPluginAnonymous:on,AuthPluginBase:nt,AuthPluginParent:rn,AuthPluginPsk:dn,Login:cn,LoginForm:ln,UserOverrideContext:Ya,UserPermissionsOverrideContext:st,isAuthPlugin:sn},Symbol.toStringTag,{value:"Module"})),hn={react:A,"react-dom":xn,redux:En,"react-redux":Tn,"@deephaven/auth-plugins":ci,"@deephaven/components":Sa,"@deephaven/jsapi-bootstrap":wa,"@deephaven/jsapi-components":Ka,"@deephaven/jsapi-utils":Da,"@deephaven/log":Ds,"@deephaven/react-hooks":Hs},ui=gt.createRequires(()=>hn),di=gt.createRemoteComponent({requires:ui}),hi=di,pi=yn.createRequires(hn),fi=Nn({requires:pi}),mi=fi,q=L.module("@deephaven/app-utils.PluginUtils");function Li(s,t){const e=new URL(`${t}.js`,s),n=A.forwardRef((o,a)=>i.jsx(hi,{url:e.href,render:({err:r,Component:c})=>{if(r!=null&&r!==""){const u=`Error loading plugin ${t} from ${e} due to ${r}`;return q.error(u),i.jsx("div",{className:"error-message",children:`${u}`})}return i.jsx(c,{ref:a,...o})}}));return n.pluginName=t,n.displayName="Plugin",n}async function gi(s){return await mi(s)}async function vi(s){const t=await fetch(s);if(!t.ok)throw new Error(t.statusText);try{return await t.json()}catch{throw new Error("Could not be parsed as JSON")}}async function bi(s){q.debug("Loading plugins...");try{const t=await vi(`${s}/manifest.json`);if(!Array.isArray(t.plugins))throw new Error("Plugin manifest JSON does not contain plugins array");q.debug("Plugin manifest loaded:",t);const e=[];for(let a=0;a<t.plugins.length;a+=1){const{name:r,main:c}=t.plugins[a],u=`${s}/${r}/${c}`;e.push(gi(u))}const n=await Promise.allSettled(e),o=new Map;for(let a=0;a<n.length;a+=1){const r=n[a],{name:c}=t.plugins[a];r.status==="fulfilled"?o.set(c,r.value):q.error(`Unable to load plugin ${c}`,r.reason)}return q.info("Plugins loaded:",o),o}catch(t){return q.error("Unable to load plugins:",t),new Map}}function Ci(s){var t;return((t=s.get("AuthHandlers"))==null?void 0:t.split(","))??[]}function xi(s,t,e){const n=Ci(t),o=[...s.entries()].filter(([,u])=>sn(u.AuthPlugin)).map(([u,d])=>[u,d.AuthPlugin]);o.push(...e??[]);const a=o.filter(([u,d])=>d.isAvailable(n,t));if(a.length===0)throw new Error(`No login plugins found, please register a login plugin for auth handlers: ${n}`);a.length>1&&q.warn("More than one login plugin available, will use the first one: ",a.map(([u])=>u).join(", "));const[r,c]=a[0];return q.info("Using LoginPlugin",r),c.Component}const at=l.createContext(null);function Ei({pluginsUrl:s,children:t}){const[e,n]=l.useState(null);return l.useEffect(function(){let a=!1;async function r(){const c=await bi(s);a||n(c)}return r(),()=>{a=!0}},[s]),i.jsx(at.Provider,{value:e,children:t})}function Ti(){const s=Se();return l.useEffect(function(){s.postMessage(Qe(Je))},[s]),null}const yi=new Map([["@deephaven/auth-plugins.AuthPluginPsk",dn],["@deephaven/auth-plugins.AuthPluginParent",rn],["@deephaven/auth-plugins.AuthPluginAnonymous",on]]);function Ni({children:s}){const t=ce(),e=l.useContext(at),[n,o]=l.useState(),[a,r]=l.useState();l.useEffect(function(){let h=!1;async function p(){try{const g=await t.getAuthConfigValues();h||o(new Map(g))}catch(g){h||r(g)}}return p(),()=>{h=!0}},[t]);const c=l.useMemo(()=>{if(!(e==null||n==null))try{return xi(e,n,yi)}catch(d){r(d)}},[n,e]),u=c==null||n==null;return u||a!=null?i.jsx(te,{isLoading:u,errorMessage:a!=null?`${a}`:void 0}):i.jsx(c,{authConfigValues:n,children:i.jsxs(i.Fragment,{children:[i.jsx(Ti,{}),s]})})}function ki(s){return new URL(s,`${window.location}`)}function Ii(){return new URLSearchParams(window.location.search).get("envoyPrefix")}function Si(){const s=Ii();return s!=null?{headers:{"envoy-prefix":s}}:{headers:{}}}function wi({children:s}){return l.useContext(nn)?i.jsx(i.Fragment,{children:s}):i.jsx(te,{"data-testid":"fonts-loaded-loading"})}function Di({apiUrl:s,fontClassNames:t,pluginsUrl:e,children:n}){const o=ki(s).origin,a=l.useMemo(()=>Si(),[]),[r,c]=l.useState(0),u=l.useCallback(()=>{},[]),d=l.useCallback(()=>{c(h=>h+1)},[]);return we(u,d),i.jsx(qa,{fontClassNames:t,children:i.jsx(Ei,{pluginsUrl:e,children:i.jsx(Nt,{serverUrl:o,options:a,children:i.jsx(Xt,{children:i.jsx(Ni,{children:i.jsx(Rs,{children:i.jsx(wi,{children:n})})})})},r)})})}function _i(){return xt(at,"No Plugins available in usePlugins. Was code wrapped in PluginsBootstrap or PluginsContext.Provider?")}export{Di as AppBootstrap,Ni as AuthBootstrap,Rs as ConnectionBootstrap,Ui as ConnectionContext,qa as FontBootstrap,wi as FontsLoaded,nn as FontsLoadedContext,Ei as PluginsBootstrap,at as PluginsContext,hi as RemoteComponent,Ci as getAuthHandlers,xi as getAuthPluginComponent,ki as getBaseUrl,Si as getConnectOptions,Ii as getEnvoyPrefix,Li as loadComponentPlugin,vi as loadJson,gi as loadModulePlugin,bi as loadModulePlugins,Vi as useConnection,_i as usePlugins};
|
|
8
|
-
//# sourceMappingURL=index-e00abfae.js.map
|