@deephaven/embed-widget 1.8.0 → 1.8.1-beta.1
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-CUwX_Af_.js → App-DUMdh1St.js} +2 -2
- package/build/assets/{App-CUwX_Af_.js.map → App-DUMdh1St.js.map} +1 -1
- package/build/assets/{Chart-BQ9hjhXM.js → Chart-D1T441dc.js} +2 -2
- package/build/assets/{Chart-BQ9hjhXM.js.map → Chart-D1T441dc.js.map} +1 -1
- package/build/assets/{IrisGrid-B8P4iafV.js → IrisGrid-Cwf5nE-n.js} +4 -4
- package/build/assets/IrisGrid-Cwf5nE-n.js.map +1 -0
- package/build/assets/{IrisGridThemeProvider-CVne5cMV.js → IrisGridThemeProvider-CembkxBu.js} +2 -2
- package/build/assets/{IrisGridThemeProvider-CVne5cMV.js.map → IrisGridThemeProvider-CembkxBu.js.map} +1 -1
- package/build/assets/{LocalWorkspaceStorage-DdUrgiLc.js → LocalWorkspaceStorage-D9-gGjWn.js} +2 -2
- package/build/assets/{LocalWorkspaceStorage-DdUrgiLc.js.map → LocalWorkspaceStorage-D9-gGjWn.js.map} +1 -1
- package/build/assets/{LogPanel-MRx_sH1z.js → LogPanel-CIejhMy6.js} +2 -2
- package/build/assets/{LogPanel-MRx_sH1z.js.map → LogPanel-CIejhMy6.js.map} +1 -1
- package/build/assets/{MarkdownEditor-xArXmDhr.js → MarkdownEditor-By7pxEcZ.js} +2 -2
- package/build/assets/{MarkdownEditor-xArXmDhr.js.map → MarkdownEditor-By7pxEcZ.js.map} +1 -1
- package/build/assets/{MarkdownNotebook-DIDXSaq2.js → MarkdownNotebook-BYQbBaXq.js} +2 -2
- package/build/assets/{MarkdownNotebook-DIDXSaq2.js.map → MarkdownNotebook-BYQbBaXq.js.map} +1 -1
- package/build/assets/{index-DzvJ8JJX.js → index-BLgjuIda.js} +3 -3
- package/build/assets/{index-DzvJ8JJX.js.map → index-BLgjuIda.js.map} +1 -1
- package/build/assets/{index-DSDX4cYW.js → index-C1nKOeGq.js} +3 -3
- package/build/assets/{index-DSDX4cYW.js.map → index-C1nKOeGq.js.map} +1 -1
- package/build/assets/{index-DGpiuwPo.js → index-dwBZ1_al.js} +11 -11
- package/build/assets/index-dwBZ1_al.js.map +1 -0
- package/build/index.html +1 -1
- package/package.json +17 -17
- package/build/assets/IrisGrid-B8P4iafV.js.map +0 -1
- package/build/assets/index-DGpiuwPo.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Plot-BXUhBfhF.js","./Plotly-CVE3B8V0.js","./plotly-C55CPtfp.js","./helpers-BosuxZz1.js","./vendor-BscqrOix.js","./vendor-CdNlUFKS.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{ao as Xa,a as R,aP as ss,T as Za,z as Ya,X as Qa,Y as Ja,V as el,a4 as tl,O as nl,a8 as rl,d as as,G as ls,e as ds,q as il,aQ as us,aR as ol,aS as sl,L as Sn,ac as al,_ as ll,aT as hs,t as cs,Z as dl,aU as ul,u as L,aO as hl,aK as ms,aL as cl,f as ps,n as ml,aM as Tr,aV as pl,aW as ui,aX as vl,aY as fl,aZ as gl,a_ as bl,v as yl,k as vs,aH as Cl,h as vr,aC as wl,a$ as Sl,b0 as hi,aF as _l,b1 as ci,b2 as fs,b3 as El,aw as Pl,b4 as Tl,b5 as Ol,b6 as xl,b7 as Il,b8 as Dl,b9 as Ml}from"./index-DSDX4cYW.js";import{r as c,ag as _n,bo as tr,J as O,bE as kl,bF as Or,D as u,H as jl,G as $,R as Vr,bq as Nl,I as le,C as ct,bG as Al,E as gs,af as Gt,bH as Ll,bI as Rl,bJ as Fl,bB as xr,_ as Hl,bK as T,bL as mi,bD as ae,N as bs,L as ys,bM as $l,bC as En,by as Qt,bd as Ee,bN as Ul,bg as pi,bO as Bl,bP as vi,bf as ze,bQ as Cs,bR as Kl,bz as We,bA as Rt,bS as fi,be as Wl,bx as zl,bT as fn}from"./vendor-BscqrOix.js";var Vl=Object.freeze([]),Kf=new Map,ws=()=>{};function Wf(n){return Array.isArray(n)?n:[n]}function zf(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return e.filter(r=>r!=null)}function Gl(n,e,t){return(e=ql(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ql(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class gi extends Error{constructor(){super(...arguments),Gl(this,"isCanceled",!0)}}function Zl(n,e,t){return(e=Yl(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Yl(n){var e=Ql(n,"string");return typeof e=="symbol"?e:e+""}function Ql(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Jl extends Error{constructor(){super(...arguments),Zl(this,"isClipboardPermissionsDeniedError",!0)}}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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class fr extends Error{constructor(){super(...arguments),ed(this,"isClipboardUnavailableError",!0)}}function rd(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=od(n,"string");return typeof e=="symbol"?e:e+""}function od(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ss extends Error{constructor(){super(...arguments),rd(this,"isPermissionUnsupported",!0)}}function bi(n,e,t,r,i,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function sd(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function s(l){bi(o,r,i,s,a,"next",l)}function a(l){bi(o,r,i,s,a,"throw",l)}s(void 0)})}}function yi(n){return Ir.apply(this,arguments)}function Ir(){return Ir=sd(function*(n){try{var e=n;return(yield navigator.permissions.query({name:e})).state}catch(t){throw t instanceof TypeError?new Ss:t}}),Ir.apply(this,arguments)}function Ci(n,e,t,r,i,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function _s(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function s(l){Ci(o,r,i,s,a,"next",l)}function a(l){Ci(o,r,i,s,a,"throw",l)}s(void 0)})}}function ad(n){return Dr.apply(this,arguments)}function Dr(){return Dr=_s(function*(n){var{clipboard:e}=navigator;if(e!==void 0)try{return yield navigator.clipboard.writeText(n)}catch{}ld(n)}),Dr.apply(this,arguments)}function ld(n){var e=document.activeElement,t=document.createElement("textarea");t.value=n,document.body.appendChild(t),t.focus(),t.select();var r=document.execCommand("copy");if(document.body.removeChild(t),e instanceof HTMLElement&&e.focus(),!r)throw new Error("Unable to execute copy command")}function Vf(){return Mr.apply(this,arguments)}function Mr(){return Mr=_s(function*(){try{var{clipboard:n}=navigator;if(n===void 0)throw new fr;var e=yield yi("clipboard-read");if(e==="granted"){var t=yield n.readText();return t}if(e==="prompt"){try{yield n.readText()}catch{}if(e=yield yi("clipboard-read"),e==="granted"){var r=yield n.readText();return r}}if(e==="prompt"||e==="denied")throw new Jl}catch(i){throw i instanceof Ss?new fr:i}throw new fr}),Mr.apply(this,arguments)}var an;function $t(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=ud(n,"string");return typeof e=="symbol"?e:e+""}function ud(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var hd="table_",Es="column_",cd=new Set(["in","not","i","ii","k"]),md=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"]),pd=/[^a-zA-Z0-9_$\-+@]/g,vd=/[^A-Za-z0-9_$]/g,fd=/^[a-zA-Z_$][a-zA-Z0-9_$\-+@]*$/,gd=/[^a-zA-Z0-9_]/g;function bd(n){return n.replace(/[ -]/g,"_")}function yd(n){return n.replace(/\s/g,"_")}class ot{}an=ot;$t(ot,"legalize",(n,e,t,r,i,o)=>{var s=e(n.trim());return i&&(cd.has(s)||md.has(s))&&(s=t+s),s=s.replace(r,""),s?(/^[0-9-]/.test(s)&&(s=t+s),s):t+o});$t(ot,"legalizeTableName",n=>an.legalize(n,yd,hd,pd,!1,0));$t(ot,"makeVariableName",n=>an.legalizeTableName(n).replace(gd,"_"));$t(ot,"legalizeColumnNames",n=>{var e=[];return n.forEach((t,r)=>{var i=an.legalizeColumnName(t,r);e.includes(i)&&(i=Es+r),e.push(i)}),e});$t(ot,"legalizeColumnName",function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return an.legalize(n,bd,Es,vd,!0,e)});$t(ot,"isValidTableName",n=>fd.test(n));$t(ot,"isValidColumnName",n=>an.legalizeColumnName(n)===n);class Ps extends CustomEvent{constructor(e,t){super(e,t)}}class He{static makeCancelable(e,t){var r=!1,i,o,s=new Promise((a,l)=>{o=l,Promise.resolve(e).then(d=>{r?t&&t(d):(i=d,a(d))}).catch(d=>l(d))});return s.cancel=()=>{r=!0,o(new gi),i!=null&&t&&t(i)},s}static isCanceled(e){return e instanceof gi}static isTimedOut(e){return e instanceof Xa}static withTimeout(e,t){return new Promise((r,i)=>{setTimeout(()=>{try{r(t())}catch(o){i(o)}},e)})}}function wi(n,e,t){return(e=Cd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Cd(n){var e=wd(n,"string");return typeof e=="symbol"?e:e+""}function wd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class nr{constructor(){wi(this,"pending",[]),wi(this,"resolved",[])}add(e,t){var r=He.makeCancelable(e,t);return this.pending.push(r),r.then(()=>{this.resolve(r)},()=>{this.resolve(r)}),r}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 Gf(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 Ze{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(!Ze.isValidRange(e))throw new Error("Invalid range! ".concat(e))}static isSelected(e,t){for(var r=0;r<e.length;r+=1){var i=e[r],o=i[0],s=i[1];if(o<=t&&t<=s)return!0}return!1}static selectRange(e,t){for(var[r,i]=t,o=[...e],s=o.length-1;s>=0;s-=1){var a=o[s],l=a[0],d=a[1];if(l<=r&&i<=d)return o;r<=d&&l<=i&&(r=Math.min(r,l),i=Math.max(i,d),o.splice(s,1))}return o.push([r,i]),o}static deselectRange(e,t){for(var[r,i]=t,o=[...e],s=o.length-1;s>=0;s-=1){var a=o[s],l=a[0],d=a[1];if(!(i<l||d<r))if(l<r&&i<d){o[s]=[l,r-1],o.splice(s+1,0,[i+1,d]);break}else r<=l&&d<=i?o.splice(s,1):l<r?o[s]=[l,r-1]:o[s]=[i+1,d]}return o}static count(e){return e.reduce((t,r)=>t+(r[1]-r[0]+1),0)}static getItemsInRanges(e,t){return t.reduce((r,i)=>{for(var o=[...r],s=i[0];s<=i[1];s+=1)o.push(e[s]);return o},[])}}function*qf(n,e){for(var t=n;t<=e;++t)yield t}var Xf=" ";class Sd{static join(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"and";if(e==null||e.length===0)return"";if(e.length===1)return e[0];if(e.length===2)return"".concat(e[0]," ").concat(t," ").concat(e[1]);var r=e.slice(0,e.length-1).join(", "),i=e[e.length-1];return"".concat(r,", ").concat(t," ").concat(i)}static toLower(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==null){if(t)return"";throw new Error("Null string passed in to TextUtils.toLower")}return e.toLowerCase()}static sort(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e<t?r?-1:1:e>t?r?1:-1:0}static pluralize(e,t,r){return e===1?t:r??"".concat(t,"s")}}function Ts(n,e,t){return(e=_d(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _d(n){var e=Ed(n,"string");return typeof e=="symbol"?e:e+""}function Ed(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ln{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),r=Math.floor(e%3600/60),i=e%60;return"".concat(t>0?"".concat(t,"h "):"")+"".concat(r>0||t>0?"".concat(r,"m "):"")+"".concat(e>=60?"".concat(i,"s").padStart(3,"0"):"".concat(i,"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"),r=e%(60*60),i=String(Math.floor(r/60)).padStart(2,"0"),o=r%60,s=String(Math.ceil(o)).padStart(2,"0");return"".concat(t,":").concat(i,":").concat(s)}static isTimeString(e){return new RegExp(ln.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])}}Ts(ln,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");Ts(ln,"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 Pd(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=Od(n,"string");return typeof e=="symbol"?e:e+""}function Od(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class gn extends Error{constructor(){super(...arguments),Pd(this,"isInvalid",!0)}}function Os(){var n=c.useRef(!1);return c.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function Si(n,e,t,r,i,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function xd(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function s(l){Si(o,r,i,s,a,"next",l)}function a(l){Si(o,r,i,s,a,"throw",l)}s(void 0)})}}var Id=R.module("useAsyncInterval");function Dd(n,e){var t=Os(),r=c.useRef(0),i=c.useRef(0),o=c.useRef(null),s=c.useCallback(xd(function*(){var a=Date.now();i.current+=1;var l=o.current==null?e:a-o.current;o.current=a;try{yield n()}catch(p){Id.error("A tick error occurred:",p)}if(t.current){l+=Date.now()-o.current;var d=Math.max(0,l-e),h=Math.max(0,e-d);r.current=window.setTimeout(s,h)}}),[n,t,e]);c.useEffect(()=>(o.current=null,s(),()=>{window.clearTimeout(r.current)}),[e,s])}function Pn(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 Md(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{leading:r=!1,trailing:i=!0,maxWait:o}=t,s=c.useMemo(()=>_n(n,e,o!=null?{leading:r,trailing:i,maxWait:o}:{leading:r,trailing:i}),[n,e,r,i,o]);return c.useEffect(()=>()=>s.cancel(),[s]),s}function kd(n){var e=c.useRef();return c.useEffect(function(){e.current=n}),e.current}function jd(n,e,t){var r=c.useRef(t),i=c.useRef(n);i.current=n;var o=c.useMemo(()=>tr(function(){return i.current(...arguments)},e,r.current),[e]);return c.useEffect(()=>()=>{var s,a;(s=(a=r.current)===null||a===void 0?void 0:a.flushOnUnmount)!==null&&s!==void 0&&s?o.flush():o.cancel()},[o]),o}function xs(n){var e=c.useRef(null);return c.useEffect(function(){n&&(typeof n=="function"?n(e.current):n.current=e.current)}),e}function _i(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Nd(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_i(Object(t),!0).forEach(function(r){qt(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):_i(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function qt(n,e,t){return(e=Ad(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ad(n){var e=Ld(n,"string");return typeof e=="symbol"?e:e+""}function Ld(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ei="popper";class rr extends c.Component{constructor(e){super(e),qt(this,"element",void 0),qt(this,"container",void 0),qt(this,"nodeRef",O.createRef()),qt(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=O.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:r}=this.props;if(!e&&this.container.current!==null){var{options:i}=this.props;i=Nd({placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}}},i),document.body.appendChild(this.element);var o=this.getVisibleElement(this.container.current);o==null&&(o=this.container.current);var s=new kl(r||o,this.element,i);s.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(t){var a=this.element.querySelector(".".concat(Ei));a instanceof HTMLElement&&!a.contains(document.activeElement)&&a.focus()}}),Or.flushSync(()=>{this.setState({popper:s})})}}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(),Or.flushSync(()=>{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:r,interactive:i,closeOnBlur:o}=this.props,{show:s}=this.state;return u.jsx(ss,{isPortal:!0,children:u.jsx(jl,{in:s,timeout:r,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,nodeRef:this.nodeRef,children:u.jsx("div",{ref:this.nodeRef,onClick:a=>{a.stopPropagation()},onKeyDown:a=>{a.key==="Escape"&&this.hide()},className:$(Ei,{interactive:i},e),onBlur:o?this.handleBlur:void 0,tabIndex:o?-1:void 0,role:"presentation",children:u.jsxs("div",{className:"popper-content",children:[t,u.jsx("div",{className:"popper-arrow","x-arrow":""})]})})})})}render(){var{popper:e}=this.state,{"data-testid":t}=this.props;return u.jsx("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":t,children:e&&Vr.createPortal(this.renderContent(),this.element)})}}qt(rr,"defaultProps",{options:{},className:"",timeout:Za.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0});var kr;function Pi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Rd(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Pi(Object(t),!0).forEach(function(r){Ye(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Pi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ye(n,e,t){return(e=Fd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Fd(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var $d=R.module("Tooltip");class ie extends c.Component{static handleHidden(){ie.shownTooltipCount-=1,ie.shownTooltipCount===0&&(ie.lastHiddenTime=Date.now())}static handleShown(){ie.shownTooltipCount+=1}constructor(e){super(e),Ye(this,"container",void 0),Ye(this,"popper",void 0),Ye(this,"parent",void 0),Ye(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=O.createRef(),this.popper=O.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:r}=t,{isShown:i}=this.state;i!==r&&(i?ie.handleShown():ie.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();var{isShown:e}=this.state;e&&ie.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){$d.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,r=e.clientY,{isShown:i}=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&&r>=o.top&&r<=o.top+o.height?this.handleMouseMove():t>=s.left&&t<=s.left+s.width&&r>=s.top&&r<=s.top+s.height?this.handleMouseMove():i&&(this.stopTimer(),this.hide())}}startTimer(){this.stopTimer();var{timeout:e,reshowTimeout:t}=this.props,r=e;(ie.shownTooltipCount>0||Date.now()-ie.lastHiddenTime<ie.triggerReshowThreshold)&&(r=t),this.timer=window.setTimeout(this.handleTimeout,r)}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(),Or.flushSync(()=>{this.setState({isShown:!0})});var{interactive:r}=this.props;r&&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:r,popperClassName:i,"data-testid":o,onEntered:s}=this.props,{isShown:a}=this.state,{options:l}=this.props;return l=Rd({placement:"bottom"},l),u.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":o,children:u.jsx(rr,{className:$(i,"popper-tooltip"),options:l,ref:this.popper,onEntered:s,onExited:this.handleExited,interactive:e,referenceObject:r,children:u.jsxs("div",{className:"tooltip-content",children:[" ",a&&t]})})})}}kr=ie;Ye(ie,"defaultTimeout",500);Ye(ie,"defaultReshowTimeout",100);Ye(ie,"triggerReshowThreshold",300);Ye(ie,"shownTooltipCount",0);Ye(ie,"lastHiddenTime",Date.now());Ye(ie,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:kr.defaultReshowTimeout,timeout:kr.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});var Ud=R.module("ThemeProvider"),Gr=c.createContext(null);Gr.displayName="ThemeContext";function Zf(n){var{themes:e,waitForActivation:t=!1,defaultPreloadValues:r=Ya,children:i}=n,o=c.useMemo(()=>Qa(),[]),[s,a]=c.useState(null),[l,d]=c.useState(Ja),h=c.useMemo(()=>e==null?null:el(l,{base:o,custom:e??[]}),[o,l,e]),p=c.useMemo(()=>[...o,...e??[]],[o,e]);return c.useEffect(function(){if(!(h==null||e==null)){tl(r);var v=nl(r);Ud.debug2("updateThemePreloadData:",{active:h.map(f=>f.themeKey),custom:e.map(f=>f.themeKey),preloadStyleContent:v,selectedThemeKey:l}),rl({themeKey:l,preloadStyleContent:v})}},[h,l,e,r]),c.useEffect(()=>{a({activeThemes:h,selectedThemeKey:l,themes:p,setSelectedThemeKey:d})},[h,l,p]),t&&h==null?null:u.jsxs(u.Fragment,{children:[h==null?null:u.jsx(u.Fragment,{children:h.map(m=>u.jsx("style",{"data-theme-key":m.themeKey,children:m.styleContent},m.themeKey))}),s==null?null:u.jsx(Gr.Provider,{value:s,children:u.jsx(ss,{children:i})})]})}function Is(){return Pn(Gr,"No ThemeContext value found. Component must be wrapped in a ThemeContext.Provider")}function Bd(n){var{children:e,className:t,style:r,"data-testid":i}=n;return u.jsx("div",{className:$("btn-group",t),style:r,role:"group","data-testid":i,children:e})}var Kd=["kind","variant","type","tooltip","icon","disabled","active","onClick","onContextMenu","onMouseDown","onMouseUp","onMouseEnter","onMouseLeave","onKeyDown","className","style","children","tabIndex","data-testid","aria-label"];function Ti(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Oi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ti(Object(t),!0).forEach(function(r){Wd(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ti(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Wd(n,e,t){return(e=zd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function zd(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Gd(n,e){if(n==null)return{};var t,r,i=qd(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function qd(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function Xd(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 Zd(n){switch(n){case"group-end":return $("pl-2","pr-3")}}var te=O.forwardRef((n,e)=>{var{kind:t,variant:r,type:i="button",tooltip:o,icon:s,disabled:a=!1,active:l,onClick:d,onContextMenu:h,onMouseDown:p,onMouseUp:m,onMouseEnter:v,onMouseLeave:f,onKeyDown:g,className:b,style:S,children:w,tabIndex:y,"data-testid":D,"aria-label":V}=n,X=Gd(n,Kd),{UNSAFE_className:G}=Nl({},"button"),A;r&&(A=Zd(r));var M;s&&(M=O.isValidElement(s)?s:u.jsx(le,{icon:s}));var Q=M!=null&&w==null,W=Xd(t,Q),k;o!==void 0&&(k=typeof o=="string"?u.jsx(ie,{children:o}):o);var z=V;V===void 0&&Q&&o!=null&&typeof o=="string"&&(z=o);var F=u.jsxs("button",Oi(Oi({"data-testid":D,ref:e,type:i,className:$("btn",W,A,{active:l},b,G),onClick:d,onContextMenu:h,onMouseUp:m,onMouseDown:p,onMouseEnter:v,onMouseLeave:f,onKeyDown:g,style:S,disabled:a,tabIndex:y,"aria-label":z},X),{},{children:[s&&M,w,o!=null&&!a&&k]}));return a&&o!=null?u.jsxs("span",{className:"btn-disabled-wrapper",children:[F,k]}):F});te.displayName="Button";function Ds(n){var{className:e,children:t,"data-testid":r}=n;return u.jsx("div",{className:$("modal-footer",e),"data-testid":r,children:t})}function jr(n){var{isOpen:e,headerText:t,bodyText:r,onCancel:i,onConfirm:o,onDiscard:s,onModalDisable:a,cancelButtonText:l="Cancel",confirmButtonText:d="Okay",discardButtonText:h="Discard",isConfirmDanger:p=!1,children:m,"data-testid":v}=n,f=c.useRef(null),g=c.useRef(null),b=c.useCallback(()=>{g.current!==null&&g.current.checked&&a&&a(),o()},[o,a]),S=c.useCallback(()=>{var y;(y=f.current)===null||y===void 0||y.focus()},[]),w="";return e&&(w=typeof r=="function"?r():r),u.jsxs(as,{isOpen:e,onOpened:S,children:[u.jsx(ls,{closeButton:!1,children:t}),u.jsx(ds,{children:w}),u.jsxs(Ds,{children:[a&&u.jsxs("div",{className:"custom-control custom-checkbox form-group mr-auto",children:[u.jsx("input",{type:"checkbox",className:"custom-control-input",id:"move-confirmation-checkbox",defaultChecked:!1,ref:g,"data-testid":v!==void 0?"".concat(v,"-checkbox-confirm"):void 0}),u.jsx("label",{className:"custom-control-label",htmlFor:"move-confirmation-checkbox",children:"Don't ask me again"})]}),s&&u.jsx(te,{kind:"secondary",className:"mr-auto","data-dismiss":"modal",onClick:s,"data-testid":v!==void 0?"".concat(v,"-btn-discard"):void 0,children:h}),i&&u.jsx(te,{kind:"secondary","data-dismiss":"modal",onClick:i,"data-testid":v!==void 0?"".concat(v,"-btn-cancel"):void 0,children:l}),u.jsxs(Bd,{children:[u.jsx(te,{kind:p?"danger":"primary",onClick:b,ref:f,"data-testid":v!==void 0?"".concat(v,"-btn-confirm"):void 0,children:d}),m]})]})]})}function Yd(n,e,t){return(e=Qd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Qd(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function gr(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 r,i;return((r=e.group)!==null&&r!==void 0?r:0)>((i=t.group)!==null&&i!==void 0?i: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,r=[],i=e;Array.isArray(i)||(i=[i]);for(var o=0;o<i.length;o+=1){var s=i[o],a=void 0;typeof s=="function"?a=s():a=s,a!=null&&(a instanceof Promise?t&&r.push(a):Array.isArray(a)?r=r.concat(a):r.push(a))}return r=r.filter(l=>l.title!==void 0||l.then!=null||l.menuElement),r}static getNextMenuItem(e,t,r){var i=e;i<0&&t<0&&(i=r.length);for(var o=1;o<r.length+1;o+=1){var s=(i+t*o+r.length)%r.length,a=r[s];if(!(a instanceof Promise)&&a.disabled!==!0)return s}return e}}Yd(he,"actionsDisabled",!1);var xi=R.module("GlobalContextAction");class eu 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:r}=this.props;r.title==null&&!r.menuElement||(t.contextActions==null&&(t.contextActions=[]),t.contextActions.push(r),xi.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 r;xi.debug("Global hotkey matched!",e),(r=t.action)===null||r===void 0||r.call(t,e),e.preventDefault(),e.stopPropagation()}}render(){return null}}class tu extends c.Component{render(){for(var{actions:e,"data-testid":t}=this.props,r=[],i=0;i<e.length;i+=1){var o=e[i],{shortcut:s}=o;if(o.title!=null||o.menuElement||s){var a=u.jsx(eu,{action:o,"data-testid":t},"".concat(o.title,".").concat(s==null?void 0:s.id));r.push(a)}}return r}}function Ms(n,e,t){return(e=nu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nu(n){var e=ru(n,"string");return typeof e=="symbol"?e:e+""}function ru(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var kn=R.module("ContextActions");class re extends c.Component{static triggerMenu(e,t,r,i){if(i.length!==0){var o=new MouseEvent("contextmenu",{clientX:t,clientY:r,bubbles:!0,cancelable:!0});o.contextActions=i,e.dispatchEvent(o)}}constructor(e){super(e),Ms(this,"container",void 0),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=O.createRef(),this.state={globalActions:[],keyboardActions:[]}}static getDerivedStateFromProps(e){if(e.actions==null||!Array.isArray(e.actions))return{globalActions:[],keyboardActions:[]};var t=e.actions.filter(i=>!gr(i)&&typeof i!="function"&&i.isGlobal),r=e.actions.filter(i=>!gr(i)&&typeof i!="function"&&(i.isGlobal===void 0||!i.isGlobal)&&i.shortcut!=null);return{globalActions:t,keyboardActions:r}}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 r=e.target,i=function(){var{classList:d}=r,h=t.find(p=>d.contains(p));if(h!==void 0)return kn.debug2('Contextmenu event ignored based on the target className "'.concat(h,'"')),{v:void 0};r=r.parentElement},o;r!=null;)if(o=i(),o)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=>gr(l)||typeof l=="function"||l.isGlobal===void 0||!l.isGlobal)),e.contextActions=e.contextActions.concat(a)}kn.debug("Received context menu event! Menu items are now: ",e.contextActions)}}handleKeyDown(e){for(var{keyboardActions:t}=this.state,r=0;r<t.length;r+=1){var i=t[r];if(!he.actionsDisabled&&i.shortcut!=null&&i.shortcut.matchesEvent(e)){var o;kn.debug("Context hotkey matched!",e),(o=i.action)===null||o===void 0||o.call(i,e),e.stopPropagation(),e.preventDefault(),kn.debug2("Matched hotkey returned false, key event not consumed")}}}render(){var{"data-testid":e}=this.props,{globalActions:t}=this.state;return u.jsx("div",{className:"context-actions-listener",ref:this.container,"data-testid":e,children:u.jsx(tu,{actions:t})})}}Ms(re,"groups",{default:void 0,high:100,medium:5e3,low:1e4,global:1e5,edit:100});var ks=O.forwardRef((n,e)=>{var t,r,{closeMenu:i,children:o,menuItem:s,onMenuItemClick:a,onMenuItemMouseMove:l,onMenuItemContextMenu:d,isKeyboardSelected:h=!1,isMouseSelected:p=!1,"data-testid":m}=n,v=c.useCallback(W=>{a(s,W)},[s,a]),f=c.useCallback(W=>{l(s,W)},[s,l]),g=c.useCallback(W=>{d(s,W)},[s,d]);function b(W,k,z){if(typeof W.type=="string")return W;var F={menuItem:s,closeMenu:i,isKeyboardSelected:h,isMouseSelected:p,iconElement:k,displayShortcut:z,"data-testid":m};return O.cloneElement(W,{forwardedProps:F})}var S=(t=s.shortcutText)!==null&&t!==void 0?t:(r=s.shortcut)===null||r===void 0?void 0:r.getDisplayText(),w=null;if(s.icon){var y=s.icon;if(O.isValidElement(y))w=y;else{var D;s.iconColor!=null&&(s.disabled===void 0||!s.disabled)&&(D={color:s.iconColor}),w=u.jsx(le,{icon:y,style:D})}}var V=null,X=!!o;s.actions&&(V=u.jsx(le,{icon:il}));var G=null;if(s.menuElement)G=u.jsx("div",{className:"custom-menu-item",onMouseMove:f,children:b(s.menuElement,w,S)});else{var A,M=s.disabled,Q=s.iconOutline;G=u.jsx("button",{type:"button",className:$("btn-context-menu",{disabled:M},{active:(X||p)&&(M===void 0||!M)},{"keyboard-active":h&&(M===void 0||!M)}),onClick:v,onMouseMove:f,onContextMenu:g,title:(A=s.description)!==null&&A!==void 0?A:"",children:u.jsxs("div",{className:"btn-context-menu-wrapper",children:[u.jsx("span",{className:$("icon",{outline:Q}),children:w}),u.jsx("span",{className:"title",children:s.title}),S!==void 0&&u.jsx("span",{className:"shortcut",children:S}),V&&u.jsx("span",{className:$("submenu-indicator",{disabled:M}),children:V})]})})}return u.jsxs("div",{className:"context-menu-item",ref:e,"data-testid":m,children:[o,G]})});ks.displayName="ContextMenuItem";var js=O.forwardRef((n,e)=>{var{checked:t=!1,children:r,className:i,disabled:o=!1,inputClassName:s,isInvalid:a=!1,labelClassName:l,name:d,onChange:h,"data-testid":p}=n,[m]=c.useState(ct()),v=xs(e);c.useEffect(function(){v.current&&(v.current.indeterminate=t===null)},[v,t]);var f=c.useCallback(g=>{v.current&&(v.current.indeterminate=t===null),h&&h(g)},[v,t,h]);return u.jsxs("div",{className:$("custom-control custom-checkbox",i),children:[u.jsx("input",{type:"checkbox",ref:v,checked:t??!1,className:$("custom-control-input",s,{"is-invalid":a}),disabled:o,id:m,name:d,onChange:f,"data-testid":p}),u.jsx("label",{className:$("custom-control-label",l),htmlFor:m,children:r})]})});js.displayName="Checkbox";function Gn(n){return(n==null?void 0:n.WrappedComponent)!==void 0}function Ns(n){return Gn(n)&&Ns(n.WrappedComponent)?!0:n.prototype!=null&&n.prototype.isReactComponent!=null}function iu(n){return!Gn(n)&&"$$typeof"in n&&n.$$typeof===Al.ForwardRef}function As(n){return Ns(n)||iu(n)}function Ii(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ou(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ii(Object(t),!0).forEach(function(r){bn(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ii(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function bn(n,e,t){return(e=su(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function su(n){var e=au(n,"string");return typeof e=="symbol"?e:e+""}function au(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ls extends c.PureComponent{constructor(e){var t;super(e),bn(this,"container",void 0),bn(this,"oldFocus",void 0),bn(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=O.createRef(),this.oldFocus=document.activeElement,this.rAF=0;var{options:r}=e,i=(t=r.initialKeyboardIndex)!==null&&t!==void 0?t:-1;this.state={menuItems:[],keyboardIndex:i,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(r=>({menuItems:he.sortActions(r.menuItems.concat(t))}))}handleKeyDown(e){var{menuItems:t}=this.state,r=this.getKeyboardIndex(),i=r;if(e.key==="Enter"||e.key===" "){r!=null&&r>=0&&r<t.length&&this.handleMenuItemClick(t[r],e);return}e.key==="Escape"?i=null:e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey===!0?i=he.getNextMenuItem(i??0,-1,t):(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1)&&(i=he.getNextMenuItem(i??0,1,t)),r!==i&&(i!==null?this.setKeyboardIndex(i):(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:r}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),r(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,r=t.indexOf(e);this.setMouseIndex(r)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{"data-testid":t}=this.props,{keyboardIndex:r,menuItems:i,mouseIndex:o}=this.state,s=0;s<i.length;s+=1){var a=i[s];s>0&&a.group!==i[s-1].group&&e.push(u.jsx("hr",{},"".concat(s,".separator")));var l=u.jsx(ks,{isKeyboardSelected:r===s,isMouseSelected:o===s,menuItem:a,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},s);e.push(l)}var{menuStyle:d}=this.props;return u.jsx("div",{className:"context-menu-container",style:ou({},d),ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":t,children:e})}}bn(Ls,"defaultProps",{closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});function Di(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Mi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Di(Object(t),!0).forEach(function(r){Xt(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Di(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Xt(n,e,t){return(e=lu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lu(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ir extends c.PureComponent{constructor(e){super(e),Xt(this,"container",void 0),Xt(this,"parent",void 0),Xt(this,"popper",void 0),Xt(this,"isOpen",void 0),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=O.createRef(),this.parent=null,this.popper=O.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:r,"data-testid":i}=this.props,{menuStyle:o}=this.props,{options:s,popperOptions:a}=this.props;return a=Mi({placement:"bottom"},a),s=Mi({separateKeyboardMouse:!0},s),u.jsx("div",{className:"menu-actions-listener",ref:this.container,"data-testid":i,children:u.jsx(rr,{ref:this.popper,options:a,className:$("menu-popper",r),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:u.jsx(Ls,{actions:e,closeMenu:this.handleCloseMenu,onMenuOpened:t,options:s,menuStyle:o})})})}}Xt(ir,"defaultProps",{isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0});function wt(n,e,t){return(e=uu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uu(n){var e=hu(n,"string");return typeof e=="symbol"?e:e+""}function hu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ki=R.module("Shortcut"),_=function(n){return n.CTRL="MODIFIER_CTRL",n.CMD="MODIFIER_CMD",n.ALT="MODIFIER_ALT",n.OPTION="MODIFIER_OPTION",n.SHIFT="MODIFIER_SHIFT",n}({}),C=function(n){return 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",n}({}),cu=new Set([C.ENTER,C.DELETE,C.F1,C.F2,C.F3,C.F4,C.F5,C.F6,C.F7,C.F8,C.F9,C.F10,C.F11,C.F12]);class de extends gs{static isAllowedKey(e){return Object.values(C).includes(e)}static isValidKeyState(e){var{keyValue:t}=e;if(t===null)return!0;if(!de.isMacPlatform&&e.metaKey||!de.isAllowedKey(t))return!1;var r=!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey;return!r||cu.has(t)}static createKeyState(e){var t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(r=>{switch(r){case _.CTRL:t.ctrlKey=!0;break;case _.ALT:case _.OPTION:t.altKey=!0;break;case _.CMD:t.metaKey=!0;break;case _.SHIFT:t.shiftKey=!0;break}}),t}static getKeyStateFromEvent(e){var{key:t,keyCode:r}=e,i="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?i="":!de.isAllowedKey(t)&&de.isAllowedKey(String.fromCharCode(r))?i=String.fromCharCode(r):i=t,{keyValue:i,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===C.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 C.ENTER:t+="⏎";break;case C.ESCAPE:t+="⎋";break;case C.BACKSPACE:t+="⌫";break;case C.DELETE:t+="⌦";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){var r,i;return((r=e.keyValue)===null||r===void 0?void 0:r.toUpperCase())===((i=t.keyValue)===null||i===void 0?void 0:i.toUpperCase())&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey&&e.shiftKey===t.shiftKey}static getDisplayText(e){return e.keyValue===null?"":de.isMacPlatform?de.getMacDisplayText(e):de.getWindowsDisplayText(e)}constructor(e){var{id:t,shortcut:r,macShortcut:i,isEditable:o=!0,name:s,tooltip:a}=e;super(),wt(this,"id",void 0),wt(this,"name",void 0),wt(this,"tooltip",void 0),wt(this,"isEditable",void 0),wt(this,"defaultKeyState",void 0),wt(this,"keyState",void 0),this.id=t,this.name=s,this.tooltip=a,this.isEditable=o;var l=de.isMacPlatform,d=l?i:r;this.defaultKeyState=de.createKeyState(d),this.keyState=this.defaultKeyState}getDisplayText(){return de.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){de.isValidKeyState(e)?(ki.debug2("Shortcut ".concat(this.id," updated to ").concat(JSON.stringify(e))),this.keyState=e,this.dispatchEvent(new Ps("onUpdate",{detail:this}))):ki.debug2("Shortcut ".concat(this.id," tried to update to invalid keyState ").concat(JSON.stringify(e)))}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return de.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState(de.NULL_KEY_STATE)}isNull(){return de.doKeyStatesMatch(this.keyState,de.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return de.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState(de.getKeyStateFromEvent(e))}}wt(de,"NULL_KEY_STATE",{metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null});wt(de,"isMacPlatform",he.isMacPlatform());function ji(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=pu(n,"string");return typeof e=="symbol"?e:e+""}function pu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ni=R.module("ShortcutRegistry");class vu extends gs{constructor(){super(...arguments),ji(this,"shortcutMap",new Map),ji(this,"shortcutsByCategory",new Map)}createAndAdd(e){var t=new de(e);return this.add(t)}add(e){var t=this.shortcutMap.get(e.id);if(t)return Ni.warn("Skipping attempt to add duplicate shortcut ID to registry: ".concat(e.id)),t;Ni.debug2("Adding shortcut to registry: ".concat(e.id)),e.addEventListener("onUpdate",o=>{var{detail:s}=o;return this.dispatchEvent(new Ps("onUpdate",{detail:s}))});var r=e.id.split(".")[0];if(this.shortcutMap.set(e.id,e),this.shortcutsByCategory.has(r)){var i;(i=this.shortcutsByCategory.get(r))===null||i===void 0||i.push(e)}else this.shortcutsByCategory.set(r,[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 ee=Object.freeze(new vu),Zt={COPY:ee.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[_.CTRL,C.C],macShortcut:[_.CMD,C.C],isEditable:!1}),PASTE:ee.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[_.CTRL,C.V],macShortcut:[_.CMD,C.V],isEditable:!1}),SAVE:ee.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[_.CTRL,C.S],macShortcut:[_.CMD,C.S],isEditable:!1}),SELECT_ALL:ee.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[_.CTRL,C.A],macShortcut:[_.CMD,C.A],isEditable:!1}),REOPEN_CLOSED_PANEL:ee.createAndAdd({id:"GLOBAL.REOPEN_CLOSED_PANEL",name:"Re-open Closed Panel",shortcut:[_.ALT,_.SHIFT,C.T],macShortcut:[_.OPTION,_.SHIFT,C.T],isEditable:!0}),LINKER:ee.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[_.CTRL,C.L],macShortcut:[_.CMD,C.L]}),LINKER_CLOSE:ee.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[C.ESCAPE],macShortcut:[C.ESCAPE],isEditable:!1}),COPY_VERSION_INFO:ee.createAndAdd({id:"GLOBAL.COPY_VERSION_INFO",name:"Copy Version Info",shortcut:[_.CTRL,_.ALT,C.I],macShortcut:[_.CMD,_.SHIFT,C.I],isEditable:!0}),EXPORT_LOGS:ee.createAndAdd({id:"GLOBAL.EXPORT_LOGS",name:"Export Logs",shortcut:[_.CTRL,_.ALT,_.SHIFT,C.L],macShortcut:[_.CMD,_.OPTION,_.SHIFT,C.L],isEditable:!0}),OPEN_DASHBOARD_LIST:ee.createAndAdd({id:"GLOBAL.OPEN_DASHBOARD_LIST",name:"Open Dashboard List",shortcut:[_.CTRL,_.SHIFT,C.D],macShortcut:[_.CMD,_.SHIFT,C.D],isEditable:!0}),NEXT:ee.createAndAdd({id:"GLOBAL.NEXT",name:"Next",shortcut:[C.ENTER],macShortcut:[C.ENTER],isEditable:!1}),PREVIOUS:ee.createAndAdd({id:"GLOBAL.PREVIOUS",name:"Previous",shortcut:[_.SHIFT,C.ENTER],macShortcut:[_.SHIFT,C.ENTER],isEditable:!1}),UNDO:ee.createAndAdd({id:"GLOBAL.UNDO",name:"Undo",shortcut:[_.CTRL,C.Z],macShortcut:[_.CMD,C.Z],isEditable:!1}),REDO:ee.createAndAdd({id:"GLOBAL.REDO",name:"Redo",shortcut:[_.CTRL,_.SHIFT,C.Z],macShortcut:[_.CMD,_.SHIFT,C.Z],isEditable:!1})};function Nr(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class or extends c.PureComponent{constructor(e){super(e),Nr(this,"inputField",void 0),Nr(this,"searchChangeSelection",void 0),this.inputField=O.createRef(),this.searchChangeSelection=O.createRef()}componentDidMount(){this.setInputPaddingRight()}componentDidUpdate(){this.setInputPaddingRight()}focus(){var e;(e=this.inputField.current)===null||e===void 0||e.focus()}select(){var e;(e=this.inputField.current)===null||e===void 0||e.select()}setInputPaddingRight(){var e=this.inputField.current,t=this.searchChangeSelection.current;if(e&&t){var r=t.getBoundingClientRect().width;e.style.paddingRight="".concat(r,"px")}}render(){var{value:e,placeholder:t,endPlaceholder:r,onBlur:i,onChange:o,className:s,disabled:a,matchCount:l,id:d,onKeyDown:h,"data-testid":p,cursor:m}=this.props,v,f=[{action:()=>m==null?void 0:m.next("forward"),shortcut:Zt.NEXT},{action:()=>m==null?void 0:m.next("back"),shortcut:Zt.PREVIOUS}];return m&&l>1?v=u.jsxs(u.Fragment,{children:[u.jsx(te,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{m.next("back")},icon:us,tooltip:"Previous match (".concat(Zt.PREVIOUS.getDisplayText(),")")}),u.jsxs("span",{className:"search-change-text",children:[m.index!==void 0&&"".concat(m.index+1," of "),l]}),u.jsx(te,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{m.next("forward")},icon:ol,tooltip:"Next match (".concat(Zt.NEXT.getDisplayText(),")")})]}):v=l>0&&u.jsx("span",{className:"search-match",children:l}),u.jsxs("div",{className:$("search-group",s),children:[u.jsx("input",{type:"search",value:e,onBlur:i,onChange:o,onKeyDown:h,className:"form-control",disabled:a,placeholder:t,ref:this.inputField,id:d,"data-testid":p}),l!=null?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"search-change-selection",ref:this.searchChangeSelection,children:v}),u.jsx(re,{actions:f})]}):u.jsxs("span",{className:"search-end-content",children:[(r??"")!==""&&e===""&&u.jsx("span",{className:"search-end-placeholder",children:r}),u.jsx(le,{icon:sl})]})]})}}Nr(or,"defaultProps",{placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0,cursor:void 0});function Rs(n,e,t){return(e=bu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function bu(n){var e=yu(n,"string");return typeof e=="symbol"?e:e+""}function yu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Fs extends c.PureComponent{constructor(e){super(e),Rs(this,"searchInput",void 0),this.searchInput=O.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=_n(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:r,id:i,"data-testid":o}=this.props,{value:s}=this.state;return u.jsx(or,{value:s,placeholder:e,onChange:this.handleChange,className:t,matchCount:r,ref:this.searchInput,id:i,"data-testid":o})}}Rs(Fs,"defaultProps",{placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0});function Hs(n,e,t){return(e=Cu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Cu(n){var e=wu(n,"string");return typeof e=="symbol"?e:e+""}function wu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Su=R.module("ItemListItem");class sr extends c.Component{static handleKeyDown(){return Su.log("ItemListItem.handleKeyDown false"),!1}constructor(e){super(e),Hs(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=O.createRef()}handleBlur(e){var{itemIndex:t,onBlur:r}=this.props;r(t,e)}handleFocus(e){var{itemIndex:t,onFocus:r}=this.props;r(t,e)}handleClick(e){var{itemIndex:t,onClick:r}=this.props;r(t,e)}handleContextMenu(e){var{itemIndex:t,onContextMenu:r}=this.props;r(t,e)}handleDragStart(e){var{itemIndex:t,onDragStart:r}=this.props;r(t,e)}handleDrag(e){var{itemIndex:t,onDrag:r}=this.props;r(t,e)}handleDragOver(e){e.preventDefault();var{itemIndex:t,onDragOver:r}=this.props;r(t,e)}handleDragEnd(e){var{itemIndex:t,onDragEnd:r}=this.props;r(t,e)}handleDrop(e){var{itemIndex:t,onDrop:r}=this.props;r(t,e)}handleDoubleClick(e){var{itemIndex:t,onDoubleClick:r}=this.props;r(t,e)}handleMouseMove(e){var{itemIndex:t,onMouseMove:r}=this.props;r(t,e)}handleMouseDown(e){var{itemIndex:t,onMouseDown:r}=this.props;r(t,e)}handleMouseUp(e){var{itemIndex:t,onMouseUp:r}=this.props;r(t,e)}render(){var{isDraggable:e,isFocused:t,isSelected:r,style:i,children:o,"data-testid":s}=this.props;return u.jsx("div",{className:$("item-list-item",{active:r},{"is-focused":t},{"is-draggable":e}),onKeyDown:sr.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:i,onFocus:this.handleFocus,onBlur:this.handleBlur,draggable:e,"data-testid":s,children:o})}}Hs(sr,"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:{}});var Wn;function Ai(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Li(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ai(Object(t),!0).forEach(function(r){Ve(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ai(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ve(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ri=R.module("ItemList"),Fi=5;class Je extends c.PureComponent{static renderItem(e){var t,r,{item:i}=e;return u.jsx("div",{className:"item-list-item-content",children:i!=null&&((t=(r=i.displayValue)!==null&&r!==void 0?r:i.value)!==null&&t!==void 0?t:"".concat(i))})}constructor(e){super(e),Ve(this,"list",void 0),Ve(this,"listContainer",void 0),Ve(this,"getItemSelected",Gt((i,o)=>Ze.isSelected(o,i),{max:Je.CACHE_SIZE})),Ve(this,"getCachedItem",Gt((i,o,s,a,l,d,h,p)=>{var m=d({item:s,itemIndex:i,isFocused:a,isSelected:l,style:h});return u.jsx(sr,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:p,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:a,isSelected:l,itemIndex:i,style:h,children:m},o)},{max:Je.CACHE_SIZE})),Ve(this,"getOuterElement",Gt(i=>{var o=O.forwardRef((s,a)=>u.jsx("div",Li({ref:a,tabIndex:-1,onKeyDown:i,role:"presentation"},s)));return o.displayName="ItemListOuterElement",o},{max:1e3})),Ve(this,"getInnerElement",Gt(()=>{var i=O.forwardRef((o,s)=>u.jsx("div",Li({className:"item-list-inner-element",ref:s},o)));return i.displayName="ItemListInnerElement",i},{max:1e3})),Ve(this,"getItemData",Gt((i,o,s)=>({items:i,selectedRanges:o,renderItem:s}),{max:1e3})),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=O.createRef(),this.listContainer=O.createRef();var{isStickyBottom:t,selectedRanges:r}=e;this.state={focusIndex:null,mouseDownIndex:null,selectedRanges:r,overscanStartIndex:0,height:null,isDragging:!1,isStuckToBottom:t,scrollOffset:null,mouseX:null,mouseY:null}}componentDidUpdate(e,t){var{selectedRanges:r,itemCount:i}=this.props,{focusIndex:o,isStuckToBottom:s,scrollOffset:a,height:l,selectedRanges:d}=this.state;if(s&&!this.isListAtBottom()&&i>0&&this.scrollToBottom(),(a!==t.scrollOffset||l!==t.height)&&this.sendViewportUpdate(),r!==e.selectedRanges&&r!==d)this.setSelectedRanges(r);else if(d!==t.selectedRanges){var{onSelectionChange:h}=this.props;h(d)}if(o!==t.focusIndex){var{onFocusChange:p}=this.props;p(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:r}=this.state,i=this.listContainer.current.querySelectorAll(t),o=e-r;return i[o]}focusItem(e){var{disableSelect:t}=this.props;if(!t){this.setState({focusIndex:e});var r=this.getElement(e);r instanceof HTMLElement&&r.focus()}}scrollToItem(e){var t=this.getElement(e);t!=null&&t.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){this.setState({focusIndex:e});var{selectedRanges:r}=this.state,i=Ze.isSelected(r,e),o=i||he.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,o,!1)}handleItemDoubleClick(e,t){var{isDoubleClickSelect:r,onSelect:i}=this.props;r&&this.setState(o=>{var{selectedRanges:s}=o;return{selectedRanges:Ze.selectRange(s,[e,e])}},()=>{i(e,t)})}handleItemMouseDown(e,t){var{selectedRanges:r}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(t.button===2&&r.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){Ri.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){Ri.debug2("item focus",e,t.target),this.setState(r=>{var{focusIndex:i}=r;return i!==e?{focusIndex:e}:null})}handleItemMouseMove(e,t){var{isDragSelect:r,isMultiSelect:i,disableSelect:o}=this.props,{mouseDownIndex:s,selectedRanges:a,mouseX:l,mouseY:d}=this.state;if(!(s==null||o)){var h=Math.abs(t.clientX-(l??0)),p=Math.abs(t.clientY-(d??0));h>Fi&&p>Fi&&this.setState({isDragging:!0}),(r||s===e)&&(this.focusItem(e),i?(!r&&!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:r,isDoubleClickSelect:i,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,d=he.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,l,d,r),!i&&!l&&!d&&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:r,onSelect:i}=this.props,{focusIndex:o}=this.state,s=o;if(e.key==="Enter"||e.key===" "){!t&&s!=null&&this.setState({selectedRanges:[[s,s]]},()=>{s!=null&&i(s,e)});return}if(e.key==="ArrowUp")s!=null&&s>=0?s=Math.max(0,s-1):s=r-1;else if(e.key==="ArrowDown")s!=null&&s>=0?s=Math.min(s+1,r-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 d;(d=this.listContainer.current)===null||d===void 0||d.focus()}this.scrollIntoView(s)}}handleScroll(e){var{scrollUpdateWasRequested:t,scrollOffset:r}=e;this.setState(i=>{if(t)return{scrollOffset:r};var{isStickyBottom:o}=this.props,{height:s}=i,a=o&&this.isListAtBottom({scrollOffset:r,height:s});return{isStuckToBottom:a,scrollOffset:r}})}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,r){var i=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?i&&this.deselectItem(e):o&&r?this.getItemSelected(e,s)?i&&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){Ze.validateRange(e),this.setState(t=>{var{selectedRanges:r}=t;return{selectedRanges:Ze.deselectRange(r,e)}})}selectItem(e){var{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){Ze.validateRange(e),this.setState(t=>{var{selectedRanges:r}=t;return{selectedRanges:Ze.selectRange(r,e)}})}setSelectedRanges(e){this.setState({selectedRanges:e})}sendViewportUpdate(){var{scrollOffset:e,height:t}=this.state;if(e!=null&&t!=null){var{onViewportChange:r,rowHeight:i}=this.props,o=Math.floor(e/i),s=o+Math.ceil(t/i);r(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:r,rowHeight:i}=this.props;return e+t>=r*i}renderInnerElement(e){var{index:t,style:r}=e,{items:i,offset:o,renderItem:s,disableSelect:a}=this.props,{focusIndex:l,selectedRanges:d}=this.state;if(t<o||t>=o+i.length)return null;var h=i[t-o];return this.getCachedItem(t,t,h,t===l&&!a,this.getItemSelected(t,d),s,r,a)}render(){var{items:e,itemCount:t,overscanCount:r,renderItem:i,rowHeight:o,"data-testid":s}=this.props,{selectedRanges:a,isStuckToBottom:l}=this.state;return u.jsx(Ll,{className:"item-list-auto-sizer",onResize:this.handleResize,children:d=>{var{width:h,height:p}=d;return u.jsx(Rl,{className:"item-list-scroll-pane",height:p,width:h,initialScrollOffset:l?t*o:0,itemCount:t,itemSize:o,itemData:this.getItemData(e,a,i),onScroll:this.handleScroll,onItemsRendered:this.handleItemsRendered,ref:this.list,outerElementType:this.getOuterElement(this.handleKeyDown),outerRef:this.listContainer,innerElementType:this.getInnerElement(),overscanCount:r,"data-testid":s,children:this.renderInnerElement})}})}}Wn=Je;Ve(Je,"CACHE_SIZE",1e3);Ve(Je,"DEFAULT_ROW_HEIGHT",20);Ve(Je,"DEFAULT_OVERSCAN",10);Ve(Je,"defaultProps",{offset:0,items:[],rowHeight:Wn.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:Wn.DEFAULT_OVERSCAN,renderItem:Wn.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0});var Pu=R.module("ErrorBoundary");class Tu extends c.Component{static getDerivedStateFromError(e){return{error:e}}constructor(e){super(e),this.state={error:void 0}}componentDidCatch(e,t){var{onError:r}=this.props;Pu.error("Error caught by ErrorBoundary",e,t),r==null||r(e,t)}render(){var{children:e,className:t,fallback:r}=this.props,{error:i}=this.state;return i!=null?r??u.jsx("div",{className:t,children:u.jsx(Sn,{errorMessage:"".concat(i),isLoading:!1,isLoaded:!1,"data-testid":"error-boundary-loading"})}):e??null}}function Ou(n){var{on:e,id:t,className:r,isInvalid:i,disabled:o=!1,onClick:s,"data-testid":a}=n;return u.jsx("button",{type:"button",className:$("btn","btn-switch",r,{active:e},{"is-invalid":i}),id:t,onClick:s,disabled:o,"data-testid":a,children:u.jsx("div",{className:"handle"})})}var xu=["children","className","isInvalid","onChange","data-testid"];function Hi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function $i(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Hi(Object(t),!0).forEach(function(r){Iu(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Hi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Iu(n,e,t){return(e=Du(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Du(n){var e=Mu(n,"string");return typeof e=="symbol"?e:e+""}function Mu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ku(n,e){if(n==null)return{};var t,r,i=ju(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function ju(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}var $s=O.forwardRef((n,e)=>{var{children:t,className:r,isInvalid:i,onChange:o,"data-testid":s}=n,a=ku(n,xu),l=xs(e),d=c.useCallback(h=>{o(h.target.value)},[o]);return u.jsx("select",$i($i({ref:l,className:$("custom-select",r,{"is-invalid":i}),onChange:d,"data-testid":s},a),{},{children:t}))});$s.displayName="Select";var qr=O.createContext(new Map);qr.displayName="XComponentMapContext";var Yf=qr.Provider;function Nu(n){var e,t=c.useContext(qr);return(e=t.get(n))!==null&&e!==void 0?e:n.Original}function Ui(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function br(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ui(Object(t),!0).forEach(function(r){Au(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ui(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Au(n,e,t){return(e=Lu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Lu(n){var e=Ru(n,"string");return typeof e=="symbol"?e:e+""}function Ru(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Us(n){var e,t;function r(i,o){var s=Nu(t);return As(n)?u.jsx(s,br(br({},i),{},{ref:o})):u.jsx(s,br({},i))}return r.displayName="XComponent(".concat((e=n.displayName)!==null&&e!==void 0?e:n.name,")"),t=c.forwardRef(r),t.Original=n,t.isXComponent=!0,t}function Fu(){return Pn(al,"No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?")}function Bs(n){return typeof n=="object"&&n!=null&&typeof n.type=="string"&&n.name!=null}function Ks(n){return typeof n=="object"&&n!=null&&typeof n.type=="string"&&n.id!=null}function Qf(n){return Bs(n)||Ks(n)}var Ws=c.createContext(null);Ws.displayName="ObjectFetcherContext";function Jf(n){if(Ks(n))return{id:n.id,type:n.type};if(Bs(n)){var e;return{name:(e=n.name)!==null&&e!==void 0?e:"",type:n.type}}throw new Error("Invalid descriptor: ".concat(n))}function Hu(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 eg(){return Pn(Ws,"No ObjectFetcher available in useObjectFetcher. Was code wrapped in ObjectFetcherContext.Provider?")}function Bi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function $u(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Bi(Object(t),!0).forEach(function(r){Uu(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Bi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Uu(n,e,t){return(e=Bu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Bu(n){var e=Ku(n,"string");return typeof e=="symbol"?e:e+""}function Ku(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Wu=Object.freeze({}),zu=new Map,tg=n=>n.api,ng=n=>n.user,zs=n=>n.storage,Vs=n=>zs(n).commandHistoryStorage,Vu=n=>zs(n).fileStorage,Gu=n=>n.defaultWorkspaceSettings,Gs=n=>{var{workspace:e}=n;return e},Xr=Fl(n=>{for(var e,t,r=(e=(t=Gs(n))===null||t===void 0?void 0:t.data.settings)!==null&&e!==void 0?e:{},i=$u({},Gu(n)),o=Object.keys(r),s=0;s<o.length;s+=1){var a=o[s];r[a]!==void 0&&(i[a]=r[a])}return i}),qu=n=>Xr(n).timeZone,rg=n=>{var e;return(e=Xr(n).notebookSettings)!==null&&e!==void 0?e:Wu},ig=n=>n.activeTool,Xu=n=>{var e;return(e=n.plugins)!==null&&e!==void 0?e:zu},Zu="SET_ACTIVE_TOOL",Yu="SET_API",og="SET_COMMAND_HISTORY_STORAGE",sg="SET_FILE_STORAGE",ag="SET_PLUGINS",Qu="SET_USER",Ju="SET_WORKSPACE",eh="SET_DEFAULT_WORKSPACE_SETTINGS",lg="SET_WORKSPACE_STORAGE",th="SET_SERVER_CONFIG_VALUES";function Ki(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function dt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ki(Object(t),!0).forEach(function(r){nh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ki(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function nh(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=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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var dg=n=>({type:Qu,payload:n}),ug=n=>({type:Yu,payload:n}),qs=n=>({type:Ju,payload:n}),hg=n=>({type:eh,payload:n}),oh=n=>(e,t)=>{e(qs(n));var{storage:r}=t(),{workspaceStorage:i}=r;return i==null?void 0:i.save(n)},sh=n=>(e,t)=>{var{workspace:r}=t(),{data:i}=r??{},o=dt(dt({},r),{},{data:dt(dt(dt({},i),n),{},{settings:dt(dt({},i==null?void 0:i.settings),n.settings)})});return e(oh(o))},cg=n=>(e,t)=>{var{notebookSettings:r}=Xr(t()),i=dt(dt({},r),n);return e(ah({notebookSettings:i}))},ah=n=>e=>e(sh({settings:n})),mg=n=>({type:Zu,payload:n}),pg=n=>({type:th,payload:n});function Wi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function zi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Wi(Object(t),!0).forEach(function(r){lh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Wi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function lh(n,e,t){return(e=dh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function dh(n){var e=uh(n,"string");return typeof e=="symbol"?e:e+""}function uh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function hh(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 r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,i=arguments.length>1?arguments[1]:void 0;switch(i==null?void 0:i.type){case n:{var{id:o,payload:s}=i;return t&&xr({payload:s},{payload:r[o]})?r:zi(zi({},r),{},{[o]:s})}default:return r}}}function Vi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Gi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Vi(Object(t),!0).forEach(function(r){Ar(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Vi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ar(n,e,t){return(e=ch(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ch(n){var e=mh(n,"string");return typeof e=="symbol"?e:e+""}function mh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ph{constructor(){Ar(this,"reducers",{}),Ar(this,"listener",null)}register(e,t){var r;this.reducers=Gi(Gi({},this.reducers),{},{[e]:t}),(r=this.listener)===null||r===void 0||r.call(this,this.reducers)}setListener(e){this.listener=e}}var vh=new ph;function Zr(n,e,t){return(e=fh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function fh(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Fe{static isValid(e,t){return!0}static isSameFormat(e,t){throw new Error("isSameFormat not implemented")}static makeFormat(e,t,r){return{label:e,formatString:t,type:r}}format(e,t){return""}}Zr(Fe,"TYPE_GLOBAL","type-global");Zr(Fe,"TYPE_CONTEXT_PRESET","type-context-preset");Zr(Fe,"TYPE_CONTEXT_CUSTOM","type-context-custom");function St(n,e,t){return(e=bh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function bh(n){var e=yh(n,"string");return typeof e=="symbol"?e:e+""}function yh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var qi=R.module("DateTimeColumnFormatter");class ht extends Fe{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 r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Fe.TYPE_CONTEXT_PRESET;return{label:e,formatString:t,type:r}}static isSameFormat(e,t){return e===t||e!==null&&t!==null&&e.type===t.type&&e.formatString===t.formatString}static makeGlobalFormatStringMap(e,t){var r=t?"'T'":" ",i=e?" z":"";return new Map([["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(r,"HH:mm:ss").concat(i)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSS").concat(i)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSSSSSSSS").concat(i)]])}static getGlobalFormats(e,t){var r=ht.makeGlobalFormatStringMap(e,t);return[...r.keys()]}static makeFormatStringMap(e,t){var r=t!==void 0&&t?"'T'":" ",i=e!==void 0&&e?" z":"";return new Map([["yyyy-MM-dd","yyyy-MM-dd".concat(i)],["MM-dd-yyyy","MM-dd-yyyy".concat(i)],["HH:mm:ss","HH:mm:ss".concat(i)],["HH:mm:ss.SSS","HH:mm:ss.SSS".concat(i)],["HH:mm:ss.SSSSSSSSS","HH:mm:ss.SSSSSSSSS".concat(i)],["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(r,"HH:mm:ss").concat(i)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSS").concat(i)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSSSSSSSS").concat(i)]])}static getFormats(e,t){var r=ht.makeFormatStringMap(e,t);return[...r.keys()]}constructor(e){var{timeZone:t="",showTimeZone:r=!0,showTSeparator:i=!1,defaultDateTimeFormatString:o=ht.DEFAULT_DATETIME_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),St(this,"dh",void 0),St(this,"dhTimeZone",void 0),St(this,"defaultDateTimeFormatString",void 0),St(this,"showTimeZone",void 0),St(this,"showTSeparator",void 0),St(this,"formatStringMap",void 0);var s=t||ht.DEFAULT_TIME_ZONE_ID;try{this.dhTimeZone=e.i18n.TimeZone.getTimeZone(s)}catch{qi.error("Unsupported time zone id",s),this.dhTimeZone=e.i18n.TimeZone.getTimeZone(ht.DEFAULT_TIME_ZONE_ID)}this.dh=e,this.defaultDateTimeFormatString=o,this.showTimeZone=r,this.showTSeparator=i,this.formatStringMap=ht.makeFormatStringMap(r,i)}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]:{},r=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultDateTimeFormatString,i=this.getEffectiveFormatString(r);try{return this.dh.i18n.DateTimeFormat.format(i,e,this.dhTimeZone)}catch{qi.error("Invalid format arguments")}return""}}St(ht,"DEFAULT_DATETIME_FORMAT_STRING","yyyy-MM-dd HH:mm:ss.SSS");St(ht,"DEFAULT_TIME_ZONE_ID","America/New_York");var vt;function et(n,e,t){return(e=Ch(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ch(n){var e=wh(n,"string");return typeof e=="symbol"?e:e+""}function wh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Sh=R.module("DecimalColumnFormatter");class Me extends Fe{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 r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Fe.TYPE_CONTEXT_PRESET,i=arguments.length>3?arguments[3]:void 0;return{label:e,type:r,formatString:t,multiplier:i}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0;return Me.makeFormat(e,t,Fe.TYPE_CONTEXT_PRESET,r)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return Me.makeFormat("Custom Format",e,Fe.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=Me.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),et(this,"defaultFormatString",void 0),et(this,"dh",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,i=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return this.dh.i18n.NumberFormat.format(r,i)}catch{Sh.error("Invalid format arguments")}return""}}vt=Me;et(Me,"DEFAULT_FORMAT_STRING","###,##0.0000");et(Me,"FORMAT_PERCENT",vt.makePresetFormat("Percent","##0.00%"));et(Me,"FORMAT_BASIS_POINTS",vt.makePresetFormat("Basis Points","###,##0 bp",1e4));et(Me,"FORMAT_THOUSANDS",vt.makePresetFormat("Thousands","##0.000 k",.001));et(Me,"FORMAT_MILLIONS",vt.makePresetFormat("Millions","###,##0.000 mm",1e-6));et(Me,"FORMAT_SCIENTIFIC_NOTATION",vt.makePresetFormat("Scientific Notation","0.0000E0"));et(Me,"FORMAT_ROUND",vt.makePresetFormat("Round","###,##0"));et(Me,"FORMAT_ROUND_TWO_DECIMALS",vt.makePresetFormat("0.00","###,##0.00"));et(Me,"FORMAT_ROUND_FOUR_DECIMALS",vt.makePresetFormat("0.0000","###,##0.0000"));var ar;function tn(n,e,t){return(e=_h(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _h(n){var e=Eh(n,"string");return typeof e=="symbol"?e:e+""}function Eh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ph=R.module("IntegerColumnFormatter");class mt extends Fe{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 r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Fe.TYPE_CONTEXT_PRESET,i=arguments.length>3?arguments[3]:void 0;return{label:e,type:r,formatString:t,multiplier:i}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0;return mt.makeFormat(e,t,Fe.TYPE_CONTEXT_PRESET,r)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return mt.makeFormat("Custom Format",e,Fe.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=mt.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),tn(this,"dh",void 0),tn(this,"defaultFormatString",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,i=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return this.dh.i18n.NumberFormat.format(r,i)}catch{Ph.error("Invalid format arguments")}return""}}ar=mt;tn(mt,"DEFAULT_FORMAT_STRING","###,##0");tn(mt,"FORMAT_THOUSANDS",ar.makePresetFormat("Thousands","##0.000 k",.001));tn(mt,"FORMAT_MILLIONS",ar.makePresetFormat("Millions","###,##0.000 mm",1e-6));tn(mt,"FORMAT_SCIENTIFIC_NOTATION",ar.makePresetFormat("Scientific Notation","0.0000E0"));function Ut(n,e,t){return(e=Th(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Th(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class B{}Ut(B,"INTEGER","int");Ut(B,"LONG","long");Ut(B,"DOUBLE","double");Ut(B,"BOOLEAN","bool");Ut(B,"STRING","string");Ut(B,"DATE_TIME","datetime");Ut(B,"LOCAL_TIME","localtime");var Xs=c.createContext(null);Xs.displayName="PluginsContext";var dn=Object.freeze({AUTH_PLUGIN:"AuthPlugin",DASHBOARD_PLUGIN:"DashboardPlugin",WIDGET_PLUGIN:"WidgetPlugin",TABLE_PLUGIN:"TablePlugin",THEME_PLUGIN:"ThemePlugin",ELEMENT_PLUGIN:"ElementPlugin"});function xh(n){return"DashboardPlugin"in n}function Ih(n){return"AuthPlugin"in n}function Dh(n){return"TablePlugin"in n}function vg(n){return xh(n)||Ih(n)||Dh(n)}function Mh(n){return"type"in n&&n.type===dn.DASHBOARD_PLUGIN}function Yr(n){return"type"in n&&n.type===dn.WIDGET_PLUGIN}function kh(n){return"type"in n&&n.type===dn.TABLE_PLUGIN}function jh(n){return"type"in n&&n.type===dn.AUTH_PLUGIN}function Zs(n){return"type"in n&&n.type===dn.THEME_PLUGIN}function Ys(n){return"type"in n&&n.type===dn.ELEMENT_PLUGIN}function fg(n){return Mh(n)||jh(n)||kh(n)||Zs(n)||Yr(n)||Ys(n)}var Qs=R.module("@deephaven/plugin.PluginUtils");function Xi(n,e){return n==null||!Yr(n)?!1:[n.supportedTypes].flat().some(t=>t===e)}function Nh(n){var e=u.jsx(le,{icon:hs});if(!Yr(n))return e;var{icon:t}=n;return t==null?e:c.isValidElement(t)?t:u.jsx(le,{icon:t})}function gg(n){var e=[...n.entries()].filter(t=>Zs(t[1]));return Qs.debug("Getting theme data from plugins",e),e.map(t=>{var[r,i]=t,o=Array.isArray(i.themes)?i.themes:[i.themes];return o.map(s=>{var{name:a,baseTheme:l,styleContent:d}=s;return{baseThemeKey:"default-".concat(l??"dark"),themeKey:ll(r,a),name:a,styleContent:d}})}).flat()}function bg(n){var e=[...n.entries()].filter(t=>Ys(t[1])&&t[1].mapping!=null);return Qs.debug("Getting element plugin mapping",e),new Map(e.flatMap(t=>{var[,r]=t;return Object.entries(r.mapping)}))}function yg(){return Pn(Xs,"No Plugins available in usePlugins. This can happen when plugins have not finished loading or if code is not wrapped in PluginsContext.Provider.")}var Js=c.createContext(null);Js.displayName="PersistentStateContext";function Cg(n){var{initialState:e,onChange:t,children:r}=n,[i,o]=O.useState(0),s=c.useRef({initial:e,initialStateMap:new Map,state:new Map,isTracking:!0}),a=c.useCallback((m,v)=>{s.current.isTracking&&s.current.state.set(m,v)},[]),l=c.useCallback(()=>{s.current.isTracking||(s.current.isTracking=!0,s.current.state=new Map,o(m=>m+1))},[]),d=c.useRef(s.current.initial[Symbol.iterator]()),h=c.useCallback(function(v){var f=s.current.initialStateMap.get(v);if(f)return f;var{value:g,done:b}=d.current.next(),S={value:g,done:b??!1};return s.current.initialStateMap.set(v,S),S},[]);c.useEffect(function(){s.current.isTracking&&(t([...s.current.state.values()]),s.current.isTracking=!1)},[i,t]);var p=c.useMemo(()=>({addState:a,scheduleStateUpdate:l,getInitialState:h,updateId:i}),[a,h,l,i]);return u.jsx(Js.Provider,{value:p,children:r})}const Ah="var(--dh-color-chart-colorway)",Lh="var(--dh-color-chart-grid)",Rh="var(--dh-color-chart-axis-line)",Fh="var(--dh-color-chart-axis-line-zero)",Zi={"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:Ah,gridcolor:Lh,linecolor:Rh,zerolinecolor:Fh,"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 Yi=R.module("ChartTheme");function Hh(){var n,e=cs(Zi);return e.colorway=dl((n=e.colorway)!==null&&n!==void 0?n:"").map(t=>{var[r,i]=t;return ul.normalizeCssColor(e.colorway.substring(r,i+1))}).join(" "),Yi.debug2("Chart theme:",Zi),Yi.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 Qi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function $h(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Qi(Object(t),!0).forEach(function(r){Uh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Qi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Uh(n,e,t){return(e=Bh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Bh(n){var e=Kh(n,"string");return typeof e=="symbol"?e:e+""}function Kh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Wh=c.lazy(()=>Hl(()=>import("./Plot-BXUhBfhF.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url));function zh(n){return u.jsx(c.Suspense,{fallback:u.jsx(Sn,{"data-testid":"lazy-plot-loading"}),children:u.jsx(Wh,$h({},n))})}var Qr=c.createContext(null);Qr.displayName="ChartThemeContext";function wg(n){var{children:e}=n,{activeThemes:t}=Is(),r=c.useMemo(Hh,[t]);return u.jsx(Qr.Provider,{value:r,children:e})}function Vh(){return Pn(Qr,"No ChartThemeContext value found.")}var ea=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 ta(n){return n.componentName!==void 0}function Gh(n){return n.component!==void 0}var na=Object.freeze({type:"default",isClosable:!0,isFocusOnShow:!0,reorderEnabled:!0,title:""});const qh=Object.freeze(Object.defineProperty({__proto__:null,defaultConfig:ea,isGLComponentConfig:ta,isReactComponentConfig:Gh,itemDefaultConfig:na},Symbol.toStringTag,{value:"Module"}));function zn(n,e,t){return(e=Xh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Xh(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Oe{constructor(){zn(this,"_mSubscriptions",void 0),zn(this,"off",this.unbind),zn(this,"trigger",this.emit),this._mSubscriptions={},this._mSubscriptions[Oe.ALL_EVENT]=[]}on(e,t,r){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:r})}emit(e){for(var t=this._mSubscriptions[e],r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[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,i)}catch(p){console.error("Error while emitting event:",p)}}i.unshift(e);for(var l=this._mSubscriptions[Oe.ALL_EVENT],d=0;d<l.length;d++){var h=l[d].ctx||{};try{l[d].fn.apply(h,i)}catch(p){console.error("Error while emitting event to allEventSubs:",p)}}}unbind(e,t,r){if(!this._mSubscriptions[e])throw new Error("No subscriptions to unsubscribe for event "+e);for(var i=!1,o=0;o<this._mSubscriptions[e].length;o++)(!t||this._mSubscriptions[e][o].fn===t)&&(!r||r===this._mSubscriptions[e][o].ctx)&&(this._mSubscriptions[e].splice(o,1),i=!0);if(i===!1)throw new Error("Nothing to unbind for "+e)}}zn(Oe,"ALL_EVENT","__all");function qe(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Lr extends Oe{constructor(e,t,r){super(),qe(this,"width",void 0),qe(this,"height",void 0),qe(this,"title",void 0),qe(this,"parent",void 0),qe(this,"layoutManager",void 0),qe(this,"tab",void 0),qe(this,"_config",void 0),qe(this,"isHidden",!1),qe(this,"beforeCloseHandler",void 0),qe(this,"_element",T(['<div class="lm_item_container">','<div class="lm_content" tabindex="-1"></div>',"</div>"].join(""))),qe(this,"_contentElement",void 0),this.title=ta(e)?e.componentName:"",this.parent=t,this.layoutManager=r,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 r,i,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 d=s.isColumn?"height":"width",h=d==="height"?t:e,p=((r=this[d])!==null&&r!==void 0?r:0)*(1/(((i=a.config[d])!==null&&i!==void 0?i:0)/100)),m=h/p*100,v=(((o=a.config[d])!==null&&o!==void 0?o:0)-m)/(s.contentItems.length-1),f=0;f<s.contentItems.length;f++)if(s.contentItems[f]===a)s.contentItems[f].config[d]=m;else{var g;s.contentItems[f].config[d]=((g=s.contentItems[f].config[d])!==null&&g!==void 0?g:0)+v}return s.callDownwards("setSize"),!0}close(e){var t,r;this._config.isClosable&&(!((t=(r=this.beforeCloseHandler)===null||r===void 0?void 0:r.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 r=this._contentElement[0],i=r.offsetWidth-r.clientWidth,o=r.offsetHeight-r.clientHeight;this._contentElement.width(this.width-i).height(this.height-o),this.emit("resize")}}}const Jh=Object.freeze(Object.defineProperty({__proto__:null,Container:Lr,ItemContainer:Lr},Symbol.toStringTag,{value:"Module"}));function ra(n){var e=location.hash.match(new RegExp(n+"=([^&]*)"));return e?e[1]:null}function ia(n){if(window.location.hash)return ra(n);if(!window.location.search)return null;var e=window.location.search.substr(1).split("&"),t={},r,i;for(i=0;i<e.length;i++)r=e[i].split("="),t[r[0]]=r[1];return t[n]||null}function Jr(n){return window.requestAnimationFrame(n)}function ec(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 qn(){return ct()}function tc(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 ei(n){return T.trim(n.replace(/(<([^>]+)>)/gi,""))}function je(n,e,t){return(e=nc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nc(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Tn extends Oe{constructor(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super(),je(this,"_eElement",void 0),je(this,"_oDocument",void 0),je(this,"_eBody",void 0),je(this,"_destroyAfterMouseUp",void 0),je(this,"_nDelay",400),je(this,"_timeout",void 0),je(this,"timeout",void 0),je(this,"_nDistance",10),je(this,"_nX",0),je(this,"_nY",0),je(this,"_nOriginalX",0),je(this,"_nOriginalY",0),je(this,"_bDragging",!1),this._eElement=e,this._oDocument=T(document),this._eBody=T(document.body),this._destroyAfterMouseUp=r,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,r,i,o,s=this._getCoordinates(e);this._nOriginalX=(t=s.x)!==null&&t!==void 0?t:0,this._nOriginalY=(r=s.y)!==null&&r!==void 0?r:0,(i=this._oDocument)===null||i===void 0||i.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,r;e.preventDefault();var i=this._getCoordinates(e);this._nX=((t=i.x)!==null&&t!==void 0?t:0)-this._nOriginalX,this._nY=((r=i.y)!==null&&r!==void 0?r: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,r,i,o;if(clearTimeout(this._timeout),(t=this._oDocument)===null||t===void 0||t.unbind("mousemove",this.onMouseMove),(r=this._oDocument)===null||r===void 0||r.unbind("mouseup",this.onMouseUp),(i=this._oDocument)===null||i===void 0||(i=i.find("iframe"))===null||i===void 0||i.css("pointer-events",""),this._bDragging===!0&&(this._bDragging=!1,this.emit("dragStop",e,this._nOriginalX+this._nX)),(o=this._eBody)===null||o===void 0||o.removeClass("lm_dragging"),!(this._eElement instanceof Window)){var s;(s=this._eElement)===null||s===void 0||s.removeClass("lm_dragging")}this._destroyAfterMouseUp&&this.destroy()}}_startDrag(){var e,t,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"),(r=this._oDocument)===null||r===void 0||(r=r.find("iframe"))===null||r===void 0||r.css("pointer-events","none"),this.emit("dragStart",this._nOriginalX,this._nOriginalY)}_getCoordinates(e){var t,r;return{x:(t=e.pageX)!==null&&t!==void 0?t:0,y:(r=e.pageY)!==null&&r!==void 0?r:0}}}function Wt(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=oc(n,"string");return typeof e=="symbol"?e:e+""}function oc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class oa{constructor(e,t){Wt(this,"_container",void 0),Wt(this,"_reactComponent",null),Wt(this,"_portalComponent",null),Wt(this,"_originalComponentWillUpdate",null),Wt(this,"_initialState",void 0),Wt(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=Vr.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 r;this._container.setState(t),(r=this._originalComponentWillUpdate)===null||r===void 0||r.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 O.createElement(this._reactClass,t)}}var Xn=["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"],sc=[!0,!1,"row","column","stack","component","close","maximise","minimise","open in new window"];function ti(n){if(Xn.length>36)throw new Error("Too many keys in config minifier map");var e={};return ni(n,e,"_min"),e}function Rr(n){if(Xn.length>36)throw new Error("Too many keys in config minifier map");var e={};return ni(n,e,"_max"),e}function ni(n,e,t){var r=t==="_min"?ac:lc;for(var i in n)if(n.hasOwnProperty(i)){var o=Array.isArray(n)?n[Number.parseInt(i,10)]:n[i];if(typeof o=="object"&&o!=null){var s=o instanceof Array?[]:{};if(Array.isArray(e))e[Number.parseInt(i,10)]=s;else{var a=r(i,Xn);e[a]=s}ni(o,s,t)}else{var l=r(o,sc);if(Array.isArray(e))e[Number.parseInt(i,10)]=l;else{var d=r(i,Xn);e[d]=l}}}}function ac(n,e){if(typeof n=="string"&&n.length===1)return"___"+n;var t=e.indexOf(n);return t===-1?n:t.toString(36)}function lc(n,e){return typeof n=="string"&&n.length===1?e[parseInt(n,36)]:typeof n=="string"&&n.substr(0,3)==="___"?n[3]:n}function yr(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Fr{constructor(e,t){yr(this,"name",void 0),yr(this,"origin",void 0),yr(this,"isPropagationStopped",void 0),this.name=e,this.origin=t,this.isPropagationStopped=!1}stopPropagation(){this.isPropagationStopped=!0}}function jn(n,e,t){return(e=hc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function hc(n){var e=cc(n,"string");return typeof e=="symbol"?e:e+""}function cc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}let sa=class extends Oe{constructor(e){super(),jn(this,"_layoutManager",void 0),jn(this,"_dontPropagateToParent",void 0),jn(this,"_childEventSource",void 0),jn(this,"_boundOnEventFromChild",void 0),this._layoutManager=e,this._dontPropagateToParent=null,this._childEventSource=null,this.on(Oe.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),r=0;r<e;r++)t[r]=arguments[r];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,r="gl_child_event",i=(t=window.opener)===null||t===void 0?void 0:t.document.createEvent("HTMLEvents");i.initEvent(r,!0,!0),i.eventName=r,i.__glArgs=e,i.__gl=this._layoutManager,window.opener.dispatchEvent(i)}_propagateToChildren(e){for(var t=0;t<this._layoutManager.openPopouts.length;t++){var r=this._layoutManager.openPopouts[t].getGlInstance();r&&r!==this._childEventSource&&r.eventHub._$onEventFromParent(e)}}destroy(){T(window).off("gl_child_event",this._boundOnEventFromChild)}};function aa(n,e,t){return n.on(e,t),()=>{n.off(e,t)}}function la(n){return(e,t)=>aa(e,n,t)}function da(n){return function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];e.emit(n,...r)}}function ua(n){return(e,t)=>{var r=c.useRef(null),i=c.useRef(()=>!1);if(r.current!=e||i.current!=t){var o;(o=r.current)===null||o===void 0||o.off(n,i.current),e==null||e.on(n,t)}r.current=e,i.current=t,c.useEffect(()=>()=>{var s;return(s=r.current)===null||s===void 0?void 0:s.off(n,i.current)},[])}}function xt(n){return{listen:la(n),emit:da(n),useListener:ua(n)}}const mc=Object.freeze(Object.defineProperty({__proto__:null,BubblingEvent:Fr,DragListener:Tn,EventEmitter:Oe,EventHub:sa,ReactComponentHandler:oa,animFrame:Jr,filterXss:tc,getHashValue:ra,getQueryStringParam:ia,getUniqueId:qn,listenForEvent:aa,makeEmitFunction:da,makeEventFunctions:xt,makeListenFunction:la,makeUseListenerFunction:ua,minifyConfig:ti,removeFromArray:ec,stripTags:ei,unminifyConfig:Rr},Symbol.toStringTag,{value:"Module"}));function bt(n,e,t){return(e=pc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function pc(n){var e=vc(n,"string");return typeof e=="symbol"?e:e+""}function vc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ha extends Oe{constructor(e,t,r,i,o){super(),bt(this,"isInitialised",!1),bt(this,"_config",void 0),bt(this,"_dimensions",void 0),bt(this,"_parentId",void 0),bt(this,"_indexInParent",void 0),bt(this,"_layoutManager",void 0),bt(this,"_popoutWindow",null),bt(this,"_id",null),this._config=e,this._dimensions=t,this._parentId=r,this._indexInParent=i,this._layoutManager=o,this._createWindow()}toConfig(){var e,t,r,i,o,s,a,l,d,h,p;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:(r=(i=(o=this._popoutWindow)===null||o===void 0?void 0:o.screenX)!==null&&i!==void 0?i:(s=this._popoutWindow)===null||s===void 0?void 0:s.screenLeft)!==null&&r!==void 0?r:0,top:(a=(l=(d=this._popoutWindow)===null||d===void 0?void 0:d.screenY)!==null&&l!==void 0?l:(h=this._popoutWindow)===null||h===void 0?void 0:h.screenTop)!==null&&a!==void 0?a:0},content:(p=this.getGlInstance())===null||p===void 0?void 0:p.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,r=null;if(this._parentId){var i;if(t=T.extend(!0,{},(i=this.getGlInstance())===null||i===void 0?void 0:i.toConfig()).content[0],r=this._layoutManager.root.getItemsById(this._parentId)[0],!r){var o;((o=this._layoutManager.root.contentItems.length)!==null&&o!==void 0?o:0)>0?r=this._layoutManager.root.contentItems[0]:r=this._layoutManager.root}}t&&((e=r)===null||e===void 0||e.addChild(t,this._indexInParent),this.close())}_createWindow(){var e=this._createUrl(),t=Math.floor(Math.random()*1e6).toString(36),r=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,r),!this._popoutWindow)if(this._layoutManager.config.settings.blockedPopoutsThrowError===!0){var i=new Error("Popout blocked");throw i.type="popoutBlocked",i}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=[],r;for(r in e)t.push(r+"="+e[r]);return t.join(",")}_createUrl(){var e={content:this._config},t="gl-window-config-"+qn();e=ti(e);try{localStorage.setItem(t,JSON.stringify(e))}catch(i){throw new Error("Error while writing to localStorage "+i.toString())}var r=document.location.href.split("?");return r.length===1?r[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=fc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function fc(n){var e=gc(n,"string");return typeof e=="symbol"?e:e+""}function gc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Bt extends Oe{constructor(e,t,r,i,o,s){var a,l,d,h,p,m,v,f;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=r,this._layoutManager=i,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 g,b;this._layoutManager.tabDropPlaceholder.width((g=this._contentItem.tab.element.outerWidth(!0))!==null&&g!==void 0?g:0),this._layoutManager.tabDropPlaceholder.height((b=this._contentItem.tab.element.outerHeight(!0))!==null&&b!==void 0?b:0)}if(this.element=T(Bt._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",ei((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,w;this._layoutManager.tabDropPlaceholder.width((S=this._proxyTab.outerWidth(!0))!==null&&S!==void 0?S:0),this._layoutManager.tabDropPlaceholder.height((w=this._proxyTab.outerHeight(!0))!==null&&w!==void 0?w:0)}var y=this._layoutManager.container.offset();this._minX=(d=y==null?void 0:y.left)!==null&&d!==void 0?d:0,this._minY=(h=y==null?void 0:y.top)!==null&&h!==void 0?h:0,this._maxX=((p=this._layoutManager.container.width())!==null&&p!==void 0?p:0)+this._minX,this._maxY=((m=this._layoutManager.container.height())!==null&&m!==void 0?m:0)+this._minY,this._width=(v=this.element.width())!==null&&v!==void 0?v:0,this._height=(f=this.element.height())!==null&&f!==void 0?f:0,this._setDropPosition(e,t),this._layoutManager.emit("itemPickedUp",this._contentItem)}_onDrag(e,t,r){var i,o,s=(i=r.pageX)!==null&&i!==void 0?i:0,a=(o=r.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,r=e.dragProxyHeight;this.element.width(t),this.element.height(r),t-=this._sided?e.headerHeight:0,r-=this._sided?0:e.headerHeight,this.childElementContainer.width(t),this.childElementContainer.height(r),this._contentItem.element.width(t),this._contentItem.element.height(r),this._contentItem.callDownwards("_$show"),this._contentItem.callDownwards("setSize")}}ve(Bt,"_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 Nn(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=yc(n,"string");return typeof e=="symbol"?e:e+""}function yc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ca{constructor(e,t,r){Nn(this,"_element",void 0),Nn(this,"_itemConfig",void 0),Nn(this,"_layoutManager",void 0),Nn(this,"_dragListener",void 0),this._element=e,this._itemConfig=t,this._layoutManager=r,this._dragListener=this._createDragListener()}_createDragListener(){return this._dragListener=new Tn(this._element,!0),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._createDragListener,this),this._dragListener}_onDragStart(e,t){var r=this._itemConfig;typeof r=="function"&&(r=r());var i=this._layoutManager._$normalizeContentItem(T.extend(!0,{},r));new Bt(e,t,this._dragListener,this._layoutManager,i,null)}}function An(n,e,t){return(e=Cc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Cc(n){var e=wc(n,"string");return typeof e=="symbol"?e:e+""}function wc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ma{constructor(e,t,r){An(this,"_element",T(window)),An(this,"_itemConfig",void 0),An(this,"_layoutManager",void 0),An(this,"_dragListener",void 0),this._itemConfig=e,this._layoutManager=t,this._createDragListener(r)}_createDragListener(e){this._dragListener&&this._dragListener.destroy(),this._element&&(this._dragListener=new Tn(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 r=this._itemConfig;typeof r=="function"&&(r=r());var i=this._layoutManager._$normalizeContentItem(T.extend(!0,{},r));new Bt(e,t,this._dragListener,this._layoutManager,i,null)}}}function pa(n,e,t){return(e=Sc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Sc(n){var e=_c(n,"string");return typeof e=="symbol"?e:e+""}function _c(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class On{constructor(){pa(this,"element",T(On._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()}}pa(On,"_template",'<div class="lm_dropTargetIndicator"><div class="lm_inner"></div></div>');function Cr(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=Pc(n,"string");return typeof e=="symbol"?e:e+""}function Pc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class pn{constructor(e,t,r,i){Cr(this,"element",void 0),Cr(this,"_header",void 0),Cr(this,"_action",void 0),this._header=e,this.element=T('<li class="'+r+'" title="'+t+'"></li>'),this._header.on("destroy",this._$destroy,this),this._action=i,this.element.on("click",this._action),this._header.controlsContainer.append(this.element)}_$destroy(){this.element.off(),this.element.remove()}}function Tc(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=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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Lt extends Error{constructor(e,t){super(),Tc(this,"node",void 0),this.name="Configuration Error",this.message=e,this.node=t}}const Ic=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationError:Lt},Symbol.toStringTag,{value:"Module"}));function me(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=Mc(n,"string");return typeof e=="symbol"?e:e+""}function Mc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Ft(n){return n.isStack}function Le(n){return n.isComponent}function va(n){return n.isRoot}class ge extends Oe{constructor(e,t,r,i){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=i,this.config=this._extendItemNode(t),this.type=t.type,this.contentItems=[],this.parent=r,this.layoutManager=e,this._pendingEventPropagations={},this._throttledEvents=["stateChanged"],this.on(Oe.ALL_EVENT,this._propagateEvent,this),t.content&&this._createContentItems(t)}callDownwards(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;r!==!0&&i!==!0&&this[e].apply(this,t);for(var o=0;o<this.contentItems.length;o++)this.contentItems[o].callDownwards(e,t,r);r===!0&&i!==!0&&this[e].apply(this,t)}removeChild(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=this.contentItems.indexOf(e);if(i===-1)throw new Error("Can't remove child item. Unknown content item");if(r!==!0&&this.contentItems[i]._$destroy(),this.contentItems.splice(i,1),(t=this.config.content)===null||t===void 0||t.splice(i,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 r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t=this.layoutManager._$normalizeContentItem(t);var i=this.contentItems.indexOf(e),o=e.element[0].parentNode;if(i===-1)throw new Error("Can't replace child. oldChild is not child of this");o==null||o.replaceChild(t.element[0],e.element[0]),r===!0&&(e.parent=null,e._$destroy()),this.contentItems[i]=t,t.parent=this,Ft(this)&&(this.header.tabs[i].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=[],r=function(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 r(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),r=[],i=0;i<t.length;i++)r.push(t[i].instance);return r}_$getItemsByProperty(e,t){return this.getItemsByFilter(function(r){return r[e]===t})}_$setParent(e){this.parent=e}_$highlightDropZone(e,t,r){var i;(i=this.layoutManager.dropTargetIndicator)===null||i===void 0||i.highlightArea(r)}_$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"),r=null,i=0;i<t.length;i++)r=t[i].getActiveContentItem(),r&&Le(r)&&r.container[e]()}_$destroy(){this.emitBubblingEvent("beforeItemDestroyed"),this.callDownwards("_$destroy",[],!0,!0),this.element.remove(),this.emitBubblingEvent("itemDestroyed")}_$getArea(e){var t,r,i;e=e||this.element;var o=(t=e.offset())!==null&&t!==void 0?t:{left:0,top:0},s=(r=e.width())!==null&&r!==void 0?r:0,a=(i=e.height())!==null&&i!==void 0?i: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 Fr(e,this);this.emit(e,t)}_createContentItems(e){var t;if(!(e.content instanceof Array))throw new Lt("content must be an Array",e);for(var r=0;r<e.content.length;r++)t=this.layoutManager.createContentItem(e.content[r],this),this.contentItems.push(t)}_extendItemNode(e){for(var[t,r]of Object.entries(na)){var i=t;e[i]===void 0&&(e[i]=r)}return e}_propagateEvent(e,t){t instanceof Fr&&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,Jr(this._propagateEventToLayoutManager.bind(this,e,t)))}_propagateEventToLayoutManager(e,t){this._pendingEventPropagations[e]=!1,this.layoutManager.emit(e,t)}}function hn(n,e,t){return(e=kc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function kc(n){var e=jc(n,"string");return typeof e=="symbol"?e:e+""}function jc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class fa extends ge{constructor(e,t,r){var i;Object.entries((i=e.config.settings.defaultComponentConfig)!==null&&i!==void 0?i:{}).forEach(a=>{var[l,d]=a;t[l]===void 0&&(t[l]=d)}),super(e,t,r,T()),hn(this,"config",void 0),hn(this,"componentName",void 0),hn(this,"container",void 0),hn(this,"parent",void 0),hn(this,"instance",void 0),this.config=t,this.parent=r;var o=e.getComponent(this.config.componentName)||e.getFallbackComponent(),s=T.extend(!0,{},this.config.componentState||{});if(o==null)throw new Lt('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 Lr(this.config,this,e),this.instance=new o(this.container,s),this.element=this.container._element}close(){var e;(e=this.parent)===null||e===void 0||e.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(e){this.container.show(),(this.container._config.isFocusOnShow||e)&&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=Nc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Nc(n){var e=Ac(n,"string");return typeof e=="symbol"?e:e+""}function Ac(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Cn extends ge{constructor(e,t,r,i){super(t,r,i,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=i,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,r){var i,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),i=1/this.contentItems.length*100,r===!0){this.emitBubblingEvent("stateChanged");return}for(s=0;s<this.contentItems.length;s++)if(this.contentItems[s]===e)e.config[this._dimension]=i;else{var l;o=((l=this.contentItems[s].config[this._dimension])!==null&&l!==void 0?l:0)*(100-i)/100,this.contentItems[s].config[this._dimension]=o}this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}removeChild(e,t){var r,i=(r=e.config[this._dimension])!==null&&r!==void 0?r: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 d;this.contentItems[a].config[this._dimension]=((d=this.contentItems[a].config[this._dimension])!==null&&d!==void 0?d:0)+i/(this.contentItems.length-1)}if(ge.prototype.removeChild.call(this,e,t),this.contentItems.length===1&&this.config.isClosable===!0){var h;l=this.contentItems[0],this.contentItems=[],(h=this.parent)===null||h===void 0||h.replaceChild(this,l,!0)}else this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}replaceChild(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=e.config[this._dimension];t.config[this._dimension]=i,super.replaceChild(e,t,r),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,r=(this.contentItems.length-1)*this._splitterSize,i=(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-=r:i-=r;for(var l=0;l<this.contentItems.length;l++){var d,h,p=this._isColumn?Math.floor(o*(((d=this.contentItems[l].config.height)!==null&&d!==void 0?d:0)/100)):Math.floor(i*(((h=this.contentItems[l].config.width)!==null&&h!==void 0?h:0)/100));s+=p,a.push(p)}var m=Math.floor((this._isColumn?o:i)-s);return{itemSizes:a,additionalPixel:m,totalWidth:i,totalHeight:o}}_calculateRelativeSizes(){for(var e=0,t=[],r=this._isColumn?"height":"width",i=0;i<this.contentItems.length;i++){var o=this.contentItems[i].config[r];o!=null?e+=o:t.push(this.contentItems[i])}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[r]=(100-e)/t.length;this._respectMinItemWidth();return}if(Math.round(e)>100)for(var a=0;a<t.length;a++)t[a].config[r]=50,e+=50;for(var l=0;l<this.contentItems.length;l++){var d;this.contentItems[l].config[r]=((d=this.contentItems[l].config[r])!==null&&d!==void 0?d: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,r=[],i=0,o=0,s=0,a=[],l;if(!(this._isColumn||!t||this.contentItems.length<=1)){for(var d=this._calculateAbsoluteSizes(),h=0;h<this.contentItems.length;h++){this.contentItems[h];var p=d.itemSizes[h];p<t?(o+=t-p,l={width:t}):(i+=p-t,l={width:p},r.push(l)),a.push(l)}if(!(o===0||o>i)){var m=o/i;s=o;for(var v=0;v<r.length;v++){l=r[v];var f=Math.round((l.width-t)*m);s-=f,l.width-=f}s!==0&&(a[a.length-1].width-=s);for(var g=0;g<this.contentItems.length;g++)this.contentItems[g].config.width=a[g].width/d.totalWidth*100}}}_createSplitter(e){var t;return t=new ga(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,r=0,i=0;i<e.length;++i){var o,s;t=Math.max((o=e[i].minWidth)!==null&&o!==void 0?o:0,t),r=Math.max((s=e[i].minHeight)!==null&&s!==void 0?s:0,r)}return{horizontal:t,vertical:r}}_onSplitterDragStart(e){var t,r,i,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:[]),d=this._isColumn?l.vertical:l.horizontal,h=this._getMinimumDimensions((r=s.after.config.content)!==null&&r!==void 0?r:[]),p=this._isColumn?h.vertical:h.horizontal;this._splitterPosition=0,this._splitterMinPosition=-1*(((i=s.before.element[this._dimension]())!==null&&i!==void 0?i:0)-(d||a)),this._splitterMaxPosition=((o=s.after.element[this._dimension]())!==null&&o!==void 0?o:0)-(p||a)}_onSplitterDrag(e,t,r){var i=this._isColumn?r:t;this._splitterMaxPosition==null||this._splitterMinPosition==null||i>this._splitterMinPosition&&i<this._splitterMaxPosition&&(this._splitterPosition=i,e.element.css(this._isColumn?"top":"left",i))}_onSplitterDragStop(e){var t,r,i,o,s,a=this._getItemsForSplitter(e),l=(t=a.before.element[this._dimension]())!==null&&t!==void 0?t:0,d=(r=a.after.element[this._dimension]())!==null&&r!==void 0?r:0,h=(((i=this._splitterPosition)!==null&&i!==void 0?i:0)+l)/(l+d),p=((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*p,a.after.config[this._dimension]=(1-h)*p,e.element.css({top:0,left:0}),Jr(this.callDownwards.bind(this,"setSize",void 0,void 0,void 0))}}function Ji(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function eo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ji(Object(t),!0).forEach(function(r){Hr(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ji(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Hr(n,e,t){return(e=Lc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Lc(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class $r extends ge{constructor(e,t,r){super(e,eo(eo({},t),{},{type:"root"}),null,T('<div class="lm_goldenlayout lm_item lm_root"></div>')),Hr(this,"childElementContainer",void 0),Hr(this,"_containerElement",void 0),this.isRoot=!0,this.type="root",this.childElementContainer=this.element,this._containerElement=r,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 r,i;e=typeof e>"u"?(r=this._containerElement.width())!==null&&r!==void 0?r:0:e,t=typeof t>"u"?(i=this._containerElement.height())!==null&&i!==void 0?i: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,r){this.layoutManager.tabDropPlaceholder.remove(),super._$highlightDropZone(e,t,r)}_$onDrop(e,t){var r;if(Le(e)&&(r=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this),r._$init(),r.addChild(e),e=r),!this.contentItems.length)this.addChild(e);else{var{side:i}=t,o=i==="left"||i==="right"?"row":"column",s=i==="left"||i==="right"?"width":"height",a=i==="left"||i==="top",l=this.contentItems[0];if(!(l instanceof Cn)||l.type!=o){var d=this.layoutManager.createContentItem({type:o},this);this.replaceChild(l,d),d.addChild(e,a?0:void 0,!0),d.addChild(l,a?void 0:0,!0),l.config[s]=50,e.config[s]=50,d.callDownwards("setSize")}else{var h,p=l.contentItems[a?0:l.contentItems.length-1];l.addChild(e,a?0:void 0,!0),p.config[s]=((h=p.config[s])!==null&&h!==void 0?h:0)*.5,e.config[s]=p.config[s],l.callDownwards("setSize")}}}}function to(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function zt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?to(Object(t),!0).forEach(function(r){Ne(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):to(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ne(n,e,t){return(e=Fc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Fc(n){var e=Hc(n,"string");return typeof e=="symbol"?e:e+""}function Hc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ur extends ge{constructor(e,t,r){var i,o,s,a,l,d,h,p,m;super(e,t,r,T('<div class="lm_item lm_stack"></div>')),Ne(this,"_activeContentItem",null),Ne(this,"_header",void 0),Ne(this,"childElementContainer",T('<div class="lm_items"></div>')),Ne(this,"header",void 0),Ne(this,"parent",void 0),Ne(this,"isStack",!0),Ne(this,"_dropSegment",null),Ne(this,"_contentAreaDimensions",null),Ne(this,"_dropIndex",void 0),Ne(this,"_side",void 0),Ne(this,"_sided",!1),Ne(this,"config",void 0),this.parent=r,this.config=t;var v=e.config;this._side=!1,this._header={show:((i=v.settings)===null||i===void 0?void 0:i.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:(d=v.settings)!==null&&d!==void 0&&d.showCloseIcon?(h=v.labels)===null||h===void 0?void 0:h.close:void 0,minimise:(p=(m=v.labels)===null||m===void 0?void 0:m.minimise)!==null&&p!==void 0?p:void 0},v.header&&(this._header=zt(zt({},this._header),v.header)),t.header&&(this._header=zt(zt({},this._header),t.header)),t.content&&t.content[0]&&t.content[0].header&&(this._header=zt(zt({},this._header),t.content[0].header)),this.header=new pt(e,this),this.element.append(this.header.element),this.element.append(this.childElementContainer),this._setupHeaderPosition(),this._$validateClosability()}setSize(){var e,t,r,i,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=((r=this.element.width())!==null&&r!==void 0?r:0)-(this._sided?s:0),l=((i=this.element.height())!==null&&i!==void 0?i: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,t){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),Le(e)?e._$show(t):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,r=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(r-1,0)]):this._activeContentItem=null),this._$validateClosability(),this.emitBubblingEvent("stateChanged")}_$validateClosability(){for(var e=this.header._isClosable(),t=0,r=this.contentItems.length;t<r;t++){var i;if(!e)break;e=(i=this.contentItems[t].config.isClosable)!==null&&i!==void 0?i:!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",r=this._dropSegment==="left"||this._dropSegment==="right",i=this._dropSegment==="top"||this._dropSegment==="left",o=this.parent instanceof Cn&&(t&&this.parent.isColumn||r&&this.parent.isRow),s=t?"column":"row",a=t?"height":"width";if(Le(e)){var l=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this);l._$init(),l.addChild(e),e=l}if(o){var d,h=this.parent.contentItems.indexOf(this);this.parent.addChild(e,i?h:h+1,!0),this.config[a]=((d=this.config[a])!==null&&d!==void 0?d:0)*.5,e.config[a]=this.config[a],this.parent.callDownwards("setSize")}else{var p,m=this.layoutManager.createContentItem({type:s},this);(p=this.parent)===null||p===void 0||p.replaceChild(this,m),m.addChild(e,i?0:void 0,!0),m.addChild(this,i?void 0:0,!0),this.config[a]=50,e.config[a]=50,m.callDownwards("setSize")}}_$highlightDropZone(e,t){if(this._contentAreaDimensions)for(var[r,i]of Object.entries(this._contentAreaDimensions)){var o=i.hoverArea;if(o.x1<e&&o.x2>e&&o.y1<t&&o.y2>t){r==="header"?(this._dropSegment="header",this._highlightHeaderDropZone(e)):(this._resetHeaderDropZone(),this._highlightBodyDropZone(r));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 r=t.x2-t.x1,i=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+r*.25,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x1+r*.5,y2:t.y2}},this._contentAreaDimensions.top={hoverArea:{x1:t.x1+r*.25,y1:t.y1,x2:t.x1+r*.75,y2:t.y1+i*.5},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y1+i*.5}},this._contentAreaDimensions.right={hoverArea:{x1:t.x1+r*.75,y1:t.y1,x2:t.x2,y2:t.y2},highlightArea:{x1:t.x1+r*.5,y1:t.y1,x2:t.x2,y2:t.y2}},this._contentAreaDimensions.bottom={hoverArea:{x1:t.x1+r*.25,y1:t.y1+i*.5,x2:t.x1+r*.75,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1+i*.5,x2:t.x2,y2:t.y2}},super._$getArea(this.element))}_highlightHeaderDropZone(e){var t,r,i,o,s,a,l,d,h,p,m,v,f,g,b,S,w=this.header.tabs.length;if(w===0){var y,D,V,X,G,A,M,Q,W=this.header.element.offset();(y=this.layoutManager.dropTargetIndicator)===null||y===void 0||y.highlightArea({x1:(D=W==null?void 0:W.left)!==null&&D!==void 0?D:0,x2:((V=W==null?void 0:W.left)!==null&&V!==void 0?V:0)+100,y1:(X=(G=this.header.element.offset())===null||G===void 0?void 0:G.top)!==null&&X!==void 0?X:0,y2:((A=(M=this.header.element.offset())===null||M===void 0?void 0:M.top)!==null&&A!==void 0?A:0)+((Q=this.header.element.innerHeight())!==null&&Q!==void 0?Q:0)});return}var k=this.header.tabsContainer,z=(t=k.get(0))===null||t===void 0?void 0:t.getBoundingClientRect(),F=(r=this.layoutManager.tabDropPlaceholder.get(0))===null||r===void 0?void 0:r.getBoundingClientRect();if(!(!z||!F)){e<z.left?e=z.left+1:e>z.right&&(e=z.right-1);var j,H;if(!(F.left<e&&e<F.right)){for(var U=0;U<w;U++){var ce;if(j=this.header.tabs[U].element,H=(ce=j.get(0))===null||ce===void 0?void 0:ce.getBoundingClientRect(),H&&H.left<e&&e<H.right){this._dropIndex=U;break}}if(j&&H&&e<H.left+H.width*.5)j.before(this.layoutManager.tabDropPlaceholder);else if(j){var tt;this._dropIndex=Math.min(((tt=this._dropIndex)!==null&&tt!==void 0?tt:0)+1,w),j.after(this.layoutManager.tabDropPlaceholder)}}var Ge=(i=(o=this.layoutManager.tabDropPlaceholder.offset())===null||o===void 0?void 0:o.left)!==null&&i!==void 0?i:0;Ge=Math.max(Ge,(s=(a=this.header.tabsContainer.offset())===null||a===void 0?void 0:a.left)!==null&&s!==void 0?s:0);var x=Ge+((l=this.layoutManager.tabDropPlaceholder.width())!==null&&l!==void 0?l:0);x=Math.min(x,((d=(h=this.header.tabsContainer.offset())===null||h===void 0?void 0:h.left)!==null&&d!==void 0?d:0)+((p=this.header.tabsContainer.innerWidth())!==null&&p!==void 0?p:0)),(m=this.layoutManager.dropTargetIndicator)===null||m===void 0||m.highlightArea({x1:Ge,x2:x,y1:(v=(f=this.header.element.offset())===null||f===void 0?void 0:f.top)!==null&&v!==void 0?v:0,y2:((g=(b=this.header.element.offset())===null||b===void 0?void 0:b.top)!==null&&g!==void 0?g:0)+((S=this.header.element.innerHeight())!==null&&S!==void 0?S:0)})}}_resetHeaderDropZone(){this.layoutManager.tabDropPlaceholder.remove()}_setupHeaderPosition(){var e=["right","left","bottom"].some(r=>r===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,r=(t=this._contentAreaDimensions)===null||t===void 0||(t=t[e])===null||t===void 0?void 0:t.highlightArea;if(r){var i;(i=this.layoutManager.dropTargetIndicator)===null||i===void 0||i.highlightArea(r)}this._dropSegment=e}}const $c=Object.freeze(Object.defineProperty({__proto__:null,AbstractContentItem:ge,Component:fa,ContentItem:ge,Root:$r,RowOrColumn:Cn,Stack:Ur,isComponent:Le,isRoot:va,isStack:Ft},Symbol.toStringTag,{value:"Module"}));function lt(n,e,t){return(e=Uc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Uc(n){var e=Bc(n,"string");return typeof e=="symbol"?e:e+""}function Bc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class xn{constructor(e,t){var r;lt(this,"header",void 0),lt(this,"contentItem",void 0),lt(this,"element",T(xn._template)),lt(this,"titleElement",void 0),lt(this,"closeElement",void 0),lt(this,"isActive",!1),lt(this,"_layoutManager",void 0),lt(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,(r=this._layoutManager.config.settings)!==null&&r!==void 0&&r.reorderEnabled&&t.config.reorderEnabled&&(this._dragListener=new Tn(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.element.on("mouseup",this._onMouseUp),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),Le(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.element.off("mouseup",this._onMouseUp),this.closeElement.off("click",this._onCloseClick),Le(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 r;(r=this.contentItem.parent)!==null&&r!==void 0&&r.isMaximised&&this.contentItem.parent.toggleMaximise(),this._dragListener&&new Bt(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(){Le(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.element.removeClass("lm_focusin")}_onTabClick(e){if(!e||e.button===0){var t,r=this.header.parent.getActiveContentItem();this.contentItem!==r&&Le(this.contentItem)?this.header.parent.setActiveContentItem(this.contentItem):Le(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.contentItem.container._contentElement.focus(),Le(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(),Le(this.contentItem)?this.contentItem.container.close():this.header.parent.removeChild(this.contentItem)}_onMouseUp(e){e.button===1&&(e.preventDefault(),e.stopPropagation())}_onCloseMousedown(e){e.stopPropagation()}}lt(xn,"_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=Kc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Kc(n){var e=Wc(n,"string");return typeof e=="symbol"?e:e+""}function Wc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class pt extends Oe{constructor(e,t){var r,i;super(),q(this,"layoutManager",void 0),q(this,"element",T(pt._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(pt._nextButtonTemplate)),q(this,"tabPreviousButton",T(pt._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,(r=this.layoutManager.config.settings)!==null&&r!==void 0&&r.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=(i=this.layoutManager.config.settings)===null||i===void 0?void 0:i.tabControlOffset,this._createControls()}createTab(e,t){for(var r=0;r<this.tabs.length;r++)if(this.tabs[r].contentItem===e)return;var i=new xn(this,e);if(this.tabs.length===0){this.tabs.push(i),this.tabsContainer.append(i.element);return}t===void 0&&(t=this.tabs.length),t>0?this.tabs[t-1].element.after(i.element):this.tabs[0].element.before(i.element),this.tabs.splice(t,0,i),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,r,i,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[(i=this.parent.config.activeItemIndex)!==null&&i!==void 0?i:0].element.get(0))===null||t===void 0||(r=t.scrollIntoView)===null||r===void 0||r.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 r=Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX;if(e.deltaMode===WheelEvent.DOM_DELTA_PAGE){var i;r*=(i=this.tabsContainer.innerWidth())!==null&&i!==void 0?i:1}else e.deltaMode===WheelEvent.DOM_DELTA_LINE&&(r*=100/3);t.scrollLeft+=Math.round(r)}}_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 r,i,o,s,a;if(((r=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&r!==void 0?r: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 d,h;l.scrollLeft=(d=(h=this.tabsContainer.get(0))===null||h===void 0?void 0:h.scrollWidth)!==null&&d!==void 0?d:0}}}_handlePreviousButtonMouseDown(){for(var e,t=this.tabs.length-1;t>=0;t-=1){var r,i,o;if(((r=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&r!==void 0?r: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,r;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)===((r=this.tabsContainer.get(0))===null||r===void 0?void 0:r.scrollWidth)?this.tabNextButton.prop("disabled",!0):(this.tabNextButton.prop("disabled",!1),this.tabPreviousButton.first().prop("disabled",!1))}_handleScrollRepeat(e,t){var r,i=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-i),this.isDraggingTab&&this.parent._highlightHeaderDropZone(a.left-1),this.tabsContainer.scrollLeft()===0){this._checkScrollArrows();return}}else if(e===this.SCROLL_RIGHT){var l,d;if(this.tabsContainer.scrollLeft(t+i),this.isDraggingTab&&this.parent._highlightHeaderDropZone(a.right+1),((l=this.tabsContainer.scrollLeft())!==null&&l!==void 0?l:0)+((d=this.tabsContainer.innerWidth())!==null&&d!==void 0?d:0)===s.scrollWidth){this._checkScrollArrows();return}}window.cancelAnimationFrame((r=this.rAF)!==null&&r!==void 0?r:-1),this.rAF=window.requestAnimationFrame(h=>{var p,m,v=o||h,f=h-v,g=this.START_SPEED*f+.5*this.ACCELERATION*(f*f);g=Math.min(g,(p=(m=this.tabsContainer.get(0))===null||m===void 0?void 0:m.scrollWidth)!==null&&p!==void 0?p:1/0),this._handleScrollRepeat(e,t,g,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,r,i,o;if(o=this.layoutManager.config.labels.tabDropdown,this.layoutManager.config.labels.tabNextLabel,this.layoutManager.config.labels.tabPreviousLabel,this.tabDropdownButton=new pn(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),r=this._getHeaderSetting("popout"),new pn(this,r,"lm_popout",t)),this._getHeaderSetting("maximise")){i=this.parent.toggleMaximise.bind(this.parent);var s=this._getHeaderSetting("maximise"),a=this._getHeaderSetting("minimise"),l=new pn(this,s,"lm_maximise",i);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),r=this._getHeaderSetting("close"),this.closeButton=new pn(this,r,"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,d){if(d==null||d.length<2)return-1;for(var h=(a+l+d.length)%d.length;h!==a;){if(d.eq(h).css("display")!=="none")return h;h=(h+l+d.length)%d.length}return a}if(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1){var r,i;e.preventDefault(),(r=this.tabDropdownList)===null||r===void 0||r.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=t(this.dropdownKeyIndex,1,this.tabDropdownList),(i=this.tabDropdownList)===null||i===void 0||i.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 r,i;((r=(i=this.tabs[t].contentItem.config.title)===null||i===void 0?void 0:i.toLowerCase().indexOf(e.target.value.toLowerCase()))!==null&&r!==void 0?r:-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,r;this.isDropdownShown&&(e&&(t=this.tabDropdownContainer.get(0))!==null&&t!==void 0&&t.contains(e.target)||e&&((r=this.tabDropdownButton)===null||r===void 0?void 0:r.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,r,i;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=(r=T(window).height())!==null&&r!==void 0?r:0,l=(i=T(window).width())!==null&&i!==void 0?i:0;if(this.tabDropdownButton){var d=this.tabDropdownButton.element[0].getBoundingClientRect(),h=o<a-d.bottom,p=!h&&d.bottom>a*.6,m=Math.min(d.left+(p?d.width:0),l-s.width-this.PADDING),v=p?Math.max(d.top-o,this.PADDING):d.bottom,f=a-v-this.PADDING;this.tabDropdownContainer.css({"max-height":f,top:v,left:m})}}}}_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 r;(r=this.tabDropdownButton)===null||r===void 0||r.element.hide(),this.tabNextButton.hide(),this.tabPreviousButton.hide(),this.isOverflowing=!1}this.isOverflowing&&this._checkScrollArrows()}}}}q(pt,"_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(pt,"_previousButtonTemplate",['<ul class="lm_controls">','<li class="lm_tabpreviousbutton"></li>',"</ul>"].join(""));q(pt,"_nextButtonTemplate",['<li class="lm_tabnextbutton"></li>'].join(""));function cn(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=Vc(n,"string");return typeof e=="symbol"?e:e+""}function Vc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ga{constructor(e,t,r){cn(this,"_isVertical",void 0),cn(this,"_size",void 0),cn(this,"_grabSize",void 0),cn(this,"_dragListener",void 0),cn(this,"element",void 0),this._isVertical=e,this._size=t,this._grabSize=r<t?t:r,this.element=this._createElement(),this._dragListener=new Tn(this.element)}on(e,t,r){var i;(i=this._dragListener)===null||i===void 0||i.on(e,t,r)}_$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 r=this._grabSize-this._size,i=r/2;return this._isVertical?(e.css("top",-i),e.css("height",this._size+r),t.addClass("lm_vertical"),t.height(this._size)):(e.css("left",-i),e.css("width",this._size+r),t.addClass("lm_horizontal"),t.width(this._size)),t}}const Gc=Object.freeze(Object.defineProperty({__proto__:null,BrowserPopout:ha,DragProxy:Bt,DragSource:ca,DragSourceFromEvent:ma,DropTargetIndicator:On,Header:pt,HeaderButton:pn,Splitter:ga,Tab:xn},Symbol.toStringTag,{value:"Module"}));var qc={config:qh,container:Jh,controls:Gc,errors:Ic,items:$c,utils:mc};function no(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function xe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?no(Object(t),!0).forEach(function(r){Z(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):no(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Z(n,e,t){return(e=Xc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Xc(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ro=["column","row","stack","component"];class ri extends Oe{static isLayoutItemConfig(e){return ro.includes(e.type)}static minifyConfig(e){return ti(e)}static unminifyConfig(e){return Rr(e)}constructor(e,t){super(),Z(this,"isInitialised",!1),Z(this,"_isFullPage",!1),Z(this,"_resizeTimeoutId",void 0),Z(this,"_components",{"lm-react-component":oa}),Z(this,"_fallbackComponent",void 0),Z(this,"_itemAreas",[]),Z(this,"_maximisedItem",null),Z(this,"_maximisePlaceholder",T('<div class="lm_maximise_place"></div>')),Z(this,"_creationTimeoutPassed",!1),Z(this,"_subWindowsCreated",!1),Z(this,"_dragSources",[]),Z(this,"_updatingColumnsResponsive",!1),Z(this,"_firstLoad",!0),Z(this,"_reactChildMap",new Map),Z(this,"_reactChildren",null),Z(this,"_initialHeaderHeight",void 0),Z(this,"width",null),Z(this,"height",null),Z(this,"root",void 0),Z(this,"openPopouts",[]),Z(this,"selectedItem",null),Z(this,"isSubWindow",!1),Z(this,"eventHub",new sa(this)),Z(this,"config",void 0),Z(this,"container",void 0),Z(this,"_originalContainer",void 0),Z(this,"dropTargetIndicator",null),Z(this,"tabDropPlaceholder",T('<div class="lm_drop_tab_placeholder"></div>')),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._windowKeydown=this._windowKeydown.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")}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 r=()=>{if(this._components[e]===void 0)throw new Error("Component "+e+" is not registered");delete this._components[e]};return r}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:xe({},this.config.settings),dimensions:xe({},this.config.dimensions),labels:xe({},this.config.labels),content:[]},r=function(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 d=0;d<a.contentItems.length;d++)s.content[d]={},r(s.content[d],a.contentItems[d])}};e?r(t,{contentItems:[e]}):r(t,this.root),this._$reconcilePopoutWindows(),t.openPopouts=[];for(var i=0;i<this.openPopouts.length;i++)t.openPopouts.push(this.openPopouts[i].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 On,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 r=this._reactChildMap.get(e);r===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 r,i;if(this.width=(r=e??this.container.width())!==null&&r!==void 0?r:0,this.height=(i=t??this.container.height())!==null&&i!==void 0?i: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"),T(window).off("keydown",this._windowKeydown),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 r,i;if(typeof e.type!="string")throw new Lt("Missing parameter 'type'",e);if(e.type==="react-component"&&(e.type="component",e.componentName="lm-react-component"),!ri.isLayoutItemConfig(e))throw i="Unknown type '"+e.type+"'. Valid types are "+ro.join(","),new Lt(i);return e.type==="component"&&!(t instanceof Ur)&&t&&!(this.isSubWindow===!0&&t instanceof $r)&&(e={type:"stack",width:e.width,height:e.height,content:[e]}),e.id=(r=e.id)!==null&&r!==void 0?r:qn(),e.type==="stack"?new Ur(this,e,t):e.type==="row"?new Cn(!1,this,e,t):e.type==="column"?new Cn(!0,this,e,t):new fa(this,e,t)}createPopout(e,t,r,i){var o=[],s=e instanceof ge,a=this;if(s){var l;o=this.toConfig(e).content,r=qn();for(var d=e.parent,h=e;((p=d)===null||p===void 0?void 0:p.contentItems.length)===1&&!d.isRoot;){var p;h=d,d=d.parent}if((l=d)===null||l===void 0||l.addId(r),i==null||Number.isNaN(i)){var m;i=(m=d)===null||m===void 0?void 0:m.contentItems.indexOf(h)}}else e instanceof Array?o=e:o=[e];if(!t&&s){var v,f,g,b=window.screenX||window.screenLeft,S=window.screenY||window.screenTop,w=(v=e.element.offset())!==null&&v!==void 0?v:{left:0,top:0};t={left:b+w.left,top:S+w.top,width:(f=e.element.width())!==null&&f!==void 0?f:0,height:(g=e.element.height())!==null&&g!==void 0?g: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||!r||i===void 0)){var y=new ha(o,t,r,i,this);return y.on("initialised",function(){a.emit("windowOpened",y)}),y.on("closed",function(){a._$reconcilePopoutWindows()}),this.openPopouts.push(y),y}}createDragSource(e,t){this.config.settings.constrainDragToContainer=!1;var r=new ca(e,t,this);return this._dragSources.push(r),r}createDragSourceFromEvent(e,t){return this.config.settings.constrainDragToContainer=!1,new ma(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,r;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((r=this.container.height())!==null&&r!==void 0?r: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 r=1/0,i=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&&r>s.surface&&(r=s.surface,i=s)}return i}_$createRootItemAreas(){var e=50,t=xe({},this.root._$getArea()),r=[xe(xe({},t),{},{side:"left",x2:t.x1+e}),xe(xe({},t),{},{side:"right",x1:t.x2-e}),xe(xe({},t),{},{side:"top",y2:t.y1+e}),xe(xe({},t),{},{side:"bottom",y1:t.y2-e})];r.forEach(i=>{i.surface=(i.x2-i.x1)*(i.y2-i.y1)}),this._itemAreas.push(...r)}_$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 r=e[t];if(Ft(r)){var i=r._$getArea();if(i!==null)if(i instanceof Array)this._itemAreas=this._itemAreas.concat(i);else{var o;this._itemAreas.push(i);var s=xe(xe({},i),(o=i.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 r=this.createContentItem(e,t??null);return r.callDownwards("_$init"),r}else throw new Error("Invalid contentItem")}_$reconcilePopoutWindows(){for(var e=[],t=0;t<this.openPopouts.length;t++){var r;((r=this.openPopouts[t].getWindow())===null||r===void 0?void 0:r.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=r=>{if(e.push(r),r.contentItems instanceof Array)for(var i=0;i<r.contentItems.length;i++)t(r.contentItems[i])};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).on("keydown",this._windowKeydown)}_windowBlur(){this.root.element.addClass("lm_window_blur")}_windowFocus(){this.root.element.removeClass("lm_window_blur")}_windowKeydown(e){if(e.key==="Escape"&&this._maximisedItem!==null){var t=document.activeElement;if(t&&(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.tagName==="SELECT"||t.isContentEditable))return;this._maximisedItem.toggleMaximise()}}_onResize(){clearTimeout(this._resizeTimeoutId),this._resizeTimeoutId=window.setTimeout(this.updateSize.bind(this),100)}_createConfig(e){var t,r=ia("gl-window");r&&(this.isSubWindow=!0,e=JSON.parse(localStorage.getItem(r)||"{}"),e=Rr(e),localStorage.removeItem(r)),e=T.extend(!0,{},ea,e);var i=function(s){for(var a in s){var l=s[a];a!=="props"&&typeof l=="object"&&l!=null?i(l):a==="type"&&l==="react-component"&&(s.type="component",s.componentName="lm-react-component")}};return i(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=ei((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 Lt(t,e);if(e.content.length>1)throw t="Top level content can't contain more then one element.",new Lt(t,e);this.root=new $r(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,r=e*t;if(!(this.width==null||r<=this.width)){this._updatingColumnsResponsive=!0;for(var i=Math.max(Math.floor(this.width/t),1),o=e-i,s=this.root.contentItems[0],a=this._findAllStackContainers()[0],l=0;l<o;l++){var d=s.contentItems[s.contentItems.length-1];this._addChildContentItemsToContainer(a,d)}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(r){e.addChild(r),t.removeChild(r,!0)}):t.contentItems.forEach(r=>{this._addChildContentItemsToContainer(e,r)})}_findAllStackContainers(){var e=[];return this._findAllStackContainersRecursive(e,this.root),e}_findAllStackContainersRecursive(e,t){t.contentItems.forEach(r=>{Ft(r)?e.push(r):r.isComponent||this._findAllStackContainersRecursive(e,r)})}}Z(ri,"__lm",qc);const io={"tab-height":"28px","drag-border-width":"5px"},oo=Object.freeze({tabHeight:parseInt(io["tab-height"],10),dragBorderWidth:parseInt(io["drag-border-width"],10)});function so(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function st(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?so(Object(t),!0).forEach(function(r){ba(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):so(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ba(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var yt=R.module("LayoutUtils");function ya(n){return n.componentName!==void 0}function _t(n){var e=n;return(ya(n)&&n.componentName==="lm-react-component"||n.type==="react-component")&&e.component!==void 0}function Ln(n){return n.focus!==void 0}function ao(n){return n.type==="stack"}class E{static activateTab(e,t){var r=E.getStackForRoot(e,t,!1);if(!r){yt.error("Could not find stack for config",t);return}var i=E.getContentItemInStack(r,t);i&&r.setActiveContentItem(i)}static isActiveTab(e,t){var r=E.getStackForRoot(e,t,!1);if(!r)return yt.error("Could not find stack for config",t),!1;var i=E.getContentItemInStack(r,t),o=r.getActiveContentItem();return o===i}static addStack(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(va(e)){var r={type:t?"column":"row"};(e.contentItems==null||e.contentItems.length===0)&&e.addChild(r);var i=e.contentItems[0],o=t?i.isColumn:i.isRow;if(!o){e.removeChild(i,!0),e.addChild(r);var s=document.activeElement;e.contentItems[0].addChild(i),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;if(!l){var d,h,p=e.layoutManager.createContentItem({type:t?"row":"column",height:(d=a.config)===null||d===void 0?void 0:d.height,width:(h=a.config)===null||h===void 0?void 0:h.width},e);e.replaceChild(a,p),e.contentItems[e.contentItems.length-1].addChild(a),a=e.contentItems[e.contentItems.length-1]}return this.addStack(a,!t)}static getAllStackContainers(e){return e._findAllStackContainers()}static getFocusedStackIndex(e){return e.findIndex(t=>t.header.tabs.some(r=>r.element[0].classList.contains("lm_focusin")))}static getFocusedStack(e){var t=E.getAllStackContainers(e),r=E.getFocusedStackIndex(t);return t[r]}static getStackById(e,t){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(i&&Ft(e)&&e.contentItems.length===0)return e;if(t===((r=e.config)===null||r===void 0?void 0:r.id)){if(Ft(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,i);if(s)return s}return null}static getContentItemById(e,t){var r;if(((r=e.config)===null||r===void 0?void 0:r.id)===t)return e;if(e.contentItems==null)return null;for(var i=0;i<e.contentItems.length;i+=1){var o=this.getContentItemById(e.contentItems[i],t);if(o)return o}return null}static getStackForConfig(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(r&&Ft(e)&&e.contentItems.length===0)return e;if(e.contentItems==null)return null;for(var i=0;i<e.contentItems.length;i+=1){var o=e.contentItems[i];if(o.isComponent&&o.config!=null&&mi(o.config,t))return e;var s=this.getStackForConfig(o,t,r);if(s)return s}return null}static getStackForRoot(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=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&&i&&(s=this.getStackForConfig(e,{component:t.component},o)),!s&&r&&(s=this.addStack(e)),s}static getStackForComponentTypes(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=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,d=E.getStackForRoot(e,{component:a},r&&l,i,o);if(d)return d}return null}static getContentItemInStack(e,t){if(!e)return null;for(var r=0;r<e.contentItems.length;r+=1){var i=e.contentItems[r];if(i.isComponent&&i.config!=null&&mi(i.config,t))return i}return null}static dehydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var r=[],i=0;i<e.length;i+=1){var o=e[i],{content:s}=o;if(_t(o)){var a=t(o.component,o);a!=null?r.push(a):yt.debug2('dehydrateLayoutConfig: skipping unmapped component "'.concat(o.component,'"'))}else if(s){var l=st(st({},o),{},{content:E.dehydrateLayoutConfig(s,t)});r.push(l)}else r.push(o)}return r}static getTabPoint(e){var{tab:t}=e;if(t==null)throw new Error("Cannot get tab for panel container ".concat(e));var r=t.element[0].getBoundingClientRect();return[r.left+r.width*.5,r.bottom-8]}static dropLayoutMinorChange(e){for(var t=0;t<e.length;t+=1){var r=e[t],{content:i}=r;i!==void 0?(ao(r)&&delete r.activeItemIndex,E.dropLayoutMinorChange(i)):_t(r)&&r.component==="IrisGridPanel"&&r.props.panelState!=null&&(delete r.id,r.props.panelState.irisGridState.sorts=[],r.props.panelState.irisGridState.quickFilters=[],r.props.panelState.gridState.isStuckToBottom=!1,r.props.panelState.gridState.isStuckToRight=!1)}}static isEqual(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=E.cloneLayout(e),o=E.cloneLayout(t);return r?(E.dropLayoutMinorChange(i),E.dropLayoutMinorChange(o),xr(i,o)):xr(i,o)}static cloneLayout(e){return JSON.parse(JSON.stringify(e))}static hydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var r=[],i=0;i<e.length;i+=1){var o=e[i];if(_t(o)){var s,{component:a,props:l={}}=o;r.push(st(st({},o),{},{id:(s=o==null?void 0:o.id)!==null&&s!==void 0?s:ct(),props:t(a,l)}))}else if(o.content!==void 0){var d=E.hydrateLayoutConfig(o.content,t);ao(o)&&o.activeItemIndex!=null&&o.activeItemIndex>=d.length&&(yt.warn("Fixing bad activeItemIndex!",o.activeItemIndex,o),o.activeItemIndex=0),r.push(st(st({},o),{},{content:d}))}else r.push(o)}return r}static openComponent(){var{root:e,config:t,stack:r=void 0,replaceExisting:i=!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]:{},d=document.activeElement,h=st({},t);if(h.id==null&&(h.id=ct()),l!=null){e==null||e.layoutManager.createDragSourceFromEvent(h,l);return}var p=o||{id:h.id,component:h.component};L(e);var m=r??(s?E.addStack(e):E.getStackForRoot(e,p));L(m);var v=E.getContentItemInStack(m,p);if(a!=null){var f=b=>{yt.debug("Component created, focusing element",a),m.off("componentCreated",f);var{element:S}=b.origin;requestAnimationFrame(()=>{E.focusElement(S[0],a)})};m.on("componentCreated",f)}if(i&&v){var g=m.contentItems.indexOf(v);m.addChild(h,g+1),m.removeChild(v),m.setActiveContentItem(m.contentItems[g])}else m.addChild(h);a==null&&d&&Ln(d)&&d.focus()}static openComponentInStack(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=document.activeElement,o={id:t.id},s=E.getContentItemInStack(e,o);if(r&&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);i&&Ln(i)&&i.focus()}static closeComponent(e,t,r){var i=E.getStackForRoot(e,t,!1,!1,!1);if(!i){yt.warn("Cannot find stack for component, ignoring close",t);return}var o=E.getContentItemInStack(i,t),s=document.activeElement;o&&(Le(o)?o.container.close(r):i.removeChild(o)),s&&document.contains(s)&&Ln(s)&&s.focus()}static renameComponent(e,t,r){var i=E.getStackForRoot(e,t,!1);if(!i){yt.error("Could not find stack for config",t);return}var o=E.getContentItemInStack(i,t);o&&o.setTitle(r)}static cloneComponent(e,t){var r=E.getStackForRoot(e,t,!1);if(!r)return yt.error("Could not find stack for config",t),null;var{props:i={}}=t,o=E.getPanelComponentState(t),s={type:"react-component",component:t.component,props:st(st({},i),{},{panelState:o}),title:"".concat(t.title," Copy"),id:ct()};return E.openComponentInStack(r,s),s}static getPanelComponentState(e){if(ya(e)){var t;return(t=e.componentState)===null||t===void 0?void 0:t.panelState}if(_t(e)){var r;return(r=e.props)===null||r===void 0?void 0:r.panelState}return null}static makeDefaultLayout(){return{dimensions:{headerHeight:oo.tabHeight,borderWidth:oo.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=E.getComponentConfigFromContainer(e);return t?t.id:null}static getIdFromPanel(e){var{glContainer:t}=e.props;return E.getIdFromContainer(t)}static getComponentNameFromPanel(e){var{glContainer:t}=e.props,r=E.getComponentConfigFromContainer(t);if(r&&_t(r)){var i;return(i=r.component)!==null&&i!==void 0?i:null}return null}static getComponentName(e){var t,r,i=(t=(r=e.WrappedComponent)===null||r===void 0?void 0:r.displayName)!==null&&t!==void 0?t:e.displayName;if(i==null)throw new Error("Component displayName not defined ".concat(e));return i}static focusElement(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:E.DEFAULT_FOCUS_SELECTOR;if(e==null)return null;var r=e.querySelector(t);return r==null?null:(Ln(r)&&r.focus(),r)}static onInitialized(e){return new Promise(t=>{if(e.isInitialised){t();return}var r=()=>{e.off("initialised",r),t()};e.on("initialised",r)})}}ba(E,"DEFAULT_FOCUS_SELECTOR","input, select, textarea, button");var Jc=O.forwardRef((n,e)=>{var t=E.getComponentNameFromPanel({props:n});return u.jsx("div",{ref:e,className:"panel-placeholder",children:u.jsxs("div",{children:['Component "',t,'" is not registered.']})})});Jc.displayName="PanelPlaceholder";var Y=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"}),{listen:_g,emit:em,useListener:Eg}=xt(Y.OPEN),lr=Object.freeze({CYCLE_TO_NEXT_STACK:"NavigationEvent.CYCLE_TO_NEXT_STACK",CYCLE_TO_PREVIOUS_STACK:"NavigationEvent.CYCLE_TO_PREVIOUS_STACK",CYCLE_TO_NEXT_TAB:"NavigationEvent.CYCLE_TO_NEXT_TAB",CYCLE_TO_PREVIOUS_TAB:"NavigationEvent.CYCLE_TO_PREVIOUS_TAB"}),{listen:tm,emit:Pg,useListener:Tg}=xt(lr.CYCLE_TO_NEXT_STACK),{listen:nm,emit:Og,useListener:xg}=xt(lr.CYCLE_TO_PREVIOUS_STACK),{listen:rm,emit:Ig,useListener:Dg}=xt(lr.CYCLE_TO_NEXT_TAB),{listen:im,emit:Mg,useListener:kg}=xt(lr.CYCLE_TO_PREVIOUS_TAB);function lo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function uo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?lo(Object(t),!0).forEach(function(r){ut(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):lo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ut(n,e,t){return(e=om(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function om(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ue=R.module("PanelManager"),jt=function(n){return n[n.Next=0]="Next",n[n.Previous=1]="Previous",n}(jt||{});class Ca{constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:(a,l)=>l,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(a,l)=>l,i=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]:()=>{};ut(this,"layout",void 0),ut(this,"hydrateComponent",void 0),ut(this,"dehydrateComponent",void 0),ut(this,"onPanelsUpdated",void 0),ut(this,"closed",void 0),ut(this,"openedMap",void 0),ut(this,"navigationEventListenerRemovers",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.handleCycleToNextStack=this.handleCycleToNextStack.bind(this),this.handleCycleToPreviousStack=this.handleCycleToPreviousStack.bind(this),this.handleCycleToNextTab=this.handleCycleToNextTab.bind(this),this.handleCycleToPreviousTab=this.handleCycleToPreviousTab.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=r,this.onPanelsUpdated=s,this.openedMap=new Map(i),this.closed=[...o],this.navigationEventListenerRemovers=[],this.startListening()}startListening(){var{eventHub:e}=this.layout;e.on(Y.FOCUS,this.handleFocus),e.on(Y.MOUNT,this.handleMount),e.on(Y.UNMOUNT,this.handleUnmount),e.on(Y.REOPEN,this.handleReopen),e.on(Y.REOPEN_LAST,this.handleReopenLast),e.on(Y.DELETE,this.handleDeleted),e.on(Y.CLOSED,this.handleClosed),e.on(Y.CLOSE,this.handleControlClose),this.navigationEventListenerRemovers.push(tm(e,this.handleCycleToNextStack)),this.navigationEventListenerRemovers.push(nm(e,this.handleCycleToPreviousStack)),this.navigationEventListenerRemovers.push(rm(e,this.handleCycleToNextTab)),this.navigationEventListenerRemovers.push(im(e,this.handleCycleToPreviousTab))}stopListening(){var{eventHub:e}=this.layout;e.off(Y.FOCUS,this.handleFocus),e.off(Y.MOUNT,this.handleMount),e.off(Y.UNMOUNT,this.handleUnmount),e.off(Y.REOPEN,this.handleReopen),e.off(Y.REOPEN_LAST,this.handleReopenLast),e.off(Y.DELETE,this.handleDeleted),e.off(Y.CLOSED,this.handleClosed),e.off(Y.CLOSE,this.handleControlClose),this.navigationEventListenerRemovers.forEach(t=>t()),this.navigationEventListenerRemovers=[]}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 E.getComponentConfigFromContainer(t)})}getOpenedPanelConfigsOfType(e){return this.getOpenedPanelConfigs().filter(t=>t!=null&&_t(t)&&t.component===e)}getOpenedPanelById(e){return this.openedMap.get(e)}getContainerByPanelId(e){var t,r=E.getStackForConfig(this.layout.root,{id:e});return(t=r&&E.getContentItemInStack(r,{id:e}))!==null&&t!==void 0?t:null}getLastUsedPanel(e){for(var t=this.getOpenedPanels(),r=t.length-1;r>=0;r-=1){var i=t[r];if(e==null||e(i))return i}}getLastUsedPanelOfType(e){return this.getLastUsedPanelOfTypes([e])}getLastUsedPanelOfTypes(e){return this.getLastUsedPanel(t=>e.some(r=>Gn(r)&&t instanceof r.WrappedComponent||!Gn(r)&&t instanceof r))}updatePanel(e){var t=E.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=E.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(r=>r===e||r.id!=null&&e.id!=null&&r.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()}cycleStack(e){var t=E.getAllStackContainers(this.layout);if(!(t.length<=1)){var r=E.getFocusedStackIndex(t);if(r===-1){var i=t[0],o=i.config.activeItemIndex,s=o!=null?i.contentItems[o]:i.contentItems[0];i.setActiveContentItem(s,!0);return}var a=e===jt.Next?(r+1)%t.length:(r-1+t.length)%t.length,l=t[a],d=l.config.activeItemIndex,h=d!=null?l.contentItems[d]:l.contentItems[0];l.setActiveContentItem(h,!0)}}handleCycleToNextStack(){this.cycleStack(jt.Next)}handleCycleToPreviousStack(){this.cycleStack(jt.Previous)}cycleTab(e){var t,r=E.getFocusedStack(this.layout);if(r!==void 0){var{contentItems:i}=r;if(!(i.length<=1)){var o=(t=r.config.activeItemIndex)!==null&&t!==void 0?t:0,s=e===jt.Next?(o+1)%i.length:(o-1+i.length)%i.length,a=i[s];r.setActiveContentItem(a,!0)}}}handleCycleToNextTab(){this.cycleTab(jt.Next)}handleCycleToPreviousTab(){this.cycleTab(jt.Previous)}handleReopen(e,t){Ue.debug2("Reopen:",e,t),this.removeClosedPanelConfig(e);var{component:r}=e,{props:i}=e;i=this.hydrateComponent(r,i);var o=uo(uo({},e),{},{props:i}),{root:s}=this.layout,a=e.parentStackId===void 0?void 0:E.getStackById(s,e.parentStackId);E.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 r=(t=E.getStackForConfig(this.layout.root,e.getConfig()))===null||t===void 0?void 0:t.config.id,i=this.closed.length-1;i>=0;i-=1){var o=this.closed[i];if(o.parentStackId===r){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:r}=this.layout;E.closeComponent(r,t)}addClosedPanel(e){var t=E.getComponentConfigFromContainer(e);if(t&&_t(t)){var r=this.dehydrateComponent(t.component,t);if(r!=null){var i;r.parentStackId=(i=e.tab)===null||i===void 0?void 0:i.header.parent.config.id,this.closed.push(r)}}}sendUpdate(){var{closed:e,openedMap:t}=this;this.onPanelsUpdated({closed:[...e],openedMap:new Map(t)})}}ut(Ca,"MAX_CLOSED_PANEL_COUNT",100);var am=R.module("PanelErrorBoundary");class lm 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,r=E.getIdFromContainer(e);am.debug("componentWillUnmount",r),t.emit(Y.CLOSED,r,e)}render(){var{children:e}=this.props,{error:t}=this.state;return t!=null?u.jsx("div",{className:"panel-error-boundary",children:u.jsx(Sn,{"data-testid":"panel-error-boundary-loading-error",errorMessage:"".concat(t),isLoading:!1,isLoaded:!1})}):e??null}}function ho(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Zn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ho(Object(t),!0).forEach(function(r){dm(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ho(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function dm(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function wa(n){var{props:e,componentState:t}=n,{metadata:r}=e,{panelState:i=null}=e;t&&({panelState:i}=t);var o={};return r!=null&&(o.metadata=r),i!=null&&(o.panelState=i),Zn(Zn({},n),{},{componentState:null,props:o,type:"react-component"})}function Sa(n,e){return Zn(Zn({},n),{},{localDashboardId:e})}const jg={dehydrate:wa,hydrate:Sa};var _a=O.createContext(void 0);_a.displayName="LayoutManagerContext";var cm=ae.shape({on:ae.func,off:ae.func,isHidden:ae.bool,tab:ae.shape({header:ae.shape({tabs:ae.arrayOf(ae.shape({contentItem:ae.shape({})}))})}),title:ae.string,setTitle:ae.func,close:ae.func}),Ea=ae.shape({on:ae.func,off:ae.func,emit:ae.func}),mm=ae.shape({registerComponent:ae.func,root:ae.shape({addChild:ae.func}),on:ae.func,off:ae.func,eventHub:Ea}),Ng=Object.freeze({Container:cm,EventHub:Ea,Layout:mm});function Vt(n,e,t){c.useEffect(function(){return n.on(e,t),()=>{n.off(e,t)}},[n,e,t])}var Pa="SET_DASHBOARD_DATA";const pm=hh(Pa,{},!1),vm={dashboardData:pm};var fm=new Map,Ta=Object.freeze({}),gm=Object.freeze([]),Ag=ys,Lg=bs,Rg=$l,bm=n=>n.dashboardData,Ce=(n,e)=>{var t;return(t=bm(n)[e])!==null&&t!==void 0?t:Ta},Fg=(n,e)=>{var t;return(t=Ce(n,e).closed)!==null&&t!==void 0?t:gm},Hg=(n,e)=>{var t;return(t=Ce(n,e).openedMap)!==null&&t!==void 0?t:fm},Oa=(n,e)=>{var t;return(t=Ce(n,e).pluginDataMap)!==null&&t!==void 0?t:Ta},$g=(n,e,t)=>Oa(n,e)[t];function co(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Yt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?co(Object(t),!0).forEach(function(r){ym(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):co(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ym(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=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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var xa=(n,e)=>({type:Pa,id:n,payload:e}),Sm=(n,e)=>(t,r)=>t(xa(n,Yt(Yt({},Ce(r(),n)),e))),Ug=(n,e,t)=>(r,i)=>r(xa(n,Yt(Yt({},Ce(i(),n)),{},{pluginDataMap:Yt(Yt({},Oa(i(),n)),{},{[e]:t})})));Object.entries(vm).map(n=>{var[e,t]=n;return vh.register(e,t)});function _m(n){var{children:e}=n;return u.jsx(u.Fragment,{children:e})}var ii=c.createContext(null);ii.displayName="PanelIdContext";function Em(){return c.useContext(ii)}function mo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function mn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?mo(Object(t),!0).forEach(function(r){Pm(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):mo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Pm(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Rn=R.module("DashboardLayout"),xm=Object.freeze({}),Im=[],po=()=>{},Dm=1e3,vo=n=>n;function Bg(n){var e,t,{id:r,children:i,emptyDashboard:o=u.jsx("div",{children:"Dashboard is empty."}),layout:s,layoutConfig:a=Im,onLayoutChange:l=po,onLayoutInitialized:d=po,hydrate:h=Sa,dehydrate:p=wa,panelWrapper:m=_m}=n,v=ys(),f=(e=bs(x=>Ce(x,r)))!==null&&e!==void 0?e:xm,[g,b]=c.useState(!1),[S,w]=c.useState(!1),[y,D]=c.useState(),[V]=c.useState((t=f==null?void 0:f.closed)!==null&&t!==void 0?t:[]),[X,G]=c.useState(s.getReactChildren()),A=c.useMemo(()=>new Map,[]),M=c.useMemo(()=>new Map,[]),Q=c.useCallback(function(x,J){var oe,un=arguments.length>2&&arguments[2]!==void 0?arguments[2]:h,gt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:p;Rn.debug2("registerComponent",x,J,un,gt);function Mn(K,ne){var pe=J,ke=m,Dt=As(pe),{glContainer:Kt,glEventHub:Ga}=K,qa=E.getIdFromContainer(Kt);return u.jsx(lm,{glContainer:Kt,glEventHub:Ga,children:u.jsx(ii.Provider,{value:qa,children:u.jsx(ke,mn(mn({},K),{},{children:Dt?u.jsx(pe,mn(mn({},K),{},{ref:ne})):u.jsx(pe,mn({},K))}))})})}Mn.displayName="DashboardWrapper(".concat((oe=J.displayName)!==null&&oe!==void 0?oe:x,")");var P=s.registerComponent(x,O.forwardRef(Mn));return A.set(x,un),M.set(x,gt),P},[h,p,A,M,s,m]),W=c.useCallback((x,J)=>{var oe;return((oe=A.get(x))!==null&&oe!==void 0?oe:vo)(J,r)},[A,r]),k=c.useCallback((x,J)=>{var oe;return((oe=M.get(x))!==null&&oe!==void 0?oe:vo)(J,r)},[M,r]),z=c.useMemo(()=>new Ca(s,W,k,new Map,V,x=>{var{closed:J,openedMap:oe}=x;v(Sm(r,{closed:J,openedMap:oe}))}),[k,v,W,r,V,s]),F=jd(x=>{var J=y==null||!E.isEqual(y,x);Rn.debug("handleLayoutStateChanged",J,x),J&&(b(s.root.contentItems.length===0),D(x),l(x),G(s.getReactChildren()))},Dm,{flushOnUnmount:!0});c.useEffect(()=>()=>F.flush(),[F]);var j=c.useCallback(()=>{if(!S){var x=s.toConfig(),J=x.content,oe=E.dehydrateLayoutConfig(J,k);F(oe)}},[k,S,s,F]),H=c.useCallback(x=>{var J=E.getIdFromContainer(x);s.eventHub.emit(Y.DRAGGING,J),w(!0)},[s.eventHub]),U=c.useCallback(x=>{var J=E.getIdFromContainer(x);s.eventHub.emit(Y.DROPPED,J),w(!1)},[s.eventHub]),ce=c.useCallback(x=>{if(Rn.debug2("handleComponentCreated",x),!(x==null||x.config==null||!_t(x.config)||x.config.component==null||x.element==null)){var J=x.config.component.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),oe="".concat(J,"-component");x.element.addClass(oe)}},[]),tt=c.useCallback(()=>{G(s.getReactChildren())},[s]);Vt(s,"stateChanged",j),Vt(s,"itemPickedUp",H),Vt(s,"itemDropped",U),Vt(s,"componentCreated",ce),Vt(s.eventHub,Y.TITLE_CHANGED,j),Vt(s,"reactChildrenChanged",tt);var Ge=kd(a);return c.useEffect(function(){if(Ge!==a&&a!==y){Rn.debug("Setting new layout content...");for(var J=E.hydrateLayoutConfig(a,W);s.root.contentItems.length>0;)s.root.contentItems[0].remove();for(var oe=0;oe<J.length;oe+=1)s.root.addChild(J[oe]);b(s.root.contentItems.length===0)}},[W,s,a,y,z,Ge]),c.useEffect(()=>d(),[]),u.jsxs(u.Fragment,{children:[g&&o,X,O.Children.map(i,x=>x!=null?u.jsx(Tu,{fallback:[],children:O.cloneElement(x,{id:r,layout:s,panelManager:z,registerComponent:Q})}):null)]})}var Ia=c.createContext(null);Ia.displayName="DashboardIdContext";function Kg(){var n=c.useContext(Ia);if(n==null)throw new Error("useDashboardId must be used within a DashboardIdContext provider");return n}function Mm(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=jm(n,"string");return typeof e=="symbol"?e:e+""}function jm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;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 r=n.child;r;){var i=Da(r,e,t);if(i)return i;r=r.sibling}}}function Nm(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}var oi=Nm(c.createContext(null));oi.displayName="FiberContext";class Wg extends c.Component{constructor(){super(...arguments),Mm(this,"_reactInternals",void 0)}render(){var{children:e}=this.props;return u.jsx(oi.Provider,{value:this._reactInternals,children:e})}}function Am(){var n=c.useContext(oi);if(n===null)throw new Error("useFiber must be called within a <FiberProvider />!");var[e]=c.useState(()=>ct()),t=c.useMemo(()=>{for(var r of[n,n==null?void 0:n.alternate].filter(o=>o!=null)){var i=Da(r,!1,o=>{for(var s=o.memoizedState;s!=null;){if(s.memoizedState===e)return!0;s=s.next}});if(i)return i}},[n,e]);return t}var zg="default",Lm="CREATE_DASHBOARD",Rm="CLOSE_DASHBOARD",{listen:Vg,emit:Gg,useListener:qg}=xt(Lm),{listen:Xg,emit:Fm,useListener:Zg}=xt(Rm);function Hm(n,e,t){return(e=$m(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function $m(n){var e=Um(n,"string");return typeof e=="symbol"?e:e+""}function Um(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ma 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,{glContainer:r}=this.props;return[...(e=r==null||(t=r.tab)===null||t===void 0||(t=t.header)===null||t===void 0?void 0:t.tabs)!==null&&e!==void 0?e:[]]}handleCloseTab(){var{glContainer:e}=this.props;e.close()}handleCloseTabsAll(){var e=this.getAllTabs();e.forEach(t=>{var r;return(r=(t==null?void 0:t.contentItem).container)===null||r===void 0?void 0:r.close()})}handleCloseTabsRight(){for(var{glContainer:e}=this.props,t=this.getAllTabs(),r=t.length-1;r>0;r-=1){var i,o,s,a;if(((i=t[r].contentItem)===null||i===void 0||(i=i.config)===null||i===void 0?void 0:i.id)===((o=e.tab)===null||o===void 0||(o=o.contentItem)===null||o===void 0||(o=o.config)===null||o===void 0?void 0:o.id))break;(s=((a=t[r])===null||a===void 0?void 0:a.contentItem).container)===null||s===void 0||s.close()}}handleReopenLast(){var{glContainer:e,glEventHub:t}=this.props;t.emit(Y.REOPEN_LAST,e)}canCloseTabsRight(){for(var{glContainer:e}=this.props,t=this.getAllTabs(),r=!0,i=t.length-1;i>0;i-=1){var o,s,a;if(((o=t[i].contentItem)===null||o===void 0||(o=o.config)===null||o===void 0?void 0:o.id)===((s=e.tab)===null||s===void 0||(s=s.contentItem)===null||s===void 0||(s=s.config)===null||s===void 0?void 0:s.id))break;var l=!!(!((a=t[i])===null||a===void 0||(a=a.contentItem)===null||a===void 0||(a=a.config)===null||a===void 0)&&a.isClosable);if(l){r=!1;break}}return r}canCloseAny(){for(var e=this.getAllTabs(),t=!0,r=e.length-1;r>0;r-=1){var i,o=!!(!((i=e[r])===null||i===void 0||(i=i.contentItem)===null||i===void 0||(i=i.config)===null||i===void 0)&&i.isClosable);if(o){t=!1;break}}return t}canReopenLast(){var e,t,{workspace:r,glContainer:i}=this.props,o=(e=E.getStackForConfig(i.layoutManager.root,i.getConfig()))===null||e===void 0?void 0:e.config.id;return!((t=r.data.closed)!==null&&t!==void 0&&t.some(s=>s.parentStackId===o))}render(){var e,{additionalActions:t,glContainer:r}=this.props,i=[...t];i.push(()=>({title:"Re-open closed panel",group:re.groups.medium+2004,action:this.handleReopenLast,disabled:this.canReopenLast()}));var o=(e=r.tab)===null||e===void 0||(e=e.contentItem)===null||e===void 0||(e=e.config)===null||e===void 0?void 0:e.isClosable;return i.push({title:"Close",order:10,group:re.groups.low,action:this.handleCloseTab,disabled:o===void 0||!o}),i.push(()=>({title:"Close Tabs to Right",order:20,group:re.groups.low,action:this.handleCloseTabsRight,disabled:this.canCloseTabsRight()})),i.push(()=>({title:"Close All",order:30,group:re.groups.low,action:this.handleCloseTabsAll,disabled:this.canCloseAny()})),u.jsx(re,{actions:i})}}Hm(Ma,"defaultProps",{additionalActions:[]});var Bm=n=>({workspace:Gs(n)}),Km=En(Bm,{setWorkspace:qs})(Ma);function ka(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=zm(n,"string");return typeof e=="symbol"?e:e+""}function zm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ja extends c.PureComponent{constructor(e){super(e),ka(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=O.createRef();var{value:t}=e;this.state={value:t,valueWasValidated:!1}}componentDidUpdate(e){var{isShown:t}=e,{isShown:r}=this.props;r&&!t&&this.resetState()}resetState(){var{value:e}=this.props;this.setState({value:e,valueWasValidated:!1})}handleRenameDialogOpened(){var e;(e=this.renameInputRef)===null||e===void 0||(e=e.current)===null||e===void 0||e.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,r=t==null?void 0:t.trim();if(r!==void 0&&r!==""){var{onSubmit:i}=this.props;i(r)}else this.setState({value:r,valueWasValidated:!0})}renderRenameDialog(){var{isShared:e,isOwner:t,itemType:r}=this.props,{value:i,valueWasValidated:o}=this.state;return u.jsxs("form",{className:$("p-3",{"was-validated":o}),onSubmit:this.handleRenameSubmit,noValidate:!0,role:"presentation",onMouseDown:s=>{s.stopPropagation()},onMouseUp:s=>{s.stopPropagation()},children:[u.jsxs("div",{className:"form-group",children:[u.jsxs("label",{htmlFor:"rename-dialog-".concat(r,"-input"),children:["Rename ",r]}),u.jsx("input",{type:"text",className:"form-control",id:"rename-dialog-".concat(r,"-input"),value:i??void 0,ref:this.renameInputRef,onChange:this.handleRenameInputChange,required:!0}),u.jsxs("div",{className:"invalid-feedback",children:[r," name cannot be empty"]}),(e||!t)&&u.jsxs("div",{className:"pt-2",children:["Renaming this ",r," will rename for all users."]})]}),u.jsxs("div",{className:"text-right",children:[u.jsx(te,{kind:"secondary",className:"mr-2",onClick:this.handleRenameCancel,children:"Cancel"}),u.jsx(te,{kind:"primary",type:"submit",children:"Rename"})]})]})}render(){var{isShown:e,onCancel:t}=this.props;return u.jsx(rr,{isShown:e,onEntered:this.handleRenameDialogOpened,onExited:t,options:{placement:"bottom"},interactive:!0,closeOnBlur:!0,children:this.renderRenameDialog()})}}ka(ja,"defaultProps",{isShared:!1,isOwner:!0,itemType:"Item",value:""});var Fn=Object.freeze({focus:"TabEvent.focus",blur:"TabEvent.blur"});function fo(n,e,t){return(e=Vm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Vm(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var qm=R.module("Panel");class Xm extends c.PureComponent{constructor(e){super(e),fo(this,"ref",void 0),fo(this,"getAdditionalActions",Qt((r,i,o)=>{var s=[];return i&&s.push(this.getCloneAction()),o&&s.push(this.getRenameAction()),[...s,...r]})),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.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=O.createRef();var{glContainer:t}=this.props;this.state={title:E.getTitleFromContainer(t),showRenameDialog:!1,isWithinPanel:!0}}componentDidMount(){var e,{componentPanel:t,glContainer:r,glEventHub:i}=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),i.on(Fn.focus,this.handleTabFocus),i.on(Fn.blur,this.handleTabBlur),i.emit(Y.MOUNT,t??this),this.setState({isWithinPanel:((e=this.ref.current)===null||e===void 0||(e=e.parentElement)===null||e===void 0?void 0:e.closest(".dh-panel"))!=null})}componentWillUnmount(){var{componentPanel:e,glContainer:t,glEventHub:r}=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),r.off(Fn.focus,this.handleTabFocus),r.off(Fn.blur,this.handleTabBlur),r.emit(Y.UNMOUNT,e??this)}handleTab(e){e!=null&&this.setState({title:E.getTitleFromTab(e)}),this.forceUpdate();var{onTab:t}=this.props;t==null||t(e)}handleTabClicked(e){var{onTabClicked:t}=this.props;t==null||t(e)}handleFocus(e){var{componentPanel:t,glEventHub:r}=this.props;r.emit(Y.FOCUS,t??this);var{onFocus:i}=this.props;i==null||i(e)}handleBlur(e){var{onBlur:t}=this.props;t==null||t(e)}handleHide(){for(var{onHide:e}=this.props,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleResize(){for(var{onResize:e}=this.props,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleBeforeShow(){for(var{onBeforeShow:e}=this.props,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleShow(){for(var{onShow:e}=this.props,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleTabBlur(){for(var{onTabBlur:e}=this.props,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleTabFocus(){for(var{onTabFocus:e}=this.props,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleRenameCancel(){this.setState({showRenameDialog:!1})}handleShowRenameDialog(){this.setState({showRenameDialog:!0})}handleRenameSubmit(e){var{glContainer:t}=this.props;this.setState({showRenameDialog:!1,title:e});var r=E.getRootFromContainer(t),i=E.getComponentConfigFromContainer(t);L(i),E.renameComponent(r,i,e)}handleCopyPanel(){var{glContainer:e,glEventHub:t}=this.props,r=E.getRootFromContainer(e),i=E.getComponentConfigFromContainer(e);if(i==null){qm.error("Could not get component config from container",e);return}var o=E.cloneComponent(r,i);o!==null&&t.emit(Y.CLONED,this,o)}getCloneAction(){return{title:"Copy Panel",order:10,group:re.groups.high,action:this.handleCopyPanel}}getRenameAction(){return{title:"Rename",order:10,group:re.groups.medium,action:this.handleShowRenameDialog}}render(){var{children:e,className:t,renderTabTooltip:r,glContainer:i,glEventHub:o,additionalActions:s=Vl,errorMessage:a,isLoaded:l=!0,isLoading:d=!1,isClonable:h=!1,isRenamable:p=!1}=this.props,{tab:m}=i,{showRenameDialog:v,title:f,isWithinPanel:g}=this.state;return u.jsxs("div",{className:$("h-100 w-100 dh-panel",t),onFocusCapture:this.handleFocus,onBlurCapture:this.handleBlur,ref:this.ref,children:[e,u.jsx(Sn,{"data-testid":"base-panel-loading",errorMessage:a,isLoaded:l,isLoading:d}),!g&&m!=null&&Vr.createPortal(u.jsxs(u.Fragment,{children:[u.jsx(Km,{glContainer:i,glEventHub:o,additionalActions:this.getAdditionalActions(s,h,p)}),p&&u.jsx(ja,{isShown:v,value:f,itemType:"Panel",onCancel:this.handleRenameCancel,onSubmit:this.handleRenameSubmit}),r!=null&&u.jsx(ie,{interactive:!0,options:{placement:"bottom"},popperClassName:"panel-tab-popper",children:r()})]}),m.element[0])]})}}var Zm=Us(Xm),Ym=R.module("useDhId"),wr="__dhId";function Yg(){var n,e,t=(n=(e=Am())===null||e===void 0?void 0:e.pendingProps)!==null&&n!==void 0?n:{},r=t[wr],i=Em();if(r!=null){if(typeof r!="string")throw new Error("useDhId expected prop ".concat(wr," to be a string, but got ").concat(typeof r));return r}return i??(Ym.warn("useDhId must be used within a PanelIdContext provider if there is no ".concat(wr," prop. Defaulting to null.")),null)}function Na(n){var{type:e}=n,t=Fu();switch(e){case t.VariableType.TABLE:case t.VariableType.TABLEMAP:case t.VariableType.TREETABLE:case t.VariableType.HIERARCHICALTABLE:case t.VariableType.PARTITIONEDTABLE:return u.jsx(le,{icon:cl});case t.VariableType.FIGURE:return u.jsx(le,{icon:ms});case t.VariableType.PANDAS:return u.jsx(le,{icon:hl});default:return u.jsx(le,{icon:hs})}}function go(n,e,t,r,i,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function Qm(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function s(l){go(o,r,i,s,a,"next",l)}function a(l){go(o,r,i,s,a,"throw",l)}s(void 0)})}}function Aa(n){var{children:e,language:t}=n,[r,i]=c.useState(null),{activeThemes:o}=Is();return c.useEffect(()=>{var s=!1;function a(){return l.apply(this,arguments)}function l(){return l=Qm(function*(){if(e!=null&&o!=null){var d=yield Ee.colorize(e.toString(),t,{});s||i(d)}}),l.apply(this,arguments)}return a(),()=>{s=!0}},[o,e,t]),u.jsx("div",{style:{pointerEvents:"none"},dangerouslySetInnerHTML:r!=null?{__html:r}:void 0})}class La{static get LANGUAGE_MAP(){return new Map([["python","Python"],["groovy","Groovy"],["scala","Scala"]])}}class Yn{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)?[]:Ul.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"),r="".concat(e.getMinutes()).padStart(2,"0"),i="".concat(e.getSeconds()).padStart(2,"0"),o="".concat(e.getMilliseconds()).padStart(3,"0");return"".concat(t,":").concat(r,":").concat(i,".").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 Yn.isTableType(e,t)||Yn.isWidgetType(e,t)}static isFigureType(e,t){return t===e.VariableType.FIGURE}static isPandas(e,t){return t===e.VariableType.PANDAS}}function Jm(n){var{children:e}=n;return u.jsxs("div",{className:"console-history-item-result",children:[u.jsx("div",{className:"console-history-gutter",children:"-"}),u.jsx("div",{className:"console-history-content",children:e})]})}function Br(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ra extends c.Component{constructor(e){super(e),Br(this,"timer",void 0),Br(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:r}=this.state;return u.jsx("div",{className:$("console-history-result-in-progress",{disabled:e}),children:u.jsxs("span",{className:"badge",children:[u.jsx(ps,{className:"ml-2"}),"Running... ",ln.formatElapsedTime(r)," ",u.jsx(te,{className:"console-history-result-in-progress-cancel",kind:"ghost",icon:ml,tooltip:"Cancel",onClick:t,disabled:e})]})})}}Br(Ra,"defaultProps",{disabled:!1});function yn(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=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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class nn extends c.PureComponent{constructor(e){super(e),yn(this,"mouseX",void 0),yn(this,"mouseY",void 0),yn(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)>=nn.mouseDragThreshold||Math.abs(e.clientY-this.mouseY)>=nn.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:r}=this.props;L(r);var i=r.trimEnd(),o=i.indexOf(`
|
|
2
|
+
import{ao as Xa,a as R,aP as ss,T as Za,z as Ya,X as Qa,Y as Ja,V as el,a4 as tl,O as nl,a8 as rl,d as as,G as ls,e as ds,q as il,aQ as us,aR as ol,aS as sl,L as Sn,ac as al,_ as ll,aT as hs,t as cs,Z as dl,aU as ul,u as L,aO as hl,aK as ms,aL as cl,f as ps,n as ml,aM as Tr,aV as pl,aW as ui,aX as vl,aY as fl,aZ as gl,a_ as bl,v as yl,k as vs,aH as Cl,h as vr,aC as wl,a$ as Sl,b0 as hi,aF as _l,b1 as ci,b2 as fs,b3 as El,aw as Pl,b4 as Tl,b5 as Ol,b6 as xl,b7 as Il,b8 as Dl,b9 as Ml}from"./index-C1nKOeGq.js";import{r as c,ag as _n,bo as tr,J as O,bE as kl,bF as Or,D as u,H as jl,G as $,R as Vr,bq as Nl,I as le,C as ct,bG as Al,E as gs,af as Gt,bH as Ll,bI as Rl,bJ as Fl,bB as xr,_ as Hl,bK as T,bL as mi,bD as ae,N as bs,L as ys,bM as $l,bC as En,by as Qt,bd as Ee,bN as Ul,bg as pi,bO as Bl,bP as vi,bf as ze,bQ as Cs,bR as Kl,bz as We,bA as Rt,bS as fi,be as Wl,bx as zl,bT as fn}from"./vendor-BscqrOix.js";var Vl=Object.freeze([]),Kf=new Map,ws=()=>{};function Wf(n){return Array.isArray(n)?n:[n]}function zf(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return e.filter(r=>r!=null)}function Gl(n,e,t){return(e=ql(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ql(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class gi extends Error{constructor(){super(...arguments),Gl(this,"isCanceled",!0)}}function Zl(n,e,t){return(e=Yl(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Yl(n){var e=Ql(n,"string");return typeof e=="symbol"?e:e+""}function Ql(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Jl extends Error{constructor(){super(...arguments),Zl(this,"isClipboardPermissionsDeniedError",!0)}}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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class fr extends Error{constructor(){super(...arguments),ed(this,"isClipboardUnavailableError",!0)}}function rd(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=od(n,"string");return typeof e=="symbol"?e:e+""}function od(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ss extends Error{constructor(){super(...arguments),rd(this,"isPermissionUnsupported",!0)}}function bi(n,e,t,r,i,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function sd(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function s(l){bi(o,r,i,s,a,"next",l)}function a(l){bi(o,r,i,s,a,"throw",l)}s(void 0)})}}function yi(n){return Ir.apply(this,arguments)}function Ir(){return Ir=sd(function*(n){try{var e=n;return(yield navigator.permissions.query({name:e})).state}catch(t){throw t instanceof TypeError?new Ss:t}}),Ir.apply(this,arguments)}function Ci(n,e,t,r,i,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function _s(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function s(l){Ci(o,r,i,s,a,"next",l)}function a(l){Ci(o,r,i,s,a,"throw",l)}s(void 0)})}}function ad(n){return Dr.apply(this,arguments)}function Dr(){return Dr=_s(function*(n){var{clipboard:e}=navigator;if(e!==void 0)try{return yield navigator.clipboard.writeText(n)}catch{}ld(n)}),Dr.apply(this,arguments)}function ld(n){var e=document.activeElement,t=document.createElement("textarea");t.value=n,document.body.appendChild(t),t.focus(),t.select();var r=document.execCommand("copy");if(document.body.removeChild(t),e instanceof HTMLElement&&e.focus(),!r)throw new Error("Unable to execute copy command")}function Vf(){return Mr.apply(this,arguments)}function Mr(){return Mr=_s(function*(){try{var{clipboard:n}=navigator;if(n===void 0)throw new fr;var e=yield yi("clipboard-read");if(e==="granted"){var t=yield n.readText();return t}if(e==="prompt"){try{yield n.readText()}catch{}if(e=yield yi("clipboard-read"),e==="granted"){var r=yield n.readText();return r}}if(e==="prompt"||e==="denied")throw new Jl}catch(i){throw i instanceof Ss?new fr:i}throw new fr}),Mr.apply(this,arguments)}var an;function $t(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=ud(n,"string");return typeof e=="symbol"?e:e+""}function ud(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var hd="table_",Es="column_",cd=new Set(["in","not","i","ii","k"]),md=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"]),pd=/[^a-zA-Z0-9_$\-+@]/g,vd=/[^A-Za-z0-9_$]/g,fd=/^[a-zA-Z_$][a-zA-Z0-9_$\-+@]*$/,gd=/[^a-zA-Z0-9_]/g;function bd(n){return n.replace(/[ -]/g,"_")}function yd(n){return n.replace(/\s/g,"_")}class ot{}an=ot;$t(ot,"legalize",(n,e,t,r,i,o)=>{var s=e(n.trim());return i&&(cd.has(s)||md.has(s))&&(s=t+s),s=s.replace(r,""),s?(/^[0-9-]/.test(s)&&(s=t+s),s):t+o});$t(ot,"legalizeTableName",n=>an.legalize(n,yd,hd,pd,!1,0));$t(ot,"makeVariableName",n=>an.legalizeTableName(n).replace(gd,"_"));$t(ot,"legalizeColumnNames",n=>{var e=[];return n.forEach((t,r)=>{var i=an.legalizeColumnName(t,r);e.includes(i)&&(i=Es+r),e.push(i)}),e});$t(ot,"legalizeColumnName",function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return an.legalize(n,bd,Es,vd,!0,e)});$t(ot,"isValidTableName",n=>fd.test(n));$t(ot,"isValidColumnName",n=>an.legalizeColumnName(n)===n);class Ps extends CustomEvent{constructor(e,t){super(e,t)}}class He{static makeCancelable(e,t){var r=!1,i,o,s=new Promise((a,l)=>{o=l,Promise.resolve(e).then(d=>{r?t&&t(d):(i=d,a(d))}).catch(d=>l(d))});return s.cancel=()=>{r=!0,o(new gi),i!=null&&t&&t(i)},s}static isCanceled(e){return e instanceof gi}static isTimedOut(e){return e instanceof Xa}static withTimeout(e,t){return new Promise((r,i)=>{setTimeout(()=>{try{r(t())}catch(o){i(o)}},e)})}}function wi(n,e,t){return(e=Cd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Cd(n){var e=wd(n,"string");return typeof e=="symbol"?e:e+""}function wd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class nr{constructor(){wi(this,"pending",[]),wi(this,"resolved",[])}add(e,t){var r=He.makeCancelable(e,t);return this.pending.push(r),r.then(()=>{this.resolve(r)},()=>{this.resolve(r)}),r}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 Gf(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 Ze{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(!Ze.isValidRange(e))throw new Error("Invalid range! ".concat(e))}static isSelected(e,t){for(var r=0;r<e.length;r+=1){var i=e[r],o=i[0],s=i[1];if(o<=t&&t<=s)return!0}return!1}static selectRange(e,t){for(var[r,i]=t,o=[...e],s=o.length-1;s>=0;s-=1){var a=o[s],l=a[0],d=a[1];if(l<=r&&i<=d)return o;r<=d&&l<=i&&(r=Math.min(r,l),i=Math.max(i,d),o.splice(s,1))}return o.push([r,i]),o}static deselectRange(e,t){for(var[r,i]=t,o=[...e],s=o.length-1;s>=0;s-=1){var a=o[s],l=a[0],d=a[1];if(!(i<l||d<r))if(l<r&&i<d){o[s]=[l,r-1],o.splice(s+1,0,[i+1,d]);break}else r<=l&&d<=i?o.splice(s,1):l<r?o[s]=[l,r-1]:o[s]=[i+1,d]}return o}static count(e){return e.reduce((t,r)=>t+(r[1]-r[0]+1),0)}static getItemsInRanges(e,t){return t.reduce((r,i)=>{for(var o=[...r],s=i[0];s<=i[1];s+=1)o.push(e[s]);return o},[])}}function*qf(n,e){for(var t=n;t<=e;++t)yield t}var Xf=" ";class Sd{static join(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"and";if(e==null||e.length===0)return"";if(e.length===1)return e[0];if(e.length===2)return"".concat(e[0]," ").concat(t," ").concat(e[1]);var r=e.slice(0,e.length-1).join(", "),i=e[e.length-1];return"".concat(r,", ").concat(t," ").concat(i)}static toLower(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==null){if(t)return"";throw new Error("Null string passed in to TextUtils.toLower")}return e.toLowerCase()}static sort(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e<t?r?-1:1:e>t?r?1:-1:0}static pluralize(e,t,r){return e===1?t:r??"".concat(t,"s")}}function Ts(n,e,t){return(e=_d(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _d(n){var e=Ed(n,"string");return typeof e=="symbol"?e:e+""}function Ed(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ln{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),r=Math.floor(e%3600/60),i=e%60;return"".concat(t>0?"".concat(t,"h "):"")+"".concat(r>0||t>0?"".concat(r,"m "):"")+"".concat(e>=60?"".concat(i,"s").padStart(3,"0"):"".concat(i,"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"),r=e%(60*60),i=String(Math.floor(r/60)).padStart(2,"0"),o=r%60,s=String(Math.ceil(o)).padStart(2,"0");return"".concat(t,":").concat(i,":").concat(s)}static isTimeString(e){return new RegExp(ln.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])}}Ts(ln,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");Ts(ln,"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 Pd(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=Od(n,"string");return typeof e=="symbol"?e:e+""}function Od(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class gn extends Error{constructor(){super(...arguments),Pd(this,"isInvalid",!0)}}function Os(){var n=c.useRef(!1);return c.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function Si(n,e,t,r,i,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function xd(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function s(l){Si(o,r,i,s,a,"next",l)}function a(l){Si(o,r,i,s,a,"throw",l)}s(void 0)})}}var Id=R.module("useAsyncInterval");function Dd(n,e){var t=Os(),r=c.useRef(0),i=c.useRef(0),o=c.useRef(null),s=c.useCallback(xd(function*(){var a=Date.now();i.current+=1;var l=o.current==null?e:a-o.current;o.current=a;try{yield n()}catch(p){Id.error("A tick error occurred:",p)}if(t.current){l+=Date.now()-o.current;var d=Math.max(0,l-e),h=Math.max(0,e-d);r.current=window.setTimeout(s,h)}}),[n,t,e]);c.useEffect(()=>(o.current=null,s(),()=>{window.clearTimeout(r.current)}),[e,s])}function Pn(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 Md(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{leading:r=!1,trailing:i=!0,maxWait:o}=t,s=c.useMemo(()=>_n(n,e,o!=null?{leading:r,trailing:i,maxWait:o}:{leading:r,trailing:i}),[n,e,r,i,o]);return c.useEffect(()=>()=>s.cancel(),[s]),s}function kd(n){var e=c.useRef();return c.useEffect(function(){e.current=n}),e.current}function jd(n,e,t){var r=c.useRef(t),i=c.useRef(n);i.current=n;var o=c.useMemo(()=>tr(function(){return i.current(...arguments)},e,r.current),[e]);return c.useEffect(()=>()=>{var s,a;(s=(a=r.current)===null||a===void 0?void 0:a.flushOnUnmount)!==null&&s!==void 0&&s?o.flush():o.cancel()},[o]),o}function xs(n){var e=c.useRef(null);return c.useEffect(function(){n&&(typeof n=="function"?n(e.current):n.current=e.current)}),e}function _i(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Nd(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_i(Object(t),!0).forEach(function(r){qt(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):_i(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function qt(n,e,t){return(e=Ad(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ad(n){var e=Ld(n,"string");return typeof e=="symbol"?e:e+""}function Ld(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ei="popper";class rr extends c.Component{constructor(e){super(e),qt(this,"element",void 0),qt(this,"container",void 0),qt(this,"nodeRef",O.createRef()),qt(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=O.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:r}=this.props;if(!e&&this.container.current!==null){var{options:i}=this.props;i=Nd({placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}}},i),document.body.appendChild(this.element);var o=this.getVisibleElement(this.container.current);o==null&&(o=this.container.current);var s=new kl(r||o,this.element,i);s.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(t){var a=this.element.querySelector(".".concat(Ei));a instanceof HTMLElement&&!a.contains(document.activeElement)&&a.focus()}}),Or.flushSync(()=>{this.setState({popper:s})})}}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(),Or.flushSync(()=>{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:r,interactive:i,closeOnBlur:o}=this.props,{show:s}=this.state;return u.jsx(ss,{isPortal:!0,children:u.jsx(jl,{in:s,timeout:r,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,nodeRef:this.nodeRef,children:u.jsx("div",{ref:this.nodeRef,onClick:a=>{a.stopPropagation()},onKeyDown:a=>{a.key==="Escape"&&this.hide()},className:$(Ei,{interactive:i},e),onBlur:o?this.handleBlur:void 0,tabIndex:o?-1:void 0,role:"presentation",children:u.jsxs("div",{className:"popper-content",children:[t,u.jsx("div",{className:"popper-arrow","x-arrow":""})]})})})})}render(){var{popper:e}=this.state,{"data-testid":t}=this.props;return u.jsx("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":t,children:e&&Vr.createPortal(this.renderContent(),this.element)})}}qt(rr,"defaultProps",{options:{},className:"",timeout:Za.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0});var kr;function Pi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Rd(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Pi(Object(t),!0).forEach(function(r){Ye(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Pi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ye(n,e,t){return(e=Fd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Fd(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var $d=R.module("Tooltip");class ie extends c.Component{static handleHidden(){ie.shownTooltipCount-=1,ie.shownTooltipCount===0&&(ie.lastHiddenTime=Date.now())}static handleShown(){ie.shownTooltipCount+=1}constructor(e){super(e),Ye(this,"container",void 0),Ye(this,"popper",void 0),Ye(this,"parent",void 0),Ye(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=O.createRef(),this.popper=O.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:r}=t,{isShown:i}=this.state;i!==r&&(i?ie.handleShown():ie.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();var{isShown:e}=this.state;e&&ie.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){$d.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,r=e.clientY,{isShown:i}=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&&r>=o.top&&r<=o.top+o.height?this.handleMouseMove():t>=s.left&&t<=s.left+s.width&&r>=s.top&&r<=s.top+s.height?this.handleMouseMove():i&&(this.stopTimer(),this.hide())}}startTimer(){this.stopTimer();var{timeout:e,reshowTimeout:t}=this.props,r=e;(ie.shownTooltipCount>0||Date.now()-ie.lastHiddenTime<ie.triggerReshowThreshold)&&(r=t),this.timer=window.setTimeout(this.handleTimeout,r)}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(),Or.flushSync(()=>{this.setState({isShown:!0})});var{interactive:r}=this.props;r&&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:r,popperClassName:i,"data-testid":o,onEntered:s}=this.props,{isShown:a}=this.state,{options:l}=this.props;return l=Rd({placement:"bottom"},l),u.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":o,children:u.jsx(rr,{className:$(i,"popper-tooltip"),options:l,ref:this.popper,onEntered:s,onExited:this.handleExited,interactive:e,referenceObject:r,children:u.jsxs("div",{className:"tooltip-content",children:[" ",a&&t]})})})}}kr=ie;Ye(ie,"defaultTimeout",500);Ye(ie,"defaultReshowTimeout",100);Ye(ie,"triggerReshowThreshold",300);Ye(ie,"shownTooltipCount",0);Ye(ie,"lastHiddenTime",Date.now());Ye(ie,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:kr.defaultReshowTimeout,timeout:kr.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});var Ud=R.module("ThemeProvider"),Gr=c.createContext(null);Gr.displayName="ThemeContext";function Zf(n){var{themes:e,waitForActivation:t=!1,defaultPreloadValues:r=Ya,children:i}=n,o=c.useMemo(()=>Qa(),[]),[s,a]=c.useState(null),[l,d]=c.useState(Ja),h=c.useMemo(()=>e==null?null:el(l,{base:o,custom:e??[]}),[o,l,e]),p=c.useMemo(()=>[...o,...e??[]],[o,e]);return c.useEffect(function(){if(!(h==null||e==null)){tl(r);var v=nl(r);Ud.debug2("updateThemePreloadData:",{active:h.map(f=>f.themeKey),custom:e.map(f=>f.themeKey),preloadStyleContent:v,selectedThemeKey:l}),rl({themeKey:l,preloadStyleContent:v})}},[h,l,e,r]),c.useEffect(()=>{a({activeThemes:h,selectedThemeKey:l,themes:p,setSelectedThemeKey:d})},[h,l,p]),t&&h==null?null:u.jsxs(u.Fragment,{children:[h==null?null:u.jsx(u.Fragment,{children:h.map(m=>u.jsx("style",{"data-theme-key":m.themeKey,children:m.styleContent},m.themeKey))}),s==null?null:u.jsx(Gr.Provider,{value:s,children:u.jsx(ss,{children:i})})]})}function Is(){return Pn(Gr,"No ThemeContext value found. Component must be wrapped in a ThemeContext.Provider")}function Bd(n){var{children:e,className:t,style:r,"data-testid":i}=n;return u.jsx("div",{className:$("btn-group",t),style:r,role:"group","data-testid":i,children:e})}var Kd=["kind","variant","type","tooltip","icon","disabled","active","onClick","onContextMenu","onMouseDown","onMouseUp","onMouseEnter","onMouseLeave","onKeyDown","className","style","children","tabIndex","data-testid","aria-label"];function Ti(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Oi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ti(Object(t),!0).forEach(function(r){Wd(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ti(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Wd(n,e,t){return(e=zd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function zd(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Gd(n,e){if(n==null)return{};var t,r,i=qd(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function qd(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function Xd(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 Zd(n){switch(n){case"group-end":return $("pl-2","pr-3")}}var te=O.forwardRef((n,e)=>{var{kind:t,variant:r,type:i="button",tooltip:o,icon:s,disabled:a=!1,active:l,onClick:d,onContextMenu:h,onMouseDown:p,onMouseUp:m,onMouseEnter:v,onMouseLeave:f,onKeyDown:g,className:b,style:S,children:w,tabIndex:y,"data-testid":D,"aria-label":V}=n,X=Gd(n,Kd),{UNSAFE_className:G}=Nl({},"button"),A;r&&(A=Zd(r));var M;s&&(M=O.isValidElement(s)?s:u.jsx(le,{icon:s}));var Q=M!=null&&w==null,W=Xd(t,Q),k;o!==void 0&&(k=typeof o=="string"?u.jsx(ie,{children:o}):o);var z=V;V===void 0&&Q&&o!=null&&typeof o=="string"&&(z=o);var F=u.jsxs("button",Oi(Oi({"data-testid":D,ref:e,type:i,className:$("btn",W,A,{active:l},b,G),onClick:d,onContextMenu:h,onMouseUp:m,onMouseDown:p,onMouseEnter:v,onMouseLeave:f,onKeyDown:g,style:S,disabled:a,tabIndex:y,"aria-label":z},X),{},{children:[s&&M,w,o!=null&&!a&&k]}));return a&&o!=null?u.jsxs("span",{className:"btn-disabled-wrapper",children:[F,k]}):F});te.displayName="Button";function Ds(n){var{className:e,children:t,"data-testid":r}=n;return u.jsx("div",{className:$("modal-footer",e),"data-testid":r,children:t})}function jr(n){var{isOpen:e,headerText:t,bodyText:r,onCancel:i,onConfirm:o,onDiscard:s,onModalDisable:a,cancelButtonText:l="Cancel",confirmButtonText:d="Okay",discardButtonText:h="Discard",isConfirmDanger:p=!1,children:m,"data-testid":v}=n,f=c.useRef(null),g=c.useRef(null),b=c.useCallback(()=>{g.current!==null&&g.current.checked&&a&&a(),o()},[o,a]),S=c.useCallback(()=>{var y;(y=f.current)===null||y===void 0||y.focus()},[]),w="";return e&&(w=typeof r=="function"?r():r),u.jsxs(as,{isOpen:e,onOpened:S,children:[u.jsx(ls,{closeButton:!1,children:t}),u.jsx(ds,{children:w}),u.jsxs(Ds,{children:[a&&u.jsxs("div",{className:"custom-control custom-checkbox form-group mr-auto",children:[u.jsx("input",{type:"checkbox",className:"custom-control-input",id:"move-confirmation-checkbox",defaultChecked:!1,ref:g,"data-testid":v!==void 0?"".concat(v,"-checkbox-confirm"):void 0}),u.jsx("label",{className:"custom-control-label",htmlFor:"move-confirmation-checkbox",children:"Don't ask me again"})]}),s&&u.jsx(te,{kind:"secondary",className:"mr-auto","data-dismiss":"modal",onClick:s,"data-testid":v!==void 0?"".concat(v,"-btn-discard"):void 0,children:h}),i&&u.jsx(te,{kind:"secondary","data-dismiss":"modal",onClick:i,"data-testid":v!==void 0?"".concat(v,"-btn-cancel"):void 0,children:l}),u.jsxs(Bd,{children:[u.jsx(te,{kind:p?"danger":"primary",onClick:b,ref:f,"data-testid":v!==void 0?"".concat(v,"-btn-confirm"):void 0,children:d}),m]})]})]})}function Yd(n,e,t){return(e=Qd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Qd(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function gr(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 r,i;return((r=e.group)!==null&&r!==void 0?r:0)>((i=t.group)!==null&&i!==void 0?i: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,r=[],i=e;Array.isArray(i)||(i=[i]);for(var o=0;o<i.length;o+=1){var s=i[o],a=void 0;typeof s=="function"?a=s():a=s,a!=null&&(a instanceof Promise?t&&r.push(a):Array.isArray(a)?r=r.concat(a):r.push(a))}return r=r.filter(l=>l.title!==void 0||l.then!=null||l.menuElement),r}static getNextMenuItem(e,t,r){var i=e;i<0&&t<0&&(i=r.length);for(var o=1;o<r.length+1;o+=1){var s=(i+t*o+r.length)%r.length,a=r[s];if(!(a instanceof Promise)&&a.disabled!==!0)return s}return e}}Yd(he,"actionsDisabled",!1);var xi=R.module("GlobalContextAction");class eu 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:r}=this.props;r.title==null&&!r.menuElement||(t.contextActions==null&&(t.contextActions=[]),t.contextActions.push(r),xi.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 r;xi.debug("Global hotkey matched!",e),(r=t.action)===null||r===void 0||r.call(t,e),e.preventDefault(),e.stopPropagation()}}render(){return null}}class tu extends c.Component{render(){for(var{actions:e,"data-testid":t}=this.props,r=[],i=0;i<e.length;i+=1){var o=e[i],{shortcut:s}=o;if(o.title!=null||o.menuElement||s){var a=u.jsx(eu,{action:o,"data-testid":t},"".concat(o.title,".").concat(s==null?void 0:s.id));r.push(a)}}return r}}function Ms(n,e,t){return(e=nu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nu(n){var e=ru(n,"string");return typeof e=="symbol"?e:e+""}function ru(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var kn=R.module("ContextActions");class re extends c.Component{static triggerMenu(e,t,r,i){if(i.length!==0){var o=new MouseEvent("contextmenu",{clientX:t,clientY:r,bubbles:!0,cancelable:!0});o.contextActions=i,e.dispatchEvent(o)}}constructor(e){super(e),Ms(this,"container",void 0),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=O.createRef(),this.state={globalActions:[],keyboardActions:[]}}static getDerivedStateFromProps(e){if(e.actions==null||!Array.isArray(e.actions))return{globalActions:[],keyboardActions:[]};var t=e.actions.filter(i=>!gr(i)&&typeof i!="function"&&i.isGlobal),r=e.actions.filter(i=>!gr(i)&&typeof i!="function"&&(i.isGlobal===void 0||!i.isGlobal)&&i.shortcut!=null);return{globalActions:t,keyboardActions:r}}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 r=e.target,i=function(){var{classList:d}=r,h=t.find(p=>d.contains(p));if(h!==void 0)return kn.debug2('Contextmenu event ignored based on the target className "'.concat(h,'"')),{v:void 0};r=r.parentElement},o;r!=null;)if(o=i(),o)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=>gr(l)||typeof l=="function"||l.isGlobal===void 0||!l.isGlobal)),e.contextActions=e.contextActions.concat(a)}kn.debug("Received context menu event! Menu items are now: ",e.contextActions)}}handleKeyDown(e){for(var{keyboardActions:t}=this.state,r=0;r<t.length;r+=1){var i=t[r];if(!he.actionsDisabled&&i.shortcut!=null&&i.shortcut.matchesEvent(e)){var o;kn.debug("Context hotkey matched!",e),(o=i.action)===null||o===void 0||o.call(i,e),e.stopPropagation(),e.preventDefault(),kn.debug2("Matched hotkey returned false, key event not consumed")}}}render(){var{"data-testid":e}=this.props,{globalActions:t}=this.state;return u.jsx("div",{className:"context-actions-listener",ref:this.container,"data-testid":e,children:u.jsx(tu,{actions:t})})}}Ms(re,"groups",{default:void 0,high:100,medium:5e3,low:1e4,global:1e5,edit:100});var ks=O.forwardRef((n,e)=>{var t,r,{closeMenu:i,children:o,menuItem:s,onMenuItemClick:a,onMenuItemMouseMove:l,onMenuItemContextMenu:d,isKeyboardSelected:h=!1,isMouseSelected:p=!1,"data-testid":m}=n,v=c.useCallback(W=>{a(s,W)},[s,a]),f=c.useCallback(W=>{l(s,W)},[s,l]),g=c.useCallback(W=>{d(s,W)},[s,d]);function b(W,k,z){if(typeof W.type=="string")return W;var F={menuItem:s,closeMenu:i,isKeyboardSelected:h,isMouseSelected:p,iconElement:k,displayShortcut:z,"data-testid":m};return O.cloneElement(W,{forwardedProps:F})}var S=(t=s.shortcutText)!==null&&t!==void 0?t:(r=s.shortcut)===null||r===void 0?void 0:r.getDisplayText(),w=null;if(s.icon){var y=s.icon;if(O.isValidElement(y))w=y;else{var D;s.iconColor!=null&&(s.disabled===void 0||!s.disabled)&&(D={color:s.iconColor}),w=u.jsx(le,{icon:y,style:D})}}var V=null,X=!!o;s.actions&&(V=u.jsx(le,{icon:il}));var G=null;if(s.menuElement)G=u.jsx("div",{className:"custom-menu-item",onMouseMove:f,children:b(s.menuElement,w,S)});else{var A,M=s.disabled,Q=s.iconOutline;G=u.jsx("button",{type:"button",className:$("btn-context-menu",{disabled:M},{active:(X||p)&&(M===void 0||!M)},{"keyboard-active":h&&(M===void 0||!M)}),onClick:v,onMouseMove:f,onContextMenu:g,title:(A=s.description)!==null&&A!==void 0?A:"",children:u.jsxs("div",{className:"btn-context-menu-wrapper",children:[u.jsx("span",{className:$("icon",{outline:Q}),children:w}),u.jsx("span",{className:"title",children:s.title}),S!==void 0&&u.jsx("span",{className:"shortcut",children:S}),V&&u.jsx("span",{className:$("submenu-indicator",{disabled:M}),children:V})]})})}return u.jsxs("div",{className:"context-menu-item",ref:e,"data-testid":m,children:[o,G]})});ks.displayName="ContextMenuItem";var js=O.forwardRef((n,e)=>{var{checked:t=!1,children:r,className:i,disabled:o=!1,inputClassName:s,isInvalid:a=!1,labelClassName:l,name:d,onChange:h,"data-testid":p}=n,[m]=c.useState(ct()),v=xs(e);c.useEffect(function(){v.current&&(v.current.indeterminate=t===null)},[v,t]);var f=c.useCallback(g=>{v.current&&(v.current.indeterminate=t===null),h&&h(g)},[v,t,h]);return u.jsxs("div",{className:$("custom-control custom-checkbox",i),children:[u.jsx("input",{type:"checkbox",ref:v,checked:t??!1,className:$("custom-control-input",s,{"is-invalid":a}),disabled:o,id:m,name:d,onChange:f,"data-testid":p}),u.jsx("label",{className:$("custom-control-label",l),htmlFor:m,children:r})]})});js.displayName="Checkbox";function Gn(n){return(n==null?void 0:n.WrappedComponent)!==void 0}function Ns(n){return Gn(n)&&Ns(n.WrappedComponent)?!0:n.prototype!=null&&n.prototype.isReactComponent!=null}function iu(n){return!Gn(n)&&"$$typeof"in n&&n.$$typeof===Al.ForwardRef}function As(n){return Ns(n)||iu(n)}function Ii(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ou(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ii(Object(t),!0).forEach(function(r){bn(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ii(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function bn(n,e,t){return(e=su(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function su(n){var e=au(n,"string");return typeof e=="symbol"?e:e+""}function au(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ls extends c.PureComponent{constructor(e){var t;super(e),bn(this,"container",void 0),bn(this,"oldFocus",void 0),bn(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=O.createRef(),this.oldFocus=document.activeElement,this.rAF=0;var{options:r}=e,i=(t=r.initialKeyboardIndex)!==null&&t!==void 0?t:-1;this.state={menuItems:[],keyboardIndex:i,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(r=>({menuItems:he.sortActions(r.menuItems.concat(t))}))}handleKeyDown(e){var{menuItems:t}=this.state,r=this.getKeyboardIndex(),i=r;if(e.key==="Enter"||e.key===" "){r!=null&&r>=0&&r<t.length&&this.handleMenuItemClick(t[r],e);return}e.key==="Escape"?i=null:e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey===!0?i=he.getNextMenuItem(i??0,-1,t):(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1)&&(i=he.getNextMenuItem(i??0,1,t)),r!==i&&(i!==null?this.setKeyboardIndex(i):(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:r}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),r(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,r=t.indexOf(e);this.setMouseIndex(r)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{"data-testid":t}=this.props,{keyboardIndex:r,menuItems:i,mouseIndex:o}=this.state,s=0;s<i.length;s+=1){var a=i[s];s>0&&a.group!==i[s-1].group&&e.push(u.jsx("hr",{},"".concat(s,".separator")));var l=u.jsx(ks,{isKeyboardSelected:r===s,isMouseSelected:o===s,menuItem:a,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},s);e.push(l)}var{menuStyle:d}=this.props;return u.jsx("div",{className:"context-menu-container",style:ou({},d),ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":t,children:e})}}bn(Ls,"defaultProps",{closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});function Di(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Mi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Di(Object(t),!0).forEach(function(r){Xt(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Di(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Xt(n,e,t){return(e=lu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lu(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ir extends c.PureComponent{constructor(e){super(e),Xt(this,"container",void 0),Xt(this,"parent",void 0),Xt(this,"popper",void 0),Xt(this,"isOpen",void 0),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=O.createRef(),this.parent=null,this.popper=O.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:r,"data-testid":i}=this.props,{menuStyle:o}=this.props,{options:s,popperOptions:a}=this.props;return a=Mi({placement:"bottom"},a),s=Mi({separateKeyboardMouse:!0},s),u.jsx("div",{className:"menu-actions-listener",ref:this.container,"data-testid":i,children:u.jsx(rr,{ref:this.popper,options:a,className:$("menu-popper",r),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:u.jsx(Ls,{actions:e,closeMenu:this.handleCloseMenu,onMenuOpened:t,options:s,menuStyle:o})})})}}Xt(ir,"defaultProps",{isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0});function wt(n,e,t){return(e=uu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uu(n){var e=hu(n,"string");return typeof e=="symbol"?e:e+""}function hu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ki=R.module("Shortcut"),_=function(n){return n.CTRL="MODIFIER_CTRL",n.CMD="MODIFIER_CMD",n.ALT="MODIFIER_ALT",n.OPTION="MODIFIER_OPTION",n.SHIFT="MODIFIER_SHIFT",n}({}),C=function(n){return 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",n}({}),cu=new Set([C.ENTER,C.DELETE,C.F1,C.F2,C.F3,C.F4,C.F5,C.F6,C.F7,C.F8,C.F9,C.F10,C.F11,C.F12]);class de extends gs{static isAllowedKey(e){return Object.values(C).includes(e)}static isValidKeyState(e){var{keyValue:t}=e;if(t===null)return!0;if(!de.isMacPlatform&&e.metaKey||!de.isAllowedKey(t))return!1;var r=!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey;return!r||cu.has(t)}static createKeyState(e){var t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(r=>{switch(r){case _.CTRL:t.ctrlKey=!0;break;case _.ALT:case _.OPTION:t.altKey=!0;break;case _.CMD:t.metaKey=!0;break;case _.SHIFT:t.shiftKey=!0;break}}),t}static getKeyStateFromEvent(e){var{key:t,keyCode:r}=e,i="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?i="":!de.isAllowedKey(t)&&de.isAllowedKey(String.fromCharCode(r))?i=String.fromCharCode(r):i=t,{keyValue:i,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===C.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 C.ENTER:t+="⏎";break;case C.ESCAPE:t+="⎋";break;case C.BACKSPACE:t+="⌫";break;case C.DELETE:t+="⌦";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){var r,i;return((r=e.keyValue)===null||r===void 0?void 0:r.toUpperCase())===((i=t.keyValue)===null||i===void 0?void 0:i.toUpperCase())&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey&&e.shiftKey===t.shiftKey}static getDisplayText(e){return e.keyValue===null?"":de.isMacPlatform?de.getMacDisplayText(e):de.getWindowsDisplayText(e)}constructor(e){var{id:t,shortcut:r,macShortcut:i,isEditable:o=!0,name:s,tooltip:a}=e;super(),wt(this,"id",void 0),wt(this,"name",void 0),wt(this,"tooltip",void 0),wt(this,"isEditable",void 0),wt(this,"defaultKeyState",void 0),wt(this,"keyState",void 0),this.id=t,this.name=s,this.tooltip=a,this.isEditable=o;var l=de.isMacPlatform,d=l?i:r;this.defaultKeyState=de.createKeyState(d),this.keyState=this.defaultKeyState}getDisplayText(){return de.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){de.isValidKeyState(e)?(ki.debug2("Shortcut ".concat(this.id," updated to ").concat(JSON.stringify(e))),this.keyState=e,this.dispatchEvent(new Ps("onUpdate",{detail:this}))):ki.debug2("Shortcut ".concat(this.id," tried to update to invalid keyState ").concat(JSON.stringify(e)))}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return de.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState(de.NULL_KEY_STATE)}isNull(){return de.doKeyStatesMatch(this.keyState,de.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return de.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState(de.getKeyStateFromEvent(e))}}wt(de,"NULL_KEY_STATE",{metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null});wt(de,"isMacPlatform",he.isMacPlatform());function ji(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=pu(n,"string");return typeof e=="symbol"?e:e+""}function pu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ni=R.module("ShortcutRegistry");class vu extends gs{constructor(){super(...arguments),ji(this,"shortcutMap",new Map),ji(this,"shortcutsByCategory",new Map)}createAndAdd(e){var t=new de(e);return this.add(t)}add(e){var t=this.shortcutMap.get(e.id);if(t)return Ni.warn("Skipping attempt to add duplicate shortcut ID to registry: ".concat(e.id)),t;Ni.debug2("Adding shortcut to registry: ".concat(e.id)),e.addEventListener("onUpdate",o=>{var{detail:s}=o;return this.dispatchEvent(new Ps("onUpdate",{detail:s}))});var r=e.id.split(".")[0];if(this.shortcutMap.set(e.id,e),this.shortcutsByCategory.has(r)){var i;(i=this.shortcutsByCategory.get(r))===null||i===void 0||i.push(e)}else this.shortcutsByCategory.set(r,[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 ee=Object.freeze(new vu),Zt={COPY:ee.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[_.CTRL,C.C],macShortcut:[_.CMD,C.C],isEditable:!1}),PASTE:ee.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[_.CTRL,C.V],macShortcut:[_.CMD,C.V],isEditable:!1}),SAVE:ee.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[_.CTRL,C.S],macShortcut:[_.CMD,C.S],isEditable:!1}),SELECT_ALL:ee.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[_.CTRL,C.A],macShortcut:[_.CMD,C.A],isEditable:!1}),REOPEN_CLOSED_PANEL:ee.createAndAdd({id:"GLOBAL.REOPEN_CLOSED_PANEL",name:"Re-open Closed Panel",shortcut:[_.ALT,_.SHIFT,C.T],macShortcut:[_.OPTION,_.SHIFT,C.T],isEditable:!0}),LINKER:ee.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[_.CTRL,C.L],macShortcut:[_.CMD,C.L]}),LINKER_CLOSE:ee.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[C.ESCAPE],macShortcut:[C.ESCAPE],isEditable:!1}),COPY_VERSION_INFO:ee.createAndAdd({id:"GLOBAL.COPY_VERSION_INFO",name:"Copy Version Info",shortcut:[_.CTRL,_.ALT,C.I],macShortcut:[_.CMD,_.SHIFT,C.I],isEditable:!0}),EXPORT_LOGS:ee.createAndAdd({id:"GLOBAL.EXPORT_LOGS",name:"Export Logs",shortcut:[_.CTRL,_.ALT,_.SHIFT,C.L],macShortcut:[_.CMD,_.OPTION,_.SHIFT,C.L],isEditable:!0}),OPEN_DASHBOARD_LIST:ee.createAndAdd({id:"GLOBAL.OPEN_DASHBOARD_LIST",name:"Open Dashboard List",shortcut:[_.CTRL,_.SHIFT,C.D],macShortcut:[_.CMD,_.SHIFT,C.D],isEditable:!0}),NEXT:ee.createAndAdd({id:"GLOBAL.NEXT",name:"Next",shortcut:[C.ENTER],macShortcut:[C.ENTER],isEditable:!1}),PREVIOUS:ee.createAndAdd({id:"GLOBAL.PREVIOUS",name:"Previous",shortcut:[_.SHIFT,C.ENTER],macShortcut:[_.SHIFT,C.ENTER],isEditable:!1}),UNDO:ee.createAndAdd({id:"GLOBAL.UNDO",name:"Undo",shortcut:[_.CTRL,C.Z],macShortcut:[_.CMD,C.Z],isEditable:!1}),REDO:ee.createAndAdd({id:"GLOBAL.REDO",name:"Redo",shortcut:[_.CTRL,_.SHIFT,C.Z],macShortcut:[_.CMD,_.SHIFT,C.Z],isEditable:!1})};function Nr(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class or extends c.PureComponent{constructor(e){super(e),Nr(this,"inputField",void 0),Nr(this,"searchChangeSelection",void 0),this.inputField=O.createRef(),this.searchChangeSelection=O.createRef()}componentDidMount(){this.setInputPaddingRight()}componentDidUpdate(){this.setInputPaddingRight()}focus(){var e;(e=this.inputField.current)===null||e===void 0||e.focus()}select(){var e;(e=this.inputField.current)===null||e===void 0||e.select()}setInputPaddingRight(){var e=this.inputField.current,t=this.searchChangeSelection.current;if(e&&t){var r=t.getBoundingClientRect().width;e.style.paddingRight="".concat(r,"px")}}render(){var{value:e,placeholder:t,endPlaceholder:r,onBlur:i,onChange:o,className:s,disabled:a,matchCount:l,id:d,onKeyDown:h,"data-testid":p,cursor:m}=this.props,v,f=[{action:()=>m==null?void 0:m.next("forward"),shortcut:Zt.NEXT},{action:()=>m==null?void 0:m.next("back"),shortcut:Zt.PREVIOUS}];return m&&l>1?v=u.jsxs(u.Fragment,{children:[u.jsx(te,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{m.next("back")},icon:us,tooltip:"Previous match (".concat(Zt.PREVIOUS.getDisplayText(),")")}),u.jsxs("span",{className:"search-change-text",children:[m.index!==void 0&&"".concat(m.index+1," of "),l]}),u.jsx(te,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{m.next("forward")},icon:ol,tooltip:"Next match (".concat(Zt.NEXT.getDisplayText(),")")})]}):v=l>0&&u.jsx("span",{className:"search-match",children:l}),u.jsxs("div",{className:$("search-group",s),children:[u.jsx("input",{type:"search",value:e,onBlur:i,onChange:o,onKeyDown:h,className:"form-control",disabled:a,placeholder:t,ref:this.inputField,id:d,"data-testid":p}),l!=null?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"search-change-selection",ref:this.searchChangeSelection,children:v}),u.jsx(re,{actions:f})]}):u.jsxs("span",{className:"search-end-content",children:[(r??"")!==""&&e===""&&u.jsx("span",{className:"search-end-placeholder",children:r}),u.jsx(le,{icon:sl})]})]})}}Nr(or,"defaultProps",{placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0,cursor:void 0});function Rs(n,e,t){return(e=bu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function bu(n){var e=yu(n,"string");return typeof e=="symbol"?e:e+""}function yu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Fs extends c.PureComponent{constructor(e){super(e),Rs(this,"searchInput",void 0),this.searchInput=O.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=_n(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:r,id:i,"data-testid":o}=this.props,{value:s}=this.state;return u.jsx(or,{value:s,placeholder:e,onChange:this.handleChange,className:t,matchCount:r,ref:this.searchInput,id:i,"data-testid":o})}}Rs(Fs,"defaultProps",{placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0});function Hs(n,e,t){return(e=Cu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Cu(n){var e=wu(n,"string");return typeof e=="symbol"?e:e+""}function wu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Su=R.module("ItemListItem");class sr extends c.Component{static handleKeyDown(){return Su.log("ItemListItem.handleKeyDown false"),!1}constructor(e){super(e),Hs(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=O.createRef()}handleBlur(e){var{itemIndex:t,onBlur:r}=this.props;r(t,e)}handleFocus(e){var{itemIndex:t,onFocus:r}=this.props;r(t,e)}handleClick(e){var{itemIndex:t,onClick:r}=this.props;r(t,e)}handleContextMenu(e){var{itemIndex:t,onContextMenu:r}=this.props;r(t,e)}handleDragStart(e){var{itemIndex:t,onDragStart:r}=this.props;r(t,e)}handleDrag(e){var{itemIndex:t,onDrag:r}=this.props;r(t,e)}handleDragOver(e){e.preventDefault();var{itemIndex:t,onDragOver:r}=this.props;r(t,e)}handleDragEnd(e){var{itemIndex:t,onDragEnd:r}=this.props;r(t,e)}handleDrop(e){var{itemIndex:t,onDrop:r}=this.props;r(t,e)}handleDoubleClick(e){var{itemIndex:t,onDoubleClick:r}=this.props;r(t,e)}handleMouseMove(e){var{itemIndex:t,onMouseMove:r}=this.props;r(t,e)}handleMouseDown(e){var{itemIndex:t,onMouseDown:r}=this.props;r(t,e)}handleMouseUp(e){var{itemIndex:t,onMouseUp:r}=this.props;r(t,e)}render(){var{isDraggable:e,isFocused:t,isSelected:r,style:i,children:o,"data-testid":s}=this.props;return u.jsx("div",{className:$("item-list-item",{active:r},{"is-focused":t},{"is-draggable":e}),onKeyDown:sr.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:i,onFocus:this.handleFocus,onBlur:this.handleBlur,draggable:e,"data-testid":s,children:o})}}Hs(sr,"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:{}});var Wn;function Ai(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Li(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ai(Object(t),!0).forEach(function(r){Ve(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ai(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ve(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ri=R.module("ItemList"),Fi=5;class Je extends c.PureComponent{static renderItem(e){var t,r,{item:i}=e;return u.jsx("div",{className:"item-list-item-content",children:i!=null&&((t=(r=i.displayValue)!==null&&r!==void 0?r:i.value)!==null&&t!==void 0?t:"".concat(i))})}constructor(e){super(e),Ve(this,"list",void 0),Ve(this,"listContainer",void 0),Ve(this,"getItemSelected",Gt((i,o)=>Ze.isSelected(o,i),{max:Je.CACHE_SIZE})),Ve(this,"getCachedItem",Gt((i,o,s,a,l,d,h,p)=>{var m=d({item:s,itemIndex:i,isFocused:a,isSelected:l,style:h});return u.jsx(sr,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:p,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:a,isSelected:l,itemIndex:i,style:h,children:m},o)},{max:Je.CACHE_SIZE})),Ve(this,"getOuterElement",Gt(i=>{var o=O.forwardRef((s,a)=>u.jsx("div",Li({ref:a,tabIndex:-1,onKeyDown:i,role:"presentation"},s)));return o.displayName="ItemListOuterElement",o},{max:1e3})),Ve(this,"getInnerElement",Gt(()=>{var i=O.forwardRef((o,s)=>u.jsx("div",Li({className:"item-list-inner-element",ref:s},o)));return i.displayName="ItemListInnerElement",i},{max:1e3})),Ve(this,"getItemData",Gt((i,o,s)=>({items:i,selectedRanges:o,renderItem:s}),{max:1e3})),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=O.createRef(),this.listContainer=O.createRef();var{isStickyBottom:t,selectedRanges:r}=e;this.state={focusIndex:null,mouseDownIndex:null,selectedRanges:r,overscanStartIndex:0,height:null,isDragging:!1,isStuckToBottom:t,scrollOffset:null,mouseX:null,mouseY:null}}componentDidUpdate(e,t){var{selectedRanges:r,itemCount:i}=this.props,{focusIndex:o,isStuckToBottom:s,scrollOffset:a,height:l,selectedRanges:d}=this.state;if(s&&!this.isListAtBottom()&&i>0&&this.scrollToBottom(),(a!==t.scrollOffset||l!==t.height)&&this.sendViewportUpdate(),r!==e.selectedRanges&&r!==d)this.setSelectedRanges(r);else if(d!==t.selectedRanges){var{onSelectionChange:h}=this.props;h(d)}if(o!==t.focusIndex){var{onFocusChange:p}=this.props;p(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:r}=this.state,i=this.listContainer.current.querySelectorAll(t),o=e-r;return i[o]}focusItem(e){var{disableSelect:t}=this.props;if(!t){this.setState({focusIndex:e});var r=this.getElement(e);r instanceof HTMLElement&&r.focus()}}scrollToItem(e){var t=this.getElement(e);t!=null&&t.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){this.setState({focusIndex:e});var{selectedRanges:r}=this.state,i=Ze.isSelected(r,e),o=i||he.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,o,!1)}handleItemDoubleClick(e,t){var{isDoubleClickSelect:r,onSelect:i}=this.props;r&&this.setState(o=>{var{selectedRanges:s}=o;return{selectedRanges:Ze.selectRange(s,[e,e])}},()=>{i(e,t)})}handleItemMouseDown(e,t){var{selectedRanges:r}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(t.button===2&&r.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){Ri.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){Ri.debug2("item focus",e,t.target),this.setState(r=>{var{focusIndex:i}=r;return i!==e?{focusIndex:e}:null})}handleItemMouseMove(e,t){var{isDragSelect:r,isMultiSelect:i,disableSelect:o}=this.props,{mouseDownIndex:s,selectedRanges:a,mouseX:l,mouseY:d}=this.state;if(!(s==null||o)){var h=Math.abs(t.clientX-(l??0)),p=Math.abs(t.clientY-(d??0));h>Fi&&p>Fi&&this.setState({isDragging:!0}),(r||s===e)&&(this.focusItem(e),i?(!r&&!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:r,isDoubleClickSelect:i,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,d=he.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,l,d,r),!i&&!l&&!d&&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:r,onSelect:i}=this.props,{focusIndex:o}=this.state,s=o;if(e.key==="Enter"||e.key===" "){!t&&s!=null&&this.setState({selectedRanges:[[s,s]]},()=>{s!=null&&i(s,e)});return}if(e.key==="ArrowUp")s!=null&&s>=0?s=Math.max(0,s-1):s=r-1;else if(e.key==="ArrowDown")s!=null&&s>=0?s=Math.min(s+1,r-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 d;(d=this.listContainer.current)===null||d===void 0||d.focus()}this.scrollIntoView(s)}}handleScroll(e){var{scrollUpdateWasRequested:t,scrollOffset:r}=e;this.setState(i=>{if(t)return{scrollOffset:r};var{isStickyBottom:o}=this.props,{height:s}=i,a=o&&this.isListAtBottom({scrollOffset:r,height:s});return{isStuckToBottom:a,scrollOffset:r}})}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,r){var i=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?i&&this.deselectItem(e):o&&r?this.getItemSelected(e,s)?i&&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){Ze.validateRange(e),this.setState(t=>{var{selectedRanges:r}=t;return{selectedRanges:Ze.deselectRange(r,e)}})}selectItem(e){var{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){Ze.validateRange(e),this.setState(t=>{var{selectedRanges:r}=t;return{selectedRanges:Ze.selectRange(r,e)}})}setSelectedRanges(e){this.setState({selectedRanges:e})}sendViewportUpdate(){var{scrollOffset:e,height:t}=this.state;if(e!=null&&t!=null){var{onViewportChange:r,rowHeight:i}=this.props,o=Math.floor(e/i),s=o+Math.ceil(t/i);r(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:r,rowHeight:i}=this.props;return e+t>=r*i}renderInnerElement(e){var{index:t,style:r}=e,{items:i,offset:o,renderItem:s,disableSelect:a}=this.props,{focusIndex:l,selectedRanges:d}=this.state;if(t<o||t>=o+i.length)return null;var h=i[t-o];return this.getCachedItem(t,t,h,t===l&&!a,this.getItemSelected(t,d),s,r,a)}render(){var{items:e,itemCount:t,overscanCount:r,renderItem:i,rowHeight:o,"data-testid":s}=this.props,{selectedRanges:a,isStuckToBottom:l}=this.state;return u.jsx(Ll,{className:"item-list-auto-sizer",onResize:this.handleResize,children:d=>{var{width:h,height:p}=d;return u.jsx(Rl,{className:"item-list-scroll-pane",height:p,width:h,initialScrollOffset:l?t*o:0,itemCount:t,itemSize:o,itemData:this.getItemData(e,a,i),onScroll:this.handleScroll,onItemsRendered:this.handleItemsRendered,ref:this.list,outerElementType:this.getOuterElement(this.handleKeyDown),outerRef:this.listContainer,innerElementType:this.getInnerElement(),overscanCount:r,"data-testid":s,children:this.renderInnerElement})}})}}Wn=Je;Ve(Je,"CACHE_SIZE",1e3);Ve(Je,"DEFAULT_ROW_HEIGHT",20);Ve(Je,"DEFAULT_OVERSCAN",10);Ve(Je,"defaultProps",{offset:0,items:[],rowHeight:Wn.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:Wn.DEFAULT_OVERSCAN,renderItem:Wn.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0});var Pu=R.module("ErrorBoundary");class Tu extends c.Component{static getDerivedStateFromError(e){return{error:e}}constructor(e){super(e),this.state={error:void 0}}componentDidCatch(e,t){var{onError:r}=this.props;Pu.error("Error caught by ErrorBoundary",e,t),r==null||r(e,t)}render(){var{children:e,className:t,fallback:r}=this.props,{error:i}=this.state;return i!=null?r??u.jsx("div",{className:t,children:u.jsx(Sn,{errorMessage:"".concat(i),isLoading:!1,isLoaded:!1,"data-testid":"error-boundary-loading"})}):e??null}}function Ou(n){var{on:e,id:t,className:r,isInvalid:i,disabled:o=!1,onClick:s,"data-testid":a}=n;return u.jsx("button",{type:"button",className:$("btn","btn-switch",r,{active:e},{"is-invalid":i}),id:t,onClick:s,disabled:o,"data-testid":a,children:u.jsx("div",{className:"handle"})})}var xu=["children","className","isInvalid","onChange","data-testid"];function Hi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function $i(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Hi(Object(t),!0).forEach(function(r){Iu(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Hi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Iu(n,e,t){return(e=Du(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Du(n){var e=Mu(n,"string");return typeof e=="symbol"?e:e+""}function Mu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ku(n,e){if(n==null)return{};var t,r,i=ju(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function ju(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}var $s=O.forwardRef((n,e)=>{var{children:t,className:r,isInvalid:i,onChange:o,"data-testid":s}=n,a=ku(n,xu),l=xs(e),d=c.useCallback(h=>{o(h.target.value)},[o]);return u.jsx("select",$i($i({ref:l,className:$("custom-select",r,{"is-invalid":i}),onChange:d,"data-testid":s},a),{},{children:t}))});$s.displayName="Select";var qr=O.createContext(new Map);qr.displayName="XComponentMapContext";var Yf=qr.Provider;function Nu(n){var e,t=c.useContext(qr);return(e=t.get(n))!==null&&e!==void 0?e:n.Original}function Ui(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function br(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ui(Object(t),!0).forEach(function(r){Au(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ui(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Au(n,e,t){return(e=Lu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Lu(n){var e=Ru(n,"string");return typeof e=="symbol"?e:e+""}function Ru(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Us(n){var e,t;function r(i,o){var s=Nu(t);return As(n)?u.jsx(s,br(br({},i),{},{ref:o})):u.jsx(s,br({},i))}return r.displayName="XComponent(".concat((e=n.displayName)!==null&&e!==void 0?e:n.name,")"),t=c.forwardRef(r),t.Original=n,t.isXComponent=!0,t}function Fu(){return Pn(al,"No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?")}function Bs(n){return typeof n=="object"&&n!=null&&typeof n.type=="string"&&n.name!=null}function Ks(n){return typeof n=="object"&&n!=null&&typeof n.type=="string"&&n.id!=null}function Qf(n){return Bs(n)||Ks(n)}var Ws=c.createContext(null);Ws.displayName="ObjectFetcherContext";function Jf(n){if(Ks(n))return{id:n.id,type:n.type};if(Bs(n)){var e;return{name:(e=n.name)!==null&&e!==void 0?e:"",type:n.type}}throw new Error("Invalid descriptor: ".concat(n))}function Hu(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 eg(){return Pn(Ws,"No ObjectFetcher available in useObjectFetcher. Was code wrapped in ObjectFetcherContext.Provider?")}function Bi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function $u(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Bi(Object(t),!0).forEach(function(r){Uu(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Bi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Uu(n,e,t){return(e=Bu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Bu(n){var e=Ku(n,"string");return typeof e=="symbol"?e:e+""}function Ku(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Wu=Object.freeze({}),zu=new Map,tg=n=>n.api,ng=n=>n.user,zs=n=>n.storage,Vs=n=>zs(n).commandHistoryStorage,Vu=n=>zs(n).fileStorage,Gu=n=>n.defaultWorkspaceSettings,Gs=n=>{var{workspace:e}=n;return e},Xr=Fl(n=>{for(var e,t,r=(e=(t=Gs(n))===null||t===void 0?void 0:t.data.settings)!==null&&e!==void 0?e:{},i=$u({},Gu(n)),o=Object.keys(r),s=0;s<o.length;s+=1){var a=o[s];r[a]!==void 0&&(i[a]=r[a])}return i}),qu=n=>Xr(n).timeZone,rg=n=>{var e;return(e=Xr(n).notebookSettings)!==null&&e!==void 0?e:Wu},ig=n=>n.activeTool,Xu=n=>{var e;return(e=n.plugins)!==null&&e!==void 0?e:zu},Zu="SET_ACTIVE_TOOL",Yu="SET_API",og="SET_COMMAND_HISTORY_STORAGE",sg="SET_FILE_STORAGE",ag="SET_PLUGINS",Qu="SET_USER",Ju="SET_WORKSPACE",eh="SET_DEFAULT_WORKSPACE_SETTINGS",lg="SET_WORKSPACE_STORAGE",th="SET_SERVER_CONFIG_VALUES";function Ki(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function dt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ki(Object(t),!0).forEach(function(r){nh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ki(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function nh(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=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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var dg=n=>({type:Qu,payload:n}),ug=n=>({type:Yu,payload:n}),qs=n=>({type:Ju,payload:n}),hg=n=>({type:eh,payload:n}),oh=n=>(e,t)=>{e(qs(n));var{storage:r}=t(),{workspaceStorage:i}=r;return i==null?void 0:i.save(n)},sh=n=>(e,t)=>{var{workspace:r}=t(),{data:i}=r??{},o=dt(dt({},r),{},{data:dt(dt(dt({},i),n),{},{settings:dt(dt({},i==null?void 0:i.settings),n.settings)})});return e(oh(o))},cg=n=>(e,t)=>{var{notebookSettings:r}=Xr(t()),i=dt(dt({},r),n);return e(ah({notebookSettings:i}))},ah=n=>e=>e(sh({settings:n})),mg=n=>({type:Zu,payload:n}),pg=n=>({type:th,payload:n});function Wi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function zi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Wi(Object(t),!0).forEach(function(r){lh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Wi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function lh(n,e,t){return(e=dh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function dh(n){var e=uh(n,"string");return typeof e=="symbol"?e:e+""}function uh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function hh(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 r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,i=arguments.length>1?arguments[1]:void 0;switch(i==null?void 0:i.type){case n:{var{id:o,payload:s}=i;return t&&xr({payload:s},{payload:r[o]})?r:zi(zi({},r),{},{[o]:s})}default:return r}}}function Vi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Gi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Vi(Object(t),!0).forEach(function(r){Ar(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Vi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ar(n,e,t){return(e=ch(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ch(n){var e=mh(n,"string");return typeof e=="symbol"?e:e+""}function mh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ph{constructor(){Ar(this,"reducers",{}),Ar(this,"listener",null)}register(e,t){var r;this.reducers=Gi(Gi({},this.reducers),{},{[e]:t}),(r=this.listener)===null||r===void 0||r.call(this,this.reducers)}setListener(e){this.listener=e}}var vh=new ph;function Zr(n,e,t){return(e=fh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function fh(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Fe{static isValid(e,t){return!0}static isSameFormat(e,t){throw new Error("isSameFormat not implemented")}static makeFormat(e,t,r){return{label:e,formatString:t,type:r}}format(e,t){return""}}Zr(Fe,"TYPE_GLOBAL","type-global");Zr(Fe,"TYPE_CONTEXT_PRESET","type-context-preset");Zr(Fe,"TYPE_CONTEXT_CUSTOM","type-context-custom");function St(n,e,t){return(e=bh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function bh(n){var e=yh(n,"string");return typeof e=="symbol"?e:e+""}function yh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var qi=R.module("DateTimeColumnFormatter");class ht extends Fe{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 r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Fe.TYPE_CONTEXT_PRESET;return{label:e,formatString:t,type:r}}static isSameFormat(e,t){return e===t||e!==null&&t!==null&&e.type===t.type&&e.formatString===t.formatString}static makeGlobalFormatStringMap(e,t){var r=t?"'T'":" ",i=e?" z":"";return new Map([["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(r,"HH:mm:ss").concat(i)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSS").concat(i)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSSSSSSSS").concat(i)]])}static getGlobalFormats(e,t){var r=ht.makeGlobalFormatStringMap(e,t);return[...r.keys()]}static makeFormatStringMap(e,t){var r=t!==void 0&&t?"'T'":" ",i=e!==void 0&&e?" z":"";return new Map([["yyyy-MM-dd","yyyy-MM-dd".concat(i)],["MM-dd-yyyy","MM-dd-yyyy".concat(i)],["HH:mm:ss","HH:mm:ss".concat(i)],["HH:mm:ss.SSS","HH:mm:ss.SSS".concat(i)],["HH:mm:ss.SSSSSSSSS","HH:mm:ss.SSSSSSSSS".concat(i)],["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(r,"HH:mm:ss").concat(i)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSS").concat(i)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSSSSSSSS").concat(i)]])}static getFormats(e,t){var r=ht.makeFormatStringMap(e,t);return[...r.keys()]}constructor(e){var{timeZone:t="",showTimeZone:r=!0,showTSeparator:i=!1,defaultDateTimeFormatString:o=ht.DEFAULT_DATETIME_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),St(this,"dh",void 0),St(this,"dhTimeZone",void 0),St(this,"defaultDateTimeFormatString",void 0),St(this,"showTimeZone",void 0),St(this,"showTSeparator",void 0),St(this,"formatStringMap",void 0);var s=t||ht.DEFAULT_TIME_ZONE_ID;try{this.dhTimeZone=e.i18n.TimeZone.getTimeZone(s)}catch{qi.error("Unsupported time zone id",s),this.dhTimeZone=e.i18n.TimeZone.getTimeZone(ht.DEFAULT_TIME_ZONE_ID)}this.dh=e,this.defaultDateTimeFormatString=o,this.showTimeZone=r,this.showTSeparator=i,this.formatStringMap=ht.makeFormatStringMap(r,i)}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]:{},r=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultDateTimeFormatString,i=this.getEffectiveFormatString(r);try{return this.dh.i18n.DateTimeFormat.format(i,e,this.dhTimeZone)}catch{qi.error("Invalid format arguments")}return""}}St(ht,"DEFAULT_DATETIME_FORMAT_STRING","yyyy-MM-dd HH:mm:ss.SSS");St(ht,"DEFAULT_TIME_ZONE_ID","America/New_York");var vt;function et(n,e,t){return(e=Ch(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ch(n){var e=wh(n,"string");return typeof e=="symbol"?e:e+""}function wh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Sh=R.module("DecimalColumnFormatter");class Me extends Fe{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 r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Fe.TYPE_CONTEXT_PRESET,i=arguments.length>3?arguments[3]:void 0;return{label:e,type:r,formatString:t,multiplier:i}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0;return Me.makeFormat(e,t,Fe.TYPE_CONTEXT_PRESET,r)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return Me.makeFormat("Custom Format",e,Fe.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=Me.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),et(this,"defaultFormatString",void 0),et(this,"dh",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,i=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return this.dh.i18n.NumberFormat.format(r,i)}catch{Sh.error("Invalid format arguments")}return""}}vt=Me;et(Me,"DEFAULT_FORMAT_STRING","###,##0.0000");et(Me,"FORMAT_PERCENT",vt.makePresetFormat("Percent","##0.00%"));et(Me,"FORMAT_BASIS_POINTS",vt.makePresetFormat("Basis Points","###,##0 bp",1e4));et(Me,"FORMAT_THOUSANDS",vt.makePresetFormat("Thousands","##0.000 k",.001));et(Me,"FORMAT_MILLIONS",vt.makePresetFormat("Millions","###,##0.000 mm",1e-6));et(Me,"FORMAT_SCIENTIFIC_NOTATION",vt.makePresetFormat("Scientific Notation","0.0000E0"));et(Me,"FORMAT_ROUND",vt.makePresetFormat("Round","###,##0"));et(Me,"FORMAT_ROUND_TWO_DECIMALS",vt.makePresetFormat("0.00","###,##0.00"));et(Me,"FORMAT_ROUND_FOUR_DECIMALS",vt.makePresetFormat("0.0000","###,##0.0000"));var ar;function tn(n,e,t){return(e=_h(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _h(n){var e=Eh(n,"string");return typeof e=="symbol"?e:e+""}function Eh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ph=R.module("IntegerColumnFormatter");class mt extends Fe{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 r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Fe.TYPE_CONTEXT_PRESET,i=arguments.length>3?arguments[3]:void 0;return{label:e,type:r,formatString:t,multiplier:i}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0;return mt.makeFormat(e,t,Fe.TYPE_CONTEXT_PRESET,r)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return mt.makeFormat("Custom Format",e,Fe.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=mt.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),tn(this,"dh",void 0),tn(this,"defaultFormatString",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,i=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return this.dh.i18n.NumberFormat.format(r,i)}catch{Ph.error("Invalid format arguments")}return""}}ar=mt;tn(mt,"DEFAULT_FORMAT_STRING","###,##0");tn(mt,"FORMAT_THOUSANDS",ar.makePresetFormat("Thousands","##0.000 k",.001));tn(mt,"FORMAT_MILLIONS",ar.makePresetFormat("Millions","###,##0.000 mm",1e-6));tn(mt,"FORMAT_SCIENTIFIC_NOTATION",ar.makePresetFormat("Scientific Notation","0.0000E0"));function Ut(n,e,t){return(e=Th(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Th(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class B{}Ut(B,"INTEGER","int");Ut(B,"LONG","long");Ut(B,"DOUBLE","double");Ut(B,"BOOLEAN","bool");Ut(B,"STRING","string");Ut(B,"DATE_TIME","datetime");Ut(B,"LOCAL_TIME","localtime");var Xs=c.createContext(null);Xs.displayName="PluginsContext";var dn=Object.freeze({AUTH_PLUGIN:"AuthPlugin",DASHBOARD_PLUGIN:"DashboardPlugin",WIDGET_PLUGIN:"WidgetPlugin",TABLE_PLUGIN:"TablePlugin",THEME_PLUGIN:"ThemePlugin",ELEMENT_PLUGIN:"ElementPlugin"});function xh(n){return"DashboardPlugin"in n}function Ih(n){return"AuthPlugin"in n}function Dh(n){return"TablePlugin"in n}function vg(n){return xh(n)||Ih(n)||Dh(n)}function Mh(n){return"type"in n&&n.type===dn.DASHBOARD_PLUGIN}function Yr(n){return"type"in n&&n.type===dn.WIDGET_PLUGIN}function kh(n){return"type"in n&&n.type===dn.TABLE_PLUGIN}function jh(n){return"type"in n&&n.type===dn.AUTH_PLUGIN}function Zs(n){return"type"in n&&n.type===dn.THEME_PLUGIN}function Ys(n){return"type"in n&&n.type===dn.ELEMENT_PLUGIN}function fg(n){return Mh(n)||jh(n)||kh(n)||Zs(n)||Yr(n)||Ys(n)}var Qs=R.module("@deephaven/plugin.PluginUtils");function Xi(n,e){return n==null||!Yr(n)?!1:[n.supportedTypes].flat().some(t=>t===e)}function Nh(n){var e=u.jsx(le,{icon:hs});if(!Yr(n))return e;var{icon:t}=n;return t==null?e:c.isValidElement(t)?t:u.jsx(le,{icon:t})}function gg(n){var e=[...n.entries()].filter(t=>Zs(t[1]));return Qs.debug("Getting theme data from plugins",e),e.map(t=>{var[r,i]=t,o=Array.isArray(i.themes)?i.themes:[i.themes];return o.map(s=>{var{name:a,baseTheme:l,styleContent:d}=s;return{baseThemeKey:"default-".concat(l??"dark"),themeKey:ll(r,a),name:a,styleContent:d}})}).flat()}function bg(n){var e=[...n.entries()].filter(t=>Ys(t[1])&&t[1].mapping!=null);return Qs.debug("Getting element plugin mapping",e),new Map(e.flatMap(t=>{var[,r]=t;return Object.entries(r.mapping)}))}function yg(){return Pn(Xs,"No Plugins available in usePlugins. This can happen when plugins have not finished loading or if code is not wrapped in PluginsContext.Provider.")}var Js=c.createContext(null);Js.displayName="PersistentStateContext";function Cg(n){var{initialState:e,onChange:t,children:r}=n,[i,o]=O.useState(0),s=c.useRef({initial:e,initialStateMap:new Map,state:new Map,isTracking:!0}),a=c.useCallback((m,v)=>{s.current.isTracking&&s.current.state.set(m,v)},[]),l=c.useCallback(()=>{s.current.isTracking||(s.current.isTracking=!0,s.current.state=new Map,o(m=>m+1))},[]),d=c.useRef(s.current.initial[Symbol.iterator]()),h=c.useCallback(function(v){var f=s.current.initialStateMap.get(v);if(f)return f;var{value:g,done:b}=d.current.next(),S={value:g,done:b??!1};return s.current.initialStateMap.set(v,S),S},[]);c.useEffect(function(){s.current.isTracking&&(t([...s.current.state.values()]),s.current.isTracking=!1)},[i,t]);var p=c.useMemo(()=>({addState:a,scheduleStateUpdate:l,getInitialState:h,updateId:i}),[a,h,l,i]);return u.jsx(Js.Provider,{value:p,children:r})}const Ah="var(--dh-color-chart-colorway)",Lh="var(--dh-color-chart-grid)",Rh="var(--dh-color-chart-axis-line)",Fh="var(--dh-color-chart-axis-line-zero)",Zi={"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:Ah,gridcolor:Lh,linecolor:Rh,zerolinecolor:Fh,"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 Yi=R.module("ChartTheme");function Hh(){var n,e=cs(Zi);return e.colorway=dl((n=e.colorway)!==null&&n!==void 0?n:"").map(t=>{var[r,i]=t;return ul.normalizeCssColor(e.colorway.substring(r,i+1))}).join(" "),Yi.debug2("Chart theme:",Zi),Yi.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 Qi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function $h(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Qi(Object(t),!0).forEach(function(r){Uh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Qi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Uh(n,e,t){return(e=Bh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Bh(n){var e=Kh(n,"string");return typeof e=="symbol"?e:e+""}function Kh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Wh=c.lazy(()=>Hl(()=>import("./Plot-BXUhBfhF.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url));function zh(n){return u.jsx(c.Suspense,{fallback:u.jsx(Sn,{"data-testid":"lazy-plot-loading"}),children:u.jsx(Wh,$h({},n))})}var Qr=c.createContext(null);Qr.displayName="ChartThemeContext";function wg(n){var{children:e}=n,{activeThemes:t}=Is(),r=c.useMemo(Hh,[t]);return u.jsx(Qr.Provider,{value:r,children:e})}function Vh(){return Pn(Qr,"No ChartThemeContext value found.")}var ea=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 ta(n){return n.componentName!==void 0}function Gh(n){return n.component!==void 0}var na=Object.freeze({type:"default",isClosable:!0,isFocusOnShow:!0,reorderEnabled:!0,title:""});const qh=Object.freeze(Object.defineProperty({__proto__:null,defaultConfig:ea,isGLComponentConfig:ta,isReactComponentConfig:Gh,itemDefaultConfig:na},Symbol.toStringTag,{value:"Module"}));function zn(n,e,t){return(e=Xh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Xh(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Oe{constructor(){zn(this,"_mSubscriptions",void 0),zn(this,"off",this.unbind),zn(this,"trigger",this.emit),this._mSubscriptions={},this._mSubscriptions[Oe.ALL_EVENT]=[]}on(e,t,r){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:r})}emit(e){for(var t=this._mSubscriptions[e],r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[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,i)}catch(p){console.error("Error while emitting event:",p)}}i.unshift(e);for(var l=this._mSubscriptions[Oe.ALL_EVENT],d=0;d<l.length;d++){var h=l[d].ctx||{};try{l[d].fn.apply(h,i)}catch(p){console.error("Error while emitting event to allEventSubs:",p)}}}unbind(e,t,r){if(!this._mSubscriptions[e])throw new Error("No subscriptions to unsubscribe for event "+e);for(var i=!1,o=0;o<this._mSubscriptions[e].length;o++)(!t||this._mSubscriptions[e][o].fn===t)&&(!r||r===this._mSubscriptions[e][o].ctx)&&(this._mSubscriptions[e].splice(o,1),i=!0);if(i===!1)throw new Error("Nothing to unbind for "+e)}}zn(Oe,"ALL_EVENT","__all");function qe(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Lr extends Oe{constructor(e,t,r){super(),qe(this,"width",void 0),qe(this,"height",void 0),qe(this,"title",void 0),qe(this,"parent",void 0),qe(this,"layoutManager",void 0),qe(this,"tab",void 0),qe(this,"_config",void 0),qe(this,"isHidden",!1),qe(this,"beforeCloseHandler",void 0),qe(this,"_element",T(['<div class="lm_item_container">','<div class="lm_content" tabindex="-1"></div>',"</div>"].join(""))),qe(this,"_contentElement",void 0),this.title=ta(e)?e.componentName:"",this.parent=t,this.layoutManager=r,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 r,i,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 d=s.isColumn?"height":"width",h=d==="height"?t:e,p=((r=this[d])!==null&&r!==void 0?r:0)*(1/(((i=a.config[d])!==null&&i!==void 0?i:0)/100)),m=h/p*100,v=(((o=a.config[d])!==null&&o!==void 0?o:0)-m)/(s.contentItems.length-1),f=0;f<s.contentItems.length;f++)if(s.contentItems[f]===a)s.contentItems[f].config[d]=m;else{var g;s.contentItems[f].config[d]=((g=s.contentItems[f].config[d])!==null&&g!==void 0?g:0)+v}return s.callDownwards("setSize"),!0}close(e){var t,r;this._config.isClosable&&(!((t=(r=this.beforeCloseHandler)===null||r===void 0?void 0:r.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 r=this._contentElement[0],i=r.offsetWidth-r.clientWidth,o=r.offsetHeight-r.clientHeight;this._contentElement.width(this.width-i).height(this.height-o),this.emit("resize")}}}const Jh=Object.freeze(Object.defineProperty({__proto__:null,Container:Lr,ItemContainer:Lr},Symbol.toStringTag,{value:"Module"}));function ra(n){var e=location.hash.match(new RegExp(n+"=([^&]*)"));return e?e[1]:null}function ia(n){if(window.location.hash)return ra(n);if(!window.location.search)return null;var e=window.location.search.substr(1).split("&"),t={},r,i;for(i=0;i<e.length;i++)r=e[i].split("="),t[r[0]]=r[1];return t[n]||null}function Jr(n){return window.requestAnimationFrame(n)}function ec(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 qn(){return ct()}function tc(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 ei(n){return T.trim(n.replace(/(<([^>]+)>)/gi,""))}function je(n,e,t){return(e=nc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nc(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Tn extends Oe{constructor(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super(),je(this,"_eElement",void 0),je(this,"_oDocument",void 0),je(this,"_eBody",void 0),je(this,"_destroyAfterMouseUp",void 0),je(this,"_nDelay",400),je(this,"_timeout",void 0),je(this,"timeout",void 0),je(this,"_nDistance",10),je(this,"_nX",0),je(this,"_nY",0),je(this,"_nOriginalX",0),je(this,"_nOriginalY",0),je(this,"_bDragging",!1),this._eElement=e,this._oDocument=T(document),this._eBody=T(document.body),this._destroyAfterMouseUp=r,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,r,i,o,s=this._getCoordinates(e);this._nOriginalX=(t=s.x)!==null&&t!==void 0?t:0,this._nOriginalY=(r=s.y)!==null&&r!==void 0?r:0,(i=this._oDocument)===null||i===void 0||i.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,r;e.preventDefault();var i=this._getCoordinates(e);this._nX=((t=i.x)!==null&&t!==void 0?t:0)-this._nOriginalX,this._nY=((r=i.y)!==null&&r!==void 0?r: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,r,i,o;if(clearTimeout(this._timeout),(t=this._oDocument)===null||t===void 0||t.unbind("mousemove",this.onMouseMove),(r=this._oDocument)===null||r===void 0||r.unbind("mouseup",this.onMouseUp),(i=this._oDocument)===null||i===void 0||(i=i.find("iframe"))===null||i===void 0||i.css("pointer-events",""),this._bDragging===!0&&(this._bDragging=!1,this.emit("dragStop",e,this._nOriginalX+this._nX)),(o=this._eBody)===null||o===void 0||o.removeClass("lm_dragging"),!(this._eElement instanceof Window)){var s;(s=this._eElement)===null||s===void 0||s.removeClass("lm_dragging")}this._destroyAfterMouseUp&&this.destroy()}}_startDrag(){var e,t,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"),(r=this._oDocument)===null||r===void 0||(r=r.find("iframe"))===null||r===void 0||r.css("pointer-events","none"),this.emit("dragStart",this._nOriginalX,this._nOriginalY)}_getCoordinates(e){var t,r;return{x:(t=e.pageX)!==null&&t!==void 0?t:0,y:(r=e.pageY)!==null&&r!==void 0?r:0}}}function Wt(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=oc(n,"string");return typeof e=="symbol"?e:e+""}function oc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class oa{constructor(e,t){Wt(this,"_container",void 0),Wt(this,"_reactComponent",null),Wt(this,"_portalComponent",null),Wt(this,"_originalComponentWillUpdate",null),Wt(this,"_initialState",void 0),Wt(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=Vr.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 r;this._container.setState(t),(r=this._originalComponentWillUpdate)===null||r===void 0||r.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 O.createElement(this._reactClass,t)}}var Xn=["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"],sc=[!0,!1,"row","column","stack","component","close","maximise","minimise","open in new window"];function ti(n){if(Xn.length>36)throw new Error("Too many keys in config minifier map");var e={};return ni(n,e,"_min"),e}function Rr(n){if(Xn.length>36)throw new Error("Too many keys in config minifier map");var e={};return ni(n,e,"_max"),e}function ni(n,e,t){var r=t==="_min"?ac:lc;for(var i in n)if(n.hasOwnProperty(i)){var o=Array.isArray(n)?n[Number.parseInt(i,10)]:n[i];if(typeof o=="object"&&o!=null){var s=o instanceof Array?[]:{};if(Array.isArray(e))e[Number.parseInt(i,10)]=s;else{var a=r(i,Xn);e[a]=s}ni(o,s,t)}else{var l=r(o,sc);if(Array.isArray(e))e[Number.parseInt(i,10)]=l;else{var d=r(i,Xn);e[d]=l}}}}function ac(n,e){if(typeof n=="string"&&n.length===1)return"___"+n;var t=e.indexOf(n);return t===-1?n:t.toString(36)}function lc(n,e){return typeof n=="string"&&n.length===1?e[parseInt(n,36)]:typeof n=="string"&&n.substr(0,3)==="___"?n[3]:n}function yr(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Fr{constructor(e,t){yr(this,"name",void 0),yr(this,"origin",void 0),yr(this,"isPropagationStopped",void 0),this.name=e,this.origin=t,this.isPropagationStopped=!1}stopPropagation(){this.isPropagationStopped=!0}}function jn(n,e,t){return(e=hc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function hc(n){var e=cc(n,"string");return typeof e=="symbol"?e:e+""}function cc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}let sa=class extends Oe{constructor(e){super(),jn(this,"_layoutManager",void 0),jn(this,"_dontPropagateToParent",void 0),jn(this,"_childEventSource",void 0),jn(this,"_boundOnEventFromChild",void 0),this._layoutManager=e,this._dontPropagateToParent=null,this._childEventSource=null,this.on(Oe.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),r=0;r<e;r++)t[r]=arguments[r];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,r="gl_child_event",i=(t=window.opener)===null||t===void 0?void 0:t.document.createEvent("HTMLEvents");i.initEvent(r,!0,!0),i.eventName=r,i.__glArgs=e,i.__gl=this._layoutManager,window.opener.dispatchEvent(i)}_propagateToChildren(e){for(var t=0;t<this._layoutManager.openPopouts.length;t++){var r=this._layoutManager.openPopouts[t].getGlInstance();r&&r!==this._childEventSource&&r.eventHub._$onEventFromParent(e)}}destroy(){T(window).off("gl_child_event",this._boundOnEventFromChild)}};function aa(n,e,t){return n.on(e,t),()=>{n.off(e,t)}}function la(n){return(e,t)=>aa(e,n,t)}function da(n){return function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];e.emit(n,...r)}}function ua(n){return(e,t)=>{var r=c.useRef(null),i=c.useRef(()=>!1);if(r.current!=e||i.current!=t){var o;(o=r.current)===null||o===void 0||o.off(n,i.current),e==null||e.on(n,t)}r.current=e,i.current=t,c.useEffect(()=>()=>{var s;return(s=r.current)===null||s===void 0?void 0:s.off(n,i.current)},[])}}function xt(n){return{listen:la(n),emit:da(n),useListener:ua(n)}}const mc=Object.freeze(Object.defineProperty({__proto__:null,BubblingEvent:Fr,DragListener:Tn,EventEmitter:Oe,EventHub:sa,ReactComponentHandler:oa,animFrame:Jr,filterXss:tc,getHashValue:ra,getQueryStringParam:ia,getUniqueId:qn,listenForEvent:aa,makeEmitFunction:da,makeEventFunctions:xt,makeListenFunction:la,makeUseListenerFunction:ua,minifyConfig:ti,removeFromArray:ec,stripTags:ei,unminifyConfig:Rr},Symbol.toStringTag,{value:"Module"}));function bt(n,e,t){return(e=pc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function pc(n){var e=vc(n,"string");return typeof e=="symbol"?e:e+""}function vc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ha extends Oe{constructor(e,t,r,i,o){super(),bt(this,"isInitialised",!1),bt(this,"_config",void 0),bt(this,"_dimensions",void 0),bt(this,"_parentId",void 0),bt(this,"_indexInParent",void 0),bt(this,"_layoutManager",void 0),bt(this,"_popoutWindow",null),bt(this,"_id",null),this._config=e,this._dimensions=t,this._parentId=r,this._indexInParent=i,this._layoutManager=o,this._createWindow()}toConfig(){var e,t,r,i,o,s,a,l,d,h,p;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:(r=(i=(o=this._popoutWindow)===null||o===void 0?void 0:o.screenX)!==null&&i!==void 0?i:(s=this._popoutWindow)===null||s===void 0?void 0:s.screenLeft)!==null&&r!==void 0?r:0,top:(a=(l=(d=this._popoutWindow)===null||d===void 0?void 0:d.screenY)!==null&&l!==void 0?l:(h=this._popoutWindow)===null||h===void 0?void 0:h.screenTop)!==null&&a!==void 0?a:0},content:(p=this.getGlInstance())===null||p===void 0?void 0:p.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,r=null;if(this._parentId){var i;if(t=T.extend(!0,{},(i=this.getGlInstance())===null||i===void 0?void 0:i.toConfig()).content[0],r=this._layoutManager.root.getItemsById(this._parentId)[0],!r){var o;((o=this._layoutManager.root.contentItems.length)!==null&&o!==void 0?o:0)>0?r=this._layoutManager.root.contentItems[0]:r=this._layoutManager.root}}t&&((e=r)===null||e===void 0||e.addChild(t,this._indexInParent),this.close())}_createWindow(){var e=this._createUrl(),t=Math.floor(Math.random()*1e6).toString(36),r=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,r),!this._popoutWindow)if(this._layoutManager.config.settings.blockedPopoutsThrowError===!0){var i=new Error("Popout blocked");throw i.type="popoutBlocked",i}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=[],r;for(r in e)t.push(r+"="+e[r]);return t.join(",")}_createUrl(){var e={content:this._config},t="gl-window-config-"+qn();e=ti(e);try{localStorage.setItem(t,JSON.stringify(e))}catch(i){throw new Error("Error while writing to localStorage "+i.toString())}var r=document.location.href.split("?");return r.length===1?r[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=fc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function fc(n){var e=gc(n,"string");return typeof e=="symbol"?e:e+""}function gc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Bt extends Oe{constructor(e,t,r,i,o,s){var a,l,d,h,p,m,v,f;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=r,this._layoutManager=i,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 g,b;this._layoutManager.tabDropPlaceholder.width((g=this._contentItem.tab.element.outerWidth(!0))!==null&&g!==void 0?g:0),this._layoutManager.tabDropPlaceholder.height((b=this._contentItem.tab.element.outerHeight(!0))!==null&&b!==void 0?b:0)}if(this.element=T(Bt._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",ei((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,w;this._layoutManager.tabDropPlaceholder.width((S=this._proxyTab.outerWidth(!0))!==null&&S!==void 0?S:0),this._layoutManager.tabDropPlaceholder.height((w=this._proxyTab.outerHeight(!0))!==null&&w!==void 0?w:0)}var y=this._layoutManager.container.offset();this._minX=(d=y==null?void 0:y.left)!==null&&d!==void 0?d:0,this._minY=(h=y==null?void 0:y.top)!==null&&h!==void 0?h:0,this._maxX=((p=this._layoutManager.container.width())!==null&&p!==void 0?p:0)+this._minX,this._maxY=((m=this._layoutManager.container.height())!==null&&m!==void 0?m:0)+this._minY,this._width=(v=this.element.width())!==null&&v!==void 0?v:0,this._height=(f=this.element.height())!==null&&f!==void 0?f:0,this._setDropPosition(e,t),this._layoutManager.emit("itemPickedUp",this._contentItem)}_onDrag(e,t,r){var i,o,s=(i=r.pageX)!==null&&i!==void 0?i:0,a=(o=r.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,r=e.dragProxyHeight;this.element.width(t),this.element.height(r),t-=this._sided?e.headerHeight:0,r-=this._sided?0:e.headerHeight,this.childElementContainer.width(t),this.childElementContainer.height(r),this._contentItem.element.width(t),this._contentItem.element.height(r),this._contentItem.callDownwards("_$show"),this._contentItem.callDownwards("setSize")}}ve(Bt,"_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 Nn(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=yc(n,"string");return typeof e=="symbol"?e:e+""}function yc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ca{constructor(e,t,r){Nn(this,"_element",void 0),Nn(this,"_itemConfig",void 0),Nn(this,"_layoutManager",void 0),Nn(this,"_dragListener",void 0),this._element=e,this._itemConfig=t,this._layoutManager=r,this._dragListener=this._createDragListener()}_createDragListener(){return this._dragListener=new Tn(this._element,!0),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._createDragListener,this),this._dragListener}_onDragStart(e,t){var r=this._itemConfig;typeof r=="function"&&(r=r());var i=this._layoutManager._$normalizeContentItem(T.extend(!0,{},r));new Bt(e,t,this._dragListener,this._layoutManager,i,null)}}function An(n,e,t){return(e=Cc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Cc(n){var e=wc(n,"string");return typeof e=="symbol"?e:e+""}function wc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ma{constructor(e,t,r){An(this,"_element",T(window)),An(this,"_itemConfig",void 0),An(this,"_layoutManager",void 0),An(this,"_dragListener",void 0),this._itemConfig=e,this._layoutManager=t,this._createDragListener(r)}_createDragListener(e){this._dragListener&&this._dragListener.destroy(),this._element&&(this._dragListener=new Tn(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 r=this._itemConfig;typeof r=="function"&&(r=r());var i=this._layoutManager._$normalizeContentItem(T.extend(!0,{},r));new Bt(e,t,this._dragListener,this._layoutManager,i,null)}}}function pa(n,e,t){return(e=Sc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Sc(n){var e=_c(n,"string");return typeof e=="symbol"?e:e+""}function _c(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class On{constructor(){pa(this,"element",T(On._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()}}pa(On,"_template",'<div class="lm_dropTargetIndicator"><div class="lm_inner"></div></div>');function Cr(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=Pc(n,"string");return typeof e=="symbol"?e:e+""}function Pc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class pn{constructor(e,t,r,i){Cr(this,"element",void 0),Cr(this,"_header",void 0),Cr(this,"_action",void 0),this._header=e,this.element=T('<li class="'+r+'" title="'+t+'"></li>'),this._header.on("destroy",this._$destroy,this),this._action=i,this.element.on("click",this._action),this._header.controlsContainer.append(this.element)}_$destroy(){this.element.off(),this.element.remove()}}function Tc(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=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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Lt extends Error{constructor(e,t){super(),Tc(this,"node",void 0),this.name="Configuration Error",this.message=e,this.node=t}}const Ic=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationError:Lt},Symbol.toStringTag,{value:"Module"}));function me(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=Mc(n,"string");return typeof e=="symbol"?e:e+""}function Mc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Ft(n){return n.isStack}function Le(n){return n.isComponent}function va(n){return n.isRoot}class ge extends Oe{constructor(e,t,r,i){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=i,this.config=this._extendItemNode(t),this.type=t.type,this.contentItems=[],this.parent=r,this.layoutManager=e,this._pendingEventPropagations={},this._throttledEvents=["stateChanged"],this.on(Oe.ALL_EVENT,this._propagateEvent,this),t.content&&this._createContentItems(t)}callDownwards(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;r!==!0&&i!==!0&&this[e].apply(this,t);for(var o=0;o<this.contentItems.length;o++)this.contentItems[o].callDownwards(e,t,r);r===!0&&i!==!0&&this[e].apply(this,t)}removeChild(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=this.contentItems.indexOf(e);if(i===-1)throw new Error("Can't remove child item. Unknown content item");if(r!==!0&&this.contentItems[i]._$destroy(),this.contentItems.splice(i,1),(t=this.config.content)===null||t===void 0||t.splice(i,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 r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t=this.layoutManager._$normalizeContentItem(t);var i=this.contentItems.indexOf(e),o=e.element[0].parentNode;if(i===-1)throw new Error("Can't replace child. oldChild is not child of this");o==null||o.replaceChild(t.element[0],e.element[0]),r===!0&&(e.parent=null,e._$destroy()),this.contentItems[i]=t,t.parent=this,Ft(this)&&(this.header.tabs[i].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=[],r=function(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 r(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),r=[],i=0;i<t.length;i++)r.push(t[i].instance);return r}_$getItemsByProperty(e,t){return this.getItemsByFilter(function(r){return r[e]===t})}_$setParent(e){this.parent=e}_$highlightDropZone(e,t,r){var i;(i=this.layoutManager.dropTargetIndicator)===null||i===void 0||i.highlightArea(r)}_$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"),r=null,i=0;i<t.length;i++)r=t[i].getActiveContentItem(),r&&Le(r)&&r.container[e]()}_$destroy(){this.emitBubblingEvent("beforeItemDestroyed"),this.callDownwards("_$destroy",[],!0,!0),this.element.remove(),this.emitBubblingEvent("itemDestroyed")}_$getArea(e){var t,r,i;e=e||this.element;var o=(t=e.offset())!==null&&t!==void 0?t:{left:0,top:0},s=(r=e.width())!==null&&r!==void 0?r:0,a=(i=e.height())!==null&&i!==void 0?i: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 Fr(e,this);this.emit(e,t)}_createContentItems(e){var t;if(!(e.content instanceof Array))throw new Lt("content must be an Array",e);for(var r=0;r<e.content.length;r++)t=this.layoutManager.createContentItem(e.content[r],this),this.contentItems.push(t)}_extendItemNode(e){for(var[t,r]of Object.entries(na)){var i=t;e[i]===void 0&&(e[i]=r)}return e}_propagateEvent(e,t){t instanceof Fr&&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,Jr(this._propagateEventToLayoutManager.bind(this,e,t)))}_propagateEventToLayoutManager(e,t){this._pendingEventPropagations[e]=!1,this.layoutManager.emit(e,t)}}function hn(n,e,t){return(e=kc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function kc(n){var e=jc(n,"string");return typeof e=="symbol"?e:e+""}function jc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class fa extends ge{constructor(e,t,r){var i;Object.entries((i=e.config.settings.defaultComponentConfig)!==null&&i!==void 0?i:{}).forEach(a=>{var[l,d]=a;t[l]===void 0&&(t[l]=d)}),super(e,t,r,T()),hn(this,"config",void 0),hn(this,"componentName",void 0),hn(this,"container",void 0),hn(this,"parent",void 0),hn(this,"instance",void 0),this.config=t,this.parent=r;var o=e.getComponent(this.config.componentName)||e.getFallbackComponent(),s=T.extend(!0,{},this.config.componentState||{});if(o==null)throw new Lt('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 Lr(this.config,this,e),this.instance=new o(this.container,s),this.element=this.container._element}close(){var e;(e=this.parent)===null||e===void 0||e.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(e){this.container.show(),(this.container._config.isFocusOnShow||e)&&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=Nc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Nc(n){var e=Ac(n,"string");return typeof e=="symbol"?e:e+""}function Ac(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Cn extends ge{constructor(e,t,r,i){super(t,r,i,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=i,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,r){var i,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),i=1/this.contentItems.length*100,r===!0){this.emitBubblingEvent("stateChanged");return}for(s=0;s<this.contentItems.length;s++)if(this.contentItems[s]===e)e.config[this._dimension]=i;else{var l;o=((l=this.contentItems[s].config[this._dimension])!==null&&l!==void 0?l:0)*(100-i)/100,this.contentItems[s].config[this._dimension]=o}this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}removeChild(e,t){var r,i=(r=e.config[this._dimension])!==null&&r!==void 0?r: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 d;this.contentItems[a].config[this._dimension]=((d=this.contentItems[a].config[this._dimension])!==null&&d!==void 0?d:0)+i/(this.contentItems.length-1)}if(ge.prototype.removeChild.call(this,e,t),this.contentItems.length===1&&this.config.isClosable===!0){var h;l=this.contentItems[0],this.contentItems=[],(h=this.parent)===null||h===void 0||h.replaceChild(this,l,!0)}else this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}replaceChild(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=e.config[this._dimension];t.config[this._dimension]=i,super.replaceChild(e,t,r),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,r=(this.contentItems.length-1)*this._splitterSize,i=(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-=r:i-=r;for(var l=0;l<this.contentItems.length;l++){var d,h,p=this._isColumn?Math.floor(o*(((d=this.contentItems[l].config.height)!==null&&d!==void 0?d:0)/100)):Math.floor(i*(((h=this.contentItems[l].config.width)!==null&&h!==void 0?h:0)/100));s+=p,a.push(p)}var m=Math.floor((this._isColumn?o:i)-s);return{itemSizes:a,additionalPixel:m,totalWidth:i,totalHeight:o}}_calculateRelativeSizes(){for(var e=0,t=[],r=this._isColumn?"height":"width",i=0;i<this.contentItems.length;i++){var o=this.contentItems[i].config[r];o!=null?e+=o:t.push(this.contentItems[i])}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[r]=(100-e)/t.length;this._respectMinItemWidth();return}if(Math.round(e)>100)for(var a=0;a<t.length;a++)t[a].config[r]=50,e+=50;for(var l=0;l<this.contentItems.length;l++){var d;this.contentItems[l].config[r]=((d=this.contentItems[l].config[r])!==null&&d!==void 0?d: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,r=[],i=0,o=0,s=0,a=[],l;if(!(this._isColumn||!t||this.contentItems.length<=1)){for(var d=this._calculateAbsoluteSizes(),h=0;h<this.contentItems.length;h++){this.contentItems[h];var p=d.itemSizes[h];p<t?(o+=t-p,l={width:t}):(i+=p-t,l={width:p},r.push(l)),a.push(l)}if(!(o===0||o>i)){var m=o/i;s=o;for(var v=0;v<r.length;v++){l=r[v];var f=Math.round((l.width-t)*m);s-=f,l.width-=f}s!==0&&(a[a.length-1].width-=s);for(var g=0;g<this.contentItems.length;g++)this.contentItems[g].config.width=a[g].width/d.totalWidth*100}}}_createSplitter(e){var t;return t=new ga(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,r=0,i=0;i<e.length;++i){var o,s;t=Math.max((o=e[i].minWidth)!==null&&o!==void 0?o:0,t),r=Math.max((s=e[i].minHeight)!==null&&s!==void 0?s:0,r)}return{horizontal:t,vertical:r}}_onSplitterDragStart(e){var t,r,i,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:[]),d=this._isColumn?l.vertical:l.horizontal,h=this._getMinimumDimensions((r=s.after.config.content)!==null&&r!==void 0?r:[]),p=this._isColumn?h.vertical:h.horizontal;this._splitterPosition=0,this._splitterMinPosition=-1*(((i=s.before.element[this._dimension]())!==null&&i!==void 0?i:0)-(d||a)),this._splitterMaxPosition=((o=s.after.element[this._dimension]())!==null&&o!==void 0?o:0)-(p||a)}_onSplitterDrag(e,t,r){var i=this._isColumn?r:t;this._splitterMaxPosition==null||this._splitterMinPosition==null||i>this._splitterMinPosition&&i<this._splitterMaxPosition&&(this._splitterPosition=i,e.element.css(this._isColumn?"top":"left",i))}_onSplitterDragStop(e){var t,r,i,o,s,a=this._getItemsForSplitter(e),l=(t=a.before.element[this._dimension]())!==null&&t!==void 0?t:0,d=(r=a.after.element[this._dimension]())!==null&&r!==void 0?r:0,h=(((i=this._splitterPosition)!==null&&i!==void 0?i:0)+l)/(l+d),p=((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*p,a.after.config[this._dimension]=(1-h)*p,e.element.css({top:0,left:0}),Jr(this.callDownwards.bind(this,"setSize",void 0,void 0,void 0))}}function Ji(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function eo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ji(Object(t),!0).forEach(function(r){Hr(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ji(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Hr(n,e,t){return(e=Lc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Lc(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class $r extends ge{constructor(e,t,r){super(e,eo(eo({},t),{},{type:"root"}),null,T('<div class="lm_goldenlayout lm_item lm_root"></div>')),Hr(this,"childElementContainer",void 0),Hr(this,"_containerElement",void 0),this.isRoot=!0,this.type="root",this.childElementContainer=this.element,this._containerElement=r,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 r,i;e=typeof e>"u"?(r=this._containerElement.width())!==null&&r!==void 0?r:0:e,t=typeof t>"u"?(i=this._containerElement.height())!==null&&i!==void 0?i: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,r){this.layoutManager.tabDropPlaceholder.remove(),super._$highlightDropZone(e,t,r)}_$onDrop(e,t){var r;if(Le(e)&&(r=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this),r._$init(),r.addChild(e),e=r),!this.contentItems.length)this.addChild(e);else{var{side:i}=t,o=i==="left"||i==="right"?"row":"column",s=i==="left"||i==="right"?"width":"height",a=i==="left"||i==="top",l=this.contentItems[0];if(!(l instanceof Cn)||l.type!=o){var d=this.layoutManager.createContentItem({type:o},this);this.replaceChild(l,d),d.addChild(e,a?0:void 0,!0),d.addChild(l,a?void 0:0,!0),l.config[s]=50,e.config[s]=50,d.callDownwards("setSize")}else{var h,p=l.contentItems[a?0:l.contentItems.length-1];l.addChild(e,a?0:void 0,!0),p.config[s]=((h=p.config[s])!==null&&h!==void 0?h:0)*.5,e.config[s]=p.config[s],l.callDownwards("setSize")}}}}function to(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function zt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?to(Object(t),!0).forEach(function(r){Ne(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):to(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ne(n,e,t){return(e=Fc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Fc(n){var e=Hc(n,"string");return typeof e=="symbol"?e:e+""}function Hc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ur extends ge{constructor(e,t,r){var i,o,s,a,l,d,h,p,m;super(e,t,r,T('<div class="lm_item lm_stack"></div>')),Ne(this,"_activeContentItem",null),Ne(this,"_header",void 0),Ne(this,"childElementContainer",T('<div class="lm_items"></div>')),Ne(this,"header",void 0),Ne(this,"parent",void 0),Ne(this,"isStack",!0),Ne(this,"_dropSegment",null),Ne(this,"_contentAreaDimensions",null),Ne(this,"_dropIndex",void 0),Ne(this,"_side",void 0),Ne(this,"_sided",!1),Ne(this,"config",void 0),this.parent=r,this.config=t;var v=e.config;this._side=!1,this._header={show:((i=v.settings)===null||i===void 0?void 0:i.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:(d=v.settings)!==null&&d!==void 0&&d.showCloseIcon?(h=v.labels)===null||h===void 0?void 0:h.close:void 0,minimise:(p=(m=v.labels)===null||m===void 0?void 0:m.minimise)!==null&&p!==void 0?p:void 0},v.header&&(this._header=zt(zt({},this._header),v.header)),t.header&&(this._header=zt(zt({},this._header),t.header)),t.content&&t.content[0]&&t.content[0].header&&(this._header=zt(zt({},this._header),t.content[0].header)),this.header=new pt(e,this),this.element.append(this.header.element),this.element.append(this.childElementContainer),this._setupHeaderPosition(),this._$validateClosability()}setSize(){var e,t,r,i,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=((r=this.element.width())!==null&&r!==void 0?r:0)-(this._sided?s:0),l=((i=this.element.height())!==null&&i!==void 0?i: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,t){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),Le(e)?e._$show(t):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,r=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(r-1,0)]):this._activeContentItem=null),this._$validateClosability(),this.emitBubblingEvent("stateChanged")}_$validateClosability(){for(var e=this.header._isClosable(),t=0,r=this.contentItems.length;t<r;t++){var i;if(!e)break;e=(i=this.contentItems[t].config.isClosable)!==null&&i!==void 0?i:!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",r=this._dropSegment==="left"||this._dropSegment==="right",i=this._dropSegment==="top"||this._dropSegment==="left",o=this.parent instanceof Cn&&(t&&this.parent.isColumn||r&&this.parent.isRow),s=t?"column":"row",a=t?"height":"width";if(Le(e)){var l=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this);l._$init(),l.addChild(e),e=l}if(o){var d,h=this.parent.contentItems.indexOf(this);this.parent.addChild(e,i?h:h+1,!0),this.config[a]=((d=this.config[a])!==null&&d!==void 0?d:0)*.5,e.config[a]=this.config[a],this.parent.callDownwards("setSize")}else{var p,m=this.layoutManager.createContentItem({type:s},this);(p=this.parent)===null||p===void 0||p.replaceChild(this,m),m.addChild(e,i?0:void 0,!0),m.addChild(this,i?void 0:0,!0),this.config[a]=50,e.config[a]=50,m.callDownwards("setSize")}}_$highlightDropZone(e,t){if(this._contentAreaDimensions)for(var[r,i]of Object.entries(this._contentAreaDimensions)){var o=i.hoverArea;if(o.x1<e&&o.x2>e&&o.y1<t&&o.y2>t){r==="header"?(this._dropSegment="header",this._highlightHeaderDropZone(e)):(this._resetHeaderDropZone(),this._highlightBodyDropZone(r));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 r=t.x2-t.x1,i=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+r*.25,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x1+r*.5,y2:t.y2}},this._contentAreaDimensions.top={hoverArea:{x1:t.x1+r*.25,y1:t.y1,x2:t.x1+r*.75,y2:t.y1+i*.5},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y1+i*.5}},this._contentAreaDimensions.right={hoverArea:{x1:t.x1+r*.75,y1:t.y1,x2:t.x2,y2:t.y2},highlightArea:{x1:t.x1+r*.5,y1:t.y1,x2:t.x2,y2:t.y2}},this._contentAreaDimensions.bottom={hoverArea:{x1:t.x1+r*.25,y1:t.y1+i*.5,x2:t.x1+r*.75,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1+i*.5,x2:t.x2,y2:t.y2}},super._$getArea(this.element))}_highlightHeaderDropZone(e){var t,r,i,o,s,a,l,d,h,p,m,v,f,g,b,S,w=this.header.tabs.length;if(w===0){var y,D,V,X,G,A,M,Q,W=this.header.element.offset();(y=this.layoutManager.dropTargetIndicator)===null||y===void 0||y.highlightArea({x1:(D=W==null?void 0:W.left)!==null&&D!==void 0?D:0,x2:((V=W==null?void 0:W.left)!==null&&V!==void 0?V:0)+100,y1:(X=(G=this.header.element.offset())===null||G===void 0?void 0:G.top)!==null&&X!==void 0?X:0,y2:((A=(M=this.header.element.offset())===null||M===void 0?void 0:M.top)!==null&&A!==void 0?A:0)+((Q=this.header.element.innerHeight())!==null&&Q!==void 0?Q:0)});return}var k=this.header.tabsContainer,z=(t=k.get(0))===null||t===void 0?void 0:t.getBoundingClientRect(),F=(r=this.layoutManager.tabDropPlaceholder.get(0))===null||r===void 0?void 0:r.getBoundingClientRect();if(!(!z||!F)){e<z.left?e=z.left+1:e>z.right&&(e=z.right-1);var j,H;if(!(F.left<e&&e<F.right)){for(var U=0;U<w;U++){var ce;if(j=this.header.tabs[U].element,H=(ce=j.get(0))===null||ce===void 0?void 0:ce.getBoundingClientRect(),H&&H.left<e&&e<H.right){this._dropIndex=U;break}}if(j&&H&&e<H.left+H.width*.5)j.before(this.layoutManager.tabDropPlaceholder);else if(j){var tt;this._dropIndex=Math.min(((tt=this._dropIndex)!==null&&tt!==void 0?tt:0)+1,w),j.after(this.layoutManager.tabDropPlaceholder)}}var Ge=(i=(o=this.layoutManager.tabDropPlaceholder.offset())===null||o===void 0?void 0:o.left)!==null&&i!==void 0?i:0;Ge=Math.max(Ge,(s=(a=this.header.tabsContainer.offset())===null||a===void 0?void 0:a.left)!==null&&s!==void 0?s:0);var x=Ge+((l=this.layoutManager.tabDropPlaceholder.width())!==null&&l!==void 0?l:0);x=Math.min(x,((d=(h=this.header.tabsContainer.offset())===null||h===void 0?void 0:h.left)!==null&&d!==void 0?d:0)+((p=this.header.tabsContainer.innerWidth())!==null&&p!==void 0?p:0)),(m=this.layoutManager.dropTargetIndicator)===null||m===void 0||m.highlightArea({x1:Ge,x2:x,y1:(v=(f=this.header.element.offset())===null||f===void 0?void 0:f.top)!==null&&v!==void 0?v:0,y2:((g=(b=this.header.element.offset())===null||b===void 0?void 0:b.top)!==null&&g!==void 0?g:0)+((S=this.header.element.innerHeight())!==null&&S!==void 0?S:0)})}}_resetHeaderDropZone(){this.layoutManager.tabDropPlaceholder.remove()}_setupHeaderPosition(){var e=["right","left","bottom"].some(r=>r===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,r=(t=this._contentAreaDimensions)===null||t===void 0||(t=t[e])===null||t===void 0?void 0:t.highlightArea;if(r){var i;(i=this.layoutManager.dropTargetIndicator)===null||i===void 0||i.highlightArea(r)}this._dropSegment=e}}const $c=Object.freeze(Object.defineProperty({__proto__:null,AbstractContentItem:ge,Component:fa,ContentItem:ge,Root:$r,RowOrColumn:Cn,Stack:Ur,isComponent:Le,isRoot:va,isStack:Ft},Symbol.toStringTag,{value:"Module"}));function lt(n,e,t){return(e=Uc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Uc(n){var e=Bc(n,"string");return typeof e=="symbol"?e:e+""}function Bc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class xn{constructor(e,t){var r;lt(this,"header",void 0),lt(this,"contentItem",void 0),lt(this,"element",T(xn._template)),lt(this,"titleElement",void 0),lt(this,"closeElement",void 0),lt(this,"isActive",!1),lt(this,"_layoutManager",void 0),lt(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,(r=this._layoutManager.config.settings)!==null&&r!==void 0&&r.reorderEnabled&&t.config.reorderEnabled&&(this._dragListener=new Tn(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.element.on("mouseup",this._onMouseUp),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),Le(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.element.off("mouseup",this._onMouseUp),this.closeElement.off("click",this._onCloseClick),Le(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 r;(r=this.contentItem.parent)!==null&&r!==void 0&&r.isMaximised&&this.contentItem.parent.toggleMaximise(),this._dragListener&&new Bt(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(){Le(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.element.removeClass("lm_focusin")}_onTabClick(e){if(!e||e.button===0){var t,r=this.header.parent.getActiveContentItem();this.contentItem!==r&&Le(this.contentItem)?this.header.parent.setActiveContentItem(this.contentItem):Le(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.contentItem.container._contentElement.focus(),Le(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(),Le(this.contentItem)?this.contentItem.container.close():this.header.parent.removeChild(this.contentItem)}_onMouseUp(e){e.button===1&&(e.preventDefault(),e.stopPropagation())}_onCloseMousedown(e){e.stopPropagation()}}lt(xn,"_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=Kc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Kc(n){var e=Wc(n,"string");return typeof e=="symbol"?e:e+""}function Wc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class pt extends Oe{constructor(e,t){var r,i;super(),q(this,"layoutManager",void 0),q(this,"element",T(pt._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(pt._nextButtonTemplate)),q(this,"tabPreviousButton",T(pt._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,(r=this.layoutManager.config.settings)!==null&&r!==void 0&&r.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=(i=this.layoutManager.config.settings)===null||i===void 0?void 0:i.tabControlOffset,this._createControls()}createTab(e,t){for(var r=0;r<this.tabs.length;r++)if(this.tabs[r].contentItem===e)return;var i=new xn(this,e);if(this.tabs.length===0){this.tabs.push(i),this.tabsContainer.append(i.element);return}t===void 0&&(t=this.tabs.length),t>0?this.tabs[t-1].element.after(i.element):this.tabs[0].element.before(i.element),this.tabs.splice(t,0,i),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,r,i,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[(i=this.parent.config.activeItemIndex)!==null&&i!==void 0?i:0].element.get(0))===null||t===void 0||(r=t.scrollIntoView)===null||r===void 0||r.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 r=Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX;if(e.deltaMode===WheelEvent.DOM_DELTA_PAGE){var i;r*=(i=this.tabsContainer.innerWidth())!==null&&i!==void 0?i:1}else e.deltaMode===WheelEvent.DOM_DELTA_LINE&&(r*=100/3);t.scrollLeft+=Math.round(r)}}_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 r,i,o,s,a;if(((r=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&r!==void 0?r: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 d,h;l.scrollLeft=(d=(h=this.tabsContainer.get(0))===null||h===void 0?void 0:h.scrollWidth)!==null&&d!==void 0?d:0}}}_handlePreviousButtonMouseDown(){for(var e,t=this.tabs.length-1;t>=0;t-=1){var r,i,o;if(((r=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&r!==void 0?r: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,r;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)===((r=this.tabsContainer.get(0))===null||r===void 0?void 0:r.scrollWidth)?this.tabNextButton.prop("disabled",!0):(this.tabNextButton.prop("disabled",!1),this.tabPreviousButton.first().prop("disabled",!1))}_handleScrollRepeat(e,t){var r,i=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-i),this.isDraggingTab&&this.parent._highlightHeaderDropZone(a.left-1),this.tabsContainer.scrollLeft()===0){this._checkScrollArrows();return}}else if(e===this.SCROLL_RIGHT){var l,d;if(this.tabsContainer.scrollLeft(t+i),this.isDraggingTab&&this.parent._highlightHeaderDropZone(a.right+1),((l=this.tabsContainer.scrollLeft())!==null&&l!==void 0?l:0)+((d=this.tabsContainer.innerWidth())!==null&&d!==void 0?d:0)===s.scrollWidth){this._checkScrollArrows();return}}window.cancelAnimationFrame((r=this.rAF)!==null&&r!==void 0?r:-1),this.rAF=window.requestAnimationFrame(h=>{var p,m,v=o||h,f=h-v,g=this.START_SPEED*f+.5*this.ACCELERATION*(f*f);g=Math.min(g,(p=(m=this.tabsContainer.get(0))===null||m===void 0?void 0:m.scrollWidth)!==null&&p!==void 0?p:1/0),this._handleScrollRepeat(e,t,g,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,r,i,o;if(o=this.layoutManager.config.labels.tabDropdown,this.layoutManager.config.labels.tabNextLabel,this.layoutManager.config.labels.tabPreviousLabel,this.tabDropdownButton=new pn(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),r=this._getHeaderSetting("popout"),new pn(this,r,"lm_popout",t)),this._getHeaderSetting("maximise")){i=this.parent.toggleMaximise.bind(this.parent);var s=this._getHeaderSetting("maximise"),a=this._getHeaderSetting("minimise"),l=new pn(this,s,"lm_maximise",i);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),r=this._getHeaderSetting("close"),this.closeButton=new pn(this,r,"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,d){if(d==null||d.length<2)return-1;for(var h=(a+l+d.length)%d.length;h!==a;){if(d.eq(h).css("display")!=="none")return h;h=(h+l+d.length)%d.length}return a}if(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1){var r,i;e.preventDefault(),(r=this.tabDropdownList)===null||r===void 0||r.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=t(this.dropdownKeyIndex,1,this.tabDropdownList),(i=this.tabDropdownList)===null||i===void 0||i.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 r,i;((r=(i=this.tabs[t].contentItem.config.title)===null||i===void 0?void 0:i.toLowerCase().indexOf(e.target.value.toLowerCase()))!==null&&r!==void 0?r:-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,r;this.isDropdownShown&&(e&&(t=this.tabDropdownContainer.get(0))!==null&&t!==void 0&&t.contains(e.target)||e&&((r=this.tabDropdownButton)===null||r===void 0?void 0:r.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,r,i;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=(r=T(window).height())!==null&&r!==void 0?r:0,l=(i=T(window).width())!==null&&i!==void 0?i:0;if(this.tabDropdownButton){var d=this.tabDropdownButton.element[0].getBoundingClientRect(),h=o<a-d.bottom,p=!h&&d.bottom>a*.6,m=Math.min(d.left+(p?d.width:0),l-s.width-this.PADDING),v=p?Math.max(d.top-o,this.PADDING):d.bottom,f=a-v-this.PADDING;this.tabDropdownContainer.css({"max-height":f,top:v,left:m})}}}}_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 r;(r=this.tabDropdownButton)===null||r===void 0||r.element.hide(),this.tabNextButton.hide(),this.tabPreviousButton.hide(),this.isOverflowing=!1}this.isOverflowing&&this._checkScrollArrows()}}}}q(pt,"_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(pt,"_previousButtonTemplate",['<ul class="lm_controls">','<li class="lm_tabpreviousbutton"></li>',"</ul>"].join(""));q(pt,"_nextButtonTemplate",['<li class="lm_tabnextbutton"></li>'].join(""));function cn(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=Vc(n,"string");return typeof e=="symbol"?e:e+""}function Vc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ga{constructor(e,t,r){cn(this,"_isVertical",void 0),cn(this,"_size",void 0),cn(this,"_grabSize",void 0),cn(this,"_dragListener",void 0),cn(this,"element",void 0),this._isVertical=e,this._size=t,this._grabSize=r<t?t:r,this.element=this._createElement(),this._dragListener=new Tn(this.element)}on(e,t,r){var i;(i=this._dragListener)===null||i===void 0||i.on(e,t,r)}_$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 r=this._grabSize-this._size,i=r/2;return this._isVertical?(e.css("top",-i),e.css("height",this._size+r),t.addClass("lm_vertical"),t.height(this._size)):(e.css("left",-i),e.css("width",this._size+r),t.addClass("lm_horizontal"),t.width(this._size)),t}}const Gc=Object.freeze(Object.defineProperty({__proto__:null,BrowserPopout:ha,DragProxy:Bt,DragSource:ca,DragSourceFromEvent:ma,DropTargetIndicator:On,Header:pt,HeaderButton:pn,Splitter:ga,Tab:xn},Symbol.toStringTag,{value:"Module"}));var qc={config:qh,container:Jh,controls:Gc,errors:Ic,items:$c,utils:mc};function no(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function xe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?no(Object(t),!0).forEach(function(r){Z(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):no(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Z(n,e,t){return(e=Xc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Xc(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ro=["column","row","stack","component"];class ri extends Oe{static isLayoutItemConfig(e){return ro.includes(e.type)}static minifyConfig(e){return ti(e)}static unminifyConfig(e){return Rr(e)}constructor(e,t){super(),Z(this,"isInitialised",!1),Z(this,"_isFullPage",!1),Z(this,"_resizeTimeoutId",void 0),Z(this,"_components",{"lm-react-component":oa}),Z(this,"_fallbackComponent",void 0),Z(this,"_itemAreas",[]),Z(this,"_maximisedItem",null),Z(this,"_maximisePlaceholder",T('<div class="lm_maximise_place"></div>')),Z(this,"_creationTimeoutPassed",!1),Z(this,"_subWindowsCreated",!1),Z(this,"_dragSources",[]),Z(this,"_updatingColumnsResponsive",!1),Z(this,"_firstLoad",!0),Z(this,"_reactChildMap",new Map),Z(this,"_reactChildren",null),Z(this,"_initialHeaderHeight",void 0),Z(this,"width",null),Z(this,"height",null),Z(this,"root",void 0),Z(this,"openPopouts",[]),Z(this,"selectedItem",null),Z(this,"isSubWindow",!1),Z(this,"eventHub",new sa(this)),Z(this,"config",void 0),Z(this,"container",void 0),Z(this,"_originalContainer",void 0),Z(this,"dropTargetIndicator",null),Z(this,"tabDropPlaceholder",T('<div class="lm_drop_tab_placeholder"></div>')),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._windowKeydown=this._windowKeydown.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")}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 r=()=>{if(this._components[e]===void 0)throw new Error("Component "+e+" is not registered");delete this._components[e]};return r}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:xe({},this.config.settings),dimensions:xe({},this.config.dimensions),labels:xe({},this.config.labels),content:[]},r=function(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 d=0;d<a.contentItems.length;d++)s.content[d]={},r(s.content[d],a.contentItems[d])}};e?r(t,{contentItems:[e]}):r(t,this.root),this._$reconcilePopoutWindows(),t.openPopouts=[];for(var i=0;i<this.openPopouts.length;i++)t.openPopouts.push(this.openPopouts[i].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 On,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 r=this._reactChildMap.get(e);r===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 r,i;if(this.width=(r=e??this.container.width())!==null&&r!==void 0?r:0,this.height=(i=t??this.container.height())!==null&&i!==void 0?i: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"),T(window).off("keydown",this._windowKeydown),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 r,i;if(typeof e.type!="string")throw new Lt("Missing parameter 'type'",e);if(e.type==="react-component"&&(e.type="component",e.componentName="lm-react-component"),!ri.isLayoutItemConfig(e))throw i="Unknown type '"+e.type+"'. Valid types are "+ro.join(","),new Lt(i);return e.type==="component"&&!(t instanceof Ur)&&t&&!(this.isSubWindow===!0&&t instanceof $r)&&(e={type:"stack",width:e.width,height:e.height,content:[e]}),e.id=(r=e.id)!==null&&r!==void 0?r:qn(),e.type==="stack"?new Ur(this,e,t):e.type==="row"?new Cn(!1,this,e,t):e.type==="column"?new Cn(!0,this,e,t):new fa(this,e,t)}createPopout(e,t,r,i){var o=[],s=e instanceof ge,a=this;if(s){var l;o=this.toConfig(e).content,r=qn();for(var d=e.parent,h=e;((p=d)===null||p===void 0?void 0:p.contentItems.length)===1&&!d.isRoot;){var p;h=d,d=d.parent}if((l=d)===null||l===void 0||l.addId(r),i==null||Number.isNaN(i)){var m;i=(m=d)===null||m===void 0?void 0:m.contentItems.indexOf(h)}}else e instanceof Array?o=e:o=[e];if(!t&&s){var v,f,g,b=window.screenX||window.screenLeft,S=window.screenY||window.screenTop,w=(v=e.element.offset())!==null&&v!==void 0?v:{left:0,top:0};t={left:b+w.left,top:S+w.top,width:(f=e.element.width())!==null&&f!==void 0?f:0,height:(g=e.element.height())!==null&&g!==void 0?g: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||!r||i===void 0)){var y=new ha(o,t,r,i,this);return y.on("initialised",function(){a.emit("windowOpened",y)}),y.on("closed",function(){a._$reconcilePopoutWindows()}),this.openPopouts.push(y),y}}createDragSource(e,t){this.config.settings.constrainDragToContainer=!1;var r=new ca(e,t,this);return this._dragSources.push(r),r}createDragSourceFromEvent(e,t){return this.config.settings.constrainDragToContainer=!1,new ma(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,r;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((r=this.container.height())!==null&&r!==void 0?r: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 r=1/0,i=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&&r>s.surface&&(r=s.surface,i=s)}return i}_$createRootItemAreas(){var e=50,t=xe({},this.root._$getArea()),r=[xe(xe({},t),{},{side:"left",x2:t.x1+e}),xe(xe({},t),{},{side:"right",x1:t.x2-e}),xe(xe({},t),{},{side:"top",y2:t.y1+e}),xe(xe({},t),{},{side:"bottom",y1:t.y2-e})];r.forEach(i=>{i.surface=(i.x2-i.x1)*(i.y2-i.y1)}),this._itemAreas.push(...r)}_$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 r=e[t];if(Ft(r)){var i=r._$getArea();if(i!==null)if(i instanceof Array)this._itemAreas=this._itemAreas.concat(i);else{var o;this._itemAreas.push(i);var s=xe(xe({},i),(o=i.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 r=this.createContentItem(e,t??null);return r.callDownwards("_$init"),r}else throw new Error("Invalid contentItem")}_$reconcilePopoutWindows(){for(var e=[],t=0;t<this.openPopouts.length;t++){var r;((r=this.openPopouts[t].getWindow())===null||r===void 0?void 0:r.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=r=>{if(e.push(r),r.contentItems instanceof Array)for(var i=0;i<r.contentItems.length;i++)t(r.contentItems[i])};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).on("keydown",this._windowKeydown)}_windowBlur(){this.root.element.addClass("lm_window_blur")}_windowFocus(){this.root.element.removeClass("lm_window_blur")}_windowKeydown(e){if(e.key==="Escape"&&this._maximisedItem!==null){var t=document.activeElement;if(t&&(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.tagName==="SELECT"||t.isContentEditable))return;this._maximisedItem.toggleMaximise()}}_onResize(){clearTimeout(this._resizeTimeoutId),this._resizeTimeoutId=window.setTimeout(this.updateSize.bind(this),100)}_createConfig(e){var t,r=ia("gl-window");r&&(this.isSubWindow=!0,e=JSON.parse(localStorage.getItem(r)||"{}"),e=Rr(e),localStorage.removeItem(r)),e=T.extend(!0,{},ea,e);var i=function(s){for(var a in s){var l=s[a];a!=="props"&&typeof l=="object"&&l!=null?i(l):a==="type"&&l==="react-component"&&(s.type="component",s.componentName="lm-react-component")}};return i(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=ei((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 Lt(t,e);if(e.content.length>1)throw t="Top level content can't contain more then one element.",new Lt(t,e);this.root=new $r(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,r=e*t;if(!(this.width==null||r<=this.width)){this._updatingColumnsResponsive=!0;for(var i=Math.max(Math.floor(this.width/t),1),o=e-i,s=this.root.contentItems[0],a=this._findAllStackContainers()[0],l=0;l<o;l++){var d=s.contentItems[s.contentItems.length-1];this._addChildContentItemsToContainer(a,d)}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(r){e.addChild(r),t.removeChild(r,!0)}):t.contentItems.forEach(r=>{this._addChildContentItemsToContainer(e,r)})}_findAllStackContainers(){var e=[];return this._findAllStackContainersRecursive(e,this.root),e}_findAllStackContainersRecursive(e,t){t.contentItems.forEach(r=>{Ft(r)?e.push(r):r.isComponent||this._findAllStackContainersRecursive(e,r)})}}Z(ri,"__lm",qc);const io={"tab-height":"28px","drag-border-width":"5px"},oo=Object.freeze({tabHeight:parseInt(io["tab-height"],10),dragBorderWidth:parseInt(io["drag-border-width"],10)});function so(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function st(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?so(Object(t),!0).forEach(function(r){ba(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):so(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ba(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var yt=R.module("LayoutUtils");function ya(n){return n.componentName!==void 0}function _t(n){var e=n;return(ya(n)&&n.componentName==="lm-react-component"||n.type==="react-component")&&e.component!==void 0}function Ln(n){return n.focus!==void 0}function ao(n){return n.type==="stack"}class E{static activateTab(e,t){var r=E.getStackForRoot(e,t,!1);if(!r){yt.error("Could not find stack for config",t);return}var i=E.getContentItemInStack(r,t);i&&r.setActiveContentItem(i)}static isActiveTab(e,t){var r=E.getStackForRoot(e,t,!1);if(!r)return yt.error("Could not find stack for config",t),!1;var i=E.getContentItemInStack(r,t),o=r.getActiveContentItem();return o===i}static addStack(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(va(e)){var r={type:t?"column":"row"};(e.contentItems==null||e.contentItems.length===0)&&e.addChild(r);var i=e.contentItems[0],o=t?i.isColumn:i.isRow;if(!o){e.removeChild(i,!0),e.addChild(r);var s=document.activeElement;e.contentItems[0].addChild(i),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;if(!l){var d,h,p=e.layoutManager.createContentItem({type:t?"row":"column",height:(d=a.config)===null||d===void 0?void 0:d.height,width:(h=a.config)===null||h===void 0?void 0:h.width},e);e.replaceChild(a,p),e.contentItems[e.contentItems.length-1].addChild(a),a=e.contentItems[e.contentItems.length-1]}return this.addStack(a,!t)}static getAllStackContainers(e){return e._findAllStackContainers()}static getFocusedStackIndex(e){return e.findIndex(t=>t.header.tabs.some(r=>r.element[0].classList.contains("lm_focusin")))}static getFocusedStack(e){var t=E.getAllStackContainers(e),r=E.getFocusedStackIndex(t);return t[r]}static getStackById(e,t){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(i&&Ft(e)&&e.contentItems.length===0)return e;if(t===((r=e.config)===null||r===void 0?void 0:r.id)){if(Ft(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,i);if(s)return s}return null}static getContentItemById(e,t){var r;if(((r=e.config)===null||r===void 0?void 0:r.id)===t)return e;if(e.contentItems==null)return null;for(var i=0;i<e.contentItems.length;i+=1){var o=this.getContentItemById(e.contentItems[i],t);if(o)return o}return null}static getStackForConfig(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(r&&Ft(e)&&e.contentItems.length===0)return e;if(e.contentItems==null)return null;for(var i=0;i<e.contentItems.length;i+=1){var o=e.contentItems[i];if(o.isComponent&&o.config!=null&&mi(o.config,t))return e;var s=this.getStackForConfig(o,t,r);if(s)return s}return null}static getStackForRoot(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=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&&i&&(s=this.getStackForConfig(e,{component:t.component},o)),!s&&r&&(s=this.addStack(e)),s}static getStackForComponentTypes(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=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,d=E.getStackForRoot(e,{component:a},r&&l,i,o);if(d)return d}return null}static getContentItemInStack(e,t){if(!e)return null;for(var r=0;r<e.contentItems.length;r+=1){var i=e.contentItems[r];if(i.isComponent&&i.config!=null&&mi(i.config,t))return i}return null}static dehydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var r=[],i=0;i<e.length;i+=1){var o=e[i],{content:s}=o;if(_t(o)){var a=t(o.component,o);a!=null?r.push(a):yt.debug2('dehydrateLayoutConfig: skipping unmapped component "'.concat(o.component,'"'))}else if(s){var l=st(st({},o),{},{content:E.dehydrateLayoutConfig(s,t)});r.push(l)}else r.push(o)}return r}static getTabPoint(e){var{tab:t}=e;if(t==null)throw new Error("Cannot get tab for panel container ".concat(e));var r=t.element[0].getBoundingClientRect();return[r.left+r.width*.5,r.bottom-8]}static dropLayoutMinorChange(e){for(var t=0;t<e.length;t+=1){var r=e[t],{content:i}=r;i!==void 0?(ao(r)&&delete r.activeItemIndex,E.dropLayoutMinorChange(i)):_t(r)&&r.component==="IrisGridPanel"&&r.props.panelState!=null&&(delete r.id,r.props.panelState.irisGridState.sorts=[],r.props.panelState.irisGridState.quickFilters=[],r.props.panelState.gridState.isStuckToBottom=!1,r.props.panelState.gridState.isStuckToRight=!1)}}static isEqual(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=E.cloneLayout(e),o=E.cloneLayout(t);return r?(E.dropLayoutMinorChange(i),E.dropLayoutMinorChange(o),xr(i,o)):xr(i,o)}static cloneLayout(e){return JSON.parse(JSON.stringify(e))}static hydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var r=[],i=0;i<e.length;i+=1){var o=e[i];if(_t(o)){var s,{component:a,props:l={}}=o;r.push(st(st({},o),{},{id:(s=o==null?void 0:o.id)!==null&&s!==void 0?s:ct(),props:t(a,l)}))}else if(o.content!==void 0){var d=E.hydrateLayoutConfig(o.content,t);ao(o)&&o.activeItemIndex!=null&&o.activeItemIndex>=d.length&&(yt.warn("Fixing bad activeItemIndex!",o.activeItemIndex,o),o.activeItemIndex=0),r.push(st(st({},o),{},{content:d}))}else r.push(o)}return r}static openComponent(){var{root:e,config:t,stack:r=void 0,replaceExisting:i=!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]:{},d=document.activeElement,h=st({},t);if(h.id==null&&(h.id=ct()),l!=null){e==null||e.layoutManager.createDragSourceFromEvent(h,l);return}var p=o||{id:h.id,component:h.component};L(e);var m=r??(s?E.addStack(e):E.getStackForRoot(e,p));L(m);var v=E.getContentItemInStack(m,p);if(a!=null){var f=b=>{yt.debug("Component created, focusing element",a),m.off("componentCreated",f);var{element:S}=b.origin;requestAnimationFrame(()=>{E.focusElement(S[0],a)})};m.on("componentCreated",f)}if(i&&v){var g=m.contentItems.indexOf(v);m.addChild(h,g+1),m.removeChild(v),m.setActiveContentItem(m.contentItems[g])}else m.addChild(h);a==null&&d&&Ln(d)&&d.focus()}static openComponentInStack(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=document.activeElement,o={id:t.id},s=E.getContentItemInStack(e,o);if(r&&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);i&&Ln(i)&&i.focus()}static closeComponent(e,t,r){var i=E.getStackForRoot(e,t,!1,!1,!1);if(!i){yt.warn("Cannot find stack for component, ignoring close",t);return}var o=E.getContentItemInStack(i,t),s=document.activeElement;o&&(Le(o)?o.container.close(r):i.removeChild(o)),s&&document.contains(s)&&Ln(s)&&s.focus()}static renameComponent(e,t,r){var i=E.getStackForRoot(e,t,!1);if(!i){yt.error("Could not find stack for config",t);return}var o=E.getContentItemInStack(i,t);o&&o.setTitle(r)}static cloneComponent(e,t){var r=E.getStackForRoot(e,t,!1);if(!r)return yt.error("Could not find stack for config",t),null;var{props:i={}}=t,o=E.getPanelComponentState(t),s={type:"react-component",component:t.component,props:st(st({},i),{},{panelState:o}),title:"".concat(t.title," Copy"),id:ct()};return E.openComponentInStack(r,s),s}static getPanelComponentState(e){if(ya(e)){var t;return(t=e.componentState)===null||t===void 0?void 0:t.panelState}if(_t(e)){var r;return(r=e.props)===null||r===void 0?void 0:r.panelState}return null}static makeDefaultLayout(){return{dimensions:{headerHeight:oo.tabHeight,borderWidth:oo.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=E.getComponentConfigFromContainer(e);return t?t.id:null}static getIdFromPanel(e){var{glContainer:t}=e.props;return E.getIdFromContainer(t)}static getComponentNameFromPanel(e){var{glContainer:t}=e.props,r=E.getComponentConfigFromContainer(t);if(r&&_t(r)){var i;return(i=r.component)!==null&&i!==void 0?i:null}return null}static getComponentName(e){var t,r,i=(t=(r=e.WrappedComponent)===null||r===void 0?void 0:r.displayName)!==null&&t!==void 0?t:e.displayName;if(i==null)throw new Error("Component displayName not defined ".concat(e));return i}static focusElement(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:E.DEFAULT_FOCUS_SELECTOR;if(e==null)return null;var r=e.querySelector(t);return r==null?null:(Ln(r)&&r.focus(),r)}static onInitialized(e){return new Promise(t=>{if(e.isInitialised){t();return}var r=()=>{e.off("initialised",r),t()};e.on("initialised",r)})}}ba(E,"DEFAULT_FOCUS_SELECTOR","input, select, textarea, button");var Jc=O.forwardRef((n,e)=>{var t=E.getComponentNameFromPanel({props:n});return u.jsx("div",{ref:e,className:"panel-placeholder",children:u.jsxs("div",{children:['Component "',t,'" is not registered.']})})});Jc.displayName="PanelPlaceholder";var Y=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"}),{listen:_g,emit:em,useListener:Eg}=xt(Y.OPEN),lr=Object.freeze({CYCLE_TO_NEXT_STACK:"NavigationEvent.CYCLE_TO_NEXT_STACK",CYCLE_TO_PREVIOUS_STACK:"NavigationEvent.CYCLE_TO_PREVIOUS_STACK",CYCLE_TO_NEXT_TAB:"NavigationEvent.CYCLE_TO_NEXT_TAB",CYCLE_TO_PREVIOUS_TAB:"NavigationEvent.CYCLE_TO_PREVIOUS_TAB"}),{listen:tm,emit:Pg,useListener:Tg}=xt(lr.CYCLE_TO_NEXT_STACK),{listen:nm,emit:Og,useListener:xg}=xt(lr.CYCLE_TO_PREVIOUS_STACK),{listen:rm,emit:Ig,useListener:Dg}=xt(lr.CYCLE_TO_NEXT_TAB),{listen:im,emit:Mg,useListener:kg}=xt(lr.CYCLE_TO_PREVIOUS_TAB);function lo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function uo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?lo(Object(t),!0).forEach(function(r){ut(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):lo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ut(n,e,t){return(e=om(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function om(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ue=R.module("PanelManager"),jt=function(n){return n[n.Next=0]="Next",n[n.Previous=1]="Previous",n}(jt||{});class Ca{constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:(a,l)=>l,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(a,l)=>l,i=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]:()=>{};ut(this,"layout",void 0),ut(this,"hydrateComponent",void 0),ut(this,"dehydrateComponent",void 0),ut(this,"onPanelsUpdated",void 0),ut(this,"closed",void 0),ut(this,"openedMap",void 0),ut(this,"navigationEventListenerRemovers",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.handleCycleToNextStack=this.handleCycleToNextStack.bind(this),this.handleCycleToPreviousStack=this.handleCycleToPreviousStack.bind(this),this.handleCycleToNextTab=this.handleCycleToNextTab.bind(this),this.handleCycleToPreviousTab=this.handleCycleToPreviousTab.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=r,this.onPanelsUpdated=s,this.openedMap=new Map(i),this.closed=[...o],this.navigationEventListenerRemovers=[],this.startListening()}startListening(){var{eventHub:e}=this.layout;e.on(Y.FOCUS,this.handleFocus),e.on(Y.MOUNT,this.handleMount),e.on(Y.UNMOUNT,this.handleUnmount),e.on(Y.REOPEN,this.handleReopen),e.on(Y.REOPEN_LAST,this.handleReopenLast),e.on(Y.DELETE,this.handleDeleted),e.on(Y.CLOSED,this.handleClosed),e.on(Y.CLOSE,this.handleControlClose),this.navigationEventListenerRemovers.push(tm(e,this.handleCycleToNextStack)),this.navigationEventListenerRemovers.push(nm(e,this.handleCycleToPreviousStack)),this.navigationEventListenerRemovers.push(rm(e,this.handleCycleToNextTab)),this.navigationEventListenerRemovers.push(im(e,this.handleCycleToPreviousTab))}stopListening(){var{eventHub:e}=this.layout;e.off(Y.FOCUS,this.handleFocus),e.off(Y.MOUNT,this.handleMount),e.off(Y.UNMOUNT,this.handleUnmount),e.off(Y.REOPEN,this.handleReopen),e.off(Y.REOPEN_LAST,this.handleReopenLast),e.off(Y.DELETE,this.handleDeleted),e.off(Y.CLOSED,this.handleClosed),e.off(Y.CLOSE,this.handleControlClose),this.navigationEventListenerRemovers.forEach(t=>t()),this.navigationEventListenerRemovers=[]}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 E.getComponentConfigFromContainer(t)})}getOpenedPanelConfigsOfType(e){return this.getOpenedPanelConfigs().filter(t=>t!=null&&_t(t)&&t.component===e)}getOpenedPanelById(e){return this.openedMap.get(e)}getContainerByPanelId(e){var t,r=E.getStackForConfig(this.layout.root,{id:e});return(t=r&&E.getContentItemInStack(r,{id:e}))!==null&&t!==void 0?t:null}getLastUsedPanel(e){for(var t=this.getOpenedPanels(),r=t.length-1;r>=0;r-=1){var i=t[r];if(e==null||e(i))return i}}getLastUsedPanelOfType(e){return this.getLastUsedPanelOfTypes([e])}getLastUsedPanelOfTypes(e){return this.getLastUsedPanel(t=>e.some(r=>Gn(r)&&t instanceof r.WrappedComponent||!Gn(r)&&t instanceof r))}updatePanel(e){var t=E.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=E.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(r=>r===e||r.id!=null&&e.id!=null&&r.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()}cycleStack(e){var t=E.getAllStackContainers(this.layout);if(!(t.length<=1)){var r=E.getFocusedStackIndex(t);if(r===-1){var i=t[0],o=i.config.activeItemIndex,s=o!=null?i.contentItems[o]:i.contentItems[0];i.setActiveContentItem(s,!0);return}var a=e===jt.Next?(r+1)%t.length:(r-1+t.length)%t.length,l=t[a],d=l.config.activeItemIndex,h=d!=null?l.contentItems[d]:l.contentItems[0];l.setActiveContentItem(h,!0)}}handleCycleToNextStack(){this.cycleStack(jt.Next)}handleCycleToPreviousStack(){this.cycleStack(jt.Previous)}cycleTab(e){var t,r=E.getFocusedStack(this.layout);if(r!==void 0){var{contentItems:i}=r;if(!(i.length<=1)){var o=(t=r.config.activeItemIndex)!==null&&t!==void 0?t:0,s=e===jt.Next?(o+1)%i.length:(o-1+i.length)%i.length,a=i[s];r.setActiveContentItem(a,!0)}}}handleCycleToNextTab(){this.cycleTab(jt.Next)}handleCycleToPreviousTab(){this.cycleTab(jt.Previous)}handleReopen(e,t){Ue.debug2("Reopen:",e,t),this.removeClosedPanelConfig(e);var{component:r}=e,{props:i}=e;i=this.hydrateComponent(r,i);var o=uo(uo({},e),{},{props:i}),{root:s}=this.layout,a=e.parentStackId===void 0?void 0:E.getStackById(s,e.parentStackId);E.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 r=(t=E.getStackForConfig(this.layout.root,e.getConfig()))===null||t===void 0?void 0:t.config.id,i=this.closed.length-1;i>=0;i-=1){var o=this.closed[i];if(o.parentStackId===r){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:r}=this.layout;E.closeComponent(r,t)}addClosedPanel(e){var t=E.getComponentConfigFromContainer(e);if(t&&_t(t)){var r=this.dehydrateComponent(t.component,t);if(r!=null){var i;r.parentStackId=(i=e.tab)===null||i===void 0?void 0:i.header.parent.config.id,this.closed.push(r)}}}sendUpdate(){var{closed:e,openedMap:t}=this;this.onPanelsUpdated({closed:[...e],openedMap:new Map(t)})}}ut(Ca,"MAX_CLOSED_PANEL_COUNT",100);var am=R.module("PanelErrorBoundary");class lm 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,r=E.getIdFromContainer(e);am.debug("componentWillUnmount",r),t.emit(Y.CLOSED,r,e)}render(){var{children:e}=this.props,{error:t}=this.state;return t!=null?u.jsx("div",{className:"panel-error-boundary",children:u.jsx(Sn,{"data-testid":"panel-error-boundary-loading-error",errorMessage:"".concat(t),isLoading:!1,isLoaded:!1})}):e??null}}function ho(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Zn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ho(Object(t),!0).forEach(function(r){dm(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ho(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function dm(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function wa(n){var{props:e,componentState:t}=n,{metadata:r}=e,{panelState:i=null}=e;t&&({panelState:i}=t);var o={};return r!=null&&(o.metadata=r),i!=null&&(o.panelState=i),Zn(Zn({},n),{},{componentState:null,props:o,type:"react-component"})}function Sa(n,e){return Zn(Zn({},n),{},{localDashboardId:e})}const jg={dehydrate:wa,hydrate:Sa};var _a=O.createContext(void 0);_a.displayName="LayoutManagerContext";var cm=ae.shape({on:ae.func,off:ae.func,isHidden:ae.bool,tab:ae.shape({header:ae.shape({tabs:ae.arrayOf(ae.shape({contentItem:ae.shape({})}))})}),title:ae.string,setTitle:ae.func,close:ae.func}),Ea=ae.shape({on:ae.func,off:ae.func,emit:ae.func}),mm=ae.shape({registerComponent:ae.func,root:ae.shape({addChild:ae.func}),on:ae.func,off:ae.func,eventHub:Ea}),Ng=Object.freeze({Container:cm,EventHub:Ea,Layout:mm});function Vt(n,e,t){c.useEffect(function(){return n.on(e,t),()=>{n.off(e,t)}},[n,e,t])}var Pa="SET_DASHBOARD_DATA";const pm=hh(Pa,{},!1),vm={dashboardData:pm};var fm=new Map,Ta=Object.freeze({}),gm=Object.freeze([]),Ag=ys,Lg=bs,Rg=$l,bm=n=>n.dashboardData,Ce=(n,e)=>{var t;return(t=bm(n)[e])!==null&&t!==void 0?t:Ta},Fg=(n,e)=>{var t;return(t=Ce(n,e).closed)!==null&&t!==void 0?t:gm},Hg=(n,e)=>{var t;return(t=Ce(n,e).openedMap)!==null&&t!==void 0?t:fm},Oa=(n,e)=>{var t;return(t=Ce(n,e).pluginDataMap)!==null&&t!==void 0?t:Ta},$g=(n,e,t)=>Oa(n,e)[t];function co(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Yt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?co(Object(t),!0).forEach(function(r){ym(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):co(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ym(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=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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var xa=(n,e)=>({type:Pa,id:n,payload:e}),Sm=(n,e)=>(t,r)=>t(xa(n,Yt(Yt({},Ce(r(),n)),e))),Ug=(n,e,t)=>(r,i)=>r(xa(n,Yt(Yt({},Ce(i(),n)),{},{pluginDataMap:Yt(Yt({},Oa(i(),n)),{},{[e]:t})})));Object.entries(vm).map(n=>{var[e,t]=n;return vh.register(e,t)});function _m(n){var{children:e}=n;return u.jsx(u.Fragment,{children:e})}var ii=c.createContext(null);ii.displayName="PanelIdContext";function Em(){return c.useContext(ii)}function mo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function mn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?mo(Object(t),!0).forEach(function(r){Pm(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):mo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Pm(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Rn=R.module("DashboardLayout"),xm=Object.freeze({}),Im=[],po=()=>{},Dm=1e3,vo=n=>n;function Bg(n){var e,t,{id:r,children:i,emptyDashboard:o=u.jsx("div",{children:"Dashboard is empty."}),layout:s,layoutConfig:a=Im,onLayoutChange:l=po,onLayoutInitialized:d=po,hydrate:h=Sa,dehydrate:p=wa,panelWrapper:m=_m}=n,v=ys(),f=(e=bs(x=>Ce(x,r)))!==null&&e!==void 0?e:xm,[g,b]=c.useState(!1),[S,w]=c.useState(!1),[y,D]=c.useState(),[V]=c.useState((t=f==null?void 0:f.closed)!==null&&t!==void 0?t:[]),[X,G]=c.useState(s.getReactChildren()),A=c.useMemo(()=>new Map,[]),M=c.useMemo(()=>new Map,[]),Q=c.useCallback(function(x,J){var oe,un=arguments.length>2&&arguments[2]!==void 0?arguments[2]:h,gt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:p;Rn.debug2("registerComponent",x,J,un,gt);function Mn(K,ne){var pe=J,ke=m,Dt=As(pe),{glContainer:Kt,glEventHub:Ga}=K,qa=E.getIdFromContainer(Kt);return u.jsx(lm,{glContainer:Kt,glEventHub:Ga,children:u.jsx(ii.Provider,{value:qa,children:u.jsx(ke,mn(mn({},K),{},{children:Dt?u.jsx(pe,mn(mn({},K),{},{ref:ne})):u.jsx(pe,mn({},K))}))})})}Mn.displayName="DashboardWrapper(".concat((oe=J.displayName)!==null&&oe!==void 0?oe:x,")");var P=s.registerComponent(x,O.forwardRef(Mn));return A.set(x,un),M.set(x,gt),P},[h,p,A,M,s,m]),W=c.useCallback((x,J)=>{var oe;return((oe=A.get(x))!==null&&oe!==void 0?oe:vo)(J,r)},[A,r]),k=c.useCallback((x,J)=>{var oe;return((oe=M.get(x))!==null&&oe!==void 0?oe:vo)(J,r)},[M,r]),z=c.useMemo(()=>new Ca(s,W,k,new Map,V,x=>{var{closed:J,openedMap:oe}=x;v(Sm(r,{closed:J,openedMap:oe}))}),[k,v,W,r,V,s]),F=jd(x=>{var J=y==null||!E.isEqual(y,x);Rn.debug("handleLayoutStateChanged",J,x),J&&(b(s.root.contentItems.length===0),D(x),l(x),G(s.getReactChildren()))},Dm,{flushOnUnmount:!0});c.useEffect(()=>()=>F.flush(),[F]);var j=c.useCallback(()=>{if(!S){var x=s.toConfig(),J=x.content,oe=E.dehydrateLayoutConfig(J,k);F(oe)}},[k,S,s,F]),H=c.useCallback(x=>{var J=E.getIdFromContainer(x);s.eventHub.emit(Y.DRAGGING,J),w(!0)},[s.eventHub]),U=c.useCallback(x=>{var J=E.getIdFromContainer(x);s.eventHub.emit(Y.DROPPED,J),w(!1)},[s.eventHub]),ce=c.useCallback(x=>{if(Rn.debug2("handleComponentCreated",x),!(x==null||x.config==null||!_t(x.config)||x.config.component==null||x.element==null)){var J=x.config.component.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),oe="".concat(J,"-component");x.element.addClass(oe)}},[]),tt=c.useCallback(()=>{G(s.getReactChildren())},[s]);Vt(s,"stateChanged",j),Vt(s,"itemPickedUp",H),Vt(s,"itemDropped",U),Vt(s,"componentCreated",ce),Vt(s.eventHub,Y.TITLE_CHANGED,j),Vt(s,"reactChildrenChanged",tt);var Ge=kd(a);return c.useEffect(function(){if(Ge!==a&&a!==y){Rn.debug("Setting new layout content...");for(var J=E.hydrateLayoutConfig(a,W);s.root.contentItems.length>0;)s.root.contentItems[0].remove();for(var oe=0;oe<J.length;oe+=1)s.root.addChild(J[oe]);b(s.root.contentItems.length===0)}},[W,s,a,y,z,Ge]),c.useEffect(()=>d(),[]),u.jsxs(u.Fragment,{children:[g&&o,X,O.Children.map(i,x=>x!=null?u.jsx(Tu,{fallback:[],children:O.cloneElement(x,{id:r,layout:s,panelManager:z,registerComponent:Q})}):null)]})}var Ia=c.createContext(null);Ia.displayName="DashboardIdContext";function Kg(){var n=c.useContext(Ia);if(n==null)throw new Error("useDashboardId must be used within a DashboardIdContext provider");return n}function Mm(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=jm(n,"string");return typeof e=="symbol"?e:e+""}function jm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;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 r=n.child;r;){var i=Da(r,e,t);if(i)return i;r=r.sibling}}}function Nm(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}var oi=Nm(c.createContext(null));oi.displayName="FiberContext";class Wg extends c.Component{constructor(){super(...arguments),Mm(this,"_reactInternals",void 0)}render(){var{children:e}=this.props;return u.jsx(oi.Provider,{value:this._reactInternals,children:e})}}function Am(){var n=c.useContext(oi);if(n===null)throw new Error("useFiber must be called within a <FiberProvider />!");var[e]=c.useState(()=>ct()),t=c.useMemo(()=>{for(var r of[n,n==null?void 0:n.alternate].filter(o=>o!=null)){var i=Da(r,!1,o=>{for(var s=o.memoizedState;s!=null;){if(s.memoizedState===e)return!0;s=s.next}});if(i)return i}},[n,e]);return t}var zg="default",Lm="CREATE_DASHBOARD",Rm="CLOSE_DASHBOARD",{listen:Vg,emit:Gg,useListener:qg}=xt(Lm),{listen:Xg,emit:Fm,useListener:Zg}=xt(Rm);function Hm(n,e,t){return(e=$m(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function $m(n){var e=Um(n,"string");return typeof e=="symbol"?e:e+""}function Um(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ma 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,{glContainer:r}=this.props;return[...(e=r==null||(t=r.tab)===null||t===void 0||(t=t.header)===null||t===void 0?void 0:t.tabs)!==null&&e!==void 0?e:[]]}handleCloseTab(){var{glContainer:e}=this.props;e.close()}handleCloseTabsAll(){var e=this.getAllTabs();e.forEach(t=>{var r;return(r=(t==null?void 0:t.contentItem).container)===null||r===void 0?void 0:r.close()})}handleCloseTabsRight(){for(var{glContainer:e}=this.props,t=this.getAllTabs(),r=t.length-1;r>0;r-=1){var i,o,s,a;if(((i=t[r].contentItem)===null||i===void 0||(i=i.config)===null||i===void 0?void 0:i.id)===((o=e.tab)===null||o===void 0||(o=o.contentItem)===null||o===void 0||(o=o.config)===null||o===void 0?void 0:o.id))break;(s=((a=t[r])===null||a===void 0?void 0:a.contentItem).container)===null||s===void 0||s.close()}}handleReopenLast(){var{glContainer:e,glEventHub:t}=this.props;t.emit(Y.REOPEN_LAST,e)}canCloseTabsRight(){for(var{glContainer:e}=this.props,t=this.getAllTabs(),r=!0,i=t.length-1;i>0;i-=1){var o,s,a;if(((o=t[i].contentItem)===null||o===void 0||(o=o.config)===null||o===void 0?void 0:o.id)===((s=e.tab)===null||s===void 0||(s=s.contentItem)===null||s===void 0||(s=s.config)===null||s===void 0?void 0:s.id))break;var l=!!(!((a=t[i])===null||a===void 0||(a=a.contentItem)===null||a===void 0||(a=a.config)===null||a===void 0)&&a.isClosable);if(l){r=!1;break}}return r}canCloseAny(){for(var e=this.getAllTabs(),t=!0,r=e.length-1;r>0;r-=1){var i,o=!!(!((i=e[r])===null||i===void 0||(i=i.contentItem)===null||i===void 0||(i=i.config)===null||i===void 0)&&i.isClosable);if(o){t=!1;break}}return t}canReopenLast(){var e,t,{workspace:r,glContainer:i}=this.props,o=(e=E.getStackForConfig(i.layoutManager.root,i.getConfig()))===null||e===void 0?void 0:e.config.id;return!((t=r.data.closed)!==null&&t!==void 0&&t.some(s=>s.parentStackId===o))}render(){var e,{additionalActions:t,glContainer:r}=this.props,i=[...t];i.push(()=>({title:"Re-open closed panel",group:re.groups.medium+2004,action:this.handleReopenLast,disabled:this.canReopenLast()}));var o=(e=r.tab)===null||e===void 0||(e=e.contentItem)===null||e===void 0||(e=e.config)===null||e===void 0?void 0:e.isClosable;return i.push({title:"Close",order:10,group:re.groups.low,action:this.handleCloseTab,disabled:o===void 0||!o}),i.push(()=>({title:"Close Tabs to Right",order:20,group:re.groups.low,action:this.handleCloseTabsRight,disabled:this.canCloseTabsRight()})),i.push(()=>({title:"Close All",order:30,group:re.groups.low,action:this.handleCloseTabsAll,disabled:this.canCloseAny()})),u.jsx(re,{actions:i})}}Hm(Ma,"defaultProps",{additionalActions:[]});var Bm=n=>({workspace:Gs(n)}),Km=En(Bm,{setWorkspace:qs})(Ma);function ka(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=zm(n,"string");return typeof e=="symbol"?e:e+""}function zm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ja extends c.PureComponent{constructor(e){super(e),ka(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=O.createRef();var{value:t}=e;this.state={value:t,valueWasValidated:!1}}componentDidUpdate(e){var{isShown:t}=e,{isShown:r}=this.props;r&&!t&&this.resetState()}resetState(){var{value:e}=this.props;this.setState({value:e,valueWasValidated:!1})}handleRenameDialogOpened(){var e;(e=this.renameInputRef)===null||e===void 0||(e=e.current)===null||e===void 0||e.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,r=t==null?void 0:t.trim();if(r!==void 0&&r!==""){var{onSubmit:i}=this.props;i(r)}else this.setState({value:r,valueWasValidated:!0})}renderRenameDialog(){var{isShared:e,isOwner:t,itemType:r}=this.props,{value:i,valueWasValidated:o}=this.state;return u.jsxs("form",{className:$("p-3",{"was-validated":o}),onSubmit:this.handleRenameSubmit,noValidate:!0,role:"presentation",onMouseDown:s=>{s.stopPropagation()},onMouseUp:s=>{s.stopPropagation()},children:[u.jsxs("div",{className:"form-group",children:[u.jsxs("label",{htmlFor:"rename-dialog-".concat(r,"-input"),children:["Rename ",r]}),u.jsx("input",{type:"text",className:"form-control",id:"rename-dialog-".concat(r,"-input"),value:i??void 0,ref:this.renameInputRef,onChange:this.handleRenameInputChange,required:!0}),u.jsxs("div",{className:"invalid-feedback",children:[r," name cannot be empty"]}),(e||!t)&&u.jsxs("div",{className:"pt-2",children:["Renaming this ",r," will rename for all users."]})]}),u.jsxs("div",{className:"text-right",children:[u.jsx(te,{kind:"secondary",className:"mr-2",onClick:this.handleRenameCancel,children:"Cancel"}),u.jsx(te,{kind:"primary",type:"submit",children:"Rename"})]})]})}render(){var{isShown:e,onCancel:t}=this.props;return u.jsx(rr,{isShown:e,onEntered:this.handleRenameDialogOpened,onExited:t,options:{placement:"bottom"},interactive:!0,closeOnBlur:!0,children:this.renderRenameDialog()})}}ka(ja,"defaultProps",{isShared:!1,isOwner:!0,itemType:"Item",value:""});var Fn=Object.freeze({focus:"TabEvent.focus",blur:"TabEvent.blur"});function fo(n,e,t){return(e=Vm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Vm(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var qm=R.module("Panel");class Xm extends c.PureComponent{constructor(e){super(e),fo(this,"ref",void 0),fo(this,"getAdditionalActions",Qt((r,i,o)=>{var s=[];return i&&s.push(this.getCloneAction()),o&&s.push(this.getRenameAction()),[...s,...r]})),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.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=O.createRef();var{glContainer:t}=this.props;this.state={title:E.getTitleFromContainer(t),showRenameDialog:!1,isWithinPanel:!0}}componentDidMount(){var e,{componentPanel:t,glContainer:r,glEventHub:i}=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),i.on(Fn.focus,this.handleTabFocus),i.on(Fn.blur,this.handleTabBlur),i.emit(Y.MOUNT,t??this),this.setState({isWithinPanel:((e=this.ref.current)===null||e===void 0||(e=e.parentElement)===null||e===void 0?void 0:e.closest(".dh-panel"))!=null})}componentWillUnmount(){var{componentPanel:e,glContainer:t,glEventHub:r}=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),r.off(Fn.focus,this.handleTabFocus),r.off(Fn.blur,this.handleTabBlur),r.emit(Y.UNMOUNT,e??this)}handleTab(e){e!=null&&this.setState({title:E.getTitleFromTab(e)}),this.forceUpdate();var{onTab:t}=this.props;t==null||t(e)}handleTabClicked(e){var{onTabClicked:t}=this.props;t==null||t(e)}handleFocus(e){var{componentPanel:t,glEventHub:r}=this.props;r.emit(Y.FOCUS,t??this);var{onFocus:i}=this.props;i==null||i(e)}handleBlur(e){var{onBlur:t}=this.props;t==null||t(e)}handleHide(){for(var{onHide:e}=this.props,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleResize(){for(var{onResize:e}=this.props,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleBeforeShow(){for(var{onBeforeShow:e}=this.props,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleShow(){for(var{onShow:e}=this.props,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleTabBlur(){for(var{onTabBlur:e}=this.props,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleTabFocus(){for(var{onTabFocus:e}=this.props,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleRenameCancel(){this.setState({showRenameDialog:!1})}handleShowRenameDialog(){this.setState({showRenameDialog:!0})}handleRenameSubmit(e){var{glContainer:t}=this.props;this.setState({showRenameDialog:!1,title:e});var r=E.getRootFromContainer(t),i=E.getComponentConfigFromContainer(t);L(i),E.renameComponent(r,i,e)}handleCopyPanel(){var{glContainer:e,glEventHub:t}=this.props,r=E.getRootFromContainer(e),i=E.getComponentConfigFromContainer(e);if(i==null){qm.error("Could not get component config from container",e);return}var o=E.cloneComponent(r,i);o!==null&&t.emit(Y.CLONED,this,o)}getCloneAction(){return{title:"Copy Panel",order:10,group:re.groups.high,action:this.handleCopyPanel}}getRenameAction(){return{title:"Rename",order:10,group:re.groups.medium,action:this.handleShowRenameDialog}}render(){var{children:e,className:t,renderTabTooltip:r,glContainer:i,glEventHub:o,additionalActions:s=Vl,errorMessage:a,isLoaded:l=!0,isLoading:d=!1,isClonable:h=!1,isRenamable:p=!1}=this.props,{tab:m}=i,{showRenameDialog:v,title:f,isWithinPanel:g}=this.state;return u.jsxs("div",{className:$("h-100 w-100 dh-panel",t),onFocusCapture:this.handleFocus,onBlurCapture:this.handleBlur,ref:this.ref,children:[e,u.jsx(Sn,{"data-testid":"base-panel-loading",errorMessage:a,isLoaded:l,isLoading:d}),!g&&m!=null&&Vr.createPortal(u.jsxs(u.Fragment,{children:[u.jsx(Km,{glContainer:i,glEventHub:o,additionalActions:this.getAdditionalActions(s,h,p)}),p&&u.jsx(ja,{isShown:v,value:f,itemType:"Panel",onCancel:this.handleRenameCancel,onSubmit:this.handleRenameSubmit}),r!=null&&u.jsx(ie,{interactive:!0,options:{placement:"bottom"},popperClassName:"panel-tab-popper",children:r()})]}),m.element[0])]})}}var Zm=Us(Xm),Ym=R.module("useDhId"),wr="__dhId";function Yg(){var n,e,t=(n=(e=Am())===null||e===void 0?void 0:e.pendingProps)!==null&&n!==void 0?n:{},r=t[wr],i=Em();if(r!=null){if(typeof r!="string")throw new Error("useDhId expected prop ".concat(wr," to be a string, but got ").concat(typeof r));return r}return i??(Ym.warn("useDhId must be used within a PanelIdContext provider if there is no ".concat(wr," prop. Defaulting to null.")),null)}function Na(n){var{type:e}=n,t=Fu();switch(e){case t.VariableType.TABLE:case t.VariableType.TABLEMAP:case t.VariableType.TREETABLE:case t.VariableType.HIERARCHICALTABLE:case t.VariableType.PARTITIONEDTABLE:return u.jsx(le,{icon:cl});case t.VariableType.FIGURE:return u.jsx(le,{icon:ms});case t.VariableType.PANDAS:return u.jsx(le,{icon:hl});default:return u.jsx(le,{icon:hs})}}function go(n,e,t,r,i,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function Qm(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function s(l){go(o,r,i,s,a,"next",l)}function a(l){go(o,r,i,s,a,"throw",l)}s(void 0)})}}function Aa(n){var{children:e,language:t}=n,[r,i]=c.useState(null),{activeThemes:o}=Is();return c.useEffect(()=>{var s=!1;function a(){return l.apply(this,arguments)}function l(){return l=Qm(function*(){if(e!=null&&o!=null){var d=yield Ee.colorize(e.toString(),t,{});s||i(d)}}),l.apply(this,arguments)}return a(),()=>{s=!0}},[o,e,t]),u.jsx("div",{style:{pointerEvents:"none"},dangerouslySetInnerHTML:r!=null?{__html:r}:void 0})}class La{static get LANGUAGE_MAP(){return new Map([["python","Python"],["groovy","Groovy"],["scala","Scala"]])}}class Yn{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)?[]:Ul.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"),r="".concat(e.getMinutes()).padStart(2,"0"),i="".concat(e.getSeconds()).padStart(2,"0"),o="".concat(e.getMilliseconds()).padStart(3,"0");return"".concat(t,":").concat(r,":").concat(i,".").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 Yn.isTableType(e,t)||Yn.isWidgetType(e,t)}static isFigureType(e,t){return t===e.VariableType.FIGURE}static isPandas(e,t){return t===e.VariableType.PANDAS}}function Jm(n){var{children:e}=n;return u.jsxs("div",{className:"console-history-item-result",children:[u.jsx("div",{className:"console-history-gutter",children:"-"}),u.jsx("div",{className:"console-history-content",children:e})]})}function Br(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ra extends c.Component{constructor(e){super(e),Br(this,"timer",void 0),Br(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:r}=this.state;return u.jsx("div",{className:$("console-history-result-in-progress",{disabled:e}),children:u.jsxs("span",{className:"badge",children:[u.jsx(ps,{className:"ml-2"}),"Running... ",ln.formatElapsedTime(r)," ",u.jsx(te,{className:"console-history-result-in-progress-cancel",kind:"ghost",icon:ml,tooltip:"Cancel",onClick:t,disabled:e})]})})}}Br(Ra,"defaultProps",{disabled:!1});function yn(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=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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class nn extends c.PureComponent{constructor(e){super(e),yn(this,"mouseX",void 0),yn(this,"mouseY",void 0),yn(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)>=nn.mouseDragThreshold||Math.abs(e.clientY-this.mouseY)>=nn.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:r}=this.props;L(r);var i=r.trimEnd(),o=i.indexOf(`
|
|
3
3
|
`),s=o>-1,a=i;s&&(a=i.slice(0,o));var l=i.slice(o),d=t?"error-btn-link error-btn-link--active":"error-btn-link";return u.jsxs("div",{className:$("error-message",{expanded:e}),children:[s&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"error-gutter",children:u.jsx("button",{type:"button",onClick:this.handleToggleError,className:d,tabIndex:-1,children:u.jsx(le,{icon:e?Tr:pl,transform:"left-3"})})}),u.jsxs("div",{className:"error-content",children:[u.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&&u.jsx("div",{className:"error-content",children:u.jsx("div",{className:"console-error-text",children:a})})]},"error")}}yn(nn,"defaultProps",{message:""});yn(nn,"mouseDragThreshold",5);function ip(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=sp(n,"string");return typeof e=="symbol"?e:e+""}function sp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var bo=R.module("ConsoleHistoryItem");class Fa extends c.PureComponent{constructor(e){super(e),this.handleCancelClick=this.handleCancelClick.bind(this),this.handleObjectClick=this.handleObjectClick.bind(this)}handleObjectClick(e){bo.debug("handleObjectClick",e);var{openObject:t}=this.props;t(e)}handleCancelClick(){var{item:e}=this.props;e!=null&&e.cancelResult&&(bo.debug("Cancelling command: ".concat(e.command)),e.cancelResult())}render(){var{disabled:e,item:t,language:r,iconForType:i}=this.props,{disabledObjects:o,result:s}=t,a=t.command!=null&&t.command!=="",l=null;a&&(l=u.jsxs("div",{className:"console-history-item-command",children:[u.jsx("div",{className:"console-history-gutter",children:">"}),u.jsx("div",{className:"console-history-content",children:u.jsx(Aa,{language:r,children:t.command})})]}));var d=[],h=!1;if(s){var{error:p,message:m,changes:v}=s;if(v){var{created:f,updated:g}=v;[...f,...g].forEach(X=>{h=!0;var{title:G}=X,A="".concat(G),M=e===void 0||e||(o??[]).indexOf(A)>=0,Q=u.jsx(te,{kind:"primary",onClick:()=>this.handleObjectClick(X),className:"btn-console-object",disabled:M,icon:i(X.type),children:G},A);d.push(Q)})}if(p!=null&&!a){var b,S="".concat((b=p.message)!==null&&b!==void 0?b:p);S||(S=p);var w=u.jsx(nn,{message:S},"result-error");d.push(w)}if(m!==void 0&&m!==""){var y=u.jsx("div",{className:"log-message",children:m},"log-message");d.push(y)}}else{h=!0;var D=u.jsx(Ra,{onCancelClick:this.handleCancelClick,disabled:e},"in_progress");d.push(D)}var V=null;return d.length>0&&(V=u.jsx(Jm,{children:d})),u.jsxs("div",{className:$("console-command-result",{"console-result-buttons":h}),children:[l,V]})}}ip(Fa,"defaultProps",{disabled:!1});function ap(n,e){return"".concat(n,".").concat(e.command,".").concat(e.result&&e.result.message,".").concat(e.result&&e.result.error)}var lp=O.forwardRef(function(e,t){for(var{disabled:r=!1,items:i,language:o,openObject:s,supportsType:a,iconForType:l}=e,d=[],h=0;h<i.length;h+=1){var p=i[h],m=u.jsx(Fa,{disabled:r,item:p,openObject:s,language:o,supportsType:a,iconForType:l},ap(h,p));d.push(m)}return u.jsx("div",{ref:t,className:"container-fluid console-history",children:d})}),dp={name:"Console",CLEAR:ee.createAndAdd({id:"CONSOLE.CLEAR",name:"Clear",shortcut:[_.CTRL,C.L],macShortcut:[_.CTRL,C.C]}),FOCUS_HISTORY:ee.createAndAdd({id:"CONSOLE.FOCUS_HISTORY",name:"Focus History",shortcut:[_.CTRL,C.H],macShortcut:[_.CTRL,_.OPTION,C.H]})},up={name:"Command History",FOCUS_HISTORY:ee.createAndAdd({id:"COMMAND_HISTORY.FOCUS_HISTORY",name:"Focus History Search",shortcut:[_.CTRL,C.H],macShortcut:[_.CTRL,_.OPTION,C.H]}),SEND_TO_CONSOLE:ee.createAndAdd({id:"COMMAND_HISTORY.SEND_TO_CONSOLE",name:"Send to Console",shortcut:[C.ENTER],macShortcut:[C.ENTER]}),SEND_TO_NOTEBOOK:ee.createAndAdd({id:"COMMAND_HISTORY.SEND_TO_NOTEBOOK",name:"Send to Notebook",shortcut:[_.CTRL,C.ENTER],macShortcut:[_.CMD,C.ENTER]}),RUN:ee.createAndAdd({id:"COMMAND_HISTORY.RUN",name:"Run",shortcut:[_.ALT,C.R],macShortcut:[_.OPTION,C.R]})},hp={name:"Notebook",RUN:ee.createAndAdd({id:"NOTEBOOK.RUN",name:"Run",shortcut:[_.ALT,C.R],macShortcut:[_.OPTION,C.R]}),RUN_SELECTED:ee.createAndAdd({id:"NOTEBOOK.RUN_SELECTED",name:"Run Selected",shortcut:[_.ALT,_.SHIFT,C.R],macShortcut:[_.OPTION,_.SHIFT,C.R]}),FIND:ee.createAndAdd({id:"NOTEBOOK.FIND",name:"Find",shortcut:[_.CTRL,C.F],macShortcut:[_.CMD,C.F],isEditable:!1}),MINIMAP:ee.createAndAdd({id:"NOTEBOOK.MINIMAP",name:"Show Minimap",shortcut:[_.ALT,C.M],macShortcut:[_.OPTION,C.M]}),WORDWRAP:ee.createAndAdd({id:"NOTEBOOK.WORDWRAP",name:"Word Wrap",shortcut:[_.ALT,C.Z],macShortcut:[_.OPTION,C.Z]})},Jt={CONSOLE:dp,COMMAND_HISTORY:up,NOTEBOOK:hp};const fe=Object.freeze({FATAL:"FATAL",STDERR:"STDERR",ERROR:"ERROR",WARN:"WARN",STDOUT:"STDOUT",INFO:"INFO",DEBUG:"DEBUG",TRACE:"TRACE"}),cp="var(--dh-color-editor-bg)",mp="var(--dh-color-editor-fg)",pp="var(--dh-color-editor-string)",vp="var(--dh-color-editor-delimiter)",fp="var(--dh-color-editor-predefined)",gp="var(--dh-color-editor-keyword)",bp="var(--dh-color-editor-storage)",yp="var(--dh-color-editor-number)",Cp="var(--dh-color-editor-operator)",wp="var(--dh-color-editor-identifier)",Sp="var(--dh-color-editor-comment)",Kr={"error-foreground":"var(--dh-color-editor-error-fg)",background:cp,foreground:mp,"line-height":"19px",string:pp,"string-delim":"var(--dh-color-editor-string-delim)",delimiter:vp,predefined:fp,keyword:gp,storage:bp,number:yp,operator:Cp,identifier:wp,"namespace-identifier":"var(--dh-color-editor-identifier-namespace)","identifier-js":"var(--dh-color-editor-identifier-js)",comment:Sp,"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 _p="python",Ep={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/}}},Pp={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"]]}},Tp={id:_p,conf:Ep,language:Pp},Op="groovy",xp={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/}}},Ip={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"]]}},Dp={id:Op,conf:xp,language:Ip},Mp="scala",kp={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>))/}}},jp={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"]]}},Np={id:Mp,conf:kp,language:jp},Ap="deephavenDb",Lp={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/}}},Rp={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"]]}},Fp={id:Ap,conf:Lp,language:Rp},Hp="log",$p={},Up={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"}]]}},Bp={id:Hp,conf:$p,language:Up},Kp={preview:!0,"target-version":"py38","line-length":88,"indent-width":4,format:{"indent-style":"space","quote-style":"double"},lint:{"flake8-implicit-str-concat":{"allow-multiline":!1},ignore:["ISC003"],select:["F","E1","E9","E711","W291","W293","W605","B","A","COM818","ISC","PLE","RUF001","RUF021","RUF027","PLR1704","LOG","ASYNC","RET501","RET502","RET503","PLC2401","PLC2403","NPY","PERF","C4"]}};function yo(n,e,t,r,i,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function Wp(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function s(l){yo(o,r,i,s,a,"next",l)}function a(l){yo(o,r,i,s,a,"throw",l)}s(void 0)})}}function Ot(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Be=R.module("MonacoCompletionProvider");class I extends c.PureComponent{static initRuff(){return Wp(function*(){if(I.isRuffEnabled)return I.initRuffPromise||(I.initRuffPromise=Kl({}).then(()=>{Be.debug("Initialized Ruff",pi.version()),I.isRuffInitialized=!0,I.updateRuffWorkspace()})),I.initRuffPromise})()}static updateRuffWorkspace(){if(I.isRuffInitialized){var e=console.log;try{console.log=()=>{},I.ruffWorkspace=new pi(I.ruffSettings)}finally{console.log=e}I.lintAllPython()}}static setRuffSettings(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I.ruffSettings;if(I.ruffSettings=e,!I.isRuffInitialized){I.initRuff();return}I.updateRuffWorkspace()}static getDiagnostics(e){if(!I.ruffWorkspace)return[];var t=I.ruffWorkspace.check(e.getValue());return ye.isConsoleModel(e)?t.filter(r=>r.code==null):t}static lintAllPython(){if(!I.isRuffEnabled){Ee.removeAllMarkers("ruff");return}Ee.getModels().filter(e=>e.getLanguageId()==="python").forEach(I.lintPython)}static lintPython(e){if(I.isRuffEnabled&&I.ruffWorkspace){var t=I.getDiagnostics(e);Be.debug("Linting Python document: ".concat(e.uri.toString()),t),Ee.setModelMarkers(e,"ruff",t.map(r=>{var i=r.code==="F401"||r.code==="F841",o=r.code==null;return{startLineNumber:r.location.row,startColumn:r.location.column,endLineNumber:r.end_location.row,endColumn:r.end_location.column,message:o?r.message:"".concat(r.code,": ").concat(r.message),severity:o?vi.Error:vi.Warning,tags:i?[Bl.Unnecessary]:[]}}))}}static lspToMonacoKind(e){var t=ze.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:r}=e;return{startLineNumber:t.line+1,startColumn:t.character+1,endLineNumber:r.line+1,endColumn:r.character+1}}static monacoToLspPosition(e){return{line:e.lineNumber-1,character:e.column-1}}static handlePythonCodeActionRequest(e,t){if(!I.isRuffEnabled||!I.ruffWorkspace)return{actions:[],dispose:()=>{}};var r=I.getDiagnostics(e).filter(d=>{var h=new Cs(d.location.row,d.location.column,d.end_location.row,d.end_location.column);return d.code!=null&&h.intersectRanges(t)}),i=r.filter(d=>{var{fix:h}=d;return h!=null}).map(d=>{var h="Fix";return d.fix!=null&&(d.fix.message!=null&&d.fix.message!==""?h="".concat(d.code,": ").concat(d.fix.message):h="Fix ".concat(d.code)),{title:h,id:"fix-".concat(d.code),kind:"quickfix",edit:d.fix?{edits:d.fix.edits.map(p=>{var m;return{resource:e.uri,versionId:e.getVersionId(),textEdit:{range:{startLineNumber:p.location.row,startColumn:p.location.column,endLineNumber:p.end_location.row,endColumn:p.end_location.column},text:(m=p.content)!==null&&m!==void 0?m:""}}})}:void 0}}),o=new Set,s=new Set;r.forEach(d=>{d.code!=null&&(o.has(d.code)&&s.add(d.code),o.add(d.code))});var a=r.map(d=>{if(d.code==null)return[];var h=e.getLineContent(d.location.row),p=Ee.tokenize(h,e.getLanguageId())[0].at(-1),m={range:{startLineNumber:d.location.row,startColumn:h.length+1,endLineNumber:d.location.row,endColumn:h.length+1},text:" # noqa: ".concat(d.code)};return p!=null&&p.type.startsWith("comment")&&(m.text="# noqa: ".concat(d.code," "),h.startsWith("# noqa:",p.offset)?(m.range.startColumn=p.offset+1,m.range.endColumn=p.offset+9):(m.range.startColumn=p.offset+1,m.range.endColumn=h.startsWith("# ",p.offset)?p.offset+3:p.offset+2)),[{title:"Disable ".concat(d.code," for ").concat(s.has(d.code)?"line ".concat(d.location.row):"this line"),kind:"quickfix",edit:{edits:[{resource:e.uri,versionId:e.getVersionId(),textEdit:m}]}}]}).flat().filter((d,h,p)=>p.find(m=>m.title===d.title)===d),l=[...o].map(d=>({title:"Disable ".concat(d," for this file"),kind:"quickfix",edit:{edits:[{resource:e.uri,versionId:e.getVersionId(),textEdit:{range:{startLineNumber:1,startColumn:1,endLineNumber:1,endColumn:1},text:"# ruff: noqa: ".concat(d,`
|
|
4
4
|
`)}}]}}));return{actions:[...i,...a,...l],dispose:()=>{}}}static handlePythonFormatRequest(e,t,r){if(I.ruffWorkspace)return Be.debug("Formatting Python document: ".concat(e.uri.toString)),[{range:e.getFullModelRange(),text:I.ruffWorkspace.format(e.getValue())}]}constructor(e){super(e),Ot(this,"registeredCompletionProvider",void 0),Ot(this,"registeredSignatureProvider",void 0),Ot(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=ze.registerCompletionItemProvider(e,{provideCompletionItems:this.handleCompletionRequest,triggerCharacters:[".",'"',"'"]}),t.getSignatureHelp!=null&&(this.registeredSignatureProvider=ze.registerSignatureHelpProvider(e,{provideSignatureHelp:this.handleSignatureRequest,signatureHelpTriggerCharacters:["(",","]})),t.getHover!=null&&(this.registeredHoverProvider=ze.registerHoverProvider(e,{provideHover:this.handleHoverRequest}))}componentWillUnmount(){var e,t,r;(e=this.registeredCompletionProvider)===null||e===void 0||e.dispose(),(t=this.registeredSignatureProvider)===null||t===void 0||t.dispose(),(r=this.registeredHoverProvider)===null||r===void 0||r.dispose()}handleCompletionRequest(e,t,r){var{model:i,session:o}=this.props;if(e!==i)return null;var s={textDocument:{uri:"".concat(e.uri),version:e.getVersionId()},position:I.monacoToLspPosition(t),context:r},a=o.getCompletionItems(s);Be.debug("Requested completion items",s);var l=a.then(d=>{Be.debug("Completion items received: ",s,d);var h=d.map(p=>{var{label:m,kind:v,detail:f,documentation:g,sortText:b,filterText:S,textEdit:w,insertTextFormat:y}=p;return{label:m,kind:I.lspToMonacoKind(v),detail:f,documentation:(g==null?void 0:g.kind)==="markdown"?g:g==null?void 0:g.value,sortText:b,filterText:S,insertText:w.text,insertTextRules:y===2?4:y,range:I.lspToMonacoRange(w.range)}});return{incomplete:!0,suggestions:h}}).catch(d=>(Be.error("There was an error retrieving completion items",d),{suggestions:[]}));return l}handleSignatureRequest(e,t,r,i){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:I.monacoToLspPosition(t),context:i},d=a.getSignatureHelp(l);Be.debug("Requested signature help",l);var h=d.then(p=>{Be.debug("Signatures received: ",l,d);var m=p.map(f=>{var{label:g,documentation:b,parameters:S}=f;return{documentation:(b==null?void 0:b.kind)==="markdown"?b:b==null?void 0:b.value,label:g,parameters:S??[]}});if(m.length===0)return o;var v=0;return{value:{signatures:m,activeSignature:v,activeParameter:p[v].activeParameter},dispose:()=>{}}}).catch(p=>(Be.error("There was an error retrieving completion items",p),o));return h}handleHoverRequest(e,t){var{model:r,session:i}=this.props;if(e!==r||i.getHover==null)return null;var o={textDocument:{uri:"".concat(e.uri),version:e.getVersionId()},position:I.monacoToLspPosition(t)},s=i.getHover(o);Be.debug("Requested hover",o);var a=s.then(l=>{Be.debug("Hover received: ",o,l);var{contents:d}=l;return{contents:d!=null?[d]:[]}}).catch(l=>(Be.error("There was an error retrieving hover",l),{contents:[]}));return a}render(){return null}}Ot(I,"ruffWorkspace",void 0);Ot(I,"initRuffPromise",void 0);Ot(I,"isRuffInitialized",!1);Ot(I,"isRuffEnabled",!0);Ot(I,"ruffSettings",Kp);function Co(n,e,t,r,i,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function Gp(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function s(l){Co(o,r,i,s,a,"next",l)}function a(l){Co(o,r,i,s,a,"throw",l)}s(void 0)})}}function wo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function So(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?wo(Object(t),!0).forEach(function(r){qp(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):wo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function qp(n,e,t){return(e=Xp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Xp(n){var e=Zp(n,"string");return typeof e=="symbol"?e:e+""}function Zp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var at=R.module("MonacoUtils"),_o="inmemory://dh-console/";class ye{static init(){var{getWorker:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};at.debug("Initializing Monaco..."),e!==void 0&&ye.registerGetWorker(e);var{initTheme:t,registerLanguages:r}=ye;t(),r([Fp,Tp,Dp,Bp,Np]),ze.onLanguage("python",()=>{ze.registerCodeActionProvider("python",{provideCodeActions:I.handlePythonCodeActionRequest},{providedCodeActionKinds:["quickfix"]}),ze.registerDocumentFormattingEditProvider("python",{provideDocumentFormattingEdits:I.handlePythonFormatRequest})}),Ee.onDidCreateModel(i=>{if(i.getLanguageId()==="python"){I.ruffWorkspace!=null&&I.lintPython(i);var o=tr(s=>I.lintPython(s),250);i.onDidChangeContent(()=>{o(i)})}}),ye.removeConflictingKeybindings(),at.debug("Monaco initialized.")}static initTheme(){var e,t,{removeHashtag:r}=ye,i=cs(Kr);at.debug2("Monaco theme:",Kr),at.debug2("Monaco theme derived:",i);var o=[{token:"",foreground:r(i.foreground)},{token:"string",foreground:r(i.string)},{token:"string.delim",foreground:r(i["string-delim"])},{token:"keyword",foreground:r(i.keyword)},{token:"identifier.js",foreground:r(i["identifier-js"])},{token:"delimiter",foreground:r(i.delimiter)},{token:"comment",foreground:r(i.comment)},{token:"number",foreground:r(i.number)},{token:"storage",foreground:r(i.storage)},{token:"identifier",foreground:r(i.identifier)},{token:"namespace.identifier",foreground:r(i["namespace-identifier"])},{token:"operator",foreground:r(i.operator)},{token:"predefined",foreground:r(i.predefined)},{token:"error.log",foreground:(e=(t=i["log-error"])===null||t===void 0?void 0:t.substring(1))!==null&&e!==void 0?e:""},{token:"warn.log",foreground:r(i["log-warn"])},{token:"info.log",foreground:r(i["log-info"])},{token:"stdout.log",foreground:r(i["log-stdout"])},{token:"trace.log",foreground:r(i["log-trace"])},{token:"debug.log",foreground:r(i["log-debug"])},{token:"date.log",foreground:r(i["log-date"])}],s={foreground:i.foreground,errorForeground:i["error-foreground"],"inputOption.activeBorder":i["input-option-active-border"],"editor.background":i.background,"editor.foreground":i.foreground,"editor.lineHighlightBackground":i["editor-line-highlight-background"],"editorLineNumber.foreground":i["editor-line-number-foreground"],"editorLineNumber.activeForeground":i["editor-line-number-active-foreground"],"editor.selectionBackground":i["editor-selection-background"],"editor.inactiveSelectionBackground":i["editor-inactive-selection-background"],"editor.selectionHighlightBackground":i["editor-selection-highlight-background"],"editor.wordHighlightBackground":i["editor-word-highlight-background"],"editor.findMatchBackground":i["editor-find-match-background"],"editor.findMatchHighlightBackground":i["editor-find-match-highlight-background"],"editorSuggestWidget.background":i["editor-suggest-widget-background"],"editorSuggestWidget.border":i["editor-suggest-widget-border"],"editorSuggestWidget.foreground":i["editor-suggest-widget-foreground"],"editorSuggestWidget.selectedBackground":i["editor-suggest-widget-selected-background"],"list.activeSelectionBackground":i["editor-suggest-widget-selected-background"],"editorSuggestWidget.selectedForeground":i["editor-suggest-widget-selected-foreground"],"list.activeSelectionForeground":i["editor-suggest-widget-selected-foreground"],"editorSuggestWidget.highlightForeground":i["editor-suggest-widget-highlightForeground"],"editorSuggestWidget.focusHighlightForeground":i["editor-suggest-widget-focus-highlight-foreground"],"list.hoverBackground":i["list-hover-background"],"dropdown.background":i["context-menu-background"],"dropdown.foreground":i["context-menu-foreground"],"menu.selectionBackground":i["menu-selection-background"],"menu.selectionForeground":i["menu-selection-foreground"],"keybindingLabel.foreground":i["menu-selection-foreground"],"list.focusBackground":i["menu-selection-background"],"editorWidget.background":i["editor-widget-background"],"inputOption.activeBackground":i["input-option-active-background"],"inputOption.activeForeground":i["input-option-active-foreground"],focusBorder:i["focus-border"],"input.background":i["input-background"],"input.foreground":i["input-foreground"],"input.border":i["input-border"],"textLink.foreground":i["text-link-foreground"],"textLink.activeForeground":i["text-link-active-foreground"],"editorLink.activeForeground":i["editor-link-active-foreground"],"editorBracketHighlight.foreground1":i["editor-bracket-foreground1"],"editorBracketHighlight.foreground2":i["editor-bracket-foreground2"],"editorBracketHighlight.foreground3":i["editor-bracket-foreground3"],"editorBracketHighlight.foreground4":i["editor-bracket-foreground4"],"editorBracketHighlight.foreground5":i["editor-bracket-foreground5"],"editorBracketHighlight.foreground6":i["editor-bracket-foreground6"],"editorBracketHighlight.unexpectedBracket.foreground":i["editor-unexpected-bracket-foreground"]};Ee.defineTheme("dh-dark",{base:"vs-dark",inherit:!0,rules:o,colors:s});try{Ee.setTheme("dh-dark")}catch(a){at.error("Failed to set 'dh-dark' Monaco theme, falling back to vs-dark",a),Ee.setTheme("vs-dark")}}static registerGetWorker(e){window.MonacoEnvironment=So(So({},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(r=>{var{id:i}=r;return i});ze.getLanguages().filter(r=>{var{id:i}=r;return t.includes(i)}).forEach(r=>{var i=r;at.debug2("Overriding default language loader:",i.id)}),e.forEach(r=>{ye.registerLanguage(r)})}static registerLanguage(e){at.debug2("Registering language: ",e.id),ze.register(e),ze.onLanguage(e.id,()=>{ze.setLanguageConfiguration(e.id,e.conf),ze.setMonarchTokensProvider(e.id,e.language)})}static setEOL(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ee.EndOfLineSequence.LF;(t=e.getModel())===null||t===void 0||t.setEOL(r)}static openDocument(e,t){var r=e.getModel();L(r);var i={textDocument:{uri:"".concat(r.uri),languageId:r.getLanguageId(),version:r.getVersionId(),text:r.getValue()}};at.debug2("didOpenDocumentParams: ",i),t.openDocument(i);var o=e.onDidChangeModelContent(s=>{for(var{changes:a,versionId:l}=s,d=[],h=0;h<a.length;h+=1){var p=a[h],{range:m,rangeLength:v,text:f}=p,g={range:{start:{line:m.startLineNumber-1,character:m.startColumn-1},end:{line:m.endLineNumber-1,character:m.endColumn-1}},rangeLength:v,text:f};d.push(g)}if(d.length>0){var b={textDocument:{version:l,uri:"".concat(r.uri)},contentChanges:d};at.debug2("didChangeDocumentParams",b),t.changeDocument(b)}});return o}static closeDocument(e,t){var r=e.getModel();L(r);var i={textDocument:{uri:"".concat(r.uri)}};t.closeDocument(i)}static registerPasteHandler(e){e.onDidPaste(t=>{var r=/“|”/g,i=/\u200b/g,o=/\u00A0/g,s=e.getModel();L(s);var a=s.getValueInRange(t.range);(r.test(a)||i.test(a)||o.test(a))&&s.applyEdits([{range:t.range,text:a.replace(r,'"').replace(i,"").replace(o," ")}])})}static isMacPlatform(){var{platform:e}=window.navigator;return e.startsWith("Mac")}static removeConflictingKeybindings(){Ee.addKeybindingRule({keybinding:We.CtrlCmd|Rt.KeyD,command:null}),ye.isMacPlatform()||Ee.addKeybindingRule({keybinding:We.CtrlCmd|Rt.KeyH,command:null})}static disableKeyBindings(e,t){e.addAction({id:"disable-keybindings-".concat(ct()),label:"",keybindings:t,run:()=>{}})}static getMonacoKeyCodeFromShortcut(e){var{keyState:t}=e,{keyValue:r}=t;if(r===null)return 0;var i=ye.isMacPlatform();return i?(t.metaKey?We.CtrlCmd:0)|(t.shiftKey?We.Shift:0)|(t.altKey?We.Alt:0)|(t.ctrlKey?We.WinCtrl:0)|fi.fromString(r):(t.ctrlKey?We.CtrlCmd:0)|(t.shiftKey?We.Shift:0)|(t.altKey?We.Alt:0)|(t.metaKey?We.WinCtrl:0)|fi.fromString(r)}static provideLinks(e){for(var t=[],r=function(s){var a=e.getLineContent(s),l=zl(a),d=l.filter(h=>h.type==="url"?/^https?:\/\//.test(h.value):!0);d.forEach(h=>{t.push({url:h.href,range:new Cs(s,h.start+1,s,h.end+1)})})},i=1;i<=e.getLineCount();i+=1)r(i);return{links:t}}static generateConsoleUri(){return Wl.parse("".concat(_o).concat(ct()))}static isConsoleModel(e){return e.uri.toString().startsWith(_o)}static canFormat(e){var t;return((t=e.getAction("editor.action.formatDocument"))===null||t===void 0?void 0:t.isSupported())===!0}static formatDocument(e){return Gp(function*(){var t;yield(t=e.getAction("editor.action.formatDocument"))===null||t===void 0?void 0:t.run()})()}}function Eo(n,e,t,r,i,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function Yp(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function s(l){Eo(o,r,i,s,a,"next",l)}function a(l){Eo(o,r,i,s,a,"throw",l)}s(void 0)})}}function Ae(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Sr=R.module("ConsoleInput"),Qn=parseInt(Kr["line-height"],10),Ha=6,$a=6,ev=Qn+Ha+$a,_r=100;class rn extends c.PureComponent{constructor(e){super(e),Ae(this,"cancelListener",void 0),Ae(this,"resizeObserver",void 0),Ae(this,"commandContainer",void 0),Ae(this,"commandEditor",void 0),Ae(this,"commandHistoryIndex",void 0),Ae(this,"commandSuggestionContainer",void 0),Ae(this,"loadingPromise",void 0),Ae(this,"timestamp",void 0),Ae(this,"bufferIndex",void 0),Ae(this,"history",void 0),Ae(this,"modifiedCommands",void 0),this.handleResize=this.handleResize.bind(this),this.commandContainer=O.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,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(e){if(Sr.debug("Command received: ",e),!r){var i;this.commandHistoryIndex=null,(i=this.commandEditor)===null||i===void 0||i.setValue(e)}t&&this.focusEnd(),this.updateDimensions(),r&&this.processCommand(e)}}initCommandEditor(){var{language:e,session:t}=this.props,r=Ee.createModel("",e,ye.generateConsoleUri()),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:Ha,bottom:$a},value:"",wordWrap:"on",autoClosingBrackets:"beforeWhitespace",model:r},o=this.commandContainer.current;L(o),this.commandEditor=Ee.create(o,i),ye.setEOL(this.commandEditor),ye.openDocument(this.commandEditor,t),this.commandEditor.onDidChangeModelContent(()=>{var s,a=(s=this.commandEditor)===null||s===void 0?void 0:s.getValue();this.modifiedCommands.set(this.commandHistoryIndex,a??null),this.updateDimensions()}),this.commandEditor.onDidFocusEditorText(()=>{this.setState({isFocused:!0})}),this.commandEditor.onDidBlurEditorText(()=>{this.setState({isFocused:!1})}),this.commandEditor.onKeyDown(s=>{var{commandEditor:a,commandHistoryIndex:l}=this,d=a==null?void 0:a.getPosition();L(d);var{lineNumber:h}=d;if(!s.altKey&&!s.shiftKey&&!s.metaKey){if(s.code==="ArrowUp"&&!this.isSuggestionMenuPopulated()&&h===1){l!=null?this.loadCommand(l+1):this.loadCommand(0),this.focusStart(),s.stopPropagation(),s.preventDefault();return}if(s.code==="ArrowDown"&&!this.isSuggestionMenuPopulated()&&h===(r==null?void 0:r.getLineCount())){l!=null&&l>0?this.loadCommand(l-1):this.loadCommand(null),this.focusEnd(),s.stopPropagation(),s.preventDefault();return}if(s.keyCode===Rt.Enter&&!this.isSuggestionMenuPopulated()){var p;s.stopPropagation(),s.preventDefault();var m=(p=this.commandEditor)===null||p===void 0?void 0:p.getValue().trim();if(m!==void 0){var v;this.processCommand(m),(v=this.commandEditor)===null||v===void 0||v.setValue("")}}}}),ye.disableKeyBindings(this.commandEditor,[We.CtrlCmd|Rt.KeyF]),ye.registerPasteHandler(this.commandEditor),this.commandEditor.focus(),this.resizeObserver.observe(o),this.updateDimensions(),this.setState({model:this.commandEditor.getModel()})}destroyCommandEditor(){var{session:e}=this.props;this.commandEditor&&(ye.closeDocument(this.commandEditor,e),this.commandEditor.dispose(),this.commandEditor=void 0)}handleResize(){this.updateDimensions()}isSuggestionMenuActive(){var e;if(!this.commandSuggestionContainer){var t;this.commandSuggestionContainer=(t=this.commandEditor)===null||t===void 0||(t=t.getDomNode())===null||t===void 0?void 0:t.querySelector(".suggest-widget")}return(e=this.commandSuggestionContainer&&this.commandSuggestionContainer.classList.contains("visible"))!==null&&e!==void 0?e:!1}isSuggestionMenuPopulated(){var e,t;return this.isSuggestionMenuActive()&&((e=(t=this.commandSuggestionContainer)===null||t===void 0||(t=t.querySelector(".monaco-list-rows"))===null||t===void 0?void 0:t.childElementCount)!==null&&e!==void 0?e:0)>0}focus(){var e;(e=this.commandEditor)===null||e===void 0||e.focus()}focusStart(){var e,t,r,i,o,s=(e=this.commandEditor)===null||e===void 0?void 0:e.getModel();L(s);var a=s.getLineLength(1)+1,l=(t=this.commandEditor)===null||t===void 0?void 0:t.getTopForPosition(1,a);L(l),(r=this.commandEditor)===null||r===void 0||r.setPosition({lineNumber:1,column:a}),(i=this.commandEditor)===null||i===void 0||i.setScrollTop(l),(o=this.commandEditor)===null||o===void 0||o.focus()}focusEnd(){var e,t,r,i,o,s=(e=this.commandEditor)===null||e===void 0?void 0:e.getModel();L(s);var a=s.getLineCount(),l=s.getLineLength(a)+1,d=(t=this.commandEditor)===null||t===void 0?void 0:t.getTopForPosition(a,l);L(d),(r=this.commandEditor)===null||r===void 0||r.setPosition({lineNumber:a,column:l}),(i=this.commandEditor)===null||i===void 0||i.setScrollTop(d),(o=this.commandEditor)===null||o===void 0||o.focus()}clear(){var e,t;(e=this.commandEditor)===null||e===void 0||e.focus(),(t=this.commandEditor)===null||t===void 0||(t=t.getModel())===null||t===void 0||t.setValue(""),this.commandHistoryIndex=null}layoutEditor(){this.commandEditor&&this.commandEditor.layout()}loadCommand(e){var t;if(!(e!==null&&e>=this.history.length)){var r=this.modifiedCommands.get(e),i=e===null?"":this.history[this.history.length-e-1];this.commandHistoryIndex=e,(t=this.commandEditor)===null||t===void 0||(t=t.getModel())===null||t===void 0||t.setValue(r??i),e!==null&&e>this.history.length-_r&&this.loadMoreHistory()}}loadMoreHistory(){var e=this;return Yp(function*(){try{if(e.loadingPromise!=null||e.bufferIndex==null)return;var{commandHistoryStorage:t,language:r,scope:i}=e.props;e.loadingPromise=He.makeCancelable(t.getTable(r,i??"",e.timestamp),a=>a.close());var o=yield e.loadingPromise;o.setReversed(!0),o.setViewport({top:e.bufferIndex,bottom:e.bufferIndex+_r-1}),e.loadingPromise=He.makeCancelable(o.getViewportData(),()=>o.close());var s=yield e.loadingPromise;e.bufferIndex+=_r,e.bufferIndex>=o.size&&(e.bufferIndex=null),e.history=[...s.items.filter((a,l,d)=>{var{name:h}=a;return l===0||h!==d[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,He.isCanceled(a)){Sr.debug2("Promise canceled, not loading history");return}Sr.error("Error fetching history",a)}})()}processCommand(e){this.commandHistoryIndex=null,this.modifiedCommands.clear(),L(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;L(e);var t=this.commandEditor.getContentHeight(),r=Math.max(Math.min(t,e),ev),i=t>r,o={overviewRulerLanes:i?void 0:0};this.setState({commandEditorHeight:r},()=>{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:r}=this.props,{commandEditorHeight:i,isFocused:o,model:s}=this.state;return u.jsx("div",{className:$("console-input-wrapper",{disabled:e}),children:u.jsxs("div",{className:$("console-input-inner-wrapper",{focus:o}),children:[u.jsx("div",{className:rn.INPUT_CLASS_NAME,ref:this.commandContainer,style:{height:i}}),s&&u.jsx(I,{model:s,language:t,session:r})]})})}}Ae(rn,"defaultProps",{maxHeight:Qn*10,scope:null,disabled:!1});Ae(rn,"INPUT_CLASS_NAME","console-input");function Et(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Po="pasted values",rv=[/^audio.*/,/^font.*/,/^image.*/,/^video.*/],Er=[".csv",".tsv",".tab",".psv",".dsv",".txt"],To=[".zip"];class Pe extends c.Component{static isValidDropItem(e){return e!=null&&e.kind==="file"&&!rv.find(t=>t.test(e.type))}static isValidExtension(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Er.some(r=>e.endsWith(r))||t&&To.some(r=>e.endsWith(r))}static handleDragOver(e){e.preventDefault(),e.stopPropagation()}static getIcon(e){return e===Po?ui:e.endsWith(".csv")?vl:e.endsWith(".zip")?fl:gl}constructor(e){super(e),Et(this,"fileElem",void 0),Et(this,"divElem",void 0),Et(this,"getValidExtensions",Qt(t=>t?[...Er,...To]:[...Er])),Et(this,"getAcceptString",Qt(t=>this.getValidExtensions(t).join(", "))),Et(this,"getFileTypeErrorString",Qt(t=>Sd.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=O.createRef(),this.divElem=O.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:r,dragError:i}=this.props;if(e.preventDefault(),e.stopPropagation(),i!=null){r();return}if(!(e.dataTransfer==null||e.dataTransfer.items==null||e.dataTransfer.items.length===0)){var o=e.dataTransfer.items[0].getAsFile();L(o),Pe.isValidExtension(o.name,t)?this.handleFile(o):this.setState({dropError:Pe.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:r}=this.props;r||navigator.clipboard.readText().then(i=>{e(i),this.setState({selectedFileName:Po,dropError:void 0})}).catch(i=>t(i))}handlePasteEvent(e){e.stopPropagation(),e.preventDefault(),this.handleMenuPaste()}makeContextMenuItems(){var{uploadInProgress:e}=this.props;return[{title:"Paste",icon:ui,action:this.handleMenuPaste,shortcut:Zt.PASTE,disabled:e}]}render(){var{allowZip:e,dragError:t,uploadInProgress:r}=this.props,{selectedFileName:i,dropError:o}=this.state,s=t??o,a=this.makeContextMenuItems();return u.jsxs("div",{ref:this.divElem,className:"csv-overlay fill-parent-absolute",onDragOver:Pe.handleDragOver,onDrop:this.handleDrop,tabIndex:-1,children:[u.jsx(re,{actions:a}),u.jsx("input",{ref:this.fileElem,type:"file",id:"fileElem",accept:this.getAcceptString(e),style:{display:"none"},onChange:this.handleFiles,"data-testid":"fileElem"}),!i&&(s===void 0||s==="")&&u.jsxs("div",{className:"message-content",children:[u.jsx("div",{className:"message-icon",children:u.jsx(le,{icon:bl})}),u.jsx("label",{children:"Drop file (or paste values) here to import"}),u.jsx("div",{className:"message-small",children:u.jsx("label",{children:"or"})}),u.jsx(te,{kind:"primary",onClick:this.handleSelectFile,children:"Select File..."})]}),i&&(s===void 0||s==="")&&u.jsxs("div",{className:"selected-content",children:[u.jsx("div",{className:"selected-icon",children:u.jsx(le,{icon:Pe.getIcon(i)})}),u.jsxs("div",{className:"selected-text",children:[u.jsx("label",{children:"Selected File"}),u.jsxs("label",{className:"selected-name",children:[i,!r&&u.jsx(te,{kind:"ghost",className:"ml-2",onClick:this.unstageFile,icon:yl,tooltip:"Remove"})]})]})]}),!!s&&u.jsxs("div",{className:"message-content",children:[u.jsx("div",{className:"message-icon",children:u.jsx(le,{icon:vs})}),u.jsx("label",{children:s}),s===Pe.FILE_TYPE_ERROR&&u.jsx("div",{className:"message-small",children:u.jsx("label",{children:this.getFileTypeErrorString(e)})})]})]})}}Et(Pe,"defaultProps",{allowZip:!1,dragError:null});Et(Pe,"MULTIPLE_FILE_ERROR","Please select only one file");Et(Pe,"FILE_TYPE_ERROR","Filetype not supported.");function Ua(n,e){var t=n.internalStream("string");return t.readable=!0,t.read=()=>!1,t.removeListener=()=>!1,t.on("data",(r,i)=>e(i)),t}function Oo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function xo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Oo(Object(t),!0).forEach(function(r){Se(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Oo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Se(n,e,t){return(e=iv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function iv(n){var e=ov(n,"string");return typeof e=="symbol"?e:e+""}function ov(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Io="unknown",sv=2147483647,av=-2147483648,Do=/^[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]+)?$/,Mo=/^([0-9]+T)?([0-9]+):([0-9]+)(:[0-9]+)?(?:\.[0-9]{1,9})?$/;class be{static determineType(e,t,r){if(!e||e===r)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 Do.test(e)?B.DATE_TIME:B.STRING}static checkLocalTime(e){return Mo.test(e)?B.LOCAL_TIME:B.STRING}static getTypeFromUnknown(e){var t=e.replace(/,/g,"");if(be.isNotParsableNumber(t)){var r=e.toLowerCase();return r==="true"||r==="false"?B.BOOLEAN:Do.test(e)&&e.includes(":")?B.DATE_TIME:Mo.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 r=parseInt(e,10);return r>sv||r<av?B.LONG:B.INTEGER}constructor(e,t,r,i,o,s,a,l,d,h){Se(this,"onFileCompleted",void 0),Se(this,"file",void 0),Se(this,"readHeaders",void 0),Se(this,"nullString",void 0),Se(this,"onProgress",void 0),Se(this,"onError",void 0),Se(this,"types",void 0),Se(this,"chunks",void 0),Se(this,"totalChunks",void 0),Se(this,"rowCount",void 0),Se(this,"isZip",void 0),Se(this,"shouldTrim",void 0),Se(this,"zipProgress",void 0),Se(this,"config",void 0),this.onFileCompleted=e,this.file=t,this.readHeaders=r,this.nullString=o,this.onProgress=s,this.onError=a,this.chunks=0,this.totalChunks=l,this.rowCount=0,this.isZip=d,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=xo(xo({},i),{},{error:this.handleError,chunk:this.handleChunk,complete:this.handleComplete})}parse(){if(this.file instanceof File||this.file instanceof Blob)fn.parse(this.file,this.config);else{var e=Ua(this.file,this.handleNodeUpdate);fn.parse(e,this.config),e.resume()}}handleChunk(e,t){var{data:r}=e;if(!this.types){if(r==null||r.length===0){t.abort(),this.onError("Error parsing CSV: no data in file.");return}this.types=new Array(r[0].length).fill(Io),this.readHeaders&&(r=r.slice(1))}this.rowCount+=r.length,L(this.types);var i=[...this.types];r.forEach(a=>{if(a.length>=i.length){for(var l=0;l<i.length;l+=1)i[l]=be.determineType(this.shouldTrim?a[l].trim():a[l],i[l],this.nullString);this.types=i}else t.abort(),this.onError(`Error parsing CSV: Insufficient data in row.
|
|
5
5
|
Expected length `.concat(i.length," but found ").concat(a.length,`.
|
|
@@ -17,4 +17,4 @@ Row = `).concat(a))}),this.chunks+=1;var o=0;this.totalChunks>0?o=Math.round(thi
|
|
|
17
17
|
`))}}if(r=r.trimRight(),this.editor.setValue(r),t){var a,l=(a=this.editor.getModel())===null||a===void 0?void 0:a.getLineCount();L(l),this.editor.revealLine(l,1)}this.stopFlushTimer(),this.bufferedMessages=[]}}truncateLogIfNecessary(){this.messages.length>ue.maxLogSize&&(this.messages=this.messages.splice(this.messages.length-ue.truncateSize))}scrollToBottom(){var e,t;if(this.editor){var r=(e=this.editor)===null||e===void 0||(t=e.getModel)===null||t===void 0||(t=t.call(e))===null||t===void 0?void 0:t.getLineCount();L(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 L(t),this.isLineVisible(t)}isLineVisible(e){var t,r=(t=this.editor)===null||t===void 0?void 0:t.getVisibleRanges();if(r==null||r.length===0)return!1;for(var i=0;i<r.length;i+=1){var o=r[i];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 r=this.bufferedMessages[t],i=ue.getLogText(r);e+=i,i.charAt(i.length-1)!==`
|
|
18
18
|
`&&(e+=`
|
|
19
19
|
`)}this.bufferedMessages=[],this.appendLogText(e)}queue(e){this.bufferedMessages.push(e),this.bufferedMessages.length===1&&(this.flushTimer=setTimeout(this.handleFlushTimeout,ue.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,r=this.getMenuActions(t);return u.jsxs("div",{className:"log-pane h-100 w-100",children:[u.jsxs("div",{className:"log-pane-menu",children:[u.jsx(te,{kind:"ghost",className:"btn-clear-logs",onClick:this.handleClearClick,icon:El,tooltip:"Clear log"}),u.jsx(te,{kind:"ghost",className:"btn-link-icon btn-overflow",icon:Pl,tooltip:"Log Settings",onClick:()=>{},children:u.jsx(ir,{actions:r,popperClassName:"log-level-menu-popper",popperOptions:e})})]}),u.jsx("div",{className:"log-pane-editor h-100 w-100",ref:i=>{this.editorContainer=i}})]})}}Re(ue,"DefaultLogLevels",[fe.STDOUT,fe.ERROR,fe.FATAL,fe.STDERR,fe.WARN]);Re(ue,"AllLogLevels",[fe.INFO,fe.STDOUT,fe.ERROR,fe.FATAL,fe.STDERR,fe.WARN,fe.DEBUG,fe.TRACE]);Re(ue,"bufferTimeout",16);Re(ue,"maxLogSize",131072);Re(ue,"truncateSize",65536);function Bo(n,e,t,r,i,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function Fv(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function s(l){Bo(o,r,i,s,a,"next",l)}function a(l){Bo(o,r,i,s,a,"throw",l)}s(void 0)})}}var Hv=R.module("HeapUsage");function $v(n){var e,{connection:t,defaultUpdateInterval:r,hoverUpdateInterval:i,bgMonitoring:o=!0,monitorDuration:s}=n,a=Vh(),[l,d]=c.useState({freeMemory:0,maximumHeapSize:999,totalHeapSize:0}),[h,p]=c.useState(!1),m=c.useRef({timestamps:[],usages:[]}),v=Os(),f=c.useCallback(Fv(function*(){try{var j=yield t.getWorkerHeapInfo();if(!v.current)return;if(d(j),o||h){for(var H=(j.totalHeapSize-j.freeMemory)/j.maximumHeapSize,U=Date.now(),{timestamps:ce,usages:tt}=m.current;ce.length!==0&&U-ce[0]>s*1.5;)ce.shift(),tt.shift();ce.push(U),tt.push(H)}else m.current={timestamps:[],usages:[]}}catch(Ge){Hv.warn("Unable to get heap usage",Ge)}}),[t,v,o,h,s]);Dd(f,h?i:r);var g=(j,H)=>Math.round(j*10**H)/10**H,b=2,S=1024**3,{freeMemory:w,totalHeapSize:y,maximumHeapSize:D}=l,V=g(w/S,b),X=g(y/S,b),G=g(D/S,b),A=X-V,M=function(H,U){var ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return u.jsxs("div",{className:$("heap-usage-info-row",{"heading-bottom-border":ce}),children:[u.jsx("div",{className:"font-weight-bold",children:H}),u.jsx("div",{children:U})]})},{timestamps:Q,usages:W}=m.current,k=(e=Q[Q.length-1])!==null&&e!==void 0?e:0,z=y/D,F=(y-w)/D;return u.jsxs("div",{className:"max-memory",children:[u.jsx("div",{className:"total-memory",style:{width:"calc(".concat(z*100,"% - ").concat(z*2,"px")}}),u.jsx("div",{className:$("used-memory",{"heap-overflow":(y-w)/D>.95}),style:{width:"calc(".concat(F*100,"% - ").concat(F*2,"px")}}),u.jsxs("div",{className:"memory-text",children:[G.toFixed(1)," GB"]}),u.jsx(ie,{onEntered:()=>p(!0),onExited:()=>p(!1),interactive:!0,children:u.jsxs("div",{className:"heap-tooltip",children:[M("In use:","".concat(A.toFixed(b)," of ").concat(G.toFixed(b)," GB"),!0),M("Free:","".concat(V.toFixed(b)," GB")),M("Total:","".concat(X.toFixed(b)," GB")),M("Max:","".concat(G.toFixed(b)," GB")),u.jsx("div",{className:"heap-plot",children:u.jsx(zh,{data:[{x:[...Q],y:[...W],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:[k-s,k],linecolor:a.linecolor,linewidth:2,mirror:!0},yaxis:{dtick:.2,gridcolor:a.linecolor,range:[0,1],linecolor:a.linecolor,linewidth:2,mirror:!0}}})}),u.jsxs("div",{className:"heap-utilisation-text",children:["% utilization over ",Math.round(s/1e3/60)," min."]})]})})]})}function In(n,e,t){return(e=Uv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Uv(n){var e=Bv(n,"string");return typeof e=="symbol"?e:e+""}function Bv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class De{}In(De,"SESSION_OPENED","ConsoleEvent.SESSION_OPENED");In(De,"SESSION_CLOSED","ConsoleEvent.SESSION_CLOSED");In(De,"FOCUS_HISTORY","ConsoleEvent.FOCUS_HISTORY");In(De,"SEND_COMMAND","ConsoleEvent.SEND_COMMAND");In(De,"SETTINGS_CHANGED","ConsoleEvent.SETTINGS_CHANGED");function It(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=Wv(n,"string");return typeof e=="symbol"?e:e+""}function Wv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class it{}It(it,"TABLE_CHANGED","InputFilterEvent.TABLE_CHANGED");It(it,"COLUMNS_CHANGED","InputFilterEvent.COLUMNS_CHANGED");It(it,"FILTERS_CHANGED","InputFilterEvent.FILTERS_CHANGED");It(it,"CLEAR_ALL_FILTERS","InputFilterEvent.CLEAR_ALL_FILTERS");It(it,"COLUMN_SELECTED","InputFilterEvent.COLUMN_SELECTED");It(it,"OPEN_DROPDOWN","InputFilterEvent.OPEN_DROPDOWN");It(it,"OPEN_INPUT","InputFilterEvent.OPEN_INPUT");It(it,"OPEN_FILTER_SET_MANAGER","InputFilterEvent.OPEN_FILTER_SET_MANAGER");function ft(n,e,t){return(e=zv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function zv(n){var e=Vv(n,"string");return typeof e=="symbol"?e:e+""}function Vv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Te{}ft(Te,"CREATE_NOTEBOOK","NotebookEvent.createNotebook");ft(Te,"SELECT_NOTEBOOK","NotebookEvent.selectNotebook");ft(Te,"CLOSE_FILE","NotebookEvent.closeFile");ft(Te,"RENAME","NotebookEvent.rename");ft(Te,"RENAME_FILE","NotebookEvent.renameFile");ft(Te,"REGISTER_FILE","NotebookEvent.registerFile");ft(Te,"SEND_TO_NOTEBOOK","NotebookEvent.sendToNotebook");ft(Te,"UNREGISTER_FILE","NotebookEvent.unregisterFile");ft(Te,"PROMOTE_FROM_PREVIEW","NotebookEvent.promoteFromPreview");var Gv=["children"];function Ko(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Wo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ko(Object(t),!0).forEach(function(r){qv(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ko(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function qv(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=Zv(n,"string");return typeof e=="symbol"?e:e+""}function Zv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Yv(n,e){if(n==null)return{};var t,r,i=Qv(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function Qv(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}class Jv extends c.PureComponent{constructor(e){super(e),this.handleClearAllFilters=this.handleClearAllFilters.bind(this),this.handleSessionClosed=this.handleSessionClosed.bind(this),this.handleSessionOpened=this.handleSessionOpened.bind(this)}componentDidMount(){var{glEventHub:e}=this.props;e.on(De.SESSION_CLOSED,this.handleSessionClosed),e.on(De.SESSION_OPENED,this.handleSessionOpened),e.on(it.CLEAR_ALL_FILTERS,this.handleClearAllFilters)}componentWillUnmount(){var{glEventHub:e}=this.props;e.off(De.SESSION_CLOSED,this.handleSessionClosed),e.off(De.SESSION_OPENED,this.handleSessionOpened),e.off(it.CLEAR_ALL_FILTERS,this.handleClearAllFilters)}handleClearAllFilters(){for(var{onClearAllFilters:e}=this.props,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleSessionClosed(e){var{onSessionClose:t}=this.props;t==null||t(e)}handleSessionOpened(e,t){var{onSessionOpen:r}=this.props;r==null||r(e,t)}render(){var e=this.props,{children:t}=e,r=Yv(e,Gv);return u.jsx(Zm,Wo(Wo({},r),{},{children:t}))}}var ur=Us(Jv),ef=Object.freeze({}),tf=new Map,hr=Object.freeze([]),Qg=(n,e)=>{var t;return(t=Ce(n,e).columns)!==null&&t!==void 0?t:hr},Jg=(n,e)=>{var t;return(t=Ce(n,e).filterSets)!==null&&t!==void 0?t:hr},eb=(n,e)=>{var t;return(t=Ce(n,e).filters)!==null&&t!==void 0?t:hr},tb=(n,e)=>{var t;return(t=Ce(n,e).tableMap)!==null&&t!==void 0?t:tf},nb=(n,e)=>Ce(n,e).isolatedLinkerPanelId,rb=(n,e)=>{var t;return(t=Ce(n,e).links)!==null&&t!==void 0?t:hr},ib=(n,e)=>Ce(n,e).columnSelectionValidator,ob=(n,e)=>{var t;return(t=Ce(n,e).consoleSettings)!==null&&t!==void 0?t:ef},sb=(n,e)=>Ce(n,e).connection,cr=(n,e)=>Ce(n,e).sessionWrapper;function er(n,e,t){return(e=nf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nf(n){var e=rf(n,"string");return typeof e=="symbol"?e:e+""}function rf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var $n=R.module("CommandHistoryPanel");class Dn extends c.Component{static handleError(e){$n.error(e)}constructor(e){super(e),er(this,"container",void 0),er(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=O.createRef(),this.pending=new nr;var{session:t,sessionId:r,language:i}=e;this.state={panelState:{},session:t,sessionId:r,language:i,contextActions:[{action:this.handleFocusHistory,shortcut:Jt.COMMAND_HISTORY.FOCUS_HISTORY}]}}componentDidMount(){var{glEventHub:e,session:t}=this.props;e.on(De.FOCUS_HISTORY,this.handleFocusHistory),t!=null&&this.loadTable()}componentWillUnmount(){var{glEventHub:e}=this.props;e.off(De.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:r,sessionId:i}=t;this.setState({session:e,sessionId:i,language:r},()=>{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:r,language:i}=this.state;if($n.debug("handleSendToNotebook",r,e),!r){$n.error("Session is not connected.");return}var{glEventHub:o}=this.props;o.emit(t?Te.CREATE_NOTEBOOK:Te.SEND_TO_NOTEBOOK,r,i,e)}handleSendToConsole(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;$n.debug("handleSendToConsole",e);var{glEventHub:i}=this.props;i.emit(De.SEND_COMMAND,e,t,r)}loadTable(){var{commandHistoryStorage:e}=this.props,{language:t,sessionId:r}=this.state;L(t),L(r),this.pending.add(e.getTable(t,r,Date.now()),i=>i.close()).then(i=>{this.setState({table:i})}).catch(Dn.handleError)}render(){var{glContainer:e,glEventHub:t,commandHistoryStorage:r}=this.props,{language:i,contextActions:o,table:s}=this.state;return u.jsxs(ur,{className:"command-history-pane",componentPanel:this,glContainer:e,glEventHub:t,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,onShow:this.handleShow,children:[!s&&u.jsx("div",{className:"command-history-disconnected-message",children:"Waiting for console connection"}),s&&i!=null&&u.jsxs(u.Fragment,{children:[u.jsx(_e,{ref:this.container,language:i,sendToNotebook:this.handleSendToNotebook,sendToConsole:this.handleSendToConsole,table:s,commandHistoryStorage:r}),u.jsx(re,{actions:o})]})]})}}er(Dn,"COMPONENT","CommandHistoryPanel");er(Dn,"TITLE","Command History");var of=(n,e)=>{var t=Vs(n),r=cr(n,e.localDashboardId),{session:i,config:o}=r??{},{type:s,id:a}=o??{};return{commandHistoryStorage:t,language:s,session:i,sessionId:a}},ab=En(of,null,null,{forwardRef:!0})(Dn);function zo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Un(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?zo(Object(t),!0).forEach(function(r){Ht(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):zo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ht(n,e,t){return(e=sf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function sf(n){var e=af(n,"string");return typeof e=="symbol"?e:e+""}function af(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Bn=R.module("ConsolePanel"),lf=500,df=Object.freeze({consoleSettings:{},itemIds:[]});class mr extends c.PureComponent{constructor(e){super(e),Ht(this,"consoleRef",void 0),Ht(this,"objectSubscriptionCleanup",void 0),Ht(this,"savePanelState",_n(()=>{var{consoleSettings:s,itemIds:a}=this.state,l={consoleSettings:s,itemIds:[...a]};Bn.debug("Saving panel state",l),this.setState({panelState:l})},lf)),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=O.createRef();var{panelState:t}=e,r=Un(Un({},df),t||{}),{consoleSettings:i,itemIds:o}=r;this.state={consoleSettings:i,itemIds:new Map(o),objectMap:new Map,error:void 0,panelState:r}}componentDidMount(){var{glEventHub:e}=this.props;this.closeDisconnectedPanels(),e.on(Y.MOUNT,this.handlePanelMount),this.subscribeToFieldUpdates()}componentDidUpdate(e,t){var{consoleSettings:r,itemIds:i}=this.state;(t.consoleSettings!==r||t.itemIds!==i)&&this.savePanelState()}componentWillUnmount(){var e,{glEventHub:t}=this.props;this.savePanelState.flush(),t.off(Y.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(r=>{Bn.debug("Got updates",r),this.setState(i=>{var{objectMap:o}=i,{updated:s,created:a,removed:l}=r,d=[...s,...l],h=new Map(o);d.forEach(m=>{var{title:v}=m;v!==void 0&&h.delete(v)});var p=[...s,...a];return p.forEach(m=>{m.title!==void 0&&h.set(m.title,m)}),{objectMap:h}})})}}setItemId(e,t){this.setState(r=>{var{itemIds:i}=r,o=new Map(i);return o.set(e,t),{itemIds:o}})}getItemId(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,{itemIds:r}=this.state,i=r.get(e);return i==null&&t&&(i=ct(),this.setItemId(e,i)),i}handleTabFocus(){var e;(e=this.consoleRef.current)===null||e===void 0||e.focus()}handlePanelMount(e){var t,r,{itemIds:i}=this.state,o=e==null||(t=e.props)===null||t===void 0?void 0:t.id,s=e==null||(r=e.props)===null||r===void 0||(r=r.metadata)===null||r===void 0?void 0:r.sourcePanelId;if(o&&s){var a=new Set(i.values());a.has(s)&&this.setItemId(o,o)}}handleFocusCommandHistory(){var{glEventHub:e}=this.props;e.emit(De.FOCUS_HISTORY)}handleResize(){this.updateDimensions()}handleShow(){this.updateDimensions()}handleOpenObject(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;L(this.context);var{root:r}=this.context,i=e.title!=null?this.getItemId(e.title,!1):null;(t||i!=null&&E.getStackForRoot(r,{id:i},!1,!1,!1)!=null)&&this.openWidget(e)}handleCloseObject(e){var{title:t}=e;if(t!==void 0){var r=this.getItemId(t,!1);if(r!=null){var{glEventHub:i}=this.props;i.emit(Y.CLOSE,r),Fm(i,t)}}}handleSettingsChange(e){var{glEventHub:t}=this.props;Bn.debug("handleSettingsChange",e),this.setState({consoleSettings:e}),t.emit(De.SETTINGS_CHANGED,e)}openWidget(e){var{glEventHub:t,sessionWrapper:r}=this.props;L(r);var{config:i,session:o}=r,{title:s=e.name}=e;L(s);var a=this.getItemId(s),l={fetch:()=>o.getObject(e),panelId:a,widget:Un(Un({},Hu(e)),{},{sessionId:i.id})};Bn.debug("openWidget",l),em(t,l)}addCommand(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;(t=this.consoleRef.current)===null||t===void 0||t.addCommand(e,r,i)}closeDisconnectedPanels(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,{consoleSettings:t,itemIds:r}=this.state,{isClosePanelsOnDisconnectEnabled:i=!0}=t;if(!(!i&&!e)){var o=[...r.values()],{glEventHub:s}=this.props;o.forEach(a=>{s.emit(Y.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(r=>Xi(r,e))}iconForType(e){var{plugins:t}=this.props,r=[...t.values()].find(i=>Xi(i,e));return r!=null?Nh(r):u.jsx(Na,{type:e})}render(){var{commandHistoryStorage:e,glContainer:t,glEventHub:r,sessionWrapper:i,timeZone:o,unzip:s}=this.props;if(i==null)return u.jsx(Sn,{isLoading:!1,errorMessage:"Console is disabled.","data-testid":"console-panel-loading-error"});var{consoleSettings:a,error:l,objectMap:d}=this.state,{config:h,session:p,connection:m,details:v={},dh:f}=i,{workerName:g,processInfoId:b}=v,{id:S,type:w}=h;return u.jsx(ur,{className:"iris-panel-console",componentPanel:this,glContainer:t,glEventHub:r,onResize:this.handleResize,onShow:this.handleShow,onTabFocus:this.handleTabFocus,errorMessage:l!=null?"".concat(l):void 0,children:p!=null&&u.jsx(Tt,{dh:f,ref:this.consoleRef,settings:a,session:p,focusCommandHistory:this.handleFocusCommandHistory,openObject:this.handleOpenObject,closeObject:this.handleCloseObject,commandHistoryStorage:e,onSettingsChange:this.handleSettingsChange,language:w,statusBarChildren:u.jsxs(u.Fragment,{children:[u.jsx("div",{children:La.LANGUAGE_MAP.get(w)}),g!=null&&u.jsxs(u.Fragment,{children:[u.jsx("div",{children:"•"}),g]}),b!=null&&u.jsxs(u.Fragment,{children:[u.jsx("div",{children:"•"}),b,u.jsx("div",{children:"•"})]}),u.jsx($v,{connection:m,defaultUpdateInterval:10*1e3,hoverUpdateInterval:3*1e3,monitorDuration:10*60*1e3})]}),showObjectsMenu:!1,scope:S,timeZone:o,objectMap:d,unzip:s,supportsType:this.supportsType,iconForType:this.iconForType})})}}Ht(mr,"COMPONENT","ConsolePanel");Ht(mr,"TITLE","Console");Ht(mr,"contextType",_a);var uf=(n,e)=>({commandHistoryStorage:Vs(n),sessionWrapper:cr(n,e.localDashboardId),timeZone:qu(n),plugins:Xu(n)}),lb=En(uf,null,null,{forwardRef:!0})(mr);function db(n){return n==="file"||n==="directory"}function Qe(n){return n.type==="directory"}function hf(n,e,t){return(e=cf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function cf(n){var e=mf(n,"string");return typeof e=="symbol"?e:e+""}function mf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ai extends Error{constructor(){super("No file exists at the path specified"),hf(this,"isFileNotFound",!0)}}function Vo(n,e,t,r,i,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function Go(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function s(l){Vo(o,r,i,s,a,"next",l)}function a(l){Vo(o,r,i,s,a,"throw",l)}s(void 0)})}}var Nt=function(n){return 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="",n}({});class N{static fileExists(e,t){return Go(function*(){try{return yield e.info(t),!0}catch(r){if(!(r instanceof ai))throw r;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(!N.hasPath(e))throw new Error("Invalid path provided: ".concat(e));var r=(t=e.match(/\//g))!==null&&t!==void 0?t:[];return r.length-1}static getExtension(e){var t=this.getBaseName(e).split(".");if(t.length>1){var r;return(r=t.pop())!==null&&r!==void 0?r:""}return""}static getBaseName(e){var t;return(t=e.split("/").pop())!==null&&t!==void 0?t:""}static getCopyFileName(e){var t=e.lastIndexOf("."),r=null,i=null;t<0?i=e:(i=e.substring(0,t),r=e.substring(t+1));var o=i?"".concat(i,"-copy"):"Copy";return r!==null?"".concat(o,".").concat(r):o}static getUniqueCopyFileName(e,t){return Go(function*(){for(var r=N.getCopyFileName(t);yield N.fileExists(e,r);)r=N.getCopyFileName(r);return r})()}static getMimeType(e){var t=this.getExtension(e).toLowerCase();switch(t){case"groovy":return Nt.GROOVY;case"py":return Nt.PYTHON;case"pyc":return Nt.PYTHON_COMPILED;case"scala":return Nt.SCALA;case"txt":return Nt.PLAIN_TEXT;default:return Nt.UNKNOWN}}static getParent(e){if(!N.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(!N.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]:"",r=e.lastIndexOf("."),i=r>-1?e.substring(0,r):e,o=N.fileExtensionToString(t);return"".concat(i).concat(o)}static validateName(e){var t=[".",".."],r=/[\\/\0]/g,i=new Map([["\0","null"]]);if(!e)throw new gn("Name cannot be empty");if(t.includes(e))throw new gn('"'.concat(e,'" is a reserved name'));if(r.test(e)){var o,s;throw new gn('Invalid characters in name: "'.concat((o=(s=e.match(r))===null||s===void 0?void 0:s.reduce((a,l)=>a.includes(l)?a:[...a,l],[]).map(a=>i.has(a)?i.get(a):a).join('", "'))!==null&&o!==void 0?o:"",'"'))}}static reducePaths(e){var t=e.filter(r=>N.isPath(r));return e.filter(r=>!t.some(i=>r!==i&&r.startsWith(i)))}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 li=26;function Wr(n){return Qe(n)?N.makePath(n.filename):N.getPath(n.filename)}function qo(n,e){if(n.length===0||e==null)throw new Error("No items to move");var t=Wr(e);if(n.some(r=>{var{filename:i}=r;return N.getPath(i)===t}))throw new Error("File already in the destination folder");if(n.some(r=>Qe(r)&&t.startsWith(N.makePath(r.filename))))throw new Error("Destination folder cannot be a child of a dragged folder");return{files:n,targetPath:t}}function pf(n){if(Qe(n))return n.isExpanded?Tl:Ol;var e=N.getMimeType(n.basename);switch(e){case Nt.PYTHON:return Il;default:return xl}}function zr(n){var e,{children:t,draggedItems:r,isDragInProgress:i,isDropTargetValid:o,isSelected:s,item:a,itemIndex:l,dropTargetItem:d,onDragStart:h,onDragOver:p,onDragEnd:m,onDragExit:v,onDrop:f}=n,g=(e=r==null?void 0:r.some(A=>A.id===a.id))!==null&&e!==void 0?e:!1,b=Wr(a),S=i&&d?Wr(d):null,w=i&&o&&Qe(a)&&S===b,y=i&&o&&S===b,D=i&&!o&&S===b,V=pf(a),X=N.getDepth(a.filename),G=Array(X).fill(null).map((A,M)=>u.jsx("span",{className:"file-list-depth-line"},M));return u.jsxs("div",{className:$("d-flex w-100 align-items-center","file-list-item",{"is-dragged":g,"is-exact-drop-target":w,"is-in-drop-target":y,"is-invalid-drop-target":D,"is-selected":s}),onDragStart:A=>h(l,A),onDragOver:A=>p(l,A),onDragEnd:A=>m(l,A),onDragExit:v,onDrop:A=>f(l,A),draggable:!0,role:"presentation","aria-label":a.basename,children:[G," ",u.jsx(le,{icon:V,className:"item-icon",fixedWidth:!0})," ",u.jsx("span",{className:"truncation-wrapper",children:t??u.jsxs(u.Fragment,{children:[a.basename,u.jsx(ie,{children:a.basename})]})})]})}function Xo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Kn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Xo(Object(t),!0).forEach(function(r){vf(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Xo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function vf(n,e,t){return(e=ff(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ff(n){var e=gf(n,"string");return typeof e=="symbol"?e:e+""}function gf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var we=R.module("FileList"),bf=500,Zo="item-list-scroll-pane";function yf(n){var{isMultiSelect:e=!1,table:t,onFocusChange:r=()=>{},onMove:i,onSelect:o,onSelectionChange:s=()=>{},renderItem:a=zr,rowHeight:l=li,overscanCount:d=Je.DEFAULT_OVERSCAN}=n,[h,p]=c.useState(()=>({items:[],offset:0,itemCount:0})),[m,v]=c.useState({top:0,bottom:0}),[f,g]=c.useState(),[b,S]=c.useState(),[w,y]=c.useState(),[D,V]=c.useState([]),X=c.useRef(),G=c.useRef(null),A=c.useRef(null),M=c.useCallback(P=>{if(P.length===0||h==null)return[];for(var K=[],ne=0;ne<P.length;ne+=1)for(var pe=P[ne],ke=pe[0];ke<=pe[1];ke+=1)ke>=h.offset&&ke<h.offset+h.items.length&&K.push(h.items[ke-h.offset]);return K},[h]),Q=c.useCallback(P=>{var K=M([[P,P]]);if(K.length>0)return K[0]},[M]),W=c.useCallback(()=>{var P=Ze.count(D);if(P===0)return null;if(P===1){var K=D[0][0],ne=Q(K);if(ne!=null)return ne.filename}return"".concat(P," items")},[Q,D]),k=c.useCallback(P=>{if(!(!b||!f)){we.debug("dropItems",b,"to",P);try{var{files:K,targetPath:ne}=qo(b,f);if(i==null||i(K,ne),P!=null){var pe;V([[P,P]]),(pe=G.current)===null||pe===void 0||pe.focusItem(P)}}catch(ke){we.error("Unable to complete move",ke)}}},[b,f,i]),z=c.useCallback((P,K)=>{var ne=h.items[P-h.offset];ne!==void 0&&(we.debug("handleItemClick",ne),o(ne,K),Qe(ne)&&(t==null||t.setExpanded(ne.filename,!ne.isExpanded)))},[h,o,t]),F=c.useCallback((P,K)=>{var ne,pe;we.debug2("handleItemDragStart",P,D);var ke=D;Ze.isSelected(D,P)||(ke=[[P,P]],V(ke)),S(M(ke)),(ne=G.current)===null||ne===void 0||ne.resetMouseState();var Dt=document.createElement("div"),Kt=document.createElement("div");Kt.className="dnd-placeholder-content",Kt.innerText=(pe=W())!==null&&pe!==void 0?pe:"",Dt.appendChild(Kt),Dt.className="file-list-dnd-placeholder",document.body.appendChild(Dt),K.dataTransfer.setDragImage(Dt,0,0),K.dataTransfer.effectAllowed="move",y(Dt)},[W,M,D]),j=c.useCallback((P,K)=>{K.preventDefault(),we.debug2("handleItemDragOver",K),g(Q(P))},[Q]),H=c.useCallback((P,K)=>{we.debug("handleItemDragEnd",P),w==null||w.remove(),S(void 0),g(void 0),y(void 0)},[w]),U=c.useCallback((P,K)=>{k(P)},[k]),ce=c.useCallback(()=>{we.debug2("handleItemDragExit"),g(void 0)},[]),tt=c.useCallback(P=>{P.target instanceof Element&&P.target.classList.contains(Zo)&&(P.preventDefault(),we.debug2("handleListDragOver",P),g({type:"directory",filename:"/",basename:"/",id:"/"}))},[]),Ge=c.useCallback(P=>{P.target instanceof Element&&P.target.classList.contains(Zo)&&(we.debug("handleListDrop"),k())},[k]),x=c.useCallback(function(P){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(we.debug2("handleSelectionChange",P),K===!0||P!==D){V(P);var ne=M(P);s(ne)}},[M,s,D]),J=c.useCallback(P=>{if(we.debug2("handleFocusChange",P),P!=null){var[K]=M([[P,P]]);r(K)}else r();X.current=P},[M,r]),oe=c.useCallback((P,K)=>{we.debug("handleViewportChange",P,K),(P!==m.top||K!==m.bottom)&&v({top:P,bottom:K})},[m]),un=c.useMemo(()=>{if(!b||!f)return!1;try{return qo(b,f),we.debug("handleValidateDropTarget true"),!0}catch{return we.debug("handleValidateDropTarget false"),!1}},[b,f]),{focusedPath:gt}=n;c.useEffect(()=>{gt!==void 0&&(gt==="/"?t.collapseAll():(t.setExpanded(gt,!1),t.setExpanded(gt,!0)))},[t,gt]),c.useEffect(function(){we.debug("updating table viewport",m),t==null||t.setViewport({top:Math.max(0,m.top-d),bottom:m.bottom+d})},[d,t,m]),c.useEffect(function(){var K=t.onUpdate(ne=>{p({items:ne.items.map(pe=>Kn(Kn({},pe),{},{itemName:pe.basename})),offset:ne.offset,itemCount:t.size})});return()=>{K()}},[t]),c.useEffect(function(){X.current!=null&&J(X.current),D.length>0&&x(D,!0)},[h,J,x,D]),c.useEffect(function(){if(f!=null&&Qe(f)&&f.filename!=="/"){var K=setTimeout(()=>{f.isExpanded||t==null||t.setExpanded(f.filename,!0)},bf);return()=>clearTimeout(K)}},[f,t]);var Mn=c.useCallback(P=>a(Kn(Kn({},P),{},{isDragInProgress:b!=null,dropTargetItem:f,draggedItems:b,isDropTargetValid:un,onDragStart:F,onDragEnd:H,onDragOver:j,onDragExit:ce,onDrop:U})),[H,ce,j,F,U,b,f,un,a]);return u.jsx("div",{ref:A,className:$("file-list",{"is-dragging":b!=null}),onDragOver:tt,onDrop:Ge,children:u.jsx(Je,{ref:G,items:h.items,itemCount:h.itemCount,offset:h.offset,onFocusChange:J,onSelect:z,onSelectionChange:x,onViewportChange:oe,selectedRanges:D,renderItem:Mn,rowHeight:l,isMultiSelect:e,isDragSelect:!1,isDeselectOnClick:!1})})}var Cf={DELETE:ee.createAndAdd({id:"FILE_EXPLORER.DELETE",name:"Delete",shortcut:[C.DELETE],macShortcut:[_.CMD,C.BACKSPACE]}),RENAME:ee.createAndAdd({id:"FILE_EXPLORER.RENAME",name:"Rename",shortcut:[C.ENTER],macShortcut:[C.ENTER]})};const Yo={FILE_EXPLORER:Cf};var Qo=R.module("FileListItemEditor"),wf=()=>Promise.resolve();function Sf(n){var{item:e,onCancel:t,onSubmit:r,validate:i=wf}=n,o=c.useRef(null),[s,a]=c.useState(e.basename),[l,d]=c.useState(),[h,p]=c.useState(Promise.resolve()),m=c.useCallback(()=>{var w;(w=o.current)===null||w===void 0||w.focus()},[o]),v=c.useCallback(w=>w.stopPropagation(),[]),f=c.useCallback(()=>{h.then(()=>{r(s)}).catch(w=>Qo.info("Unable to validate name",w))},[r,s,h]);c.useEffect(function(){var y=He.makeCancelable(i(s));return y.then(()=>d(void 0)).catch(D=>{He.isCanceled(D)||d(D)}),p(y),()=>y.cancel()},[i,s]),c.useEffect(function(){m()},[m]);var g=c.useCallback(()=>{Qo.debug2("handleBlur"),f()},[f]),b=c.useCallback(w=>{var{value:y}=w.target;a(y)},[]),S=c.useCallback(w=>{w.stopPropagation();var{key:y}=w;switch(y){case"Enter":{f();break}case"Escape":{t();break}}},[t,f]);return u.jsxs("div",{className:"file-list-item-editor",children:[u.jsx("input",{type:"text",className:$("form-control file-list-item-editor-input",{"is-invalid":l}),value:s,ref:o,onBlur:g,onKeyDown:S,onChange:b,onClick:v,onDoubleClick:v,onMouseDown:v}),l&&u.jsx("div",{className:"invalid-feedback",children:"".concat(l)})]})}function Jo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Pr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Jo(Object(t),!0).forEach(function(r){_f(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Jo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function _f(n,e,t){return(e=Ef(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ef(n){var e=Pf(n,"string");return typeof e=="symbol"?e:e+""}function Pf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function za(n){var{isMultiSelect:e=!1,focusedPath:t,showContextMenu:r=!1,onCreateFile:i,onCreateFolder:o,onCopy:s,onDelete:a,onMove:l,onRename:d,onSelect:h,onSelectionChange:p,table:m,rowHeight:v=li,validateRename:f=()=>Promise.resolve()}=n,[g,b]=c.useState(),[S,w]=c.useState([]),[y,D]=c.useState(),V=c.useCallback(U=>{w(U),p==null||p(U)},[p]),X=c.useCallback(U=>{D(U)},[]),G=c.useCallback(()=>{y&&(s==null||s(y))},[y,s]),A=c.useCallback(()=>{S.length>0&&(a==null||a(S))},[a,S]),M=c.useCallback(()=>{i==null||i()},[i]),Q=c.useCallback(()=>{y&&(o==null||o(N.getPath(y.filename)))},[y,o]),W=c.useCallback(()=>{y&&b(y)},[y]),k=c.useCallback(()=>{b(void 0)},[]),z=c.useCallback(U=>{g&&(d==null||d(g,U),b(void 0))},[d,g]),F=c.useMemo(()=>{if(g)return[];var U=[];return i&&U.push({title:"New File",description:"Create new file",action:M,group:re.groups.medium}),o&&U.push({title:"New Folder",description:"Create new folder",action:Q,group:re.groups.medium}),s&&U.push({title:"Copy File",description:"Copy the selected file",action:G,group:re.groups.low,disabled:y==null||Qe(y)}),a&&S.length>0&&U.push({title:"Delete",description:"Delete",shortcut:Yo.FILE_EXPLORER.DELETE,action:A,group:re.groups.low}),d&&U.push({title:"Rename",description:"Rename",shortcut:Yo.FILE_EXPLORER.RENAME,action:W,group:re.groups.low,disabled:y==null}),U},[G,A,M,Q,W,y,s,i,o,a,d,S,g]),j=c.useCallback(U=>(L(g),f(g,U)),[g,f]),H=c.useCallback(U=>{var{item:ce}=U;return g&&g.filename===ce.filename?u.jsx(zr,Pr(Pr({},U),{},{children:u.jsx(Sf,{item:ce,validate:j,onSubmit:z,onCancel:k})})):u.jsx(zr,Pr({},U))},[k,z,g,j]);return u.jsxs("div",{className:"file-list-container",children:[m!=null&&u.jsx(yf,{onMove:l,onSelect:h,onSelectionChange:V,onFocusChange:X,renderItem:H,rowHeight:v,table:m,isMultiSelect:e,focusedPath:t}),r&&u.jsx(re,{actions:F})]})}za.displayName="FileListContainer";function es(n,e,t){return(e=Tf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Tf(n){var e=Of(n,"string");return typeof e=="symbol"?e:e+""}function Of(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Vn extends gn{constructor(e){super("Name already exists"),es(this,"isExistingFile",!0),es(this,"info",void 0),this.info=e}}function ts(n,e,t,r,i,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function ns(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function s(l){ts(o,r,i,s,a,"next",l)}function a(l){ts(o,r,i,s,a,"throw",l)}s(void 0)})}}var nt=R.module("FileExplorer");function di(n){var{storage:e,isMultiSelect:t=!1,focusedPath:r,onCopy:i=()=>{},onDelete:o=()=>{},onRename:s=()=>{},onCreateFile:a=()=>{},onCreateFolder:l=()=>{},onSelect:d,onSelectionChange:h,rowHeight:p=li}=n,[m,v]=c.useState([]),[f,g]=c.useState();c.useEffect(function(){var z;function F(){return j.apply(this,arguments)}function j(){return j=ns(function*(){nt.debug("initTable"),z=He.makeCancelable(e.getTable(),H=>H.close());try{g(yield z)}catch(H){He.isCanceled(H)||nt.error("Unable to initialize table",H)}}),j.apply(this,arguments)}return F(),()=>{z.cancel()}},[e]);var b=c.useCallback(k=>{He.isCanceled(k)||nt.error(k)},[]),S=c.useCallback(()=>{nt.debug("handleCreateFile"),a()},[a]),w=c.useCallback(()=>{nt.debug("handleCreateFolder"),l()},[l]),y=c.useCallback(k=>{nt.debug("handleCopyFile",k.filename),i(k)},[i]),D=c.useCallback(k=>{nt.debug("handleDelete, pending confirmation",k),v(k)},[]),V=c.useCallback(()=>{nt.debug("handleDeleteConfirm",m),m.forEach(k=>e.deleteFile(Qe(k)?N.makePath(k.filename):k.filename)),o(m),v([])},[m,o,e]),X=c.useCallback(()=>{nt.debug("handleDeleteCancel"),v([])},[]),G=c.useCallback((k,z)=>{var F=N.reducePaths(k.map(j=>Qe(j)?N.makePath(j.filename):j.filename));F.forEach(j=>{var H=N.isPath(j)?"".concat(z).concat(N.getBaseName(j.substring(0,j.length-1)),"/"):"".concat(z).concat(N.getBaseName(j));e.moveFile(j,H).then(()=>{s(j,H)}).catch(b)})},[b,s,e]),A=c.useCallback((k,z)=>{var F=k.filename,j=Qe(k);j&&!F.endsWith("/")&&(F="".concat(F,"/"));var H="".concat(N.getParent(F)).concat(z);j&&!H.endsWith("/")&&(H="".concat(H,"/")),nt.debug2("handleRename",F,H),e.moveFile(F,H).catch(b),s(F,H)},[b,s,e]),M=c.useCallback(function(){var k=ns(function*(z,F){if(F!==z.basename){N.validateName(F);var j="".concat(N.getPath(z.filename)).concat(F);try{var H=yield e.info(j);throw new Vn(H)}catch(U){if(!(U instanceof ai))throw U}}});return function(z,F){return k.apply(this,arguments)}}(),[e]),Q=m.length>0,W=c.useMemo(()=>m.length===1?'Are you sure you want to delete "'.concat(m[0].filename,'"?'):"Are you sure you want to delete the selected files?",[m]);return u.jsxs("div",{className:"file-explorer",children:[f&&u.jsx(za,{isMultiSelect:t,focusedPath:r,showContextMenu:!0,onCopy:y,onCreateFolder:w,onCreateFile:S,onMove:G,onDelete:D,onRename:A,onSelect:d,onSelectionChange:h,rowHeight:p,table:f,validateRename:M}),u.jsx(jr,{isOpen:Q,headerText:W,bodyText:"You cannot undo this action.",onCancel:X,onConfirm:V,confirmButtonText:"Delete"})]})}di.displayName="FileExplorer";function rs(n,e,t,r,i,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function xf(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function s(l){rs(o,r,i,s,a,"next",l)}function a(l){rs(o,r,i,s,a,"throw",l)}s(void 0)})}}function At(n,e,t){return(e=If(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function If(n){var e=Df(n,"string");return typeof e=="symbol"?e:e+""}function Df(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Mt=R.module("NewItemModal");class en extends c.PureComponent{static getValidationMessage(e){return e instanceof Vn&&e.info.type==="directory"?"Error: Cannot overwrite existing directory":"".concat(e)}static handleError(e){He.isCanceled(e)||Mt.error(e)}constructor(e){super(e),At(this,"inputRef",O.createRef()),At(this,"cancelableValidatePromise",void 0),At(this,"cancelableExistingItemPromise",void 0),At(this,"pending",new nr),At(this,"pathMap",new Map),At(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,r=N.hasPath(t)?N.getPath(t):"/";this.state={isSubmitting:!1,path:r,prevExtension:N.getExtension(t),showExtensionChangeModal:!1,showOverwriteModal:!1,value:N.getBaseName(t)}}componentDidUpdate(e,t){var{isOpen:r}=this.props,{isOpen:i}=e,{value:o,path:s}=this.state;!i&&r&&(this.resetValue(),this.isInitialLoad=!0),i&&r&&(!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=N.hasPath(e)?N.getPath(e):"/";this.setState({path:t,value:N.getBaseName(e),validationError:void 0,prevExtension:N.getExtension(e),isSubmitting:!1})}getValidationPromise(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.cancelableValidatePromise&&this.cancelableValidatePromise.cancel(),this.cancelableValidatePromise=He.makeCancelable(this.validateName(e,t,r)),this.cancelableValidatePromise}validateName(e,t,r){var i=this;return xf(function*(){N.validateName(t);var{defaultValue:o,storage:s}=i.props;if(r){var a="".concat(e).concat(t);if(a!==o)try{var l=yield s.info(a);throw new Vn(l)}catch(d){if(!(d instanceof ai))throw d}}return t})()}updateValidationStatus(e,t){this.getValidationPromise(e,t).then(()=>{this.setState({validationError:void 0})}).catch(this.handleValidationError).catch(en.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:N.makePath(e.filename)});else{var t=e.basename,r=N.getPath(e.filename);this.setState({value:t,path:r},()=>{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:r}=this.props;r();break}}}handleValidationError(e){if(!(e instanceof gn))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:r}=this.state;Mt.debug("handleOverwriteConfirm",t,r),e("".concat(t).concat(r),!0)}handleExtensionChangeCancel(){Mt.debug("handleExtensionChangeCancel"),this.setState(e=>{var{value:t,prevExtension:r}=e,i=N.replaceExtension(t,r);return{showExtensionChangeModal:!1,value:i}}),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:r}=e,i=t==="directory"?r.length:r.lastIndexOf(".");e.focus(),e.setSelectionRange(0,i>0?i:r.length)}}submitModal(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.setState(t=>{var{prevExtension:r,value:i,path:o}=t,{notifyOnExtensionChange:s,type:a}=this.props;Mt.debug("submitModal",r,i);var l=N.getExtension(i);return s&&!e&&r!==null&&r!==l?{isSubmitting:!1,showExtensionChangeModal:!0,newExtension:l}:(this.getValidationPromise(o,i,!0).then(d=>{var{onSubmit:h}=this.props;h("".concat(o).concat(i))}).catch(d=>{if(d instanceof Vn&&a!=="directory"&&d.info.type!=="directory"){this.setState({showOverwriteModal:!0});return}throw d}).catch(d=>{throw He.isCanceled(d)&&this.setState({isSubmitting:!1}),d}).catch(this.handleValidationError).catch(en.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((r,i)=>{for(var o="",s=0;s<i;s+=1)o+="".concat(t[s],"/");return o+="".concat(r,"/"),u.jsxs(O.Fragment,{children:[u.jsx(te,{kind:"ghost",className:"directory-breadcrumbs",onClick:()=>this.handleBreadcrumbSelect(o),"aria-label":i===0?"Home":void 0,icon:i===0?u.jsx(le,{icon:Dl,transform:"right-1.6"}):void 0,tooltip:i===0?"Home":void 0,children:r}),"/"]},o)})}render(){var{storage:e,isOpen:t,onCancel:r,placeholder:i,title:o,type:s}=this.props,{isSubmitting:a,path:l,showExtensionChangeModal:d,showOverwriteModal:h,validationError:p,value:m,prevExtension:v,newExtension:f}=this.state,g=s==="directory",b=N.fileExtensionToString(v),S=N.fileExtensionToString(f),w=g?"Create":"Save",y=g?"New folder name":"Save file as";return u.jsxs(u.Fragment,{children:[u.jsxs(as,{isOpen:t,toggle:r,onOpened:this.handleModalOpened,className:"modal-dialog-centered new-file-modal",children:[u.jsx(ls,{toggle:r,children:o}),u.jsx(ds,{children:u.jsx("form",{children:u.jsxs("div",{className:"d-flex flex-column new-file-modal-content",children:[u.jsxs("div",{className:"flex-grow-0 mb-4",children:[u.jsx("label",{htmlFor:"file-name-input",children:y}),u.jsx("input",{id:"file-name-input",type:"text",autoComplete:"off",autoCapitalize:"none",autoCorrect:"off",spellCheck:"false",className:$("form-control",{"is-invalid":p}),value:m,placeholder:i,ref:this.inputRef,onKeyDown:this.handleKeyDown,onChange:this.handleChange}),p&&u.jsx("div",{className:"invalid-feedback",children:en.getValidationMessage(p)})]}),u.jsxs("div",{className:"flex-grow-0",children:[u.jsx("label",{children:"Directory: /"}),this.renderPathButtons(l)]}),u.jsx("div",{className:"flex-grow-1 file-explorer-container",children:u.jsx(di,{onSelect:this.handleSelect,storage:e,focusedPath:l})})]})})}),u.jsxs(Ds,{children:[u.jsx(te,{kind:"secondary",onClick:r,children:"Cancel"}),u.jsx(te,{kind:"primary",disabled:a,onClick:this.handleModalSubmit,children:w})]})]}),u.jsx(jr,{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"}),u.jsx(jr,{isOpen:d,headerText:"Confirm extension change",bodyText:'Are you sure you want to change extension from "'.concat(b,'" to "').concat(S,'"?'),onCancel:this.handleExtensionChangeCancel,onConfirm:this.handleExtensionChangeConfirm,cancelButtonText:'Keep "'.concat(b,'"'),confirmButtonText:'Use "'.concat(S,'"')})]})}}At(en,"defaultProps",{isOpen:!1,defaultValue:"/",notifyOnExtensionChange:!1,placeholder:"",onSubmit:(n,e)=>{},onCancel:()=>{}});function Mf(n){var{createFile:e,createFolder:t,onSearchChange:r,defaultSearchText:i=""}=n;return u.jsxs("div",{className:"file-explorer-toolbar",children:[u.jsxs("div",{className:"file-explorer-toolbar-buttons",children:[u.jsx(te,{kind:"ghost",icon:fs,tooltip:"New notebook",onClick:e,"aria-label":"New notebook"}),u.jsx(te,{kind:"ghost",icon:Ml,tooltip:"New folder",onClick:t,"aria-label":"New folder"})]}),r&&u.jsx("div",{className:"file-explorer-toolbar-search",children:u.jsx(Fs,{value:i,onChange:r,placeholder:"Search by name"})})]})}function is(n,e,t,r,i,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function kf(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function s(l){is(o,r,i,s,a,"next",l)}function a(l){is(o,r,i,s,a,"throw",l)}s(void 0)})}}function Va(n,e,t){return(e=jf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jf(n){var e=Nf(n,"string");return typeof e=="symbol"?e:e+""}function Nf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var kt=R.module("FileExplorerPanel"),Af=(n,e)=>{var t=Vu(n),r=cr(n,e.localDashboardId),{session:i,config:o}=r??{},s=o==null?void 0:o.type;return{fileStorage:t,language:s,session:i}},Lf=En(Af,null,null,{forwardRef:!0});function Rf(n){var e=n;return e!=null&&typeof e.button=="number"}class sn extends O.Component{static handleError(e){kt.error(e)}static isFocusEvent(e){return Rf(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:r}=e;this.state={isShown:!1,language:r,session:t,showCreateFolder:!1,focusedFilePath:"/"}}componentDidMount(){this.isHidden()||this.setState({isShown:!0})}handleCreateFile(){var{glEventHub:e}=this.props,{session:t,language:r}=this.state,i={language:r,value:""};kt.debug("handleCreateFile",t,r,i),e.emit(Te.CREATE_NOTEBOOK,t,r,i)}handleCreateDirectory(){this.setState({showCreateFolder:!0})}handleCreateDirectoryCancel(){kt.debug("handleCreateDirectoryCancel"),this.setState({showCreateFolder:!1})}handleCreateDirectorySubmit(e){kt.debug("handleCreateDirectorySubmit",e),this.setState({showCreateFolder:!1});var{fileStorage:t}=this.props;t.createDirectory(e).catch(sn.handleError)}handleCopyFile(e){var t=this;return kf(function*(){var{fileStorage:r}=t.props;if(Qe(e)){kt.error("Invalid item in handleCopyItem",e);return}var i=yield N.getUniqueCopyFileName(r,e.filename);yield r.copyFile(e.filename,i)})()}handleDelete(e){var{glEventHub:t}=this.props;e.forEach(r=>{t.emit(Te.CLOSE_FILE,{id:r.filename,itemName:r.filename})})}handleSelectionChange(e){var t="/";e.length===1&&(e[0].type==="directory"?t=N.makePath(e[0].filename):t=N.getPath(e[0].filename)),this.setState({focusedFilePath:t})}handleFileSelect(e,t){if(kt.debug("fileSelect",e),e.type!=="directory"){var r=sn.isFocusEvent(t),i={id:e.filename,itemName:e.filename},{glEventHub:o}=this.props,{session:s,language:a}=this.state,l={value:null,language:a};o.emit(Te.SELECT_NOTEBOOK,s,a,l,i,r)}}handleRename(e,t){var{glEventHub:r}=this.props;kt.debug("handleRename",e,t),r.emit(Te.RENAME_FILE,e,t)}handleSessionOpened(e,t){var{language:r}=t;this.setState({session:e,language:r})}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:r}=this.props,{isShown:i,showCreateFolder:o,focusedFilePath:s}=this.state;return u.jsxs(ur,{className:"file-explorer-panel",componentPanel:this,glContainer:t,glEventHub:r,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,onShow:this.handleShow,children:[u.jsx(Mf,{createFile:this.handleCreateFile,createFolder:this.handleCreateDirectory}),i&&u.jsx(di,{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}),u.jsx(en,{isOpen:o,type:"directory",title:"Create New Folder",storage:e,onSubmit:this.handleCreateDirectorySubmit,onCancel:this.handleCreateDirectoryCancel,defaultValue:s})]})}}Va(sn,"COMPONENT","FileExplorerPanel");Va(sn,"TITLE","File Explorer");var ub=Lf(sn);function wn(n,e,t){return(e=Ff(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ff(n){var e=Hf(n,"string");return typeof e=="symbol"?e:e+""}function Hf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var os=R.module("LogPanel");class pr extends c.PureComponent{constructor(e){super(e),wn(this,"isBottomVisible",void 0),wn(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){os.debug("Session opened",[e]),this.setState({session:e})}handleSessionClosed(e){os.debug("Session closed",e)}updateDimensions(){this.logView&&this.logView.updateDimensions()}render(){var{glContainer:e,glEventHub:t}=this.props,{session:r}=this.state;return u.jsxs(ur,{componentPanel:this,glContainer:e,glEventHub:t,onResize:this.handleResize,onHide:this.handleHide,onShow:this.handleShow,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,children:[r==null&&u.jsx("div",{className:"log-panel-disconnected-message",children:"Waiting for session connection"}),r!=null&&u.jsx(ue,{session:r,ref:i=>{this.logView=i}})]})}}wn(pr,"defaultProps",{session:null});wn(pr,"COMPONENT","LogPanel");wn(pr,"TITLE","Log");var $f=(n,e)=>{var t;return{session:(t=cr(n,e.localDashboardId))===null||t===void 0?void 0:t.session}},hb=En($f,null,null,{forwardRef:!0})(pr);export{As as $,ln as A,te as B,he as C,ir as D,Vl as E,js as F,re as G,or as H,Je as I,Zt as J,C as K,jr as L,_ as M,Fs as N,sr as O,rr as P,Ds as Q,Ze as R,de as S,ie as T,$s as U,Bd as V,Gr as W,Zf as X,Ou as Y,qr as Z,Yf as _,qg as a,Fm as a$,Us as a0,Ns as a1,iu as a2,Gn as a3,Nu as a4,Ws as a5,Ks as a6,Bs as a7,Qf as a8,Jf as a9,Gf as aA,gi as aB,Hh as aC,Qr as aD,wg as aE,zh as aF,Vh as aG,E as aH,Eg as aI,$g as aJ,Zm as aK,Rm as aL,Lm as aM,zg as aN,wr as aO,Ia as aP,Bg as aQ,jg as aR,Ng as aS,_a as aT,lm as aU,Y as aV,ii as aW,Ca as aX,Pa as aY,Fn as aZ,wa as a_,eg as aa,ht as ab,Me as ac,mt as ad,B as ae,Fe as af,gg as ag,yg as ah,Yr as ai,bg as aj,Js as ak,Cg as al,dn as am,Xs as an,Nh as ao,jh as ap,Mh as aq,Ys as ar,Ih as as,xh as at,vg as au,Dh as av,fg as aw,kh as ax,Zs as ay,Xi as az,bm as b,lb as b$,Gg as b0,Pg as b1,Ig as b2,Og as b3,Mg as b4,Fg as b5,Ce as b6,Hg as b7,Oa as b8,Sa as b9,Aa as bA,_e as bB,Jn as bC,Dv as bD,dr as bE,La as bF,lp as bG,Fa as bH,Jm as bI,nn as bJ,Ra as bK,rn as bL,bv as bM,Yn as bN,$v as bO,ue as bP,Kr as bQ,Na as bR,Jt as bS,Xr as bT,N as bU,ai as bV,db as bW,Jc as bX,ri as bY,Wg as bZ,sh as b_,Xg as ba,Vg as bb,tm as bc,rm as bd,nm as be,im as bf,_g as bg,vm as bh,xa as bi,Sm as bj,Ag as bk,Lg as bl,Rg as bm,Zg as bn,Tg as bo,Dg as bp,xg as bq,kg as br,Kg as bs,Yg as bt,Vt as bu,Em as bv,ye as bw,Kp as bx,I as by,Tt as bz,Tu as c,hb as c0,ab as c1,ub as c2,ad as c3,Yu as c4,Zu as c5,ag as c6,og as c7,sg as c8,lg as c9,rg as cA,cr as cB,Te as cC,De as cD,en as cE,Qe as cF,qu as cG,Le as cH,sb as cI,ob as cJ,Xf as cK,ot as cL,Vf as cM,fr as cN,Jl as cO,gn as cP,Qu as ca,Ju as cb,eh as cc,th as cd,vh as ce,Sd as cf,zf as cg,Kf as ch,Ps as ci,ur as cj,rb as ck,xt as cl,it as cm,mg as cn,tb as co,ig as cp,nb as cq,eb as cr,ib as cs,nr as ct,tg as cu,Qg as cv,ng as cw,Jg as cx,cg as cy,Vu as cz,ug as d,em as e,pg as f,Hu as g,dg as h,qs as i,hg as j,qf as k,Dd as l,Pn as m,Md as n,xs as o,Os as p,kd as q,ee as r,Ug as s,jd as t,Fu as u,Is as v,ws as w,Wf as x,He as y,ks as z};
|
|
20
|
-
//# sourceMappingURL=LogPanel-
|
|
20
|
+
//# sourceMappingURL=LogPanel-CIejhMy6.js.map
|