@deephaven/embed-chart 0.61.1-alpha-widget-types.1 → 0.61.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-75a5be4f.js → App-3e2cd6f9.js} +2 -2
- package/build/assets/{App-75a5be4f.js.map → App-3e2cd6f9.js.map} +1 -1
- package/build/assets/{index-87b6a40e.js → index-07a5ec52.js} +4 -4
- package/build/assets/{index-87b6a40e.js.map → index-07a5ec52.js.map} +1 -1
- package/build/assets/{index-21cb389c.js → index-1377628c.js} +2 -2
- package/build/assets/{index-21cb389c.js.map → index-1377628c.js.map} +1 -1
- package/build/assets/{index-638f69d4.css → index-831f2f06.css} +1 -1
- package/build/assets/{useConnection-e192fa04.js → useConnection-0feca045.js} +3 -3
- package/build/assets/{useConnection-e192fa04.js.map → useConnection-0feca045.js.map} +1 -1
- package/build/assets/{useConnection-f9938d9a.css → useConnection-d95d352e.css} +1 -1
- package/build/index.html +2 -2
- package/package.json +14 -14
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{C as u,$ as dP,H as bS,I as Kc,F as oe,J as CS,r as p,K as Qe,L as Me,M as uP,N as SS,O as hP,P as wS,Q as cP,S as vP,T as Km,U as Ce,G as re,E as q,V,W as mP,D as kt,X as zc,Y as fP,Z as gP,a0 as qd,a1 as Ks,a2 as pP,a3 as ke,a4 as zs,a5 as bP,a6 as yS,a7 as CP,a8 as SP,a9 as Oo,aa as fe,R as Yd,ab as zm,ac as At,ad as wP,ae as qc,af as yP,ag as EP,ah as TP,ai as PP,aj as qs,ak as ES,al as fi,am as TS,an as qh,ao as ve,ap as Jr,aq as OP,ar as Ln,as as DP,at as IP,au as RP,av as _P,aw as Yh,ax as xP,ay as NP,az as MP,aA as qm,aB as FP,aC as Ym,aD as AP,aE as LP,aF as kP,aG as jP,aH as $P,aI as HP,aJ as UP,aK as Fn,aL as Pr,aM as ea,aN as Xm,aO as BP,aP as Ds,aQ as an,aR as PS,aS as VP,aT as GP,aU as WP,aV as KP,aW as zP,aX as qP,aY as OS}from"./vendor-83d58fe6.js";import{L as te,i as YP,v as er,M as jo,b as $o,c as Ys,d as DS,e as XP,f as IS,g as $n,h as Xs,j as RS,a as tr,k as Yc,l as Ho,m as _S,T as qe,r as Xd,n as $,o as xS,p as QP,q as ZP,C as JP,D as eO,s as tO,t as rO,u as nO,w as Un,N as iO,S as aO,x as oO,y as sO,W as lO,z as dO,A as uO,B as hO,E as cO,F as vO,G as mO,H as NS,I as MS,J as fO,K as gO,O as pO,P as bO,Q as CO,R as SO,U as wO,V as yO,X as Qd,Y as EO,Z as FS,_ as U,$ as Xc,a0 as ta,a1 as Qc,a2 as Zc,a3 as pd,a4 as TO,a5 as Yn,a6 as PO,a7 as OO,a8 as Pa,a9 as AS,aa as DO,ab as IO,ac as RO,ad as _O,ae as Jc,af as La,ag as Qm,ah as xO,ai as Qs,aj as ev,ak as tv,al as Zd,am as Do,an as NO,ao as MO,ap as bd,aq as FO,ar as rv,as as LS,at as AO,au as LO,av as kO,aw as jO,ax as $O,ay as HO,az as Zm,aA as mh,aB as UO,aC as BO,aD as VO,aE as GO,aF as kS,aG as nv,aH as Jm,aI as WO,aJ as KO,aK as zO,aL as qO,aM as jS,aN as YO,aO as ef,aP as Cd,aQ as tf,aR as $S,aS as XO,aT as Jd,aU as QO,aV as ZO,aW as JO,aX as eD,aY as tD,aZ as rD,a_ as nD,a$ as iD,b0 as aD,b1 as oD,b2 as sD,b3 as lD,b4 as dD,b5 as uD,b6 as hD,b7 as cD,b8 as vD,b9 as mD,ba as fD,bb as HS,bc as gD,bd as rf,be as pD,bf as bD,bg as CD,bh as SD,bi as wD,bj as yD}from"./index-87b6a40e.js";import{P as De,T as lt,e as Zs,f as ED,g as oa,B as z,h as et,i as fh,j as US,k as Uo,c as BS,l as eu,m as TD,n as VS,t as PD,a as It,o as GS,p as Oe,q as OD,r as DD,D as ra,s as Ma,v as wr,w as ID,F as Jt,x as gi,I as ki,S as RD,y as Is,z as B,A as _D,E as iv,G as xD,H as WS,J as KS,K as av,L as ov,M as zS,N as qS,O as YS,Q as XS,R as ND,U as MD,V as sv,W as Sd,X as FD,Y as QS,Z as ZS,_ as JS,$ as tu,a0 as AD,C as lv,d as po,a1 as LD,a2 as ew,a3 as kD,a4 as jD,b as Js,a5 as $D,a6 as ye,a7 as HD,a8 as tw,u as rw,a9 as dv,aa as Yr,ab as el,ac as rs,ad as UD,ae as zr}from"./useConnection-e192fa04.js";import{P as BD}from"./plotly-6502aac3.js";import"./helpers-de833af9.js";function Bo(n,e,t){return e=VD(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function VD(n){var e=GD(n,"string");return typeof e=="symbol"?e:String(e)}function GD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var WD="table_",nw="column_",KD=new Set(["in","not","i","ii","k"]),zD=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"]),qD=/[^a-zA-Z0-9_$+@-]/g,YD=/[^A-Za-z0-9_$]/g;class nn{}Bo(nn,"legalize",(n,e,t,r,i)=>{var a=n.trim().replace(/[- ]/g,"_");return r&&(KD.has(a)||zD.has(a))&&(a=e+a),a=a.replace(t,""),a||(a=e+i),Number.isNaN(Number(a.charAt(0)))||(a=e+a),a});Bo(nn,"legalizeTableName",n=>nn.legalize(n,WD,qD,!1,0));Bo(nn,"legalizeColumnNames",n=>{var e=[];return n.forEach((t,r)=>{var i=nn.legalizeColumnName(t,r);e.includes(i)&&(i=nw+r),e.push(i)}),e});Bo(nn,"legalizeColumnName",function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return nn.legalize(n,nw,YD,!0,e)});Bo(nn,"isValidTableName",n=>nn.legalizeTableName(n)===n);Bo(nn,"isValidColumnName",n=>nn.legalizeColumnName(n)===n);const tl=nn;class Xe extends CustomEvent{constructor(e,t){super(e,t)}}function nf(n,e,t){return e=XD(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function XD(n){var e=QD(n,"string");return typeof e=="symbol"?e:String(e)}function QD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ZD{constructor(){nf(this,"pending",[]),nf(this,"resolved",[])}add(e,t){var r=De.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=[]}}const Bn=ZD;function Io(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}function af(n,e){var t=new Set([...Object.keys(n),...Object.keys(e)]),r=[];return t.forEach(i=>{n[i]!==e[i]&&r.push(i)}),r}class uv{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(!uv.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],a=i[0],o=i[1];if(a<=t&&t<=o)return!0}return!1}static selectRange(e,t){for(var[r,i]=t,a=[...e],o=a.length-1;o>=0;o-=1){var s=a[o],l=s[0],d=s[1];if(l<=r&&i<=d)return a;r<=d&&l<=i&&(r=Math.min(r,l),i=Math.max(i,d),a.splice(o,1))}return a.push([r,i]),a}static deselectRange(e,t){for(var[r,i]=t,a=[...e],o=a.length-1;o>=0;o-=1){var s=a[o],l=s[0],d=s[1];if(!(i<l||d<r))if(l<r&&i<d){a[o]=[l,r-1],a.splice(o+1,0,[i+1,d]);break}else r<=l&&d<=i?a.splice(o,1):l<r?a[o]=[l,r-1]:a[o]=[i+1,d]}return a}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 a=[...r],o=i[0];o<=i[1];o+=1)a.push(e[o]);return a},[])}}const Xr=uv;function*JD(n,e){for(var t=n;t<=e;++t)yield t}function iw(n,e,t){return e=eI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function eI(n){var e=tI(n,"string");return typeof e=="symbol"?e:String(e)}function tI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class rl{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"),a=r%60,o=String(Math.ceil(a)).padStart(2,"0");return"".concat(t,":").concat(i,":").concat(o)}static isTimeString(e){return new RegExp(rl.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])}}iw(rl,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");iw(rl,"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"}]));const _a=rl;function rI(n,e,t){return e=nI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nI(n){var e=iI(n,"string");return typeof e=="symbol"?e:String(e)}function iI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");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(...arguments),rI(this,"isInvalid",!0)}}const bo=aI;var aw=24,oI=32,sI=33,lI=150,Xh=200,ow=500,sw=250,dI={spellCheck:!1},uI=["ariaLabel","icon","isQuiet","labelText","children","onOpenChange","tooltip"];function of(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 sf(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?of(Object(t),!0).forEach(function(r){hI(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):of(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function hI(n,e,t){return e=cI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function cI(n){var e=vI(n,"string");return typeof e=="symbol"?e:String(e)}function vI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function mI(n,e){if(n==null)return{};var t=fI(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function fI(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function lw(n){var{ariaLabel:e,icon:t,isQuiet:r,labelText:i,children:a,onOpenChange:o,tooltip:s}=n,l=mI(n,uI),d=i==null&&s!=null?"action-button-icon-with-tooltip":void 0;return u.jsxs(dP,{type:"popover",onOpenChange:o,children:[u.jsxs(bS,sf(sf({},l),{},{"aria-label":e??i,isQuiet:r,children:[u.jsx(Kc,{UNSAFE_className:d,children:u.jsx(oe,{icon:t})}),i==null?null:u.jsx(CS,{children:i}),s==null?null:u.jsx(lt,{children:s})]})),a]})}function gI(n,e){return n===0?0:e==="all"||n===e.size?"all":e.size}function dw(n,e){return n===e?!0:n==="all"||e==="all"||n.size!==e.size?!1:[...n.keys()].every(t=>e.has(t))}function uw(n,e){return n.isInverted===e.isInverted&&dw(n.selection,e.selection)}function hw(n,e,t){if(n==="all")return"all";var r=[...n.keys()];return new Set(r.map(i=>t(e(i))))}function cw(n,e){var t=n==="all"||n.size>e/2,r=n;return t&&(r=n==="all"?new Set:new Set([...JD(0,e-1)].filter(i=>!n.has(String(i))).map(i=>String(i)))),{selection:r,isInverted:t}}function pI(n,e){return n?{}:{errorMessage:e,validationState:"invalid"}}function vw(n){var e;return(e=n==null?void 0:n.UNSAFE_getDOMNode())!==null&&e!==void 0?e:null}function bI(n){var e=n==null?void 0:n.UNSAFE_getDOMNode().lastElementChild;return mw(e)}function CI(n){var e=n==null?void 0:n.UNSAFE_getDOMNode(),t=e==null?void 0:e.querySelector("input"),r=t==null?void 0:t.getAttribute("aria-controls"),i=r==null?null:document.getElementById(r);return i}function mw(n){return n instanceof HTMLElement?n:null}function hv(){var n=p.useRef(!1);return p.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function lf(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function SI(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){lf(a,r,i,o,s,"next",l)}function s(l){lf(a,r,i,o,s,"throw",l)}o(void 0)})}}var wI=te.module("useAsyncInterval");function fw(n,e){var t=hv(),r=p.useRef(0),i=p.useRef(0),a=p.useRef(null),o=p.useCallback(SI(function*(){var s=Date.now();i.current+=1;var l=a.current==null?e:s-a.current;a.current=s;try{yield n()}catch(c){wI.error("A tick error occurred:",c)}if(t.current){l+=Date.now()-a.current;var d=Math.max(0,l-e),h=Math.max(0,e-d);r.current=window.setTimeout(o,h)}}),[n,t,e]);p.useEffect(()=>(a.current=null,o(),()=>{window.clearTimeout(r.current)}),[e,o])}function yI(n,e){return p.useCallback(function(){var t=n(...arguments);return e(),t},[e,n])}function wd(n,e){var t=p.useMemo(()=>Qe(n,e),[n,e]);return p.useEffect(()=>()=>t.cancel(),[t]),t}function EI(n){var[e,t]=p.useState(n);return p.useEffect(()=>{t(n)},[n]),[e,t]}function TI(n,e,t,r){var i=p.useRef(0);p.useEffect(()=>{i.current>=t||r&&(i.current+=1,n())},[t,r,...e])}function gw(n,e){var t=p.useRef(n),r=e(t.current,n)?t.current:n;return t.current=r,r}function nl(n){var e=p.useRef();return p.useEffect(function(){e.current=n}),e.current}function ru(n){var e=p.useRef(null);return p.useEffect(function(){n&&(typeof n=="function"?n(e.current):n.current=e.current)}),e}function PI(n){n.preventDefault()}function pw(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=p.useMemo(()=>"useSubmitButtonRef-".concat(Me()),[]),t=p.useCallback(a=>{a==null||a.UNSAFE_getDOMNode().setAttribute("form",e)},[e]),r=p.useMemo(()=>({id:e,onSubmit:n?void 0:PI}),[e,n]),i=p.useMemo(()=>({form:e,ref:t}),[e,t]);return{formProps:r,submitButtonProps:i}}function bw(n,e){return p.useCallback(t=>{typeof n=="function"?n(e(t)):n.current=e(t)},[e,n])}function Cw(n,e){var{getItem:t,selectedKeys:r,items:i}=n;return p.useMemo(()=>{var{selection:a,isInverted:o}=cw(r,i.length);return{selection:hw(a,t,e),isInverted:o}},[r,i.length,t,e])}function OI(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:YP,t=p.useRef();return p.useEffect(()=>()=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t)},[]),p.useCallback(r=>{var i;(i=t.current)===null||i===void 0||i.call(t);var a=e(r);a&&(a.addEventListener("scroll",n),t.current=()=>{a.removeEventListener("scroll",n),t.current=void 0})},[e,n])}function df(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function DI(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){df(a,r,i,o,s,"next",l)}function s(l){df(a,r,i,o,s,"throw",l)}o(void 0)})}}function II(n,e,t){var r=p.useRef(null),[i,a]=p.useState(null),o=p.useCallback(DI(function*(){if(!(i==null||t==null)){var l=yield t();i.scroll(0,l)}}),[t,i]);p.useEffect(()=>(i==null||i.addEventListener("scroll",e),o(),()=>{i==null||i.removeEventListener("scroll",e)}),[e,i,o]);var s=p.useCallback(l=>{l&&setTimeout(()=>{a(n(r.current))},0)},[n]);return{ref:r,onOpenChange:s}}function uf(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function RI(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){uf(a,r,i,o,s,"next",l)}function s(l){uf(a,r,i,o,s,"throw",l)}o(void 0)})}}function Ls(n,e){var{autoLoad:t=!0}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},[r,i]=p.useState(null),[a,o]=p.useState(null),[s,l]=p.useState(!1),d=p.useCallback(RI(function*(){l(!0);try{var h=yield n(...e);i(h),o(null)}catch(c){i(null),o(c)}finally{l(!1)}}),[n,...e]);return p.useEffect(()=>{t&&d()},[t,d]),{data:r,error:a,isError:a!=null,isLoading:s,reload:d}}function hf(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 cf(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?hf(Object(t),!0).forEach(function(r){_I(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):hf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function _I(n,e,t){return e=xI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function xI(n){var e=NI(n,"string");return typeof e=="symbol"?e:String(e)}function NI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function MI(n,e,t,r){var i=arguments.length===4;return p.useCallback(a=>{var o=i?a??r:a;t(cf(cf({},n),{},{[e]:o}))},[t,n,e,i,r])}function Sw(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=p.useRef(),i=p.useRef(0);return p.useCallback(a=>{window.clearTimeout(r.current),r.current=window.setTimeout(()=>{var o=Math.floor(a.target.scrollTop/n);i.current!==o&&(i.current=o,e(o))},t)},[t,n,e])}function il(n,e){var[t,r]=p.useState(!0),[i,a]=p.useState(n),[o,s]=p.useState(n),[l,d]=p.useState(e);return(n!==o||e!==l)&&(r(!0),s(n),d(e)),p.useEffect(()=>{var h=!1,c=setTimeout(()=>{h||(r(!1),a(n))},e);return()=>{h=!0,clearTimeout(c)}},[n,e]),{isDebouncing:t,value:i}}function ww(n,e){return p.useCallback(t=>{if(t!=null){var r=e==null?[t]:t.querySelectorAll(e);r.forEach(i=>{Object.entries(n).forEach(a=>{var[o,s]=a;i.setAttribute(o,s)})})}},[n,e])}function FI(n){var e=ww(dI,n);return bw(e,vw)}function yw(){var{getKey:n=Ew}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},[e,t]=p.useState([]),[r,i]=p.useState(()=>new Set),a=p.useCallback(f=>g=>n(g)===f,[n]),o=p.useCallback(f=>{var g;return(g=e.find(a(f)))!==null&&g!==void 0?g:null},[e,a]),s=p.useCallback(f=>{var g=o(f);if(g==null)throw new Error("No item found matching key: ".concat(f));return g},[o]),l=p.useCallback(f=>{t(g=>[...g,...f])},[]),d=p.useCallback((f,g)=>{t(b=>[...b.slice(0,f),...g,...b.slice(f)])},[]),h=p.useCallback(f=>{var g=new Set(f);t(b=>b.filter(C=>!g.has(n(C))))},[n]),c=p.useCallback((f,g)=>{var b=e.findIndex(a(f));b!==-1&&t(C=>[...C.slice(0,b),g,...C.slice(b+1)])},[e,a]),v=p.useCallback(f=>{if(f.size!==0){var g=[],b=new Map;for(var C of f.keys()){var S=e.findIndex(a(C));g.push(S),b.set(S,C)}g.sort((E,y)=>E-y);var w=[];e.forEach((E,y)=>{if(g[0]===y){var T=b.get(g.shift()),O=f.get(T);w.push(O)}else w.push(E)}),t(w)}},[e,a]),m=p.useMemo(()=>({items:e,selectedKeys:r,append:l,bulkUpdate:v,findItem:o,getItem:s,insert:d,remove:h,setItems:t,setSelectedKeys:i,update:c}),[l,v,o,s,d,e,h,t,r,c]);return m}function Ew(n){var e=n!=null&&typeof n=="object"&&"key"in n;if(!e)throw new Error("Item does not have a `key` prop.");return n.key}function cv(n,e){p.useEffect(()=>{if(n!=null){var t=new window.ResizeObserver(e);return t.observe(n),()=>{n!=null&&t.unobserve(n)}}},[n,e])}const AI=Object.freeze(Object.defineProperty({__proto__:null,createValidationProps:pI,defaultGetKey:Ew,extractSpectrumHTMLElement:vw,extractSpectrumLastChildHTMLElement:bI,findSpectrumComboBoxScrollArea:CI,getSelectedItemCountOrAll:gI,identityExtractHTMLElement:mw,isSelectionEqual:dw,isSelectionMaybeInvertedEqual:uw,mapSelection:hw,optimizeSelection:cw,useAsyncInterval:fw,useCallbackWithAction:yI,useContextOrThrow:Zs,useCopyToClipboard:ED,useDebouncedCallback:wd,useDebouncedValue:il,useDependentState:EI,useEffectNTimesWhen:TI,useFormWithDetachedSubmitButton:pw,useForwardedRef:ru,useIsEqualMemo:gw,useIsMountedRef:hv,useMappedRef:bw,useMappedSelection:Cw,useOnScrollOffsetChangeCallback:Sw,useOnScrollRef:OI,usePopoverOnScrollRef:II,usePrevious:nl,usePromiseFactory:Ls,usePropChangeCallback:MI,useResizeObserver:cv,useSetAttributesCallback:ww,useSpectrumDisableSpellcheckRef:FI,useWindowedListData:yw},Symbol.toStringTag,{value:"Module"})),LI="_spectrumActionBar_tmmkp_5",kI="_spectrumDialogComponentHeading_tmmkp_9",jI="_spectrumEllipsis_tmmkp_14",vv={spectrumActionBar:LI,spectrumDialogComponentHeading:kI,spectrumEllipsis:jI};function vf(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 Rl(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?vf(Object(t),!0).forEach(function(r){$I(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):vf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function $I(n,e,t){return e=HI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function HI(n){var e=UI(n,"string");return typeof e=="symbol"?e:String(e)}function UI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Tw(n){var{heading:e,confirmationButtonLabel:t,children:r,onCancel:i,onConfirm:a}=n,{formProps:o,submitButtonProps:s}=pw();return u.jsxs(uP,{children:[u.jsx(SS,{level:3,UNSAFE_className:vv.spectrumDialogComponentHeading,children:e}),u.jsx(hP,{}),u.jsx(wS,{children:u.jsx(cP,Rl(Rl({},o),{},{children:r}))}),u.jsxs(vP,{children:[u.jsx(Km,{variant:"secondary",onPress:i,children:"Cancel"}),u.jsx(Km,Rl(Rl({},s),{},{style:"fill",variant:"negative",onPress:a,type:"submit",children:t}))]})]})}function BI(n){var{ariaLabel:e,heading:t,confirmationButtonLabel:r,isHidden:i,children:a,tooltip:o,onConfirm:s}=n,l=p.useCallback(d=>u.jsx(Tw,{heading:t,confirmationButtonLabel:r,onCancel:d,onConfirm:()=>{d(),s()},children:a}),[a,r,t,s]);return u.jsx(lw,{ariaLabel:e,icon:er,isHidden:i,isQuiet:!0,height:aw,tooltip:o,children:l})}var VI=["icon","label","tooltip"];function mf(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 ff(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?mf(Object(t),!0).forEach(function(r){GI(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):mf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function GI(n,e,t){return e=WI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function WI(n){var e=KI(n,"string");return typeof e=="symbol"?e:String(e)}function KI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function zI(n,e){if(n==null)return{};var t=qI(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function qI(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function Pw(n){var{icon:e,label:t,tooltip:r}=n,i=zI(n,VI);return u.jsxs(bS,ff(ff({},i),{},{"aria-label":t,isQuiet:!0,height:aw,children:[u.jsx(Kc,{UNSAFE_className:r==null?void 0:"action-button-icon-with-tooltip",children:u.jsx(oe,{icon:e})}),r==null?null:u.jsx(lt,{children:r})]}))}Pw.displayName="IconActionButton";function gf(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 YI(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?gf(Object(t),!0).forEach(function(r){li(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):gf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function li(n,e,t){return e=XI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function XI(n){var e=QI(n,"string");return typeof e=="symbol"?e:String(e)}function QI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ZI=100,Qh;(function(n){n.UP="UP",n.DOWN="DOWN"})(Qh||(Qh={}));class gn extends p.Component{constructor(e){super(e),li(this,"popper",void 0),li(this,"cbContainer",void 0),li(this,"menuContainer",void 0),li(this,"input",void 0),li(this,"getCachedFilteredOptions",Ce((r,i)=>r.filter(a=>a.title.toLowerCase().indexOf(i.toLowerCase())>=0)));var{popperOptions:t}=this.props;t=YI({placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}}},t),this.state={title:"",filteredOptions:[],keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,invalid:!1,popperOptions:t},this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handelInputFocus=this.handelInputFocus.bind(this),this.handleInputClick=this.handleInputClick.bind(this),this.updateInputValue=Qe(this.updateInputValue,ZI),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=re.createRef(),this.cbContainer=re.createRef(),this.menuContainer=re.createRef(),this.input=re.createRef()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}getValueAndValidate(e){if(!e)return this.setState({invalid:!1}),{value:e,isValid:!1};var{options:t}=this.props,r=t.filter(i=>i.title.toLowerCase()===e.toLowerCase());return r.length<1?(this.setState({invalid:!0}),{value:e,isValid:!1}):(this.setState({invalid:!1}),{value:r[0].value,isValid:!0})}updateInputValue(e){var{menuIsOpen:t}=this.state,{value:r,isValid:i}=this.getValueAndValidate(e);t&&this.processFilterChange(e),this.fireOnChange(r,i)}fireOnChange(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,{onChange:r}=this.props;r(e,t)}processFilterChange(e){var t,{options:r}=this.props,{menuIsOpen:i}=this.state,a=e?this.getCachedFilteredOptions(r,e):r,o=a.length===1&&a[0].title===e;if(this.setState({filteredOptions:a,keyboardOptionIndex:0}),o&&i){this.closeMenu();return}(t=this.popper.current)===null||t===void 0||t.scheduleUpdate()}resetValue(){this.setState({title:""}),this.fireOnChange("")}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var t,{filteredOptions:r,keyboardOptionIndex:i}=this.state,a=r[i];switch(e.key){case"Enter":case"ArrowRight":e.stopPropagation(),e.preventDefault(),a!=null&&(this.setState({title:a.title,invalid:!1}),this.fireOnChange(a.value)),this.closeMenu(),(t=this.input.current)===null||t===void 0||t.focus();break;case"ArrowUp":e.stopPropagation(),e.preventDefault(),this.navigateMenu(gn.MENU_NAVIGATION_DIRECTION.UP);break;case"ArrowDown":e.stopPropagation(),e.preventDefault(),this.navigateMenu(gn.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Tab":if(e.stopPropagation(),e.preventDefault(),e.shiftKey){this.navigateMenu(gn.MENU_NAVIGATION_DIRECTION.UP);break}this.navigateMenu(gn.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Escape":e.preventDefault(),e.stopPropagation(),this.closeMenu();break}}navigateMenu(e){var{filteredOptions:t,keyboardOptionIndex:r}=this.state,i=r;e===gn.MENU_NAVIGATION_DIRECTION.UP?r>0?(i=(i-1)%t.length,this.setState({keyboardOptionIndex:i})):r===0&&(i=t.length-1,this.setState({keyboardOptionIndex:i})):e===gn.MENU_NAVIGATION_DIRECTION.DOWN&&r<t.length&&(i=(i+1)%t.length,this.setState({keyboardOptionIndex:i})),this.scrollOptionIntoView(i)}handleInputKeyDown(e){var{onEnter:t}=this.props,{menuIsOpen:r}=this.state;r?this.handleMenuKeyDown(e):e.key==="Enter"?t():e.key==="Escape"?(this.resetValue(),e.preventDefault(),e.stopPropagation()):e.key==="ArrowRight"||e.key==="ArrowLeft"||e.key==="Tab"||e.key==="Shift"||this.openMenu()}handleInputChange(e){this.setState({title:e.target.value}),this.updateInputValue(e.target.value)}handleOptionClick(e){var t;this.setState({title:e.title,invalid:!1}),this.fireOnChange(e.value),this.closeMenu(),(t=this.input.current)===null||t===void 0||t.focus()}handelInputFocus(){var{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputClick(){var{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputBlur(e){var{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&this.popper.current!==null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuBlur(e){e.relatedTarget===this.input.current||e.relatedTarget instanceof Element&&this.popper.current!==null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuOpened(){var e;(e=this.input.current)===null||e===void 0||e.focus()}handleMenuExited(){var{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}openMenu(){var{title:e}=this.state;this.processFilterChange(e),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var t;(t=this.popper.current)===null||t===void 0||t.show()})}closeMenu(){var e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(this.setState({menuIsOpen:!1,keyboardOptionIndex:0}),t){var r;(r=this.input.current)===null||r===void 0||r.focus()}(e=this.popper.current)===null||e===void 0||e.hide()}scrollOptionIntoView(e){if(this.menuContainer.current){var t;(t=this.menuContainer.current.children.item(e))===null||t===void 0||t.scrollIntoView({behavior:"smooth",block:"nearest"})}}renderMenuElement(){var{inputWidth:e}=this.state;return u.jsx("div",{className:q("aci-options"),ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,style:{width:e},onBlur:this.handleMenuBlur,children:this.renderOptions()})}renderOptions(){var{noMatchText:e}=this.props,{title:t,filteredOptions:r}=this.state;return t&&r.length===0?u.jsx("div",{className:"no-match",children:e}):r.map((i,a)=>this.renderOption(i,a))}renderOption(e,t){var{keyboardOptionIndex:r}=this.state,i="option-".concat(t,"-").concat(e.value);return u.jsx("button",{type:"button",className:q("aci-option-btn",{"keyboard-active":r===t}),onClick:()=>this.handleOptionClick(e),onFocus:()=>this.setState({keyboardOptionIndex:t}),children:e.title},i)}render(){var{options:e,inputPlaceholder:t,disabled:r,className:i,defaultTitle:a,spellCheck:o,"data-testid":s}=this.props,{title:l,menuIsOpen:d,popperOptions:h,invalid:c}=this.state;return u.jsxs("div",{className:"aci-container",ref:this.cbContainer,children:[u.jsx("input",{value:l||a,className:q("form-control",i,"aci-input",{"is-invalid":c&&!d}),ref:this.input,onChange:this.handleInputChange,placeholder:t||e[0].title,disabled:r,onFocus:this.handelInputFocus,onClick:this.handleInputClick,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:o,"data-testid":s}),u.jsx(oa,{ref:this.popper,options:h,className:q("aci-options-popper interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})}}li(gn,"propTypes",{options:V.arrayOf(V.shape({title:V.string.isRequired,value:V.string.isRequired})).isRequired,popperOptions:V.shape({}),onChange:V.func,inputPlaceholder:V.string,disabled:V.bool,className:V.string,defaultTitle:V.string,spellCheck:V.bool,onEnter:V.func,noMatchText:V.string,"data-testid":V.string});li(gn,"defaultProps",{onChange(){},inputPlaceholder:"",disabled:!1,className:"",defaultTitle:"",popperOptions:null,spellCheck:!0,onEnter(){},noMatchText:"No matching items found","data-testid":void 0});li(gn,"MENU_NAVIGATION_DIRECTION",Qh);const JI=gn;function mv(n){var{className:e="",value:t,onChange:r,spellCheck:i=!1,placeholder:a="",disabled:o=!1,delimiter:s="",id:l="","data-testid":d}=n,[h,c]=p.useState(t),[v,m]=p.useState(!1),f=p.useRef(null);p.useEffect(function(){c(t)},[t]);function g(O){return O.trim().split(s).filter(R=>R).join(`
|
|
1
|
+
import{C as u,$ as dP,H as bS,I as Kc,F as oe,J as CS,r as p,K as Qe,L as Me,M as uP,N as SS,O as hP,P as wS,Q as cP,S as vP,T as Km,U as Ce,G as re,E as q,V,W as mP,D as kt,X as zc,Y as fP,Z as gP,a0 as qd,a1 as Ks,a2 as pP,a3 as ke,a4 as zs,a5 as bP,a6 as yS,a7 as CP,a8 as SP,a9 as Oo,aa as fe,R as Yd,ab as zm,ac as At,ad as wP,ae as qc,af as yP,ag as EP,ah as TP,ai as PP,aj as qs,ak as ES,al as fi,am as TS,an as qh,ao as ve,ap as Jr,aq as OP,ar as Ln,as as DP,at as IP,au as RP,av as _P,aw as Yh,ax as xP,ay as NP,az as MP,aA as qm,aB as FP,aC as Ym,aD as AP,aE as LP,aF as kP,aG as jP,aH as $P,aI as HP,aJ as UP,aK as Fn,aL as Pr,aM as ea,aN as Xm,aO as BP,aP as Ds,aQ as an,aR as PS,aS as VP,aT as GP,aU as WP,aV as KP,aW as zP,aX as qP,aY as OS}from"./vendor-83d58fe6.js";import{L as te,i as YP,v as er,M as jo,b as $o,c as Ys,d as DS,e as XP,f as IS,g as $n,h as Xs,j as RS,a as tr,k as Yc,l as Ho,m as _S,T as qe,r as Xd,n as $,o as xS,p as QP,q as ZP,C as JP,D as eO,s as tO,t as rO,u as nO,w as Un,N as iO,S as aO,x as oO,y as sO,W as lO,z as dO,A as uO,B as hO,E as cO,F as vO,G as mO,H as NS,I as MS,J as fO,K as gO,O as pO,P as bO,Q as CO,R as SO,U as wO,V as yO,X as Qd,Y as EO,Z as FS,_ as U,$ as Xc,a0 as ta,a1 as Qc,a2 as Zc,a3 as pd,a4 as TO,a5 as Yn,a6 as PO,a7 as OO,a8 as Pa,a9 as AS,aa as DO,ab as IO,ac as RO,ad as _O,ae as Jc,af as La,ag as Qm,ah as xO,ai as Qs,aj as ev,ak as tv,al as Zd,am as Do,an as NO,ao as MO,ap as bd,aq as FO,ar as rv,as as LS,at as AO,au as LO,av as kO,aw as jO,ax as $O,ay as HO,az as Zm,aA as mh,aB as UO,aC as BO,aD as VO,aE as GO,aF as kS,aG as nv,aH as Jm,aI as WO,aJ as KO,aK as zO,aL as qO,aM as jS,aN as YO,aO as ef,aP as Cd,aQ as tf,aR as $S,aS as XO,aT as Jd,aU as QO,aV as ZO,aW as JO,aX as eD,aY as tD,aZ as rD,a_ as nD,a$ as iD,b0 as aD,b1 as oD,b2 as sD,b3 as lD,b4 as dD,b5 as uD,b6 as hD,b7 as cD,b8 as vD,b9 as mD,ba as fD,bb as HS,bc as gD,bd as rf,be as pD,bf as bD,bg as CD,bh as SD,bi as wD,bj as yD}from"./index-07a5ec52.js";import{P as De,T as lt,e as Zs,f as ED,g as oa,B as z,h as et,i as fh,j as US,k as Uo,c as BS,l as eu,m as TD,n as VS,t as PD,a as It,o as GS,p as Oe,q as OD,r as DD,D as ra,s as Ma,v as wr,w as ID,F as Jt,x as gi,I as ki,S as RD,y as Is,z as B,A as _D,E as iv,G as xD,H as WS,J as KS,K as av,L as ov,M as zS,N as qS,O as YS,Q as XS,R as ND,U as MD,V as sv,W as Sd,X as FD,Y as QS,Z as ZS,_ as JS,$ as tu,a0 as AD,C as lv,d as po,a1 as LD,a2 as ew,a3 as kD,a4 as jD,b as Js,a5 as $D,a6 as ye,a7 as HD,a8 as tw,u as rw,a9 as dv,aa as Yr,ab as el,ac as rs,ad as UD,ae as zr}from"./useConnection-0feca045.js";import{P as BD}from"./plotly-6502aac3.js";import"./helpers-de833af9.js";function Bo(n,e,t){return e=VD(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function VD(n){var e=GD(n,"string");return typeof e=="symbol"?e:String(e)}function GD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var WD="table_",nw="column_",KD=new Set(["in","not","i","ii","k"]),zD=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"]),qD=/[^a-zA-Z0-9_$+@-]/g,YD=/[^A-Za-z0-9_$]/g;class nn{}Bo(nn,"legalize",(n,e,t,r,i)=>{var a=n.trim().replace(/[- ]/g,"_");return r&&(KD.has(a)||zD.has(a))&&(a=e+a),a=a.replace(t,""),a||(a=e+i),Number.isNaN(Number(a.charAt(0)))||(a=e+a),a});Bo(nn,"legalizeTableName",n=>nn.legalize(n,WD,qD,!1,0));Bo(nn,"legalizeColumnNames",n=>{var e=[];return n.forEach((t,r)=>{var i=nn.legalizeColumnName(t,r);e.includes(i)&&(i=nw+r),e.push(i)}),e});Bo(nn,"legalizeColumnName",function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return nn.legalize(n,nw,YD,!0,e)});Bo(nn,"isValidTableName",n=>nn.legalizeTableName(n)===n);Bo(nn,"isValidColumnName",n=>nn.legalizeColumnName(n)===n);const tl=nn;class Xe extends CustomEvent{constructor(e,t){super(e,t)}}function nf(n,e,t){return e=XD(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function XD(n){var e=QD(n,"string");return typeof e=="symbol"?e:String(e)}function QD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ZD{constructor(){nf(this,"pending",[]),nf(this,"resolved",[])}add(e,t){var r=De.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=[]}}const Bn=ZD;function Io(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}function af(n,e){var t=new Set([...Object.keys(n),...Object.keys(e)]),r=[];return t.forEach(i=>{n[i]!==e[i]&&r.push(i)}),r}class uv{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(!uv.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],a=i[0],o=i[1];if(a<=t&&t<=o)return!0}return!1}static selectRange(e,t){for(var[r,i]=t,a=[...e],o=a.length-1;o>=0;o-=1){var s=a[o],l=s[0],d=s[1];if(l<=r&&i<=d)return a;r<=d&&l<=i&&(r=Math.min(r,l),i=Math.max(i,d),a.splice(o,1))}return a.push([r,i]),a}static deselectRange(e,t){for(var[r,i]=t,a=[...e],o=a.length-1;o>=0;o-=1){var s=a[o],l=s[0],d=s[1];if(!(i<l||d<r))if(l<r&&i<d){a[o]=[l,r-1],a.splice(o+1,0,[i+1,d]);break}else r<=l&&d<=i?a.splice(o,1):l<r?a[o]=[l,r-1]:a[o]=[i+1,d]}return a}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 a=[...r],o=i[0];o<=i[1];o+=1)a.push(e[o]);return a},[])}}const Xr=uv;function*JD(n,e){for(var t=n;t<=e;++t)yield t}function iw(n,e,t){return e=eI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function eI(n){var e=tI(n,"string");return typeof e=="symbol"?e:String(e)}function tI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class rl{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"),a=r%60,o=String(Math.ceil(a)).padStart(2,"0");return"".concat(t,":").concat(i,":").concat(o)}static isTimeString(e){return new RegExp(rl.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])}}iw(rl,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");iw(rl,"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"}]));const _a=rl;function rI(n,e,t){return e=nI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nI(n){var e=iI(n,"string");return typeof e=="symbol"?e:String(e)}function iI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");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(...arguments),rI(this,"isInvalid",!0)}}const bo=aI;var aw=24,oI=32,sI=33,lI=150,Xh=200,ow=500,sw=250,dI={spellCheck:!1},uI=["ariaLabel","icon","isQuiet","labelText","children","onOpenChange","tooltip"];function of(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 sf(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?of(Object(t),!0).forEach(function(r){hI(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):of(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function hI(n,e,t){return e=cI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function cI(n){var e=vI(n,"string");return typeof e=="symbol"?e:String(e)}function vI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function mI(n,e){if(n==null)return{};var t=fI(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function fI(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function lw(n){var{ariaLabel:e,icon:t,isQuiet:r,labelText:i,children:a,onOpenChange:o,tooltip:s}=n,l=mI(n,uI),d=i==null&&s!=null?"action-button-icon-with-tooltip":void 0;return u.jsxs(dP,{type:"popover",onOpenChange:o,children:[u.jsxs(bS,sf(sf({},l),{},{"aria-label":e??i,isQuiet:r,children:[u.jsx(Kc,{UNSAFE_className:d,children:u.jsx(oe,{icon:t})}),i==null?null:u.jsx(CS,{children:i}),s==null?null:u.jsx(lt,{children:s})]})),a]})}function gI(n,e){return n===0?0:e==="all"||n===e.size?"all":e.size}function dw(n,e){return n===e?!0:n==="all"||e==="all"||n.size!==e.size?!1:[...n.keys()].every(t=>e.has(t))}function uw(n,e){return n.isInverted===e.isInverted&&dw(n.selection,e.selection)}function hw(n,e,t){if(n==="all")return"all";var r=[...n.keys()];return new Set(r.map(i=>t(e(i))))}function cw(n,e){var t=n==="all"||n.size>e/2,r=n;return t&&(r=n==="all"?new Set:new Set([...JD(0,e-1)].filter(i=>!n.has(String(i))).map(i=>String(i)))),{selection:r,isInverted:t}}function pI(n,e){return n?{}:{errorMessage:e,validationState:"invalid"}}function vw(n){var e;return(e=n==null?void 0:n.UNSAFE_getDOMNode())!==null&&e!==void 0?e:null}function bI(n){var e=n==null?void 0:n.UNSAFE_getDOMNode().lastElementChild;return mw(e)}function CI(n){var e=n==null?void 0:n.UNSAFE_getDOMNode(),t=e==null?void 0:e.querySelector("input"),r=t==null?void 0:t.getAttribute("aria-controls"),i=r==null?null:document.getElementById(r);return i}function mw(n){return n instanceof HTMLElement?n:null}function hv(){var n=p.useRef(!1);return p.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function lf(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function SI(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){lf(a,r,i,o,s,"next",l)}function s(l){lf(a,r,i,o,s,"throw",l)}o(void 0)})}}var wI=te.module("useAsyncInterval");function fw(n,e){var t=hv(),r=p.useRef(0),i=p.useRef(0),a=p.useRef(null),o=p.useCallback(SI(function*(){var s=Date.now();i.current+=1;var l=a.current==null?e:s-a.current;a.current=s;try{yield n()}catch(c){wI.error("A tick error occurred:",c)}if(t.current){l+=Date.now()-a.current;var d=Math.max(0,l-e),h=Math.max(0,e-d);r.current=window.setTimeout(o,h)}}),[n,t,e]);p.useEffect(()=>(a.current=null,o(),()=>{window.clearTimeout(r.current)}),[e,o])}function yI(n,e){return p.useCallback(function(){var t=n(...arguments);return e(),t},[e,n])}function wd(n,e){var t=p.useMemo(()=>Qe(n,e),[n,e]);return p.useEffect(()=>()=>t.cancel(),[t]),t}function EI(n){var[e,t]=p.useState(n);return p.useEffect(()=>{t(n)},[n]),[e,t]}function TI(n,e,t,r){var i=p.useRef(0);p.useEffect(()=>{i.current>=t||r&&(i.current+=1,n())},[t,r,...e])}function gw(n,e){var t=p.useRef(n),r=e(t.current,n)?t.current:n;return t.current=r,r}function nl(n){var e=p.useRef();return p.useEffect(function(){e.current=n}),e.current}function ru(n){var e=p.useRef(null);return p.useEffect(function(){n&&(typeof n=="function"?n(e.current):n.current=e.current)}),e}function PI(n){n.preventDefault()}function pw(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=p.useMemo(()=>"useSubmitButtonRef-".concat(Me()),[]),t=p.useCallback(a=>{a==null||a.UNSAFE_getDOMNode().setAttribute("form",e)},[e]),r=p.useMemo(()=>({id:e,onSubmit:n?void 0:PI}),[e,n]),i=p.useMemo(()=>({form:e,ref:t}),[e,t]);return{formProps:r,submitButtonProps:i}}function bw(n,e){return p.useCallback(t=>{typeof n=="function"?n(e(t)):n.current=e(t)},[e,n])}function Cw(n,e){var{getItem:t,selectedKeys:r,items:i}=n;return p.useMemo(()=>{var{selection:a,isInverted:o}=cw(r,i.length);return{selection:hw(a,t,e),isInverted:o}},[r,i.length,t,e])}function OI(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:YP,t=p.useRef();return p.useEffect(()=>()=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t)},[]),p.useCallback(r=>{var i;(i=t.current)===null||i===void 0||i.call(t);var a=e(r);a&&(a.addEventListener("scroll",n),t.current=()=>{a.removeEventListener("scroll",n),t.current=void 0})},[e,n])}function df(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function DI(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){df(a,r,i,o,s,"next",l)}function s(l){df(a,r,i,o,s,"throw",l)}o(void 0)})}}function II(n,e,t){var r=p.useRef(null),[i,a]=p.useState(null),o=p.useCallback(DI(function*(){if(!(i==null||t==null)){var l=yield t();i.scroll(0,l)}}),[t,i]);p.useEffect(()=>(i==null||i.addEventListener("scroll",e),o(),()=>{i==null||i.removeEventListener("scroll",e)}),[e,i,o]);var s=p.useCallback(l=>{l&&setTimeout(()=>{a(n(r.current))},0)},[n]);return{ref:r,onOpenChange:s}}function uf(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function RI(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){uf(a,r,i,o,s,"next",l)}function s(l){uf(a,r,i,o,s,"throw",l)}o(void 0)})}}function Ls(n,e){var{autoLoad:t=!0}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},[r,i]=p.useState(null),[a,o]=p.useState(null),[s,l]=p.useState(!1),d=p.useCallback(RI(function*(){l(!0);try{var h=yield n(...e);i(h),o(null)}catch(c){i(null),o(c)}finally{l(!1)}}),[n,...e]);return p.useEffect(()=>{t&&d()},[t,d]),{data:r,error:a,isError:a!=null,isLoading:s,reload:d}}function hf(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 cf(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?hf(Object(t),!0).forEach(function(r){_I(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):hf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function _I(n,e,t){return e=xI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function xI(n){var e=NI(n,"string");return typeof e=="symbol"?e:String(e)}function NI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function MI(n,e,t,r){var i=arguments.length===4;return p.useCallback(a=>{var o=i?a??r:a;t(cf(cf({},n),{},{[e]:o}))},[t,n,e,i,r])}function Sw(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=p.useRef(),i=p.useRef(0);return p.useCallback(a=>{window.clearTimeout(r.current),r.current=window.setTimeout(()=>{var o=Math.floor(a.target.scrollTop/n);i.current!==o&&(i.current=o,e(o))},t)},[t,n,e])}function il(n,e){var[t,r]=p.useState(!0),[i,a]=p.useState(n),[o,s]=p.useState(n),[l,d]=p.useState(e);return(n!==o||e!==l)&&(r(!0),s(n),d(e)),p.useEffect(()=>{var h=!1,c=setTimeout(()=>{h||(r(!1),a(n))},e);return()=>{h=!0,clearTimeout(c)}},[n,e]),{isDebouncing:t,value:i}}function ww(n,e){return p.useCallback(t=>{if(t!=null){var r=e==null?[t]:t.querySelectorAll(e);r.forEach(i=>{Object.entries(n).forEach(a=>{var[o,s]=a;i.setAttribute(o,s)})})}},[n,e])}function FI(n){var e=ww(dI,n);return bw(e,vw)}function yw(){var{getKey:n=Ew}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},[e,t]=p.useState([]),[r,i]=p.useState(()=>new Set),a=p.useCallback(f=>g=>n(g)===f,[n]),o=p.useCallback(f=>{var g;return(g=e.find(a(f)))!==null&&g!==void 0?g:null},[e,a]),s=p.useCallback(f=>{var g=o(f);if(g==null)throw new Error("No item found matching key: ".concat(f));return g},[o]),l=p.useCallback(f=>{t(g=>[...g,...f])},[]),d=p.useCallback((f,g)=>{t(b=>[...b.slice(0,f),...g,...b.slice(f)])},[]),h=p.useCallback(f=>{var g=new Set(f);t(b=>b.filter(C=>!g.has(n(C))))},[n]),c=p.useCallback((f,g)=>{var b=e.findIndex(a(f));b!==-1&&t(C=>[...C.slice(0,b),g,...C.slice(b+1)])},[e,a]),v=p.useCallback(f=>{if(f.size!==0){var g=[],b=new Map;for(var C of f.keys()){var S=e.findIndex(a(C));g.push(S),b.set(S,C)}g.sort((E,y)=>E-y);var w=[];e.forEach((E,y)=>{if(g[0]===y){var T=b.get(g.shift()),O=f.get(T);w.push(O)}else w.push(E)}),t(w)}},[e,a]),m=p.useMemo(()=>({items:e,selectedKeys:r,append:l,bulkUpdate:v,findItem:o,getItem:s,insert:d,remove:h,setItems:t,setSelectedKeys:i,update:c}),[l,v,o,s,d,e,h,t,r,c]);return m}function Ew(n){var e=n!=null&&typeof n=="object"&&"key"in n;if(!e)throw new Error("Item does not have a `key` prop.");return n.key}function cv(n,e){p.useEffect(()=>{if(n!=null){var t=new window.ResizeObserver(e);return t.observe(n),()=>{n!=null&&t.unobserve(n)}}},[n,e])}const AI=Object.freeze(Object.defineProperty({__proto__:null,createValidationProps:pI,defaultGetKey:Ew,extractSpectrumHTMLElement:vw,extractSpectrumLastChildHTMLElement:bI,findSpectrumComboBoxScrollArea:CI,getSelectedItemCountOrAll:gI,identityExtractHTMLElement:mw,isSelectionEqual:dw,isSelectionMaybeInvertedEqual:uw,mapSelection:hw,optimizeSelection:cw,useAsyncInterval:fw,useCallbackWithAction:yI,useContextOrThrow:Zs,useCopyToClipboard:ED,useDebouncedCallback:wd,useDebouncedValue:il,useDependentState:EI,useEffectNTimesWhen:TI,useFormWithDetachedSubmitButton:pw,useForwardedRef:ru,useIsEqualMemo:gw,useIsMountedRef:hv,useMappedRef:bw,useMappedSelection:Cw,useOnScrollOffsetChangeCallback:Sw,useOnScrollRef:OI,usePopoverOnScrollRef:II,usePrevious:nl,usePromiseFactory:Ls,usePropChangeCallback:MI,useResizeObserver:cv,useSetAttributesCallback:ww,useSpectrumDisableSpellcheckRef:FI,useWindowedListData:yw},Symbol.toStringTag,{value:"Module"})),LI="_spectrumActionBar_tmmkp_5",kI="_spectrumDialogComponentHeading_tmmkp_9",jI="_spectrumEllipsis_tmmkp_14",vv={spectrumActionBar:LI,spectrumDialogComponentHeading:kI,spectrumEllipsis:jI};function vf(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 Rl(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?vf(Object(t),!0).forEach(function(r){$I(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):vf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function $I(n,e,t){return e=HI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function HI(n){var e=UI(n,"string");return typeof e=="symbol"?e:String(e)}function UI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Tw(n){var{heading:e,confirmationButtonLabel:t,children:r,onCancel:i,onConfirm:a}=n,{formProps:o,submitButtonProps:s}=pw();return u.jsxs(uP,{children:[u.jsx(SS,{level:3,UNSAFE_className:vv.spectrumDialogComponentHeading,children:e}),u.jsx(hP,{}),u.jsx(wS,{children:u.jsx(cP,Rl(Rl({},o),{},{children:r}))}),u.jsxs(vP,{children:[u.jsx(Km,{variant:"secondary",onPress:i,children:"Cancel"}),u.jsx(Km,Rl(Rl({},s),{},{style:"fill",variant:"negative",onPress:a,type:"submit",children:t}))]})]})}function BI(n){var{ariaLabel:e,heading:t,confirmationButtonLabel:r,isHidden:i,children:a,tooltip:o,onConfirm:s}=n,l=p.useCallback(d=>u.jsx(Tw,{heading:t,confirmationButtonLabel:r,onCancel:d,onConfirm:()=>{d(),s()},children:a}),[a,r,t,s]);return u.jsx(lw,{ariaLabel:e,icon:er,isHidden:i,isQuiet:!0,height:aw,tooltip:o,children:l})}var VI=["icon","label","tooltip"];function mf(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 ff(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?mf(Object(t),!0).forEach(function(r){GI(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):mf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function GI(n,e,t){return e=WI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function WI(n){var e=KI(n,"string");return typeof e=="symbol"?e:String(e)}function KI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function zI(n,e){if(n==null)return{};var t=qI(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function qI(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function Pw(n){var{icon:e,label:t,tooltip:r}=n,i=zI(n,VI);return u.jsxs(bS,ff(ff({},i),{},{"aria-label":t,isQuiet:!0,height:aw,children:[u.jsx(Kc,{UNSAFE_className:r==null?void 0:"action-button-icon-with-tooltip",children:u.jsx(oe,{icon:e})}),r==null?null:u.jsx(lt,{children:r})]}))}Pw.displayName="IconActionButton";function gf(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 YI(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?gf(Object(t),!0).forEach(function(r){li(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):gf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function li(n,e,t){return e=XI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function XI(n){var e=QI(n,"string");return typeof e=="symbol"?e:String(e)}function QI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ZI=100,Qh;(function(n){n.UP="UP",n.DOWN="DOWN"})(Qh||(Qh={}));class gn extends p.Component{constructor(e){super(e),li(this,"popper",void 0),li(this,"cbContainer",void 0),li(this,"menuContainer",void 0),li(this,"input",void 0),li(this,"getCachedFilteredOptions",Ce((r,i)=>r.filter(a=>a.title.toLowerCase().indexOf(i.toLowerCase())>=0)));var{popperOptions:t}=this.props;t=YI({placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}}},t),this.state={title:"",filteredOptions:[],keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,invalid:!1,popperOptions:t},this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handelInputFocus=this.handelInputFocus.bind(this),this.handleInputClick=this.handleInputClick.bind(this),this.updateInputValue=Qe(this.updateInputValue,ZI),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=re.createRef(),this.cbContainer=re.createRef(),this.menuContainer=re.createRef(),this.input=re.createRef()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}getValueAndValidate(e){if(!e)return this.setState({invalid:!1}),{value:e,isValid:!1};var{options:t}=this.props,r=t.filter(i=>i.title.toLowerCase()===e.toLowerCase());return r.length<1?(this.setState({invalid:!0}),{value:e,isValid:!1}):(this.setState({invalid:!1}),{value:r[0].value,isValid:!0})}updateInputValue(e){var{menuIsOpen:t}=this.state,{value:r,isValid:i}=this.getValueAndValidate(e);t&&this.processFilterChange(e),this.fireOnChange(r,i)}fireOnChange(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,{onChange:r}=this.props;r(e,t)}processFilterChange(e){var t,{options:r}=this.props,{menuIsOpen:i}=this.state,a=e?this.getCachedFilteredOptions(r,e):r,o=a.length===1&&a[0].title===e;if(this.setState({filteredOptions:a,keyboardOptionIndex:0}),o&&i){this.closeMenu();return}(t=this.popper.current)===null||t===void 0||t.scheduleUpdate()}resetValue(){this.setState({title:""}),this.fireOnChange("")}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var t,{filteredOptions:r,keyboardOptionIndex:i}=this.state,a=r[i];switch(e.key){case"Enter":case"ArrowRight":e.stopPropagation(),e.preventDefault(),a!=null&&(this.setState({title:a.title,invalid:!1}),this.fireOnChange(a.value)),this.closeMenu(),(t=this.input.current)===null||t===void 0||t.focus();break;case"ArrowUp":e.stopPropagation(),e.preventDefault(),this.navigateMenu(gn.MENU_NAVIGATION_DIRECTION.UP);break;case"ArrowDown":e.stopPropagation(),e.preventDefault(),this.navigateMenu(gn.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Tab":if(e.stopPropagation(),e.preventDefault(),e.shiftKey){this.navigateMenu(gn.MENU_NAVIGATION_DIRECTION.UP);break}this.navigateMenu(gn.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Escape":e.preventDefault(),e.stopPropagation(),this.closeMenu();break}}navigateMenu(e){var{filteredOptions:t,keyboardOptionIndex:r}=this.state,i=r;e===gn.MENU_NAVIGATION_DIRECTION.UP?r>0?(i=(i-1)%t.length,this.setState({keyboardOptionIndex:i})):r===0&&(i=t.length-1,this.setState({keyboardOptionIndex:i})):e===gn.MENU_NAVIGATION_DIRECTION.DOWN&&r<t.length&&(i=(i+1)%t.length,this.setState({keyboardOptionIndex:i})),this.scrollOptionIntoView(i)}handleInputKeyDown(e){var{onEnter:t}=this.props,{menuIsOpen:r}=this.state;r?this.handleMenuKeyDown(e):e.key==="Enter"?t():e.key==="Escape"?(this.resetValue(),e.preventDefault(),e.stopPropagation()):e.key==="ArrowRight"||e.key==="ArrowLeft"||e.key==="Tab"||e.key==="Shift"||this.openMenu()}handleInputChange(e){this.setState({title:e.target.value}),this.updateInputValue(e.target.value)}handleOptionClick(e){var t;this.setState({title:e.title,invalid:!1}),this.fireOnChange(e.value),this.closeMenu(),(t=this.input.current)===null||t===void 0||t.focus()}handelInputFocus(){var{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputClick(){var{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputBlur(e){var{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&this.popper.current!==null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuBlur(e){e.relatedTarget===this.input.current||e.relatedTarget instanceof Element&&this.popper.current!==null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuOpened(){var e;(e=this.input.current)===null||e===void 0||e.focus()}handleMenuExited(){var{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}openMenu(){var{title:e}=this.state;this.processFilterChange(e),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var t;(t=this.popper.current)===null||t===void 0||t.show()})}closeMenu(){var e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(this.setState({menuIsOpen:!1,keyboardOptionIndex:0}),t){var r;(r=this.input.current)===null||r===void 0||r.focus()}(e=this.popper.current)===null||e===void 0||e.hide()}scrollOptionIntoView(e){if(this.menuContainer.current){var t;(t=this.menuContainer.current.children.item(e))===null||t===void 0||t.scrollIntoView({behavior:"smooth",block:"nearest"})}}renderMenuElement(){var{inputWidth:e}=this.state;return u.jsx("div",{className:q("aci-options"),ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,style:{width:e},onBlur:this.handleMenuBlur,children:this.renderOptions()})}renderOptions(){var{noMatchText:e}=this.props,{title:t,filteredOptions:r}=this.state;return t&&r.length===0?u.jsx("div",{className:"no-match",children:e}):r.map((i,a)=>this.renderOption(i,a))}renderOption(e,t){var{keyboardOptionIndex:r}=this.state,i="option-".concat(t,"-").concat(e.value);return u.jsx("button",{type:"button",className:q("aci-option-btn",{"keyboard-active":r===t}),onClick:()=>this.handleOptionClick(e),onFocus:()=>this.setState({keyboardOptionIndex:t}),children:e.title},i)}render(){var{options:e,inputPlaceholder:t,disabled:r,className:i,defaultTitle:a,spellCheck:o,"data-testid":s}=this.props,{title:l,menuIsOpen:d,popperOptions:h,invalid:c}=this.state;return u.jsxs("div",{className:"aci-container",ref:this.cbContainer,children:[u.jsx("input",{value:l||a,className:q("form-control",i,"aci-input",{"is-invalid":c&&!d}),ref:this.input,onChange:this.handleInputChange,placeholder:t||e[0].title,disabled:r,onFocus:this.handelInputFocus,onClick:this.handleInputClick,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:o,"data-testid":s}),u.jsx(oa,{ref:this.popper,options:h,className:q("aci-options-popper interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})}}li(gn,"propTypes",{options:V.arrayOf(V.shape({title:V.string.isRequired,value:V.string.isRequired})).isRequired,popperOptions:V.shape({}),onChange:V.func,inputPlaceholder:V.string,disabled:V.bool,className:V.string,defaultTitle:V.string,spellCheck:V.bool,onEnter:V.func,noMatchText:V.string,"data-testid":V.string});li(gn,"defaultProps",{onChange(){},inputPlaceholder:"",disabled:!1,className:"",defaultTitle:"",popperOptions:null,spellCheck:!0,onEnter(){},noMatchText:"No matching items found","data-testid":void 0});li(gn,"MENU_NAVIGATION_DIRECTION",Qh);const JI=gn;function mv(n){var{className:e="",value:t,onChange:r,spellCheck:i=!1,placeholder:a="",disabled:o=!1,delimiter:s="",id:l="","data-testid":d}=n,[h,c]=p.useState(t),[v,m]=p.useState(!1),f=p.useRef(null);p.useEffect(function(){c(t)},[t]);function g(O){return O.trim().split(s).filter(R=>R).join(`
|
|
2
2
|
`.concat(s.trim()))}function b(O){return O.split(`
|
|
3
3
|
`).map(R=>R.trim()).join(" ")}function C(){if(f.current){f.current.style.height="0";var O=f.current.scrollHeight+(f.current.offsetHeight-f.current.clientHeight);O>0&&(f.current.style.height="".concat(O,"px"))}}function S(O){var R=O.target.value;v&&(s&&(R=g(R)),m(!1)),c(R),r(R)}function w(){f.current&&(s&&(c(g(h)),C()),f.current.scrollLeft=0)}function E(){f.current&&document.activeElement!==f.current&&f.current.focus()}function y(){s&&(c(b(h)),r(b(h)))}function T(){m(!0)}return p.useEffect(function(){C()},[h]),u.jsx("textarea",{ref:f,id:l,className:q(e,"auto-resize-textarea form-control"),placeholder:a,value:h,rows:1,onChange:S,onFocus:w,onMouseDown:E,onBlur:y,onPaste:T,spellCheck:i,disabled:o,"data-testid":d})}mv.propTypes={value:V.string.isRequired,onChange:V.func.isRequired,className:V.string,placeholder:V.string,spellCheck:V.bool,disabled:V.bool,delimiter:V.string,id:V.string,"data-testid":V.string};mv.defaultProps={className:"",id:"",placeholder:"",disabled:!1,spellCheck:!1,delimiter:"","data-testid":void 0};function al(n){var{children:e,className:t,style:r,"data-testid":i}=n;return u.jsx("div",{className:q("btn-group",t),style:r,role:"group","data-testid":i,children:e})}al.displayName="ButtonGroup";al.propTypes={children:V.node.isRequired,className:V.string,style:V.object,"data-testid":V.string};al.defaultProps={className:null,style:{},"data-testid":void 0};function eR(n){var{blockInteraction:e=!0,children:t,debounceMs:r,isOpen:i=!1}=n,{value:a}=il(i,r);return u.jsxs(u.Fragment,{children:[e&&i&&u.jsx("div",{className:"modal-backdrop",style:{backgroundColor:"transparent"},"data-testid":"debounced-modal-backdrop"}),re.cloneElement(t,{isOpen:i&&a})]})}function tR(n){var{className:e,icon:t,isOpen:r=!1,subtitle:i,title:a}=n;return u.jsx(jo,{isOpen:r,className:e,children:u.jsx($o,{children:u.jsxs("div",{className:"info-modal",children:[t!=null&&u.jsx("div",{className:"message-icon",children:u.jsx(oe,{icon:t})}),u.jsx("div",{className:"message-header",children:a}),i!=null&&u.jsx("div",{className:"message-content",children:i})]})})})}function nu(n){var{className:e="modal-footer",children:t,"data-testid":r}=n;return u.jsx("div",{className:e,"data-testid":r,children:t})}function aa(n){var{isOpen:e,headerText:t,bodyText:r,onCancel:i,onConfirm:a,onDiscard:o,onModalDisable:s,cancelButtonText:l="Cancel",confirmButtonText:d="Okay",discardButtonText:h="Discard",isConfirmDanger:c=!1,children:v,"data-testid":m}=n,f=p.useRef(null),g=p.useRef(null),b=p.useCallback(()=>{g.current!==null&&g.current.checked&&s&&s(),a()},[a,s]),C=p.useCallback(()=>{var w;(w=f.current)===null||w===void 0||w.focus()},[]),S="";return e&&(S=typeof r=="function"?r():r),u.jsxs(jo,{isOpen:e,onOpened:C,children:[u.jsx(Ys,{closeButton:!1,children:t}),u.jsx($o,{children:S}),u.jsxs(nu,{children:[s&&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":m!==void 0?"".concat(m,"-checkbox-confirm"):void 0}),u.jsx("label",{className:"custom-control-label",htmlFor:"move-confirmation-checkbox",children:"Don't ask me again"})]}),o&&u.jsx(z,{kind:"secondary",className:"mr-auto","data-dismiss":"modal",onClick:o,"data-testid":m!==void 0?"".concat(m,"-btn-discard"):void 0,children:h}),i&&u.jsx(z,{kind:"secondary","data-dismiss":"modal",onClick:i,"data-testid":m!==void 0?"".concat(m,"-btn-cancel"):void 0,children:l}),u.jsxs(al,{children:[u.jsx(z,{kind:c?"danger":"primary",onClick:b,ref:f,"data-testid":m!==void 0?"".concat(m,"-btn-confirm"):void 0,children:d}),v]})]})]})}aa.propTypes={isOpen:V.bool.isRequired,headerText:V.string.isRequired,bodyText:V.oneOfType([V.string,V.func]).isRequired,onCancel:V.func,onConfirm:V.func.isRequired,onDiscard:V.func,onModalDisable:V.func,cancelButtonText:V.string,confirmButtonText:V.string,discardButtonText:V.string,children:V.node,"data-testid":V.string};aa.defaultProps={children:void 0,cancelButtonText:"Cancel",confirmButtonText:"Okay",discardButtonText:"Discard",onCancel:void 0,onDiscard:void 0,onModalDisable:void 0,"data-testid":void 0};var iu=re.forwardRef((n,e)=>{var{children:t,className:r,disabled:i,onClick:a,style:o,id:s}=n;return u.jsx("button",{ref:e,type:"button",className:q("btn",r),onClick:a,style:o,disabled:i,id:s,children:t})});iu.displayName="Button";iu.propTypes={children:V.node,className:V.string,disabled:V.bool,onClick:V.func,style:V.shape({}),id:V.string};iu.defaultProps={children:null,className:"",disabled:!1,onClick:()=>null,style:{},id:""};const Zh=iu;function pf(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 bf(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?pf(Object(t),!0).forEach(function(r){rR(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):pf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function rR(n,e,t){return e=nR(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nR(n){var e=iR(n,"string");return typeof e=="symbol"?e:String(e)}function iR(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function aR(n){var{styleProps:e,selectedItemCount:t,onClearSelection:r}=n;return u.jsx(mP,bf(bf({UNSAFE_className:vv.spectrumActionBar},e),{},{isEmphasized:!0,selectedItemCount:t,onClearSelection:r}))}function au(n){var{className:e,isFlipped:t,children:r,"data-testid":i}=n,a=d=>{if(r.length!==2)throw new Error("CardFlip requires 2 children to function");return r[d]},o=p.useRef(null),s=p.useCallback(d=>{d.target===d.currentTarget&&document.body.classList.add("card-flip--is-flipping")},[]),l=p.useCallback(d=>{d.target===d.currentTarget&&document.body.classList.remove("card-flip--is-flipping")},[]);return p.useEffect(function(){if(!o.current)throw Error("ref undefined");o.current.addEventListener("transitionstart",s);var h=o.current;return function(){if(h!=null)return h.removeEventListener("transitionstart",s)}},[s]),u.jsxs("div",{className:q(e,{"card-flip--show-front":t,"card-flip--show-back":!t}),"data-testid":i,children:[u.jsx("div",{className:"card-flip--back",children:a(0)}),u.jsx("div",{ref:o,className:"card-flip--front",onTransitionEnd:l,children:a(1)})]})}var Cf=te.module("GlobalContextAction");class oR extends p.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),Cf.debug("Received context menu event at global action! Menu items are now: ",t.contextActions))}handleKeyDown(e){var{action:t}=this.props;if(!et.actionsDisabled&&t.shortcut!==void 0&&t.shortcut.matchesEvent(e)){var r;Cf.debug("Global hotkey matched!",e),(r=t.action)===null||r===void 0||r.call(t,e),e.preventDefault(),e.stopPropagation()}}render(){return null}}const sR=oR;class lR extends p.Component{render(){for(var{actions:e,"data-testid":t}=this.props,r=[],i=0;i<e.length;i+=1){var a=e[i],{shortcut:o}=a;if(a.title!=null||a.menuElement||o){var s=u.jsx(sR,{action:a,"data-testid":t},"".concat(a.title,".").concat(o==null?void 0:o.id));r.push(s)}}return r}}const dR=lR;function Ow(n,e,t){return e=uR(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uR(n){var e=hR(n,"string");return typeof e=="symbol"?e:String(e)}function hR(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var _l=te.module("ContextActions");class Dw extends p.Component{static triggerMenu(e,t,r,i){if(i.length!==0){var a=new MouseEvent("contextmenu",{clientX:t,clientY:r,bubbles:!0,cancelable:!0});a.contextActions=i,e.dispatchEvent(a)}}constructor(e){super(e),Ow(this,"container",void 0),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=re.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=>!fh(i)&&typeof i!="function"&&i.isGlobal),r=e.actions.filter(i=>!fh(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(c=>d.contains(c));if(h!==void 0)return _l.debug2('Contextmenu event ignored based on the target className "'.concat(h,'"')),{v:void 0};r=r.parentElement};r!=null;){var a=i();if(typeof a=="object")return a.v}if(et.isContextActionEvent(e)||(e.contextActions=[]),!!et.isContextActionEvent(e)){var{actions:o}=this.props;if(o!=null){var s=o;Array.isArray(s)&&(s=s.filter(l=>fh(l)||typeof l=="function"||l.isGlobal===void 0||!l.isGlobal)),e.contextActions=e.contextActions.concat(s)}_l.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(!et.actionsDisabled&&i.shortcut!=null&&i.shortcut.matchesEvent(e)){var a;_l.debug("Context hotkey matched!",e),(a=i.action)===null||a===void 0||a.call(i,e),e.stopPropagation(),e.preventDefault(),_l.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(dR,{actions:t})})}}Ow(Dw,"groups",{default:void 0,high:100,medium:5e3,low:1e4,global:1e5,edit:100});const le=Dw;function Iw(n,e,t){return e=cR(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function cR(n){var e=vR(n,"string");return typeof e=="symbol"?e:String(e)}function vR(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class xn extends p.Component{static handleEnter(e){var t=e;t.style.height="0"}static handleEntering(e){var t=e;t.style.height="".concat(xn.getHeight(t),"px")}static handleExiting(e){var t=e;t.style.height="0"}static handleExit(e){var t=e;t.style.height="".concat(xn.getHeight(t),"px")}static getHeight(e){var t=e.scrollWidth-e.clientWidth;return e.scrollHeight-t}constructor(e){super(e),this.handleEntered=this.handleEntered.bind(this)}handleEntered(e){var t=e;t.style.height="";var{autoFocusOnShow:r}=this.props;if(r!==void 0&&r){var i=t.querySelector("input, select, textarea");i!=null&&i.focus()}}render(){var{children:e,className:t,in:r,"data-testid":i}=this.props;return u.jsx(kt,{in:r,classNames:{enterActive:"collapsing",enterDone:"collapse show",exitActive:"collapsing",exitDone:"collapse"},onEnter:xn.handleEnter,onEntering:xn.handleEntering,onEntered:this.handleEntered,onExit:xn.handleExit,onExiting:xn.handleExiting,timeout:350,children:a=>u.jsx("div",{className:q({collapse:a==="exited"},t),"data-testid":i,children:e})})}}Iw(xn,"propTypes",{className:V.string,in:V.bool.isRequired,children:V.node.isRequired,autoFocusOnShow:V.bool,"data-testid":V.string});Iw(xn,"defaultProps",{className:"",autoFocusOnShow:!1,"data-testid":void 0});const mR=xn;var ou=re.forwardRef((n,e)=>{var{checked:t=!1,children:r,className:i,disabled:a,inputClassName:o,isInvalid:s,labelClassName:l,name:d,onChange:h,"data-testid":c}=n,[v]=p.useState(Me()),m=ru(e);p.useEffect(function(){m.current&&(m.current.indeterminate=t===null)},[m,t]);var f=p.useCallback(g=>{m.current&&(m.current.indeterminate=t===null),h&&h(g)},[m,t,h]);return u.jsxs("div",{className:q("custom-control custom-checkbox",i),children:[u.jsx("input",{type:"checkbox",ref:m,checked:t??!1,className:q("custom-control-input",o,{"is-invalid":s}),disabled:a,id:v,name:d,onChange:f,"data-testid":c}),u.jsx("label",{className:q("custom-control-label",l),htmlFor:v,children:r})]})});ou.displayName="Checkbox";ou.propTypes={checked:(n,e)=>{var{[e]:t}=n;return t!==null&&typeof t!="boolean"?new Error("Checked must be a boolean or null for indeterminate"):null},children:V.node.isRequired,className:V.string,disabled:V.bool,inputClassName:V.string,isInvalid:V.bool,labelClassName:V.string,name:V.string,onChange:V.func,"data-testid":V.string};ou.defaultProps={checked:!1,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const Fr=ou;function Bi(n,e,t){return e=fR(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function fR(n){var e=gR(n,"string");return typeof e=="symbol"?e:String(e)}function gR(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Sf=te.module("Shortcut"),ue;(function(n){n.CTRL="MODIFIER_CTRL",n.CMD="MODIFIER_CMD",n.ALT="MODIFIER_ALT",n.OPTION="MODIFIER_OPTION",n.SHIFT="MODIFIER_SHIFT"})(ue||(ue={}));var de;(function(n){n.A="A",n.B="B",n.C="C",n.D="D",n.E="E",n.F="F",n.G="G",n.H="H",n.I="I",n.J="J",n.K="K",n.L="L",n.M="M",n.N="N",n.O="O",n.P="P",n.Q="Q",n.R="R",n.S="S",n.T="T",n.U="U",n.V="V",n.W="W",n.X="X",n.Y="Y",n.Z="Z",n.ZERO="0",n.ONE="1",n.TWO="2",n.THREE="3",n.FOUR="4",n.FIVE="5",n.SIX="6",n.SEVEN="7",n.EIGHT="8",n.NINE="9",n.BACKSPACE="Backspace",n.ESCAPE="Escape",n.ENTER="Enter",n.DELETE="Delete",n.SLASH="/",n.QUESTION_MARK="?",n.BACKSLASH="\\",n.PIPE="|",n.MINUS="-",n.UNDERSCORE="_",n.EQUALS="=",n.PLUS="+",n.BACKTICK="`",n.TILDE="~",n.COMMA=",",n.LEFT_CHEVRON="<",n.PERIOD=".",n.RIGHT_CHEVRON=">",n.SEMICOLON=";",n.COLON=":",n.SINGLE_QUOTE="'",n.DOUBLE_QUOTE='"',n.LEFT_BRACKET="[",n.RIGHT_BRACKET="]",n.LEFT_CURLY="{",n.RIGHT_CURLY="}",n.F1="F1",n.F2="F2",n.F3="F3",n.F4="F4",n.F5="F5",n.F6="F6",n.F7="F7",n.F8="F8",n.F9="F9",n.F10="F10",n.F11="F11",n.F12="F12"})(de||(de={}));var pR=new Set([de.ENTER,de.DELETE,de.F1,de.F2,de.F3,de.F4,de.F5,de.F6,de.F7,de.F8,de.F9,de.F10,de.F11,de.F12]);class ht extends zc{static isAllowedKey(e){return Object.values(de).includes(e)}static isValidKeyState(e){var{keyValue:t}=e;if(t===null)return!0;if(!ht.isMacPlatform&&e.metaKey||!ht.isAllowedKey(t))return!1;var r=!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey;return!r||pR.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 ue.CTRL:t.ctrlKey=!0;break;case ue.ALT:case ue.OPTION:t.altKey=!0;break;case ue.CMD:t.metaKey=!0;break;case ue.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="":!ht.isAllowedKey(t)&&ht.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===de.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 de.ENTER:t+="⏎";break;case de.ESCAPE:t+="⎋";break;case de.BACKSPACE:t+="⌫";break;case de.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?"":ht.isMacPlatform?ht.getMacDisplayText(e):ht.getWindowsDisplayText(e)}constructor(e){var{id:t,shortcut:r,macShortcut:i,isEditable:a=!0,name:o,tooltip:s}=e;super(),Bi(this,"id",void 0),Bi(this,"name",void 0),Bi(this,"tooltip",void 0),Bi(this,"isEditable",void 0),Bi(this,"defaultKeyState",void 0),Bi(this,"keyState",void 0),this.id=t,this.name=o,this.tooltip=s,this.isEditable=a;var l=ht.isMacPlatform,d=l?i:r;this.defaultKeyState=ht.createKeyState(d),this.keyState=this.defaultKeyState}getDisplayText(){return ht.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){ht.isValidKeyState(e)?(Sf.debug2("Shortcut ".concat(this.id," updated to ").concat(JSON.stringify(e))),this.keyState=e,this.dispatchEvent(new Xe("onUpdate",{detail:this}))):Sf.debug2("Shortcut ".concat(this.id," tried to update to invalid keyState ").concat(JSON.stringify(e)))}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return ht.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState(ht.NULL_KEY_STATE)}isNull(){return ht.doKeyStatesMatch(this.keyState,ht.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return ht.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState(ht.getKeyStateFromEvent(e))}}Bi(ht,"NULL_KEY_STATE",{metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null});Bi(ht,"isMacPlatform",et.isMacPlatform());function wf(n,e,t){return e=bR(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function bR(n){var e=CR(n,"string");return typeof e=="symbol"?e:String(e)}function CR(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var yf=te.module("ShortcutRegistry");class SR extends zc{constructor(){super(...arguments),wf(this,"shortcutMap",new Map),wf(this,"shortcutsByCategory",new Map)}createAndAdd(e){var t=new ht(e);return this.add(t)}add(e){var t=this.shortcutMap.get(e.id);if(t)return yf.warn("Skipping attempt to add duplicate shortcut ID to registry: ".concat(e.id)),t;yf.debug2("Adding shortcut to registry: ".concat(e.id)),e.addEventListener("onUpdate",a=>{var{detail:o}=a;return this.dispatchEvent(new Xe("onUpdate",{detail:o}))});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 wR=Object.freeze(new SR);const Le=wR;var yR={COPY:Le.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[ue.CTRL,de.C],macShortcut:[ue.CMD,de.C],isEditable:!1}),PASTE:Le.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[ue.CTRL,de.V],macShortcut:[ue.CMD,de.V],isEditable:!1}),SAVE:Le.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[ue.CTRL,de.S],macShortcut:[ue.CMD,de.S],isEditable:!1}),SELECT_ALL:Le.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[ue.CTRL,de.A],macShortcut:[ue.CMD,de.A],isEditable:!1}),LINKER:Le.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[ue.CTRL,de.L],macShortcut:[ue.CMD,de.L]}),LINKER_CLOSE:Le.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[de.ESCAPE],macShortcut:[de.ESCAPE],isEditable:!1}),COPY_VERSION_INFO:Le.createAndAdd({id:"GLOBAL.COPY_VERSION_INFO",name:"Copy Version Info",shortcut:[ue.CTRL,ue.ALT,de.I],macShortcut:[ue.CMD,ue.SHIFT,de.I],isEditable:!0}),NEXT:Le.createAndAdd({id:"GLOBAL.NEXT",name:"Next",shortcut:[de.ENTER],macShortcut:[de.ENTER],isEditable:!1}),PREVIOUS:Le.createAndAdd({id:"GLOBAL.PREVIOUS",name:"Previous",shortcut:[ue.SHIFT,de.ENTER],macShortcut:[ue.SHIFT,de.ENTER],isEditable:!1})};const Cn=yR;function Jh(n,e,t){return e=ER(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ER(n){var e=TR(n,"string");return typeof e=="symbol"?e:String(e)}function TR(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Rw extends p.PureComponent{constructor(e){super(e),Jh(this,"inputField",void 0),Jh(this,"searchChangeSelection",void 0),this.inputField=re.createRef(),this.searchChangeSelection=re.createRef()}componentDidMount(){this.setInputPaddingRight()}componentDidUpdate(){this.setInputPaddingRight()}focus(){var e;(e=this.inputField.current)===null||e===void 0||e.focus()}setInputPaddingRight(){var e=this.inputField.current,t=this.searchChangeSelection.current;if(e&&t){var r=t.getBoundingClientRect().width;e.style.paddingRight="".concat(r,"px")}}render(){var{value:e,placeholder:t,onBlur:r,onChange:i,className:a,disabled:o,matchCount:s,id:l,onKeyDown:d,"data-testid":h,cursor:c}=this.props,v,m=[{action:()=>c==null?void 0:c.next("forward"),shortcut:Cn.NEXT},{action:()=>c==null?void 0:c.next("back"),shortcut:Cn.PREVIOUS}];return c&&s>1?v=u.jsxs(u.Fragment,{children:[u.jsx(z,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{c.next("back")},icon:DS,tooltip:"Previous match (".concat(Cn.PREVIOUS.getDisplayText(),")")}),u.jsxs("span",{className:"search-change-text",children:[c.index!==void 0&&"".concat(c.index+1," of "),s]}),u.jsx(z,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{c.next("forward")},icon:XP,tooltip:"Next match (".concat(Cn.NEXT.getDisplayText(),")")})]}):v=s>0&&u.jsx("span",{className:"search-match",children:s}),u.jsxs("div",{className:q("search-group",a),children:[u.jsx("input",{type:"search",value:e,onBlur:r,onChange:i,onKeyDown:d,className:"form-control",disabled:o,placeholder:t,ref:this.inputField,id:l,"data-testid":h}),s!=null?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"search-change-selection",ref:this.searchChangeSelection,children:v}),u.jsx(le,{actions:m})]}):u.jsx("span",{className:"search-icon",children:u.jsx(oe,{icon:IS})})]})}}Jh(Rw,"defaultProps",{placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0,cursor:void 0});const pi=Rw;function Ef(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?Ef(Object(t),!0).forEach(function(r){Qr(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ef(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Qr(n,e,t){return e=OR(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function OR(n){var e=DR(n,"string");return typeof e=="symbol"?e:String(e)}function DR(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ec;(function(n){n.UP="UP",n.DOWN="DOWN"})(ec||(ec={}));class kn extends p.Component{constructor(e){super(e),Qr(this,"popper",void 0),Qr(this,"cbContainer",void 0),Qr(this,"toggleButton",void 0),Qr(this,"menuContainer",void 0),Qr(this,"input",void 0),Qr(this,"searchInput",void 0),Qr(this,"getCachedFilteredOptions",Ce((t,r)=>t.filter(i=>i.title.toLowerCase().indexOf(r.toLowerCase())>=0||i.value.toLowerCase().indexOf(r.toLowerCase())>=0))),this.state={value:"",filter:"",filteredOptions:e.options,keyboardOptionIndex:-1,menuIsOpen:!1,inputWidth:100},this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handleFilterChange=this.handleFilterChange.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleOptionFocus=this.handleOptionFocus.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=re.createRef(),this.cbContainer=re.createRef(),this.toggleButton=re.createRef(),this.menuContainer=re.createRef(),this.input=re.createRef(),this.searchInput=re.createRef()}componentDidUpdate(){var{menuIsOpen:e,keyboardOptionIndex:t}=this.state;e&&t>=0&&this.scrollOptionIntoView()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.input.current)===null||e===void 0||e.focus()}resetValue(){this.setState({value:""})}updateInputValue(e){var{onChange:t}=this.props;this.setState({value:e}),t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var t,r,{filter:i,filteredOptions:a,keyboardOptionIndex:o}=this.state,{options:s}=this.props,l=i?a:s;switch(e.key){case"Enter":((t=l[o])===null||t===void 0?void 0:t.value)!=null&&this.updateInputValue(l[o].value),this.closeMenu(),(r=this.input.current)===null||r===void 0||r.focus(),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(kn.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(kn.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":i!==""?(this.setState({filter:""}),e.stopPropagation()):this.closeMenu();break;case"Tab":!e.shiftKey&&o===l.length-1&&this.closeMenu();break}}handleMenuNavigation(e){var{filter:t,filteredOptions:r,keyboardOptionIndex:i}=this.state,{options:a}=this.props,o=t?r:a,s=o.length,l=0;switch(e){case kn.MENU_NAVIGATION_DIRECTION.UP:l=-1;break;case kn.MENU_NAVIGATION_DIRECTION.DOWN:l=1;break}l!==0&&this.setState({keyboardOptionIndex:(i+l+s)%s})}handleInputKeyDown(e){var{onEnter:t}=this.props,{menuIsOpen:r}=this.state;e.key==="ArrowDown"||e.key==="ArrowUp"?r||this.openMenu():e.key==="Enter"&&t()}handleInputChange(e){this.updateInputValue(e.target.value)}handleOptionClick(e){var t,r=Number(e.currentTarget.value),{filter:i,filteredOptions:a}=this.state,{options:o}=this.props,s=i?a:o;this.updateInputValue(s[r].value),this.closeMenu(),(t=this.input.current)===null||t===void 0||t.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleFilterChange(e){var t,{options:r}=this.props,i=e.target.value,a=this.getCachedFilteredOptions(r,i);this.setState({filter:i,filteredOptions:a,keyboardOptionIndex:0}),(t=this.popper.current)===null||t===void 0||t.scheduleUpdate()}handleMenuBlur(e){e.relatedTarget instanceof Element&&this.popper.current!=null&&this.popper.current.element.contains(e.relatedTarget)||e.relatedTarget===this.toggleButton.current||this.closeMenu(!1)}handleInputBlur(e){var{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&this.popper.current!=null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuOpened(){var e;this.scrollOptionIntoView(),(e=this.searchInput.current)===null||e===void 0||e.focus()}handleMenuExited(){var{menuIsOpen:e}=this.state;if(e){var t;this.setState({menuIsOpen:!1}),(t=this.popper.current)===null||t===void 0||t.hide()}this.setState({filter:""})}toggleMenu(e){var{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var e;(e=this.popper.current)===null||e===void 0||e.show()})}closeMenu(){var e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(this.setState({menuIsOpen:!1}),t){var r;(r=this.input.current)===null||r===void 0||r.focus()}(e=this.popper.current)===null||e===void 0||e.hide()}updateKeyboardIndex(){var{value:e,filter:t,filteredOptions:r}=this.state,{options:i}=this.props,a=t?r:i,o=a.findIndex(s=>s.value===e);this.setState({keyboardOptionIndex:o})}scrollOptionIntoView(){var e,t=(e=this.menuContainer.current)===null||e===void 0?void 0:e.querySelector(".cb-option-btn.keyboard-active");t instanceof HTMLElement&&t.scrollIntoView({block:"nearest",inline:"nearest"})}renderMenuElement(){var{searchPlaceholder:e}=this.props,{filter:t,inputWidth:r}=this.state;return u.jsxs("div",{className:"cb-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:i=>{i.stopPropagation()},style:{width:r},onBlur:this.handleMenuBlur,children:[u.jsx("div",{className:"cb-search-input-container",children:u.jsx(pi,{value:t,ref:this.searchInput,onChange:this.handleFilterChange,className:"cb-search-input",placeholder:e})}),u.jsx("div",{className:"cb-options-container",children:u.jsx("div",{className:"cb-options",children:this.renderOptions()})})]})}renderOptions(){var{options:e}=this.props,{keyboardOptionIndex:t,filter:r,filteredOptions:i}=this.state,a=r?i:e;return a.map((o,s)=>{var l="option-".concat(s,"-").concat(o.value);return u.jsx("button",{type:"button",value:s,className:q("cb-option-btn",{"keyboard-active":t===s}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:o.title},l)})}render(){var{options:e,inputPlaceholder:t,disabled:r,className:i,defaultValue:a,spellCheck:o,"data-testid":s}=this.props,{value:l}=this.state,{popperOptions:d}=this.props;return d=PR({placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}}},d),u.jsxs("div",{className:"input-group cb-container",ref:this.cbContainer,children:[u.jsx("input",{value:l||a,className:q("form-control",i,"cb-input"),ref:this.input,onChange:this.handleInputChange,placeholder:t||(e[0]!=null?e[0].title:void 0),disabled:r,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:o,"data-testid":s!==void 0?"".concat(s,"-input"):void 0}),u.jsx("div",{className:"input-group-append cb-dropdown",children:u.jsxs("button",{tabIndex:-1,type:"button",className:"btn cb-btn form-control",ref:this.toggleButton,onClick:this.toggleMenu,onKeyDown:this.handleInputKeyDown,disabled:r,"data-testid":s!==void 0?"".concat(s,"-btn"):void 0,children:[u.jsx("span",{className:"cb-caret"}),u.jsx(oa,{ref:this.popper,options:d,className:q("combobox interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})})]})}}Qr(kn,"MENU_NAVIGATION_DIRECTION",ec);Qr(kn,"DROP_DOWN_MENU_HEIGHT",200);Qr(kn,"propTypes",{options:V.arrayOf(V.shape({title:V.string.isRequired,value:V.string.isRequired})).isRequired,popperOptions:V.shape({title:V.string.isRequired,value:V.string.isRequired}),onChange:V.func,inputPlaceholder:V.string,searchPlaceholder:V.string,disabled:V.bool,className:V.string,defaultValue:V.string,spellCheck:V.bool,onEnter:V.func,"data-testid":V.string});Qr(kn,"defaultProps",{onChange(){},inputPlaceholder:"",searchPlaceholder:"Search",disabled:!1,className:"",defaultValue:"",popperOptions:null,spellCheck:!0,onEnter(){},"data-testid":void 0});const fv=kn;function su(n,e,t){return n.substring(0,e)+t+n.substring(e+1)}function _w(n,e,t){return n.length<t?"".concat(n).concat(e.substring(n.length,t)):n}function tc(n,e){for(var{length:t}=n,r=n.length-1;r>=0&&e[r]===n[r];r-=1)t=r;return n.substring(0,t)}function Tf(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 IR(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Tf(Object(t),!0).forEach(function(r){RR(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Tf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function RR(n,e,t){return e=_R(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _R(n){var e=xR(n,"string");return typeof e=="symbol"?e:String(e)}function xR(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ln=te.module("MaskedInput"),Ya={FORWARD:"forward",BACKWARD:"backward",NONE:"none"},xl=" ",xw=re.forwardRef((n,e)=>{var{className:t,example:r,getNextSegmentValue:i=(D,_,x)=>x,getPreferredReplacementString:a=su,onChange:o=()=>!1,onSelect:s=()=>!1,onSubmit:l,pattern:d,placeholder:h,selection:c,value:v,onFocus:m=()=>!1,onBlur:f=()=>!1,"data-testid":g}=n,b=ru(e),C=p.useMemo(()=>Array.isArray(r)?r:[r],[r]),S=p.useMemo(()=>C[0].replace(/[a-zA-Z0-9]/g,xl),[C]);p.useEffect(function(){if(c!=null){var _;ln.debug("setting selection...",c);var{selectionStart:x,selectionEnd:L,selectionDirection:H}=c;(_=b.current)===null||_===void 0||_.setSelectionRange(x,L,H),ln.debug("selection set!")}},[c,b]);var w=p.useCallback(D=>{for(var _=D,x=D,L=C.length>0?C[0]:v,H=_-1;H>=0&&/[a-zA-Z0-9]/g.test(L.charAt(H));H-=1)_=H;for(var G=x;G<L.length&&/[a-zA-Z0-9]/g.test(L.charAt(G));G+=1)x=G+1;var X=_===x?Ya.NONE:Ya.BACKWARD;return{selectionStart:_,selectionEnd:x,selectionDirection:X}},[C,v]);function E(D,_){for(var x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:D.length,L="",H=0;H<x;H+=1)D.charAt(H)!==xl?L=L.concat(D[H]):L=L.concat(_[H]);return L=L.concat(_.substring(x)),L}function y(D){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:D.length,x=new RegExp("^".concat(d,"$"));if(x.test(D))return!0;for(var L=0;L<C.length;L+=1){var H=E(D,C[L],_);if(x.test(H))return!0}return!1}function T(D){var _=w(D),x=_.selectionEnd+1;return x>=v.length?_:w(x)}function O(D){var _=w(D),x=_.selectionStart-1;return x<=0?_:w(x)}function R(D,_){var x=w(D),L=v.substring(x.selectionStart,x.selectionEnd),H=i(x,_,L,v),G=v.substring(0,x.selectionStart)+H+v.substring(x.selectionEnd);y(G,x.selectionEnd)&&(o(G),s(x))}var P=p.useCallback(D=>{var{selectionStart:_=0,selectionEnd:x=0,selectionDirection:L="none"}=D.target;if(_===null||x===null||L===null){ln.error("Selection attempted on non-text input element",D.target);return}if(ln.debug2("handleSelect",_,x,L),!(c!=null&&_===c.selectionStart&&x===c.selectionEnd)){if(c!=null&&_===v.length&&x===v.length&&D.nativeEvent.type!=="mouseup"){s(IR({},c));return}if(_===x){var H=w(_);ln.debug("Selection segment from ",_,x,"=>",H),s(H)}else s({selectionStart:_,selectionEnd:x,selectionDirection:L})}},[w,s,c,v]),M=p.useCallback(D=>{var _;if(b.current){ln.debug("handleSelectCapture",D);var x=(_=b.current.selectionStart)!==null&&_!==void 0?_:0;x===v.length&&c!=null&&x!==c.selectionStart&&(D.preventDefault(),D.stopPropagation())}},[b,c,v]);function F(D){if(D.preventDefault(),D.stopPropagation(),!!b.current){var{key:_}=D,{selectionStart:x=0,selectionEnd:L=0}=b.current;if(x===null||L===null){ln.error("Selection arrow nvaigation attempted on non-text input element",D.target);return}_==="ArrowLeft"?s(O(x)):_==="ArrowRight"?s(T(L)):_==="ArrowUp"?R(x,-1):_==="ArrowDown"&&R(x,1)}}function N(D){if(b.current){ln.debug("handleKeyDown",D);var{key:_}=D,{selectionStart:x=0,selectionEnd:L=0}=b.current;if(x===null||L===null){ln.error("Selection key event on non-text input element",D.target);return}if(_==="Enter"){l==null||l(D);return}if(_.startsWith("Arrow")){F(D);return}if(_==="Delete"||_==="Backspace"){if(D.preventDefault(),D.stopPropagation(),L>=tc(v,S).length){var H=v.substring(0,x===L?x-1:x),G=tc(H,S);G!==v&&(o(G),s({selectionStart:G.length,selectionEnd:G.length,selectionDirection:Ya.NONE}));return}if(x!==L){var X=v.substring(0,x)+v.substring(x,L).replace(/[a-zA-Z0-9]/g,xl)+v.substring(L);ln.debug("Range ",x,L,"deleted, setting value",X),o(X),s({selectionStart:x,selectionEnd:x,selectionDirection:Ya.NONE})}else if(x>0)for(var W=x-1;W>=0;W-=1){var A=v.substring(0,W)+v.substring(W,x).replace(/[a-zA-Z0-9]/g,xl)+v.substring(x);if(A!==v){o(A),s({selectionStart:W,selectionEnd:W,selectionDirection:Ya.NONE});return}}return}if(!(D.altKey||D.metaKey||D.ctrlKey||_.length>1)){D.preventDefault(),D.stopPropagation();for(var I=Array.from(new Set([_,_.toUpperCase(),_.toLowerCase()])),k=0;k<I.length;k+=1)for(var j=I[k],Y=/[a-zA-Z0-9]/g.test(j)?C[0].length-1:x,ee=x;ee<=Y;ee+=1){var K=_w(v,C[0],ee+1),ie=a(K,ee,j,x,L);if(y(ie,ee+1)){var ne=w(ee),se=ee+1,pe={selectionStart:se,selectionEnd:se,selectionDirection:Ya.NONE};if(se>=ne.selectionEnd){var Fe=T(ee);Fe.selectionStart!==ne.selectionStart&&(pe=Fe)}ln.debug("handleKeyDown",_,"=>",ie,pe),o(ie),s(pe);return}}}}}return u.jsx("input",{ref:b,className:q("form-control masked-input",t),type:"text",pattern:d,placeholder:h,value:v,onChange:()=>{},onKeyDown:N,onSelect:P,onSelectCapture:M,onFocus:m,onBlur:f,"data-testid":g})});xw.defaultProps={className:"",placeholder:void 0,onChange(){},onSelect(){},getNextSegmentValue:(n,e,t)=>t,getPreferredReplacementString:su,selection:void 0,onFocus(){},onBlur(){},"data-testid":void 0};const lu=xw;var NR=te.module("TimeInput"),MR="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]",FR=["00:00:00","12:34:56","23:59:59"];function Pf(n){return n!=null?"".concat(n.substring(0,8).replace(/\u2007/g,"0")).concat("00:00:00".substring(n.length)):n}var Nw=re.forwardRef((n,e)=>{var{allowValueWrapping:t=!0,className:r="",onChange:i=()=>!1,value:a=0,onFocus:o=()=>!1,onBlur:s=()=>!1,onSelect:l=()=>!1,"data-testid":d}=n,[h,c]=p.useState(_a.formatTime(a)),v=p.useRef(a),[m,f]=p.useState(),g=p.useRef(null);p.useImperativeHandle(e,()=>({focus:()=>{var y;(y=g.current)===null||y===void 0||y.focus()},setSelection:y=>{var T;(T=g.current)===null||T===void 0||T.focus(),f(y)}}),[]),p.useEffect(function(){v.current!==a&&(c(_a.formatTime(a)),v.current=a)},[v,a]);function b(y,T,O){var R=y.selectionStart===0?24:60,P=parseInt(O,10)-T;return Number.isNaN(P)?P=0:t?P=(P%R+R)%R:P=Math.min(Math.max(0,P),R-1),"".concat(P).padStart(2,"0")}function C(y,T,O,R,P){return R===0&&P===2&&T===1&&parseInt(O,10)>1?"0".concat(O).concat(y.substring(2)):su(y,T,O)}var S=p.useCallback(y=>{NR.debug("handleChange",y),c(y),v.current=_a.parseTime(Pf(y)),i(v.current)},[i]),w=p.useCallback(()=>{var y=Pf(h);y!==h&&c(y),s()},[h,s]),E=p.useCallback(y=>{f(y),l(y)},[l]);return u.jsx(lu,{ref:g,className:r,example:FR,getNextSegmentValue:b,getPreferredReplacementString:C,onChange:S,onSelect:E,pattern:MR,selection:m,value:h,onFocus:o,onBlur:w,"data-testid":d})});Nw.defaultProps={allowValueWrapping:!0,className:"",onChange:()=>!1,onSelect:()=>!1,value:0,onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};const yd=Nw;function Of(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 AR(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Of(Object(t),!0).forEach(function(r){Rs(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Of(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Rs(n,e,t){return e=LR(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function LR(n){var e=kR(n,"string");return typeof e=="symbol"?e:String(e)}function kR(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}let Mw=class extends p.PureComponent{constructor(e){var t;super(e),Rs(this,"container",void 0),Rs(this,"oldFocus",void 0),Rs(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=re.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=et.getMenuItems(e,!1);t.length>0&&this.setState(r=>({menuItems:et.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}if(e.key==="Escape")i=null;else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey===!0){var a;i=et.getNextMenuItem((a=i)!==null&&a!==void 0?a:0,-1,t)}else if(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1){var o;i=et.getNextMenuItem((o=i)!==null&&o!==void 0?o: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:a}=this.state,o=0;o<i.length;o+=1){var s=i[o];o>0&&s.group!==i[o-1].group&&e.push(u.jsx("hr",{},"".concat(o,".separator")));var l=u.jsx(US,{isKeyboardSelected:r===o,isMouseSelected:a===o,menuItem:s,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},o);e.push(l)}var{menuStyle:d}=this.props;return u.jsx("div",{className:"context-menu-container",style:AR({},d),ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":t,children:e})}};Rs(Mw,"defaultProps",{closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});const jR=Mw;function Df(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 If(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Df(Object(t),!0).forEach(function(r){uo(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Df(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function uo(n,e,t){return e=$R(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function $R(n){var e=HR(n,"string");return typeof e=="symbol"?e:String(e)}function HR(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Fw extends p.PureComponent{constructor(e){super(e),uo(this,"container",void 0),uo(this,"parent",void 0),uo(this,"popper",void 0),uo(this,"isOpen",void 0),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=re.createRef(),this.parent=null,this.popper=re.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:a}=this.props,{options:o,popperOptions:s}=this.props;return s=If({placement:"bottom"},s),o=If({separateKeyboardMouse:!0},o),u.jsx("div",{className:"menu-actions-listener",ref:this.container,"data-testid":i,children:u.jsx(oa,{ref:this.popper,options:s,className:q("menu-popper",r),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:u.jsx(jR,{actions:e,closeMenu:this.handleCloseMenu,onMenuOpened:t,options:o,menuStyle:a})})})}}uo(Fw,"defaultProps",{isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0});const ci=Fw;function Rf(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 UR(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Rf(Object(t),!0).forEach(function(r){Qi(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Rf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Qi(n,e,t){return e=BR(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function BR(n){var e=VR(n,"string");return typeof e=="symbol"?e:String(e)}function VR(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var _f=-1,rc;(function(n){n.UP="UP",n.DOWN="DOWN"})(rc||(rc={}));class Or extends p.Component{constructor(e){super(e),Qi(this,"csContainer",void 0),Qi(this,"menuContainer",void 0),Qi(this,"button",void 0),Qi(this,"input",void 0);var{value:t,valueToTime:r}=e;this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleOptionFocus=this.handleOptionFocus.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.handleCustomInput=this.handleCustomInput.bind(this),this.csContainer=re.createRef(),this.menuContainer=re.createRef(),this.button=re.createRef(),this.input=re.createRef(),this.state={keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,customTime:r(t),inputFocused:!1}}getSelectedText(){var{options:e,value:t,placeholder:r}=this.props,{customTime:i}=this.state;if(t===null)return r;for(var a=0;a<e.length;a+=1){var o=e[a];if(o.value===t)return o.title}return _a.formatTime(i)}setInputWidth(){this.csContainer.current&&this.setState({inputWidth:this.csContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.button.current)===null||e===void 0||e.focus()}updateInputValue(e){var{onChange:t}=this.props;t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var t,{keyboardOptionIndex:r,inputFocused:i}=this.state,{options:a}=this.props;switch(e.key){case"Enter":case" ":i?this.updateFromCustom():this.updateInputValue(a[r].value),this.closeMenu(),(t=this.button.current)===null||t===void 0||t.focus(),e.stopPropagation(),e.preventDefault();break;case"Tab":e.shiftKey?this.handleMenuNavigation(Or.MENU_NAVIGATION_DIRECTION.UP):this.handleMenuNavigation(Or.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(Or.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(Or.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":this.closeMenu();break}}handleMenuNavigation(e){var{keyboardOptionIndex:t,inputFocused:r}=this.state,{options:i}=this.props,a=i.length,o=t;switch(e){case Or.MENU_NAVIGATION_DIRECTION.UP:if(!r&&t===0){this.focusInput();break}else r&&this.focusOption(t);t>0&&!r?(o=(o-1)%a,this.setState({keyboardOptionIndex:o})):t===0&&(o=a-1,this.setState({keyboardOptionIndex:o})),this.scrollOptionIntoView(o);break;case Or.MENU_NAVIGATION_DIRECTION.DOWN:if(!r&&t===a-1){this.focusInput();break}else r&&this.focusOption(t);t<a&&!(r&&t===0)&&(o=(o+1)%a,this.setState({keyboardOptionIndex:o})),this.scrollOptionIntoView(o);break}}handleOptionClick(e){var t=Number(e.currentTarget.value),{options:r,timeToValue:i}=this.props,{customTime:a}=this.state;if(t===_f){var o=i(a);this.updateAndClose(o)}else this.updateAndClose(r[t].value)}updateAndClose(e){var t;this.updateInputValue(e),this.closeMenu(),(t=this.button.current)===null||t===void 0||t.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleMenuOpened(){var e,{options:t,value:r}=this.props,{keyboardOptionIndex:i}=this.state;this.scrollOptionIntoView(i);var a=(e=this.menuContainer.current)===null||e===void 0?void 0:e.querySelector(".cs-option-btn.keyboard-active");if(a instanceof HTMLElement&&a.focus(),r!==null){var o=t.map(s=>s.value).indexOf(r);o<0&&this.focusInput()}}focusInput(){var e;(e=this.input.current)===null||e===void 0||e.focus()}focusOption(e){var t,r=(t=this.menuContainer.current)===null||t===void 0?void 0:t.querySelector(".cs-options");if(r&&r.children!=null){var i=r.children.item(e);i instanceof HTMLElement&&i.focus()}}handleMenuExited(){var{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}handleCustomInput(e){var{timeToValue:t}=this.props,r=t(e);this.updateInputValue(r),this.setState({customTime:e})}updateFromCustom(){var{timeToValue:e}=this.props,{customTime:t}=this.state,r=e(t);this.updateInputValue(r)}toggleMenu(e){var{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0})}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(this.setState({menuIsOpen:!1}),e){var t;(t=this.button.current)===null||t===void 0||t.focus()}}updateKeyboardIndex(){var{options:e,value:t}=this.props;if(t!==null){var r=e.map(i=>i.value).indexOf(t);r>0&&this.setState({keyboardOptionIndex:r})}}scrollOptionIntoView(e){var t,r=(t=this.menuContainer.current)===null||t===void 0?void 0:t.querySelector(".cs-options");if(r&&r.children!=null){var i=r.children.item(e);i instanceof HTMLElement&&i.offsetTop>Or.DROP_DOWN_MENU_HEIGHT?r.scrollTop=i.offsetTop-Or.DROP_DOWN_MENU_HEIGHT:(i instanceof HTMLElement&&i.offsetTop<0||e===0)&&(r.scrollTop=0)}}renderMenuElement(){var{inputWidth:e}=this.state;return u.jsx("div",{className:"cs-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:t=>{t.stopPropagation()},style:{width:e},children:u.jsx("div",{className:"cs-options-container",children:u.jsx("div",{className:"cs-options",children:this.renderOptions()})})})}renderOptions(){for(var{options:e,value:t,icon:r,customText:i}=this.props,{keyboardOptionIndex:a,customTime:o,inputFocused:s}=this.state,l=!1,d=[],h=0;h<e.length;h+=1){var c=e[h],v="option-".concat(h,"-").concat(c.value);l=l||c.value===t,d.push(u.jsxs("button",{type:"button",value:h,className:q("cs-option-btn",{"keyboard-active":a===h&&!s}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[c.value===t&&u.jsx(oe,{icon:r,className:"mr-2"}),c.value!==t&&u.jsx("span",{className:"mr-4"}),c.title]},v))}return d.push(u.jsx("hr",{className:"cs-divider"},"option-divider")),d.push(u.jsxs("button",{type:"button",value:_f,className:q("cs-option-btn",{"keyboard-active":s}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[!l&&t!==null?u.jsx(oe,{icon:r,className:"mr-2"}):u.jsx("span",{className:"mr-4"}),i]},"option-custom-label")),d.push(u.jsxs("div",{className:"cs-custom-container",children:[u.jsx("span",{className:"mr-2"}),u.jsx(yd,{ref:this.input,onChange:this.handleCustomInput,value:o,onFocus:()=>this.setState({inputFocused:!0}),onBlur:()=>this.setState({inputFocused:!1})},"option-input"),u.jsx("span",{className:"ml-2"})]},"cs-custom-container")),d.push(u.jsx("hr",{className:"mb-2"},"option-end")),d}render(){var{disabled:e,invalid:t,value:r,"data-testid":i}=this.props,{menuIsOpen:a}=this.state,{popperOptions:o}=this.props;return o=UR({placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}}},o),u.jsx("div",{className:"input-group cs-container context-menu",ref:this.csContainer,"data-testid":i,children:u.jsx("div",{className:q("input-group-append cs-dropdown",{"cs-dropdown-invalid":t}),children:u.jsxs("button",{type:"button",className:q("btn cs-btn form-control",{"cs-btn-invalid":t}),ref:this.button,onClick:this.toggleMenu,disabled:e,children:[u.jsx("span",{className:q({"text-muted":r===null}),children:this.getSelectedText()}),u.jsx("span",{className:"cs-caret"}),u.jsx(ci,{isShown:a,actions:{menuElement:this.renderMenuElement()},popperOptions:o,popperClassName:"CustomTimeSelect",onMenuOpened:this.handleMenuOpened,onMenuClosed:this.handleMenuExited,menuStyle:{maxWidth:"100rem"}})]})})})}}Qi(Or,"MENU_NAVIGATION_DIRECTION",rc);Qi(Or,"DROP_DOWN_MENU_HEIGHT",125);Qi(Or,"defaultProps",{onChange(){},value:null,disabled:!1,popperOptions:{},icon:$n,customText:"Custom",placeholder:"Select a time",valueToTime:n=>n===null?0:Math.round(n/1e3),timeToValue:n=>n*1e3,invalid:!1,"data-testid":void 0});const GR=Or;function Xa(n,e,t,r,i){var a=r-t+1,o=((parseInt(e,10)-n-t)%a+a)%a+t;return"".concat(o).padStart(i,"0")}function Aw(n,e,t){var{selectionStart:r}=n;return r===0?Xa(e,t,1900,2099,4):r===5?Xa(e,t,1,12,2):r===8?Xa(e,t,1,31,2):r===11?Xa(e,t,0,23,2):r===17||r===14?Xa(e,t,0,59,2):r===20||r===24||r===28?Xa(e,t,0,999,3):t}function nc(n){var e=n.substring(0,23),t=n.substring(23,26),r=n.substring(26);return[e,t,r].filter(i=>i!=="").join("")}var WR=te.module("DateTimeInput"),KR="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",zR="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]\\.[0-9]{3}[0-9]{3}[0-9]{3}",qR="".concat(KR," ").concat(zR),ud="2022-01-01",Lw="".concat(ud," 00:00:00.000000000"),YR="YYYY-MM-DD HH:MM:SS.SSSSSSSSS";function xf(n){return n!=null&&n.length>=ud.length?"".concat(n.substring(0,ud.length)).concat(n.substring(ud.length).replace(/\u2007/g,"0")).concat(Lw.substring(n.length)):n}function Nf(n){return n.replace(/\u200B/g,"")}var XR=[nc(Lw)],gv=re.forwardRef((n,e)=>{var{className:t="",onChange:r=()=>{},defaultValue:i="",onFocus:a=()=>{},onBlur:o=()=>{},onSubmit:s,"data-testid":l}=n,[d,h]=p.useState(i.length>0?nc(i):""),[c,v]=p.useState(),m=p.useCallback(g=>{WR.debug("handleChange",g),h(g),r(xf(Nf(g)))},[r]),f=p.useCallback(()=>{var g=Nf(d),b=xf(g);b!==g&&h(nc(b)),o()},[d,o]);return u.jsx("div",{className:"d-flex flex-row align-items-center",children:u.jsx(lu,{ref:e,className:q(t),example:XR,getNextSegmentValue:Aw,onChange:m,onSelect:v,onSubmit:s,pattern:qR,placeholder:YR,selection:c,value:d,onFocus:a,onBlur:f,"data-testid":l})})});gv.displayName="DateTimeInput";gv.defaultProps={className:"",onChange:()=>{},defaultValue:"",onFocus:()=>{},onBlur:()=>{},"data-testid":void 0};const kw=gv;var QR=te.module("DateInput"),ZR="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",JR=["2000-01-01","2022-12-31"],e_="YYYY-MM-DD",jw=re.forwardRef((n,e)=>{var{className:t="",onChange:r=()=>{},defaultValue:i="",onFocus:a=()=>{},onBlur:o=()=>{},"data-testid":s}=n,[l,d]=p.useState(i),[h,c]=p.useState(),v=p.useCallback(m=>{QR.debug("handleChange",m),d(m),r(m)},[r]);return u.jsx("div",{className:"d-flex flex-row align-items-center",children:u.jsx(lu,{ref:e,className:q(t),example:JR,getNextSegmentValue:Aw,onChange:v,onSelect:c,pattern:ZR,placeholder:e_,selection:h,value:l,onFocus:a,onBlur:o,"data-testid":s})})});jw.displayName="DateInput";const t_=jw;function $w(n,e,t){return e=r_(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function r_(n){var e=n_(n,"string");return typeof e=="symbol"?e:String(e)}function n_(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Hw extends p.PureComponent{constructor(e){super(e),$w(this,"searchInput",void 0),this.searchInput=re.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=Qe(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":a}=this.props,{value:o}=this.state;return u.jsx(pi,{value:o,placeholder:e,onChange:this.handleChange,className:t,matchCount:r,ref:this.searchInput,id:i,"data-testid":a})}}$w(Hw,"defaultProps",{placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0});const Uw=Hw;function Bw(n,e,t){return e=i_(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function i_(n){var e=a_(n,"string");return typeof e=="symbol"?e:String(e)}function a_(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var o_=te.module("ItemListItem");class du extends p.Component{static handleKeyDown(){return o_.log("ItemListItem.handleKeyDown false"),!1}constructor(e){super(e),Bw(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=re.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:a,"data-testid":o}=this.props;return u.jsx("div",{className:q("item-list-item",{active:r},{"is-focused":t},{"is-draggable":e}),onKeyDown:du.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":o,children:a})}}Bw(du,"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:{}});const Vw=du;function Mf(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 Ff(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Mf(Object(t),!0).forEach(function(r){Zr(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Mf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Zr(n,e,t){return e=s_(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function s_(n){var e=l_(n,"string");return typeof e=="symbol"?e:String(e)}function l_(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Af=te.module("ItemList"),Lf=5;class Tt extends p.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),Zr(this,"list",void 0),Zr(this,"listContainer",void 0),Zr(this,"getItemSelected",Ce((i,a)=>Xr.isSelected(a,i),{max:Tt.CACHE_SIZE})),Zr(this,"getCachedItem",Ce((i,a,o,s,l,d,h,c)=>{var v=d({item:o,itemIndex:i,isFocused:s,isSelected:l,style:h});return u.jsx(Vw,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:c,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:s,isSelected:l,itemIndex:i,style:h,children:v},a)},{max:Tt.CACHE_SIZE})),Zr(this,"getOuterElement",Ce(i=>{var a=re.forwardRef((o,s)=>u.jsx("div",Ff({ref:s,tabIndex:-1,onKeyDown:i,role:"presentation"},o)));return a.displayName="ItemListOuterElement",a})),Zr(this,"getInnerElement",Ce(()=>{var i=re.forwardRef((a,o)=>u.jsx("div",Ff({className:"item-list-inner-element",ref:o},a)));return i.displayName="ItemListInnerElement",i})),Zr(this,"getItemData",Ce((i,a,o)=>({items:i,selectedRanges:a,renderItem:o}))),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=re.createRef(),this.listContainer=re.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:a,isStuckToBottom:o,scrollOffset:s,height:l,selectedRanges:d}=this.state;if(o&&!this.isListAtBottom()&&i>0&&this.scrollToBottom(),(s!==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(a!==t.focusIndex){var{onFocusChange:c}=this.props;c(a)}}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),a=e-r;return i[a]}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=Xr.isSelected(r,e),a=i||et.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,a,!1)}handleItemDoubleClick(e,t){var{isDoubleClickSelect:r,onSelect:i}=this.props;r&&this.setState(a=>{var{selectedRanges:o}=a;return{selectedRanges:Xr.selectRange(o,[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){Af.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){Af.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:a}=this.props,{mouseDownIndex:o,selectedRanges:s,mouseX:l,mouseY:d}=this.state;if(!(o==null||a)){var h=Math.abs(t.clientX-(l??0)),c=Math.abs(t.clientY-(d??0));h>Lf&&c>Lf&&this.setState({isDragging:!0}),(r||o===e)&&(this.focusItem(e),i?(!r&&!this.getItemSelected(e,s)&&!et.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(o,e),Math.max(o,e)])):this.toggleSelect(e,t.shiftKey,et.isModifierKeyDown(t),!1))}}handleItemMouseUp(e,t){var{isDeselectOnClick:r,isDoubleClickSelect:i,onSelect:a}=this.props,{mouseDownIndex:o,isDragging:s}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(o===e&&!s){var l=t.shiftKey,d=et.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,l,d,r),!i&&!l&&!d&&a(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:a}=this.state,o=a;if(e.key==="Enter"||e.key===" "){!t&&o!=null&&this.setState({selectedRanges:[[o,o]]},()=>{o!=null&&i(o,e)});return}if(e.key==="ArrowUp")o!=null&&o>=0?o=Math.max(0,o-1):o=r-1;else if(e.key==="ArrowDown")o!=null&&o>=0?o=Math.min(o+1,r-1):o=0;else return;if(a!==o){e.stopPropagation(),e.preventDefault(),this.focusItem(o);var{selectedRanges:s}=this.state;if(e.shiftKey&&s.length>0){var l=s[s.length-1];this.selectRange([Math.min(o,l[0]),Math.max(o,l[1])])}else if(this.deselectAll(),o!==null)this.selectItem(o);else{var d;(d=this.listContainer.current)===null||d===void 0||d.focus()}this.scrollIntoView(o)}}handleScroll(e){var{scrollUpdateWasRequested:t,scrollOffset:r}=e;this.setState(i=>{if(t)return{scrollOffset:r};var{isStickyBottom:a}=this.props,{height:o}=i,s=a&&this.isListAtBottom({scrollOffset:r,height:o});return{isStuckToBottom:s,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:a}=this.props,{selectedRanges:o}=this.state;if(a&&t&&o.length>0){var s=o[o.length-1];this.selectRange([Math.min(s[0],e),Math.max(e,s[1])])}else a&&o.length===1&&o[0][0]===e&&o[0][1]===e?i&&this.deselectItem(e):a&&r?this.getItemSelected(e,o)?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){Xr.validateRange(e),this.setState(t=>{var{selectedRanges:r}=t;return{selectedRanges:Xr.deselectRange(r,e)}})}selectItem(e){var{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){Xr.validateRange(e),this.setState(t=>{var{selectedRanges:r}=t;return{selectedRanges:Xr.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,a=Math.floor(e/i),o=a+Math.ceil(t/i);r(a,o)}}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:a,renderItem:o,disableSelect:s}=this.props,{focusIndex:l,selectedRanges:d}=this.state;if(t<a||t>=a+i.length)return null;var h=i[t-a];return this.getCachedItem(t,t,h,t===l&&!s,this.getItemSelected(t,d),o,r,s)}render(){var{items:e,itemCount:t,overscanCount:r,renderItem:i,rowHeight:a,"data-testid":o}=this.props,{selectedRanges:s,isStuckToBottom:l}=this.state;return u.jsx(fP,{className:"item-list-auto-sizer",onResize:this.handleResize,children:d=>{var{width:h,height:c}=d;return u.jsx(gP,{className:"item-list-scroll-pane",height:c,width:h,initialScrollOffset:l?t*a:0,itemCount:t,itemSize:a,itemData:this.getItemData(e,s,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":o,children:this.renderInnerElement})}})}}Zr(Tt,"CACHE_SIZE",1e3);Zr(Tt,"DEFAULT_ROW_HEIGHT",20);Zr(Tt,"DEFAULT_OVERSCAN",10);Zr(Tt,"defaultProps",{offset:0,items:[],rowHeight:Tt.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:Tt.DEFAULT_OVERSCAN,renderItem:Tt.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0});function kf(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 Pi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?kf(Object(t),!0).forEach(function(r){Oa(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):kf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Oa(n,e,t){return e=d_(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function d_(n){var e=u_(n,"string");return typeof e=="symbol"?e:String(e)}function u_(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class jn extends p.PureComponent{static renderHandle(){return u.jsxs("div",{children:[u.jsx(lt,{children:"Drag to re-order"}),u.jsx(oe,{icon:Xs})]})}static renderBadge(e){var{text:t}=e;return t!=null&&t.length>0?u.jsx("span",{className:"number-badge",children:t}):null}static renderTextItem(e){var{text:t,badgeText:r="",className:i=""}=e;return u.jsxs("div",{className:q("item-list-item-content","draggable-item-list-item-content",i),children:[u.jsx("span",{className:"title",children:t}),jn.renderBadge({text:r}),jn.renderHandle()]})}static renderItem(e){var t,r,{item:i,isClone:a,selectedCount:o}=e,s=i!=null?(t=(r=i.displayValue)!==null&&r!==void 0?r:i.value)!==null&&t!==void 0?t:"".concat(i):"",l=a!==void 0&&a?"".concat(o):"",d=a!==void 0&&a?"item-list-item-clone":"";return jn.renderTextItem({text:s,badgeText:l,className:d})}static getDraggableId(e,t){return"".concat(e,"/").concat(t)}static getDraggableIndex(e){var t=e.split("/").pop();return parseInt(t!==void 0?t:"",10)}constructor(e){super(e),Oa(this,"itemList",void 0),Oa(this,"getCachedDraggableItem",Ce((t,r,i,a,o,s,l,d)=>u.jsx(qd,{draggableId:jn.getDraggableId(t,a),index:a,isDragDisabled:l,children:h=>u.jsx("div",Pi(Pi(Pi({role:"menuitem",className:"draggable-item-list-item",ref:h.innerRef,tabIndex:-1},h.draggableProps),h.dragHandleProps),{},{children:r({item:i,itemIndex:a,isFocused:o,isSelected:s,style:d,isClone:!1})}))},a),{max:Tt.CACHE_SIZE})),Oa(this,"getCachedRenderDraggableItem",Ce((t,r,i)=>a=>{var{item:o,itemIndex:s,isFocused:l,isSelected:d,style:h}=a;return this.getCachedDraggableItem(t,i,o,s,l,d,r,h)},{max:1})),Oa(this,"getCachedRenderClone",Ce((t,r,i,a)=>(o,s,l)=>{var{selectedCount:d}=this.state,{draggableProps:h,dragHandleProps:c,innerRef:v}=o,{index:m}=l.source,f=r[m-i];return u.jsx("div",Pi(Pi(Pi({className:q("draggable-item-list-dragging-item-container",t)},h),c),{},{ref:v,children:u.jsx("div",{className:q("draggable-item-list-dragging-item",{"two-dragged":d===2},{"multiple-dragged":d>2}),children:a({item:f,itemIndex:m,isFocused:!1,isSelected:!0,style:{},isClone:!0,selectedCount:d})})}))},{max:1})),this.handleSelectionChange=this.handleSelectionChange.bind(this),this.itemList=re.createRef(),this.state={selectedCount:0}}selectItem(e){var t;(t=this.itemList.current)===null||t===void 0||t.selectItem(e)}focusItem(e){var t;(t=this.itemList.current)===null||t===void 0||t.focusItem(e)}scrollToItem(e){var t;(t=this.itemList.current)===null||t===void 0||t.scrollToItem(e)}handleSelectionChange(e){this.setState({selectedCount:Xr.count(e)});var{onSelectionChange:t}=this.props;t(e)}render(){var{className:e,draggablePrefix:t,draggingItemClassName:r,droppableId:i,isDoubleClickSelect:a,isDragDisabled:o,isDropDisabled:s,isMultiSelect:l,isStickyBottom:d,itemCount:h,items:c,offset:v,onFocusChange:m,onSelect:f,onViewportChange:g,renderItem:b,rowHeight:C,selectedRanges:S,style:w,"data-testid":E}=this.props;return u.jsx(Ks,{isDropDisabled:s,droppableId:i,mode:"virtual",renderClone:this.getCachedRenderClone(r,c,v,b),"data-testid":E,children:(y,T)=>u.jsx("div",Pi(Pi({role:"menu",className:q("draggable-item-list",e,{"is-drop-disabled":s,"is-drag-disabled":o,"is-dragging-from-this":T.draggingFromThisWith,"is-dragging-over":T.isDraggingOver,"is-dropping":T.draggingOverWith}),style:w,ref:y.innerRef},y.droppableProps),{},{children:u.jsx(Tt,{focusSelector:".draggable-item-list-item",isDoubleClickSelect:a,isDragSelect:!1,isMultiSelect:l,isStickyBottom:d,itemCount:h,items:c,onFocusChange:m,onSelect:f,onSelectionChange:this.handleSelectionChange,onViewportChange:g,offset:v,ref:this.itemList,renderItem:this.getCachedRenderDraggableItem(t,o,b),rowHeight:C,selectedRanges:S})}))})}}Oa(jn,"DEFAULT_ROW_HEIGHT",30);Oa(jn,"defaultProps",{className:"",draggingItemClassName:"",offset:0,items:[],rowHeight:jn.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!0,isDropDisabled:!1,isDragDisabled:!1,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,style:null,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},renderItem:jn.renderItem,selectedRanges:[],draggablePrefix:"draggable-item",droppableId:"droppable-item-list","data-testid":void 0});const qr=jn;class Ed{static reorder(e,t,r,i){var a=e===r?Ed.adjustDestinationIndex(i,t):i,o=Ed.removeItems(e,t);return r.splice(a,0,...o),o}static removeItems(e,t){for(var r=[],i=t.map((h,c)=>({range:h,index:c})).sort((h,c)=>c.range[0]-h.range[0]),a=0;a<i.length;a+=1){var{range:o,index:s}=i[a],[l,d]=o;r[s]=e.splice(l,d-l+1)}return pP(r)}static adjustDestinationIndex(e,t){for(var r=e,i=0;i<t.length;i+=1){var[a,o]=t[i];if(a>e)break;r-=Math.min(o,e-1)-a+1}return r}static startDragging(){document.documentElement.classList.add("drag-pointer-events-none")}static stopDragging(){document.documentElement.classList.remove("drag-pointer-events-none")}}const cr=Ed;function h_(n){var{isInvalid:e=!1,items:t,onAdd:r=()=>{},onDelete:i=()=>{},validate:a=()=>null}=n,[o,s]=p.useState(null),[l,d]=p.useState([]),[h,c]=p.useState(""),v=p.useCallback(w=>{d(w)},[]),m=p.useCallback(()=>{i(Xr.getItemsInRanges(t,l)),d([])},[t,l,i]),f=p.useCallback(()=>{if(h!==""){var w=a(h);w==null?(r(h),c("")):s(w)}},[h,r,a]),g=p.useCallback(w=>{var{value:E}=w.target;c(E),s(E===""?null:a(E))},[a]),b=p.useCallback(()=>{d([])},[]),C=p.useCallback(w=>{w.key==="Enter"&&f()},[f]),S=p.useMemo(()=>14+ke(t.length,1,6)*Tt.DEFAULT_ROW_HEIGHT,[t.length]);return u.jsxs("div",{className:q("editable-item-list-container",{"is-invalid":e}),children:[u.jsx("div",{style:{height:S},children:u.jsx(Tt,{itemCount:t.length,items:t.map((w,E)=>({value:w,isSelected:Xr.isSelected(l,E)})),offset:0,selectedRanges:l,onSelectionChange:v,isMultiSelect:!0})}),u.jsxs("div",{className:"d-flex flex-row pt-2",children:[u.jsx("div",{className:"d-flex flex-grow-1",children:u.jsx("input",{className:q("form-control",{"is-invalid":o!=null}),placeholder:"Enter value",type:"text",value:h,onChange:g,onFocus:b,onKeyDown:C})}),u.jsxs("div",{className:"d-flex align-items-start mt-1 ml-2",children:[u.jsx(z,{kind:"ghost",onClick:f,disabled:o!=null||h==="",icon:RS,tooltip:"Add new item","data-testid":"add-item-button"}),u.jsx(z,{kind:"ghost",onClick:m,disabled:l.length===0,icon:er,tooltip:"Delete selected items","data-testid":"delete-item-button"})]})]})]})}var c_=te.module("ErrorBoundary");class v_ extends p.Component{static getDerivedStateFromError(e){return{error:e}}constructor(e){super(e),this.state={error:void 0}}componentDidCatch(e,t){var{onError:r}=this.props;c_.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(tr,{errorMessage:"".concat(i),isLoading:!1,isLoaded:!1})}):e}}function m_(n,e,t){return e=f_(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function f_(n){var e=g_(n,"string");return typeof e=="symbol"?e:String(e)}function g_(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Co extends p.Component{static isParentSelected(e,t){var r=t.get(e);if(r===void 0)return!1;if(typeof r=="boolean")return r;var i=Array.from(r.values()).includes(!0),a=Array.from(r.values()).includes(!1);return i&&a?null:i}constructor(e){super(e),this.toggleMenu=this.toggleMenu.bind(this),this.toggleValueFor=this.toggleValueFor.bind(this),this.selectAll=this.selectAll.bind(this),this.clear=this.clear.bind(this),this.state={menuIsOpen:!1}}toggleMenu(e){e.stopPropagation(),e.preventDefault(),this.setState(t=>{var{menuIsOpen:r}=t;return{menuIsOpen:!r}})}toggleValueFor(e,t){var{valueMap:r,onUpdateValueMap:i}=this.props,a=new Map(r),o=a.get(e);if(o instanceof Map){var s=new Map(o);if(t!=null)s.set(t,o.get(t)===void 0);else{var l=Co.isParentSelected(e,a),d=l==null||!l;o.forEach((v,m)=>s.set(m,d))}a.set(e,s)}else a.set(e,o==null||!o);var h=a.get(e);if(t===void 0&&h!==void 0&&typeof h!="boolean"){var c=Co.isParentSelected(e,r);c!=null&&c?h.forEach((v,m)=>h.set(m,!1)):h.forEach((v,m)=>h.set(m,!0))}i(a)}setAllValues(e){var{valueMap:t,onUpdateValueMap:r}=this.props,i=new Map;t.forEach((a,o)=>{if(typeof a=="boolean")i.set(o,e);else{var s=new Map;a.forEach((l,d)=>s.set(d,e)),i.set(o,s)}}),r(i)}selectAll(){this.setAllValues(!0)}clear(){this.setAllValues(!1)}renderMenuElement(){var{valueMap:e,"data-testid":t}=this.props;return u.jsxs("div",{className:"hcm-menu-container",children:[Array.from(e.entries()).map(r=>{var[i,a]=r;return u.jsxs("div",{children:[u.jsx(Fr,{className:"hcm-parent",checked:Co.isParentSelected(i,e),onChange:()=>this.toggleValueFor(i),children:i}),a!==void 0&&typeof a!="boolean"&&Array.from(a.entries()).map(o=>{var[s,l]=o;return u.jsx(Fr,{className:"hcm-child",checked:l,onChange:()=>this.toggleValueFor(i,s),children:s},s)})]},i)}),u.jsx(z,{kind:"ghost",onClick:this.selectAll,"data-testid":t!==void 0?"".concat(t,"-btn-select-all"):void 0,children:"Select All"}),u.jsx(z,{kind:"ghost",onClick:this.clear,"data-testid":t!==void 0?"".concat(t,"-btn-clear"):void 0,children:"Clear"})]})}render(){var{menuText:e,className:t,icon:r,id:i,"data-testid":a}=this.props,{menuIsOpen:o}=this.state;return u.jsxs("button",{type:"button",className:q("btn hcm-btn",t),onClick:this.toggleMenu,id:i,"data-testid":a,children:[u.jsxs("span",{children:[r&&u.jsx(oe,{icon:r,className:"hcm-icon mr-1"}),e]}),u.jsx("span",{className:"cs-caret"}),u.jsx(oa,{options:{placement:"bottom"},isShown:o,onExited:()=>{this.setState({menuIsOpen:!1})},closeOnBlur:!0,interactive:!0,children:this.renderMenuElement()})]})}}m_(Co,"defaultProps",{className:"",icon:null,id:"","data-testid":void 0});const p_=Co;function pv(n){var{on:e,id:t,className:r,isInvalid:i,disabled:a=!1,onClick:o,"data-testid":s}=n;return u.jsx("button",{type:"button",className:q("btn","btn-switch",r,{active:e},{"is-invalid":i}),id:t,onClick:o,disabled:a,"data-testid":s,children:u.jsx("div",{className:"handle"})})}function jf(n){return n.isOn!==void 0}function Gw(n){var{item:e,onSelect:t=()=>{},"data-testid":r}=n,{icon:i,subtitle:a,title:o}=e,s=p.useMemo(()=>jf(e)?()=>{e.onChange(!e.isOn)}:t,[e,t]);return u.jsxs("div",{className:"btn btn-navigation-menu-item","data-testid":"menu-item-".concat(o),onClick:s,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&s()},tabIndex:0,role:"menuitem",children:[i!==void 0&&u.jsx("div",{className:"icon",children:u.jsx(oe,{icon:i})}),u.jsx("div",{className:"title",children:o}),a!==void 0&&u.jsx("div",{className:"shortcut",children:a}),u.jsx("div",{className:"accessory","data-testid":r,children:jf(e)?u.jsx(pv,{on:e.isOn,onClick:l=>{l.stopPropagation(),s()}}):u.jsx(oe,{icon:Yc})})]})}function bv(n){var{items:e,onSelect:t=()=>{},"data-testid":r}=n;return u.jsx("div",{className:"navigation-menu-view","data-testid":r,children:u.jsx("ul",{className:"navigation-menu-list",children:e.map((i,a)=>u.jsx("li",{children:u.jsx(Gw,{item:i,onSelect:()=>{t(a)}})},i.title))})})}function $f(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 gh(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?$f(Object(t),!0).forEach(function(r){b_(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):$f(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function b_(n,e,t){return e=C_(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function C_(n){var e=S_(n,"string");return typeof e=="symbol"?e:String(e)}function S_(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ww=p.memo(n=>{var{tab:e,onClose:t,onSelect:r,isActive:i,activeRef:a,index:o,isDraggable:s,contextActions:l}=n,{key:d,isClosable:h=t!=null,title:c}=e;return u.jsx(qd,{draggableId:d,index:o,isDragDisabled:!s,children:(v,m)=>u.jsxs("div",{className:"context-menu-wrapper",ref:i?a:null,children:[u.jsxs("div",gh(gh(gh({ref:v.innerRef},v.draggableProps),v.dragHandleProps),{},{className:q("btn btn-link btn-nav-tab",{active:i},{dragging:m.isDragging}),"data-testid":"btn-nav-tab-".concat(c),role:"tab",tabIndex:0,onClick:f=>{f.target.focus(),r(d)},onKeyPress:f=>{f.key==="Enter"&&r(d)},children:[c,h&&u.jsx(z,{kind:"ghost",className:"btn-nav-tab-close",onClick:f=>{t==null||t(d),f.stopPropagation(),f.preventDefault()},icon:Ho,tooltip:"Close"})]})),u.jsx(le,{actions:l})]})},d)});Ww.displayName="NavTab";const w_=Ww;function Hf(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 Uf(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Hf(Object(t),!0).forEach(function(r){y_(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Hf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function y_(n,e,t){return e=E_(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function E_(n){var e=T_(n,"string");return typeof e=="symbol"?e:String(e)}function T_(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var P_=500,O_=.01,D_=5e-4;function Bf(n){return n.scrollLeft===0}function Vf(n){return n.scrollLeft+n.clientWidth===n.scrollWidth||n.scrollWidth===0}function I_(n,e,t){var{isClosable:r=!1,key:i}=n,a=[];if(r&&t!=null){a.push({title:"Close",order:10,group:20,action:()=>{t(i)}});for(var o=!0,s=e.length-1;s>0&&e[s].key!==n.key;s-=1)if(e[s].isClosable===!0){o=!1;break}a.push({title:"Close to the Right",order:20,group:20,action:()=>{for(var l=e.length-1;l>0&&e[l].key!==i;l-=1)e[l].isClosable===!0&&t(e[l].key)},disabled:o}),a.push({title:"Close All",order:30,group:20,action:()=>{e.forEach(l=>{l.isClosable===!0&&t(l.key)})}})}return a}function R_(n){var{activeKey:e,tabs:t,onSelect:r,onReorder:i,onClose:a,makeContextActions:o}=n,s=p.useRef(),[l,d]=p.useState(!0),[h,c]=p.useState(!0),[v,m]=p.useState(!0),f=p.useCallback(()=>{s.current!=null&&(s.current.clientWidth<s.current.scrollWidth&&t.length>0?d(!0):d(!1),c(Bf(s.current)),m(Vf(s.current)))},[t]);cv(s.current,f);var g=p.useCallback(D=>{cr.stopDragging(),D.destination&&(i==null||i(D.source.index,D.destination.index))},[i]),b=p.useCallback(()=>{if(s.current!=null){var D=Bf(s.current);D!==h&&c(D);var _=Vf(s.current);_!==v&&m(_)}},[h,v]),C=p.useRef({cancelClick:!1}),S=p.useCallback(()=>{if(!(s.current==null||C.current.cancelClick))for(var{children:D}=s.current,_=D.length-1;_>=0;_-=1){var x=D[_];if(x.offsetLeft<s.current.scrollLeft-5){x.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"});return}}},[]),w=p.useCallback(()=>{if(!(s.current==null||C.current.cancelClick))for(var{children:D}=s.current,_=0;_<D.length;_+=1){var x=D[_];if(x.offsetLeft+5>s.current.scrollLeft+s.current.offsetWidth){x.scrollIntoView({behavior:"smooth",block:"nearest",inline:"end"});return}}},[]),E=p.useCallback(function(D,_){var x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,L=arguments.length>3?arguments[3]:void 0,H=s.current;H!=null&&(C.current.cancelClick=!0,D==="left"?H.scrollLeft=_-x:D==="right"&&(H.scrollLeft=_+x),C.current.rAF=requestAnimationFrame(G=>{var X=L??G,W=G-X,A=O_*W+.5*D_*W**2;A=Math.min(A,H.scrollWidth),E(D,_,A,X)}))},[]),y=p.useCallback(()=>{var{holdTimer:D,rAF:_}=C.current;D!=null&&(clearTimeout(D),C.current.holdTimer=void 0),_!=null&&(cancelAnimationFrame(_),C.current.rAF=void 0),window.removeEventListener("mouseup",y)},[]);p.useEffect(()=>()=>window.removeEventListener("mouseup",y),[y]);var T=p.useCallback(D=>{s.current!=null&&(C.current.holdTimer=window.setTimeout(E,P_,D,s.current.scrollLeft)),C.current.cancelClick=!1,window.addEventListener("mouseup",y)},[y,E]),O=p.useCallback(()=>{T("left")},[T]),R=p.useCallback(()=>{T("right")},[T]);p.useEffect(function(){var _,x=L=>{L.stopPropagation(),L.preventDefault();var H=L.currentTarget,G=Math.abs(L.deltaY)>Math.abs(L.deltaX)?L.deltaY:L.deltaX;H.scrollLeft+=ke(G,-30,30)};return(_=s.current)===null||_===void 0||_.addEventListener("wheel",x),()=>{var L;(L=s.current)===null||L===void 0||L.removeEventListener("wheel",x)}},[]);var P=p.useMemo(()=>{var D=new Map;return t.forEach(_=>{var{key:x}=_,L=[()=>I_(_,t,a),()=>{var H;return(H=o==null?void 0:o(_))!==null&&H!==void 0?H:[]}];D.set(x,L)}),D},[o,t,a]),M=p.useRef(null),F=t.find(D=>D.key===e),N=t.map((D,_)=>{var{key:x}=D,L=D===F;return u.jsx(w_,{tab:D,index:_,isActive:L,activeRef:M,onSelect:r,onClose:a,isDraggable:i!=null,contextActions:P.get(x)},x)});return p.useEffect(function(){M.current!=null&&M.current.scrollIntoView({block:"nearest",inline:"nearest"})},[e]),u.jsxs("nav",{className:"nav-container",children:[l&&u.jsx(z,{kind:"ghost",icon:u.jsx(oe,{icon:_S,transform:"grow-4"}),className:"tab-controls-btn tab-controls-btn-left",tooltip:"Scroll left",onClick:S,onMouseDown:O,disabled:h}),u.jsx(zs,{onDragStart:cr.startDragging,onDragEnd:g,children:u.jsx(Ks,{droppableId:"droppable-tab-navigation",direction:"horizontal",children:(D,_)=>u.jsxs("div",Uf(Uf({ref:x=>{x!=null&&(s.current=x,D.innerRef(x))}},D.droppableProps),{},{className:q("nav nav-tabs",{dragging:_.draggingFromThisWith}),role:"tablist",onScroll:b,children:[N,D.placeholder]}))})}),l&&u.jsx(z,{kind:"ghost",icon:u.jsx(oe,{icon:Yc,transform:"grow-4"}),className:"tab-controls-btn tab-controls-btn-right",tooltip:"Scroll right",onClick:w,onMouseDown:R,disabled:v})]})}function ic(n){var{children:e,onBack:t,onClose:r,title:i,"data-testid":a}=n;return u.jsxs("div",{className:"navigation-page","data-testid":a,children:[u.jsxs("div",{className:"navigation-title-bar",children:[u.jsx("div",{className:"navigation-left-buttons",children:t!==void 0&&u.jsx(z,{kind:"ghost",className:"btn-back m-1 btn-sm","data-testid":"btn-page-back",onClick:t,icon:_S,children:"Back"})}),u.jsx("div",{className:"navigation-title",children:i}),u.jsx("div",{className:"navigation-right-buttons",children:r!==void 0&&u.jsx(z,{kind:"ghost",className:"btn-close btn-sm px-2 m-1","data-testid":"btn-page-close",onClick:r,icon:Ho,tooltip:"Close"})})]}),u.jsx("div",{className:"navigation-content",children:e})]})}function Kw(n){var{children:e,"data-testid":t}=n,r=p.useMemo(()=>re.Children.toArray(e),[e]),i=nl(r),[a,o]=p.useState(r[r.length-1]),[s,l]=p.useState(null),[d,h]=p.useState(null);p.useEffect(function(){if(!(i===void 0||r===i)){var f=r[r.length-1];r.length===i.length||i.length===0||s!==null||d!==null?s!==null&&f!==s?l(f):f!==d&&f!==a&&o(f):r.length>i.length?l(f):r.length<i.length&&(o(f),h(i[i.length-1]))}},[r,i,s,d,a]);var c=p.useCallback(()=>{o(s),l(null)},[s]),v=p.useCallback(()=>{h(null)},[]);return u.jsxs("div",{className:"navigation-stack",children:[u.jsx("div",{className:"main-view","data-testid":t,children:a}),u.jsx(kt,{in:d!=null,timeout:qe.transitionMidMs,classNames:"slide-right",onEntered:v,children:u.jsx(u.Fragment,{children:d!=null&&u.jsx("div",{className:"popping-view",children:d})})}),u.jsx(kt,{in:s!=null,timeout:qe.transitionMidMs,classNames:"slide-left",onEntered:c,children:u.jsx(u.Fragment,{children:s!=null&&u.jsx("div",{className:"pushing-view",children:s})})})]})}var __=["children"];function Gf(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 Wf(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Gf(Object(t),!0).forEach(function(r){x_(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Gf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function x_(n,e,t){return e=N_(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function N_(n){var e=M_(n,"string");return typeof e=="symbol"?e:String(e)}function M_(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function F_(n,e){if(n==null)return{};var t=A_(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function A_(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function Cv(n){var{children:e}=n,t=F_(n,__);return u.jsx("option",Wf(Wf({},t),{},{children:e}))}function ol(n){var{children:e,disabled:t=!1,name:r,onChange:i,value:a="","data-testid":o}=n,[s]=p.useState(r??Me());return u.jsx(u.Fragment,{children:re.Children.map(e,l=>{var d,h;return l?re.cloneElement(l,{name:s,onChange:(d=l.props.onChange)!==null&&d!==void 0?d:i,checked:a===l.props.value,disabled:(h=l.props.disabled)!==null&&h!==void 0?h:t,"data-testid":o}):null})})}var Sv=re.forwardRef((n,e)=>{var{checked:t,children:r,className:i="",disabled:a=!1,inputClassName:o="",isInvalid:s=!1,labelClassName:l="",name:d,onChange:h,value:c,"data-testid":v}=n,[m]=p.useState(Me());return u.jsxs("div",{className:q("custom-control custom-radio",i),children:[u.jsx("input",{type:"radio",id:m,"data-testid":v,name:d,ref:e,className:q("custom-control-input",o,{"is-invalid":s}),checked:t,disabled:a,value:c,onChange:h}),u.jsx("label",{className:q("custom-control-label",l),htmlFor:m,children:r})]})});Sv.displayName="RadioItem";Sv.defaultProps={checked:void 0,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const Hn=Sv;function L_(){var{selectedThemeKey:n,setSelectedThemeKey:e,themes:t}=Uo(),r=p.useCallback(i=>{e(i)},[e]);return u.jsx(bP,{label:"Pick a color scheme",items:t,selectedKey:n,onSelectionChange:r,children:i=>u.jsx(yS,{children:i.name},i.themeKey)})}function k_(n){var{className:e,style:t}=n;return u.jsx("div",{className:q("dh-logo",e),style:t})}var j_=.025,$_=.9,H_=.1,U_=.618,Kf=80,Qa={SIZE:8,DOT_SIZE:2},Oi=18,B_=250,V_=60*1e3,G_={background:"var(--dh-color-random-area-plot-animation-bg)",foregroundFill:"var(--dh-color-random-area-plot-animation-fg-fill)",foregroundStroke:"var(--dh-color-random-area-plot-animation-fg-stroke)",gridColor:"var(--dh-color-random-area-plot-animation-grid)"};function W_(){return Xd(G_)}var K_=re.memo(()=>{var{activeThemes:n}=Uo(),e=p.useMemo(W_,[n]),t=p.useRef(null),r=p.useRef(null),[i,a]=p.useState(!1),o=window.devicePixelRatio,s,l,d,h,c,v=null,m=[];function f(){var N;r.current!=null&&(d=r.current.offsetWidth,h=r.current.offsetHeight),t.current!=null&&(t.current.style.width="".concat(d,"px"),t.current.style.height="".concat(h,"px"),t.current.width=d*o,t.current.height=h*o),(N=s)===null||N===void 0||N.scale(o,o)}function g(){var{foregroundFill:N,foregroundStroke:D}=e,_=document.createElement("canvas");_.width=Qa.SIZE,_.height=Qa.SIZE;var x=_.getContext("2d");return x!=null&&(x.fillStyle=D,x.fillRect(0,0,Qa.DOT_SIZE,Qa.DOT_SIZE),x.fillStyle=N,x.fillRect(0,0,Qa.SIZE,Qa.SIZE)),x==null?void 0:x.createPattern(_,"repeat")}function b(N){var D=Math.random()-.5,_=j_*D;return N<H_?_=Math.abs(_):N>$_&&(_=-Math.abs(_)),N+_}function C(){for(var N=[],D=U_,_=0;_<d+Oi;_+=1)D=b(D),N.push(D);return N}function S(){for(;m.length>=d+Oi;)m.pop();for(;m.length<d+Oi;)m.push(b(m[m.length-1]))}function w(N,D){D.beginPath(),D.moveTo(-1,h+1),D.lineTo(-1,h*N[0]);for(var _=0;_<N.length;_+=1)D.lineTo(_,h*N[_]);D.lineTo(d+Oi,h*N[N.length-1]),D.lineTo(d+Oi,h+1),D.closePath()}function E(N){N.beginPath();for(var D=1;D<d;D+=Kf)N.moveTo(D,0),N.lineTo(D,h);for(var _=1;_<h;_+=Kf)N.moveTo(0,_),N.lineTo(d,_)}function y(N){var D,_,x;v=(D=v)!==null&&D!==void 0?D:N;var{background:L,foregroundStroke:H,gridColor:G}=e;$(s),s.fillStyle=L,s.fillRect(0,0,d,h),E(s),s.lineWidth=1,s.strokeStyle=G,s.stroke();var X=(((_=v)!==null&&_!==void 0?_:0)-(N??0))/(1e3/Oi);if(s.translate(X,0),w(m,s),s.lineWidth=2,s.strokeStyle=H,s.stroke(),s.translate(-X,0),l!=null&&(s.fillStyle=l),s.fill(),s.setTransform(o,0,0,o,0,0),(N??0)-((x=v)!==null&&x!==void 0?x:0)>1e3/Oi){for(var W,A=Math.floor(((N??0)-((W=v)!==null&&W!==void 0?W:0))/(1e3/Oi)),I=0;I<A;I+=1)m.shift(),m.push(b(m[m.length-1]));v=N}c!=null&&cancelAnimationFrame(c),c=requestAnimationFrame(y)}var T=Qe(()=>{c=requestAnimationFrame(N=>{f(),S(),a(!1),y(N)})},B_,{leading:!0});function O(){a(!0),c!=null&&cancelAnimationFrame(c),c=null,v=null}var R=Qe(()=>{O()},V_);function P(){c==null&&(a(!1),f(),S(),c=requestAnimationFrame(y)),R()}function M(){document.hasFocus()&&P()}function F(){c!=null&&cancelAnimationFrame(c),R(),T()}return p.useEffect(()=>{var N;return s=(N=t.current)===null||N===void 0?void 0:N.getContext("2d",{alpha:!1}),f(),m=C(),l=g(),y(),R(),window.addEventListener("resize",F),window.addEventListener("focus",P),window.addEventListener("blur",O),window.addEventListener("mousemove",M),window.addEventListener("keydown",M),()=>{c!=null&&cancelAnimationFrame(c),window.removeEventListener("resize",F),window.removeEventListener("focus",P),window.removeEventListener("blur",O),window.removeEventListener("mousemove",M),window.removeEventListener("keydown",M),R.cancel(),T.cancel()}},[e]),u.jsx("div",{className:"random-area-plot-animation-container",ref:r,children:u.jsx("canvas",{ref:t,className:i?"shade":""})})});const zw=K_;function qw(n){var{text:e,placement:t="top-start"}=n,r=p.useMemo(()=>({placement:t}),[t]);return u.jsxs(u.Fragment,{children:[u.jsx(CS,{UNSAFE_className:vv.spectrumEllipsis,children:e??u.jsx(u.Fragment,{children:" "})}),e==null||e===""?null:u.jsx(lt,{options:r,children:e})]})}var z_=["scrollRef","getItemDisplayText","getKey"];function zf(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 qf(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?zf(Object(t),!0).forEach(function(r){q_(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):zf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function q_(n,e,t){return e=Y_(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Y_(n){var e=X_(n,"string");return typeof e=="symbol"?e:String(e)}function X_(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Q_(n,e){if(n==null)return{};var t=Z_(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function Z_(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function J_(n){var{scrollRef:e,getItemDisplayText:t,getKey:r}=n,i=Q_(n,z_),a=p.useCallback(o=>{var s=r(o),l=t(o);return u.jsx(yS,{textValue:l??String(s),children:u.jsx(qw,{text:l})},s)},[t,r]);return u.jsx(CP,qf(qf({},i),{},{ref:e,menuTrigger:"focus",onSelectionChange:i.onSelectionChange,children:a}))}var ex=["children","className","onChange","data-testid"];function Yf(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 Xf(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Yf(Object(t),!0).forEach(function(r){tx(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Yf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function tx(n,e,t){return e=rx(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rx(n){var e=nx(n,"string");return typeof e=="symbol"?e:String(e)}function nx(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ix(n,e){if(n==null)return{};var t=ax(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function ax(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}var Yw=re.forwardRef((n,e)=>{var{children:t,className:r,onChange:i,"data-testid":a}=n,o=ix(n,ex),s=ru(e),l=p.useCallback(d=>{i(d.target.value)},[i]);return u.jsx("select",Xf(Xf({ref:s,className:q("custom-select",r),onChange:l,"data-testid":a},o),{},{children:t}))});Yw.displayName="Select";const Dt=Yw;function ao(n,e,t){return e=ox(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ox(n){var e=sx(n,"string");return typeof e=="symbol"?e:String(e)}function sx(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Xw extends p.PureComponent{constructor(e){super(e),ao(this,"list",void 0),ao(this,"topRow",void 0),ao(this,"bottomRow",void 0),ao(this,"getCachedItem",Ce((t,r,i,a,o,s,l)=>{var d={height:o},h=a??i;return u.jsx("li",{className:"value-list-item",style:d,tabIndex:-1,children:u.jsx(Fr,{checked:s,disabled:l,onChange:()=>this.handleSelect(t),children:h})},r)},{max:1e3})),ao(this,"getCachedItems",Ce((t,r,i,a)=>{for(var o=[],s=0;s<t.length;s+=1){var l=t[s],{value:d,displayValue:h,isSelected:c}=l,v=i+s,m=v,f=this.getCachedItem(v,m,d,h,r,c,a);o.push(f)}return o},{max:1})),this.handleBlur=this.handleBlur.bind(this),this.handleScroll=this.handleScroll.bind(this),this.handleSelect=this.handleSelect.bind(this),this.list=re.createRef(),this.topRow=null,this.bottomRow=null}componentDidMount(){this.sendViewportUpdate()}componentDidUpdate(){this.sendViewportUpdate()}handleBlur(e){if(!e.relatedTarget||this.list.current&&e.relatedTarget instanceof HTMLElement&&!this.list.current.contains(e.relatedTarget)){var{onBlur:t}=this.props;t==null||t(e)}}handleScroll(){this.sendViewportUpdate()}handleSelect(e){var{items:t,offset:r,onSelect:i}=this.props,a=e-r;if(a>=0&&a<t.length){var o=t[a],{value:s}=o;i(e,s)}else i(e,null)}sendViewportUpdate(){if(!(!this.list.current||this.list.current.clientHeight===0)){var{onViewportChange:e,rowHeight:t}=this.props,r=this.list.current.scrollTop,i=r+this.list.current.clientHeight,a=Math.floor(r/t),o=Math.ceil(i/t);(this.topRow!==a||this.bottomRow!==o)&&(this.topRow=a,this.bottomRow=o,e(a,o))}}getElement(e){if(this.list.current==null)return null;var t=this.list.current.querySelectorAll(".value-list-item");return t[e]}scrollIntoView(e){var t=this.getElement(e);t==null||t.scrollIntoView({block:"center"})}render(){var{className:e,disabled:t,isInvalid:r,items:i,itemCount:a,offset:o,rowHeight:s,"data-testid":l}=this.props,d=this.getCachedItems(i,s,o,t);return u.jsx("div",{className:q("select-value-list-scroll-pane h-100 w-100",{"is-invalid":r},e),onBlur:this.handleBlur,onScroll:this.handleScroll,ref:this.list,"data-testid":l,children:u.jsx("div",{className:"select-value-list",style:{height:a*s},children:u.jsx("ol",{className:"select-value-list-content",style:{position:"absolute",height:i.length*s,top:o*s,left:0},children:d})})})}}ao(Xw,"defaultProps",{disabled:!1,rowHeight:21,onBlur:()=>{},"data-testid":void 0});const wv=Xw;var yv=re.forwardRef((n,e)=>{var{children:t,className:r,disabled:i,id:a,isLinked:o,isLinkedSource:s,isInvalid:l,onClick:d,onMouseEnter:h,onMouseLeave:c,style:v,"data-testid":m}=n;return u.jsxs("button",{ref:e,type:"button",className:q("btn-socketed",{"btn-socketed-linked":o!==void 0&&o||s},{"btn-socketed-linked-source":s},{"is-invalid":l},r),id:a,onClick:d,onMouseEnter:h,onMouseLeave:c,style:v,disabled:i,"data-testid":m,children:[t,u.jsx(oe,{icon:xS,className:"linked btn-socketed-icon",transform:"down-1"}),u.jsx(oe,{icon:QP,className:"is-invalid btn-socketed-icon"})]})});yv.displayName="SocketedButton";yv.defaultProps={children:void 0,className:"",disabled:!1,id:void 0,isLinked:!1,isLinkedSource:!1,isInvalid:!1,onClick:void 0,onMouseEnter:void 0,onMouseLeave:void 0,style:void 0,"data-testid":void 0};const Ev=yv;var lx=500;function dx(n){var{heading:e,content:t,delayMs:r=lx}=n,[i,a]=p.useState(!1);return p.useEffect(()=>{window.setTimeout(()=>{a(!0)},r)},[r]),i?u.jsxs(SP,{children:[u.jsx(Kc,{size:"XXL",children:u.jsx(oe,{icon:ZP})}),u.jsx(SS,{children:e}),t==null?null:u.jsx(wS,{children:t})]}):null}const ux="_modified_5rbci_24",hx="_track_5rbci_35",cx="_handle_5rbci_15",vx="_ticks_5rbci_103",Qw={"handle-size":"15px","popover-width":"90px","time-slider":"_time-slider_5rbci_5","time-slider-popovers":"_time-slider-popovers_5rbci_10","handle-popper":"_handle-popper_5rbci_15",modified:ux,"flex-spacer":"_flex-spacer_5rbci_31",track:hx,"track-fills":"_track-fills_5rbci_42","track-fill":"_track-fill_5rbci_42","track-fill-start":"_track-fill-start_5rbci_60","track-fill-middle":"_track-fill-middle_5rbci_61","track-fill-end":"_track-fill-end_5rbci_64","handle-track":"_handle-track_5rbci_67",handle:cx,ticks:vx,"tick-labels":"_tick-labels_5rbci_121","tick-label":"_tick-label_5rbci_121","tick-label-wrapper":"_tick-label-wrapper_5rbci_137"};var Nl=parseInt(Qw["handle-size"],10),Qf=parseInt(Qw["popover-width"],10),xr=24*60*60-1,Zf=5*60;function mx(n){var{startTime:e,endTime:t,onChange:r,isStartModified:i=!1,isEndModified:a=!1,"data-testid":o}=n,[s,l]=p.useState(e),[d,h]=p.useState(t),c=p.useRef(null);p.useEffect(function(){l(e),h(t)},[e,t]);var v=p.useCallback((g,b)=>{var C=g,S=b;C===S&&(S<xr?S+=1:C-=1),l(C),h(S),r({startTime:C,endTime:S})},[l,h,r]),m=p.useCallback(g=>{v(g,d)},[v,d]),f=p.useCallback(g=>{v(s,g)},[v,s]);return u.jsxs("div",{className:"time-slider","data-testid":o,children:[u.jsx(fx,{startTime:s,endTime:d,onStartTimeChange:m,onEndTimeChange:f,isStartModified:i,isEndModified:a}),u.jsxs("div",{className:"track",ref:c,children:[u.jsx(gx,{startTime:s,endTime:d}),u.jsx("div",{className:"ticks",children:Array(24).fill(null).map((g,b)=>u.jsx("div",{className:"tick"},b))}),u.jsx(Jf,{track:c,time:s,setTime:m}),u.jsx(Jf,{track:c,time:d,setTime:f})]}),u.jsxs("div",{className:"tick-labels",children:[u.jsx("div",{className:"tick-label",children:"0:00"}),u.jsx("div",{className:"tick-label-wrapper",children:Array(24).fill(null).map((g,b)=>u.jsx("div",{className:"tick-label",children:"".concat(b+1,":00")},b))})]})]})}function fx(n){var{startTime:e,endTime:t,onStartTimeChange:r,onEndTimeChange:i,isStartModified:a,isEndModified:o,"data-testid":s}=n,l=e>t,[d,h]=p.useState(l?t:e),[c,v]=p.useState(l?e:t),m=p.useRef(null),f=p.useRef(null),g=p.useRef(null),b=p.useRef(null);p.useEffect(function(){h(e>t?t:e),v(e>t?e:t)},[e,t]),p.useEffect(function(){if(g.current!==null){var T;(T=f.current)===null||T===void 0||T.setSelection(g.current)}if(b.current!==null){var O;(O=m.current)===null||O===void 0||O.setSelection(b.current)}},[l]);function C(y){e<=t?r(y):i(y)}function S(y){e<=t?i(y):r(y)}var w=p.useCallback(y=>{g.current=y,b.current=null},[]),E=p.useCallback(y=>{g.current=null,b.current=y},[]);return u.jsxs("div",{className:"time-slider-popovers",children:[u.jsx("div",{className:"flex",style:{flexBasis:"calc(".concat(d/xr*100,"% - ").concat(Qf/2,"px)")}}),u.jsxs("div",{className:"handle-popper",children:[u.jsx("label",{className:q({modified:l?o:a}),children:l?"End Time":"Start Time"}),u.jsx(yd,{ref:m,allowValueWrapping:!1,value:d,onChange:C,onSelect:w,"data-testid":s!==void 0?"".concat(s,"-input-1"):void 0})]}),u.jsx("div",{className:"flex-spacer"}),u.jsxs("div",{className:"handle-popper",children:[u.jsx("label",{className:q({modified:l?a:o}),children:l?"Start Time":"End Time"}),u.jsx(yd,{ref:f,allowValueWrapping:!1,value:c,onChange:S,onSelect:E,"data-testid":s!==void 0?"".concat(s,"-input-2"):void 0})]}),u.jsx("div",{className:"flex",style:{flexBasis:"calc(".concat((xr-c)/xr*100,"% - ").concat(Qf/2,"px)")}})]})}function gx(n){var{startTime:e,endTime:t,"data-testid":r}=n;return u.jsxs("div",{className:"track-fills","data-testid":r,children:[e>t&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"track-fill track-fill-start",style:{transform:"scaleX(".concat(t/xr,")")}}),u.jsx("div",{className:"track-fill track-fill-end",style:{transform:"scaleX(".concat((xr-e)/xr,")")}})]}),e<t&&u.jsx("div",{className:"track-fill track-fill-middle",style:{transform:"translateX(".concat(e/xr*100,"%) scaleX(").concat((t-e)/xr,")")}})]})}function Jf(n){var{track:e,time:t,setTime:r,"data-testid":i}=n,a=p.useMemo(()=>{var v=3600,m=Nl/2;return t<v?m=t/v*(Nl/2):t>23*v&&(m=Nl/2+1/(xr-23*v)*(t-23*v)*(Nl/2)),"translateX(calc(".concat(t/xr*100,"% - ").concat(m,"px))")},[t]),o=p.useCallback(v=>{if(!e.current)return 0;var m=e.current.getBoundingClientRect(),f=Math.max(v-m.left,0),g=xr*Math.min(1,f/m.width),b=Zf*Math.round(g/Zf),C=Math.min(xr,b);return C},[e]),s=p.useCallback(v=>{var{clientX:m}=v;r(o(m))},[r,o]),l=p.useCallback(v=>{var{clientX:m}=v;r(o(m)),window.removeEventListener("mousemove",s),window.removeEventListener("mouseup",l),document.documentElement.classList.remove("drag-pointer-events-none")},[r,o,s]),d=p.useCallback(()=>{window.addEventListener("mousemove",s),window.addEventListener("mouseup",l),document.documentElement.classList.add("drag-pointer-events-none")},[s,l]),h=p.useCallback(()=>{window.removeEventListener("mousemove",s),window.removeEventListener("mouseup",l),document.documentElement.classList.remove("drag-pointer-events-none")},[s,l]),c=p.useCallback(()=>{d()},[d]);return p.useEffect(function(){return()=>{h()}},[h]),u.jsx("div",{className:"handle-track",style:{transform:a},children:u.jsx("button",{className:"handle",type:"button","aria-label":"Change time",onMouseDown:c,"data-testid":i})})}function Zw(n){var{buttons:e,isShown:t=!1,classNames:r,message:i,type:a,onClick:o,onDismiss:s,"data-testid":l}=n,d=e&&e.length!==0;return u.jsx(kt,{in:t,timeout:qe.transitionMs,classNames:"toast-notification-slide-up",mountOnEnter:!0,unmountOnExit:!0,children:u.jsxs("div",{className:q("toast-notification",r,a),role:"presentation",onClick:o,onKeyPress:o,"data-testid":l,children:[u.jsx("div",{className:"message-container",children:u.jsx("span",{className:"message",children:i})}),u.jsx(kt,{in:d,timeout:qe.transitionSlowMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:u.jsx("div",{className:"buttons-container",children:e})}),s&&u.jsx(z,{kind:"ghost",icon:Ho,tooltip:"Close notification",className:"my-2",onClick:s})]})})}Zw.TYPE=Object.freeze({ERROR:"error"});function px(n){var{children:e,className:t,labelText:r,hintText:i,isModified:a,validationError:o,showValidationError:s=!0,"data-testid":l,id:d}=n,{current:h}=p.useRef(d??Me());return u.jsxs(u.Fragment,{children:[u.jsx("label",{className:q("validate-label",t,{modified:a}),htmlFor:h,"data-testid":l,children:r}),re.Children.toArray(e).map(c=>re.isValidElement(c)?re.cloneElement(c,{className:q(c.props.className,{"is-invalid":o})}):u.jsx("div",{className:q(t),children:c})),i!==void 0&&u.jsx("small",{className:"form-text text-muted",children:i}),o!==void 0&&s&&u.jsx("p",{className:"validate-label-error text-danger",children:o})]})}const bx=Object.freeze(Object.defineProperty({__proto__:null,ActionButtonDialogTrigger:lw,AutoCompleteInput:JI,AutoResizeTextarea:mv,BasicModal:aa,BulkActionBar:aR,Button:z,ButtonGroup:al,ButtonOld:Zh,CSS_VAR_EXPRESSION_PREFIX:JP,CardFlip:au,Checkbox:Fr,Collapse:mR,ComboBox:fv,ConfirmActionButton:BI,ConfirmationDialog:Tw,ContextActionUtils:et,ContextActions:le,ContextMenuItem:US,ContextMenuRoot:BS,CopyButton:eu,CustomTimeSelect:GR,DEFAULT_DARK_THEME_KEY:eO,DEFAULT_DARK_THEME_PALETTE:tO,DEFAULT_GET_PREFERRED_REPLACEMENT_STRING:su,DEFAULT_LIGHT_THEME_KEY:rO,DEFAULT_PRELOAD_DATA_VARIABLES:nO,DateInput:t_,DateTimeInput:kw,DebouncedModal:eR,DebouncedSearchInput:Uw,DragUtils:cr,DraggableItemList:qr,DropdownMenu:ci,EditableItemList:h_,ErrorBoundary:v_,GLOBAL_SHORTCUTS:Cn,HierarchicalCheckboxMenu:p_,IconActionButton:Pw,InfoModal:tR,ItemList:Tt,ItemListItem:Vw,get KEY(){return de},LoadingOverlay:tr,LoadingSpinner:Un,Logo:k_,get MODIFIER(){return ue},MaskedInput:lu,Menu:bv,MenuItem:Gw,Modal:jo,ModalBody:$o,ModalFooter:nu,ModalHeader:Ys,NON_WHITESPACE_REGEX:iO,NavTabList:R_,Option:Cv,Page:ic,Popper:oa,RadioGroup:ol,RadioItem:Hn,RandomAreaPlotAnimation:zw,SVG_ICON_MANUAL_COLOR_MAP:aO,SearchInput:pi,SearchableCombobox:J_,Select:Dt,SelectValueList:wv,Shortcut:ht,ShortcutRegistry:Le,SocketedButton:Ev,Stack:Kw,THEME_CACHE_LOCAL_STORAGE_KEY:oO,TMP_CSS_PROP_PREFIX:sO,TableViewEmptyState:dx,TextWithTooltip:qw,ThemeContext:TD,ThemeExport:qe,ThemePicker:L_,ThemeProvider:VS,TimeInput:yd,TimeSlider:mx,ToastNotification:Zw,Tooltip:lt,UISwitch:pv,ValidateLabelInput:px,WHITESPACE_REGEX:lO,calculatePreloadStyleContent:dO,createCssVariableResolver:uO,createPreloadStyleElement:hO,extractDistinctCssVariableExpressions:cO,fillToLength:_w,getActiveThemes:vO,getDefaultBaseThemes:mO,getExpressionRanges:NS,getThemeKey:MS,getThemePreloadData:fO,overrideSVGFillColors:gO,preloadTheme:pO,replaceSVGFillColor:bO,resolveCssVariablesInRecord:Xd,resolveCssVariablesInString:CO,setThemePreloadData:SO,themeDHDefault:PD,themeDark:wO,themeLight:yO,trimTrailingMask:tc,useTheme:Uo},Symbol.toStringTag,{value:"Module"}));function Cx(n,e){var t=It(),r=p.useMemo(()=>new t.CoreClient(n,e),[t,n,e]);return p.useEffect(()=>()=>{r.disconnect()},[r]),r}var Tv=p.createContext(null);function Jw(n){var{serverUrl:e,options:t,children:r}=n,i=Cx(e,t);return u.jsx(Tv.Provider,{value:i,children:r})}function eg(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function Sx(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){eg(a,r,i,o,s,"next",l)}function s(l){eg(a,r,i,o,s,"throw",l)}o(void 0)})}}var ey=p.createContext(null);function ty(n){var[e,t]=p.useState(null),[r,i]=p.useState(null),a=p.useContext(ey),o=p.useContext(Qd);return p.useEffect(()=>{if(a==null){if(o!=null){t(o),i(null);return}t(null),i(new Error("No API available in useDeferredApi. Was code wrapped in ApiBootstrap or DeferredApiContext.Provider?"));return}var s=!1;function l(){return d.apply(this,arguments)}function d(){return d=Sx(function*(){if(typeof a=="function")try{var h=yield a(n);s||(t(h),i(null))}catch(c){s||(t(null),i(c))}else t(a)}),d.apply(this,arguments)}return l(),()=>{s=!0}},[o,a,n]),[e,r]}var ry=re.memo(n=>{var{children:e,onError:t,options:r}=n,[i,a]=ty(r);return a!=null?(t==null||t(a),null):i==null?null:u.jsx(Qd.Provider,{value:i,children:e})});ry.displayName="DeferredApiBootstrap";function ka(){return Zs(Tv,"No Client available in useClient. Was code wrapped in ClientBootstrap or ClientContext.Provider?")}const wx=Object.freeze(Object.defineProperty({__proto__:null,ApiBootstrap:EO,ApiContext:Qd,ClientBootstrap:Jw,ClientContext:Tv,DeferredApiBootstrap:ry,DeferredApiContext:ey,useApi:It,useClient:ka,useDeferredApi:ty},Symbol.toStringTag,{value:"Module"}));var ny=1e4;function yx(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ny;return new Promise((r,i)=>{var a,o=setTimeout(()=>{var l;(l=a)===null||l===void 0||l(),i(new GS("Timeout looking for variable ".concat(e)))},t);function s(l){var d,h=l.created.find(c=>c.title===e);clearTimeout(o),(d=a)===null||d===void 0||d(),h!=null?r(h):i(new Error("Variable ".concat(e," not found")))}a=n.subscribeToFieldUpdates(s)})}function iy(n){switch(n){case Oe.eq:return"is exactly";case Oe.eqIgnoreCase:return"is exactly (ignore case)";case Oe.notEq:return"is not exactly";case Oe.notEqIgnoreCase:return"is not exactly (ignore case)";case Oe.contains:return"contains";case Oe.notContains:return"does not contain";case Oe.startsWith:return"starts with";case Oe.endsWith:return"ends with";default:throw new Error("Unrecognized text filter type ".concat(n))}}function ay(n){switch(n){case Oe.eq:return"is equal to";case Oe.notEq:return"is not equal to";case Oe.greaterThan:return"greater than";case Oe.greaterThanOrEqualTo:return"greater than or equal to";case Oe.lessThan:return"less than";case Oe.lessThanOrEqualTo:return"less than or equal to";default:throw new Error("Unrecognized number filter type ".concat(n))}}function oy(n){switch(n){case Oe.eq:return"date is";case Oe.notEq:return"date is not";case Oe.notEqIgnoreCase:case Oe.greaterThan:return"date is after";case Oe.greaterThanOrEqualTo:return"date is after or equal";case Oe.lessThan:return"date is before";case Oe.lessThanOrEqualTo:return"date is before or equal";default:throw new Error("Unrecognized date filter type ".concat(n))}}function Ex(n){switch(n){case Oe.isTrue:return"Is True";case Oe.isFalse:return"Is False";case Oe.isNull:return"Is Null";default:throw new Error("Unrecognized boolean filter type ".concat(n))}}function tg(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function Tx(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){tg(a,r,i,o,s,"next",l)}function s(l){tg(a,r,i,o,s,"throw",l)}o(void 0)})}}var ph=te.module("MessageUtils"),sy="io.deephaven.message.LoginOptions.request",ly="io.deephaven.message.SessionDetails.request",dy="io.deephaven.broadcast",Pv="io.deephaven.broadcast.Login",uy="io.deephaven.broadcast.Logout";function uu(n){var e=n;return e!=null&&typeof e.id=="string"&&typeof e.message=="string"}function hy(n){return uu(n)&&n.message===Pv}function cy(n){return uu(n)&&n.message===uy}function vy(n){var e=n;return e!=null&&typeof e.id=="string"}function Ov(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Me(),t=arguments.length>2?arguments[2]:void 0;return{message:n,id:e,payload:t}}function Px(n,e){return{id:n,payload:e}}function Dv(){return window.opener!=null?window.opener:window.parent!=null&&window.parent!==window?window.parent:null}function Iv(n){return ac.apply(this,arguments)}function ac(){return ac=Tx(function*(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3e4,t=Dv();if(t==null)throw new Error("window parent is null, unable to send request.");return new Promise((r,i)=>{var a,o=Me(),s=l=>{var{data:d}=l;if(!vy(d)){ph.debug("Ignoring non-deephaven response",d);return}if(ph.debug("Received message",d),(d==null?void 0:d.id)!==o){ph.debug("Ignore message, id doesn't match",d);return}window.clearTimeout(a),window.removeEventListener("message",s),r(d.payload)};window.addEventListener("message",s),a=window.setTimeout(()=>{window.removeEventListener("message",s),i(new GS("Request timed out"))},e),t.postMessage(Ov(n,o),"*")})}),ac.apply(this,arguments)}function Ox(n,e,t){return e=Dx(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Dx(n){var e=Ix(n,"string");return typeof e=="symbol"?e:String(e)}function Ix(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class my extends Error{constructor(){super(...arguments),Ox(this,"isNoConsolesError",!0)}}function fy(n){return n.isNoConsolesError}function rg(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function hu(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){rg(a,r,i,o,s,"next",l)}function s(l){rg(a,r,i,o,s,"throw",l)}o(void 0)})}}var ho=te.module("SessionUtils");function Rx(n,e){return ho.info("Starting connection to '".concat(e,"'...")),new n.IdeConnection(e)}function gy(n,e,t){return oc.apply(this,arguments)}function oc(){return oc=hu(function*(n,e,t){ho.info("Getting console types...");var r=yield e.getConsoleTypes();if(r.length===0)throw new my("No console types available");ho.info("Available types:",r);var i=r[0];ho.info("Starting session with type",i);var a=yield e.startSession(i),o={type:i,id:Me.generate()};return ho.info("Console session established",o),{session:a,config:o,connection:e,details:t,dh:n}}),oc.apply(this,arguments)}function _x(n,e,t){return ho.info("createCoreClient",e),new n.CoreClient(e,t)}function xx(n){return n!=null&&typeof n=="object"}function Nx(){return sc.apply(this,arguments)}function sc(){return sc=hu(function*(){var n=yield Iv(ly);if(!xx(n))throw new Error("Unexpected session details response: ".concat(n));return n}),sc.apply(this,arguments)}function Mx(){return lc.apply(this,arguments)}function lc(){return lc=hu(function*(){var n=new URLSearchParams(window.location.search);switch(n.get("authProvider")){case"parent":return Nx()}return{}}),lc.apply(this,arguments)}function Fx(n,e,t){return dc.apply(this,arguments)}function dc(){return dc=hu(function*(n,e,t){var r;try{r=yield gy(n,e,t)}catch(i){if(!fy(i))throw i}return r}),dc.apply(this,arguments)}const Ax=Object.freeze(Object.defineProperty({__proto__:null,BROADCAST_CHANNEL_NAME:dy,BROADCAST_LOGIN_MESSAGE:Pv,BROADCAST_LOGOUT_MESSAGE:uy,BooleanColumnFormatter:OD,CharColumnFormatter:DD,DateTimeColumnFormatter:ra,DateUtils:Ma,DecimalColumnFormatter:wr,DefaultColumnFormatter:ID,FETCH_TIMEOUT:ny,Formatter:Jt,FormatterUtils:gi,IntegerColumnFormatter:ki,LOGIN_OPTIONS_REQUEST:sy,NoConsolesError:my,SESSION_DETAILS_REQUEST:ly,StringColumnFormatter:RD,TableColumnFormatter:Is,TableUtils:B,createComboboxFilterArgs:_D,createConnection:Rx,createCoreClient:_x,createFilterConditionFactory:iv,createKeyFromOffsetRow:xD,createNotNullOrEmptyFilterCondition:WS,createOnTableUpdatedHandler:KS,createSearchTextFilter:av,createSelectedValuesFilter:ov,createSessionWrapper:gy,createShowOnlyEmptyFilterCondition:zS,createValueFilter:qS,defaultRowDeserializer:YS,fetchVariableDefinition:yx,generateEmptyKeyedItems:XS,getColumnFormats:ND,getDateTimeFormatterOptions:MD,getSessionDetails:Mx,getSize:sv,getWindowParent:Dv,isBroadcastLoginMessage:hy,isBroadcastLogoutMessage:cy,isClosed:Sd,isCustomColumnFormatDefined:FD,isMessage:uu,isNoConsolesError:fy,isResponse:vy,loadSessionWrapper:Fx,makeMessage:Ov,makeResponse:Px,padFirstAndLastRow:QS,requestParentResponse:Iv},Symbol.toStringTag,{value:"Module"}));function So(n,e,t){return e=Lx(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Lx(n){var e=kx(n,"string");return typeof e=="symbol"?e:String(e)}function kx(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class st extends ZS{static get theme(){return st._theme==null&&(st._theme=JS()),st._theme}static makeRandomSeries(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:100,i=[],a=[],o=[],s=[],l=new Date("2018-06-01"),d=0;d<r;d+=1){var h=new Date(l.getFullYear(),l.getMonth(),l.getDate()+d-r);i.push("".concat(h.getFullYear(),"-").concat(h.getMonth()+1,"-").concat(h.getDate()));var c=(Math.sin(d/r*e)*r/3+Math.cos(d*.2)*r/6+Math.sin(d*.5)*r/10+st.random()*r/5+d*st.smoothing)*t;c=Math.round(c*100)/100,a.push(c),s.push(40+d*st.smoothing),o.push(Math.sin(d/r*e)*r/3+st.random()*r/10+d*st.smoothing)}return{x:i,y:a,s:o,l:s}}static makeScatter(e){return{name:"SCTR",x:e.x,y:e.y,type:"scatter",mode:"markers",hoverinfo:"skip",marker:{size:5}}}static makeArea(e){return{name:"AREA",x:e.x,y:e.s,type:"scatter",mode:"line",fill:"tozeroy",hoverinfo:"all",line:{width:3}}}static makeTrendline(e){return{name:"Trendline <br>R<sup>2</sup> = 0.91",x:e.x,y:e.l,type:"scatter",mode:"line",hoverinfo:"skip",line:{width:3,dash:"dot"}}}static makeErrorBand(e){for(var t=[],r=[],i=0;i<e.y.length;i+=1){var a=e.y[i];t[i]=Math.round((a+18)*100)/100,r[i]=Math.round((a-18)*100)/100}var o=t.concat(r.reverse());return{name:"error",x:e.x.concat(e.x.slice().reverse()),y:o,type:"scatter",mode:"line",hoverinfo:"skip",fill:"toself",line:{width:0,color:st.theme.error_band_line_color,shape:"spline"}}}static makeLine(e){return{name:"LINE",x:e.x,y:e.y,type:"scatter",mode:"line",hoverinfo:"x+y+text+name",line:{width:3}}}static makeRandomData(){var e=st.makeRandomSeries(6),t=st.makeArea(e),r=st.makeTrendline(e),i=st.makeRandomSeries(2),a=st.makeLine(i),o=st.makeErrorBand(i);return[t,r,a,o]}static makeDefaultLayout(e){var t=new tu(e).makeDefaultLayout(st.theme);return t.title="Chart",t.xaxis&&(t.xaxis.title="Datestamp"),t.yaxis&&(t.yaxis.title="Price"),t}constructor(e){var{data:t=st.makeRandomData(),layout:r=st.makeDefaultLayout(e),filterFields:i=[]}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(e),So(this,"data",void 0),So(this,"filterFields",void 0),So(this,"layout",void 0),this.data=t,this.layout=r,this.filterFields=i}getData(){return this.data}getLayout(){return this.layout}getFilterColumnMap(){for(var e=new Map,t=0;t<this.filterFields.length;t+=1){var r=this.filterFields[t],i="java.lang.String";e.set(r,{name:r,type:i})}return e}isFilterRequired(){return this.filterFields.length>0}setFilter(){this.fireUpdate(this.data)}}So(st,"random",Math.random.bind(Math));So(st,"smoothing",1.5);So(st,"_theme",void 0);const jx=st,py=AD(BD);function uc(n){return n.setFigure!==void 0}const $x=Object.freeze(Object.defineProperty({__proto__:null,Chart:lv,ChartModel:ZS,ChartModelFactory:po,ChartThemeContext:LD,ChartThemeProvider:ew,ChartUtils:tu,DownsamplingError:kD,FigureChartModel:jD,MockChartModel:jx,Plot:py,defaultChartTheme:JS,isFigureChartModel:uc,useChartTheme:Js},Symbol.toStringTag,{value:"Module"}));function Hx(n){return function(t){var{children:r}=t;return u.jsx(Qd.Provider,{value:n,children:r})}}var ng=te.module("useTableListener"),Ux=(n,e,t)=>p.useEffect(function(){if(n==null){ng.debug2("Emitter undefined, skipping addEventListener",e);return}return ng.debug2("Adding listener",e),n.addEventListener(e,t)},[n,e,t]);const wo=Ux;function Bx(n,e,t){return e=Vx(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Vx(n){var e=Gx(n,"string");return typeof e=="symbol"?e:String(e)}function Gx(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Wx extends Error{constructor(){super(...arguments),Bx(this,"isColumnNameError",!0)}}const Kx=Wx;function zx(n,e,t){return e=qx(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qx(n){var e=Yx(n,"string");return typeof e=="symbol"?e:String(e)}function Yx(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Xx extends Error{constructor(){super(...arguments),zx(this,"isTableDisconnectError",!0)}}const Qx=Xx;var Ml=te.module("useTable"),Zx=(n,e,t,r)=>{var i=It(),[a,o]=p.useState(void 0),[s,l]=p.useState([]),[d,h]=p.useState(null),[c,v]=p.useState(null);p.useEffect(()=>{if(r===void 0){o(n==null?void 0:n.columns),h(null);return}try{o(n==null?void 0:n.findColumns(r)),h(null)}catch(b){Ml.error("Column not found",b,r),h(new Kx("Invalid columnNames argument"))}},[n,r]),p.useEffect(()=>{if(!a||!n){Ml.debug2("Table or column not initialized, skip viewport update.");return}Ml.debug2("Setting viewport",e,t),n.setViewport(e,t,a)},[a,n,e,t]);var m=p.useCallback(b=>{var{detail:C}=b;if(!a){Ml.error("Columns not initialized.");return}var S=a.map(w=>C.rows.map(E=>E.get(w)));l(S)},[a]),f=p.useCallback(()=>{v(new Qx("Table disconnected"))},[]),g=p.useCallback(()=>{v(null)},[]);return wo(n,i.Table.EVENT_UPDATED,m),wo(n,i.Table.EVENT_DISCONNECT,f),wo(n,i.Table.EVENT_RECONNECT,g),{columns:a,data:s,error:c??d}};const by=Zx;var Jx=(n,e,t,r)=>{var i=p.useMemo(()=>[r],[r]),{columns:a=[],data:o=[],error:s}=by(n,e,t,i);return{column:a[0],data:o[0],error:s}};const Cy=Jx;function ig(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function eN(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){ig(a,r,i,o,s,"next",l)}function s(l){ig(a,r,i,o,s,"throw",l)}o(void 0)})}}var Xn=te.module("TableInput"),bh=250;function Rv(n){var e,t,{className:r=void 0,columnName:i,settings:a,defaultValue:o=[],isInvalid:s=!1,onChange:l=()=>!1,onBlur:d=()=>!1,table:h}=n,c=p.useRef(null),v=It(),m=p.useMemo(()=>{var W=gi.getColumnFormats(a),A=gi.getDateTimeFormatterOptions(a),{defaultDecimalFormatOptions:I={},defaultIntegerFormatOptions:k={}}=a;return new Jt(v,W,A,I,k)},[v,a]),[f,g]=p.useState(""),[b,C]=p.useState(new Set(o)),[S,w]=p.useState(),E=p.useRef(null),y=Math.min((e=S==null?void 0:S.size)!==null&&e!==void 0?e:0,bh),{column:T,data:O,error:R}=Cy(S,0,bh-1,i),P=p.useCallback(W=>T?m.getFormattedString(W,T.type,T.name):"".concat(W),[T,m]),[M,F]=p.useMemo(()=>{var W=new Set(b),A=[];if(O==null)return[A,null];if(O.forEach(k=>{var j="".concat(k),Y=b.has(j);Y&&W.delete(j),A.push({value:j,displayValue:P(k),isSelected:Y})}),W.size>0){Xn.debug2("Selection has items that are missing from the viewport");var I=new Set(b);return Array.from(W).forEach(k=>{I.delete(k)}),[A,I]}return[A,null]},[O,b,P]);p.useEffect(()=>{F!==null&&(C(F),l(Array.from(F)))},[l,F]);var N=p.useCallback(function(){var W=eN(function*(A){try{var I=yield A;Xn.debug("Table resolved",I),w(I)}catch(k){if(De.isCanceled(k))return;Xn.error(k)}});return function(A){return W.apply(this,arguments)}}(),[]);p.useEffect(()=>{var W=De.makeCancelable(h);return N(W),()=>{Xn.debug2("Cancel table promise"),W.cancel()}},[h,N]);var D=p.useCallback(W=>{var{value:A}=W.target;g(A);var I=M.findIndex(j=>j.displayValue.includes(A));if(I>-1){var k;Xn.debug2("Found ".concat(A," at index ").concat(I)),(k=E.current)===null||k===void 0||k.scrollIntoView(I)}else Xn.debug2("".concat(A," not found"))},[M,E]),_=p.useCallback(W=>{if(Xn.debug("handleSelect",W),W>=M.length){Xn.error("Invalid index",W);return}var A=M[W].value,I=new Set(b);M[W].isSelected?I.delete(A):I.add(A),C(I),l(Array.from(I))},[l,M,b]),x=p.useCallback(()=>{var W=M.map(I=>I.value),A=new Set(W);C(A),l(W)},[M,l]),L=p.useCallback(()=>{C(new Set),l([])},[l]),H=p.useCallback(()=>{},[]),G=p.useCallback(W=>{var A,{relatedTarget:I}=W;Xn.debug("handleChildBlur",I,I instanceof HTMLElement,c.current,(A=c.current)===null||A===void 0?void 0:A.contains(I)),(!I||c.current&&I instanceof HTMLElement&&!c.current.contains(I))&&d()},[d]),X=M.length===0;return u.jsxs("div",{ref:c,className:q("table-input-container d-flex flex-column position-relative",r),children:[u.jsx(pi,{disabled:!!R||X,value:f,placeholder:"Search",onChange:D,className:"mb-2 d-flex",onBlur:G}),u.jsx(wv,{className:"table-input-list",disabled:S===void 0||X,isInvalid:s,items:X?[{value:"Empty",isSelected:!1}]:M,itemCount:y,offset:0,onSelect:_,onViewportChange:H,ref:E,onBlur:G}),S&&u.jsxs("div",{className:"meta-row",children:[u.jsx("div",{className:"d-flex align-items-center text-muted small",children:S!=null&&S.size>y&&u.jsxs(u.Fragment,{children:["Table is too large, showing the first ",bh," items."]})}),u.jsxs("div",{children:[u.jsx("button",{type:"button",className:"btn btn-link",onBlur:G,onClick:x,children:"Select All"}),u.jsx("button",{type:"button",className:"btn btn-link mr-a",onBlur:G,onClick:L,children:"Clear"})]})]}),S==null||R&&u.jsx("div",{className:"h-100 w-100 position-absolute",children:u.jsx(tr,{isLoaded:S!=null,isLoading:S==null&&R==null,errorMessage:(t=R==null?void 0:R.message)!==null&&t!==void 0?t:null})})]})}Rv.displayName="TableInput";Rv.defaultProps={isInvalid:!1,className:void 0};var ag=te.module("useBroadcastChannel");function _v(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$D,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:dy,t=p.useMemo(()=>new BroadcastChannel(e),[e]);return p.useEffect(()=>()=>{t.close()},[t]),p.useEffect(()=>{function r(i){var{data:a}=i;if(!uu(a)){ag.debug("Ignoring non-deephaven message",a);return}ag.debug("event received",a),n(i)}return t.addEventListener("message",r),()=>{t.removeEventListener("message",r)}},[t,n]),t}function cu(n,e){var t=p.useCallback(r=>{hy(r.data)?n==null||n(r.data):cy(r.data)&&(e==null||e(r.data))},[n,e]);_v(t)}var Td="io.deephaven.web.client.auth.refreshToken",Sy=p.createContext(null),tN=te.module("RefreshTokenUtils");function hc(){var n=Oo.get(Td);try{if(n!=null)return JSON.parse(n)}catch(e){tN.error("Error parsing refresh token",n,e)}return null}function cc(n){if(n==null){Oo.remove(Td);return}var e=JSON.stringify({bytes:n.bytes,expiry:n.expiry}),t=new Date(n.expiry);Oo.set(Td,e,{secure:!0,sameSite:"strict",expires:t})}function wy(n){var{children:e}=n,t=It(),r=ka(),[i,a]=p.useState(hc());p.useEffect(function(){var d=r.addEventListener(t.CoreClient.EVENT_REFRESH_TOKEN_UPDATED,h=>{var{detail:c}=h;cc(c),a(c)});return d},[t,r,i]);var o=p.useCallback(()=>{a(hc())},[]),s=p.useCallback(()=>{cc(null),a(null)},[]);return cu(o,s),u.jsx(Sy.Provider,{value:i,children:e})}function rN(n){return typeof n=="object"&&n!=null&&"equals"in n&&typeof n.equals=="function"}function nN(n){return"".concat(n)}function yy(n){var{column:e,table:t,filter:r=ye,onChange:i,selectedValue:a,disabled:o,className:s,formatValue:l=nN,maxSize:d=1e3}=n,h=It(),[c,v]=p.useState([]);p.useEffect(()=>{if(t==null){v([]);return}var b=e??t.columns[0];t.applyFilter(r);var C=t.setViewport(0,d,[b]);return C.addEventListener(h.Table.EVENT_UPDATED,S=>{var{detail:w}=S,E=w.rows.map(y=>y.get(b));v(E)}),()=>{C.close()}},[e,h,r,d,t]);var m=p.useMemo(()=>a===void 0?[void 0,...c]:c,[a,c]),f=p.useMemo(()=>m.findIndex(b=>b===a||rN(b)&&b.equals(a)),[a,m]),g=p.useCallback(b=>{i(m[b])},[i,m]);return u.jsx(Dt,{className:s,value:f,onChange:g,disabled:o,children:m.map((b,C)=>u.jsx(Cv,{value:C,children:l(b)},"".concat(C)))})}function bi(){var n=It();return p.useMemo(()=>new B(n),[n])}function iN(n,e,t,r){var i=bi(),[a,o]=p.useState(""),{value:s}=il(a,t),l=p.useCallback(v=>{o(v.trim())},[]),{data:d,isLoading:h}=Ls(i.doesColumnValueExist,[n,e,s,r]),c=h||a!==s?null:d;return{valueTrimmed:a,valueTrimmedDebounced:s,valueExists:c,trimAndUpdateValue:l}}var og=te.module("useDebouncedViewportSearch"),aN=200;function oN(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:aN,r=bi(),{table:i,applyFiltersAndRefresh:a}=n,o=p.useMemo(()=>Qe(s=>{if(og.debug("Applying debounced searchText '".concat(s,"'")),i!=null){var l=s.trim();if(l===""){a([]);return}var d=i.findColumn(e),h=r.makeFilterValue(d.type,l),c=[d.filter().contains(h)];a(c)}},t),[a,e,t,i,r]);return p.useEffect(()=>()=>{og.debug("Cancelling debounced search function"),o.cancel()},[o]),o}var Ey=300;function sN(n){var{viewportData:e,columnName:t,shouldSelectAllOnNoSelection:r,mapItemToValue:i}=n,a=bi(),o=Cw(e,i),{value:s}=il(o,Ey),l=gw(s,uw);return p.useMemo(()=>ov(a,t,l.selection,r,l.isInverted),[t,l,r,a])}function xv(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return p.useMemo(()=>HD(...t.map(i=>i(n))),[n,...t])}function lN(n,e,t,r){var i=p.useRef("");return i.current=t,p.useMemo(()=>{var a=n.length>0&&n[0].item==null;return!a&&r!=null&&(i.current===""||r.toLowerCase().includes(i.current.toLowerCase()))?[{key:r,item:{[e]:r}},...n]:n},[r,e,n])}function sg(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function dN(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){sg(a,r,i,o,s,"next",l)}function s(l){sg(a,r,i,o,s,"throw",l)}o(void 0)})}}function uN(n){var{table:e,columnName:t,defaultValue:r,itemHeight:i,topOffset:a=0,value:o}=n;return p.useCallback(dN(function*(){if(e==null||o===""||o===r)return a;var s=e.findColumn(t),l=yield e.seekRow(0,s,"String",o),d=r==null?0:1;return(l+d)*i+a}),[t,r,i,e,a,o])}function Nv(n){var[,e]=p.useState(0),t=It();return wo(n,t.Table.EVENT_SIZECHANGED,()=>{e(r=>r+1)}),sv(n)}var hN=te.module("useInitializeViewportData");function Ty(n){var e=yw({}),t=Math.max(0,Nv(n));return p.useEffect(()=>{var r=e.items.length;t!==r&&(hN.debug("size changed:",{currentSize:r,targetSize:t}),e.setItems(Array.from(XS(0,t-1))))},[t,n]),e}function Py(n,e,t){return p.useCallback(function(i){var[a,o]=QS(i,e,t,sv(n));n==null||n.setViewport(a,o)},[n,t,e])}var lg=te.module("useViewportData");function Mv(n){var{table:e,itemHeight:t=1,scrollDebounce:r=lI,viewportSize:i=10,viewportPadding:a=50,deserializeRow:o=YS}=n,s=Ty(e),l=Py(e,i,a),d=p.useCallback(g=>{e&&!Sd(e)?l(g):lg.debug("setViewport called on closed table.",e)},[e,l]),h=p.useCallback(g=>{e&&!Sd(e)?(e.applyFilter(g),d(0)):lg.debug("applyFiltersAndRefresh called on closed table.",e)},[d,e]),c=It(),v=p.useMemo(()=>KS(s,o),[o,s]);wo(e,c.Table.EVENT_UPDATED,v);var m=Nv(e);p.useEffect(()=>{d(0)},[e,d,m]);var f=Sw(t,d,r);return p.useMemo(()=>({viewportData:s,size:m,table:e,applyFiltersAndRefresh:h,setViewport:d,onScroll:f}),[h,f,d,m,e,s])}function Fv(n,e){var{applyFiltersAndRefresh:t}=n;p.useEffect(()=>{t(e)},[t,e])}function cN(n,e){for(var t=bi(),[r,i]=p.useState(""),a=p.useMemo(()=>av(t,e,r),[e,r,t]),o=wd(i,Xh),s=Mv({table:n,itemHeight:sI,viewportSize:ow,viewportPadding:sw}),l=arguments.length,d=new Array(l>2?l-2:0),h=2;h<l;h++)d[h-2]=arguments[h];var c=xv(s.table,a,...d);return Fv(s,c),{list:s,onSearchTextChange:o}}function vN(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"or",t=bi(),r=p.useMemo(()=>WS(t),[t]);return p.useMemo(()=>iv(n,r,e),[n,e,r])}function Oy(n){p.useEffect(()=>()=>{n!=null&&(Sd(n)||n.close())},[n])}function mN(n){var{maybeTable:e,columnName:t,mapItemToValue:r,filterConditionFactories:i=[],trimSearchText:a=!1}=n,o=bi(),[s,l]=p.useState(""),[d,h]=p.useState(""),c=p.useCallback(G=>{h(a?G.trim():G)},[a]),v=p.useMemo(()=>a?s.trim():s,[s,a]),[m,f]=p.useState(null),[g,b]=p.useState(()=>new Map),{data:C,isLoading:S}=Ls(o.doesColumnValueExist,[e,t,d,!1]),{isDebouncing:w}=il(d,Xh),E=w||S?null:C,y=p.useMemo(()=>av(o,t,d),[d,t,o]),T=p.useMemo(()=>ov(o,t,new Set(g.keys()),!1,!0),[t,g,o]),{data:O}=Ls(o.createDistinctSortedColumnTable,[e,t,"asc",...i]);Oy(O);var R=Mv({table:O,itemHeight:oI,viewportSize:ow,viewportPadding:sw}),P=v.length>0&&R.size===0,M=g.has(v),F=wd(c,Xh),N=p.useCallback(G=>{l(G),F(G)},[F]),D=wd(f,0),_=p.useCallback(G=>{if(l(""),c(""),f(G),D(null),G!=null){var X=R.viewportData.findItem(G);if(X!=null){var W=r(X);b(A=>{var I=new Map(A);return I.set(W,{value:W}),I})}}},[c,D,R.viewportData,r]),x=p.useCallback(G=>{b(X=>{if(G.size===0)return X;var W=new Map(X);for(var A of G)W.set(A,{value:A});return W})},[]),L=p.useCallback(G=>{b(X=>{if(G==="all")return new Map;var W=new Map(X);for(var A of G)W.delete(A);return W})},[]),H=xv(R.table,y,T);return Fv(R,H),p.useMemo(()=>({list:R,hasSearchTextWithZeroResults:P,searchText:s,searchTextExists:E,searchTextIsInSelectedValues:M,selectedKey:m,selectedValueMap:g,onSearchTextChange:N,onSelectKey:_,onAddValues:x,onRemoveValues:L}),[P,R,x,L,N,_,s,E,M,m,g])}function dg(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function fN(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){dg(a,r,i,o,s,"next",l)}function s(l){dg(a,r,i,o,s,"throw",l)}o(void 0)})}}function gN(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];var i=p.useCallback(fN(function*(){var d;return(d=n==null?void 0:n.selectDistinct(n.findColumns(t)))!==null&&d!==void 0?d:null}),[n,...t]),{data:a,error:o,isError:s,isLoading:l}=Ls(i,[]);return p.useEffect(()=>()=>{a==null||a.close()},[a]),{distinctTable:a,error:o,isError:s,isLoading:l}}function pN(n,e){var t=bi(),r=p.useMemo(()=>zS(t,n),[n,t]);return p.useMemo(()=>iv(e,r),[e,r])}function bN(n,e,t){var r=bi();return p.useMemo(()=>qS(r,n,e,t),[n,t,r,e])}const CN=Object.freeze(Object.defineProperty({__proto__:null,ConnectionContext:tw,DEBOUNCE_MS:Ey,REFRESH_TOKEN_KEY:Td,RefreshTokenBootstrap:wy,RefreshTokenContext:Sy,TableDropdown:yy,TableInput:Rv,makeApiContextWrapper:Hx,readRefreshToken:hc,storeRefreshToken:cc,useBroadcastChannel:_v,useBroadcastLoginListener:cu,useCheckIfExistsValue:iN,useConnection:rw,useDebouncedViewportSearch:oN,useDebouncedViewportSelectionFilter:sN,useFilterConditionFactories:xv,useFilteredItemsWithDefaultValue:lN,useGetItemPosition:uN,useInitializeViewportData:Ty,useNotNullOrEmptyFilter:vN,usePickerWithSelectedValues:mN,useSearchableViewportData:cN,useSelectDistinctTable:gN,useSetPaddedViewportCallback:Py,useShowOnlyEmptyFilter:pN,useTable:by,useTableClose:Oy,useTableColumn:Cy,useTableListener:wo,useTableSize:Nv,useTableUtils:bi,useValueFilter:bN,useViewportData:Mv,useViewportFilter:Fv},Symbol.toStringTag,{value:"Module"}));var Dy=p.createContext(!1);function SN(n){var{fontClassNames:e=["fira-sans-regular","fira-sans-semibold","fira-mono"],children:t}=n,[r,i]=p.useState(!1);return p.useEffect(function(){document.fonts.ready.then(()=>{i(!0)})},[]),u.jsxs(u.Fragment,{children:[u.jsx(Dy.Provider,{value:r,children:t}),u.jsx("div",{id:"preload-fonts",style:{visibility:"hidden",position:"absolute",top:-1e4},children:e.map(a=>u.jsx("p",{className:a,children:"preload"},a))})]})}var sl=p.createContext(null),rr=Object.freeze({AUTH_PLUGIN:"AuthPlugin",DASHBOARD_PLUGIN:"DashboardPlugin",WIDGET_PLUGIN:"WidgetPlugin",TABLE_PLUGIN:"TablePlugin",THEME_PLUGIN:"ThemePlugin"});function Iy(n){return"DashboardPlugin"in n}function Pd(n){return"AuthPlugin"in n}function Av(n){return"TablePlugin"in n}function Ry(n){return Iy(n)||Pd(n)||Av(n)}function wN(n){return"type"in n&&n.type===rr.DASHBOARD_PLUGIN}function ll(n){return"type"in n&&n.type===rr.WIDGET_PLUGIN}function _y(n){return"type"in n&&n.type===rr.TABLE_PLUGIN}function xy(n){return"type"in n&&n.type===rr.AUTH_PLUGIN}function Ny(n){return"type"in n&&n.type===rr.THEME_PLUGIN}var yN=te.module("@deephaven/plugin.PluginUtils");function vc(n,e){return n==null||!ll(n)?!1:[n.supportedTypes].flat().some(t=>t===e)}function My(n){var e=u.jsx(oe,{icon:FS});if(!ll(n))return e;var{icon:t}=n;return t==null?e:p.isValidElement(t)?t:u.jsx(oe,{icon:t})}function Fy(n){var e=[...n.entries()].filter(t=>Ny(t[1]));return yN.debug("Getting theme data from plugins",e),e.map(t=>{var[r,i]=t,a=Array.isArray(i.themes)?i.themes:[i.themes];return a.map(o=>{var{name:s,baseTheme:l,styleContent:d}=o;return{baseThemeKey:"default-".concat(l??"dark"),themeKey:MS(r,s),name:s,styleContent:d}})}).flat()}function vu(){return Zs(sl,"No Plugins available in usePlugins. This can happen when plugins have not finished loading or if code is not wrapped in PluginsContext.Provider.")}function EN(n){var{fetch:e,type:t}=n,r=vu(),i=p.useMemo(()=>[...r.values()].filter(ll).find(o=>[o.supportedTypes].flat().includes(t)),[r,t]);if(i!=null){var a=i.component;return u.jsx(a,{fetch:e})}throw new Error("Unknown widget type '".concat(t,"'"))}const TN=Object.freeze(Object.defineProperty({__proto__:null,PluginType:rr,PluginsContext:sl,WidgetView:EN,getIconForPlugin:My,getThemeDataFromPlugins:Fy,isAuthPlugin:xy,isDashboardPlugin:wN,isLegacyAuthPlugin:Pd,isLegacyDashboardPlugin:Iy,isLegacyPlugin:Ry,isLegacyTablePlugin:Av,isTablePlugin:_y,isThemePlugin:Ny,isWidgetPlugin:ll,pluginSupportsType:vc,usePlugins:vu},Symbol.toStringTag,{value:"Module"}));function PN(n){if(n==null)return!1;var e=n;return e.Component!==void 0&&typeof e.isAvailable=="function"}var Ay="io.deephaven.auth.AnonymousAuthenticationHandler",ON="io.deephaven.authentication.psk.PskAuthenticationHandler";function ug(n,e,t){return e=DN(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function DN(n){var e=IN(n,"string");return typeof e=="symbol"?e:String(e)}function IN(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class RN extends Error{constructor(){super(...arguments),ug(this,"name","AuthenticationError"),ug(this,"isAuthenticationError",!0)}}const Ly=RN;function hg(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function _N(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){hg(a,r,i,o,s,"next",l)}function s(l){hg(a,r,i,o,s,"throw",l)}o(void 0)})}}var cg=te.module("AuthPluginBase");function Lv(n){var{children:e,getLoginOptions:t}=n,r=ka(),[i,a]=p.useState(),[o,s]=p.useState(!1);return p.useEffect(()=>{var l=!1;function d(){if(l)throw new dv("Login canceled.")}function h(){return c.apply(this,arguments)}function c(){return c=_N(function*(){try{var v=yield t();d(),cg.info("Logging in..."),yield r.login(v),d(),s(!0)}catch(g){if(!l){var m;cg.error("Unable to login:",g);var f=(m=Io(g))!==null&&m!==void 0?m:"Unable to login. Verify credentials.";a(new Ly(f)),s(!1)}}}),c.apply(this,arguments)}return h(),()=>{l=!0}},[r,t]),o?u.jsx(u.Fragment,{children:e}):u.jsx(tr,{"data-testid":"auth-base-loading",isLoading:i==null,isLoaded:!1,errorMessage:Io(i)})}var ky=p.createContext({}),mu=p.createContext({}),kv=p.createContext(null),xN={canLogout:!1};function NN(n){var{children:e}=n,t=It(),r=p.useCallback(()=>({type:t.CoreClient.LOGIN_TYPE_ANONYMOUS}),[t]);return u.jsx(Lv,{getLoginOptions:r,children:u.jsx(mu.Provider,{value:xN,children:e})})}var MN={Component:NN,isAvailable:n=>n.includes(Ay)};const jy=MN;function vg(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function FN(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){vg(a,r,i,o,s,"next",l)}function s(l){vg(a,r,i,o,s,"throw",l)}o(void 0)})}}var AN=te.module("AuthPluginParent"),LN={canLogout:!1};function kN(n){return n!=null&&typeof n.type=="string"}function jN(){return mc.apply(this,arguments)}function mc(){return mc=FN(function*(){AN.info("Logging in by delegating to parent window...");var n=yield Iv(sy);if(!kN(n))throw new Error("Unexpected login options response: ".concat(n));return n}),mc.apply(this,arguments)}function $N(){var n;return(n=new URLSearchParams(window.location.search).get("authProvider"))!==null&&n!==void 0?n:""}function HN(n){var{children:e}=n;return u.jsx(Lv,{getLoginOptions:jN,children:u.jsx(mu.Provider,{value:LN,children:e})})}var UN={Component:HN,isAvailable:()=>Dv()!=null&&$N()==="parent"};const $y=UN;function Hy(n){var{children:e,errorMessage:t,isLoggingIn:r=!1,onSubmit:i}=n;return u.jsxs("form",{className:"login-form",onSubmit:a=>{a.preventDefault(),a.stopPropagation(),i==null||i(a)},children:[u.jsx("div",{className:"flex-spacer"}),u.jsxs("div",{className:"flex-wrapper",children:[u.jsx("fieldset",{disabled:r,className:"container-fluid",children:e}),u.jsx("div",{className:"form-group d-flex justify-content-end align-items-center mb-0",children:u.jsxs("button",{type:"submit",className:q("btn btn-primary",{"btn-spinner":r},{"btn-cancelable":r}),"data-testid":"btn-login",children:[r&&u.jsxs("span",{children:[u.jsx(Un,{className:"mr-2 loading-spinner-vertical-align"}),u.jsx("span",{className:"btn-normal-content",children:"Logging in"}),u.jsx("span",{className:"btn-hover-content",children:"Cancel"})]}),!r&&"Login"]})})]}),u.jsx("div",{className:"flex-spacer",children:t!=null&&u.jsx("p",{className:"error-message mb-0",role:"alert",children:"".concat(t)})})]})}function Uy(n){var{children:e,logoPath:t="./logo.png"}=n;return u.jsxs("div",{className:"login-container",children:[u.jsx(zw,{}),u.jsxs("div",{className:"login-box",children:[u.jsx("div",{className:"logo",children:u.jsx("img",{src:t,alt:"Deephaven Data Labs"})}),e,u.jsxs("p",{className:"footer",children:["© 2016-",new Date().getFullYear()," Deephaven Data Labs LLC. Patent Pending."]})]})]})}function mg(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function Ch(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){mg(a,r,i,o,s,"next",l)}function s(l){mg(a,r,i,o,s,"throw",l)}o(void 0)})}}var fc="io.deephaven.authentication.psk.PskAuthenticationHandler",By="psk",gc="io.deephaven.web.client.auth.psk.token",co=te.module("AuthPluginPsk");function BN(){return new URLSearchParams(window.location.search).get(By)}function VN(){co.debug2("clearWindowToken");var n=new URL(window.location.href);n.searchParams.delete(By),window.history.replaceState(null,"",n.href)}function fg(){var n;return(n=Oo.get(gc))!==null&&n!==void 0?n:null}function Sh(n){co.debug2("Storing token in cookie",n),n!=null?Oo.set(gc,n,{secure:!0,sameSite:"strict"}):Oo.remove(gc)}function GN(n){var{children:e,logoPath:t}=n,r=ka(),i=p.useRef(null),a=p.useRef(null),[o,s]=p.useState(),[l,d]=p.useState(!1),[h,c]=p.useState(!1),[v,m]=p.useState(!1),[f,g]=p.useState(""),b=p.useCallback(function(){var y=Ch(function*(T){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;co.info("Logging in..."),m(!0);var R=null;try{if(R=r.login({type:fc,token:T}),a.current=R,yield R,co.info("Logged in successfully"),a.current!==R)return;Sh(T),c(!0)}catch(F){if(a.current!==R)return;if(d(!0),O){var P;co.error("Unable to login",F);var M=(P=Io(F))!==null&&P!==void 0?P:"Unable to login: Verify credentials.";s(new Ly(M))}}m(!1)});return function(T){return y.apply(this,arguments)}}(),[r]),C=p.useCallback(()=>{a.current=null,m(!1)},[]),S=p.useCallback(Ch(function*(){co.debug("onLogin");var y=fg();h||v||y==null||b(y,!1)}),[h,v,b]),w=p.useCallback(()=>{Sh(null)},[]);cu(S,w),p.useEffect(()=>{var y=!1;function T(){return O.apply(this,arguments)}function O(){return O=Ch(function*(){var R,P=(R=BN())!==null&&R!==void 0?R:fg();if(VN(),P==null){d(!0);return}m(!0);try{yield r.login({type:fc,token:P}),y||(Sh(P),c(!0),m(!1))}catch{y||(d(!0),m(!1))}}),O.apply(this,arguments)}return T(),()=>{y=!0}},[r]);var E=p.useCallback(()=>{v?C():b(f)},[C,v,b,f]);return p.useEffect(function(){var T;(T=i.current)===null||T===void 0||T.focus()},[i,l]),u.jsxs(u.Fragment,{children:[h&&e,l&&u.jsx(kt,{in:!h,timeout:qe.transitionMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:u.jsx(Uy,{logoPath:t,children:u.jsx(Hy,{errorMessage:Io(o),isLoggingIn:v,onSubmit:E,children:u.jsxs("div",{className:"form-group",children:[u.jsx("label",{htmlFor:"auth-psk-token-input",children:"Token"}),u.jsx("input",{id:"auth-psk-token-input",name:"token",className:"input-token form-control",type:"text",autoComplete:"username",autoCapitalize:"none",autoCorrect:"off",spellCheck:"false",ref:i,value:f,onChange:y=>{s(void 0),g(y.target.value)}})]})})})}),u.jsx(tr,{"data-testid":"auth-psk-loading",isLoaded:h||l,isLoading:!h&&!l})]})}var WN={Component:GN,isAvailable:n=>n.includes(fc)};const Vy=WN;function gg(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 wh(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?gg(Object(t),!0).forEach(function(r){KN(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):gg(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function KN(n,e,t){return e=zN(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function zN(n){var e=qN(n,"string");return typeof e=="symbol"?e:String(e)}function qN(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var YN=te.module("UserUtils");function Gy(n,e){return n.get("internal.webClient.appInit.".concat(e))}function Wy(n){var e,t,r,i,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};function s(b){return Gy(n,b)}function l(b,C){var S=s(b);return S==="true"?!0:S==="false"?!1:(S!==void 0&&YN.warn("Unexpected value for ".concat(b,": ").concat(S)),C)}var d=(e=s("name"))!==null&&e!==void 0?e:"",h=(t=s("operateAs"))!==null&&t!==void 0?t:d,c=(r=(i=s("groups"))===null||i===void 0?void 0:i.split(","))!==null&&r!==void 0?r:[],v=l("canCopy",!0),m=l("canDownloadCsv",!0),f=l("canUsePanels",!0),g=l("canLogout",!0);return wh(wh({name:d,operateAs:h,groups:c},a),{},{permissions:wh({canUsePanels:f,canCopy:v,canDownloadCsv:m,canLogout:g},o)})}const XN=Object.freeze(Object.defineProperty({__proto__:null,AUTH_HANDLER_TYPE_ANONYMOUS:Ay,AUTH_HANDLER_TYPE_PSK:ON,AuthPluginAnonymous:jy,AuthPluginBase:Lv,AuthPluginParent:$y,AuthPluginPsk:Vy,Login:Uy,LoginForm:Hy,UserContext:kv,UserOverrideContext:ky,UserPermissionsOverrideContext:mu,getAppInitValue:Gy,getUserFromConfig:Wy,isAuthPlugin:PN},Symbol.toStringTag,{value:"Module"}));var Ky=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 zy(n){return n.componentName!==void 0}function QN(n){return n.component!==void 0}var qy=Object.freeze({type:"default",isClosable:!0,isFocusOnShow:!0,reorderEnabled:!0,title:""});const ZN=Object.freeze(Object.defineProperty({__proto__:null,defaultConfig:Ky,isGLComponentConfig:zy,isReactComponentConfig:QN,itemDefaultConfig:qy},Symbol.toStringTag,{value:"Module"}));function hd(n,e,t){return e=JN(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function JN(n){var e=eM(n,"string");return typeof e=="symbol"?e:String(e)}function eM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ks{constructor(){hd(this,"_mSubscriptions",void 0),hd(this,"off",this.unbind),hd(this,"trigger",this.emit),this._mSubscriptions={},this._mSubscriptions[ks.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),a=1;a<r;a++)i[a-1]=arguments[a];if(t)for(var o=0;o<t.length;o++){var s=t[o].ctx||{};try{t[o].fn.apply(s,i)}catch(c){console.error("Error while emitting event:",c)}}i.unshift(e);for(var l=this._mSubscriptions[ks.ALL_EVENT],d=0;d<l.length;d++){var h=l[d].ctx||{};try{l[d].fn.apply(h,i)}catch(c){console.error("Error while emitting event to allEventSubs:",c)}}}unbind(e,t,r){if(!this._mSubscriptions[e])throw new Error("No subscriptions to unsubscribe for event "+e);for(var i=!1,a=0;a<this._mSubscriptions[e].length;a++)(!t||this._mSubscriptions[e][a].fn===t)&&(!r||r===this._mSubscriptions[e][a].ctx)&&(this._mSubscriptions[e].splice(a,1),i=!0);if(i===!1)throw new Error("Nothing to unbind for "+e)}}hd(ks,"ALL_EVENT","__all");const En=ks;function dn(n,e,t){return e=tM(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function tM(n){var e=rM(n,"string");return typeof e=="symbol"?e:String(e)}function rM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class pc extends En{constructor(e,t,r){super(),dn(this,"width",void 0),dn(this,"height",void 0),dn(this,"title",void 0),dn(this,"parent",void 0),dn(this,"layoutManager",void 0),dn(this,"tab",void 0),dn(this,"_config",void 0),dn(this,"isHidden",!1),dn(this,"beforeCloseHandler",void 0),dn(this,"_element",fe(['<div class="lm_item_container">','<div class="lm_content" tabindex="-1"></div>',"</div>"].join(""))),dn(this,"_contentElement",void 0),this.title=zy(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,a,o=this.parent,s=null;o&&!o.isColumn&&!o.isRow;){var l;if(s=o,o=o.parent,(l=o)!==null&&l!==void 0&&l.isRoot)return!1}if(!o||!s)return!1;for(var d=o.isColumn?"height":"width",h=d==="height"?t:e,c=((r=this[d])!==null&&r!==void 0?r:0)*(1/(((i=s.config[d])!==null&&i!==void 0?i:0)/100)),v=h/c*100,m=(((a=s.config[d])!==null&&a!==void 0?a:0)-v)/(o.contentItems.length-1),f=0;f<o.contentItems.length;f++)if(o.contentItems[f]===s)o.contentItems[f].config[d]=v;else{var g;o.contentItems[f].config[d]=((g=o.contentItems[f].config[d])!==null&&g!==void 0?g:0)+m}return o.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}extendState(e){this.setState(fe.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,a=r.offsetHeight-r.clientHeight;this._contentElement.width(this.width-i).height(this.height-a),this.emit("resize")}}}const nM=Object.freeze(Object.defineProperty({__proto__:null,Container:pc,ItemContainer:pc},Symbol.toStringTag,{value:"Module"}));function Yy(n){var e=location.hash.match(new RegExp(n+"=([^&]*)"));return e?e[1]:null}function Xy(n){if(window.location.hash)return Yy(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 jv(n){return window.requestAnimationFrame(n)}function iM(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 $v(){return(Math.random()*1e15).toString(36).replace(".","")}function aM(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 Hv(n){return fe.trim(n.replace(/(<([^>]+)>)/gi,""))}function Cr(n,e,t){return e=oM(e),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:String(e)}function sM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class lM extends En{constructor(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super(),Cr(this,"_eElement",void 0),Cr(this,"_oDocument",void 0),Cr(this,"_eBody",void 0),Cr(this,"_destroyAfterMouseUp",void 0),Cr(this,"_nDelay",400),Cr(this,"_timeout",void 0),Cr(this,"timeout",void 0),Cr(this,"_nDistance",10),Cr(this,"_nX",0),Cr(this,"_nY",0),Cr(this,"_nOriginalX",0),Cr(this,"_nOriginalY",0),Cr(this,"_bDragging",!1),this._eElement=e,this._oDocument=fe(document),this._eBody=fe(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,a,o=this._getCoordinates(e);this._nOriginalX=(t=o.x)!==null&&t!==void 0?t:0,this._nOriginalY=(r=o.y)!==null&&r!==void 0?r:0,(i=this._oDocument)===null||i===void 0||i.on("mousemove",this.onMouseMove),(a=this._oDocument)===null||a===void 0||a.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,a,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||(a=i.find("iframe"))===null||a===void 0||a.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,i;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||(i=r.find("iframe"))===null||i===void 0||i.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}}}const dl=lM;function Za(n,e,t){return e=dM(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function dM(n){var e=uM(n,"string");return typeof e=="symbol"?e:String(e)}function uM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Qy{constructor(e,t){Za(this,"_container",void 0),Za(this,"_reactComponent",null),Za(this,"_portalComponent",null),Za(this,"_originalComponentWillUpdate",null),Za(this,"_initialState",void 0),Za(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=Yd.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=fe.extend(e,this._container._config.props);return re.createElement(this._reactClass,t)}}var Od=["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"],hM=[!0,!1,"row","column","stack","component","close","maximise","minimise","open in new window"];function Uv(n){if(Od.length>36)throw new Error("Too many keys in config minifier map");var e={};return Bv(n,e,"_min"),e}function bc(n){if(Od.length>36)throw new Error("Too many keys in config minifier map");var e={};return Bv(n,e,"_max"),e}function Bv(n,e,t){var r=t==="_min"?cM:vM;for(var i in n)if(n.hasOwnProperty(i)){var a=Array.isArray(n)?n[Number.parseInt(i,10)]:n[i];if(typeof a=="object"&&a!=null){var o=a instanceof Array?[]:{};if(Array.isArray(e))e[Number.parseInt(i,10)]=o;else{var s=r(i,Od);e[s]=o}Bv(a,o,t)}else{var l=r(a,hM);if(Array.isArray(e))e[Number.parseInt(i,10)]=l;else{var d=r(i,Od);e[d]=l}}}}function cM(n,e){if(typeof n=="string"&&n.length===1)return"___"+n;var t=e.indexOf(n);return t===-1?n:t.toString(36)}function vM(n,e){return typeof n=="string"&&n.length===1?e[parseInt(n,36)]:typeof n=="string"&&n.substr(0,3)==="___"?n[3]:n}function yh(n,e,t){return e=mM(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mM(n){var e=fM(n,"string");return typeof e=="symbol"?e:String(e)}function fM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Cc{constructor(e,t){yh(this,"name",void 0),yh(this,"origin",void 0),yh(this,"isPropagationStopped",void 0),this.name=e,this.origin=t,this.isPropagationStopped=!1}stopPropagation(){this.isPropagationStopped=!0}}function Fl(n,e,t){return e=gM(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function gM(n){var e=pM(n,"string");return typeof e=="symbol"?e:String(e)}function pM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}let bM=class extends En{constructor(e){super(),Fl(this,"_layoutManager",void 0),Fl(this,"_dontPropagateToParent",void 0),Fl(this,"_childEventSource",void 0),Fl(this,"_boundOnEventFromChild",void 0),this._layoutManager=e,this._dontPropagateToParent=null,this._childEventSource=null,this.on(En.ALL_EVENT,this._onEventFromThis.bind(this)),this._boundOnEventFromChild=this._onEventFromChild.bind(this),fe(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(){fe(window).off("gl_child_event",this._boundOnEventFromChild)}};const Zy=bM,CM=Object.freeze(Object.defineProperty({__proto__:null,BubblingEvent:Cc,DragListener:dl,EventEmitter:En,EventHub:Zy,ReactComponentHandler:Qy,animFrame:jv,filterXss:aM,getHashValue:Yy,getQueryStringParam:Xy,getUniqueId:$v,minifyConfig:Uv,removeFromArray:iM,stripTags:Hv,unminifyConfig:bc},Symbol.toStringTag,{value:"Module"}));function Di(n,e,t){return e=SM(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function SM(n){var e=wM(n,"string");return typeof e=="symbol"?e:String(e)}function wM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Jy extends En{constructor(e,t,r,i,a){super(),Di(this,"isInitialised",!1),Di(this,"_config",void 0),Di(this,"_dimensions",void 0),Di(this,"_parentId",void 0),Di(this,"_indexInParent",void 0),Di(this,"_layoutManager",void 0),Di(this,"_popoutWindow",null),Di(this,"_id",null),this._config=e,this._dimensions=t,this._parentId=r,this._indexInParent=i,this._layoutManager=a,this._createWindow()}toConfig(){var e,t,r,i,a,o,s,l,d,h,c;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=(a=this._popoutWindow)===null||a===void 0?void 0:a.screenX)!==null&&i!==void 0?i:(o=this._popoutWindow)===null||o===void 0?void 0:o.screenLeft)!==null&&r!==void 0?r:0,top:(s=(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&&s!==void 0?s:0},content:(c=this.getGlInstance())===null||c===void 0?void 0:c.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=fe.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 a;((a=this._layoutManager.root.contentItems.length)!==null&&a!==void 0?a: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;fe(this._popoutWindow).on("load",this._positionWindow.bind(this)).on("unload beforeunload",this._onClose.bind(this));var a=window.setInterval(()=>{var o;(o=this._popoutWindow)!==null&&o!==void 0&&o.__glInstance&&this._popoutWindow.__glInstance.isInitialised&&(this._onInitialised(),window.clearInterval(a))},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-"+$v();e=Uv(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 Nt(n,e,t){return e=yM(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yM(n){var e=EM(n,"string");return typeof e=="symbol"?e:String(e)}function EM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ja extends En{constructor(e,t,r,i,a,o){var s,l,d,h,c,v,m,f;if(super(),Nt(this,"_dragListener",void 0),Nt(this,"_layoutManager",void 0),Nt(this,"_contentItem",void 0),Nt(this,"_originalParent",void 0),Nt(this,"_area",null),Nt(this,"_lastValidArea",null),Nt(this,"_minX",void 0),Nt(this,"_maxX",void 0),Nt(this,"_minY",void 0),Nt(this,"_maxY",void 0),Nt(this,"_width",void 0),Nt(this,"_height",void 0),Nt(this,"_sided",void 0),Nt(this,"element",void 0),Nt(this,"childElementContainer",void 0),Nt(this,"_proxyTab",void 0),this._dragListener=r,this._layoutManager=i,this._contentItem=a,this._originalParent=o,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=fe(ja._template),o&&o._side&&(this._sided=o._sided,this.element.addClass("lm_"+o._side),["right","bottom"].indexOf(o._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",Hv((s=this._contentItem.config.title)!==null&&s!==void 0?s:"")),this.element.find(".lm_title").html((l=this._contentItem.config.title)!==null&&l!==void 0?l:""),this.childElementContainer=this.element.find(".lm_content"),this.childElementContainer.append(a.element),this._updateTree(),this._layoutManager._$calculateItemAreas(),fe(document.body).append(this.element),this._setDimensions(),!this._contentItem.tab&&this._proxyTab.length){var C,S;this._layoutManager.tabDropPlaceholder.width((C=this._proxyTab.outerWidth(!0))!==null&&C!==void 0?C:0),this._layoutManager.tabDropPlaceholder.height((S=this._proxyTab.outerHeight(!0))!==null&&S!==void 0?S:0)}var w=this._layoutManager.container.offset();this._minX=(d=w==null?void 0:w.left)!==null&&d!==void 0?d:0,this._minY=(h=w==null?void 0:w.top)!==null&&h!==void 0?h:0,this._maxX=((c=this._layoutManager.container.width())!==null&&c!==void 0?c:0)+this._minX,this._maxY=((v=this._layoutManager.container.height())!==null&&v!==void 0?v:0)+this._minY,this._width=(m=this.element.width())!==null&&m!==void 0?m: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,a,o=(i=r.pageX)!==null&&i!==void 0?i:0,s=(a=r.pageY)!==null&&a!==void 0?a:0,l=o>this._minX&&o<this._maxX&&s>this._minY&&s<this._maxY;!l&&this._layoutManager.config.settings.constrainDragToContainer===!0||this._setDropPosition(o,s)}_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")}}Nt(ja,"_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 Al(n,e,t){return e=TM(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function TM(n){var e=PM(n,"string");return typeof e=="symbol"?e:String(e)}function PM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class e0{constructor(e,t,r){Al(this,"_element",void 0),Al(this,"_itemConfig",void 0),Al(this,"_layoutManager",void 0),Al(this,"_dragListener",void 0),this._element=e,this._itemConfig=t,this._layoutManager=r,this._dragListener=this._createDragListener()}_createDragListener(){return this._dragListener=new dl(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(fe.extend(!0,{},r));new ja(e,t,this._dragListener,this._layoutManager,i,null)}}function Ll(n,e,t){return e=OM(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function OM(n){var e=DM(n,"string");return typeof e=="symbol"?e:String(e)}function DM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class t0{constructor(e,t,r){Ll(this,"_element",fe(window)),Ll(this,"_itemConfig",void 0),Ll(this,"_layoutManager",void 0),Ll(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 dl(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(fe.extend(!0,{},r));new ja(e,t,this._dragListener,this._layoutManager,i,null)}}}function r0(n,e,t){return e=IM(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function IM(n){var e=RM(n,"string");return typeof e=="symbol"?e:String(e)}function RM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ul{constructor(){r0(this,"element",fe(ul._template)),fe(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()}}r0(ul,"_template",'<div class="lm_dropTargetIndicator"><div class="lm_inner"></div></div>');function Eh(n,e,t){return e=_M(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _M(n){var e=xM(n,"string");return typeof e=="symbol"?e:String(e)}function xM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class bs{constructor(e,t,r,i){Eh(this,"element",void 0),Eh(this,"_header",void 0),Eh(this,"_action",void 0),this._header=e,this.element=fe('<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 NM(n,e,t){return e=MM(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function MM(n){var e=FM(n,"string");return typeof e=="symbol"?e:String(e)}function FM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class AM extends Error{constructor(e,t){super(),NM(this,"node",void 0),this.name="Configuration Error",this.message=e,this.node=t}}const Da=AM,LM=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationError:Da},Symbol.toStringTag,{value:"Module"}));function Ot(n,e,t){return e=kM(e),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:String(e)}function jM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function js(n){return n.isStack}function Dr(n){return n.isComponent}function n0(n){return n.isRoot}class Lt extends En{constructor(e,t,r,i){super(),Ot(this,"config",void 0),Ot(this,"type",void 0),Ot(this,"contentItems",void 0),Ot(this,"parent",void 0),Ot(this,"layoutManager",void 0),Ot(this,"element",void 0),Ot(this,"childElementContainer",void 0),Ot(this,"componentName",void 0),Ot(this,"isInitialised",!1),Ot(this,"isMaximised",!1),Ot(this,"isRoot",!1),Ot(this,"isRow",!1),Ot(this,"isColumn",!1),Ot(this,"isStack",!1),Ot(this,"isComponent",!1),Ot(this,"tab",void 0),Ot(this,"_pendingEventPropagations",void 0),Ot(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(En.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 a=0;a<this.contentItems.length;a++)this.contentItems[a].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 a;(a=this.parent)===null||a===void 0||a.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),a=e.element[0].parentNode;if(i===-1)throw new Error("Can't replace child. oldChild is not child of this");a==null||a.replaceChild(t.element[0],e.element[0]),r===!0&&(e.parent=null,e._$destroy()),this.contentItems[i]=t,t.parent=this,js(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 i(a){for(var o=0;o<a.contentItems.length;o++)e(a.contentItems[o])===!0&&t.push(a.contentItems[o]),i(a.contentItems[o])};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&&Dr(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 a=(t=e.offset())!==null&&t!==void 0?t:{left:0,top:0},o=(r=e.width())!==null&&r!==void 0?r:0,s=(i=e.height())!==null&&i!==void 0?i:0;return{x1:a.left,y1:a.top,x2:a.left+o,y2:a.top+s,surface:o*s,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 Cc(e,this);this.emit(e,t)}_createContentItems(e){var t;if(!(e.content instanceof Array))throw new Da("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(qy)){var i=t;e[i]===void 0&&(e[i]=r)}return e}_propagateEvent(e,t){t instanceof Cc&&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,jv(this._propagateEventToLayoutManager.bind(this,e,t)))}_propagateEventToLayoutManager(e,t){this._pendingEventPropagations[e]=!1,this.layoutManager.emit(e,t)}}function ns(n,e,t){return e=$M(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function $M(n){var e=HM(n,"string");return typeof e=="symbol"?e:String(e)}function HM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class i0 extends Lt{constructor(e,t,r){super(e,t,r,fe()),ns(this,"config",void 0),ns(this,"componentName",void 0),ns(this,"container",void 0),ns(this,"parent",void 0),ns(this,"instance",void 0),this.config=t,this.parent=r;var i=e.getComponent(this.config.componentName)||e.getFallbackComponent(),a=fe.extend(!0,{},this.config.componentState||{});if(i==null)throw new Da('Unknown component "'+this.config.componentName+'"');a.componentName=this.config.componentName,this.componentName=this.config.componentName,this.config.title===""&&(this.config.title=this.config.componentName),this.isComponent=!0,this.container=new pc(this.config,this,e),this.instance=new i(this.container,a),this.element=this.container._element}close(){this.parent.removeChild(this)}setSize(){this.element.is(":visible")&&this.container._$setSize(this.element.width(),this.element.height())}_$init(){Lt.prototype._$init.call(this),this.container.emit("open")}_$hide(){this.container.hide(),Lt.prototype._$hide.call(this)}_$show(){this.container.show(),this.container._config.isFocusOnShow&&this.container._contentElement[0].focus({preventScroll:!0}),Lt.prototype._$show.call(this)}_$destroy(){this.container.emit("destroy",this),Lt.prototype._$destroy.call(this)}_$getArea(){return null}}function Br(n,e,t){return e=UM(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function UM(n){var e=BM(n,"string");return typeof e=="symbol"?e:String(e)}function BM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Dd extends Lt{constructor(e,t,r,i){super(t,r,i,fe('<div class="lm_item lm_'+(e?"column":"row")+'"></div>')),Br(this,"isRow",void 0),Br(this,"isColumn",void 0),Br(this,"childElementContainer",void 0),Br(this,"parent",void 0),Br(this,"_splitter",[]),Br(this,"_splitterSize",void 0),Br(this,"_splitterGrabSize",void 0),Br(this,"_isColumn",void 0),Br(this,"_dimension",void 0),Br(this,"_splitterPosition",null),Br(this,"_splitterMinPosition",null),Br(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,a,o,s;if(e=this.layoutManager._$normalizeContentItem(e,this),t===void 0&&(t=this.contentItems.length),this.contentItems.length>0?(s=this._createSplitter(Math.max(0,t-1)).element,t>0?(this.contentItems[t-1].element.after(s),s.after(e.element)):(this.contentItems[0].element.before(s),s.before(e.element))):this.childElementContainer.append(e.element),Lt.prototype.addChild.call(this,e,t),i=1/this.contentItems.length*100,r===!0){this.emitBubblingEvent("stateChanged");return}for(o=0;o<this.contentItems.length;o++)if(this.contentItems[o]===e)e.config[this._dimension]=i;else{var l;a=((l=this.contentItems[o].config[this._dimension])!==null&&l!==void 0?l:0)*(100-i)/100,this.contentItems[o].config[this._dimension]=a}this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}removeChild(e,t){var r,i=(r=e.config[this._dimension])!==null&&r!==void 0?r:0,a=this.contentItems.indexOf(e),o=Math.max(a-1,0),s,l;if(a===-1)throw new Error("Can't remove child. ContentItem is not child of this Row or Column");for(this._splitter[o]&&(this._splitter[o]._$destroy(),this._splitter.splice(o,1)),s=0;s<this.contentItems.length;s++)if(this.contentItems[s]!==e){var d;this.contentItems[s].config[this._dimension]=((d=this.contentItems[s].config[this._dimension])!==null&&d!==void 0?d:0)+i/(this.contentItems.length-1)}Lt.prototype.removeChild.call(this,e,t),this.contentItems.length===1&&this.config.isClosable===!0?(l=this.contentItems[0],this.contentItems=[],this.parent.replaceChild(this,l,!0)):(this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged"))}replaceChild(e,t){var r=e.config[this._dimension];super.replaceChild(e,t),t.config[this._dimension]=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(Lt.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,a=(t=this.element.height())!==null&&t!==void 0?t:0,o=0,s=[];this._isColumn?a-=r:i-=r;for(var l=0;l<this.contentItems.length;l++){var d,h,c=this._isColumn?Math.floor(a*(((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));o+=c,s.push(c)}var v=Math.floor((this._isColumn?a:i)-o);return{itemSizes:s,additionalPixel:v,totalWidth:i,totalHeight:a}}_calculateRelativeSizes(){for(var e=0,t=[],r=this._isColumn?"height":"width",i=0;i<this.contentItems.length;i++){var a=this.contentItems[i].config[r];a!=null?e+=a:t.push(this.contentItems[i])}if(Math.round(e)===100){this._respectMinItemWidth();return}if(Math.round(e)<100&&t.length>0){for(var o=0;o<t.length;o++)t[o].config[r]=(100-e)/t.length;this._respectMinItemWidth();return}if(Math.round(e)>100)for(var s=0;s<t.length;s++)t[s].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,a=0,o=0,s=[],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 c=d.itemSizes[h];c<t?(a+=t-c,l={width:t}):(i+=c-t,l={width:c},r.push(l)),s.push(l)}if(!(a===0||a>i)){var v=a/i;o=a;for(var m=0;m<r.length;m++){l=r[m];var f=Math.round((l.width-t)*v);o-=f,l.width-=f}o!==0&&(s[s.length-1].width-=o);for(var g=0;g<this.contentItems.length;g++)this.contentItems[g].config.width=s[g].width/d.totalWidth*100}}}_createSplitter(e){var t;return t=new a0(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 a,o;t=Math.max((a=e[i].minWidth)!==null&&a!==void 0?a:0,t),r=Math.max((o=e[i].minHeight)!==null&&o!==void 0?o:0,r)}return{horizontal:t,vertical:r}}_onSplitterDragStart(e){var t,r,i,a,o=this._getItemsForSplitter(e),s=this.layoutManager.config.dimensions[this._isColumn?"minItemHeight":"minItemWidth"],l=this._getMinimumDimensions((t=o.before.config.content)!==null&&t!==void 0?t:[]),d=this._isColumn?l.vertical:l.horizontal,h=this._getMinimumDimensions((r=o.after.config.content)!==null&&r!==void 0?r:[]),c=this._isColumn?h.vertical:h.horizontal;this._splitterPosition=0,this._splitterMinPosition=-1*(((i=o.before.element[this._dimension]())!==null&&i!==void 0?i:0)-(d||s)),this._splitterMaxPosition=((a=o.after.element[this._dimension]())!==null&&a!==void 0?a:0)-(c||s)}_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,a,o,s=this._getItemsForSplitter(e),l=(t=s.before.element[this._dimension]())!==null&&t!==void 0?t:0,d=(r=s.after.element[this._dimension]())!==null&&r!==void 0?r:0,h=(((i=this._splitterPosition)!==null&&i!==void 0?i:0)+l)/(l+d),c=((a=s.before.config[this._dimension])!==null&&a!==void 0?a:0)+((o=s.after.config[this._dimension])!==null&&o!==void 0?o:0);s.before.config[this._dimension]=h*c,s.after.config[this._dimension]=(1-h)*c,e.element.css({top:0,left:0}),jv(this.callDownwards.bind(this,"setSize",void 0,void 0,void 0))}}function pg(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 bg(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?pg(Object(t),!0).forEach(function(r){Sc(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):pg(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Sc(n,e,t){return e=VM(e),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:String(e)}function GM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class wc extends Lt{constructor(e,t,r){super(e,bg(bg({},t),{},{type:"root"}),null,fe('<div class="lm_goldenlayout lm_item lm_root"></div>')),Sc(this,"childElementContainer",void 0),Sc(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(Dr(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,a=i==="left"||i==="right"?"row":"column",o=i==="left"||i==="right"?"width":"height",s=i==="left"||i==="top",l=this.contentItems[0];if(!(l instanceof Dd)||l.type!=a){var d=this.layoutManager.createContentItem({type:a},this);this.replaceChild(l,d),d.addChild(e,s?0:void 0,!0),d.addChild(l,s?void 0:0,!0),l.config[o]=50,e.config[o]=50,d.callDownwards("setSize")}else{var h,c=l.contentItems[s?0:l.contentItems.length-1];l.addChild(e,s?0:void 0,!0),c.config[o]=((h=c.config[o])!==null&&h!==void 0?h:0)*.5,e.config[o]=c.config[o],l.callDownwards("setSize")}}}}function Cg(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 Ja(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Cg(Object(t),!0).forEach(function(r){lr(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Cg(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function lr(n,e,t){return e=WM(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function WM(n){var e=KM(n,"string");return typeof e=="symbol"?e:String(e)}function KM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class yc extends Lt{constructor(e,t,r){var i,a,o,s,l,d,h,c,v;super(e,t,r,fe('<div class="lm_item lm_stack"></div>')),lr(this,"_activeContentItem",null),lr(this,"_header",void 0),lr(this,"childElementContainer",fe('<div class="lm_items"></div>')),lr(this,"header",void 0),lr(this,"parent",void 0),lr(this,"isStack",!0),lr(this,"_dropZones",{}),lr(this,"_dropSegment",null),lr(this,"_contentAreaDimensions",null),lr(this,"_dropIndex",void 0),lr(this,"_side",void 0),lr(this,"_sided",!1),lr(this,"config",void 0),this.parent=r,this.config=t;var m=e.config;this._side=!1,this._header={show:((i=m.settings)===null||i===void 0?void 0:i.hasHeaders)&&t.hasHeaders!==!1,popout:(a=m.settings)!==null&&a!==void 0&&a.showPopoutIcon?(o=m.labels)===null||o===void 0?void 0:o.popout:void 0,maximise:(s=m.settings)!==null&&s!==void 0&&s.showMaximiseIcon?(l=m.labels)===null||l===void 0?void 0:l.maximise:void 0,close:(d=m.settings)!==null&&d!==void 0&&d.showCloseIcon?(h=m.labels)===null||h===void 0?void 0:h.close:void 0,minimise:(c=(v=m.labels)===null||v===void 0?void 0:v.minimise)!==null&&c!==void 0?c:void 0},m.header&&(this._header=Ja(Ja({},this._header),m.header)),t.header&&(this._header=Ja(Ja({},this._header),t.header)),t.content&&t.content[0]&&t.content[0].header&&(this._header=Ja(Ja({},this._header),t.content[0].header)),this.header=new vi(e,this),this.element.append(this.header.element),this.element.append(this.childElementContainer),this._setupHeaderPosition(),this._$validateClosability()}setSize(){var e,t,r,i,a,o=this._header.show&&(e=(t=this.layoutManager.config.dimensions)===null||t===void 0?void 0:t.headerHeight)!==null&&e!==void 0?e:0,s=((r=this.element.width())!==null&&r!==void 0?r:0)-(this._sided?o:0),l=((i=this.element.height())!==null&&i!==void 0?i:0)-(this._sided?0:o);for(this.childElementContainer.width(s),this.childElementContainer.height(l),a=0;a<this.contentItems.length;a++)this.contentItems[a].element.width(s).height(l);this.emit("resize"),this.emitBubblingEvent("stateChanged")}_$init(){if(this.isInitialised!==!0){this.header._attachWheelListener(),super._$init();for(var e=0;e<this.contentItems.length;e++)this.header.createTab(this.contentItems[e]),this.contentItems[e]._$hide();if(this.contentItems.length>0){var t=this.contentItems[this.config.activeItemIndex||0];if(!t)throw new Error("Configured activeItemIndex out of bounds");this.setActiveContentItem(t)}}}setActiveContentItem(e){if(this.contentItems.indexOf(e)===-1)throw new Error("contentItem is not a child of this stack");this._activeContentItem!==null&&this._activeContentItem._$hide(),this._activeContentItem=e,this.header.setActiveContentItem(e),e._$show(),this.emit("activeContentItemChanged",e),this.layoutManager.emit("activeContentItemChanged",e),this.emitBubblingEvent("stateChanged")}getActiveContentItem(){return this.header.activeContentItem}addChild(e,t){e=this.layoutManager._$normalizeContentItem(e,this),super.addChild(e,t),this.childElementContainer.append(e.element),this.header.createTab(e,t),this.setActiveContentItem(e),this.callDownwards("setSize"),this._$validateClosability(),this.emitBubblingEvent("stateChanged")}removeChild(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,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(){Lt.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",a=t&&this.parent.isColumn||r&&this.parent.isRow,o=t?"column":"row",s=t?"height":"width";if(Dr(e)){var l=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this);l._$init(),l.addChild(e),e=l}if(a){var d,h=this.parent.contentItems.indexOf(this);this.parent.addChild(e,i?h:h+1,!0),this.config[s]=((d=this.config[s])!==null&&d!==void 0?d:0)*.5,e.config[s]=this.config[s],this.parent.callDownwards("setSize")}else{var c=this.layoutManager.createContentItem({type:o},this);this.parent.replaceChild(this,c),c.addChild(e,i?0:void 0,!0),c.addChild(this,i?void 0:0,!0),this.config[s]=50,e.config[s]=50,c.callDownwards("setSize")}}_$highlightDropZone(e,t){if(this._contentAreaDimensions)for(var[r,i]of Object.entries(this._contentAreaDimensions)){var a=i.hoverArea;if(a.x1<e&&a.x2>e&&a.y1<t&&a.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,a,o,s,l,d,h,c,v,m,f,g,b,C,S=this.header.tabs.length;if(S===0){var w,E,y,T,O,R,P,M,F=this.header.element.offset();(w=this.layoutManager.dropTargetIndicator)===null||w===void 0||w.highlightArea({x1:(E=F==null?void 0:F.left)!==null&&E!==void 0?E:0,x2:((y=F==null?void 0:F.left)!==null&&y!==void 0?y:0)+100,y1:(T=(O=this.header.element.offset())===null||O===void 0?void 0:O.top)!==null&&T!==void 0?T:0,y2:((R=(P=this.header.element.offset())===null||P===void 0?void 0:P.top)!==null&&R!==void 0?R:0)+((M=this.header.element.innerHeight())!==null&&M!==void 0?M:0)});return}var N=this.header.tabsContainer,D=(t=N.get(0))===null||t===void 0?void 0:t.getBoundingClientRect(),_=(r=this.layoutManager.tabDropPlaceholder.get(0))===null||r===void 0?void 0:r.getBoundingClientRect();if(!(!D||!_)){e<D.left?e=D.left+1:e>D.right&&(e=D.right-1);var x,L;if(!(_.left<e&&e<_.right)){for(var H=0;H<S;H++){var G;if(x=this.header.tabs[H].element,L=(G=x.get(0))===null||G===void 0?void 0:G.getBoundingClientRect(),L&&L.left<e&&e<L.right){this._dropIndex=H;break}}if(x&&L&&e<L.left+L.width*.5)x.before(this.layoutManager.tabDropPlaceholder);else if(x){var X;this._dropIndex=Math.min(((X=this._dropIndex)!==null&&X!==void 0?X:0)+1,S),x.after(this.layoutManager.tabDropPlaceholder)}}var W=(i=(a=this.layoutManager.tabDropPlaceholder.offset())===null||a===void 0?void 0:a.left)!==null&&i!==void 0?i:0;W=Math.max(W,(o=(s=this.header.tabsContainer.offset())===null||s===void 0?void 0:s.left)!==null&&o!==void 0?o:0);var A=W+((l=this.layoutManager.tabDropPlaceholder.width())!==null&&l!==void 0?l:0);A=Math.min(A,((d=(h=this.header.tabsContainer.offset())===null||h===void 0?void 0:h.left)!==null&&d!==void 0?d:0)+((c=this.header.tabsContainer.innerWidth())!==null&&c!==void 0?c:0)),(v=this.layoutManager.dropTargetIndicator)===null||v===void 0||v.highlightArea({x1:W,x2:A,y1:(m=(f=this.header.element.offset())===null||f===void 0?void 0:f.top)!==null&&m!==void 0?m:0,y2:((g=(b=this.header.element.offset())===null||b===void 0?void 0:b.top)!==null&&g!==void 0?g:0)+((C=this.header.element.innerHeight())!==null&&C!==void 0?C: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,i=(t=this._contentAreaDimensions)===null||t===void 0||(r=t[e])===null||r===void 0?void 0:r.highlightArea;if(i){var a;(a=this.layoutManager.dropTargetIndicator)===null||a===void 0||a.highlightArea(i)}this._dropSegment=e}}const zM=Object.freeze(Object.defineProperty({__proto__:null,AbstractContentItem:Lt,Component:i0,ContentItem:Lt,Root:wc,RowOrColumn:Dd,Stack:yc,isComponent:Dr,isRoot:n0,isStack:js},Symbol.toStringTag,{value:"Module"}));function ai(n,e,t){return e=qM(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qM(n){var e=YM(n,"string");return typeof e=="symbol"?e:String(e)}function YM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class hl{constructor(e,t){var r;ai(this,"header",void 0),ai(this,"contentItem",void 0),ai(this,"element",fe(hl._template)),ai(this,"titleElement",void 0),ai(this,"closeElement",void 0),ai(this,"isActive",!1),ai(this,"_layoutManager",void 0),ai(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 dl(this.element),this._dragListener.on("dragStart",this._onDragStart,this),this.contentItem.on("destroy",this._dragListener.destroy,this._dragListener)),this._onTabClick=this._onTabClick.bind(this),this._onCloseClick=this._onCloseClick.bind(this),this._onTabContentFocusIn=this._onTabContentFocusIn.bind(this),this._onTabContentFocusOut=this._onTabContentFocusOut.bind(this),this.element.on("click",this._onTabClick),this.element.on("auxclick",this._onTabClick),this.contentItem.config.isClosable?(this.closeElement.on("click",this._onCloseClick),this.closeElement.on("mousedown",this._onCloseMousedown)):this.closeElement.remove(),this.contentItem.tab=this,this.contentItem.emit("tab",this),this.contentItem.layoutManager.emit("tabCreated",this),Dr(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.html(e)}setActive(e){e!==this.isActive&&(this.isActive=e,e?this.element.addClass("lm_active"):this.element.removeClass("lm_active"))}_$destroy(){this.element.off("click",this._onTabClick),this.element.off("auxclick",this._onTabClick),this.closeElement.off("click",this._onCloseClick),Dr(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 ja(e,t,this._dragListener,this._layoutManager,this.contentItem,this.header.parent)}_onTabContentFocusIn(){fe(".lm_focusin",this._layoutManager.root.element).removeClass("lm_focusin"),this.element.addClass("lm_focusin")}_onTabContentFocusOut(){Dr(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&&Dr(this.contentItem)?this.header.parent.setActiveContentItem(this.contentItem):Dr(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.contentItem.container._contentElement.focus(),Dr(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(),Dr(this.contentItem)?this.contentItem.container.close():this.header.parent.removeChild(this.contentItem)}_onCloseMousedown(e){e.stopPropagation()}}ai(hl,"_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 Ue(n,e,t){return e=XM(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function XM(n){var e=QM(n,"string");return typeof e=="symbol"?e:String(e)}function QM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class vi extends En{constructor(e,t){var r,i;super(),Ue(this,"layoutManager",void 0),Ue(this,"element",fe(vi._template)),Ue(this,"tabsContainer",void 0),Ue(this,"tabDropdownContainer",void 0),Ue(this,"tabDropdownSearch",void 0),Ue(this,"tabDropdownList",null),Ue(this,"controlsContainer",void 0),Ue(this,"parent",void 0),Ue(this,"tabs",[]),Ue(this,"activeContentItem",null),Ue(this,"closeButton",null),Ue(this,"tabDropdownButton",null),Ue(this,"tabNextButton",fe(vi._nextButtonTemplate)),Ue(this,"tabPreviousButton",fe(vi._previousButtonTemplate)),Ue(this,"holdTimer",null),Ue(this,"rAF",null),Ue(this,"CLICK_TIMEOUT",500),Ue(this,"START_SPEED",.01),Ue(this,"ACCELERATION",5e-4),Ue(this,"PADDING",10),Ue(this,"SCROLL_LEFT","left"),Ue(this,"SCROLL_RIGHT","right"),Ue(this,"isDraggingTab",!1),Ue(this,"isOverflowing",!1),Ue(this,"isDropdownShown",!1),Ue(this,"dropdownKeyIndex",0),Ue(this,"_lastVisibleTabIndex",-1),Ue(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 hl(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,a,o=0;o<this.tabs.length;o++)a=this.tabs[o].contentItem===e,this.tabs[o].setActive(a),a===!0&&(this.activeContentItem=e,this.parent.config.activeItemIndex=o);(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,a,o,s;if(((r=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&r!==void 0?r:0)>((a=(o=this.tabsContainer.get(0))===null||o===void 0?void 0:o.offsetWidth)!==null&&a!==void 0?a:0)+((s=this.tabsContainer.scrollLeft())!==null&&s!==void 0?s: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,a;if(((r=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&r!==void 0?r: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:"start"}),this._handleScrollButtonMouseDown(this.SCROLL_LEFT);else{var o=this.tabsContainer.get(0);o&&(o.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,a=arguments.length>3?arguments[3]:void 0,o=this.tabsContainer.get(0);if(o){var s=o.getBoundingClientRect();if(e===this.SCROLL_LEFT){if(this.tabsContainer.scrollLeft(t-i),this.isDraggingTab&&this.parent._highlightHeaderDropZone(s.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(s.right+1),((l=this.tabsContainer.scrollLeft())!==null&&l!==void 0?l:0)+((d=this.tabsContainer.innerWidth())!==null&&d!==void 0?d:0)===o.scrollWidth){this._checkScrollArrows();return}}window.cancelAnimationFrame((r=this.rAF)!==null&&r!==void 0?r:-1),this.rAF=window.requestAnimationFrame(h=>{var c,v,m=a||h,f=h-m,g=this.START_SPEED*f+.5*this.ACCELERATION*(f*f);g=Math.min(g,(c=(v=this.tabsContainer.get(0))===null||v===void 0?void 0:v.scrollWidth)!==null&&c!==void 0?c:1/0),this._handleScrollRepeat(e,t,g,m)})}}_$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(),fe(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,a;if(a=this.layoutManager.config.labels.tabDropdown,this.layoutManager.config.labels.tabNextLabel,this.layoutManager.config.labels.tabPreviousLabel,this.tabDropdownButton=new bs(this,a,"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 bs(this,r,"lm_popout",t)),this._getHeaderSetting("maximise")){i=this.parent.toggleMaximise.bind(this.parent);var o=this._getHeaderSetting("maximise"),s=this._getHeaderSetting("minimise"),l=new bs(this,o,"lm_maximise",i);this.parent.on("maximised",function(){l.element.attr("title",s??"")}),this.parent.on("minimised",function(){l.element.attr("title",o??"")})}this._isClosable()&&(e=this.parent.remove.bind(this.parent),r=this._getHeaderSetting("close"),this.closeButton=new bs(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"),fe(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"),fe(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(s,l,d){if(d==null||d.length<2)return-1;for(var h=(s+l+d.length)%d.length;h!==s;){if(d.eq(h).css("display")!=="none")return h;h=(h+l+d.length)%d.length}return s}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 a,o;e.preventDefault(),(a=this.tabDropdownList)===null||a===void 0||a.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=t(this.dropdownKeyIndex,-1,this.tabDropdownList),(o=this.tabDropdownList)===null||o===void 0||o.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(),fe(document).off("mousedown",this._hideAdditionalTabsDropdown)))}_updateAdditionalTabsDropdown(){var e,t,r,i;if(this.isDropdownShown&&!(!this.tabDropdownList||this.tabDropdownList.length==0)){var a=(e=(t=this.tabDropdownContainer.get(0))===null||t===void 0?void 0:t.scrollHeight)!==null&&e!==void 0?e:0;if(a!==0){var o=this.tabDropdownContainer[0].getBoundingClientRect(),s=(r=fe(window).height())!==null&&r!==void 0?r:0,l=(i=fe(window).width())!==null&&i!==void 0?i:0;if(this.tabDropdownButton){var d=this.tabDropdownButton.element[0].getBoundingClientRect(),h=a<s-d.bottom,c=!h&&d.bottom>s*.6,v=Math.min(d.left+(c?d.width:0),l-o.width-this.PADDING),m=c?Math.max(d.top-a,this.PADDING):d.bottom,f=s-m-this.PADDING;this.tabDropdownContainer.css({"max-height":f,top:m,left:v})}}}}_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()}}}}Ue(vi,"_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(""));Ue(vi,"_previousButtonTemplate",['<ul class="lm_controls">','<li class="lm_tabpreviousbutton"></li>',"</ul>"].join(""));Ue(vi,"_nextButtonTemplate",['<li class="lm_tabnextbutton"></li>'].join(""));function is(n,e,t){return e=ZM(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ZM(n){var e=JM(n,"string");return typeof e=="symbol"?e:String(e)}function JM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class a0{constructor(e,t,r){is(this,"_isVertical",void 0),is(this,"_size",void 0),is(this,"_grabSize",void 0),is(this,"_dragListener",void 0),is(this,"element",void 0),this._isVertical=e,this._size=t,this._grabSize=r<t?t:r,this.element=this._createElement(),this._dragListener=new dl(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=fe('<div class="lm_drag_handle"></div>'),t=fe('<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 eF=Object.freeze(Object.defineProperty({__proto__:null,BrowserPopout:Jy,DragProxy:ja,DragSource:e0,DragSourceFromEvent:t0,DropTargetIndicator:ul,Header:vi,HeaderButton:bs,Splitter:a0,Tab:hl},Symbol.toStringTag,{value:"Module"}));var tF={config:ZN,container:nM,controls:eF,errors:LM,items:zM,utils:CM};const rF=tF;function Sg(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 ir(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Sg(Object(t),!0).forEach(function(r){Ge(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Sg(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ge(n,e,t){return e=nF(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nF(n){var e=iF(n,"string");return typeof e=="symbol"?e:String(e)}function iF(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class o0 extends En{static minifyConfig(e){return Uv(e)}static unminifyConfig(e){return bc(e)}constructor(e,t){super(),Ge(this,"isInitialised",!1),Ge(this,"_isFullPage",!1),Ge(this,"_resizeTimeoutId",void 0),Ge(this,"_components",{"lm-react-component":Qy}),Ge(this,"_fallbackComponent",void 0),Ge(this,"_itemAreas",[]),Ge(this,"_maximisedItem",null),Ge(this,"_maximisePlaceholder",fe('<div class="lm_maximise_place"></div>')),Ge(this,"_creationTimeoutPassed",!1),Ge(this,"_subWindowsCreated",!1),Ge(this,"_dragSources",[]),Ge(this,"_updatingColumnsResponsive",!1),Ge(this,"_firstLoad",!0),Ge(this,"_reactChildMap",new Map),Ge(this,"_reactChildren",null),Ge(this,"width",null),Ge(this,"height",null),Ge(this,"root",void 0),Ge(this,"openPopouts",[]),Ge(this,"selectedItem",null),Ge(this,"isSubWindow",!1),Ge(this,"eventHub",new Zy(this)),Ge(this,"config",void 0),Ge(this,"container",void 0),Ge(this,"_originalContainer",void 0),Ge(this,"dropTargetIndicator",null),Ge(this,"tabDropPlaceholder",fe('<div class="lm_drop_tab_placeholder"></div>')),Ge(this,"_typeToItem",void 0),this._onResize=this._onResize.bind(this),this._onUnload=this._onUnload.bind(this),this._windowBlur=this._windowBlur.bind(this),this._windowFocus=this._windowFocus.bind(this),this.config=this._createConfig(e),this._originalContainer=t,this.container=this._getContainer(),this.isSubWindow&&fe("body").css("visibility","hidden"),this._typeToItem={column:Dd.bind(this,!0),row:Dd.bind(this,!1),stack:yc,component:i0}}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 Lt))throw new Error("Root must be a ContentItem");var t={settings:ir({},this.config.settings),dimensions:ir({},this.config.dimensions),labels:ir({},this.config.labels),content:[]},r=function a(o,s){for(var l in s.config)l!=="content"&&(o[l]=s.config[l]);if(o.componentName==="lm-react-component"&&(o.type="react-component"),s.contentItems.length){o.content=[];for(var d=0;d<s.contentItems.length;d++)o.content[d]={},a(o.content[d],s.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){fe(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 ul,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}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 a,o;this._maximisedItem.element.width((a=this.container.width())!==null&&a!==void 0?a:0),this._maximisedItem.element.height((o=this.container.height())!==null&&o!==void 0?o:0),this._maximisedItem.callDownwards("setSize")}this._adjustColumnsResponsive()}}destroy(){var e;this.isInitialised===!1||!this.root||(this._onUnload(),fe(window).off("resize",this._onResize),fe(window).off("unload beforeunload",this._onUnload),fe(window).off("blur.lm").off("focus.lm"),this.root.callDownwards("_$destroy",[],!0),this.root.contentItems=[],this.tabDropPlaceholder.remove(),(e=this.dropTargetIndicator)===null||e===void 0||e.destroy(),this.eventHub.destroy(),this._dragSources.forEach(function(t){t._dragListener.destroy()}),this._dragSources=[])}createContentItem(e,t){var r,i;if(typeof e.type!="string")throw new Da("Missing parameter 'type'",e);if(e.type==="react-component"&&(e.type="component",e.componentName="lm-react-component"),!this._typeToItem[e.type])throw r="Unknown type '"+e.type+"'. Valid types are "+Object.keys(this._typeToItem).join(","),new Da(r);return e.type==="component"&&!(t instanceof yc)&&t&&!(this.isSubWindow===!0&&t instanceof wc)&&(e={type:"stack",width:e.width,height:e.height,content:[e]}),i=new this._typeToItem[e.type](this,e,t),i}createPopout(e,t,r,i){var a=[],o=e instanceof Lt,s=this;if(o){var l;a=this.toConfig(e).content,r=$v();for(var d=e.parent,h=e;((c=d)===null||c===void 0?void 0:c.contentItems.length)===1&&!d.isRoot;){var c;h=d,d=d.parent}if((l=d)===null||l===void 0||l.addId(r),i==null||Number.isNaN(i)){var v;i=(v=d)===null||v===void 0?void 0:v.contentItems.indexOf(h)}}else e instanceof Array?a=e:a=[e];if(!t&&o){var m,f,g,b=window.screenX||window.screenLeft,C=window.screenY||window.screenTop,S=(m=e.element.offset())!==null&&m!==void 0?m:{left:0,top:0};t={left:b+S.left,top:C+S.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&&!o&&(t={left:window.screenX||window.screenLeft+20,top:window.screenY||window.screenTop+20,width:500,height:309}),o&&e.remove(),!(!t||!r||i===void 0)){var w=new Jy(a,t,r,i,this);return w.on("initialised",function(){s.emit("windowOpened",w)}),w.on("closed",function(){s._$reconcilePopoutWindows()}),this.openPopouts.push(w),w}}createDragSource(e,t){this.config.settings.constrainDragToContainer=!1;var r=new e0(e,t,this);return this._dragSources.push(r),r}createDragSourceFromEvent(e,t){return this.config.settings.constrainDragToContainer=!1,new t0(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,a=0;a<this._itemAreas.length;a++){var o=this._itemAreas[a];e>o.x1&&e<o.x2&&t>o.y1&&t<o.y2&&r>o.surface&&(r=o.surface,i=o)}return i}_$createRootItemAreas(){var e=50,t=ir({},this.root._$getArea()),r=[ir(ir({},t),{},{side:"left",x2:t.x1+e}),ir(ir({},t),{},{side:"right",x1:t.x2-e}),ir(ir({},t),{},{side:"top",y2:t.y1+e}),ir(ir({},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(js(r)){var i=r._$getArea();if(i!==null)if(i instanceof Array)this._itemAreas=this._itemAreas.concat(i);else{var a;this._itemAreas.push(i);var o=ir(ir({},i),(a=i.contentItem._contentAreaDimensions)===null||a===void 0?void 0:a.header.highlightArea);o.surface=(o.x2-o.x1)*(o.y2-o.y1),this._itemAreas.push(o)}}}}_$normalizeContentItem(e,t){if(!e)throw new Error("No content item defined");if(typeof e=="function"&&(e=e()),e instanceof Lt)return e;if(fe.isPlainObject(e)&&e.type){var r=this.createContentItem(e,t);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&&fe(window).resize(this._onResize),fe(window).on("unload beforeunload",this._onUnload).on("blur.lm",this._windowBlur).on("focus.lm",this._windowFocus)}_windowBlur(){this.root.element.addClass("lm_window_blur")}_windowFocus(){this.root.element.removeClass("lm_window_blur")}_onResize(){clearTimeout(this._resizeTimeoutId),this._resizeTimeoutId=window.setTimeout(this.updateSize.bind(this),100)}_createConfig(e){var t,r=Xy("gl-window");r&&(this.isSubWindow=!0,e=JSON.parse(localStorage.getItem(r)||"{}"),e=bc(e),localStorage.removeItem(r)),e=fe.extend(!0,{},Ky,e);var i=function a(o){for(var s in o){var l=o[s];s!=="props"&&typeof l=="object"&&l!=null?a(l):s==="type"&&l==="react-component"&&(o.type="component",o.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=fe('<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=Hv((e=this.config.content[0].title)!==null&&e!==void 0?e:""),fe("head").append(fe("body link, body style, template, .gl_keep")),this.container=fe("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?fe(this._originalContainer):fe("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,fe("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 Da(t,e);if(e.content.length>1)throw t="Top level content can't contain more then one element.",new Da(t,e);this.root=new wc(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),a=e-i,o=this.root.contentItems[0],s=this._findAllStackContainers()[0],l=0;l<a;l++){var d=o.contentItems[o.contentItems.length-1];this._addChildContentItemsToContainer(s,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=>{js(r)?e.push(r):r.isComponent||this._findAllStackContainersRecursive(e,r)})}}Ge(o0,"__lm",rF);const s0=o0,aF="_lm_dragging_1qalq_1",oF="_lm_goldenlayout_1qalq_1",sF="_lm_header_1qalq_1",lF="_lm_controls_1qalq_1",dF="_lm_tabpreviousbutton_1qalq_1",uF="_lm_tabnextbutton_1qalq_1",hF="_lm_tab_1qalq_1",cF="_lm_active_1qalq_1",vF="_lm_close_tab_1qalq_1",mF="_lm_content_1qalq_1",fF="_lm_dragProxy_1qalq_1",gF="_lm_dropTargetIndicator_1qalq_1",pF="_march_1qalq_1",bF="_lm_inner_1qalq_1",CF="_lm_splitter_1qalq_1",SF="_lm_selectable_1qalq_1",wF="_lm_tabdropdown_list_1qalq_1",yF="_lm_title_1qalq_1",EF="_lm_title_before_1qalq_1",TF="_lm_selected_1qalq_1",PF="_lm_focusin_1qalq_1",OF="_lm_window_blur_1qalq_1",DF="_lm_popout_1qalq_1",IF="_lm_maximise_1qalq_1",RF="_lm_tabdropdown_1qalq_1",_F="_lm_close_1qalq_1",xF="_lm_tabdropdown_search_1qalq_1",NF="_lm_tabs_1qalq_1",MF="_lm_keyboard_active_1qalq_1",FF="_lm_maximised_1qalq_1",AF="_lm_items_1qalq_1",wg={"tab-height":"28px","drag-border-width":"5px",lm_dragging:aF,lm_goldenlayout:oF,lm_header:sF,lm_controls:lF,lm_tabpreviousbutton:dF,lm_tabnextbutton:uF,lm_tab:hF,lm_active:cF,lm_close_tab:vF,lm_content:mF,lm_dragProxy:fF,lm_dropTargetIndicator:gF,march:pF,lm_inner:bF,lm_splitter:CF,lm_selectable:SF,lm_tabdropdown_list:wF,lm_title:yF,lm_title_before:EF,lm_selected:TF,lm_focusin:PF,lm_window_blur:OF,lm_popout:DF,lm_maximise:IF,lm_tabdropdown:RF,lm_close:_F,lm_tabdropdown_search:xF,lm_tabs:NF,lm_keyboard_active:MF,lm_maximised:FF,lm_items:AF},yg=Object.freeze({tabHeight:parseInt(wg["tab-height"],10),dragBorderWidth:parseInt(wg["drag-border-width"],10)});function Eg(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 Qn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Eg(Object(t),!0).forEach(function(r){l0(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Eg(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function l0(n,e,t){return e=LF(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function LF(n){var e=kF(n,"string");return typeof e=="symbol"?e:String(e)}function kF(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ii=te.module("LayoutUtils");function d0(n){return n.componentName!==void 0}function vo(n){var e=n;return(d0(n)&&n.componentName==="lm-react-component"||n.type==="react-component")&&e.component!==void 0}function kl(n){return n.focus!==void 0}function Tg(n){return n.type==="stack"}class Z{static activateTab(e,t){var r=Z.getStackForRoot(e,t,!1);if(!r){Ii.error("Could not find stack for config",t);return}var i=Z.getContentItemInStack(r,t);i&&r.setActiveContentItem(i)}static isActiveTab(e,t){var r=Z.getStackForRoot(e,t,!1);if(!r)return Ii.error("Could not find stack for config",t),!1;var i=Z.getContentItemInStack(r,t),a=r.getActiveContentItem();return a===i}static addStack(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=t?"column":"row";if(n0(e)){(e.contentItems==null||e.contentItems.length===0)&&e.addChild({type:r});var i=e.contentItems[0],a=t?i.isColumn:i.isRow;if(!a){e.removeChild(i,!0),e.addChild({type:r});var o=document.activeElement;e.contentItems[0].addChild(i),o&&o.focus!=null&&o.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 s=e.contentItems[e.contentItems.length-1],l=t?s.isRow:s.isColumn;return l||(e.addChild({type:t?"row":"column"}),e.removeChild(s,!0),e.contentItems[e.contentItems.length-1].addChild(s),s=e.contentItems[e.contentItems.length-1]),this.addStack(s,!t)}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&&js(e)&&e.contentItems.length===0)return e;if(e.contentItems==null)return null;for(var i=0;i<e.contentItems.length;i+=1){var a=e.contentItems[i];if(a.isComponent&&a.config!=null&&zm(a.config,t))return e;var o=this.getStackForConfig(a,t,r);if(o)return o}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,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=this.getStackForConfig(e,t);return!o&&i&&(o=this.getStackForConfig(e,{component:t.component},a)),!o&&r&&(o=this.addStack(e)),o}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,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;o<t.length;o+=1){var s=t[o],l=o===t.length-1,d=Z.getStackForRoot(e,{component:s},r&&l,i,a);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&&zm(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 a=e[i],{component:o,content:s}=a;if(o){var l=t(o,a);l!=null?r.push(l):Ii.debug2('dehydrateLayoutConfig: skipping unmapped component "'.concat(o,'"'))}else if(s){var d=Qn(Qn({},a),{},{content:Z.dehydrateLayoutConfig(s,t)});r.push(d)}else r.push(a)}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?(Tg(r)&&delete r.activeItemIndex,Z.dropLayoutMinorChange(i)):vo(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;if(r){var i=Z.cloneLayout(e),a=Z.cloneLayout(t);return Z.dropLayoutMinorChange(i),Z.dropLayoutMinorChange(a),At(i,a)}return At(e,t)}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 a=e[i];if(vo(a)){var o,{component:s,props:l={}}=a;r.push(Qn(Qn({},a),{},{id:(o=a==null?void 0:a.id)!==null&&o!==void 0?o:Me(),props:t(s,l)}))}else if(a.content!==void 0){var d=Z.hydrateLayoutConfig(a.content,t);Tg(a)&&a.activeItemIndex!=null&&a.activeItemIndex>=d.length&&(Ii.warn("Fixing bad activeItemIndex!",a.activeItemIndex,a),a.activeItemIndex=0),r.push(Qn(Qn({},a),{},{content:d}))}else r.push(a)}return r}static openComponent(){var{root:e,config:t,replaceExisting:r=!0,replaceConfig:i=void 0,createNewStack:a=!1,focusElement:o=void 0,dragEvent:s=void 0}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=document.activeElement,d=Qn({},t);if(d.id==null&&(d.id=Me.generate()),s!=null){e==null||e.layoutManager.createDragSourceFromEvent(d,s);return}var h=i||{id:d.id,component:d.component};$(e);var c=a?Z.addStack(e):Z.getStackForRoot(e,h);$(c);var v=Z.getContentItemInStack(c,h);if(o!=null){var m=g=>{Ii.debug("Component created, focusing element",o),c.off("componentCreated",m);var{element:b}=g.origin;requestAnimationFrame(()=>{Z.focusElement(b[0],o)})};c.on("componentCreated",m)}if(r&&v){var f=c.contentItems.indexOf(v);c.addChild(d,f+1),c.removeChild(v),c.setActiveContentItem(c.contentItems[f])}else c.addChild(d);o==null&&l&&kl(l)&&l.focus()}static openComponentInStack(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=document.activeElement,a={id:t.id},o=Z.getContentItemInStack(e,a);if(r&&o&&e){var s=e==null?void 0:e.contentItems.indexOf(o);e.addChild(t,s+1),e.removeChild(o),e.setActiveContentItem(e.contentItems[s])}else e==null||e.addChild(t);i&&kl(i)&&i.focus()}static closeComponent(e,t,r){var i=Z.getStackForRoot(e,t,!1,!1,!1);if(!i){Ii.warn("Cannot find stack for component, ignoring close",t);return}var a=Z.getContentItemInStack(i,t),o=document.activeElement;a&&(Dr(a)?a.container.close(r):i.removeChild(a)),o&&document.contains(o)&&kl(o)&&o.focus()}static renameComponent(e,t,r){var i=Z.getStackForRoot(e,t,!1);if(!i){Ii.error("Could not find stack for config",t);return}var a=Z.getContentItemInStack(i,t);a&&a.setTitle(r)}static cloneComponent(e,t){var r=Z.getStackForRoot(e,t,!1);if(!r)return Ii.error("Could not find stack for config",t),null;var{props:i={}}=t,a=Z.getPanelComponentState(t),o={type:"react-component",component:t.component,props:Qn(Qn({},i),{},{panelState:a}),title:"".concat(t.title," Copy"),id:Me.generate()};return Z.openComponentInStack(r,o),o}static getPanelComponentState(e){if(d0(e)){var t;return(t=e.componentState)===null||t===void 0?void 0:t.panelState}if(vo(e)){var r;return(r=e.props)===null||r===void 0?void 0:r.panelState}return null}static makeDefaultLayout(){return{dimensions:{headerHeight:yg.tabHeight,borderWidth:yg.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=Z.getComponentConfigFromContainer(e);return t?t.id:null}static getIdFromPanel(e){var{glContainer:t}=e.props;return Z.getIdFromContainer(t)}static getComponentNameFromPanel(e){var{glContainer:t}=e.props,r=Z.getComponentConfigFromContainer(t);if(r&&vo(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]:Z.DEFAULT_FOCUS_SELECTOR;if(e==null)return null;var r=e.querySelector(t);return r==null?null:(kl(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)})}}l0(Z,"DEFAULT_FOCUS_SELECTOR","input, select, textarea, button");var u0=re.forwardRef((n,e)=>{var t=Z.getComponentNameFromPanel({props:n});return u.jsx("div",{ref:e,className:"panel-placeholder",children:u.jsxs("div",{children:['Component "',t,'" is not registered.']})})});u0.displayName="PanelPlaceholder";const Te=Object.freeze({FOCUS:"PanelEvent.FOCUS",MOUNT:"PanelEvent.MOUNT",UNMOUNT:"PanelEvent.UNMOUNT",TITLE_CHANGED:"PanelEvent.TITLE_CHANGED",REOPEN:"PanelEvent.REOPEN",DELETE:"PanelEvent.DELETE",CLONED:"PanelEvent.CLONED",CLOSED:"PanelEvent.CLOSED",OPEN:"PanelEvent.OPEN",CLOSE:"PanelEvent.CLOSE",DRAGGING:"PanelEvent.DRAGGING",DROPPED:"PanelEvent.DROPPED"});function $s(n){return(n==null?void 0:n.WrappedComponent)!==void 0}function h0(n){return typeof n.id=="string"&&n.layout instanceof s0&&n.panelManager instanceof fu&&typeof n.registerComponent=="function"}function $a(n){if(!h0(n))throw new Error("Expected dashboard plugin props, but instead received ".concat(n))}function Pg(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 Og(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Pg(Object(t),!0).forEach(function(r){Vi(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Pg(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Vi(n,e,t){return e=jF(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jF(n){var e=$F(n,"string");return typeof e=="symbol"?e:String(e)}function $F(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Vr=te.module("PanelManager");class fu{constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:(s,l)=>l,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(s,l)=>l,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new Map,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:()=>{};Vi(this,"layout",void 0),Vi(this,"hydrateComponent",void 0),Vi(this,"dehydrateComponent",void 0),Vi(this,"onPanelsUpdated",void 0),Vi(this,"closed",void 0),Vi(this,"openedMap",void 0),this.handleFocus=this.handleFocus.bind(this),this.handleMount=this.handleMount.bind(this),this.handleUnmount=this.handleUnmount.bind(this),this.handleReopen=this.handleReopen.bind(this),this.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=o,this.openedMap=new Map(i),this.closed=[...a],this.startListening()}startListening(){var{eventHub:e}=this.layout;e.on(Te.FOCUS,this.handleFocus),e.on(Te.MOUNT,this.handleMount),e.on(Te.UNMOUNT,this.handleUnmount),e.on(Te.REOPEN,this.handleReopen),e.on(Te.DELETE,this.handleDeleted),e.on(Te.CLOSED,this.handleClosed),e.on(Te.CLOSE,this.handleControlClose)}stopListening(){var{eventHub:e}=this.layout;e.off(Te.FOCUS,this.handleFocus),e.off(Te.MOUNT,this.handleMount),e.off(Te.UNMOUNT,this.handleUnmount),e.off(Te.REOPEN,this.handleReopen),e.off(Te.DELETE,this.handleDeleted),e.off(Te.CLOSED,this.handleClosed),e.off(Te.CLOSE,this.handleControlClose)}getClosedPanelConfigsOfType(e){return this.closed.filter(t=>t.component===e)}getOpenedPanels(){return Array.from(this.openedMap.values())}getOpenedPanelConfigs(){return this.getOpenedPanels().map(e=>{var{glContainer:t}=e.props;return Z.getComponentConfigFromContainer(t)})}getOpenedPanelConfigsOfType(e){return this.getOpenedPanelConfigs().filter(t=>t!=null&&vo(t)&&t.component===e)}getOpenedPanelById(e){return this.openedMap.get(e)}getContainerByPanelId(e){var t,r=Z.getStackForConfig(this.layout.root,{id:e});return(t=r&&Z.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=>$s(r)&&t instanceof r.WrappedComponent||!$s(r)&&t instanceof r))}updatePanel(e){var t=Z.getIdFromPanel(e);if(t==null){Vr.error("updatePanel Panel did not have an ID",e);return}Vr.debug2("Updating panel ID ".concat(t," in open panels map")),this.openedMap.delete(t),this.openedMap.set(t,e)}removePanel(e){var t=Z.getIdFromPanel(e);if(t==null){Vr.error("removePanel Panel did not have an ID",e);return}if(!this.openedMap.has(t)){Vr.error("Missing panel ID ".concat(t," in open panels map"));return}if(this.openedMap.get(t)!==e){Vr.debug("Panel argument doesn't match the open panels map entry for ".concat(t,", removePanel ignored"));return}Vr.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){Vr.debug2("Focus: ",e),this.updatePanel(e)}handleMount(e){Vr.debug2("Mount: ",e),this.updatePanel(e),this.sendUpdate()}handleUnmount(e){Vr.debug2("Unmount: ",e),this.removePanel(e),this.sendUpdate()}handleReopen(e,t){Vr.debug2("Reopen:",e,t),this.removeClosedPanelConfig(e);var{component:r}=e,{props:i}=e;i=this.hydrateComponent(r,i);var a=Og(Og({},e),{},{props:i}),{root:o}=this.layout;Z.openComponent({root:o,config:a,replaceConfig:t})}handleDeleted(e){Vr.debug2("Deleted:",e),this.removeClosedPanelConfig(e),this.sendUpdate()}handleClosed(e,t){Vr.debug2("Closed: ",e),this.addClosedPanel(t),this.sendUpdate()}handleControlClose(e){var t={id:e},{root:r}=this.layout;Z.closeComponent(r,t)}addClosedPanel(e){var t=Z.getComponentConfigFromContainer(e);if(t&&vo(t)){var r=this.dehydrateComponent(t.component,t);r!=null&&this.closed.push(r)}}sendUpdate(){var{closed:e,openedMap:t}=this;this.onPanelsUpdated({closed:[...e],openedMap:new Map(t)})}}Vi(fu,"MAX_CLOSED_PANEL_COUNT",100);var HF=te.module("PanelErrorBoundary");class c0 extends p.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){this.setState({error:e})}componentWillUnmount(){var{glContainer:e,glEventHub:t}=this.props,r=Z.getIdFromContainer(e);HF.debug("componentWillUnmount",r),t.emit(Te.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(tr,{errorMessage:"".concat(t),isLoading:!1,isLoaded:!1})}):e}}function Dg(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 Id(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Dg(Object(t),!0).forEach(function(r){UF(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Dg(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function UF(n,e,t){return e=BF(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function BF(n){var e=VF(n,"string");return typeof e=="symbol"?e:String(e)}function VF(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function gu(n){var{props:e,componentState:t}=n,{metadata:r}=e,{panelState:i=null}=e;t&&({panelState:i}=t);var a={};return r!=null&&(a.metadata=r),i!=null&&(a.panelState=i),Id(Id({},n),{},{componentState:null,props:a,type:"react-component"})}function pu(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return Id(Id({metadata:{}},n),{},{localDashboardId:e})}function Vv(n){var e=$s(n)&&n.WrappedComponent.prototype!=null&&n.WrappedComponent.prototype.isReactComponent!=null||n.prototype!=null&&n.prototype.isReactComponent!=null,t=!$s(n)&&"$$typeof"in n&&n.$$typeof===wP.ForwardRef;return e||t}const v0={dehydrate:gu,hydrate:pu};var bu=re.createContext(void 0),GF=V.shape({on:V.func,off:V.func,isHidden:V.bool,tab:V.shape({header:V.shape({tabs:V.arrayOf(V.shape({contentItem:V.shape({})}))})}),title:V.string,setTitle:V.func,close:V.func}),m0=V.shape({on:V.func,off:V.func,emit:V.func}),WF=V.shape({registerComponent:V.func,root:V.shape({addChild:V.func}),on:V.func,off:V.func,eventHub:m0}),Cu=Object.freeze({Container:GF,EventHub:m0,Layout:WF});function ze(n,e,t){p.useEffect(function(){return n.on(e,t),()=>{n.off(e,t)}},[n,e,t])}function wa(n,e,t,r){var i,a=(i=e.COMPONENT)!==null&&i!==void 0?i:e.displayName;if(a==null)throw new Error("ComponentType must have a `COMPONENT` or `displayName` attribute.");re.useEffect(()=>{var o=n(a,e,t,r);return()=>{o()}},[e,r,t,a,n])}function KF(n){var{dashboardProps:e,componentName:t,component:r,supportedTypes:i,hydrate:a,dehydrate:o}=n,{id:s,layout:l,registerComponent:d}=e,h=p.useCallback(c=>{var v,{dragEvent:m,fetch:f,panelId:g=Me.generate(),widget:b}=c,{id:C,type:S}=b,w=(v=b.title)!==null&&v!==void 0?v:b.name,E=Array.isArray(i)&&i.includes(S)||S===i;if(E){var y={id:C,name:w,type:S},T={localDashboardId:s,metadata:y,fetch:f};a!=null&&(T=a(T,s));var O={type:"react-component",component:t,props:T,title:w,id:g},{root:R}=l;Z.openComponent({root:R,config:O,dragEvent:m})}},[t,a,s,l,i]);wa(d,r,a,o),ze(l.eventHub,Te.OPEN,h)}function zF(){var n=p.useContext(bu);if(n==null)throw new Error("LayoutManager not available, did you add a LayoutManagerContext.Provider to the tree?");return n}function Ig(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 qF(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ig(Object(t),!0).forEach(function(r){YF(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ig(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function YF(n,e,t){return e=XF(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function XF(n){var e=QF(n,"string");return typeof e=="symbol"?e:String(e)}function QF(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ZF=Object.freeze({}),JF=new Map,f0=n=>n.api,eA=n=>n.user,g0=n=>n.storage,p0=n=>g0(n).commandHistoryStorage,b0=n=>g0(n).fileStorage,tA=n=>n.defaultWorkspaceSettings,C0=n=>{var{workspace:e}=n;return e},cl=n=>{for(var e=C0(n).data.settings,t=qF({},tA(n)),r=Object.keys(e),i=0;i<r.length;i+=1){var a=r[i];e[a]!==void 0&&(t[a]=e[a])}return t},Gv=n=>cl(n).timeZone,rA=n=>{var e;return(e=cl(n).defaultNotebookSettings)!==null&&e!==void 0?e:ZF},Wv=n=>n.activeTool,nA=n=>{var e;return(e=n.plugins)!==null&&e!==void 0?e:JF},S0="SET_ACTIVE_TOOL",iA="SET_API",aA="SET_COMMAND_HISTORY_STORAGE",oA="SET_FILE_STORAGE",sA="SET_PLUGINS",lA="SET_USER",w0="SET_WORKSPACE",dA="SET_DEFAULT_WORKSPACE_SETTINGS",uA="SET_WORKSPACE_STORAGE",hA="SET_SERVER_CONFIG_VALUES";function Rg(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 ma(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Rg(Object(t),!0).forEach(function(r){cA(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Rg(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function cA(n,e,t){return e=vA(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function vA(n){var e=mA(n,"string");return typeof e=="symbol"?e:String(e)}function mA(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var fA=n=>({type:w0,payload:n}),gA=n=>(e,t)=>{e(fA(n));var{storage:r}=t(),{workspaceStorage:i}=r;return i.save(n)},y0=n=>(e,t)=>{var{workspace:r}=t(),{data:i}=r,a=ma(ma({},r),{},{data:ma(ma(ma({},i),n),{},{settings:ma(ma({},i.settings),n.settings)})});return e(gA(a))},pA=n=>e=>e(y0({settings:n})),E0=n=>({type:S0,payload:n});function _g(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 Th(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_g(Object(t),!0).forEach(function(r){bA(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):_g(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function bA(n,e,t){return e=CA(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function CA(n){var e=SA(n,"string");return typeof e=="symbol"?e:String(e)}function SA(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function T0(n,e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,r=arguments.length>1?arguments[1]:void 0;switch(r.type){case n:{var i=r.payload;return i==null?null:t!=null?Th(Th({},t),i):Th({},i)}default:return t}}}function xg(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 Ng(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xg(Object(t),!0).forEach(function(r){wA(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):xg(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function wA(n,e,t){return e=yA(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yA(n){var e=EA(n,"string");return typeof e=="symbol"?e:String(e)}function EA(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function TA(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.type){case n:{var{id:a,payload:o}=i;return t&&At({payload:o},{payload:r[a]})?r:Ng(Ng({},r),{},{[a]:o})}default:return r}}}function sa(n,e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,r=arguments.length>1?arguments[1]:void 0;switch(r.type){case n:return r.payload;default:return t}}}const PA=sa(iA,null),OA=sa(S0,null),DA=sa(sA,null),IA=sa(aA,null),RA=sa(oA,null),_A=sa(uA,null),xA=qc({commandHistoryStorage:IA,fileStorage:RA,workspaceStorage:_A}),NA=T0(lA,null),MA=T0(w0,null),FA=sa(dA,null),AA=sa(hA,null);var LA={activeTool:OA,api:PA,plugins:DA,storage:xA,user:NA,workspace:MA,defaultWorkspaceSettings:FA,serverConfigValues:AA};const kA=LA;function Mg(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 Fg(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Mg(Object(t),!0).forEach(function(r){Ec(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Mg(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ec(n,e,t){return e=jA(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jA(n){var e=$A(n,"string");return typeof e=="symbol"?e:String(e)}function $A(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class HA{constructor(){Ec(this,"reducers",{}),Ec(this,"listener",null)}register(e,t){var r;this.reducers=Fg(Fg({},this.reducers),{},{[e]:t}),(r=this.listener)===null||r===void 0||r.call(this,this.reducers)}setListener(e){this.listener=e}}var UA=new HA;const Su=UA;var Ag=te.module("redux-logger"),BA=n=>e=>t=>{Ag.debug("dispatching",t);var r=e(t);return Ag.debug("next state",n.getState()),r};const VA=BA;var GA=te.module("redux-crashReporter"),WA=n=>e=>t=>{try{return e(t)}catch(r){throw GA.error("Error executing",t," with state ",n.getState(),":",r),r}};const KA=WA,zA=[VA,KA,yP];var Ph;Object.entries(kA).map(n=>{var[e,t]=n;return Su.register(e,t)});var qA=(Ph=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__)!==null&&Ph!==void 0?Ph:PP,P0=EP(qc(Su.reducers),qA(TP(...zA)));Su.setListener(n=>{P0.replaceReducer(qc(n))});const YA=P0;var Kv="SET_DASHBOARD_DATA";const XA=TA(Kv,{},!1),O0={dashboardData:XA};var QA=new Map,D0=Object.freeze({}),ZA=Object.freeze([]),I0=n=>n.dashboardData,jt=(n,e)=>{var t;return(t=I0(n)[e])!==null&&t!==void 0?t:D0},R0=(n,e)=>{var t;return(t=jt(n,e).closed)!==null&&t!==void 0?t:ZA},zv=(n,e)=>{var t;return(t=jt(n,e).openedMap)!==null&&t!==void 0?t:QA},qv=(n,e)=>{var t;return(t=jt(n,e).pluginDataMap)!==null&&t!==void 0?t:D0},_0=(n,e,t)=>qv(n,e)[t];function Lg(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 mo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Lg(Object(t),!0).forEach(function(r){JA(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Lg(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function JA(n,e,t){return e=eL(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function eL(n){var e=tL(n,"string");return typeof e=="symbol"?e:String(e)}function tL(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Yv=(n,e)=>({type:Kv,id:n,payload:e}),Tn=(n,e)=>(t,r)=>t(Yv(n,mo(mo({},jt(r(),n)),e))),x0=(n,e,t)=>(r,i)=>r(Yv(n,mo(mo({},jt(i(),n)),{},{pluginDataMap:mo(mo({},qv(i(),n)),{},{[e]:t})})));function rL(n,e){var t=qs(),r=ES(a=>_0(a,n,e)),i=p.useCallback(a=>t(x0(n,e,a)),[n,e,t]);return[r,i]}Object.entries(O0).map(n=>{var[e,t]=n;return Su.register(e,t)});function nL(n){var{children:e}=n;return u.jsx(u.Fragment,{children:e})}function kg(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 as(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?kg(Object(t),!0).forEach(function(r){iL(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):kg(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function iL(n,e,t){return e=aL(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function aL(n){var e=oL(n,"string");return typeof e=="symbol"?e:String(e)}function oL(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var jl=te.module("DashboardLayout"),sL=Object.freeze({}),lL=[],jg=()=>{},$g=n=>n;function Xv(n){var e,t,{id:r,children:i,emptyDashboard:a=u.jsx("div",{children:"Dashboard is empty."}),layout:o,layoutConfig:s=lL,onLayoutChange:l=jg,onLayoutInitialized:d=jg,hydrate:h=pu,dehydrate:c=gu,panelWrapper:v=nL}=n,m=qs(),f=(e=ES(I=>jt(I,r)))!==null&&e!==void 0?e:sL,[g,b]=p.useState(!1),[C,S]=p.useState(!1),[w,E]=p.useState(),[y]=p.useState((t=f==null?void 0:f.closed)!==null&&t!==void 0?t:[]),[T,O]=p.useState(!1),[R,P]=p.useState(o.getReactChildren()),M=p.useMemo(()=>new Map,[]),F=p.useMemo(()=>new Map,[]),N=p.useCallback(function(I,k){var j,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:h,ee=arguments.length>3&&arguments[3]!==void 0?arguments[3]:c;jl.debug2("registerComponent",I,k,Y,ee);function K(ne,se){var pe=k,Fe=v,tt=Vv(pe),{glContainer:rt,glEventHub:Ye}=ne;return u.jsx(c0,{glContainer:rt,glEventHub:Ye,children:u.jsx(Fe,as(as({},ne),{},{children:tt?u.jsx(pe,as(as({},ne),{},{ref:se})):u.jsx(pe,as({},ne))}))})}K.displayName="DashboardWrapper(".concat((j=k.displayName)!==null&&j!==void 0?j:I,")");var ie=o.registerComponent(I,re.forwardRef(K));return M.set(I,Y),F.set(I,ee),ie},[h,c,M,F,o,v]),D=p.useCallback((I,k)=>{var j;return((j=M.get(I))!==null&&j!==void 0?j:$g)(k,r)},[M,r]),_=p.useCallback((I,k)=>{var j;return((j=F.get(I))!==null&&j!==void 0?j:$g)(k,r)},[F,r]),x=p.useMemo(()=>new fu(o,D,_,new Map,y,I=>{var{closed:k,openedMap:j}=I;m(Tn(r,{closed:k,openedMap:j}))}),[_,m,D,r,y,o]),L=p.useCallback(()=>{if(!C){T||(d(),O(!0));var I=o.toConfig(),k=I.content,j=Z.dehydrateLayoutConfig(k,_),Y=w==null||!Z.isEqual(w,j);jl.debug("handleLayoutStateChanged",Y,k,j),Y&&(b(o.root.contentItems.length===0),E(j),l(j),P(o.getReactChildren()))}},[_,T,C,w,o,l,d]),H=p.useCallback(I=>{var k=Z.getIdFromContainer(I);o.eventHub.emit(Te.DRAGGING,k),S(!0)},[o.eventHub]),G=p.useCallback(I=>{var k=Z.getIdFromContainer(I);o.eventHub.emit(Te.DROPPED,k),S(!1)},[o.eventHub]),X=p.useCallback(I=>{if(jl.debug2("handleComponentCreated",I),!(I==null||I.config==null||I.config.component==null||I.element==null)){var k=I.config.component.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),j="".concat(k,"-component");I.element.addClass(j)}},[]),W=p.useCallback(()=>{P(o.getReactChildren())},[o]);ze(o,"stateChanged",L),ze(o,"itemPickedUp",H),ze(o,"itemDropped",G),ze(o,"componentCreated",X),ze(o.eventHub,Te.TITLE_CHANGED,L),ze(o,"reactChildrenChanged",W);var A=nl(s);return p.useEffect(function(){if(A!==s&&s!==w){jl.debug("Setting new layout content...");for(var k=Z.hydrateLayoutConfig(s,D);o.root.contentItems.length>0;)o.root.contentItems[0].remove();for(var j=0;j<k.length;j+=1)o.root.addChild(k[j]);b(o.root.contentItems.length===0)}},[D,o,s,w,x,A]),u.jsxs(u.Fragment,{children:[g&&a,R,re.Children.map(i,I=>I!=null?re.cloneElement(I,{id:r,layout:o,panelManager:x,registerComponent:N}):null)]})}Xv.propTypes={id:V.string.isRequired,children:V.node,data:V.shape({}),emptyDashboard:V.node,layout:Cu.Layout.isRequired,layoutConfig:V.arrayOf(V.shape({})),onLayoutChange:V.func,onLayoutInitialized:V.func};function Hg(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 dL(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Hg(Object(t),!0).forEach(function(r){uL(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Hg(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function uL(n,e,t){return e=hL(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function hL(n){var e=cL(n,"string");return typeof e=="symbol"?e:String(e)}function cL(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var vL=100,Oh=()=>{},mL=Object.freeze({});function Tc(n){var{id:e="default",children:t,emptyDashboard:r,layoutConfig:i,layoutSettings:a=mL,onLayoutConfigChange:o=Oh,onGoldenLayoutChange:s=Oh,onLayoutInitialized:l=Oh,fallbackComponent:d=u0,hydrate:h,dehydrate:c,panelWrapper:v}=n,m=p.useRef(null),[f,g]=p.useState(!1),[b,C]=p.useState();p.useEffect(function(){if(!m.current){C(void 0);return}var E=dL({},Z.makeDefaultLayout());E.settings===void 0&&(E.settings={}),Object.assign(E.settings,a),E.content=[];var y=new s0(E,m.current),T=()=>{y.off("initialised",T),g(!0)};return y.on("initialised",T),d!=null&&y.setFallbackComponent(d),y.init(),C(y),s(y),()=>{y.destroy()}},[a,d,s,g,C]);var S=p.useMemo(()=>fi(()=>{b!=null&&b.isInitialised&&(b==null||b.updateSize())},vL),[b]);return cv(m.current,S),u.jsxs("div",{className:"dashboard-container w-100 h-100",children:[u.jsx("div",{className:"w-100 h-100",ref:m}),f&&b&&u.jsx(bu.Provider,{value:b,children:u.jsx(Xv,{emptyDashboard:r,id:e,layout:b,layoutConfig:i,onLayoutChange:o,onLayoutInitialized:l,hydrate:h,dehydrate:c,panelWrapper:v,children:t})})]})}var Qv="default",Zv="CREATE_DASHBOARD";function fL(n,e){n.on(Zv,e)}function gL(n,e){n.emit(Zv,e)}var pL=["id","isActive","plugins"];function Ug(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 Bg(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ug(Object(t),!0).forEach(function(r){bL(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ug(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function bL(n,e,t){return e=CL(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function CL(n){var e=SL(n,"string");return typeof e=="symbol"?e:String(e)}function SL(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function wL(n,e){if(n==null)return{};var t=yL(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function yL(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function EL(n){var{id:e,isActive:t,plugins:r}=n,i=wL(n,pL),[a,o]=p.useState(t),s=qs(),l=p.useCallback(d=>{s(e===Qv?y0({layoutConfig:d}):Tn(e,{layoutConfig:d}))},[e,s]);return!a&&t&&o(!0),a?u.jsx(Tc,Bg(Bg({id:e,onLayoutConfigChange:l},i),{},{children:r})):u.jsx(tr,{})}const TL=Object.freeze(Object.defineProperty({__proto__:null,CREATE_DASHBOARD:Zv,DEFAULT_DASHBOARD_ID:Qv,Dashboard:Tc,DashboardLayout:Xv,DashboardUtils:v0,GLPropTypes:Cu,LayoutManagerContext:bu,LayoutUtils:Z,LazyDashboard:EL,PanelErrorBoundary:c0,PanelEvent:Te,PanelManager:fu,SET_DASHBOARD_DATA:Kv,assertIsDashboardPluginProps:$a,canHaveRef:Vv,default:Tc,dehydrate:gu,emitCreateDashboard:gL,getAllDashboardsData:I0,getClosedPanelsForDashboard:R0,getDashboardData:jt,getOpenedPanelMapForDashboard:zv,getPluginDataForDashboard:_0,getPluginDataMapForDashboard:qv,hydrate:pu,isDashboardPluginProps:h0,isWrappedComponent:$s,listenForCreateDashboard:fL,reducers:O0,setDashboardData:Yv,setDashboardPluginData:x0,updateDashboardData:Tn,useDashboardPanel:KF,useDashboardPluginData:rL,useLayoutManager:zF,useListener:ze,usePanelRegistration:wa},Symbol.toStringTag,{value:"Module"}));function PL(n,e,t){return e=OL(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function OL(n){var e=DL(n,"string");return typeof e=="symbol"?e:String(e)}function DL(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class IL extends Error{constructor(){super(...arguments),PL(this,"isAssertionFailed",!0)}}const N0=IL;function Vg(n){if(n==null)throw new N0("Expected 'val' to be defined, but received ".concat(n))}function RL(n,e,t){return e=_L(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _L(n){var e=xL(n,"string");return typeof e=="symbol"?e:String(e)}function xL(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class NL extends Error{constructor(){super(...arguments),RL(this,"isPasteError",!0)}}const Dh=NL;function Je(n){return(n==null?void 0:n.isEditable)!==void 0}function Gg(n){if(!Je(n))throw new N0("Expected 'model' to be editable, but received ".concat(n))}function Ke(n){return(n==null?void 0:n.hasExpandableRows)!==void 0}function Cs(n,e,t){return e=ML(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ML(n){var e=FL(n,"string");return typeof e=="symbol"?e:String(e)}function FL(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var rn;(function(n){n.DOWN="DOWN",n.UP="UP",n.LEFT="LEFT",n.RIGHT="RIGHT"})(rn||(rn={}));class Q{static normalize(e,t,r,i){var a=e,o=t,s=r,l=i;return a!=null&&s!=null&&s<a&&(a=s,s=e),o!=null&&l!=null&&l<o&&(o=l,l=t),[a,o,s,l]}static makeNormalized(e,t,r,i){return new Q(...Q.normalize(e,t,r,i))}static makeCell(e,t){return new Q(e,t,e,t)}static makeColumn(e){return new Q(e,null,e,null)}static makeRow(e){return new Q(null,e,null,e)}static minOrNull(e,t){return e==null||t==null?null:Math.min(e,t)}static maxOrNull(e,t){return e==null||t==null?null:Math.max(e,t)}static consolidate(e){for(var t=e.slice(),r=!0;r;){r=!1;for(var i=0;i<t.length&&!r;i+=1)for(var a=t[i],o=t.length-1;o>i;o-=1){var s=t[o];if(a.contains(s))t.splice(o,1);else if(s.contains(a)){r=!0,t[i]=s,t.splice(o,1);break}else if(a.startRow===s.startRow&&a.endRow===s.endRow){if(a.touches(s)){var{startRow:l,endRow:d}=a,h=Q.minOrNull(a.startColumn,s.startColumn),c=Q.maxOrNull(a.endColumn,s.endColumn);r=!0,t[i]=new Q(h,l,c,d),t.splice(o,1);break}}else if(a.startColumn===s.startColumn&&a.endColumn===s.endColumn&&a.touches(s)){var{startColumn:v,endColumn:m}=a,f=Q.minOrNull(a.startRow,s.startRow),g=Q.maxOrNull(a.endRow,s.endRow);r=!0,t[i]=new Q(v,f,m,g),t.splice(o,1);break}}}return t}static isAxisRangeTouching(e,t,r,i){return e==null?t==null||r==null?!0:r<=t+1:t==null?i==null?!0:i>=e-1:r==null?i==null?!0:e<=i+1:i==null?t>=r-1:r>=e-1?r<=t+1:i>=e-1}static rangeArraysEqual(e,t){if(e===t)return!0;if(e==null||t==null||e.length!==t.length)return!1;for(var r=0;r<e.length;r+=1)if(!e[r].equals(t[r]))return!1;return!0}static intersection(e,t){var r,i,a,o,s,l;if(e.equals(t))return e;var{startColumn:d,startRow:h,endColumn:c,endRow:v}=e;return d=d!=null&&t.startColumn!=null?Math.max(d,t.startColumn):(r=d)!==null&&r!==void 0?r:t.startColumn,c=c!=null&&t.endColumn!=null?Math.min(c,t.endColumn):(i=c)!==null&&i!==void 0?i:t.endColumn,h=h!=null&&t.startRow!=null?Math.max(h,t.startRow):(a=h)!==null&&a!==void 0?a:t.startRow,v=v!=null&&t.endRow!=null?Math.min(v,t.endRow):(o=v)!==null&&o!==void 0?o:t.endRow,d!=null&&d>((s=c)!==null&&s!==void 0?s:-1)||h!=null&&h>((l=v)!==null&&l!==void 0?l:-1)?null:new Q(d,h,c,v)}static subtractFromRange(e,t){var r=[],i=Q.intersection(e,t);return i==null?[e]:(i.startRow!=null&&(e.startRow==null||e.startRow<i.startRow)&&r.push(new Q(e.startColumn,e.startRow,e.endColumn,i.startRow-1)),i.startColumn!=null&&(e.startColumn==null||e.startColumn<i.startColumn)&&r.push(new Q(e.startColumn,i.startRow,i.startColumn-1,i.endRow)),i.endColumn!=null&&(e.endColumn==null||e.endColumn>i.endColumn)&&r.push(new Q(i.endColumn+1,i.startRow,e.endColumn,i.endRow)),i.endRow!=null&&(e.endRow==null||e.endRow>i.endRow)&&r.push(new Q(e.startColumn,i.endRow+1,e.endColumn,e.endRow)),r)}static subtractFromRanges(e,t){for(var r=[],i=0;i<e.length;i+=1)r.push(...Q.subtractFromRange(e[i],t));return r}static subtractRangesFromRanges(e,t){for(var r=[...e],i=0;i<t.length;i+=1)r=Q.subtractFromRanges(r,t[i]);return r}static isBounded(e){return e.startRow!=null&&e.startColumn!=null&&e.endRow!=null&&e.endColumn!=null}static boundedRange(e,t,r){var i,a,o,s;return Q.isBounded(e)?e:new Q((i=e.startColumn)!==null&&i!==void 0?i:0,(a=e.startRow)!==null&&a!==void 0?a:0,(o=e.endColumn)!==null&&o!==void 0?o:t-1,(s=e.endRow)!==null&&s!==void 0?s:r-1)}static boundedRanges(e,t,r){return e.map(i=>Q.boundedRange(i,t,r))}static offset(e,t,r){return new Q(e.startColumn!=null?e.startColumn+t:null,e.startRow!=null?e.startRow+r:null,e.endColumn!=null?e.endColumn+t:null,e.endRow!=null?e.endRow+r:null)}static nextCell(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Q.SELECTION_DIRECTION.DOWN;if(e.length===0)return null;var a=-1;if(t!=null&&r!=null&&(a=e.findIndex(v=>v.containsCell(t,r)),a>=0)){var o=e[a],s=o.nextCell(t,r,i);if(s!=null)return s}switch(i){case Q.SELECTION_DIRECTION.DOWN:case Q.SELECTION_DIRECTION.RIGHT:{var l=a<e.length-1?a+1:0,d=e[l];return d.startCell(i)}case Q.SELECTION_DIRECTION.LEFT:case Q.SELECTION_DIRECTION.UP:{var h=a>0?a-1:e.length-1,c=e[h];return c.startCell(i)}default:throw new Error("Invalid direction: ".concat(i))}}static cellCount(e){return e.reduce((t,r)=>{var i,a,o,s;return t+(((i=r.endRow)!==null&&i!==void 0?i:NaN)-((a=r.startRow)!==null&&a!==void 0?a:NaN)+1)*(((o=r.endColumn)!==null&&o!==void 0?o:NaN)-((s=r.startColumn)!==null&&s!==void 0?s:NaN)+1)},0)}static rowCount(e){return e.reduce((t,r)=>{var i,a;return t+((i=r.endRow)!==null&&i!==void 0?i:NaN)-((a=r.startRow)!==null&&a!==void 0?a:NaN)+1},0)}static columnCount(e){return e.reduce((t,r)=>{var i,a;return t+((i=r.endColumn)!==null&&i!==void 0?i:NaN)-((a=r.startColumn)!==null&&a!==void 0?a:NaN)+1},0)}static containsCell(e,t,r){for(var i=0;i<e.length;i+=1){var a=e[i];if(a.containsCell(t,r))return!0}return!1}static forEachCell(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Q.SELECTION_DIRECTION.RIGHT,i=0;i<e.length;i+=1)e[i].forEach(t,r)}constructor(e,t,r,i){Cs(this,"startColumn",void 0),Cs(this,"startRow",void 0),Cs(this,"endColumn",void 0),Cs(this,"endRow",void 0),this.startColumn=e,this.startRow=t,this.endColumn=r,this.endRow=i}equals(e){return this.startColumn===e.startColumn&&this.startRow===e.startRow&&this.endColumn===e.endColumn&&this.endRow===e.endRow}contains(e){return(this.startColumn==null||e.startColumn!=null&&this.startColumn<=e.startColumn)&&(this.startRow==null||e.startRow!=null&&this.startRow<=e.startRow)&&(this.endColumn==null||e.endColumn!=null&&this.endColumn>=e.endColumn)&&(this.endRow==null||e.endRow!=null&&this.endRow>=e.endRow)}containsCell(e,t){return e==null||t==null?!1:(this.startColumn==null||this.startColumn<=e)&&(this.endColumn==null||this.endColumn>=e)&&(this.startRow==null||this.startRow<=t)&&(this.endRow==null||this.endRow>=t)}touches(e){return Q.isAxisRangeTouching(this.startRow,this.endRow,e.startRow,e.endRow)&&Q.isAxisRangeTouching(this.startColumn,this.endColumn,e.startColumn,e.endColumn)}subtract(e){return Q.subtractFromRange(this,e)}startCell(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Q.SELECTION_DIRECTION.DOWN;if(!Q.isBounded(this))throw new Error("Cannot get the startCell of an unbounded range");switch(e){case Q.SELECTION_DIRECTION.DOWN:case Q.SELECTION_DIRECTION.RIGHT:return{column:this.startColumn,row:this.startRow};case Q.SELECTION_DIRECTION.LEFT:case Q.SELECTION_DIRECTION.UP:return{column:this.endColumn,row:this.endRow};default:throw new Error("Invalid direction: ".concat(e))}}nextCell(e,t,r){if(!Q.isBounded(this))throw new Error("Bounded range required");if(e==null||t==null)throw new Error("Require a non-null cursor");var{startColumn:i,endColumn:a,startRow:o,endRow:s}=this;switch(r){case Q.SELECTION_DIRECTION.DOWN:if(t<s)return{column:e,row:Math.max(t+1,o)};if(e<a)return{column:Math.max(e+1,i),row:o};break;case Q.SELECTION_DIRECTION.UP:if(t>o)return{column:e,row:Math.min(t-1,s)};if(e>i)return{column:Math.min(e-1,a),row:s};break;case Q.SELECTION_DIRECTION.RIGHT:if(e<a)return{column:Math.max(e+1,i),row:t};if(t<s)return{column:i,row:Math.max(t+1,o)};break;case Q.SELECTION_DIRECTION.LEFT:if(e>i)return{column:Math.min(e-1,a),row:t};if(t>o)return{column:a,row:Math.min(t-1,s)};break;default:throw new Error("Invalid direction: ".concat(r))}return null}forEach(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Q.SELECTION_DIRECTION.RIGHT,r=0,{column:i,row:a}=this.startCell(t);i!=null&&a!=null;){var o;e(i,a,r),r+=1,{column:i,row:a}=(o=this.nextCell(i,a,t))!==null&&o!==void 0?o:{}}}}Cs(Q,"SELECTION_DIRECTION",rn);function AL(n){return Array.isArray(n)&&n.length===2&&(n[0]===null||typeof n[0]=="number")&&(n[1]===null||typeof n[1]=="number")}function $l(n){return AL(n)&&n[0]!=null&&n[1]!=null}function Wg(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 Hl(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Wg(Object(t),!0).forEach(function(r){M0(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Wg(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function M0(n,e,t){return e=LL(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function LL(n){var e=kL(n,"string");return typeof e=="symbol"?e:String(e)}function kL(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Rd(n){return(n==null?void 0:n.href)!==void 0}class ae{static getGridPointFromXY(e,t,r){var i=ae.getColumnAtX(e,r),a=ae.getRowAtY(t,r),o=ae.getColumnHeaderDepthAtY(t,r);return{x:e,y:t,row:a,column:i,columnHeaderDepth:o}}static getCellInfoFromXY(e,t,r){var{row:i,column:a}=ae.getGridPointFromXY(e,t,r),{allColumnWidths:o,allRowHeights:s,allColumnXs:l,allRowYs:d,modelColumns:h,modelRows:c}=r,v=i!==null?c.get(i):null,m=a!==null?h.get(a):null,f=a!==null?l.get(a):null,g=i!==null?d.get(i):null,b=a!==null?o.get(a):null,C=i!==null?s.get(i):null;return{row:i,column:a,modelRow:v??null,modelColumn:m??null,left:f??null,top:g??null,columnWidth:b??null,rowHeight:C??null}}static getColumnHeaderDepthAtY(e,t){var r=ae.getRowAtY(e,t),{columnHeaderHeight:i,columnHeaderMaxDepth:a}=t;if(r===null&&e<=i*a)return ke(a-Math.ceil(e/i),0,a-1)}static iterateFloatingStart(e,t,r){for(var i=0;i<e&&i<t;i+=1){var a=r(i);if(a!==void 0)return a}}static iterateFloatingEnd(e,t,r){for(var i=0;i<e&&t-(e-i)>=0;i+=1){var a=r(t-(e-i));if(a!==void 0)return a}}static iterateFloating(e,t,r,i){var a=ae.iterateFloatingStart(e,r,i);return a!==void 0?a:ae.iterateFloatingEnd(t,r,i)}static iterateAllItems(e,t,r,i,a,o){var s=Math.max(e,r),l=Math.min(t,a-i-1),d=ae.iterateFloating(r,i,a,o);if(d!==void 0)return d;for(var h=s;h<=l;h+=1)if(d=o(h),d!==void 0)return d}static isInItem(e,t,r,i){var a,o,s=(a=t.get(e))!==null&&a!==void 0?a:0,l=(o=r.get(e))!==null&&o!==void 0?o:0;return s<=i&&i<=s+l}static getItemAtOffset(e,t,r,i,a,o,s){var l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:!1,d=l?void 0:ae.iterateFloating(r,i,t,v=>{if(ae.isInItem(v,o,s,e))return v});if(!l&&d!==void 0)return d;for(var h=0;h<a.length;h+=1){var c=a[h];if(ae.isInItem(c,o,s,e))return c}return null}static getColumnAtX(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,{columnCount:i,floatingLeftColumnCount:a,floatingRightColumnCount:o,visibleColumns:s,allColumnXs:l,allColumnWidths:d,gridX:h}=t;return e<h?null:this.getItemAtOffset(e-h,i,a,o,s,l,d,r)}static getRowAtY(e,t){var{floatingTopRowCount:r,floatingBottomRowCount:i,rowCount:a,visibleRows:o,allRowYs:s,allRowHeights:l,gridY:d}=t;return e<d?null:this.getItemAtOffset(e-d,a,r,i,o,s,l)}static getNextShownItem(e,t,r,i){var a=r.findIndex(l=>l===e)||0;for(a-=1;a!=null&&a>=0;){var o=r[a],s=t.get(o);if(s!=null&&i.get(s)!==0)return o;a-=1}return null}static getNextShownColumn(e,t){var{modelColumns:r,visibleColumns:i,userColumnWidths:a}=t;return ae.getNextShownItem(e,r,i,a)}static getNextShownRow(e,t){var{modelRows:r,visibleRows:i,userRowHeights:a}=t;return ae.getNextShownItem(e,r,i,a)}static getColumnSeparatorIndex(e,t,r,i){var{rowHeaderWidth:a,columnHeaderHeight:o,floatingColumns:s,floatingLeftWidth:l,visibleColumns:d,allColumnXs:h,allColumnWidths:c,columnHeaderMaxDepth:v}=r,{allowColumnResize:m,headerSeparatorHandleSize:f}=i;if(v*o<t||!m||f<=0)return null;for(var g=e-a,b=f*.5,C=!1,S=s.length-1;S>=0;S-=1){var w,E,y=s[S],T=(w=h.get(y))!==null&&w!==void 0?w:0,O=(E=c.get(y))!==null&&E!==void 0?E:0,R=O===0;if(!C||!R){var P=T+O;R?P+=b:C&&(P-=b);var M=P-b,F=P+b;if(M<=g&&g<=F)return y;C=R}}C=!1;for(var N=d.length-1;N>=0;N-=1){var D,_,x=d[N],L=(D=h.get(x))!==null&&D!==void 0?D:0,H=(_=c.get(x))!==null&&_!==void 0?_:0,G=H===0;if(L<l-H)return null;if(!C||!G){var X=L+H;G?X+=b:C&&(X-=b);var W=X-b,A=X+b;if(W<=g&&g<=A)return x;C=G}}return null}static isItemHidden(e,t){return t.get(e)===0}static isColumnHidden(e,t){var{allColumnWidths:r}=t;return ae.isItemHidden(e,r)}static isFloatingRow(e,t){if(e==null)return!1;var{floatingTopRowCount:r,floatingBottomRowCount:i,rowCount:a}=t;return e<r||e>=a-i}static isFloatingColumn(e,t){if(e==null)return!1;var{floatingLeftColumnCount:r,floatingRightColumnCount:i,columnCount:a}=t;return e<r||e>=a-i}static getHiddenItems(e,t,r){if(!ae.isItemHidden(e,t))return[];for(var i=[e],a=r.findIndex(l=>l===e),o=a-1;o>=0;o-=1){var s=r[o];if(!ae.isItemHidden(s,t))break;i.push(s)}return i}static getHiddenColumns(e,t){var{visibleColumns:r,allColumnWidths:i}=t;return ae.getHiddenItems(e,i,r)}static getRowSeparatorIndex(e,t,r,i){var{rowHeaderWidth:a,columnHeaderHeight:o,visibleRows:s,allRowYs:l,allRowHeights:d}=r,{allowRowResize:h,headerSeparatorHandleSize:c}=i;if(a<e||!h||c<=0)return null;for(var v=t-o,m=c*.5,f=!1,g=s.length-1;g>=0;g-=1){var b,C,S=s[g],w=(b=l.get(S))!==null&&b!==void 0?b:0,E=(C=d.get(S))!==null&&C!==void 0?C:0,y=E===0;if(!f||!y){var T=w+E;y?T+=m:f&&(T-=m);var O=T-m,R=T+m;if(O<=v&&v<=R)return S;f=y}}return null}static isRowHidden(e,t){var{allRowHeights:r}=t;return ae.isItemHidden(e,r)}static getHiddenRows(e,t){var{visibleRows:r,allRowHeights:i}=t;return ae.getHiddenItems(e,i,r)}static moveItem(e,t,r){if(e===t)return[...r];var i=[...r],a=i[i.length-1];return a!=null&&!$l(a.from)&&a.to===e?a.from===t?i.pop():i[i.length-1]=Hl(Hl({},a),{},{to:t}):i.push({from:e,to:t}),i}static moveRange(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e[0]===e[1])return ae.moveItem(e[0],t,r);var a=t;if(i&&e[0]<t&&(a-=e[1]-e[0]),e[0]===a)return[...r];var o=[...r],s=o[o.length-1];s!=null&&$l(s.from)&&s.from[1]-s.from[0]===e[1]-e[0]&&s.to===e[0]?o[o.length-1]=Hl(Hl({},s),{},{to:a}):o.push({from:e,to:a});var l=o[o.length-1];return $l(l.from)&&l.from[0]===l.to&&o.pop(),o}static moveItemOrRange(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return Array.isArray(e)?ae.moveRange(e,t,r,i):ae.moveItem(e,t,r)}static applyItemMoves(e,t,r){for(var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,a=[[e,t]],o=function(){var{from:d,to:h}=r[s],c=1,v;$l(d)?(c=d[1]-d[0]+1,[v]=d):v=d;for(var m=i?h:v,f=m+c-1,g=i?v:h,b=g-m,C=[],S=function(){var y,T,O=(y=a[w][0])!==null&&y!==void 0?y:Number.NEGATIVE_INFINITY,R=(T=a[w][1])!==null&&T!==void 0?T:Number.POSITIVE_INFINITY,P,M=[[O,m-1],[m,f],[f+1,R]].map(F=>{var[N,D]=F;return[Math.max(N,O),Math.min(D,R)]}).filter(F=>{var[N,D]=F;return N<=D}).map(F=>{var[N,D]=F;return m<=N&&f>=D?(P=[N+b,D+b],P):f<N?[N-c,D-c]:F}).map(F=>{var[N,D]=F;return g>N&&g<=D?[[N,g-1],[g+c,D+c]]:F===P?[F]:g<=N?[[N+c,D+c]]:[F]}).flat();C.push(...M)},w=0;w<a.length;w+=1)S();a=C.map(E=>{var[y,T]=E;return[Number.isFinite(y)?y:null,Number.isFinite(T)?T:null]})},s=i?r.length-1:0;i?s>=0:s<r.length;i?s-=1:s+=1)o();return a}static translateRange(e,t,r,i){for(var a=ae.applyItemMoves(e.startColumn,e.endColumn,t,i),o=ae.applyItemMoves(e.startRow,e.endRow,r,i),s=[],l=0;l<a.length;l+=1)for(var d=a[l],h=0;h<o.length;h+=1){var c=o[h];s.push(new Q(d[0],c[0],d[1],c[1]))}return s}static getModelIndex(e,t){var r=ae.applyItemMoves(e,e,t,!0)[0][0];return r}static getModelIndexes(e,t){return e.map(r=>ae.getModelIndex(r,t))}static getModelRangeIndexes(e,t,r){return ae.applyItemMoves(e,t,r,!0)}static getModelRange(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ye,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ye;return ae.translateRange(e,t,r,!0)}static getModelRanges(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ye,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ye,i=[],a=0;a<e.length;a+=1)i.push(...ae.getModelRange(e[a],t,r));return i}static getVisibleRangeIndexes(e,t,r){return ae.applyItemMoves(e,t,r,!1)}static getVisibleRange(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ye,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ye;return this.translateRange(e,t,r,!1)}static getVisibleRanges(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ye,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ye,i=[],a=0;a<e.length;a+=1)i.push(...ae.getVisibleRange(e[a],t,r));return i}static getVisibleIndex(e,t){var r=ae.applyItemMoves(e,e,t)[0][0];return r}static getVisibleIndexes(e,t){return e.map(r=>ae.getVisibleIndex(r,t))}static isMacPlatform(){var{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return ae.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){var t=ae.getModifierKey();return e[t]}static checkColumnHidden(e,t){return t.get(e)===0}static checkAllColumnsHidden(e,t){return t.size===0?!1:e.every(r=>t.get(r)===0)}static getScrollDragBounds(e,t,r){var{gridX:i,gridY:a,width:o,height:s,floatingTopRowCount:l,floatingBottomRowCount:d,floatingLeftColumnCount:h,floatingRightColumnCount:c,floatingLeftWidth:v,floatingRightWidth:m,floatingTopHeight:f,floatingBottomHeight:g,columnCount:b,rowCount:C}=e,S=i,w=a,E=o,y=s;return r!=null&&(r>h&&(S+=v),r<b-c&&(E-=m)),t!=null&&(t>l&&(w+=f),t<C-d&&(y-=g)),{x1:S,y1:w,x2:E,y2:y}}static getScrollDelta(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1024,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:768,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:20,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:20,{deltaX:o,deltaY:s}=e;return!ae.isMacPlatform()&&e.shiftKey&&e.deltaX===0&&e.deltaY!==0&&(o=e.deltaY,s=e.deltaX),(e==null?void 0:e.deltaMode)===WheelEvent.DOM_DELTA_PAGE?(o*=t,s*=r):(e==null?void 0:e.deltaMode)===WheelEvent.DOM_DELTA_LINE&&(ae.isMacPlatform()?(o=Math.round(o*i),s=Math.round(s*a)):(o=Math.round(o*this.PIXELS_PER_LINE),s=Math.round(s*this.PIXELS_PER_LINE))),{deltaX:o,deltaY:s}}static compareRanges(e,t){return e[0]==null||e[1]==null||t[0]==null||t[1]==null?0:e[0]!==t[0]?e[0]-t[0]:e[1]-t[1]}static mergeSortedRanges(e){for(var t=[],r=0;r<e.length;r+=1){var i=e[r],a=i[0],o=i[1];r===0?t.push([a,o]):a-1<=t[t.length-1][1]?t[t.length-1][1]=Math.max(t[t.length-1][1],o):t.push([a,o])}return t}static translateTokenBox(e,t){var{x1:r,y1:i,x2:a,y2:o}=e,{gridX:s,gridY:l,width:d,height:h,verticalBarWidth:c,horizontalBarHeight:v}=t,m=ke(s+r,s,d-c),f=ke(s+a,s,d-c),g=ke(l+i,l,h-v),b=ke(l+o,l,h-v);return{x1:m,y1:g,x2:f,y2:b,token:e.token}}static getTextRenderMetrics(e,t,r){var{metrics:i,model:a,theme:o}=e,{firstColumn:s,allColumnXs:l,allColumnWidths:d,allRowYs:h,allRowHeights:c,modelRows:v,modelColumns:m}=i,{cellHorizontalPadding:f,treeDepthIndent:g,treeHorizontalPadding:b}=o,C=U(v,r),S=U(m,t),w=a.textAlignForCell(S,C),E=U(l,t),y=U(h,r),T=U(d,t),O=U(c,r),R=t===s,P=0;Ke(a)&&a.hasExpandableRows&&R&&(P=g*(a.depthForRow(r)+1)+b);var M=T-P,F=E+f,N=y+O*.5;return w==="right"?F=E+M-f:w==="center"&&(F=E+M*.5),F+=P,{width:M-f*2,x:F,y:N}}static findTokensWithProtocolInText(e){var t=TS(e);return t.filter(r=>r.type==="url"?/^https?:\/\//.test(r.value):!0)}}M0(ae,"PIXELS_PER_LINE",100/3);const he=ae;function yr(n,e,t){return e=jL(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jL(n){var e=$L(n,"string");return typeof e=="symbol"?e:String(e)}function $L(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Ul(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ha.CACHE_SIZE,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Math.floor(e/2);if(n.size>e)for(var r=n.keys();n.size>t;)n.delete(r.next().value)}function Kg(n,e,t,r,i){for(var a=new Map,o=0,s=0;s<n&&s<t;s+=1)a.set(s,o),o+=U(i,s);o=r;for(var l=0;l<e&&t-l-1>=0;l+=1)o-=U(i,t-l-1),a.set(t-l-1,o);return a}class Ha{constructor(){var{userColumnWidths:e=new Map,userRowHeights:t=new Map,calculatedColumnWidths:r=new Map,calculatedRowHeights:i=new Map,fontWidths:a=new Map,modelRows:o=new Map,modelColumns:s=new Map,movedRows:l=[],movedColumns:d=[],initialRowHeights:h=new Map,initialColumnWidths:c=new Map}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};yr(this,"initialRowHeights",void 0),yr(this,"initialColumnWidths",void 0),yr(this,"userColumnWidths",void 0),yr(this,"userRowHeights",void 0),yr(this,"calculatedColumnWidths",void 0),yr(this,"calculatedRowHeights",void 0),yr(this,"fontWidths",void 0),yr(this,"modelRows",void 0),yr(this,"modelColumns",void 0),yr(this,"movedRows",void 0),yr(this,"movedColumns",void 0),this.userColumnWidths=e,this.userRowHeights=t,this.calculatedRowHeights=i,this.calculatedColumnWidths=r,this.fontWidths=a,this.modelRows=o,this.modelColumns=s,this.movedRows=l,this.movedColumns=d,this.initialRowHeights=h,this.initialColumnWidths=c}getMetrics(e){var{left:t,top:r,leftOffset:i,topOffset:a,width:o,height:s,theme:l,model:d,movedRows:h,movedColumns:c,draggingColumn:v}=e,{rowHeight:m,rowHeaderWidth:f,rowFooterWidth:g,columnWidth:b,columnHeaderHeight:C,minScrollHandleSize:S,scrollBarSize:w}=l;h!==this.movedRows&&(this.movedRows=h,this.modelRows.clear()),c!==this.movedColumns&&(this.movedColumns=c,this.modelColumns.clear());var{columnCount:E,rowCount:y,floatingTopRowCount:T,floatingBottomRowCount:O,floatingLeftColumnCount:R,floatingRightColumnCount:P,columnHeaderMaxDepth:M}=d,F=this.getFirstRow(e),N=this.getFirstColumn(e),D=this.getGridX(e),_=this.getGridY(e),x=Ke(d)&&d.hasExpandableRows?this.calculateTreePaddingX(e):0,L=0,H=this.getVisibleRowHeights(e),G=this.getVisibleColumnWidths(e,N,x),X=Array.from(H.keys()),W=Array.from(G.keys()),A=new Map([...H,...this.getFloatingRowHeights(e)]),I=new Map([...G,...this.getFloatingColumnWidths(e)]),k=this.getVisibleColumnXs(I,W,i),j=this.getVisibleRowYs(A,X,a),Y=X.length>0?X[X.length-1]:r,ee=W.length>0?W[W.length-1]:t,K=this.getBottomViewport(e,X,j,A),ie=this.getRightViewport(e,W,k,I),ne=this.getFloatingTopHeight(e,A),se=this.getFloatingBottomHeight(e,A),pe=this.getFloatingLeftWidth(e,I),Fe=this.getFloatingRightWidth(e,I),tt=Array.from(I.values()),rt=Array.from(A.values()),Ye=tt.reduce((On,va)=>On+va,0)-i,vt=rt.reduce((On,va)=>On+va,0)-a,St=i+Ye+g,$e=a+vt,wt=o-D,Rt=s-_,Lr=this.getLastLeft(e,null,wt-g),fr=this.getLastLeft(e,null,wt-g-w),Wn=this.getLastTop(e,null,Rt-se),on=this.getLastTop(e,null,Rt-se-w),gr=fr,nt=on;Lr===0&&Wn===0&&(gr=0,nt=0);var Bt=gr>0,kr=Bt?w:0,pr=nt>0,jr=pr?w:0,wi=D,$r=M*C,Hr=o-wi-jr,nr=s-$r-kr,Kn=E===1?Hr/St:(E-gr)/E,zn=y===1?nr/$e:(y-nt)/y,qn=Bt?ke(Hr*Kn,S,Hr-1):0,br=pr?ke(nr*zn,S,nr-1):0,sn=U(I,t,0),yi=U(A,r,0),ua=sn>0?i/sn:0,zo=yi>0?a/yi:0,qo=E===1?i/(St-wt):(t+ua)/gr,Yo=y===1?a/($e-Rt):(r+zo)/nt,Xo=Bt?qo*(Hr-qn):0,it=pr?Yo*(nr-br):0,wl=[...Array(T).keys(),...[...Array(O).keys()].map(On=>y-On-1)],ha=new Map([...j,...this.getFloatingRowYs(e,A,Math.floor(s-_-kr))]),Ei=[...Array(R).keys(),...[...Array(P).keys()].map(On=>E-On-1)],ca=new Map([...k,...this.getFloatingColumnXs(e,I,Math.floor(o-D-jr))]),Qo=[];if(v)for(var Pn=v.range[0];Pn<=v.range[1];Pn+=1)Qo.push(Pn),I.has(Pn)||I.set(Pn,this.getVisibleColumnWidth(Pn,e)),ca.has(Pn)||ca.set(Pn,0);var yl=X.concat(wl),El=W.concat(Ei).concat(Qo),Zo=this.getModelRows(yl,e),Tl=this.getModelColumns(El,e),Ku=this.getVisibleRowTreeBoxes(A,Zo,e),Pl=this.getTopVisible(e,ha,A,X),Ol=this.getLeftVisible(e,ca,I,W),zu=nt>0?this.getBottomVisible(e,ha,A,X,_):Y,qu=gr>0?this.getRightVisible(e,ca,I,W,D):ee,{fontWidths:Yu,userColumnWidths:Xu,userRowHeights:Qu,calculatedRowHeights:Zu,calculatedColumnWidths:Dl}=this;return{rowHeight:m,rowHeaderWidth:f,rowFooterWidth:g,rowCount:y,columnWidth:b,columnCount:E,columnHeaderHeight:C,floatingTopRowCount:T,floatingBottomRowCount:O,floatingLeftColumnCount:R,floatingRightColumnCount:P,gridX:D,gridY:_,firstRow:F,firstColumn:N,treePaddingX:x,treePaddingY:L,left:t,top:r,bottom:Y,right:ee,topOffset:a,leftOffset:i,topVisible:Pl,leftVisible:Ol,bottomVisible:zu,rightVisible:qu,bottomViewport:K,rightViewport:ie,width:o,height:s,maxX:Ye,maxY:vt,lastLeft:gr,lastTop:nt,barHeight:nr,barTop:$r,barWidth:Hr,barLeft:wi,handleHeight:br,handleWidth:qn,hasHorizontalBar:Bt,hasVerticalBar:pr,verticalBarWidth:jr,horizontalBarHeight:kr,scrollX:Xo,scrollY:it,scrollableContentWidth:St,scrollableContentHeight:$e,scrollableViewportWidth:wt,scrollableViewportHeight:Rt,visibleRows:X,visibleColumns:W,visibleRowHeights:H,visibleColumnWidths:G,floatingRows:wl,floatingColumns:Ei,allRows:yl,allColumns:El,allRowHeights:A,allColumnWidths:I,floatingTopHeight:ne,floatingBottomHeight:se,floatingLeftWidth:pe,floatingRightWidth:Fe,visibleRowYs:j,visibleColumnXs:k,allRowYs:ha,allColumnXs:ca,visibleRowTreeBoxes:Ku,modelRows:Zo,modelColumns:Tl,movedRows:h,movedColumns:c,fontWidths:Yu,userColumnWidths:Xu,userRowHeights:Qu,calculatedRowHeights:Zu,calculatedColumnWidths:Dl,columnHeaderMaxDepth:M}}getGridX(e){var{theme:t}=e,{rowHeaderWidth:r}=t;return r}getGridY(e){var{theme:t,model:r}=e,{columnHeaderHeight:i}=t,{columnHeaderMaxDepth:a}=r;return a*i}getVisibleHeight(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFloatingRowHeights(e),{height:r,theme:i}=e,{scrollBarSize:a}=i,o=this.getGridY(e),s=this.getFloatingBottomHeight(e,t),l=this.getFloatingTopHeight(e,t);return r-s-l-o-a}getVisibleWidth(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFloatingColumnWidths(e),{width:r,theme:i}=e,{scrollBarSize:a,rowFooterWidth:o}=i,s=this.getGridX(e),l=this.getFloatingRightWidth(e,t),d=this.getFloatingLeftWidth(e,t);return r-d-l-s-a-o}getFirstIndex(e,t,r){for(var i=e.size+1,a=0;a<i;a+=1){var o=t(a,r);if(e.get(o)!==0)return a}return 0}getFirstColumn(e){return this.getFirstIndex(this.userColumnWidths,this.getModelColumn.bind(this),e)}getFirstRow(e){return this.getFirstIndex(this.userRowHeights,this.getModelRow.bind(this),e)}getLastLeft(e,t,r){var{model:i}=e,{columnCount:a,floatingRightColumnCount:o}=i,s=Math.max(0,a-o-1);t!=null&&(s=t);for(var l=0;s>=0;){var d=this.getVisibleColumnWidth(s,e);if(l+=d,l>=r)return ke(s+1,0,t??a-1);s-=1}return 0}getLastTop(e,t,r){var{model:i}=e,{rowCount:a,floatingBottomRowCount:o}=i,s=Math.max(0,a-o-1);t!=null&&(s=t);for(var l=0;s>=0;){var d=this.getVisibleRowHeight(s,e);if(l+=d,l>=r)return ke(s+1,0,a-1);s-=1}return 0}getTopForTopVisible(e,t){for(var r=this.getFloatingTopHeight(e),i=t,a=0;i>0&&a<r;)i-=1,a+=this.getVisibleRowHeight(i,e);return i}getTopForBottomVisible(e,t){var{height:r}=e,i=this.getGridY(e),a=this.getFloatingBottomHeight(e),o=r-i-a;return this.getLastTop(e,t,o)}getLeftForLeftVisible(e,t){for(var r=this.getFloatingLeftWidth(e),i=t,a=0;i>0&&a<r;)i-=1,a+=this.getVisibleColumnWidth(i,e);return i}getLeftForRightVisible(e,t){var{width:r}=e,i=this.getGridX(e),a=this.getFloatingRightWidth(e),o=r-i-a;return this.getLastLeft(e,t,o)}getFloatingRowHeights(e){for(var{model:t}=e,{floatingTopRowCount:r,floatingBottomRowCount:i,rowCount:a}=t,o=new Map,s=0;s<r&&s<a;s+=1)o.set(s,this.getVisibleRowHeight(s,e));for(var l=0;l<i&&a-l-1>=0;l+=1){var d=a-l-1;o.set(d,this.getVisibleRowHeight(d,e))}return o}getVisibleRowHeights(e){for(var{top:t,topOffset:r,height:i,model:a}=e,o=0,s=t,l=new Map,{rowCount:d}=a;o<i+r&&s<d;){var h=this.getVisibleRowHeight(s,e);l.set(s,h),o+=h,s+=1}return l}getFloatingColumnWidths(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFirstColumn(e),r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.calculateTreePaddingX(e),{model:i}=e,{columnCount:a,floatingLeftColumnCount:o,floatingRightColumnCount:s}=i,l=new Map,d=0;d<o&&d<a;d+=1)l.set(d,this.getVisibleColumnWidth(d,e,t,r));for(var h=0;h<s&&a-h-1>=0;h+=1){var c=a-h-1;l.set(c,this.getVisibleColumnWidth(c,e,t,r))}return l}getVisibleColumnWidths(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFirstColumn(e),r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.calculateTreePaddingX(e),{left:i,leftOffset:a,width:o,model:s}=e,l=0,d=i,h=new Map,{columnCount:c}=s;l<o+a&&d<c;){var v=this.getVisibleColumnWidth(d,e,t,r);h.set(d,v),l+=v,d+=1}return h}getFloatingColumnXs(e,t,r){var{model:i}=e,{columnCount:a,floatingLeftColumnCount:o,floatingRightColumnCount:s}=i;return Kg(o,s,a,r,t)}getVisibleColumnXs(e,t,r){for(var i=new Map,a=-r,o=0;o<t.length;o+=1){var s=t[o],l=U(e,s);i.set(s,a),a+=l}return i}getFloatingRowYs(e,t,r){var{model:i}=e,{floatingTopRowCount:a,floatingBottomRowCount:o,rowCount:s}=i;return Kg(a,o,s,r,t)}getVisibleRowYs(e,t,r){for(var i=new Map,a=-r,o=0;o<t.length;o+=1){var s=t[o],l=U(e,s);i.set(s,a),a+=l}return i}getVisibleRowTreeBoxes(e,t,r){var i=new Map,{model:a,theme:o}=r,{treeDepthIndent:s,treeHorizontalPadding:l}=o;return Ke(a)&&a.hasExpandableRows&&e.forEach((d,h)=>{var c=U(t,h);if(a.isRowExpandable(c)){var v=a.depthForRow(c),m=v*s+l,f=(v+1)*s+l,g=0,b=d;i.set(h,{x1:m,y1:g,x2:f,y2:b})}}),i}getFloatingLeftWidth(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFloatingColumnWidths(e),{model:r}=e,{floatingLeftColumnCount:i}=r,a=0,o=0;o<i;o+=1)a+=U(t,o);return a}getFloatingRightWidth(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFloatingColumnWidths(e),{model:r}=e,{floatingRightColumnCount:i,columnCount:a}=r,o=0,s=0;s<i;s+=1)o+=U(t,a-s-1);return o}getFloatingTopHeight(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFloatingRowHeights(e),{model:r}=e,{floatingTopRowCount:i}=r,a=0,o=0;o<i;o+=1)a+=U(t,o);return a}getFloatingBottomHeight(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFloatingRowHeights(e),{model:r}=e,{floatingBottomRowCount:i,rowCount:a}=r,o=0,s=0;s<i;s+=1)o+=U(t,a-s-1);return o}getTopVisible(e,t,r,i){for(var a=this.getFloatingTopHeight(e,r),o=0;o<i.length;o+=1){var s=i[o],l=U(t,s);if(l>=a)return s}return 0}getLeftVisible(e,t,r,i){for(var a=this.getFloatingLeftWidth(e,r),o=0;o<i.length;o+=1){var s=i[o],l=U(t,s);if(l>=a)return s}return 0}getBottomVisible(e,t,r,i,a){for(var{height:o,theme:s}=e,{scrollBarSize:l}=s,d=this.getFloatingBottomHeight(e,r),h=o-a-l-d,c=i.length-1;c>=0;c-=1){var v=i[c],m=U(t,v),f=U(r,v);if(m+f<=h)return v}return 0}getRightVisible(e,t,r,i,a){for(var{width:o,theme:s}=e,{scrollBarSize:l}=s,d=this.getFloatingRightWidth(e,r),h=o-a-l-d,c=i.length-1;c>=0;c-=1){var v=i[c],m=U(t,v),f=U(r,v);if(m+f<=h)return v}return 0}getBottomViewport(e,t,r,i){var{height:a,theme:o}=e,{rowHeight:s}=o;return this.getLastIndexViewport(t,r,i,a,s)}getRightViewport(e,t,r,i){var{width:a,theme:o}=e,{columnWidth:s}=o;return this.getLastIndexViewport(t,r,i,a,s)}getLastIndexViewport(e,t,r,i,a){var o=0,s=0;return e.length>0&&(o=e[e.length-1],s=U(t,o)+U(r,o)),s<i&&(o+=Math.ceil((i-s)/a)),o}getVisibleItemSize(e,t,r){var i;return(i=t.get(e))!==null&&i!==void 0?i:r()}getVisibleRowHeight(e,t){var r=this.getModelRow(e,t),i=this.calculateRowHeight(e,r,t);return this.getVisibleItemSize(r,this.userRowHeights,()=>{var a=this.initialRowHeights.get(r);return a!==void 0?a:i})}getVisibleColumnWidth(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.getFirstColumn(t),i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:this.calculateTreePaddingX(t),a=this.getModelColumn(e,t),o=this.calculateColumnWidth(e,a,t,r,i);return this.getVisibleItemSize(a,this.userColumnWidths,()=>{var s=this.initialColumnWidths.get(a);return s!==void 0?s:o})}getModelRows(e,t){for(var r=new Map,i=0;i<e.length;i+=1){var a=e[i],o=this.getModelRow(a,t);r.set(a,o)}return r}getModelRow(e,t){if(this.modelRows.has(e))return U(this.modelRows,e);var{movedRows:r}=t,i=he.getModelIndex(e,r);return this.modelRows.set(e,i),i}getModelColumns(e,t){for(var r=new Map,i=0;i<e.length;i+=1){var a=e[i],o=this.getModelColumn(a,t);r.set(a,o)}return r}getModelColumn(e,t){var r=this.modelColumns.has(e);if(r)return U(this.modelColumns,e);var{movedColumns:i}=t,a=he.getModelIndex(e,i);return this.modelColumns.set(e,a),a}calculateRowHeight(e,t,r){var{theme:i}=r,{autoSizeRows:a,rowHeight:o}=i;if(!a)return o;var s=this.calculatedRowHeights.get(t);return s??(this.calculatedRowHeights.set(t,Math.ceil(o)),Ul(this.calculatedRowHeights),o)}calculateColumnWidth(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:this.getFirstColumn(r),a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.calculateTreePaddingX(r),{theme:o}=r,{autoSizeColumns:s,minColumnWidth:l,maxColumnWidth:d}=o;if(!s){var{columnWidth:h}=o;return h}var c=this.calculateColumnHeaderWidth(t,r),v=this.calculateColumnDataWidth(t,r),m=this.calculatedColumnWidths.get(t),f=Math.ceil(Math.max(c,v));return f=Math.max(l,f),f=Math.min(d,f),m!=null&&m>f?f=m:(this.calculatedColumnWidths.set(t,f),Ul(this.calculatedColumnWidths)),e===i&&(f+=a),f}calculateColumnHeaderWidth(e,t){var{model:r,theme:i}=t,{headerFont:a,headerHorizontalPadding:o}=i,s=r.textForColumnHeader(e,0);if(s!==void 0&&s!==""){var l=this.getWidthForFont(a,t);return s.length*l+o*2}return o*2}calculateColumnDataWidth(e,t){var{top:r,height:i,width:a,model:o,theme:s}=t,{floatingTopRowCount:l,floatingBottomRowCount:d,rowCount:h}=o,{font:c,cellHorizontalPadding:v,rowHeight:m,rowHeaderWidth:f,rowFooterWidth:g,scrollBarSize:b,dataBarHorizontalPadding:C}=s,S=0,w=this.getWidthForFont(c,t),E=i/m,y=Math.ceil(r+E);return he.iterateAllItems(r,y,l,d,h,T=>{var O=this.getModelRow(T,t),R=o.textForCell(e,O),P=o.renderTypeForCell(e,O),M=0;if(R){var F=v*2;M=R.length*w+F}P==="dataBar"&&(M+=C),S=Math.max(S,M)}),S=Math.max(Math.min(S,(a-f-b-g)*Ha.MAX_COLUMN_WIDTH),v*2),S}calculateTreePaddingX(e){var{top:t,height:r,model:i,theme:a}=e,{rowHeight:o,treeDepthIndent:s}=a;if(!Ke(i)||!i.hasExpandableRows)return 0;for(var l=0,d=r/o,h=Math.ceil(t+d),c=t;c<=h;c+=1){var v=this.getModelRow(c,e),m=i.depthForRow(v);l=Math.max(l,s*(m+1))}return l}getWidthForFont(e,t){if(this.fontWidths.has(e))return U(this.fontWidths,e);var{context:r}=t;r.font=e;var i=r.measureText("8"),{width:a}=i;return this.fontWidths.set(e,a),this.fontWidths.set(r.font,a),a}setColumnWidth(e,t){var r=new Map(this.userColumnWidths);r.set(e,Math.ceil(t)),Ul(r),this.userColumnWidths=r}resetColumnWidth(e){var t=new Map(this.userColumnWidths);t.delete(e),this.userColumnWidths=t}setRowHeight(e,t){var r=new Map(this.userRowHeights);r.set(e,Math.ceil(t)),Ul(r),this.userRowHeights=r}resetRowHeight(e){var t=new Map(this.userRowHeights);t.delete(e),this.userRowHeights=t,this.calculatedRowHeights.delete(e)}}yr(Ha,"CACHE_SIZE",1e4);yr(Ha,"MAX_COLUMN_WIDTH",.8);var HL=Object.freeze({allowColumnResize:!0,allowRowResize:!0,autoSelectRow:!1,autoSelectColumn:!1,autoSizeColumns:!0,autoSizeRows:!0,backgroundColor:"#000000",black:"#000000",white:"#ffffff",cellHorizontalPadding:5,headerHorizontalPadding:5,font:"12px Arial, sans-serif",gridColumnColor:"#8f8f8f66",gridRowColor:"#8f8f8f66",headerBackgroundColor:"#222222",headerSeparatorColor:"#000000",headerSeparatorHoverColor:"#888888",headerSeparatorHandleSize:5,headerHiddenSeparatorSize:5,headerHiddenSeparatorHoverColor:"#8888FF",headerColor:"#d5d5d5",headerFont:"10px Arial, sans-serif",columnHoverBackgroundColor:"#444444",selectedColumnHoverBackgroundColor:"#494949",rowBackgroundColors:"#333333 #222222",rowHoverBackgroundColor:"#444444",selectedRowHoverBackgroundColor:"#494949",minScrollHandleSize:50,scrollBarBackgroundColor:"#111111",scrollBarHoverBackgroundColor:"#333333",scrollBarCasingColor:"#000000",scrollBarCornerColor:"#000000",scrollBarColor:"#555555",scrollBarHoverColor:"#888888",scrollBarActiveColor:"#AAAAAA",scrollBarSize:12,scrollBarHoverSize:16,scrollBarCasingWidth:1,scrollSnapToColumn:!1,scrollSnapToRow:!1,selectionColor:"#4286f433",selectionOutlineColor:"#4286f4",selectionOutlineCasingColor:"#222222",scrollBarSelectionTick:!0,scrollBarSelectionTickColor:"#4286f433",scrollBarActiveSelectionTickColor:"#4286f480",shadowBlur:8,shadowAlpha:.15,shadowColor:"#000000",textColor:"#ffffff",hyperlinkColor:"#4878ea",maxDepth:6,treeDepthIndent:10,treeHorizontalPadding:5,treeLineColor:"#888888",treeMarkerColor:"#cccccc",treeMarkerHoverColor:"#ffffff",rowHeight:20,columnWidth:100,minRowHeight:20,minColumnWidth:55,maxColumnWidth:600,columnHeaderHeight:20,rowHeaderWidth:30,rowFooterWidth:0,headerResizeSnapThreshold:10,headerResizeHiddenSnapThreshold:8,allowColumnReorder:!0,allowRowReorder:!0,reorderOffset:2,floatingGridColumnColor:"#8f8f8f66",floatingGridRowColor:"#8f8f8f66",floatingRowBackgroundColors:"#393939 #292929",floatingDividerOuterColor:"#000000",floatingDividerInnerColor:"#cccccc",zeroLineColor:"#888888",positiveBarColor:"#00ff00",negativeBarColor:"#ff0000",markerBarColor:"#ffffff",dataBarHorizontalPadding:90});const F0=HL;function zg(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 qg(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?zg(Object(t),!0).forEach(function(r){UL(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):zg(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function UL(n,e,t){return e=BL(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function BL(n){var e=VL(n,"string");return typeof e=="symbol"?e:String(e)}function VL(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var GL=(n,e)=>{var t=!1,r=Ce(n,qg(qg({},e),{},{dispose:()=>{t||(t=!0,r.clear(),t=!1)}}));return r};const yn=GL;function WL(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:6,r=qh.hex.lab.raw(n),i=r[0]<50?17:10;return r[0]=Math.max(r[0]-i/t*e,0),"#".concat(qh.lab.hex(r))}function KL(n,e){var[t,r,i]=qh.hex.rgb(n);return"rgba(".concat(t,", ").concat(r,", ").concat(i,", ").concat(e,")")}var zL=n=>{var{r:e,g:t,b:r}=n,i=.4122214708*e+.5363325363*t+.0514459929*r,a=.2119034982*e+.6806995451*t+.1073969566*r,o=.0883024619*e+.2817188376*t+.6299787005*r,s=Math.cbrt(i),l=Math.cbrt(a),d=Math.cbrt(o);return{L:.2104542553*s+.793617785*l-.0040720468*d,a:1.9779984951*s-2.428592205*l+.4505937099*d,b:.0259040371*s+.7827717662*l-.808675766*d}},qL=n=>{var{L:e,a:t,b:r}=n,i=e+.3963377774*t+.2158037573*r,a=e-.1055613458*t-.0638541728*r,o=e-.0894841775*t-1.291485548*r,s=i*i*i,l=a*a*a,d=o*o*o;return{r:ke(4.0767416621*s-3.3077115913*l+.2309699292*d,0,255),g:ke(-1.2684380046*s+2.6097574011*l-.3413193965*d,0,255),b:ke(-.0041960863*s-.7034186147*l+1.707614701*d,0,255)}},YL=n=>{var e,t,r=(e=(t=n.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(i,a,o,s)=>"#".concat(a).concat(a).concat(o).concat(o).concat(s).concat(s)).substring(1).match(/.{2}/g))===null||t===void 0?void 0:t.map(i=>parseInt(i,16)))!==null&&e!==void 0?e:[0,0,0];return{r:r[0],g:r[1],b:r[2]}},XL=n=>{var e=Math.round(n.r),t=Math.round(n.g),r=Math.round(n.b);return"#".concat([e,t,r].map(i=>{var a=i.toString(16);return a.length===1?"0".concat(a):a}).join(""))},QL=(n,e,t)=>{var{L:r,a:i,b:a}=n,{L:o,a:s,b:l}=e,d=r+(o-r)*t,h=i+(s-i)*t,c=a+(l-a)*t;return{L:d,a:h,b:c}};const ya={colorWithAlpha:KL,darkenForDepth:WL,linearSRGBToOklab:zL,OklabToLinearSRGB:qL,hexToRgb:YL,rgbToHex:XL,lerpColor:QL};function Yg(n,e,t){return e=ZL(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ZL(n){var e=JL(n,"string");return typeof e=="symbol"?e:String(e)}function JL(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class bt{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:5e3;Yg(this,"order",void 0),Yg(this,"cursor",null),this.order=e}onDown(e,t,r){return!1}onMove(e,t,r){return!1}onDrag(e,t,r){return!1}onLeave(e,t,r){return!1}onClick(e,t,r){return!1}onContextMenu(e,t,r){return!1}onDoubleClick(e,t,r){return!1}onUp(e,t,r){return!1}onWheel(e,t,r){return!1}}function os(n,e,t){return e=e1(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function e1(n){var e=t1(n,"string");return typeof e=="symbol"?e:String(e)}function t1(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class r1 extends bt{constructor(){super(...arguments),os(this,"draggingIndex",void 0),os(this,"resizingItems",[]),os(this,"hiddenItems",[]),os(this,"targetSizes",new Map),os(this,"dragOffset",0)}onDown(e,t){var{metrics:r}=t,{model:i}=t.props,a=t.getTheme();if(!r)throw new Error("metrics not set");var o=this.getSeparator(e,r,i,a);if(o!=null){var s=o.index;return this.dragOffset=0,this.draggingIndex=s,this.resizingItems=[s],this.hiddenItems=this.getHiddenItems(s,r).reverse(),this.targetSizes.clear(),this.addTargetSize(r,s),this.updateCursor(r,s),this.updateSeparator(t,o),!0}return!1}onMove(e,t){var{metrics:r}=t,{model:i}=t.props,a=t.getTheme();if(!r)throw new Error("metrics not set");var o=this.getSeparator(e,r,i,a);return o!=null?(this.updateCursor(r,o.index),!0):!1}onDrag(e,t){if(this.draggingIndex==null)return!1;var r=e[this.pointProperty],{metricCalculator:i,metrics:a}=t;if(!a)throw new Error("metrics not set");for(var o=t.getTheme(),s=a[this.visibleOffsetProperty],l=a[this.marginProperty],d=a[this.calculatedSizesProperty],h=a[this.modelIndexesProperty],c=a[this.firstIndexProperty],v=a[this.treePaddingProperty],m=new Map,f=this.resizingItems[this.resizingItems.length-1];f!=null;){var g=U(s,f),b=r-l-g-this.dragOffset,C=U(h,f),S=this.targetSizes.get(C),w=this.resizingItems.length>1,E=this.hiddenItems.indexOf(f),y=U(d,C);f===c&&(y+=v);var T=b;if(Math.abs(b-y)<=o.headerResizeSnapThreshold?T=y:S!==void 0&&b>S&&(w&&E!==0||E>0)?T=S:b<=o.headerResizeHiddenSnapThreshold&&(T=0),m.set(C,T),b<-o.headerResizeSnapThreshold&&T===0)if(E>=0&&w){var O;this.resizingItems.pop(),this.removeTargetSize(a,f),f=this.resizingItems[this.resizingItems.length-1],this.dragOffset-=(O=this.targetSizes.get(U(h,f)))!==null&&O!==void 0?O:0}else f=this.getNextShownItem(f,a),f!==null&&(this.resizingItems.push(f),this.addTargetSize(a,f));else S!==void 0&&b>S+o.headerResizeSnapThreshold&&T===S?E>0?(this.dragOffset+=T,f=this.hiddenItems[E-1],this.resizingItems.push(f),this.addTargetSize(a,f)):w?(this.resizingItems.pop(),this.removeTargetSize(a,f),f=this.resizingItems[this.resizingItems.length-1]):f=null:f=null}return m.forEach((R,P)=>{var M,F=(M=i[this.initialSizesProperty].get(P))!==null&&M!==void 0?M:d.get(P);R===F?this.resetSize(i,P):this.setSize(i,P,R)}),this.updateCursor(a,this.draggingIndex),!0}onUp(e,t){return this.draggingIndex!=null&&(this.draggingIndex=void 0,this.resizingItems=[],this.hiddenItems=[],this.targetSizes.clear(),this.updateSeparator(t,null)),!1}onDoubleClick(e,t){var{metrics:r,metricCalculator:i}=t,{model:a}=t.props,o=t.getTheme();if(!r)throw new Error("metrics not set");var s=this.getSeparator(e,r,a,o);if(s!=null){var l=r[this.modelIndexesProperty],d=U(l,s.index),h=U(r[this.calculatedSizesProperty],d),c=i[this.initialSizesProperty].get(d);return h===c?this.resetSize(i,d):this.setSize(i,d,h),t.forceUpdate(),!0}return!1}updateCursor(e,t){var r=e[this.visibleSizesProperty],i=U(r,t);i===0?this.cursor=this.hiddenCursor:this.cursor=this.defaultCursor}addTargetSize(e,t){var r=e[this.modelIndexesProperty],i=e[this.userSizesProperty],a=e[this.calculatedSizesProperty],o=t===0?e[this.treePaddingProperty]:0,s=U(r,t),l=i.get(s);(l==null||l===0)&&(l=U(a,s)+o),this.targetSizes.set(s,l)}removeTargetSize(e,t){var r=e[this.modelIndexesProperty],i=U(r,t);this.targetSizes.delete(i)}}const A0=r1;function Vt(n,e,t){return e=n1(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function n1(n){var e=i1(n,"string");return typeof e=="symbol"?e:String(e)}function i1(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Jv extends A0{constructor(){super(...arguments),Vt(this,"hiddenCursor","e-resize"),Vt(this,"defaultCursor","col-resize"),Vt(this,"pointProperty","x"),Vt(this,"userSizesProperty","userColumnWidths"),Vt(this,"visibleOffsetProperty","visibleColumnXs"),Vt(this,"visibleSizesProperty","visibleColumnWidths"),Vt(this,"marginProperty","rowHeaderWidth"),Vt(this,"calculatedSizesProperty","calculatedColumnWidths"),Vt(this,"initialSizesProperty","initialColumnWidths"),Vt(this,"modelIndexesProperty","modelColumns"),Vt(this,"firstIndexProperty","firstColumn"),Vt(this,"treePaddingProperty","treePaddingX"),Vt(this,"getHiddenItems",he.getHiddenColumns),Vt(this,"getNextShownItem",he.getNextShownColumn),Vt(this,"getSeparator",Jv.getColumnSeparator)}static getColumnSeparator(e,t,r,i){if(!i.allowColumnResize)return null;var{x:a,y:o,columnHeaderDepth:s}=e,{modelColumns:l}=t,d=he.getColumnSeparatorIndex(a,o,t,i);if(d==null||s==null||s>0)return null;var h=l.get(d);return h!=null?{index:d,depth:0}:null}setSize(e,t,r){e.setColumnWidth(t,r)}resetSize(e,t){e.resetColumnWidth(t)}updateSeparator(e,t){e.setState({draggingColumnSeparator:t,isDragging:t!==null})}}const L0=Jv;var Fa=10;function a1(n,e,t){return e=o1(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function o1(n){var e=s1(n,"string");return typeof e=="symbol"?e:String(e)}function s1(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class l1{constructor(){a1(this,"getCachedTruncatedString",yn((e,t,r,i,a)=>Sn.truncateToWidth(e,t,r,i,a),{max:1e4}))}drawCellRowTreeMarker(e,t,r){var{metrics:i,model:a,mouseX:o,mouseY:s,theme:l}=t,{firstColumn:d,gridX:h,gridY:c,allColumnXs:v,allColumnWidths:m,allRowYs:f,allRowHeights:g,visibleRowTreeBoxes:b}=i,{treeMarkerColor:C,treeMarkerHoverColor:S}=l,w=U(v,d),E=U(m,d),y=U(f,r),T=U(g,r);if(!(!Ke(a)||!a.isRowExpandable(r))){var O=U(b,r),R=o!=null&&s!=null&&o>=h+w&&o<=h+w+E&&s>=c+y&&s<=c+y+T?S:C;this.drawTreeMarker(e,t,w,y,O,R,a.isRowExpanded(r))}}drawTreeMarker(e,t,r,i,a,o,s){var{x1:l,y1:d,x2:h,y2:c}=a,v=s?"⊟":"⊞",m=r+(l+h)*.5+.5,f=i+(d+c)*.5+.5;e.fillStyle=o,e.textAlign="center",e.fillText(v,m,f)}}const k0=l1;function Xg(n){return(n==null?void 0:n.dataBarOptionsForCell)!==void 0}function Qg(n,e,t){return e=d1(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function d1(n){var e=u1(n,"string");return typeof e=="symbol"?e:String(e)}function u1(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class h1 extends k0{constructor(){super(...arguments),Qg(this,"heightOfDigits",void 0),Qg(this,"getCachedWidestValueForColumn",yn((e,t,r,i,a)=>{for(var o=0,s=0;s<t.length;s+=1){var l=t[s],d=U(r,l),h=i.textForCell(a,d);o=Math.max(o,e.measureText(h).width)}return o},{max:1e3}))}drawCellContent(e,t,r,i){var a,{metrics:o,model:s,theme:l}=t;if(Xg(s)){var{modelColumns:d,modelRows:h,allRowHeights:c,allRowYs:v,firstColumn:m,fontWidths:f}=o,g=r===m,b=U(c,i),C=U(h,i),S=U(d,r),w=U(v,i),E=s.textAlignForCell(S,C),y=s.textForCell(S,C),{x:T,width:O}=he.getTextRenderMetrics(t,r,i),R=(a=f==null?void 0:f.get(e.font))!==null&&a!==void 0?a:Fa,P=s.truncationCharForCell(S,C),M=this.getCachedTruncatedString(e,y,O,R,P),{columnMin:F,columnMax:N,axis:D,color:_,valuePlacement:x,opacity:L,markers:H,direction:G,value:X}=s.dataBarOptionsForCell(S,C,l),W=Array.isArray(_);if(!(F==null||N==null)){var{maxWidth:A,x:I,y:k,zeroPosition:j,leftmostPosition:Y,markerXs:ee,totalValueRange:K,dataBarWidth:ie}=this.getDataBarRenderMetrics(e,t,r,i);if(this.heightOfDigits===void 0){var{actualBoundingBoxAscent:ne,actualBoundingBoxDescent:se}=e.measureText("1234567890");this.heightOfDigits=ne+se}if(e.save(),e.textAlign=E,W){var pe=X>=0?_[_.length-1]:_[0];e.fillStyle=pe}else e.fillStyle=_;if(e.textBaseline="top",e.font=l.font,x!=="hide"&&e.fillText(M,T,w+(b-this.heightOfDigits)/2),W){var Fe=_.map(br=>ya.linearSRGBToOklab(ya.hexToRgb(br)));if(e.save(),e.beginPath(),e.roundRect(I,k,ie,b-2,1),e.clip(),X<0){if(G==="LTR")for(var tt=Math.round(Math.abs(F)/K*A),rt=tt/(_.length-1),Ye=Math.round(Y),vt=0;vt<_.length-1;vt+=1){var St=Fe[vt],$e=Fe[vt+1];this.drawGradient(e,St,$e,Ye,w+1,rt,b),Ye+=rt}else if(G==="RTL")for(var wt=Math.round(A-Math.abs(N)/K*A),Rt=wt/(_.length-1),Lr=Math.round(j),fr=_.length-1;fr>0;fr-=1){var Wn=Fe[fr],on=Fe[fr-1];this.drawGradient(e,Wn,on,Lr,w+1,Rt,b),Lr+=Rt}}else if(G==="LTR")for(var gr=Math.round(A-Math.abs(F)/K*A)-1,nt=gr/(_.length-1),Bt=Math.round(j),kr=0;kr<_.length-1;kr+=1){var pr=Fe[kr],jr=Fe[kr+1];this.drawGradient(e,pr,jr,Bt,w+1,nt,b-2),Bt+=nt}else if(G==="RTL")for(var wi=Math.round(Math.abs(N)/K*A),$r=wi/(_.length-1),Hr=Math.round(Y),nr=_.length-1;nr>0;nr-=1){var Kn=Fe[nr],zn=Fe[nr-1];this.drawGradient(e,Kn,zn,Hr,w+1,$r,b-2),Hr+=$r}e.restore()}else e.save(),e.globalAlpha=L,e.beginPath(),e.roundRect(I,k,ie,b-2,1),e.fill(),e.restore();A>0&&ee.forEach((br,sn)=>{e.fillStyle=H[sn].color,e.fillRect(br,k,1,b-2)});var qn=!(D==="directional"&&(x==="beside"&&E==="right"&&G==="LTR"||x==="beside"&&E==="left"&&G==="RTL"||x!=="beside"));qn&&(e.strokeStyle=l.zeroLineColor,e.beginPath(),e.setLineDash([2,1]),e.moveTo(j,w),e.lineTo(j,w+b),e.stroke()),e.restore(),g&&Ke(s)&&s.hasExpandableRows&&this.drawCellRowTreeMarker(e,t,i)}}}getDataBarRenderMetrics(e,t,r,i){var{metrics:a,model:o,theme:s}=t;if(!Xg(o))throw new Error("Grid model is not a data bar grid model");var{firstColumn:l,allColumnXs:d,allColumnWidths:h,allRowYs:c,modelColumns:v,modelRows:m,visibleRows:f}=a,{cellHorizontalPadding:g,treeDepthIndent:b,treeHorizontalPadding:C}=s,S=U(v,r),w=U(m,i),E=U(d,r),y=U(c,i),T=U(h,r),O=r===l,R=0;Ke(o)&&o.hasExpandableRows&&O&&(R=b*(o.depthForRow(i)+1)+C);var P=o.textAlignForCell(S,w),{columnMin:M,columnMax:F,axis:N,valuePlacement:D,markers:_,direction:x,value:L}=o.dataBarOptionsForCell(S,w,s),H=this.getCachedWidestValueForColumn(e,f,m,o,S),G=2,X=D==="beside"&&P==="right"?2:1,W=F-M;F>=0&&M>=0||M===F?W=F:F<=0&&M<=0&&(W=Math.abs(M));var A=T-R-X-G;D==="beside"&&(A=A-g-H),A<0&&(A=0);var I=Math.max(Math.abs(M),Math.abs(F)),k=Math.abs(L)/W*A;A===0?k=0:N==="middle"?k=Math.abs(L)/I*(A/2):N==="directional"&&(k=Math.abs(L)/I*A);var j=M>=0?0:Math.abs(M)/W*A,Y=L>=0?j:j-Math.abs(L)/W*A,ee=_.map(ne=>{var{value:se}=ne,pe=Math.abs(se)/W*A;return se>=0?j+pe:j-pe}),K=D==="beside"&&P==="left"?g+H+G:G,ie=D==="beside"&&P==="right"?T-g-H-X:X;return x==="RTL"&&(j=M>=0?T:T-Math.abs(M)/W*A,Y=L>=0?j-L/W*A:j,ee=_.map(ne=>{var{value:se}=ne;return se>=0?j-Math.abs(se)/W*A:j+Math.abs(se)/W*A})),N==="middle"?(j=A/2,x==="LTR"?(Y=L>=0?j:j-Math.abs(L)/I*(A/2),ee=_.map(ne=>{var{value:se}=ne;return se>=0?j+Math.abs(se)/I*(A/2):j-Math.abs(se)/I*(A/2)})):x==="RTL"&&(Y=L<=0?j:j-Math.abs(L)/I*(A/2),ee=_.map(ne=>{var{value:se}=ne;return se<=0?j+Math.abs(se)/I*(A/2):j-Math.abs(se)/I*(A/2)}))):N==="directional"&&(x==="LTR"?(j=0,Y=j,ee=_.map(ne=>{var{value:se}=ne;return j+Math.abs(se)/I*A})):x==="RTL"&&(j=T,Y=j-Math.abs(L)/I*A,ee=_.map(ne=>{var{value:se}=ne;return j-Math.abs(se)/I*A}))),x==="LTR"?(j+=E+G+R,Y+=E+G+R,ee=ee.map(ne=>ne+E+G+R),D==="beside"&&P==="left"&&(j+=H+g,Y+=H+g,ee=ee.map(ne=>ne+H+g))):x==="RTL"&&(j=j+E-X,Y=Y+E-X,ee=ee.map(ne=>ne+E-X),D==="beside"&&P==="right"&&(j=j-g-H,Y=Y-g-H,ee=ee.map(ne=>ne-g-H))),K+=E+R,ie+=E,{maxWidth:A,x:Y,y:y+1.5,zeroPosition:j,leftmostPosition:K,rightmostPosition:ie,totalValueRange:W,dataBarWidth:k,markerXs:ee}}drawGradient(e,t,r,i,a,o,s){for(var l=t,d=i;d<=i+o;d+=.5)this.drawGradientPart(e,d,a,1,s,ya.rgbToHex(ya.OklabToLinearSRGB(l))),l=ya.lerpColor(t,r,(d-i)/o)}drawGradientPart(e,t,r,i,a,o){e.fillStyle=o,e.fillRect(t,r,i,a)}}const j0=h1;function c1(n,e,t){return e=v1(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function v1(n){var e=m1(n,"string");return typeof e=="symbol"?e:String(e)}function m1(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class f1 extends k0{constructor(){super(...arguments),c1(this,"getCachedTokenBoxesForVisibleCell",yn((e,t,r,i,a,o)=>{for(var s=0,l=a,d=[],h=0,c=0,v=0;v<t.length;v+=1){var m=t[v],{start:f,end:g}=m,b=g>e.length?e.substring(f):m.value;c+=o.measureText(e.substring(h,f)).width;var C=o.measureText(b).width,S=c,w=S+C,E={x1:S,y1:s,x2:w,y2:l,token:m};d.push(E),h=g,c+=C}return d},{max:1e4}))}drawCellContent(e,t,r,i){var{metrics:a,model:o,theme:s}=t,{fontWidths:l,modelColumns:d,modelRows:h,allRowHeights:c,firstColumn:v}=a,m=r===v,{textColor:f}=s,g=U(c,i),b=U(h,i),C=U(d,r),S=o.textForCell(C,b),w=o.truncationCharForCell(C,b);if(S&&g>0){var E,y=o.textAlignForCell(C,b)||"left";e.textAlign=y;var T=o.colorForCell(C,b,s)||f;e.fillStyle=T,e.save();var{width:O,x:R,y:P}=he.getTextRenderMetrics(t,r,i),M=(E=l.get(e.font))!==null&&E!==void 0?E:Fa,F=this.getCachedTruncatedString(e,S,O,M,w),N=o.tokensForCell(C,b,F.length);if(F)for(var D=0,_=0,x=R,{actualBoundingBoxDescent:L}=e.measureText(F);_<F.length;){var H,G,X=N[D],W=_===(X==null?void 0:X.start)?X:null,A=(H=(G=W==null?void 0:W.end)!==null&&G!==void 0?G:X==null?void 0:X.start)!==null&&H!==void 0?H:F.length,I=F.substring(_,A),{width:k}=e.measureText(I),j=I.endsWith("…")?e.measureText(I.substring(0,I.length-1)).width:k;W!=null?(e.fillStyle=s.hyperlinkColor,e.fillText(I,x,P),e.fillRect(x,P+L,j,1)):(e.fillStyle=T,e.fillText(I,x,P)),x+=k,_=A,W!=null&&(D+=1)}e.restore()}m&&Ke(o)&&o.hasExpandableRows&&this.drawCellRowTreeMarker(e,t,i)}getTokenBoxesForVisibleCell(e,t,r){var i,{metrics:a,context:o,model:s,theme:l}=r;if(o==null||a==null)return ye;var{modelRows:d,modelColumns:h}=a,c=U(d,t),v=U(h,e),m=s.textForCell(v,c),{width:f,x:g,y:b}=he.getTextRenderMetrics(r,e,t),{fontWidths:C}=a;o.save(),this.configureContext(o,r);var S=(i=C==null?void 0:C.get(o.font))!==null&&i!==void 0?i:Fa,w=s.truncationCharForCell(v,c),E=this.getCachedTruncatedString(o,m,f,S,w),{actualBoundingBoxAscent:y,actualBoundingBoxDescent:T}=o.measureText(E),O=y+T,R=s.tokensForCell(v,c,E.length);if(R.length===0)return o.restore(),ye;var P=this.getCachedTokenBoxesForVisibleCell(E,R,l.font,"middle",O,o).map(M=>({x1:M.x1+g,y1:M.y1+(b-y),x2:M.x2+g,y2:M.y2+(b-y),token:M.token}));return o.restore(),P}configureContext(e,t){var{theme:r}=t;e.font=r.font,e.textBaseline="middle",e.lineCap="butt"}}const $0=f1;function Ea(n,e,t){return e=g1(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function g1(n){var e=p1(n,"string");return typeof e=="symbol"?e:String(e)}function p1(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Sn{constructor(){Ea(this,"textCellRenderer",new $0),Ea(this,"dataBarCellRenderer",new j0),Ea(this,"getCachedBackgroundColors",yn((e,t)=>e.split(" ").map(r=>{for(var i=[],a=0;a<t;a+=1)i.push(ya.darkenForDepth(r,a,t));return i}),{max:1e3})),Ea(this,"getCachedColorWithAlpha",yn((e,t)=>ya.colorWithAlpha(e,t),{max:1e3})),Ea(this,"getCachedColorIsDark",yn(e=>Xc.isDark(e),{max:1e3}))}static truncate(e,t){return t<e.length?e.substr(0,t)+"…":e}static binaryTruncateToWidth(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:t.length,o=arguments.length>5?arguments[5]:void 0;if(a>=t.length&&e.measureText(t).width<=r)return t;if(o!==void 0){var s=e.measureText(o).width;return o.repeat(Math.max(1,Math.floor(r/s)))}for(var l=i,d=Math.min(t.length-1,a),h=t;d>=l;){var c=Math.ceil((d+l)/2),v=Sn.truncate(t,c);if(e.measureText(v).width<=r){if(h=v,l===c)break;l=c}else if(c===0){h=v;break}else d=c-1}return h}static truncateToWidth(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Fa,a=arguments.length>4?arguments[4]:void 0;if(r<=0||t.length<=0)return"";var o=Math.min(Math.max(0,Math.floor(r/i/2)-5),t.length),s=Math.min(Math.ceil(r/i*2),t.length);return Sn.binaryTruncateToWidth(e,t,r,o,s,a)}drawCanvas(e){var{context:t}=e;t.save(),this.configureContext(t,e),this.drawBackground(t,e),this.drawGrid(t,e),this.drawHeaders(t,e),this.drawFooters(t,e),this.drawDraggingColumn(t,e),this.drawDraggingRow(t,e),this.drawScrollBars(t,e),t.restore()}configureContext(e,t){var{theme:r}=t;e.font=r.font,e.textBaseline="middle",e.lineCap="butt"}drawBackground(e,t){var{theme:r,metrics:i}=t,{width:a,height:o}=i;e.fillStyle=r.backgroundColor,e.fillRect(0,0,a,o)}drawGrid(e,t){var{metrics:r,draggingRow:i,draggingColumn:a}=t,{gridX:o,gridY:s}=r;e.translate(o,s),this.drawGridBackground(e,t,i==null&&a==null),this.drawCellContents(e,t),this.drawFloatingRows(e,t),this.drawFloatingColumns(e,t),e.translate(-o,-s)}drawFloatingRows(e,t){var{draggingRow:r,draggingColumn:i,metrics:a,theme:o}=t,{floatingTopRowCount:s,floatingBottomRowCount:l,floatingRows:d,rowCount:h,visibleColumns:c,allRowYs:v,allRowHeights:m}=a;if(d.length!==0){o.floatingRowBackgroundColors&&this.drawRowStripesForRows(e,t,d,o.floatingRowBackgroundColors),r==null&&i==null&&this.drawFloatingMouseRowHover(e,t),this.drawGridLinesForItems(e,t,c,d,o.floatingGridColumnColor,o.floatingGridRowColor),this.drawCellBackgroundsForItems(e,t,c,d),this.drawFloatingBorders(e,t),s>0&&this.drawSelectedRanges(e,t,{top:0,bottom:s-1,maxY:U(v,s-1)+U(m,s-1)-.5}),l>0&&this.drawSelectedRanges(e,t,{top:h-l-1,bottom:h-1,minY:U(v,h-l)+.5,maxY:U(v,h-1)+U(m,h-1)-.5});for(var f=0;f<c.length;f+=1)for(var g=c[f],b=0;b<d.length;b+=1){var C=d[b];this.drawCellContent(e,t,g,C)}}}drawFloatingColumns(e,t){var{draggingRow:r,draggingColumn:i,metrics:a,theme:o}=t,{floatingLeftColumnCount:s,floatingRightColumnCount:l,floatingLeftWidth:d,floatingRightWidth:h,floatingColumns:c,gridX:v,maxX:m,columnCount:f,visibleRows:g,allColumnXs:b,allColumnWidths:C,width:S,height:w}=a;if(c.length!==0){o.floatingRowBackgroundColors&&(this.drawRowStripesForRows(e,t,g,o.floatingRowBackgroundColors,0,d),this.drawRowStripesForRows(e,t,g,o.floatingRowBackgroundColors,S-v-h,m)),r==null&&i==null&&this.drawFloatingMouseRowHover(e,t),e.save(),e.beginPath(),e.rect(0,0,d,w),e.clip(),this.drawGridLinesForItems(e,t,c,g,o.floatingGridColumnColor,o.floatingGridRowColor),e.restore(),this.drawCellBackgroundsForItems(e,t,c,g),this.drawFloatingBorders(e,t),s>0&&this.drawSelectedRanges(e,t,{left:0,maxX:U(b,s-1)+U(C,s-1)}),l>0&&this.drawSelectedRanges(e,t,{left:f-l,right:f-1,minX:U(b,f-l)+.5,maxX:U(b,f-1)+U(C,f-1)});for(var E=0;E<c.length;E+=1)for(var y=c[E],T=0;T<g.length;T+=1){var O=g[T];this.drawCellContent(e,t,y,O)}}}drawFloatingBorders(e,t){var{metrics:r,theme:i}=t,{floatingTopRowCount:a,floatingBottomRowCount:o,floatingLeftColumnCount:s,floatingRightColumnCount:l,rowCount:d,columnCount:h,allRowYs:c,allColumnXs:v,allRowHeights:m,allColumnWidths:f,maxX:g,maxY:b}=r,{floatingDividerOuterColor:C,floatingDividerInnerColor:S}=i;if(e.lineWidth=3,e.beginPath(),e.strokeStyle=C,a>0){var w=U(c,a-1)+U(m,a-1)+.5;e.moveTo(0,w),e.lineTo(g,w)}if(o>0){var E=U(c,d-o)-.5;e.moveTo(0,E),e.lineTo(g,E)}if(s>0){var y=U(v,s-1)+U(f,s-1)+.5;e.moveTo(y,0),e.lineTo(y,b)}if(l>0){var T=U(v,h-l)-.5;e.moveTo(T,0),e.lineTo(T,b)}if(e.stroke(),e.beginPath(),e.lineWidth=1,e.strokeStyle=S,a>0){var O=U(c,a-1)+U(m,a-1)+.5;e.moveTo(0,O),e.lineTo(g,O)}if(o>0){var R=U(c,d-o)-.5;e.moveTo(0,R),e.lineTo(g,R)}if(s>0){var P=U(v,s-1)+U(f,s-1)+.5;e.moveTo(P,0),e.lineTo(P,b)}if(l>0){var M=U(v,h-l)-.5;e.moveTo(M,0),e.lineTo(M,b)}e.stroke()}drawGridBackground(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.drawRowStripes(e,t),r&&(this.drawMouseColumnHover(e,t),this.drawMouseRowHover(e,t)),this.drawGridLines(e,t),this.drawCellBackgrounds(e,t);var{metrics:i}=t,{bottom:a,right:o,floatingBottomRowCount:s,floatingLeftColumnCount:l,floatingRightColumnCount:d,floatingTopRowCount:h,columnCount:c,rowCount:v,allRowHeights:m,allRowYs:f,allColumnXs:g,allColumnWidths:b,width:C,height:S}=i;this.drawSelectedRanges(e,t,{bottom:Math.min(a,v-s-1),right:Math.min(o,c-d-1),minX:l>0&&g.has(l+1)?U(g,l+1):-10,minY:h>0&&f.has(h+1)?U(f,h+1):-10,maxX:d>0&&g.has(c-d-1)?U(g,c-d-1)+U(b,c-d-1)-.5:C+10,maxY:s>0&&f.has(v-s-1)?U(f,v-s-1)+U(m,v-s-1)-.5:S+10})}drawRowStripes(e,t){var{metrics:r,theme:i}=t,{visibleRows:a}=r,{rowBackgroundColors:o}=i;o&&this.drawRowStripesForRows(e,t,a,o)}drawRowStripesForRows(e,t,r,i){for(var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:t.metrics.maxX,{theme:s,metrics:l,model:d}=t,{maxDepth:h,shadowBlur:c,shadowColor:v,shadowAlpha:m}=s,f=this.getCachedBackgroundColors(i,h),{allRowYs:g,allRowHeights:b}=l,C=new Map,S=[],w=[],E=(I,k)=>{var j=Ke(d)?d.depthForRow(I):0,Y=f[I%f.length],ee=Y[Math.min(j,Y.length-1)];if(C.has(ee)||C.set(ee,[]),C.get(ee).push(I),k!=null){var K=Ke(d)?d.depthForRow(k):0;K<j?S.push(I):K>j&&w.push(k)}},y=0;y<r.length;y+=1){var T=r[y],O=y>0?r[y-1]:void 0;E(T,O)}if(C.forEach((I,k)=>{e.fillStyle=k,e.beginPath();for(var j=0;j<I.length;j+=1){var Y=I[j],ee=U(g,Y),K=U(b,Y);e.rect(a,ee,o,K)}e.fill()}),S.length>0){e.save();var R=this.getCachedColorWithAlpha(v,m),P=this.getCachedColorWithAlpha(v,0),M=e.createLinearGradient(0,0,0,c);M.addColorStop(0,R),M.addColorStop(1,P),e.fillStyle=M;for(var F=0;F<S.length;F+=1){var N=S[F],D=U(g,N);e.translate(0,D),e.fillRect(a,0,o,c),e.translate(0,-D)}e.restore()}if(w.length>0){e.save();var _=this.getCachedColorWithAlpha(v,0),x=this.getCachedColorWithAlpha(v,m),L=e.createLinearGradient(0,0,0,c);L.addColorStop(0,_),L.addColorStop(1,x),e.fillStyle=L;for(var H=0;H<w.length;H+=1){var G=w[H],X=U(g,G),W=U(b,G),A=X+W-c;e.translate(0,A),e.fillRect(a,0,o,c),e.translate(0,-A)}e.restore()}}drawMouseColumnHover(e,t){var{mouseX:r,mouseY:i,theme:a,metrics:o}=t;if(!(r==null||i==null)){var s=he.getColumnAtX(r,o);if(!(s==null||a.columnHoverBackgroundColor==null)){var{allColumnWidths:l,allColumnXs:d,maxY:h}=o;if(!(i>h)){var c=U(d,s),v=U(l,s);e.fillStyle=a.columnHoverBackgroundColor,e.fillRect(c,0,v,h)}}}}drawMouseRowHover(e,t){var{mouseX:r,mouseY:i,theme:a,metrics:o}=t;if(!(r==null||i==null)){var{maxX:s}=o;if(!(r>s||a.rowHoverBackgroundColor==null)){var l=he.getRowAtY(i,o);l!=null&&this.drawMouseRowHoverForRow(e,t,l)}}}drawFloatingMouseRowHover(e,t){var{mouseX:r,mouseY:i,theme:a,metrics:o}=t,{maxX:s,floatingTopRowCount:l,floatingBottomRowCount:d,rowCount:h,rowFooterWidth:c}=o;if(!(r==null||i==null||r>s+c||a.rowHoverBackgroundColor==null)){var v=he.getRowAtY(i,o);v!=null&&(v<l||h-d<=v)&&this.drawMouseRowHoverForRow(e,t,v)}}drawMouseRowHoverForRow(e,t,r){var{metrics:i,selectedRanges:a,theme:o}=t,{allRowHeights:s,allRowYs:l,maxX:d}=i,h=U(l,r),c=U(s,r);o.rowHoverBackgroundColor!=null&&(e.fillStyle=o.rowHoverBackgroundColor);for(var v=0;v<a.length;v+=1){var{startRow:m,endRow:f}=a[v];if(m!=null&&f!=null&&m<=r&&f>=r){o.selectedRowHoverBackgroundColor!=null&&(e.fillStyle=o.selectedRowHoverBackgroundColor);break}}e.fillRect(0,h,d,c)}drawGridLines(e,t){var{metrics:r,theme:i}=t,{visibleColumns:a,visibleRows:o}=r;this.drawGridLinesForItems(e,t,a,o,i.gridColumnColor,i.gridRowColor)}drawGridLinesForItems(e,t,r,i,a,o){a==null&&o==null||(e.lineWidth=1,e.beginPath(),a!=null&&(e.strokeStyle=a,this.drawGridLinesForColumns(e,t,r)),o!=null&&(e.strokeStyle=o,this.drawGridLinesForRows(e,t,i)),e.stroke())}drawGridLinesForColumns(e,t,r){for(var{metrics:i}=t,{allColumnXs:a,maxY:o}=i,s=0;s<r.length;s+=1){var l=r[s],d=U(a,l)+.5;e.moveTo(d,0),e.lineTo(d,o)}}drawGridLinesForRows(e,t,r){for(var{metrics:i}=t,{allRowYs:a,maxX:o}=i,s=o,l=0;l<r.length;l+=1){var d=r[l],h=U(a,d)+.5;e.moveTo(.5,h),e.lineTo(s-.5,h)}}drawCellBackgrounds(e,t){var{metrics:r}=t,{visibleColumns:i,visibleRows:a}=r;this.drawCellBackgroundsForItems(e,t,i,a)}drawCellBackgroundsForItems(e,t,r,i){e.save();for(var a=0;a<r.length;a+=1)for(var o=r[a],s=0;s<i.length;s+=1){var l=i[s],d=s+1<i.length?i[s+1]:void 0;this.drawCellBackground(e,t,o,l,d)}e.restore()}drawCellBackground(e,t,r,i,a){var{metrics:o,model:s,theme:l}=t,{firstColumn:d,modelColumns:h,modelRows:c,allColumnXs:v,allColumnWidths:m,allRowYs:f,allRowHeights:g}=o,b=U(c,i),C=U(h,r),S=s.backgroundColorForCell(C,b,l),w=r===d,E=Ke(s)&&s.hasExpandableRows;if(S!=null){var y=U(v,r)+1,T=U(f,i)+1,O=U(m,r)-1,R=U(g,i)-1;e.fillStyle=S,e.fillRect(y,T,O,R)}w&&E&&this.drawCellRowTreeDepthLines(e,t,i,a)}drawCellContents(e,t){for(var{metrics:r}=t,{visibleColumns:i}=r,a=0;a<i.length;a+=1){var o=i[a];this.drawColumnCellContents(e,t,o)}}drawColumnCellContents(e,t,r){var{metrics:i}=t,{allColumnXs:a,allColumnWidths:o,visibleRows:s,height:l}=i,d=U(a,r),h=U(o,r);e.save(),e.beginPath(),e.rect(d,0,h,l),e.clip();for(var c=0;c<s.length;c+=1){var v=s[c];this.drawCellContent(e,t,r,v)}e.restore()}drawCellContent(e,t,r,i){var{metrics:a,model:o}=t,{modelColumns:s,modelRows:l}=a,d=U(l,i),h=U(s,r),c=o.renderTypeForCell(h,d),v=this.getCellRenderer(c);v.drawCellContent(e,t,r,i)}getCellRenderer(e){switch(e){case"dataBar":return this.dataBarCellRenderer;default:return this.textCellRenderer}}drawCellRowTreeDepthLines(e,t,r,i){var{metrics:a,model:o,theme:s}=t;if(Ke(o)){var l=o.depthForRow(r);if(l!==0){var{firstColumn:d,allColumnXs:h,allRowYs:c,allRowHeights:v}=a,{treeDepthIndent:m,treeHorizontalPadding:f,treeLineColor:g}=s,b=U(h,d),C=U(c,r),S=U(v,r),w=i!==void 0?o.depthForRow(i):0,E=l>w?l-w:0;if(e.strokeStyle=g,e.lineWidth=1,l-E>0){e.beginPath();for(var y=0;y<l-E;y+=1){var T=b+y*m+m*.5+f+.5;e.moveTo(T,C),e.lineTo(T,C+S)}e.stroke()}if(E>0){e.beginPath();for(var O=l-E;O<l;O+=1){var R=b+O*m+m*.5+f+.5;e.moveTo(R,C),e.lineTo(R,C+Math.ceil(S/2)),e.moveTo(R-.5,C+Math.ceil(S/2)+.5),e.lineTo(R+m-.5,C+Math.ceil(S/2)+.5)}e.stroke()}}}}drawHeaders(e,t){var{theme:r}=t;e.font=r.headerFont,this.drawColumnHeaders(e,t),this.drawRowHeaders(e,t)}drawFooters(e,t){var{theme:r}=t;e.font=r.headerFont,this.drawRowFooters(e,t)}drawColumnHeaders(e,t){var{mouseX:r,mouseY:i,theme:a,metrics:o,draggingColumnSeparator:s,isDragging:l,model:d}=t,{columnHeaderHeight:h,floatingColumns:c,gridX:v,width:m,visibleColumns:f,allColumnWidths:g,allColumnXs:b,floatingLeftColumnCount:C,floatingLeftWidth:S,floatingRightWidth:w,modelColumns:E,columnHeaderMaxDepth:y}=o;if(!(h<=0)){var{headerHiddenSeparatorSize:T,headerHiddenSeparatorHoverColor:O,headerSeparatorColor:R,headerSeparatorHoverColor:P}=a,M=h*.5,F=h*(y-1)+h*.5-M*.5,N=C>0;if(e.save(),this.drawColumnHeadersForRange(e,t,[f[0],f[f.length-1]],{minX:v+S,maxX:m-w}),N&&this.drawColumnHeadersForRange(e,t,[c[0],c[c.length-1]],{minX:v,maxX:v+S}),R){e.strokeStyle=R;var D=[...g.entries()].filter(tt=>{var[rt,Ye]=tt;return Ye===0}).map(tt=>{var[rt]=tt;return rt});e.beginPath(),e.fillStyle=R;for(var _=0;_<D.length;_+=1){var x=D[_],L=U(b,x),H=U(g,x),G=v+L+H+.5-T*.5;e.rect(G,F,T,M)}e.fill()}if(P){var{index:X,depth:W}=s??{};if(X==null&&r!=null&&i!=null){var A=L0.getColumnSeparator(he.getGridPointFromXY(r,i,o),o,d,a);X=A==null?void 0:A.index,W=A==null?void 0:A.depth}var I;if(X==null)I=!1;else{var k=E.get(X),j=E.get(X+1);k==null||j==null?I=!1:I=d.textForColumnHeader(k,W)!==d.textForColumnHeader(j,W)}if(I&&X!=null&&W!=null&&(!l||s!=null)){e.strokeStyle=P;var Y=U(b,X),ee=U(g,X),K=v+Y+ee+.5,ie=f.indexOf(X),ne=ie<f.length-1?f[ie+1]:null,se=ne!=null?g.get(ne):null,pe=ee===0,Fe=se!=null&&se===0;pe?(e.strokeStyle=O,e.fillStyle=O,e.fillRect(K,F,T*.5,M)):Fe&&(e.fillStyle=P,e.fillRect(K-T*.5,F,T*.5,M)),e.beginPath(),e.moveTo(K,(y-W-1)*h),e.lineTo(K,(y-W)*h-1),e.stroke()}}e.restore()}}drawColumnHeadersForRange(e,t,r,i){var{model:a}=t,{columnHeaderMaxDepth:o}=a;if(o!==0)for(var s=0;s<=o;s+=1)this.drawColumnHeadersAtDepth(e,t,r,i,s)}drawColumnHeadersAtDepth(e,t,r,i,a){var{metrics:o,model:s,theme:l}=t,{modelColumns:d,allColumnXs:h,gridX:c,userColumnWidths:v,allColumnWidths:m,movedColumns:f}=o,{columnHeaderHeight:g,columnWidth:b}=l,{columnHeaderMaxDepth:C}=s,{minX:S,maxX:w}=i,E=w-S;if(C!==0){var y=r[0],T=r[1];if(e.save(),e.translate(0,(C-a-1)*g),a===0){this.drawColumnHeader(e,t,"",S,w);for(var O=y;O<=T;O+=1)this.drawColumnHeaderAtIndex(e,t,O,i)}if(a>0)for(var R=y;R<=T;){var{columnCount:P}=o,M=U(d,R),F=s.textForColumnHeader(M,a),N=s.colorForColumnHeader(M,a),D=U(h,R)+c,_=D+U(m,R);if(F!=null){for(var x=R-1;x>=0&&(_-D<E||D>S);){var L,H,G,X=(L=d.get(x))!==null&&L!==void 0?L:he.getModelIndex(x,f);if(X==null||s.textForColumnHeader(X,a)!==F)break;var W=(H=(G=v.get(X))!==null&&G!==void 0?G:m.get(x))!==null&&H!==void 0?H:b;D-=W,x-=1}for(var A=R+1;A<P&&(_-D<E||_<w);){var I,k,j,Y=(I=d.get(A))!==null&&I!==void 0?I:he.getModelIndex(A,f);if(s.textForColumnHeader(Y,a)!==F)break;var ee=(k=(j=v.get(Y))!==null&&j!==void 0?j:m.get(A))!==null&&k!==void 0?k:b;_+=ee,A+=1}R=A-1;var K=_-D>=E,ie=D;K&&(_<w?ie=_-E:D<S&&(ie=S)),this.drawColumnHeader(e,t,F,ie,Math.min(_-D,E),{backgroundColor:N??void 0},i)}R+=1}e.restore()}}drawColumnHeaderAtIndex(e,t,r,i){var a,{metrics:o,model:s}=t,{modelColumns:l,allColumnWidths:d,allColumnXs:h,gridX:c}=o,v=U(d,r),m=U(h,r)+c,f=U(l,r),g=s.textForColumnHeader(f);g!=null&&this.drawColumnHeader(e,t,g,m,v,{backgroundColor:(a=s.colorForColumnHeader(f))!==null&&a!==void 0?a:void 0},i)}drawColumnHeader(e,t,r,i,a,o,s){var l;if(!(a<=0)){var{metrics:d,theme:h}=t,{headerHorizontalPadding:c,columnHeaderHeight:v,headerBackgroundColor:m,headerColor:f,headerSeparatorColor:g,black:b,white:C}=h,{fontWidths:S,width:w}=d,E=(l=S.get(e.font))!==null&&l!==void 0?l:Fa,y=a-c*2,T=y/E,{backgroundColor:O=m,separatorColor:R=g}=o??{},{textColor:P=f}=o??{};try{var M=this.getCachedColorIsDark(O),F=this.getCachedColorIsDark(P);M&&F?P=C:!M&&!F&&(P=b)}catch{}var{minX:N=0,maxX:D=w}=s??{};e.save(),e.rect(N,0,D-N,v),e.clip(),O!=null&&(e.fillStyle=O,e.fillRect(i,0,a,v)),R!=null&&(e.strokeStyle=R,e.beginPath(),i>0&&(e.moveTo(i+.5,0),e.lineTo(i+.5,v)),e.moveTo(i+a+.5,0),e.lineTo(i+a+.5,v),e.moveTo(i,v-.5),e.lineTo(i+a,v-.5),e.stroke()),e.beginPath(),e.rect(i,0,a,v),e.clip(),e.fillStyle=P;var _=r;T<=0?_="":_.length>T&&(_="".concat(_.substring(0,T-1),"…"));var x=_.length*E,L=i+a*.5,H=v*.5;N+=c,D-=c;var G=i+c,X=ke(G,N,D),W=i+a-c,A=ke(W,N,D),I=A-X,k=L-x*.5<N,j=L+x*.5>D;k?x<I?L=N+x*.5:L=W-x*.5:j&&(x<I?L=D-x*.5:L=G+x*.5),e.textAlign="center",e.fillText(_,L,H),e.restore()}}drawRowHeaders(e,t){var{mouseX:r,mouseY:i,metrics:a,theme:o,draggingRowSeparator:s}=t,{gridY:l,rowHeaderWidth:d,height:h,visibleRows:c,allRowHeights:v,allRowYs:m}=a;if(!(d<=0)){var{headerBackgroundColor:f,headerColor:g,headerHiddenSeparatorSize:b,headerHiddenSeparatorHoverColor:C,headerSeparatorColor:S,headerSeparatorHoverColor:w}=o,E=d*.5,y=d*.5-E*.5;if(e.save(),e.beginPath(),e.fillStyle=f,e.fillRect(0,0,d,h),S){e.strokeStyle=S,e.beginPath(),e.moveTo(0,l+.5),e.lineTo(d,l+.5);for(var T=[],O=!1,R=0;R<c.length;R+=1){var P=c[R],M=U(m,P),F=U(v,P);if(F>0){var N=l+M+F+.5;e.moveTo(0,N),e.lineTo(d,N),O=!1}else O||(O=!0,T.push(P))}e.moveTo(d-.5,0),e.lineTo(d-.5,h),e.stroke(),e.beginPath(),e.fillStyle=S;for(var D=0;D<T.length;D+=1){var _=T[D],x=U(m,_),L=U(v,_),H=l+x+L+.5-b*.5;e.rect(y,H,E,b)}e.fill()}if(w){var{index:G=null}=s??{};if(G==null&&r!=null&&i!=null&&(G=he.getRowSeparatorIndex(r,i,a,o)),G!=null){e.strokeStyle=w;var X=U(m,G),W=U(v,G),A=l+X+W+.5,I=c.indexOf(G),k=I<c.length-1?c[I+1]:null,j=k!=null?v.get(k):null,Y=W===0,ee=j!=null&&j===0;Y?(e.strokeStyle=C,e.fillStyle=C,e.fillRect(y,A,E,b*.5)):ee&&(e.fillStyle=w,e.fillRect(y,A-b*.5,E,b*.5)),e.beginPath(),e.moveTo(.5,A),e.lineTo(d+.5,A),e.stroke()}}e.beginPath(),e.rect(0,l,d,h),e.clip(),e.fillStyle=g,e.textAlign="right";for(var K=0;K<c.length;K+=1){var ie=c[K],ne=U(v,ie),se=U(m,ie)+l;this.drawRowHeader(e,t,ie,se,ne)}e.restore()}}drawRowHeader(e,t,r,i,a){if(!(a<=0)){var{metrics:o,model:s,theme:l}=t,{modelRows:d,rowHeaderWidth:h}=o,c=U(d,r),v=h-l.cellHorizontalPadding,m=i+a*.5;e.fillText(s.textForRowHeader(c),v,m)}}drawRowFooters(e,t){var{mouseX:r,mouseY:i,metrics:a,model:o,theme:s,draggingRowSeparator:l}=t,{gridY:d,gridX:h,maxX:c,modelRows:v,rowFooterWidth:m,height:f,verticalBarWidth:g,visibleRows:b,allRowHeights:C,allRowYs:S,width:w}=a;if(!(m<=0)){var{cellHorizontalPadding:E,headerBackgroundColor:y,headerColor:T,headerHiddenSeparatorSize:O,headerHiddenSeparatorHoverColor:R,headerSeparatorColor:P,headerSeparatorHoverColor:M}=s,F=m*.5,N=m*.5-F*.5,D=Math.min(h+c,w-m-g);if(e.save(),e.beginPath(),e.fillStyle=y,e.fillRect(D,d,m,f),P){e.strokeStyle=P,e.beginPath(),e.moveTo(D,d+.5),e.lineTo(m,d+.5);for(var _=[],x=!1,L=0;L<b.length;L+=1){var H=b[L],G=U(S,H),X=U(C,H);if(X>0){var W=d+G+X+.5;e.moveTo(D+.5,W),e.lineTo(D+m-.5,W),x=!1}else x||(x=!0,_.push(H))}e.moveTo(D+.5,d),e.lineTo(D+.5,f),e.stroke(),e.beginPath(),e.fillStyle=P;for(var A=0;A<_.length;A+=1){var I=_[A],k=U(S,I),j=U(C,I),Y=d+k+j+.5-O*.5;e.rect(D+N,Y,F,O)}e.fill()}if(M){var{index:ee=null}=l??{};if(ee==null&&r!=null&&i!=null&&(ee=he.getRowSeparatorIndex(r,i,a,s)),ee!=null){e.strokeStyle=M;var K=U(S,ee),ie=U(C,ee),ne=d+K+ie+.5,se=b.indexOf(ee),pe=se<b.length-1?b[se+1]:null,Fe=pe!=null?C.get(pe):null,tt=ie===0,rt=Fe!=null&&Fe===0;tt?(e.strokeStyle=R,e.fillStyle=R,e.fillRect(N,ne,F,O*.5)):rt&&(e.fillStyle=M,e.fillRect(N,ne-O*.5,F,O*.5)),e.beginPath(),e.moveTo(D+.5,ne),e.lineTo(D+m+.5,ne),e.stroke()}}e.beginPath(),e.rect(D,d,m,f),e.clip(),e.fillStyle=T,e.textAlign="left";for(var Ye=D+E,vt=0;vt<b.length;vt+=1){var St=b[vt],$e=U(C,St);if($e>0){var wt=U(S,St)+d,Rt=U(v,St),Lr=wt+$e*.5;e.fillText(o.textForRowFooter(Rt),Ye,Lr)}}e.restore()}}drawSelectedRanges(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{cursorColumn:i,cursorRow:a,draggingRow:o,draggingColumn:s,editingCell:l,metrics:d,model:h,selectedRanges:c,theme:v}=t,{allColumnWidths:m,allColumnXs:f,allRowHeights:g,allRowYs:b,width:C,height:S}=d,{left:w=d.left,top:E=d.top,right:y=d.right,bottom:T=d.bottom,minY:O=-10,maxY:R=S+10,minX:P=-10,maxX:M=C+10}=r;if(c.length!==0){var F=Je(h)&&h.isEditable&&l==null&&o==null&&s==null&&i!=null&&a!=null&&f.has(i)&&b.has(a);if(F){var N=U(f,i),D=U(b,a),_=U(m,i),x=U(g,a);e.save(),e.beginPath(),e.rect(0,0,C,S),e.rect(N,D,_,x),e.clip("evenodd")}e.beginPath();for(var L=0;L<c.length;L+=1){var H=c[L],G=H.startColumn!==null?H.startColumn:w,X=H.startRow!==null?H.startRow:E,W=H.endColumn!==null?H.endColumn:y,A=H.endRow!==null?H.endRow:T;if(A>=E&&T>=X&&W>=w&&y>=G){var I=G>=w&&f.has(G)?Math.round(U(f,G))+.5:P,k=X>=E&&b.has(X)?Math.max(Math.round(U(b,X))+.5,.5):O,j=W<=y&&f.has(W)?Math.round(U(f,W)+U(m,W))-.5:M,Y=A<=T&&b.has(A)?Math.round(U(b,A)+U(g,A))-.5:R;e.rect(I,k,j-I,Y-k)}}e.fillStyle=v.selectionColor,e.fill(),e.save(),e.clip(),e.strokeStyle=v.selectionOutlineCasingColor,e.lineWidth=3,e.stroke(),e.restore(),e.strokeStyle=v.selectionOutlineColor,e.lineWidth=1,e.stroke(),F&&i!=null&&a!=null&&(e.restore(),this.drawActiveCell(e,t,i,a))}}drawActiveCell(e,t,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:Sn.ACTIVE_CELL_BORDER_WIDTH,{metrics:o,theme:s}=t,{allColumnWidths:l,allColumnXs:d,allRowHeights:h,allRowYs:c}=o,v=U(d,r),m=U(c,i),f=U(l,r),g=U(h,i),b=v-a*.5,C=m-a*.5,S=f+a,w=g+a;b<=0&&(S+=b-1,b=1),C<=0&&(w+=C-1,C=1);var{lineWidth:E}=e;e.beginPath(),e.lineWidth=a,e.strokeStyle=s.selectionOutlineColor,this.drawRoundedRect(e,b,C,S,w),e.stroke(),e.lineWidth=E}drawRoundedRect(e,t,r,i,a){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:Sn.DEFAULT_EDGE_RADIUS;e.beginPath(),e.moveTo(t+o,r),e.lineTo(t+i-o,r),e.quadraticCurveTo(t+i,r,t+i,r+o),e.lineTo(t+i,r+a-o),e.quadraticCurveTo(t+i,r+a,t+i-o,r+a),e.lineTo(t+o,r+a),e.quadraticCurveTo(t,r+a,t,r+a-o),e.lineTo(t,r+o),e.quadraticCurveTo(t,r,t+o,r),e.closePath()}drawDraggingColumn(e,t){var r,{draggingColumn:i,metrics:a,mouseX:o,theme:s,model:l}=t;if(!(i==null||o==null)){var{range:d,depth:h}=i,{gridX:c,gridY:v,allColumnXs:m,allColumnWidths:f,height:g,width:b,columnHeaderMaxDepth:C,columnHeaderHeight:S,movedColumns:w,modelColumns:E,floatingLeftWidth:y}=a,T=(r=E.get(d[0]))!==null&&r!==void 0?r:he.getModelIndex(d[0],w),O=l.getColumnHeaderGroup(T,h);if(!(h>0&&!O)){var[R,P]=d,M=U(m,R),F=U(m,P)+U(f,P),N=F-M,D=i.left,{backgroundColor:_,font:x,headerFont:L,reorderOffset:H,shadowBlur:G,shadowColor:X}=s,W=(C-h-1)*S;e.save(),e.translate(c,0),e.save(),e.beginPath(),e.rect(y,0,b,g),e.clip(),e.fillStyle=_,e.fillRect(M,W,N,g),e.restore(),e.translate(0,H),e.save(),e.shadowColor=X,e.shadowBlur=G,e.fillStyle=_,e.fillRect(i.left,W+H,i.width,g),e.restore(),e.beginPath(),e.rect(i.left,W,i.width+1,g),e.clip(),e.translate(D-M,0),e.font=L;for(var A=[],I=i.range[0];I<=i.range[1];I+=1)A.push(I);this.drawColumnHeaders(e,t),this.drawColumnHeadersForRange(e,t,[A[0],A[A.length-1]],{minX:M,maxX:b}),e.translate(0,v),e.font=x,this.drawGridBackground(e,t);for(var k=R;k<=P;k+=1)this.drawColumnCellContents(e,t,k);e.restore()}}}drawDraggingRow(e,t){var{draggingRow:r,draggingRowOffset:i,metrics:a,mouseY:o,theme:s}=t;if(!(r==null||o==null)){var{gridX:l,gridY:d,allRowYs:h,allRowHeights:c,width:v}=a,m=U(h,r),f=U(c,r)+1,{backgroundColor:g,font:b,headerFont:C,reorderOffset:S,shadowBlur:w,shadowColor:E}=s;e.save(),e.translate(0,d),e.fillStyle=g,e.fillRect(0,m,v,f),e.translate(l+S,o-m-d-(i??0)),e.save(),e.shadowColor=E,e.shadowBlur=w,e.fillStyle=g,e.fillRect(-l,m,v,f),e.restore(),e.beginPath(),e.rect(-l,m,v,f),e.clip(),e.font=b,this.drawGridBackground(e,t),this.drawCellContents(e,t),e.translate(-l,-d),e.font=C,this.drawRowHeaders(e,t),e.restore()}}drawScrollBars(e,t){var{isDraggingHorizontalScrollBar:r,isDraggingVerticalScrollBar:i,isDragging:a,metrics:o,mouseX:s,mouseY:l,theme:d}=t;if(!(d.scrollBarSize<=0)){var{width:h,height:c,handleHeight:v,handleWidth:m,scrollX:f,scrollY:g,hasHorizontalBar:b,hasVerticalBar:C,barWidth:S,barHeight:w,barLeft:E,barTop:y}=o,{scrollBarBackgroundColor:T,scrollBarHoverBackgroundColor:O,scrollBarCasingColor:R,scrollBarCornerColor:P,scrollBarColor:M,scrollBarHoverColor:F,scrollBarActiveColor:N,scrollBarSize:D,scrollBarHoverSize:_,scrollBarCasingWidth:x,scrollBarSelectionTick:L,scrollBarSelectionTickColor:H,scrollBarActiveSelectionTickColor:G,autoSelectRow:X,autoSelectColumn:W}=d,A=s!=null&&l!=null&&s<=h&&l<=c,I=i||C&&!r&&!a&&s!=null&&l!=null&&s>=h-_&&l>=y&&A,k=r||b&&!i&&!a&&!I&&s!=null&&l!=null&&l>=c-_&&s>=E&&A,j=k?_:D,Y=I?_:D;if(e.translate(E,y),b&&C&&(e.fillStyle=R,e.fillRect(h-E-D,c-y-D,D,D),e.fillStyle=P,e.fillRect(h-E-D+x,c-y-D+x,D-x,D-x)),b){var ee=f,K=c-y-j;if(e.fillStyle=R,e.fillRect(0,K,S,j-x),e.fillStyle=k?O:T,e.fillRect(0,K+x,S,j-x),r?e.fillStyle=N:k?e.fillStyle=F:e.fillStyle=M,e.fillRect(ee,K+x,m,j-x),!X&&L&&H!=null&&G!=null){e.fillStyle=H;for(var{selectedRanges:ie,cursorColumn:ne}=t,{lastLeft:se,columnCount:pe}=o,Fe=[...ie].filter(it=>it.startColumn!=null&&it.endColumn!=null),tt=Fe.map(it=>[it.startColumn,it.endColumn]).sort(he.compareRanges),rt=he.mergeSortedRanges(tt),Ye=it=>it<=se?it/se*(S-m):S-m+(it-se)/(pe-se)*m,vt=0;vt<rt.length;vt+=1){var St=rt[vt],$e=St[0],wt=St[1];if($e!=null&&wt!=null&&($e!==ne||wt!==ne)){var Rt=Ye($e),Lr=Math.max(1,Math.round(Ye(wt+1)-Rt)),fr=j-x;e.fillRect(Rt,K+x+Math.round(fr/3),Lr,Math.round(fr/3))}}if(ne!=null){var Wn=Ye(ne),on=2,gr=j-x;e.fillStyle=G,e.fillRect(Wn,K+x,on,gr)}}}if(C){var nt=h-E-Y,Bt=g;if(e.fillStyle=R,e.fillRect(nt,0,Y-x,w),e.fillStyle=I?O:T,e.fillRect(nt+x,0,Y-x,w),i?e.fillStyle=N:I?e.fillStyle=F:e.fillStyle=M,e.fillRect(nt+x,Bt,Y-x,v),!W&&L&&H!=null&&G!=null){var{selectedRanges:kr,cursorRow:pr}=t,{lastTop:jr,rowCount:wi}=o,$r=it=>it<=jr?it/jr*(w-v):w-v+(it-jr)/(wi-jr)*v;e.fillStyle=H;for(var Hr=[...kr].filter(it=>it.startRow!=null&&it.endRow!=null),nr=Hr.map(it=>[it.startRow,it.endRow]).sort(he.compareRanges),Kn=he.mergeSortedRanges(nr),zn=0;zn<Kn.length;zn+=1){var qn=Kn[zn],br=qn[0],sn=qn[1];if(br!=null&&sn!=null&&(br!==pr||sn!==pr)){var yi=$r(br),ua=Y-x,zo=Math.max(1,Math.round($r(sn+1)-yi));e.fillRect(nt+x+Math.round(ua/3),yi,Math.round(ua/3),zo)}}if(pr!=null){var qo=Math.round($r(pr)),Yo=Y-x,Xo=2;e.fillStyle=G,e.fillRect(nt+x,qo,Yo,Xo)}}}e.translate(-E,-y)}}}Ea(Sn,"DEFAULT_EDGE_RADIUS",2);Ea(Sn,"ACTIVE_CELL_BORDER_WIDTH",2);function ss(n,e,t){return e=b1(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function b1(n){var e=C1(n,"string");return typeof e=="symbol"?e:String(e)}function C1(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Zg=100;class S1 extends bt{constructor(){super(...arguments),ss(this,"startPoint",void 0),ss(this,"hasExtendedFloating",!1),ss(this,"timer",void 0),ss(this,"lastTriggerTime",void 0),ss(this,"dragBounds",void 0)}onDown(e,t,r){var{x:i,y:a,column:o,row:s}=e,{metrics:l}=t;if(!l)throw new Error("metrics not set");var{gridX:d,gridY:h,maxX:c,maxY:v}=l,m=i-d,f=a-h;if(m<0||f<0||o==null&&m>c||s==null&&f>v)return!1;var g=he.isModifierKeyDown(r),b=r.shiftKey;g||(b?t.trimSelectedRanges():t.clearSelectedRanges());var C=t.getTheme(),{autoSelectRow:S,autoSelectColumn:w}=C;return(o!==null||!w)&&(s!==null||!S)&&(t.focus(),t.moveCursorToPosition(o,s,b,!1,b&&g)),this.startPoint=e,this.hasExtendedFloating=!1,this.dragBounds=he.getScrollDragBounds(l,s,o),!0}onDrag(e,t){if(this.startPoint===void 0)return!1;this.stopTimer();var{row:r,column:i}=this.startPoint,{x:a,y:o}=e,{row:s,column:l}=e,{metrics:d}=t;if(!d)throw new Error("metrics not set");var{left:h,lastLeft:c,top:v,lastTop:m,columnWidth:f,rowHeight:g}=d,b=he.getScrollDragBounds(d,r,i),C=0,S=0;if(h<c&&(a<b.x1?C=a-b.x1:a>b.x2&&(C=a-b.x2)),v<m&&(o<b.y1?S=o-b.y1:o>b.y2&&(S=o-b.y2)),C!==0||S!==0)this.startTimer(t,e,C>0?Math.ceil(C/f):Math.floor(C/f),S>0?Math.ceil(S/g):Math.floor(S/g));else if(s!=null&&l!=null){var{floatingTopRowCount:w,floatingBottomRowCount:E,floatingLeftColumnCount:y,floatingRightColumnCount:T,columnCount:O,rowCount:R,bottom:P,right:M,topVisible:F,bottomVisible:N,leftVisible:D,rightVisible:_}=d;this.hasExtendedFloating||(r!==null&&r<w&&s>=w?(s=w,this.hasExtendedFloating=!0):r!==null&&r>=R-E&&s<R-E&&(s=R-E-1,this.hasExtendedFloating=!0),i!==null&&i<y&&l>=y?(l=y,this.hasExtendedFloating=!0):i!==null&&i>=O-T&&l<O-T&&(l=O-T-1,this.hasExtendedFloating=!0)),r!==null&&!he.isFloatingRow(r,d)&&he.isFloatingRow(s,d)&&(r>s&&s<v?s=F-1:r<s&&s>P&&(s=N+1)),i!==null&&!he.isFloatingColumn(i,d)&&he.isFloatingColumn(l,d)&&(i>l&&l<h?l=D-1:i<l&&l>M&&(l=_+1)),t.moveCursorToPosition(l,s,!0,!0)}return!0}onUp(e,t){return this.startPoint!==void 0&&(this.startPoint=void 0,this.dragBounds=void 0,this.stopTimer(),t.commitSelection()),!1}moveSelection(e,t,r,i){var{row:a,column:o}=t,{metrics:s}=e;if(!s)throw new Error("metrics not set");var{selectionEndRow:l,selectionEndColumn:d}=e.state;if(l==null||d==null)throw new Error("selection not set");var{rowCount:h,columnCount:c}=s,v=r<0&&o!=null?o:0,m=r>0&&o!=null?o:c-1,f=i<0&&a!=null?a:0,g=i>0&&a!=null?a:h-1;e.moveCursorToPosition(Math.min(Math.max(v,d+r),m),Math.min(Math.max(f,l+i),g),!0),this.lastTriggerTime=Date.now()}startTimer(e,t,r,i){this.stopTimer();var a=this.lastTriggerTime!=null?Zg-Math.min(Zg,Date.now()-this.lastTriggerTime):0;this.timer=setTimeout(()=>{this.moveSelection(e,t,r,i),this.startTimer(e,t,r,i)},a)}stopTimer(){this.timer!==void 0&&(clearTimeout(this.timer),this.timer=void 0)}}const w1=S1;function Jg(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 ar(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Jg(Object(t),!0).forEach(function(r){ji(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Jg(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ji(n,e,t){return e=y1(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function y1(n){var e=E1(n,"string");return typeof e=="symbol"?e:String(e)}function E1(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ep=5,T1=1e3/60,Bl=10;function Ri(n,e,t,r){var i,{modelColumns:a,movedColumns:o,allColumnXs:s,columnCount:l,allColumnWidths:d,userColumnWidths:h,calculatedColumnWidths:c,floatingLeftWidth:v,maxX:m}=t;if(e==null||n==null||n>l||n<0)return null;var f=(i=a.get(n))!==null&&i!==void 0?i:he.getModelIndex(n,o),g=r.getColumnHeaderGroup(f,e),b=g!=null,C,S,w;if(g!=null){var E,y,T,[O,R]=g.getVisibleRange(o);C=(E=s.get(O))!==null&&E!==void 0?E:v,S=((y=s.get(R))!==null&&y!==void 0?y:m)+((T=d.get(R))!==null&&T!==void 0?T:0),w=[O,R]}else{var P,M,F,N=s.get(n);if(N==null)return null;C=N,S=C+((P=(M=(F=d.get(n))!==null&&F!==void 0?F:h.get(f))!==null&&M!==void 0?M:c.get(f))!==null&&P!==void 0?P:0),w=[n,n]}return{visibleIndex:n,modelIndex:f,left:C,right:S,width:S-C,isColumnGroup:b,range:w,depth:e}}class P1 extends bt{constructor(){super(...arguments),ji(this,"cursor",null),ji(this,"draggingOffset",void 0),ji(this,"initialOffset",void 0),ji(this,"initialGridPoint",void 0),ji(this,"scrollingInterval",void 0),ji(this,"scrollingDirection",void 0),ji(this,"draggingColumn",null)}setScrollInterval(e,t){this.scrollingInterval!=null&&t===this.scrollingDirection||(this.scrollingDirection=t,this.scrollingInterval=window.setInterval(()=>{var{metrics:r}=e;if(r){var{left:i,lastLeft:a,leftOffset:o,userColumnWidths:s,calculatedColumnWidths:l,movedColumns:d,allColumnWidths:h}=r,c=i,v=o;if(t==="left")for(v-=Bl;v<0;){var m;c-=1;var f=he.getModelIndex(i-1,d),g=(m=s.get(f))!==null&&m!==void 0?m:l.get(f);g===void 0?v=0:v+=g,c<0&&(v=0,c=0)}else{v+=Bl;for(var b=h.get(i);b!==void 0&&v>b;){var C;c+=1,v-=b;var S=he.getModelIndex(i+1,d);b=(C=s.get(S))!==null&&C!==void 0?C:l.get(S),c>a&&(v=0,c=a)}}var{mouseX:w,mouseY:E}=e.state;r==null||w==null||E==null||(this.moveDraggingColumn(w,e,t==="left"?-Bl:Bl),e.setState({left:c,leftOffset:v}),(t==="left"&&c===0&&o===0||t==="right"&&c===a)&&this.clearScrollInterval())}},T1))}clearScrollInterval(){this.scrollingDirection=void 0,window.clearInterval(this.scrollingInterval),this.scrollingInterval=void 0}onLeave(){return this.clearScrollInterval(),!1}onDown(e,t){var{model:r}=t.props,{x:i,column:a,columnHeaderDepth:o}=e,{metrics:s}=t;if(!s)throw new Error("Metrics not set");var l=Ri(a,o,s,r);if(a==null||l==null||o==null||o>0&&!l.isColumnGroup)return!1;var{rowHeaderWidth:d}=s;return this.initialGridPoint=e,this.draggingColumn=null,this.cursor=null,l.modelIndex!=null&&o!=null&&r.isColumnMovable(l.modelIndex,o)&&(this.draggingOffset=i-l.left-d,this.initialOffset=this.draggingOffset),!1}onDrag(e,t,r){if(this.draggingOffset===void 0||this.initialGridPoint===void 0||this.initialOffset===void 0)return!1;var{x:i,y:a}=e,{columnHeaderDepth:o}=this.initialGridPoint,{model:s}=t.props,{draggingColumn:l}=this,{metrics:d}=t;if(!d)throw new Error("Metrics not set");if(!l&&Math.abs(this.initialGridPoint.x-i)<ep&&Math.abs(this.initialGridPoint.y-a)<ep)return!1;if(l==null){var h=Ri(this.initialGridPoint.column,o,d,s);if(!h||o==null||!s.isColumnMovable(h.modelIndex)||o>0&&!h.isColumnGroup||h.range[0]==null)return!1;l={range:h.range,depth:o,left:h.left,width:h.width};var c=Ri(l.range[0],0,d,s),v=Ri(l.range[1],0,d,s);if(!c||!v)return!1;this.draggingColumn=l,t.setState({draggingColumn:l,isDragging:!0})}return this.cursor="move",this.moveDraggingColumn(e.x,t,r.movementX),!0}moveDraggingColumn(e,t,r){var i;if(!(this.draggingOffset===void 0||this.initialGridPoint===void 0||this.initialOffset===void 0||this.draggingColumn==null||r===0)){if(this.initialOffset!==this.draggingOffset){this.draggingOffset<this.initialOffset&&this.initialOffset<this.draggingOffset+r||this.draggingOffset>this.initialOffset&&this.initialOffset>this.draggingOffset+r?this.draggingOffset=this.initialOffset:this.draggingOffset+=r,this.draggingColumn=ar(ar({},this.draggingColumn),{},{left:e-this.draggingOffset}),t.setState({draggingColumn:this.draggingColumn});return}var{depth:a}=this.draggingColumn,{model:o}=t.props,{movedColumns:s}=t.state,{metrics:l}=t;if(!l)throw new Error("Metrics not set");var{floatingLeftWidth:d,width:h,columnHeaderMaxDepth:c,allColumnXs:v}=l,m=r<0,f=Ri(this.draggingColumn.range[0],a,l,o);if(f){var g=e-this.draggingOffset,b=g+f.width;this.draggingColumn=ar(ar({},this.draggingColumn),{},{left:g}),t.setState({draggingColumn:this.draggingColumn});var C=Ri(he.getColumnAtX(ke(m?g:b,d,h),l,!0),a,l,o),S=o.getColumnHeaderParentGroup(f.modelIndex,f.depth);if(C){if(S!==void 0){var w=S.getVisibleRange(s);if(C.visibleIndex<w[0]){var E,y=this.moveColumn(f,w[0],s);this.draggingOffset=e-((E=v.get(w[0]))!==null&&E!==void 0?E:0),this.draggingColumn=ar(ar({},this.draggingColumn),{},{left:e-this.draggingOffset}),this.clearScrollInterval(),t.setState({draggingColumn:this.draggingColumn,movedColumns:y});return}if(C.visibleIndex>w[1]){var T,O=this.moveColumn(f,w[1]-(f.range[1]-f.range[0]),s),{right:R=0}=(T=Ri(w[1],0,l,o))!==null&&T!==void 0?T:{};this.draggingOffset=e-(R-f.width),this.draggingColumn=ar(ar({},this.draggingColumn),{},{left:e-this.draggingOffset}),this.clearScrollInterval(),t.setState({draggingColumn:this.draggingColumn,movedColumns:O});return}}if(!o.isColumnMovable(C.modelIndex)){var P=C.visibleIndex;if(m)for(P+=1;P<f.visibleIndex&&!o.isColumnMovable(he.getModelIndex(P,s));)P+=1;else for(P-=1;P>f.visibleIndex&&!o.isColumnMovable(he.getModelIndex(P,s));)P-=1;if(P!==f.visibleIndex){m||(P-=f.range[1]-f.range[0]);var M=this.moveColumn(f,P,s);t.setState({movedColumns:M,draggingColumn:this.draggingColumn})}var F=Ri(P,0,l,o);if(m){var N;this.draggingOffset=e-((N=F==null?void 0:F.left)!==null&&N!==void 0?N:0)}else{var D;this.draggingOffset=e-(((D=F==null?void 0:F.right)!==null&&D!==void 0?D:0)-f.width)}this.draggingColumn=ar(ar({},this.draggingColumn),{},{left:e-this.draggingOffset}),t.setState({draggingColumn:this.draggingColumn});return}if(g<=d?this.setScrollInterval(t,"left"):b>h?this.setScrollInterval(t,"right"):this.clearScrollInterval(),C.visibleIndex!==f.visibleIndex&&!(m&&f.visibleIndex<C.visibleIndex||!m&&f.visibleIndex>C.visibleIndex)){for(var _=C.left+C.width*.5,x=o.getColumnHeaderParentGroup(f.modelIndex,f.depth),L,H=((i=x==null?void 0:x.depth)!==null&&i!==void 0?i:c)-1;H>=0&&L===void 0;)L=o.getColumnHeaderGroup(C.modelIndex,H),H-=1;var G;m&&g<_&&(!L||C.visibleIndex===L.getVisibleRange(s)[0])&&(G=this.moveColumn(f,C.range[0],s)),!m&&b>_&&(!L||C.visibleIndex===L.getVisibleRange(s)[1])&&(G=this.moveColumn(f,C.range[1]-(f.range[1]-f.range[0]),s)),G&&(this.draggingColumn=ar(ar({},this.draggingColumn),{},{left:g}),t.setState({movedColumns:G,draggingColumn:this.draggingColumn}))}}}}}moveColumn(e,t,r){var i=e.isColumnGroup?he.moveRange(e.range,t,r):he.moveItem(e.visibleIndex,t,r),a=t-e.range[0],o=[e.range[0]+a,e.range[1]+a];return this.draggingColumn&&(this.draggingColumn=ar(ar({},this.draggingColumn),{},{range:o})),i}onUp(e,t){return this.cursor=null,this.clearScrollInterval(),this.draggingOffset!=null?(this.draggingOffset=void 0,t.setState({draggingColumn:null,isDragging:!1}),!0):!1}}const O1=P1;function tp(n,e,t){return e=D1(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function D1(n){var e=I1(n,"string");return typeof e=="symbol"?e:String(e)}function I1(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class em extends bt{constructor(){super(...arguments),tp(this,"dragOffset",void 0),tp(this,"cursor","default")}static getLeftWithOffsetFromRawLeft(e,t){var r=e.getTheme(),{metrics:i,metricCalculator:a}=e;if(!i)throw new Error("metrics not set");if(r.scrollSnapToColumn){var o=Math.round(t),s=0;return{left:o,leftOffset:s}}var l=Math.floor(t),d=t-l,h=i.allColumnWidths.get(l);if(h==null){var c=e.getMetricState();h=a.getVisibleColumnWidth(l,c)}var v=h*d;return{left:l,leftOffset:v}}isInScrollBar(e,t){var r=t.getTheme(),{scrollBarSize:i,scrollBarHoverSize:a}=r,{metrics:o}=t;if(!o)throw new Error("metrics not set");var{x:s,y:l}=e,{barLeft:d,barWidth:h,height:c,hasHorizontalBar:v}=o;return v&&i>0&&l>=c-a&&l<c&&s>d&&s<d+h}getLeftWithOffset(e,t){var r,{metrics:i}=t;if(!i)throw new Error("metrics not set");var{x:a}=e,{barWidth:o,handleWidth:s,lastLeft:l,barLeft:d,columnCount:h,scrollableContentWidth:c,scrollableViewportWidth:v}=i,m=a-d,f=ke((m-((r=this.dragOffset)!==null&&r!==void 0?r:0))/(o-s),0,1);if(h===1)return{left:0,leftOffset:f*(c-v)};var g=f*l;return em.getLeftWithOffsetFromRawLeft(t,g)}onDown(e,t){var{metrics:r}=t;if(!r)throw new Error("metrics not set");var{x:i}=e,{handleWidth:a,barLeft:o,scrollX:s}=r;if(!this.isInScrollBar(e,t))return!1;var l=i-o;if(l>=s&&l<=s+a)this.dragOffset=l-s,t.setState({isDraggingHorizontalScrollBar:!0});else{this.dragOffset=0;var{left:d,leftOffset:h}=this.getLeftWithOffset(e,t);t.setViewState({left:d,leftOffset:h,isDraggingHorizontalScrollBar:!0,isDragging:!0})}return!0}onDrag(e,t){if(this.dragOffset!=null){var{left:r,leftOffset:i}=this.getLeftWithOffset(e,t);return t.setViewState({left:r,leftOffset:i,isDraggingHorizontalScrollBar:!0,isDragging:!0}),!0}return!1}onMove(e,t){return this.isInScrollBar(e,t)}onUp(e,t){return this.dragOffset!==void 0&&(this.dragOffset=void 0,t.setState({isDraggingHorizontalScrollBar:!1,isDragging:!1})),this.isInScrollBar(e,t)}onClick(e,t){return this.isInScrollBar(e,t)}}const R1=em;function rp(n,e,t){return e=_1(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _1(n){var e=x1(n,"string");return typeof e=="symbol"?e:String(e)}function x1(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class N1 extends bt{constructor(){super(...arguments),rp(this,"cursor","move"),rp(this,"draggingOffset",void 0)}onDown(e,t){var{model:r}=t.props,{x:i,y:a,row:o}=e,{metrics:s}=t;if(!s)throw new Error("metrics not set");var{columnHeaderHeight:l,rowHeaderWidth:d,allRowYs:h}=s;if(i<=d&&o!==null&&r.isRowMovable(o)){var c=U(h,o);this.draggingOffset=a-c-l,t.setState({draggingRowOffset:this.draggingOffset})}return!1}onDrag(e,t){if(this.draggingOffset==null)return!1;var{model:r}=t.props,{draggingRow:i}=t.state,{mouseX:a,mouseY:o}=t.state;if(a==null||o==null)return!1;if(i==null){var{row:s}=t.getGridPointFromXY(a,o);if(s!=null&&!r.isRowMovable(s)||(i=s,t.setState({draggingRow:i,isDragging:!0}),i==null))return!1}var{metrics:l}=t;if(!l)throw new Error("metrics not set");var{top:d,lastTop:h,bottom:c,bottomVisible:v,rowCount:m,columnHeaderHeight:f,allRowHeights:g,allRowYs:b,height:C}=l,S=f;if(d<i){var w=i-1;S=U(b,w)+U(g,w)*.5+f}var E=C;if(i<c){var y=i+1;E=U(b,y)+U(g,y)*.5+f}var{movedRows:T}=t.state;o<S&&i>0&&r.isRowMovable(i-1)?(T=he.moveItem(i,i-1,T),i-=1):E<o&&i<m-1&&r.isRowMovable(i+1)&&(T=he.moveItem(i,i+1,T),i+=1),t.setState({movedRows:T,draggingRow:i});var O=f+U(g,d)*.5,R=f+U(b,v)+U(g,v)*.5;return o<O&&d>0?t.setState({top:d-1}):o>R&&d<h&&t.setState({top:d+1}),!0}onUp(e,t){return this.draggingOffset!==void 0?(this.draggingOffset=void 0,t.setState({draggingRowOffset:null,draggingRow:null,isDragging:!1}),!0):!1}}const M1=N1;function Gt(n,e,t){return e=F1(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function F1(n){var e=A1(n,"string");return typeof e=="symbol"?e:String(e)}function A1(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class tm extends A0{constructor(){super(...arguments),Gt(this,"hiddenCursor","s-resize"),Gt(this,"defaultCursor","row-resize"),Gt(this,"pointProperty","y"),Gt(this,"userSizesProperty","userRowHeights"),Gt(this,"visibleOffsetProperty","visibleRowYs"),Gt(this,"visibleSizesProperty","visibleRowHeights"),Gt(this,"marginProperty","columnHeaderHeight"),Gt(this,"calculatedSizesProperty","calculatedRowHeights"),Gt(this,"initialSizesProperty","initialRowHeights"),Gt(this,"modelIndexesProperty","modelRows"),Gt(this,"firstIndexProperty","firstRow"),Gt(this,"treePaddingProperty","treePaddingY"),Gt(this,"getHiddenItems",he.getHiddenRows),Gt(this,"getNextShownItem",he.getNextShownRow),Gt(this,"getSeparator",tm.getRowSeparator)}static getRowSeparator(e,t,r,i){if(!i.allowRowResize)return null;var{x:a,y:o}=e,s=he.getRowSeparatorIndex(a,o,t,i);return s!=null?{index:s,depth:0}:null}setSize(e,t,r){e.setRowHeight(t,r)}resetSize(e,t){e.resetRowHeight(t)}updateSeparator(e,t){e.setState({draggingRowSeparator:t,isDragging:t!==null})}}const L1=tm;class _d extends bt{static isInTreeBox(e,t){var{column:r,row:i,x:a,y:o}=e,{metrics:s}=t;if(!s)throw new Error("metrics not set");var{gridX:l,gridY:d,firstColumn:h,allColumnXs:c,allColumnWidths:v,allRowHeights:m,allRowYs:f,visibleRowTreeBoxes:g}=s;if(r===h&&i!=null&&g.get(i)!=null&&a>l&&o>d){var b=U(c,r),C=U(v,r),S=U(f,i),w=U(m,i);if(a>=l+b&&a<=l+b+C&&o>=d+S&&o<=d+S+w)return!0}return!1}onDown(e,t){return _d.isInTreeBox(e,t)}onClick(e,t,r){if(_d.isInTreeBox(e,t)){var{row:i}=e;if(i!==null)return t.toggleRowExpanded(i,he.isModifierKeyDown(r)),!0}return!1}}const Pc=_d;class k1 extends bt{isInCorner(e,t){var r=t.getTheme(),{scrollBarSize:i}=r,{metrics:a}=t;if(!a)throw new Error("metrics not set");var{x:o,y:s}=e,{width:l,height:d,hasVerticalBar:h,hasHorizontalBar:c}=a;return i>0&&h&&c&&o>=l-i&&s>=d-i&&o<=l&&s<=d}onDown(e,t){return this.isInCorner(e,t)}onUp(e,t){return this.isInCorner(e,t)}onClick(e,t){return this.isInCorner(e,t)}}const j1=k1;function np(n,e,t){return e=$1(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function $1(n){var e=H1(n,"string");return typeof e=="symbol"?e:String(e)}function H1(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class rm extends bt{constructor(){super(...arguments),np(this,"dragOffset",void 0),np(this,"cursor","default")}static getTopWithOffsetFromRawTop(e,t){var r=e.getTheme(),{metrics:i,metricCalculator:a}=e;if(!i)throw new Error("metrics not set");if(r.scrollSnapToRow){var o=Math.round(t),s=0;return{top:o,topOffset:s}}var l=Math.floor(t),d=t-l,h=i.allRowHeights.get(l);if(h==null){var c=e.getMetricState();h=a.getVisibleRowHeight(l,c)}var v=h*d;return{top:l,topOffset:v}}isInScrollBar(e,t){var r=t.getTheme(),{scrollBarSize:i,scrollBarHoverSize:a}=r,{metrics:o}=t;if(!o)throw new Error("metrics not set");var{x:s,y:l}=e,{barTop:d,barHeight:h,width:c,hasVerticalBar:v}=o;return v&&i>0&&s>=c-a&&s<c&&l>d&&l<d+h}getTopWithOffset(e,t){var r,{metrics:i}=t;if(!i)throw new Error("metrics not set");var{y:a}=e,{barHeight:o,handleHeight:s,lastTop:l,barTop:d,rowCount:h,scrollableContentHeight:c,scrollableViewportHeight:v}=i,m=a-d,f=ke((m-((r=this.dragOffset)!==null&&r!==void 0?r:0))/(o-s),0,1);if(h===1)return{top:0,topOffset:f*(c-v)};var g=f*l;return rm.getTopWithOffsetFromRawTop(t,g)}onDown(e,t){var{metrics:r}=t;if(!r)throw new Error("metrics not set");var{y:i}=e,{handleHeight:a,barTop:o,scrollY:s}=r;if(!this.isInScrollBar(e,t))return!1;var l=i-o;if(l>=s&&l<=s+a)this.dragOffset=l-s,t.setState({isDraggingVerticalScrollBar:!0});else{this.dragOffset=0;var{top:d,topOffset:h}=this.getTopWithOffset(e,t);t.setViewState({top:d,topOffset:h,isDraggingVerticalScrollBar:!0,isDragging:!0})}return!0}onMove(e,t){return this.isInScrollBar(e,t)}onDrag(e,t){if(this.dragOffset!=null){var{top:r,topOffset:i}=this.getTopWithOffset(e,t);return t.setViewState({top:r,topOffset:i,isDraggingVerticalScrollBar:!0,isDragging:!0}),!0}return!1}onUp(e,t){return this.dragOffset!==void 0&&(this.dragOffset=void 0,t.setState({isDraggingVerticalScrollBar:!1,isDragging:!1})),this.isInScrollBar(e,t)}onClick(e,t){return this.isInScrollBar(e,t)}}const U1=rm;class B1 extends bt{onDoubleClick(e,t){var{column:r,row:i}=e,{model:a}=t.props;return Je(a)&&r!=null&&i!=null&&a.isEditableRange(Q.makeCell(r,i))?(t.startEditing(r,i),!0):!1}}const V1=B1;function H0(n){return(n==null?void 0:n.getTokenBoxesForVisibleCell)!==void 0}function Ss(n,e,t){return e=G1(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function G1(n){var e=W1(n,"string");return typeof e=="symbol"?e:String(e)}function W1(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class wu extends bt{constructor(){super(...arguments),Ss(this,"timeoutId",void 0),Ss(this,"isHold",!1),Ss(this,"isDown",!1),Ss(this,"currentLinkBox",void 0)}isHoveringLink(e,t){var{column:r,row:i,x:a,y:o}=e,{renderer:s,metrics:l,props:d}=t,{model:h}=d;if(r==null||i==null||l==null)return this.currentLinkBox=void 0,!1;var{modelRows:c,modelColumns:v}=l,m=U(c,i),f=U(v,r),g=h.renderTypeForCell(f,m),b=s.getCellRenderer(g);if(!H0(b))return!1;if(this.currentLinkBox!=null){var{x1:C,y1:S,x2:w,y2:E}=this.currentLinkBox;if(a>=C&&a<=w&&o>=S&&o<=E)return!0}for(var y=t.updateRenderState(),T=b.getTokenBoxesForVisibleCell(r,i,y),O=0;O<T.length;O+=1)if(Rd(T[O].token)){var R=he.translateTokenBox(T[O],l),{x1:P,x2:M,y1:F,y2:N}=R;if(a>=P&&a<=M&&o>=F&&o<=N)return this.currentLinkBox=R,!0}return this.currentLinkBox=void 0,!1}setCursor(e,t){return this.isHoveringLink(e,t)?this.cursor="pointer":this.cursor=null,!1}onMove(e,t){return this.setCursor(e,t)}onDown(e,t,r){var i=this.isHoveringLink(e,t);return he.isModifierKeyDown(r)||r.shiftKey||!i?!1:(this.isDown=!0,this.timeoutId!=null&&clearTimeout(this.timeoutId),this.isHold=!1,this.timeoutId=setTimeout(()=>{this.isHold=!0;var{column:a,row:o}=e,{model:s}=t.props;t.clearSelectedRanges(),t.focus(),t.moveCursorToPosition(a,o),Je(s)&&a!=null&&o!=null&&s.isEditableRange(Q.makeCell(a,o))&&t.startEditing(a,o)},wu.HOLD_LENGTH),!0)}onClick(e,t){var r=this.isHoveringLink(e,t);if(!r||!this.isDown||this.currentLinkBox==null)return this.isDown=!1,this.isHold=!1,!1;if(!this.isHold){var i;this.timeoutId!=null&&clearTimeout(this.timeoutId),this.timeoutId=void 0,t.props.onTokenClicked((i=this.currentLinkBox)===null||i===void 0?void 0:i.token)}return this.isHold=!1,this.isDown=!1,!0}}Ss(wu,"HOLD_LENGTH",1e3);const K1=wu;function z1(n,e,t){return e=q1(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function q1(n){var e=Y1(n,"string");return typeof e=="symbol"?e:String(e)}function Y1(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class X1{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:5e3;z1(this,"order",void 0),this.order=e}onDown(e,t){return!1}onUp(e,t){return!1}}const Ua=X1;class Q1 extends Ua{onDown(e,t){switch(e.key){case"a":if(he.isModifierKeyDown(e))return t.selectAll(),!0;break;case"ArrowUp":return this.handleArrowMove(0,-1,e,t);case"ArrowDown":return this.handleArrowMove(0,1,e,t);case"ArrowRight":return this.handleArrowMove(1,0,e,t);case"ArrowLeft":return this.handleArrowMove(-1,0,e,t);case"k":case"K":return he.isModifierKeyDown(e)?!1:this.handlePageUp(e,t);case"j":case"J":return he.isModifierKeyDown(e)?!1:this.handlePageDown(e,t);case"h":case"H":return he.isModifierKeyDown(e)?!1:(e.shiftKey||t.clearSelectedRanges(),t.moveCursorToPosition(0,t.state.cursorRow,e.shiftKey),!0);case"l":case"L":{if(he.isModifierKeyDown(e))return!1;var{model:r}=t.props,{columnCount:i}=r;return e.shiftKey||t.clearSelectedRanges(),t.moveCursorToPosition(i-1,t.state.cursorRow,e.shiftKey),!0}case"PageDown":return this.handlePageDown(e,t);case"PageUp":return this.handlePageUp(e,t);case"Home":return e.shiftKey||t.clearSelectedRanges(),t.moveCursorToPosition(he.isModifierKeyDown(e)?t.state.cursorColumn:0,he.isModifierKeyDown(e)?0:t.state.cursorRow,e.shiftKey,!0,!0),!0;case"End":{var{model:a}=t.props,{columnCount:o,rowCount:s}=a;return e.shiftKey||t.clearSelectedRanges(),t.moveCursorToPosition(he.isModifierKeyDown(e)?t.state.cursorColumn:o-1,he.isModifierKeyDown(e)?s-1:t.state.cursorRow,e.shiftKey,!0,!0),!0}case"Escape":return t.clearSelectedRanges(),{preventDefault:!1,stopPropagation:!1};case"Enter":if(t.state.selectedRanges.length>0)return t.moveCursorInDirection(e.shiftKey?Q.SELECTION_DIRECTION.UP:Q.SELECTION_DIRECTION.DOWN),!0;break;case"Tab":if(t.state.selectedRanges.length>0)return t.moveCursorInDirection(e.shiftKey?Q.SELECTION_DIRECTION.LEFT:Q.SELECTION_DIRECTION.RIGHT),!0;break}return!1}handleArrowMove(e,t,r,i){var a=r.shiftKey,o=he.isModifierKeyDown(r);a?i.trimSelectedRanges():i.clearSelectedRanges();var{cursorRow:s,cursorColumn:l,selectionEndColumn:d,selectionEndRow:h}=i.state,c=a?d:l,v=a?h:s;if(o){var{model:m}=i.props,{columnCount:f,rowCount:g}=m,b=o&&a,C=null,S=null;e<0?(C=0,S=v):e>0?(C=f-1,S=v):t<0?(C=c,S=0):t>0&&(C=c,S=g-1),C!=null&&S!=null&&i.moveCursorToPosition(C,S,a,!0,b)}else{if(!i.metrics)throw new Error("grid.metrics are not set");var{theme:w}=i.props,{autoSelectRow:E=!1,autoSelectColumn:y=!1}=w;if(E&&e!==0){var{lastLeft:T}=i.metrics,{left:O}=i.state;O=ke(O+e,0,T),i.moveCursorToPosition(O,s,a,!1),i.setViewState({left:O})}else if(y&&t!==0){var{lastTop:R}=i.metrics,{top:P}=i.state;P=ke(P+t,0,R),i.moveCursorToPosition(P,l,a,!1),i.setViewState({top:P})}else i.moveCursor(e,t,a)}return!0}handlePageUp(e,t){var r=e.shiftKey;r?t.trimSelectedRanges():t.clearSelectedRanges();var{cursorColumn:i,selectionEndRow:a}=t.state,o=a,s=i;if(o==null)return!1;var l=t.getMetricState(),{metricCalculator:d}=t,{bottomVisible:h,topVisible:c,hasHorizontalBar:v}=d.getMetrics(l),m=o-(h-c);m-=v?0:1,m=Math.max(m,0);var f=Math.max(m-(o-c),0);return t.moveCursorToPosition(s,m,r,!1),t.setViewState({top:f}),!0}handlePageDown(e,t){var r=e.shiftKey;r?t.trimSelectedRanges():t.clearSelectedRanges();var{selectionEndRow:i,cursorColumn:a}=t.state,o=i,s=a;if(o===null)return!1;var l=t.getMetricState(),{metricCalculator:d}=t,{bottomVisible:h,topVisible:c,hasHorizontalBar:v,rowCount:m,lastTop:f}=d.getMetrics(l),g=m-1,b=h-c+o;b+=v?0:1,b=Math.min(b,g);var C=Math.min(f,b-(o-c));return t.moveCursorToPosition(s,b,r,!1),t.setViewState({top:C}),!0}}const Z1=Q1;class J1 extends Ua{onDown(e,t){switch(e.key){case"Enter":case" ":return this.handleExpandKey(e,t)}return!1}handleExpandKey(e,t){var{selectedRanges:r}=t.state;if(r.length===1){var i=r[0];if(i.startRow===i.endRow&&i.startColumn===i.endColumn){if(!t.metrics)throw new Error("grid.metrics not set");var{model:a}=t.props,{startRow:o,startColumn:s}=i;if(o!=null){var l=t.getModelRow(o);if((s===0||s==null)&&Ke(a)&&a.isRowExpandable(l))return t.toggleRowExpanded(o),!0}}}return!1}}const ek=J1;class tk extends Ua{onDown(e,t){if(he.isModifierKeyDown(e))return!1;var{model:r}=t.props,{cursorColumn:i,cursorRow:a}=t.state;if(i==null||a==null||!Je(r)||!r.isEditableRange(Q.makeCell(i,a)))return!1;var o=i,s=a;return o==null||s==null?!1:e.key.length===1?(t.startEditing(o,s,!0,[1,1],e.key),!0):e.key==="F2"?(t.startEditing(o,s),!0):e.key==="Backspace"?(t.startEditing(o,s,!0,void 0,""),!0):e.key==="Delete"?(t.setValueForCell(o,s,""),!0):!1}}const rk=tk;function nk(n){for(var e=[],t=n.querySelectorAll("tr"),r=0;r<t.length;r+=1){for(var i=t[r],a=i.querySelectorAll("td"),o=[],s=0;s<a.length;s+=1){var l,d,h=a[s];o.push((l=(d=h.textContent)===null||d===void 0?void 0:d.trim())!==null&&l!==void 0?l:"")}e.push(o)}return e}function ik(n){var e=[];return n.forEach(t=>{var r,i=(r=t.textContent)!==null&&r!==void 0?r:"";i.length>0&&e.push(i.split(/\t|\u00a0\u00a0 \u00a0/))}),e}function ak(n){var e,t,r=n.querySelector("table");if(r!=null)return nk(r);var i=(e=(t=n.textContent)===null||t===void 0?void 0:t.trim())!==null&&e!==void 0?e:"";if(i.length>0){var{childNodes:a}=n,o=i.includes(" "),s=i.includes(" ");return o&&a.length!==0&&(a.length===1||a.length>1&&(a[0].textContent==null||!a[0].textContent.includes(" ")))?i.split(`
|
|
4
4
|
`).map(l=>l.split(" ")):a.length>1||s?ik(n.childNodes):i}return null}class ok extends Ua{onDown(e,t){switch(e.key){case"v":if(he.isModifierKeyDown(e)){var r=document.createElement("div");document.body.appendChild(r),r.setAttribute("contenteditable","true"),r.setAttribute("style",'clip-path: "inset(50%)"; height: 1px; width: 1px; margin: -1px; overflow: hidden; padding 0; position: absolute;');var i=()=>{r.removeEventListener("input",i),r.remove(),t.focus();var a=ak(r);a!=null&&t.pasteValue(a)};return r.addEventListener("input",i),r.focus(),{preventDefault:!1,stopPropagation:!0}}break}return!1}}const sk=ok;var lk=n=>{switch(n){case"ArrowDown":return rn.DOWN;case"ArrowUp":return rn.UP;case"ArrowLeft":return rn.LEFT;case"ArrowRight":return rn.RIGHT;default:return}};function nm(n){var{selectionRange:e=void 0,className:t="",disabled:r=!1,value:i="",isQuickEdit:a=!0,onChange:o=()=>{},onCancel:s=()=>{},onDone:l=()=>{},onContextMenu:d=()=>{},style:h={}}=n,c=p.useRef(null),v=p.useRef(!1),[m]=p.useState(i),[f,g]=p.useState(!1),[b,C]=p.useState(a),[S,w]=p.useState(i);p.useEffect(function(){var{current:D}=c;D!=null&&(D.focus(),e?D.setSelectionRange(e[0],e[1]):D.setSelectionRange(D.value.length,D.value.length))},[e]);var E=p.useCallback(N=>{o(N)},[o]),y=p.useCallback(N=>{var{value:D}=N.target;w(D),g(!0),E(D)},[E,w,g]),T=p.useCallback(()=>{v.current=!0,f&&E(m),g(!1),s()},[m,f,s,E]),O=p.useCallback(()=>{C(!1)},[C]),R=p.useCallback(function(N){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;l(S,{direction:N,fillRange:D})},[l,S]),P=p.useCallback(()=>{v.current||R(null)},[v,R]),M=p.useCallback(N=>{switch(N.stopPropagation(),N.key){case"Escape":N.preventDefault(),T();break;case"Enter":if(N.preventDefault(),he.isModifierKeyDown(N))R(void 0,!0);else if(N.altKey){var D="".concat(S,`
|
|
@@ -39,4 +39,4 @@ Check your internet connection.`;if(t&&r)return"Disconnected from server.";if(r)
|
|
|
39
39
|
`).concat(Po.makeCirclePath(o,s,nS)),R="link-select-clip-".concat(l),P=Math.atan2(s-y,o-E),M=P-rS+Math.PI,F=P+rS+Math.PI,N=o+Math.cos(P)*tS,D=s+Math.sin(P)*tS,_=N+Math.cos(M)*dd,x=D+Math.sin(M)*dd,L=N+Math.cos(F)*dd,H=D+Math.sin(F)*dd,G="".concat(N,",").concat(D," ").concat(_,",").concat(x," ").concat(L,",").concat(H),X=.25*i+.5*E+.25*o,W=.25*a+.5*y+.25*s,A=E-i+(o-E),I=y-a+(s-y),k=I/A,j=20,Y=j/Math.sqrt(1+k**2),ee=Y*k,K=Y*-1,ie=ee*-1;Number.isFinite(k)?k>0?(Y*=-1,ee*=-1,K*=-1,ie*=-1,K-=50-10*(Math.abs(m)%Li),ie+=10*(Math.abs(m)%Li),Y-=50-10*(Math.abs(m)%Li),ee+=10*(Math.abs(m)%Li)):k<0?(K+=10*(Math.abs(m)%Li),ie+=10*(Math.abs(m)%Li),Y+=10*(Math.abs(m)%Li),ee+=10*(Math.abs(m)%Li)):(K=15,ie=10,Y=-25,ee=10):(K=10,ie=5,Y=10,ee=-35);var ne="";t!==void 0&&(t==="startsWith"?ne="a*":t==="endsWith"?ne="*z":ne=B.getFilterOperatorString(t));var se=h!=="chartLink"&&h!=="filterSource";return u.jsxs(u.Fragment,{children:[u.jsxs("svg",{className:q(e,{hovering:c}),children:[u.jsx("clipPath",{id:R,children:u.jsx("path",{d:O,clipRule:"evenodd"})}),u.jsx("path",{className:"link-select",d:T,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,clipPath:"url(#".concat(R,")"),"data-testid":"link-select"}),u.jsx("path",{className:"link-background",d:T}),u.jsx("path",{className:"link-foreground",d:T}),u.jsx("circle",{className:"link-dot",cx:i,cy:a,r:"5"}),u.jsx("polygon",{className:"link-triangle",points:G})]}),d!=null&&r&&u.jsxs(u.Fragment,{children:[se&&u.jsx(z,{kind:"primary",className:"btn-fab btn-operator",style:{top:W+(k>=0?ee:ie),left:X+(k>=0?Y:K)},onClick:()=>{},icon:u.jsxs("div",{className:"fa-md fa-layers",children:[u.jsx("b",{children:ne}),u.jsx(oe,{icon:Pa,transform:"right-8 down-9 shrink-5"})]}),tooltip:"Change comparison operator",children:u.jsx(ci,{actions:this.getDropdownActions,popperOptions:{placement:"bottom-start"}})}),u.jsx(z,{kind:"primary",className:"btn-fab btn-delete",style:{top:W+(k<0?ee:ie),left:X+(k<0?Y:K)},onClick:this.handleDelete,icon:er,tooltip:"Delete"})]})]})}}MT(Po,"defaultProps",{className:"",isSelected:!1,onClick(){},onDelete(){}});const h3=Po;function iS(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 aS(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?iS(Object(t),!0).forEach(function(r){_m(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):iS(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function _m(n,e,t){return e=c3(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function c3(n){var e=v3(n,"string");return typeof e=="symbol"?e:String(e)}function v3(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Wh=te.module("LinkerOverlayContent");class LT extends p.Component{constructor(e){super(e),_m(this,"dialogRef",void 0),this.handleBlur=this.handleBlur.bind(this),this.handleResize=this.handleResize.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleKeyUp=this.handleKeyUp.bind(this),this.handleEscapePressed=this.handleEscapePressed.bind(this),this.handleOperatorChanged=this.handleOperatorChanged.bind(this),this.dialogRef=re.createRef(),this.state={mouse:void 0,dialog:void 0,offset:{x:0,y:0},isDragging:!1,mode:"select"}}componentDidMount(){window.addEventListener("blur",this.handleBlur,!0),window.addEventListener("mousemove",this.handleMouseMove,!0),window.addEventListener("mouseup",this.handleMouseUp,!0),window.addEventListener("keydown",this.handleKeyDown,!0),window.addEventListener("keyup",this.handleKeyUp,!0),window.addEventListener("resize",this.handleResize,!0)}componentDidCatch(e,t){Wh.error("componentDidCatch",e,t)}componentWillUnmount(){window.removeEventListener("blur",this.handleBlur,!0),window.removeEventListener("mousemove",this.handleMouseMove,!0),window.removeEventListener("mouseup",this.handleMouseUp,!0),window.removeEventListener("keydown",this.handleKeyDown,!0),window.removeEventListener("keyup",this.handleKeyUp,!0),window.removeEventListener("resize",this.handleResize,!0)}getPointFromLinkPoint(e){var{panelManager:t}=this.props,{panelId:r,columnName:i}=e,a=t.getOpenedPanelById(r);if(a!=null){if(!NT(a))throw new Error("Panel does not have getCoordinateForColumn method: ".concat(r));try{var o=a.getCoordinateForColumn(i);if(o!=null)return o}catch{Wh.error("Could not get coordinate for column",i,a)}}var s=t.getContainerByPanelId(r);if(s==null)throw new Error("Unable to find panel container for id: ".concat(r));return Z.getTabPoint(s)}handleOperatorChanged(e,t){var{links:r,onLinksUpdated:i}=this.props,a=r.map(o=>o.id===e?aS(aS({},o),{},{operator:t}):o);i(a)}handleBlur(){this.setState({mode:"select"})}handleResize(){var{dialog:e}=this.state;if(e&&this.dialogRef.current){var t=this.dialogRef.current.getBoundingClientRect(),r=ke(e.x,0,window.innerWidth-t.width),i=ke(e.y,0,window.innerHeight-t.height);this.setState({dialog:{x:r,y:i}})}}handleMouseMove(e){var{offset:t,isDragging:r}=this.state;if(this.setState({mouse:{x:e.clientX,y:e.clientY}}),r&&this.dialogRef.current){var i=this.dialogRef.current.getBoundingClientRect(),a=ke(window.innerWidth-(e.clientX+i.width+t.x),0,window.innerWidth-i.width),o=ke(window.innerHeight-(e.clientY+i.height+t.y),0,window.innerHeight-i.height);this.setState({dialog:{x:a,y:o}})}}handleMouseDown(e){e.preventDefault();var t={x:0,y:0};if(this.dialogRef.current){var r=this.dialogRef.current.getBoundingClientRect();t.x=r.right-(r.width+e.clientX),t.y=r.bottom-(r.height+e.clientY)}this.setState({isDragging:!0,offset:t})}handleMouseUp(){this.setState({isDragging:!1})}handleKeyDown(e){if(e.key==="Alt")e.preventDefault(),this.setState({mode:"delete"});else if(e.key==="Delete"||e.key==="Backspace"){var{selectedIds:t,onLinkDeleted:r}=this.props;e.preventDefault(),t.forEach(i=>r(i))}}handleKeyUp(e){e.key==="Alt"&&(e.preventDefault(),this.setState({mode:"select"}))}handleEscapePressed(){var{onCancel:e}=this.props;e()}render(){var{disabled:e,links:t,selectedIds:r,messageText:i,onLinkSelected:a,onLinkDeleted:o,onAllLinksDeleted:s,onDone:l}=this.props,{mouse:d,dialog:h,isDragging:c,mode:v}=this.state,m=t.map(f=>{try{var g,b,{id:C,type:S,isReversed:w,start:E,end:y,operator:T}=f,O=E.columnType,[R,P]=this.getPointFromLinkPoint(E),M=(g=d==null?void 0:d.x)!==null&&g!==void 0?g:R,F=(b=d==null?void 0:d.y)!==null&&b!==void 0?b:P;if(y!=null&&([M,F]=this.getPointFromLinkPoint(y)),w!=null&&w){var[N,D]=[R,P];[R,P]=[M,F],[M,F]=[N,D]}var _=q("linker-link",{disabled:e},{"link-filter-source":S==="filterSource"},{"link-invalid":S==="invalid"},{interactive:f.end==null},{"link-is-selected":r.has(C)},{"danger-delete":v==="delete"});return{x1:R,y1:P,x2:M,y2:F,id:C,className:_,operator:T,startColumnType:O,type:S}}catch(x){return Wh.warn("Unable to get point for link",f,x),null}}).filter(f=>f!=null);return u.jsxs("div",{className:q("linker-overlay",{"danger-delete":v==="delete"}),children:[m.map(f=>{var{x1:g,y1:b,x2:C,y2:S,id:w,className:E,operator:y,startColumnType:T,type:O}=f;return u.jsx(h3,{className:E,id:w,x1:g,y1:b,x2:C,y2:S,onClick:a,onDelete:o,isSelected:r.has(w),operator:y,startColumnType:T,type:O,onOperatorChanged:this.handleOperatorChanged},w)}),u.jsxs("div",{className:q("linker-toast-dialog",{dragging:c}),ref:this.dialogRef,style:{bottom:h==null?void 0:h.y,right:h==null?void 0:h.x},"data-testid":"linker-toast-dialog",children:[u.jsx(z,{draggable:!0,kind:"inline",className:"btn-drag-handle",icon:Xs,onClick:()=>{},onMouseDown:this.handleMouseDown,children:!c&&u.jsx(lt,{children:"Drag to reposition"})}),u.jsx("div",{className:"toast-body",children:i}),u.jsxs("div",{className:"toast-footer",children:[u.jsx(z,{kind:"secondary",onClick:s,children:"Clear All"}),u.jsx(z,{kind:"primary",onClick:l,children:"Done"})]})]}),u.jsx(le,{actions:[{action:this.handleEscapePressed,shortcut:Cn.LINKER_CLOSE,isGlobal:!0}]})]})}}_m(LT,"defaultProps",{disabled:"false"});const m3=LT;function oS(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 sS(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?oS(Object(t),!0).forEach(function(r){kT(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):oS(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function kT(n,e,t){return e=f3(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function f3(n){var e=g3(n,"string");return typeof e=="symbol"?e:String(e)}function g3(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var xt=te.module("Linker"),p3=(n,e)=>({activeTool:Wv(n),dh:f0(n),isolatedLinkerPanelId:Fu(n,e.localDashboardId),links:Ka(n,e.localDashboardId),timeZone:Gv(n)}),b3=an(p3,{setActiveTool:E0,setDashboardLinks:Lu,addDashboardLinks:tT,deleteDashboardLinks:rT,setDashboardIsolatedLinkerPanelId:Sm,setDashboardColumnSelectionValidator:nT});class C3 extends p.Component{constructor(e){super(e),kT(this,"getCachedLinks",ve((t,r,i)=>{var a=[...t];return r!=null&&r.start!=null&&a.push(r),i!==void 0?a.filter(o=>{var s,l;return(o==null||(s=o.start)===null||s===void 0?void 0:s.panelId)===i||(o==null||(l=o.end)===null||l===void 0?void 0:l.panelId)===i||(o==null?void 0:o.end)==null}):a})),this.handleCancel=this.handleCancel.bind(this),this.handleDone=this.handleDone.bind(this),this.handlePanelCloned=this.handlePanelCloned.bind(this),this.handleFilterColumnSelect=this.handleFilterColumnSelect.bind(this),this.handleColumnsChanged=this.handleColumnsChanged.bind(this),this.handlePanelClosed=this.handlePanelClosed.bind(this),this.handleLayoutStateChanged=this.handleLayoutStateChanged.bind(this),this.handleAllLinksDeleted=this.handleAllLinksDeleted.bind(this),this.handleLinkDeleted=this.handleLinkDeleted.bind(this),this.handleLinksUpdated=this.handleLinksUpdated.bind(this),this.handleChartColumnSelect=this.handleChartColumnSelect.bind(this),this.handleGridColumnSelect=this.handleGridColumnSelect.bind(this),this.handleUpdateValues=this.handleUpdateValues.bind(this),this.handleStateChange=this.handleStateChange.bind(this),this.handleExited=this.handleExited.bind(this),this.handleLinkSelected=this.handleLinkSelected.bind(this),this.handlePanelDragging=this.handlePanelDragging.bind(this),this.handlePanelDropped=this.handlePanelDropped.bind(this),this.isColumnSelectionValid=this.isColumnSelectionValid.bind(this),this.state={linkInProgress:void 0,selectedIds:new Set,isDraggingPanel:!1}}componentDidMount(){var{layout:e}=this.props;this.startListening(e),this.updateSelectionValidators()}componentDidUpdate(e){var{activeTool:t,layout:r}=this.props;r!==e.layout&&(this.stopListening(e.layout),this.startListening(r)),t!==e.activeTool&&(this.updateSelectionValidators(),t===pn.DEFAULT&&this.reset())}componentDidCatch(e,t){xt.error("componentDidCatch",e,t)}componentWillUnmount(){var{layout:e}=this.props;this.stopListening(e)}startListening(e){e.on("stateChanged",this.handleLayoutStateChanged);var{eventHub:t}=e;t.on(en.COLUMN_SELECTED,this.handleGridColumnSelect),t.on(en.DATA_SELECTED,this.handleUpdateValues),t.on(en.STATE_CHANGED,this.handleStateChange),t.on(Gd.COLUMN_SELECTED,this.handleChartColumnSelect),t.on(Te.CLONED,this.handlePanelCloned),t.on(gt.COLUMN_SELECTED,this.handleFilterColumnSelect),t.on(gt.COLUMNS_CHANGED,this.handleColumnsChanged),t.on(Te.CLOSE,this.handlePanelClosed),t.on(Te.CLOSED,this.handlePanelClosed),t.on(Te.DRAGGING,this.handlePanelDragging),t.on(Te.DROPPED,this.handlePanelDropped)}stopListening(e){e.off("stateChanged",this.handleLayoutStateChanged);var{eventHub:t}=e;t.off(en.COLUMN_SELECTED,this.handleGridColumnSelect),t.off(en.DATA_SELECTED,this.handleUpdateValues),t.off(en.STATE_CHANGED,this.handleStateChange),t.off(Gd.COLUMN_SELECTED,this.handleChartColumnSelect),t.off(Te.CLONED,this.handlePanelCloned),t.off(gt.COLUMN_SELECTED,this.handleFilterColumnSelect),t.off(gt.COLUMNS_CHANGED,this.handleColumnsChanged),t.off(Te.CLOSE,this.handlePanelClosed),t.off(Te.CLOSED,this.handlePanelClosed),t.off(Te.DRAGGING,this.handlePanelDragging),t.off(Te.DROPPED,this.handlePanelDropped)}reset(){this.setState({linkInProgress:void 0,selectedIds:new Set})}handleCancel(){var{linkInProgress:e}=this.state;if(e==null){var{setActiveTool:t}=this.props;t(pn.DEFAULT)}this.setState({linkInProgress:void 0})}handleDone(){var{setActiveTool:e}=this.props;e(pn.DEFAULT)}handleChartColumnSelect(e,t){this.columnSelected(e,t,!0)}handleFilterColumnSelect(e,t){xt.debug("handleFilterColumnSelect",this.isOverlayShown());var{links:r,localDashboardId:i,setActiveTool:a,setDashboardIsolatedLinkerPanelId:o}=this.props,s=Z.getIdFromPanel(e),l=r.filter(d=>{var h,c;return((h=d.start)===null||h===void 0?void 0:h.panelId)===s||((c=d.end)===null||c===void 0?void 0:c.panelId)===s});if(!this.isOverlayShown()&&s!=null){a(pn.LINKER),o(i,s),l.length===0&&this.columnSelected(e,t,!0,s);return}this.columnSelected(e,t,!0)}handleColumnsChanged(e,t){xt.debug("handleColumnsChanged",e,t);var{links:r}=this.props,i=Z.getIdFromPanel(e);if(i==null){xt.error("Invalid panelId",e);return}var a=r.filter(o=>{var{start:s,end:l}=o;return s.panelId===i&&Sa.findColumn(t,s)==null||l!=null&&l.panelId===i&&Sa.findColumn(t,l)==null});this.deleteLinks(a)}handleGridColumnSelect(e,t){if(!ZC(t)){xt.debug2("Column is not filterable");return}this.columnSelected(e,t)}columnSelected(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3?arguments[3]:void 0;if(!(i===void 0&&!this.isOverlayShown())){var{isolatedLinkerPanelId:a}=this.props,{linkInProgress:o}=this.state,s=Z.getIdFromPanel(e);if(s!=null){var l=Z.getComponentNameFromPanel(e),{name:d,type:h}=t;if(o==null||o.start==null){var c={id:Me.generate(),start:{panelId:s,panelComponent:l,columnName:d,columnType:h},type:"invalid",isReversed:r};xt.debug("starting link",c),this.setState({linkInProgress:c})}else{var{links:v}=this.props,{start:m,id:f,isReversed:g}=o,b={panelId:s,panelComponent:l,columnName:d,columnType:h},C=Sa.getLinkType(g!==void 0&&g?b:m,g!==void 0&&g?m:b,i??a);switch(C){case"invalid":xt.debug("Ignore invalid link connection",o,b);return;case"filterSource":{var S=g!==void 0&&g?m.panelId:b.panelId,w=v.filter(R=>{var{end:P}=R;return(P==null?void 0:P.panelId)===S});this.deleteLinks(w);break}case"chartLink":{var E=g===!0?m:b,y=g===!0?b:m;xt.debug("creating chartlink",{existingLinkEnd:E,start:m,end:b});var T=v.filter(R=>{var{end:P,start:M}=R;return(M==null?void 0:M.panelId)===y.panelId&&(P==null?void 0:P.panelId)===E.panelId&&(P==null?void 0:P.columnName)===E.columnName&&(P==null?void 0:P.columnType)===E.columnType});this.deleteLinks(T);break}}var O={start:g!==void 0&&g?b:m,end:g!==void 0&&g?m:b,id:f,type:C,operator:Oe.eq};xt.info("creating link",O),this.setState({linkInProgress:void 0,selectedIds:new Set([f])},()=>{this.addLinks([O])})}}}}unsetFilterValueForLink(e){var{panelManager:t}=this.props;if(e.end){var{end:r}=e,{panelId:i,columnName:a,columnType:o}=r,s=t.getOpenedPanelById(i);s?QC(s)?s.unsetFilterValue(a,o):xt.debug("endPanel.unsetFilterValue not implemented",s):xt.debug("endPanel no longer exists, ignoring unsetFilterValue",i)}}setPanelFilterMap(e,t){xt.debug("Set filter data for panel:",e,t);var{panelManager:r}=this.props,i=r.getOpenedPanelById(e);i?QC(i)?i.setFilterMap(t):xt.debug("panel.setFilterMap not implemented",e,i):xt.debug("panel no longer exists, ignoring setFilterMap",e)}addLinks(e){var{addDashboardLinks:t,localDashboardId:r}=this.props;t(r,e)}deleteLinks(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,{localDashboardId:r}=this.props;if(e.forEach(o=>this.unsetFilterValueForLink(o)),t){var{setDashboardLinks:i}=this.props;i(r,[])}else if(e.length>0){var{deleteDashboardLinks:a}=this.props;a(r,e.map(o=>{var{id:s}=o;return s}))}}handleAllLinksDeleted(){var{links:e,isolatedLinkerPanelId:t}=this.props;if(t===void 0)this.deleteLinks(e,!0);else{var r=e.filter(i=>{var a,o;return(i==null||(a=i.start)===null||a===void 0?void 0:a.panelId)===t||(i==null||(o=i.end)===null||o===void 0?void 0:o.panelId)===t});this.deleteLinks(r)}this.reset()}handleLinkDeleted(e){var{links:t}=this.props,r=t.find(i=>i.id===e);r?this.deleteLinks([r]):xt.error("Unable to find link to delete",e)}handleUpdateValues(e,t){for(var r=Z.getIdFromPanel(e),{dh:i,links:a,timeZone:o}=this.props,s=new Map,l=0;l<a.length;l+=1){var{start:d,end:h,operator:c}=a[l];if(d.panelId===r&&h!=null){var{panelId:v,columnName:m,columnType:f}=h,g=s.has(v)?s.get(v):new Map,b=g.has(m)===!0?g.get(m).filterList:[],{visibleIndex:C,isExpandable:S,isGrouped:w}=t[d.columnName],{value:E}=t[d.columnName],y="".concat(E);if(E===null&&S&&w&&(E=void 0),f!=null&&B.isDateType(f)){var T=new ra(i,{timeZone:o,showTimeZone:!1,showTSeparator:!0,defaultDateTimeFormatString:Ma.FULL_DATE_FORMAT});y=T.format(E)}var O={operator:c,text:y,value:E,startColumnIndex:C};b.push(O),g.set(m,{columnType:f,filterList:b}),s.set(v,g)}}s.forEach((R,P)=>{this.setPanelFilterMap(P,R)})}handlePanelCloned(e,t){var{links:r}=this.props,i=Z.getIdFromPanel(e),a=t.id;if(i!=null){var o=Sa.cloneLinksForPanel(r,i,a);this.addLinks(o)}}handlePanelDragging(e){for(var{links:t}=this.props,r=0;r<t.length;r+=1){var i=t[r],{start:a,end:o}=i;if(a.panelId===e||(o==null?void 0:o.panelId)===e){this.setState({isDraggingPanel:!0});return}}}handlePanelDropped(){this.setState({isDraggingPanel:!1})}handlePanelClosed(e){xt.debug("Panel ".concat(e," closed, deleting links.")),this.deleteLinksForPanelId(e)}handleLinkSelected(e){this.setState({selectedIds:new Set([e])})}handleLinksUpdated(e){var{localDashboardId:t,setDashboardLinks:r}=this.props;r(t,e)}handleLayoutStateChanged(){this.forceUpdate()}handleStateChange(){this.forceUpdate()}handleExited(){var{localDashboardId:e,setDashboardIsolatedLinkerPanelId:t}=this.props;t(e,void 0)}deleteLinksForPanelId(e){for(var{links:t}=this.props,r=0;r<t.length;r+=1){var i=t[r],{start:a,end:o,id:s}=i;(a.panelId===e||(o==null?void 0:o.panelId)===e)&&this.handleLinkDeleted(s)}}isOverlayShown(){var{activeTool:e}=this.props;return e===pn.LINKER}updateSelectionValidators(){var{activeTool:e,setDashboardColumnSelectionValidator:t,localDashboardId:r}=this.props;switch(e){case pn.LINKER:t(r,this.isColumnSelectionValid);break;default:t(r,void 0);break}}updateLinkInProgressType(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"invalid";this.setState(t=>{var{linkInProgress:r}=t;return r!==void 0?{linkInProgress:sS(sS({},r),{},{type:e})}:null})}isColumnSelectionValid(e,t){var{linkInProgress:r}=this.state,{isolatedLinkerPanelId:i}=this.props;if(t==null)return(r==null?void 0:r.start)!=null&&this.updateLinkInProgressType(),!1;if(!ZC(t))return xt.debug2("Column is not filterable",t.description),(r==null?void 0:r.start)!=null&&this.updateLinkInProgressType("invalid"),!1;if((r==null?void 0:r.start)==null)return!0;var{isReversed:a,start:o}=r,s=Z.getIdFromPanel(e);if(s==null)return!1;var l={panelId:s,panelComponent:Z.getComponentNameFromPanel(e),columnName:t.name,columnType:t.type},d=a!==void 0&&a?Sa.getLinkType(l,o,i):Sa.getLinkType(o,l,i);return this.updateLinkInProgressType(d),d!=="invalid"}render(){var{links:e,isolatedLinkerPanelId:t,panelManager:r}=this.props,{linkInProgress:i,selectedIds:a,isDraggingPanel:o}=this.state,s=this.isOverlayShown(),l=i!=null&&i.start!=null,d=t===void 0?"Click a column source, then click a column target to create a filter link. The filter comparison operator used by a selected link can be changed. Delete a filter link by clicking the delete button or with alt+click. Click done when finished.":"Create a link between the source column button and a table column by clicking on one, then the other. Delete a filter link by clicking the delete button or with alt+click. Click done when finished.";return o?null:u.jsx(kt,{in:s,timeout:qe.transitionMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,onExited:this.handleExited,children:u.jsx(m3,{disabled:l,panelManager:r,links:this.getCachedLinks(e,i,t),selectedIds:a,messageText:d,onLinkSelected:this.handleLinkSelected,onLinkDeleted:this.handleLinkDeleted,onAllLinksDeleted:this.handleAllLinksDeleted,onLinksUpdated:this.handleLinksUpdated,onDone:this.handleDone,onCancel:this.handleCancel})})}}var S3=b3(C3);const w3=S3;function jT(n){$a(n);var{id:e,layout:t,panelManager:r}=n;return u.jsx(w3,{layout:t,localDashboardId:e,panelManager:r})}var y3={name:"LinkerPlugin",type:rr.DASHBOARD_PLUGIN,component:jT};const E3=y3;function $T(n,e,t){return e=T3(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function T3(n){var e=P3(n,"string");return typeof e=="symbol"?e:String(e)}function P3(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ko{static getNewMarkdownTitle(e){for(var t="".concat(ko.DEFAULT_TITLE),r=0;e.indexOf(t)>=0;)r+=1,t="".concat(ko.DEFAULT_TITLE,"-").concat(r);return t}}$T(ko,"DEFAULT_TITLE","Note");$T(ko,"DEFAULT_CONTENT",`# Markdown Note
|
|
40
40
|
|
|
41
41
|
This note can be edited using **markdown** for styling.`);const Kh=ko;function HT(n){$a(n);var{id:e,layout:t,panelManager:r,registerComponent:i}=n,a=p.useCallback(s=>{var{title:l,componentState:d,props:h}=s,{panelState:c=null}=h;return d!=null&&({panelState:c=null}=d),l==null||c==null||c.content==null||c.content.length===0||c.content===Kh.DEFAULT_CONTENT?null:gu(s)},[]),o=p.useCallback(function(){var{title:s="",metadata:l={},id:d=Me.generate(),focusElement:h=Z.DEFAULT_FOCUS_SELECTOR,createNewStack:c=!1,dragEvent:v=null}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},m=r.getOpenedPanelConfigsOfType(lo.COMPONENT),f=r.getClosedPanelConfigsOfType(lo.COMPONENT),g=m.map(E=>{var y;return(y=E.title)!==null&&y!==void 0?y:""}),b=s!=null&&s!==""?s:Kh.getNewMarkdownTitle(g),C=f.length>0?null:Kh.DEFAULT_CONTENT,S={type:"react-component",component:lo.COMPONENT,props:{id:d,metadata:l,panelState:{content:C},localDashboardId:e},title:b,id:d},{root:w}=t;Z.openComponent({root:w,config:S,focusElement:h,createNewStack:c,dragEvent:v})},[e,t,r]);return p.useEffect(function(){var l=[i(lo.COMPONENT,lo,pu,a)];return()=>{l.forEach(d=>d())}},[a,i]),ze(t.eventHub,KE.OPEN,o),null}var O3={name:"MarkdownPlugin",type:rr.DASHBOARD_PLUGIN,component:HT};const D3=O3;function lS(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 dS(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?lS(Object(t),!0).forEach(function(r){I3(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):lS(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function I3(n,e,t){return e=R3(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function R3(n){var e=_3(n,"string");return typeof e=="symbol"?e:String(e)}function _3(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var xm=p.forwardRef((n,e)=>{var{localDashboardId:t,fetch:r}=n,i=RT(r,t);return u.jsx(TT,dS(dS({ref:e},n),i))});xm.displayName="PandasPanelPlugin";const x3=xm;function uS(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function zh(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){uS(a,r,i,o,s,"next",l)}function s(l){uS(a,r,i,o,s,"throw",l)}o(void 0)})}}function UT(n){var e=It(),[t,r]=p.useState(),[i,a]=p.useState(!0),[o,s]=p.useState(!1),{fetch:l}=n,d=p.useCallback(zh(function*(){var c=yield l();return Ru.makeModel(e,c)}),[e,l]),h=p.useCallback(zh(function*(){a(!0);var c=yield d();r(c),a(!1)}),[d]);return p.useEffect(()=>{var c=!1;function v(){return m.apply(this,arguments)}function m(){return m=zh(function*(){var f=yield d();c||(r(f),s(!0),a(!1))}),m.apply(this,arguments)}return v(),a(!0),()=>{c=!0}},[d]),u.jsxs(u.Fragment,{children:[u.jsx(tr,{isLoaded:o,isLoading:i}),t&&u.jsx(xo,{model:t,children:u.jsx(ET,{onClick:h})})]})}var N3={name:"PandasPanel",title:"Pandas",type:rr.WIDGET_PLUGIN,component:UT,panelComponent:xm,supportedTypes:"pandas.DataFrame",icon:kS};const M3=N3;function hS(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 ps(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?hS(Object(t),!0).forEach(function(r){F3(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):hS(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function F3(n,e,t){return e=A3(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function A3(n){var e=L3(n,"string");return typeof e=="symbol"?e:String(e)}function L3(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var k3=te.module("WidgetLoaderPlugin");function j3(n){var e;function t(r,i){var a=n.component,{metadata:o}=r,s=Vv(a);return u.jsx(pl,ps(ps({widgetName:o==null?void 0:o.name,widgetType:n.title},r),{},{children:s?u.jsx(a,ps(ps({},r),{},{ref:i})):u.jsx(a,ps({},r))}))}return t.displayName="WidgetLoaderPlugin(".concat((e=n.component.displayName)!==null&&e!==void 0?e:n.name,")"),p.forwardRef(t)}function BT(n){var e=vu(),t=p.useMemo(()=>{var s=new Map;return e.forEach(l=>{ll(l)&&[l.supportedTypes].flat().forEach(d=>{if(d!=null&&d!==""){if(s.has(d)){var h;k3.warn("Multiple WidgetPlugins handling type ".concat(d,". Replacing ").concat((h=s.get(d))===null||h===void 0?void 0:h.name," with ").concat(l.name," to handle ").concat(d))}s.set(d,l)}})}),s},[e]);$a(n);var{id:r,layout:i,registerComponent:a}=n,o=p.useCallback(s=>{var l,{dragEvent:d,fetch:h,panelId:c=Me.generate(),widget:v}=s,{id:m,type:f}=v,g=(l=v.title)!==null&&l!==void 0?l:v.name,b=t.get(f);if(b!=null){var C={id:m,name:g,type:f},S={localDashboardId:r,metadata:C,fetch:h},w={type:"react-component",component:b.name,props:S,title:g,id:c},{root:E}=i;Z.openComponent({root:E,config:w,dragEvent:d})}},[r,i,t]);return p.useEffect(()=>{var s=[...new Set(t.values())].map(l=>{var{panelComponent:d}=l;return d==null?a(l.name,j3(l)):a(l.name,d)});return()=>{s.forEach(l=>l())}},[a,t]),ze(i.eventHub,Te.OPEN,o),null}var $3={name:"WidgetLoaderPlugin",type:rr.DASHBOARD_PLUGIN,component:BT};const H3=$3;function Wu(n,e,t){return e=U3(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function U3(n){var e=B3(n,"string");return typeof e=="symbol"?e:String(e)}function B3(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Sl{}Wu(Sl,"DROPDOWN_FILTER","ControlType.DROPDOWN_FILTER");Wu(Sl,"INPUT_FILTER","ControlType.INPUT_FILTER");Wu(Sl,"MARKDOWN","ControlType.MARKDOWN");Wu(Sl,"FILTER_SET_MANAGER","ControlType.FILTER_SET_MANAGER");const V3=Sl;var G3=V.shape({state:V.shape({panelState:V.shape({})})}),W3=V.shape({panelId:V.string.isRequired,columnName:V.string.isRequired,columnType:V.string.isRequired}),cS=V.shape({panelId:V.string.isRequired,columnName:V.string.isRequired}),VT=V.shape({start:cS,end:cS,id:V.string,isReversed:V.bool}),K3=V.arrayOf(VT),z3=V.shape({name:V.string.isRequired,operateAs:V.string.isRequired,groups:V.arrayOf(V.string).isRequired,permissions:V.shape({canUsePanels:V.bool.isRequired,canCopy:V.bool.isRequired,canDownloadCsv:V.bool.isRequired,canLogout:V.bool.isRequired}).isRequired}),q3=Object.freeze({LinkPoint:W3,Link:VT,Links:K3,Panel:G3,User:z3});const Y3=q3;var X3=(n,e)=>n[e]===null?null:V.bool,Q3=(n,e)=>n[e]===null?null:V.string,Z3=Object.freeze({nullableBoolean:X3,nullableString:Q3});const J3=Z3,eq=Object.freeze(Object.defineProperty({__proto__:null,ChartBuilderPlugin:OT,ChartBuilderPluginConfig:V5,ChartEvent:Gd,ChartPanel:bl,ChartPanelPlugin:j5,ChartPluginConfig:U5,ChartWidgetPlugin:PT,CommandHistoryPanel:dT,CommonPropTypes:J3,ConsoleEvent:Mr,ConsolePanel:vd,ConsolePlugin:q5,ControlType:V3,DropdownFilterPanel:ia,FileExplorerPanel:vT,FilterPlugin:DT,FilterPluginConfig:X5,FilterSetManager:mT,FilterSetManagerPanel:fd,GridPanelPlugin:r3,GridPluginConfig:a3,GridWidgetPlugin:_T,InputFilterEvent:gt,InputFilterPanel:To,IrisGridEvent:en,IrisGridPanel:Fo,LinkerPlugin:jT,LinkerPluginConfig:E3,LinkerUtils:Sa,LogPanel:pT,MarkdownEvent:KE,MarkdownPanel:lo,MarkdownPlugin:HT,MarkdownPluginConfig:D3,MockFileStorage:N5,NotebookEvent:We,NotebookPanel:Ui,PandasEvent:aK,PandasPanel:TT,PandasPanelPlugin:x3,PandasPluginConfig:M3,PandasWidgetPlugin:UT,Panel:Gn,TabEvent:Ps,ToolType:pn,UIPropTypes:Y3,WidgetLoaderPlugin:BT,WidgetLoaderPluginConfig:H3,WidgetPanel:pl,WidgetPanelTooltip:gl,addDashboardLinks:tT,deleteDashboardLinks:rT,getColumnSelectionValidatorForDashboard:Au,getColumnsForDashboard:Cm,getDashboardConnection:yK,getDashboardConsoleSettings:wK,getDashboardSessionWrapper:Ko,getFilterSetsForDashboard:eT,getInputFiltersForDashboard:Nu,getIsolatedLinkerPanelIdForDashboard:Fu,getLinksForDashboard:Ka,getTableMapForDashboard:Mu,isChartPanelDehydratedProps:lT,isChartPanelFigureMetadata:wm,isChartPanelTableMetadata:Eo,isGLChartPanelState:sT,isIrisGridPanelMetadata:gT,isLegacyIrisGridPanelMetadata:fT,setDashboardColumnSelectionValidator:nT,setDashboardConnection:EK,setDashboardConsoleSettings:iT,setDashboardFilterSets:aT,setDashboardIsolatedLinkerPanelId:Sm,setDashboardLinks:Lu,setDashboardSessionWrapper:TK,useLoadTablePlugin:IT},Symbol.toStringTag,{value:"Module"}));var GT={react:re,"react-dom":Yd,redux:GP,"react-redux":WP,"@adobe/react-spectrum":KP,"@deephaven/auth-plugins":XN,"@deephaven/chart":$x,"@deephaven/components":bx,"@deephaven/dashboard":TL,"@deephaven/dashboard-core-plugins":eq,"@deephaven/icons":yD,"@deephaven/iris-grid":KW,"@deephaven/jsapi-bootstrap":wx,"@deephaven/jsapi-components":CN,"@deephaven/jsapi-utils":Ax,"@deephaven/log":te,"@deephaven/plugin":TN,"@deephaven/react-hooks":AI},tq=zP.createRequires(GT),rq=qP({requires:tq});const nq=rq;function vS(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function Nm(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){vS(a,r,i,o,s,"next",l)}function s(l){vS(a,r,i,o,s,"throw",l)}o(void 0)})}}var Ki=te.module("@deephaven/app-utils.PluginUtils");function iq(n){return Vc.apply(this,arguments)}function Vc(){return Vc=Nm(function*(n){var e=yield nq(n);return e}),Vc.apply(this,arguments)}function aq(n){return Gc.apply(this,arguments)}function Gc(){return Gc=Nm(function*(n){var e=yield fetch(n);if(!e.ok)throw new Error(e.statusText);try{return yield e.json()}catch{throw new Error("Could not be parsed as JSON")}}),Gc.apply(this,arguments)}function oq(n){return Wc.apply(this,arguments)}function Wc(){return Wc=Nm(function*(n){Ki.debug("Loading plugins...");try{var e=yield aq("".concat(n,"/manifest.json"));if(!Array.isArray(e.plugins))throw new Error("Plugin manifest JSON does not contain plugins array");Ki.debug("Plugin manifest loaded:",e);for(var t=[],r=0;r<e.plugins.length;r+=1){var{name:i,main:a}=e.plugins[r],o="".concat(n,"/").concat(i,"/").concat(a);t.push(iq(o))}for(var s=yield Promise.allSettled(t),l=new Map,d=0;d<s.length;d+=1){var h=s[d],{name:c}=e.plugins[d];if(h.status==="fulfilled"){var v,m=Ry(h.value)?h.value:(v=h.value.default)!==null&&v!==void 0?v:h.value;m==null?Ki.error("Plugin '".concat(c,"' is missing an exported value.")):l.set(c,m)}else Ki.error("Unable to load plugin '".concat(c,"'"),h.reason)}return Ki.info("Plugins loaded:",l),l}catch(f){return Ki.error("Unable to load plugins:",f),new Map}}),Wc.apply(this,arguments)}function sq(n){var e,t;return(e=(t=n.get("AuthHandlers"))===null||t===void 0?void 0:t.split(","))!==null&&e!==void 0?e:[]}function lq(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Map,r=sq(e),i=[...n.entries(),...t.entries()].filter(l=>{var[,d]=l;return xy(d)||Pd(d)}).map(l=>{var[d,h]=l;return Pd(h)?{type:rr.AUTH_PLUGIN,name:d,component:h.AuthPlugin.Component,isAvailable:h.AuthPlugin.isAvailable}:h}),a=i.filter(l=>{var{isAvailable:d}=l;return d(r,e)});if(a.length===0)throw new Error("No login plugins found, please register a login plugin for auth handlers: ".concat(r));a.length>1&&Ki.warn("More than one login plugin available, will use the first one: ",a.map(l=>{var{name:d}=l;return d}).join(", "));var{name:o,component:s}=a[0];return Ki.info("Using LoginPlugin",o),s}var dq=OS.createRequires(()=>GT),uq=OS.createRemoteComponent({requires:dq});const Lq=uq;function mS(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function hq(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){mS(a,r,i,o,s,"next",l)}function s(l){mS(a,r,i,o,s,"throw",l)}o(void 0)})}}function cq(n){var{pluginsUrl:e,getCorePlugins:t,children:r}=n,[i,a]=p.useState(null);return p.useEffect(function(){var s=!1;function l(){return d.apply(this,arguments)}function d(){return d=hq(function*(){var h,c=(h=yield t==null?void 0:t())!==null&&h!==void 0?h:[],v=yield oq(e);if(!s){var m=c.map(f=>[f.name,f]);a(new Map([...m,...v]))}}),d.apply(this,arguments)}return l(),()=>{s=!0}},[e,t]),u.jsx(sl.Provider,{value:i,children:r})}function vq(){var n=_v();return p.useEffect(function(){n.postMessage(Ov(Pv))},[n]),null}function fS(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function mq(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){fS(a,r,i,o,s,"next",l)}function s(l){fS(a,r,i,o,s,"throw",l)}o(void 0)})}}var fq=new Map([["@deephaven/auth-plugins.AuthPluginParent",{AuthPlugin:$y}],["@deephaven/auth-plugins.AuthPluginPsk",{AuthPlugin:Vy}],["@deephaven/auth-plugins.AuthPluginAnonymous",{AuthPlugin:jy}]]);function gq(n){var{children:e}=n,t=ka(),r=p.useContext(sl),[i,a]=p.useState(),[o,s]=p.useState();p.useEffect(function(){var c=!1;function v(){return m.apply(this,arguments)}function m(){return m=mq(function*(){try{var f=yield t.getAuthConfigValues();c||a(new Map(f))}catch(g){c||s(g)}}),m.apply(this,arguments)}return v(),()=>{c=!0}},[t]);var l=p.useMemo(()=>{if(!(r==null||i==null))try{return lq(r,i,fq)}catch(h){s(h)}},[i,r]),d=l==null||i==null;return d||o!=null?u.jsx(tr,{isLoading:d&&o==null,errorMessage:Io(o)}):u.jsx(l,{authConfigValues:i,children:u.jsxs(u.Fragment,{children:[u.jsx(vq,{}),e]})})}function gS(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function pq(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){gS(a,r,i,o,s,"next",l)}function s(l){gS(a,r,i,o,s,"throw",l)}o(void 0)})}}var bq=te.module("@deephaven/app-utils.ConnectionBootstrap");function Cq(n){var{children:e}=n,t=It(),r=ka(),[i,a]=p.useState(),[o,s]=p.useState();return p.useEffect(function(){var d=!1;function h(){return c.apply(this,arguments)}function c(){return c=pq(function*(){try{var v=yield r.getAsIdeConnection();if(d)return;s(v)}catch(m){if(d)return;a(m)}}),c.apply(this,arguments)}return h(),()=>{d=!0}},[t,r]),p.useEffect(function(){if(o==null)return;function d(c){var{detail:v}=c;bq.info("Shutdown","".concat(JSON.stringify(v))),a("Server shutdown: ".concat(v??"Unknown reason"))}var h=o.addEventListener(t.IdeConnection.EVENT_SHUTDOWN,d);return h},[t,o]),o==null||i!=null?u.jsx(tr,{"data-testid":"connection-bootstrap-loading",isLoading:o==null,errorMessage:i!=null?"".concat(i):void 0}):u.jsx(tw.Provider,{value:o,children:e})}function kq(n){return new URL(n,"".concat(window.location))}function Sq(){var n=new URLSearchParams(window.location.search);return n.get("envoyPrefix")}function wq(){var n=Sq();return n!=null?{headers:{"envoy-prefix":n}}:{headers:{}}}function yq(n){var{children:e}=n,t=p.useContext(Dy);return t?u.jsx(u.Fragment,{children:e}):u.jsx(tr,{"data-testid":"fonts-loaded-loading"})}function pS(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function Eq(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){pS(a,r,i,o,s,"next",l)}function s(l){pS(a,r,i,o,s,"throw",l)}o(void 0)})}}var WT=p.createContext(null);function Tq(n){var{children:e}=n,t=ka(),[r,i]=p.useState(),[a,o]=p.useState();p.useEffect(function(){var d=!1;function h(){return c.apply(this,arguments)}function c(){return c=Eq(function*(){try{var v=yield t.getServerConfigValues();d||i(new Map(v))}catch(m){d||o(m)}}),c.apply(this,arguments)}return h(),()=>{d=!0}},[t]);var s=r==null;return s||a!=null?u.jsx(tr,{isLoading:s&&a==null,errorMessage:Io(a)}):u.jsx(WT.Provider,{value:r,children:e})}function Pq(){return Zs(WT,"No server config available in useServerConfig. Was code wrapped in ServerConfigBootstrap or ServerConfigContext.Provider?")}function Oq(n){var{children:e}=n,t=Pq(),r=p.useContext(ky),i=p.useContext(mu),a=Wy(t,r,i);return u.jsx(kv.Provider,{value:a,children:e})}function Dq(n){var{children:e}=n,t=p.useContext(sl),r=p.useMemo(()=>t==null?null:Fy(t),[t]);return u.jsx(VS,{themes:r,children:u.jsx(ew,{children:u.jsx(M2,{children:u.jsx($E,{children:e})})})})}function jq(n){var{fontClassNames:e,pluginsUrl:t,getCorePlugins:r,serverUrl:i,children:a}=n,o=p.useMemo(()=>wq(),[]),[s,l]=p.useState(0),d=p.useCallback(()=>{},[]),h=p.useCallback(()=>{l(c=>c+1)},[]);return cu(d,h),u.jsx(SN,{fontClassNames:e,children:u.jsx(cq,{getCorePlugins:r,pluginsUrl:t,children:u.jsx(Dq,{children:u.jsx(Jw,{serverUrl:i,options:o,children:u.jsx(wy,{children:u.jsx(gq,{children:u.jsx(Tq,{children:u.jsx(Oq,{children:u.jsx(Cq,{children:u.jsx(yq,{children:a})})})})})})},s)})})})}function $q(){return Zs(kv,"No user available in useUser. Was code wrapped in UserBootstrap or UserContext.Provider?")}export{jq as AppBootstrap,gq as AuthBootstrap,Cq as ConnectionBootstrap,SN as FontBootstrap,yq as FontsLoaded,Dy as FontsLoadedContext,cq as PluginsBootstrap,Lq as RemoteComponent,Dq as ThemeBootstrap,sq as getAuthHandlers,lq as getAuthPluginComponent,kq as getBaseUrl,wq as getConnectOptions,Sq as getEnvoyPrefix,aq as loadJson,iq as loadModulePlugin,oq as loadModulePlugins,Pq as useServerConfig,$q as useUser};
|
|
42
|
-
//# sourceMappingURL=index-
|
|
42
|
+
//# sourceMappingURL=index-1377628c.js.map
|