@deephaven/code-studio 0.31.1 → 0.31.2-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.
@@ -1,4 +1,4 @@
1
- import{A as b,F as v,E as K,C as h,R as de,T as bp,K as J,D as Ht,L as be,M as $e,B as M,U as wp,V as ge,W as ra,X as Pn,J as Je,I as Ie,Y as mh,Z as ct,_ as xa,$ as Tp,a0 as vp,a1 as Ep,a2 as yp,a3 as pe,G as No,a4 as Hd,a5 as Oa,a6 as Rp,a7 as Ip,a8 as ph,a9 as Qe,aa as la,H as Fp,ab as Zr,Q as gh,S as Aa,ac as Ud,ad as Dp,ae as On,af as Np,ag as _p,ah as Mp,ai as kp,aj as aa,ak as xp,al as Op,am as Ap,an as Vd,ao as Lp,ap as Pp,aq as Bd,ar as Hp,as as Up,at as Vp,au as Bp,av as $p,aw as vt,ax as fh,ay as Gp,az as Ch,aA as Wp,aB as Sh,aC as zp,aD as qp,aE as Yp,aF as Kp,aG as Xp,aH as jp,aI as Zp,aJ as Qp,aK as Jp,aL as eg,aM as $d,aN as tg}from"./vendor.7d6152a1.js";import{P as ye,C as Hn,a as ng,u as sg,B as V,v as ig,b as og,c as rg,d as lg,e as Ui,T as Xe,f as da,g as ag,h as bh,i as La,L as as,j as Qr,k as ts,l as wh,m as ee,r as qe,M as Te,K as Fe,n as Gd,o as dg,p as cg,q as hg,G as ls,s as le,t as ug,w as sn,x as Os,D as Vi,y as mn,z as ns,A as Th,S as Bi,E as Jr,F as ut,H as ss,I as el,J as Mi,N as mg,O as pg,Q as Wd,R as Mr,U as zd,V as vh,W as ko,X as ki,Y as gg,Z as xo,_ as fg,$ as Eh,a0 as Cg,a1 as Sg,a2 as He,a3 as Pa,a4 as Jn,a5 as Ha,a6 as kr,a7 as Wn,a8 as bg,a9 as wg,aa as Tg,ab as vg,ac as Eg,ad as Ua,ae as yg,af as As,ag as qd,ah as Sn,ai as Oo,aj as is,ak as Va,al as Ba,am as yh,an as Rg,ao as tl,ap as Ig,aq as xr,ar as Fg,as as $a,at as Rh,au as ti,av as Dg,aw as Ng,ax as _g,ay as Mg,az as kg,aA as xg,aB as nl,aC as Yd,aD as Bl,aE as Og,aF as Ag,aG as Lg,aH as Ih,aI as sl,aJ as il,aK as Pg,aL as Hg,aM as ol,aN as Fh,aO as Ug,aP as Vg,aQ as Bg,aR as $g,aS as Dh,aT as Gg,aU as Wg,aV as zg,aW as qg,aX as Yg,aY as Kg,aZ as Xg,a_ as Ke,a$ as Kd,b0 as Nh,b1 as jg,b2 as Zg,b3 as Qg,b4 as Jg,b5 as Xd,b6 as Or,b7 as ef,b8 as _h,b9 as tf,ba as nf,bb as Mh,bc as sf,bd as ca,be as ha,bf as of,bg as rf,bh as lf,bi as af,bj as fn,bk as df,bl as cf,bm as hf,bn as uf,bo as mf,bp as pf,bq as gf,br as ff,bs as jd,bt as Cf,bu as Sf}from"./index.8e178cee.js";import{e as os,l as Ti,K as cn,a as Zd,b as Ds,_ as bf,W as wf}from"./monaco.1292e04e.js";import{P as Ar,b as Tf,h as vf,p as Ef,o as yf,s as Rf,t as If,c as $l}from"./plotly.3e127198.js";import"./helpers.162e09a8.js";function Ga({className:t,isFlipped:e,children:n,"data-testid":s}){const i=a=>{if(n.length!==2)throw new Error("CardFlip requires 2 children to function");return n[a]},o=b.exports.useRef(null),r=b.exports.useCallback(a=>{a.target===a.currentTarget&&document.body.classList.add("card-flip--is-flipping")},[]),l=b.exports.useCallback(a=>{a.target===a.currentTarget&&document.body.classList.remove("card-flip--is-flipping")},[]);return b.exports.useEffect(function(){if(!o.current)throw Error("ref undefined");o.current.addEventListener("transitionstart",r);const d=o.current;return function(){if(d!=null)return d.removeEventListener("transitionstart",r)}},[r]),v("div",{className:K(t,{"card-flip--show-front":e,"card-flip--show-back":!e}),"data-testid":s,children:[h("div",{className:"card-flip--back",children:i(0)}),h("div",{ref:o,className:"card-flip--front",onTransitionEnd:l,children:i(1)})]})}class rl{static isDark(e){const n=document.createElement("div");n.style.display="none",n.style.color=e;const s=getComputedStyle(document.body.appendChild(n)).color,i=s.match(/\d+/g);let o=[];if(i)o=i.map(l=>parseInt(l,10));else throw new Error(`Invalid color received. Got ${s}`);return document.body.removeChild(n),rl.getBrightness(o)<125}static getBrightness(e){return Math.round((e[0]*299+e[1]*587+e[2]*114)/1e3)}}function Ff(t,e){return t?t.closest(`.${e}`):null}const Df={getClosestByClassName:Ff};class ds{constructor(){this.pending=[],this.resolved=[]}add(e,n){const s=ye.makeCancelable(e,n);return this.pending.push(s),s.then(()=>{this.resolve(s)},()=>{this.resolve(s)}),s}remove(e){for(let n=0;n<this.pending.length;n+=1)if(this.pending[n]===e){this.pending.splice(n,1);return}}resolve(e){this.remove(e),this.resolved.push(e)}cancel(){const e=[...this.pending,...this.resolved];for(let n=0;n<e.length;n+=1)e[n].cancel();this.pending=[],this.resolved=[]}}function k(t){if(t==null)throw new Error("Value is null or undefined")}class jt{static join(e,n="and"){if(e==null||e.length===0)return"";if(e.length===1)return e[0];if(e.length===2)return`${e[0]} ${n} ${e[1]}`;const s=e.slice(0,e.length-1).join(", "),i=e[e.length-1];return`${s}, ${n} ${i}`}static toLower(e,n=!0){if(e==null){if(n)return"";throw new Error("Null string passed in to TextUtils.toLower")}return e.toLowerCase()}static sort(e,n,s=!0){return e<n?s?-1:1:e>n?s?1:-1:0}}class Di extends Error{constructor(){super(...arguments),this.isInvalid=!0}}class kh extends b.exports.Component{constructor(e){super(e),this.handleMenuClose=this.handleMenuClose.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.container=de.createRef(),this.openMenu=de.createRef(),this.state={actions:null,left:0,top:0}}componentDidMount(){this.container.current?.parentElement&&this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu)}componentWillUnmount(){this.container.current?.parentElement&&this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu)}handleContextMenu(e){if(!Hn.isContextActionEvent(e)||!this.container.current||e.metaKey||e.ctrlKey)return;const n=Hn.getMenuItems(e.contextActions),s=this.container.current.getBoundingClientRect(),i=e.clientY-s.top,o=e.clientX-s.left;if(n.length===0){if(e.target===this.container.current){e.preventDefault(),this.setState({actions:null},()=>{const r=document.elementFromPoint(o,i),l=new MouseEvent("contextmenu",{clientX:e.clientX,clientY:e.clientY,bubbles:!0,cancelable:!0});r?.dispatchEvent(l)});return}return}e.preventDefault(),this.setState({actions:n,top:i,left:o})}handleMenuClose(e){e===this.openMenu.current&&this.setState({actions:null})}render(){let e=null;const{"data-testid":n}=this.props,{actions:s,top:i,left:o}=this.state;return s&&(e=h(ng,{ref:this.openMenu,actions:s,onMenuClosed:this.handleMenuClose,top:i,left:o,updatePosition:(r,l)=>{this.setState({top:r,left:l})},"data-testid":n})),h("div",{className:K("context-menu-root",{active:s}),ref:this.container,children:e})}}function ll(t){const e=b.exports.useRef();return b.exports.useEffect(function(){e.current=t}),e.current}function al({copy:t,kind:e="ghost",tooltip:n="Copy",className:s,"data-testid":i,children:o}){const[r,l]=sg();return h(V,{kind:e,className:s,"data-testid":i,icon:r?ig:og,tooltip:r?"Copied":n,onClick:()=>{l(typeof t=="function"?t():t)},children:o})}class qt{static reorder(e,n,s,i){const o=e===s?qt.adjustDestinationIndex(i,n):i,r=qt.removeItems(e,n);return s.splice(o,0,...r),r}static removeItems(e,n){const s=[],i=n.map((o,r)=>({range:o,index:r})).sort((o,r)=>r.range[0]-o.range[0]);for(let o=0;o<i.length;o+=1){const{range:r,index:l}=i[o],[a,d]=r;s[l]=e.splice(a,d-a+1)}return bp(s)}static adjustDestinationIndex(e,n){let s=e;for(let i=0;i<n.length;i+=1){const[o,r]=n[i];if(o>e)break;s-=Math.min(r,e-1)-o+1}return s}static startDragging(){document.documentElement.classList.add("drag-pointer-events-none")}static stopDragging(){document.documentElement.classList.remove("drag-pointer-events-none")}}function xh({on:t,id:e,className:n,isInvalid:s,disabled:i=!1,onClick:o,"data-testid":r}){return h("button",{type:"button",className:K("btn","btn-switch",n,{active:t},{"is-invalid":s}),id:e,onClick:o,disabled:i,"data-testid":r,children:h("div",{className:"handle"})})}function Qd(t){return t.isOn!==void 0}function Nf({item:t,onSelect:e=()=>{},"data-testid":n}){const{icon:s,subtitle:i,title:o}=t,r=b.exports.useMemo(()=>Qd(t)?()=>{t.onChange(!t.isOn)}:e,[t,e]);return v("div",{className:"btn btn-navigation-menu-item","data-testid":`menu-item-${o}`,onClick:r,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&r()},tabIndex:0,role:"menuitem",children:[s!==void 0&&h("div",{className:"icon",children:h(J,{icon:s})}),h("div",{className:"title",children:o}),i!==void 0&&h("div",{className:"shortcut",children:i}),h("div",{className:"accessory","data-testid":n,children:Qd(t)?h(xh,{on:t.isOn,onClick:l=>{l.stopPropagation(),r()}}):h(J,{icon:rg})})]})}function Oh({items:t,onSelect:e=()=>{},"data-testid":n}){return h("div",{className:"navigation-menu-view","data-testid":n,children:h("ul",{className:"navigation-menu-list",children:t.map((s,i)=>h("li",{children:h(Nf,{item:s,onSelect:()=>{e(i)}})},s.title))})})}function Jd({children:t,onBack:e,onClose:n,title:s,"data-testid":i}){return v("div",{className:"navigation-page","data-testid":i,children:[v("div",{className:"navigation-title-bar",children:[h("div",{className:"navigation-left-buttons",children:e!==void 0&&h(V,{kind:"ghost",className:"btn-back","data-testid":"btn-page-back",onClick:e,icon:lg,children:"Back"})}),h("div",{className:"navigation-title",children:s}),h("div",{className:"navigation-right-buttons",children:n!==void 0&&h(V,{kind:"ghost",className:"btn-close px-2 m-1","data-testid":"btn-page-close",onClick:n,icon:Ui,tooltip:"Close"})})]}),h("div",{className:"navigation-content",children:t})]})}function _f({children:t,"data-testid":e}){const n=b.exports.useMemo(()=>de.Children.toArray(t),[t]),s=ll(n),[i,o]=b.exports.useState(n[n.length-1]),[r,l]=b.exports.useState(null),[a,d]=b.exports.useState(null);b.exports.useEffect(function(){if(s===void 0||n===s)return;const p=n[n.length-1];n.length===s.length||s.length===0||r!==null||a!==null?r!==null&&p!==r?l(p):p!==a&&p!==i&&o(p):n.length>s.length?l(p):n.length<s.length&&(o(p),d(s[s.length-1]))},[n,s,r,a,i]);const c=b.exports.useCallback(()=>{o(r),l(null)},[r]),u=b.exports.useCallback(()=>{d(null)},[]);return v("div",{className:"navigation-stack",children:[h("div",{className:"main-view","data-testid":e,children:i}),h(Ht,{in:a!=null,timeout:Xe.transitionMidMs,classNames:"slide-right",onEntered:u,children:h(be,{children:a!=null&&h("div",{className:"popping-view",children:a})})}),h(Ht,{in:r!=null,timeout:Xe.transitionMidMs,classNames:"slide-left",onEntered:c,children:h(be,{children:r!=null&&h("div",{className:"pushing-view",children:r})})})]})}function Mf({children:t,disabled:e,value:n,"data-testid":s}){return h("option",{value:n,disabled:e,"data-testid":s,children:t})}function dl(t){const{children:e,disabled:n=!1,name:s,onChange:i,value:o="","data-testid":r}=t,[l]=b.exports.useState(s??$e());return h(be,{children:de.Children.map(e,a=>a?de.cloneElement(a,{name:l,onChange:a.props.onChange??i,checked:o===a.props.value,disabled:a.props.disabled??n,"data-testid":r}):null)})}function kf({children:t,onBlur:e,onChange:n,className:s,defaultValue:i,name:o,value:r,disabled:l,"data-testid":a}){const d=b.exports.useCallback(c=>{n(c.target.value)},[n]);return h("select",{className:K("custom-select",s),onBlur:e,onChange:d,defaultValue:i,value:r,name:o,disabled:l,"data-testid":a,children:t})}const{dh:I}=globalThis,cl=M.exports.shape({name:M.exports.string.isRequired,type:M.exports.string.isRequired,description:M.exports.string,constituentType:M.exports.string}),Ah=M.exports.shape({not:M.exports.func.isRequired,and:M.exports.func.isRequired,or:M.exports.func.isRequired}),xf=M.exports.shape({asc:M.exports.func.isRequired,desc:M.exports.func.isRequired,abs:M.exports.func.isRequired,column:cl.isRequired,direction:M.exports.string.isRequired,isAbs:M.exports.bool.isRequired}),Of=M.exports.shape({columns:M.exports.arrayOf(cl).isRequired,customColumns:M.exports.arrayOf(M.exports.string).isRequired,filter:M.exports.arrayOf(Ah),addEventListener:M.exports.func.isRequired,removeEventListener:M.exports.func.isRequired,size:M.exports.number.isRequired,sort:M.exports.arrayOf(M.exports.any),copy:M.exports.func.isRequired,applyFilter:M.exports.func.isRequired,applySort:M.exports.func.isRequired,applyCustomColumns:M.exports.func.isRequired,description:M.exports.string}),Af=M.exports.shape({columns:M.exports.arrayOf(cl),filter:M.exports.arrayOf(M.exports.any),isExpanded:M.exports.func.isRequired,saveExpandedState:M.exports.func.isRequired,addEventListener:M.exports.func.isRequired,removeEventListener:M.exports.func.isRequired,size:M.exports.number.isRequired,sort:M.exports.arrayOf(M.exports.any),applyFilter:M.exports.func.isRequired,applySort:M.exports.func.isRequired}),Er=M.exports.shape({name:M.exports.string.isRequired,type:M.exports.string.isRequired}),Lf=M.exports.shape({created:M.exports.arrayOf(Er).isRequired,updated:M.exports.arrayOf(Er).isRequired,removed:M.exports.arrayOf(Er).isRequired}),Pf=M.exports.shape({groupingColumns:M.exports.arrayOf(M.exports.string),aggregations:M.exports.shape({}),includeConstituents:M.exports.bool,includeOriginalColumns:M.exports.bool,includeDescriptions:M.exports.bool}),Hf=M.exports.shape({addEventListener:M.exports.func.isRequired,removeEventListener:M.exports.func.isRequired,onLogMessage:M.exports.func,getTable:M.exports.func.isRequired,runCode:M.exports.func.isRequired});Object.freeze({Column:cl,FilterCondition:Ah,IdeSession:Hf,RollupConfig:Pf,Sort:xf,Table:Of,TreeTable:Af,VariableChanges:Lf,VariableDefinition:Er});function Lh({type:t}){switch(t){case I.VariableType.TABLE:case I.VariableType.TABLEMAP:case I.VariableType.TREETABLE:case I.VariableType.HIERARCHICALTABLE:return h(J,{icon:La});case I.VariableType.FIGURE:return h(J,{icon:bh});case I.VariableType.PANDAS:return h(J,{icon:ag});default:return h(J,{icon:da})}}class hl extends b.exports.Component{constructor(e){super(e),this.container=null}componentDidMount(){this.colorize()}colorize(){const{children:e}=this.props;this.container&&e!=null&&os.colorizeElement(this.container,{theme:"dh-dark"})}render(){const{children:e,language:n}=this.props;return h("div",{children:h("div",{"data-lang":n,ref:s=>{this.container=s},style:{pointerEvents:"none"},children:e})})}}class Ph{static get LANGUAGE_MAP(){return new Map([["python","Python"],["groovy","Groovy"],["scala","Scala"]])}}class xi{static hasComment(e){return e.comment!==void 0}static hasPattern(e){return e.pattern!==void 0}static hasOp(e){return e.op!==void 0}static parseArguments(e){return e==null||!(typeof e=="string"||e instanceof String)?[]:wp.parse(e).filter(n=>!this.hasComment(n)).map(n=>this.hasPattern(n)?n.pattern:this.hasOp(n)?n.op:`${n}`)}static formatTimestamp(e){if(e==null||!(e instanceof Date))return null;const n=`${e.getHours()}`.padStart(2,"0"),s=`${e.getMinutes()}`.padStart(2,"0"),i=`${e.getSeconds()}`.padStart(2,"0"),o=`${e.getMilliseconds()}`.padStart(3,"0");return`${n}:${s}:${i}.${o}`}static isTableType(e){return e===I.VariableType.TABLE||e===I.VariableType.TREETABLE||e===I.VariableType.HIERARCHICALTABLE}static isWidgetType(e){return e===I.VariableType.FIGURE||e===I.VariableType.OTHERWIDGET||e===I.VariableType.PANDAS}static isOpenableType(e){return xi.isTableType(e)||xi.isWidgetType(e)}static isFigureType(e){return e===I.VariableType.FIGURE}static isPandas(e){return e===I.VariableType.PANDAS}}function Hh({children:t}){return v("div",{className:"console-history-item-result",children:[h("div",{className:"console-history-gutter",children:"-"}),h("div",{className:"console-history-content",children:t})]})}Hh.propTypes={children:M.exports.node.isRequired};class Uh extends b.exports.Component{constructor(e){super(e),this.updateElapsed=this.updateElapsed.bind(this),this.startTime=Date.now(),this.state={elapsed:0}}componentDidMount(){this.timer=setInterval(this.updateElapsed,1e3)}componentWillUnmount(){this.timer&&clearInterval(this.timer),this.timer=void 0}updateElapsed(){this.setState({elapsed:Math.round((Date.now()-this.startTime)/1e3)})}render(){const{disabled:e,onCancelClick:n}=this.props,{elapsed:s}=this.state;return h("div",{className:K("console-history-result-in-progress",{disabled:e}),children:v("span",{className:"badge",children:[h(as,{}),"\xA0Running... ",Qr.formatElapsedTime(s),"\xA0",h(V,{className:"console-history-result-in-progress-cancel",kind:"ghost",icon:Ui,tooltip:"Cancel",onClick:n,disabled:e})]})})}}Uh.defaultProps={disabled:!1};const ua=class extends b.exports.PureComponent{constructor(t){super(t),this.handleKeyPress=this.handleKeyPress.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleToggleError=this.handleToggleError.bind(this),this.handleMouseEnter=this.handleMouseEnter.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.mouseX=null,this.mouseY=null,this.isClicking=!1,this.state={isExpanded:!1,isTriggerHovered:!1}}handleKeyPress(t){switch(t.key){case"Enter":case" ":this.handleToggleError(),t.stopPropagation(),t.preventDefault();break}}handleMouseDown(t){this.mouseX=t.clientX,this.mouseY=t.clientY,this.isClicking=!0}handleMouseMove(t){this.mouseX!=null&&this.mouseY!=null?(Math.abs(t.clientX-this.mouseX)>=ua.mouseDragThreshold||Math.abs(t.clientY-this.mouseY)>=ua.mouseDragThreshold)&&(this.isClicking=!1):this.isClicking&&(this.isClicking=!1)}handleMouseUp(t){this.isClicking&&!t.shiftKey&&!t.metaKey&&!t.altKey&&this.handleToggleError(),this.mouseX=null,this.mouseY=null,this.isClicking=!1}handleToggleError(){this.setState(t=>({isExpanded:!t.isExpanded}))}handleMouseEnter(){this.setState({isTriggerHovered:!0})}handleMouseLeave(){this.setState({isTriggerHovered:!1})}render(){const{isExpanded:t,isTriggerHovered:e}=this.state,{message:n}=this.props;k(n);const s=n.indexOf(`
1
+ import{A as b,F as v,E as K,C as h,R as de,T as bp,K as J,D as Ht,L as be,M as $e,B as M,U as wp,V as ge,W as ra,X as Pn,J as Je,I as Ie,Y as mh,Z as ct,_ as xa,$ as Tp,a0 as vp,a1 as Ep,a2 as yp,a3 as pe,G as No,a4 as Hd,a5 as Oa,a6 as Rp,a7 as Ip,a8 as ph,a9 as Qe,aa as la,H as Fp,ab as Zr,Q as gh,S as Aa,ac as Ud,ad as Dp,ae as On,af as Np,ag as _p,ah as Mp,ai as kp,aj as aa,ak as xp,al as Op,am as Ap,an as Vd,ao as Lp,ap as Pp,aq as Bd,ar as Hp,as as Up,at as Vp,au as Bp,av as $p,aw as vt,ax as fh,ay as Gp,az as Ch,aA as Wp,aB as Sh,aC as zp,aD as qp,aE as Yp,aF as Kp,aG as Xp,aH as jp,aI as Zp,aJ as Qp,aK as Jp,aL as eg,aM as $d,aN as tg}from"./vendor.7d6152a1.js";import{P as ye,C as Hn,a as ng,u as sg,B as V,v as ig,b as og,c as rg,d as lg,e as Ui,T as Xe,f as da,g as ag,h as bh,i as La,L as as,j as Qr,k as ts,l as wh,m as ee,r as qe,M as Te,K as Fe,n as Gd,o as dg,p as cg,q as hg,G as ls,s as le,t as ug,w as sn,x as Os,D as Vi,y as mn,z as ns,A as Th,S as Bi,E as Jr,F as ut,H as ss,I as el,J as Mi,N as mg,O as pg,Q as Wd,R as Mr,U as zd,V as vh,W as ko,X as ki,Y as gg,Z as xo,_ as fg,$ as Eh,a0 as Cg,a1 as Sg,a2 as He,a3 as Pa,a4 as Jn,a5 as Ha,a6 as kr,a7 as Wn,a8 as bg,a9 as wg,aa as Tg,ab as vg,ac as Eg,ad as Ua,ae as yg,af as As,ag as qd,ah as Sn,ai as Oo,aj as is,ak as Va,al as Ba,am as yh,an as Rg,ao as tl,ap as Ig,aq as xr,ar as Fg,as as $a,at as Rh,au as ti,av as Dg,aw as Ng,ax as _g,ay as Mg,az as kg,aA as xg,aB as nl,aC as Yd,aD as Bl,aE as Og,aF as Ag,aG as Lg,aH as Ih,aI as sl,aJ as il,aK as Pg,aL as Hg,aM as ol,aN as Fh,aO as Ug,aP as Vg,aQ as Bg,aR as $g,aS as Dh,aT as Gg,aU as Wg,aV as zg,aW as qg,aX as Yg,aY as Kg,aZ as Xg,a_ as Ke,a$ as Kd,b0 as Nh,b1 as jg,b2 as Zg,b3 as Qg,b4 as Jg,b5 as Xd,b6 as Or,b7 as ef,b8 as _h,b9 as tf,ba as nf,bb as Mh,bc as sf,bd as ca,be as ha,bf as of,bg as rf,bh as lf,bi as af,bj as fn,bk as df,bl as cf,bm as hf,bn as uf,bo as mf,bp as pf,bq as gf,br as ff,bs as jd,bt as Cf,bu as Sf}from"./index.7db55d02.js";import{e as os,l as Ti,K as cn,a as Zd,b as Ds,_ as bf,W as wf}from"./monaco.1292e04e.js";import{P as Ar,b as Tf,h as vf,p as Ef,o as yf,s as Rf,t as If,c as $l}from"./plotly.4a640e26.js";import"./helpers.162e09a8.js";function Ga({className:t,isFlipped:e,children:n,"data-testid":s}){const i=a=>{if(n.length!==2)throw new Error("CardFlip requires 2 children to function");return n[a]},o=b.exports.useRef(null),r=b.exports.useCallback(a=>{a.target===a.currentTarget&&document.body.classList.add("card-flip--is-flipping")},[]),l=b.exports.useCallback(a=>{a.target===a.currentTarget&&document.body.classList.remove("card-flip--is-flipping")},[]);return b.exports.useEffect(function(){if(!o.current)throw Error("ref undefined");o.current.addEventListener("transitionstart",r);const d=o.current;return function(){if(d!=null)return d.removeEventListener("transitionstart",r)}},[r]),v("div",{className:K(t,{"card-flip--show-front":e,"card-flip--show-back":!e}),"data-testid":s,children:[h("div",{className:"card-flip--back",children:i(0)}),h("div",{ref:o,className:"card-flip--front",onTransitionEnd:l,children:i(1)})]})}class rl{static isDark(e){const n=document.createElement("div");n.style.display="none",n.style.color=e;const s=getComputedStyle(document.body.appendChild(n)).color,i=s.match(/\d+/g);let o=[];if(i)o=i.map(l=>parseInt(l,10));else throw new Error(`Invalid color received. Got ${s}`);return document.body.removeChild(n),rl.getBrightness(o)<125}static getBrightness(e){return Math.round((e[0]*299+e[1]*587+e[2]*114)/1e3)}}function Ff(t,e){return t?t.closest(`.${e}`):null}const Df={getClosestByClassName:Ff};class ds{constructor(){this.pending=[],this.resolved=[]}add(e,n){const s=ye.makeCancelable(e,n);return this.pending.push(s),s.then(()=>{this.resolve(s)},()=>{this.resolve(s)}),s}remove(e){for(let n=0;n<this.pending.length;n+=1)if(this.pending[n]===e){this.pending.splice(n,1);return}}resolve(e){this.remove(e),this.resolved.push(e)}cancel(){const e=[...this.pending,...this.resolved];for(let n=0;n<e.length;n+=1)e[n].cancel();this.pending=[],this.resolved=[]}}function k(t){if(t==null)throw new Error("Value is null or undefined")}class jt{static join(e,n="and"){if(e==null||e.length===0)return"";if(e.length===1)return e[0];if(e.length===2)return`${e[0]} ${n} ${e[1]}`;const s=e.slice(0,e.length-1).join(", "),i=e[e.length-1];return`${s}, ${n} ${i}`}static toLower(e,n=!0){if(e==null){if(n)return"";throw new Error("Null string passed in to TextUtils.toLower")}return e.toLowerCase()}static sort(e,n,s=!0){return e<n?s?-1:1:e>n?s?1:-1:0}}class Di extends Error{constructor(){super(...arguments),this.isInvalid=!0}}class kh extends b.exports.Component{constructor(e){super(e),this.handleMenuClose=this.handleMenuClose.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.container=de.createRef(),this.openMenu=de.createRef(),this.state={actions:null,left:0,top:0}}componentDidMount(){this.container.current?.parentElement&&this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu)}componentWillUnmount(){this.container.current?.parentElement&&this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu)}handleContextMenu(e){if(!Hn.isContextActionEvent(e)||!this.container.current||e.metaKey||e.ctrlKey)return;const n=Hn.getMenuItems(e.contextActions),s=this.container.current.getBoundingClientRect(),i=e.clientY-s.top,o=e.clientX-s.left;if(n.length===0){if(e.target===this.container.current){e.preventDefault(),this.setState({actions:null},()=>{const r=document.elementFromPoint(o,i),l=new MouseEvent("contextmenu",{clientX:e.clientX,clientY:e.clientY,bubbles:!0,cancelable:!0});r?.dispatchEvent(l)});return}return}e.preventDefault(),this.setState({actions:n,top:i,left:o})}handleMenuClose(e){e===this.openMenu.current&&this.setState({actions:null})}render(){let e=null;const{"data-testid":n}=this.props,{actions:s,top:i,left:o}=this.state;return s&&(e=h(ng,{ref:this.openMenu,actions:s,onMenuClosed:this.handleMenuClose,top:i,left:o,updatePosition:(r,l)=>{this.setState({top:r,left:l})},"data-testid":n})),h("div",{className:K("context-menu-root",{active:s}),ref:this.container,children:e})}}function ll(t){const e=b.exports.useRef();return b.exports.useEffect(function(){e.current=t}),e.current}function al({copy:t,kind:e="ghost",tooltip:n="Copy",className:s,"data-testid":i,children:o}){const[r,l]=sg();return h(V,{kind:e,className:s,"data-testid":i,icon:r?ig:og,tooltip:r?"Copied":n,onClick:()=>{l(typeof t=="function"?t():t)},children:o})}class qt{static reorder(e,n,s,i){const o=e===s?qt.adjustDestinationIndex(i,n):i,r=qt.removeItems(e,n);return s.splice(o,0,...r),r}static removeItems(e,n){const s=[],i=n.map((o,r)=>({range:o,index:r})).sort((o,r)=>r.range[0]-o.range[0]);for(let o=0;o<i.length;o+=1){const{range:r,index:l}=i[o],[a,d]=r;s[l]=e.splice(a,d-a+1)}return bp(s)}static adjustDestinationIndex(e,n){let s=e;for(let i=0;i<n.length;i+=1){const[o,r]=n[i];if(o>e)break;s-=Math.min(r,e-1)-o+1}return s}static startDragging(){document.documentElement.classList.add("drag-pointer-events-none")}static stopDragging(){document.documentElement.classList.remove("drag-pointer-events-none")}}function xh({on:t,id:e,className:n,isInvalid:s,disabled:i=!1,onClick:o,"data-testid":r}){return h("button",{type:"button",className:K("btn","btn-switch",n,{active:t},{"is-invalid":s}),id:e,onClick:o,disabled:i,"data-testid":r,children:h("div",{className:"handle"})})}function Qd(t){return t.isOn!==void 0}function Nf({item:t,onSelect:e=()=>{},"data-testid":n}){const{icon:s,subtitle:i,title:o}=t,r=b.exports.useMemo(()=>Qd(t)?()=>{t.onChange(!t.isOn)}:e,[t,e]);return v("div",{className:"btn btn-navigation-menu-item","data-testid":`menu-item-${o}`,onClick:r,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&r()},tabIndex:0,role:"menuitem",children:[s!==void 0&&h("div",{className:"icon",children:h(J,{icon:s})}),h("div",{className:"title",children:o}),i!==void 0&&h("div",{className:"shortcut",children:i}),h("div",{className:"accessory","data-testid":n,children:Qd(t)?h(xh,{on:t.isOn,onClick:l=>{l.stopPropagation(),r()}}):h(J,{icon:rg})})]})}function Oh({items:t,onSelect:e=()=>{},"data-testid":n}){return h("div",{className:"navigation-menu-view","data-testid":n,children:h("ul",{className:"navigation-menu-list",children:t.map((s,i)=>h("li",{children:h(Nf,{item:s,onSelect:()=>{e(i)}})},s.title))})})}function Jd({children:t,onBack:e,onClose:n,title:s,"data-testid":i}){return v("div",{className:"navigation-page","data-testid":i,children:[v("div",{className:"navigation-title-bar",children:[h("div",{className:"navigation-left-buttons",children:e!==void 0&&h(V,{kind:"ghost",className:"btn-back","data-testid":"btn-page-back",onClick:e,icon:lg,children:"Back"})}),h("div",{className:"navigation-title",children:s}),h("div",{className:"navigation-right-buttons",children:n!==void 0&&h(V,{kind:"ghost",className:"btn-close px-2 m-1","data-testid":"btn-page-close",onClick:n,icon:Ui,tooltip:"Close"})})]}),h("div",{className:"navigation-content",children:t})]})}function _f({children:t,"data-testid":e}){const n=b.exports.useMemo(()=>de.Children.toArray(t),[t]),s=ll(n),[i,o]=b.exports.useState(n[n.length-1]),[r,l]=b.exports.useState(null),[a,d]=b.exports.useState(null);b.exports.useEffect(function(){if(s===void 0||n===s)return;const p=n[n.length-1];n.length===s.length||s.length===0||r!==null||a!==null?r!==null&&p!==r?l(p):p!==a&&p!==i&&o(p):n.length>s.length?l(p):n.length<s.length&&(o(p),d(s[s.length-1]))},[n,s,r,a,i]);const c=b.exports.useCallback(()=>{o(r),l(null)},[r]),u=b.exports.useCallback(()=>{d(null)},[]);return v("div",{className:"navigation-stack",children:[h("div",{className:"main-view","data-testid":e,children:i}),h(Ht,{in:a!=null,timeout:Xe.transitionMidMs,classNames:"slide-right",onEntered:u,children:h(be,{children:a!=null&&h("div",{className:"popping-view",children:a})})}),h(Ht,{in:r!=null,timeout:Xe.transitionMidMs,classNames:"slide-left",onEntered:c,children:h(be,{children:r!=null&&h("div",{className:"pushing-view",children:r})})})]})}function Mf({children:t,disabled:e,value:n,"data-testid":s}){return h("option",{value:n,disabled:e,"data-testid":s,children:t})}function dl(t){const{children:e,disabled:n=!1,name:s,onChange:i,value:o="","data-testid":r}=t,[l]=b.exports.useState(s??$e());return h(be,{children:de.Children.map(e,a=>a?de.cloneElement(a,{name:l,onChange:a.props.onChange??i,checked:o===a.props.value,disabled:a.props.disabled??n,"data-testid":r}):null)})}function kf({children:t,onBlur:e,onChange:n,className:s,defaultValue:i,name:o,value:r,disabled:l,"data-testid":a}){const d=b.exports.useCallback(c=>{n(c.target.value)},[n]);return h("select",{className:K("custom-select",s),onBlur:e,onChange:d,defaultValue:i,value:r,name:o,disabled:l,"data-testid":a,children:t})}const{dh:I}=globalThis,cl=M.exports.shape({name:M.exports.string.isRequired,type:M.exports.string.isRequired,description:M.exports.string,constituentType:M.exports.string}),Ah=M.exports.shape({not:M.exports.func.isRequired,and:M.exports.func.isRequired,or:M.exports.func.isRequired}),xf=M.exports.shape({asc:M.exports.func.isRequired,desc:M.exports.func.isRequired,abs:M.exports.func.isRequired,column:cl.isRequired,direction:M.exports.string.isRequired,isAbs:M.exports.bool.isRequired}),Of=M.exports.shape({columns:M.exports.arrayOf(cl).isRequired,customColumns:M.exports.arrayOf(M.exports.string).isRequired,filter:M.exports.arrayOf(Ah),addEventListener:M.exports.func.isRequired,removeEventListener:M.exports.func.isRequired,size:M.exports.number.isRequired,sort:M.exports.arrayOf(M.exports.any),copy:M.exports.func.isRequired,applyFilter:M.exports.func.isRequired,applySort:M.exports.func.isRequired,applyCustomColumns:M.exports.func.isRequired,description:M.exports.string}),Af=M.exports.shape({columns:M.exports.arrayOf(cl),filter:M.exports.arrayOf(M.exports.any),isExpanded:M.exports.func.isRequired,saveExpandedState:M.exports.func.isRequired,addEventListener:M.exports.func.isRequired,removeEventListener:M.exports.func.isRequired,size:M.exports.number.isRequired,sort:M.exports.arrayOf(M.exports.any),applyFilter:M.exports.func.isRequired,applySort:M.exports.func.isRequired}),Er=M.exports.shape({name:M.exports.string.isRequired,type:M.exports.string.isRequired}),Lf=M.exports.shape({created:M.exports.arrayOf(Er).isRequired,updated:M.exports.arrayOf(Er).isRequired,removed:M.exports.arrayOf(Er).isRequired}),Pf=M.exports.shape({groupingColumns:M.exports.arrayOf(M.exports.string),aggregations:M.exports.shape({}),includeConstituents:M.exports.bool,includeOriginalColumns:M.exports.bool,includeDescriptions:M.exports.bool}),Hf=M.exports.shape({addEventListener:M.exports.func.isRequired,removeEventListener:M.exports.func.isRequired,onLogMessage:M.exports.func,getTable:M.exports.func.isRequired,runCode:M.exports.func.isRequired});Object.freeze({Column:cl,FilterCondition:Ah,IdeSession:Hf,RollupConfig:Pf,Sort:xf,Table:Of,TreeTable:Af,VariableChanges:Lf,VariableDefinition:Er});function Lh({type:t}){switch(t){case I.VariableType.TABLE:case I.VariableType.TABLEMAP:case I.VariableType.TREETABLE:case I.VariableType.HIERARCHICALTABLE:return h(J,{icon:La});case I.VariableType.FIGURE:return h(J,{icon:bh});case I.VariableType.PANDAS:return h(J,{icon:ag});default:return h(J,{icon:da})}}class hl extends b.exports.Component{constructor(e){super(e),this.container=null}componentDidMount(){this.colorize()}colorize(){const{children:e}=this.props;this.container&&e!=null&&os.colorizeElement(this.container,{theme:"dh-dark"})}render(){const{children:e,language:n}=this.props;return h("div",{children:h("div",{"data-lang":n,ref:s=>{this.container=s},style:{pointerEvents:"none"},children:e})})}}class Ph{static get LANGUAGE_MAP(){return new Map([["python","Python"],["groovy","Groovy"],["scala","Scala"]])}}class xi{static hasComment(e){return e.comment!==void 0}static hasPattern(e){return e.pattern!==void 0}static hasOp(e){return e.op!==void 0}static parseArguments(e){return e==null||!(typeof e=="string"||e instanceof String)?[]:wp.parse(e).filter(n=>!this.hasComment(n)).map(n=>this.hasPattern(n)?n.pattern:this.hasOp(n)?n.op:`${n}`)}static formatTimestamp(e){if(e==null||!(e instanceof Date))return null;const n=`${e.getHours()}`.padStart(2,"0"),s=`${e.getMinutes()}`.padStart(2,"0"),i=`${e.getSeconds()}`.padStart(2,"0"),o=`${e.getMilliseconds()}`.padStart(3,"0");return`${n}:${s}:${i}.${o}`}static isTableType(e){return e===I.VariableType.TABLE||e===I.VariableType.TREETABLE||e===I.VariableType.HIERARCHICALTABLE}static isWidgetType(e){return e===I.VariableType.FIGURE||e===I.VariableType.OTHERWIDGET||e===I.VariableType.PANDAS}static isOpenableType(e){return xi.isTableType(e)||xi.isWidgetType(e)}static isFigureType(e){return e===I.VariableType.FIGURE}static isPandas(e){return e===I.VariableType.PANDAS}}function Hh({children:t}){return v("div",{className:"console-history-item-result",children:[h("div",{className:"console-history-gutter",children:"-"}),h("div",{className:"console-history-content",children:t})]})}Hh.propTypes={children:M.exports.node.isRequired};class Uh extends b.exports.Component{constructor(e){super(e),this.updateElapsed=this.updateElapsed.bind(this),this.startTime=Date.now(),this.state={elapsed:0}}componentDidMount(){this.timer=setInterval(this.updateElapsed,1e3)}componentWillUnmount(){this.timer&&clearInterval(this.timer),this.timer=void 0}updateElapsed(){this.setState({elapsed:Math.round((Date.now()-this.startTime)/1e3)})}render(){const{disabled:e,onCancelClick:n}=this.props,{elapsed:s}=this.state;return h("div",{className:K("console-history-result-in-progress",{disabled:e}),children:v("span",{className:"badge",children:[h(as,{}),"\xA0Running... ",Qr.formatElapsedTime(s),"\xA0",h(V,{className:"console-history-result-in-progress-cancel",kind:"ghost",icon:Ui,tooltip:"Cancel",onClick:n,disabled:e})]})})}}Uh.defaultProps={disabled:!1};const ua=class extends b.exports.PureComponent{constructor(t){super(t),this.handleKeyPress=this.handleKeyPress.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleToggleError=this.handleToggleError.bind(this),this.handleMouseEnter=this.handleMouseEnter.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.mouseX=null,this.mouseY=null,this.isClicking=!1,this.state={isExpanded:!1,isTriggerHovered:!1}}handleKeyPress(t){switch(t.key){case"Enter":case" ":this.handleToggleError(),t.stopPropagation(),t.preventDefault();break}}handleMouseDown(t){this.mouseX=t.clientX,this.mouseY=t.clientY,this.isClicking=!0}handleMouseMove(t){this.mouseX!=null&&this.mouseY!=null?(Math.abs(t.clientX-this.mouseX)>=ua.mouseDragThreshold||Math.abs(t.clientY-this.mouseY)>=ua.mouseDragThreshold)&&(this.isClicking=!1):this.isClicking&&(this.isClicking=!1)}handleMouseUp(t){this.isClicking&&!t.shiftKey&&!t.metaKey&&!t.altKey&&this.handleToggleError(),this.mouseX=null,this.mouseY=null,this.isClicking=!1}handleToggleError(){this.setState(t=>({isExpanded:!t.isExpanded}))}handleMouseEnter(){this.setState({isTriggerHovered:!0})}handleMouseLeave(){this.setState({isTriggerHovered:!1})}render(){const{isExpanded:t,isTriggerHovered:e}=this.state,{message:n}=this.props;k(n);const s=n.indexOf(`
2
2
  `),i=s>-1;let o=n;i&&(o=n.slice(0,s));const r=n.slice(s),l=e?"error-btn-link error-btn-link--active":"error-btn-link";return v("div",{className:K("error-message",{expanded:t}),children:[i&&v(be,{children:[h("div",{className:"error-gutter",children:h("button",{type:"button",onClick:this.handleToggleError,className:l,tabIndex:-1,children:h(J,{icon:t?ts:wh,transform:"left-3"})})}),v("div",{className:"error-content",children:[h("div",{className:"console-error-text-trigger",role:"button",tabIndex:0,onKeyPress:this.handleKeyPress,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onMouseUp:this.handleMouseUp,children:o}),t?r:""]})]}),!i&&h("div",{className:"error-content",children:h("div",{className:"console-error-text",children:o})})]},"error")}};let Wa=ua;Wa.defaultProps={message:""};Wa.mouseDragThreshold=5;const ec=ee.module("ConsoleHistoryItem");class Vh extends b.exports.PureComponent{constructor(e){super(e),this.handleCancelClick=this.handleCancelClick.bind(this),this.handleObjectClick=this.handleObjectClick.bind(this)}handleObjectClick(e){ec.debug("handleObjectClick",e);const{openObject:n}=this.props;n(e)}handleCancelClick(){const{item:e}=this.props;e!=null&&e.cancelResult&&(ec.debug(`Cancelling command: ${e.command}`),e.cancelResult())}render(){const{disabled:e,item:n,language:s}=this.props,{disabledObjects:i,result:o}=n;let r=null;n.command!=null&&n.command!==""&&(r=v("div",{className:"console-history-item-command",children:[h("div",{className:"console-history-gutter",children:">"}),h("div",{className:"console-history-content",children:h(hl,{language:s,children:n.command})})]}));const l=[];let a=!1;if(o){const{error:c,message:u,changes:m}=o;if(m){const{created:p,updated:g}=m;[...p,...g].forEach(f=>{a=!0;const{title:C}=f,S=`${C}`,w=e===void 0||e||(i??[]).indexOf(S)>=0,T=h(V,{kind:"primary",onClick:()=>this.handleObjectClick(f),className:"btn-console-object",disabled:w,icon:h(Lh,{type:f.type}),children:C},S);l.push(T)})}if(c!=null&&n.command==null){let p=`${c.message??c}`;p||(p=c);const g=h(Wa,{message:p},"result-error");l.push(g)}if(u!==void 0&&u!==""){const p=h("div",{className:"log-message",children:u},"log-message");l.push(p)}}else{a=!0;const c=h(Uh,{onCancelClick:this.handleCancelClick,disabled:e},"in_progress");l.push(c)}let d=null;return l.length>0&&(d=h(Hh,{children:l})),v("div",{className:K("console-command-result",{"console-result-buttons":a}),children:[r,d]})}}Vh.defaultProps={disabled:!1};const Bh=class extends b.exports.Component{static itemKey(t,e){return`${t}.${e.command}.${e.result&&e.result.message}.${e.result&&e.result.error}`}render(){const{disabled:t,items:e,language:n,openObject:s}=this.props,i=[];for(let o=0;o<e.length;o+=1){const r=e[o],l=h(Vh,{disabled:t,item:r,openObject:s,language:n},Bh.itemKey(o,r));i.push(l)}return h("div",{className:"container-fluid console-history",children:i})}};let $h=Bh;$h.defaultProps={disabled:!1};const Uf={name:"Console",CLEAR:qe.createAndAdd({id:"CONSOLE.CLEAR",name:"Clear",shortcut:[Te.CTRL,Fe.L],macShortcut:[Te.CTRL,Fe.C]}),FOCUS_HISTORY:qe.createAndAdd({id:"CONSOLE.FOCUS_HISTORY",name:"Focus History",shortcut:[Te.CTRL,Fe.H],macShortcut:[Te.CTRL,Te.OPTION,Fe.H]})},Vf={name:"Command History",FOCUS_HISTORY:qe.createAndAdd({id:"COMMAND_HISTORY.FOCUS_HISTORY",name:"Focus History Search",shortcut:[Te.CTRL,Fe.H],macShortcut:[Te.CTRL,Te.OPTION,Fe.H]}),SEND_TO_CONSOLE:qe.createAndAdd({id:"COMMAND_HISTORY.SEND_TO_CONSOLE",name:"Send to Console",shortcut:[Fe.ENTER],macShortcut:[Fe.ENTER]}),SEND_TO_NOTEBOOK:qe.createAndAdd({id:"COMMAND_HISTORY.SEND_TO_NOTEBOOK",name:"Send to Notebook",shortcut:[Te.CTRL,Fe.ENTER],macShortcut:[Te.CMD,Fe.ENTER]}),RUN:qe.createAndAdd({id:"COMMAND_HISTORY.RUN",name:"Run",shortcut:[Te.ALT,Fe.R],macShortcut:[Te.OPTION,Fe.R]})},Bf={name:"Notebook",RUN:qe.createAndAdd({id:"NOTEBOOK.RUN",name:"Run",shortcut:[Te.ALT,Fe.R],macShortcut:[Te.OPTION,Fe.R]}),RUN_SELECTED:qe.createAndAdd({id:"NOTEBOOK.RUN_SELECTED",name:"Run Selected",shortcut:[Te.ALT,Te.SHIFT,Fe.R],macShortcut:[Te.OPTION,Te.SHIFT,Fe.R]}),FIND:qe.createAndAdd({id:"NOTEBOOK.FIND",name:"Find",shortcut:[Te.CTRL,Fe.F],macShortcut:[Te.CMD,Fe.F],isEditable:!1}),MINIMAP:qe.createAndAdd({id:"NOTEBOOK.MINIMAP",name:"Show Minimap",shortcut:[Te.ALT,Fe.M],macShortcut:[Te.OPTION,Fe.M]}),WORDWRAP:qe.createAndAdd({id:"NOTEBOOK.WORDWRAP",name:"Word Wrap",shortcut:[Te.ALT,Fe.Z],macShortcut:[Te.OPTION,Fe.Z]})},Pt={CONSOLE:Uf,COMMAND_HISTORY:Vf,NOTEBOOK:Bf},St=Object.freeze({FATAL:"FATAL",STDERR:"STDERR",ERROR:"ERROR",WARN:"WARN",STDOUT:"STDOUT",INFO:"INFO",DEBUG:"DEBUG",TRACE:"TRACE"}),$f="#2d2a2e",Gf="#fcfcfa",Wf="#fcd65b",zf="#b2b1b2",qf="#9edc6f",Yf="#76d9e4",Kf="#f95d84",Xf="#aa9af4",jf="#f95d84",Zf="#fcfcfa",Qf="#7c7b7c",we={"error-foreground":"#f95d84",background:$f,foreground:Gf,"line-height":"19px",string:Wf,"string-delim":"#929192",delimiter:zf,predefined:qf,keyword:Yf,storage:Kf,number:Xf,operator:jf,identifier:Zf,"namespace-identifier":"#f95d84","identifier-js":"#fcd65b",comment:Qf,"input-option-active-border":"#929192","focus-border":"rgba(72, 120, 234, 0.85)","input-background":"#555356","input-foreground":"#f0f0ee","input-border":"#929192","editor-line-number-foreground":"#929192","editor-selection-background":"#676368","editor-line-highlight-bg":"#373438","context-menu-background":"#555356","context-menu-foreground":"#f0f0ee","menu-selection-background":"#4878ea","log-date":"#929192","log-error":"#f95d84","log-info":"#76d9e4","log-stdout":"#f0f0ee","log-warn":"#fcd65b","log-debug":"#aa9af4","log-trace":"#9edc6f","editor-find-match-background":"#3c5595","editor-find-match-highlight-background":"#343e5d","editor-widget-background":"#403e41","input-option-active-background":"#4878ea","input-option-active-foreground":"#f0f0ee","editor-suggest-widget-background":"#403e41","editor-suggest-widget-border":"#5b5a5c","editor-suggest-widget-foreground":"#f0f0ee","editor-suggest-widget-selected-background":"#41475a","editor-suggest-widget-highlightForeground":"#4878ea","list-hover-background":"#555356"},Jf="python",eC={comments:{lineComment:"#",blockComment:["'''","'''"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:/^\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async).*?:\s*$/,action:{indentAction:1}}],folding:{offSide:!0,markers:{start:/^\s*#region\b/,end:/^\s*#endregion\b/}}},tC={keywords:["and","del","from","not","while","as","elif","global","or","with","assert","else","if","pass","yield","break","except","import","print","exec","in","raise","continue","finally","is","return","for","try",":","=","isinstance","__debug__"],storage:["class","def","async","lambda"],operators:["+","-","*","**","/","//","%","<<",">>","&","|","^","~","<",">","<=",">=","==","!=","<>","+=","-=","*=","/","//=","%=","&=","|=","^=",">>=","<<=","**="],brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],symbols:/[=><!~&|+\-*/^%]+/,delimiters:/[;=.@:,`]/,escapes:/\\(?:[abfnrtv\\"'\n\r]|x[0-9A-Fa-f]{2}|[0-7]{3}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8}|N\{\w+\})/,rawpre:/(?:[rR]|ur|Ur|uR|UR|br|Br|bR|BR)/,strpre:/(?:[buBU])/,tokenizer:{root:[[/@strpre?("""|''')/,{token:"string.delim",bracket:"@open",next:"@mstring.$1"}],[/@strpre?"([^"\\]|\\.)*$/,"string.invalid"],[/@strpre?'([^'\\]|\\.)*$/,"string.invalid"],[/@strpre?(["])/,{token:"string.delim",bracket:"@open",next:"@sstring.$1",nextEmbedded:"deephavenDb"}],[/@strpre?(["'])/,{token:"string.delim",bracket:"@open",next:"@string.$1"}],[/@rawpre("""|''')/,{token:"string.delim",bracket:"@open",next:"@mrawstring.$1"}],[/@rawpre"([^"\\]|\\.)*$/,"string.invalid"],[/@rawpre'([^'\\]|\\.)*$/,"string.invalid"],[/@rawpre(["'])/,{token:"string.delim",bracket:"@open",next:"@rawstring.$1"}],[/__[\w$]*/,"predefined"],[/[a-z_$][\w$]*/,{cases:{"@keywords":"keyword","@storage":"storage","@default":"identifier"}}],[/[A-Z][\w]*/,{cases:{"~[A-Z0-9_]+":"constructor.identifier","@default":"namespace.identifier"}}],{include:"@whitespace"},[/[{}()[\]]/,"@brackets"],[/@symbols/,{cases:{"@keywords":"keyword","@operators":"operator","@default":""}}],[/\d*\.\d+([eE][-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F]+[lL]?/,"number.hex"],[/0[bB][0-1]+[lL]?/,"number.binary"],[/(0[oO][0-7]+|0[0-7]+)[lL]?/,"number.octal"],[/(0|[1-9]\d*)[lL]?/,"number"],[":",{token:"keyword",bracket:"@open"}],[/@delimiters/,{cases:{"@keywords":"keyword","@default":"delimiter"}}]],comment:[[/[^/*]+/,"comment"],[/\/\*/,"comment","@push"],["\\*/","comment","@pop"],[/[/*]/,"comment"]],mstring:[{include:"@strcontent"},[/"""|'''/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/["']/,"string"],[/./,"string.invalid"]],sstring:[{include:"@strcontent"},[/["]/,{token:"string.delim",bracket:"@close",next:"@pop",nextEmbedded:"@pop"}],[/./,"string.invalid"]],string:[{include:"@strcontent"},[/[']/,{token:"string.delim",bracket:"@close",next:"@pop"}],[/./,"string.invalid"]],strcontent:[[/[^\\"']+/,"string"],[/\\$/,"string.escape"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"]],mrawstring:[{include:"@rawstrcontent"},[/"""|'''/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/["']/,"string"],[/./,"string.invalid"]],rawstring:[{include:"@rawstrcontent"},[/["']/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/./,"string.invalid"]],rawstrcontent:[[/[^\\"']+/,"string"],[/\\["']/,"string"],[/\\u[0-9A-Fa-f]{4}/,"string.escape"],[/\\/,"string"]],whitespace:[[/\s+/,"white"],[/(^#.*$)/,"comment"],[/'''/,"string","@endDocString"],[/"""/,"string","@endDblDocString"]],endDocString:[[/[^']+/,"string"],[/\\'/,"string"],[/'''/,"string","@popall"],[/'/,"string"]],endDblDocString:[[/[^"]+/,"string"],[/\\"/,"string"],[/"""/,"string","@popall"],[/"/,"string"]]}},nC={id:Jf,conf:eC,language:tC},sC="groovy",iC={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:/^\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async).*?:\s*$/,action:{indentAction:1}}],folding:{offSide:!0,markers:{start:/^\s*#region\b/,end:/^\s*#endregion\b/}}},oC={keywords:["and","del","from","not","while","as","elif","global","or","with","assert","else","if","pass","yield","break","except","import","print","println","class","exec","in","raise","continue","finally","is","return","def","for","lambda","try",":","=","isinstance","__debug__"],operators:["+","-","*","**","/","//","%","<<",">>","&","|","^","~","<",">","<=",">=","==","!=","<>","+=","-=","*=","/","//=","%=","&=","|=","^=",">>=","<<=","**="],brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],symbols:/[=><!~&|+\-*/^%]+/,delimiters:/[;=.@:,`]/,escapes:/\\(?:[abfnrtv\\"'\n\r]|x[0-9A-Fa-f]{2}|[0-7]{3}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8}|N\{\w+\})/,rawpre:/(?:[rR]|ur|Ur|uR|UR|br|Br|bR|BR)/,strpre:/(?:[buBU])/,tokenizer:{root:[[/@strpre?("""|''')/,{token:"string.delim",bracket:"@open",next:"@mstring.$1"}],[/@strpre?"([^"\\]|\\.)*$/,"string.invalid"],[/@strpre?'([^'\\]|\\.)*$/,"string.invalid"],[/@strpre?(["])/,{token:"string.delim",bracket:"@open",next:"@sstring.$1",nextEmbedded:"deephavenDb"}],[/@strpre?(["'])/,{token:"string.delim",bracket:"@open",next:"@string.$1"}],[/@rawpre("""|''')/,{token:"string.delim",bracket:"@open",next:"@mrawstring.$1"}],[/@rawpre"([^"\\]|\\.)*$/,"string.invalid"],[/@rawpre'([^'\\]|\\.)*$/,"string.invalid"],[/@rawpre(["'])/,{token:"string.delim",bracket:"@open",next:"@rawstring.$1"}],[/__[\w$]*/,"predefined"],[/[a-z_$][\w$]*/,{cases:{"@keywords":"keyword","@default":"identifier"}}],[/[A-Z][\w]*/,{cases:{"~[A-Z0-9_]+":"constructor.identifier","@default":"namespace.identifier"}}],{include:"@whitespace"},[/[{}()[\]]/,"@brackets"],[/@symbols/,{cases:{"@keywords":"keyword","@operators":"operator","@default":""}}],[/\d*\.\d+([eE][-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F]+[lL]?/,"number.hex"],[/0[bB][0-1]+[lL]?/,"number.binary"],[/(0[oO][0-7]+|0[0-7]+)[lL]?/,"number.octal"],[/(0|[1-9]\d*)[lL]?/,"number"],[":",{token:"keyword",bracket:"@open"}],[/@delimiters/,{cases:{"@keywords":"keyword","@default":"delimiter"}}]],mstring:[{include:"@strcontent"},[/"""|'''/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/["']/,"string"],[/./,"string.invalid"]],sstring:[{include:"@strcontent"},[/["]/,{token:"string.delim",bracket:"@close",next:"@pop",nextEmbedded:"@pop"}],[/./,"string.invalid"]],string:[{include:"@strcontent"},[/[']/,{token:"string.delim",bracket:"@close",next:"@pop"}],[/./,"string.invalid"]],strcontent:[[/[^\\"']+/,"string"],[/\\$/,"string.escape"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"]],mrawstring:[{include:"@rawstrcontent"},[/"""|'''/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/["']/,"string"],[/./,"string.invalid"]],rawstring:[{include:"@rawstrcontent"},[/["']/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/./,"string.invalid"]],rawstrcontent:[[/[^\\"']+/,"string"],[/\\["']/,"string"],[/\\u[0-9A-Fa-f]{4}/,"string.escape"],[/\\/,"string"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@doccomment"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[/*]/,"comment"]],doccomment:[[/[^/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[/*]/,"comment.doc"]]}},rC={id:sC,conf:iC,language:oC},lC="scala",aC={wordPattern:/(unary_[@~!#%^&*()\-=+\\|:<>/?]+)|([a-zA-Z_$][\w$]*?_=)|(`[^`]+`)|([a-zA-Z_$][\w$]*)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:/^\s*\/\/\s*(?:(?:#?region\b)|(?:<editor-fold\b))/,end:/^\s*\/\/\s*(?:(?:#?endregion\b)|(?:<\/editor-fold>))/}}},dC={keywords:["asInstanceOf","catch","class","classOf","def","do","else","extends","finally","for","foreach","forSome","if","import","isInstanceOf","macro","match","new","object","package","return","throw","trait","try","type","until","val","var","while","with","yield","given","enum","then"],softKeywords:["as","export","extension","end","derives","on"],constants:["true","false","null","this","super"],modifiers:["abstract","final","implicit","lazy","override","private","protected","sealed"],softModifiers:["inline","opaque","open","transparent","using"],name:/(?:[a-z_$][\w$]*|`[^`]+`)/,type:/(?:[A-Z][\w$]*)/,symbols:/[=><!~?:&|+\-*/^\\%@#]+/,digits:/\d+(_+\d+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,escapes:/\\(?:[btnfr\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,fstring_conv:/[bBhHsScCdoxXeEfgGaAt]|[Tn](?:[HIklMSLNpzZsQ]|[BbhAaCYyjmde]|[RTrDFC])/,tokenizer:{root:[[/\braw"""/,{token:"string.quote",bracket:"@open",next:"@rawstringt"}],[/\braw"/,{token:"string.quote",bracket:"@open",next:"@rawstring"}],[/\bs"""/,{token:"string.quote",bracket:"@open",next:"@sstringt"}],[/\bs"/,{token:"string.quote",bracket:"@open",next:"@sstring"}],[/\bf""""/,{token:"string.quote",bracket:"@open",next:"@fstringt"}],[/\bf"/,{token:"string.quote",bracket:"@open",next:"@fstring"}],[/"""/,{token:"string.quote",bracket:"@open",next:"@stringt"}],[/"/,{token:"string.quote",bracket:"@open",next:"@string"}],[/(@digits)[eE]([-+]?(@digits))?[fFdD]?/,"number.float","@allowMethod"],[/(@digits)\.(@digits)([eE][-+]?(@digits))?[fFdD]?/,"number.float","@allowMethod"],[/0[xX](@hexdigits)[Ll]?/,"number.hex","@allowMethod"],[/(@digits)[fFdD]/,"number.float","@allowMethod"],[/(@digits)[lL]?/,"number","@allowMethod"],[/\b_\*/,"key"],[/\b(_)\b/,"keyword","@allowMethod"],[/\bimport\b/,"keyword","@import"],[/\b(case)([ \t]+)(class)\b/,["keyword.modifier","white","keyword"]],[/\bcase\b/,"keyword","@case"],[/\bva[lr]\b/,"keyword","@vardef"],[/\b(def)([ \t]+)((?:unary_)?@symbols|@name(?:_=)|@name)/,["keyword","white","identifier"]],[/@name(?=[ \t]*:(?!:))/,"variable"],[/(\.)(@name|@symbols)/,[{token:"operator"},{token:"@rematch",next:"@allowMethod"}]],[/([{(])(\s*)(@name(?=\s*=>))/,["@brackets","white","variable"]],[/@name/,{cases:{"@keywords":"keyword","@softKeywords":"keyword","@modifiers":"keyword.modifier","@softModifiers":"keyword.modifier","@constants":{token:"constant",next:"@allowMethod"},"@default":{token:"identifier",next:"@allowMethod"}}}],[/@type/,"type","@allowMethod"],{include:"@whitespace"},[/@[a-zA-Z_$][\w$]*(?:\.[a-zA-Z_$][\w$]*)*/,"annotation"],[/[{(]/,"@brackets"],[/[})]/,"@brackets","@allowMethod"],[/\[/,"operator.square"],[/](?!\s*(?:va[rl]|def|type)\b)/,"operator.square","@allowMethod"],[/]/,"operator.square"],[/([=-]>|<-|>:|<:|:>|<%)(?=[\s\w()[\]{},."'`])/,"keyword"],[/@symbols/,"operator"],[/[;,.]/,"delimiter"],[/'[a-zA-Z$][\w$]*(?!')/,"attribute.name"],[/'[^\\']'/,"string","@allowMethod"],[/(')(@escapes)(')/,[{token:"string"},{token:"string.escape"},{token:"string",next:"@allowMethod"}]],[/'/,"string.invalid"]],import:[[/;/,"delimiter","@pop"],[/^|$/,"","@pop"],[/[ \t]+/,"white"],[/[\n\r]+/,"white","@pop"],[/\/\*/,"comment","@comment"],[/@name|@type/,"type"],[/[(){}]/,"@brackets"],[/[[\]]/,"operator.square"],[/[.,]/,"delimiter"]],allowMethod:[[/^|$/,"","@pop"],[/[ \t]+/,"white"],[/[\n\r]+/,"white","@pop"],[/\/\*/,"comment","@comment"],[/(?==>[\s\w([{])/,"keyword","@pop"],[/(@name|@symbols)(?=[ \t]*[[({"'`]|[ \t]+(?:[+-]?\.?\d|\w))/,{cases:{"@keywords":{token:"keyword",next:"@pop"},"->|<-|>:|<:|<%":{token:"keyword",next:"@pop"},"@default":{token:"@rematch",next:"@pop"}}}],["","","@pop"]],comment:[[/[^/*]+/,"comment"],[/\/\*/,"comment","@push"],[/\*\//,"comment","@pop"],[/[/*]/,"comment"]],case:[[/\b_\*/,"key"],[/\b(_|true|false|null|this|super)\b/,"keyword","@allowMethod"],[/\bif\b|=>/,"keyword","@pop"],[/`[^`]+`/,"identifier","@allowMethod"],[/@name/,"variable","@allowMethod"],[/:::?|\||@(?![a-z_$])/,"keyword"],{include:"@root"}],vardef:[[/\b_\*/,"key"],[/\b(_|true|false|null|this|super)\b/,"keyword"],[/@name/,"variable"],[/:::?|\||@(?![a-z_$])/,"keyword"],[/=|:(?!:)/,"operator","@pop"],[/$/,"white","@pop"],{include:"@root"}],string:[[/[^\\"\n\r]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}]],stringt:[[/[^\\"\n\r]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/"/,"string"]],fstring:[[/@escapes/,"string.escape"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/%%/,"string"],[/(%)([-#+ 0,(])(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","keyword.modifier","number","metatag"]],[/(%)(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","number","metatag"]],[/(%)([-#+ 0,(])(@fstring_conv)/,["metatag","keyword.modifier","metatag"]],[/(%)(@fstring_conv)/,["metatag","metatag"]],[/./,"string"]],fstringt:[[/@escapes/,"string.escape"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/%%/,"string"],[/(%)([-#+ 0,(])(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","keyword.modifier","number","metatag"]],[/(%)(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","number","metatag"]],[/(%)([-#+ 0,(])(@fstring_conv)/,["metatag","keyword.modifier","metatag"]],[/(%)(@fstring_conv)/,["metatag","metatag"]],[/./,"string"]],sstring:[[/@escapes/,"string.escape"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/./,"string"]],sstringt:[[/@escapes/,"string.escape"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/./,"string"]],interp:[[/{/,"operator","@push"],[/}/,"operator","@pop"],{include:"@root"}],rawstring:[[/[^"]/,"string"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}]],rawstringt:[[/[^"]/,"string"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/"/,"string"]],whitespace:[[/[ \t\r\n]+/,"white"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}},cC={id:lC,conf:aC,language:dC},hC="deephavenDb",uC={comments:{lineComment:"#",blockComment:["'''","'''"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:/^\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async).*?:\s*$/,action:{indentAction:1}}],folding:{offSide:!0,markers:{start:/^\s*#region\b/,end:/^\s*#endregion\b/}}},mC={tokenPostfix:".js",keywords:["boolean","break","byte","case","catch","char","class","const","continue","debugger","default","delete","do","double","else","enum","export","extends","false","final","finally","float","for","function","goto","if","implements","import","in","instanceof","int","interface","long","native","new","null","package","private","protected","public","return","short","static","super","switch","synchronized","this","throw","throws","transient","true","try","typeof","var","void","volatile","while","with"],builtins:["define","require","window","document","undefined"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"}],symbols:/[~!@#%\^&*-+=|\\:`<>.?\/]+/,escapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,exponent:/[eE][\-+]?[0-9]+/,regexpctl:/[(){}\[\]\$\^|\-*+?\.]/,regexpesc:/\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})/,tokenizer:{root:[[/([a-zA-Z_\$][\w\$]*)(\s*)(:?)/,{cases:{"$1@keywords":["keyword","white","delimiter"],$3:["key.identifier","white","delimiter"],"$1@builtins":["predefined.identifier","white","delimiter"],"@default":["identifier","white","delimiter"]}}],{include:"@whitespace"},[/\/(?=([^\\\/]|\\.)+\/)/,{token:"regexp.slash",bracket:"@open",next:"@regexp"}],[/[{}()\[\]]/,"@brackets"],[/[;,.]/,"delimiter"],[/@symbols/,{cases:{"@operators":"operator","@default":""}}],[/\d+\.\d*(@exponent)?/,"number.float"],[/\.\d+(@exponent)?/,"number.float"],[/\d+@exponent/,"number.float"],[/0[xX][\da-fA-F]+/,"number.hex"],[/0[0-7]+/,"number.octal"],[/\d+/,"number"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string",'@string."'],[/'/,"string","@string.'"]],whitespace:[[/[ \t\r\n]+/,"white"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\/\*/,"comment.invalid"],["\\*/","comment","@pop"],[/[\/*]/,"comment"]],string:[[/[^\\"']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,["@brackets.regexp.escape.control","regexp.escape.control","@brackets.regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,[{token:"@brackets.regexp.escape.control"},{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/,["@brackets.regexp.escape.control","regexp.escape.control"]],[/[()]/,"@brackets.regexp.escape.control"],[/@regexpctl/,"regexp.escape.control"],[/[^\\\/]/,"regexp"],[/@regexpesc/,"regexp.escape"],[/\\\./,"regexp.invalid"],["/",{token:"regexp.slash",bracket:"@close"},"@pop"]],regexrange:[[/-/,"regexp.escape.control"],[/\^/,"regexp.invalid"],[/@regexpesc/,"regexp.escape"],[/[^\]]/,"regexp"],[/\]/,"@brackets.regexp.escape.control","@pop"]]}},pC={id:hC,conf:uC,language:mC},gC="log",fC={},CC={tokenizer:{root:[[/ FATAL[\s\S]*/,{token:"error",next:"@error"}],[/ ERROR[\s\S]*/,{token:"error",next:"@error"}],[/ STDERR[\s\S]*/,{token:"error",next:"@error"}],[/ STDOUT.*/,{token:"stdout",next:"@stdout"}],[/ INFO[\s\S]*/,{token:"info",next:"@info"}],[/ WARN.*/,{token:"warn",next:"@warn"}],[/ TRACE[\s\S]*/,{token:"trace",next:"@trace"}],[/ DEBUG[.\s\S]*/,{token:"debug",next:"@debug"}],[/^\d{2}:\d{2}:\d{2}.\d{3}/,"date"]],error:[{include:"@body"}],info:[{include:"@body"}],warn:[{include:"@body"}],stdout:[{include:"@body"}],trace:[{include:"@body"}],debug:[{include:"@body"}],body:[[/^\d{2}:\d{2}:\d{2}.\d{3}/,{token:"date",next:"@pop"}],[/[\s\S]*/,{token:"$S0"}]]}},SC={id:gC,conf:fC,language:CC},Dn=ee.module("MonacoUtils");class lt{static init({getWorker:e}={}){Dn.debug("Initializing Monaco..."),e!==void 0&&lt.registerGetWorker(e);const{registerLanguages:n,removeHashtag:s}=lt,i=[{token:"",foreground:s(we.foreground)},{token:"string",foreground:s(we.string)},{token:"string.delim",foreground:s(we["string-delim"])},{token:"keyword",foreground:s(we.keyword)},{token:"identifier.js",foreground:s(we["identifier-js"])},{token:"delimiter",foreground:s(we.delimiter)},{token:"comment",foreground:s(we.comment)},{token:"number",foreground:s(we.number)},{token:"storage",foreground:s(we.storage)},{token:"identifier",foreground:s(we.identifier)},{token:"namespace.identifier",foreground:s(we["namespace-identifier"])},{token:"operator",foreground:s(we.operator)},{token:"predefined",foreground:s(we.predefined)},{token:"error.log",foreground:we["log-error"].substring(1)},{token:"warn.log",foreground:s(we["log-warn"])},{token:"info.log",foreground:s(we["log-info"])},{token:"stdout.log",foreground:s(we["log-stdout"])},{token:"trace.log",foreground:s(we["log-trace"])},{token:"debug.log",foreground:s(we["log-debug"])},{token:"date.log",foreground:s(we["log-date"])}],o={errorForeground:we["error-foreground"],"inputOption.activeBorder":we["input-option-active-border"],"editor.background":we.background,"editor.foreground":we.foreground,"editor.lineHighlightBackground":we["editor-line-highlight-bg"],"editorLineNumber.foreground":we["editor-line-number-foreground"],"editor.selectionBackground":we["editor-selection-background"],"editor.findMatchBackground":we["editor-find-match-background"],"editor.findMatchHighlightBackground":we["editor-find-match-highlight-background"],"editorSuggestWidget.background":we["editor-suggest-widget-background"],"editorSuggestWidget.border":we["editor-suggest-widget-border"],"editorSuggestWidget.foreground":we["editor-suggest-widget-foreground"],"editorSuggestWidget.selectedBackground":we["editor-suggest-widget-selected-background"],"editorSuggestWidget.highlightForeground":we["editor-suggest-widget-highlightForeground"],"list.hoverBackground":we["list-hover-background"],"dropdown.background":we["context-menu-background"],"dropdown.foreground":we["context-menu-foreground"],"menu.selectionBackground":we["menu-selection-background"],"list.focusBackground":we["menu-selection-background"],"editorWidget.background":we["editor-widget-background"],"inputOption.activeBackground":we["input-option-active-background"],"inputOption.activeForeground":we["input-option-active-foreground"],focusBorder:we["focus-border"],"input.background":we["input-background"],"input.foreground":we["input-foreground"],"input.border":we["input-border"]};os.defineTheme("dh-dark",{base:"vs-dark",inherit:!0,rules:i,colors:o}),Dn.debug2("monaco theme: ",we),os.setTheme("dh-dark"),n([pC,nC,rC,SC,cC]),Dn.debug("Monaco initialized.")}static registerGetWorker(e){window.MonacoEnvironment={...window.MonacoEnvironment,getWorker:e}}static removeHashtag(e){return e.substring(1)}static registerLanguages(e){const n=e.map(({id:s})=>s);Ti.getLanguages().filter(({id:s})=>n.includes(s)).forEach(s=>{const i=s;Dn.debug2("Overriding default language loader:",i.id)}),e.forEach(s=>{lt.registerLanguage(s)})}static registerLanguage(e){Dn.debug2("Registering language: ",e.id),Ti.register(e),Ti.onLanguage(e.id,()=>{Ti.setLanguageConfiguration(e.id,e.conf),Ti.setMonarchTokensProvider(e.id,e.language)})}static setEOL(e,n=os.EndOfLineSequence.LF){e.getModel()?.setEOL(n)}static openDocument(e,n){const s=e.getModel();k(s);const i={textDocument:{uri:`${s.uri}`,languageId:s.getLanguageId(),version:s.getVersionId(),text:s.getValue()}};return Dn.debug2("didOpenDocumentParams: ",i),n.openDocument(i),e.onDidChangeModelContent(r=>{const{changes:l,versionId:a}=r,d=[];for(let c=0;c<l.length;c+=1){const u=l[c],{range:m,rangeLength:p,text:g}=u,f={range:{start:{line:m.startLineNumber-1,character:m.startColumn-1},end:{line:m.endLineNumber-1,character:m.endColumn-1}},rangeLength:p,text:g};d.push(f)}if(d.length>0){const c={textDocument:{version:a,uri:`${s.uri}`},contentChanges:d};Dn.debug2("didChangeDocumentParams",c),n.changeDocument(c)}})}static closeDocument(e,n){const s=e.getModel();k(s);const i={textDocument:{uri:`${s.uri}`}};n.closeDocument(i)}static registerPasteHandler(e){e.onDidPaste(n=>{const s=/“|”/g,i=/\u200b/g,o=/\u00A0/g,r=e.getModel();k(r);const l=r.getValueInRange(n.range);(s.test(l)||i.test(l)||o.test(l))&&r.applyEdits([{range:n.range,text:l.replace(s,'"').replace(i,"").replace(o," ")}])})}static isMacPlatform(){const{platform:e}=window.navigator;return e.startsWith("Mac")}static removeConflictingKeybindings(e){const n=[{windows:"ctrl+D",mac:"meta+D"},{windows:"ctrl+H"}];try{n.forEach(s=>{lt.isMacPlatform()&&s.mac===""||!lt.isMacPlatform()&&s.windows===""||lt.removeKeybinding(e,lt.isMacPlatform()?s.mac:s.windows)})}catch(s){Dn.error(s)}}static removeKeybinding(e,n){if(n===void 0)return;const s=e._standaloneKeybindingService._getResolver()._map.get(n);s!=null?s.forEach(i=>{Dn.debug2(`Removing Monaco keybinding ${n} for ${i.command}`),e._standaloneKeybindingService.addDynamicKeybinding(`-${i.command}`,null,()=>{})}):Dn.warn(`Did not find any keybindings to remove for ${n}`)}static getMonacoKeyCodeFromShortcut(e){const{keyState:n}=e,{keyValue:s}=n;return s===null?0:lt.isMacPlatform()?(n.metaKey?cn.CtrlCmd:0)|(n.shiftKey?cn.Shift:0)|(n.altKey?cn.Alt:0)|(n.ctrlKey?cn.WinCtrl:0)|Zd.fromString(s):(n.ctrlKey?cn.CtrlCmd:0)|(n.shiftKey?cn.Shift:0)|(n.altKey?cn.Alt:0)|(n.metaKey?cn.WinCtrl:0)|Zd.fromString(s)}}const tc=ee.module("MonacoCompletionProvider");class Gh extends b.exports.PureComponent{constructor(e){super(e),this.handleCompletionRequest=this.handleCompletionRequest.bind(this)}componentDidMount(){const{language:e}=this.props;this.registeredCompletionProvider=Ti.registerCompletionItemProvider(e??"",{provideCompletionItems:this.handleCompletionRequest,triggerCharacters:['"',".","'","(","[","{",","]})}componentWillUnmount(){this.registeredCompletionProvider?.dispose()}handleCompletionRequest(e,n,s){const{model:i,session:o}=this.props;if(e!==i)return null;const r={textDocument:{uri:`${e.uri}`,version:e.getVersionId()},position:{line:n.lineNumber-1,character:n.column-1},context:s},l=o.getCompletionItems(r);return tc.debug("Completion items received: ",r,l),l.then(d=>{const c=d.map(u=>{const{label:m,kind:p,detail:g,documentation:f,sortText:C,filterText:S,textEdit:w,insertTextFormat:T}=u,{start:y,end:E}=w.range,R={startLineNumber:y.line+1,startColumn:y.character+1,endLineNumber:E.line+1,endColumn:E.character+1};return{label:m,kind:p,detail:g,documentation:f,sortText:C,filterText:S,insertText:w.text,insertTextRules:T===2?4:T,range:R}});return{incomplete:!0,suggestions:c}}).catch(d=>(tc.error("There was an error retrieving completion items",d),{suggestions:[]}))}render(){return null}}const Gl=ee.module("ConsoleInput"),Lr=parseInt(we["line-height"],10),Wh=6,zh=6,bC=Lr+Wh+zh,Wl=100,qh=class extends b.exports.PureComponent{constructor(t){super(t),this.handleWindowResize=this.handleWindowResize.bind(this),this.commandContainer=de.createRef(),this.commandHistoryIndex=null,this.timestamp=Date.now(),this.bufferIndex=0,this.history=[],this.modifiedCommands=new Map,this.state={commandEditorHeight:Lr,isFocused:!1,model:null}}componentDidMount(){this.initCommandEditor(),window.addEventListener("resize",this.handleWindowResize),this.loadMoreHistory()}componentDidUpdate(){this.layoutEditor()}componentWillUnmount(){window.removeEventListener("resize",this.handleWindowResize),this.loadingPromise!=null&&this.loadingPromise.cancel(),this.destroyCommandEditor()}setConsoleText(t,e=!0,n=!1){!t||(Gl.debug("Command received: ",t),n||(this.commandHistoryIndex=null,this.commandEditor?.setValue(t)),e&&this.focusEnd(),this.updateDimensions(),n&&this.processCommand(t))}initCommandEditor(){const{language:t,session:e}=this.props,n={copyWithSyntaxHighlighting:!1,cursorStyle:"block",fixedOverflowWidgets:!0,folding:!1,fontFamily:"Fira Mono",glyphMargin:!1,language:t,lineHeight:Lr,lineDecorationsWidth:3,lineNumbers:"off",minimap:{enabled:!1},renderLineHighlight:"none",scrollBeyondLastLine:!1,scrollbar:{arrowSize:0,horizontal:"hidden",horizontalScrollbarSize:0},padding:{top:Wh,bottom:zh},tabCompletion:"on",value:"",wordWrap:"on"},s=this.commandContainer.current;k(s),this.commandEditor=os.create(s,n),lt.setEOL(this.commandEditor),lt.openDocument(this.commandEditor,e),this.commandEditor.onDidChangeModelContent(()=>{const i=this.commandEditor?.getValue();this.modifiedCommands.set(this.commandHistoryIndex,i??null),this.updateDimensions()}),this.commandEditor.onDidFocusEditorText(()=>{this.setState({isFocused:!0})}),this.commandEditor.onDidBlurEditorText(()=>{this.setState({isFocused:!1})}),this.commandEditor.onKeyDown(i=>{const{commandEditor:o,commandHistoryIndex:r}=this,l=o?.getPosition();k(l);const{lineNumber:a}=l,d=o?.getModel();if(i.code==="ArrowUp"&&!this.isSuggestionMenuPopulated()&&a===1){r!=null?this.loadCommand(r+1):this.loadCommand(0),this.focusStart(),i.stopPropagation(),i.preventDefault();return}if(i.code==="ArrowDown"&&!this.isSuggestionMenuPopulated()&&a===d?.getLineCount()){r!=null&&r>0?this.loadCommand(r-1):this.loadCommand(null),this.focusEnd(),i.stopPropagation(),i.preventDefault();return}if(!i.altKey&&!i.shiftKey&&!i.metaKey)if(i.keyCode===Ds.Enter){if(!this.isSuggestionMenuPopulated()){i.stopPropagation(),i.preventDefault();const c=this.commandEditor?.getValue().trim();c!==void 0&&(this.processCommand(c),this.commandEditor?.setValue(""))}}else i.keyCode===Ds.Tab&&(this.isSuggestionMenuActive()?this.isSuggestionMenuPopulated()||(i.stopPropagation(),i.preventDefault()):(i.stopPropagation(),i.preventDefault(),this.commandEditor?.trigger("Tab key trigger suggestions","editor.action.triggerSuggest",{})))}),this.commandEditor.addCommand(cn.CtrlCmd|Ds.KeyF,()=>{}),lt.removeConflictingKeybindings(this.commandEditor),lt.registerPasteHandler(this.commandEditor),this.commandEditor.focus(),this.updateDimensions(),this.setState({model:this.commandEditor.getModel()})}destroyCommandEditor(){const{session:t}=this.props;this.commandEditor&&(lt.closeDocument(this.commandEditor,t),this.commandEditor.dispose(),this.commandEditor=void 0)}handleWindowResize(){this.updateDimensions()}isSuggestionMenuActive(){return this.commandSuggestionContainer||(this.commandSuggestionContainer=this.commandEditor?.getDomNode()?.querySelector(".suggest-widget")),(this.commandSuggestionContainer&&this.commandSuggestionContainer.classList.contains("visible"))??!1}isSuggestionMenuPopulated(){return this.isSuggestionMenuActive()&&(this.commandSuggestionContainer?.querySelector(".monaco-list-rows")?.childElementCount??0)>0}focus(){this.commandEditor?.focus()}focusStart(){const t=this.commandEditor?.getModel();k(t);const e=t.getLineLength(1)+1,n=this.commandEditor?.getTopForPosition(1,e);k(n),this.commandEditor?.setPosition({lineNumber:1,column:e}),this.commandEditor?.setScrollTop(n),this.commandEditor?.focus()}focusEnd(){const t=this.commandEditor?.getModel();k(t);const e=t.getLineCount(),n=t.getLineLength(e)+1,s=this.commandEditor?.getTopForPosition(e,n);k(s),this.commandEditor?.setPosition({lineNumber:e,column:n}),this.commandEditor?.setScrollTop(s),this.commandEditor?.focus()}clear(){this.commandEditor?.focus(),this.commandEditor?.getModel()?.setValue(""),this.commandHistoryIndex=null}layoutEditor(){this.commandEditor&&this.commandEditor.layout()}loadCommand(t){if(t!==null&&t>=this.history.length)return;const e=this.modifiedCommands.get(t),n=t===null?"":this.history[this.history.length-t-1];this.commandHistoryIndex=t,this.commandEditor?.getModel()?.setValue(e??n),t!==null&&t>this.history.length-Wl&&this.loadMoreHistory()}async loadMoreHistory(){try{if(this.loadingPromise!=null||this.bufferIndex==null)return;const{commandHistoryStorage:t,language:e,scope:n}=this.props;this.loadingPromise=ye.makeCancelable(t.getTable(e,n??"",this.timestamp),o=>o.close());const s=await this.loadingPromise;s.setReversed(!0),s.setViewport({top:this.bufferIndex,bottom:this.bufferIndex+Wl-1}),this.loadingPromise=ye.makeCancelable(s.getViewportData(),()=>s.close());const i=await this.loadingPromise;this.bufferIndex+=Wl,this.bufferIndex>=s.size&&(this.bufferIndex=null),this.history=[...i.items.filter(({name:o},r,l)=>r===0||o!==l[r-1].name).map(({name:o})=>o).reverse(),...this.history],this.loadingPromise=void 0,s.close()}catch(t){if(this.loadingPromise=void 0,ye.isCanceled(t)){Gl.debug2("Promise canceled, not loading history");return}Gl.error("Error fetching history",t)}}processCommand(t){this.commandHistoryIndex=null,this.modifiedCommands.clear(),k(t),t!==""&&(this.history.length===0||t!==this.history[this.history.length-1])&&this.history.push(t),this.updateDimensions();const{onSubmit:e}=this.props;e(t)}updateDimensions(){if(!this.commandEditor)return;const{maxHeight:t}=this.props;k(t);const e=this.commandEditor.getContentHeight(),n=Math.max(Math.min(e,t),bC),i={overviewRulerLanes:e>n?void 0:0};this.setState({commandEditorHeight:n},()=>{this.commandEditor?.updateOptions(i),this.commandEditor?.layout()})}render(){const{disabled:t,language:e,session:n}=this.props,{commandEditorHeight:s,isFocused:i,model:o}=this.state;return h("div",{className:K("console-input-wrapper",{disabled:t}),children:v("div",{className:K("console-input-inner-wrapper",{focus:i}),children:[h("div",{className:qh.INPUT_CLASS_NAME,ref:this.commandContainer,style:{height:s}}),o&&h(Gh,{model:o,language:e,session:n})]})})}};let Pr=qh;Pr.defaultProps={maxHeight:Lr*10,scope:null,disabled:!1};Pr.INPUT_CLASS_NAME="console-input";const nc="pasted values",wC=[/^audio.*/,/^font.*/,/^image.*/,/^video.*/],zl=[".csv",".tsv",".tab",".psv",".dsv",".txt"],sc=[".zip"],vi=class extends b.exports.Component{constructor(t){super(t),this.getValidExtensions=ge(e=>e?[...zl,...sc]:[...zl]),this.getAcceptString=ge(e=>this.getValidExtensions(e).join(", ")),this.getFileTypeErrorString=ge(e=>jt.join(this.getValidExtensions(e),"or")),this.handleSelectFile=this.handleSelectFile.bind(this),this.handleFiles=this.handleFiles.bind(this),this.handleDrop=this.handleDrop.bind(this),this.unstageFile=this.unstageFile.bind(this),this.handleMenuPaste=this.handleMenuPaste.bind(this),this.handlePasteEvent=this.handlePasteEvent.bind(this),this.fileElem=de.createRef(),this.divElem=de.createRef(),this.state={selectedFileName:""}}static isValidDropItem(t){return t!=null&&t.kind==="file"&&!wC.find(e=>e.test(t.type))}static isValidExtension(t,e=!1){return zl.some(n=>t.endsWith(n))||e&&sc.some(n=>t.endsWith(n))}static handleDragOver(t){t.preventDefault(),t.stopPropagation()}static getIcon(t){return t===nc?Gd:t.endsWith(".csv")?dg:t.endsWith(".zip")?cg:hg}componentDidMount(){this.divElem.current?.addEventListener("paste",this.handlePasteEvent),this.divElem.current?.focus()}componentWillUnmount(){this.divElem.current?.removeEventListener("paste",this.handlePasteEvent)}handleSelectFile(){this.fileElem.current&&(this.fileElem.current.value="",this.fileElem.current?.click())}handleFiles(t){t.stopPropagation(),t.preventDefault();const{files:e}=t.target;e!=null&&this.handleFile(e[0])}handleDrop(t){const{allowZip:e,clearDragError:n,dragError:s}=this.props;if(t.preventDefault(),t.stopPropagation(),s!=null){n();return}if(t.dataTransfer==null||t.dataTransfer.items==null||t.dataTransfer.items.length===0)return;const i=t.dataTransfer.items[0].getAsFile();k(i),vi.isValidExtension(i.name,e)?this.handleFile(i):this.setState({dropError:vi.FILE_TYPE_ERROR})}unstageFile(t){const{onCancel:e}=this.props;t.stopPropagation(),t.preventDefault(),e(),this.setState({selectedFileName:"",dropError:void 0})}handleFile(t){const{onFileOpened:e}=this.props;e(t),this.setState({selectedFileName:t.name,dropError:void 0})}handleMenuPaste(){const{onPaste:t,onError:e,uploadInProgress:n}=this.props;n||navigator.clipboard.readText().then(s=>{t(s),this.setState({selectedFileName:nc,dropError:void 0})}).catch(s=>e(s))}handlePasteEvent(t){t.stopPropagation(),t.preventDefault(),this.handleMenuPaste()}makeContextMenuItems(){const{uploadInProgress:t}=this.props;return[{title:"Paste",icon:Gd,action:this.handleMenuPaste,shortcut:ls.PASTE,disabled:t}]}render(){const{allowZip:t,dragError:e,uploadInProgress:n}=this.props,{selectedFileName:s,dropError:i}=this.state,o=e??i,r=this.makeContextMenuItems();return v("div",{ref:this.divElem,className:"csv-overlay fill-parent-absolute",onDragOver:vi.handleDragOver,onDrop:this.handleDrop,tabIndex:-1,children:[h(le,{actions:r}),h("input",{ref:this.fileElem,type:"file",id:"fileElem",accept:this.getAcceptString(t),style:{display:"none"},onChange:this.handleFiles,"data-testid":"fileElem"}),!s&&(o===void 0||o==="")&&v("div",{className:"message-content",children:[h("div",{className:"message-icon",children:h(J,{icon:ug})}),h("label",{children:"Drop file (or paste values) here to import"}),h("div",{className:"message-small",children:h("label",{children:"or"})}),h(V,{kind:"primary",onClick:this.handleSelectFile,children:"Select File..."})]}),s&&(o===void 0||o==="")&&v("div",{className:"selected-content",children:[h("div",{className:"selected-icon",children:h(J,{icon:vi.getIcon(s)})}),v("div",{className:"selected-text",children:[h("label",{children:"Selected File"}),v("label",{className:"selected-name",children:[s,!n&&h(V,{kind:"ghost",className:"ml-2",onClick:this.unstageFile,icon:sn,tooltip:"Remove"})]})]})]}),Boolean(o)&&v("div",{className:"message-content",children:[h("div",{className:"message-icon",children:h(J,{icon:Os})}),h("label",{children:o}),o===vi.FILE_TYPE_ERROR&&h("div",{className:"message-small",children:h("label",{children:this.getFileTypeErrorString(t)})})]})]})}};let es=vi;es.defaultProps={allowZip:!1,dragError:null};es.MULTIPLE_FILE_ERROR="Please select only one file";es.FILE_TYPE_ERROR="Filetype not supported.";class Me{}Me.INTEGER="int";Me.LONG="long";Me.DOUBLE="double";Me.BOOLEAN="bool";Me.STRING="string";Me.DATE_TIME="datetime";Me.LOCAL_TIME="localtime";const ic="unknown",TC=2147483647,vC=-2147483648,oc=/^[0-9]{4}-[0-1][0-9]-[0-3][0-9][ T][0-2][0-9]:[0-5][0-9]:[0-6][0-9](?:\.[0-9]{1,9})?(?: [a-zA-Z]+)?$/,rc=/^([0-9]+T)?([0-9]+):([0-9]+)(:[0-9]+)?(?:\.[0-9]{1,9})?$/;class Nt{static determineType(e,n,s){if(!e||e===s)return n;switch(n){case Me.STRING:return Me.STRING;case Me.INTEGER:return Nt.checkInteger(e);case Me.LONG:return Nt.checkLong(e);case Me.DOUBLE:return Nt.checkDouble(e);case Me.BOOLEAN:return Nt.checkBoolean(e);case Me.DATE_TIME:return Nt.checkDateTime(e);case Me.LOCAL_TIME:return Nt.checkLocalTime(e);default:return Nt.getTypeFromUnknown(e)}}static isNotParsableNumber(e){return isNaN(e)||e==="Infinity"||e==="-Infinity"}static checkInteger(e){const n=e.replace(/,/g,"");return Nt.isNotParsableNumber(n)?Me.STRING:Nt.getNumberType(n)}static checkLong(e){const n=e.replace(/,/g,"");return Nt.isNotParsableNumber(n)?Me.STRING:n.includes(".")?Me.DOUBLE:Me.LONG}static checkDouble(e){const n=e.replace(/,/g,"");return Nt.isNotParsableNumber(n)?Me.STRING:Me.DOUBLE}static checkBoolean(e){const n=e.toLowerCase();return n==="true"||n==="false"?Me.BOOLEAN:Me.STRING}static checkDateTime(e){return oc.test(e)?Me.DATE_TIME:Me.STRING}static checkLocalTime(e){return rc.test(e)?Me.LOCAL_TIME:Me.STRING}static getTypeFromUnknown(e){const n=e.replace(/,/g,"");if(Nt.isNotParsableNumber(n)){const s=e.toLowerCase();return s==="true"||s==="false"?Me.BOOLEAN:oc.test(e)&&e.includes(":")?Me.DATE_TIME:rc.test(e)?Me.LOCAL_TIME:Me.STRING}return Nt.getNumberType(n)}static getNumberType(e){if(e.includes("."))return Me.DOUBLE;const n=e.startsWith("-")?11:10;if(e.length>n)return Me.LONG;const s=parseInt(e,10);return s>TC||s<vC?Me.LONG:Me.INTEGER}constructor(e,n,s,i,o,r,l,a,d,c){this.onFileCompleted=e,this.file=n,this.readHeaders=s,this.nullString=o,this.onProgress=r,this.onError=l,this.chunks=0,this.totalChunks=a,this.isZip=d,this.shouldTrim=c,this.zipProgress=0,this.handleChunk=this.handleChunk.bind(this),this.handleComplete=this.handleComplete.bind(this),this.handleError=this.handleError.bind(this),this.handleNodeUpdate=this.handleNodeUpdate.bind(this),this.config={...i,error:this.handleError,chunk:this.handleChunk,complete:this.handleComplete}}parse(){const e=this.isZip?this.file.nodeStream("nodebuffer",this.handleNodeUpdate):this.file;ra.parse(e,this.config)}handleChunk(e,n){let{data:s}=e;if(!this.types){if(s==null||s.length===0){n.abort(),this.onError("Error parsing CSV: no data in file.");return}this.types=new Array(s[0].length).fill(ic),this.readHeaders&&(s=s.slice(1))}k(this.types);const i=[...this.types];s.forEach(l=>{if(l.length>=i.length){for(let a=0;a<i.length;a+=1)i[a]=Nt.determineType(this.shouldTrim?l[a].trim():l[a],i[a],this.nullString);this.types=i}else n.abort(),this.onError(`Error parsing CSV: Insufficient data in row.
3
3
  Expected length ${i.length} but found ${l.length}.
4
4
  Row = ${l}`)}),this.chunks+=1;let o=0;this.totalChunks>0?o=Math.round(this.chunks/this.totalChunks*50):o=Math.round(this.zipProgress/2),this.onProgress(o)&&n.abort()}handleComplete(e){const{types:n,onFileCompleted:s}=this;k(n),(e==null||!e.meta.aborted)&&s(n.map(i=>i===ic?Me.STRING:i))}handleError(e){const{onError:n}=this;n(e)}handleNodeUpdate(e){this.zipProgress=e.percent}}const or=ee.module("CsvParser"),EC=650,Hr=class{static generateHeaderRecursive(t){let e="",n=t;return t>=26&&(e=e.concat(Hr.generateHeaderRecursive(Math.floor(t/26)-1)),n=t%26),e.concat(String.fromCharCode(65+n))}constructor({onFileCompleted:t,session:e,file:n,type:s,readHeaders:i=!0,onProgress:o,onError:r,timeZone:l,isZip:a}){this.onFileCompleted=t,this.session=e,this.file=n,this.isZip=a,this.type=s,this.readHeaders=i,this.timeZone=l,this.onProgress=o,this.onError=r,this.tables=[],this.chunks=0,this.totalChunks=a?0:Math.ceil(n.size/ra.LocalChunkSize),this.isComplete=!1,this.zipProgress=0,this.numConsolidated=0,this.isCancelled=!1,this.handleChunk=this.handleChunk.bind(this),this.handleError=this.handleError.bind(this),this.handleComplete=this.handleComplete.bind(this),this.handleNodeUpdate=this.handleNodeUpdate.bind(this),this.handleCreateTable=this.handleCreateTable.bind(this),this.config={delimiter:s.delimiter,newline:s.newline,escapeChar:s.escapeChar,dynamicTyping:!1,error:this.handleError,skipEmptyLines:s.skipEmptyLines,chunk:this.handleChunk,complete:this.handleComplete,fastMode:!1}}cancel(){this.isCancelled=!0}transpose(t,e){const n=e.length,s=new Array(t).fill(null).map(()=>new Array(n));for(let i=0;i<n;i+=1){const o=e[i];if(o.length<t)throw new Error(`Insufficient columns. Expected ${t} but found ${o.length}
@@ -39,4 +39,4 @@ This note can be edited using **markdown** for styling.`;function wy(t){Ps(t);co
39
39
  Web UI Version: ${t}
40
40
  Java Version: ${o}
41
41
  Barrage Version: ${i}`,children:"Copy Versions"})]})]})]}),h("div",{className:"app-settings-footer-item",children:h($y,{})})]}),h("div",{className:"app-settings-footer-section",children:h("div",{className:"logo",children:h("a",{target:"_blank",rel:"noreferrer noopener",href:"https://deephaven.io",className:"d-inline-block custom-link p-1",children:h("img",{src:ep,alt:"Deephaven Data Labs",width:"230px"})})})})]})]})]})}};let ji=Qn;ji.defaultProps={onDone:()=>{}};ji.FORMATTING_SECTION_KEY="SettingsMenu.formatting";ji.COLUMN_SPECIFIC_SECTION_KEY="SettingsMenu.columnFormatting";ji.APPLICATION_SECTION_KEY="ApplicationMenu.settings";ji.SHORTCUT_SECTION_KEY="SettingsMenu.shortcuts";const ch=10;function Fi(t){const{forwardedProps:{menuItem:{action:e,title:n,disabled:s},iconElement:i,displayShortcut:o,isMouseSelected:r,isKeyboardSelected:l,closeMenu:a}}=t,d=b.exports.useRef(),c=b.exports.useRef(),u=b.exports.useRef(null),[m,p]=b.exports.useState(!1),g=b.exports.useCallback(S=>{d.current!=null&&c.current!=null&&u.current&&(Math.abs(d.current-S.clientX)>=ch||Math.abs(c.current-S.clientY)>=ch)&&(p(!0),window.removeEventListener("mousemove",g),a(),e(S),u.current=null)},[e,a]);function f(S){d.current=S.clientX,c.current=S.clientY,u.current=S.target,window.addEventListener("mousemove",g)}function C(S){u.current===S.target&&(p(!0),a(),e(),window.removeEventListener("mousemove",g)),u.current=null}return b.exports.useEffect(function(){return function(){return window.removeEventListener("mousemove",g)}},[g]),v("button",{type:"button",className:K("btn-context-menu",{disabled:s},{active:r&&!s},{"keyboard-active":l&&!s}),onMouseDown:f,onMouseUp:C,disabled:m,children:[h("span",{className:K("icon"),children:i}),h("span",{className:"title",children:n}),h("span",{className:"shortcut",children:o})]})}function Ld(t){const{handleControlSelect:e,handleToolSelect:n,onClearFilter:s}=t,i=b.exports.useMemo(()=>[{title:"Input Filter",icon:pf,menuElement:h(Fi,{}),action:o=>{e(un.INPUT_FILTER,o)},order:10},{title:"Dropdown Filter",icon:Dh,menuElement:h(Fi,{}),action:o=>{e(un.DROPDOWN_FILTER,o)},order:15},{title:"Markdown Widget",icon:gf,menuElement:h(Fi,{}),action:o=>{e(un.MARKDOWN,o)},order:20},{title:"Filter Sets",icon:ca,menuElement:h(Fi,{}),action:o=>{e(un.FILTER_SET_MANAGER,o)},order:25},{disabled:!0,menuElement:h("div",{className:"context-menu-group-header",children:"Tools"}),order:30},{title:"Linker",icon:yh,action:()=>{n(Wt.LINKER)},order:40,shortcut:ls.LINKER},{disabled:!0,menuElement:h("div",{className:"context-menu-group-header",children:"Actions"}),order:50},{title:"Clear All Filters",icon:ff,action:()=>{s()},order:60,shortcut:en.TABLE.CLEAR_ALL_FILTERS}],[e,n,s]);return h(ns,{popperClassName:"controls-menu-popper",actions:i})}Ld.propTypes={handleControlSelect:M.exports.func,handleToolSelect:M.exports.func,onClearFilter:M.exports.func};Ld.defaultProps={handleControlSelect:()=>{},handleToolSelect:()=>{},onClearFilter:()=>{}};Fi.propTypes={forwardedProps:M.exports.shape({iconElement:M.exports.node,displayShortcut:M.exports.string,isMouseSelected:M.exports.bool.isRequired,isKeyboardSelected:M.exports.bool.isRequired,closeMenu:M.exports.func.isRequired,menuItem:M.exports.shape({action:M.exports.func,title:M.exports.string,disabled:M.exports.bool}).isRequired})};Fi.defaultProps={forwardedProps:null};const sR=Ls(Jm,null),iR={layoutStorage:sR},oR=t=>t.layoutStorage,rR=t=>t.serverConfigValues;Object.entries(iR).map(([t,e])=>Gi.register(t,e));const hh=10;function lR(t){const{onExportLayout:e,onImportLayout:n,onResetLayout:s,onSelect:i,widgets:o=[]}=t,[r,l]=b.exports.useState(!1),[a,d]=b.exports.useState(""),c=b.exports.useRef(null),u=b.exports.useRef(),m=b.exports.useCallback((y,E)=>{y!=null&&i(y,E)},[i]),p=b.exports.useCallback(y=>{d(y.target.value)},[]),g=b.exports.useCallback(y=>{u.current!=null&&(Math.abs(u.current.x-y.clientX)>=hh||Math.abs(u.current.y-y.clientY)>=hh)&&(l(!0),window.removeEventListener("mousemove",g),m(u.current.widget,y),u.current=void 0)},[u,m]),f=b.exports.useCallback((y,E)=>{u.current={x:y.clientX,y:y.clientY,widget:E},window.addEventListener("mousemove",g)},[g]),C=b.exports.useCallback((y,E)=>{window.removeEventListener("mousemove",g),u.current?.widget===E&&(l(!0),m(E)),u.current=void 0},[g,u,m]),S=b.exports.useMemo(()=>o.filter(y=>a?y.name?.toLowerCase().includes(a.toLowerCase()):!0),[a,o]).sort((y,E)=>y.name?.localeCompare(E.name??"")??0),w=b.exports.useMemo(()=>S.map(y=>h("li",{children:v(V,{kind:"ghost","data-testid":`panel-list-item-${y.name??""}-button`,onMouseDown:E=>{f(E,y)},onMouseUp:E=>{C(E,y)},onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&m(y)},disabled:r,onClick:()=>{},children:[h(Lh,{type:y.type})," ",y.name??""]})},y.name)),[S,r,f,C,m]),T=b.exports.useMemo(()=>w.length===0?h("span",{children:"No bound variables found."}):null,[w]);return v("div",{className:"widget-list-container d-flex flex-column",children:[h("div",{className:"widget-list-header",children:h(Bi,{value:a,placeholder:"Find Table, Plot or Widget",onChange:p,ref:c})}),v("ul",{className:"widget-list flex-grow-1",children:[T&&h("li",{className:"widget-list-message",children:T}),!T&&w]}),h("div",{children:h("hr",{})}),v("div",{className:"widget-list-footer",children:[v(V,{kind:"ghost",onClick:e,children:[v("div",{className:"fa-md fa-layers",children:[h(J,{mask:da,icon:jd,transform:"right-5 down-5"}),h(J,{icon:jd,transform:"right-8 down-6"})]}),"Export Layout"]}),v(V,{kind:"ghost",onClick:n,children:[v("div",{className:"fa-md fa-layers",children:[h(J,{mask:da,icon:ha,transform:"right-5 down-5"}),h(J,{icon:ha,transform:"right-8 down-6"})]}),"Import Layout"]}),h(V,{kind:"ghost",icon:ti,onClick:s,tooltip:"Reset Layout"})]})]})}const aR=async(t,e,n)=>{let s,i,o,r;if(Rr(e)?(s=e.settings,i=e.table,o=void 0,r=e.tableSettings):(s={},i="",o=e.figure,r={}),n!==void 0&&(n.tableSettings!=null&&(r=n.tableSettings),n.table!=null&&(i=n.table),n.figure!=null&&(o=n.figure),n.settings!=null&&(s={...s,...n.settings})),o!==void 0){const d={title:o,name:o,type:I.VariableType.FIGURE},c=await t.getObject(d);return Oi.makeModel(s,c)}const l={title:o,name:i,type:I.VariableType.TABLE},a=await t.getObject(l);return te.applyTableSettings(a,r,Ao(Sl.getState())),Oi.makeModelFromSettings(s,a)},dR=async(t,e,n=I.VariableType.TABLE)=>{const{table:s}=e,i={title:s,name:s,type:n},o=await t.getObject(i);return Cd.makeModel(o)};function cR({onAutoFillClick:t=()=>{}}){return v("div",{className:"empty-dashboard-container",children:[v("div",{className:"hint-container",children:[h(J,{icon:Fh})," ",h("br",{}),"Use the panel list to add objects from a query."]}),v("div",{className:"empty-dashboard",children:[h("div",{className:"add-panels-hint",children:"Drag Panels Here"}),h(V,{kind:"tertiary",onClick:t,children:"Auto fill objects"})]})]})}function hR(t){return t.version===2}function uR(t){return Array.isArray(t)}const Tr=ee.module("UserLayoutUtils"),mR={layoutConfig:[{type:"column",content:[{type:"row",height:40,content:[{type:"stack",content:[{type:"react-component",component:Ii.COMPONENT,title:Ii.TITLE,isClosable:!1},{type:"react-component",component:Xr.COMPONENT,title:Xr.TITLE,isClosable:!1}]},{type:"stack",width:25,content:[{type:"react-component",component:qr.COMPONENT,title:qr.TITLE,isClosable:!1},{type:"react-component",component:Yr.COMPONENT,title:Yr.TITLE,isClosable:!1}]}]},{type:"row",content:[{type:"stack",title:"Notebooks",content:[]}]}]}],links:[],filterSets:[],version:2},pR={layoutConfig:[],links:[],filterSets:[],version:2};function dp(t){if(hR(t))return t;if(uR(t))return{layoutConfig:t,links:[],filterSets:[],version:2};throw new Error(`Unexpected layout import format: ${t}`)}async function gR(t,e=!0){try{const n=await t.getLayouts();if(n.length>0)try{const s=await t.getLayout(n[0]);return dp(s)}catch(s){Tr.error("Unable to load layout",n[0],":",s),Tr.warn("No valid layouts found, falling back to default layout")}}catch(n){Tr.error("Unable to fetch layout list",n),Tr.warn("Falling back to default layout")}return e?mR:pR}function fR(t){const{filterSets:e,layoutConfig:n,links:s}=t;return{filterSets:e,layoutConfig:n,links:s,version:2}}const _r={exportLayout:fR,getDefaultLayout:gR,normalizeLayout:dp},vr=ee.module("DownloadServiceWorkerUtils"),cp=class{static registerOnLoaded(){new URL("/ide/",window.location.href).origin===window.location.origin&&("serviceWorker"in navigator?window.addEventListener("load",()=>{const e=new URL("/ide/download/serviceWorker.js",window.location.href);navigator.serviceWorker.register(e).then(n=>{n.update(),vr.info("Registering service worker on ",e,n)}).catch(n=>{vr.error("Failed to register service worker",n)})}):vr.info("Service worker is not supported."))}static async getServiceWorker(){if("serviceWorker"in navigator){const e=(await navigator.serviceWorker.getRegistrations()).find(n=>n.scope.endsWith(cp.DOWNLOAD_PATH));if(e&&e.active)return vr.info("Download service worker is active."),e.active;throw new Error("Can not find download service worker.")}throw new Error("Download service worker is not available.")}static unregisterSW(){}};let jr=cp;jr.DOWNLOAD_PATH="/download/";const hp={react:de,"react-dom":No,redux:qp,"react-redux":Yp},CR=Kp(hp),SR=Xp({requires:CR}),bR=jp.createRequires(hp),wR=Zp({requires:bR}),TR=ee.module("PluginUtils");class Ma{static loadComponentPlugin(e){if("".split(",").includes(e)){const o=de.lazy(()=>bf(()=>import(`./internal/${e}`),[])),r=de.forwardRef((l,a)=>h(b.exports.Suspense,{fallback:h("div",{children:"Loading Plugin..."}),children:h(o,{ref:a,...l})}));return r.pluginName=e,r.displayName="Local Plugin",r}const n=new URL("/ide/plugins/",`${window.location}`),s=new URL(`${e}.js`,n),i=de.forwardRef((o,r)=>h(SR,{url:s,render:({err:l,Component:a})=>{if(l!=null&&l!==""){const d=`Error loading plugin ${e} from ${s} due to ${l}`;return TR.error(d),h("div",{className:"error-message",children:`${d}`})}return h(a,{ref:r,...o})}}));return i.pluginName=e,i.displayName="Plugin",i}static async loadModulePlugin(e){return await wR(e)}static async loadJson(e){return new Promise((n,s)=>{const i=new XMLHttpRequest;i.addEventListener("load",()=>{try{const o=JSON.parse(i.responseText);n(o)}catch(o){s(o)}}),i.addEventListener("error",o=>{s(o)}),i.open("GET",e),i.send()})}}const Ot=ee.module("AppMainContainer");class Do extends b.exports.Component{constructor(e){super(e),this.getDashboardPlugins=ge(n=>[...n.entries()].filter(([,s])=>s.DashboardPlugin!=null).map(([s,{DashboardPlugin:i}])=>h(i,{},s))),this.handleSettingsMenuHide=this.handleSettingsMenuHide.bind(this),this.handleSettingsMenuShow=this.handleSettingsMenuShow.bind(this),this.handleError=this.handleError.bind(this),this.handleControlSelect=this.handleControlSelect.bind(this),this.handleToolSelect=this.handleToolSelect.bind(this),this.handleClearFilter=this.handleClearFilter.bind(this),this.handleDataChange=this.handleDataChange.bind(this),this.handleAutoFillClick=this.handleAutoFillClick.bind(this),this.handleGoldenLayoutChange=this.handleGoldenLayoutChange.bind(this),this.handleLayoutConfigChange=this.handleLayoutConfigChange.bind(this),this.handleExportLayoutClick=this.handleExportLayoutClick.bind(this),this.handleImportLayoutClick=this.handleImportLayoutClick.bind(this),this.handleImportLayoutFiles=this.handleImportLayoutFiles.bind(this),this.handleLoadTablePlugin=this.handleLoadTablePlugin.bind(this),this.handleResetLayoutClick=this.handleResetLayoutClick.bind(this),this.handleWidgetMenuClick=this.handleWidgetMenuClick.bind(this),this.handleWidgetsMenuClose=this.handleWidgetsMenuClose.bind(this),this.handleWidgetSelect=this.handleWidgetSelect.bind(this),this.handlePaste=this.handlePaste.bind(this),this.hydrateChart=this.hydrateChart.bind(this),this.hydrateGrid=this.hydrateGrid.bind(this),this.hydratePandas=this.hydratePandas.bind(this),this.hydrateDefault=this.hydrateDefault.bind(this),this.openNotebookFromURL=this.openNotebookFromURL.bind(this),this.importElement=de.createRef(),this.state={contextActions:[{action:()=>{this.handleToolSelect(Wt.LINKER)},shortcut:ls.LINKER,isGlobal:!0},{action:()=>{this.sendClearFilter()},shortcut:en.TABLE.CLEAR_ALL_FILTERS,isGlobal:!0},{action:()=>{Ot.debug("Consume unhandled save shortcut")},shortcut:ls.SAVE,isGlobal:!0}],isPanelsMenuShown:!1,isSettingsMenuShown:!1,widgets:[]}}static handleWindowBeforeUnload(e){e.preventDefault(),e.returnValue=""}static hydrateConsole(e,n){return wa.hydrate({...e,unzip:s=>Sh.loadAsync(s).then(i=>Object.values(i.files))},n)}componentDidMount(){this.initWidgets(),window.addEventListener("beforeunload",Do.handleWindowBeforeUnload)}componentDidUpdate(e){const{dashboardData:n}=this.props;e.dashboardData!==n&&this.handleDataChange(n)}componentWillUnmount(){this.deinitWidgets(),window.removeEventListener("beforeunload",Do.handleWindowBeforeUnload)}initWidgets(){const{connection:e}=this.props;if(e.subscribeToFieldUpdates==null){Ot.warn("subscribeToFieldUpdates not supported, not initializing widgets");return}this.widgetListenerRemover=e.subscribeToFieldUpdates(n=>{Ot.debug("Got updates",n),this.setState(({widgets:s})=>{const{updated:i,created:o,removed:r}=n,l=[...i,...r],a=s.filter(c=>!l.some(u=>u.name===c.name));return[...i,...o].forEach(c=>{c.name!=null&&c.name!==""&&a.push(c)}),{widgets:a}})})}deinitWidgets(){this.widgetListenerRemover?.()}openNotebookFromURL(){const{match:e}=this.props,{notebookPath:n}=e.params;if(n){const{session:s,sessionConfig:i}=this.props;if(s==null||i==null){Ot.error("No session available to open notebook URL",n);return}const o={id:`/${n}`,itemName:`/${n}`},r=i.type,l={value:null,language:r};this.emitLayoutEvent(Ae.SELECT_NOTEBOOK,s,r,l,o,!0)}}sendClearFilter(){this.emitLayoutEvent(Le.CLEAR_ALL_FILTERS)}emitLayoutEvent(e,...n){this.goldenLayout?.eventHub.emit(e,...n)}handleError(e){ye.isCanceled(e)||Ot.error(e)}handleSettingsMenuHide(){this.setState({isSettingsMenuShown:!1})}handleSettingsMenuShow(){this.setState({isSettingsMenuShown:!0})}handleControlSelect(e,n=null){switch(Ot.debug("handleControlSelect",e),e){case un.DROPDOWN_FILTER:this.emitLayoutEvent(Le.OPEN_DROPDOWN,{title:"DropdownFilter",type:e,createNewStack:!0,dragEvent:n});break;case un.INPUT_FILTER:this.emitLayoutEvent(Le.OPEN_INPUT,{title:"InputFilter",type:e,createNewStack:!0,dragEvent:n});break;case un.MARKDOWN:this.emitLayoutEvent(xm.OPEN,{title:"Markdown",type:e,dragEvent:n});break;case un.FILTER_SET_MANAGER:this.emitLayoutEvent(Le.OPEN_FILTER_SET_MANAGER,{title:"FilterSets",type:e,dragEvent:n});break;default:throw new Error(`Unrecognized control type ${e}`)}}handleToolSelect(e){Ot.debug("handleToolSelect",e);const{activeTool:n,setActiveTool:s}=this.props;s(n===e?Wt.DEFAULT:e)}handleClearFilter(){this.sendClearFilter()}handleDataChange(e){const{updateWorkspaceData:n}=this.props,{closed:s,filterSets:i,links:o}=e;n({closed:s,filterSets:i,links:o})}handleGoldenLayoutChange(e){this.goldenLayout=e}handleLayoutConfigChange(e){const{updateWorkspaceData:n}=this.props;n({layoutConfig:e})}handleWidgetMenuClick(){this.setState(({isPanelsMenuShown:e})=>({isPanelsMenuShown:!e}))}handleWidgetSelect(e,n){this.setState({isPanelsMenuShown:!1}),Ot.debug("handleWidgetSelect",e,n),this.openWidget(e,n)}handleWidgetsMenuClose(){this.setState({isPanelsMenuShown:!1})}handleAutoFillClick(){const{widgets:e}=this.state;Ot.debug("handleAutoFillClick",e);const n=e.sort((s,i)=>s.title!=null&&i.title!=null?s.title.localeCompare(i.title):0);for(let s=0;s<n.length;s+=1)this.openWidget(n[s])}handleExportLayoutClick(){Ot.info("handleExportLayoutClick"),this.setState({isPanelsMenuShown:!1});try{const{workspace:e}=this.props,{data:n}=e,s=_r.exportLayout(n);Ot.info("handleExportLayoutClick exportedConfig",s);const i=new Blob([JSON.stringify(s)],{type:"application/json"}),o=I.i18n.DateTimeFormat.format("yyyy-MM-dd-HHmmss",new Date),r=document.createElement("a");r.href=URL.createObjectURL(i),r.download=`deephaven-app-layout-${o}.json`,r.click()}catch(e){Ot.error("Unable to export layout",e)}}handleImportLayoutClick(){Ot.info("handleImportLayoutClick"),this.setState({isPanelsMenuShown:!1}),this.importElement.current!=null&&(this.importElement.current.value="",this.importElement.current.click())}handleResetLayoutClick(){Ot.info("handleResetLayoutClick"),this.setState({isPanelsMenuShown:!1}),this.resetLayout()}handleImportLayoutFiles(e){e.stopPropagation(),e.preventDefault(),e.target.files!=null&&this.importLayoutFile(e.target.files?.[0])}async importLayoutFile(e){try{const{updateDashboardData:n,updateWorkspaceData:s}=this.props,i=await e.text(),o=JSON.parse(i),{filterSets:r,layoutConfig:l,links:a}=_r.normalizeLayout(o);s({layoutConfig:l}),n(bn,{filterSets:r,links:a})}catch(n){Ot.error("Unable to import layout",n)}}async resetLayout(){const{layoutStorage:e,session:n}=this.props,{filterSets:s,layoutConfig:i,links:o}=await _r.getDefaultLayout(e,n!==void 0),{updateDashboardData:r,updateWorkspaceData:l}=this.props;l({layoutConfig:i}),r(bn,{filterSets:s,links:o})}handlePaste(e){if(e.target instanceof HTMLElement&&e.target.closest(".monaco-editor"))return;const{clipboardData:n}=e,s=n.getData("Text"),i=/“|”/g;i.test(s)&&(e.preventDefault(),e.stopPropagation(),document.execCommand("insertText",!1,s.replace(i,'"')))}handleLoadTablePlugin(e){const{plugins:n}=this.props,s=n.get(e);return s!=null&&s.TablePlugin!=null?s.TablePlugin:Ma.loadComponentPlugin(e)}hydrateDefault(e,n){const{connection:s}=this.props,{metadata:i}=e;if(i?.type!=null&&(i?.id!=null||i?.name!=null)){const o=i.id!=null?{type:i.type,id:i.id}:{type:i.type,name:i.name,title:i.name};return{fetch:()=>s.getObject(o),localDashboardId:n,...e}}return wa.hydrate(e,n)}hydrateGrid(e,n){return this.hydrateTable(e,n,e.metadata.type??I.VariableType.TABLE)}hydratePandas(e,n){return this.hydrateTable(e,n,I.VariableType.PANDAS)}hydrateTable(e,n,s=I.VariableType.TABLE){const{connection:i}=this.props;return{...e,getDownloadWorker:jr.getServiceWorker,loadPlugin:this.handleLoadTablePlugin,localDashboardId:n,makeModel:()=>dR(i,e.metadata,s)}}hydrateChart(e,n){const{connection:s}=this.props;return{...e,localDashboardId:n,makeModel:()=>{const{metadata:i,panelState:o}=e;return aR(s,i,o)}}}openWidget(e,n){const{connection:s}=this.props;this.emitLayoutEvent(Ee.OPEN,{dragEvent:n,fetch:()=>s.getObject(e),widget:e})}render(){const{activeTool:e,plugins:n,user:s,workspace:i,serverConfigValues:o}=this.props,{data:r}=i,{layoutConfig:l}=r,{permissions:a}=s,{canUsePanels:d}=a,{contextActions:c,isPanelsMenuShown:u,isSettingsMenuShown:m,widgets:p}=this.state,g=this.getDashboardPlugins(n);return v("div",{className:K("app-main-tabs","w-100","h-100","d-flex","flex-column",e?`active-tool-${e.toLowerCase()}`:""),onPaste:this.handlePaste,tabIndex:-1,children:[h("nav",{className:"nav-container",children:v("div",{className:"app-main-top-nav-menus",children:[h("img",{src:ep,alt:"Deephaven Data Labs",width:"115px",className:"ml-1"}),v("div",{children:[v(V,{kind:"ghost",className:"btn-panels-menu",icon:Cf,onClick:()=>{},children:["Controls",h(Ld,{handleControlSelect:this.handleControlSelect,handleToolSelect:this.handleToolSelect,onClearFilter:this.handleClearFilter})]}),d&&v(V,{kind:"ghost",className:"btn-panels-menu btn-show-panels","data-testid":"app-main-panels-button",onClick:this.handleWidgetMenuClick,icon:Sf,children:["Panels",h(nl,{isShown:u,className:"panels-menu-popper",onExited:this.handleWidgetsMenuClose,closeOnBlur:!0,interactive:!0,children:h(lR,{widgets:p,onExportLayout:this.handleExportLayoutClick,onImportLayout:this.handleImportLayoutClick,onResetLayout:this.handleResetLayoutClick,onSelect:this.handleWidgetSelect})})]}),h(V,{kind:"ghost",className:K("btn-settings-menu",{"text-warning":s.operateAs!==s.name}),onClick:this.handleSettingsMenuShow,icon:h(J,{icon:xo,transform:"grow-3 right-1 down-1"}),tooltip:"User Settings"})]})]})}),v(tw,{emptyDashboard:h(cR,{onAutoFillClick:this.handleAutoFillClick}),id:bn,layoutConfig:l,onGoldenLayoutChange:this.handleGoldenLayoutChange,onLayoutConfigChange:this.handleLayoutConfigChange,onLayoutInitialized:this.openNotebookFromURL,hydrate:this.hydrateDefault,children:[h(my,{hydrate:this.hydrateGrid,getDownloadWorker:jr.getServiceWorker,loadPlugin:this.handleLoadTablePlugin}),h(ly,{hydrate:this.hydrateChart}),h(ay,{}),h(cy,{hydrateConsole:Do.hydrateConsole,notebooksUrl:new URL("/notebooks/",`${window.location}`).href}),h(hy,{}),h(Ty,{hydrate:this.hydratePandas}),h(wy,{}),h(by,{}),g]}),h(Ht,{in:m,timeout:Xe.transitionMidMs,classNames:"slide-left",mountOnEnter:!0,unmountOnExit:!0,children:h(ji,{serverConfigValues:o,onDone:this.handleSettingsMenuHide})}),h(le,{actions:c}),h("input",{ref:this.importElement,type:"file",accept:".json",style:{display:"none"},onChange:this.handleImportLayoutFiles})]})}}const vR=t=>({activeTool:gl(t),dashboardData:Yt(t,bn),layoutStorage:oR(t),plugins:oS(t),connection:CE(t,bn),session:di(t,bn)?.session,sessionConfig:di(t,bn)?.config,user:ru(t),workspace:pl(t),serverConfigValues:rR(t)}),ER=vt(vR,{setActiveTool:Cl,updateDashboardData:Vn,updateWorkspaceData:Ru})(Qp(Do));function yR(){return v("div",{className:"app",children:[h(ER,{}),h(kh,{})]})}const RR=ee.module("LocalWorkspaceStorage"),To=class{static async makeDefaultWorkspaceData(t,e){const{filterSets:n,links:s,layoutConfig:i}=await _r.getDefaultLayout(t,e?.isConsoleAvailable);return{settings:{defaultDateTimeFormat:st.DEFAULT_DATETIME_FORMAT_STRING,formatter:[],timeZone:st.DEFAULT_TIME_ZONE_ID,showTimeZone:!1,showTSeparator:!0,disableMoveConfirmation:!1,defaultDecimalFormatOptions:{defaultFormatString:ke.DEFAULT_FORMAT_STRING},defaultIntegerFormatOptions:{defaultFormatString:Ze.DEFAULT_FORMAT_STRING},truncateNumbersWithPound:!1,defaultNotebookSettings:{isMinimapEnabled:!1}},layoutConfig:i,closed:[{}],links:s,filterSets:n}}static async makeDefaultWorkspace(t,e){return{data:await To.makeDefaultWorkspaceData(t,e)}}constructor(t){this.layoutStorage=t}async load(t){try{return JSON.parse(localStorage.getItem(To.STORAGE_KEY)??"")}catch{return RR.info("Unable to load workspace data, initializing to default data"),To.makeDefaultWorkspace(this.layoutStorage,t)}}async save(t){return localStorage.setItem(To.STORAGE_KEY,JSON.stringify(t)),t}};let up=To;up.STORAGE_KEY="deephaven.WorkspaceStorage";class IR extends Error{constructor(){super(...arguments),this.isNoConsolesError=!0}}function FR(t){return t.isNoConsolesError}const ks=ee.module("SessionUtils");var mp=(t=>(t.ANONYMOUS="anonymous",t.PARENT="parent",t))(mp||{});function DR(){return new URL("/jsapi",`${window.location}`)}function pp(){const t=DR();return`${t.protocol}//${t.host}`}function NR(){switch(new URLSearchParams(window.location.search).get("authProvider")){case"parent":return"parent";default:return"anonymous"}}function _R(){const t=pp();return ks.info(`Starting connection to '${t}'...`),new I.IdeConnection(t)}async function MR(t){ks.info("Getting console types...");const e=await t.getConsoleTypes();if(ks.info("Available types:",e),e.length===0)throw new IR("No console types available");const n=e[0];ks.info("Starting session with type",n);const s=await t.startSession(n),i={type:n,id:$e.generate()};return ks.info("Console session established",i),{session:s,config:i,connection:t}}function kR(){const t=pp();return ks.info("createCoreClient",t),new I.CoreClient(t)}async function xR(){if(window.opener==null)throw new Error("window.opener is null, unable to send auth request.");return new Promise(t=>{const e=n=>{const{data:s}=n;if(ks.debug("Received message",s),s?.message!=="loginOptions"){ks.debug("Ignore received message",s);return}window.removeEventListener("message",e),t(s.payload)};window.addEventListener("message",e),window.opener.postMessage("requestLoginOptionsFromParent","*")})}async function OR(t){switch(t){case"parent":return xR();case"anonymous":return{type:I.CoreClient.LOGIN_TYPE_ANONYMOUS};default:throw new Error(`Unknown auth type: ${t}`)}}class AR{constructor(e,n=""){this.storageService=e,this.root=n}async getLayouts(){return(await this.storageService.listItems(this.root,"*.json")).map(n=>n.basename)}async getLayout(e){const s=await(await this.storageService.loadFile(`${this.root}/${e}`)).text();return JSON.parse(s)}}const po=ee.module("GrpcFileStorageTable"),ka=class{constructor(t,e="",n=e){this.currentSize=0,this.listeners=[],this.childTables=new Map,this.storageService=t,this.baseRoot=e,this.root=n,n===e&&(this.doRefresh=Je(this.doRefresh.bind(this),ka.REFRESH_DEBOUNCE))}removeBaseRoot(t){return me.removeRoot(this.baseRoot,t)}getViewportData(){return this.viewportUpdatePromise||this.refreshInternal(),this.viewportUpdatePromise??Promise.resolve({items:[],offset:0})}getSnapshot(t){throw new Error("Method not implemented.")}get size(){return this.currentSize}setExpanded(t,e){const n=t.split("/");let s=n.shift();if((s===void 0||s==="")&&(s=n.shift()),s===void 0||s==="")throw new Error(`Invalid path: ${t}`);const i=n.join("/");if(e){if(!this.childTables.has(s)){const o=new ka(this.storageService,this.baseRoot,`${this.root}/${s}`);this.childTables.set(s,o)}i&&this.childTables.get(s)?.setExpanded(i,e)}else this.childTables.has(s)&&(i?this.childTables.get(s)?.setExpanded(i,e):this.childTables.delete(s));this.currentViewport&&this.refreshInternal()}collapseAll(){this.childTables.clear(),this.currentViewport&&this.refreshInternal()}setSearch(t){throw new Error("Method not implemented.")}setViewport(t){this.currentViewport=t,this.refreshInternal()}setFilters(){throw new Error("Method not implemented.")}setSorts(){throw new Error("Method not implemented.")}setReversed(){throw new Error("Method not implemented.")}close(){this.listeners=[]}onUpdate(t){return this.listeners=[...this.listeners,t],()=>{this.listeners=this.listeners.filter(e=>e!==t)}}doRefresh(t){po.debug2("doRefresh",this.root),t(this.fetchData())}refresh(){po.debug2("refresh",this.root),this.viewportUpdatePromise?.cancel();const t=new Promise(n=>{this.doRefresh(n)}),e=ye.makeCancelable(t.then(n=>{if(this.viewportUpdatePromise!==e)throw new Jr;return this.currentViewportData=n,this.sendUpdate(),n}));e.catch(n=>{ye.isCanceled(n)||po.error("Error updating viewport",n)}),this.viewportUpdatePromise=e}refreshInternal(){try{this.refresh()}catch(t){ye.isCanceled(t)||po.error("Unable to refresh data",t)}}async fetchData(){const{currentViewport:t}=this;if(!t)throw new Error("No viewport set");let n=(await this.storageService.listItems(this.root)).map(s=>({type:s.type,filename:this.removeBaseRoot(s.filename),basename:s.basename,id:this.removeBaseRoot(s.filename),isExpanded:s.type==="directory"?this.childTables.has(s.basename):void 0})).sort((s,i)=>s.type!==i.type?s.type==="directory"?-1:1:s.basename.localeCompare(i.basename));for(let s=0;s<n.length;s+=1){const i=n[s],{basename:o,filename:r}=i;if(r===this.removeBaseRoot(`${this.root}/${o}`)&&i.type==="directory"){const l=this.childTables.get(o);if(l!=null){l.setViewport({top:0,bottom:t.bottom-s});const a=await l.getViewportData();n.splice(s+1,0,...a.items)}}}return this.currentSize=n.length,po.debug2(this.root,"items",n,t),n=n.slice(t.top,t.bottom),{items:n,offset:t.top}}sendUpdate(){const{listeners:t}=this,e=this.currentViewportData??{items:[],offset:0};for(let n=0;n<t.length;n+=1)t[n](e)}};let gp=ka;gp.REFRESH_DEBOUNCE=50;const LR=ee.module("GrpcFileStorage"),fp=class{constructor(t,e=""){this.tables=[],this.refreshTables=Pn(()=>{this.tables.forEach(n=>n.refresh())},fp.REFRESH_THROTTLE),this.storageService=t,this.root=e}removeRoot(t){return me.removeRoot(this.root,t)}addRoot(t){return me.addRoot(this.root,t)}async createDirectory(t){return await this.storageService.createDirectory(this.addRoot(t)),this.refreshTables(),{type:"directory",id:t,filename:t,basename:me.getBaseName(t)}}async getTable(){const t=new gp(this.storageService,this.root);return this.tables.push(t),t}async saveFile(t){const e=dh.storage.FileContents.text(t.content);return await this.storageService.saveFile(this.addRoot(t.filename),e,!0),this.refreshTables(),t}async loadFile(t){const n=await(await this.storageService.loadFile(this.addRoot(t))).text();return{filename:t,basename:me.getBaseName(t),content:n}}async deleteFile(t){await this.storageService.deleteItem(this.addRoot(t)),this.refreshTables()}async moveFile(t,e){await this.storageService.moveItem(this.addRoot(t),this.addRoot(e)),this.refreshTables()}async info(t){const e=await this.storageService.listItems(this.addRoot(me.getPath(t)),me.getBaseName(t));if(e.length===0)throw new Fd;if(e.length>1)throw LR.error("More than one matching file found, should never happen.",e),new Error("More than one matching file found");const n=e[0];return{filename:this.removeRoot(n.filename),basename:n.basename,id:this.removeRoot(n.filename),type:n.type}}};let Cp=fp;Cp.REFRESH_THROTTLE=150;const xs=ee.module("AppInit");async function PR(){xs.debug("Loading plugins...");try{const t=await Ma.loadJson("/js-plugins/manifest.json");xs.debug("Plugin manifest loaded:",t);const e=[];for(let i=0;i<t.plugins.length;i+=1){const{name:o,main:r}=t.plugins[i],l=`/js-plugins/${o}/${r}`;e.push(Ma.loadModulePlugin(l))}const n=await Promise.all(e),s=new Map;for(let i=0;i<n.length;i+=1){const{name:o}=t.plugins[i];s.set(o,n[i])}return xs.info("Plugins loaded:",s),s}catch(t){return xs.error("Unable to load plugins:",t),new Map}}async function HR(t){let e;try{e=await MR(t)}catch(n){if(!FR(n))throw n}return e}function Pd(t){const{workspace:e,setActiveTool:n,setCommandHistoryStorage:s,setDashboardData:i,setFileStorage:o,setLayoutStorage:r,setDashboardConnection:l,setDashboardSessionWrapper:a,setPlugins:d,setUser:c,setWorkspace:u,setWorkspaceStorage:m,setServerConfigValues:p}=t,[g,f]=b.exports.useState(),[C,S]=b.exports.useState(!0),w=b.exports.useCallback(async()=>{try{xs.info("Initializing Web UI","0.31.1",navigator.userAgent);const F=kR(),D=NR();xs.info(`Login using auth type ${D}...`),await F.login(await OR(D));const _=await PR(),H=await(D===mp.ANONYMOUS&&F.getAsIdeConnection==null?_R():F.getAsIdeConnection());H.addEventListener(I.IdeConnection.HACK_CONNECTION_FAILURE,Se=>{const{detail:Re}=Se;xs.error("Connection failure",`${JSON.stringify(Re)}`),f(`Unable to connect: ${Re.details??"Unknown Error"}`)});const U=await HR(H),A="user",Y=F.getStorageService(),G=new AR(Y,"/layouts"),z=new Cp(Y,"/notebooks"),x=new up(G),L=new xy,P=await x.load({isConsoleAvailable:U!==void 0}),{data:Z}=P,{settings:ne}=Z;ne.defaultDecimalFormatOptions===void 0&&(ne.defaultDecimalFormatOptions={defaultFormatString:ke.DEFAULT_FORMAT_STRING}),ne.defaultIntegerFormatOptions===void 0&&(ne.defaultIntegerFormatOptions={defaultFormatString:Ze.DEFAULT_FORMAT_STRING}),ne.truncateNumbersWithPound===void 0&&(ne.truncateNumbersWithPound=!1);const{shortcutOverrides:B={}}=ne,X=fn.isMacPlatform?B.mac??{}:B.windows??{};Object.entries(X).forEach(([Se,Re])=>{qe.get(Se)?.setKeyState(Re)});const se={filterSets:Z.filterSets,links:Z.links},ce=await F.getServerConfigValues(),Q=new Map(ce),he={name:A,operateAs:A,groups:[],permissions:{isSuperUser:!1,isQueryViewOnly:!1,isNonInteractive:!1,canUsePanels:!0,canCreateDashboard:!0,canCreateCodeStudio:!0,canCreateQueryMonitor:!0,canCopy:Q.get("internal.webClient.appInit.canCopy")!=="false",canDownloadCsv:Q.get("internal.webClient.appInit.canDownloadCsv")!=="false"}};n(Wt.DEFAULT),p(Q),s(L),i(bn,se),o(z),r(G),l(bn,H),U!==void 0&&a(bn,U),d(_),c(he),m(x),u(P)}catch(F){xs.error(F),f(F)}},[n,s,i,o,r,l,a,d,c,u,m,p]),T=b.exports.useCallback(()=>{document.fonts!=null?document.fonts.ready.then(()=>{S(!1)}):S(!1)},[]);b.exports.useEffect(function(){w(),T()},[w,T]);const y=e==null&&g==null||C,E=!y&&g==null,R=g!=null?`${g}`:null;return v(be,{children:[E&&h(yR,{}),h(el,{isLoading:y,isLoaded:E,errorMessage:R}),v("div",{id:"preload-fonts",style:{visibility:"hidden",position:"absolute",top:-1e4},children:[h("p",{className:"fira-sans-regular",children:"preload"}),h("p",{className:"fira-sans-semibold",children:"preload"}),h("p",{className:"fira-mono",children:"preload"})]})]})}Pd.propTypes={workspace:M.exports.shape({}),workspaceStorage:M.exports.shape({close:M.exports.func}),setActiveTool:M.exports.func.isRequired,setCommandHistoryStorage:M.exports.func.isRequired,setDashboardData:M.exports.func.isRequired,setFileStorage:M.exports.func.isRequired,setLayoutStorage:M.exports.func.isRequired,setDashboardConnection:M.exports.func.isRequired,setDashboardSessionWrapper:M.exports.func.isRequired,setPlugins:M.exports.func.isRequired,setUser:M.exports.func.isRequired,setWorkspace:M.exports.func.isRequired,setWorkspaceStorage:M.exports.func.isRequired};Pd.defaultProps={workspace:null,workspaceStorage:null};const UR=t=>({workspace:pl(t),workspaceStorage:nS(t)}),uh=vt(UR,{setActiveTool:Cl,setCommandHistoryStorage:aS,setDashboardData:Xu,setFileStorage:dS,setLayoutStorage:Oy,setDashboardConnection:SE,setDashboardSessionWrapper:bE,setPlugins:hS,setUser:rS,setWorkspace:yu,setWorkspaceStorage:lS,setServerConfigValues:uS})(Pd);function VR(){return h(Jp,{basename:"/ide/",children:v(eg,{children:[h($d,{exact:!0,path:"/",component:uh}),h($d,{path:"/notebook/:notebookPath+",component:uh}),h(tg,{from:"*",to:"/"})]})})}Boolean(window.location.hostname==="localhost"||window.location.hostname==="[::1]"||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));function BR(){"serviceWorker"in navigator&&navigator.serviceWorker.getRegistrations().then(t=>{t.forEach(e=>{e.scope.endsWith("/download/")||e.unregister()})})}function YR(){return BR(),jr.registerOnLoaded(),lt.init({getWorker:()=>new wf}),window["__react-beautiful-dnd-disable-dev-warnings"]=!0,h(ph,{store:Sl,children:h(VR,{})})}export{YR as AppRoot,YR as default};
42
- //# sourceMappingURL=AppRoot.5ed03647.js.map
42
+ //# sourceMappingURL=AppRoot.4c48896e.js.map