@deephaven/embed-widget 0.85.41 → 0.85.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/assets/{App-BgUxxSX8.js → App-Bm8waigR.js} +2 -2
- package/build/assets/{App-BgUxxSX8.js.map → App-Bm8waigR.js.map} +1 -1
- package/build/assets/{Chart-DITkoH4J.js → Chart-uDj1SWnk.js} +2 -2
- package/build/assets/{Chart-DITkoH4J.js.map → Chart-uDj1SWnk.js.map} +1 -1
- package/build/assets/{IrisGrid-CWZtOvAV.js → IrisGrid-DI0ZPxfS.js} +2 -2
- package/build/assets/{IrisGrid-CWZtOvAV.js.map → IrisGrid-DI0ZPxfS.js.map} +1 -1
- package/build/assets/{IrisGridThemeProvider-Gs71n0JL.js → IrisGridThemeProvider-CGeAIOXA.js} +3 -3
- package/build/assets/{IrisGridThemeProvider-Gs71n0JL.js.map → IrisGridThemeProvider-CGeAIOXA.js.map} +1 -1
- package/build/assets/{LocalWorkspaceStorage-STwIHE3I.js → LocalWorkspaceStorage-D8Nkjm_H.js} +2 -2
- package/build/assets/{LocalWorkspaceStorage-STwIHE3I.js.map → LocalWorkspaceStorage-D8Nkjm_H.js.map} +1 -1
- package/build/assets/{LogPanel-Ck_sjcZA.js → LogPanel-DHULO3aD.js} +2 -2
- package/build/assets/{LogPanel-Ck_sjcZA.js.map → LogPanel-DHULO3aD.js.map} +1 -1
- package/build/assets/{MarkdownEditor-Cr69mCRS.js → MarkdownEditor-BL5tU_c8.js} +2 -2
- package/build/assets/{MarkdownEditor-Cr69mCRS.js.map → MarkdownEditor-BL5tU_c8.js.map} +1 -1
- package/build/assets/{MarkdownNotebook-0BhkwZxg.js → MarkdownNotebook-BX7MT55g.js} +2 -2
- package/build/assets/{MarkdownNotebook-0BhkwZxg.js.map → MarkdownNotebook-BX7MT55g.js.map} +1 -1
- package/build/assets/{index-0AsqbK-5.js → index-C6uNMsJo.js} +2 -2
- package/build/assets/{index-0AsqbK-5.js.map → index-C6uNMsJo.js.map} +1 -1
- package/build/assets/{index-B2n8OD1I.js → index-CmctFa0c.js} +3 -3
- package/build/assets/{index-B2n8OD1I.js.map → index-CmctFa0c.js.map} +1 -1
- package/build/assets/{index-CqW6mPlJ.js → index-DPW3FCzI.js} +6 -6
- package/build/assets/index-DPW3FCzI.js.map +1 -0
- package/build/index.html +2 -2
- package/package.json +7 -7
- package/build/assets/index-CqW6mPlJ.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Plot-9MEtok1o.js","./Plotly-gH-FXxbq.js","./plotly-BNi-gO9O.js","./helpers-BosuxZz1.js","./vendor-DrtWDXhi.js","./vendor-DhqnWjAV.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as L,an as Ro,T as ba,p as ya,B as Ca,D as wa,G as Sa,A as _a,H as Ea,w as Pa,O as Ta,M as Fo,s as Ho,b as $o,k as Oa,ao as Uo,ap as xa,aq as Ia,L as wn,U as Ma,F as Da,ar as Bo,r as Ko,E as ja,as as ka,am as Na,ai as Wo,aj as zo,q as Vo,h as Aa,l as H,ak as hn,at as La,au as Ji,av as Ra,aw as Fa,ax as Ha,ay as $a,v as Ua,e as Go,af as Ba,c as mi,aa as Ka,az as Wa,aA as er,ad as za,aB as tr,aC as qo,aD as Va,a4 as Ga,aE as qa,aF as Za,aG as Xa,aH as Ya,aI as Qa,aJ as Ja}from"./index-B2n8OD1I.js";import{r as c,bg as Hi,J as I,bx as el,E as d,G as tl,H as $,R as $i,ad as b,bh as nl,I as re,D as Pt,bt as Zo,ac as ii,ab as zt,by as il,bz as rl,bA as ol,bv as _i,_ as sl,bo as lt,bB as al,br as ht,bp as Be,bq as Nt,bC as nr,bs as ll,bD as dl,bu as Tt,bE as pn,bF as T,bG as ir,bH as ul,L as Xo,K as Yo,bI as hl,bw as Sn}from"./vendor-DrtWDXhi.js";var Fv=Object.freeze([]),Hv=new Map,$v=()=>{};function Uv(n){return Array.isArray(n)?n:[n]}function Bv(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return e.filter(i=>i!=null)}function cl(n,e,t){return(e=ml(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ml(n){var e=pl(n,"string");return typeof e=="symbol"?e:e+""}function pl(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ei extends Error{constructor(){super(...arguments),cl(this,"isCanceled",!0)}}function rr(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(u){return void t(u)}a.done?e(l):Promise.resolve(l).then(i,r)}function vl(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){rr(o,i,r,s,a,"next",l)}function a(l){rr(o,i,r,s,a,"throw",l)}s(void 0)})}}function fl(n){return Pi.apply(this,arguments)}function Pi(){return Pi=vl(function*(n){var{clipboard:e}=navigator;if(e!==void 0)try{return navigator.clipboard.writeText(n)}catch{return or(n)}or(n)}),Pi.apply(this,arguments)}function or(n){var e=document.activeElement,t=document.createElement("textarea");t.value=n,document.body.appendChild(t),t.focus(),t.select();var i=document.execCommand("copy");if(document.body.removeChild(t),e instanceof HTMLElement&&e.focus(),!i)throw new Error("Unable to execute copy command")}function Ft(n,e,t){return(e=gl(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function gl(n){var e=bl(n,"string");return typeof e=="symbol"?e:e+""}function bl(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var yl="table_",Qo="column_",Cl=new Set(["in","not","i","ii","k"]),wl=new Set(["abstract","continue","for","new","switch","assert","default","if","package","synchronized","boolean","do","goto","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","null","true","false"]),Sl=/[^a-zA-Z0-9_$\-+@]/g,_l=/[^A-Za-z0-9_$]/g,El=/^[a-zA-Z_$][a-zA-Z0-9_$\-+@]*$/,Pl=/[^a-zA-Z0-9_]/g;function Tl(n){return n.replace(/[ -]/g,"_")}function Ol(n){return n.replace(/\s/g,"_")}class De{}Ft(De,"legalize",(n,e,t,i,r,o)=>{var s=e(n.trim());return r&&(Cl.has(s)||wl.has(s))&&(s=t+s),s=s.replace(i,""),s?(/^[0-9-]/.test(s)&&(s=t+s),s):t+o});Ft(De,"legalizeTableName",n=>De.legalize(n,Ol,yl,Sl,!1,0));Ft(De,"makeVariableName",n=>De.legalizeTableName(n).replace(Pl,"_"));Ft(De,"legalizeColumnNames",n=>{var e=[];return n.forEach((t,i)=>{var r=De.legalizeColumnName(t,i);e.includes(r)&&(r=Qo+i),e.push(r)}),e});Ft(De,"legalizeColumnName",function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return De.legalize(n,Tl,Qo,_l,!0,e)});Ft(De,"isValidTableName",n=>El.test(n));Ft(De,"isValidColumnName",n=>De.legalizeColumnName(n)===n);class Jo extends CustomEvent{constructor(e,t){super(e,t)}}function xl(n,e,t){return(e=Il(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Il(n){var e=Ml(n,"string");return typeof e=="symbol"?e:e+""}function Ml(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Dl extends Error{constructor(){super(...arguments),xl(this,"isTimeout",!0)}}class Fe{static makeCancelable(e,t){var i=!1,r,o,s=new Promise((a,l)=>{o=l,Promise.resolve(e).then(u=>{i?t&&t(u):(r=u,a(u))}).catch(u=>l(u))});return s.cancel=()=>{i=!0,o(new Ei),r!=null&&t&&t(r)},s}static isCanceled(e){return e instanceof Ei}static isTimedOut(e){return e instanceof Dl}static withTimeout(e,t){return new Promise((i,r)=>{setTimeout(()=>{try{i(t())}catch(o){r(o)}},e)})}}function sr(n,e,t){return(e=jl(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jl(n){var e=kl(n,"string");return typeof e=="symbol"?e:e+""}function kl(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class _n{constructor(){sr(this,"pending",[]),sr(this,"resolved",[])}add(e,t){var i=Fe.makeCancelable(e,t);return this.pending.push(i),i.then(()=>{this.resolve(i)},()=>{this.resolve(i)}),i}remove(e){for(var t=0;t<this.pending.length;t+=1)if(this.pending[t]===e){this.pending.splice(t,1);return}}resolve(e){this.remove(e),this.resolved.push(e)}cancel(){for(var e=[...this.pending,...this.resolved],t=0;t<e.length;t+=1)e[t].cancel();this.pending=[],this.resolved=[]}}function Kv(n){var e=n;n instanceof CustomEvent&&(e=n.detail);var t="";if(e instanceof Error?t=e.message:e!=null&&(t="".concat(e)),t=t.trim(),t.length>0)return t}class qe{static isValidRange(e){return e!=null&&e.length===2&&Number.isInteger(e[0])&&Number.isInteger(e[1])&&e[0]<=e[1]}static validateRange(e){if(!qe.isValidRange(e))throw new Error("Invalid range! ".concat(e))}static isSelected(e,t){for(var i=0;i<e.length;i+=1){var r=e[i],o=r[0],s=r[1];if(o<=t&&t<=s)return!0}return!1}static selectRange(e,t){for(var[i,r]=t,o=[...e],s=o.length-1;s>=0;s-=1){var a=o[s],l=a[0],u=a[1];if(l<=i&&r<=u)return o;i<=u&&l<=r&&(i=Math.min(i,l),r=Math.max(r,u),o.splice(s,1))}return o.push([i,r]),o}static deselectRange(e,t){for(var[i,r]=t,o=[...e],s=o.length-1;s>=0;s-=1){var a=o[s],l=a[0],u=a[1];if(!(r<l||u<i))if(l<i&&r<u){o[s]=[l,i-1],o.splice(s+1,0,[r+1,u]);break}else i<=l&&u<=r?o.splice(s,1):l<i?o[s]=[l,i-1]:o[s]=[r+1,u]}return o}static count(e){return e.reduce((t,i)=>t+(i[1]-i[0]+1),0)}static getItemsInRanges(e,t){return t.reduce((i,r)=>{for(var o=[...i],s=r[0];s<=r[1];s+=1)o.push(e[s]);return o},[])}}function*Wv(n,e){for(var t=n;t<=e;++t)yield t}var zv=" ";class Nl{static join(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"and";if(e==null||e.length===0)return"";if(e.length===1)return e[0];if(e.length===2)return"".concat(e[0]," ").concat(t," ").concat(e[1]);var i=e.slice(0,e.length-1).join(", "),r=e[e.length-1];return"".concat(i,", ").concat(t," ").concat(r)}static toLower(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==null){if(t)return"";throw new Error("Null string passed in to TextUtils.toLower")}return e.toLowerCase()}static sort(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e<t?i?-1:1:e>t?i?1:-1:0}}function es(n,e,t){return(e=Al(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Al(n){var e=Ll(n,"string");return typeof e=="symbol"?e:e+""}function Ll(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class on{static formatElapsedTime(e){if(typeof e!="number"||!Number.isInteger(e))throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=Math.floor(e/3600),i=Math.floor(e%3600/60),r=e%60;return"".concat(t>0?"".concat(t,"h "):"")+"".concat(i>0||t>0?"".concat(i,"m "):"")+"".concat(e>=60?"".concat(r,"s").padStart(3,"0"):"".concat(r,"s"))}static formatTime(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=String(Math.floor(e/(60*60))).padStart(2,"0"),i=e%(60*60),r=String(Math.floor(i/60)).padStart(2,"0"),o=i%60,s=String(Math.ceil(o)).padStart(2,"0");return"".concat(t,":").concat(r,":").concat(s)}static isTimeString(e){return new RegExp(on.TIME_PATTERN).test(e)}static parseTime(e){if(e==null||typeof e!="string")throw new Error("".concat(e," is not a valid string"));var t=e.split(":");if(t.length!==3)throw new Error("".concat(e," is not a time string that can be parsed"));return Number(t[0])*60*60+Number(t[1])*60+Number(t[2])}}es(on,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");es(on,"TIME_ZONES",Object.freeze([{label:"Tokyo UTC+9 No DST",value:"Asia/Tokyo"},{label:"Seoul UTC+9 No DST",value:"Asia/Seoul"},{label:"Hong Kong UTC+8 No DST",value:"Asia/Hong_Kong"},{label:"Singapore UTC+8 No DST",value:"Asia/Singapore"},{label:"Kolkata UTC+5:30 No DST",value:"Asia/Kolkata"},{label:"Berlin UTC+1",value:"Europe/Berlin"},{label:"UTC UTC±0 No DST",value:"UTC"},{label:"London UTC±0",value:"Europe/London"},{label:"Sao Paulo UTC-2",value:"America/Sao_Paulo"},{label:"Newfoundland UTC-3:30",value:"America/St_Johns"},{label:"Halifax UTC-4",value:"America/Halifax"},{label:"New York UTC−5",value:"America/New_York"},{label:"Chicago UTC-6",value:"America/Chicago"},{label:"Denver UTC-7",value:"America/Denver"},{label:"Los Angeles UTC-8",value:"America/Los_Angeles"},{label:"Anchorage UTC-9",value:"America/Anchorage"},{label:"Honolulu UTC-10 No DST",value:"Pacific/Honolulu"},{label:"Zurich UTC+1",value:"Europe/Zurich"},{label:"Amsterdam UTC+1",value:"Europe/Amsterdam"},{label:"Taipei UTC+8 No DST",value:"Asia/Taipei"},{label:"Sydney UTC+10",value:"Australia/Sydney"}]));function Rl(n,e,t){return(e=Fl(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Fl(n){var e=Hl(n,"string");return typeof e=="symbol"?e:e+""}function Hl(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class vn extends Error{constructor(){super(...arguments),Rl(this,"isInvalid",!0)}}function ts(){var n=c.useRef(!1);return c.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function ar(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(u){return void t(u)}a.done?e(l):Promise.resolve(l).then(i,r)}function $l(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){ar(o,i,r,s,a,"next",l)}function a(l){ar(o,i,r,s,a,"throw",l)}s(void 0)})}}var Ul=L.module("useAsyncInterval");function Bl(n,e){var t=ts(),i=c.useRef(0),r=c.useRef(0),o=c.useRef(null),s=c.useCallback($l(function*(){var a=Date.now();r.current+=1;var l=o.current==null?e:a-o.current;o.current=a;try{yield n()}catch(m){Ul.error("A tick error occurred:",m)}if(t.current){l+=Date.now()-o.current;var u=Math.max(0,l-e),h=Math.max(0,e-u);i.current=window.setTimeout(s,h)}}),[n,t,e]);c.useEffect(()=>(o.current=null,s(),()=>{window.clearTimeout(i.current)}),[e,s])}function En(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"No value available in context. Was code wrapped in a provider?",t=c.useContext(n);if(t==null)throw new Error(e);return t}function Kl(n,e,t){var i=c.useRef(t),r=c.useRef(n);r.current=n;var o=c.useMemo(()=>Hi(function(){return r.current(...arguments)},e,i.current),[e]);return c.useEffect(()=>()=>{var s,a;(s=(a=i.current)===null||a===void 0?void 0:a.flushOnUnmount)!==null&&s!==void 0&&s?o.flush():o.cancel()},[o]),o}function Wl(n){var e=c.useRef();return c.useEffect(function(){e.current=n}),e.current}function ns(n){var e=c.useRef(null);return c.useEffect(function(){n&&(typeof n=="function"?n(e.current):n.current=e.current)}),e}function lr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function zl(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?lr(Object(t),!0).forEach(function(i){Xt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):lr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Xt(n,e,t){return(e=Vl(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Vl(n){var e=Gl(n,"string");return typeof e=="symbol"?e:e+""}function Gl(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var dr="popper";class Pn extends c.Component{constructor(e){super(e),Xt(this,"element",void 0),Xt(this,"container",void 0),Xt(this,"rAF",void 0),this.handleEnter=this.handleEnter.bind(this),this.handleExit=this.handleExit.bind(this),this.handleBlur=this.handleBlur.bind(this),this.element=document.createElement("div"),this.element.className="popper-container",this.container=I.createRef(),this.rAF=0;var{isShown:t}=this.props;this.state={show:t,popper:null}}componentDidUpdate(e){var{isShown:t}=this.props;e.isShown!==t&&(t?(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{this.show()})):this.hide())}componentWillUnmount(){this.destroyPopper(!1)}getVisibleElement(e){return e==null||e.clientHeight>0||e.clientWidth>0?e:this.getVisibleElement(e.parentElement)}initPopper(){var{popper:e}=this.state,{closeOnBlur:t,referenceObject:i}=this.props;if(!e&&this.container.current!==null){var{options:r}=this.props;r=zl({placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}}},r),document.body.appendChild(this.element);var o=this.getVisibleElement(this.container.current);o==null&&(o=this.container.current),e=new el(i||o,this.element,r),e.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(t){var s=this.element.querySelector(".".concat(dr));s instanceof HTMLElement&&!s.contains(document.activeElement)&&s.focus()}}),this.setState({popper:e})}}destroyPopper(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;cancelAnimationFrame(this.rAF);var{popper:t}=this.state;t&&(t.destroy(),document.body.contains(this.element)&&document.body.removeChild(this.element),e&&this.setState({popper:null}))}show(){this.initPopper(),this.setState({show:!0})}hide(){this.setState({show:!1})}scheduleUpdate(){var{popper:e}=this.state;e&&e.scheduleUpdate()}handleBlur(e){e.relatedTarget instanceof HTMLElement&&(this.element.contains(e.relatedTarget)||this.hide())}handleEnter(){var{onEntered:e}=this.props;e()}handleExit(){var{onExited:e}=this.props,{show:t}=this.state;t||this.destroyPopper(),e()}renderContent(){var{className:e,children:t,timeout:i,interactive:r,closeOnBlur:o}=this.props,{show:s}=this.state;return d.jsx(Ro,{isPortal:!0,children:d.jsx(tl,{in:s,timeout:i,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,children:d.jsx("div",{onClick:a=>{a.stopPropagation()},onKeyDown:a=>{a.key==="Escape"&&this.hide()},className:$(dr,{interactive:r},e),onBlur:o?this.handleBlur:void 0,tabIndex:o?-1:void 0,role:"presentation",children:d.jsxs("div",{className:"popper-content",children:[t,d.jsx("div",{className:"popper-arrow","x-arrow":""})]})})})})}render(){var{popper:e}=this.state,{"data-testid":t}=this.props;return d.jsx("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":t,children:e&&$i.createPortal(this.renderContent(),this.element)})}}Xt(Pn,"propTypes",{children:b.node.isRequired,options:b.shape({}),className:b.string,timeout:b.number,onEntered:b.func,onExited:b.func,isShown:b.bool,closeOnBlur:b.bool,interactive:b.bool,referenceObject:b.shape({}),"data-testid":b.string});Xt(Pn,"defaultProps",{options:{},className:"",timeout:ba.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0});function ur(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function ql(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ur(Object(t),!0).forEach(function(i){Ze(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ur(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Ze(n,e,t){return(e=Zl(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Zl(n){var e=Xl(n,"string");return typeof e=="symbol"?e:e+""}function Xl(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Yl=L.module("Tooltip");class ne extends c.Component{static handleHidden(){ne.shownTooltipCount-=1,ne.shownTooltipCount===0&&(ne.lastHiddenTime=Date.now())}static handleShown(){ne.shownTooltipCount+=1}constructor(e){super(e),Ze(this,"container",void 0),Ze(this,"popper",void 0),Ze(this,"parent",void 0),Ze(this,"timer",void 0),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowMouseMove=this.handleWindowMouseMove.bind(this),this.handleWheel=this.handleWheel.bind(this),this.handleTimeout=this.handleTimeout.bind(this),this.handleExited=this.handleExited.bind(this),this.stopShowingTooltip=this.stopShowingTooltip.bind(this),this.container=I.createRef(),this.popper=I.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}componentDidMount(){this.startListening();var{timeout:e}=this.props;e===0&&this.show()}componentDidUpdate(e,t){var{isShown:i}=t,{isShown:r}=this.state;r!==i&&(r?ne.handleShown():ne.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();var{isShown:e}=this.state;e&&ne.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){Yl.error("Tooltip doesn't have a container or a parent set!");return}this.parent=this.container.current.parentElement,this.parent.addEventListener("mousemove",this.handleMouseMove),this.parent.addEventListener("mouseleave",this.handleMouseLeave),this.parent.addEventListener("mousedown",this.stopShowingTooltip)}stopListening(){this.parent&&(this.parent.removeEventListener("mousemove",this.handleMouseMove),this.parent.removeEventListener("mouseleave",this.handleMouseLeave),this.parent.removeEventListener("mousedown",this.stopShowingTooltip))}startListeningWindow(){window.addEventListener("mousemove",this.handleWindowMouseMove,!0),window.addEventListener("contextmenu",this.stopShowingTooltip,!0),window.addEventListener("wheel",this.handleWheel)}stopListeningWindow(){window.removeEventListener("mousemove",this.handleWindowMouseMove,!0),window.removeEventListener("contextmenu",this.stopShowingTooltip,!0),window.removeEventListener("wheel",this.handleWheel)}handleMouseMove(){this.startTimer()}handleWheel(){var{isShown:e}=this.state;this.popper.current&&this.parent&&e&&!this.popper.current.element.matches(":hover")&&!this.parent.matches(":hover")&&(this.stopTimer(),this.hide())}handleMouseLeave(){var{isShown:e}=this.state;this.stopTimer();var{interactive:t}=this.props;!t&&e&&this.hide()}handleTimeout(){this.show()}handleWindowMouseMove(e){var t=e.clientX,i=e.clientY,{isShown:r}=this.state;if(!(!this.popper.current||!this.parent)){var o=this.popper.current.element.getBoundingClientRect(),s=this.parent.getBoundingClientRect();t>=o.left&&t<=o.left+o.width&&i>=o.top&&i<=o.top+o.height?this.handleMouseMove():t>=s.left&&t<=s.left+s.width&&i>=s.top&&i<=s.top+s.height?this.handleMouseMove():r&&(this.stopTimer(),this.hide())}}startTimer(){this.stopTimer();var{timeout:e,reshowTimeout:t}=this.props,i=e;(ne.shownTooltipCount>0||Date.now()-ne.lastHiddenTime<ne.triggerReshowThreshold)&&(i=t),this.timer=window.setTimeout(this.handleTimeout,i)}stopTimer(){this.timer!=null&&(clearTimeout(this.timer),this.timer=null)}show(){var{isShown:e}=this.state;if(this.stopTimer(),!e){var t;(t=this.popper.current)===null||t===void 0||t.show(),this.setState({isShown:!0});var{interactive:i}=this.props;i&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)===null||e===void 0||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});var{onExited:e}=this.props;e()}stopShowingTooltip(){var{isShown:e}=this.state;this.stopTimer(),e&&this.hide()}render(){var{interactive:e,children:t,referenceObject:i,popperClassName:r,"data-testid":o,onEntered:s}=this.props,{isShown:a}=this.state,{options:l}=this.props;return l=ql({placement:"bottom"},l),d.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":o,children:d.jsx(Pn,{className:$(r,"popper-tooltip"),options:l,ref:this.popper,onEntered:s,onExited:this.handleExited,interactive:e,referenceObject:i,children:d.jsxs("div",{className:"tooltip-content",children:[" ",a&&t]})})})}}Ze(ne,"defaultTimeout",500);Ze(ne,"defaultReshowTimeout",100);Ze(ne,"triggerReshowThreshold",300);Ze(ne,"shownTooltipCount",0);Ze(ne,"lastHiddenTime",Date.now());Ze(ne,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:ne.defaultReshowTimeout,timeout:ne.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});var Ql=L.module("ThemeProvider"),is=c.createContext(null);function Vv(n){var{themes:e,defaultPreloadValues:t=ya,children:i}=n,r=c.useMemo(()=>Ca(),[]),[o,s]=c.useState(null),[a,l]=c.useState(()=>{var m,p;return(m=(p=Sa())===null||p===void 0?void 0:p.themeKey)!==null&&m!==void 0?m:wa}),u=c.useMemo(()=>e==null?null:_a(a,{base:r,custom:e??[]}),[r,a,e]),h=c.useMemo(()=>[...r,...e??[]],[r,e]);return c.useEffect(function(){if(!(u==null||e==null)){Ea(t);var p=Pa(t);Ql.debug2("updateThemePreloadData:",{active:u.map(v=>v.themeKey),custom:e.map(v=>v.themeKey),preloadStyleContent:p,selectedThemeKey:a}),Ta({themeKey:a,preloadStyleContent:p})}},[u,a,e,t]),c.useEffect(()=>{s({activeThemes:u,selectedThemeKey:a,themes:h,setSelectedThemeKey:l})},[u,a,h]),d.jsxs(d.Fragment,{children:[u==null?null:d.jsx(d.Fragment,{children:u.map(m=>d.jsx("style",{"data-theme-key":m.themeKey,children:m.styleContent},m.themeKey))}),o==null?null:d.jsx(is.Provider,{value:o,children:d.jsx(Ro,{children:i})})]})}function rs(){return En(is,"No ThemeContext value found. Component must be wrapped in a ThemeContext.Provider")}function ri(n){var{children:e,className:t,style:i,"data-testid":r}=n;return d.jsx("div",{className:$("btn-group",t),style:i,role:"group","data-testid":r,children:e})}ri.displayName="SplitButtonGroup";ri.propTypes={children:b.node.isRequired,className:b.string,style:b.object,"data-testid":b.string};ri.defaultProps={className:null,style:{},"data-testid":void 0};var Jl=["kind","variant","type","tooltip","icon","disabled","active","onClick","onContextMenu","onMouseDown","onMouseUp","onMouseEnter","onMouseLeave","onKeyDown","className","style","children","tabIndex","data-testid","aria-label"];function hr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function cr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?hr(Object(t),!0).forEach(function(i){ed(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):hr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function ed(n,e,t){return(e=td(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function td(n){var e=nd(n,"string");return typeof e=="symbol"?e:e+""}function nd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function id(n,e){if(n==null)return{};var t,i,r=rd(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(i=0;i<o.length;i++)t=o[i],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(r[t]=n[t])}return r}function rd(n,e){if(n==null)return{};var t={};for(var i in n)if({}.hasOwnProperty.call(n,i)){if(e.indexOf(i)!==-1)continue;t[i]=n[i]}return t}var od=["primary","secondary","tertiary","success","danger","inline","ghost"],sd=["group-end"];function ad(n,e){switch(n){case"primary":return"btn-primary";case"secondary":return"btn-outline-primary";case"tertiary":return"btn-secondary";case"success":return"btn-success";case"danger":return"btn-danger";case"inline":return"btn-inline";case"ghost":return $("btn-link",{"btn-link-icon":e,"btn-link-icon-only":e})}}function ld(n){switch(n){case"group-end":return $("pl-2","pr-3")}}var X=I.forwardRef((n,e)=>{var{kind:t,variant:i,type:r,tooltip:o,icon:s,disabled:a=!1,active:l,onClick:u,onContextMenu:h,onMouseDown:m,onMouseUp:p,onMouseEnter:v,onMouseLeave:g,onKeyDown:f,className:y,style:_,children:S,tabIndex:C,"data-testid":M,"aria-label":K}=n,Y=id(n,Jl),{UNSAFE_className:x}=nl({},"button"),z;i&&(z=ld(i));var N;s&&(N=I.isValidElement(s)?s:d.jsx(re,{icon:s}));var Q=N!=null&&S==null,te=ad(t,Q),j;o!==void 0&&(j=typeof o=="string"?d.jsx(ne,{children:o}):o);var V=K;K===void 0&&Q&&o!=null&&typeof o=="string"&&(V=o);var R=d.jsxs("button",cr(cr({"data-testid":M,ref:e,type:r,className:$("btn",te,z,{active:l},y,x),onClick:u,onContextMenu:h,onMouseUp:p,onMouseDown:m,onMouseEnter:v,onMouseLeave:g,onKeyDown:f,style:_,disabled:a,tabIndex:C,"aria-label":V},Y),{},{children:[s&&N,S,o!=null&&!a&&j]}));return a&&o!=null?d.jsxs("span",{className:"btn-disabled-wrapper",children:[R,j]}):R});X.displayName="Button";X.propTypes={kind:b.oneOf(od).isRequired,variant:b.oneOf(sd),type:b.oneOf(["submit","reset","button"]),tooltip(n){var{tooltip:e,icon:t,children:i}=n;return e===void 0&&t!=null&&i==null?new Error("Tooltip is required for icon only buttons"):null},icon(n){var{children:e,icon:t}=n;return t==null&&e==null?new Error("Icon is required if no children are provided"):e==null&&!I.isValidElement(t)&&(t==null||t.iconName===""||t.iconName==null)?new Error("Icon must be react element or fontawesome IconDefinition"):null},disabled:b.bool,active:b.bool,onClick(n){var{onClick:e,type:t}=n;return t==="button"&&typeof e!="function"?new Error("type button requires an onClick function"):e!==void 0&&typeof e!="function"?new Error("onClick must be a function"):null},onContextMenu:b.func,onMouseUp:b.func,onMouseDown:b.func,onMouseEnter:b.func,onMouseLeave:b.func,onKeyDown:b.func,tabIndex:b.number,children:b.node,className:b.string,style:b.object,"data-testid":b.string};X.defaultProps={type:"button",onClick:void 0,onContextMenu:void 0,onMouseUp:void 0,onMouseDown:void 0,onMouseEnter:void 0,onMouseLeave:void 0,onKeyDown:void 0,variant:void 0,tooltip:void 0,icon:void 0,disabled:!1,active:void 0,tabIndex:void 0,children:void 0,className:void 0,style:{},"data-testid":void 0};function os(n){var{className:e,children:t,"data-testid":i}=n;return d.jsx("div",{className:$("modal-footer",e),"data-testid":i,children:t})}function yn(n){var{isOpen:e,headerText:t,bodyText:i,onCancel:r,onConfirm:o,onDiscard:s,onModalDisable:a,cancelButtonText:l="Cancel",confirmButtonText:u="Okay",discardButtonText:h="Discard",isConfirmDanger:m=!1,children:p,"data-testid":v}=n,g=c.useRef(null),f=c.useRef(null),y=c.useCallback(()=>{f.current!==null&&f.current.checked&&a&&a(),o()},[o,a]),_=c.useCallback(()=>{var C;(C=g.current)===null||C===void 0||C.focus()},[]),S="";return e&&(S=typeof i=="function"?i():i),d.jsxs(Fo,{isOpen:e,onOpened:_,children:[d.jsx(Ho,{closeButton:!1,children:t}),d.jsx($o,{children:S}),d.jsxs(os,{children:[a&&d.jsxs("div",{className:"custom-control custom-checkbox form-group mr-auto",children:[d.jsx("input",{type:"checkbox",className:"custom-control-input",id:"move-confirmation-checkbox",defaultChecked:!1,ref:f,"data-testid":v!==void 0?"".concat(v,"-checkbox-confirm"):void 0}),d.jsx("label",{className:"custom-control-label",htmlFor:"move-confirmation-checkbox",children:"Don't ask me again"})]}),s&&d.jsx(X,{kind:"secondary",className:"mr-auto","data-dismiss":"modal",onClick:s,"data-testid":v!==void 0?"".concat(v,"-btn-discard"):void 0,children:h}),r&&d.jsx(X,{kind:"secondary","data-dismiss":"modal",onClick:r,"data-testid":v!==void 0?"".concat(v,"-btn-cancel"):void 0,children:l}),d.jsxs(ri,{children:[d.jsx(X,{kind:m?"danger":"primary",onClick:y,ref:g,"data-testid":v!==void 0?"".concat(v,"-btn-confirm"):void 0,children:u}),p]})]})]})}yn.propTypes={isOpen:b.bool.isRequired,headerText:b.string.isRequired,bodyText:b.oneOfType([b.string,b.func]).isRequired,onCancel:b.func,onConfirm:b.func.isRequired,onDiscard:b.func,onModalDisable:b.func,cancelButtonText:b.string,confirmButtonText:b.string,discardButtonText:b.string,children:b.node,"data-testid":b.string};yn.defaultProps={children:void 0,cancelButtonText:"Cancel",confirmButtonText:"Okay",discardButtonText:"Discard",onCancel:void 0,onDiscard:void 0,onModalDisable:void 0,"data-testid":void 0};function dd(n,e,t){return(e=ud(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ud(n){var e=hd(n,"string");return typeof e=="symbol"?e:e+""}function hd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function pi(n){return n.then!==void 0}class he{static disableAllActions(){he.actionsDisabled=!0}static enableAllActions(){he.actionsDisabled=!1}static isContextActionEvent(e){return Array.isArray(e.contextActions)}static compareActions(e,t){if(e.group!==t.group){var i,r;return((i=e.group)!==null&&i!==void 0?i:0)>((r=t.group)!==null&&r!==void 0?r:0)?1:-1}if(e.order!==t.order){var o,s;return((o=e.order)!==null&&o!==void 0?o:0)>((s=t.order)!==null&&s!==void 0?s:0)?1:-1}if(e.title!==t.title){var a,l;return((a=e.title)!==null&&a!==void 0?a:"")>((l=t.title)!==null&&l!==void 0?l:"")?1:-1}return e!==t?e>t?1:-1:0}static sortActions(e){if(e==null||!Array.isArray(e))return[];var t=e.slice();return t.sort(he.compareActions),t}static isMacPlatform(){var{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return he.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){var t=he.getModifierKey();return e[t]}static getMenuItems(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=[],r=e;Array.isArray(r)||(r=[r]);for(var o=0;o<r.length;o+=1){var s=r[o],a=void 0;typeof s=="function"?a=s():a=s,a!=null&&(a instanceof Promise?t&&i.push(a):Array.isArray(a)?i=i.concat(a):i.push(a))}return i=i.filter(l=>l.title!==void 0||l.then!=null||l.menuElement),i}static getNextMenuItem(e,t,i){var r=e;r<0&&t<0&&(r=i.length);for(var o=1;o<i.length+1;o+=1){var s=(r+t*o+i.length)%i.length,a=i[s];if(!(a instanceof Promise)&&a.disabled!==!0)return s}return e}}dd(he,"actionsDisabled",!1);var mr=L.module("GlobalContextAction");class cd extends c.Component{constructor(e){super(e),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}componentDidMount(){document.body.addEventListener("contextmenu",this.handleContextMenu),document.body.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.body.removeEventListener("contextmenu",this.handleContextMenu),document.body.removeEventListener("keydown",this.handleKeyDown)}handleContextMenu(e){var t=e;t.contextActions==null&&(t.contextActions=[]);var{action:i}=this.props;i.title==null&&!i.menuElement||(t.contextActions==null&&(t.contextActions=[]),t.contextActions.push(i),mr.debug("Received context menu event at global action! Menu items are now: ",t.contextActions))}handleKeyDown(e){var{action:t}=this.props;if(!he.actionsDisabled&&t.shortcut!==void 0&&t.shortcut.matchesEvent(e)){var i;mr.debug("Global hotkey matched!",e),(i=t.action)===null||i===void 0||i.call(t,e),e.preventDefault(),e.stopPropagation()}}render(){return null}}class md extends c.Component{render(){for(var{actions:e,"data-testid":t}=this.props,i=[],r=0;r<e.length;r+=1){var o=e[r],{shortcut:s}=o;if(o.title!=null||o.menuElement||s){var a=d.jsx(cd,{action:o,"data-testid":t},"".concat(o.title,".").concat(s==null?void 0:s.id));i.push(a)}}return i}}function ss(n,e,t){return(e=pd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function pd(n){var e=vd(n,"string");return typeof e=="symbol"?e:e+""}function vd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Nn=L.module("ContextActions");class ie extends c.Component{static triggerMenu(e,t,i,r){if(r.length!==0){var o=new MouseEvent("contextmenu",{clientX:t,clientY:i,bubbles:!0,cancelable:!0});o.contextActions=r,e.dispatchEvent(o)}}constructor(e){super(e),ss(this,"container",void 0),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=I.createRef(),this.state={globalActions:[],keyboardActions:[]}}static getDerivedStateFromProps(e){if(e.actions==null||!Array.isArray(e.actions))return{globalActions:[],keyboardActions:[]};var t=e.actions.filter(r=>!pi(r)&&typeof r!="function"&&r.isGlobal),i=e.actions.filter(r=>!pi(r)&&typeof r!="function"&&(r.isGlobal===void 0||!r.isGlobal)&&r.shortcut!=null);return{globalActions:t,keyboardActions:i}}componentDidMount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&(this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.addEventListener("keydown",this.handleKeyDown))}componentWillUnmount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&(this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.removeEventListener("keydown",this.handleKeyDown))}handleContextMenu(e){var{ignoreClassNames:t=[]}=this.props;if(t.length>0)for(var i=e.target,r=function(){var{classList:u}=i,h=t.find(m=>u.contains(m));if(h!==void 0)return Nn.debug2('Contextmenu event ignored based on the target className "'.concat(h,'"')),{v:void 0};i=i.parentElement};i!=null;){var o=r();if(typeof o=="object")return o.v}if(he.isContextActionEvent(e)||(e.contextActions=[]),!!he.isContextActionEvent(e)){var{actions:s}=this.props;if(s!=null){var a=s;Array.isArray(a)&&(a=a.filter(l=>pi(l)||typeof l=="function"||l.isGlobal===void 0||!l.isGlobal)),e.contextActions=e.contextActions.concat(a)}Nn.debug("Received context menu event! Menu items are now: ",e.contextActions)}}handleKeyDown(e){for(var{keyboardActions:t}=this.state,i=0;i<t.length;i+=1){var r=t[i];if(!he.actionsDisabled&&r.shortcut!=null&&r.shortcut.matchesEvent(e)){var o;Nn.debug("Context hotkey matched!",e),(o=r.action)===null||o===void 0||o.call(r,e),e.stopPropagation(),e.preventDefault(),Nn.debug2("Matched hotkey returned false, key event not consumed")}}}render(){var{"data-testid":e}=this.props,{globalActions:t}=this.state;return d.jsx("div",{className:"context-actions-listener",ref:this.container,"data-testid":e,children:d.jsx(md,{actions:t})})}}ss(ie,"groups",{default:void 0,high:100,medium:5e3,low:1e4,global:1e5,edit:100});var Ui=I.forwardRef((n,e)=>{var t,i;function r(x){var{menuItem:z,onMenuItemClick:N}=n;N(z,x)}function o(x){var{menuItem:z,onMenuItemMouseMove:N}=n;N(z,x)}function s(x){var{menuItem:z,onMenuItemContextMenu:N}=n;N(z,x)}function a(x,z,N){if(typeof x.type=="string")return x;var{closeMenu:Q,menuItem:te,isKeyboardSelected:j,isMouseSelected:V,"data-testid":R}=n,D={menuItem:te,closeMenu:Q,isKeyboardSelected:j,isMouseSelected:V,iconElement:z,displayShortcut:N,"data-testid":R};return I.cloneElement(x,{forwardedProps:D})}var{children:l,menuItem:u,isKeyboardSelected:h=!1,isMouseSelected:m=!1,"data-testid":p}=n,v=(t=u.shortcutText)!==null&&t!==void 0?t:(i=u.shortcut)===null||i===void 0?void 0:i.getDisplayText(),g=null;if(u.icon){var f=u.icon;if(I.isValidElement(f))g=f;else{var y;u.iconColor!=null&&(u.disabled===void 0||!u.disabled)&&(y={color:u.iconColor}),g=d.jsx(re,{icon:f,style:y})}}var _=null,S=!!l;u.actions&&(_=d.jsx(re,{icon:Oa}));var C=null;if(u.menuElement)C=d.jsx("div",{className:"custom-menu-item",onMouseMove:o,children:a(u.menuElement,g,v)});else{var M,K=u.disabled,Y=u.iconOutline;C=d.jsx("button",{type:"button",className:$("btn-context-menu",{disabled:K},{active:(S||m)&&(K===void 0||!K)},{"keyboard-active":h&&(K===void 0||!K)}),onClick:r,onMouseMove:o,onContextMenu:s,title:(M=u.description)!==null&&M!==void 0?M:"",children:d.jsxs("div",{className:"btn-context-menu-wrapper",children:[d.jsx("span",{className:$("icon",{outline:Y}),children:g}),d.jsx("span",{className:"title",children:u.title}),v!==void 0&&d.jsx("span",{className:"shortcut",children:v}),_&&d.jsx("span",{className:$("submenu-indicator",{disabled:K}),children:_})]})})}return d.jsxs("div",{className:"context-menu-item",ref:e,"data-testid":p,children:[l,C]})});Ui.displayName="ContextMenuItem";Ui.defaultProps={children:null,isKeyboardSelected:!1,isMouseSelected:!1,"data-testid":void 0};var oi=I.forwardRef((n,e)=>{var{checked:t=!1,children:i,className:r,disabled:o,inputClassName:s,isInvalid:a,labelClassName:l,name:u,onChange:h,"data-testid":m}=n,[p]=c.useState(Pt()),v=ns(e);c.useEffect(function(){v.current&&(v.current.indeterminate=t===null)},[v,t]);var g=c.useCallback(f=>{v.current&&(v.current.indeterminate=t===null),h&&h(f)},[v,t,h]);return d.jsxs("div",{className:$("custom-control custom-checkbox",r),children:[d.jsx("input",{type:"checkbox",ref:v,checked:t??!1,className:$("custom-control-input",s,{"is-invalid":a}),disabled:o,id:p,name:u,onChange:g,"data-testid":m}),d.jsx("label",{className:$("custom-control-label",l),htmlFor:p,children:i})]})});oi.displayName="Checkbox";oi.propTypes={checked:(n,e)=>{var{[e]:t}=n;return t!==null&&typeof t!="boolean"?new Error("Checked must be a boolean or null for indeterminate"):null},children:b.node.isRequired,className:b.string,disabled:b.bool,inputClassName:b.string,isInvalid:b.bool,labelClassName:b.string,name:b.string,onChange:b.func,"data-testid":b.string};oi.defaultProps={checked:!1,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};function pr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function fd(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?pr(Object(t),!0).forEach(function(i){fn(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):pr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function fn(n,e,t){return(e=gd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function gd(n){var e=bd(n,"string");return typeof e=="symbol"?e:e+""}function bd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class as extends c.PureComponent{constructor(e){var t;super(e),fn(this,"container",void 0),fn(this,"oldFocus",void 0),fn(this,"rAF",void 0),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMenuItemClick=this.handleMenuItemClick.bind(this),this.handleMenuItemMouseMove=this.handleMenuItemMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.container=I.createRef(),this.oldFocus=document.activeElement,this.rAF=0;var{options:i}=e,r=(t=i.initialKeyboardIndex)!==null&&t!==void 0?t:-1;this.state={menuItems:[],keyboardIndex:r,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.rAF=window.requestAnimationFrame(()=>{var e;(e=this.container.current)===null||e===void 0||e.focus();var{onMenuOpened:t}=this.props;t(this)})}componentDidUpdate(e){var{actions:t}=this.props;e.actions!==t&&this.initMenu()}componentWillUnmount(){cancelAnimationFrame(this.rAF)}getKeyboardIndex(){var{options:e}=this.props;if(e.separateKeyboardMouse!==void 0&&e.separateKeyboardMouse){var{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){var{options:t}=this.props;t.separateKeyboardMouse!==void 0&&t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){var{mouseIndex:e}=this.state;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){cancelAnimationFrame(this.rAF),this.setState({menuItems:[]});var{actions:e}=this.props,t=he.getMenuItems(e,!1);t.length>0&&this.setState(i=>({menuItems:he.sortActions(i.menuItems.concat(t))}))}handleKeyDown(e){var{menuItems:t}=this.state,i=this.getKeyboardIndex(),r=i;if(e.key==="Enter"||e.key===" "){i!=null&&i>=0&&i<t.length&&this.handleMenuItemClick(t[i],e);return}if(e.key==="Escape")r=null;else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey===!0){var o;r=he.getNextMenuItem((o=r)!==null&&o!==void 0?o:0,-1,t)}else if(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1){var s;r=he.getNextMenuItem((s=r)!==null&&s!==void 0?s:0,1,t)}i!==r&&(r!==null?this.setKeyboardIndex(r):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,{closeMenu:t,onMenuClosed:i}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),i(this)})}handleCloseMenu(){this.closeMenu()}handleMenuItemClick(e,t){t.preventDefault(),t.stopPropagation(),e!=null&&(e.disabled===void 0||!e.disabled)&&e.action!=null&&(e.action(t.nativeEvent),this.closeMenu(!0))}handleMenuItemMouseMove(e){var{menuItems:t}=this.state,i=t.indexOf(e);this.setMouseIndex(i)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{"data-testid":t}=this.props,{keyboardIndex:i,menuItems:r,mouseIndex:o}=this.state,s=0;s<r.length;s+=1){var a=r[s];s>0&&a.group!==r[s-1].group&&e.push(d.jsx("hr",{},"".concat(s,".separator")));var l=d.jsx(Ui,{isKeyboardSelected:i===s,isMouseSelected:o===s,menuItem:a,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},s);e.push(l)}var{menuStyle:u}=this.props;return d.jsx("div",{className:"context-menu-container",style:fd({},u),ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":t,children:e})}}fn(as,"defaultProps",{closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});function vr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function fr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?vr(Object(t),!0).forEach(function(i){Vt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):vr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Vt(n,e,t){return(e=yd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yd(n){var e=Cd(n,"string");return typeof e=="symbol"?e:e+""}function Cd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class gn extends c.PureComponent{constructor(e){super(e),Vt(this,"container",void 0),Vt(this,"parent",void 0),Vt(this,"popper",void 0),Vt(this,"isOpen",void 0),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=I.createRef(),this.parent=null,this.popper=I.createRef(),this.isOpen=!1}componentDidMount(){var{isShown:e}=this.props;if(e===null){var t;(t=this.container.current)!==null&&t!==void 0&&t.parentElement&&(this.parent=this.container.current.parentElement,this.parent.addEventListener("click",this.handleClick))}else e&&this.openMenu()}componentDidUpdate(e){var{isShown:t}=this.props;e.isShown!==t&&(t!==null&&t?window.requestAnimationFrame(()=>{this.openMenu()}):this.closeMenu())}componentWillUnmount(){this.parent&&this.parent.removeEventListener("click",this.handleClick)}closeMenu(){var e;(e=this.popper.current)===null||e===void 0||e.hide()}openMenu(){this.popper.current&&!this.isOpen&&(this.popper.current.show(),this.isOpen=!0)}scheduleUpdate(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleClick(e){e.preventDefault(),e.stopPropagation(),this.openMenu()}handleCloseMenu(){this.closeMenu()}handleExited(){this.isOpen=!1;var{onMenuClosed:e}=this.props;e()}render(){var{actions:e,onMenuOpened:t,popperClassName:i,"data-testid":r}=this.props,{menuStyle:o}=this.props,{options:s,popperOptions:a}=this.props;return a=fr({placement:"bottom"},a),s=fr({separateKeyboardMouse:!0},s),d.jsx("div",{className:"menu-actions-listener",ref:this.container,"data-testid":r,children:d.jsx(Pn,{ref:this.popper,options:a,className:$("menu-popper",i),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:d.jsx(as,{actions:e,closeMenu:this.handleCloseMenu,onMenuOpened:t,options:s,menuStyle:o})})})}}Vt(gn,"defaultProps",{isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0});function bt(n,e,t){return(e=wd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wd(n){var e=Sd(n,"string");return typeof e=="symbol"?e:e+""}function Sd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var gr=L.module("Shortcut"),O;(function(n){n.CTRL="MODIFIER_CTRL",n.CMD="MODIFIER_CMD",n.ALT="MODIFIER_ALT",n.OPTION="MODIFIER_OPTION",n.SHIFT="MODIFIER_SHIFT"})(O||(O={}));var w;(function(n){n.A="A",n.B="B",n.C="C",n.D="D",n.E="E",n.F="F",n.G="G",n.H="H",n.I="I",n.J="J",n.K="K",n.L="L",n.M="M",n.N="N",n.O="O",n.P="P",n.Q="Q",n.R="R",n.S="S",n.T="T",n.U="U",n.V="V",n.W="W",n.X="X",n.Y="Y",n.Z="Z",n.ZERO="0",n.ONE="1",n.TWO="2",n.THREE="3",n.FOUR="4",n.FIVE="5",n.SIX="6",n.SEVEN="7",n.EIGHT="8",n.NINE="9",n.BACKSPACE="Backspace",n.ESCAPE="Escape",n.ENTER="Enter",n.DELETE="Delete",n.SLASH="/",n.QUESTION_MARK="?",n.BACKSLASH="\\",n.PIPE="|",n.MINUS="-",n.UNDERSCORE="_",n.EQUALS="=",n.PLUS="+",n.BACKTICK="`",n.TILDE="~",n.COMMA=",",n.LEFT_CHEVRON="<",n.PERIOD=".",n.RIGHT_CHEVRON=">",n.SEMICOLON=";",n.COLON=":",n.SINGLE_QUOTE="'",n.DOUBLE_QUOTE='"',n.LEFT_BRACKET="[",n.RIGHT_BRACKET="]",n.LEFT_CURLY="{",n.RIGHT_CURLY="}",n.F1="F1",n.F2="F2",n.F3="F3",n.F4="F4",n.F5="F5",n.F6="F6",n.F7="F7",n.F8="F8",n.F9="F9",n.F10="F10",n.F11="F11",n.F12="F12"})(w||(w={}));var _d=new Set([w.ENTER,w.DELETE,w.F1,w.F2,w.F3,w.F4,w.F5,w.F6,w.F7,w.F8,w.F9,w.F10,w.F11,w.F12]);class le extends Zo{static isAllowedKey(e){return Object.values(w).includes(e)}static isValidKeyState(e){var{keyValue:t}=e;if(t===null)return!0;if(!le.isMacPlatform&&e.metaKey||!le.isAllowedKey(t))return!1;var i=!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey;return!i||_d.has(t)}static createKeyState(e){var t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(i=>{switch(i){case O.CTRL:t.ctrlKey=!0;break;case O.ALT:case O.OPTION:t.altKey=!0;break;case O.CMD:t.metaKey=!0;break;case O.SHIFT:t.shiftKey=!0;break}}),t}static getKeyStateFromEvent(e){var{key:t,keyCode:i}=e,r="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?r="":!le.isAllowedKey(t)&&le.isAllowedKey(String.fromCharCode(i))?r=String.fromCharCode(i):r=t,{keyValue:r,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey}}static getWindowsDisplayText(e){var t="";return e.ctrlKey&&(t+="Ctrl+"),e.altKey&&(t+="Alt+"),e.shiftKey&&(t+="Shift+"),e.keyValue===w.ESCAPE?t+="Esc":e.keyValue!==null&&(t+=e.keyValue),t}static getMacDisplayText(e){var t="";switch(e.ctrlKey&&(t+="⌃"),e.altKey&&(t+="⌥"),e.shiftKey&&(t+="⇧"),e.metaKey&&(t+="⌘"),e.keyValue){case w.ENTER:t+="⏎";break;case w.ESCAPE:t+="⎋";break;case w.BACKSPACE:t+="⌫";break;case w.DELETE:t+="⌦";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){var i,r;return((i=e.keyValue)===null||i===void 0?void 0:i.toUpperCase())===((r=t.keyValue)===null||r===void 0?void 0:r.toUpperCase())&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey&&e.shiftKey===t.shiftKey}static getDisplayText(e){return e.keyValue===null?"":le.isMacPlatform?le.getMacDisplayText(e):le.getWindowsDisplayText(e)}constructor(e){var{id:t,shortcut:i,macShortcut:r,isEditable:o=!0,name:s,tooltip:a}=e;super(),bt(this,"id",void 0),bt(this,"name",void 0),bt(this,"tooltip",void 0),bt(this,"isEditable",void 0),bt(this,"defaultKeyState",void 0),bt(this,"keyState",void 0),this.id=t,this.name=s,this.tooltip=a,this.isEditable=o;var l=le.isMacPlatform,u=l?r:i;this.defaultKeyState=le.createKeyState(u),this.keyState=this.defaultKeyState}getDisplayText(){return le.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){le.isValidKeyState(e)?(gr.debug2("Shortcut ".concat(this.id," updated to ").concat(JSON.stringify(e))),this.keyState=e,this.dispatchEvent(new Jo("onUpdate",{detail:this}))):gr.debug2("Shortcut ".concat(this.id," tried to update to invalid keyState ").concat(JSON.stringify(e)))}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return le.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState(le.NULL_KEY_STATE)}isNull(){return le.doKeyStatesMatch(this.keyState,le.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return le.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState(le.getKeyStateFromEvent(e))}}bt(le,"NULL_KEY_STATE",{metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null});bt(le,"isMacPlatform",he.isMacPlatform());function br(n,e,t){return(e=Ed(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ed(n){var e=Pd(n,"string");return typeof e=="symbol"?e:e+""}function Pd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var yr=L.module("ShortcutRegistry");class Td extends Zo{constructor(){super(...arguments),br(this,"shortcutMap",new Map),br(this,"shortcutsByCategory",new Map)}createAndAdd(e){var t=new le(e);return this.add(t)}add(e){var t=this.shortcutMap.get(e.id);if(t)return yr.warn("Skipping attempt to add duplicate shortcut ID to registry: ".concat(e.id)),t;yr.debug2("Adding shortcut to registry: ".concat(e.id)),e.addEventListener("onUpdate",o=>{var{detail:s}=o;return this.dispatchEvent(new Jo("onUpdate",{detail:s}))});var i=e.id.split(".")[0];if(this.shortcutMap.set(e.id,e),this.shortcutsByCategory.has(i)){var r;(r=this.shortcutsByCategory.get(i))===null||r===void 0||r.push(e)}else this.shortcutsByCategory.set(i,[e]);return e}get(e){return this.shortcutMap.get(e)}getConflictingShortcuts(e){return Array.from(this.shortcutMap.values()).filter(t=>!t.isNull()&&t.matchesKeyState(e))}}var ae=Object.freeze(new Td),Gt={COPY:ae.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[O.CTRL,w.C],macShortcut:[O.CMD,w.C],isEditable:!1}),PASTE:ae.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[O.CTRL,w.V],macShortcut:[O.CMD,w.V],isEditable:!1}),SAVE:ae.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[O.CTRL,w.S],macShortcut:[O.CMD,w.S],isEditable:!1}),SELECT_ALL:ae.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[O.CTRL,w.A],macShortcut:[O.CMD,w.A],isEditable:!1}),REOPEN_CLOSED_PANEL:ae.createAndAdd({id:"GLOBAL.REOPEN_CLOSED_PANEL",name:"Re-open Closed Panel",shortcut:[O.ALT,O.SHIFT,w.T],macShortcut:[O.OPTION,O.SHIFT,w.T],isEditable:!0}),LINKER:ae.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[O.CTRL,w.L],macShortcut:[O.CMD,w.L]}),LINKER_CLOSE:ae.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[w.ESCAPE],macShortcut:[w.ESCAPE],isEditable:!1}),COPY_VERSION_INFO:ae.createAndAdd({id:"GLOBAL.COPY_VERSION_INFO",name:"Copy Version Info",shortcut:[O.CTRL,O.ALT,w.I],macShortcut:[O.CMD,O.SHIFT,w.I],isEditable:!0}),NEXT:ae.createAndAdd({id:"GLOBAL.NEXT",name:"Next",shortcut:[w.ENTER],macShortcut:[w.ENTER],isEditable:!1}),PREVIOUS:ae.createAndAdd({id:"GLOBAL.PREVIOUS",name:"Previous",shortcut:[O.SHIFT,w.ENTER],macShortcut:[O.SHIFT,w.ENTER],isEditable:!1})};function Ti(n,e,t){return(e=Od(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Od(n){var e=xd(n,"string");return typeof e=="symbol"?e:e+""}function xd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class si extends c.PureComponent{constructor(e){super(e),Ti(this,"inputField",void 0),Ti(this,"searchChangeSelection",void 0),this.inputField=I.createRef(),this.searchChangeSelection=I.createRef()}componentDidMount(){this.setInputPaddingRight()}componentDidUpdate(){this.setInputPaddingRight()}focus(){var e;(e=this.inputField.current)===null||e===void 0||e.focus()}setInputPaddingRight(){var e=this.inputField.current,t=this.searchChangeSelection.current;if(e&&t){var i=t.getBoundingClientRect().width;e.style.paddingRight="".concat(i,"px")}}render(){var{value:e,placeholder:t,onBlur:i,onChange:r,className:o,disabled:s,matchCount:a,id:l,onKeyDown:u,"data-testid":h,cursor:m}=this.props,p,v=[{action:()=>m==null?void 0:m.next("forward"),shortcut:Gt.NEXT},{action:()=>m==null?void 0:m.next("back"),shortcut:Gt.PREVIOUS}];return m&&a>1?p=d.jsxs(d.Fragment,{children:[d.jsx(X,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{m.next("back")},icon:Uo,tooltip:"Previous match (".concat(Gt.PREVIOUS.getDisplayText(),")")}),d.jsxs("span",{className:"search-change-text",children:[m.index!==void 0&&"".concat(m.index+1," of "),a]}),d.jsx(X,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{m.next("forward")},icon:xa,tooltip:"Next match (".concat(Gt.NEXT.getDisplayText(),")")})]}):p=a>0&&d.jsx("span",{className:"search-match",children:a}),d.jsxs("div",{className:$("search-group",o),children:[d.jsx("input",{type:"search",value:e,onBlur:i,onChange:r,onKeyDown:u,className:"form-control",disabled:s,placeholder:t,ref:this.inputField,id:l,"data-testid":h}),a!=null?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"search-change-selection",ref:this.searchChangeSelection,children:p}),d.jsx(ie,{actions:v})]}):d.jsx("span",{className:"search-icon",children:d.jsx(re,{icon:Ia})})]})}}Ti(si,"defaultProps",{placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0,cursor:void 0});function ls(n,e,t){return(e=Id(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Id(n){var e=Md(n,"string");return typeof e=="symbol"?e:e+""}function Md(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ds extends c.PureComponent{constructor(e){super(e),ls(this,"searchInput",void 0),this.searchInput=I.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=ii(this.sendUpdate.bind(this),e.debounceMs),this.state={value:e.value}}componentDidUpdate(e){var{value:t}=this.props;e.value!==t&&this.setState({value:t})}focus(){var e;(e=this.searchInput.current)===null||e===void 0||e.focus()}handleChange(e){this.setState({value:e.target.value},this.sendUpdate)}sendUpdate(){var{onChange:e}=this.props,{value:t}=this.state;e(t)}render(){var{placeholder:e,className:t,matchCount:i,id:r,"data-testid":o}=this.props,{value:s}=this.state;return d.jsx(si,{value:s,placeholder:e,onChange:this.handleChange,className:t,matchCount:i,ref:this.searchInput,id:r,"data-testid":o})}}ls(ds,"defaultProps",{placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0});function us(n,e,t){return(e=Dd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Dd(n){var e=jd(n,"string");return typeof e=="symbol"?e:e+""}function jd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var kd=L.module("ItemListItem");class ai extends c.Component{static handleKeyDown(){return kd.log("ItemListItem.handleKeyDown false"),!1}constructor(e){super(e),us(this,"itemRef",void 0),this.handleBlur=this.handleBlur.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleClick=this.handleClick.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleDragStart=this.handleDragStart.bind(this),this.handleDrag=this.handleDrag.bind(this),this.handleDragOver=this.handleDragOver.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.handleDrop=this.handleDrop.bind(this),this.handleDoubleClick=this.handleDoubleClick.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.itemRef=I.createRef()}handleBlur(e){var{itemIndex:t,onBlur:i}=this.props;i(t,e)}handleFocus(e){var{itemIndex:t,onFocus:i}=this.props;i(t,e)}handleClick(e){var{itemIndex:t,onClick:i}=this.props;i(t,e)}handleContextMenu(e){var{itemIndex:t,onContextMenu:i}=this.props;i(t,e)}handleDragStart(e){var{itemIndex:t,onDragStart:i}=this.props;i(t,e)}handleDrag(e){var{itemIndex:t,onDrag:i}=this.props;i(t,e)}handleDragOver(e){e.preventDefault();var{itemIndex:t,onDragOver:i}=this.props;i(t,e)}handleDragEnd(e){var{itemIndex:t,onDragEnd:i}=this.props;i(t,e)}handleDrop(e){var{itemIndex:t,onDrop:i}=this.props;i(t,e)}handleDoubleClick(e){var{itemIndex:t,onDoubleClick:i}=this.props;i(t,e)}handleMouseMove(e){var{itemIndex:t,onMouseMove:i}=this.props;i(t,e)}handleMouseDown(e){var{itemIndex:t,onMouseDown:i}=this.props;i(t,e)}handleMouseUp(e){var{itemIndex:t,onMouseUp:i}=this.props;i(t,e)}render(){var{isDraggable:e,isFocused:t,isSelected:i,style:r,children:o,"data-testid":s}=this.props;return d.jsx("div",{className:$("item-list-item",{active:i},{"is-focused":t},{"is-draggable":e}),onKeyDown:ai.handleKeyDown,onContextMenuCapture:this.handleContextMenu,onClick:this.handleClick,onDrag:this.handleDrag,onDragStart:this.handleDragStart,onDragOver:this.handleDragOver,onDragEnd:this.handleDragEnd,onDrop:this.handleDrop,onDoubleClick:this.handleDoubleClick,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseUp:this.handleMouseUp,tabIndex:-1,ref:this.itemRef,role:"listitem",style:r,onFocus:this.handleFocus,onBlur:this.handleBlur,draggable:e,"data-testid":s,children:o})}}us(ai,"defaultProps",{children:null,isDraggable:!1,isFocused:!1,isSelected:!1,itemIndex:0,"data-testid":void 0,onBlur(){},onClick(){},onContextMenu(){},onDragStart(){},onDrag(){},onDragOver(){},onDragEnd(){},onDrop(){},onDoubleClick(){},onFocus(){},onMouseDown(){},onMouseMove(){},onMouseUp(){},style:{}});function Cr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function wr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Cr(Object(t),!0).forEach(function(i){Ke(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Cr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Ke(n,e,t){return(e=Nd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Nd(n){var e=Ad(n,"string");return typeof e=="symbol"?e:e+""}function Ad(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Sr=L.module("ItemList"),_r=5;class Le extends c.PureComponent{static renderItem(e){var t,i,{item:r}=e;return d.jsx("div",{className:"item-list-item-content",children:r!=null&&((t=(i=r.displayValue)!==null&&i!==void 0?i:r.value)!==null&&t!==void 0?t:"".concat(r))})}constructor(e){super(e),Ke(this,"list",void 0),Ke(this,"listContainer",void 0),Ke(this,"getItemSelected",zt((r,o)=>qe.isSelected(o,r),{max:Le.CACHE_SIZE})),Ke(this,"getCachedItem",zt((r,o,s,a,l,u,h,m)=>{var p=u({item:s,itemIndex:r,isFocused:a,isSelected:l,style:h});return d.jsx(ai,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:m,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:a,isSelected:l,itemIndex:r,style:h,children:p},o)},{max:Le.CACHE_SIZE})),Ke(this,"getOuterElement",zt(r=>{var o=I.forwardRef((s,a)=>d.jsx("div",wr({ref:a,tabIndex:-1,onKeyDown:r,role:"presentation"},s)));return o.displayName="ItemListOuterElement",o})),Ke(this,"getInnerElement",zt(()=>{var r=I.forwardRef((o,s)=>d.jsx("div",wr({className:"item-list-inner-element",ref:s},o)));return r.displayName="ItemListInnerElement",r})),Ke(this,"getItemData",zt((r,o,s)=>({items:r,selectedRanges:o,renderItem:s}))),this.handleItemBlur=this.handleItemBlur.bind(this),this.handleItemContextMenu=this.handleItemContextMenu.bind(this),this.handleItemFocus=this.handleItemFocus.bind(this),this.handleItemDoubleClick=this.handleItemDoubleClick.bind(this),this.handleItemMouseDown=this.handleItemMouseDown.bind(this),this.handleItemMouseMove=this.handleItemMouseMove.bind(this),this.handleItemMouseUp=this.handleItemMouseUp.bind(this),this.handleItemsRendered=this.handleItemsRendered.bind(this),this.handleWindowMouseUp=this.handleWindowMouseUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleScroll=this.handleScroll.bind(this),this.handleResize=this.handleResize.bind(this),this.renderInnerElement=this.renderInnerElement.bind(this),this.list=I.createRef(),this.listContainer=I.createRef();var{isStickyBottom:t,selectedRanges:i}=e;this.state={focusIndex:null,mouseDownIndex:null,selectedRanges:i,overscanStartIndex:0,height:null,isDragging:!1,isStuckToBottom:t,scrollOffset:null,mouseX:null,mouseY:null}}componentDidUpdate(e,t){var{selectedRanges:i,itemCount:r}=this.props,{focusIndex:o,isStuckToBottom:s,scrollOffset:a,height:l,selectedRanges:u}=this.state;if(s&&!this.isListAtBottom()&&r>0&&this.scrollToBottom(),(a!==t.scrollOffset||l!==t.height)&&this.sendViewportUpdate(),i!==e.selectedRanges&&i!==u)this.setSelectedRanges(i);else if(u!==t.selectedRanges){var{onSelectionChange:h}=this.props;h(u)}if(o!==t.focusIndex){var{onFocusChange:m}=this.props;m(o)}}componentWillUnmount(){window.removeEventListener("mouseup",this.handleWindowMouseUp)}focus(){var e;(e=this.listContainer.current)===null||e===void 0||e.focus()}restoreScrollPosition(){var{scrollOffset:e}=this.state;if(e!=null){var t;(t=this.listContainer.current)===null||t===void 0||t.scrollTo(0,e)}}getElement(e){if(this.listContainer.current==null)return null;var{focusSelector:t}=this.props,{overscanStartIndex:i}=this.state,r=this.listContainer.current.querySelectorAll(t),o=e-i;return r[o]}focusItem(e){var{disableSelect:t}=this.props;if(!t){this.setState({focusIndex:e});var i=this.getElement(e);i instanceof HTMLElement&&i.focus()}}scrollToItem(e){var t=this.getElement(e);t!=null&&t.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){this.setState({focusIndex:e});var{selectedRanges:i}=this.state,r=qe.isSelected(i,e),o=r||he.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,o,!1)}handleItemDoubleClick(e,t){var{isDoubleClickSelect:i,onSelect:r}=this.props;i&&this.setState(o=>{var{selectedRanges:s}=o;return{selectedRanges:qe.selectRange(s,[e,e])}},()=>{r(e,t)})}handleItemMouseDown(e,t){var{selectedRanges:i}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(t.button===2&&i.length===0){this.focusItem(e),this.selectItem(e);return}t.button!=null&&t.button!==0||(this.setState({mouseDownIndex:e,mouseX:t.clientX,mouseY:t.clientY}),window.addEventListener("mouseup",this.handleWindowMouseUp))}}handleItemBlur(e,t){Sr.debug2("item blur",e,t.currentTarget,t.relatedTarget),(!t.relatedTarget||this.listContainer.current&&t.relatedTarget instanceof HTMLElement&&!this.listContainer.current.contains(t.relatedTarget))&&this.setState({focusIndex:null})}handleItemFocus(e,t){Sr.debug2("item focus",e,t.target),this.setState(i=>{var{focusIndex:r}=i;return r!==e?{focusIndex:e}:null})}handleItemMouseMove(e,t){var{isDragSelect:i,isMultiSelect:r,disableSelect:o}=this.props,{mouseDownIndex:s,selectedRanges:a,mouseX:l,mouseY:u}=this.state;if(!(s==null||o)){var h=Math.abs(t.clientX-(l??0)),m=Math.abs(t.clientY-(u??0));h>_r&&m>_r&&this.setState({isDragging:!0}),(i||s===e)&&(this.focusItem(e),r?(!i&&!this.getItemSelected(e,a)&&!he.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(s,e),Math.max(s,e)])):this.toggleSelect(e,t.shiftKey,he.isModifierKeyDown(t),!1))}}handleItemMouseUp(e,t){var{isDeselectOnClick:i,isDoubleClickSelect:r,onSelect:o}=this.props,{mouseDownIndex:s,isDragging:a}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(s===e&&!a){var l=t.shiftKey,u=he.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,l,u,i),!r&&!l&&!u&&o(e,t)}this.resetMouseState()}}handleItemsRendered(e){var{overscanStartIndex:t}=e;this.setState({overscanStartIndex:t})}handleResize(e){var{height:t}=e;this.setState({height:t})}handleMouseLeave(){this.setState({mouseDownIndex:null})}handleWindowMouseUp(){this.resetMouseState(),window.removeEventListener("mouseup",this.handleWindowMouseUp)}handleKeyDown(e){var{isMultiSelect:t,itemCount:i,onSelect:r}=this.props,{focusIndex:o}=this.state,s=o;if(e.key==="Enter"||e.key===" "){!t&&s!=null&&this.setState({selectedRanges:[[s,s]]},()=>{s!=null&&r(s,e)});return}if(e.key==="ArrowUp")s!=null&&s>=0?s=Math.max(0,s-1):s=i-1;else if(e.key==="ArrowDown")s!=null&&s>=0?s=Math.min(s+1,i-1):s=0;else return;if(o!==s){e.stopPropagation(),e.preventDefault(),this.focusItem(s);var{selectedRanges:a}=this.state;if(e.shiftKey&&a.length>0){var l=a[a.length-1];this.selectRange([Math.min(s,l[0]),Math.max(s,l[1])])}else if(this.deselectAll(),s!==null)this.selectItem(s);else{var u;(u=this.listContainer.current)===null||u===void 0||u.focus()}this.scrollIntoView(s)}}handleScroll(e){var{scrollUpdateWasRequested:t,scrollOffset:i}=e;this.setState(r=>{if(t)return{scrollOffset:i};var{isStickyBottom:o}=this.props,{height:s}=r,a=o&&this.isListAtBottom({scrollOffset:i,height:s});return{isStuckToBottom:a,scrollOffset:i}})}resetMouseState(){this.setState({mouseDownIndex:null,isDragging:!1})}scrollToBottom(){var{itemCount:e}=this.props;this.list.current&&this.list.current.scrollToItem(e)}scrollIntoView(e){this.list.current&&this.list.current.scrollToItem(e)}toggleSelect(e,t,i){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,{isMultiSelect:o}=this.props,{selectedRanges:s}=this.state;if(o&&t&&s.length>0){var a=s[s.length-1];this.selectRange([Math.min(a[0],e),Math.max(e,a[1])])}else o&&s.length===1&&s[0][0]===e&&s[0][1]===e?r&&this.deselectItem(e):o&&i?this.getItemSelected(e,s)?r&&this.deselectItem(e):this.selectItem(e):(this.deselectAll(),this.selectItem(e))}deselectAll(){var{itemCount:e}=this.props;this.deselectRange([0,e])}deselectItem(e){this.deselectRange([e,e])}deselectRange(e){qe.validateRange(e),this.setState(t=>{var{selectedRanges:i}=t;return{selectedRanges:qe.deselectRange(i,e)}})}selectItem(e){var{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){qe.validateRange(e),this.setState(t=>{var{selectedRanges:i}=t;return{selectedRanges:qe.selectRange(i,e)}})}setSelectedRanges(e){this.setState({selectedRanges:e})}sendViewportUpdate(){var{scrollOffset:e,height:t}=this.state;if(e!=null&&t!=null){var{onViewportChange:i,rowHeight:r}=this.props,o=Math.floor(e/r),s=o+Math.ceil(t/r);i(o,s)}}isListAtBottom(){var{scrollOffset:e,height:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.state;if(t==null||e==null)return!1;var{itemCount:i,rowHeight:r}=this.props;return e+t>=i*r}renderInnerElement(e){var{index:t,style:i}=e,{items:r,offset:o,renderItem:s,disableSelect:a}=this.props,{focusIndex:l,selectedRanges:u}=this.state;if(t<o||t>=o+r.length)return null;var h=r[t-o];return this.getCachedItem(t,t,h,t===l&&!a,this.getItemSelected(t,u),s,i,a)}render(){var{items:e,itemCount:t,overscanCount:i,renderItem:r,rowHeight:o,"data-testid":s}=this.props,{selectedRanges:a,isStuckToBottom:l}=this.state;return d.jsx(il,{className:"item-list-auto-sizer",onResize:this.handleResize,children:u=>{var{width:h,height:m}=u;return d.jsx(rl,{className:"item-list-scroll-pane",height:m,width:h,initialScrollOffset:l?t*o:0,itemCount:t,itemSize:o,itemData:this.getItemData(e,a,r),onScroll:this.handleScroll,onItemsRendered:this.handleItemsRendered,ref:this.list,outerElementType:this.getOuterElement(this.handleKeyDown),outerRef:this.listContainer,innerElementType:this.getInnerElement(),overscanCount:i,"data-testid":s,children:this.renderInnerElement})}})}}Ke(Le,"CACHE_SIZE",1e3);Ke(Le,"DEFAULT_ROW_HEIGHT",20);Ke(Le,"DEFAULT_OVERSCAN",10);Ke(Le,"defaultProps",{offset:0,items:[],rowHeight:Le.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:Le.DEFAULT_OVERSCAN,renderItem:Le.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0});var Ld=L.module("ErrorBoundary");class Rd extends c.Component{static getDerivedStateFromError(e){return{error:e}}constructor(e){super(e),this.state={error:void 0}}componentDidCatch(e,t){var{onError:i}=this.props;Ld.error("Error caught by ErrorBoundary",e,t),i==null||i(e,t)}render(){var{children:e,className:t,fallback:i}=this.props,{error:r}=this.state;return r!=null?i??d.jsx("div",{className:t,children:d.jsx(wn,{errorMessage:"".concat(r),isLoading:!1,isLoaded:!1})}):e}}function Fd(n){var{on:e,id:t,className:i,isInvalid:r,disabled:o=!1,onClick:s,"data-testid":a}=n;return d.jsx("button",{type:"button",className:$("btn","btn-switch",i,{active:e},{"is-invalid":r}),id:t,onClick:s,disabled:o,"data-testid":a,children:d.jsx("div",{className:"handle"})})}var Hd=["children","className","isInvalid","onChange","data-testid"];function Er(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Pr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Er(Object(t),!0).forEach(function(i){$d(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Er(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function $d(n,e,t){return(e=Ud(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ud(n){var e=Bd(n,"string");return typeof e=="symbol"?e:e+""}function Bd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Kd(n,e){if(n==null)return{};var t,i,r=Wd(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(i=0;i<o.length;i++)t=o[i],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(r[t]=n[t])}return r}function Wd(n,e){if(n==null)return{};var t={};for(var i in n)if({}.hasOwnProperty.call(n,i)){if(e.indexOf(i)!==-1)continue;t[i]=n[i]}return t}var hs=I.forwardRef((n,e)=>{var{children:t,className:i,isInvalid:r,onChange:o,"data-testid":s}=n,a=Kd(n,Hd),l=ns(e),u=c.useCallback(h=>{o(h.target.value)},[o]);return d.jsx("select",Pr(Pr({ref:l,className:$("custom-select",i,{"is-invalid":r}),onChange:u,"data-testid":s},a),{},{children:t}))});hs.displayName="Select";function zd(){return En(Ma,"No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?")}function cs(n){return typeof n=="object"&&n!=null&&typeof n.type=="string"&&n.name!=null}function ms(n){return typeof n=="object"&&n!=null&&typeof n.type=="string"&&n.id!=null}function Gv(n){return cs(n)||ms(n)}var Vd=c.createContext(null);function qv(n){if(ms(n))return{id:n.id,type:n.type};if(cs(n)){var e;return{name:(e=n.name)!==null&&e!==void 0?e:"",type:n.type}}throw new Error("Invalid descriptor: ".concat(n))}function Gd(n){var e,t;return{type:(e=n.type)!==null&&e!==void 0?e:"",name:(t=n.title)!==null&&t!==void 0?t:n.name,id:n.id}}function Zv(){return En(Vd,"No ObjectFetcher available in useObjectFetcher. Was code wrapped in ObjectFetcherContext.Provider?")}function Tr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function qd(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Tr(Object(t),!0).forEach(function(i){Zd(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Tr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Zd(n,e,t){return(e=Xd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Xd(n){var e=Yd(n,"string");return typeof e=="symbol"?e:e+""}function Yd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Qd=Object.freeze({}),Jd=new Map,Xv=n=>n.api,Yv=n=>n.user,ps=n=>n.storage,vs=n=>ps(n).commandHistoryStorage,eu=n=>ps(n).fileStorage,tu=n=>n.defaultWorkspaceSettings,fs=n=>{var{workspace:e}=n;return e},gs=ol(n=>{for(var e,t,i=(e=(t=fs(n))===null||t===void 0?void 0:t.data.settings)!==null&&e!==void 0?e:{},r=qd({},tu(n)),o=Object.keys(i),s=0;s<o.length;s+=1){var a=o[s];i[a]!==void 0&&(r[a]=i[a])}return r}),nu=n=>gs(n).timeZone,Qv=n=>{var e;return(e=gs(n).defaultNotebookSettings)!==null&&e!==void 0?e:Qd},Jv=n=>n.activeTool,iu=n=>{var e;return(e=n.plugins)!==null&&e!==void 0?e:Jd},ru="SET_ACTIVE_TOOL",ou="SET_API",ef="SET_COMMAND_HISTORY_STORAGE",tf="SET_FILE_STORAGE",nf="SET_PLUGINS",su="SET_USER",au="SET_WORKSPACE",lu="SET_DEFAULT_WORKSPACE_SETTINGS",rf="SET_WORKSPACE_STORAGE",du="SET_SERVER_CONFIG_VALUES";function Or(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function It(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Or(Object(t),!0).forEach(function(i){uu(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Or(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function uu(n,e,t){return(e=hu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function hu(n){var e=cu(n,"string");return typeof e=="symbol"?e:e+""}function cu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var of=n=>({type:su,payload:n}),sf=n=>({type:ou,payload:n}),bs=n=>({type:au,payload:n}),af=n=>({type:lu,payload:n}),mu=n=>(e,t)=>{e(bs(n));var{storage:i}=t(),{workspaceStorage:r}=i;return r==null?void 0:r.save(n)},pu=n=>(e,t)=>{var{workspace:i}=t(),{data:r}=i??{},o=It(It({},i),{},{data:It(It(It({},r),n),{},{settings:It(It({},r==null?void 0:r.settings),n.settings)})});return e(mu(o))},lf=n=>e=>e(pu({settings:n})),df=n=>({type:ru,payload:n}),uf=n=>({type:du,payload:n});function xr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Ir(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xr(Object(t),!0).forEach(function(i){vu(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):xr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function vu(n,e,t){return(e=fu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function fu(n){var e=gu(n,"string");return typeof e=="symbol"?e:e+""}function gu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function bu(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,r=arguments.length>1?arguments[1]:void 0;switch(r.type){case n:{var{id:o,payload:s}=r;return t&&_i({payload:s},{payload:i[o]})?i:Ir(Ir({},i),{},{[o]:s})}default:return i}}}function Mr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Dr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Mr(Object(t),!0).forEach(function(i){Oi(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Mr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Oi(n,e,t){return(e=yu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yu(n){var e=Cu(n,"string");return typeof e=="symbol"?e:e+""}function Cu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class wu{constructor(){Oi(this,"reducers",{}),Oi(this,"listener",null)}register(e,t){var i;this.reducers=Dr(Dr({},this.reducers),{},{[e]:t}),(i=this.listener)===null||i===void 0||i.call(this,this.reducers)}setListener(e){this.listener=e}}var Su=new wu;function Bi(n,e,t){return(e=_u(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _u(n){var e=Eu(n,"string");return typeof e=="symbol"?e:e+""}function Eu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Re{static isValid(e,t){return!0}static isSameFormat(e,t){throw new Error("isSameFormat not implemented")}static makeFormat(e,t,i){return{label:e,formatString:t,type:i}}format(e,t){return""}}Bi(Re,"TYPE_GLOBAL","type-global");Bi(Re,"TYPE_CONTEXT_PRESET","type-context-preset");Bi(Re,"TYPE_CONTEXT_CUSTOM","type-context-custom");function yt(n,e,t){return(e=Pu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Pu(n){var e=Tu(n,"string");return typeof e=="symbol"?e:e+""}function Tu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var jr=L.module("DateTimeColumnFormatter");class dt extends Re{static isValid(e,t){if(t.formatString==null)return!1;try{return e.i18n.DateTimeFormat.format(t.formatString,new Date),!0}catch{return!1}}static makeFormat(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Re.TYPE_CONTEXT_PRESET;return{label:e,formatString:t,type:i}}static isSameFormat(e,t){return e===t||e!==null&&t!==null&&e.type===t.type&&e.formatString===t.formatString}static makeGlobalFormatStringMap(e,t){var i=t?"'T'":" ",r=e?" z":"";return new Map([["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(i,"HH:mm:ss").concat(r)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(i,"HH:mm:ss.SSS").concat(r)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(i,"HH:mm:ss.SSSSSSSSS").concat(r)]])}static getGlobalFormats(e,t){var i=dt.makeGlobalFormatStringMap(e,t);return[...i.keys()]}static makeFormatStringMap(e,t){var i=t!==void 0&&t?"'T'":" ",r=e!==void 0&&e?" z":"";return new Map([["yyyy-MM-dd","yyyy-MM-dd".concat(r)],["MM-dd-yyyy","MM-dd-yyyy".concat(r)],["HH:mm:ss","HH:mm:ss".concat(r)],["HH:mm:ss.SSS","HH:mm:ss.SSS".concat(r)],["HH:mm:ss.SSSSSSSSS","HH:mm:ss.SSSSSSSSS".concat(r)],["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(i,"HH:mm:ss").concat(r)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(i,"HH:mm:ss.SSS").concat(r)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(i,"HH:mm:ss.SSSSSSSSS").concat(r)]])}static getFormats(e,t){var i=dt.makeFormatStringMap(e,t);return[...i.keys()]}constructor(e){var{timeZone:t="",showTimeZone:i=!0,showTSeparator:r=!1,defaultDateTimeFormatString:o=dt.DEFAULT_DATETIME_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),yt(this,"dh",void 0),yt(this,"dhTimeZone",void 0),yt(this,"defaultDateTimeFormatString",void 0),yt(this,"showTimeZone",void 0),yt(this,"showTSeparator",void 0),yt(this,"formatStringMap",void 0);var s=t||dt.DEFAULT_TIME_ZONE_ID;try{this.dhTimeZone=e.i18n.TimeZone.getTimeZone(s)}catch{jr.error("Unsupported time zone id",s),this.dhTimeZone=e.i18n.TimeZone.getTimeZone(dt.DEFAULT_TIME_ZONE_ID)}this.dh=e,this.defaultDateTimeFormatString=o,this.showTimeZone=i,this.showTSeparator=r,this.formatStringMap=dt.makeFormatStringMap(i,r)}getEffectiveFormatString(e){var t;return(t=this.formatStringMap.get(e))!==null&&t!==void 0?t:e}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultDateTimeFormatString,r=this.getEffectiveFormatString(i);try{return this.dh.i18n.DateTimeFormat.format(r,e,this.dhTimeZone)}catch{jr.error("Invalid format arguments")}return""}}yt(dt,"DEFAULT_DATETIME_FORMAT_STRING","yyyy-MM-dd HH:mm:ss.SSS");yt(dt,"DEFAULT_TIME_ZONE_ID","America/New_York");function Qe(n,e,t){return(e=Ou(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ou(n){var e=xu(n,"string");return typeof e=="symbol"?e:e+""}function xu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Iu=L.module("DecimalColumnFormatter");class ue extends Re{static isValid(e,t){if(t.formatString==null)return!1;try{return e.i18n.NumberFormat.format(t.formatString,0),!0}catch{return!1}}static makeFormat(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Re.TYPE_CONTEXT_PRESET,r=arguments.length>3?arguments[3]:void 0;return{label:e,type:i,formatString:t,multiplier:r}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0;return ue.makeFormat(e,t,Re.TYPE_CONTEXT_PRESET,i)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return ue.makeFormat("Custom Format",e,Re.TYPE_CONTEXT_CUSTOM,t)}static isSameFormat(e,t){return e===t||e!=null&&t!=null&&e.type===t.type&&e.formatString===t.formatString&&e.multiplier===t.multiplier}constructor(e){var{defaultFormatString:t=ue.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Qe(this,"defaultFormatString",void 0),Qe(this,"dh",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,r=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return this.dh.i18n.NumberFormat.format(i,r)}catch{Iu.error("Invalid format arguments")}return""}}Qe(ue,"DEFAULT_FORMAT_STRING","###,##0.0000");Qe(ue,"FORMAT_PERCENT",ue.makePresetFormat("Percent","##0.00%"));Qe(ue,"FORMAT_BASIS_POINTS",ue.makePresetFormat("Basis Points","###,##0 bp",1e4));Qe(ue,"FORMAT_THOUSANDS",ue.makePresetFormat("Thousands","##0.000 k",.001));Qe(ue,"FORMAT_MILLIONS",ue.makePresetFormat("Millions","###,##0.000 mm",1e-6));Qe(ue,"FORMAT_SCIENTIFIC_NOTATION",ue.makePresetFormat("Scientific Notation","0.0000E0"));Qe(ue,"FORMAT_ROUND",ue.makePresetFormat("Round","###,##0"));Qe(ue,"FORMAT_ROUND_TWO_DECIMALS",ue.makePresetFormat("0.00","###,##0.00"));Qe(ue,"FORMAT_ROUND_FOUR_DECIMALS",ue.makePresetFormat("0.0000","###,##0.0000"));function Qt(n,e,t){return(e=Mu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Mu(n){var e=Du(n,"string");return typeof e=="symbol"?e:e+""}function Du(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ju=L.module("IntegerColumnFormatter");class Xe extends Re{static isValid(e,t){if(t.formatString==null)return!1;try{return e.i18n.NumberFormat.format(t.formatString,0),!0}catch{return!1}}static makeFormat(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Re.TYPE_CONTEXT_PRESET,r=arguments.length>3?arguments[3]:void 0;return{label:e,type:i,formatString:t,multiplier:r}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0;return Xe.makeFormat(e,t,Re.TYPE_CONTEXT_PRESET,i)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return Xe.makeFormat("Custom Format",e,Re.TYPE_CONTEXT_CUSTOM,t)}static isSameFormat(e,t){return e===t||e!=null&&t!=null&&e.type===t.type&&e.formatString===t.formatString&&e.multiplier===t.multiplier}constructor(e){var{defaultFormatString:t=Xe.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Qt(this,"dh",void 0),Qt(this,"defaultFormatString",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,r=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return this.dh.i18n.NumberFormat.format(i,r)}catch{ju.error("Invalid format arguments")}return""}}Qt(Xe,"DEFAULT_FORMAT_STRING","###,##0");Qt(Xe,"FORMAT_THOUSANDS",Xe.makePresetFormat("Thousands","##0.000 k",.001));Qt(Xe,"FORMAT_MILLIONS",Xe.makePresetFormat("Millions","###,##0.000 mm",1e-6));Qt(Xe,"FORMAT_SCIENTIFIC_NOTATION",Xe.makePresetFormat("Scientific Notation","0.0000E0"));var ku=c.createContext(null),Tn=Object.freeze({AUTH_PLUGIN:"AuthPlugin",DASHBOARD_PLUGIN:"DashboardPlugin",WIDGET_PLUGIN:"WidgetPlugin",TABLE_PLUGIN:"TablePlugin",THEME_PLUGIN:"ThemePlugin"});function Nu(n){return"DashboardPlugin"in n}function Au(n){return"AuthPlugin"in n}function Lu(n){return"TablePlugin"in n}function hf(n){return Nu(n)||Au(n)||Lu(n)}function Ru(n){return"type"in n&&n.type===Tn.DASHBOARD_PLUGIN}function Ki(n){return"type"in n&&n.type===Tn.WIDGET_PLUGIN}function Fu(n){return"type"in n&&n.type===Tn.TABLE_PLUGIN}function Hu(n){return"type"in n&&n.type===Tn.AUTH_PLUGIN}function ys(n){return"type"in n&&n.type===Tn.THEME_PLUGIN}function cf(n){return Ru(n)||Hu(n)||Fu(n)||ys(n)||Ki(n)}var $u=L.module("@deephaven/plugin.PluginUtils");function kr(n,e){return n==null||!Ki(n)?!1:[n.supportedTypes].flat().some(t=>t===e)}function Uu(n){var e=d.jsx(re,{icon:Bo});if(!Ki(n))return e;var{icon:t}=n;return t==null?e:c.isValidElement(t)?t:d.jsx(re,{icon:t})}function mf(n){var e=[...n.entries()].filter(t=>ys(t[1]));return $u.debug("Getting theme data from plugins",e),e.map(t=>{var[i,r]=t,o=Array.isArray(r.themes)?r.themes:[r.themes];return o.map(s=>{var{name:a,baseTheme:l,styleContent:u}=s;return{baseThemeKey:"default-".concat(l??"dark"),themeKey:Da(i,a),name:a,styleContent:u}})}).flat()}function pf(){return En(ku,"No Plugins available in usePlugins. This can happen when plugins have not finished loading or if code is not wrapped in PluginsContext.Provider.")}const Bu="var(--dh-color-chart-colorway)",Ku="var(--dh-color-chart-grid)",Wu="var(--dh-color-chart-axis-line)",zu="var(--dh-color-chart-axis-line-zero)",Nr={"paper-bgcolor":"var(--dh-color-chart-bg)","plot-bgcolor":"var(--dh-color-chart-plot-bg)","title-color":"var(--dh-color-chart-title)","legend-color":"var(--dh-color-chart-legend-fg)",colorway:Bu,gridcolor:Ku,linecolor:Wu,zerolinecolor:zu,"error-band-line-color":"var(--dh-color-chart-error-band-line)","ohlc-increasing":"var(--dh-color-chart-ohlc-increase)","ohlc-decreasing":"var(--dh-color-chart-ohlc-decrease)","coastline-color":"var(--dh-color-chart-geo-coastline)","land-color":"var(--dh-color-chart-geo-land)","ocean-color":"var(--dh-color-chart-geo-ocean)","lake-color":"var(--dh-color-chart-geo-lake)","river-color":"var(--dh-color-chart-geo-river)","indicator-increasing":"var(--dh-color-chart-indicator-increase)","indicator-decreasing":"var(--dh-color-chart-indicator-decrease)","indicator-gauge":"var(--dh-color-chart-indicator-gauge)"};var Ar=L.module("ChartTheme");function Vu(){var n,e=Ko(Nr);return e.colorway=ja((n=e.colorway)!==null&&n!==void 0?n:"").map(t=>{var[i,r]=t;return ka.normalizeCssColor(e.colorway.substring(i,r+1))}).join(" "),Ar.debug2("Chart theme:",Nr),Ar.debug2("Chart theme derived:",e),Object.freeze({paper_bgcolor:e["paper-bgcolor"],plot_bgcolor:e["plot-bgcolor"],title_color:e["title-color"],legend_color:e["legend-color"],colorway:e.colorway,gridcolor:e.gridcolor,linecolor:e.linecolor,zerolinecolor:e.zerolinecolor,error_band_line_color:e["error-band-line-color"],ohlc_increasing:e["ohlc-increasing"],ohlc_decreasing:e["ohlc-decreasing"],coastline_color:e["coastline-color"],land_color:e["land-color"],ocean_color:e["ocean-color"],lake_color:e["lake-color"],river_color:e["river-color"],indicator_increasing:e["indicator-increasing"],indicator_decreasing:e["indicator-decreasing"],indicator_gauge:e["indicator-gauge"]})}function Lr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Gu(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Lr(Object(t),!0).forEach(function(i){qu(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Lr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function qu(n,e,t){return(e=Zu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Zu(n){var e=Xu(n,"string");return typeof e=="symbol"?e:e+""}function Xu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Yu=c.lazy(()=>sl(()=>import("./Plot-9MEtok1o.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url));function Qu(n){return d.jsx(c.Suspense,{fallback:d.jsx(wn,{}),children:d.jsx(Yu,Gu({},n))})}var Cs=c.createContext(null);function vf(n){var{children:e}=n,{activeThemes:t}=rs(),i=c.useMemo(Vu,[t]);return d.jsx(Cs.Provider,{value:i,children:e})}function Ju(){return En(Cs,"No ChartThemeContext value found.")}function eh(n){var{type:e}=n,t=zd();switch(e){case t.VariableType.TABLE:case t.VariableType.TABLEMAP:case t.VariableType.TREETABLE:case t.VariableType.HIERARCHICALTABLE:case t.VariableType.PARTITIONEDTABLE:return d.jsx(re,{icon:zo});case t.VariableType.FIGURE:return d.jsx(re,{icon:Wo});case t.VariableType.PANDAS:return d.jsx(re,{icon:Na});default:return d.jsx(re,{icon:Bo})}}function Rr(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(u){return void t(u)}a.done?e(l):Promise.resolve(l).then(i,r)}function th(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){Rr(o,i,r,s,a,"next",l)}function a(l){Rr(o,i,r,s,a,"throw",l)}s(void 0)})}}function ws(n){var{children:e,language:t}=n,[i,r]=c.useState(null),{activeThemes:o}=rs();return c.useEffect(()=>{var s=!1;function a(){return l.apply(this,arguments)}function l(){return l=th(function*(){if(e!=null&&o!=null){var u=yield lt.colorize(e.toString(),t,{});s||r(u)}}),l.apply(this,arguments)}return a(),()=>{s=!0}},[o,e,t]),d.jsx("div",{style:{pointerEvents:"none"},dangerouslySetInnerHTML:i!=null?{__html:i}:void 0})}class Ss{static get LANGUAGE_MAP(){return new Map([["python","Python"],["groovy","Groovy"],["scala","Scala"]])}}class Jt{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)?[]:al.parse(e).filter(t=>!this.hasComment(t)).map(t=>this.hasPattern(t)?t.pattern:this.hasOp(t)?t.op:"".concat(t))}static formatTimestamp(e){if(e==null||!(e instanceof Date))return null;var t="".concat(e.getHours()).padStart(2,"0"),i="".concat(e.getMinutes()).padStart(2,"0"),r="".concat(e.getSeconds()).padStart(2,"0"),o="".concat(e.getMilliseconds()).padStart(3,"0");return"".concat(t,":").concat(i,":").concat(r,".").concat(o)}static isTableType(e,t){return t===e.VariableType.TABLE||t===e.VariableType.TREETABLE||t===e.VariableType.HIERARCHICALTABLE||t===e.VariableType.PARTITIONEDTABLE}static isWidgetType(e,t){return t===e.VariableType.FIGURE||t===e.VariableType.OTHERWIDGET||t===e.VariableType.PANDAS}static isOpenableType(e,t){return Jt.isTableType(e,t)||Jt.isWidgetType(e,t)}static isFigureType(e,t){return t===e.VariableType.FIGURE}static isPandas(e,t){return t===e.VariableType.PANDAS}}function _s(n){var{children:e}=n;return d.jsxs("div",{className:"console-history-item-result",children:[d.jsx("div",{className:"console-history-gutter",children:"-"}),d.jsx("div",{className:"console-history-content",children:e})]})}_s.propTypes={children:b.node.isRequired};function xi(n,e,t){return(e=nh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nh(n){var e=ih(n,"string");return typeof e=="symbol"?e:e+""}function ih(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Es extends c.Component{constructor(e){super(e),xi(this,"timer",void 0),xi(this,"startTime",void 0),this.updateElapsed=this.updateElapsed.bind(this),this.startTime=Date.now(),this.state={elapsed:0}}componentDidMount(){this.timer=window.setInterval(this.updateElapsed,1e3)}componentWillUnmount(){this.timer!=null&&clearInterval(this.timer),this.timer=void 0}updateElapsed(){this.setState({elapsed:Math.round((Date.now()-this.startTime)/1e3)})}render(){var{disabled:e,onCancelClick:t}=this.props,{elapsed:i}=this.state;return d.jsx("div",{className:$("console-history-result-in-progress",{disabled:e}),children:d.jsxs("span",{className:"badge",children:[d.jsx(Vo,{className:"ml-2"}),"Running... ",on.formatElapsedTime(i)," ",d.jsx(X,{className:"console-history-result-in-progress-cancel",kind:"ghost",icon:Aa,tooltip:"Cancel",onClick:t,disabled:e})]})})}}xi(Es,"defaultProps",{disabled:!1});function bn(n,e,t){return(e=rh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rh(n){var e=oh(n,"string");return typeof e=="symbol"?e:e+""}function oh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class en extends c.PureComponent{constructor(e){super(e),bn(this,"mouseX",void 0),bn(this,"mouseY",void 0),bn(this,"isClicking",void 0),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(e){switch(e.key){case"Enter":case" ":this.handleToggleError(),e.stopPropagation(),e.preventDefault();break}}handleMouseDown(e){this.mouseX=e.clientX,this.mouseY=e.clientY,this.isClicking=!0}handleMouseMove(e){this.mouseX!=null&&this.mouseY!=null?(Math.abs(e.clientX-this.mouseX)>=en.mouseDragThreshold||Math.abs(e.clientY-this.mouseY)>=en.mouseDragThreshold)&&(this.isClicking=!1):this.isClicking&&(this.isClicking=!1)}handleMouseUp(e){this.isClicking&&!e.shiftKey&&!e.metaKey&&!e.altKey&&this.handleToggleError(),this.mouseX=null,this.mouseY=null,this.isClicking=!1}handleToggleError(){this.setState(e=>({isExpanded:!e.isExpanded}))}handleMouseEnter(){this.setState({isTriggerHovered:!0})}handleMouseLeave(){this.setState({isTriggerHovered:!1})}render(){var{isExpanded:e,isTriggerHovered:t}=this.state,{message:i}=this.props;H(i);var r=i.trimEnd(),o=r.indexOf(`
|
|
2
|
+
import{a as L,an as Ro,T as ba,p as ya,B as Ca,D as wa,G as Sa,A as _a,H as Ea,w as Pa,O as Ta,M as Fo,s as Ho,b as $o,k as Oa,ao as Uo,ap as xa,aq as Ia,L as wn,U as Ma,F as Da,ar as Bo,r as Ko,E as ja,as as ka,am as Na,ai as Wo,aj as zo,q as Vo,h as Aa,l as H,ak as hn,at as La,au as Ji,av as Ra,aw as Fa,ax as Ha,ay as $a,v as Ua,e as Go,af as Ba,c as mi,aa as Ka,az as Wa,aA as er,ad as za,aB as tr,aC as qo,aD as Va,a4 as Ga,aE as qa,aF as Za,aG as Xa,aH as Ya,aI as Qa,aJ as Ja}from"./index-CmctFa0c.js";import{r as c,bg as Hi,J as I,bx as el,E as d,G as tl,H as $,R as $i,ad as b,bh as nl,I as re,D as Pt,bt as Zo,ac as ii,ab as zt,by as il,bz as rl,bA as ol,bv as _i,_ as sl,bo as lt,bB as al,br as ht,bp as Be,bq as Nt,bC as nr,bs as ll,bD as dl,bu as Tt,bE as pn,bF as T,bG as ir,bH as ul,L as Xo,K as Yo,bI as hl,bw as Sn}from"./vendor-DrtWDXhi.js";var Fv=Object.freeze([]),Hv=new Map,$v=()=>{};function Uv(n){return Array.isArray(n)?n:[n]}function Bv(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return e.filter(i=>i!=null)}function cl(n,e,t){return(e=ml(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ml(n){var e=pl(n,"string");return typeof e=="symbol"?e:e+""}function pl(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ei extends Error{constructor(){super(...arguments),cl(this,"isCanceled",!0)}}function rr(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(u){return void t(u)}a.done?e(l):Promise.resolve(l).then(i,r)}function vl(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){rr(o,i,r,s,a,"next",l)}function a(l){rr(o,i,r,s,a,"throw",l)}s(void 0)})}}function fl(n){return Pi.apply(this,arguments)}function Pi(){return Pi=vl(function*(n){var{clipboard:e}=navigator;if(e!==void 0)try{return navigator.clipboard.writeText(n)}catch{return or(n)}or(n)}),Pi.apply(this,arguments)}function or(n){var e=document.activeElement,t=document.createElement("textarea");t.value=n,document.body.appendChild(t),t.focus(),t.select();var i=document.execCommand("copy");if(document.body.removeChild(t),e instanceof HTMLElement&&e.focus(),!i)throw new Error("Unable to execute copy command")}function Ft(n,e,t){return(e=gl(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function gl(n){var e=bl(n,"string");return typeof e=="symbol"?e:e+""}function bl(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var yl="table_",Qo="column_",Cl=new Set(["in","not","i","ii","k"]),wl=new Set(["abstract","continue","for","new","switch","assert","default","if","package","synchronized","boolean","do","goto","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","null","true","false"]),Sl=/[^a-zA-Z0-9_$\-+@]/g,_l=/[^A-Za-z0-9_$]/g,El=/^[a-zA-Z_$][a-zA-Z0-9_$\-+@]*$/,Pl=/[^a-zA-Z0-9_]/g;function Tl(n){return n.replace(/[ -]/g,"_")}function Ol(n){return n.replace(/\s/g,"_")}class De{}Ft(De,"legalize",(n,e,t,i,r,o)=>{var s=e(n.trim());return r&&(Cl.has(s)||wl.has(s))&&(s=t+s),s=s.replace(i,""),s?(/^[0-9-]/.test(s)&&(s=t+s),s):t+o});Ft(De,"legalizeTableName",n=>De.legalize(n,Ol,yl,Sl,!1,0));Ft(De,"makeVariableName",n=>De.legalizeTableName(n).replace(Pl,"_"));Ft(De,"legalizeColumnNames",n=>{var e=[];return n.forEach((t,i)=>{var r=De.legalizeColumnName(t,i);e.includes(r)&&(r=Qo+i),e.push(r)}),e});Ft(De,"legalizeColumnName",function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return De.legalize(n,Tl,Qo,_l,!0,e)});Ft(De,"isValidTableName",n=>El.test(n));Ft(De,"isValidColumnName",n=>De.legalizeColumnName(n)===n);class Jo extends CustomEvent{constructor(e,t){super(e,t)}}function xl(n,e,t){return(e=Il(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Il(n){var e=Ml(n,"string");return typeof e=="symbol"?e:e+""}function Ml(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Dl extends Error{constructor(){super(...arguments),xl(this,"isTimeout",!0)}}class Fe{static makeCancelable(e,t){var i=!1,r,o,s=new Promise((a,l)=>{o=l,Promise.resolve(e).then(u=>{i?t&&t(u):(r=u,a(u))}).catch(u=>l(u))});return s.cancel=()=>{i=!0,o(new Ei),r!=null&&t&&t(r)},s}static isCanceled(e){return e instanceof Ei}static isTimedOut(e){return e instanceof Dl}static withTimeout(e,t){return new Promise((i,r)=>{setTimeout(()=>{try{i(t())}catch(o){r(o)}},e)})}}function sr(n,e,t){return(e=jl(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jl(n){var e=kl(n,"string");return typeof e=="symbol"?e:e+""}function kl(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class _n{constructor(){sr(this,"pending",[]),sr(this,"resolved",[])}add(e,t){var i=Fe.makeCancelable(e,t);return this.pending.push(i),i.then(()=>{this.resolve(i)},()=>{this.resolve(i)}),i}remove(e){for(var t=0;t<this.pending.length;t+=1)if(this.pending[t]===e){this.pending.splice(t,1);return}}resolve(e){this.remove(e),this.resolved.push(e)}cancel(){for(var e=[...this.pending,...this.resolved],t=0;t<e.length;t+=1)e[t].cancel();this.pending=[],this.resolved=[]}}function Kv(n){var e=n;n instanceof CustomEvent&&(e=n.detail);var t="";if(e instanceof Error?t=e.message:e!=null&&(t="".concat(e)),t=t.trim(),t.length>0)return t}class qe{static isValidRange(e){return e!=null&&e.length===2&&Number.isInteger(e[0])&&Number.isInteger(e[1])&&e[0]<=e[1]}static validateRange(e){if(!qe.isValidRange(e))throw new Error("Invalid range! ".concat(e))}static isSelected(e,t){for(var i=0;i<e.length;i+=1){var r=e[i],o=r[0],s=r[1];if(o<=t&&t<=s)return!0}return!1}static selectRange(e,t){for(var[i,r]=t,o=[...e],s=o.length-1;s>=0;s-=1){var a=o[s],l=a[0],u=a[1];if(l<=i&&r<=u)return o;i<=u&&l<=r&&(i=Math.min(i,l),r=Math.max(r,u),o.splice(s,1))}return o.push([i,r]),o}static deselectRange(e,t){for(var[i,r]=t,o=[...e],s=o.length-1;s>=0;s-=1){var a=o[s],l=a[0],u=a[1];if(!(r<l||u<i))if(l<i&&r<u){o[s]=[l,i-1],o.splice(s+1,0,[r+1,u]);break}else i<=l&&u<=r?o.splice(s,1):l<i?o[s]=[l,i-1]:o[s]=[r+1,u]}return o}static count(e){return e.reduce((t,i)=>t+(i[1]-i[0]+1),0)}static getItemsInRanges(e,t){return t.reduce((i,r)=>{for(var o=[...i],s=r[0];s<=r[1];s+=1)o.push(e[s]);return o},[])}}function*Wv(n,e){for(var t=n;t<=e;++t)yield t}var zv=" ";class Nl{static join(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"and";if(e==null||e.length===0)return"";if(e.length===1)return e[0];if(e.length===2)return"".concat(e[0]," ").concat(t," ").concat(e[1]);var i=e.slice(0,e.length-1).join(", "),r=e[e.length-1];return"".concat(i,", ").concat(t," ").concat(r)}static toLower(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==null){if(t)return"";throw new Error("Null string passed in to TextUtils.toLower")}return e.toLowerCase()}static sort(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e<t?i?-1:1:e>t?i?1:-1:0}}function es(n,e,t){return(e=Al(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Al(n){var e=Ll(n,"string");return typeof e=="symbol"?e:e+""}function Ll(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class on{static formatElapsedTime(e){if(typeof e!="number"||!Number.isInteger(e))throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=Math.floor(e/3600),i=Math.floor(e%3600/60),r=e%60;return"".concat(t>0?"".concat(t,"h "):"")+"".concat(i>0||t>0?"".concat(i,"m "):"")+"".concat(e>=60?"".concat(r,"s").padStart(3,"0"):"".concat(r,"s"))}static formatTime(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=String(Math.floor(e/(60*60))).padStart(2,"0"),i=e%(60*60),r=String(Math.floor(i/60)).padStart(2,"0"),o=i%60,s=String(Math.ceil(o)).padStart(2,"0");return"".concat(t,":").concat(r,":").concat(s)}static isTimeString(e){return new RegExp(on.TIME_PATTERN).test(e)}static parseTime(e){if(e==null||typeof e!="string")throw new Error("".concat(e," is not a valid string"));var t=e.split(":");if(t.length!==3)throw new Error("".concat(e," is not a time string that can be parsed"));return Number(t[0])*60*60+Number(t[1])*60+Number(t[2])}}es(on,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");es(on,"TIME_ZONES",Object.freeze([{label:"Tokyo UTC+9 No DST",value:"Asia/Tokyo"},{label:"Seoul UTC+9 No DST",value:"Asia/Seoul"},{label:"Hong Kong UTC+8 No DST",value:"Asia/Hong_Kong"},{label:"Singapore UTC+8 No DST",value:"Asia/Singapore"},{label:"Kolkata UTC+5:30 No DST",value:"Asia/Kolkata"},{label:"Berlin UTC+1",value:"Europe/Berlin"},{label:"UTC UTC±0 No DST",value:"UTC"},{label:"London UTC±0",value:"Europe/London"},{label:"Sao Paulo UTC-2",value:"America/Sao_Paulo"},{label:"Newfoundland UTC-3:30",value:"America/St_Johns"},{label:"Halifax UTC-4",value:"America/Halifax"},{label:"New York UTC−5",value:"America/New_York"},{label:"Chicago UTC-6",value:"America/Chicago"},{label:"Denver UTC-7",value:"America/Denver"},{label:"Los Angeles UTC-8",value:"America/Los_Angeles"},{label:"Anchorage UTC-9",value:"America/Anchorage"},{label:"Honolulu UTC-10 No DST",value:"Pacific/Honolulu"},{label:"Zurich UTC+1",value:"Europe/Zurich"},{label:"Amsterdam UTC+1",value:"Europe/Amsterdam"},{label:"Taipei UTC+8 No DST",value:"Asia/Taipei"},{label:"Sydney UTC+10",value:"Australia/Sydney"}]));function Rl(n,e,t){return(e=Fl(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Fl(n){var e=Hl(n,"string");return typeof e=="symbol"?e:e+""}function Hl(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class vn extends Error{constructor(){super(...arguments),Rl(this,"isInvalid",!0)}}function ts(){var n=c.useRef(!1);return c.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function ar(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(u){return void t(u)}a.done?e(l):Promise.resolve(l).then(i,r)}function $l(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){ar(o,i,r,s,a,"next",l)}function a(l){ar(o,i,r,s,a,"throw",l)}s(void 0)})}}var Ul=L.module("useAsyncInterval");function Bl(n,e){var t=ts(),i=c.useRef(0),r=c.useRef(0),o=c.useRef(null),s=c.useCallback($l(function*(){var a=Date.now();r.current+=1;var l=o.current==null?e:a-o.current;o.current=a;try{yield n()}catch(m){Ul.error("A tick error occurred:",m)}if(t.current){l+=Date.now()-o.current;var u=Math.max(0,l-e),h=Math.max(0,e-u);i.current=window.setTimeout(s,h)}}),[n,t,e]);c.useEffect(()=>(o.current=null,s(),()=>{window.clearTimeout(i.current)}),[e,s])}function En(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"No value available in context. Was code wrapped in a provider?",t=c.useContext(n);if(t==null)throw new Error(e);return t}function Kl(n,e,t){var i=c.useRef(t),r=c.useRef(n);r.current=n;var o=c.useMemo(()=>Hi(function(){return r.current(...arguments)},e,i.current),[e]);return c.useEffect(()=>()=>{var s,a;(s=(a=i.current)===null||a===void 0?void 0:a.flushOnUnmount)!==null&&s!==void 0&&s?o.flush():o.cancel()},[o]),o}function Wl(n){var e=c.useRef();return c.useEffect(function(){e.current=n}),e.current}function ns(n){var e=c.useRef(null);return c.useEffect(function(){n&&(typeof n=="function"?n(e.current):n.current=e.current)}),e}function lr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function zl(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?lr(Object(t),!0).forEach(function(i){Xt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):lr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Xt(n,e,t){return(e=Vl(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Vl(n){var e=Gl(n,"string");return typeof e=="symbol"?e:e+""}function Gl(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var dr="popper";class Pn extends c.Component{constructor(e){super(e),Xt(this,"element",void 0),Xt(this,"container",void 0),Xt(this,"rAF",void 0),this.handleEnter=this.handleEnter.bind(this),this.handleExit=this.handleExit.bind(this),this.handleBlur=this.handleBlur.bind(this),this.element=document.createElement("div"),this.element.className="popper-container",this.container=I.createRef(),this.rAF=0;var{isShown:t}=this.props;this.state={show:t,popper:null}}componentDidUpdate(e){var{isShown:t}=this.props;e.isShown!==t&&(t?(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{this.show()})):this.hide())}componentWillUnmount(){this.destroyPopper(!1)}getVisibleElement(e){return e==null||e.clientHeight>0||e.clientWidth>0?e:this.getVisibleElement(e.parentElement)}initPopper(){var{popper:e}=this.state,{closeOnBlur:t,referenceObject:i}=this.props;if(!e&&this.container.current!==null){var{options:r}=this.props;r=zl({placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}}},r),document.body.appendChild(this.element);var o=this.getVisibleElement(this.container.current);o==null&&(o=this.container.current),e=new el(i||o,this.element,r),e.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(t){var s=this.element.querySelector(".".concat(dr));s instanceof HTMLElement&&!s.contains(document.activeElement)&&s.focus()}}),this.setState({popper:e})}}destroyPopper(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;cancelAnimationFrame(this.rAF);var{popper:t}=this.state;t&&(t.destroy(),document.body.contains(this.element)&&document.body.removeChild(this.element),e&&this.setState({popper:null}))}show(){this.initPopper(),this.setState({show:!0})}hide(){this.setState({show:!1})}scheduleUpdate(){var{popper:e}=this.state;e&&e.scheduleUpdate()}handleBlur(e){e.relatedTarget instanceof HTMLElement&&(this.element.contains(e.relatedTarget)||this.hide())}handleEnter(){var{onEntered:e}=this.props;e()}handleExit(){var{onExited:e}=this.props,{show:t}=this.state;t||this.destroyPopper(),e()}renderContent(){var{className:e,children:t,timeout:i,interactive:r,closeOnBlur:o}=this.props,{show:s}=this.state;return d.jsx(Ro,{isPortal:!0,children:d.jsx(tl,{in:s,timeout:i,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,children:d.jsx("div",{onClick:a=>{a.stopPropagation()},onKeyDown:a=>{a.key==="Escape"&&this.hide()},className:$(dr,{interactive:r},e),onBlur:o?this.handleBlur:void 0,tabIndex:o?-1:void 0,role:"presentation",children:d.jsxs("div",{className:"popper-content",children:[t,d.jsx("div",{className:"popper-arrow","x-arrow":""})]})})})})}render(){var{popper:e}=this.state,{"data-testid":t}=this.props;return d.jsx("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":t,children:e&&$i.createPortal(this.renderContent(),this.element)})}}Xt(Pn,"propTypes",{children:b.node.isRequired,options:b.shape({}),className:b.string,timeout:b.number,onEntered:b.func,onExited:b.func,isShown:b.bool,closeOnBlur:b.bool,interactive:b.bool,referenceObject:b.shape({}),"data-testid":b.string});Xt(Pn,"defaultProps",{options:{},className:"",timeout:ba.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0});function ur(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function ql(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ur(Object(t),!0).forEach(function(i){Ze(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ur(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Ze(n,e,t){return(e=Zl(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Zl(n){var e=Xl(n,"string");return typeof e=="symbol"?e:e+""}function Xl(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Yl=L.module("Tooltip");class ne extends c.Component{static handleHidden(){ne.shownTooltipCount-=1,ne.shownTooltipCount===0&&(ne.lastHiddenTime=Date.now())}static handleShown(){ne.shownTooltipCount+=1}constructor(e){super(e),Ze(this,"container",void 0),Ze(this,"popper",void 0),Ze(this,"parent",void 0),Ze(this,"timer",void 0),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowMouseMove=this.handleWindowMouseMove.bind(this),this.handleWheel=this.handleWheel.bind(this),this.handleTimeout=this.handleTimeout.bind(this),this.handleExited=this.handleExited.bind(this),this.stopShowingTooltip=this.stopShowingTooltip.bind(this),this.container=I.createRef(),this.popper=I.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}componentDidMount(){this.startListening();var{timeout:e}=this.props;e===0&&this.show()}componentDidUpdate(e,t){var{isShown:i}=t,{isShown:r}=this.state;r!==i&&(r?ne.handleShown():ne.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();var{isShown:e}=this.state;e&&ne.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){Yl.error("Tooltip doesn't have a container or a parent set!");return}this.parent=this.container.current.parentElement,this.parent.addEventListener("mousemove",this.handleMouseMove),this.parent.addEventListener("mouseleave",this.handleMouseLeave),this.parent.addEventListener("mousedown",this.stopShowingTooltip)}stopListening(){this.parent&&(this.parent.removeEventListener("mousemove",this.handleMouseMove),this.parent.removeEventListener("mouseleave",this.handleMouseLeave),this.parent.removeEventListener("mousedown",this.stopShowingTooltip))}startListeningWindow(){window.addEventListener("mousemove",this.handleWindowMouseMove,!0),window.addEventListener("contextmenu",this.stopShowingTooltip,!0),window.addEventListener("wheel",this.handleWheel)}stopListeningWindow(){window.removeEventListener("mousemove",this.handleWindowMouseMove,!0),window.removeEventListener("contextmenu",this.stopShowingTooltip,!0),window.removeEventListener("wheel",this.handleWheel)}handleMouseMove(){this.startTimer()}handleWheel(){var{isShown:e}=this.state;this.popper.current&&this.parent&&e&&!this.popper.current.element.matches(":hover")&&!this.parent.matches(":hover")&&(this.stopTimer(),this.hide())}handleMouseLeave(){var{isShown:e}=this.state;this.stopTimer();var{interactive:t}=this.props;!t&&e&&this.hide()}handleTimeout(){this.show()}handleWindowMouseMove(e){var t=e.clientX,i=e.clientY,{isShown:r}=this.state;if(!(!this.popper.current||!this.parent)){var o=this.popper.current.element.getBoundingClientRect(),s=this.parent.getBoundingClientRect();t>=o.left&&t<=o.left+o.width&&i>=o.top&&i<=o.top+o.height?this.handleMouseMove():t>=s.left&&t<=s.left+s.width&&i>=s.top&&i<=s.top+s.height?this.handleMouseMove():r&&(this.stopTimer(),this.hide())}}startTimer(){this.stopTimer();var{timeout:e,reshowTimeout:t}=this.props,i=e;(ne.shownTooltipCount>0||Date.now()-ne.lastHiddenTime<ne.triggerReshowThreshold)&&(i=t),this.timer=window.setTimeout(this.handleTimeout,i)}stopTimer(){this.timer!=null&&(clearTimeout(this.timer),this.timer=null)}show(){var{isShown:e}=this.state;if(this.stopTimer(),!e){var t;(t=this.popper.current)===null||t===void 0||t.show(),this.setState({isShown:!0});var{interactive:i}=this.props;i&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)===null||e===void 0||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});var{onExited:e}=this.props;e()}stopShowingTooltip(){var{isShown:e}=this.state;this.stopTimer(),e&&this.hide()}render(){var{interactive:e,children:t,referenceObject:i,popperClassName:r,"data-testid":o,onEntered:s}=this.props,{isShown:a}=this.state,{options:l}=this.props;return l=ql({placement:"bottom"},l),d.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":o,children:d.jsx(Pn,{className:$(r,"popper-tooltip"),options:l,ref:this.popper,onEntered:s,onExited:this.handleExited,interactive:e,referenceObject:i,children:d.jsxs("div",{className:"tooltip-content",children:[" ",a&&t]})})})}}Ze(ne,"defaultTimeout",500);Ze(ne,"defaultReshowTimeout",100);Ze(ne,"triggerReshowThreshold",300);Ze(ne,"shownTooltipCount",0);Ze(ne,"lastHiddenTime",Date.now());Ze(ne,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:ne.defaultReshowTimeout,timeout:ne.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});var Ql=L.module("ThemeProvider"),is=c.createContext(null);function Vv(n){var{themes:e,defaultPreloadValues:t=ya,children:i}=n,r=c.useMemo(()=>Ca(),[]),[o,s]=c.useState(null),[a,l]=c.useState(()=>{var m,p;return(m=(p=Sa())===null||p===void 0?void 0:p.themeKey)!==null&&m!==void 0?m:wa}),u=c.useMemo(()=>e==null?null:_a(a,{base:r,custom:e??[]}),[r,a,e]),h=c.useMemo(()=>[...r,...e??[]],[r,e]);return c.useEffect(function(){if(!(u==null||e==null)){Ea(t);var p=Pa(t);Ql.debug2("updateThemePreloadData:",{active:u.map(v=>v.themeKey),custom:e.map(v=>v.themeKey),preloadStyleContent:p,selectedThemeKey:a}),Ta({themeKey:a,preloadStyleContent:p})}},[u,a,e,t]),c.useEffect(()=>{s({activeThemes:u,selectedThemeKey:a,themes:h,setSelectedThemeKey:l})},[u,a,h]),d.jsxs(d.Fragment,{children:[u==null?null:d.jsx(d.Fragment,{children:u.map(m=>d.jsx("style",{"data-theme-key":m.themeKey,children:m.styleContent},m.themeKey))}),o==null?null:d.jsx(is.Provider,{value:o,children:d.jsx(Ro,{children:i})})]})}function rs(){return En(is,"No ThemeContext value found. Component must be wrapped in a ThemeContext.Provider")}function ri(n){var{children:e,className:t,style:i,"data-testid":r}=n;return d.jsx("div",{className:$("btn-group",t),style:i,role:"group","data-testid":r,children:e})}ri.displayName="SplitButtonGroup";ri.propTypes={children:b.node.isRequired,className:b.string,style:b.object,"data-testid":b.string};ri.defaultProps={className:null,style:{},"data-testid":void 0};var Jl=["kind","variant","type","tooltip","icon","disabled","active","onClick","onContextMenu","onMouseDown","onMouseUp","onMouseEnter","onMouseLeave","onKeyDown","className","style","children","tabIndex","data-testid","aria-label"];function hr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function cr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?hr(Object(t),!0).forEach(function(i){ed(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):hr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function ed(n,e,t){return(e=td(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function td(n){var e=nd(n,"string");return typeof e=="symbol"?e:e+""}function nd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function id(n,e){if(n==null)return{};var t,i,r=rd(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(i=0;i<o.length;i++)t=o[i],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(r[t]=n[t])}return r}function rd(n,e){if(n==null)return{};var t={};for(var i in n)if({}.hasOwnProperty.call(n,i)){if(e.indexOf(i)!==-1)continue;t[i]=n[i]}return t}var od=["primary","secondary","tertiary","success","danger","inline","ghost"],sd=["group-end"];function ad(n,e){switch(n){case"primary":return"btn-primary";case"secondary":return"btn-outline-primary";case"tertiary":return"btn-secondary";case"success":return"btn-success";case"danger":return"btn-danger";case"inline":return"btn-inline";case"ghost":return $("btn-link",{"btn-link-icon":e,"btn-link-icon-only":e})}}function ld(n){switch(n){case"group-end":return $("pl-2","pr-3")}}var X=I.forwardRef((n,e)=>{var{kind:t,variant:i,type:r,tooltip:o,icon:s,disabled:a=!1,active:l,onClick:u,onContextMenu:h,onMouseDown:m,onMouseUp:p,onMouseEnter:v,onMouseLeave:g,onKeyDown:f,className:y,style:_,children:S,tabIndex:C,"data-testid":M,"aria-label":K}=n,Y=id(n,Jl),{UNSAFE_className:x}=nl({},"button"),z;i&&(z=ld(i));var N;s&&(N=I.isValidElement(s)?s:d.jsx(re,{icon:s}));var Q=N!=null&&S==null,te=ad(t,Q),j;o!==void 0&&(j=typeof o=="string"?d.jsx(ne,{children:o}):o);var V=K;K===void 0&&Q&&o!=null&&typeof o=="string"&&(V=o);var R=d.jsxs("button",cr(cr({"data-testid":M,ref:e,type:r,className:$("btn",te,z,{active:l},y,x),onClick:u,onContextMenu:h,onMouseUp:p,onMouseDown:m,onMouseEnter:v,onMouseLeave:g,onKeyDown:f,style:_,disabled:a,tabIndex:C,"aria-label":V},Y),{},{children:[s&&N,S,o!=null&&!a&&j]}));return a&&o!=null?d.jsxs("span",{className:"btn-disabled-wrapper",children:[R,j]}):R});X.displayName="Button";X.propTypes={kind:b.oneOf(od).isRequired,variant:b.oneOf(sd),type:b.oneOf(["submit","reset","button"]),tooltip(n){var{tooltip:e,icon:t,children:i}=n;return e===void 0&&t!=null&&i==null?new Error("Tooltip is required for icon only buttons"):null},icon(n){var{children:e,icon:t}=n;return t==null&&e==null?new Error("Icon is required if no children are provided"):e==null&&!I.isValidElement(t)&&(t==null||t.iconName===""||t.iconName==null)?new Error("Icon must be react element or fontawesome IconDefinition"):null},disabled:b.bool,active:b.bool,onClick(n){var{onClick:e,type:t}=n;return t==="button"&&typeof e!="function"?new Error("type button requires an onClick function"):e!==void 0&&typeof e!="function"?new Error("onClick must be a function"):null},onContextMenu:b.func,onMouseUp:b.func,onMouseDown:b.func,onMouseEnter:b.func,onMouseLeave:b.func,onKeyDown:b.func,tabIndex:b.number,children:b.node,className:b.string,style:b.object,"data-testid":b.string};X.defaultProps={type:"button",onClick:void 0,onContextMenu:void 0,onMouseUp:void 0,onMouseDown:void 0,onMouseEnter:void 0,onMouseLeave:void 0,onKeyDown:void 0,variant:void 0,tooltip:void 0,icon:void 0,disabled:!1,active:void 0,tabIndex:void 0,children:void 0,className:void 0,style:{},"data-testid":void 0};function os(n){var{className:e,children:t,"data-testid":i}=n;return d.jsx("div",{className:$("modal-footer",e),"data-testid":i,children:t})}function yn(n){var{isOpen:e,headerText:t,bodyText:i,onCancel:r,onConfirm:o,onDiscard:s,onModalDisable:a,cancelButtonText:l="Cancel",confirmButtonText:u="Okay",discardButtonText:h="Discard",isConfirmDanger:m=!1,children:p,"data-testid":v}=n,g=c.useRef(null),f=c.useRef(null),y=c.useCallback(()=>{f.current!==null&&f.current.checked&&a&&a(),o()},[o,a]),_=c.useCallback(()=>{var C;(C=g.current)===null||C===void 0||C.focus()},[]),S="";return e&&(S=typeof i=="function"?i():i),d.jsxs(Fo,{isOpen:e,onOpened:_,children:[d.jsx(Ho,{closeButton:!1,children:t}),d.jsx($o,{children:S}),d.jsxs(os,{children:[a&&d.jsxs("div",{className:"custom-control custom-checkbox form-group mr-auto",children:[d.jsx("input",{type:"checkbox",className:"custom-control-input",id:"move-confirmation-checkbox",defaultChecked:!1,ref:f,"data-testid":v!==void 0?"".concat(v,"-checkbox-confirm"):void 0}),d.jsx("label",{className:"custom-control-label",htmlFor:"move-confirmation-checkbox",children:"Don't ask me again"})]}),s&&d.jsx(X,{kind:"secondary",className:"mr-auto","data-dismiss":"modal",onClick:s,"data-testid":v!==void 0?"".concat(v,"-btn-discard"):void 0,children:h}),r&&d.jsx(X,{kind:"secondary","data-dismiss":"modal",onClick:r,"data-testid":v!==void 0?"".concat(v,"-btn-cancel"):void 0,children:l}),d.jsxs(ri,{children:[d.jsx(X,{kind:m?"danger":"primary",onClick:y,ref:g,"data-testid":v!==void 0?"".concat(v,"-btn-confirm"):void 0,children:u}),p]})]})]})}yn.propTypes={isOpen:b.bool.isRequired,headerText:b.string.isRequired,bodyText:b.oneOfType([b.string,b.func]).isRequired,onCancel:b.func,onConfirm:b.func.isRequired,onDiscard:b.func,onModalDisable:b.func,cancelButtonText:b.string,confirmButtonText:b.string,discardButtonText:b.string,children:b.node,"data-testid":b.string};yn.defaultProps={children:void 0,cancelButtonText:"Cancel",confirmButtonText:"Okay",discardButtonText:"Discard",onCancel:void 0,onDiscard:void 0,onModalDisable:void 0,"data-testid":void 0};function dd(n,e,t){return(e=ud(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ud(n){var e=hd(n,"string");return typeof e=="symbol"?e:e+""}function hd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function pi(n){return n.then!==void 0}class he{static disableAllActions(){he.actionsDisabled=!0}static enableAllActions(){he.actionsDisabled=!1}static isContextActionEvent(e){return Array.isArray(e.contextActions)}static compareActions(e,t){if(e.group!==t.group){var i,r;return((i=e.group)!==null&&i!==void 0?i:0)>((r=t.group)!==null&&r!==void 0?r:0)?1:-1}if(e.order!==t.order){var o,s;return((o=e.order)!==null&&o!==void 0?o:0)>((s=t.order)!==null&&s!==void 0?s:0)?1:-1}if(e.title!==t.title){var a,l;return((a=e.title)!==null&&a!==void 0?a:"")>((l=t.title)!==null&&l!==void 0?l:"")?1:-1}return e!==t?e>t?1:-1:0}static sortActions(e){if(e==null||!Array.isArray(e))return[];var t=e.slice();return t.sort(he.compareActions),t}static isMacPlatform(){var{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return he.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){var t=he.getModifierKey();return e[t]}static getMenuItems(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=[],r=e;Array.isArray(r)||(r=[r]);for(var o=0;o<r.length;o+=1){var s=r[o],a=void 0;typeof s=="function"?a=s():a=s,a!=null&&(a instanceof Promise?t&&i.push(a):Array.isArray(a)?i=i.concat(a):i.push(a))}return i=i.filter(l=>l.title!==void 0||l.then!=null||l.menuElement),i}static getNextMenuItem(e,t,i){var r=e;r<0&&t<0&&(r=i.length);for(var o=1;o<i.length+1;o+=1){var s=(r+t*o+i.length)%i.length,a=i[s];if(!(a instanceof Promise)&&a.disabled!==!0)return s}return e}}dd(he,"actionsDisabled",!1);var mr=L.module("GlobalContextAction");class cd extends c.Component{constructor(e){super(e),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}componentDidMount(){document.body.addEventListener("contextmenu",this.handleContextMenu),document.body.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.body.removeEventListener("contextmenu",this.handleContextMenu),document.body.removeEventListener("keydown",this.handleKeyDown)}handleContextMenu(e){var t=e;t.contextActions==null&&(t.contextActions=[]);var{action:i}=this.props;i.title==null&&!i.menuElement||(t.contextActions==null&&(t.contextActions=[]),t.contextActions.push(i),mr.debug("Received context menu event at global action! Menu items are now: ",t.contextActions))}handleKeyDown(e){var{action:t}=this.props;if(!he.actionsDisabled&&t.shortcut!==void 0&&t.shortcut.matchesEvent(e)){var i;mr.debug("Global hotkey matched!",e),(i=t.action)===null||i===void 0||i.call(t,e),e.preventDefault(),e.stopPropagation()}}render(){return null}}class md extends c.Component{render(){for(var{actions:e,"data-testid":t}=this.props,i=[],r=0;r<e.length;r+=1){var o=e[r],{shortcut:s}=o;if(o.title!=null||o.menuElement||s){var a=d.jsx(cd,{action:o,"data-testid":t},"".concat(o.title,".").concat(s==null?void 0:s.id));i.push(a)}}return i}}function ss(n,e,t){return(e=pd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function pd(n){var e=vd(n,"string");return typeof e=="symbol"?e:e+""}function vd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Nn=L.module("ContextActions");class ie extends c.Component{static triggerMenu(e,t,i,r){if(r.length!==0){var o=new MouseEvent("contextmenu",{clientX:t,clientY:i,bubbles:!0,cancelable:!0});o.contextActions=r,e.dispatchEvent(o)}}constructor(e){super(e),ss(this,"container",void 0),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=I.createRef(),this.state={globalActions:[],keyboardActions:[]}}static getDerivedStateFromProps(e){if(e.actions==null||!Array.isArray(e.actions))return{globalActions:[],keyboardActions:[]};var t=e.actions.filter(r=>!pi(r)&&typeof r!="function"&&r.isGlobal),i=e.actions.filter(r=>!pi(r)&&typeof r!="function"&&(r.isGlobal===void 0||!r.isGlobal)&&r.shortcut!=null);return{globalActions:t,keyboardActions:i}}componentDidMount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&(this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.addEventListener("keydown",this.handleKeyDown))}componentWillUnmount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&(this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.removeEventListener("keydown",this.handleKeyDown))}handleContextMenu(e){var{ignoreClassNames:t=[]}=this.props;if(t.length>0)for(var i=e.target,r=function(){var{classList:u}=i,h=t.find(m=>u.contains(m));if(h!==void 0)return Nn.debug2('Contextmenu event ignored based on the target className "'.concat(h,'"')),{v:void 0};i=i.parentElement};i!=null;){var o=r();if(typeof o=="object")return o.v}if(he.isContextActionEvent(e)||(e.contextActions=[]),!!he.isContextActionEvent(e)){var{actions:s}=this.props;if(s!=null){var a=s;Array.isArray(a)&&(a=a.filter(l=>pi(l)||typeof l=="function"||l.isGlobal===void 0||!l.isGlobal)),e.contextActions=e.contextActions.concat(a)}Nn.debug("Received context menu event! Menu items are now: ",e.contextActions)}}handleKeyDown(e){for(var{keyboardActions:t}=this.state,i=0;i<t.length;i+=1){var r=t[i];if(!he.actionsDisabled&&r.shortcut!=null&&r.shortcut.matchesEvent(e)){var o;Nn.debug("Context hotkey matched!",e),(o=r.action)===null||o===void 0||o.call(r,e),e.stopPropagation(),e.preventDefault(),Nn.debug2("Matched hotkey returned false, key event not consumed")}}}render(){var{"data-testid":e}=this.props,{globalActions:t}=this.state;return d.jsx("div",{className:"context-actions-listener",ref:this.container,"data-testid":e,children:d.jsx(md,{actions:t})})}}ss(ie,"groups",{default:void 0,high:100,medium:5e3,low:1e4,global:1e5,edit:100});var Ui=I.forwardRef((n,e)=>{var t,i;function r(x){var{menuItem:z,onMenuItemClick:N}=n;N(z,x)}function o(x){var{menuItem:z,onMenuItemMouseMove:N}=n;N(z,x)}function s(x){var{menuItem:z,onMenuItemContextMenu:N}=n;N(z,x)}function a(x,z,N){if(typeof x.type=="string")return x;var{closeMenu:Q,menuItem:te,isKeyboardSelected:j,isMouseSelected:V,"data-testid":R}=n,D={menuItem:te,closeMenu:Q,isKeyboardSelected:j,isMouseSelected:V,iconElement:z,displayShortcut:N,"data-testid":R};return I.cloneElement(x,{forwardedProps:D})}var{children:l,menuItem:u,isKeyboardSelected:h=!1,isMouseSelected:m=!1,"data-testid":p}=n,v=(t=u.shortcutText)!==null&&t!==void 0?t:(i=u.shortcut)===null||i===void 0?void 0:i.getDisplayText(),g=null;if(u.icon){var f=u.icon;if(I.isValidElement(f))g=f;else{var y;u.iconColor!=null&&(u.disabled===void 0||!u.disabled)&&(y={color:u.iconColor}),g=d.jsx(re,{icon:f,style:y})}}var _=null,S=!!l;u.actions&&(_=d.jsx(re,{icon:Oa}));var C=null;if(u.menuElement)C=d.jsx("div",{className:"custom-menu-item",onMouseMove:o,children:a(u.menuElement,g,v)});else{var M,K=u.disabled,Y=u.iconOutline;C=d.jsx("button",{type:"button",className:$("btn-context-menu",{disabled:K},{active:(S||m)&&(K===void 0||!K)},{"keyboard-active":h&&(K===void 0||!K)}),onClick:r,onMouseMove:o,onContextMenu:s,title:(M=u.description)!==null&&M!==void 0?M:"",children:d.jsxs("div",{className:"btn-context-menu-wrapper",children:[d.jsx("span",{className:$("icon",{outline:Y}),children:g}),d.jsx("span",{className:"title",children:u.title}),v!==void 0&&d.jsx("span",{className:"shortcut",children:v}),_&&d.jsx("span",{className:$("submenu-indicator",{disabled:K}),children:_})]})})}return d.jsxs("div",{className:"context-menu-item",ref:e,"data-testid":p,children:[l,C]})});Ui.displayName="ContextMenuItem";Ui.defaultProps={children:null,isKeyboardSelected:!1,isMouseSelected:!1,"data-testid":void 0};var oi=I.forwardRef((n,e)=>{var{checked:t=!1,children:i,className:r,disabled:o,inputClassName:s,isInvalid:a,labelClassName:l,name:u,onChange:h,"data-testid":m}=n,[p]=c.useState(Pt()),v=ns(e);c.useEffect(function(){v.current&&(v.current.indeterminate=t===null)},[v,t]);var g=c.useCallback(f=>{v.current&&(v.current.indeterminate=t===null),h&&h(f)},[v,t,h]);return d.jsxs("div",{className:$("custom-control custom-checkbox",r),children:[d.jsx("input",{type:"checkbox",ref:v,checked:t??!1,className:$("custom-control-input",s,{"is-invalid":a}),disabled:o,id:p,name:u,onChange:g,"data-testid":m}),d.jsx("label",{className:$("custom-control-label",l),htmlFor:p,children:i})]})});oi.displayName="Checkbox";oi.propTypes={checked:(n,e)=>{var{[e]:t}=n;return t!==null&&typeof t!="boolean"?new Error("Checked must be a boolean or null for indeterminate"):null},children:b.node.isRequired,className:b.string,disabled:b.bool,inputClassName:b.string,isInvalid:b.bool,labelClassName:b.string,name:b.string,onChange:b.func,"data-testid":b.string};oi.defaultProps={checked:!1,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};function pr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function fd(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?pr(Object(t),!0).forEach(function(i){fn(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):pr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function fn(n,e,t){return(e=gd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function gd(n){var e=bd(n,"string");return typeof e=="symbol"?e:e+""}function bd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class as extends c.PureComponent{constructor(e){var t;super(e),fn(this,"container",void 0),fn(this,"oldFocus",void 0),fn(this,"rAF",void 0),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMenuItemClick=this.handleMenuItemClick.bind(this),this.handleMenuItemMouseMove=this.handleMenuItemMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.container=I.createRef(),this.oldFocus=document.activeElement,this.rAF=0;var{options:i}=e,r=(t=i.initialKeyboardIndex)!==null&&t!==void 0?t:-1;this.state={menuItems:[],keyboardIndex:r,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.rAF=window.requestAnimationFrame(()=>{var e;(e=this.container.current)===null||e===void 0||e.focus();var{onMenuOpened:t}=this.props;t(this)})}componentDidUpdate(e){var{actions:t}=this.props;e.actions!==t&&this.initMenu()}componentWillUnmount(){cancelAnimationFrame(this.rAF)}getKeyboardIndex(){var{options:e}=this.props;if(e.separateKeyboardMouse!==void 0&&e.separateKeyboardMouse){var{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){var{options:t}=this.props;t.separateKeyboardMouse!==void 0&&t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){var{mouseIndex:e}=this.state;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){cancelAnimationFrame(this.rAF),this.setState({menuItems:[]});var{actions:e}=this.props,t=he.getMenuItems(e,!1);t.length>0&&this.setState(i=>({menuItems:he.sortActions(i.menuItems.concat(t))}))}handleKeyDown(e){var{menuItems:t}=this.state,i=this.getKeyboardIndex(),r=i;if(e.key==="Enter"||e.key===" "){i!=null&&i>=0&&i<t.length&&this.handleMenuItemClick(t[i],e);return}if(e.key==="Escape")r=null;else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey===!0){var o;r=he.getNextMenuItem((o=r)!==null&&o!==void 0?o:0,-1,t)}else if(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1){var s;r=he.getNextMenuItem((s=r)!==null&&s!==void 0?s:0,1,t)}i!==r&&(r!==null?this.setKeyboardIndex(r):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,{closeMenu:t,onMenuClosed:i}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),i(this)})}handleCloseMenu(){this.closeMenu()}handleMenuItemClick(e,t){t.preventDefault(),t.stopPropagation(),e!=null&&(e.disabled===void 0||!e.disabled)&&e.action!=null&&(e.action(t.nativeEvent),this.closeMenu(!0))}handleMenuItemMouseMove(e){var{menuItems:t}=this.state,i=t.indexOf(e);this.setMouseIndex(i)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{"data-testid":t}=this.props,{keyboardIndex:i,menuItems:r,mouseIndex:o}=this.state,s=0;s<r.length;s+=1){var a=r[s];s>0&&a.group!==r[s-1].group&&e.push(d.jsx("hr",{},"".concat(s,".separator")));var l=d.jsx(Ui,{isKeyboardSelected:i===s,isMouseSelected:o===s,menuItem:a,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},s);e.push(l)}var{menuStyle:u}=this.props;return d.jsx("div",{className:"context-menu-container",style:fd({},u),ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":t,children:e})}}fn(as,"defaultProps",{closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});function vr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function fr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?vr(Object(t),!0).forEach(function(i){Vt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):vr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Vt(n,e,t){return(e=yd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yd(n){var e=Cd(n,"string");return typeof e=="symbol"?e:e+""}function Cd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class gn extends c.PureComponent{constructor(e){super(e),Vt(this,"container",void 0),Vt(this,"parent",void 0),Vt(this,"popper",void 0),Vt(this,"isOpen",void 0),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=I.createRef(),this.parent=null,this.popper=I.createRef(),this.isOpen=!1}componentDidMount(){var{isShown:e}=this.props;if(e===null){var t;(t=this.container.current)!==null&&t!==void 0&&t.parentElement&&(this.parent=this.container.current.parentElement,this.parent.addEventListener("click",this.handleClick))}else e&&this.openMenu()}componentDidUpdate(e){var{isShown:t}=this.props;e.isShown!==t&&(t!==null&&t?window.requestAnimationFrame(()=>{this.openMenu()}):this.closeMenu())}componentWillUnmount(){this.parent&&this.parent.removeEventListener("click",this.handleClick)}closeMenu(){var e;(e=this.popper.current)===null||e===void 0||e.hide()}openMenu(){this.popper.current&&!this.isOpen&&(this.popper.current.show(),this.isOpen=!0)}scheduleUpdate(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleClick(e){e.preventDefault(),e.stopPropagation(),this.openMenu()}handleCloseMenu(){this.closeMenu()}handleExited(){this.isOpen=!1;var{onMenuClosed:e}=this.props;e()}render(){var{actions:e,onMenuOpened:t,popperClassName:i,"data-testid":r}=this.props,{menuStyle:o}=this.props,{options:s,popperOptions:a}=this.props;return a=fr({placement:"bottom"},a),s=fr({separateKeyboardMouse:!0},s),d.jsx("div",{className:"menu-actions-listener",ref:this.container,"data-testid":r,children:d.jsx(Pn,{ref:this.popper,options:a,className:$("menu-popper",i),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:d.jsx(as,{actions:e,closeMenu:this.handleCloseMenu,onMenuOpened:t,options:s,menuStyle:o})})})}}Vt(gn,"defaultProps",{isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0});function bt(n,e,t){return(e=wd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wd(n){var e=Sd(n,"string");return typeof e=="symbol"?e:e+""}function Sd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var gr=L.module("Shortcut"),O;(function(n){n.CTRL="MODIFIER_CTRL",n.CMD="MODIFIER_CMD",n.ALT="MODIFIER_ALT",n.OPTION="MODIFIER_OPTION",n.SHIFT="MODIFIER_SHIFT"})(O||(O={}));var w;(function(n){n.A="A",n.B="B",n.C="C",n.D="D",n.E="E",n.F="F",n.G="G",n.H="H",n.I="I",n.J="J",n.K="K",n.L="L",n.M="M",n.N="N",n.O="O",n.P="P",n.Q="Q",n.R="R",n.S="S",n.T="T",n.U="U",n.V="V",n.W="W",n.X="X",n.Y="Y",n.Z="Z",n.ZERO="0",n.ONE="1",n.TWO="2",n.THREE="3",n.FOUR="4",n.FIVE="5",n.SIX="6",n.SEVEN="7",n.EIGHT="8",n.NINE="9",n.BACKSPACE="Backspace",n.ESCAPE="Escape",n.ENTER="Enter",n.DELETE="Delete",n.SLASH="/",n.QUESTION_MARK="?",n.BACKSLASH="\\",n.PIPE="|",n.MINUS="-",n.UNDERSCORE="_",n.EQUALS="=",n.PLUS="+",n.BACKTICK="`",n.TILDE="~",n.COMMA=",",n.LEFT_CHEVRON="<",n.PERIOD=".",n.RIGHT_CHEVRON=">",n.SEMICOLON=";",n.COLON=":",n.SINGLE_QUOTE="'",n.DOUBLE_QUOTE='"',n.LEFT_BRACKET="[",n.RIGHT_BRACKET="]",n.LEFT_CURLY="{",n.RIGHT_CURLY="}",n.F1="F1",n.F2="F2",n.F3="F3",n.F4="F4",n.F5="F5",n.F6="F6",n.F7="F7",n.F8="F8",n.F9="F9",n.F10="F10",n.F11="F11",n.F12="F12"})(w||(w={}));var _d=new Set([w.ENTER,w.DELETE,w.F1,w.F2,w.F3,w.F4,w.F5,w.F6,w.F7,w.F8,w.F9,w.F10,w.F11,w.F12]);class le extends Zo{static isAllowedKey(e){return Object.values(w).includes(e)}static isValidKeyState(e){var{keyValue:t}=e;if(t===null)return!0;if(!le.isMacPlatform&&e.metaKey||!le.isAllowedKey(t))return!1;var i=!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey;return!i||_d.has(t)}static createKeyState(e){var t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(i=>{switch(i){case O.CTRL:t.ctrlKey=!0;break;case O.ALT:case O.OPTION:t.altKey=!0;break;case O.CMD:t.metaKey=!0;break;case O.SHIFT:t.shiftKey=!0;break}}),t}static getKeyStateFromEvent(e){var{key:t,keyCode:i}=e,r="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?r="":!le.isAllowedKey(t)&&le.isAllowedKey(String.fromCharCode(i))?r=String.fromCharCode(i):r=t,{keyValue:r,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey}}static getWindowsDisplayText(e){var t="";return e.ctrlKey&&(t+="Ctrl+"),e.altKey&&(t+="Alt+"),e.shiftKey&&(t+="Shift+"),e.keyValue===w.ESCAPE?t+="Esc":e.keyValue!==null&&(t+=e.keyValue),t}static getMacDisplayText(e){var t="";switch(e.ctrlKey&&(t+="⌃"),e.altKey&&(t+="⌥"),e.shiftKey&&(t+="⇧"),e.metaKey&&(t+="⌘"),e.keyValue){case w.ENTER:t+="⏎";break;case w.ESCAPE:t+="⎋";break;case w.BACKSPACE:t+="⌫";break;case w.DELETE:t+="⌦";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){var i,r;return((i=e.keyValue)===null||i===void 0?void 0:i.toUpperCase())===((r=t.keyValue)===null||r===void 0?void 0:r.toUpperCase())&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey&&e.shiftKey===t.shiftKey}static getDisplayText(e){return e.keyValue===null?"":le.isMacPlatform?le.getMacDisplayText(e):le.getWindowsDisplayText(e)}constructor(e){var{id:t,shortcut:i,macShortcut:r,isEditable:o=!0,name:s,tooltip:a}=e;super(),bt(this,"id",void 0),bt(this,"name",void 0),bt(this,"tooltip",void 0),bt(this,"isEditable",void 0),bt(this,"defaultKeyState",void 0),bt(this,"keyState",void 0),this.id=t,this.name=s,this.tooltip=a,this.isEditable=o;var l=le.isMacPlatform,u=l?r:i;this.defaultKeyState=le.createKeyState(u),this.keyState=this.defaultKeyState}getDisplayText(){return le.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){le.isValidKeyState(e)?(gr.debug2("Shortcut ".concat(this.id," updated to ").concat(JSON.stringify(e))),this.keyState=e,this.dispatchEvent(new Jo("onUpdate",{detail:this}))):gr.debug2("Shortcut ".concat(this.id," tried to update to invalid keyState ").concat(JSON.stringify(e)))}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return le.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState(le.NULL_KEY_STATE)}isNull(){return le.doKeyStatesMatch(this.keyState,le.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return le.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState(le.getKeyStateFromEvent(e))}}bt(le,"NULL_KEY_STATE",{metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null});bt(le,"isMacPlatform",he.isMacPlatform());function br(n,e,t){return(e=Ed(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ed(n){var e=Pd(n,"string");return typeof e=="symbol"?e:e+""}function Pd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var yr=L.module("ShortcutRegistry");class Td extends Zo{constructor(){super(...arguments),br(this,"shortcutMap",new Map),br(this,"shortcutsByCategory",new Map)}createAndAdd(e){var t=new le(e);return this.add(t)}add(e){var t=this.shortcutMap.get(e.id);if(t)return yr.warn("Skipping attempt to add duplicate shortcut ID to registry: ".concat(e.id)),t;yr.debug2("Adding shortcut to registry: ".concat(e.id)),e.addEventListener("onUpdate",o=>{var{detail:s}=o;return this.dispatchEvent(new Jo("onUpdate",{detail:s}))});var i=e.id.split(".")[0];if(this.shortcutMap.set(e.id,e),this.shortcutsByCategory.has(i)){var r;(r=this.shortcutsByCategory.get(i))===null||r===void 0||r.push(e)}else this.shortcutsByCategory.set(i,[e]);return e}get(e){return this.shortcutMap.get(e)}getConflictingShortcuts(e){return Array.from(this.shortcutMap.values()).filter(t=>!t.isNull()&&t.matchesKeyState(e))}}var ae=Object.freeze(new Td),Gt={COPY:ae.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[O.CTRL,w.C],macShortcut:[O.CMD,w.C],isEditable:!1}),PASTE:ae.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[O.CTRL,w.V],macShortcut:[O.CMD,w.V],isEditable:!1}),SAVE:ae.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[O.CTRL,w.S],macShortcut:[O.CMD,w.S],isEditable:!1}),SELECT_ALL:ae.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[O.CTRL,w.A],macShortcut:[O.CMD,w.A],isEditable:!1}),REOPEN_CLOSED_PANEL:ae.createAndAdd({id:"GLOBAL.REOPEN_CLOSED_PANEL",name:"Re-open Closed Panel",shortcut:[O.ALT,O.SHIFT,w.T],macShortcut:[O.OPTION,O.SHIFT,w.T],isEditable:!0}),LINKER:ae.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[O.CTRL,w.L],macShortcut:[O.CMD,w.L]}),LINKER_CLOSE:ae.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[w.ESCAPE],macShortcut:[w.ESCAPE],isEditable:!1}),COPY_VERSION_INFO:ae.createAndAdd({id:"GLOBAL.COPY_VERSION_INFO",name:"Copy Version Info",shortcut:[O.CTRL,O.ALT,w.I],macShortcut:[O.CMD,O.SHIFT,w.I],isEditable:!0}),NEXT:ae.createAndAdd({id:"GLOBAL.NEXT",name:"Next",shortcut:[w.ENTER],macShortcut:[w.ENTER],isEditable:!1}),PREVIOUS:ae.createAndAdd({id:"GLOBAL.PREVIOUS",name:"Previous",shortcut:[O.SHIFT,w.ENTER],macShortcut:[O.SHIFT,w.ENTER],isEditable:!1})};function Ti(n,e,t){return(e=Od(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Od(n){var e=xd(n,"string");return typeof e=="symbol"?e:e+""}function xd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class si extends c.PureComponent{constructor(e){super(e),Ti(this,"inputField",void 0),Ti(this,"searchChangeSelection",void 0),this.inputField=I.createRef(),this.searchChangeSelection=I.createRef()}componentDidMount(){this.setInputPaddingRight()}componentDidUpdate(){this.setInputPaddingRight()}focus(){var e;(e=this.inputField.current)===null||e===void 0||e.focus()}setInputPaddingRight(){var e=this.inputField.current,t=this.searchChangeSelection.current;if(e&&t){var i=t.getBoundingClientRect().width;e.style.paddingRight="".concat(i,"px")}}render(){var{value:e,placeholder:t,onBlur:i,onChange:r,className:o,disabled:s,matchCount:a,id:l,onKeyDown:u,"data-testid":h,cursor:m}=this.props,p,v=[{action:()=>m==null?void 0:m.next("forward"),shortcut:Gt.NEXT},{action:()=>m==null?void 0:m.next("back"),shortcut:Gt.PREVIOUS}];return m&&a>1?p=d.jsxs(d.Fragment,{children:[d.jsx(X,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{m.next("back")},icon:Uo,tooltip:"Previous match (".concat(Gt.PREVIOUS.getDisplayText(),")")}),d.jsxs("span",{className:"search-change-text",children:[m.index!==void 0&&"".concat(m.index+1," of "),a]}),d.jsx(X,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{m.next("forward")},icon:xa,tooltip:"Next match (".concat(Gt.NEXT.getDisplayText(),")")})]}):p=a>0&&d.jsx("span",{className:"search-match",children:a}),d.jsxs("div",{className:$("search-group",o),children:[d.jsx("input",{type:"search",value:e,onBlur:i,onChange:r,onKeyDown:u,className:"form-control",disabled:s,placeholder:t,ref:this.inputField,id:l,"data-testid":h}),a!=null?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"search-change-selection",ref:this.searchChangeSelection,children:p}),d.jsx(ie,{actions:v})]}):d.jsx("span",{className:"search-icon",children:d.jsx(re,{icon:Ia})})]})}}Ti(si,"defaultProps",{placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0,cursor:void 0});function ls(n,e,t){return(e=Id(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Id(n){var e=Md(n,"string");return typeof e=="symbol"?e:e+""}function Md(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ds extends c.PureComponent{constructor(e){super(e),ls(this,"searchInput",void 0),this.searchInput=I.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=ii(this.sendUpdate.bind(this),e.debounceMs),this.state={value:e.value}}componentDidUpdate(e){var{value:t}=this.props;e.value!==t&&this.setState({value:t})}focus(){var e;(e=this.searchInput.current)===null||e===void 0||e.focus()}handleChange(e){this.setState({value:e.target.value},this.sendUpdate)}sendUpdate(){var{onChange:e}=this.props,{value:t}=this.state;e(t)}render(){var{placeholder:e,className:t,matchCount:i,id:r,"data-testid":o}=this.props,{value:s}=this.state;return d.jsx(si,{value:s,placeholder:e,onChange:this.handleChange,className:t,matchCount:i,ref:this.searchInput,id:r,"data-testid":o})}}ls(ds,"defaultProps",{placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0});function us(n,e,t){return(e=Dd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Dd(n){var e=jd(n,"string");return typeof e=="symbol"?e:e+""}function jd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var kd=L.module("ItemListItem");class ai extends c.Component{static handleKeyDown(){return kd.log("ItemListItem.handleKeyDown false"),!1}constructor(e){super(e),us(this,"itemRef",void 0),this.handleBlur=this.handleBlur.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleClick=this.handleClick.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleDragStart=this.handleDragStart.bind(this),this.handleDrag=this.handleDrag.bind(this),this.handleDragOver=this.handleDragOver.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.handleDrop=this.handleDrop.bind(this),this.handleDoubleClick=this.handleDoubleClick.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.itemRef=I.createRef()}handleBlur(e){var{itemIndex:t,onBlur:i}=this.props;i(t,e)}handleFocus(e){var{itemIndex:t,onFocus:i}=this.props;i(t,e)}handleClick(e){var{itemIndex:t,onClick:i}=this.props;i(t,e)}handleContextMenu(e){var{itemIndex:t,onContextMenu:i}=this.props;i(t,e)}handleDragStart(e){var{itemIndex:t,onDragStart:i}=this.props;i(t,e)}handleDrag(e){var{itemIndex:t,onDrag:i}=this.props;i(t,e)}handleDragOver(e){e.preventDefault();var{itemIndex:t,onDragOver:i}=this.props;i(t,e)}handleDragEnd(e){var{itemIndex:t,onDragEnd:i}=this.props;i(t,e)}handleDrop(e){var{itemIndex:t,onDrop:i}=this.props;i(t,e)}handleDoubleClick(e){var{itemIndex:t,onDoubleClick:i}=this.props;i(t,e)}handleMouseMove(e){var{itemIndex:t,onMouseMove:i}=this.props;i(t,e)}handleMouseDown(e){var{itemIndex:t,onMouseDown:i}=this.props;i(t,e)}handleMouseUp(e){var{itemIndex:t,onMouseUp:i}=this.props;i(t,e)}render(){var{isDraggable:e,isFocused:t,isSelected:i,style:r,children:o,"data-testid":s}=this.props;return d.jsx("div",{className:$("item-list-item",{active:i},{"is-focused":t},{"is-draggable":e}),onKeyDown:ai.handleKeyDown,onContextMenuCapture:this.handleContextMenu,onClick:this.handleClick,onDrag:this.handleDrag,onDragStart:this.handleDragStart,onDragOver:this.handleDragOver,onDragEnd:this.handleDragEnd,onDrop:this.handleDrop,onDoubleClick:this.handleDoubleClick,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseUp:this.handleMouseUp,tabIndex:-1,ref:this.itemRef,role:"listitem",style:r,onFocus:this.handleFocus,onBlur:this.handleBlur,draggable:e,"data-testid":s,children:o})}}us(ai,"defaultProps",{children:null,isDraggable:!1,isFocused:!1,isSelected:!1,itemIndex:0,"data-testid":void 0,onBlur(){},onClick(){},onContextMenu(){},onDragStart(){},onDrag(){},onDragOver(){},onDragEnd(){},onDrop(){},onDoubleClick(){},onFocus(){},onMouseDown(){},onMouseMove(){},onMouseUp(){},style:{}});function Cr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function wr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Cr(Object(t),!0).forEach(function(i){Ke(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Cr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Ke(n,e,t){return(e=Nd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Nd(n){var e=Ad(n,"string");return typeof e=="symbol"?e:e+""}function Ad(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Sr=L.module("ItemList"),_r=5;class Le extends c.PureComponent{static renderItem(e){var t,i,{item:r}=e;return d.jsx("div",{className:"item-list-item-content",children:r!=null&&((t=(i=r.displayValue)!==null&&i!==void 0?i:r.value)!==null&&t!==void 0?t:"".concat(r))})}constructor(e){super(e),Ke(this,"list",void 0),Ke(this,"listContainer",void 0),Ke(this,"getItemSelected",zt((r,o)=>qe.isSelected(o,r),{max:Le.CACHE_SIZE})),Ke(this,"getCachedItem",zt((r,o,s,a,l,u,h,m)=>{var p=u({item:s,itemIndex:r,isFocused:a,isSelected:l,style:h});return d.jsx(ai,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:m,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:a,isSelected:l,itemIndex:r,style:h,children:p},o)},{max:Le.CACHE_SIZE})),Ke(this,"getOuterElement",zt(r=>{var o=I.forwardRef((s,a)=>d.jsx("div",wr({ref:a,tabIndex:-1,onKeyDown:r,role:"presentation"},s)));return o.displayName="ItemListOuterElement",o})),Ke(this,"getInnerElement",zt(()=>{var r=I.forwardRef((o,s)=>d.jsx("div",wr({className:"item-list-inner-element",ref:s},o)));return r.displayName="ItemListInnerElement",r})),Ke(this,"getItemData",zt((r,o,s)=>({items:r,selectedRanges:o,renderItem:s}))),this.handleItemBlur=this.handleItemBlur.bind(this),this.handleItemContextMenu=this.handleItemContextMenu.bind(this),this.handleItemFocus=this.handleItemFocus.bind(this),this.handleItemDoubleClick=this.handleItemDoubleClick.bind(this),this.handleItemMouseDown=this.handleItemMouseDown.bind(this),this.handleItemMouseMove=this.handleItemMouseMove.bind(this),this.handleItemMouseUp=this.handleItemMouseUp.bind(this),this.handleItemsRendered=this.handleItemsRendered.bind(this),this.handleWindowMouseUp=this.handleWindowMouseUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleScroll=this.handleScroll.bind(this),this.handleResize=this.handleResize.bind(this),this.renderInnerElement=this.renderInnerElement.bind(this),this.list=I.createRef(),this.listContainer=I.createRef();var{isStickyBottom:t,selectedRanges:i}=e;this.state={focusIndex:null,mouseDownIndex:null,selectedRanges:i,overscanStartIndex:0,height:null,isDragging:!1,isStuckToBottom:t,scrollOffset:null,mouseX:null,mouseY:null}}componentDidUpdate(e,t){var{selectedRanges:i,itemCount:r}=this.props,{focusIndex:o,isStuckToBottom:s,scrollOffset:a,height:l,selectedRanges:u}=this.state;if(s&&!this.isListAtBottom()&&r>0&&this.scrollToBottom(),(a!==t.scrollOffset||l!==t.height)&&this.sendViewportUpdate(),i!==e.selectedRanges&&i!==u)this.setSelectedRanges(i);else if(u!==t.selectedRanges){var{onSelectionChange:h}=this.props;h(u)}if(o!==t.focusIndex){var{onFocusChange:m}=this.props;m(o)}}componentWillUnmount(){window.removeEventListener("mouseup",this.handleWindowMouseUp)}focus(){var e;(e=this.listContainer.current)===null||e===void 0||e.focus()}restoreScrollPosition(){var{scrollOffset:e}=this.state;if(e!=null){var t;(t=this.listContainer.current)===null||t===void 0||t.scrollTo(0,e)}}getElement(e){if(this.listContainer.current==null)return null;var{focusSelector:t}=this.props,{overscanStartIndex:i}=this.state,r=this.listContainer.current.querySelectorAll(t),o=e-i;return r[o]}focusItem(e){var{disableSelect:t}=this.props;if(!t){this.setState({focusIndex:e});var i=this.getElement(e);i instanceof HTMLElement&&i.focus()}}scrollToItem(e){var t=this.getElement(e);t!=null&&t.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){this.setState({focusIndex:e});var{selectedRanges:i}=this.state,r=qe.isSelected(i,e),o=r||he.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,o,!1)}handleItemDoubleClick(e,t){var{isDoubleClickSelect:i,onSelect:r}=this.props;i&&this.setState(o=>{var{selectedRanges:s}=o;return{selectedRanges:qe.selectRange(s,[e,e])}},()=>{r(e,t)})}handleItemMouseDown(e,t){var{selectedRanges:i}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(t.button===2&&i.length===0){this.focusItem(e),this.selectItem(e);return}t.button!=null&&t.button!==0||(this.setState({mouseDownIndex:e,mouseX:t.clientX,mouseY:t.clientY}),window.addEventListener("mouseup",this.handleWindowMouseUp))}}handleItemBlur(e,t){Sr.debug2("item blur",e,t.currentTarget,t.relatedTarget),(!t.relatedTarget||this.listContainer.current&&t.relatedTarget instanceof HTMLElement&&!this.listContainer.current.contains(t.relatedTarget))&&this.setState({focusIndex:null})}handleItemFocus(e,t){Sr.debug2("item focus",e,t.target),this.setState(i=>{var{focusIndex:r}=i;return r!==e?{focusIndex:e}:null})}handleItemMouseMove(e,t){var{isDragSelect:i,isMultiSelect:r,disableSelect:o}=this.props,{mouseDownIndex:s,selectedRanges:a,mouseX:l,mouseY:u}=this.state;if(!(s==null||o)){var h=Math.abs(t.clientX-(l??0)),m=Math.abs(t.clientY-(u??0));h>_r&&m>_r&&this.setState({isDragging:!0}),(i||s===e)&&(this.focusItem(e),r?(!i&&!this.getItemSelected(e,a)&&!he.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(s,e),Math.max(s,e)])):this.toggleSelect(e,t.shiftKey,he.isModifierKeyDown(t),!1))}}handleItemMouseUp(e,t){var{isDeselectOnClick:i,isDoubleClickSelect:r,onSelect:o}=this.props,{mouseDownIndex:s,isDragging:a}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(s===e&&!a){var l=t.shiftKey,u=he.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,l,u,i),!r&&!l&&!u&&o(e,t)}this.resetMouseState()}}handleItemsRendered(e){var{overscanStartIndex:t}=e;this.setState({overscanStartIndex:t})}handleResize(e){var{height:t}=e;this.setState({height:t})}handleMouseLeave(){this.setState({mouseDownIndex:null})}handleWindowMouseUp(){this.resetMouseState(),window.removeEventListener("mouseup",this.handleWindowMouseUp)}handleKeyDown(e){var{isMultiSelect:t,itemCount:i,onSelect:r}=this.props,{focusIndex:o}=this.state,s=o;if(e.key==="Enter"||e.key===" "){!t&&s!=null&&this.setState({selectedRanges:[[s,s]]},()=>{s!=null&&r(s,e)});return}if(e.key==="ArrowUp")s!=null&&s>=0?s=Math.max(0,s-1):s=i-1;else if(e.key==="ArrowDown")s!=null&&s>=0?s=Math.min(s+1,i-1):s=0;else return;if(o!==s){e.stopPropagation(),e.preventDefault(),this.focusItem(s);var{selectedRanges:a}=this.state;if(e.shiftKey&&a.length>0){var l=a[a.length-1];this.selectRange([Math.min(s,l[0]),Math.max(s,l[1])])}else if(this.deselectAll(),s!==null)this.selectItem(s);else{var u;(u=this.listContainer.current)===null||u===void 0||u.focus()}this.scrollIntoView(s)}}handleScroll(e){var{scrollUpdateWasRequested:t,scrollOffset:i}=e;this.setState(r=>{if(t)return{scrollOffset:i};var{isStickyBottom:o}=this.props,{height:s}=r,a=o&&this.isListAtBottom({scrollOffset:i,height:s});return{isStuckToBottom:a,scrollOffset:i}})}resetMouseState(){this.setState({mouseDownIndex:null,isDragging:!1})}scrollToBottom(){var{itemCount:e}=this.props;this.list.current&&this.list.current.scrollToItem(e)}scrollIntoView(e){this.list.current&&this.list.current.scrollToItem(e)}toggleSelect(e,t,i){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,{isMultiSelect:o}=this.props,{selectedRanges:s}=this.state;if(o&&t&&s.length>0){var a=s[s.length-1];this.selectRange([Math.min(a[0],e),Math.max(e,a[1])])}else o&&s.length===1&&s[0][0]===e&&s[0][1]===e?r&&this.deselectItem(e):o&&i?this.getItemSelected(e,s)?r&&this.deselectItem(e):this.selectItem(e):(this.deselectAll(),this.selectItem(e))}deselectAll(){var{itemCount:e}=this.props;this.deselectRange([0,e])}deselectItem(e){this.deselectRange([e,e])}deselectRange(e){qe.validateRange(e),this.setState(t=>{var{selectedRanges:i}=t;return{selectedRanges:qe.deselectRange(i,e)}})}selectItem(e){var{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){qe.validateRange(e),this.setState(t=>{var{selectedRanges:i}=t;return{selectedRanges:qe.selectRange(i,e)}})}setSelectedRanges(e){this.setState({selectedRanges:e})}sendViewportUpdate(){var{scrollOffset:e,height:t}=this.state;if(e!=null&&t!=null){var{onViewportChange:i,rowHeight:r}=this.props,o=Math.floor(e/r),s=o+Math.ceil(t/r);i(o,s)}}isListAtBottom(){var{scrollOffset:e,height:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.state;if(t==null||e==null)return!1;var{itemCount:i,rowHeight:r}=this.props;return e+t>=i*r}renderInnerElement(e){var{index:t,style:i}=e,{items:r,offset:o,renderItem:s,disableSelect:a}=this.props,{focusIndex:l,selectedRanges:u}=this.state;if(t<o||t>=o+r.length)return null;var h=r[t-o];return this.getCachedItem(t,t,h,t===l&&!a,this.getItemSelected(t,u),s,i,a)}render(){var{items:e,itemCount:t,overscanCount:i,renderItem:r,rowHeight:o,"data-testid":s}=this.props,{selectedRanges:a,isStuckToBottom:l}=this.state;return d.jsx(il,{className:"item-list-auto-sizer",onResize:this.handleResize,children:u=>{var{width:h,height:m}=u;return d.jsx(rl,{className:"item-list-scroll-pane",height:m,width:h,initialScrollOffset:l?t*o:0,itemCount:t,itemSize:o,itemData:this.getItemData(e,a,r),onScroll:this.handleScroll,onItemsRendered:this.handleItemsRendered,ref:this.list,outerElementType:this.getOuterElement(this.handleKeyDown),outerRef:this.listContainer,innerElementType:this.getInnerElement(),overscanCount:i,"data-testid":s,children:this.renderInnerElement})}})}}Ke(Le,"CACHE_SIZE",1e3);Ke(Le,"DEFAULT_ROW_HEIGHT",20);Ke(Le,"DEFAULT_OVERSCAN",10);Ke(Le,"defaultProps",{offset:0,items:[],rowHeight:Le.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:Le.DEFAULT_OVERSCAN,renderItem:Le.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0});var Ld=L.module("ErrorBoundary");class Rd extends c.Component{static getDerivedStateFromError(e){return{error:e}}constructor(e){super(e),this.state={error:void 0}}componentDidCatch(e,t){var{onError:i}=this.props;Ld.error("Error caught by ErrorBoundary",e,t),i==null||i(e,t)}render(){var{children:e,className:t,fallback:i}=this.props,{error:r}=this.state;return r!=null?i??d.jsx("div",{className:t,children:d.jsx(wn,{errorMessage:"".concat(r),isLoading:!1,isLoaded:!1})}):e}}function Fd(n){var{on:e,id:t,className:i,isInvalid:r,disabled:o=!1,onClick:s,"data-testid":a}=n;return d.jsx("button",{type:"button",className:$("btn","btn-switch",i,{active:e},{"is-invalid":r}),id:t,onClick:s,disabled:o,"data-testid":a,children:d.jsx("div",{className:"handle"})})}var Hd=["children","className","isInvalid","onChange","data-testid"];function Er(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Pr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Er(Object(t),!0).forEach(function(i){$d(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Er(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function $d(n,e,t){return(e=Ud(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ud(n){var e=Bd(n,"string");return typeof e=="symbol"?e:e+""}function Bd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Kd(n,e){if(n==null)return{};var t,i,r=Wd(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(i=0;i<o.length;i++)t=o[i],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(r[t]=n[t])}return r}function Wd(n,e){if(n==null)return{};var t={};for(var i in n)if({}.hasOwnProperty.call(n,i)){if(e.indexOf(i)!==-1)continue;t[i]=n[i]}return t}var hs=I.forwardRef((n,e)=>{var{children:t,className:i,isInvalid:r,onChange:o,"data-testid":s}=n,a=Kd(n,Hd),l=ns(e),u=c.useCallback(h=>{o(h.target.value)},[o]);return d.jsx("select",Pr(Pr({ref:l,className:$("custom-select",i,{"is-invalid":r}),onChange:u,"data-testid":s},a),{},{children:t}))});hs.displayName="Select";function zd(){return En(Ma,"No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?")}function cs(n){return typeof n=="object"&&n!=null&&typeof n.type=="string"&&n.name!=null}function ms(n){return typeof n=="object"&&n!=null&&typeof n.type=="string"&&n.id!=null}function Gv(n){return cs(n)||ms(n)}var Vd=c.createContext(null);function qv(n){if(ms(n))return{id:n.id,type:n.type};if(cs(n)){var e;return{name:(e=n.name)!==null&&e!==void 0?e:"",type:n.type}}throw new Error("Invalid descriptor: ".concat(n))}function Gd(n){var e,t;return{type:(e=n.type)!==null&&e!==void 0?e:"",name:(t=n.title)!==null&&t!==void 0?t:n.name,id:n.id}}function Zv(){return En(Vd,"No ObjectFetcher available in useObjectFetcher. Was code wrapped in ObjectFetcherContext.Provider?")}function Tr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function qd(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Tr(Object(t),!0).forEach(function(i){Zd(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Tr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Zd(n,e,t){return(e=Xd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Xd(n){var e=Yd(n,"string");return typeof e=="symbol"?e:e+""}function Yd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Qd=Object.freeze({}),Jd=new Map,Xv=n=>n.api,Yv=n=>n.user,ps=n=>n.storage,vs=n=>ps(n).commandHistoryStorage,eu=n=>ps(n).fileStorage,tu=n=>n.defaultWorkspaceSettings,fs=n=>{var{workspace:e}=n;return e},gs=ol(n=>{for(var e,t,i=(e=(t=fs(n))===null||t===void 0?void 0:t.data.settings)!==null&&e!==void 0?e:{},r=qd({},tu(n)),o=Object.keys(i),s=0;s<o.length;s+=1){var a=o[s];i[a]!==void 0&&(r[a]=i[a])}return r}),nu=n=>gs(n).timeZone,Qv=n=>{var e;return(e=gs(n).defaultNotebookSettings)!==null&&e!==void 0?e:Qd},Jv=n=>n.activeTool,iu=n=>{var e;return(e=n.plugins)!==null&&e!==void 0?e:Jd},ru="SET_ACTIVE_TOOL",ou="SET_API",ef="SET_COMMAND_HISTORY_STORAGE",tf="SET_FILE_STORAGE",nf="SET_PLUGINS",su="SET_USER",au="SET_WORKSPACE",lu="SET_DEFAULT_WORKSPACE_SETTINGS",rf="SET_WORKSPACE_STORAGE",du="SET_SERVER_CONFIG_VALUES";function Or(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function It(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Or(Object(t),!0).forEach(function(i){uu(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Or(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function uu(n,e,t){return(e=hu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function hu(n){var e=cu(n,"string");return typeof e=="symbol"?e:e+""}function cu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var of=n=>({type:su,payload:n}),sf=n=>({type:ou,payload:n}),bs=n=>({type:au,payload:n}),af=n=>({type:lu,payload:n}),mu=n=>(e,t)=>{e(bs(n));var{storage:i}=t(),{workspaceStorage:r}=i;return r==null?void 0:r.save(n)},pu=n=>(e,t)=>{var{workspace:i}=t(),{data:r}=i??{},o=It(It({},i),{},{data:It(It(It({},r),n),{},{settings:It(It({},r==null?void 0:r.settings),n.settings)})});return e(mu(o))},lf=n=>e=>e(pu({settings:n})),df=n=>({type:ru,payload:n}),uf=n=>({type:du,payload:n});function xr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Ir(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xr(Object(t),!0).forEach(function(i){vu(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):xr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function vu(n,e,t){return(e=fu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function fu(n){var e=gu(n,"string");return typeof e=="symbol"?e:e+""}function gu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function bu(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,r=arguments.length>1?arguments[1]:void 0;switch(r.type){case n:{var{id:o,payload:s}=r;return t&&_i({payload:s},{payload:i[o]})?i:Ir(Ir({},i),{},{[o]:s})}default:return i}}}function Mr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Dr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Mr(Object(t),!0).forEach(function(i){Oi(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Mr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Oi(n,e,t){return(e=yu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yu(n){var e=Cu(n,"string");return typeof e=="symbol"?e:e+""}function Cu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class wu{constructor(){Oi(this,"reducers",{}),Oi(this,"listener",null)}register(e,t){var i;this.reducers=Dr(Dr({},this.reducers),{},{[e]:t}),(i=this.listener)===null||i===void 0||i.call(this,this.reducers)}setListener(e){this.listener=e}}var Su=new wu;function Bi(n,e,t){return(e=_u(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _u(n){var e=Eu(n,"string");return typeof e=="symbol"?e:e+""}function Eu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Re{static isValid(e,t){return!0}static isSameFormat(e,t){throw new Error("isSameFormat not implemented")}static makeFormat(e,t,i){return{label:e,formatString:t,type:i}}format(e,t){return""}}Bi(Re,"TYPE_GLOBAL","type-global");Bi(Re,"TYPE_CONTEXT_PRESET","type-context-preset");Bi(Re,"TYPE_CONTEXT_CUSTOM","type-context-custom");function yt(n,e,t){return(e=Pu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Pu(n){var e=Tu(n,"string");return typeof e=="symbol"?e:e+""}function Tu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var jr=L.module("DateTimeColumnFormatter");class dt extends Re{static isValid(e,t){if(t.formatString==null)return!1;try{return e.i18n.DateTimeFormat.format(t.formatString,new Date),!0}catch{return!1}}static makeFormat(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Re.TYPE_CONTEXT_PRESET;return{label:e,formatString:t,type:i}}static isSameFormat(e,t){return e===t||e!==null&&t!==null&&e.type===t.type&&e.formatString===t.formatString}static makeGlobalFormatStringMap(e,t){var i=t?"'T'":" ",r=e?" z":"";return new Map([["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(i,"HH:mm:ss").concat(r)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(i,"HH:mm:ss.SSS").concat(r)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(i,"HH:mm:ss.SSSSSSSSS").concat(r)]])}static getGlobalFormats(e,t){var i=dt.makeGlobalFormatStringMap(e,t);return[...i.keys()]}static makeFormatStringMap(e,t){var i=t!==void 0&&t?"'T'":" ",r=e!==void 0&&e?" z":"";return new Map([["yyyy-MM-dd","yyyy-MM-dd".concat(r)],["MM-dd-yyyy","MM-dd-yyyy".concat(r)],["HH:mm:ss","HH:mm:ss".concat(r)],["HH:mm:ss.SSS","HH:mm:ss.SSS".concat(r)],["HH:mm:ss.SSSSSSSSS","HH:mm:ss.SSSSSSSSS".concat(r)],["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(i,"HH:mm:ss").concat(r)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(i,"HH:mm:ss.SSS").concat(r)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(i,"HH:mm:ss.SSSSSSSSS").concat(r)]])}static getFormats(e,t){var i=dt.makeFormatStringMap(e,t);return[...i.keys()]}constructor(e){var{timeZone:t="",showTimeZone:i=!0,showTSeparator:r=!1,defaultDateTimeFormatString:o=dt.DEFAULT_DATETIME_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),yt(this,"dh",void 0),yt(this,"dhTimeZone",void 0),yt(this,"defaultDateTimeFormatString",void 0),yt(this,"showTimeZone",void 0),yt(this,"showTSeparator",void 0),yt(this,"formatStringMap",void 0);var s=t||dt.DEFAULT_TIME_ZONE_ID;try{this.dhTimeZone=e.i18n.TimeZone.getTimeZone(s)}catch{jr.error("Unsupported time zone id",s),this.dhTimeZone=e.i18n.TimeZone.getTimeZone(dt.DEFAULT_TIME_ZONE_ID)}this.dh=e,this.defaultDateTimeFormatString=o,this.showTimeZone=i,this.showTSeparator=r,this.formatStringMap=dt.makeFormatStringMap(i,r)}getEffectiveFormatString(e){var t;return(t=this.formatStringMap.get(e))!==null&&t!==void 0?t:e}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultDateTimeFormatString,r=this.getEffectiveFormatString(i);try{return this.dh.i18n.DateTimeFormat.format(r,e,this.dhTimeZone)}catch{jr.error("Invalid format arguments")}return""}}yt(dt,"DEFAULT_DATETIME_FORMAT_STRING","yyyy-MM-dd HH:mm:ss.SSS");yt(dt,"DEFAULT_TIME_ZONE_ID","America/New_York");function Qe(n,e,t){return(e=Ou(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ou(n){var e=xu(n,"string");return typeof e=="symbol"?e:e+""}function xu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Iu=L.module("DecimalColumnFormatter");class ue extends Re{static isValid(e,t){if(t.formatString==null)return!1;try{return e.i18n.NumberFormat.format(t.formatString,0),!0}catch{return!1}}static makeFormat(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Re.TYPE_CONTEXT_PRESET,r=arguments.length>3?arguments[3]:void 0;return{label:e,type:i,formatString:t,multiplier:r}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0;return ue.makeFormat(e,t,Re.TYPE_CONTEXT_PRESET,i)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return ue.makeFormat("Custom Format",e,Re.TYPE_CONTEXT_CUSTOM,t)}static isSameFormat(e,t){return e===t||e!=null&&t!=null&&e.type===t.type&&e.formatString===t.formatString&&e.multiplier===t.multiplier}constructor(e){var{defaultFormatString:t=ue.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Qe(this,"defaultFormatString",void 0),Qe(this,"dh",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,r=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return this.dh.i18n.NumberFormat.format(i,r)}catch{Iu.error("Invalid format arguments")}return""}}Qe(ue,"DEFAULT_FORMAT_STRING","###,##0.0000");Qe(ue,"FORMAT_PERCENT",ue.makePresetFormat("Percent","##0.00%"));Qe(ue,"FORMAT_BASIS_POINTS",ue.makePresetFormat("Basis Points","###,##0 bp",1e4));Qe(ue,"FORMAT_THOUSANDS",ue.makePresetFormat("Thousands","##0.000 k",.001));Qe(ue,"FORMAT_MILLIONS",ue.makePresetFormat("Millions","###,##0.000 mm",1e-6));Qe(ue,"FORMAT_SCIENTIFIC_NOTATION",ue.makePresetFormat("Scientific Notation","0.0000E0"));Qe(ue,"FORMAT_ROUND",ue.makePresetFormat("Round","###,##0"));Qe(ue,"FORMAT_ROUND_TWO_DECIMALS",ue.makePresetFormat("0.00","###,##0.00"));Qe(ue,"FORMAT_ROUND_FOUR_DECIMALS",ue.makePresetFormat("0.0000","###,##0.0000"));function Qt(n,e,t){return(e=Mu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Mu(n){var e=Du(n,"string");return typeof e=="symbol"?e:e+""}function Du(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ju=L.module("IntegerColumnFormatter");class Xe extends Re{static isValid(e,t){if(t.formatString==null)return!1;try{return e.i18n.NumberFormat.format(t.formatString,0),!0}catch{return!1}}static makeFormat(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Re.TYPE_CONTEXT_PRESET,r=arguments.length>3?arguments[3]:void 0;return{label:e,type:i,formatString:t,multiplier:r}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0;return Xe.makeFormat(e,t,Re.TYPE_CONTEXT_PRESET,i)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return Xe.makeFormat("Custom Format",e,Re.TYPE_CONTEXT_CUSTOM,t)}static isSameFormat(e,t){return e===t||e!=null&&t!=null&&e.type===t.type&&e.formatString===t.formatString&&e.multiplier===t.multiplier}constructor(e){var{defaultFormatString:t=Xe.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Qt(this,"dh",void 0),Qt(this,"defaultFormatString",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,r=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return this.dh.i18n.NumberFormat.format(i,r)}catch{ju.error("Invalid format arguments")}return""}}Qt(Xe,"DEFAULT_FORMAT_STRING","###,##0");Qt(Xe,"FORMAT_THOUSANDS",Xe.makePresetFormat("Thousands","##0.000 k",.001));Qt(Xe,"FORMAT_MILLIONS",Xe.makePresetFormat("Millions","###,##0.000 mm",1e-6));Qt(Xe,"FORMAT_SCIENTIFIC_NOTATION",Xe.makePresetFormat("Scientific Notation","0.0000E0"));var ku=c.createContext(null),Tn=Object.freeze({AUTH_PLUGIN:"AuthPlugin",DASHBOARD_PLUGIN:"DashboardPlugin",WIDGET_PLUGIN:"WidgetPlugin",TABLE_PLUGIN:"TablePlugin",THEME_PLUGIN:"ThemePlugin"});function Nu(n){return"DashboardPlugin"in n}function Au(n){return"AuthPlugin"in n}function Lu(n){return"TablePlugin"in n}function hf(n){return Nu(n)||Au(n)||Lu(n)}function Ru(n){return"type"in n&&n.type===Tn.DASHBOARD_PLUGIN}function Ki(n){return"type"in n&&n.type===Tn.WIDGET_PLUGIN}function Fu(n){return"type"in n&&n.type===Tn.TABLE_PLUGIN}function Hu(n){return"type"in n&&n.type===Tn.AUTH_PLUGIN}function ys(n){return"type"in n&&n.type===Tn.THEME_PLUGIN}function cf(n){return Ru(n)||Hu(n)||Fu(n)||ys(n)||Ki(n)}var $u=L.module("@deephaven/plugin.PluginUtils");function kr(n,e){return n==null||!Ki(n)?!1:[n.supportedTypes].flat().some(t=>t===e)}function Uu(n){var e=d.jsx(re,{icon:Bo});if(!Ki(n))return e;var{icon:t}=n;return t==null?e:c.isValidElement(t)?t:d.jsx(re,{icon:t})}function mf(n){var e=[...n.entries()].filter(t=>ys(t[1]));return $u.debug("Getting theme data from plugins",e),e.map(t=>{var[i,r]=t,o=Array.isArray(r.themes)?r.themes:[r.themes];return o.map(s=>{var{name:a,baseTheme:l,styleContent:u}=s;return{baseThemeKey:"default-".concat(l??"dark"),themeKey:Da(i,a),name:a,styleContent:u}})}).flat()}function pf(){return En(ku,"No Plugins available in usePlugins. This can happen when plugins have not finished loading or if code is not wrapped in PluginsContext.Provider.")}const Bu="var(--dh-color-chart-colorway)",Ku="var(--dh-color-chart-grid)",Wu="var(--dh-color-chart-axis-line)",zu="var(--dh-color-chart-axis-line-zero)",Nr={"paper-bgcolor":"var(--dh-color-chart-bg)","plot-bgcolor":"var(--dh-color-chart-plot-bg)","title-color":"var(--dh-color-chart-title)","legend-color":"var(--dh-color-chart-legend-fg)",colorway:Bu,gridcolor:Ku,linecolor:Wu,zerolinecolor:zu,"error-band-line-color":"var(--dh-color-chart-error-band-line)","ohlc-increasing":"var(--dh-color-chart-ohlc-increase)","ohlc-decreasing":"var(--dh-color-chart-ohlc-decrease)","coastline-color":"var(--dh-color-chart-geo-coastline)","land-color":"var(--dh-color-chart-geo-land)","ocean-color":"var(--dh-color-chart-geo-ocean)","lake-color":"var(--dh-color-chart-geo-lake)","river-color":"var(--dh-color-chart-geo-river)","indicator-increasing":"var(--dh-color-chart-indicator-increase)","indicator-decreasing":"var(--dh-color-chart-indicator-decrease)","indicator-gauge":"var(--dh-color-chart-indicator-gauge)"};var Ar=L.module("ChartTheme");function Vu(){var n,e=Ko(Nr);return e.colorway=ja((n=e.colorway)!==null&&n!==void 0?n:"").map(t=>{var[i,r]=t;return ka.normalizeCssColor(e.colorway.substring(i,r+1))}).join(" "),Ar.debug2("Chart theme:",Nr),Ar.debug2("Chart theme derived:",e),Object.freeze({paper_bgcolor:e["paper-bgcolor"],plot_bgcolor:e["plot-bgcolor"],title_color:e["title-color"],legend_color:e["legend-color"],colorway:e.colorway,gridcolor:e.gridcolor,linecolor:e.linecolor,zerolinecolor:e.zerolinecolor,error_band_line_color:e["error-band-line-color"],ohlc_increasing:e["ohlc-increasing"],ohlc_decreasing:e["ohlc-decreasing"],coastline_color:e["coastline-color"],land_color:e["land-color"],ocean_color:e["ocean-color"],lake_color:e["lake-color"],river_color:e["river-color"],indicator_increasing:e["indicator-increasing"],indicator_decreasing:e["indicator-decreasing"],indicator_gauge:e["indicator-gauge"]})}function Lr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Gu(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Lr(Object(t),!0).forEach(function(i){qu(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Lr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function qu(n,e,t){return(e=Zu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Zu(n){var e=Xu(n,"string");return typeof e=="symbol"?e:e+""}function Xu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Yu=c.lazy(()=>sl(()=>import("./Plot-9MEtok1o.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url));function Qu(n){return d.jsx(c.Suspense,{fallback:d.jsx(wn,{}),children:d.jsx(Yu,Gu({},n))})}var Cs=c.createContext(null);function vf(n){var{children:e}=n,{activeThemes:t}=rs(),i=c.useMemo(Vu,[t]);return d.jsx(Cs.Provider,{value:i,children:e})}function Ju(){return En(Cs,"No ChartThemeContext value found.")}function eh(n){var{type:e}=n,t=zd();switch(e){case t.VariableType.TABLE:case t.VariableType.TABLEMAP:case t.VariableType.TREETABLE:case t.VariableType.HIERARCHICALTABLE:case t.VariableType.PARTITIONEDTABLE:return d.jsx(re,{icon:zo});case t.VariableType.FIGURE:return d.jsx(re,{icon:Wo});case t.VariableType.PANDAS:return d.jsx(re,{icon:Na});default:return d.jsx(re,{icon:Bo})}}function Rr(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(u){return void t(u)}a.done?e(l):Promise.resolve(l).then(i,r)}function th(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){Rr(o,i,r,s,a,"next",l)}function a(l){Rr(o,i,r,s,a,"throw",l)}s(void 0)})}}function ws(n){var{children:e,language:t}=n,[i,r]=c.useState(null),{activeThemes:o}=rs();return c.useEffect(()=>{var s=!1;function a(){return l.apply(this,arguments)}function l(){return l=th(function*(){if(e!=null&&o!=null){var u=yield lt.colorize(e.toString(),t,{});s||r(u)}}),l.apply(this,arguments)}return a(),()=>{s=!0}},[o,e,t]),d.jsx("div",{style:{pointerEvents:"none"},dangerouslySetInnerHTML:i!=null?{__html:i}:void 0})}class Ss{static get LANGUAGE_MAP(){return new Map([["python","Python"],["groovy","Groovy"],["scala","Scala"]])}}class Jt{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)?[]:al.parse(e).filter(t=>!this.hasComment(t)).map(t=>this.hasPattern(t)?t.pattern:this.hasOp(t)?t.op:"".concat(t))}static formatTimestamp(e){if(e==null||!(e instanceof Date))return null;var t="".concat(e.getHours()).padStart(2,"0"),i="".concat(e.getMinutes()).padStart(2,"0"),r="".concat(e.getSeconds()).padStart(2,"0"),o="".concat(e.getMilliseconds()).padStart(3,"0");return"".concat(t,":").concat(i,":").concat(r,".").concat(o)}static isTableType(e,t){return t===e.VariableType.TABLE||t===e.VariableType.TREETABLE||t===e.VariableType.HIERARCHICALTABLE||t===e.VariableType.PARTITIONEDTABLE}static isWidgetType(e,t){return t===e.VariableType.FIGURE||t===e.VariableType.OTHERWIDGET||t===e.VariableType.PANDAS}static isOpenableType(e,t){return Jt.isTableType(e,t)||Jt.isWidgetType(e,t)}static isFigureType(e,t){return t===e.VariableType.FIGURE}static isPandas(e,t){return t===e.VariableType.PANDAS}}function _s(n){var{children:e}=n;return d.jsxs("div",{className:"console-history-item-result",children:[d.jsx("div",{className:"console-history-gutter",children:"-"}),d.jsx("div",{className:"console-history-content",children:e})]})}_s.propTypes={children:b.node.isRequired};function xi(n,e,t){return(e=nh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nh(n){var e=ih(n,"string");return typeof e=="symbol"?e:e+""}function ih(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Es extends c.Component{constructor(e){super(e),xi(this,"timer",void 0),xi(this,"startTime",void 0),this.updateElapsed=this.updateElapsed.bind(this),this.startTime=Date.now(),this.state={elapsed:0}}componentDidMount(){this.timer=window.setInterval(this.updateElapsed,1e3)}componentWillUnmount(){this.timer!=null&&clearInterval(this.timer),this.timer=void 0}updateElapsed(){this.setState({elapsed:Math.round((Date.now()-this.startTime)/1e3)})}render(){var{disabled:e,onCancelClick:t}=this.props,{elapsed:i}=this.state;return d.jsx("div",{className:$("console-history-result-in-progress",{disabled:e}),children:d.jsxs("span",{className:"badge",children:[d.jsx(Vo,{className:"ml-2"}),"Running... ",on.formatElapsedTime(i)," ",d.jsx(X,{className:"console-history-result-in-progress-cancel",kind:"ghost",icon:Aa,tooltip:"Cancel",onClick:t,disabled:e})]})})}}xi(Es,"defaultProps",{disabled:!1});function bn(n,e,t){return(e=rh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rh(n){var e=oh(n,"string");return typeof e=="symbol"?e:e+""}function oh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class en extends c.PureComponent{constructor(e){super(e),bn(this,"mouseX",void 0),bn(this,"mouseY",void 0),bn(this,"isClicking",void 0),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(e){switch(e.key){case"Enter":case" ":this.handleToggleError(),e.stopPropagation(),e.preventDefault();break}}handleMouseDown(e){this.mouseX=e.clientX,this.mouseY=e.clientY,this.isClicking=!0}handleMouseMove(e){this.mouseX!=null&&this.mouseY!=null?(Math.abs(e.clientX-this.mouseX)>=en.mouseDragThreshold||Math.abs(e.clientY-this.mouseY)>=en.mouseDragThreshold)&&(this.isClicking=!1):this.isClicking&&(this.isClicking=!1)}handleMouseUp(e){this.isClicking&&!e.shiftKey&&!e.metaKey&&!e.altKey&&this.handleToggleError(),this.mouseX=null,this.mouseY=null,this.isClicking=!1}handleToggleError(){this.setState(e=>({isExpanded:!e.isExpanded}))}handleMouseEnter(){this.setState({isTriggerHovered:!0})}handleMouseLeave(){this.setState({isTriggerHovered:!1})}render(){var{isExpanded:e,isTriggerHovered:t}=this.state,{message:i}=this.props;H(i);var r=i.trimEnd(),o=r.indexOf(`
|
|
3
3
|
`),s=o>-1,a=r;s&&(a=r.slice(0,o));var l=r.slice(o),u=t?"error-btn-link error-btn-link--active":"error-btn-link";return d.jsxs("div",{className:$("error-message",{expanded:e}),children:[s&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"error-gutter",children:d.jsx("button",{type:"button",onClick:this.handleToggleError,className:u,tabIndex:-1,children:d.jsx(re,{icon:e?hn:La,transform:"left-3"})})}),d.jsxs("div",{className:"error-content",children:[d.jsx("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:a}),e?l:""]})]}),!s&&d.jsx("div",{className:"error-content",children:d.jsx("div",{className:"console-error-text",children:a})})]},"error")}}bn(en,"defaultProps",{message:""});bn(en,"mouseDragThreshold",5);function sh(n,e,t){return(e=ah(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ah(n){var e=lh(n,"string");return typeof e=="symbol"?e:e+""}function lh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Fr=L.module("ConsoleHistoryItem");class Ps extends c.PureComponent{constructor(e){super(e),this.handleCancelClick=this.handleCancelClick.bind(this),this.handleObjectClick=this.handleObjectClick.bind(this)}handleObjectClick(e){Fr.debug("handleObjectClick",e);var{openObject:t}=this.props;t(e)}handleCancelClick(){var{item:e}=this.props;e!=null&&e.cancelResult&&(Fr.debug("Cancelling command: ".concat(e.command)),e.cancelResult())}render(){var{disabled:e,item:t,language:i,iconForType:r}=this.props,{disabledObjects:o,result:s}=t,a=t.command!=null&&t.command!=="",l=null;a&&(l=d.jsxs("div",{className:"console-history-item-command",children:[d.jsx("div",{className:"console-history-gutter",children:">"}),d.jsx("div",{className:"console-history-content",children:d.jsx(ws,{language:i,children:t.command})})]}));var u=[],h=!1;if(s){var{error:m,message:p,changes:v}=s;if(v){var{created:g,updated:f}=v;[...g,...f].forEach(Y=>{h=!0;var{title:x}=Y,z="".concat(x),N=e===void 0||e||(o??[]).indexOf(z)>=0,Q=d.jsx(X,{kind:"primary",onClick:()=>this.handleObjectClick(Y),className:"btn-console-object",disabled:N,icon:r(Y.type),children:x},z);u.push(Q)})}if(m!=null&&!a){var y,_="".concat((y=m.message)!==null&&y!==void 0?y:m);_||(_=m);var S=d.jsx(en,{message:_},"result-error");u.push(S)}if(p!==void 0&&p!==""){var C=d.jsx("div",{className:"log-message",children:p},"log-message");u.push(C)}}else{h=!0;var M=d.jsx(Es,{onCancelClick:this.handleCancelClick,disabled:e},"in_progress");u.push(M)}var K=null;return u.length>0&&(K=d.jsx(_s,{children:u})),d.jsxs("div",{className:$("console-command-result",{"console-result-buttons":h}),children:[l,K]})}}sh(Ps,"defaultProps",{disabled:!1});function dh(n,e){return"".concat(n,".").concat(e.command,".").concat(e.result&&e.result.message,".").concat(e.result&&e.result.error)}var uh=I.forwardRef(function(e,t){for(var{disabled:i=!1,items:r,language:o,openObject:s,supportsType:a,iconForType:l}=e,u=[],h=0;h<r.length;h+=1){var m=r[h],p=d.jsx(Ps,{disabled:i,item:m,openObject:s,language:o,supportsType:a,iconForType:l},dh(h,m));u.push(p)}return d.jsx("div",{ref:t,className:"container-fluid console-history",children:u})}),hh={name:"Console",CLEAR:ae.createAndAdd({id:"CONSOLE.CLEAR",name:"Clear",shortcut:[O.CTRL,w.L],macShortcut:[O.CTRL,w.C]}),FOCUS_HISTORY:ae.createAndAdd({id:"CONSOLE.FOCUS_HISTORY",name:"Focus History",shortcut:[O.CTRL,w.H],macShortcut:[O.CTRL,O.OPTION,w.H]})},ch={name:"Command History",FOCUS_HISTORY:ae.createAndAdd({id:"COMMAND_HISTORY.FOCUS_HISTORY",name:"Focus History Search",shortcut:[O.CTRL,w.H],macShortcut:[O.CTRL,O.OPTION,w.H]}),SEND_TO_CONSOLE:ae.createAndAdd({id:"COMMAND_HISTORY.SEND_TO_CONSOLE",name:"Send to Console",shortcut:[w.ENTER],macShortcut:[w.ENTER]}),SEND_TO_NOTEBOOK:ae.createAndAdd({id:"COMMAND_HISTORY.SEND_TO_NOTEBOOK",name:"Send to Notebook",shortcut:[O.CTRL,w.ENTER],macShortcut:[O.CMD,w.ENTER]}),RUN:ae.createAndAdd({id:"COMMAND_HISTORY.RUN",name:"Run",shortcut:[O.ALT,w.R],macShortcut:[O.OPTION,w.R]})},mh={name:"Notebook",RUN:ae.createAndAdd({id:"NOTEBOOK.RUN",name:"Run",shortcut:[O.ALT,w.R],macShortcut:[O.OPTION,w.R]}),RUN_SELECTED:ae.createAndAdd({id:"NOTEBOOK.RUN_SELECTED",name:"Run Selected",shortcut:[O.ALT,O.SHIFT,w.R],macShortcut:[O.OPTION,O.SHIFT,w.R]}),FIND:ae.createAndAdd({id:"NOTEBOOK.FIND",name:"Find",shortcut:[O.CTRL,w.F],macShortcut:[O.CMD,w.F],isEditable:!1}),MINIMAP:ae.createAndAdd({id:"NOTEBOOK.MINIMAP",name:"Show Minimap",shortcut:[O.ALT,w.M],macShortcut:[O.OPTION,w.M]}),WORDWRAP:ae.createAndAdd({id:"NOTEBOOK.WORDWRAP",name:"Word Wrap",shortcut:[O.ALT,w.Z],macShortcut:[O.OPTION,w.Z]})},Yt={CONSOLE:hh,COMMAND_HISTORY:ch,NOTEBOOK:mh};const fe=Object.freeze({FATAL:"FATAL",STDERR:"STDERR",ERROR:"ERROR",WARN:"WARN",STDOUT:"STDOUT",INFO:"INFO",DEBUG:"DEBUG",TRACE:"TRACE"}),ph="var(--dh-color-editor-bg)",vh="var(--dh-color-editor-fg)",fh="var(--dh-color-editor-string)",gh="var(--dh-color-editor-delimiter)",bh="var(--dh-color-editor-predefined)",yh="var(--dh-color-editor-keyword)",Ch="var(--dh-color-editor-storage)",wh="var(--dh-color-editor-number)",Sh="var(--dh-color-editor-operator)",_h="var(--dh-color-editor-identifier)",Eh="var(--dh-color-editor-comment)",Ii={"error-foreground":"var(--dh-color-editor-error-fg)",background:ph,foreground:vh,"line-height":"19px",string:fh,"string-delim":"var(--dh-color-editor-string-delim)",delimiter:gh,predefined:bh,keyword:yh,storage:Ch,number:wh,operator:Sh,identifier:_h,"namespace-identifier":"var(--dh-color-editor-identifier-namespace)","identifier-js":"var(--dh-color-editor-identifier-js)",comment:Eh,"editor-bracket-foreground1":"var(--dh-color-editor-bracket-fg1)","editor-bracket-foreground2":"var(--dh-color-editor-bracket-fg2)","editor-bracket-foreground3":"var(--dh-color-editor-bracket-fg3)","editor-bracket-foreground4":"var(--dh-color-editor-bracket-fg4)","editor-bracket-foreground5":"var(--dh-color-editor-bracket-fg5)","editor-bracket-foreground6":"var(--dh-color-editor-bracket-fg6)","editor-unexpected-bracket-foreground":"var(--dh-color-editor-unexpected-bracket-fg)","input-option-active-border":"var(--dh-color-editor-input-option-active-border)","focus-border":"var(--dh-color-editor-focus-border)","input-background":"var(--dh-color-editor-input-bg)","input-foreground":"var(--dh-color-editor-input-fg)","input-border":"var(--dh-color-editor-input-border)","editor-line-number-foreground":"var(--dh-color-editor-line-number-fg)","editor-line-number-active-foreground":"var(--dh-color-editor-line-number-active-fg)","editor-selection-background":"var(--dh-color-editor-selection-bg)","editor-inactive-selection-background":"var(--dh-color-editor-inactive-selection-bg)","editor-selection-highlight-background":"var(--dh-color-editor-selection-highlight-bg)","editor-line-highlight-background":"var(--dh-color-editor-line-highlight-bg)","editor-word-highlight-background":"var(--dh-color-editor-word-highlight-bg)","context-menu-background":"var(--dh-color-editor-context-menu-bg)","context-menu-foreground":"var(--dh-color-editor-context-menu-fg)","menu-selection-background":"var(--dh-color-editor-menu-selection-bg)","menu-selection-foreground":"var(--dh-color-editor-menu-selection-fg)","log-date":"var(--dh-color-editor-log-date)","log-error":"var(--dh-color-editor-log-error)","log-info":"var(--dh-color-editor-log-info)","log-stdout":"var(--dh-color-editor-log-stdout)","log-warn":"var(--dh-color-editor-log-warn)","log-debug":"var(--dh-color-editor-log-debug)","log-trace":"var(--dh-color-editor-log-trace)","editor-find-match-background":"var(--dh-color-editor-find-match-bg)","editor-find-match-highlight-background":"var(--dh-color-editor-find-match-highlight-bg)","editor-widget-background":"var(--dh-color-editor-find-bg)","input-option-active-background":"var(--dh-color-editor-find-option-active-bg)","input-option-active-foreground":"var(--dh-color-editor-find-option-active-fg)","editor-suggest-widget-background":"var(--dh-color-editor-suggest-bg)","editor-suggest-widget-border":"var(--dh-color-editor-suggest-border)","editor-suggest-widget-foreground":"var(--dh-color-editor-suggest-fg)","editor-suggest-widget-selected-background":"var(--dh-color-editor-suggest-selected-bg)","editor-suggest-widget-selected-foreground":"var(--dh-color-editor-suggest-selected-fg)","editor-suggest-widget-highlightForeground":"var(--dh-color-editor-suggest-highlight-fg)","editor-suggest-widget-focus-highlight-foreground":"var(--dh-color-editor-suggest-focus-highlight-fg)","list-hover-background":"var(--dh-color-editor-suggest-hover-bg)","text-link-foreground":"var(--dh-color-editor-link-foreground)","text-link-active-foreground":"var(--dh-color-editor-link-active-fg)","editor-link-active-foreground":"var(--dh-color-editor-link-active-fg)"};var Ph="python",Th={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/}}},Oh={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"]]}},xh={id:Ph,conf:Th,language:Oh},Ih="groovy",Mh={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/}}},Dh={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"]]}},jh={id:Ih,conf:Mh,language:Dh},kh="scala",Nh={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>))/}}},Ah={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"]]}},Lh={id:kh,conf:Nh,language:Ah},Rh="deephavenDb",Fh={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/}}},Hh={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"]]}},$h={id:Rh,conf:Fh,language:Hh},Uh="log",Bh={},Kh={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"}]]}},Wh={id:Uh,conf:Bh,language:Kh};function Hr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function $r(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Hr(Object(t),!0).forEach(function(i){zh(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Hr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function zh(n,e,t){return(e=Vh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Vh(n){var e=Gh(n,"string");return typeof e=="symbol"?e:e+""}function Gh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var rt=L.module("MonacoUtils");class Ie{static init(){var{getWorker:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};rt.debug("Initializing Monaco..."),e!==void 0&&Ie.registerGetWorker(e);var{initTheme:t,registerLanguages:i}=Ie;t(),i([$h,xh,jh,Wh,Lh]),Ie.removeConflictingKeybindings(),rt.debug("Monaco initialized.")}static initTheme(){var e,t,{removeHashtag:i}=Ie,r=Ko(Ii);rt.debug2("Monaco theme:",Ii),rt.debug2("Monaco theme derived:",r);var o=[{token:"",foreground:i(r.foreground)},{token:"string",foreground:i(r.string)},{token:"string.delim",foreground:i(r["string-delim"])},{token:"keyword",foreground:i(r.keyword)},{token:"identifier.js",foreground:i(r["identifier-js"])},{token:"delimiter",foreground:i(r.delimiter)},{token:"comment",foreground:i(r.comment)},{token:"number",foreground:i(r.number)},{token:"storage",foreground:i(r.storage)},{token:"identifier",foreground:i(r.identifier)},{token:"namespace.identifier",foreground:i(r["namespace-identifier"])},{token:"operator",foreground:i(r.operator)},{token:"predefined",foreground:i(r.predefined)},{token:"error.log",foreground:(e=(t=r["log-error"])===null||t===void 0?void 0:t.substring(1))!==null&&e!==void 0?e:""},{token:"warn.log",foreground:i(r["log-warn"])},{token:"info.log",foreground:i(r["log-info"])},{token:"stdout.log",foreground:i(r["log-stdout"])},{token:"trace.log",foreground:i(r["log-trace"])},{token:"debug.log",foreground:i(r["log-debug"])},{token:"date.log",foreground:i(r["log-date"])}],s={foreground:r.foreground,errorForeground:r["error-foreground"],"inputOption.activeBorder":r["input-option-active-border"],"editor.background":r.background,"editor.foreground":r.foreground,"editor.lineHighlightBackground":r["editor-line-highlight-background"],"editorLineNumber.foreground":r["editor-line-number-foreground"],"editorLineNumber.activeForeground":r["editor-line-number-active-foreground"],"editor.selectionBackground":r["editor-selection-background"],"editor.inactiveSelectionBackground":r["editor-inactive-selection-background"],"editor.selectionHighlightBackground":r["editor-selection-highlight-background"],"editor.wordHighlightBackground":r["editor-word-highlight-background"],"editor.findMatchBackground":r["editor-find-match-background"],"editor.findMatchHighlightBackground":r["editor-find-match-highlight-background"],"editorSuggestWidget.background":r["editor-suggest-widget-background"],"editorSuggestWidget.border":r["editor-suggest-widget-border"],"editorSuggestWidget.foreground":r["editor-suggest-widget-foreground"],"editorSuggestWidget.selectedBackground":r["editor-suggest-widget-selected-background"],"list.activeSelectionBackground":r["editor-suggest-widget-selected-background"],"editorSuggestWidget.selectedForeground":r["editor-suggest-widget-selected-foreground"],"list.activeSelectionForeground":r["editor-suggest-widget-selected-foreground"],"editorSuggestWidget.highlightForeground":r["editor-suggest-widget-highlightForeground"],"editorSuggestWidget.focusHighlightForeground":r["editor-suggest-widget-focus-highlight-foreground"],"list.hoverBackground":r["list-hover-background"],"dropdown.background":r["context-menu-background"],"dropdown.foreground":r["context-menu-foreground"],"menu.selectionBackground":r["menu-selection-background"],"menu.selectionForeground":r["menu-selection-foreground"],"keybindingLabel.foreground":r["menu-selection-foreground"],"list.focusBackground":r["menu-selection-background"],"editorWidget.background":r["editor-widget-background"],"inputOption.activeBackground":r["input-option-active-background"],"inputOption.activeForeground":r["input-option-active-foreground"],focusBorder:r["focus-border"],"input.background":r["input-background"],"input.foreground":r["input-foreground"],"input.border":r["input-border"],"textLink.foreground":r["text-link-foreground"],"textLink.activeForeground":r["text-link-active-foreground"],"editorLink.activeForeground":r["editor-link-active-foreground"],"editorBracketHighlight.foreground1":r["editor-bracket-foreground1"],"editorBracketHighlight.foreground2":r["editor-bracket-foreground2"],"editorBracketHighlight.foreground3":r["editor-bracket-foreground3"],"editorBracketHighlight.foreground4":r["editor-bracket-foreground4"],"editorBracketHighlight.foreground5":r["editor-bracket-foreground5"],"editorBracketHighlight.foreground6":r["editor-bracket-foreground6"],"editorBracketHighlight.unexpectedBracket.foreground":r["editor-unexpected-bracket-foreground"]};lt.defineTheme("dh-dark",{base:"vs-dark",inherit:!0,rules:o,colors:s});try{lt.setTheme("dh-dark")}catch(a){rt.error("Failed to set 'dh-dark' Monaco theme, falling back to vs-dark",a),lt.setTheme("vs-dark")}}static registerGetWorker(e){window.MonacoEnvironment=$r($r({},window.MonacoEnvironment),{},{getWorker:e})}static removeHashtag(e){var t;return(t=e==null?void 0:e.substring(1))!==null&&t!==void 0?t:""}static registerLanguages(e){var t=e.map(i=>{var{id:r}=i;return r});ht.getLanguages().filter(i=>{var{id:r}=i;return t.includes(r)}).forEach(i=>{var r=i;rt.debug2("Overriding default language loader:",r.id)}),e.forEach(i=>{Ie.registerLanguage(i)})}static registerLanguage(e){rt.debug2("Registering language: ",e.id),ht.register(e),ht.onLanguage(e.id,()=>{ht.setLanguageConfiguration(e.id,e.conf),ht.setMonarchTokensProvider(e.id,e.language)})}static setEOL(e){var t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:lt.EndOfLineSequence.LF;(t=e.getModel())===null||t===void 0||t.setEOL(i)}static openDocument(e,t){var i=e.getModel();H(i);var r={textDocument:{uri:"".concat(i.uri),languageId:i.getLanguageId(),version:i.getVersionId(),text:i.getValue()}};rt.debug2("didOpenDocumentParams: ",r),t.openDocument(r);var o=e.onDidChangeModelContent(s=>{for(var{changes:a,versionId:l}=s,u=[],h=0;h<a.length;h+=1){var m=a[h],{range:p,rangeLength:v,text:g}=m,f={range:{start:{line:p.startLineNumber-1,character:p.startColumn-1},end:{line:p.endLineNumber-1,character:p.endColumn-1}},rangeLength:v,text:g};u.push(f)}if(u.length>0){var y={textDocument:{version:l,uri:"".concat(i.uri)},contentChanges:u};rt.debug2("didChangeDocumentParams",y),t.changeDocument(y)}});return o}static closeDocument(e,t){var i=e.getModel();H(i);var r={textDocument:{uri:"".concat(i.uri)}};t.closeDocument(r)}static registerPasteHandler(e){e.onDidPaste(t=>{var i=/“|”/g,r=/\u200b/g,o=/\u00A0/g,s=e.getModel();H(s);var a=s.getValueInRange(t.range);(i.test(a)||r.test(a)||o.test(a))&&s.applyEdits([{range:t.range,text:a.replace(i,'"').replace(r,"").replace(o," ")}])})}static isMacPlatform(){var{platform:e}=window.navigator;return e.startsWith("Mac")}static removeConflictingKeybindings(){lt.addKeybindingRule({keybinding:Be.CtrlCmd|Nt.KeyD,command:null}),Ie.isMacPlatform()||lt.addKeybindingRule({keybinding:Be.CtrlCmd|Nt.KeyH,command:null})}static disableKeyBindings(e,t){e.addAction({id:"disable-keybindings-".concat(Pt()),label:"",keybindings:t,run:()=>{}})}static getMonacoKeyCodeFromShortcut(e){var{keyState:t}=e,{keyValue:i}=t;if(i===null)return 0;var r=Ie.isMacPlatform();return r?(t.metaKey?Be.CtrlCmd:0)|(t.shiftKey?Be.Shift:0)|(t.altKey?Be.Alt:0)|(t.ctrlKey?Be.WinCtrl:0)|nr.fromString(i):(t.ctrlKey?Be.CtrlCmd:0)|(t.shiftKey?Be.Shift:0)|(t.altKey?Be.Alt:0)|(t.metaKey?Be.WinCtrl:0)|nr.fromString(i)}static provideLinks(e){for(var t=[],i=function(s){var a=e.getLineContent(s),l=ll(a),u=l.filter(h=>h.type==="url"?/^https?:\/\//.test(h.value):!0);u.forEach(h=>{t.push({url:h.href,range:new dl(s,h.start+1,s,h.end+1)})})},r=1;r<=e.getLineCount();r+=1)i(r);return{links:t}}}function vi(n,e,t){return(e=qh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qh(n){var e=Zh(n,"string");return typeof e=="symbol"?e:e+""}function Zh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ot=L.module("MonacoCompletionProvider");class jt extends c.PureComponent{static lspToMonacoKind(e){var t=ht.CompletionItemKind;switch(e){case 1:return t.Text;case 2:return t.Method;case 3:return t.Function;case 4:return t.Constructor;case 5:return t.Field;case 6:return t.Variable;case 7:return t.Class;case 8:return t.Interface;case 9:return t.Module;case 10:return t.Property;case 11:return t.Unit;case 12:return t.Value;case 13:return t.Enum;case 14:return t.Keyword;case 15:return t.Snippet;case 16:return t.Color;case 17:return t.File;case 18:return t.Reference;case 19:return t.Folder;case 20:return t.EnumMember;case 21:return t.Constant;case 22:return t.Struct;case 23:return t.Event;case 24:return t.Operator;case 25:return t.TypeParameter;default:return t.Variable}}static lspToMonacoRange(e){var{start:t,end:i}=e;return{startLineNumber:t.line+1,startColumn:t.character+1,endLineNumber:i.line+1,endColumn:i.character+1}}static monacoToLspPosition(e){return{line:e.lineNumber-1,character:e.column-1}}constructor(e){super(e),vi(this,"registeredCompletionProvider",void 0),vi(this,"registeredSignatureProvider",void 0),vi(this,"registeredHoverProvider",void 0),this.handleCompletionRequest=this.handleCompletionRequest.bind(this),this.handleSignatureRequest=this.handleSignatureRequest.bind(this),this.handleHoverRequest=this.handleHoverRequest.bind(this)}componentDidMount(){var{language:e,session:t}=this.props;this.registeredCompletionProvider=ht.registerCompletionItemProvider(e,{provideCompletionItems:this.handleCompletionRequest,triggerCharacters:[".",'"',"'"]}),t.getSignatureHelp!=null&&(this.registeredSignatureProvider=ht.registerSignatureHelpProvider(e,{provideSignatureHelp:this.handleSignatureRequest,signatureHelpTriggerCharacters:["(",","]})),t.getHover!=null&&(this.registeredHoverProvider=ht.registerHoverProvider(e,{provideHover:this.handleHoverRequest}))}componentWillUnmount(){var e,t,i;(e=this.registeredCompletionProvider)===null||e===void 0||e.dispose(),(t=this.registeredSignatureProvider)===null||t===void 0||t.dispose(),(i=this.registeredHoverProvider)===null||i===void 0||i.dispose()}handleCompletionRequest(e,t,i){var{model:r,session:o}=this.props;if(e!==r)return null;var s={textDocument:{uri:"".concat(e.uri),version:e.getVersionId()},position:jt.monacoToLspPosition(t),context:i},a=o.getCompletionItems(s);ot.debug("Requested completion items",s);var l=a.then(u=>{ot.debug("Completion items received: ",s,u);var h=u.map(m=>{var{label:p,kind:v,detail:g,documentation:f,sortText:y,filterText:_,textEdit:S,insertTextFormat:C}=m;return{label:p,kind:jt.lspToMonacoKind(v),detail:g,documentation:(f==null?void 0:f.kind)==="markdown"?f:f==null?void 0:f.value,sortText:y,filterText:_,insertText:S.text,insertTextRules:C===2?4:C,range:jt.lspToMonacoRange(S.range)}});return{incomplete:!0,suggestions:h}}).catch(u=>(ot.error("There was an error retrieving completion items",u),{suggestions:[]}));return l}handleSignatureRequest(e,t,i,r){var o={value:{signatures:[],activeSignature:0,activeParameter:0},dispose:()=>{}},{model:s,session:a}=this.props;if(e!==s||a.getSignatureHelp==null)return null;var l={textDocument:{uri:"".concat(e.uri),version:e.getVersionId()},position:jt.monacoToLspPosition(t),context:r},u=a.getSignatureHelp(l);ot.debug("Requested signature help",l);var h=u.then(m=>{ot.debug("Signatures received: ",l,u);var p=m.map(g=>{var{label:f,documentation:y,parameters:_}=g;return{documentation:(y==null?void 0:y.kind)==="markdown"?y:y==null?void 0:y.value,label:f,parameters:_??[]}});if(p.length===0)return o;var v=0;return{value:{signatures:p,activeSignature:v,activeParameter:m[v].activeParameter},dispose:()=>{}}}).catch(m=>(ot.error("There was an error retrieving completion items",m),o));return h}handleHoverRequest(e,t){var{model:i,session:r}=this.props;if(e!==i||r.getHover==null)return null;var o={textDocument:{uri:"".concat(e.uri),version:e.getVersionId()},position:jt.monacoToLspPosition(t)},s=r.getHover(o);ot.debug("Requested hover",o);var a=s.then(l=>{ot.debug("Hover received: ",o,l);var{contents:u}=l;return{contents:u!=null?[u]:[]}}).catch(l=>(ot.error("There was an error retrieving hover",l),{contents:[]}));return a}render(){return null}}function Ur(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(u){return void t(u)}a.done?e(l):Promise.resolve(l).then(i,r)}function Xh(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){Ur(o,i,r,s,a,"next",l)}function a(l){Ur(o,i,r,s,a,"throw",l)}s(void 0)})}}function Ne(n,e,t){return(e=Yh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Yh(n){var e=Qh(n,"string");return typeof e=="symbol"?e:e+""}function Qh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var fi=L.module("ConsoleInput"),qn=parseInt(Ii["line-height"],10),Ts=6,Os=6,Jh=qn+Ts+Os,gi=100;class tn extends c.PureComponent{constructor(e){super(e),Ne(this,"cancelListener",void 0),Ne(this,"resizeObserver",void 0),Ne(this,"commandContainer",void 0),Ne(this,"commandEditor",void 0),Ne(this,"commandHistoryIndex",void 0),Ne(this,"commandSuggestionContainer",void 0),Ne(this,"loadingPromise",void 0),Ne(this,"timestamp",void 0),Ne(this,"bufferIndex",void 0),Ne(this,"history",void 0),Ne(this,"modifiedCommands",void 0),this.handleResize=this.handleResize.bind(this),this.commandContainer=I.createRef(),this.commandHistoryIndex=null,this.timestamp=Date.now(),this.bufferIndex=0,this.history=[],this.modifiedCommands=new Map,this.resizeObserver=new window.ResizeObserver(this.handleResize),this.state={commandEditorHeight:qn,isFocused:!1,model:null}}componentDidMount(){this.initCommandEditor(),this.loadMoreHistory()}componentDidUpdate(){this.layoutEditor()}componentWillUnmount(){this.resizeObserver.disconnect(),this.loadingPromise!=null&&this.loadingPromise.cancel(),this.destroyCommandEditor()}setConsoleText(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(e){if(fi.debug("Command received: ",e),!i){var r;this.commandHistoryIndex=null,(r=this.commandEditor)===null||r===void 0||r.setValue(e)}t&&this.focusEnd(),this.updateDimensions(),i&&this.processCommand(e)}}initCommandEditor(){var{language:e,session:t}=this.props,i={copyWithSyntaxHighlighting:!1,cursorStyle:"block",fixedOverflowWidgets:!0,folding:!1,fontFamily:"Fira Mono",glyphMargin:!1,language:e,lineHeight:qn,lineDecorationsWidth:3,lineNumbers:"off",minimap:{enabled:!1},renderLineHighlight:"none",scrollBeyondLastLine:!1,scrollbar:{arrowSize:0,horizontal:"hidden",horizontalScrollbarSize:0},padding:{top:Ts,bottom:Os},value:"",wordWrap:"on",autoClosingBrackets:"beforeWhitespace"},r=this.commandContainer.current;H(r),this.commandEditor=lt.create(r,i),Ie.setEOL(this.commandEditor),Ie.openDocument(this.commandEditor,t),this.commandEditor.onDidChangeModelContent(()=>{var o,s=(o=this.commandEditor)===null||o===void 0?void 0:o.getValue();this.modifiedCommands.set(this.commandHistoryIndex,s??null),this.updateDimensions()}),this.commandEditor.onDidFocusEditorText(()=>{this.setState({isFocused:!0})}),this.commandEditor.onDidBlurEditorText(()=>{this.setState({isFocused:!1})}),this.commandEditor.onKeyDown(o=>{var{commandEditor:s,commandHistoryIndex:a}=this,l=s==null?void 0:s.getPosition();H(l);var{lineNumber:u}=l,h=s==null?void 0:s.getModel();if(o.code==="ArrowUp"&&!this.isSuggestionMenuPopulated()&&u===1){a!=null?this.loadCommand(a+1):this.loadCommand(0),this.focusStart(),o.stopPropagation(),o.preventDefault();return}if(o.code==="ArrowDown"&&!this.isSuggestionMenuPopulated()&&u===(h==null?void 0:h.getLineCount())){a!=null&&a>0?this.loadCommand(a-1):this.loadCommand(null),this.focusEnd(),o.stopPropagation(),o.preventDefault();return}if(!o.altKey&&!o.shiftKey&&!o.metaKey&&o.keyCode===Nt.Enter&&!this.isSuggestionMenuPopulated()){var m;o.stopPropagation(),o.preventDefault();var p=(m=this.commandEditor)===null||m===void 0?void 0:m.getValue().trim();if(p!==void 0){var v;this.processCommand(p),(v=this.commandEditor)===null||v===void 0||v.setValue("")}}}),Ie.disableKeyBindings(this.commandEditor,[Be.CtrlCmd|Nt.KeyF]),Ie.registerPasteHandler(this.commandEditor),this.commandEditor.focus(),this.resizeObserver.observe(r),this.updateDimensions(),this.setState({model:this.commandEditor.getModel()})}destroyCommandEditor(){var{session:e}=this.props;this.commandEditor&&(Ie.closeDocument(this.commandEditor,e),this.commandEditor.dispose(),this.commandEditor=void 0)}handleResize(){this.updateDimensions()}isSuggestionMenuActive(){var e;if(!this.commandSuggestionContainer){var t,i;this.commandSuggestionContainer=(t=this.commandEditor)===null||t===void 0||(i=t.getDomNode())===null||i===void 0?void 0:i.querySelector(".suggest-widget")}return(e=this.commandSuggestionContainer&&this.commandSuggestionContainer.classList.contains("visible"))!==null&&e!==void 0?e:!1}isSuggestionMenuPopulated(){var e,t,i;return this.isSuggestionMenuActive()&&((e=(t=this.commandSuggestionContainer)===null||t===void 0||(i=t.querySelector(".monaco-list-rows"))===null||i===void 0?void 0:i.childElementCount)!==null&&e!==void 0?e:0)>0}focus(){var e;(e=this.commandEditor)===null||e===void 0||e.focus()}focusStart(){var e,t,i,r,o,s=(e=this.commandEditor)===null||e===void 0?void 0:e.getModel();H(s);var a=s.getLineLength(1)+1,l=(t=this.commandEditor)===null||t===void 0?void 0:t.getTopForPosition(1,a);H(l),(i=this.commandEditor)===null||i===void 0||i.setPosition({lineNumber:1,column:a}),(r=this.commandEditor)===null||r===void 0||r.setScrollTop(l),(o=this.commandEditor)===null||o===void 0||o.focus()}focusEnd(){var e,t,i,r,o,s=(e=this.commandEditor)===null||e===void 0?void 0:e.getModel();H(s);var a=s.getLineCount(),l=s.getLineLength(a)+1,u=(t=this.commandEditor)===null||t===void 0?void 0:t.getTopForPosition(a,l);H(u),(i=this.commandEditor)===null||i===void 0||i.setPosition({lineNumber:a,column:l}),(r=this.commandEditor)===null||r===void 0||r.setScrollTop(u),(o=this.commandEditor)===null||o===void 0||o.focus()}clear(){var e,t,i;(e=this.commandEditor)===null||e===void 0||e.focus(),(t=this.commandEditor)===null||t===void 0||(i=t.getModel())===null||i===void 0||i.setValue(""),this.commandHistoryIndex=null}layoutEditor(){this.commandEditor&&this.commandEditor.layout()}loadCommand(e){var t,i;if(!(e!==null&&e>=this.history.length)){var r=this.modifiedCommands.get(e),o=e===null?"":this.history[this.history.length-e-1];this.commandHistoryIndex=e,(t=this.commandEditor)===null||t===void 0||(i=t.getModel())===null||i===void 0||i.setValue(r??o),e!==null&&e>this.history.length-gi&&this.loadMoreHistory()}}loadMoreHistory(){var e=this;return Xh(function*(){try{if(e.loadingPromise!=null||e.bufferIndex==null)return;var{commandHistoryStorage:t,language:i,scope:r}=e.props;e.loadingPromise=Fe.makeCancelable(t.getTable(i,r??"",e.timestamp),a=>a.close());var o=yield e.loadingPromise;o.setReversed(!0),o.setViewport({top:e.bufferIndex,bottom:e.bufferIndex+gi-1}),e.loadingPromise=Fe.makeCancelable(o.getViewportData(),()=>o.close());var s=yield e.loadingPromise;e.bufferIndex+=gi,e.bufferIndex>=o.size&&(e.bufferIndex=null),e.history=[...s.items.filter((a,l,u)=>{var{name:h}=a;return l===0||h!==u[l-1].name}).map(a=>{var{name:l}=a;return l}).reverse(),...e.history],e.loadingPromise=void 0,o.close()}catch(a){if(e.loadingPromise=void 0,Fe.isCanceled(a)){fi.debug2("Promise canceled, not loading history");return}fi.error("Error fetching history",a)}})()}processCommand(e){this.commandHistoryIndex=null,this.modifiedCommands.clear(),H(e),e!==""&&(this.history.length===0||e!==this.history[this.history.length-1])&&this.history.push(e),this.updateDimensions();var{onSubmit:t}=this.props;t(e)}updateDimensions(){if(this.commandEditor){var{maxHeight:e}=this.props;H(e);var t=this.commandEditor.getContentHeight(),i=Math.max(Math.min(t,e),Jh),r=t>i,o={overviewRulerLanes:r?void 0:0};this.setState({commandEditorHeight:i},()=>{var s,a;(s=this.commandEditor)===null||s===void 0||s.updateOptions(o),(a=this.commandEditor)===null||a===void 0||a.layout()})}}render(){var{disabled:e,language:t,session:i}=this.props,{commandEditorHeight:r,isFocused:o,model:s}=this.state;return d.jsx("div",{className:$("console-input-wrapper",{disabled:e}),children:d.jsxs("div",{className:$("console-input-inner-wrapper",{focus:o}),children:[d.jsx("div",{className:tn.INPUT_CLASS_NAME,ref:this.commandContainer,style:{height:r}}),s&&d.jsx(jt,{model:s,language:t,session:i})]})})}}Ne(tn,"defaultProps",{maxHeight:qn*10,scope:null,disabled:!1});Ne(tn,"INPUT_CLASS_NAME","console-input");function St(n,e,t){return(e=ec(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ec(n){var e=tc(n,"string");return typeof e=="symbol"?e:e+""}function tc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Br="pasted values",nc=[/^audio.*/,/^font.*/,/^image.*/,/^video.*/],bi=[".csv",".tsv",".tab",".psv",".dsv",".txt"],Kr=[".zip"];class _e extends c.Component{static isValidDropItem(e){return e!=null&&e.kind==="file"&&!nc.find(t=>t.test(e.type))}static isValidExtension(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return bi.some(i=>e.endsWith(i))||t&&Kr.some(i=>e.endsWith(i))}static handleDragOver(e){e.preventDefault(),e.stopPropagation()}static getIcon(e){return e===Br?Ji:e.endsWith(".csv")?Ra:e.endsWith(".zip")?Fa:Ha}constructor(e){super(e),St(this,"fileElem",void 0),St(this,"divElem",void 0),St(this,"getValidExtensions",Tt(t=>t?[...bi,...Kr]:[...bi])),St(this,"getAcceptString",Tt(t=>this.getValidExtensions(t).join(", "))),St(this,"getFileTypeErrorString",Tt(t=>Nl.join(this.getValidExtensions(t),"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=I.createRef(),this.divElem=I.createRef(),this.state={selectedFileName:""}}componentDidMount(){var e,t;(e=this.divElem.current)===null||e===void 0||e.addEventListener("paste",this.handlePasteEvent),(t=this.divElem.current)===null||t===void 0||t.focus()}componentWillUnmount(){var e;(e=this.divElem.current)===null||e===void 0||e.removeEventListener("paste",this.handlePasteEvent)}handleSelectFile(){if(this.fileElem.current){var e;this.fileElem.current.value="",(e=this.fileElem.current)===null||e===void 0||e.click()}}handleFiles(e){e.stopPropagation(),e.preventDefault();var{files:t}=e.target;t!=null&&this.handleFile(t[0])}handleDrop(e){var{allowZip:t,clearDragError:i,dragError:r}=this.props;if(e.preventDefault(),e.stopPropagation(),r!=null){i();return}if(!(e.dataTransfer==null||e.dataTransfer.items==null||e.dataTransfer.items.length===0)){var o=e.dataTransfer.items[0].getAsFile();H(o),_e.isValidExtension(o.name,t)?this.handleFile(o):this.setState({dropError:_e.FILE_TYPE_ERROR})}}unstageFile(e){var{onCancel:t}=this.props;e.stopPropagation(),e.preventDefault(),t(),this.setState({selectedFileName:"",dropError:void 0})}handleFile(e){var{onFileOpened:t}=this.props;t(e),this.setState({selectedFileName:e.name,dropError:void 0})}handleMenuPaste(){var{onPaste:e,onError:t,uploadInProgress:i}=this.props;i||navigator.clipboard.readText().then(r=>{e(r),this.setState({selectedFileName:Br,dropError:void 0})}).catch(r=>t(r))}handlePasteEvent(e){e.stopPropagation(),e.preventDefault(),this.handleMenuPaste()}makeContextMenuItems(){var{uploadInProgress:e}=this.props;return[{title:"Paste",icon:Ji,action:this.handleMenuPaste,shortcut:Gt.PASTE,disabled:e}]}render(){var{allowZip:e,dragError:t,uploadInProgress:i}=this.props,{selectedFileName:r,dropError:o}=this.state,s=t??o,a=this.makeContextMenuItems();return d.jsxs("div",{ref:this.divElem,className:"csv-overlay fill-parent-absolute",onDragOver:_e.handleDragOver,onDrop:this.handleDrop,tabIndex:-1,children:[d.jsx(ie,{actions:a}),d.jsx("input",{ref:this.fileElem,type:"file",id:"fileElem",accept:this.getAcceptString(e),style:{display:"none"},onChange:this.handleFiles,"data-testid":"fileElem"}),!r&&(s===void 0||s==="")&&d.jsxs("div",{className:"message-content",children:[d.jsx("div",{className:"message-icon",children:d.jsx(re,{icon:$a})}),d.jsx("label",{children:"Drop file (or paste values) here to import"}),d.jsx("div",{className:"message-small",children:d.jsx("label",{children:"or"})}),d.jsx(X,{kind:"primary",onClick:this.handleSelectFile,children:"Select File..."})]}),r&&(s===void 0||s==="")&&d.jsxs("div",{className:"selected-content",children:[d.jsx("div",{className:"selected-icon",children:d.jsx(re,{icon:_e.getIcon(r)})}),d.jsxs("div",{className:"selected-text",children:[d.jsx("label",{children:"Selected File"}),d.jsxs("label",{className:"selected-name",children:[r,!i&&d.jsx(X,{kind:"ghost",className:"ml-2",onClick:this.unstageFile,icon:Ua,tooltip:"Remove"})]})]})]}),!!s&&d.jsxs("div",{className:"message-content",children:[d.jsx("div",{className:"message-icon",children:d.jsx(re,{icon:Go})}),d.jsx("label",{children:s}),s===_e.FILE_TYPE_ERROR&&d.jsx("div",{className:"message-small",children:d.jsx("label",{children:this.getFileTypeErrorString(e)})})]})]})}}St(_e,"defaultProps",{allowZip:!1,dragError:null});St(_e,"MULTIPLE_FILE_ERROR","Please select only one file");St(_e,"FILE_TYPE_ERROR","Filetype not supported.");function Ht(n,e,t){return(e=ic(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ic(n){var e=rc(n,"string");return typeof e=="symbol"?e:e+""}function rc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class B{}Ht(B,"INTEGER","int");Ht(B,"LONG","long");Ht(B,"DOUBLE","double");Ht(B,"BOOLEAN","bool");Ht(B,"STRING","string");Ht(B,"DATE_TIME","datetime");Ht(B,"LOCAL_TIME","localtime");function xs(n,e){var t=n.internalStream("string");return t.readable=!0,t.read=()=>!1,t.removeListener=()=>!1,t.on("data",(i,r)=>e(r)),t}function Wr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function zr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Wr(Object(t),!0).forEach(function(i){we(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Wr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function we(n,e,t){return(e=oc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function oc(n){var e=sc(n,"string");return typeof e=="symbol"?e:e+""}function sc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Vr="unknown",ac=2147483647,lc=-2147483648,Gr=/^[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]+)?$/,qr=/^([0-9]+T)?([0-9]+):([0-9]+)(:[0-9]+)?(?:\.[0-9]{1,9})?$/;class be{static determineType(e,t,i){if(!e||e===i)return t;switch(t){case B.STRING:return B.STRING;case B.INTEGER:return be.checkInteger(e);case B.LONG:return be.checkLong(e);case B.DOUBLE:return be.checkDouble(e);case B.BOOLEAN:return be.checkBoolean(e);case B.DATE_TIME:return be.checkDateTime(e);case B.LOCAL_TIME:return be.checkLocalTime(e);default:return be.getTypeFromUnknown(e)}}static isNotParsableNumber(e){return isNaN(e)||e==="Infinity"||e==="-Infinity"}static checkInteger(e){var t=e.replace(/,/g,"");return be.isNotParsableNumber(t)?B.STRING:be.getNumberType(t)}static checkLong(e){var t=e.replace(/,/g,"");return be.isNotParsableNumber(t)?B.STRING:t.includes(".")?B.DOUBLE:B.LONG}static checkDouble(e){var t=e.replace(/,/g,"");return be.isNotParsableNumber(t)?B.STRING:B.DOUBLE}static checkBoolean(e){var t=e.toLowerCase();return t==="true"||t==="false"?B.BOOLEAN:B.STRING}static checkDateTime(e){return Gr.test(e)?B.DATE_TIME:B.STRING}static checkLocalTime(e){return qr.test(e)?B.LOCAL_TIME:B.STRING}static getTypeFromUnknown(e){var t=e.replace(/,/g,"");if(be.isNotParsableNumber(t)){var i=e.toLowerCase();return i==="true"||i==="false"?B.BOOLEAN:Gr.test(e)&&e.includes(":")?B.DATE_TIME:qr.test(e)?B.LOCAL_TIME:B.STRING}return be.getNumberType(t)}static getNumberType(e){if(e.includes("."))return B.DOUBLE;var t=e.startsWith("-")?11:10;if(e.length>t)return B.LONG;var i=parseInt(e,10);return i>ac||i<lc?B.LONG:B.INTEGER}constructor(e,t,i,r,o,s,a,l,u,h){we(this,"onFileCompleted",void 0),we(this,"file",void 0),we(this,"readHeaders",void 0),we(this,"nullString",void 0),we(this,"onProgress",void 0),we(this,"onError",void 0),we(this,"types",void 0),we(this,"chunks",void 0),we(this,"totalChunks",void 0),we(this,"rowCount",void 0),we(this,"isZip",void 0),we(this,"shouldTrim",void 0),we(this,"zipProgress",void 0),we(this,"config",void 0),this.onFileCompleted=e,this.file=t,this.readHeaders=i,this.nullString=o,this.onProgress=s,this.onError=a,this.chunks=0,this.totalChunks=l,this.rowCount=0,this.isZip=u,this.shouldTrim=h,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=zr(zr({},r),{},{error:this.handleError,chunk:this.handleChunk,complete:this.handleComplete})}parse(){if(this.file instanceof File||this.file instanceof Blob)pn.parse(this.file,this.config);else{var e=xs(this.file,this.handleNodeUpdate);pn.parse(e,this.config),e.resume()}}handleChunk(e,t){var{data:i}=e;if(!this.types){if(i==null||i.length===0){t.abort(),this.onError("Error parsing CSV: no data in file.");return}this.types=new Array(i[0].length).fill(Vr),this.readHeaders&&(i=i.slice(1))}this.rowCount+=i.length,H(this.types);var r=[...this.types];i.forEach(a=>{if(a.length>=r.length){for(var l=0;l<r.length;l+=1)r[l]=be.determineType(this.shouldTrim?a[l].trim():a[l],r[l],this.nullString);this.types=r}else t.abort(),this.onError(`Error parsing CSV: Insufficient data in row.
|
|
4
4
|
Expected length `.concat(r.length," but found ").concat(a.length,`.
|
|
5
5
|
Row = `).concat(a))}),this.chunks+=1;var o=0;this.totalChunks>0?o=Math.round(this.chunks/this.totalChunks*50):o=Math.round(this.zipProgress/2);var s=this.onProgress(o);s&&t.abort()}handleComplete(e){var{types:t,onFileCompleted:i}=this;H(t),(e==null||!e.meta.aborted)&&i(t.map(r=>r===Vr||r===B.LOCAL_TIME?B.STRING:r),this.rowCount)}handleError(e){var{onError:t}=this;t(e)}handleNodeUpdate(e){this.zipProgress=e.percent}}function se(n,e,t){return(e=dc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function dc(n){var e=uc(n,"string");return typeof e=="symbol"?e:e+""}function uc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var An=L.module("CsvParser"),hc=650;class nn{static generateHeaderRecursive(e){var t="",i=e;return e>=26&&(t=t.concat(nn.generateHeaderRecursive(Math.floor(e/26)-1)),i=e%26),t.concat(String.fromCharCode(65+i))}constructor(e){var{onFileCompleted:t,session:i,file:r,type:o,readHeaders:s=!0,onProgress:a,onError:l,timeZone:u,isZip:h}=e;se(this,"onFileCompleted",void 0),se(this,"session",void 0),se(this,"file",void 0),se(this,"isZip",void 0),se(this,"type",void 0),se(this,"readHeaders",void 0),se(this,"timeZone",void 0),se(this,"onProgress",void 0),se(this,"onError",void 0),se(this,"tables",void 0),se(this,"headers",void 0),se(this,"types",void 0),se(this,"rowCount",void 0),se(this,"rowsProcessed",void 0),se(this,"chunks",void 0),se(this,"totalChunks",void 0),se(this,"isComplete",void 0),se(this,"zipProgress",void 0),se(this,"consolidatedChunks",void 0),se(this,"numConsolidated",void 0),se(this,"isCancelled",void 0),se(this,"config",void 0),this.onFileCompleted=t,this.session=i,this.file=r,this.isZip=h,this.type=o,this.readHeaders=s,this.timeZone=u,this.onProgress=a,this.onError=l,this.tables=[],this.rowCount=0,this.rowsProcessed=0,this.chunks=0,this.totalChunks=h?0:Math.ceil(r.size/pn.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:o.delimiter,newline:o.newline,escapeChar:o.escapeChar,dynamicTyping:!1,error:this.handleError,skipEmptyLines:o.skipEmptyLines,chunk:this.handleChunk,complete:this.handleComplete,fastMode:!1}}cancel(){this.isCancelled=!0}transpose(e,t){for(var i=t.length,r=new Array(e).fill(null).map(()=>new Array(i)),o=0;o<i;o+=1){var s=t[o];if(s.length<e)throw new Error("Insufficient columns. Expected ".concat(e," but found ").concat(s.length,`
|
|
@@ -16,4 +16,4 @@ Row = `).concat(a))}),this.chunks+=1;var o=0;this.totalChunks>0?o=Math.round(thi
|
|
|
16
16
|
`))}}if(i=i.trimRight(),this.editor.setValue(i),t){var a,l=(a=this.editor.getModel())===null||a===void 0?void 0:a.getLineCount();H(l),this.editor.revealLine(l,1)}this.stopFlushTimer(),this.bufferedMessages=[]}}truncateLogIfNecessary(){this.messages.length>de.maxLogSize&&(this.messages=this.messages.splice(this.messages.length-de.truncateSize))}scrollToBottom(){var e,t,i;if(this.editor){var r=(e=this.editor)===null||e===void 0||(t=e.getModel)===null||t===void 0||(i=t.call(e))===null||i===void 0?void 0:i.getLineCount();H(r),this.editor.revealLine(r,1)}}isBottomVisible(){if(!this.editor)return!0;var e=this.editor.getModel(),t=e==null?void 0:e.getLineCount();return H(t),this.isLineVisible(t)}isLineVisible(e){var t,i=(t=this.editor)===null||t===void 0?void 0:t.getVisibleRanges();if(i==null||i.length===0)return!1;for(var r=0;r<i.length;r+=1){var o=i[r];if(o.startLineNumber<=e&&e<=o.endLineNumber)return!0}return!1}isLogItemVisible(e){var{shownLogLevels:t}=this.state;return t[e.logLevel]}flush(){for(var e="",t=0;t<this.bufferedMessages.length;t+=1){var i=this.bufferedMessages[t],r=de.getLogText(i);e+=r,r.charAt(r.length-1)!==`
|
|
17
17
|
`&&(e+=`
|
|
18
18
|
`)}this.bufferedMessages=[],this.appendLogText(e)}queue(e){this.bufferedMessages.push(e),this.bufferedMessages.length===1&&(this.flushTimer=setTimeout(this.handleFlushTimeout,de.bufferTimeout))}stopFlushTimer(){this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=void 0)}updateDimensions(){this.editor&&this.editor.layout()}handleClearClick(){this.clearLogs()}clearLogs(){this.messages=[],this.refreshLogText()}handleFlushTimeout(){this.stopFlushTimer(),this.flush()}handleLogMessage(e){this.messages.push(e),this.editor&&this.isLogItemVisible(e)&&this.queue(e)}handleMenuItemClick(e){this.toggleLogLevel(e)}handleResetClick(){this.resetLogLevels()}handleResize(){this.updateDimensions()}handleToggleAllClick(){this.toggleAll()}render(){var e={placement:"bottom-end"},{shownLogLevels:t}=this.state,i=this.getMenuActions(t);return d.jsxs("div",{className:"log-pane h-100 w-100",children:[d.jsxs("div",{className:"log-pane-menu",children:[d.jsx(X,{kind:"ghost",className:"btn-clear-logs",onClick:this.handleClearClick,icon:Va,tooltip:"Clear log"}),d.jsx(X,{kind:"ghost",className:"btn-link-icon btn-overflow",icon:Ga,tooltip:"Log Settings",onClick:()=>{},children:d.jsx(gn,{actions:i,popperClassName:"log-level-menu-popper",popperOptions:e})})]}),d.jsx("div",{className:"log-pane-editor h-100 w-100",ref:r=>{this.editorContainer=r}})]})}}Ae(de,"DefaultLogLevels",[fe.STDOUT,fe.ERROR,fe.FATAL,fe.STDERR,fe.WARN]);Ae(de,"AllLogLevels",[fe.INFO,fe.STDOUT,fe.ERROR,fe.FATAL,fe.STDERR,fe.WARN,fe.DEBUG,fe.TRACE]);Ae(de,"bufferTimeout",16);Ae(de,"maxLogSize",131072);Ae(de,"truncateSize",65536);function oo(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(u){return void t(u)}a.done?e(l):Promise.resolve(l).then(i,r)}function Rc(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){oo(o,i,r,s,a,"next",l)}function a(l){oo(o,i,r,s,a,"throw",l)}s(void 0)})}}var Fc=L.module("HeapUsage");function Hc(n){var e,{connection:t,defaultUpdateInterval:i,hoverUpdateInterval:r,bgMonitoring:o=!0,monitorDuration:s}=n,a=Ju(),[l,u]=c.useState({freeMemory:0,maximumHeapSize:999,totalHeapSize:0}),[h,m]=c.useState(!1),p=c.useRef({timestamps:[],usages:[]}),v=ts(),g=c.useCallback(Rc(function*(){try{var D=yield t.getWorkerHeapInfo();if(!v.current)return;if(u(D),o||h){for(var F=(D.totalHeapSize-D.freeMemory)/D.maximumHeapSize,U=Date.now(),{timestamps:ce,usages:Je}=p.current;ce.length!==0&&U-ce[0]>s*1.5;)ce.shift(),Je.shift();ce.push(U),Je.push(F)}else p.current={timestamps:[],usages:[]}}catch(ze){Fc.warn("Unable to get heap usage",ze)}}),[t,v,o,h,s]);Bl(g,h?r:i);var f=(D,F)=>Math.round(D*10**F)/10**F,y=2,_=1024**3,{freeMemory:S,totalHeapSize:C,maximumHeapSize:M}=l,K=f(S/_,y),Y=f(C/_,y),x=f(M/_,y),z=Y-K,N=function(F,U){var ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return d.jsxs("div",{className:$("heap-usage-info-row",{"heading-bottom-border":ce}),children:[d.jsx("div",{className:"font-weight-bold",children:F}),d.jsx("div",{children:U})]})},{timestamps:Q,usages:te}=p.current,j=(e=Q[Q.length-1])!==null&&e!==void 0?e:0,V=C/M,R=(C-S)/M;return d.jsxs("div",{className:"max-memory",children:[d.jsx("div",{className:"total-memory",style:{width:"calc(".concat(V*100,"% - ").concat(V*2,"px")}}),d.jsx("div",{className:$("used-memory",{"heap-overflow":(C-S)/M>.95}),style:{width:"calc(".concat(R*100,"% - ").concat(R*2,"px")}}),d.jsxs("div",{className:"memory-text",children:[x.toFixed(1)," GB"]}),d.jsx(ne,{onEntered:()=>m(!0),onExited:()=>m(!1),interactive:!0,children:d.jsxs("div",{className:"heap-tooltip",children:[N("In use:","".concat(z.toFixed(y)," of ").concat(x.toFixed(y)," GB"),!0),N("Free:","".concat(K.toFixed(y)," GB")),N("Total:","".concat(Y.toFixed(y)," GB")),N("Max:","".concat(x.toFixed(y)," GB")),d.jsx("div",{className:"heap-plot",children:d.jsx(Qu,{data:[{x:[...Q],y:[...te],type:"scatter",mode:"lines"}],config:{staticPlot:!0,responsive:!0},style:{width:"196px",height:"100px"},layout:{margin:{l:2,t:2,r:2,b:2},plot_bgcolor:"transparent",paper_bgcolor:"transparent",colorway:["#4878ea"],xaxis:{dtick:Math.round(s/6),gridcolor:a.linecolor,range:[j-s,j],linecolor:a.linecolor,linewidth:2,mirror:!0},yaxis:{dtick:.2,gridcolor:a.linecolor,range:[0,1],linecolor:a.linecolor,linewidth:2,mirror:!0}}})}),d.jsxs("div",{className:"heap-utilisation-text",children:["% utilization over ",Math.round(s/1e3/60)," min."]})]})})]})}var Ns=Object.freeze({openPopouts:[],settings:{hasHeaders:!0,constrainDragToContainer:!0,reorderEnabled:!0,selectionEnabled:!1,popoutWholeStack:!1,blockedPopoutsThrowError:!0,closePopoutsOnUnload:!0,showPopoutIcon:!0,showMaximiseIcon:!0,showCloseIcon:!0,responsiveMode:"onload",tabOverlapAllowance:0,tabControlOffset:10},dimensions:{borderWidth:5,borderGrabWidth:10,minItemHeight:10,minItemWidth:10,headerHeight:20,dragProxyWidth:300,dragProxyHeight:200},labels:{close:"Close",maximise:"Maximize",minimise:"Minimize",popout:"Open in new window",popin:"Pop in",tabDropdown:"Additional tabs",tabNextLabel:"Next",tabPreviousLabel:"Previous"},content:[]});function As(n){return n.componentName!==void 0}function $c(n){return n.component!==void 0}var Ls=Object.freeze({type:"default",isClosable:!0,isFocusOnShow:!0,reorderEnabled:!0,title:""});const Uc=Object.freeze(Object.defineProperty({__proto__:null,defaultConfig:Ns,isGLComponentConfig:As,isReactComponentConfig:$c,itemDefaultConfig:Ls},Symbol.toStringTag,{value:"Module"}));function Vn(n,e,t){return(e=Bc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Bc(n){var e=Kc(n,"string");return typeof e=="symbol"?e:e+""}function Kc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Pe{constructor(){Vn(this,"_mSubscriptions",void 0),Vn(this,"off",this.unbind),Vn(this,"trigger",this.emit),this._mSubscriptions={},this._mSubscriptions[Pe.ALL_EVENT]=[]}on(e,t,i){if(typeof t!="function")throw new Error("Tried to listen to event "+e+" with non-function callback "+t);this._mSubscriptions[e]||(this._mSubscriptions[e]=[]),this._mSubscriptions[e].push({fn:t,ctx:i})}emit(e){for(var t=this._mSubscriptions[e],i=arguments.length,r=new Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];if(t)for(var s=0;s<t.length;s++){var a=t[s].ctx||{};try{t[s].fn.apply(a,r)}catch(m){console.error("Error while emitting event:",m)}}r.unshift(e);for(var l=this._mSubscriptions[Pe.ALL_EVENT],u=0;u<l.length;u++){var h=l[u].ctx||{};try{l[u].fn.apply(h,r)}catch(m){console.error("Error while emitting event to allEventSubs:",m)}}}unbind(e,t,i){if(!this._mSubscriptions[e])throw new Error("No subscriptions to unsubscribe for event "+e);for(var r=!1,o=0;o<this._mSubscriptions[e].length;o++)(!t||this._mSubscriptions[e][o].fn===t)&&(!i||i===this._mSubscriptions[e][o].ctx)&&(this._mSubscriptions[e].splice(o,1),r=!0);if(r===!1)throw new Error("Nothing to unbind for "+e)}}Vn(Pe,"ALL_EVENT","__all");function Ge(n,e,t){return(e=Wc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Wc(n){var e=zc(n,"string");return typeof e=="symbol"?e:e+""}function zc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Mi extends Pe{constructor(e,t,i){super(),Ge(this,"width",void 0),Ge(this,"height",void 0),Ge(this,"title",void 0),Ge(this,"parent",void 0),Ge(this,"layoutManager",void 0),Ge(this,"tab",void 0),Ge(this,"_config",void 0),Ge(this,"isHidden",!1),Ge(this,"beforeCloseHandler",void 0),Ge(this,"_element",T(['<div class="lm_item_container">','<div class="lm_content" tabindex="-1"></div>',"</div>"].join(""))),Ge(this,"_contentElement",void 0),this.title=As(e)?e.componentName:"",this.parent=t,this.layoutManager=i,this._config=e,this._contentElement=this._element.find(".lm_content"),this.beforeCloseHandler=null}getElement(){return this._contentElement}hide(){this.emit("hide"),this.isHidden=!0,this._element.hide()}show(){this.emit("show"),this.isHidden=!1,this._element.show(),(this.height!=0||this.width!=0)&&this.emit("shown")}setSize(e,t){for(var i,r,o,s=this.parent,a=null;s&&!s.isColumn&&!s.isRow;){var l;if(a=s,s=s.parent,(l=s)!==null&&l!==void 0&&l.isRoot)return!1}if(!s||!a)return!1;for(var u=s.isColumn?"height":"width",h=u==="height"?t:e,m=((i=this[u])!==null&&i!==void 0?i:0)*(1/(((r=a.config[u])!==null&&r!==void 0?r:0)/100)),p=h/m*100,v=(((o=a.config[u])!==null&&o!==void 0?o:0)-p)/(s.contentItems.length-1),g=0;g<s.contentItems.length;g++)if(s.contentItems[g]===a)s.contentItems[g].config[u]=p;else{var f;s.contentItems[g].config[u]=((f=s.contentItems[g].config[u])!==null&&f!==void 0?f:0)+v}return s.callDownwards("setSize"),!0}close(e){var t,i;this._config.isClosable&&(!((t=(i=this.beforeCloseHandler)===null||i===void 0?void 0:i.call(this,e))!==null&&t!==void 0)||t)&&(this.emit("close"),this.parent.close())}beforeClose(e){this.beforeCloseHandler=e}getState(){return this._config.componentState}getConfig(){return this._config}extendState(e){this.setState(T.extend(!0,this.getState(),e))}setState(e){this._config.componentState=e,this.parent.emitBubblingEvent("stateChanged")}setTitle(e){this.parent.setTitle(e)}_$setSize(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(e!==this.width||t!==this.height){this.width=e,this.height=t;var i=this._contentElement[0],r=i.offsetWidth-i.clientWidth,o=i.offsetHeight-i.clientHeight;this._contentElement.width(this.width-r).height(this.height-o),this.emit("resize")}}}const Vc=Object.freeze(Object.defineProperty({__proto__:null,Container:Mi,ItemContainer:Mi},Symbol.toStringTag,{value:"Module"}));function Rs(n){var e=location.hash.match(new RegExp(n+"=([^&]*)"));return e?e[1]:null}function Fs(n){if(window.location.hash)return Rs(n);if(!window.location.search)return null;var e=window.location.search.substr(1).split("&"),t={},i,r;for(r=0;r<e.length;r++)i=e[r].split("="),t[i[0]]=i[1];return t[n]||null}function zi(n){return window.requestAnimationFrame(n)}function Gc(n,e){var t=e.indexOf(n);if(t===-1)throw new Error("Can't remove item from array. Item is not in the array");e.splice(t,1)}function Yn(){return Pt()}function qc(n,e){var t=n.replace(/javascript/gi,"javascript").replace(/expression/gi,"expression").replace(/onload/gi,"onload").replace(/script/gi,"script").replace(/onerror/gi,"onerror");return e===!0?t:t.replace(/>/g,">").replace(/</g,"<")}function Vi(n){return T.trim(n.replace(/(<([^>]+)>)/gi,""))}function ke(n,e,t){return(e=Zc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Zc(n){var e=Xc(n,"string");return typeof e=="symbol"?e:e+""}function Xc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class On extends Pe{constructor(e){var t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super(),ke(this,"_eElement",void 0),ke(this,"_oDocument",void 0),ke(this,"_eBody",void 0),ke(this,"_destroyAfterMouseUp",void 0),ke(this,"_nDelay",400),ke(this,"_timeout",void 0),ke(this,"timeout",void 0),ke(this,"_nDistance",10),ke(this,"_nX",0),ke(this,"_nY",0),ke(this,"_nOriginalX",0),ke(this,"_nOriginalY",0),ke(this,"_bDragging",!1),this._eElement=e,this._oDocument=T(document),this._eBody=T(document.body),this._destroyAfterMouseUp=i,this.onMouseMove=this.onMouseMove.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this._startDrag=this._startDrag.bind(this),(t=this._eElement)===null||t===void 0||t.on("mousedown",this.onMouseDown)}destroy(){var e,t;(e=this._eElement)===null||e===void 0||e.unbind("mousedown",this.onMouseDown),(t=this._oDocument)===null||t===void 0||t.unbind("mouseup",this.onMouseUp),this._eElement=void 0,this._oDocument=void 0,this._eBody=void 0,clearTimeout(this._timeout),this._timeout=void 0}onMouseDown(e){if(e.preventDefault(),e.button===0){var t,i,r,o,s=this._getCoordinates(e);this._nOriginalX=(t=s.x)!==null&&t!==void 0?t:0,this._nOriginalY=(i=s.y)!==null&&i!==void 0?i:0,(r=this._oDocument)===null||r===void 0||r.on("mousemove",this.onMouseMove),(o=this._oDocument)===null||o===void 0||o.on("mouseup",this.onMouseUp),this._timeout=window.setTimeout(this._startDrag,this._nDelay)}}onMouseMove(e){if(this._timeout!=null){var t,i;e.preventDefault();var r=this._getCoordinates(e);this._nX=((t=r.x)!==null&&t!==void 0?t:0)-this._nOriginalX,this._nY=((i=r.y)!==null&&i!==void 0?i:0)-this._nOriginalY,this._bDragging===!1&&(Math.abs(this._nX)>this._nDistance||Math.abs(this._nY)>this._nDistance)&&this._startDrag(),this._bDragging&&this.emit("drag",this._nX,this._nY,e)}}onMouseUp(e){if(this._timeout!=null){var t,i,r,o,s;if(clearTimeout(this._timeout),(t=this._oDocument)===null||t===void 0||t.unbind("mousemove",this.onMouseMove),(i=this._oDocument)===null||i===void 0||i.unbind("mouseup",this.onMouseUp),(r=this._oDocument)===null||r===void 0||(o=r.find("iframe"))===null||o===void 0||o.css("pointer-events",""),this._bDragging===!0&&(this._bDragging=!1,this.emit("dragStop",e,this._nOriginalX+this._nX)),(s=this._eBody)===null||s===void 0||s.removeClass("lm_dragging"),!(this._eElement instanceof Window)){var a;(a=this._eElement)===null||a===void 0||a.removeClass("lm_dragging")}this._destroyAfterMouseUp&&this.destroy()}}_startDrag(){var e,t,i,r;window.clearTimeout(this._timeout),this._bDragging=!0,(e=this._eBody)===null||e===void 0||e.addClass("lm_dragging"),(t=this._eElement)===null||t===void 0||t.addClass("lm_dragging"),(i=this._oDocument)===null||i===void 0||(r=i.find("iframe"))===null||r===void 0||r.css("pointer-events","none"),this.emit("dragStart",this._nOriginalX,this._nOriginalY)}_getCoordinates(e){var t,i;return{x:(t=e.pageX)!==null&&t!==void 0?t:0,y:(i=e.pageY)!==null&&i!==void 0?i:0}}}function Bt(n,e,t){return(e=Yc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Yc(n){var e=Qc(n,"string");return typeof e=="symbol"?e:e+""}function Qc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Hs{constructor(e,t){Bt(this,"_container",void 0),Bt(this,"_reactComponent",null),Bt(this,"_portalComponent",null),Bt(this,"_originalComponentWillUpdate",null),Bt(this,"_initialState",void 0),Bt(this,"_reactClass",void 0),this._reactComponent=null,this._portalComponent=null,this._originalComponentWillUpdate=null,this._container=e,this._initialState=t,this._reactClass=this._getReactClass(),this._container.on("open",this._render,this),this._container.on("destroy",this._destroy,this)}_key(){var e=this._container._config.id;if(!e)throw new Error("Cannot mount panel without id");return Array.isArray(e)?e.join(","):e}_render(){var e=this._key();this._portalComponent=$i.createPortal(this._getReactComponent(),this._container.getElement()[0],e),this._container.layoutManager.addReactChild(e,this._portalComponent)}_gotReactComponent(e){if(e){this._reactComponent=e,this._originalComponentWillUpdate=this._reactComponent.componentWillUpdate||function(){},this._reactComponent.componentWillUpdate=this._onUpdate.bind(this);var t=this._container.getState();t&&this._reactComponent.setState(t)}}_destroy(){this._container.layoutManager.removeReactChild(this._key(),this._portalComponent),this._container.off("open",this._render,this),this._container.off("destroy",this._destroy,this)}_onUpdate(e,t){var i;this._container.setState(t),(i=this._originalComponentWillUpdate)===null||i===void 0||i.call(this._reactComponent,e,t)}_getReactClass(){var e=this._container._config.component;if(!e)throw new Error("No react component name. type: react-component needs a field `component`");var t=this._container.layoutManager.getComponent(e)||this._container.layoutManager.getFallbackComponent();if(!t)throw new Error('React component "'+e+'" not found. Please register all components with GoldenLayout using `registerComponent(name, component)`');return t}_getReactComponent(){var e={glEventHub:this._container.layoutManager.eventHub,glContainer:this._container,ref:this._gotReactComponent.bind(this)},t=T.extend(e,this._container._config.props);return I.createElement(this._reactClass,t)}}var Qn=["settings","hasHeaders","constrainDragToContainer","selectionEnabled","dimensions","borderWidth","minItemHeight","minItemWidth","headerHeight","dragProxyWidth","dragProxyHeight","labels","close","maximise","minimise","popout","content","componentName","componentState","id","width","type","height","isClosable","title","popoutWholeStack","openPopouts","parentId","activeItemIndex","reorderEnabled","borderGrabWidth"],Jc=[!0,!1,"row","column","stack","component","close","maximise","minimise","open in new window"];function Gi(n){if(Qn.length>36)throw new Error("Too many keys in config minifier map");var e={};return qi(n,e,"_min"),e}function Di(n){if(Qn.length>36)throw new Error("Too many keys in config minifier map");var e={};return qi(n,e,"_max"),e}function qi(n,e,t){var i=t==="_min"?em:tm;for(var r in n)if(n.hasOwnProperty(r)){var o=Array.isArray(n)?n[Number.parseInt(r,10)]:n[r];if(typeof o=="object"&&o!=null){var s=o instanceof Array?[]:{};if(Array.isArray(e))e[Number.parseInt(r,10)]=s;else{var a=i(r,Qn);e[a]=s}qi(o,s,t)}else{var l=i(o,Jc);if(Array.isArray(e))e[Number.parseInt(r,10)]=l;else{var u=i(r,Qn);e[u]=l}}}}function em(n,e){if(typeof n=="string"&&n.length===1)return"___"+n;var t=e.indexOf(n);return t===-1?n:t.toString(36)}function tm(n,e){return typeof n=="string"&&n.length===1?e[parseInt(n,36)]:typeof n=="string"&&n.substr(0,3)==="___"?n[3]:n}function yi(n,e,t){return(e=nm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nm(n){var e=im(n,"string");return typeof e=="symbol"?e:e+""}function im(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ji{constructor(e,t){yi(this,"name",void 0),yi(this,"origin",void 0),yi(this,"isPropagationStopped",void 0),this.name=e,this.origin=t,this.isPropagationStopped=!1}stopPropagation(){this.isPropagationStopped=!0}}function Rn(n,e,t){return(e=rm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rm(n){var e=om(n,"string");return typeof e=="symbol"?e:e+""}function om(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}let $s=class extends Pe{constructor(e){super(),Rn(this,"_layoutManager",void 0),Rn(this,"_dontPropagateToParent",void 0),Rn(this,"_childEventSource",void 0),Rn(this,"_boundOnEventFromChild",void 0),this._layoutManager=e,this._dontPropagateToParent=null,this._childEventSource=null,this.on(Pe.ALL_EVENT,this._onEventFromThis.bind(this)),this._boundOnEventFromChild=this._onEventFromChild.bind(this),T(window).on("gl_child_event",this._boundOnEventFromChild)}_onEventFromThis(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];this._layoutManager.isSubWindow&&t[0]!==this._dontPropagateToParent&&this._propagateToParent(t),this._propagateToChildren(t),this._dontPropagateToParent=null,this._childEventSource=null}_$onEventFromParent(e){this._dontPropagateToParent=e[0],this.emit.apply(this,e)}_onEventFromChild(e){this._childEventSource=e.originalEvent.__gl,this.emit.apply(this,e.originalEvent.__glArgs)}_propagateToParent(e){var t,i="gl_child_event",r=(t=window.opener)===null||t===void 0?void 0:t.document.createEvent("HTMLEvents");r.initEvent(i,!0,!0),r.eventName=i,r.__glArgs=e,r.__gl=this._layoutManager,window.opener.dispatchEvent(r)}_propagateToChildren(e){for(var t=0;t<this._layoutManager.openPopouts.length;t++){var i=this._layoutManager.openPopouts[t].getGlInstance();i&&i!==this._childEventSource&&i.eventHub._$onEventFromParent(e)}}destroy(){T(window).off("gl_child_event",this._boundOnEventFromChild)}};function Us(n,e,t){return n.on(e,t),()=>{n.off(e,t)}}function Bs(n){return(e,t)=>Us(e,n,t)}function Ks(n){return function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];e.emit(n,...i)}}function Ws(n){return(e,t)=>{var i=c.useRef(null),r=c.useRef(()=>!1);if(i.current!=e||r.current!=t){var o;(o=i.current)===null||o===void 0||o.off(n,r.current),e==null||e.on(n,t)}i.current=e,r.current=t,c.useEffect(()=>()=>{var s;return(s=i.current)===null||s===void 0?void 0:s.off(n,r.current)},[])}}function sm(n){return{listen:Bs(n),emit:Ks(n),useListener:Ws(n)}}const am=Object.freeze(Object.defineProperty({__proto__:null,BubblingEvent:ji,DragListener:On,EventEmitter:Pe,EventHub:$s,ReactComponentHandler:Hs,animFrame:zi,filterXss:qc,getHashValue:Rs,getQueryStringParam:Fs,getUniqueId:Yn,listenForEvent:Us,makeEmitFunction:Ks,makeEventFunctions:sm,makeListenFunction:Bs,makeUseListenerFunction:Ws,minifyConfig:Gi,removeFromArray:Gc,stripTags:Vi,unminifyConfig:Di},Symbol.toStringTag,{value:"Module"}));function ft(n,e,t){return(e=lm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lm(n){var e=dm(n,"string");return typeof e=="symbol"?e:e+""}function dm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class zs extends Pe{constructor(e,t,i,r,o){super(),ft(this,"isInitialised",!1),ft(this,"_config",void 0),ft(this,"_dimensions",void 0),ft(this,"_parentId",void 0),ft(this,"_indexInParent",void 0),ft(this,"_layoutManager",void 0),ft(this,"_popoutWindow",null),ft(this,"_id",null),this._config=e,this._dimensions=t,this._parentId=i,this._indexInParent=r,this._layoutManager=o,this._createWindow()}toConfig(){var e,t,i,r,o,s,a,l,u,h,m;if(this.isInitialised===!1)throw new Error("Can't create config, layout not yet initialised");return{dimensions:{width:(e=this.getGlInstance())===null||e===void 0?void 0:e.width,height:(t=this.getGlInstance())===null||t===void 0?void 0:t.height,left:(i=(r=(o=this._popoutWindow)===null||o===void 0?void 0:o.screenX)!==null&&r!==void 0?r:(s=this._popoutWindow)===null||s===void 0?void 0:s.screenLeft)!==null&&i!==void 0?i:0,top:(a=(l=(u=this._popoutWindow)===null||u===void 0?void 0:u.screenY)!==null&&l!==void 0?l:(h=this._popoutWindow)===null||h===void 0?void 0:h.screenTop)!==null&&a!==void 0?a:0},content:(m=this.getGlInstance())===null||m===void 0?void 0:m.toConfig().content,parentId:this._parentId,indexInParent:this._indexInParent}}getGlInstance(){var e;return(e=this._popoutWindow)===null||e===void 0?void 0:e.__glInstance}getWindow(){return this._popoutWindow}close(){if(this.getGlInstance()){var e;(e=this.getGlInstance())===null||e===void 0||e._$closeWindow()}else try{var t;(t=this.getWindow())===null||t===void 0||t.close()}catch{}}popIn(){var e;this._indexInParent;var t=null,i=null;if(this._parentId){var r;if(t=T.extend(!0,{},(r=this.getGlInstance())===null||r===void 0?void 0:r.toConfig()).content[0],i=this._layoutManager.root.getItemsById(this._parentId)[0],!i){var o;((o=this._layoutManager.root.contentItems.length)!==null&&o!==void 0?o:0)>0?i=this._layoutManager.root.contentItems[0]:i=this._layoutManager.root}}t&&((e=i)===null||e===void 0||e.addChild(t,this._indexInParent),this.close())}_createWindow(){var e=this._createUrl(),t=Math.floor(Math.random()*1e6).toString(36),i=this._serializeWindowOptions({width:this._dimensions.width,height:this._dimensions.height,innerWidth:this._dimensions.width,innerHeight:this._dimensions.height,menubar:"no",toolbar:"no",location:"no",personalbar:"no",resizable:"yes",scrollbars:"no",status:"no"});if(this._popoutWindow=window.open(e,t,i),!this._popoutWindow)if(this._layoutManager.config.settings.blockedPopoutsThrowError===!0){var r=new Error("Popout blocked");throw r.type="popoutBlocked",r}else return;T(this._popoutWindow).on("load",this._positionWindow.bind(this)).on("unload beforeunload",this._onClose.bind(this));var o=window.setInterval(()=>{var s;(s=this._popoutWindow)!==null&&s!==void 0&&s.__glInstance&&this._popoutWindow.__glInstance.isInitialised&&(this._onInitialised(),window.clearInterval(o))},10)}_serializeWindowOptions(e){var t=[],i;for(i in e)t.push(i+"="+e[i]);return t.join(",")}_createUrl(){var e={content:this._config},t="gl-window-config-"+Yn();e=Gi(e);try{localStorage.setItem(t,JSON.stringify(e))}catch(r){throw new Error("Error while writing to localStorage "+r.toString())}var i=document.location.href.split("?");return i.length===1?i[0]+"?gl-window="+t:document.location.href+"&gl-window="+t}_positionWindow(){var e,t;(e=this._popoutWindow)===null||e===void 0||e.moveTo(this._dimensions.left,this._dimensions.top),(t=this._popoutWindow)===null||t===void 0||t.focus()}_onInitialised(){var e;this.isInitialised=!0,(e=this.getGlInstance())===null||e===void 0||e.on("popIn",this.popIn,this),this.emit("initialised")}_onClose(){setTimeout(this.emit.bind(this,"closed"),50)}}function ve(n,e,t){return(e=um(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function um(n){var e=hm(n,"string");return typeof e=="symbol"?e:e+""}function hm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class $t extends Pe{constructor(e,t,i,r,o,s){var a,l,u,h,m,p,v,g;if(super(),ve(this,"_dragListener",void 0),ve(this,"_layoutManager",void 0),ve(this,"_contentItem",void 0),ve(this,"_originalParent",void 0),ve(this,"_area",null),ve(this,"_lastValidArea",null),ve(this,"_minX",void 0),ve(this,"_maxX",void 0),ve(this,"_minY",void 0),ve(this,"_maxY",void 0),ve(this,"_width",void 0),ve(this,"_height",void 0),ve(this,"_sided",void 0),ve(this,"element",void 0),ve(this,"childElementContainer",void 0),ve(this,"_proxyTab",void 0),this._dragListener=i,this._layoutManager=r,this._contentItem=o,this._originalParent=s,this._dragListener.on("drag",this._onDrag,this),this._dragListener.on("dragStop",this._onDrop,this),this._contentItem.tab&&this._contentItem.tab.element){var f,y;this._layoutManager.tabDropPlaceholder.width((f=this._contentItem.tab.element.outerWidth(!0))!==null&&f!==void 0?f:0),this._layoutManager.tabDropPlaceholder.height((y=this._contentItem.tab.element.outerHeight(!0))!==null&&y!==void 0?y:0)}if(this.element=T($t._template),s&&s._side&&(this._sided=s._sided,this.element.addClass("lm_"+s._side),["right","bottom"].indexOf(s._side.toString())>=0&&this.element.find(".lm_content").after(this.element.find(".lm_header"))),this.element.css({left:e,top:t}),this._proxyTab=this.element.find(".lm_tab"),this._proxyTab.attr("title",Vi((a=this._contentItem.config.title)!==null&&a!==void 0?a:"")),this.element.find(".lm_title").text((l=this._contentItem.config.title)!==null&&l!==void 0?l:""),this.childElementContainer=this.element.find(".lm_content"),this.childElementContainer.append(o.element),this._updateTree(),this._layoutManager._$calculateItemAreas(),T(document.body).append(this.element),this._setDimensions(),!this._contentItem.tab&&this._proxyTab.length){var _,S;this._layoutManager.tabDropPlaceholder.width((_=this._proxyTab.outerWidth(!0))!==null&&_!==void 0?_:0),this._layoutManager.tabDropPlaceholder.height((S=this._proxyTab.outerHeight(!0))!==null&&S!==void 0?S:0)}var C=this._layoutManager.container.offset();this._minX=(u=C==null?void 0:C.left)!==null&&u!==void 0?u:0,this._minY=(h=C==null?void 0:C.top)!==null&&h!==void 0?h:0,this._maxX=((m=this._layoutManager.container.width())!==null&&m!==void 0?m:0)+this._minX,this._maxY=((p=this._layoutManager.container.height())!==null&&p!==void 0?p:0)+this._minY,this._width=(v=this.element.width())!==null&&v!==void 0?v:0,this._height=(g=this.element.height())!==null&&g!==void 0?g:0,this._setDropPosition(e,t),this._layoutManager.emit("itemPickedUp",this._contentItem)}_onDrag(e,t,i){var r,o,s=(r=i.pageX)!==null&&r!==void 0?r:0,a=(o=i.pageY)!==null&&o!==void 0?o:0,l=s>this._minX&&s<this._maxX&&a>this._minY&&a<this._maxY;!l&&this._layoutManager.config.settings.constrainDragToContainer===!0||this._setDropPosition(s,a)}_setDropPosition(e,t){this.element.css({left:e,top:t}),this._area=this._layoutManager._$getArea(e,t),this._area!==null&&(this._lastValidArea=this._area,this._area.contentItem._$highlightDropZone(e,t,this._area))}_onDrop(){var e;(e=this._layoutManager.dropTargetIndicator)===null||e===void 0||e.hide(),this._area!==null?this._area.contentItem._$onDrop(this._contentItem,this._area):this._lastValidArea!==null?this._lastValidArea.contentItem._$onDrop(this._contentItem,this._lastValidArea):this._originalParent?this._originalParent.addChild(this._contentItem):this._contentItem._$destroy(),this._dragListener.off("drag",this._onDrag,this),this._dragListener.off("dragStop",this._onDrop,this),this.element.remove(),this._layoutManager.emit("itemDropped",this._contentItem)}_updateTree(){this._contentItem.parent&&this._contentItem.parent.removeChild(this._contentItem,!0),this._contentItem._$setParent(null)}_setDimensions(){var e=this._layoutManager.config.dimensions,t=e.dragProxyWidth,i=e.dragProxyHeight;this.element.width(t),this.element.height(i),t-=this._sided?e.headerHeight:0,i-=this._sided?0:e.headerHeight,this.childElementContainer.width(t),this.childElementContainer.height(i),this._contentItem.element.width(t),this._contentItem.element.height(i),this._contentItem.callDownwards("_$show"),this._contentItem.callDownwards("setSize")}}ve($t,"_template",'<div class="lm_dragProxy"><div class="lm_header"><ul class="lm_tabs"><li class="lm_tab lm_active"><i class="lm_left"></i><span class="lm_title"></span><i class="lm_right"></i></li></ul></div><div class="lm_content"></div></div>');function Fn(n,e,t){return(e=cm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function cm(n){var e=mm(n,"string");return typeof e=="symbol"?e:e+""}function mm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Vs{constructor(e,t,i){Fn(this,"_element",void 0),Fn(this,"_itemConfig",void 0),Fn(this,"_layoutManager",void 0),Fn(this,"_dragListener",void 0),this._element=e,this._itemConfig=t,this._layoutManager=i,this._dragListener=this._createDragListener()}_createDragListener(){return this._dragListener=new On(this._element,!0),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._createDragListener,this),this._dragListener}_onDragStart(e,t){var i=this._itemConfig;typeof i=="function"&&(i=i());var r=this._layoutManager._$normalizeContentItem(T.extend(!0,{},i));new $t(e,t,this._dragListener,this._layoutManager,r,null)}}function Hn(n,e,t){return(e=pm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function pm(n){var e=vm(n,"string");return typeof e=="symbol"?e:e+""}function vm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Gs{constructor(e,t,i){Hn(this,"_element",T(window)),Hn(this,"_itemConfig",void 0),Hn(this,"_layoutManager",void 0),Hn(this,"_dragListener",void 0),this._itemConfig=e,this._layoutManager=t,this._createDragListener(i)}_createDragListener(e){this._dragListener&&this._dragListener.destroy(),this._element&&(this._dragListener=new On(this._element,!0),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._destroy,this),this._dragListener.onMouseDown(e),this._dragListener._startDrag())}_destroy(){this._dragListener=void 0,this._element=void 0,this._itemConfig=void 0,this._layoutManager=void 0}_onDragStart(e,t){if(!(!this._dragListener||!this._layoutManager)){var i=this._itemConfig;typeof i=="function"&&(i=i());var r=this._layoutManager._$normalizeContentItem(T.extend(!0,{},i));new $t(e,t,this._dragListener,this._layoutManager,r,null)}}}function qs(n,e,t){return(e=fm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function fm(n){var e=gm(n,"string");return typeof e=="symbol"?e:e+""}function gm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class xn{constructor(){qs(this,"element",T(xn._template)),T(document.body).append(this.element)}destroy(){this.element.remove()}highlightArea(e){this.element.css({left:e.x1,top:e.y1,width:Math.floor(e.x2-e.x1),height:Math.floor(e.y2-e.y1)}).show()}hide(){this.element.hide()}}qs(xn,"_template",'<div class="lm_dropTargetIndicator"><div class="lm_inner"></div></div>');function Ci(n,e,t){return(e=bm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function bm(n){var e=ym(n,"string");return typeof e=="symbol"?e:e+""}function ym(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class mn{constructor(e,t,i,r){Ci(this,"element",void 0),Ci(this,"_header",void 0),Ci(this,"_action",void 0),this._header=e,this.element=T('<li class="'+i+'" title="'+t+'"></li>'),this._header.on("destroy",this._$destroy,this),this._action=r,this.element.on("click",this._action),this._header.controlsContainer.append(this.element)}_$destroy(){this.element.off(),this.element.remove()}}function Cm(n,e,t){return(e=wm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wm(n){var e=Sm(n,"string");return typeof e=="symbol"?e:e+""}function Sm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class kt extends Error{constructor(e,t){super(),Cm(this,"node",void 0),this.name="Configuration Error",this.message=e,this.node=t}}const _m=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationError:kt},Symbol.toStringTag,{value:"Module"}));function me(n,e,t){return(e=Em(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Em(n){var e=Pm(n,"string");return typeof e=="symbol"?e:e+""}function Pm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function At(n){return n.isStack}function We(n){return n.isComponent}function Zs(n){return n.isRoot}class ge extends Pe{constructor(e,t,i,r){super(),me(this,"config",void 0),me(this,"type",void 0),me(this,"contentItems",void 0),me(this,"parent",void 0),me(this,"layoutManager",void 0),me(this,"element",void 0),me(this,"childElementContainer",void 0),me(this,"componentName",void 0),me(this,"isInitialised",!1),me(this,"isMaximised",!1),me(this,"isRoot",!1),me(this,"isRow",!1),me(this,"isColumn",!1),me(this,"isStack",!1),me(this,"isComponent",!1),me(this,"tab",void 0),me(this,"_pendingEventPropagations",void 0),me(this,"_throttledEvents",void 0),this.element=r,this.config=this._extendItemNode(t),this.type=t.type,this.contentItems=[],this.parent=i,this.layoutManager=e,this._pendingEventPropagations={},this._throttledEvents=["stateChanged"],this.on(Pe.ALL_EVENT,this._propagateEvent,this),t.content&&this._createContentItems(t)}callDownwards(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;i!==!0&&r!==!0&&this[e].apply(this,t);for(var o=0;o<this.contentItems.length;o++)this.contentItems[o].callDownwards(e,t,i);i===!0&&r!==!0&&this[e].apply(this,t)}removeChild(e){var t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=this.contentItems.indexOf(e);if(r===-1)throw new Error("Can't remove child item. Unknown content item");if(i!==!0&&this.contentItems[r]._$destroy(),this.contentItems.splice(r,1),(t=this.config.content)===null||t===void 0||t.splice(r,1),this.contentItems.length>0)this.callDownwards("setSize");else if(this.type!=="root"&&this.config.isClosable){var o;(o=this.parent)===null||o===void 0||o.removeChild(this)}}addChild(e,t){e=this.layoutManager._$normalizeContentItem(e,this),t===void 0&&(t=this.contentItems.length),this.contentItems.splice(t,0,e),this.config.content===void 0&&(this.config.content=[]),this.config.content.splice(t,0,e.config),e.parent=this,e.parent.isInitialised===!0&&e.isInitialised===!1&&e._$init()}replaceChild(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t=this.layoutManager._$normalizeContentItem(t);var r=this.contentItems.indexOf(e),o=e.element[0].parentNode;if(r===-1)throw new Error("Can't replace child. oldChild is not child of this");o==null||o.replaceChild(t.element[0],e.element[0]),i===!0&&(e.parent=null,e._$destroy()),this.contentItems[r]=t,t.parent=this,At(this)&&(this.header.tabs[r].contentItem=t),t.parent.isInitialised===!0&&t.isInitialised===!1&&t._$init(),this.callDownwards("setSize")}remove(){var e;(e=this.parent)===null||e===void 0||e.removeChild(this)}popout(){var e=this.layoutManager.createPopout(this);return this.emitBubblingEvent("stateChanged"),e}toggleMaximise(e){e&&e.preventDefault(),this.isMaximised===!0?this.layoutManager._$minimiseItem(this):this.layoutManager._$maximiseItem(this),this.isMaximised=!this.isMaximised,this.emitBubblingEvent("stateChanged")}select(){this.layoutManager.selectedItem!==this&&(this.layoutManager.selectItem(this,!0),this.element.addClass("lm_selected"))}deselect(){this.layoutManager.selectedItem===this&&(this.layoutManager.selectedItem=null,this.element.removeClass("lm_selected"))}setTitle(e){this.config.title=e,this.emit("titleChanged",e),this.emitBubblingEvent("stateChanged")}hasId(e){if(this.config.id){if(typeof this.config.id=="string")return this.config.id===e;if(this.config.id instanceof Array)return this.config.id.indexOf(e)!==-1}else return!1}addId(e){this.hasId(e)||(this.config.id?typeof this.config.id=="string"?this.config.id=[this.config.id,e]:this.config.id instanceof Array&&this.config.id.push(e):this.config.id=e)}removeId(e){if(!this.hasId(e))throw new Error("Id not found");if(typeof this.config.id=="string")delete this.config.id;else if(this.config.id instanceof Array){var t=this.config.id.indexOf(e);this.config.id.splice(t,1)}}getItemsByFilter(e){var t=[],i=function r(o){for(var s=0;s<o.contentItems.length;s++)e(o.contentItems[s])===!0&&t.push(o.contentItems[s]),r(o.contentItems[s])};return i(this),t}getItemsById(e){return this.getItemsByFilter(function(t){return t.config.id instanceof Array?t.config.id.indexOf(e)!==-1:t.config.id===e})}getItemsByType(e){return this._$getItemsByProperty("type",e)}getComponentsByName(e){for(var t=this._$getItemsByProperty("componentName",e),i=[],r=0;r<t.length;r++)i.push(t[r].instance);return i}_$getItemsByProperty(e,t){return this.getItemsByFilter(function(i){return i[e]===t})}_$setParent(e){this.parent=e}_$highlightDropZone(e,t,i){var r;(r=this.layoutManager.dropTargetIndicator)===null||r===void 0||r.highlightArea(i)}_$onDrop(e,t){this.addChild(e)}_$hide(){this._callOnActiveComponents("hide"),this.element.hide(),this.layoutManager.updateSize()}_$show(){this._callOnActiveComponents("show"),this.element.show(),this.layoutManager.updateSize()}_callOnActiveComponents(e){for(var t=this.getItemsByType("stack"),i=null,r=0;r<t.length;r++)i=t[r].getActiveContentItem(),i&&We(i)&&i.container[e]()}_$destroy(){this.emitBubblingEvent("beforeItemDestroyed"),this.callDownwards("_$destroy",[],!0,!0),this.element.remove(),this.emitBubblingEvent("itemDestroyed")}_$getArea(e){var t,i,r;e=e||this.element;var o=(t=e.offset())!==null&&t!==void 0?t:{left:0,top:0},s=(i=e.width())!==null&&i!==void 0?i:0,a=(r=e.height())!==null&&r!==void 0?r:0;return{x1:o.left,y1:o.top,x2:o.left+s,y2:o.top+a,surface:s*a,contentItem:this,side:""}}_$init(){this.setSize();for(var e=0;e<this.contentItems.length;e++){var t;(t=this.childElementContainer)===null||t===void 0||t.append(this.contentItems[e].element)}this.isInitialised=!0,this.emitBubblingEvent("itemCreated"),this.emitBubblingEvent(this.type+"Created")}emitBubblingEvent(e){var t=new ji(e,this);this.emit(e,t)}_createContentItems(e){var t;if(!(e.content instanceof Array))throw new kt("content must be an Array",e);for(var i=0;i<e.content.length;i++)t=this.layoutManager.createContentItem(e.content[i],this),this.contentItems.push(t)}_extendItemNode(e){for(var[t,i]of Object.entries(Ls)){var r=t;e[r]===void 0&&(e[r]=i)}return e}_propagateEvent(e,t){t instanceof ji&&t.isPropagationStopped===!1&&this.isInitialised===!0&&(this.isRoot===!1&&this.parent?this.parent.emit.apply(this.parent,[e,t]):this._scheduleEventPropagationToLayoutManager(e,t))}_scheduleEventPropagationToLayoutManager(e,t){this._throttledEvents.indexOf(e)===-1?this.layoutManager.emit(e,t.origin):this._pendingEventPropagations[e]!==!0&&(this._pendingEventPropagations[e]=!0,zi(this._propagateEventToLayoutManager.bind(this,e,t)))}_propagateEventToLayoutManager(e,t){this._pendingEventPropagations[e]=!1,this.layoutManager.emit(e,t)}}function ln(n,e,t){return(e=Tm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Tm(n){var e=Om(n,"string");return typeof e=="symbol"?e:e+""}function Om(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Xs extends ge{constructor(e,t,i){var r;Object.entries((r=e.config.settings.defaultComponentConfig)!==null&&r!==void 0?r:{}).forEach(a=>{var[l,u]=a;t[l]===void 0&&(t[l]=u)}),super(e,t,i,T()),ln(this,"config",void 0),ln(this,"componentName",void 0),ln(this,"container",void 0),ln(this,"parent",void 0),ln(this,"instance",void 0),this.config=t,this.parent=i;var o=e.getComponent(this.config.componentName)||e.getFallbackComponent(),s=T.extend(!0,{},this.config.componentState||{});if(o==null)throw new kt('Unknown component "'+this.config.componentName+'"');s.componentName=this.config.componentName,this.componentName=this.config.componentName,this.config.title===""&&(this.config.title=this.config.componentName),this.isComponent=!0,this.container=new Mi(this.config,this,e),this.instance=new o(this.container,s),this.element=this.container._element}close(){this.parent.removeChild(this)}setSize(){this.element.is(":visible")&&this.container._$setSize(this.element.width(),this.element.height())}_$init(){ge.prototype._$init.call(this),this.container.emit("open")}_$hide(){this.container.hide(),ge.prototype._$hide.call(this)}_$show(){this.container.show(),this.container._config.isFocusOnShow&&this.container._contentElement[0].focus({preventScroll:!0}),ge.prototype._$show.call(this)}_$destroy(){this.container.emit("destroy",this),ge.prototype._$destroy.call(this)}_$getArea(){return null}}function $e(n,e,t){return(e=xm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function xm(n){var e=Im(n,"string");return typeof e=="symbol"?e:e+""}function Im(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Jn extends ge{constructor(e,t,i,r){super(t,i,r,T('<div class="lm_item lm_'+(e?"column":"row")+'"></div>')),$e(this,"isRow",void 0),$e(this,"isColumn",void 0),$e(this,"childElementContainer",void 0),$e(this,"parent",void 0),$e(this,"_splitter",[]),$e(this,"_splitterSize",void 0),$e(this,"_splitterGrabSize",void 0),$e(this,"_isColumn",void 0),$e(this,"_dimension",void 0),$e(this,"_splitterPosition",null),$e(this,"_splitterMinPosition",null),$e(this,"_splitterMaxPosition",null),this.parent=r,this.isRow=!e,this.isColumn=e,this.childElementContainer=this.element,this._splitterSize=t.config.dimensions.borderWidth,this._splitterGrabSize=t.config.dimensions.borderGrabWidth,this._isColumn=e,this._dimension=e?"height":"width",this._splitterPosition=null,this._splitterMinPosition=null,this._splitterMaxPosition=null}addChild(e,t,i){var r,o,s,a;if(e=this.layoutManager._$normalizeContentItem(e,this),t===void 0&&(t=this.contentItems.length),this.contentItems.length>0?(a=this._createSplitter(Math.max(0,t-1)).element,t>0?(this.contentItems[t-1].element.after(a),a.after(e.element)):(this.contentItems[0].element.before(a),a.before(e.element))):this.childElementContainer.append(e.element),ge.prototype.addChild.call(this,e,t),r=1/this.contentItems.length*100,i===!0){this.emitBubblingEvent("stateChanged");return}for(s=0;s<this.contentItems.length;s++)if(this.contentItems[s]===e)e.config[this._dimension]=r;else{var l;o=((l=this.contentItems[s].config[this._dimension])!==null&&l!==void 0?l:0)*(100-r)/100,this.contentItems[s].config[this._dimension]=o}this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}removeChild(e,t){var i,r=(i=e.config[this._dimension])!==null&&i!==void 0?i:0,o=this.contentItems.indexOf(e),s=Math.max(o-1,0),a,l;if(o===-1)throw new Error("Can't remove child. ContentItem is not child of this Row or Column");for(this._splitter[s]&&(this._splitter[s]._$destroy(),this._splitter.splice(s,1)),a=0;a<this.contentItems.length;a++)if(this.contentItems[a]!==e){var u;this.contentItems[a].config[this._dimension]=((u=this.contentItems[a].config[this._dimension])!==null&&u!==void 0?u:0)+r/(this.contentItems.length-1)}ge.prototype.removeChild.call(this,e,t),this.contentItems.length===1&&this.config.isClosable===!0?(l=this.contentItems[0],this.contentItems=[],this.parent.replaceChild(this,l,!0)):(this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged"))}replaceChild(e,t){var i=e.config[this._dimension];super.replaceChild(e,t),t.config[this._dimension]=i,this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}setSize(){this.contentItems.length>0&&(this._calculateRelativeSizes(),this._setAbsoluteSizes()),this.emitBubblingEvent("stateChanged"),this.emit("resize")}_$init(){if(this.isInitialised!==!0){var e;for(ge.prototype._$init.call(this),e=0;e<this.contentItems.length-1;e++)this.contentItems[e].element.after(this._createSplitter(e).element)}}_setAbsoluteSizes(){var e,t=this._calculateAbsoluteSizes();for(e=0;e<this.contentItems.length;e++)t.additionalPixel-e>0&&t.itemSizes[e]++,this._isColumn?(this.contentItems[e].element.width(t.totalWidth),this.contentItems[e].element.height(t.itemSizes[e])):(this.contentItems[e].element.width(t.itemSizes[e]),this.contentItems[e].element.height(t.totalHeight))}_calculateAbsoluteSizes(){var e,t,i=(this.contentItems.length-1)*this._splitterSize,r=(e=this.element.width())!==null&&e!==void 0?e:0,o=(t=this.element.height())!==null&&t!==void 0?t:0,s=0,a=[];this._isColumn?o-=i:r-=i;for(var l=0;l<this.contentItems.length;l++){var u,h,m=this._isColumn?Math.floor(o*(((u=this.contentItems[l].config.height)!==null&&u!==void 0?u:0)/100)):Math.floor(r*(((h=this.contentItems[l].config.width)!==null&&h!==void 0?h:0)/100));s+=m,a.push(m)}var p=Math.floor((this._isColumn?o:r)-s);return{itemSizes:a,additionalPixel:p,totalWidth:r,totalHeight:o}}_calculateRelativeSizes(){for(var e=0,t=[],i=this._isColumn?"height":"width",r=0;r<this.contentItems.length;r++){var o=this.contentItems[r].config[i];o!=null?e+=o:t.push(this.contentItems[r])}if(Math.round(e)===100){this._respectMinItemWidth();return}if(Math.round(e)<100&&t.length>0){for(var s=0;s<t.length;s++)t[s].config[i]=(100-e)/t.length;this._respectMinItemWidth();return}if(Math.round(e)>100)for(var a=0;a<t.length;a++)t[a].config[i]=50,e+=50;for(var l=0;l<this.contentItems.length;l++){var u;this.contentItems[l].config[i]=((u=this.contentItems[l].config[i])!==null&&u!==void 0?u:0)/e*100}this._respectMinItemWidth()}_respectMinItemWidth(){var e,t=this.layoutManager.config.dimensions&&(e=this.layoutManager.config.dimensions.minItemWidth)!==null&&e!==void 0?e:0,i=[],r=0,o=0,s=0,a=[],l;if(!(this._isColumn||!t||this.contentItems.length<=1)){for(var u=this._calculateAbsoluteSizes(),h=0;h<this.contentItems.length;h++){this.contentItems[h];var m=u.itemSizes[h];m<t?(o+=t-m,l={width:t}):(r+=m-t,l={width:m},i.push(l)),a.push(l)}if(!(o===0||o>r)){var p=o/r;s=o;for(var v=0;v<i.length;v++){l=i[v];var g=Math.round((l.width-t)*p);s-=g,l.width-=g}s!==0&&(a[a.length-1].width-=s);for(var f=0;f<this.contentItems.length;f++)this.contentItems[f].config.width=a[f].width/u.totalWidth*100}}}_createSplitter(e){var t;return t=new Ys(this._isColumn,this._splitterSize,this._splitterGrabSize),t.on("drag",this._onSplitterDrag.bind(this,t),this),t.on("dragStop",this._onSplitterDragStop.bind(this,t),this),t.on("dragStart",this._onSplitterDragStart.bind(this,t),this),this._splitter.splice(e,0,t),t}_getItemsForSplitter(e){var t=this._splitter.indexOf(e);if(t<0)throw new Error("Splitter not found in RowOrColumn");return{before:this.contentItems[t],after:this.contentItems[t+1]}}_getMinimumDimensions(e){for(var t=0,i=0,r=0;r<e.length;++r){var o,s;t=Math.max((o=e[r].minWidth)!==null&&o!==void 0?o:0,t),i=Math.max((s=e[r].minHeight)!==null&&s!==void 0?s:0,i)}return{horizontal:t,vertical:i}}_onSplitterDragStart(e){var t,i,r,o,s=this._getItemsForSplitter(e),a=this.layoutManager.config.dimensions[this._isColumn?"minItemHeight":"minItemWidth"],l=this._getMinimumDimensions((t=s.before.config.content)!==null&&t!==void 0?t:[]),u=this._isColumn?l.vertical:l.horizontal,h=this._getMinimumDimensions((i=s.after.config.content)!==null&&i!==void 0?i:[]),m=this._isColumn?h.vertical:h.horizontal;this._splitterPosition=0,this._splitterMinPosition=-1*(((r=s.before.element[this._dimension]())!==null&&r!==void 0?r:0)-(u||a)),this._splitterMaxPosition=((o=s.after.element[this._dimension]())!==null&&o!==void 0?o:0)-(m||a)}_onSplitterDrag(e,t,i){var r=this._isColumn?i:t;this._splitterMaxPosition==null||this._splitterMinPosition==null||r>this._splitterMinPosition&&r<this._splitterMaxPosition&&(this._splitterPosition=r,e.element.css(this._isColumn?"top":"left",r))}_onSplitterDragStop(e){var t,i,r,o,s,a=this._getItemsForSplitter(e),l=(t=a.before.element[this._dimension]())!==null&&t!==void 0?t:0,u=(i=a.after.element[this._dimension]())!==null&&i!==void 0?i:0,h=(((r=this._splitterPosition)!==null&&r!==void 0?r:0)+l)/(l+u),m=((o=a.before.config[this._dimension])!==null&&o!==void 0?o:0)+((s=a.after.config[this._dimension])!==null&&s!==void 0?s:0);a.before.config[this._dimension]=h*m,a.after.config[this._dimension]=(1-h)*m,e.element.css({top:0,left:0}),zi(this.callDownwards.bind(this,"setSize",void 0,void 0,void 0))}}function so(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function ao(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?so(Object(t),!0).forEach(function(i){ki(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):so(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function ki(n,e,t){return(e=Mm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Mm(n){var e=Dm(n,"string");return typeof e=="symbol"?e:e+""}function Dm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ni extends ge{constructor(e,t,i){super(e,ao(ao({},t),{},{type:"root"}),null,T('<div class="lm_goldenlayout lm_item lm_root"></div>')),ki(this,"childElementContainer",void 0),ki(this,"_containerElement",void 0),this.isRoot=!0,this.type="root",this.childElementContainer=this.element,this._containerElement=i,this._containerElement.append(this.element)}addChild(e,t){if(this.contentItems.length>0)throw new Error("Root node can only have a single child");e=this.layoutManager._$normalizeContentItem(e,this),this.childElementContainer.append(e.element),super.addChild(e,t),this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}setSize(e,t){var i,r;e=typeof e>"u"?(i=this._containerElement.width())!==null&&i!==void 0?i:0:e,t=typeof t>"u"?(r=this._containerElement.height())!==null&&r!==void 0?r:0:t,this.element.width(e),this.element.height(t),this.contentItems[0]&&(this.contentItems[0].element.width(e),this.contentItems[0].element.height(t))}_$getArea(){var e=super._$getArea();if(e==null)throw new Error("Unable to get root area");return e}_$highlightDropZone(e,t,i){this.layoutManager.tabDropPlaceholder.remove(),super._$highlightDropZone(e,t,i)}_$onDrop(e,t){var i;if(We(e)&&(i=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this),i._$init(),i.addChild(e),e=i),!this.contentItems.length)this.addChild(e);else{var{side:r}=t,o=r==="left"||r==="right"?"row":"column",s=r==="left"||r==="right"?"width":"height",a=r==="left"||r==="top",l=this.contentItems[0];if(!(l instanceof Jn)||l.type!=o){var u=this.layoutManager.createContentItem({type:o},this);this.replaceChild(l,u),u.addChild(e,a?0:void 0,!0),u.addChild(l,a?void 0:0,!0),l.config[s]=50,e.config[s]=50,u.callDownwards("setSize")}else{var h,m=l.contentItems[a?0:l.contentItems.length-1];l.addChild(e,a?0:void 0,!0),m.config[s]=((h=m.config[s])!==null&&h!==void 0?h:0)*.5,e.config[s]=m.config[s],l.callDownwards("setSize")}}}}function lo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Kt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?lo(Object(t),!0).forEach(function(i){Oe(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):lo(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Oe(n,e,t){return(e=jm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jm(n){var e=km(n,"string");return typeof e=="symbol"?e:e+""}function km(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ai extends ge{constructor(e,t,i){var r,o,s,a,l,u,h,m,p;super(e,t,i,T('<div class="lm_item lm_stack"></div>')),Oe(this,"_activeContentItem",null),Oe(this,"_header",void 0),Oe(this,"childElementContainer",T('<div class="lm_items"></div>')),Oe(this,"header",void 0),Oe(this,"parent",void 0),Oe(this,"isStack",!0),Oe(this,"_dropZones",{}),Oe(this,"_dropSegment",null),Oe(this,"_contentAreaDimensions",null),Oe(this,"_dropIndex",void 0),Oe(this,"_side",void 0),Oe(this,"_sided",!1),Oe(this,"config",void 0),this.parent=i,this.config=t;var v=e.config;this._side=!1,this._header={show:((r=v.settings)===null||r===void 0?void 0:r.hasHeaders)&&t.hasHeaders!==!1,popout:(o=v.settings)!==null&&o!==void 0&&o.showPopoutIcon?(s=v.labels)===null||s===void 0?void 0:s.popout:void 0,maximise:(a=v.settings)!==null&&a!==void 0&&a.showMaximiseIcon?(l=v.labels)===null||l===void 0?void 0:l.maximise:void 0,close:(u=v.settings)!==null&&u!==void 0&&u.showCloseIcon?(h=v.labels)===null||h===void 0?void 0:h.close:void 0,minimise:(m=(p=v.labels)===null||p===void 0?void 0:p.minimise)!==null&&m!==void 0?m:void 0},v.header&&(this._header=Kt(Kt({},this._header),v.header)),t.header&&(this._header=Kt(Kt({},this._header),t.header)),t.content&&t.content[0]&&t.content[0].header&&(this._header=Kt(Kt({},this._header),t.content[0].header)),this.header=new ct(e,this),this.element.append(this.header.element),this.element.append(this.childElementContainer),this._setupHeaderPosition(),this._$validateClosability()}setSize(){var e,t,i,r,o,s=this._header.show&&(e=(t=this.layoutManager.config.dimensions)===null||t===void 0?void 0:t.headerHeight)!==null&&e!==void 0?e:0,a=((i=this.element.width())!==null&&i!==void 0?i:0)-(this._sided?s:0),l=((r=this.element.height())!==null&&r!==void 0?r:0)-(this._sided?0:s);for(this.childElementContainer.width(a),this.childElementContainer.height(l),o=0;o<this.contentItems.length;o++)this.contentItems[o].element.width(a).height(l);this.emit("resize"),this.emitBubblingEvent("stateChanged")}_$init(){if(this.isInitialised!==!0){this.header._attachWheelListener(),super._$init();for(var e=0;e<this.contentItems.length;e++)this.header.createTab(this.contentItems[e]),this.contentItems[e]._$hide();if(this.contentItems.length>0){var t=this.contentItems[this.config.activeItemIndex||0];if(!t)throw new Error("Configured activeItemIndex out of bounds");this.setActiveContentItem(t)}}}setActiveContentItem(e){if(this.contentItems.indexOf(e)===-1)throw new Error("contentItem is not a child of this stack");this._activeContentItem!==null&&this._activeContentItem._$hide(),this._activeContentItem=e,this.header.setActiveContentItem(e),e._$show(),this.emit("activeContentItemChanged",e),this.layoutManager.emit("activeContentItemChanged",e),this.emitBubblingEvent("stateChanged")}getActiveContentItem(){return this.header.activeContentItem}addChild(e,t){e=this.layoutManager._$normalizeContentItem(e,this),super.addChild(e,t),this.childElementContainer.append(e.element),this.header.createTab(e,t),this.setActiveContentItem(e),this.callDownwards("setSize"),this._$validateClosability(),this.emitBubblingEvent("stateChanged")}removeChild(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=this.contentItems.indexOf(e);super.removeChild(e,t),this.header.removeTab(e),this.header.activeContentItem===e&&(this.contentItems.length>0?this.setActiveContentItem(this.contentItems[Math.max(i-1,0)]):this._activeContentItem=null),this._$validateClosability(),this.emitBubblingEvent("stateChanged")}_$validateClosability(){for(var e=this.header._isClosable(),t=0,i=this.contentItems.length;t<i;t++){var r;if(!e)break;e=(r=this.contentItems[t].config.isClosable)!==null&&r!==void 0?r:!1}this.header._$setClosable(e)}_$destroy(){ge.prototype._$destroy.call(this),this.header._$destroy()}_$onDrop(e){if(this._dropSegment==="header"){this._resetHeaderDropZone(),this.addChild(e,this._dropIndex);return}if(this._dropSegment==="body"){this.addChild(e);return}var t=this._dropSegment==="top"||this._dropSegment==="bottom",i=this._dropSegment==="left"||this._dropSegment==="right",r=this._dropSegment==="top"||this._dropSegment==="left",o=t&&this.parent.isColumn||i&&this.parent.isRow,s=t?"column":"row",a=t?"height":"width";if(We(e)){var l=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this);l._$init(),l.addChild(e),e=l}if(o){var u,h=this.parent.contentItems.indexOf(this);this.parent.addChild(e,r?h:h+1,!0),this.config[a]=((u=this.config[a])!==null&&u!==void 0?u:0)*.5,e.config[a]=this.config[a],this.parent.callDownwards("setSize")}else{var m=this.layoutManager.createContentItem({type:s},this);this.parent.replaceChild(this,m),m.addChild(e,r?0:void 0,!0),m.addChild(this,r?void 0:0,!0),this.config[a]=50,e.config[a]=50,m.callDownwards("setSize")}}_$highlightDropZone(e,t){if(this._contentAreaDimensions)for(var[i,r]of Object.entries(this._contentAreaDimensions)){var o=r.hoverArea;if(o.x1<e&&o.x2>e&&o.y1<t&&o.y2>t){i==="header"?(this._dropSegment="header",this._highlightHeaderDropZone(e)):(this._resetHeaderDropZone(),this._highlightBodyDropZone(i));return}}}_$getArea(){if(this.element.is(":visible")===!1)return null;var e=super._$getArea(this.header.element),t=super._$getArea(this.childElementContainer);if(e==null||t==null)return null;var i=t.x2-t.x1,r=t.y2-t.y1;return this._contentAreaDimensions={header:{hoverArea:{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},highlightArea:{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}}},this._activeContentItem&&this._activeContentItem.isComponent===!1?e:this.contentItems.length===0?(this._contentAreaDimensions.body={hoverArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2}},super._$getArea(this.element)):(this._contentAreaDimensions.left={hoverArea:{x1:t.x1,y1:t.y1,x2:t.x1+i*.25,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x1+i*.5,y2:t.y2}},this._contentAreaDimensions.top={hoverArea:{x1:t.x1+i*.25,y1:t.y1,x2:t.x1+i*.75,y2:t.y1+r*.5},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y1+r*.5}},this._contentAreaDimensions.right={hoverArea:{x1:t.x1+i*.75,y1:t.y1,x2:t.x2,y2:t.y2},highlightArea:{x1:t.x1+i*.5,y1:t.y1,x2:t.x2,y2:t.y2}},this._contentAreaDimensions.bottom={hoverArea:{x1:t.x1+i*.25,y1:t.y1+r*.5,x2:t.x1+i*.75,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1+r*.5,x2:t.x2,y2:t.y2}},super._$getArea(this.element))}_highlightHeaderDropZone(e){var t,i,r,o,s,a,l,u,h,m,p,v,g,f,y,_,S=this.header.tabs.length;if(S===0){var C,M,K,Y,x,z,N,Q,te=this.header.element.offset();(C=this.layoutManager.dropTargetIndicator)===null||C===void 0||C.highlightArea({x1:(M=te==null?void 0:te.left)!==null&&M!==void 0?M:0,x2:((K=te==null?void 0:te.left)!==null&&K!==void 0?K:0)+100,y1:(Y=(x=this.header.element.offset())===null||x===void 0?void 0:x.top)!==null&&Y!==void 0?Y:0,y2:((z=(N=this.header.element.offset())===null||N===void 0?void 0:N.top)!==null&&z!==void 0?z:0)+((Q=this.header.element.innerHeight())!==null&&Q!==void 0?Q:0)});return}var j=this.header.tabsContainer,V=(t=j.get(0))===null||t===void 0?void 0:t.getBoundingClientRect(),R=(i=this.layoutManager.tabDropPlaceholder.get(0))===null||i===void 0?void 0:i.getBoundingClientRect();if(!(!V||!R)){e<V.left?e=V.left+1:e>V.right&&(e=V.right-1);var D,F;if(!(R.left<e&&e<R.right)){for(var U=0;U<S;U++){var ce;if(D=this.header.tabs[U].element,F=(ce=D.get(0))===null||ce===void 0?void 0:ce.getBoundingClientRect(),F&&F.left<e&&e<F.right){this._dropIndex=U;break}}if(D&&F&&e<F.left+F.width*.5)D.before(this.layoutManager.tabDropPlaceholder);else if(D){var Je;this._dropIndex=Math.min(((Je=this._dropIndex)!==null&&Je!==void 0?Je:0)+1,S),D.after(this.layoutManager.tabDropPlaceholder)}}var ze=(r=(o=this.layoutManager.tabDropPlaceholder.offset())===null||o===void 0?void 0:o.left)!==null&&r!==void 0?r:0;ze=Math.max(ze,(s=(a=this.header.tabsContainer.offset())===null||a===void 0?void 0:a.left)!==null&&s!==void 0?s:0);var k=ze+((l=this.layoutManager.tabDropPlaceholder.width())!==null&&l!==void 0?l:0);k=Math.min(k,((u=(h=this.header.tabsContainer.offset())===null||h===void 0?void 0:h.left)!==null&&u!==void 0?u:0)+((m=this.header.tabsContainer.innerWidth())!==null&&m!==void 0?m:0)),(p=this.layoutManager.dropTargetIndicator)===null||p===void 0||p.highlightArea({x1:ze,x2:k,y1:(v=(g=this.header.element.offset())===null||g===void 0?void 0:g.top)!==null&&v!==void 0?v:0,y2:((f=(y=this.header.element.offset())===null||y===void 0?void 0:y.top)!==null&&f!==void 0?f:0)+((_=this.header.element.innerHeight())!==null&&_!==void 0?_:0)})}}_resetHeaderDropZone(){this.layoutManager.tabDropPlaceholder.remove()}_setupHeaderPosition(){var e=["right","left","bottom"].some(i=>i===this._header.show)?this._header.show:void 0;if(this.header.element.toggle(!!this._header.show),!!e&&(this._side=e,this._sided=["right","left"].indexOf(this._side.toString())>=0,this.element.removeClass("lm_left lm_right lm_bottom"),this._side&&this.element.addClass("lm_"+this._side),this.element.find(".lm_header").length&&this.childElementContainer)){var t=["right","bottom"].indexOf(this._side.toString())>=0?"before":"after";this.header.element[t](this.childElementContainer),this.callDownwards("setSize")}}_highlightBodyDropZone(e){var t,i,r=(t=this._contentAreaDimensions)===null||t===void 0||(i=t[e])===null||i===void 0?void 0:i.highlightArea;if(r){var o;(o=this.layoutManager.dropTargetIndicator)===null||o===void 0||o.highlightArea(r)}this._dropSegment=e}}const Nm=Object.freeze(Object.defineProperty({__proto__:null,AbstractContentItem:ge,Component:Xs,ContentItem:ge,Root:Ni,RowOrColumn:Jn,Stack:Ai,isComponent:We,isRoot:Zs,isStack:At},Symbol.toStringTag,{value:"Module"}));function at(n,e,t){return(e=Am(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Am(n){var e=Lm(n,"string");return typeof e=="symbol"?e:e+""}function Lm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class In{constructor(e,t){var i;at(this,"header",void 0),at(this,"contentItem",void 0),at(this,"element",T(In._template)),at(this,"titleElement",void 0),at(this,"closeElement",void 0),at(this,"isActive",!1),at(this,"_layoutManager",void 0),at(this,"_dragListener",void 0),this.header=e,this.contentItem=t,this.titleElement=this.element.find(".lm_title"),this.closeElement=this.element.find(".lm_close_tab"),this.closeElement[t.config.isClosable?"show":"hide"](),this.setTitle(t.config.title),this.contentItem.on("titleChanged",this.setTitle,this),this._layoutManager=this.contentItem.layoutManager,(i=this._layoutManager.config.settings)!==null&&i!==void 0&&i.reorderEnabled&&t.config.reorderEnabled&&(this._dragListener=new On(this.element),this._dragListener.on("dragStart",this._onDragStart,this),this.contentItem.on("destroy",this._dragListener.destroy,this._dragListener)),this._onTabClick=this._onTabClick.bind(this),this._onCloseClick=this._onCloseClick.bind(this),this._onTabContentFocusIn=this._onTabContentFocusIn.bind(this),this._onTabContentFocusOut=this._onTabContentFocusOut.bind(this),this.element.on("click",this._onTabClick),this.element.on("auxclick",this._onTabClick),this.contentItem.config.isClosable?(this.closeElement.on("click",this._onCloseClick),this.closeElement.on("mousedown",this._onCloseMousedown)):this.closeElement.remove(),this.contentItem.tab=this,this.contentItem.emit("tab",this),this.contentItem.layoutManager.emit("tabCreated",this),We(this.contentItem)&&(this.contentItem.container._contentElement.on("focusin",this._onTabContentFocusIn).on("focusout",this._onTabContentFocusOut),this.contentItem.container.tab=this,this.contentItem.container.emit("tab",this))}setTitle(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";this.titleElement.text(e)}setActive(e){e!==this.isActive&&(this.isActive=e,e?this.element.addClass("lm_active"):this.element.removeClass("lm_active"))}_$destroy(){this.element.off("click",this._onTabClick),this.element.off("auxclick",this._onTabClick),this.closeElement.off("click",this._onCloseClick),We(this.contentItem)&&(this.contentItem.container._contentElement.off(),this.contentItem.container._contentElement[0].removeEventListener("click",this._onTabContentFocusIn,!0)),this._dragListener&&(this.contentItem.off("destroy",this._dragListener.destroy,this._dragListener),this._dragListener.off("dragStart",this._onDragStart),this._dragListener=void 0),this.element.remove()}_onDragStart(e,t){var i;(i=this.contentItem.parent)!==null&&i!==void 0&&i.isMaximised&&this.contentItem.parent.toggleMaximise(),this._dragListener&&new $t(e,t,this._dragListener,this._layoutManager,this.contentItem,this.header.parent)}_onTabContentFocusIn(){T(".lm_focusin",this._layoutManager.root.element).removeClass("lm_focusin"),this.element.addClass("lm_focusin")}_onTabContentFocusOut(){We(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.element.removeClass("lm_focusin")}_onTabClick(e){if(!e||e.button===0){var t,i=this.header.parent.getActiveContentItem();this.contentItem!==i&&We(this.contentItem)?this.header.parent.setActiveContentItem(this.contentItem):We(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.contentItem.container._contentElement.focus(),We(this.contentItem)&&this.contentItem.container.emit("tabClicked",e),this.header._hideAdditionalTabsDropdown(),(t=this.element.get(0))===null||t===void 0||t.scrollIntoView({inline:"nearest"})}else e.button===1&&this.contentItem.config.isClosable&&this._onCloseClick(e)}_onCloseClick(e){e.stopPropagation(),We(this.contentItem)?this.contentItem.container.close():this.header.parent.removeChild(this.contentItem)}_onCloseMousedown(e){e.stopPropagation()}}at(In,"_template",['<li class="lm_tab">','<span class="lm_title_before"></span>','<span class="lm_title"></span>','<div class="lm_close_tab" aria-label="Close tab"></div>',"</li>"].join(""));function q(n,e,t){return(e=Rm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Rm(n){var e=Fm(n,"string");return typeof e=="symbol"?e:e+""}function Fm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ct extends Pe{constructor(e,t){var i,r;super(),q(this,"layoutManager",void 0),q(this,"element",T(ct._template)),q(this,"tabsContainer",void 0),q(this,"tabDropdownContainer",void 0),q(this,"tabDropdownSearch",void 0),q(this,"tabDropdownList",null),q(this,"controlsContainer",void 0),q(this,"parent",void 0),q(this,"tabs",[]),q(this,"activeContentItem",null),q(this,"closeButton",null),q(this,"tabDropdownButton",null),q(this,"tabNextButton",T(ct._nextButtonTemplate)),q(this,"tabPreviousButton",T(ct._previousButtonTemplate)),q(this,"holdTimer",null),q(this,"rAF",null),q(this,"CLICK_TIMEOUT",500),q(this,"START_SPEED",.01),q(this,"ACCELERATION",5e-4),q(this,"PADDING",10),q(this,"SCROLL_LEFT","left"),q(this,"SCROLL_RIGHT","right"),q(this,"isDraggingTab",!1),q(this,"isOverflowing",!1),q(this,"isDropdownShown",!1),q(this,"dropdownKeyIndex",0),q(this,"_lastVisibleTabIndex",-1),q(this,"_tabControlOffset",void 0),this.layoutManager=e,(i=this.layoutManager.config.settings)!==null&&i!==void 0&&i.selectionEnabled&&(this.element.addClass("lm_selectable"),this.element.on("click",this._onHeaderClick.bind(this))),this.tabsContainer=this.element.find(".lm_tabs"),this.tabDropdownContainer=this.element.find(".lm_tabdropdown_list"),this.tabDropdownContainer.hide(),this.tabDropdownSearch=this.element.find(".lm_tabdropdown_search input"),this._handleFilterInput=this._handleFilterInput.bind(this),this._handleFilterKeydown=this._handleFilterKeydown.bind(this),this.tabDropdownSearch.on("input",this._handleFilterInput),this.tabDropdownSearch.on("keydown",this._handleFilterKeydown),this.controlsContainer=this.element.find(".lm_controls"),this.parent=t,this.parent.on("resize",this._updateTabSizes,this),this._handleItemPickedUp=this._handleItemPickedUp.bind(this),this._handleItemDropped=this._handleItemDropped.bind(this),this._handleNextMouseEnter=this._handleNextMouseEnter.bind(this),this._handleNextMouseLeave=this._handleNextMouseLeave.bind(this),this._handlePreviousMouseEnter=this._handlePreviousMouseEnter.bind(this),this._handlePreviousMouseLeave=this._handlePreviousMouseLeave.bind(this),this._handleScrollRepeat=this._handleScrollRepeat.bind(this),this._handleNextButtonMouseDown=this._handleNextButtonMouseDown.bind(this),this._handlePreviousButtonMouseDown=this._handlePreviousButtonMouseDown.bind(this),this._handleScrollButtonMouseDown=this._handleScrollButtonMouseDown.bind(this),this._handleScrollButtonMouseUp=this._handleScrollButtonMouseUp.bind(this),this._handleScrollEvent=this._handleScrollEvent.bind(this),this.tabNextButton.on("mousedown",this._handleNextButtonMouseDown),this.tabPreviousButton.on("mousedown",this._handlePreviousButtonMouseDown),this.tabsContainer.on("scroll",this._handleScrollEvent),this.layoutManager.on("itemPickedUp",this._handleItemPickedUp),this.layoutManager.on("itemDropped",this._handleItemDropped),this.tabsContainer.before(this.tabPreviousButton),this.tabPreviousButton=this.tabPreviousButton.find(">:first-child"),this.tabPreviousButton.hide(),this._showAdditionalTabsDropdown=this._showAdditionalTabsDropdown.bind(this),this._hideAdditionalTabsDropdown=this._hideAdditionalTabsDropdown.bind(this),this._tabControlOffset=(r=this.layoutManager.config.settings)===null||r===void 0?void 0:r.tabControlOffset,this._createControls()}createTab(e,t){for(var i=0;i<this.tabs.length;i++)if(this.tabs[i].contentItem===e)return;var r=new In(this,e);if(this.tabs.length===0){this.tabs.push(r),this.tabsContainer.append(r.element);return}t===void 0&&(t=this.tabs.length),t>0?this.tabs[t-1].element.after(r.element):this.tabs[0].element.before(r.element),this.tabs.splice(t,0,r),this._updateTabSizes()}removeTab(e){for(var t=0;t<this.tabs.length;t++)if(this.tabs[t].contentItem===e){this.tabs[t]._$destroy(),this.tabs.splice(t,1);return}throw new Error("contentItem is not controlled by this header")}setActiveContentItem(e){for(var t,i,r,o,s=0;s<this.tabs.length;s++)o=this.tabs[s].contentItem===e,this.tabs[s].setActive(o),o===!0&&(this.activeContentItem=e,this.parent.config.activeItemIndex=s);(t=this.tabs[(r=this.parent.config.activeItemIndex)!==null&&r!==void 0?r:0].element.get(0))===null||t===void 0||(i=t.scrollIntoView)===null||i===void 0||i.call(t,{inline:"nearest"}),this._hideAdditionalTabsDropdown(),this._updateTabSizes(),this.parent.emitBubblingEvent("stateChanged")}position(e){var t=this.parent._header.show;return t&&!this.parent._side&&(t="top"),e!==void 0&&this.parent._header.show!==e&&(this.parent._header.show=e,this.parent._setupHeaderPosition()),t}_attachWheelListener(){var e;(e=this.tabsContainer.get(0))===null||e===void 0||e.addEventListener("wheel",this._handleWheelEvent,{passive:!0})}_detachWheelListener(){var e;(e=this.tabsContainer.get(0))===null||e===void 0||e.removeEventListener("wheel",this._handleWheelEvent)}_handleWheelEvent(e){var t=e.currentTarget;if(t instanceof HTMLElement){var i=Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX;if(e.deltaMode===WheelEvent.DOM_DELTA_PAGE){var r;i*=(r=this.tabsContainer.innerWidth())!==null&&r!==void 0?r:1}else e.deltaMode===WheelEvent.DOM_DELTA_LINE&&(i*=100/3);t.scrollLeft+=Math.round(i)}}_handleScrollEvent(){this._checkScrollArrows()}_handleItemPickedUp(){this.isDraggingTab=!0,this.isDropdownShown&&this._hideAdditionalTabsDropdown(),this.controlsContainer.on("mouseenter",this._handleNextMouseEnter),this.tabPreviousButton.on("mouseenter",this._handlePreviousMouseEnter)}_handleItemDropped(){var e;this.isDraggingTab=!1,window.cancelAnimationFrame((e=this.rAF)!==null&&e!==void 0?e:-1),this.rAF=null,this.controlsContainer.off("mouseenter",this._handleNextMouseEnter),this.controlsContainer.off("mouseleave",this._handleNextMouseLeave),this.tabPreviousButton.off("mouseenter",this._handlePreviousMouseEnter),this.tabPreviousButton.off("mouseleave",this._handlePreviousMouseLeave)}_handleNextMouseEnter(){var e;this.controlsContainer.on("mouseleave",this._handleNextMouseLeave),this._handleScrollRepeat(this.SCROLL_RIGHT,(e=this.tabsContainer.scrollLeft())!==null&&e!==void 0?e:0)}_handlePreviousMouseEnter(){var e;this.tabPreviousButton.on("mouseleave",this._handlePreviousMouseLeave),this._handleScrollRepeat(this.SCROLL_LEFT,(e=this.tabsContainer.scrollLeft())!==null&&e!==void 0?e:0)}_handleNextMouseLeave(){var e;window.cancelAnimationFrame((e=this.rAF)!==null&&e!==void 0?e:-1),this.rAF=null,this.controlsContainer.off("mouseleave",this._handleNextMouseLeave)}_handlePreviousMouseLeave(){var e;window.cancelAnimationFrame((e=this.rAF)!==null&&e!==void 0?e:-1),this.rAF=null,this.tabPreviousButton.off("mouseleave",this._handlePreviousMouseLeave)}_handleNextButtonMouseDown(){for(var e,t=0;t<this.tabs.length;t+=1){var i,r,o,s,a;if(((i=(r=this.tabs[t].element.get(0))===null||r===void 0?void 0:r.offsetLeft)!==null&&i!==void 0?i:0)>((o=(s=this.tabsContainer.get(0))===null||s===void 0?void 0:s.offsetWidth)!==null&&o!==void 0?o:0)+((a=this.tabsContainer.scrollLeft())!==null&&a!==void 0?a:0)){e=this.tabs[t].element.get(0);break}}if(e)e.scrollIntoView({behavior:"smooth",inline:"nearest"}),this._handleScrollButtonMouseDown(this.SCROLL_RIGHT);else{var l=this.tabsContainer.get(0);if(l){var u,h;l.scrollLeft=(u=(h=this.tabsContainer.get(0))===null||h===void 0?void 0:h.scrollWidth)!==null&&u!==void 0?u:0}}}_handlePreviousButtonMouseDown(){for(var e,t=this.tabs.length-1;t>=0;t-=1){var i,r,o;if(((i=(r=this.tabs[t].element.get(0))===null||r===void 0?void 0:r.offsetLeft)!==null&&i!==void 0?i:0)<((o=this.tabsContainer.scrollLeft())!==null&&o!==void 0?o:0)){e=this.tabs[t].element.get(0);break}}if(e)e.scrollIntoView({behavior:"smooth",inline:"start"}),this._handleScrollButtonMouseDown(this.SCROLL_LEFT);else{var s=this.tabsContainer.get(0);s&&(s.scrollLeft=0)}}_handleScrollButtonMouseDown(e){this.holdTimer=window.setTimeout(()=>{var t;this._handleScrollRepeat(e,(t=this.tabsContainer.scrollLeft())!==null&&t!==void 0?t:0,100)},this.CLICK_TIMEOUT),window.addEventListener("mouseup",this._handleScrollButtonMouseUp)}_handleScrollButtonMouseUp(){var e,t;clearTimeout((e=this.holdTimer)!==null&&e!==void 0?e:-1),this.holdTimer=null,cancelAnimationFrame((t=this.rAF)!==null&&t!==void 0?t:-1),this.rAF=null,window.removeEventListener("mouseup",this._handleScrollButtonMouseUp)}_checkScrollArrows(){var e,t,i;this.tabsContainer.scrollLeft()===0?this.tabPreviousButton.first().prop("disabled",!0):((e=this.tabsContainer.scrollLeft())!==null&&e!==void 0?e:0)+((t=this.tabsContainer.innerWidth())!==null&&t!==void 0?t:0)===((i=this.tabsContainer.get(0))===null||i===void 0?void 0:i.scrollWidth)?this.tabNextButton.prop("disabled",!0):(this.tabNextButton.prop("disabled",!1),this.tabPreviousButton.first().prop("disabled",!1))}_handleScrollRepeat(e,t){var i,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3?arguments[3]:void 0,s=this.tabsContainer.get(0);if(s){var a=s.getBoundingClientRect();if(e===this.SCROLL_LEFT){if(this.tabsContainer.scrollLeft(t-r),this.isDraggingTab&&this.parent._highlightHeaderDropZone(a.left-1),this.tabsContainer.scrollLeft()===0){this._checkScrollArrows();return}}else if(e===this.SCROLL_RIGHT){var l,u;if(this.tabsContainer.scrollLeft(t+r),this.isDraggingTab&&this.parent._highlightHeaderDropZone(a.right+1),((l=this.tabsContainer.scrollLeft())!==null&&l!==void 0?l:0)+((u=this.tabsContainer.innerWidth())!==null&&u!==void 0?u:0)===s.scrollWidth){this._checkScrollArrows();return}}window.cancelAnimationFrame((i=this.rAF)!==null&&i!==void 0?i:-1),this.rAF=window.requestAnimationFrame(h=>{var m,p,v=o||h,g=h-v,f=this.START_SPEED*g+.5*this.ACCELERATION*(g*g);f=Math.min(f,(m=(p=this.tabsContainer.get(0))===null||p===void 0?void 0:p.scrollWidth)!==null&&m!==void 0?m:1/0),this._handleScrollRepeat(e,t,f,v)})}}_$setClosable(e){return this.closeButton&&this._isClosable()?(this.closeButton.element[e?"show":"hide"](),!0):!1}_$destroy(){this.emit("destroy",this);for(var e=0;e<this.tabs.length;e++)this.tabs[e]._$destroy();this._detachWheelListener(),this._handleItemDropped(),T(document).off("mouseup",this._hideAdditionalTabsDropdown),this.tabDropdownSearch.off("input",this._handleFilterInput),this.tabDropdownSearch.off("keydown",this._handleFilterKeydown),this.element.remove()}_getHeaderSetting(e){if(e in this.parent._header)return this.parent._header[e]}_createControls(){var e,t,i,r,o;if(o=this.layoutManager.config.labels.tabDropdown,this.layoutManager.config.labels.tabNextLabel,this.layoutManager.config.labels.tabPreviousLabel,this.tabDropdownButton=new mn(this,o,"lm_tabdropdown",this._showAdditionalTabsDropdown),this.tabDropdownButton.element.hide(),this.controlsContainer.prepend(this.tabNextButton),this.tabNextButton.hide(),this._getHeaderSetting("popout")&&(t=this._onPopoutClick.bind(this),i=this._getHeaderSetting("popout"),new mn(this,i,"lm_popout",t)),this._getHeaderSetting("maximise")){r=this.parent.toggleMaximise.bind(this.parent);var s=this._getHeaderSetting("maximise"),a=this._getHeaderSetting("minimise"),l=new mn(this,s,"lm_maximise",r);this.parent.on("maximised",function(){l.element.attr("title",a??"")}),this.parent.on("minimised",function(){l.element.attr("title",s??"")})}this._isClosable()&&(e=this.parent.remove.bind(this.parent),i=this._getHeaderSetting("close"),this.closeButton=new mn(this,i,"lm_close",e))}_showAdditionalTabsDropdown(){if(this.isDropdownShown){this._hideAdditionalTabsDropdown();return}this.tabDropdownList=this.tabsContainer.clone(!0).appendTo(this.tabDropdownContainer).children().removeClass("lm_active"),T(document.body).append(this.tabDropdownContainer),this.tabDropdownContainer.show(),this.isDropdownShown=!0,this.element.addClass("lm_dropdown_open"),this.tabDropdownSearch.val("").focus(),this.dropdownKeyIndex=0,this.tabDropdownList.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active"),T(document).on("mousedown",this._hideAdditionalTabsDropdown),this._updateAdditionalTabsDropdown()}_handleFilterKeydown(e){if(e.key==="Escape"){this._hideAdditionalTabsDropdown();return}if(this.dropdownKeyIndex===-1)return;if(e.key==="Enter"||e.key===" "){this._hideAdditionalTabsDropdown(),this.tabs[this.dropdownKeyIndex]._onTabClick();return}function t(a,l,u){if(u==null||u.length<2)return-1;for(var h=(a+l+u.length)%u.length;h!==a;){if(u.eq(h).css("display")!=="none")return h;h=(h+l+u.length)%u.length}return a}if(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1){var i,r;e.preventDefault(),(i=this.tabDropdownList)===null||i===void 0||i.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=t(this.dropdownKeyIndex,1,this.tabDropdownList),(r=this.tabDropdownList)===null||r===void 0||r.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active")}else if(e.key==="ArrowUp"||e.key==="Tab"){var o,s;e.preventDefault(),(o=this.tabDropdownList)===null||o===void 0||o.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=t(this.dropdownKeyIndex,-1,this.tabDropdownList),(s=this.tabDropdownList)===null||s===void 0||s.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active")}}_handleFilterInput(e){if(this.tabDropdownList!=null){this.tabDropdownList.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=-1;for(var t=0;t<this.tabDropdownList.length;t++){var i,r;((i=(r=this.tabs[t].contentItem.config.title)===null||r===void 0?void 0:r.toLowerCase().indexOf(e.target.value.toLowerCase()))!==null&&i!==void 0?i:-1)!==-1?(this.tabDropdownList.eq(t).css("display",""),this.dropdownKeyIndex===-1&&(this.dropdownKeyIndex=t)):this.tabDropdownList.eq(t).css("display","none")}this.dropdownKeyIndex!==-1&&this.tabDropdownList.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active")}}_hideAdditionalTabsDropdown(e){var t,i;this.isDropdownShown&&(e&&(t=this.tabDropdownContainer.get(0))!==null&&t!==void 0&&t.contains(e.target)||e&&((i=this.tabDropdownButton)===null||i===void 0?void 0:i.element.get(0))===e.target||(this.element.removeClass("lm_dropdown_open"),this.tabDropdownContainer.hide(),this.isDropdownShown=!1,this.element.append(this.tabDropdownContainer),this.tabDropdownContainer.find(".lm_tabs").remove(),T(document).off("mousedown",this._hideAdditionalTabsDropdown)))}_updateAdditionalTabsDropdown(){var e,t,i,r;if(this.isDropdownShown&&!(!this.tabDropdownList||this.tabDropdownList.length==0)){var o=(e=(t=this.tabDropdownContainer.get(0))===null||t===void 0?void 0:t.scrollHeight)!==null&&e!==void 0?e:0;if(o!==0){var s=this.tabDropdownContainer[0].getBoundingClientRect(),a=(i=T(window).height())!==null&&i!==void 0?i:0,l=(r=T(window).width())!==null&&r!==void 0?r:0;if(this.tabDropdownButton){var u=this.tabDropdownButton.element[0].getBoundingClientRect(),h=o<a-u.bottom,m=!h&&u.bottom>a*.6,p=Math.min(u.left+(m?u.width:0),l-s.width-this.PADDING),v=m?Math.max(u.top-o,this.PADDING):u.bottom,g=a-v-this.PADDING;this.tabDropdownContainer.css({"max-height":g,top:v,left:p})}}}}_isClosable(){return!!(this.parent.config.isClosable&&this.layoutManager.config.settings.showCloseIcon)}_onPopoutClick(){if(this.layoutManager.config.settings.popoutWholeStack===!0)this.parent.popout();else{var e;(e=this.activeContentItem)===null||e===void 0||e.popout()}}_onHeaderClick(e){e.target===this.element[0]&&this.parent.select()}_updateTabSizes(){if(this.tabs.length!==0){var e=this.tabsContainer.get(0);if(this.isDropdownShown&&this._updateAdditionalTabsDropdown(),!!e){if(!this.isOverflowing&&e.scrollWidth>e.clientWidth){var t;(t=this.tabDropdownButton)===null||t===void 0||t.element.show(),this.tabNextButton.show(),this.tabPreviousButton.show(),this.isOverflowing=!0}else if(this.isOverflowing&&e.scrollWidth<=e.clientWidth){var i;(i=this.tabDropdownButton)===null||i===void 0||i.element.hide(),this.tabNextButton.hide(),this.tabPreviousButton.hide(),this.isOverflowing=!1}this.isOverflowing&&this._checkScrollArrows()}}}}q(ct,"_template",['<div class="lm_header">','<ul class="lm_tabs"></ul>','<ul class="lm_controls"></ul>','<ul class="lm_tabdropdown_list">','<li class="lm_tabdropdown_search"><input type="text" placeholder="Find tab..."></li>',"</ul>","</div>"].join(""));q(ct,"_previousButtonTemplate",['<ul class="lm_controls">','<li class="lm_tabpreviousbutton"></li>',"</ul>"].join(""));q(ct,"_nextButtonTemplate",['<li class="lm_tabnextbutton"></li>'].join(""));function dn(n,e,t){return(e=Hm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Hm(n){var e=$m(n,"string");return typeof e=="symbol"?e:e+""}function $m(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ys{constructor(e,t,i){dn(this,"_isVertical",void 0),dn(this,"_size",void 0),dn(this,"_grabSize",void 0),dn(this,"_dragListener",void 0),dn(this,"element",void 0),this._isVertical=e,this._size=t,this._grabSize=i<t?t:i,this.element=this._createElement(),this._dragListener=new On(this.element)}on(e,t,i){var r;(r=this._dragListener)===null||r===void 0||r.on(e,t,i)}_$destroy(){var e;(e=this._dragListener)===null||e===void 0||e.destroy(),this._dragListener=null,this.element.remove()}_createElement(){var e=T('<div class="lm_drag_handle"></div>'),t=T('<div class="lm_splitter"></div>');t.append(e);var i=this._grabSize-this._size,r=i/2;return this._isVertical?(e.css("top",-r),e.css("height",this._size+i),t.addClass("lm_vertical"),t.height(this._size)):(e.css("left",-r),e.css("width",this._size+i),t.addClass("lm_horizontal"),t.width(this._size)),t}}const Um=Object.freeze(Object.defineProperty({__proto__:null,BrowserPopout:zs,DragProxy:$t,DragSource:Vs,DragSourceFromEvent:Gs,DropTargetIndicator:xn,Header:ct,HeaderButton:mn,Splitter:Ys,Tab:In},Symbol.toStringTag,{value:"Module"}));var Bm={config:Uc,container:Vc,controls:Um,errors:_m,items:Nm,utils:am};function uo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Te(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?uo(Object(t),!0).forEach(function(i){G(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):uo(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function G(n,e,t){return(e=Km(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Km(n){var e=Wm(n,"string");return typeof e=="symbol"?e:e+""}function Wm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Qs extends Pe{static minifyConfig(e){return Gi(e)}static unminifyConfig(e){return Di(e)}constructor(e,t){super(),G(this,"isInitialised",!1),G(this,"_isFullPage",!1),G(this,"_resizeTimeoutId",void 0),G(this,"_components",{"lm-react-component":Hs}),G(this,"_fallbackComponent",void 0),G(this,"_itemAreas",[]),G(this,"_maximisedItem",null),G(this,"_maximisePlaceholder",T('<div class="lm_maximise_place"></div>')),G(this,"_creationTimeoutPassed",!1),G(this,"_subWindowsCreated",!1),G(this,"_dragSources",[]),G(this,"_updatingColumnsResponsive",!1),G(this,"_firstLoad",!0),G(this,"_reactChildMap",new Map),G(this,"_reactChildren",null),G(this,"_initialHeaderHeight",void 0),G(this,"width",null),G(this,"height",null),G(this,"root",void 0),G(this,"openPopouts",[]),G(this,"selectedItem",null),G(this,"isSubWindow",!1),G(this,"eventHub",new $s(this)),G(this,"config",void 0),G(this,"container",void 0),G(this,"_originalContainer",void 0),G(this,"dropTargetIndicator",null),G(this,"tabDropPlaceholder",T('<div class="lm_drop_tab_placeholder"></div>')),G(this,"_typeToItem",void 0),this._onResize=this._onResize.bind(this),this._onUnload=this._onUnload.bind(this),this._windowBlur=this._windowBlur.bind(this),this._windowFocus=this._windowFocus.bind(this),this.config=this._createConfig(e),this._originalContainer=t,this.container=this._getContainer(),this._initialHeaderHeight=this.config.dimensions.headerHeight,this.isSubWindow&&T("body").css("visibility","hidden"),this._typeToItem={column:Jn.bind(this,!0),row:Jn.bind(this,!1),stack:Ai,component:Xs}}registerComponent(e,t){if(typeof t!="function"&&(t==null||t.render==null||typeof t.render!="function"))throw new Error("Please register a constructor function");if(this._components[e]!==void 0)throw new Error("Component "+e+" is already registered");this._components[e]=t;var i=()=>{if(this._components[e]===void 0)throw new Error("Component "+e+" is not registered");delete this._components[e]};return i}setFallbackComponent(e){this._fallbackComponent=e}toConfig(e){if(this.isInitialised===!1)throw new Error("Can't create config, layout not yet initialised");if(e&&!(e instanceof ge))throw new Error("Root must be a ContentItem");var t={settings:Te({},this.config.settings),dimensions:Te({},this.config.dimensions),labels:Te({},this.config.labels),content:[]},i=function o(s,a){for(var l in a.config)l!=="content"&&(s[l]=a.config[l]);if(s.componentName==="lm-react-component"&&(s.type="react-component"),a.contentItems.length){s.content=[];for(var u=0;u<a.contentItems.length;u++)s.content[u]={},o(s.content[u],a.contentItems[u])}};e?i(t,{contentItems:[e]}):i(t,this.root),this._$reconcilePopoutWindows(),t.openPopouts=[];for(var r=0;r<this.openPopouts.length;r++)t.openPopouts.push(this.openPopouts[r].toConfig());return t.maximisedItemId=this._maximisedItem?"__glMaximised":void 0,t}getComponent(e){return this._components[e]}getFallbackComponent(){return this._fallbackComponent}init(){if(this._subWindowsCreated===!1&&(this._createSubWindows(),this._subWindowsCreated=!0),document.readyState==="loading"||document.body===null){T(document).ready(this.init.bind(this));return}if(this.isSubWindow===!0&&this._creationTimeoutPassed===!1){setTimeout(this.init.bind(this),7),this._creationTimeoutPassed=!0;return}this.isSubWindow===!0&&this._adjustToWindowMode(),this._setContainer(),this.dropTargetIndicator=new xn,this.updateSize(),this._create(this.config),this._bindEvents(),this.isInitialised=!0,this._adjustColumnsResponsive(),this.emit("initialised")}addReactChild(e,t){this._reactChildMap.set(e,t),this._reactChildren=[...this._reactChildMap.values()],this.emit("reactChildrenChanged")}removeReactChild(e,t){var i=this._reactChildMap.get(e);i===t&&(this._reactChildMap.delete(e),this._reactChildren=[...this._reactChildMap.values()],this.emit("reactChildrenChanged"))}getReactChildren(){return this._reactChildren}enableHeaders(){this.config.settings.hasHeaders=!0,this.config.dimensions.headerHeight=this._initialHeaderHeight,this._findAllStackContainers().forEach(e=>{e._header.show=!0,e.header.element.toggle(!0)}),this.updateSize()}disableHeaders(){this.config.settings.hasHeaders=!1,this.config.dimensions.headerHeight=0,this._findAllStackContainers().forEach(e=>{e._header.show=!1,e.header.element.toggle(!1)}),this.updateSize()}updateSize(e,t){var i,r;if(this.width=(i=e??this.container.width())!==null&&i!==void 0?i:0,this.height=(r=t??this.container.height())!==null&&r!==void 0?r:0,this.isInitialised===!0){if(this.root.callDownwards("setSize",[this.width,this.height]),this._maximisedItem){var o,s;this._maximisedItem.element.width((o=this.container.width())!==null&&o!==void 0?o:0),this._maximisedItem.element.height((s=this.container.height())!==null&&s!==void 0?s:0),this._maximisedItem.callDownwards("setSize")}this._adjustColumnsResponsive()}}destroy(){var e;this.isInitialised===!1||!this.root||(this._onUnload(),T(window).off("resize",this._onResize),T(window).off("unload beforeunload",this._onUnload),T(window).off("blur.lm").off("focus.lm"),this.root.callDownwards("_$destroy",[],!0),this.root.contentItems=[],this.tabDropPlaceholder.remove(),(e=this.dropTargetIndicator)===null||e===void 0||e.destroy(),this.eventHub.destroy(),this._dragSources.forEach(function(t){t._dragListener.destroy()}),this._dragSources=[])}createContentItem(e,t){var i,r,o;if(typeof e.type!="string")throw new kt("Missing parameter 'type'",e);if(e.type==="react-component"&&(e.type="component",e.componentName="lm-react-component"),!this._typeToItem[e.type])throw r="Unknown type '"+e.type+"'. Valid types are "+Object.keys(this._typeToItem).join(","),new kt(r);return e.type==="component"&&!(t instanceof Ai)&&t&&!(this.isSubWindow===!0&&t instanceof Ni)&&(e={type:"stack",width:e.width,height:e.height,content:[e]}),e.id=(i=e.id)!==null&&i!==void 0?i:Yn(),o=new this._typeToItem[e.type](this,e,t),o}createPopout(e,t,i,r){var o=[],s=e instanceof ge,a=this;if(s){var l;o=this.toConfig(e).content,i=Yn();for(var u=e.parent,h=e;((m=u)===null||m===void 0?void 0:m.contentItems.length)===1&&!u.isRoot;){var m;h=u,u=u.parent}if((l=u)===null||l===void 0||l.addId(i),r==null||Number.isNaN(r)){var p;r=(p=u)===null||p===void 0?void 0:p.contentItems.indexOf(h)}}else e instanceof Array?o=e:o=[e];if(!t&&s){var v,g,f,y=window.screenX||window.screenLeft,_=window.screenY||window.screenTop,S=(v=e.element.offset())!==null&&v!==void 0?v:{left:0,top:0};t={left:y+S.left,top:_+S.top,width:(g=e.element.width())!==null&&g!==void 0?g:0,height:(f=e.element.height())!==null&&f!==void 0?f:0}}if(!t&&!s&&(t={left:window.screenX||window.screenLeft+20,top:window.screenY||window.screenTop+20,width:500,height:309}),s&&e.remove(),!(!t||!i||r===void 0)){var C=new zs(o,t,i,r,this);return C.on("initialised",function(){a.emit("windowOpened",C)}),C.on("closed",function(){a._$reconcilePopoutWindows()}),this.openPopouts.push(C),C}}createDragSource(e,t){this.config.settings.constrainDragToContainer=!1;var i=new Vs(e,t,this);return this._dragSources.push(i),i}createDragSourceFromEvent(e,t){return this.config.settings.constrainDragToContainer=!1,new Gs(e,this,t)}selectItem(e,t){if(this.config.settings.selectionEnabled!==!0)throw new Error("Please set selectionEnabled to true to use this feature");e!==this.selectedItem&&(this.selectedItem!==null&&this.selectedItem.deselect(),e&&t!==!0&&e.select(),this.selectedItem=e,this.emit("selectionChanged",e))}_$maximiseItem(e){var t,i;this._maximisedItem!==null&&this._$minimiseItem(this._maximisedItem),this._maximisedItem=e,this._maximisedItem.addId("__glMaximised"),e.element.addClass("lm_maximised"),e.element.after(this._maximisePlaceholder),this.root.element.prepend(e.element),e.element.width((t=this.container.width())!==null&&t!==void 0?t:0),e.element.height((i=this.container.height())!==null&&i!==void 0?i:0),e.callDownwards("setSize"),this._maximisedItem.emit("maximised"),this.emit("stateChanged")}_$minimiseItem(e){var t;e.element.removeClass("lm_maximised"),e.removeId("__glMaximised"),this._maximisePlaceholder.after(e.element),this._maximisePlaceholder.remove(),(t=e.parent)===null||t===void 0||t.callDownwards("setSize"),this._maximisedItem=null,e.emit("minimised"),this.emit("stateChanged")}_$closeWindow(){window.setTimeout(function(){window.close()},1)}_$getArea(e,t){for(var i=1/0,r=null,o=0;o<this._itemAreas.length;o++){var s=this._itemAreas[o];e>s.x1&&e<s.x2&&t>s.y1&&t<s.y2&&i>s.surface&&(i=s.surface,r=s)}return r}_$createRootItemAreas(){var e=50,t=Te({},this.root._$getArea()),i=[Te(Te({},t),{},{side:"left",x2:t.x1+e}),Te(Te({},t),{},{side:"right",x1:t.x2-e}),Te(Te({},t),{},{side:"top",y2:t.y1+e}),Te(Te({},t),{},{side:"bottom",y1:t.y2-e})];i.forEach(r=>{r.surface=(r.x2-r.x1)*(r.y2-r.y1)}),this._itemAreas.push(...i)}_$calculateItemAreas(){var e=this._getAllContentItems();if(this._itemAreas=[],e.length===1){this._itemAreas.push(this.root._$getArea());return}this._$createRootItemAreas();for(var t=0;t<e.length;t++){var i=e[t];if(At(i)){var r=i._$getArea();if(r!==null)if(r instanceof Array)this._itemAreas=this._itemAreas.concat(r);else{var o;this._itemAreas.push(r);var s=Te(Te({},r),(o=r.contentItem._contentAreaDimensions)===null||o===void 0?void 0:o.header.highlightArea);s.surface=(s.x2-s.x1)*(s.y2-s.y1),this._itemAreas.push(s)}}}}_$normalizeContentItem(e,t){if(!e)throw new Error("No content item defined");if(typeof e=="function"&&(e=e()),e instanceof ge)return e;if(T.isPlainObject(e)&&e.type){var i=this.createContentItem(e,t);return i.callDownwards("_$init"),i}else throw new Error("Invalid contentItem")}_$reconcilePopoutWindows(){for(var e=[],t=0;t<this.openPopouts.length;t++){var i;((i=this.openPopouts[t].getWindow())===null||i===void 0?void 0:i.closed)===!1?e.push(this.openPopouts[t]):this.emit("windowClosed",this.openPopouts[t])}this.openPopouts.length!==e.length&&(this.emit("stateChanged"),this.openPopouts=e)}_getAllContentItems(){var e=[],t=i=>{if(e.push(i),i.contentItems instanceof Array)for(var r=0;r<i.contentItems.length;r++)t(i.contentItems[r])};return t(this.root),e}_bindEvents(){this._isFullPage&&T(window).resize(this._onResize),T(window).on("unload beforeunload",this._onUnload).on("blur.lm",this._windowBlur).on("focus.lm",this._windowFocus)}_windowBlur(){this.root.element.addClass("lm_window_blur")}_windowFocus(){this.root.element.removeClass("lm_window_blur")}_onResize(){clearTimeout(this._resizeTimeoutId),this._resizeTimeoutId=window.setTimeout(this.updateSize.bind(this),100)}_createConfig(e){var t,i=Fs("gl-window");i&&(this.isSubWindow=!0,e=JSON.parse(localStorage.getItem(i)||"{}"),e=Di(e),localStorage.removeItem(i)),e=T.extend(!0,{},Ns,e);var r=function o(s){for(var a in s){var l=s[a];a!=="props"&&typeof l=="object"&&l!=null?o(l):a==="type"&&l==="react-component"&&(s.type="component",s.componentName="lm-react-component")}};return r(e),((t=e.settings)===null||t===void 0?void 0:t.hasHeaders)===!1&&(e.dimensions.headerHeight=0),e}_adjustToWindowMode(){var e,t=T('<div class="lm_popin" title="'+this.config.labels.popin+'"><div class="lm_icon"></div><div class="lm_bg"></div></div>');t.click(()=>{this.emit("popIn")}),document.title=Vi((e=this.config.content[0].title)!==null&&e!==void 0?e:""),T("head").append(T("body link, body style, template, .gl_keep")),this.container=T("body").html("").css("visibility","visible").append(t),document.body.offsetHeight,window.__glInstance=this}_createSubWindows(){if(this.config.openPopouts)for(var e=0;e<this.config.openPopouts.length;e++){var t=this.config.openPopouts[e];this.createPopout(t.content,t.dimensions,t.parentId,t.indexInParent)}}_getContainer(){var e=this._originalContainer?T(this._originalContainer):T("body");if(e.length===0)throw new Error("GoldenLayout container not found");if(e.length>1)throw new Error("GoldenLayout more than one container element specified");return e}_setContainer(){var e=this._getContainer();e[0]===document.body&&(this._isFullPage=!0,T("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"})),this.container=e}_create(e){var t;if(!(e.content instanceof Array))throw e.content===void 0?t="Missing setting 'content' on top level of configuration":t="Configuration parameter 'content' must be an array",new kt(t,e);if(e.content.length>1)throw t="Top level content can't contain more then one element.",new kt(t,e);this.root=new Ni(this,{content:e.content},this.container),this.root.callDownwards("_$init"),e.maximisedItemId==="__glMaximised"&&this.root.getItemsById(e.maximisedItemId)[0].toggleMaximise()}_onUnload(){if(this.config.settings.closePopoutsOnUnload===!0)for(var e=0;e<this.openPopouts.length;e++)this.openPopouts[e].close()}_adjustColumnsResponsive(){if(!this._useResponsiveLayout()||this._updatingColumnsResponsive||!this.config.dimensions||!this.config.dimensions.minItemWidth||this.root.contentItems.length===0||!this.root.contentItems[0].isRow){this._firstLoad=!1;return}this._firstLoad=!1;var e=this.root.contentItems[0].contentItems.length;if(!(e<=1)){var t=this.config.dimensions.minItemWidth,i=e*t;if(!(this.width==null||i<=this.width)){this._updatingColumnsResponsive=!0;for(var r=Math.max(Math.floor(this.width/t),1),o=e-r,s=this.root.contentItems[0],a=this._findAllStackContainers()[0],l=0;l<o;l++){var u=s.contentItems[s.contentItems.length-1];this._addChildContentItemsToContainer(a,u)}this._updatingColumnsResponsive=!1}}}_useResponsiveLayout(){return this.config.settings&&(this.config.settings.responsiveMode=="always"||this.config.settings.responsiveMode=="onload"&&this._firstLoad)}_addChildContentItemsToContainer(e,t){t.type==="stack"?t.contentItems.forEach(function(i){e.addChild(i),t.removeChild(i,!0)}):t.contentItems.forEach(i=>{this._addChildContentItemsToContainer(e,i)})}_findAllStackContainers(){var e=[];return this._findAllStackContainersRecursive(e,this.root),e}_findAllStackContainersRecursive(e,t){t.contentItems.forEach(i=>{At(i)?e.push(i):i.isComponent||this._findAllStackContainersRecursive(e,i)})}}G(Qs,"__lm",Bm);const ho={"tab-height":"28px","drag-border-width":"5px"},co=Object.freeze({tabHeight:parseInt(ho["tab-height"],10),dragBorderWidth:parseInt(ho["drag-border-width"],10)});function mo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function st(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?mo(Object(t),!0).forEach(function(i){Js(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):mo(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Js(n,e,t){return(e=zm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function zm(n){var e=Vm(n,"string");return typeof e=="symbol"?e:e+""}function Vm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var gt=L.module("LayoutUtils");function ea(n){return n.componentName!==void 0}function qt(n){var e=n;return(ea(n)&&n.componentName==="lm-react-component"||n.type==="react-component")&&e.component!==void 0}function $n(n){return n.focus!==void 0}function po(n){return n.type==="stack"}class P{static activateTab(e,t){var i=P.getStackForRoot(e,t,!1);if(!i){gt.error("Could not find stack for config",t);return}var r=P.getContentItemInStack(i,t);r&&i.setActiveContentItem(r)}static isActiveTab(e,t){var i=P.getStackForRoot(e,t,!1);if(!i)return gt.error("Could not find stack for config",t),!1;var r=P.getContentItemInStack(i,t),o=i.getActiveContentItem();return o===r}static addStack(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=t?"column":"row";if(Zs(e)){(e.contentItems==null||e.contentItems.length===0)&&e.addChild({type:i});var r=e.contentItems[0],o=t?r.isColumn:r.isRow;if(!o){e.removeChild(r,!0),e.addChild({type:i});var s=document.activeElement;e.contentItems[0].addChild(r),s&&s.focus!=null&&s.focus()}return this.addStack(e.contentItems[0],t)}if(e.contentItems.length<2)return e.addChild({type:"stack"}),e.contentItems[e.contentItems.length-1];var a=e.contentItems[e.contentItems.length-1],l=t?a.isRow:a.isColumn;return l||(e.addChild({type:t?"row":"column"}),e.removeChild(a,!0),e.contentItems[e.contentItems.length-1].addChild(a),a=e.contentItems[e.contentItems.length-1]),this.addStack(a,!t)}static getStackById(e,t){var i,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(r&&At(e)&&e.contentItems.length===0)return e;if(t===((i=e.config)===null||i===void 0?void 0:i.id)){if(At(e))return e;throw new Error("Item with ID ".concat(t," is not a stack"))}if(e.contentItems==null)return null;for(var o=0;o<e.contentItems.length;o+=1){var s=this.getStackById(e.contentItems[o],t,r);if(s)return s}return null}static getStackForConfig(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(i&&At(e)&&e.contentItems.length===0)return e;if(e.contentItems==null)return null;for(var r=0;r<e.contentItems.length;r+=1){var o=e.contentItems[r];if(o.isComponent&&o.config!=null&&ir(o.config,t))return e;var s=this.getStackForConfig(o,t,i);if(s)return s}return null}static getStackForRoot(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=this.getStackForConfig(e,t);return!s&&r&&(s=this.getStackForConfig(e,{component:t.component},o)),!s&&i&&(s=this.addStack(e)),s}static getStackForComponentTypes(e,t){for(var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=0;s<t.length;s+=1){var a=t[s],l=s===t.length-1,u=P.getStackForRoot(e,{component:a},i&&l,r,o);if(u)return u}return null}static getContentItemInStack(e,t){if(!e)return null;for(var i=0;i<e.contentItems.length;i+=1){var r=e.contentItems[i];if(r.isComponent&&r.config!=null&&ir(r.config,t))return r}return null}static dehydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var i=[],r=0;r<e.length;r+=1){var o=e[r],{component:s,content:a}=o;if(s){var l=t(s,o);l!=null?i.push(l):gt.debug2('dehydrateLayoutConfig: skipping unmapped component "'.concat(s,'"'))}else if(a){var u=st(st({},o),{},{content:P.dehydrateLayoutConfig(a,t)});i.push(u)}else i.push(o)}return i}static getTabPoint(e){var{tab:t}=e;if(t==null)throw new Error("Cannot get tab for panel container ".concat(e));var i=t.element[0].getBoundingClientRect();return[i.left+i.width*.5,i.bottom-8]}static dropLayoutMinorChange(e){for(var t=0;t<e.length;t+=1){var i=e[t],{content:r}=i;r!==void 0?(po(i)&&delete i.activeItemIndex,P.dropLayoutMinorChange(r)):qt(i)&&i.component==="IrisGridPanel"&&i.props.panelState!=null&&(delete i.id,i.props.panelState.irisGridState.sorts=[],i.props.panelState.irisGridState.quickFilters=[],i.props.panelState.gridState.isStuckToBottom=!1,i.props.panelState.gridState.isStuckToRight=!1)}}static isEqual(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=P.cloneLayout(e),o=P.cloneLayout(t);return i?(P.dropLayoutMinorChange(r),P.dropLayoutMinorChange(o),_i(r,o)):_i(r,o)}static cloneLayout(e){return JSON.parse(JSON.stringify(e))}static hydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var i=[],r=0;r<e.length;r+=1){var o=e[r];if(qt(o)){var s,{component:a,props:l={}}=o;i.push(st(st({},o),{},{id:(s=o==null?void 0:o.id)!==null&&s!==void 0?s:Pt(),props:t(a,l)}))}else if(o.content!==void 0){var u=P.hydrateLayoutConfig(o.content,t);po(o)&&o.activeItemIndex!=null&&o.activeItemIndex>=u.length&&(gt.warn("Fixing bad activeItemIndex!",o.activeItemIndex,o),o.activeItemIndex=0),i.push(st(st({},o),{},{content:u}))}else i.push(o)}return i}static openComponent(){var{root:e,config:t,stack:i=void 0,replaceExisting:r=!0,replaceConfig:o=void 0,createNewStack:s=!1,focusElement:a=void 0,dragEvent:l=void 0}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},u=document.activeElement,h=st({},t);if(h.id==null&&(h.id=Pt()),l!=null){e==null||e.layoutManager.createDragSourceFromEvent(h,l);return}var m=o||{id:h.id,component:h.component};H(e);var p=i??(s?P.addStack(e):P.getStackForRoot(e,m));H(p);var v=P.getContentItemInStack(p,m);if(a!=null){var g=y=>{gt.debug("Component created, focusing element",a),p.off("componentCreated",g);var{element:_}=y.origin;requestAnimationFrame(()=>{P.focusElement(_[0],a)})};p.on("componentCreated",g)}if(r&&v){var f=p.contentItems.indexOf(v);p.addChild(h,f+1),p.removeChild(v),p.setActiveContentItem(p.contentItems[f])}else p.addChild(h);a==null&&u&&$n(u)&&u.focus()}static openComponentInStack(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=document.activeElement,o={id:t.id},s=P.getContentItemInStack(e,o);if(i&&s&&e){var a=e==null?void 0:e.contentItems.indexOf(s);e.addChild(t,a+1),e.removeChild(s),e.setActiveContentItem(e.contentItems[a])}else e==null||e.addChild(t);r&&$n(r)&&r.focus()}static closeComponent(e,t,i){var r=P.getStackForRoot(e,t,!1,!1,!1);if(!r){gt.warn("Cannot find stack for component, ignoring close",t);return}var o=P.getContentItemInStack(r,t),s=document.activeElement;o&&(We(o)?o.container.close(i):r.removeChild(o)),s&&document.contains(s)&&$n(s)&&s.focus()}static renameComponent(e,t,i){var r=P.getStackForRoot(e,t,!1);if(!r){gt.error("Could not find stack for config",t);return}var o=P.getContentItemInStack(r,t);o&&o.setTitle(i)}static cloneComponent(e,t){var i=P.getStackForRoot(e,t,!1);if(!i)return gt.error("Could not find stack for config",t),null;var{props:r={}}=t,o=P.getPanelComponentState(t),s={type:"react-component",component:t.component,props:st(st({},r),{},{panelState:o}),title:"".concat(t.title," Copy"),id:Pt()};return P.openComponentInStack(i,s),s}static getPanelComponentState(e){if(ea(e)){var t;return(t=e.componentState)===null||t===void 0?void 0:t.panelState}if(qt(e)){var i;return(i=e.props)===null||i===void 0?void 0:i.panelState}return null}static makeDefaultLayout(){return{dimensions:{headerHeight:co.tabHeight,borderWidth:co.dragBorderWidth,borderGrabWidth:10},settings:{showPopoutIcon:!1,showCloseIcon:!1,constrainDragToContainer:!1}}}static getRootFromContainer(e){return e.layoutManager.root}static getComponentConfigFromContainer(e){return e?e.tab!=null&&e.tab.contentItem!=null?e.tab.contentItem.config:e._config:null}static getTitleFromContainer(e){return e!=null&&e.tab!=null&&e.tab.contentItem!=null?e.tab.contentItem.config.title:null}static getTitleFromTab(e){return e!=null&&e.contentItem!=null?e.contentItem.config.title:null}static getIdFromContainer(e){var t=P.getComponentConfigFromContainer(e);return t?t.id:null}static getIdFromPanel(e){var{glContainer:t}=e.props;return P.getIdFromContainer(t)}static getComponentNameFromPanel(e){var{glContainer:t}=e.props,i=P.getComponentConfigFromContainer(t);if(i&&qt(i)){var r;return(r=i.component)!==null&&r!==void 0?r:null}return null}static getComponentName(e){var t,i,r=(t=(i=e.WrappedComponent)===null||i===void 0?void 0:i.displayName)!==null&&t!==void 0?t:e.displayName;if(r==null)throw new Error("Component displayName not defined ".concat(e));return r}static focusElement(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:P.DEFAULT_FOCUS_SELECTOR;if(e==null)return null;var i=e.querySelector(t);return i==null?null:($n(i)&&i.focus(),i)}static onInitialized(e){return new Promise(t=>{if(e.isInitialised){t();return}var i=()=>{e.off("initialised",i),t()};e.on("initialised",i)})}}Js(P,"DEFAULT_FOCUS_SELECTOR","input, select, textarea, button");var Gm=I.forwardRef((n,e)=>{var t=P.getComponentNameFromPanel({props:n});return d.jsx("div",{ref:e,className:"panel-placeholder",children:d.jsxs("div",{children:['Component "',t,'" is not registered.']})})});Gm.displayName="PanelPlaceholder";const Z=Object.freeze({FOCUS:"PanelEvent.FOCUS",MOUNT:"PanelEvent.MOUNT",UNMOUNT:"PanelEvent.UNMOUNT",TITLE_CHANGED:"PanelEvent.TITLE_CHANGED",REOPEN:"PanelEvent.REOPEN",REOPEN_LAST:"PanelEvent.REOPEN_LAST",DELETE:"PanelEvent.DELETE",CLONED:"PanelEvent.CLONED",CLOSED:"PanelEvent.CLOSED",OPEN:"PanelEvent.OPEN",CLOSE:"PanelEvent.CLOSE",DRAGGING:"PanelEvent.DRAGGING",DROPPED:"PanelEvent.DROPPED"});function ei(n){return(n==null?void 0:n.WrappedComponent)!==void 0}function qm(n){return typeof n.id=="string"&&n.layout instanceof Qs&&n.panelManager instanceof Zi&&typeof n.registerComponent=="function"}function gf(n){if(!qm(n))throw new Error("Expected dashboard plugin props, but instead received ".concat(n))}function vo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function fo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?vo(Object(t),!0).forEach(function(i){Ct(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):vo(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Ct(n,e,t){return(e=Zm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Zm(n){var e=Xm(n,"string");return typeof e=="symbol"?e:e+""}function Xm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ue=L.module("PanelManager");class Zi{constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:(a,l)=>l,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(a,l)=>l,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new Map,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:()=>{};Ct(this,"layout",void 0),Ct(this,"hydrateComponent",void 0),Ct(this,"dehydrateComponent",void 0),Ct(this,"onPanelsUpdated",void 0),Ct(this,"closed",void 0),Ct(this,"openedMap",void 0),this.handleFocus=this.handleFocus.bind(this),this.handleMount=this.handleMount.bind(this),this.handleUnmount=this.handleUnmount.bind(this),this.handleReopen=this.handleReopen.bind(this),this.handleReopenLast=this.handleReopenLast.bind(this),this.handleDeleted=this.handleDeleted.bind(this),this.handleClosed=this.handleClosed.bind(this),this.handleControlClose=this.handleControlClose.bind(this),this.layout=e,this.hydrateComponent=t,this.dehydrateComponent=i,this.onPanelsUpdated=s,this.openedMap=new Map(r),this.closed=[...o],this.startListening()}startListening(){var{eventHub:e}=this.layout;e.on(Z.FOCUS,this.handleFocus),e.on(Z.MOUNT,this.handleMount),e.on(Z.UNMOUNT,this.handleUnmount),e.on(Z.REOPEN,this.handleReopen),e.on(Z.REOPEN_LAST,this.handleReopenLast),e.on(Z.DELETE,this.handleDeleted),e.on(Z.CLOSED,this.handleClosed),e.on(Z.CLOSE,this.handleControlClose)}stopListening(){var{eventHub:e}=this.layout;e.off(Z.FOCUS,this.handleFocus),e.off(Z.MOUNT,this.handleMount),e.off(Z.UNMOUNT,this.handleUnmount),e.off(Z.REOPEN,this.handleReopen),e.off(Z.REOPEN_LAST,this.handleReopenLast),e.off(Z.DELETE,this.handleDeleted),e.off(Z.CLOSED,this.handleClosed),e.off(Z.CLOSE,this.handleControlClose)}getClosedPanelConfigsOfType(e){return this.closed.filter(t=>t.component===e)}getOpenedPanels(){return Array.from(this.openedMap.values())}getOpenedPanelConfigs(){return this.getOpenedPanels().map(e=>{var{glContainer:t}=e.props;return P.getComponentConfigFromContainer(t)})}getOpenedPanelConfigsOfType(e){return this.getOpenedPanelConfigs().filter(t=>t!=null&&qt(t)&&t.component===e)}getOpenedPanelById(e){return this.openedMap.get(e)}getContainerByPanelId(e){var t,i=P.getStackForConfig(this.layout.root,{id:e});return(t=i&&P.getContentItemInStack(i,{id:e}))!==null&&t!==void 0?t:null}getLastUsedPanel(e){for(var t=this.getOpenedPanels(),i=t.length-1;i>=0;i-=1){var r=t[i];if(e==null||e(r))return r}}getLastUsedPanelOfType(e){return this.getLastUsedPanelOfTypes([e])}getLastUsedPanelOfTypes(e){return this.getLastUsedPanel(t=>e.some(i=>ei(i)&&t instanceof i.WrappedComponent||!ei(i)&&t instanceof i))}updatePanel(e){var t=P.getIdFromPanel(e);if(t==null){Ue.error("updatePanel Panel did not have an ID",e);return}Ue.debug2("Updating panel ID ".concat(t," in open panels map")),this.openedMap.delete(t),this.openedMap.set(t,e)}removePanel(e){var t=P.getIdFromPanel(e);if(t==null){Ue.error("removePanel Panel did not have an ID",e);return}if(!this.openedMap.has(t)){Ue.error("Missing panel ID ".concat(t," in open panels map"));return}if(this.openedMap.get(t)!==e){Ue.debug("Panel argument doesn't match the open panels map entry for ".concat(t,", removePanel ignored"));return}Ue.debug2("Removing panel ID ".concat(t," from open panels map")),this.openedMap.delete(t)}removeClosedPanelConfig(e){var t=this.closed.findIndex(i=>i===e||i.id!=null&&e.id!=null&&i.id===e.id);t>=0&&this.closed.splice(t,1)}handleFocus(e){Ue.debug2("Focus: ",e),this.updatePanel(e)}handleMount(e){Ue.debug2("Mount: ",e),this.updatePanel(e),this.sendUpdate()}handleUnmount(e){Ue.debug2("Unmount: ",e),this.removePanel(e),this.sendUpdate()}handleReopen(e,t){Ue.debug2("Reopen:",e,t),this.removeClosedPanelConfig(e);var{component:i}=e,{props:r}=e;r=this.hydrateComponent(i,r);var o=fo(fo({},e),{},{props:r}),{root:s}=this.layout,a=e.parentStackId===void 0?void 0:P.getStackById(s,e.parentStackId);P.openComponent({root:s,config:o,replaceConfig:t,stack:a??void 0})}handleReopenLast(e){var t;if(this.closed.length!==0){if(e===void 0){this.handleReopen(this.closed[this.closed.length-1]);return}for(var i=(t=P.getStackForConfig(this.layout.root,e.getConfig()))===null||t===void 0?void 0:t.config.id,r=this.closed.length-1;r>=0;r-=1){var o=this.closed[r];if(o.parentStackId===i){this.handleReopen(o);return}}}}handleDeleted(e){Ue.debug2("Deleted:",e),this.removeClosedPanelConfig(e),this.sendUpdate()}handleClosed(e,t){Ue.debug2("Closed: ",e),this.addClosedPanel(t),this.sendUpdate()}handleControlClose(e){var t={id:e},{root:i}=this.layout;P.closeComponent(i,t)}addClosedPanel(e){var{root:t}=this.layout,i=P.getComponentConfigFromContainer(e);if(i&&qt(i)){var r=this.dehydrateComponent(i.component,i);if(r!=null){var o;r.parentStackId=(o=P.getStackForConfig(t,i))===null||o===void 0?void 0:o.config.id,this.closed.push(r)}}}sendUpdate(){var{closed:e,openedMap:t}=this;this.onPanelsUpdated({closed:[...e],openedMap:new Map(t)})}}Ct(Zi,"MAX_CLOSED_PANEL_COUNT",100);var Ym=L.module("PanelErrorBoundary");class Qm extends c.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){this.setState({error:e})}componentWillUnmount(){var{glContainer:e,glEventHub:t}=this.props,i=P.getIdFromContainer(e);Ym.debug("componentWillUnmount",i),t.emit(Z.CLOSED,i,e)}render(){var{children:e}=this.props,{error:t}=this.state;return t!=null?d.jsx("div",{className:"panel-error-boundary",children:d.jsx(wn,{errorMessage:"".concat(t),isLoading:!1,isLoaded:!1})}):e}}function go(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function ti(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?go(Object(t),!0).forEach(function(i){Jm(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):go(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Jm(n,e,t){return(e=ep(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ep(n){var e=tp(n,"string");return typeof e=="symbol"?e:e+""}function tp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ta(n){var{props:e,componentState:t}=n,{metadata:i}=e,{panelState:r=null}=e;t&&({panelState:r}=t);var o={};return i!=null&&(o.metadata=i),r!=null&&(o.panelState=r),ti(ti({},n),{},{componentState:null,props:o,type:"react-component"})}function na(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return ti(ti({},n),{},{localDashboardId:e})}function np(n){var e=ei(n)&&n.WrappedComponent.prototype!=null&&n.WrappedComponent.prototype.isReactComponent!=null||n.prototype!=null&&n.prototype.isReactComponent!=null,t=!ei(n)&&"$$typeof"in n&&n.$$typeof===ul.ForwardRef;return e||t}const bf={dehydrate:ta,hydrate:na};var ip=I.createContext(void 0),rp=b.shape({on:b.func,off:b.func,isHidden:b.bool,tab:b.shape({header:b.shape({tabs:b.arrayOf(b.shape({contentItem:b.shape({})}))})}),title:b.string,setTitle:b.func,close:b.func}),ia=b.shape({on:b.func,off:b.func,emit:b.func}),op=b.shape({registerComponent:b.func,root:b.shape({addChild:b.func}),on:b.func,off:b.func,eventHub:ia}),sp=Object.freeze({Container:rp,EventHub:ia,Layout:op});function Wt(n,e,t){c.useEffect(function(){return n.on(e,t),()=>{n.off(e,t)}},[n,e,t])}var ra="SET_DASHBOARD_DATA";const ap=bu(ra,{},!1),lp={dashboardData:ap};var dp=new Map,oa=Object.freeze({}),up=Object.freeze([]),yf=Yo,Cf=Xo,wf=hl,hp=n=>n.dashboardData,ye=(n,e)=>{var t;return(t=hp(n)[e])!==null&&t!==void 0?t:oa},Sf=(n,e)=>{var t;return(t=ye(n,e).closed)!==null&&t!==void 0?t:up},_f=(n,e)=>{var t;return(t=ye(n,e).openedMap)!==null&&t!==void 0?t:dp},sa=(n,e)=>{var t;return(t=ye(n,e).pluginDataMap)!==null&&t!==void 0?t:oa},Ef=(n,e,t)=>sa(n,e)[t];function bo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Zt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?bo(Object(t),!0).forEach(function(i){cp(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):bo(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function cp(n,e,t){return(e=mp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mp(n){var e=pp(n,"string");return typeof e=="symbol"?e:e+""}function pp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var aa=(n,e)=>({type:ra,id:n,payload:e}),vp=(n,e)=>(t,i)=>t(aa(n,Zt(Zt({},ye(i(),n)),e))),Pf=(n,e,t)=>(i,r)=>i(aa(n,Zt(Zt({},ye(r(),n)),{},{pluginDataMap:Zt(Zt({},sa(r(),n)),{},{[e]:t})})));Object.entries(lp).map(n=>{var[e,t]=n;return Su.register(e,t)});function fp(n){var{children:e}=n;return d.jsx(d.Fragment,{children:e})}var la=c.createContext(null);function gp(){return c.useContext(la)}function yo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function un(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?yo(Object(t),!0).forEach(function(i){bp(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):yo(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function bp(n,e,t){return(e=yp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yp(n){var e=Cp(n,"string");return typeof e=="symbol"?e:e+""}function Cp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Un=L.module("DashboardLayout"),wp=Object.freeze({}),Sp=[],Co=()=>{},_p=1e3,wo=n=>n;function Ep(n){var e,t,{id:i,children:r,emptyDashboard:o=d.jsx("div",{children:"Dashboard is empty."}),layout:s,layoutConfig:a=Sp,onLayoutChange:l=Co,onLayoutInitialized:u=Co,hydrate:h=na,dehydrate:m=ta,panelWrapper:p=fp}=n,v=Yo(),g=(e=Xo(k=>ye(k,i)))!==null&&e!==void 0?e:wp,[f,y]=c.useState(!1),[_,S]=c.useState(!1),[C,M]=c.useState(),[K]=c.useState((t=g==null?void 0:g.closed)!==null&&t!==void 0?t:[]),[Y,x]=c.useState(s.getReactChildren()),z=c.useMemo(()=>new Map,[]),N=c.useMemo(()=>new Map,[]),Q=c.useCallback(function(k,J){var oe,an=arguments.length>2&&arguments[2]!==void 0?arguments[2]:h,pt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:m;Un.debug2("registerComponent",k,J,an,pt);function kn(W,ee){var pe=J,je=p,xt=np(pe),{glContainer:Ut,glEventHub:fa}=W,ga=P.getIdFromContainer(Ut);return d.jsx(Qm,{glContainer:Ut,glEventHub:fa,children:d.jsx(la.Provider,{value:ga,children:d.jsx(je,un(un({},W),{},{children:xt?d.jsx(pe,un(un({},W),{},{ref:ee})):d.jsx(pe,un({},W))}))})})}kn.displayName="DashboardWrapper(".concat((oe=J.displayName)!==null&&oe!==void 0?oe:k,")");var E=s.registerComponent(k,I.forwardRef(kn));return z.set(k,an),N.set(k,pt),E},[h,m,z,N,s,p]),te=c.useCallback((k,J)=>{var oe;return((oe=z.get(k))!==null&&oe!==void 0?oe:wo)(J,i)},[z,i]),j=c.useCallback((k,J)=>{var oe;return((oe=N.get(k))!==null&&oe!==void 0?oe:wo)(J,i)},[N,i]),V=c.useMemo(()=>new Zi(s,te,j,new Map,K,k=>{var{closed:J,openedMap:oe}=k;v(vp(i,{closed:J,openedMap:oe}))}),[j,v,te,i,K,s]),R=Kl(k=>{var J=C==null||!P.isEqual(C,k);Un.debug("handleLayoutStateChanged",J,k),J&&(y(s.root.contentItems.length===0),M(k),l(k),x(s.getReactChildren()))},_p,{flushOnUnmount:!0});c.useEffect(()=>()=>R.flush(),[R]);var D=c.useCallback(()=>{if(!_){var k=s.toConfig(),J=k.content,oe=P.dehydrateLayoutConfig(J,j);R(oe)}},[j,_,s,R]),F=c.useCallback(k=>{var J=P.getIdFromContainer(k);s.eventHub.emit(Z.DRAGGING,J),S(!0)},[s.eventHub]),U=c.useCallback(k=>{var J=P.getIdFromContainer(k);s.eventHub.emit(Z.DROPPED,J),S(!1)},[s.eventHub]),ce=c.useCallback(k=>{if(Un.debug2("handleComponentCreated",k),!(k==null||k.config==null||k.config.component==null||k.element==null)){var J=k.config.component.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),oe="".concat(J,"-component");k.element.addClass(oe)}},[]),Je=c.useCallback(()=>{x(s.getReactChildren())},[s]);Wt(s,"stateChanged",D),Wt(s,"itemPickedUp",F),Wt(s,"itemDropped",U),Wt(s,"componentCreated",ce),Wt(s.eventHub,Z.TITLE_CHANGED,D),Wt(s,"reactChildrenChanged",Je);var ze=Wl(a);return c.useEffect(function(){if(ze!==a&&a!==C){Un.debug("Setting new layout content...");for(var J=P.hydrateLayoutConfig(a,te);s.root.contentItems.length>0;)s.root.contentItems[0].remove();for(var oe=0;oe<J.length;oe+=1)s.root.addChild(J[oe]);y(s.root.contentItems.length===0)}},[te,s,a,C,V,ze]),c.useEffect(()=>u(),[]),d.jsxs(d.Fragment,{children:[f&&o,Y,I.Children.map(r,k=>k!=null?d.jsx(Rd,{fallback:[],children:I.cloneElement(k,{id:i,layout:s,panelManager:V,registerComponent:Q})}):null)]})}Ep.propTypes={id:b.string.isRequired,children:b.node,data:b.shape({}),emptyDashboard:b.node,layout:sp.Layout.isRequired,layoutConfig:b.arrayOf(b.shape({})),onLayoutChange:b.func,onLayoutInitialized:b.func};var Pp=c.createContext(null);function Tf(){var n=c.useContext(Pp);if(n==null)throw new Error("useDashboardId must be used within a DashboardIdContext provider");return n}function Tp(n,e,t){return(e=Op(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Op(n){var e=xp(n,"string");return typeof e=="symbol"?e:e+""}function xp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function da(n,e,t){if(n){if(t(n)===!0)return n;for(var i=n.child;i;){var r=da(i,e,t);if(r)return r;i=i.sibling}}}function Ip(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}var ua=Ip(c.createContext(null));class Of extends c.Component{constructor(){super(...arguments),Tp(this,"_reactInternals",void 0)}render(){var{children:e}=this.props;return d.jsx(ua.Provider,{value:this._reactInternals,children:e})}}function Mp(){var n=c.useContext(ua);if(n===null)throw new Error("useFiber must be called within a <FiberProvider />!");var[e]=c.useState(()=>Pt()),t=c.useMemo(()=>{for(var i of[n,n==null?void 0:n.alternate].filter(o=>o!=null)){var r=da(i,!1,o=>{for(var s=o.memoizedState;s!=null;){if(s.memoizedState===e)return!0;s=s.next}});if(r)return r}},[n,e]);return t}var xf="default",Dp=L.module("useDhId"),wi="__dhId";function If(){var n,e,t=(n=(e=Mp())===null||e===void 0?void 0:e.pendingProps)!==null&&n!==void 0?n:{},i=t[wi],r=gp();if(i!=null){if(typeof i!="string")throw new Error("useDhId expected prop ".concat(wi," to be a string, but got ").concat(typeof i));return i}return r??(Dp.warn("useDhId must be used within a PanelIdContext provider if there is no ".concat(wi," prop. Defaulting to null.")),null)}function Mn(n,e,t){return(e=jp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jp(n){var e=kp(n,"string");return typeof e=="symbol"?e:e+""}function kp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Me{}Mn(Me,"SESSION_OPENED","ConsoleEvent.SESSION_OPENED");Mn(Me,"SESSION_CLOSED","ConsoleEvent.SESSION_CLOSED");Mn(Me,"FOCUS_HISTORY","ConsoleEvent.FOCUS_HISTORY");Mn(Me,"SEND_COMMAND","ConsoleEvent.SEND_COMMAND");Mn(Me,"SETTINGS_CHANGED","ConsoleEvent.SETTINGS_CHANGED");function Ot(n,e,t){return(e=Np(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Np(n){var e=Ap(n,"string");return typeof e=="symbol"?e:e+""}function Ap(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class it{}Ot(it,"TABLE_CHANGED","InputFilterEvent.TABLE_CHANGED");Ot(it,"COLUMNS_CHANGED","InputFilterEvent.COLUMNS_CHANGED");Ot(it,"FILTERS_CHANGED","InputFilterEvent.FILTERS_CHANGED");Ot(it,"CLEAR_ALL_FILTERS","InputFilterEvent.CLEAR_ALL_FILTERS");Ot(it,"COLUMN_SELECTED","InputFilterEvent.COLUMN_SELECTED");Ot(it,"OPEN_DROPDOWN","InputFilterEvent.OPEN_DROPDOWN");Ot(it,"OPEN_INPUT","InputFilterEvent.OPEN_INPUT");Ot(it,"OPEN_FILTER_SET_MANAGER","InputFilterEvent.OPEN_FILTER_SET_MANAGER");function mt(n,e,t){return(e=Lp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Lp(n){var e=Rp(n,"string");return typeof e=="symbol"?e:e+""}function Rp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ee{}mt(Ee,"CREATE_NOTEBOOK","NotebookEvent.createNotebook");mt(Ee,"SELECT_NOTEBOOK","NotebookEvent.selectNotebook");mt(Ee,"CLOSE_FILE","NotebookEvent.closeFile");mt(Ee,"RENAME","NotebookEvent.rename");mt(Ee,"RENAME_FILE","NotebookEvent.renameFile");mt(Ee,"REGISTER_FILE","NotebookEvent.registerFile");mt(Ee,"SEND_TO_NOTEBOOK","NotebookEvent.sendToNotebook");mt(Ee,"UNREGISTER_FILE","NotebookEvent.unregisterFile");mt(Ee,"PROMOTE_FROM_PREVIEW","NotebookEvent.promoteFromPreview");function sn(n,e,t){return(e=Fp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Fp(n){var e=Hp(n,"string");return typeof e=="symbol"?e:e+""}function Hp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class nt{}sn(nt,"focus","TabEvent.focus");sn(nt,"blur","TabEvent.blur");sn(nt,"openPQObject","TabEvent.openPQObject");sn(nt,"openControl","TabEvent.openControl");sn(nt,"reload","TabEvent.reload");sn(nt,"clearAllFilters","TabEvent.clearAllFilters");function $p(n,e,t){return(e=Up(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Up(n){var e=Bp(n,"string");return typeof e=="symbol"?e:e+""}function Bp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ha extends c.PureComponent{constructor(e){super(e),this.handleCloseTab=this.handleCloseTab.bind(this),this.handleCloseTabsRight=this.handleCloseTabsRight.bind(this),this.handleCloseTabsAll=this.handleCloseTabsAll.bind(this),this.handleReopenLast=this.handleReopenLast.bind(this)}getAllTabs(){var e,t,i,{glContainer:r}=this.props;return[...(e=r==null||(t=r.tab)===null||t===void 0||(i=t.header)===null||i===void 0?void 0:i.tabs)!==null&&e!==void 0?e:[]]}handleCloseTab(){var{glContainer:e}=this.props;e.close()}handleCloseTabsAll(){var e=this.getAllTabs();e.forEach(t=>{var i;return(i=(t==null?void 0:t.contentItem).container)===null||i===void 0?void 0:i.close()})}handleCloseTabsRight(){for(var{glContainer:e}=this.props,t=this.getAllTabs(),i=t.length-1;i>0;i-=1){var r,o,s,a,l,u,h;if(((r=t[i].contentItem)===null||r===void 0||(o=r.config)===null||o===void 0?void 0:o.id)===((s=e.tab)===null||s===void 0||(a=s.contentItem)===null||a===void 0||(l=a.config)===null||l===void 0?void 0:l.id))break;(u=((h=t[i])===null||h===void 0?void 0:h.contentItem).container)===null||u===void 0||u.close()}}handleReopenLast(){var{glContainer:e,glEventHub:t}=this.props;t.emit(Z.REOPEN_LAST,e)}canCloseTabsRight(){for(var{glContainer:e}=this.props,t=this.getAllTabs(),i=!0,r=t.length-1;r>0;r-=1){var o,s,a,l,u,h,m,p;if(((o=t[r].contentItem)===null||o===void 0||(s=o.config)===null||s===void 0?void 0:s.id)===((a=e.tab)===null||a===void 0||(l=a.contentItem)===null||l===void 0||(u=l.config)===null||u===void 0?void 0:u.id))break;var v=!!(!((h=t[r])===null||h===void 0||(m=h.contentItem)===null||m===void 0||(p=m.config)===null||p===void 0)&&p.isClosable);if(v){i=!1;break}}return i}canCloseAny(){for(var e=this.getAllTabs(),t=!0,i=e.length-1;i>0;i-=1){var r,o,s,a=!!(!((r=e[i])===null||r===void 0||(o=r.contentItem)===null||o===void 0||(s=o.config)===null||s===void 0)&&s.isClosable);if(a){t=!1;break}}return t}canReopenLast(){var e,t,{workspace:i,glContainer:r}=this.props,o=(e=P.getStackForConfig(r.layoutManager.root,r.getConfig()))===null||e===void 0?void 0:e.config.id;return!((t=i.data.closed)!==null&&t!==void 0&&t.some(s=>s.parentStackId===o))}render(){var e,t,i,{additionalActions:r,glContainer:o}=this.props,s=[...r];s.push(()=>({title:"Re-open closed panel",group:ie.groups.medium+2004,action:this.handleReopenLast,disabled:this.canReopenLast()}));var a=(e=o.tab)===null||e===void 0||(t=e.contentItem)===null||t===void 0||(i=t.config)===null||i===void 0?void 0:i.isClosable;return s.push({title:"Close",order:10,group:ie.groups.low,action:this.handleCloseTab,disabled:a===void 0||!a}),s.push(()=>({title:"Close Tabs to Right",order:20,group:ie.groups.low,action:this.handleCloseTabsRight,disabled:this.canCloseTabsRight()})),s.push(()=>({title:"Close All",order:30,group:ie.groups.low,action:this.handleCloseTabsAll,disabled:this.canCloseAny()})),d.jsx(ie,{actions:s})}}$p(ha,"defaultProps",{additionalActions:[]});var Kp=n=>({workspace:fs(n)}),Wp=Sn(Kp,{setWorkspace:bs})(ha);function ca(n,e,t){return(e=zp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function zp(n){var e=Vp(n,"string");return typeof e=="symbol"?e:e+""}function Vp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ma extends c.PureComponent{constructor(e){super(e),ca(this,"renameInputRef",void 0),this.handleRenameDialogOpened=this.handleRenameDialogOpened.bind(this),this.handleRenameInputChange=this.handleRenameInputChange.bind(this),this.handleRenameCancel=this.handleRenameCancel.bind(this),this.handleRenameSubmit=this.handleRenameSubmit.bind(this),this.renameInputRef=I.createRef();var{value:t}=e;this.state={value:t,valueWasValidated:!1}}componentDidUpdate(e){var{isShown:t}=e,{isShown:i}=this.props;i&&!t&&this.resetState()}resetState(){var{value:e}=this.props;this.setState({value:e,valueWasValidated:!1})}handleRenameDialogOpened(){var e,t;(e=this.renameInputRef)===null||e===void 0||(t=e.current)===null||t===void 0||t.focus()}handleRenameInputChange(e){this.setState({value:e.target.value})}handleRenameCancel(){var{onCancel:e}=this.props;e()}handleRenameSubmit(e){e.stopPropagation(),e.preventDefault();var{value:t}=this.state,i=t==null?void 0:t.trim();if(i!==void 0&&i!==""){var{onSubmit:r}=this.props;r(i)}else this.setState({value:i,valueWasValidated:!0})}renderRenameDialog(){var{isShared:e,isOwner:t,itemType:i}=this.props,{value:r,valueWasValidated:o}=this.state;return d.jsxs("form",{className:$("p-3",{"was-validated":o}),onSubmit:this.handleRenameSubmit,noValidate:!0,role:"presentation",onMouseDown:s=>{s.stopPropagation()},onMouseUp:s=>{s.stopPropagation()},children:[d.jsxs("div",{className:"form-group",children:[d.jsxs("label",{htmlFor:"rename-dialog-".concat(i,"-input"),children:["Rename ",i]}),d.jsx("input",{type:"text",className:"form-control",id:"rename-dialog-".concat(i,"-input"),value:r??void 0,ref:this.renameInputRef,onChange:this.handleRenameInputChange,required:!0}),d.jsxs("div",{className:"invalid-feedback",children:[i," name cannot be empty"]}),(e||!t)&&d.jsxs("div",{className:"pt-2",children:["Renaming this ",i," will rename for all users."]})]}),d.jsxs("div",{className:"text-right",children:[d.jsx(X,{kind:"secondary",className:"mr-2",onClick:this.handleRenameCancel,children:"Cancel"}),d.jsx(X,{kind:"primary",type:"submit",children:"Rename"})]})]})}render(){var{isShown:e,onCancel:t}=this.props;return d.jsx(Pn,{isShown:e,onEntered:this.handleRenameDialogOpened,onExited:t,options:{placement:"bottom"},interactive:!0,closeOnBlur:!0,children:this.renderRenameDialog()})}}ca(ma,"defaultProps",{isShared:!1,isOwner:!0,itemType:"Item",value:""});function Li(n,e,t){return(e=Gp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Gp(n){var e=qp(n,"string");return typeof e=="symbol"?e:e+""}function qp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Zp=L.module("Panel");class Dn extends c.PureComponent{constructor(e){super(e),Li(this,"ref",void 0),Li(this,"getAdditionActions",Tt((i,r,o)=>{var s=[];return r&&s.push(this.getCloneAction()),o&&s.push(this.getRenameAction()),[...s,...i]})),this.handleClearAllFilters=this.handleClearAllFilters.bind(this),this.handleCopyPanel=this.handleCopyPanel.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleBlur=this.handleBlur.bind(this),this.handleHide=this.handleHide.bind(this),this.handleResize=this.handleResize.bind(this),this.handleSessionClosed=this.handleSessionClosed.bind(this),this.handleSessionOpened=this.handleSessionOpened.bind(this),this.handleBeforeShow=this.handleBeforeShow.bind(this),this.handleShow=this.handleShow.bind(this),this.handleTabBlur=this.handleTabBlur.bind(this),this.handleTabFocus=this.handleTabFocus.bind(this),this.handleRenameCancel=this.handleRenameCancel.bind(this),this.handleRenameSubmit=this.handleRenameSubmit.bind(this),this.handleShowRenameDialog=this.handleShowRenameDialog.bind(this),this.handleTabClicked=this.handleTabClicked.bind(this),this.handleTab=this.handleTab.bind(this),this.ref=I.createRef();var{glContainer:t}=this.props;this.state={title:P.getTitleFromContainer(t),showRenameDialog:!1,isWithinPanel:!0}}componentDidMount(){var e,t,{componentPanel:i,glContainer:r,glEventHub:o}=this.props;r.on("resize",this.handleResize),r.on("show",this.handleBeforeShow),r.on("shown",this.handleShow),r.on("hide",this.handleHide),r.on("tab",this.handleTab),r.on("tabClicked",this.handleTabClicked),o.on(Me.SESSION_CLOSED,this.handleSessionClosed),o.on(Me.SESSION_OPENED,this.handleSessionOpened),o.on(nt.focus,this.handleTabFocus),o.on(nt.blur,this.handleTabBlur),o.on(it.CLEAR_ALL_FILTERS,this.handleClearAllFilters),o.emit(Z.MOUNT,i??this),this.setState({isWithinPanel:((e=this.ref.current)===null||e===void 0||(t=e.parentElement)===null||t===void 0?void 0:t.closest(".dh-panel"))!=null})}componentWillUnmount(){var{componentPanel:e,glContainer:t,glEventHub:i}=this.props;t.off("resize",this.handleResize),t.off("show",this.handleBeforeShow),t.off("shown",this.handleShow),t.off("hide",this.handleHide),t.off("tab",this.handleTab),t.off("tabClicked",this.handleTabClicked),i.off(Me.SESSION_CLOSED,this.handleSessionClosed),i.off(Me.SESSION_OPENED,this.handleSessionOpened),i.off(nt.focus,this.handleTabFocus),i.off(nt.blur,this.handleTabBlur),i.off(it.CLEAR_ALL_FILTERS,this.handleClearAllFilters),i.emit(Z.UNMOUNT,e??this)}handleTab(e){e!=null&&this.setState({title:P.getTitleFromTab(e)}),this.forceUpdate();var{onTab:t}=this.props;t(e)}handleTabClicked(e){var{onTabClicked:t}=this.props;t(e)}handleClearAllFilters(){var{onClearAllFilters:e}=this.props;e(...arguments)}handleFocus(e){var{componentPanel:t,glEventHub:i}=this.props;i.emit(Z.FOCUS,t??this);var{onFocus:r}=this.props;r(e)}handleBlur(e){var{onBlur:t}=this.props;t(e)}handleHide(){var{onHide:e}=this.props;e(...arguments)}handleResize(){var{onResize:e}=this.props;e(...arguments)}handleSessionClosed(e){var{onSessionClose:t}=this.props;t(e)}handleSessionOpened(e,t){var{onSessionOpen:i}=this.props;i(e,t)}handleBeforeShow(){var{onBeforeShow:e}=this.props;e(...arguments)}handleShow(){var{onShow:e}=this.props;e(...arguments)}handleTabBlur(){var{onTabBlur:e}=this.props;e(...arguments)}handleTabFocus(){var{onTabFocus:e}=this.props;e(...arguments)}handleRenameCancel(){this.setState({showRenameDialog:!1})}handleShowRenameDialog(){this.setState({showRenameDialog:!0})}handleRenameSubmit(e){var{glContainer:t}=this.props;this.setState({showRenameDialog:!1,title:e});var i=P.getRootFromContainer(t),r=P.getComponentConfigFromContainer(t);H(r),P.renameComponent(i,r,e)}handleCopyPanel(){var{glContainer:e,glEventHub:t}=this.props,i=P.getRootFromContainer(e),r=P.getComponentConfigFromContainer(e);if(r==null){Zp.error("Could not get component config from container",e);return}var o=P.cloneComponent(i,r);o!==null&&t.emit(Z.CLONED,this,o)}getCloneAction(){return{title:"Copy Panel",order:10,group:ie.groups.high,action:this.handleCopyPanel}}getRenameAction(){return{title:"Rename",order:10,group:ie.groups.medium,action:this.handleShowRenameDialog}}render(){var{children:e,className:t,renderTabTooltip:i,glContainer:r,glEventHub:o,additionalActions:s,errorMessage:a,isLoaded:l,isLoading:u,isClonable:h,isRenamable:m}=this.props,{tab:p}=r,{showRenameDialog:v,title:g,isWithinPanel:f}=this.state;return d.jsxs("div",{className:$("h-100 w-100 dh-panel",t),onFocusCapture:this.handleFocus,onBlurCapture:this.handleBlur,ref:this.ref,children:[e,d.jsx(wn,{errorMessage:a,isLoaded:l,isLoading:u}),!f&&p!=null&&$i.createPortal(d.jsxs(d.Fragment,{children:[d.jsx(Wp,{glContainer:r,glEventHub:o,additionalActions:this.getAdditionActions(s,h,m)}),m&&d.jsx(ma,{isShown:v,value:g,itemType:"Panel",onCancel:this.handleRenameCancel,onSubmit:this.handleRenameSubmit}),i!=null&&d.jsx(ne,{interactive:!0,options:{placement:"bottom"},popperClassName:"panel-tab-popper",children:i()})]}),p.element[0])]})}}Li(Dn,"defaultProps",{className:"",onTab:()=>{},onTabClicked:()=>{},onClearAllFilters:()=>{},onFocus:()=>{},onBlur:()=>{},onHide:()=>{},onResize:()=>{},onSessionClose:()=>{},onSessionOpen:()=>{},onBeforeShow:()=>{},onShow:()=>{},onTabBlur:()=>{},onTabFocus:()=>{},renderTabTooltip:null,additionalActions:[],errorMessage:null,isLoading:!1,isLoaded:!0,isClonable:!1,isRenamable:!1});var Xp=Object.freeze({}),Yp=new Map,di=Object.freeze([]),Mf=(n,e)=>{var t;return(t=ye(n,e).columns)!==null&&t!==void 0?t:di},Df=(n,e)=>{var t;return(t=ye(n,e).filterSets)!==null&&t!==void 0?t:di},jf=(n,e)=>{var t;return(t=ye(n,e).filters)!==null&&t!==void 0?t:di},kf=(n,e)=>{var t;return(t=ye(n,e).tableMap)!==null&&t!==void 0?t:Yp},Nf=(n,e)=>ye(n,e).isolatedLinkerPanelId,Af=(n,e)=>{var t;return(t=ye(n,e).links)!==null&&t!==void 0?t:di},Lf=(n,e)=>ye(n,e).columnSelectionValidator,Rf=(n,e)=>{var t;return(t=ye(n,e).consoleSettings)!==null&&t!==void 0?t:Xp},Ff=(n,e)=>ye(n,e).connection,ui=(n,e)=>ye(n,e).sessionWrapper;function ni(n,e,t){return(e=Qp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Qp(n){var e=Jp(n,"string");return typeof e=="symbol"?e:e+""}function Jp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Bn=L.module("CommandHistoryPanel");class jn extends c.Component{static handleError(e){Bn.error(e)}constructor(e){super(e),ni(this,"container",void 0),ni(this,"pending",void 0),this.handleFocusHistory=this.handleFocusHistory.bind(this),this.handleSessionOpened=this.handleSessionOpened.bind(this),this.handleSessionClosed=this.handleSessionClosed.bind(this),this.handleShow=this.handleShow.bind(this),this.handleSendToConsole=this.handleSendToConsole.bind(this),this.handleSendToNotebook=this.handleSendToNotebook.bind(this),this.container=I.createRef(),this.pending=new _n;var{session:t,sessionId:i,language:r}=e;this.state={panelState:{},session:t,sessionId:i,language:r,contextActions:[{action:this.handleFocusHistory,shortcut:Yt.COMMAND_HISTORY.FOCUS_HISTORY}]}}componentDidMount(){var{glEventHub:e,session:t}=this.props;e.on(Me.FOCUS_HISTORY,this.handleFocusHistory),t!=null&&this.loadTable()}componentWillUnmount(){var{glEventHub:e}=this.props;e.off(Me.FOCUS_HISTORY,this.handleFocusHistory),this.pending.cancel()}handleFocusHistory(){this.container.current&&this.container.current.focus()}handleShow(){var e;(e=this.container.current)===null||e===void 0||e.restoreScrollPosition()}handleSessionOpened(e,t){var{language:i,sessionId:r}=t;this.setState({session:e,sessionId:r,language:i},()=>{this.loadTable()})}handleSessionClosed(){this.pending.cancel(),this.setState({session:void 0,language:void 0,table:void 0})}handleSendToNotebook(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,{session:i,language:r}=this.state;if(Bn.debug("handleSendToNotebook",i,e),!i){Bn.error("Session is not connected.");return}var{glEventHub:o}=this.props;o.emit(t?Ee.CREATE_NOTEBOOK:Ee.SEND_TO_NOTEBOOK,i,r,e)}handleSendToConsole(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;Bn.debug("handleSendToConsole",e);var{glEventHub:r}=this.props;r.emit(Me.SEND_COMMAND,e,t,i)}loadTable(){var{commandHistoryStorage:e}=this.props,{language:t,sessionId:i}=this.state;H(t),H(i),this.pending.add(e.getTable(t,i,Date.now()),r=>r.close()).then(r=>{this.setState({table:r})}).catch(jn.handleError)}render(){var{glContainer:e,glEventHub:t,commandHistoryStorage:i}=this.props,{language:r,contextActions:o,table:s}=this.state;return d.jsxs(Dn,{className:"command-history-pane",componentPanel:this,glContainer:e,glEventHub:t,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,onShow:this.handleShow,children:[!s&&d.jsx("div",{className:"command-history-disconnected-message",children:"Waiting for console connection"}),s&&r!=null&&d.jsxs(d.Fragment,{children:[d.jsx(Se,{ref:this.container,language:r,sendToNotebook:this.handleSendToNotebook,sendToConsole:this.handleSendToConsole,table:s,commandHistoryStorage:i}),d.jsx(ie,{actions:o})]})]})}}ni(jn,"COMPONENT","CommandHistoryPanel");ni(jn,"TITLE","Command History");var ev=(n,e)=>{var t=vs(n),i=ui(n,e.localDashboardId),{session:r,config:o}=i??{},{type:s,id:a}=o??{};return{commandHistoryStorage:t,language:s,session:r,sessionId:a}},Hf=Sn(ev,null,null,{forwardRef:!0})(jn);function So(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Kn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?So(Object(t),!0).forEach(function(i){Lt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):So(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Lt(n,e,t){return(e=tv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function tv(n){var e=nv(n,"string");return typeof e=="symbol"?e:e+""}function nv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Wn=L.module("ConsolePanel"),iv=500,rv=Object.freeze({consoleSettings:{},itemIds:[]});class hi extends c.PureComponent{constructor(e){super(e),Lt(this,"consoleRef",void 0),Lt(this,"objectSubscriptionCleanup",void 0),Lt(this,"savePanelState",ii(()=>{var{consoleSettings:s,itemIds:a}=this.state,l={consoleSettings:s,itemIds:[...a]};Wn.debug("Saving panel state",l),this.setState({panelState:l})},iv)),this.handleFocusCommandHistory=this.handleFocusCommandHistory.bind(this),this.handleOpenObject=this.handleOpenObject.bind(this),this.handleCloseObject=this.handleCloseObject.bind(this),this.handleResize=this.handleResize.bind(this),this.handleSettingsChange=this.handleSettingsChange.bind(this),this.handleShow=this.handleShow.bind(this),this.handlePanelMount=this.handlePanelMount.bind(this),this.supportsType=this.supportsType.bind(this),this.iconForType=this.iconForType.bind(this),this.consoleRef=I.createRef();var{panelState:t}=e,i=Kn(Kn({},rv),t||{}),{consoleSettings:r,itemIds:o}=i;this.state={consoleSettings:r,itemIds:new Map(o),objectMap:new Map,error:void 0,panelState:i}}componentDidMount(){var{glEventHub:e}=this.props;this.closeDisconnectedPanels(),e.on(Z.MOUNT,this.handlePanelMount),this.subscribeToFieldUpdates()}componentDidUpdate(e,t){var{consoleSettings:i,itemIds:r}=this.state;(t.consoleSettings!==i||t.itemIds!==r)&&this.savePanelState()}componentWillUnmount(){var e,{glEventHub:t}=this.props;this.savePanelState.flush(),t.off(Z.MOUNT,this.handlePanelMount),(e=this.objectSubscriptionCleanup)===null||e===void 0||e.call(this)}subscribeToFieldUpdates(){var{sessionWrapper:e}=this.props;if(e!=null){var{session:t}=e;this.objectSubscriptionCleanup=t.subscribeToFieldUpdates(i=>{Wn.debug("Got updates",i),this.setState(r=>{var{objectMap:o}=r,{updated:s,created:a,removed:l}=i,u=[...s,...l],h=new Map(o);u.forEach(p=>{var{title:v}=p;v!==void 0&&h.delete(v)});var m=[...s,...a];return m.forEach(p=>{p.title!==void 0&&h.set(p.title,p)}),{objectMap:h}})})}}setItemId(e,t){this.setState(i=>{var{itemIds:r}=i,o=new Map(r);return o.set(e,t),{itemIds:o}})}getItemId(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,{itemIds:i}=this.state,r=i.get(e);return r==null&&t&&(r=Pt(),this.setItemId(e,r)),r}handleTabFocus(){var e;(e=this.consoleRef.current)===null||e===void 0||e.focus()}handlePanelMount(e){var t,i,r,{itemIds:o}=this.state,s=e==null||(t=e.props)===null||t===void 0?void 0:t.id,a=e==null||(i=e.props)===null||i===void 0||(r=i.metadata)===null||r===void 0?void 0:r.sourcePanelId;if(s&&a){var l=new Set(o.values());l.has(a)&&this.setItemId(s,s)}}handleFocusCommandHistory(){var{glEventHub:e}=this.props;e.emit(Me.FOCUS_HISTORY)}handleResize(){this.updateDimensions()}handleShow(){this.updateDimensions()}handleOpenObject(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,{root:i}=this.context,r=e.title!=null?this.getItemId(e.title,!1):null;(t||r!=null&&P.getStackForRoot(i,{id:r},!1,!1,!1)!=null)&&this.openWidget(e)}handleCloseObject(e){var{title:t}=e;if(t!==void 0){var i=this.getItemId(t,!1);if(i!=null){var{glEventHub:r}=this.props;r.emit(Z.CLOSE,i)}}}handleSettingsChange(e){var{glEventHub:t}=this.props;Wn.debug("handleSettingsChange",e),this.setState({consoleSettings:e}),t.emit(Me.SETTINGS_CHANGED,e)}openWidget(e){var{glEventHub:t,sessionWrapper:i}=this.props;H(i);var{config:r,session:o}=i,{title:s=e.name}=e;H(s);var a=this.getItemId(s),l={fetch:()=>o.getObject(e),panelId:a,widget:Kn(Kn({},Gd(e)),{},{sessionId:r.id})};Wn.debug("openWidget",l),t.emit(Z.OPEN,l)}addCommand(e){var t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;(t=this.consoleRef.current)===null||t===void 0||t.addCommand(e,i,r)}closeDisconnectedPanels(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,{consoleSettings:t,itemIds:i}=this.state,{isClosePanelsOnDisconnectEnabled:r=!0}=t;if(!(!r&&!e)){var o=[...i.values()],{glEventHub:s}=this.props;o.forEach(a=>{s.emit(Z.CLOSE,a)}),this.setState({itemIds:new Map})}}updateDimensions(){var e;(e=this.consoleRef.current)===null||e===void 0||e.updateDimensions()}supportsType(e){var{plugins:t}=this.props;return[...t.values()].some(i=>kr(i,e))}iconForType(e){var{plugins:t}=this.props,i=[...t.values()].find(r=>kr(r,e));return i!=null?Uu(i):d.jsx(eh,{type:e})}render(){var{commandHistoryStorage:e,glContainer:t,glEventHub:i,sessionWrapper:r,timeZone:o,unzip:s}=this.props;if(r==null)return d.jsx(wn,{isLoading:!1,errorMessage:"Console is disabled."});var{consoleSettings:a,error:l,objectMap:u}=this.state,{config:h,session:m,connection:p,details:v={},dh:g}=r,{workerName:f,processInfoId:y}=v,{id:_,type:S}=h;return d.jsx(Dn,{className:"iris-panel-console",componentPanel:this,glContainer:t,glEventHub:i,onResize:this.handleResize,onShow:this.handleShow,onTabFocus:this.handleTabFocus,errorMessage:l!=null?"".concat(l):void 0,children:m!=null&&d.jsx(Et,{dh:g,ref:this.consoleRef,settings:a,session:m,focusCommandHistory:this.handleFocusCommandHistory,openObject:this.handleOpenObject,closeObject:this.handleCloseObject,commandHistoryStorage:e,onSettingsChange:this.handleSettingsChange,language:S,statusBarChildren:d.jsxs(d.Fragment,{children:[d.jsx("div",{children:Ss.LANGUAGE_MAP.get(S)}),f!=null&&d.jsxs(d.Fragment,{children:[d.jsx("div",{children:"•"}),f]}),y!=null&&d.jsxs(d.Fragment,{children:[d.jsx("div",{children:"•"}),y,d.jsx("div",{children:"•"})]}),d.jsx(Hc,{connection:p,defaultUpdateInterval:10*1e3,hoverUpdateInterval:3*1e3,monitorDuration:10*60*1e3})]}),scope:_,timeZone:o,objectMap:u,unzip:s,supportsType:this.supportsType,iconForType:this.iconForType})})}}Lt(hi,"COMPONENT","ConsolePanel");Lt(hi,"TITLE","Console");Lt(hi,"contextType",ip);var ov=(n,e)=>({commandHistoryStorage:vs(n),sessionWrapper:ui(n,e.localDashboardId),timeZone:nu(n),plugins:iu(n)}),$f=Sn(ov,null,null,{forwardRef:!0})(hi);function Uf(n){return n==="file"||n==="directory"}function Ye(n){return n.type==="directory"}function sv(n,e,t){return(e=av(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function av(n){var e=lv(n,"string");return typeof e=="symbol"?e:e+""}function lv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Xi extends Error{constructor(){super("No file exists at the path specified"),sv(this,"isFileNotFound",!0)}}function _o(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(u){return void t(u)}a.done?e(l):Promise.resolve(l).then(i,r)}function Eo(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){_o(o,i,r,s,a,"next",l)}function a(l){_o(o,i,r,s,a,"throw",l)}s(void 0)})}}var ut;(function(n){n.GROOVY="text/x-groovy",n.PLAIN_TEXT="text/plain",n.PYTHON="text/x-python",n.PYTHON_COMPILED="application/x-python-code",n.SCALA="text/x-scala",n.UNKNOWN=""})(ut||(ut={}));class A{static fileExists(e,t){return Eo(function*(){try{return yield e.info(t),!0}catch(i){if(!(i instanceof Xi))throw i;return!1}})()}static fileExtensionToString(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return e.length===0?"":".".concat(e)}static getDepth(e){var t;if(!A.hasPath(e))throw new Error("Invalid path provided: ".concat(e));var i=(t=e.match(/\//g))!==null&&t!==void 0?t:[];return i.length-1}static getExtension(e){var t=this.getBaseName(e).split(".");if(t.length>1){var i;return(i=t.pop())!==null&&i!==void 0?i:""}return""}static getBaseName(e){var t;return(t=e.split("/").pop())!==null&&t!==void 0?t:""}static getCopyFileName(e){var t=e.lastIndexOf("."),i=null,r=null;t<0?r=e:(r=e.substring(0,t),i=e.substring(t+1));var o=r?"".concat(r,"-copy"):"Copy";return i!==null?"".concat(o,".").concat(i):o}static getUniqueCopyFileName(e,t){return Eo(function*(){for(var i=A.getCopyFileName(t);yield A.fileExists(e,i);)i=A.getCopyFileName(i);return i})()}static getMimeType(e){var t=this.getExtension(e).toLowerCase();switch(t){case"groovy":return ut.GROOVY;case"py":return ut.PYTHON;case"pyc":return ut.PYTHON_COMPILED;case"scala":return ut.SCALA;case"txt":return ut.PLAIN_TEXT;default:return ut.UNKNOWN}}static getParent(e){if(!A.hasPath(e))throw new Error("Invalid name provided: ".concat(e));for(var t=e.split("/");t.pop()==="";);if(t.length===0)throw new Error("No parent for path provided: ".concat(e));return"".concat(t.join("/"),"/")}static getPath(e){if(!A.hasPath(e))throw new Error("Invalid filename provided: ".concat(e));var t=e.split("/");return t.pop(),"".concat(t.join("/"),"/")}static hasPath(e){return e.startsWith("/")}static isPath(e){return e.startsWith("/")&&e.endsWith("/")}static makePath(e){return e.endsWith("/")?e:"".concat(e,"/")}static replaceExtension(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=e.lastIndexOf("."),r=i>-1?e.substring(0,i):e,o=A.fileExtensionToString(t);return"".concat(r).concat(o)}static validateName(e){var t=[".",".."],i=/[\\/\0]/g,r=new Map([["\0","null"]]);if(!e)throw new vn("Name cannot be empty");if(t.includes(e))throw new vn('"'.concat(e,'" is a reserved name'));if(i.test(e)){var o,s;throw new vn('Invalid characters in name: "'.concat((o=(s=e.match(i))===null||s===void 0?void 0:s.reduce((a,l)=>a.includes(l)?a:[...a,l],[]).map(a=>r.has(a)?r.get(a):a).join('", "'))!==null&&o!==void 0?o:"",'"'))}}static reducePaths(e){var t=e.filter(i=>A.isPath(i));return e.filter(i=>!t.some(r=>i!==r&&i.startsWith(r)))}static removeRoot(e,t){if(e.length===0)return t;if(!t.startsWith(e))throw new Error("Filename ".concat(t," does not start with expected root ").concat(e));return t.substring(e.length)}static addRoot(e,t){return"".concat(e).concat(t)}}var Yi=26;function Ri(n){return Ye(n)?A.makePath(n.filename):A.getPath(n.filename)}function Po(n,e){if(n.length===0||e==null)throw new Error("No items to move");var t=Ri(e);if(n.some(i=>{var{filename:r}=i;return A.getPath(r)===t}))throw new Error("File already in the destination folder");if(n.some(i=>Ye(i)&&t.startsWith(A.makePath(i.filename))))throw new Error("Destination folder cannot be a child of a dragged folder");return{files:n,targetPath:t}}function dv(n){if(Ye(n))return n.isExpanded?qa:Za;var e=A.getMimeType(n.basename);switch(e){case ut.PYTHON:return Ya;default:return Xa}}function Fi(n){var e,{children:t,draggedItems:i,isDragInProgress:r,isDropTargetValid:o,isSelected:s,item:a,itemIndex:l,dropTargetItem:u,onDragStart:h,onDragOver:m,onDragEnd:p,onDrop:v}=n,g=(e=i==null?void 0:i.some(x=>x.id===a.id))!==null&&e!==void 0?e:!1,f=Ri(a),y=r&&u?Ri(u):null,_=r&&o&&Ye(a)&&y===f,S=r&&o&&y===f,C=r&&!o&&y===f,M=dv(a),K=A.getDepth(a.filename),Y=Array(K).fill(null).map((x,z)=>d.jsx("span",{className:"file-list-depth-line"},z));return d.jsxs("div",{className:$("d-flex w-100 align-items-center","file-list-item",{"is-dragged":g,"is-exact-drop-target":_,"is-in-drop-target":S,"is-invalid-drop-target":C,"is-selected":s}),onDragStart:x=>h(l,x),onDragOver:x=>m(l,x),onDragEnd:x=>p(l,x),onDrop:x=>v(l,x),draggable:!0,role:"presentation","aria-label":a.basename,children:[Y," ",d.jsx(re,{icon:M,className:"item-icon",fixedWidth:!0})," ",d.jsx("span",{className:"truncation-wrapper",children:t??d.jsxs(d.Fragment,{children:[a.basename,d.jsx(ne,{children:a.basename})]})})]})}function To(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function zn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?To(Object(t),!0).forEach(function(i){uv(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):To(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function uv(n,e,t){return(e=hv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function hv(n){var e=cv(n,"string");return typeof e=="symbol"?e:e+""}function cv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ce=L.module("FileList"),mv=500,Oo="item-list-scroll-pane";function pv(n){var{isMultiSelect:e=!1,table:t,onFocusChange:i=()=>{},onMove:r,onSelect:o,onSelectionChange:s=()=>{},renderItem:a=Fi,rowHeight:l=Yi,overscanCount:u=Le.DEFAULT_OVERSCAN}=n,[h,m]=c.useState(()=>({items:[],offset:0,itemCount:0})),[p,v]=c.useState({top:0,bottom:0}),[g,f]=c.useState(),[y,_]=c.useState(),[S,C]=c.useState(),[M,K]=c.useState([]),Y=c.useRef(),x=c.useRef(null),z=c.useRef(null),N=c.useCallback(E=>{if(E.length===0||h==null)return[];for(var W=[],ee=0;ee<E.length;ee+=1)for(var pe=E[ee],je=pe[0];je<=pe[1];je+=1)je>=h.offset&&je<h.offset+h.items.length&&W.push(h.items[je-h.offset]);return W},[h]),Q=c.useCallback(E=>{var W=N([[E,E]]);if(W.length>0)return W[0]},[N]),te=c.useCallback(()=>{var E=qe.count(M);if(E===0)return null;if(E===1){var W=M[0][0],ee=Q(W);if(ee!=null)return ee.filename}return"".concat(E," items")},[Q,M]),j=c.useCallback(E=>{if(!(!y||!g)){Ce.debug("dropItems",y,"to",E);try{var{files:W,targetPath:ee}=Po(y,g);if(r==null||r(W,ee),E!=null){var pe;K([[E,E]]),(pe=x.current)===null||pe===void 0||pe.focusItem(E)}}catch(je){Ce.error("Unable to complete move",je)}}},[y,g,r]),V=c.useCallback((E,W)=>{var ee=h.items[E-h.offset];ee!==void 0&&(Ce.debug("handleItemClick",ee),o(ee,W),Ye(ee)&&(t==null||t.setExpanded(ee.filename,!ee.isExpanded)))},[h,o,t]),R=c.useCallback((E,W)=>{var ee,pe;Ce.debug2("handleItemDragStart",E,M);var je=M;qe.isSelected(M,E)||(je=[[E,E]],K(je)),_(N(je)),(ee=x.current)===null||ee===void 0||ee.resetMouseState();var xt=document.createElement("div"),Ut=document.createElement("div");Ut.className="dnd-placeholder-content",Ut.innerText=(pe=te())!==null&&pe!==void 0?pe:"",xt.appendChild(Ut),xt.className="file-list-dnd-placeholder",document.body.appendChild(xt),W.dataTransfer.setDragImage(xt,0,0),W.dataTransfer.effectAllowed="move",C(xt)},[te,N,M]),D=c.useCallback((E,W)=>{W.preventDefault(),Ce.debug2("handleItemDragOver",W),f(Q(E))},[Q]),F=c.useCallback((E,W)=>{Ce.debug("handleItemDragEnd",E),S==null||S.remove(),_(void 0),f(void 0),C(void 0)},[S]),U=c.useCallback((E,W)=>{j(E)},[j]),ce=c.useCallback(()=>{Ce.debug2("handleItemDragExit"),f(void 0)},[]),Je=c.useCallback(E=>{E.target instanceof Element&&E.target.classList.contains(Oo)&&(E.preventDefault(),Ce.debug2("handleListDragOver",E),f({type:"directory",filename:"/",basename:"/",id:"/"}))},[]),ze=c.useCallback(E=>{E.target instanceof Element&&E.target.classList.contains(Oo)&&(Ce.debug("handleListDrop"),j())},[j]),k=c.useCallback(function(E){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Ce.debug2("handleSelectionChange",E),W===!0||E!==M){K(E);var ee=N(E);s(ee)}},[N,s,M]),J=c.useCallback(E=>{if(Ce.debug2("handleFocusChange",E),E!=null){var[W]=N([[E,E]]);i(W)}else i();Y.current=E},[N,i]),oe=c.useCallback((E,W)=>{Ce.debug("handleViewportChange",E,W),(E!==p.top||W!==p.bottom)&&v({top:E,bottom:W})},[p]),an=c.useMemo(()=>{if(!y||!g)return!1;try{return Po(y,g),Ce.debug("handleValidateDropTarget true"),!0}catch{return Ce.debug("handleValidateDropTarget false"),!1}},[y,g]),{focusedPath:pt}=n;c.useEffect(()=>{pt!==void 0&&(pt==="/"?t.collapseAll():(t.setExpanded(pt,!1),t.setExpanded(pt,!0)))},[t,pt]),c.useEffect(function(){Ce.debug("updating table viewport",p),t==null||t.setViewport({top:Math.max(0,p.top-u),bottom:p.bottom+u})},[u,t,p]),c.useEffect(function(){var W=t.onUpdate(ee=>{m({items:ee.items.map(pe=>zn(zn({},pe),{},{itemName:pe.basename})),offset:ee.offset,itemCount:t.size})});return()=>{W()}},[t]),c.useEffect(function(){Y.current!=null&&J(Y.current),M.length>0&&k(M,!0)},[h,J,k,M]),c.useEffect(function(){if(g!=null&&Ye(g)&&g.filename!=="/"){var W=setTimeout(()=>{g.isExpanded||t==null||t.setExpanded(g.filename,!0)},mv);return()=>clearTimeout(W)}},[g,t]);var kn=c.useCallback(E=>a(zn(zn({},E),{},{isDragInProgress:y!=null,dropTargetItem:g,draggedItems:y,isDropTargetValid:an,onDragStart:R,onDragEnd:F,onDragOver:D,onDragExit:ce,onDrop:U})),[F,ce,D,R,U,y,g,an,a]);return d.jsx("div",{ref:z,className:$("file-list",{"is-dragging":y!=null}),onDragOver:Je,onDrop:ze,children:d.jsx(Le,{ref:x,items:h.items,itemCount:h.itemCount,offset:h.offset,onFocusChange:J,onSelect:V,onSelectionChange:k,onViewportChange:oe,selectedRanges:M,renderItem:kn,rowHeight:l,isMultiSelect:e,isDragSelect:!1,isDeselectOnClick:!1})})}var vv={DELETE:ae.createAndAdd({id:"FILE_EXPLORER.DELETE",name:"Delete",shortcut:[w.DELETE],macShortcut:[O.CMD,w.BACKSPACE]}),RENAME:ae.createAndAdd({id:"FILE_EXPLORER.RENAME",name:"Rename",shortcut:[w.ENTER],macShortcut:[w.ENTER]})};const xo={FILE_EXPLORER:vv};var Io=L.module("FileListItemEditor"),fv=()=>Promise.resolve();function gv(n){var{item:e,onCancel:t,onSubmit:i,validate:r=fv}=n,o=c.useRef(null),[s,a]=c.useState(e.basename),[l,u]=c.useState(),[h,m]=c.useState(Promise.resolve()),p=c.useCallback(()=>{var S;(S=o.current)===null||S===void 0||S.focus()},[o]),v=c.useCallback(S=>S.stopPropagation(),[]),g=c.useCallback(()=>{h.then(()=>{i(s)}).catch(S=>Io.info("Unable to validate name",S))},[i,s,h]);c.useEffect(function(){var C=Fe.makeCancelable(r(s));return C.then(()=>u(void 0)).catch(M=>{Fe.isCanceled(M)||u(M)}),m(C),()=>C.cancel()},[r,s]),c.useEffect(function(){p()},[p]);var f=c.useCallback(()=>{Io.debug2("handleBlur"),g()},[g]),y=c.useCallback(S=>{var{value:C}=S.target;a(C)},[]),_=c.useCallback(S=>{S.stopPropagation();var{key:C}=S;switch(C){case"Enter":{g();break}case"Escape":{t();break}}},[t,g]);return d.jsxs("div",{className:"file-list-item-editor",children:[d.jsx("input",{type:"text",className:$("form-control file-list-item-editor-input",{"is-invalid":l}),value:s,ref:o,onBlur:f,onKeyDown:_,onChange:y,onClick:v,onDoubleClick:v,onMouseDown:v}),l&&d.jsx("div",{className:"invalid-feedback",children:"".concat(l)})]})}function Mo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Si(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Mo(Object(t),!0).forEach(function(i){bv(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Mo(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function bv(n,e,t){return(e=yv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yv(n){var e=Cv(n,"string");return typeof e=="symbol"?e:e+""}function Cv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function pa(n){var{isMultiSelect:e=!1,focusedPath:t,showContextMenu:i=!1,onCreateFile:r,onCreateFolder:o,onCopy:s,onDelete:a,onMove:l,onRename:u,onSelect:h,onSelectionChange:m,table:p,rowHeight:v=Yi,validateRename:g=()=>Promise.resolve()}=n,[f,y]=c.useState(),[_,S]=c.useState([]),[C,M]=c.useState(),K=c.useCallback(U=>{S(U),m==null||m(U)},[m]),Y=c.useCallback(U=>{M(U)},[]),x=c.useCallback(()=>{C&&(s==null||s(C))},[C,s]),z=c.useCallback(()=>{_.length>0&&(a==null||a(_))},[a,_]),N=c.useCallback(()=>{r==null||r()},[r]),Q=c.useCallback(()=>{C&&(o==null||o(A.getPath(C.filename)))},[C,o]),te=c.useCallback(()=>{C&&y(C)},[C]),j=c.useCallback(()=>{y(void 0)},[]),V=c.useCallback(U=>{f&&(u==null||u(f,U),y(void 0))},[u,f]),R=c.useMemo(()=>{if(f)return[];var U=[];return r&&U.push({title:"New File",description:"Create new file",action:N,group:ie.groups.medium}),o&&U.push({title:"New Folder",description:"Create new folder",action:Q,group:ie.groups.medium}),s&&U.push({title:"Copy File",description:"Copy the selected file",action:x,group:ie.groups.low,disabled:C==null||Ye(C)}),a&&_.length>0&&U.push({title:"Delete",description:"Delete",shortcut:xo.FILE_EXPLORER.DELETE,action:z,group:ie.groups.low}),u&&U.push({title:"Rename",description:"Rename",shortcut:xo.FILE_EXPLORER.RENAME,action:te,group:ie.groups.low,disabled:C==null}),U},[x,z,N,Q,te,C,s,r,o,a,u,_,f]),D=c.useCallback(U=>(H(f),g(f,U)),[f,g]),F=c.useCallback(U=>{var{item:ce}=U;return f&&f.filename===ce.filename?d.jsx(Fi,Si(Si({},U),{},{children:d.jsx(gv,{item:ce,validate:D,onSubmit:V,onCancel:j})})):d.jsx(Fi,Si({},U))},[j,V,f,D]);return d.jsxs("div",{className:"file-list-container",children:[p!=null&&d.jsx(pv,{onMove:l,onSelect:h,onSelectionChange:K,onFocusChange:Y,renderItem:F,rowHeight:v,table:p,isMultiSelect:e,focusedPath:t}),i&&d.jsx(ie,{actions:R})]})}pa.displayName="FileListContainer";function Do(n,e,t){return(e=wv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wv(n){var e=Sv(n,"string");return typeof e=="symbol"?e:e+""}function Sv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Gn extends vn{constructor(e){super("Name already exists"),Do(this,"isExistingFile",!0),Do(this,"info",void 0),this.info=e}}function jo(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(u){return void t(u)}a.done?e(l):Promise.resolve(l).then(i,r)}function ko(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){jo(o,i,r,s,a,"next",l)}function a(l){jo(o,i,r,s,a,"throw",l)}s(void 0)})}}var et=L.module("FileExplorer");function Qi(n){var{storage:e,isMultiSelect:t=!1,focusedPath:i,onCopy:r=()=>{},onDelete:o=()=>{},onRename:s=()=>{},onCreateFile:a=()=>{},onCreateFolder:l=()=>{},onSelect:u,onSelectionChange:h,rowHeight:m=Yi}=n,[p,v]=c.useState([]),[g,f]=c.useState();c.useEffect(function(){var V;function R(){return D.apply(this,arguments)}function D(){return D=ko(function*(){et.debug("initTable"),V=Fe.makeCancelable(e.getTable(),F=>F.close());try{f(yield V)}catch(F){Fe.isCanceled(F)||et.error("Unable to initialize table",F)}}),D.apply(this,arguments)}return R(),()=>{V.cancel()}},[e]);var y=c.useCallback(j=>{Fe.isCanceled(j)||et.error(j)},[]),_=c.useCallback(()=>{et.debug("handleCreateFile"),a()},[a]),S=c.useCallback(()=>{et.debug("handleCreateFolder"),l()},[l]),C=c.useCallback(j=>{et.debug("handleCopyFile",j.filename),r(j)},[r]),M=c.useCallback(j=>{et.debug("handleDelete, pending confirmation",j),v(j)},[]),K=c.useCallback(()=>{et.debug("handleDeleteConfirm",p),p.forEach(j=>e.deleteFile(Ye(j)?A.makePath(j.filename):j.filename)),o(p),v([])},[p,o,e]),Y=c.useCallback(()=>{et.debug("handleDeleteCancel"),v([])},[]),x=c.useCallback((j,V)=>{var R=A.reducePaths(j.map(D=>Ye(D)?A.makePath(D.filename):D.filename));R.forEach(D=>{var F=A.isPath(D)?"".concat(V).concat(A.getBaseName(D.substring(0,D.length-1)),"/"):"".concat(V).concat(A.getBaseName(D));e.moveFile(D,F).then(()=>{s(D,F)}).catch(y)})},[y,s,e]),z=c.useCallback((j,V)=>{var R=j.filename,D=Ye(j);D&&!R.endsWith("/")&&(R="".concat(R,"/"));var F="".concat(A.getParent(R)).concat(V);D&&!F.endsWith("/")&&(F="".concat(F,"/")),et.debug2("handleRename",R,F),e.moveFile(R,F).catch(y),s(R,F)},[y,s,e]),N=c.useCallback(function(){var j=ko(function*(V,R){if(R!==V.basename){A.validateName(R);var D="".concat(A.getPath(V.filename)).concat(R);try{var F=yield e.info(D);throw new Gn(F)}catch(U){if(!(U instanceof Xi))throw U}}});return function(V,R){return j.apply(this,arguments)}}(),[e]),Q=p.length>0,te=c.useMemo(()=>p.length===1?'Are you sure you want to delete "'.concat(p[0].filename,'"?'):"Are you sure you want to delete the selected files?",[p]);return d.jsxs("div",{className:"file-explorer",children:[g&&d.jsx(pa,{isMultiSelect:t,focusedPath:i,showContextMenu:!0,onCopy:C,onCreateFolder:S,onCreateFile:_,onMove:x,onDelete:M,onRename:z,onSelect:u,onSelectionChange:h,rowHeight:m,table:g,validateRename:N}),d.jsx(yn,{isOpen:Q,headerText:te,bodyText:"You cannot undo this action.",onCancel:Y,onConfirm:K,confirmButtonText:"Delete"})]})}Qi.displayName="FileExplorer";function No(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(u){return void t(u)}a.done?e(l):Promise.resolve(l).then(i,r)}function _v(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){No(o,i,r,s,a,"next",l)}function a(l){No(o,i,r,s,a,"throw",l)}s(void 0)})}}function wt(n,e,t){return(e=Ev(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ev(n){var e=Pv(n,"string");return typeof e=="symbol"?e:e+""}function Pv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Mt=L.module("NewItemModal");class Rt extends c.PureComponent{static getValidationMessage(e){return e instanceof Gn&&e.info.type==="directory"?"Error: Cannot overwrite existing directory":"".concat(e)}static handleError(e){Fe.isCanceled(e)||Mt.error(e)}constructor(e){super(e),wt(this,"inputRef",I.createRef()),wt(this,"cancelableValidatePromise",void 0),wt(this,"cancelableExistingItemPromise",void 0),wt(this,"pending",new _n),wt(this,"pathMap",new Map),wt(this,"isInitialLoad",!0),this.handleModalSubmit=this.handleModalSubmit.bind(this),this.handleModalOpened=this.handleModalOpened.bind(this),this.handleSelect=this.handleSelect.bind(this),this.handleChange=this.handleChange.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleValidationError=this.handleValidationError.bind(this),this.handleOverwriteCancel=this.handleOverwriteCancel.bind(this),this.handleOverwriteConfirm=this.handleOverwriteConfirm.bind(this),this.handleExtensionChangeCancel=this.handleExtensionChangeCancel.bind(this),this.handleExtensionChangeConfirm=this.handleExtensionChangeConfirm.bind(this),this.handleBreadcrumbSelect=this.handleBreadcrumbSelect.bind(this);var{defaultValue:t}=e,i=A.hasPath(t)?A.getPath(t):"/";this.state={isSubmitting:!1,path:i,prevExtension:A.getExtension(t),showExtensionChangeModal:!1,showOverwriteModal:!1,value:A.getBaseName(t)}}componentDidUpdate(e,t){var{isOpen:i}=this.props,{isOpen:r}=e,{value:o,path:s}=this.state;!r&&i&&(this.resetValue(),this.isInitialLoad=!0),r&&i&&(!this.isInitialLoad&&(s!==t.path||o!==t.value)&&this.updateValidationStatus(s,o),this.isInitialLoad=!1)}componentWillUnmount(){this.pending.cancel(),this.cancelableValidatePromise&&this.cancelableValidatePromise.cancel(),this.cancelableExistingItemPromise&&this.cancelableExistingItemPromise.cancel()}resetValue(){var{defaultValue:e}=this.props,t=A.hasPath(e)?A.getPath(e):"/";this.setState({path:t,value:A.getBaseName(e),validationError:void 0,prevExtension:A.getExtension(e),isSubmitting:!1})}getValidationPromise(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.cancelableValidatePromise&&this.cancelableValidatePromise.cancel(),this.cancelableValidatePromise=Fe.makeCancelable(this.validateName(e,t,i)),this.cancelableValidatePromise}validateName(e,t,i){var r=this;return _v(function*(){A.validateName(t);var{defaultValue:o,storage:s}=r.props;if(i){var a="".concat(e).concat(t);if(a!==o)try{var l=yield s.info(a);throw new Gn(l)}catch(u){if(!(u instanceof Xi))throw u}}return t})()}updateValidationStatus(e,t){this.getValidationPromise(e,t).then(()=>{this.setState({validationError:void 0})}).catch(this.handleValidationError).catch(Rt.handleError)}handleModalOpened(){this.focusRenameInput()}handleModalSubmit(){this.submitModal()}handleChange(e){var{value:t}=e.target;this.setState({value:t})}handleSelect(e){if(Mt.debug("handleSelect",e),e.type==="directory")this.setState({path:A.makePath(e.filename)});else{var t=e.basename,i=A.getPath(e.filename);this.setState({value:t,path:i},()=>{this.focusRenameInput()})}}handleKeyDown(e){var{key:t}=e;switch(e.stopPropagation(),t){case"Enter":{e.preventDefault(),this.submitModal();break}case"Escape":{e.preventDefault();var{onCancel:i}=this.props;i();break}}}handleValidationError(e){if(!(e instanceof vn))throw e;Mt.debug("Validation error",e),this.setState({validationError:e})}handleOverwriteCancel(){this.setState({showOverwriteModal:!1,isSubmitting:!1})}handleOverwriteConfirm(){this.setState({showOverwriteModal:!1});var{onSubmit:e}=this.props,{path:t,value:i}=this.state;Mt.debug("handleOverwriteConfirm",t,i),e("".concat(t).concat(i),!0)}handleExtensionChangeCancel(){Mt.debug("handleExtensionChangeCancel"),this.setState(e=>{var{value:t,prevExtension:i}=e,r=A.replaceExtension(t,i);return{showExtensionChangeModal:!1,value:r}}),this.submitModal(!0)}handleExtensionChangeConfirm(){Mt.debug("handleExtensionChangeConfirm"),this.setState({showExtensionChangeModal:!1}),this.submitModal(!0)}focusRenameInput(){var e=this.inputRef.current;if(e){var{type:t}=this.props,{value:i}=e,r=t==="directory"?i.length:i.lastIndexOf(".");e.focus(),e.setSelectionRange(0,r>0?r:i.length)}}submitModal(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.setState(t=>{var{prevExtension:i,value:r,path:o}=t,{notifyOnExtensionChange:s,type:a}=this.props;Mt.debug("submitModal",i,r);var l=A.getExtension(r);return s&&!e&&i!==null&&i!==l?{isSubmitting:!1,showExtensionChangeModal:!0,newExtension:l}:(this.getValidationPromise(o,r,!0).then(u=>{var{onSubmit:h}=this.props;h("".concat(o).concat(r))}).catch(u=>{if(u instanceof Gn&&a!=="directory"&&u.info.type!=="directory"){this.setState({showOverwriteModal:!0});return}throw u}).catch(u=>{throw Fe.isCanceled(u)&&this.setState({isSubmitting:!1}),u}).catch(this.handleValidationError).catch(Rt.handleError),{isSubmitting:!0,showExtensionChangeModal:!1,newExtension:void 0})})}handleBreadcrumbSelect(e){this.setState({path:e})}renderPathButtons(e){var t=e.split("/");return t.pop(),t.map((i,r)=>{for(var o="",s=0;s<r;s+=1)o+="".concat(t[s],"/");return o+="".concat(i,"/"),d.jsxs(I.Fragment,{children:[d.jsx(X,{kind:"ghost",className:"directory-breadcrumbs",onClick:()=>this.handleBreadcrumbSelect(o),"aria-label":r===0?"Home":void 0,icon:r===0?d.jsx(re,{icon:Qa,transform:"right-1.6"}):void 0,tooltip:r===0?"Home":void 0,children:i}),"/"]},o)})}render(){var{storage:e,isOpen:t,onCancel:i,placeholder:r,title:o,type:s}=this.props,{isSubmitting:a,path:l,showExtensionChangeModal:u,showOverwriteModal:h,validationError:m,value:p,prevExtension:v,newExtension:g}=this.state,f=s==="directory",y=A.fileExtensionToString(v),_=A.fileExtensionToString(g),S=f?"Create":"Save",C=f?"New folder name":"Save file as";return d.jsxs(d.Fragment,{children:[d.jsxs(Fo,{isOpen:t,toggle:i,onOpened:this.handleModalOpened,className:"modal-dialog-centered new-file-modal",children:[d.jsx(Ho,{toggle:i,children:o}),d.jsx($o,{children:d.jsx("form",{children:d.jsxs("div",{className:"d-flex flex-column new-file-modal-content",children:[d.jsxs("div",{className:"flex-grow-0 mb-4",children:[d.jsx("label",{htmlFor:"file-name-input",children:C}),d.jsx("input",{id:"file-name-input",type:"text",autoComplete:"off",autoCapitalize:"none",autoCorrect:"off",spellCheck:"false",className:$("form-control",{"is-invalid":m}),value:p,placeholder:r,ref:this.inputRef,onKeyDown:this.handleKeyDown,onChange:this.handleChange}),m&&d.jsx("div",{className:"invalid-feedback",children:Rt.getValidationMessage(m)})]}),d.jsxs("div",{className:"flex-grow-0",children:[d.jsx("label",{children:"Directory: /"}),this.renderPathButtons(l)]}),d.jsx("div",{className:"flex-grow-1 file-explorer-container",children:d.jsx(Qi,{onSelect:this.handleSelect,storage:e,focusedPath:l})})]})})}),d.jsxs(os,{children:[d.jsx(X,{kind:"secondary",onClick:i,children:"Cancel"}),d.jsx(X,{kind:"primary",disabled:a,onClick:this.handleModalSubmit,children:S})]})]}),d.jsx(yn,{isOpen:h,headerText:"Confirm overwrite",bodyText:"File with this name already exists, are you sure you want to overwrite it?",onCancel:this.handleOverwriteCancel,onConfirm:this.handleOverwriteConfirm,cancelButtonText:"Cancel",confirmButtonText:"Overwrite"}),d.jsx(yn,{isOpen:u,headerText:"Confirm extension change",bodyText:'Are you sure you want to change extension from "'.concat(y,'" to "').concat(_,'"?'),onCancel:this.handleExtensionChangeCancel,onConfirm:this.handleExtensionChangeConfirm,cancelButtonText:'Keep "'.concat(y,'"'),confirmButtonText:'Use "'.concat(_,'"')})]})}}wt(Rt,"propTypes",{isOpen:b.bool,title:b.string.isRequired,defaultValue:b.string,type:b.oneOf(["file","directory"]).isRequired,onSubmit:b.func,onCancel:b.func,placeholder:b.string,storage:b.shape({}).isRequired,notifyOnExtensionChange:b.bool});wt(Rt,"defaultProps",{isOpen:!1,defaultValue:"/",notifyOnExtensionChange:!1,placeholder:"",onSubmit:(n,e)=>{},onCancel:()=>{}});function Tv(n){var{createFile:e,createFolder:t,onSearchChange:i,defaultSearchText:r=""}=n;return d.jsxs("div",{className:"file-explorer-toolbar",children:[d.jsxs("div",{className:"file-explorer-toolbar-buttons",children:[d.jsx(X,{kind:"ghost",icon:qo,tooltip:"New notebook",onClick:e,"aria-label":"New notebook"}),d.jsx(X,{kind:"ghost",icon:Ja,tooltip:"New folder",onClick:t,"aria-label":"New folder"})]}),i&&d.jsx("div",{className:"file-explorer-toolbar-search",children:d.jsx(ds,{value:r,onChange:i,placeholder:"Search by name"})})]})}function Ao(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(u){return void t(u)}a.done?e(l):Promise.resolve(l).then(i,r)}function Ov(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){Ao(o,i,r,s,a,"next",l)}function a(l){Ao(o,i,r,s,a,"throw",l)}s(void 0)})}}function va(n,e,t){return(e=xv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function xv(n){var e=Iv(n,"string");return typeof e=="symbol"?e:e+""}function Iv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Dt=L.module("FileExplorerPanel"),Mv=(n,e)=>{var t=eu(n),i=ui(n,e.localDashboardId),{session:r,config:o}=i??{},s=o==null?void 0:o.type;return{fileStorage:t,language:s,session:r}},Dv=Sn(Mv,null,null,{forwardRef:!0});function jv(n){var e=n;return e!=null&&typeof e.button=="number"}class rn extends I.Component{static handleError(e){Dt.error(e)}static isFocusEvent(e){return jv(e)?e.detail>=2:!0}constructor(e){super(e),this.handleFileSelect=this.handleFileSelect.bind(this),this.handleCopyFile=this.handleCopyFile.bind(this),this.handleCreateFile=this.handleCreateFile.bind(this),this.handleCreateDirectory=this.handleCreateDirectory.bind(this),this.handleCreateDirectoryCancel=this.handleCreateDirectoryCancel.bind(this),this.handleCreateDirectorySubmit=this.handleCreateDirectorySubmit.bind(this),this.handleDelete=this.handleDelete.bind(this),this.handleRename=this.handleRename.bind(this),this.handleSessionOpened=this.handleSessionOpened.bind(this),this.handleSessionClosed=this.handleSessionClosed.bind(this),this.handleShow=this.handleShow.bind(this),this.handleSelectionChange=this.handleSelectionChange.bind(this);var{session:t,language:i}=e;this.state={isShown:!1,language:i,session:t,showCreateFolder:!1,focusedFilePath:"/"}}componentDidMount(){this.isHidden()||this.setState({isShown:!0})}handleCreateFile(){var{glEventHub:e}=this.props,{session:t,language:i}=this.state,r={language:i,value:""};Dt.debug("handleCreateFile",t,i,r),e.emit(Ee.CREATE_NOTEBOOK,t,i,r)}handleCreateDirectory(){this.setState({showCreateFolder:!0})}handleCreateDirectoryCancel(){Dt.debug("handleCreateDirectoryCancel"),this.setState({showCreateFolder:!1})}handleCreateDirectorySubmit(e){Dt.debug("handleCreateDirectorySubmit",e),this.setState({showCreateFolder:!1});var{fileStorage:t}=this.props;t.createDirectory(e).catch(rn.handleError)}handleCopyFile(e){var t=this;return Ov(function*(){var{fileStorage:i}=t.props;if(Ye(e)){Dt.error("Invalid item in handleCopyItem",e);return}var r=yield A.getUniqueCopyFileName(i,e.filename);yield i.copyFile(e.filename,r)})()}handleDelete(e){var{glEventHub:t}=this.props;e.forEach(i=>{t.emit(Ee.CLOSE_FILE,{id:i.filename,itemName:i.filename})})}handleSelectionChange(e){var t="/";e.length===1&&(e[0].type==="directory"?t=A.makePath(e[0].filename):t=A.getPath(e[0].filename)),this.setState({focusedFilePath:t})}handleFileSelect(e,t){if(Dt.debug("fileSelect",e),e.type!=="directory"){var i=rn.isFocusEvent(t),r={id:e.filename,itemName:e.filename},{glEventHub:o}=this.props,{session:s,language:a}=this.state,l={value:null,language:a};o.emit(Ee.SELECT_NOTEBOOK,s,a,l,r,i)}}handleRename(e,t){var{glEventHub:i}=this.props;Dt.debug("handleRename",e,t),i.emit(Ee.RENAME_FILE,e,t)}handleSessionOpened(e,t){var{language:i}=t;this.setState({session:e,language:i})}handleSessionClosed(){this.setState({session:void 0,language:void 0})}handleShow(){this.setState({isShown:!0})}isHidden(){var{glContainer:e}=this.props,{isHidden:t}=e;return t}render(){var{fileStorage:e,glContainer:t,glEventHub:i}=this.props,{isShown:r,showCreateFolder:o,focusedFilePath:s}=this.state;return d.jsxs(Dn,{className:"file-explorer-panel",componentPanel:this,glContainer:t,glEventHub:i,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,onShow:this.handleShow,children:[d.jsx(Tv,{createFile:this.handleCreateFile,createFolder:this.handleCreateDirectory}),r&&d.jsx(Qi,{isMultiSelect:!0,storage:e,onCopy:this.handleCopyFile,onCreateFile:this.handleCreateFile,onCreateFolder:this.handleCreateDirectory,onDelete:this.handleDelete,onRename:this.handleRename,onSelect:this.handleFileSelect,onSelectionChange:this.handleSelectionChange}),d.jsx(Rt,{isOpen:o,type:"directory",title:"Create New Folder",storage:e,onSubmit:this.handleCreateDirectorySubmit,onCancel:this.handleCreateDirectoryCancel,defaultValue:s})]})}}va(rn,"COMPONENT","FileExplorerPanel");va(rn,"TITLE","File Explorer");var Bf=Dv(rn);function Cn(n,e,t){return(e=kv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function kv(n){var e=Nv(n,"string");return typeof e=="symbol"?e:e+""}function Nv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Lo=L.module("LogPanel");class ci extends c.PureComponent{constructor(e){super(e),Cn(this,"isBottomVisible",void 0),Cn(this,"logView",void 0),this.handleResize=this.handleResize.bind(this),this.handleShow=this.handleShow.bind(this),this.handleHide=this.handleHide.bind(this),this.handleSessionOpened=this.handleSessionOpened.bind(this),this.handleSessionClosed=this.handleSessionClosed.bind(this),this.isBottomVisible=!0,this.logView=null;var{session:t}=this.props;this.state={session:t}}handleResize(){this.updateDimensions()}handleShow(){this.updateDimensions(),this.logView&&(this.logView.triggerFindWidget(),this.isBottomVisible&&this.logView.scrollToBottom())}handleHide(){this.logView&&(this.isBottomVisible=this.logView.isBottomVisible())}handleSessionOpened(e){Lo.debug("Session opened",[e]),this.setState({session:e})}handleSessionClosed(e){Lo.debug("Session closed",e)}updateDimensions(){this.logView&&this.logView.updateDimensions()}render(){var{glContainer:e,glEventHub:t}=this.props,{session:i}=this.state;return d.jsxs(Dn,{componentPanel:this,glContainer:e,glEventHub:t,onResize:this.handleResize,onHide:this.handleHide,onShow:this.handleShow,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,children:[i==null&&d.jsx("div",{className:"log-panel-disconnected-message",children:"Waiting for session connection"}),i!=null&&d.jsx(de,{session:i,ref:r=>{this.logView=r}})]})}}Cn(ci,"defaultProps",{session:null});Cn(ci,"COMPONENT","LogPanel");Cn(ci,"TITLE","Log");var Av=(n,e)=>{var t;return{session:(t=ui(n,e.localDashboardId))===null||t===void 0?void 0:t.session}},Kf=Sn(Av,null,null,{forwardRef:!0})(ci);export{Zv as $,Ui as A,X as B,oi as C,gn as D,Fv as E,ds as F,Gt as G,ai as H,Le as I,os as J,w as K,si as L,O as M,hs as N,ri as O,Z as P,is as Q,qe as R,le as S,ne as T,Vv as U,Fd as V,Vd as W,ms as X,cs as Y,Gv as Z,qv as _,hp as a,Zi as a$,Dl as a0,dt as a1,ue as a2,Xe as a3,Re as a4,Fe as a5,pf as a6,Ki as a7,Tn as a8,ku as a9,Ss as aA,uh as aB,Ps as aC,_s as aD,en as aE,Es as aF,tn as aG,Zn as aH,js as aI,Jt as aJ,Hc as aK,de as aL,B as aM,eh as aN,Yt as aO,P as aP,Wt as aQ,Ef as aR,xf as aS,wi as aT,Pp as aU,Ep as aV,bf as aW,sp as aX,ip as aY,Qm as aZ,la as a_,Uu as aa,mf as ab,Hu as ac,Ru as ad,Au as ae,Nu as af,hf as ag,Lu as ah,cf as ai,Fu as aj,ys as ak,kr as al,Kv as am,Ei as an,Vu as ao,Cs as ap,vf as aq,Qu as ar,Ju as as,Ie as at,Et as au,ws as av,Se as aw,Xn as ax,ks as ay,li as az,Rd as b,Df as b$,ra as b0,gf as b1,np as b2,ta as b3,Sf as b4,ye as b5,_f as b6,sa as b7,na as b8,qm as b9,ef as bA,tf as bB,rf as bC,su as bD,au as bE,lu as bF,du as bG,Su as bH,Nl as bI,Bv as bJ,jt as bK,Hv as bL,Jo as bM,Dn as bN,Af as bO,sm as bP,it as bQ,df as bR,kf as bS,Jv as bT,Nf as bU,jf as bV,Lf as bW,_n as bX,Xv as bY,Mf as bZ,Yv as b_,ei as ba,lp as bb,aa as bc,vp as bd,yf as be,Cf as bf,wf as bg,Tf as bh,If as bi,gp as bj,gs as bk,A as bl,Xi as bm,Uf as bn,Gm as bo,Qs as bp,Of as bq,pu as br,$f as bs,Kf as bt,Hf as bu,Bf as bv,fl as bw,ou as bx,ru as by,nf as bz,uf as c,lf as c0,eu as c1,Qv as c2,ui as c3,Ee as c4,Me as c5,Rt as c6,Ye as c7,nu as c8,We as c9,nt as ca,Ff as cb,Rf as cc,zv as cd,De as ce,vn as cf,of as d,bs as e,af as f,Gd as g,Pf as h,Wv as i,Bl as j,En as k,ns as l,ts as m,Wl as n,Kl as o,rs as p,$v as q,ae as r,sf as s,Uv as t,zd as u,Pn as v,on as w,ie as x,yn as y,he as z};
|
|
19
|
-
//# sourceMappingURL=LogPanel-
|
|
19
|
+
//# sourceMappingURL=LogPanel-DHULO3aD.js.map
|