@deephaven/embed-chart 0.20.1-beta.2 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{A as d,B as _t,z as C,C as In,R as D,D as Re,E as p,F as ut,G,P as Cn,H as dt,I as N,J as L,K as Vt,L as X,M as xn,N as Ut,O as Dn,Q as vn,S as wn,T as Nn,U as $t}from"./vendor.d4f8636b.js";import{P as Ge,b as An,h as Fn,p as On,o as kn,s as Rn,t as Ln,c as nt}from"./plotly.3009bed8.js";import"./helpers.162e09a8.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerpolicy&&(i.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?i.credentials="include":o.crossorigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var Pn={prefix:"vs",iconName:"check",icon:[512,512,[],"f000","m461.792 106.336 -271.04 320 -25.28 -1.152 -107.2 -152.64 26.176 -18.368 95.296 135.68 257.632 -304.192 24.448 20.672z"]},_n={prefix:"vs",iconName:"chevron-right",icon:[512,512,[],"f000","M322.304 256.768 182.88 117.344l19.776 -19.84L352 246.912v19.776L202.656 416l-19.776 -19.808 139.424 -139.424z"]},Vn={prefix:"vs",iconName:"circle-large-outline",icon:[512,512,[],"f000","M306.816 70.88A185.856 185.856 0 0 0 256 64c-17.728 0 -34.624 2.336 -50.816 6.88l-0.192 0.064c-16.448 4.512 -31.68 10.944 -45.824 19.232A196.992 196.992 0 0 0 90.24 159.36l-0.064 0.128A190.944 190.944 0 0 0 70.72 205.12 191.552 191.552 0 0 0 64 256c0 17.76 2.24 34.72 6.72 50.912a193.6 193.6 0 0 0 49.536 84.832c11.84 11.68 24.768 21.664 38.912 30.08a195.2 195.2 0 0 0 45.92 19.488A192.64 192.64 0 0 0 256 448c17.76 0 34.72 -2.24 50.912 -6.72 16.48 -4.64 31.68 -11.136 45.632 -19.424l0.128 -0.064a197.12 197.12 0 0 0 69.152 -68.96 187.2 187.2 0 0 0 19.2 -45.824l0.096 -0.192A185.824 185.824 0 0 0 448 256c0 -17.728 -2.304 -34.624 -6.88 -50.816l-0.064 -0.192a184.704 184.704 0 0 0 -19.2 -45.536l-0.064 -0.128a188.8 188.8 0 0 0 -30.144 -38.72l-0.256 -0.256a188.864 188.864 0 0 0 -38.72 -30.144l-0.128 -0.064a184.704 184.704 0 0 0 -45.536 -19.2l-0.192 -0.064zm142.56 298.24a229.024 229.024 0 0 1 -80.512 80.256 222.912 222.912 0 0 1 -53.376 22.72A223.488 223.488 0 0 1 256 480a223.488 223.488 0 0 1 -59.52 -7.872 227.136 227.136 0 0 1 -53.568 -22.752 233.6 233.6 0 0 1 -45.28 -35.008 233.44 233.44 0 0 1 -35.008 -45.28 227.136 227.136 0 0 1 -22.72 -53.6A223.52 223.52 0 0 1 32 256c0 -20.576 2.624 -40.384 7.872 -59.52a222.976 222.976 0 0 1 22.752 -53.344 228.992 228.992 0 0 1 80.288 -80.512 220.64 220.64 0 0 1 53.6 -22.528A217.856 217.856 0 0 1 256 32a217.6 217.6 0 0 1 59.52 8.096 220.768 220.768 0 0 1 98.656 57.76 220.896 220.896 0 0 1 57.728 98.656C477.312 215.616 480 235.424 480 256s-2.688 40.384 -8.096 59.52a220.8 220.8 0 0 1 -22.528 53.568z"]},Un={prefix:"vs",iconName:"gripper",icon:[512,512,[],"f000","M160 96h64v64H160zm0 128h64v64H160zm0 128h64v64H160zm128 -256h64v64H288zm0 128h64v64H288zm0 128h64v64H288z"]},$n={prefix:"vs",iconName:"link",icon:[512,512,[],"f000","M140.8 96h98.72a108.8 108.8 0 0 1 108.8 108.8v6.56A108.8 108.8 0 0 1 239.52 320H224V288h15.52A76.8 76.8 0 0 0 316.16 211.52V204.8A76.8 76.8 0 0 0 239.68 128H140.8A76.8 76.8 0 0 0 64 204.8v6.56A76.608 76.608 0 0 0 128 286.72v32a108.8 108.8 0 0 1 -96 -107.2V204.8A108.96 108.96 0 0 1 140.8 96zM384 225.28v-32a108.8 108.8 0 0 1 96 107.52v6.56A108.96 108.96 0 0 1 371.36 416h-98.88A108.8 108.8 0 0 1 163.84 307.52V300.8A108.8 108.8 0 0 1 272.48 192H288v32h-15.52A76.8 76.8 0 0 0 195.84 300.8v6.56A76.8 76.8 0 0 0 272.48 384h98.88A76.8 76.8 0 0 0 448 307.52V300.8a76.608 76.608 0 0 0 -64 -75.52z"]},Ht={prefix:"vs",iconName:"loading",icon:[512,512,[],"f000","M445.344 224A192.064 192.064 0 0 0 66.656 224H34.272a224.064 224.064 0 0 1 443.456 0h-32.384z"]},Hn={prefix:"vs",iconName:"search",icon:[512,512,[],"f000","M325.333 0a176 176 0 0 0 -131.84 292.693L21.333 488.107l23.893 21.333 171.733 -194.56A176.021 176.021 0 1 0 325.333 0.213V0zm0 320a144 144 0 1 1 0 -288 144 144 0 0 1 0 288z"]},Bn={prefix:"vs",iconName:"triangle-down",icon:[512,512,[],"f000","M64 177.92 77.216 160h358.208l12.576 17.28L267.936 352h-26.464L64 177.92z"]},Wn={prefix:"vs",iconName:"warning",icon:[512,512,[],"f000","M241.92 32h28.16l209.28 392.32 -14.08 23.68H46.08L32 424.32 241.92 32zM256 72.96 72.96 416H438.4L256 72.96zM276 384v-32h-40v32h40zm-40 -64V192h40v128h-40z"]},qn={prefix:"dh",iconName:"exclamation",icon:[512,512,[],"f000","M275.2 384v-32H236.8v32h38.4zm-38.4 -64V128h38.4v192H236.8z"]},Kn={prefix:"dh",iconName:"graph-line-down",icon:[512,512,[],"f000","M64 416V0H32v432l16 16H480v-32zm67.2 -291.2 -22.4 22.4 108.8 112 70.4 -64 108.8 124.8H320v32h112l16 -16V224h-32v70.4L288 150.4l-70.4 64z"]},Bt={prefix:"dh",iconName:"sort",icon:[512,512,[],"f000","m128 224 -12.8 -25.6 128 -118.4h25.6l128 118.4 -12.8 25.6H128zm0 64 -12.8 25.6 128 118.4h25.6l128 -118.4L384 288H128z"]},zn={prefix:"dh",iconName:"warning-filled",icon:[512,512,[],"f000","M268.8 32h-25.6L32 425.6l12.8 22.4h419.2l12.8 -22.4L268.8 32zm6.4 352H236.8v-32h38.4v32zm0 -64H236.8V192h38.4v128z"]};class W{static isValid(t){return!0}static isSameFormat(t,n){throw new Error("isSameFormat not implemented")}static makeFormat(t,n,s){return{label:t,formatString:n,type:s}}format(t,n){return""}}W.TYPE_GLOBAL="type-global";W.TYPE_CONTEXT_PRESET="type-context-preset";W.TYPE_CONTEXT_CUSTOM="type-context-custom";class Gn extends W{format(t){switch(t){case 1:case!0:return"true";case 0:case!1:return"false";default:return""}}}class jn extends W{format(t){return String.fromCharCode(t)}}const{dh:u}=globalThis,je=d.exports.shape({name:d.exports.string.isRequired,type:d.exports.string.isRequired,description:d.exports.string,constituentType:d.exports.string}),Wt=d.exports.shape({not:d.exports.func.isRequired,and:d.exports.func.isRequired,or:d.exports.func.isRequired}),Xn=d.exports.shape({asc:d.exports.func.isRequired,desc:d.exports.func.isRequired,abs:d.exports.func.isRequired,column:je.isRequired,direction:d.exports.string.isRequired,isAbs:d.exports.bool.isRequired}),Zn=d.exports.shape({columns:d.exports.arrayOf(je).isRequired,customColumns:d.exports.arrayOf(d.exports.string).isRequired,filter:d.exports.arrayOf(Wt),addEventListener:d.exports.func.isRequired,removeEventListener:d.exports.func.isRequired,size:d.exports.number.isRequired,sort:d.exports.arrayOf(d.exports.any),copy:d.exports.func.isRequired,applyFilter:d.exports.func.isRequired,applySort:d.exports.func.isRequired,applyCustomColumns:d.exports.func.isRequired,description:d.exports.string}),Qn=d.exports.shape({columns:d.exports.arrayOf(je),filter:d.exports.arrayOf(d.exports.any),isExpanded:d.exports.func.isRequired,saveExpandedState:d.exports.func.isRequired,addEventListener:d.exports.func.isRequired,removeEventListener:d.exports.func.isRequired,size:d.exports.number.isRequired,sort:d.exports.arrayOf(d.exports.any),applyFilter:d.exports.func.isRequired,applySort:d.exports.func.isRequired}),qe=d.exports.shape({name:d.exports.string.isRequired,type:d.exports.string.isRequired}),Jn=d.exports.shape({created:d.exports.arrayOf(qe).isRequired,updated:d.exports.arrayOf(qe).isRequired,removed:d.exports.arrayOf(qe).isRequired}),Yn=d.exports.shape({groupingColumns:d.exports.arrayOf(d.exports.string),aggregations:d.exports.shape({}),includeConstituents:d.exports.bool,includeOriginalColumns:d.exports.bool,includeDescriptions:d.exports.bool}),es=d.exports.shape({addEventListener:d.exports.func.isRequired,removeEventListener:d.exports.func.isRequired,onLogMessage:d.exports.func,getTable:d.exports.func.isRequired,runCode:d.exports.func.isRequired});Object.freeze({Column:je,FilterCondition:Wt,IdeSession:es,RollupConfig:Yn,Sort:Xn,Table:Zn,TreeTable:Qn,VariableChanges:Jn,VariableDefinition:qe});const ts=-1,qt=0,Kt=1,ht=2,zt=3,Gt=4;Object.freeze({SILENT:ts,ERROR:qt,WARN:Kt,INFO:ht,DEBUG:zt,DEBUG2:Gt});const ee=()=>{};class Ct{constructor(t,n){this.name=t,this.prefix=t!=null?`[${t}]`:"",this.error=ee,this.warn=ee,this.log=ee,this.info=ee,this.debug=ee,this.debug2=ee,this.level=n,this.setLogLevel(n)}setLogLevel(t){if(!Number.isFinite(t)){console.warn(`Expected a number for log level. Received: ${t}. Ignoring`);return}this.level=t,this.error=t>=qt?console.error.bind(console,this.prefix):ee,this.warn=t>=Kt?console.warn.bind(console,this.prefix):ee,this.log=t>=ht?console.log.bind(console,this.prefix):ee,this.info=this.log,this.debug=t>=zt?console.debug.bind(console,this.prefix):ee,this.debug2=t>=Gt?console.debug.bind(console,this.prefix):ee}}class ns extends Ct{constructor(t=ht){super(null,t),this.modules={}}module(t){return this.modules[t]==null&&(this.modules[t]=new Ct(t,this.level)),this.modules[t]}setLogLevel(t){if(super.setLogLevel(t),this.modules==null)return;const n=Object.keys(this.modules);for(let s=0;s<n.length;s+=1)this.modules[n[s]].setLogLevel(t)}}const H=new ns,xt=H.module("DateTimeColumnFormatter"),Te=class extends W{constructor({timeZone:e="",showTimeZone:t=!0,showTSeparator:n=!1,defaultDateTimeFormatString:s=Te.DEFAULT_DATETIME_FORMAT_STRING}={}){super();const o=e||Te.DEFAULT_TIME_ZONE_ID;try{this.dhTimeZone=u.i18n.TimeZone.getTimeZone(o)}catch{xt.error("Unsupported time zone id",o),this.dhTimeZone=u.i18n.TimeZone.getTimeZone(Te.DEFAULT_TIME_ZONE_ID)}this.defaultDateTimeFormatString=s,this.showTimeZone=t,this.showTSeparator=n,this.formatStringMap=Te.makeFormatStringMap(t,n)}static isValid(e){try{return u.i18n.DateTimeFormat.format(e.formatString,new Date),!0}catch{return!1}}static makeFormat(e,t,n=W.TYPE_CONTEXT_PRESET){return{label:e,formatString:t,type:n}}static isSameFormat(e,t){return e===t||e!==null&&t!==null&&e.type===t.type&&e.formatString===t.formatString}static makeGlobalFormatStringMap(e,t){const n=t?"'T'":" ",s=e?" z":"";return new Map([["yyyy-MM-dd HH:mm:ss",`yyyy-MM-dd${n}HH:mm:ss${s}`],["yyyy-MM-dd HH:mm:ss.SSS",`yyyy-MM-dd${n}HH:mm:ss.SSS${s}`],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS",`yyyy-MM-dd${n}HH:mm:ss.SSSSSSSSS${s}`]])}static getGlobalFormats(e,t){return[...Te.makeGlobalFormatStringMap(e,t).keys()]}static makeFormatStringMap(e,t){const n=t!==void 0&&t?"'T'":" ",s=e!==void 0&&e?" z":"";return new Map([["yyyy-MM-dd",`yyyy-MM-dd${s}`],["MM-dd-yyyy",`MM-dd-yyyy${s}`],["HH:mm:ss",`HH:mm:ss${s}`],["HH:mm:ss.SSS",`HH:mm:ss.SSS${s}`],["HH:mm:ss.SSSSSSSSS",`HH:mm:ss.SSSSSSSSS${s}`],["yyyy-MM-dd HH:mm:ss",`yyyy-MM-dd${n}HH:mm:ss${s}`],["yyyy-MM-dd HH:mm:ss.SSS",`yyyy-MM-dd${n}HH:mm:ss.SSS${s}`],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS",`yyyy-MM-dd${n}HH:mm:ss.SSSSSSSSS${s}`]])}static getFormats(e,t){return[...Te.makeFormatStringMap(e,t).keys()]}getEffectiveFormatString(e){var t;return(t=this.formatStringMap.get(e))!=null?t:e}format(e,t){const n=t&&t.formatString||this.defaultDateTimeFormatString,s=this.getEffectiveFormatString(n);try{return u.i18n.DateTimeFormat.format(s,e,this.dhTimeZone)}catch{xt.error("Invalid format arguments")}return""}};let pt=Te;pt.DEFAULT_DATETIME_FORMAT_STRING="yyyy-MM-dd HH:mm:ss.SSS";pt.DEFAULT_TIME_ZONE_ID="America/New_York";const ss=H.module("DecimalColumnFormatter"),se=class extends W{constructor({defaultFormatString:e=se.DEFAULT_FORMAT_STRING}={}){super(),this.defaultFormatString=e}static isValid(e){try{return u.i18n.NumberFormat.format(e.formatString,0),!0}catch{return!1}}static makeFormat(e,t,n=W.TYPE_CONTEXT_PRESET,s){return{label:e,type:n,formatString:t,multiplier:s}}static makePresetFormat(e,t="",n){return se.makeFormat(e,t,W.TYPE_CONTEXT_PRESET,n)}static makeCustomFormat(e="",t){return se.makeFormat("Custom Format",e,W.TYPE_CONTEXT_CUSTOM,t)}static isSameFormat(e,t){return e===t||e!=null&&t!=null&&e.type===t.type&&e.formatString===t.formatString&&e.multiplier===t.multiplier}format(e,t){const n=t&&t.formatString||this.defaultFormatString,s=t&&t.multiplier!==void 0&&t.multiplier!==0?e*t.multiplier:e;try{return u.i18n.NumberFormat.format(n,s)}catch{ss.error("Invalid format arguments")}return""}};let pe=se;pe.DEFAULT_FORMAT_STRING="###,##0.0000";pe.FORMAT_PERCENT=se.makePresetFormat("Percent","##0.00%");pe.FORMAT_BASIS_POINTS=se.makePresetFormat("Basis Points","###,##0 bp",1e4);pe.FORMAT_MILLIONS=se.makePresetFormat("Millions","###,##0.000 mm",1e-6);pe.FORMAT_SCIENTIFIC_NOTATION=se.makePresetFormat("Scientific Notation","0.0000E0");pe.FORMAT_ROUND=se.makePresetFormat("Round","###,##0");pe.FORMAT_ROUND_TWO_DECIMALS=se.makePresetFormat("0.00","###,##0.00");pe.FORMAT_ROUND_FOUR_DECIMALS=se.makePresetFormat("0.0000","###,##0.0000");class is extends W{format(t){return`${t}`}}const os=H.module("IntegerColumnFormatter"),Ae=class extends W{constructor({defaultFormatString:e=Ae.DEFAULT_FORMAT_STRING}={}){super(),this.defaultFormatString=e}static isValid(e){try{return u.i18n.NumberFormat.format(e.formatString,0),!0}catch{return!1}}static makeFormat(e,t,n=W.TYPE_CONTEXT_PRESET,s){return{label:e,type:n,formatString:t,multiplier:s}}static makePresetFormat(e,t="",n){return Ae.makeFormat(e,t,W.TYPE_CONTEXT_PRESET,n)}static makeCustomFormat(e="",t){return Ae.makeFormat("Custom Format",e,W.TYPE_CONTEXT_CUSTOM,t)}static isSameFormat(e,t){return e===t||e!=null&&t!=null&&e.type===t.type&&e.formatString===t.formatString&&e.multiplier===t.multiplier}format(e,t){const n=t&&t.formatString||this.defaultFormatString,s=t&&t.multiplier!==void 0&&t.multiplier!==0?e*t.multiplier:e;try{return u.i18n.NumberFormat.format(n,s)}catch{os.error("Invalid format arguments")}return""}};let Xe=Ae;Xe.DEFAULT_FORMAT_STRING="###,##0";Xe.FORMAT_MILLIONS=Ae.makePresetFormat("Millions","###,##0.000 mm",1e-6);Xe.FORMAT_SCIENTIFIC_NOTATION=Ae.makePresetFormat("Scientific Notation","0.0000E0");class rs extends W{format(t){return t}}const Q=class{static makeDateWrapper(e,t,n=0,s=1,o=0,i=0,r=0,a=0){if(!e)throw new Error("No timezone provided");const l=`${t}`.padStart(4,"0"),c=`${n+1}`.padStart(2,"0"),h=`${s}`.padStart(2,"0"),m=`${o}`.padStart(2,"0"),T=`${i}`.padStart(2,"0"),y=`${r}`.padStart(2,"0"),M=`${a}`.padStart(9,"0"),E=`${l}-${c}-${h} ${m}:${T}:${y}.${M}`;return u.i18n.DateTimeFormat.parse(Q.FULL_DATE_FORMAT,E,u.i18n.TimeZone.getTimeZone(e))}static getNextNanos(e){const t=parseInt(e,10),n="0".repeat(9-e.length),s=`${t+1}${n}`;return parseInt(s,10)}static getNextDate(e,t,n){let{year:s,month:o,date:i,hours:r,minutes:a,seconds:l,nanos:c}=t;if(e.nanos!=null){if(e.nanos.length===9)return null;c=Q.getNextNanos(e.nanos),c>999999999&&(l+=1,c=0)}else e.seconds!=null?l+=1:e.minutes!=null?a+=1:e.hours!=null?r+=1:e.date!=null?i+=1:e.month!=null?o+=1:s+=1;const h=new Date(s,o,i,r,a,l);return Q.makeDateWrapper(n,h.getFullYear(),h.getMonth(),h.getDate(),h.getHours(),h.getMinutes(),h.getSeconds(),c)}static parseMonth(e){const t=parseInt(e,10);if(!Number.isNaN(t))return t>=1&&t<=12?t-1:NaN;const n=e.trim().toLowerCase();if(n.length>=3){for(let s=0;s<Q.months.length;s+=1)if(Q.months[s].startsWith(n))return s}return NaN}static parseDateValues(e,t,n,s,o,i,r){const a=parseInt(e,10),l=t!=null?this.parseMonth(t):0,c=n!=null?parseInt(n,10):1,h=s!=null?parseInt(s,10):0,m=o!=null?parseInt(o,10):0,T=i!=null?parseInt(i,10):0,y=r!=null?parseInt(r.padEnd(9,"0"),10):0;return Number.isNaN(a)||Number.isNaN(l)||Number.isNaN(c)||Number.isNaN(h)||Number.isNaN(m)||Number.isNaN(T)||Number.isNaN(y)?null:{year:a,month:l,date:c,hours:h,minutes:m,seconds:T,nanos:y}}static parseDateTimeString(e){const n=/\s*(\d{4})([-./]([\da-z]+))?([-./](\d{1,2}))?([tT\s](\d{2})([:](\d{2}))?([:](\d{2}))?([.](\d{1,9}))?)?(.*)/.exec(e);if(n==null)throw new Error(`Unexpected date string: ${e}`);const[,s,,o,,i,,r,,a,,l,,c,h]=n;if(h!=null&&h.length>0)throw new Error(`Unexpected characters after date string '${e}': ${h}`);return{year:s,month:o,date:i,hours:r,minutes:a,seconds:l,nanos:c}}static parseDateRange(e,t){const n=e.trim().toLowerCase();if(n.length===0)throw new Error("Cannot parse date range from empty string");if(n==="null")return[null,null];if(n==="today"){const a=new Date(Date.now()),l=Q.makeDateWrapper(t,a.getFullYear(),a.getMonth(),a.getDate()),c=Q.makeDateWrapper(t,a.getFullYear(),a.getMonth(),a.getDate()+1);return[l,c]}if(n==="yesterday"){const a=new Date(Date.now()),l=Q.makeDateWrapper(t,a.getFullYear(),a.getMonth(),a.getDate()-1),c=Q.makeDateWrapper(t,a.getFullYear(),a.getMonth(),a.getDate());return[l,c]}if(n==="now"){const a=new Date(Date.now());return[u.DateWrapper.ofJsDate(a),null]}const s=Q.parseDateTimeString(n);if(s.year==null&&s.month==null&&s.date==null)throw new Error(`Unable to extract year, month, or day ${n}`);const o=Q.parseDateValues(s.year,s.month,s.date,s.hours,s.minutes,s.seconds,s.nanos);if(o==null)throw new Error(`Unable to extract date values from ${s}`);const i=Q.makeDateWrapper(t,o.year,o.month,o.date,o.hours,o.minutes,o.seconds,o.nanos),r=Q.getNextDate(s,o,t);return[i,r]}static getJsDate(e){return typeof e=="number"?new Date(e):e.asDate()}};let Ve=Q;Ve.FULL_DATE_FORMAT="yyyy-MM-dd HH:mm:ss.SSSSSSSSS";Ve.months=["january","february","march","april","may","june","july","august","september","october","november","december"];class Ue{}Ue.not="not";Ue.and="and";Ue.or="or";class f{}f.eq="eq";f.eqIgnoreCase="eqIgnoreCase";f.notEq="notEq";f.notEqIgnoreCase="notEqIgnoreCase";f.greaterThan="greaterThan";f.greaterThanOrEqualTo="greaterThanOrEqualTo";f.lessThan="lessThan";f.lessThanOrEqualTo="lessThanOrEqualTo";f.in="in";f.inIgnoreCase="inIgnoreCase";f.notIn="notIn";f.notInIgnoreCase="notInIgnoreCase";f.isTrue="isTrue";f.isFalse="isFalse";f.isNull="isNull";f.invoke="invoke";f.contains="contains";f.notContains="notContains";f.startsWith="startsWith";f.endsWith="endsWith";f.containsAny="containsAny";class st extends Error{constructor(){super(...arguments),this.isCanceled=!0}}class jt extends CustomEvent{constructor(t,n){super(t,n)}}class Xt extends Error{constructor(){super(...arguments),this.isTimeout=!0}}class rt{static makeCancelable(t,n){let s=!1,o;const i=new Promise((r,a)=>{Promise.resolve(t).then(l=>{s?(n&&n(l),a(new st)):(o=l,r(l))},l=>a(s?new st:l))});return i.cancel=()=>{s=!0,o!=null&&n&&n(o)},i}static isCanceled(t){return t instanceof st}static isTimedOut(t){return t instanceof Xt}}function Le(e){if(e==null)throw new Error("Value is null or undefined")}class le{static isValidRange(t){return t!=null&&t.length===2&&Number.isInteger(t[0])&&Number.isInteger(t[1])&&t[0]<=t[1]}static validateRange(t){if(!le.isValidRange(t))throw new Error(`Invalid range! ${t}`)}static isSelected(t,n){for(let s=0;s<t.length;s+=1){const o=t[s],i=o[0],r=o[1];if(i<=n&&n<=r)return!0}return!1}static selectRange(t,n){let[s,o]=n;const i=[...t];for(let r=i.length-1;r>=0;r-=1){const a=i[r],l=a[0],c=a[1];if(l<=s&&o<=c)return i;s<=c&&l<=o&&(s=Math.min(s,l),o=Math.max(o,c),i.splice(r,1))}return i.push([s,o]),i}static deselectRange(t,n){const[s,o]=n,i=[...t];for(let r=i.length-1;r>=0;r-=1){const a=i[r],l=a[0],c=a[1];if(!(o<l||c<s))if(l<s&&o<c){i[r]=[l,s-1],i.splice(r+1,0,[o+1,c]);break}else s<=l&&c<=o?i.splice(r,1):l<s?i[r]=[l,s-1]:i[r]=[o+1,c]}return i}static count(t){return t.reduce((n,s)=>n+(s[1]-s[0]+1),0)}}class as{static join(t,n="and"){if(t==null||t.length===0)return"";if(t.length===1)return t[0];if(t.length===2)return`${t[0]} ${n} ${t[1]}`;const s=t.slice(0,t.length-1).join(", "),o=t[t.length-1];return`${s}, ${n} ${o}`}static toLower(t,n=!0){if(t==null){if(n)return"";throw new Error("Null string passed in to TextUtils.toLower")}return t.toLowerCase()}static sort(t,n,s=!0){return t<n?s?-1:1:t>n?s?1:-1:0}}const Zt=class{static formatElapsedTime(e){if(typeof e!="number"||!Number.isInteger(e))throw new Error(`${e} is not a number that can be expressed as a formatted time`);const t=Math.floor(e/3600),n=Math.floor(e%3600/60),s=e%60;return`${t>0?`${t}h `:""}${n>0||t>0?`${n}m `:""}${e>=60?`${s}s`.padStart(3,"0"):`${s}s`}`}static formatTime(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new Error(`${e} is not a number that can be expressed as a formatted time`);const t=String(Math.floor(e/(60*60))).padStart(2,"0"),n=e%(60*60),s=String(Math.floor(n/60)).padStart(2,"0"),o=n%60,i=String(Math.ceil(o)).padStart(2,"0");return`${t}:${s}:${i}`}static isTimeString(e){return new RegExp(Zt.TIME_PATTERN).test(e)}static parseTime(e){if(e==null||typeof e!="string")throw new Error(`${e} is not a valid string`);const t=e.split(":");if(t.length!==3)throw new Error(`${e} is not a time string that can be parsed`);return Number(t[0])*60*60+Number(t[1])*60+Number(t[2])}};let Ie=Zt;Ie.TIME_PATTERN="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]";Ie.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\xB10 No DST",value:"UTC"},{label:"London UTC\xB10",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\u22125",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 ue=H.module("TableUtils"),g=class{static getSortIndex(e,t){var n;for(let s=0;s<e.length;s+=1)if(((n=e[s].column)==null?void 0:n.index)===t)return s;return null}static getSortForColumn(e,t){const n=g.getSortIndex(e,t);return n!=null?e[n]:null}static getFilterText(e){return e?e.toString():null}static getFilterTypes(e){return g.isBooleanType(e)?[f.isTrue,f.isFalse,f.isNull]:g.isCharType(e)||g.isNumberType(e)||g.isDateType(e)?[f.eq,f.notEq,f.greaterThan,f.greaterThanOrEqualTo,f.lessThan,f.lessThanOrEqualTo]:g.isTextType(e)?[f.eq,f.eqIgnoreCase,f.notEq,f.notEqIgnoreCase,f.contains,f.notContains,f.startsWith,f.endsWith]:[]}static getNextSort(e,t,n){if(e==null||n<0||n>=e.length)return null;const s=g.getSortForColumn(t,n);return s===null?e[n].sort().asc():s.direction===g.sortDirection.ascending?s.desc():null}static makeColumnSort(e,t,n,s){if(e==null||t<0||t>=e.length||n===g.sortDirection.none)return null;let o=e[t].sort();switch(n){case g.sortDirection.ascending:o=o.asc();break;case g.sortDirection.descending:o=o.desc();break}return s&&(o=o.abs()),o}static toggleSortForColumn(e,t,n,s=!1){if(n<0||n>=t.length)return[];const o=g.getNextSort(t,e,n);return g.setSortForColumn(e,n,o,s)}static sortColumn(e,t,n,s,o,i){if(e==null||n<0||n>=t.length)return[];const r=g.makeColumnSort(t,n,s,o);return g.setSortForColumn(e,n,r,i)}static setSortForColumn(e,t,n,s=!1){const o=g.getSortIndex(e,t);let i=[];return s&&(i=i.concat(e.filter(({direction:r})=>r!==g.sortDirection.reverse)),o!==null&&i.splice(o,1)),n!==null&&i.push(n),i}static getNormalizedType(e){switch(e){case"boolean":case"java.lang.Boolean":case g.dataType.BOOLEAN:return g.dataType.BOOLEAN;case"char":case"java.lang.Character":case g.dataType.CHAR:return g.dataType.CHAR;case"java.lang.String":case g.dataType.STRING:return g.dataType.STRING;case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":case g.dataType.DATETIME:return g.dataType.DATETIME;case"double":case"java.lang.Double":case"float":case"java.lang.Float":case"java.math.BigDecimal":case g.dataType.DECIMAL:return g.dataType.DECIMAL;case"int":case"java.lang.Integer":case"long":case"java.lang.Long":case"short":case"java.lang.Short":case"byte":case"java.lang.Byte":case"java.math.BigInteger":case g.dataType.INT:return g.dataType.INT;default:return g.dataType.UNKNOWN}}static isLongType(e){switch(e){case"long":case"java.lang.Long":return!0;default:return!1}}static isDateType(e){switch(e){case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":return!0;default:return!1}}static isNumberType(e){return g.isIntegerType(e)||g.isDecimalType(e)}static isIntegerType(e){switch(e){case"int":case"java.lang.Integer":case"java.math.BigInteger":case"long":case"java.lang.Long":case"short":case"java.lang.Short":case"byte":case"java.lang.Byte":return!0;default:return!1}}static isDecimalType(e){switch(e){case"double":case"java.lang.Double":case"java.math.BigDecimal":case"float":case"java.lang.Float":return!0;default:return!1}}static isBooleanType(e){switch(e){case"boolean":case"java.lang.Boolean":return!0;default:return!1}}static isCharType(e){switch(e){case"char":case"java.lang.Character":return!0;default:return!1}}static isStringType(e){switch(e){case"java.lang.String":return!0;default:return!1}}static isTextType(e){return this.isStringType(e)||this.isCharType(e)}static getBaseType(e){return e.split("[]")[0]}static isCompatibleType(e,t){return g.getNormalizedType(e)===g.getNormalizedType(t)}static makeQuickFilter(e,t,n){const s=t.split("||");let o=null;for(let i=0;i<s.length;i+=1){const a=s[i].split("&&");let l=null;for(let c=0;c<a.length;c+=1){const h=a[c].trim();if(h.length>0){const m=g.makeQuickFilterFromComponent(e,h,n);if(m)l?l=l.and(m):l=m;else throw new Error(`Unable to parse quick filter from text ${t}`)}}o&&l?o=o.or(l):o=l}return o}static makeQuickFilterFromComponent(e,t,n){const{type:s}=e;return g.isNumberType(s)?this.makeQuickNumberFilter(e,t):g.isBooleanType(s)?this.makeQuickBooleanFilter(e,t):n!=null&&g.isDateType(s)?this.makeQuickDateFilter(e,t,n):g.isCharType(s)?this.makeQuickCharFilter(e,t):this.makeQuickTextFilter(e,t)}static makeQuickNumberFilter(e,t){if(t==null)return null;const n=e.filter();let s=null;const i=/\s*(>=|<=|=>|=<|>|<|!=|=|!)?(\s*-\s*)?(\s*\d*(?:,\d{3})*(?:\.\d*)?\s*)?(null|nan|infinity|inf|\u221E)?(.*)/i.exec(t);let r=null,a=null,l=null,c=null,h=null;if(i!==null&&i.length>3&&([,r,a,l,c,h]=i),h!=null&&h.trim().length>0)return null;if(r==null&&(r="="),c!=null){if(!(r==="="||r==="!"||r==="!="))return null;switch(c=c.trim().toLowerCase(),c){case"null":s=n.isNull();break;case"nan":s=u.FilterCondition.invoke("isNaN",n);break;case"infinity":case"inf":case"\u221E":a!=null?s=u.FilterCondition.invoke("isInf",n).and(n.lessThan(u.FilterValue.ofNumber(0))):s=u.FilterCondition.invoke("isInf",n).and(n.greaterThan(u.FilterValue.ofNumber(0)));break}return s!==null&&(r==="!"||r==="!=")&&(s=s.not()),s}if(l==null)return null;if(l=g.removeCommas(l),g.isLongType(e.type))try{l=u.FilterValue.ofNumber(u.LongWrapper.ofString(`${a!=null?"-":""}${l}`))}catch(m){return ue.warn("Unable to create long filter",m),null}else{if(l=parseFloat(l),l==null||Number.isNaN(l))return null;l=u.FilterValue.ofNumber(a!=null?0-l:l)}return s=e.filter(),g.makeRangeFilterWithOperation(s,r,l)}static makeQuickTextFilter(e,t){if(t==null)return null;const n=`${t}`.trim(),o=/^(!~|!=|~|=|!)?(.*)/.exec(n);let i=null,r=null;if(o!==null&&o.length>2&&([,i,r]=o,r!=null&&(r=r.trim())),r==null||r.length===0)return null;i==null&&(i="=");const a=e.filter();if(r.toLowerCase()==="null")switch(i){case"=":return a.isNull();case"!=":case"!":return a.isNull().not();default:return null}let l=null,c=null;switch(r.startsWith("*")?(l="*",r=r.substring(1)):r.endsWith("*")&&!r.endsWith("\\*")&&(c="*",r=r.substring(0,r.length-1)),r=r.replace("\\",""),i){case"~":return a.isNull().not().and(a.invoke("matches",u.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E.*`)));case"!~":return a.isNull().or(a.invoke("matches",u.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E.*`)).not());case"!=":return l==="*"?a.isNull().or(a.invoke("matches",u.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E$`)).not()):c==="*"?a.isNull().or(a.invoke("matches",u.FilterValue.ofString(`(?s)(?i)^\\Q${r}\\E.*`)).not()):a.notEqIgnoreCase(u.FilterValue.ofString(r.toLowerCase()));case"=":return l==="*"?a.isNull().not().and(a.invoke("matches",u.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E$`))):c==="*"?a.isNull().not().and(a.invoke("matches",u.FilterValue.ofString(`(?s)(?i)^\\Q${r}\\E.*`))):a.eqIgnoreCase(u.FilterValue.ofString(r.toLowerCase()))}return null}static makeQuickBooleanFilter(e,t){if(t==null)return null;const s=/^(!=|=|!)?(.*)/.exec(`${t}`.trim());if(s===null)return null;const[,o,i]=s,r=o==="!"||o==="!=",a=i.trim().toLowerCase();let l=e.filter();try{const c=g.makeBooleanValue(a);return c!=null&&c?l=l.isTrue():c===null?l=l.isNull():l=l.isFalse(),r?l.not():l}catch{return null}}static makeQuickDateFilter(e,t,n){const s=t.trim(),i=/\s*(>=|<=|=>|=<|>|<|!=|!|=)?(.*)/.exec(s);if(i==null||i.length<=2)throw new Error(`Unable to parse date filter: ${t}`);let r=null,a=null;[,r,a]=i;let l=f.eq;switch(r){case"<":l=f.lessThan;break;case"<=":case"=<":l=f.lessThanOrEqualTo;break;case">":l=f.greaterThan;break;case">=":case"=>":l=f.greaterThanOrEqualTo;break;case"!=":case"!":l=f.notEq;break;case"=":case"==":default:l=f.eq;break}return g.makeQuickDateFilterWithOperation(e,a,l,n)}static makeQuickDateFilterWithOperation(e,t,n=f.eq,s){if(e==null)throw new Error("Column is null");const[o,i]=Ve.parseDateRange(t,s),r=o!=null?u.FilterValue.ofNumber(o):null,a=i!=null?u.FilterValue.ofNumber(i):null,l=e.filter();if(r==null)return n===f.notEq?l.isNull().not():l.isNull();switch(n){case f.eq:{if(a!=null){const c=l.greaterThanOrEqualTo(r),h=l.lessThan(a);return c.and(h)}return l.eq(r)}case f.lessThan:return l.lessThan(r);case f.lessThanOrEqualTo:return a!=null?l.lessThan(a):l.lessThanOrEqualTo(r);case f.greaterThan:return a!=null?l.greaterThanOrEqualTo(a):l.greaterThan(r);case f.greaterThanOrEqualTo:return l.greaterThanOrEqualTo(r);case f.notEq:{if(a!=null){const c=l.lessThan(r),h=l.greaterThanOrEqualTo(a);return c.or(h)}return l.notEq(r)}default:throw new Error(`Invalid operator: ${n}`)}}static quoteValue(e){return e.length>=2&&(e.charAt(0)==='"'&&e.charAt(e.length-1)==='"'||e.charAt(0)==="'"&&e.charAt(e.length-1)==="'")?e:`"${e}"`}static isRangeOperation(e){switch(e){case"<":case"<=":case"=<":case">":case">=":case"=>":return!0;default:return!1}}static makeQuickCharFilter(e,t){if(t==null)return null;const n=`${t}`.trim(),o=/^(>=|<=|=>|=<|>|<|!=|=|!)?(null|"."|'.'|.)?(.*)/.exec(n);let i=null,r=null,a=null;if(o!==null&&o.length>3&&([,i,r,a]=o),a!=null&&a.trim().length>0||r==null||r.length===0)return null;i==null&&(i="=");const l=e.filter();if(r.toLowerCase()==="null")switch(i){case"=":return l.isNull();case"!=":case"!":return l.isNull().not();default:return null}const c=u.FilterValue.ofString(g.isRangeOperation(i)?g.quoteValue(r):r);return g.makeRangeFilterWithOperation(l,i,c)}static makeRangeFilterWithOperation(e,t,n){switch(t){case"=":return e.eq(n);case"<":return e.lessThan(n);case"<=":case"=<":return e.lessThanOrEqualTo(n);case">":return e.greaterThan(n);case">=":case"=>":return e.greaterThanOrEqualTo(n);case"!=":case"!":return e.notEq(n);default:return null}}static makeCancelableTablePromise(e){return rt.makeCancelable(e,t=>{t.close()})}static makeCancelableTableEventPromise(e,t,n=0,s=null){let o,i,r=!0;const a=new Promise((l,c)=>{i=setTimeout(()=>{o(),r=!1,c(new Xt(`Event "${t}" timed out.`))},n),o=e.addEventListener(t,h=>{if(s!=null&&!s(h)){ue.debug2("Event triggered, but matcher returned false.");return}ue.debug2("Event triggered, resolving."),o(),clearTimeout(i),r=!1,l(h)})});return a.cancel=()=>{if(r){ue.debug2("Pending promise cleanup."),o(),clearTimeout(i),r=!1;return}ue.debug2("Ignoring non-pending promise cancel.")},a}static makeAdvancedFilter(e,t,n){const{filterItems:s,filterOperators:o,invertSelection:i,selectedValues:r}=t;let a=null;for(let c=0;c<s.length;c+=1){const h=s[c],{selectedType:m,value:T}=h;if(m!=null&&m.length>0&&T!=null&&T.length>0)try{const y=g.makeAdvancedValueFilter(e,m,T,n);if(y!=null){if(c===0)a=y;else if(a!==null&&c-1<o.length){const M=o[c-1];if(M===Ue.and)a=a.and(y);else if(M===Ue.or)a=a.or(y);else{ue.error("Unexpected filter operator",M,y),a=null;break}}}else ue.debug2("Empty filter ignored for",m,T)}catch(y){ue.error("Unable to create filter",y),a=null;break}}const l=g.makeSelectValueFilter(e,r,i);return l!=null&&(a!=null?a=a.and(l):a=l),a}static removeCommas(e){return e.replace(/[\s|,]/g,"")}static makeFilterValue(e,t){const n=g.getBaseType(e);return g.isTextType(n)?u.FilterValue.ofString(t):g.isLongType(n)?u.FilterValue.ofNumber(u.LongWrapper.ofString(g.removeCommas(t))):u.FilterValue.ofNumber(g.removeCommas(t))}static makeFilterRawValue(e,t){return g.isTextType(e)?u.FilterValue.ofString(t):g.isBooleanType(e)?u.FilterValue.ofBoolean(t):u.FilterValue.ofNumber(t)}static makeValue(e,t,n){if(t==null||t==="null")return null;if(g.isTextType(e))return t;if(g.isLongType(e))return u.LongWrapper.ofString(g.removeCommas(t));if(g.isBooleanType(e))return g.makeBooleanValue(t,!0);if(g.isDateType(e)){const[s]=Ve.parseDateRange(t,n);return s}return g.isNumberType(e)?g.makeNumberValue(t):(ue.error("Unexpected column type",e),null)}static makeBooleanValue(e,t=!1){if(e===""&&t)return null;switch(e==null?void 0:e.toLowerCase()){case"null":return null;case"0":case"f":case"fa":case"fal":case"fals":case"false":case"n":case"no":return!1;case"1":case"t":case"tr":case"tru":case"true":case"y":case"ye":case"yes":return!0;default:throw new Error(`Invalid boolean '${e}'`)}}static makeNumberValue(e){if(e==null||e==="null"||e==="")return null;const t=e.toLowerCase().trim();if(t==="\u221E"||t==="infinity"||t==="inf")return Number.POSITIVE_INFINITY;if(t==="-\u221E"||t==="-infinity"||t==="-inf")return Number.NEGATIVE_INFINITY;const n=g.removeCommas(t);if(g.NUMBER_REGEX.test(n))return parseFloat(n);throw new Error(`Invalid number '${e}'`)}static getFilterOperatorString(e){switch(e){case f.eq:return"=";case f.notEq:return"!=";case f.greaterThan:return">";case f.greaterThanOrEqualTo:return">=";case f.lessThan:return"<";case f.lessThanOrEqualTo:return"<=";case f.contains:return"~";case f.notContains:return"!~";default:throw new Error(`Unexpected filter type ${e}`)}}static makeAdvancedValueFilter(e,t,n,s){if(g.isDateType(e.type))return g.makeQuickDateFilterWithOperation(e,n,t,s);if(g.isNumberType(e.type)||g.isCharType(e.type))return g.makeQuickFilter(e,`${g.getFilterOperatorString(t)}${n}`);const o=g.makeFilterValue(e.type,n),i=e.filter();switch(t){case f.eq:return i.eq(o);case f.eqIgnoreCase:return i.eqIgnoreCase(o);case f.notEq:return i.notEq(o);case f.notEqIgnoreCase:return i.notEqIgnoreCase(o);case f.greaterThan:return i.greaterThan(o);case f.greaterThanOrEqualTo:return i.greaterThanOrEqualTo(o);case f.lessThan:return i.lessThan(o);case f.lessThanOrEqualTo:return i.lessThanOrEqualTo(o);case f.isTrue:return i.isTrue();case f.isFalse:return i.isFalse();case f.isNull:return i.isNull();case f.contains:return i.isNull().not().and(i.invoke("matches",u.FilterValue.ofString(`(?s)(?i).*\\Q${n}\\E.*`)));case f.notContains:return i.isNull().or(i.invoke("matches",u.FilterValue.ofString(`(?s)(?i).*\\Q${n}\\E.*`)).not());case f.startsWith:return i.isNull().not().and(i.invoke("matches",u.FilterValue.ofString(`(?s)(?i)^\\Q${n}\\E.*`)));case f.endsWith:return i.isNull().not().and(i.invoke("matches",u.FilterValue.ofString(`(?s)(?i).*\\Q${n}\\E$`)));case f.in:case f.inIgnoreCase:case f.notIn:case f.notInIgnoreCase:case f.invoke:default:throw new Error(`Unexpected filter operation: ${t}`)}}static makeSelectValueFilter(e,t,n){if(t.length===0){if(n)return null;let i=null;g.isTextType(e.type)?i=u.FilterValue.ofString("a"):g.isBooleanType(e.type)?i=u.FilterValue.ofBoolean(!0):g.isDateType(e.type)?i=u.FilterValue.ofNumber(u.DateWrapper.ofJsDate(new Date)):i=u.FilterValue.ofNumber(0);const r=e.filter().eq(i),a=e.filter().notEq(i);return r.and(a)}const s=[];let o=!1;for(let i=0;i<t.length;i+=1){const r=t[i];r==null?o=!0:g.isTextType(e.type)?s.push(u.FilterValue.ofString(typeof r=="number"?String.fromCharCode(r):r)):g.isBooleanType(e.type)?s.push(u.FilterValue.ofBoolean(Boolean(r))):s.push(u.FilterValue.ofNumber(r))}return o?s.length>0?n?e.filter().isNull().not().and(e.filter().notIn(s)):e.filter().isNull().or(e.filter().in(s)):n?e.filter().isNull().not():e.filter().isNull():n?e.filter().notIn(s):e.filter().in(s)}static isTreeTable(e){return e!=null&&e.expand!==void 0&&e.collapse!==void 0}static sortColumns(e,t=!0){return[...e].sort((n,s)=>{const o=n.name.toUpperCase(),i=s.name.toUpperCase();return as.sort(o,i,t)})}};let K=g;K.dataType={BOOLEAN:"boolean",CHAR:"char",DATETIME:"datetime",DECIMAL:"decimal",INT:"int",STRING:"string",UNKNOWN:"unknown"};K.sortDirection={ascending:"ASC",descending:"DESC",reverse:"REVERSE",none:null};K.REVERSE_TYPE=Object.freeze({NONE:"none",PRE_SORT:"pre-sort",POST_SORT:"post-sort"});K.NUMBER_REGEX=/^-?\d+(\.\d+)?$/;class mt{static makeColumnFormatMap(t){return t==null?new Map:t.reduce((n,s)=>{const o=K.getNormalizedType(s.columnType);if(o===null)return n;n.has(o)||n.set(o,new Map);const i=n.get(o);return i==null||i.set(s.columnName,s.format),n},new Map)}static makeColumnFormattingRule(t,n,s){return{columnType:t,columnName:n,format:s}}constructor(t=[],n,s,o,i=!1){this.defaultColumnFormatter=new is,this.typeFormatterMap=new Map([[K.dataType.BOOLEAN,new Gn],[K.dataType.CHAR,new jn],[K.dataType.DATETIME,new pt(n)],[K.dataType.DECIMAL,new pe(s)],[K.dataType.INT,new Xe(o)],[K.dataType.STRING,new rs]]),this.columnFormatMap=mt.makeColumnFormatMap(t),this.truncateNumbersWithPound=i}getColumnFormatMapForType(t,n=!1){const s=K.getNormalizedType(t);if(s!==null)return n&&!this.columnFormatMap.has(s)&&this.columnFormatMap.set(s,new Map),this.columnFormatMap.get(s)}getColumnFormat(t,n){var o;const s=this.getColumnFormatMapForType(t);return(o=s==null?void 0:s.get(n))!=null?o:null}getColumnTypeFormatter(t){var o;const n=K.getNormalizedType(t);let s=this.defaultColumnFormatter;return n&&(s=(o=this.typeFormatterMap.get(n))!=null?o:s),s}getFormattedString(t,n,s="",o){if(t==null)return"";const i=this.getColumnTypeFormatter(n),r=o||this.getColumnFormat(n,s);return i.format(t,r!=null?r:void 0)}get timeZone(){var n;const t=this.typeFormatterMap.get(K.dataType.DATETIME);return(n=t==null?void 0:t.dhTimeZone)==null?void 0:n.id}}function ls(e){if(e&&e.formatter){const{formatter:t}=e;return t}}function cs(e){return{timeZone:e==null?void 0:e.timeZone,defaultDateTimeFormatString:e==null?void 0:e.defaultDateTimeFormat,showTimeZone:e==null?void 0:e.showTimeZone,showTSeparator:e==null?void 0:e.showTSeparator}}function us(e,t,n){const s=e.getColumnFormat(n,t);return s!=null&&(s.type===W.TYPE_CONTEXT_PRESET||s.type===W.TYPE_CONTEXT_CUSTOM)}const it={getColumnFormats:ls,getDateTimeFormatterOptions:cs,isCustomColumnFormatDefined:us};Ge.register([An,Fn,On,kn,Rn,Ln]);const ds=typeof nt=="function"?nt(Ge):nt.default(Ge),de=class{constructor(){this.listeners=[],this.isDownsamplingDisabled=!1}getData(){return[]}getDefaultTitle(){return""}getLayout(){return{}}getFilterColumnMap(){return new Map}isFilterRequired(){return!1}setFilter(e){}close(){}setFormatter(e){this.formatter=e}setDownsamplingDisabled(e){this.isDownsamplingDisabled=e}setDimensions(e){this.rect=e}setTitle(e){this.title=e}subscribe(e){this.listeners.push(e)}unsubscribe(e){this.listeners=this.listeners.filter(t=>t!==e)}fireEvent(e){for(let t=0;t<this.listeners.length;t+=1)this.listeners[t](e)}fireUpdate(e){this.fireEvent(new CustomEvent(de.EVENT_UPDATED,{detail:e}))}fireDisconnect(){this.fireEvent(new CustomEvent(de.EVENT_DISCONNECT))}fireReconnect(){this.fireEvent(new CustomEvent(de.EVENT_RECONNECT))}fireDownsampleStart(e){this.fireEvent(new CustomEvent(de.EVENT_DOWNSAMPLESTARTED,{detail:e}))}fireDownsampleFinish(e){this.fireEvent(new CustomEvent(de.EVENT_DOWNSAMPLEFINISHED,{detail:e}))}fireDownsampleFail(e){this.fireEvent(new CustomEvent(de.EVENT_DOWNSAMPLEFAILED,{detail:e}))}fireDownsampleNeeded(e){this.fireEvent(new CustomEvent(de.EVENT_DOWNSAMPLENEEDED,{detail:e}))}fireLoadFinished(){this.fireEvent(new CustomEvent(de.EVENT_LOADFINISHED))}};let z=de;z.EVENT_UPDATED="ChartModel.EVENT_UPDATED";z.EVENT_DISCONNECT="ChartModel.EVENT_DISCONNECT";z.EVENT_RECONNECT="ChartModel.EVENT_RECONNECT";z.EVENT_DOWNSAMPLESTARTED="ChartModel.EVENT_DOWNSAMPLESTARTED";z.EVENT_DOWNSAMPLEFINISHED="ChartModel.EVENT_DOWNSAMPLEFINISHED";z.EVENT_DOWNSAMPLEFAILED="ChartModel.EVENT_DOWNSAMPLEFAILED";z.EVENT_DOWNSAMPLENEEDED="ChartModel.EVENT_DOWNSAMPLENEEDED";z.EVENT_LOADFINISHED="ChartModel.EVENT_LOADFINISHED";const hs="#76d9e4 #9edc6f #fcd65b #aa9af4 #f37e3f #f95d84 #f0f0ee",ps="#403e41",ms="#5b5a5c",fs="#c0bfbf",gs="#4878ea",ys="rgba(91, 90, 92, 0.7)",j={"paper-bgcolor":"#2d2a2e","plot-bgcolor":"#322f33","title-color":"#f0f0ee",colorway:hs,gridcolor:ps,linecolor:ms,zerolinecolor:fs,activecolor:gs,rangebgcolor:ys,"area-color":"#76d9e4","trend-color":"#d5f0c1","line-color":"#9edc6f","error-band-line-color":"white","error-band-fill-color":"rgba(213, 240, 193, 0.1)","ohlc-increasing":"#9edc6f","ohlc-decreasing":"#f95d84"},ce=Object.freeze({paper_bgcolor:j["paper-bgcolor"],plot_bgcolor:j["plot-bgcolor"],title_color:j["title-color"],colorway:j.colorway,gridcolor:j.gridcolor,linecolor:j.linecolor,zerolinecolor:j.zerolinecolor,activecolor:j.activecolor,rangebgcolor:j.rangebgcolor,area_color:j["area-color"],trend_color:j["trend-color"],line_color:j["line-color"],error_band_line_color:j["error-band-line-color"],error_band_fill_color:j["error-band-fill-color"],ohlc_increasing:j["ohlc-increasing"],ohlc_decreasing:j["ohlc-decreasing"]}),He=H.module("ChartUtils"),fe=Object.freeze(u.calendar.DayOfWeek.values()),Dt="io.deephaven.time.DateTime",bs=36e5,Ss=1e6;function Ts(e){return e.asDate!==void 0}function Es(e){return e.asNumber!==void 0}function vt(e){return e.dhTimeZone!==void 0}function Ms(e){return e!=null&&e.range&&(e.autorange===!1||e.autorange===void 0)}const b=class{static getPlotlyChartType(e,t){switch(e){case u.plot.SeriesPlotStyle.SCATTER:return t?"scatter":"scattergl";case u.plot.SeriesPlotStyle.LINE:return"scatter";case u.plot.SeriesPlotStyle.BAR:case u.plot.SeriesPlotStyle.STACKED_BAR:return"bar";case u.plot.SeriesPlotStyle.PIE:return"pie";case u.plot.SeriesPlotStyle.TREEMAP:return"treemap";case u.plot.SeriesPlotStyle.HISTOGRAM:return"histogram";case u.plot.SeriesPlotStyle.OHLC:return"ohlc";default:return}}static getPlotlyChartMode(e){switch(e){case u.plot.SeriesPlotStyle.SCATTER:return"markers";case u.plot.SeriesPlotStyle.LINE:return"lines";default:return}}static getPlotlyProperty(e,t){switch(e){case u.plot.SeriesPlotStyle.PIE:switch(t){case u.plot.SourceType.X:return"labels";case u.plot.SourceType.Y:return"values"}break;case u.plot.SeriesPlotStyle.OHLC:switch(t){case u.plot.SourceType.TIME:return"x"}break;case u.plot.SeriesPlotStyle.TREEMAP:switch(t){case u.plot.SourceType.X:return"ids";case u.plot.SourceType.Y:return"values";case u.plot.SourceType.LABEL:return"labels";case u.plot.SourceType.PARENT:return"parents";case u.plot.SourceType.COLOR:return"marker.colors"}break}switch(t){case u.plot.SourceType.X:return"x";case u.plot.SourceType.Y:return"y";case u.plot.SourceType.Z:return"z";case u.plot.SourceType.X_LOW:return"xLow";case u.plot.SourceType.X_HIGH:return"xHigh";case u.plot.SourceType.Y_LOW:return"yLow";case u.plot.SourceType.Y_HIGH:return"yHigh";case u.plot.SourceType.TIME:return"time";case u.plot.SourceType.OPEN:return"open";case u.plot.SourceType.HIGH:return"high";case u.plot.SourceType.LOW:return"low";case u.plot.SourceType.CLOSE:return"close";case u.plot.SourceType.SHAPE:return"shape";case u.plot.SourceType.SIZE:return"size";case u.plot.SourceType.LABEL:return"label";case u.plot.SourceType.COLOR:return"color";case u.plot.SourceType.PARENT:return"parent";case u.plot.SourceType.HOVER_TEXT:return"hovertext";case u.plot.SourceType.TEXT:return"text";default:throw new Error(`Unrecognized source type: ${t}`)}}static getPlotlySeriesOrientation(e){var n,s;const{sources:t}=e;return t.length===2&&((s=(n=t[0])==null?void 0:n.axis)==null?void 0:s.type)===u.plot.AxisType.Y?b.ORIENTATION.HORIZONTAL:b.ORIENTATION.VERTICAL}static getPlotlyErrorBars(e,t,n){const s=n.map((i,r)=>i-e[r]),o=t.map((i,r)=>e[r]-i);return{type:"data",symmetric:!1,array:s,arrayminus:o}}static getPlotlyDateFormat(e,t,n){const s=n==null?void 0:n.replace("%","%%").replace(/S{9}/g,"%9f").replace(/S{8}/g,"%8f").replace(/S{7}/g,"%7f").replace(/S{6}/g,"%6f").replace(/S{5}/g,"%5f").replace(/S{4}/g,"%4f").replace(/S{3}/g,"%3f").replace(/S{2}/g,"%2f").replace(/S{1}/g,"%1f").replace(/y{4}/g,"%Y").replace(/y{2}/g,"%y").replace(/M{4}/g,"%B").replace(/M{3}/g,"%b").replace(/M{2}/g,"%m").replace(/M{1}/g,"%-m").replace(/E{4,}/g,"%A").replace(/E{1,}/g,"%a").replace(/d{2}/g,"%d").replace(/([^%]|^)d{1}/g,"$1%-d").replace(/H{2}/g,"%H").replace(/h{2}/g,"%I").replace(/h{1}/g,"%-I").replace(/m{2}/g,"%M").replace(/s{2}/g,"%S").replace("'T'","T").replace(" z","");let o;const i=e==null?void 0:e.getColumnTypeFormatter(t);return i!=null&&vt(i)&&i.dhTimeZone!=null&&i.showTimeZone&&(o=u.i18n.DateTimeFormat.format(" z",new Date,i.dhTimeZone)),{tickformat:s,ticksuffix:o,automargin:!0}}static convertNumberPrefix(e){return e.replace(/\u00A4\u00A4/g,"USD").replace(/\u00A4/g,"$")}static getPlotlyNumberFormat(e,t,n){if(!n)return null;const o=n.split(";")[0].match(/^([^#,0.]*)([#,]*)([0,]*)(\.?)(0*)(#*)(E?0*)(%?)(.*)/);Le(o);const[,i,r,a,,l,c,h,m,T]=o,y=a.replace(",","").length,E=r.indexOf(",")>=0||a.indexOf(",")>=0?",":"",A=h!=null&&h!==""?"e":"f",O=m!==""?m:A,x=l.length+c.length,k=`0${y}${E}.${x}${O}`,V=b.convertNumberPrefix(i),U=b.convertNumberPrefix(T);return{tickformat:k,tickprefix:V,ticksuffix:U,automargin:!0}}static getPlotlyAxisFormat(e,t=null){const{axis:n,columnType:s}=e,{formatPattern:o}=n;let i=null;return K.isDateType(s)?(i=b.getPlotlyDateFormat(t,s,o),i=b.addTickSpacing(i,n,!0)):K.isNumberType(s)&&(i=b.getPlotlyNumberFormat(t,s,o),i=b.addTickSpacing(i,n,!1)),n.formatType===u.plot.AxisFormatType.CATEGORY&&(i?i.type="category":i={type:"category",tickformat:void 0,ticksuffix:void 0}),i}static addTickSpacing(e,t,n){const{gapBetweenMajorTicks:s}=t;if(s>0){const o=e||{};let i=s;return n&&(i=s/Ss),t.log&&(i=Math.log(i)),o.tickmode="linear",o.dtick=i,o}return e}static getSourceForAxis(e,t){for(let n=0;n<e.series.length;n+=1){const s=e.series[n];for(let o=0;o<s.sources.length;o+=1){const i=s.sources[o];if(i.axis===t)return i}}return null}static getSeriesVisibility(e,t){return t!=null&&t.hiddenSeries!=null&&t.hiddenSeries.includes(e)?"legendonly":!0}static getHiddenLabels(e){return e!=null&&e.hiddenSeries?[...e.hiddenSeries]:[]}static makeSeriesData(e,t,n,s=b.ORIENTATION.VERTICAL){return{type:e,mode:t,name:n,orientation:s}}static makeSeriesDataFromSeries(e,t,n,s=ce){const{name:o,plotStyle:i,lineColor:r,shapeColor:a,sources:l}=e,c=l.some(M=>{var E;return(E=M.axis)==null?void 0:E.businessCalendar}),h=b.getChartType(i,c),m=b.getPlotlyChartMode(i),T=b.getPlotlySeriesOrientation(e),y=b.makeSeriesData(h,m,o,T);return b.addSourcesToSeriesData(y,i,l,t),b.addStylingToSeriesData(y,i,s,r,a,n),y}static addSourcesToSeriesData(e,t,n,s){const o=e;for(let i=0;i<n.length;i+=1){const r=n[i],{axis:a,type:l}=r,c=b.getPlotlyProperty(t,l);_t(o,c,[]);const h=a!=null?b.getAxisPropertyName(a.type):null;if(h!=null){const m=s.get(a.type);if(m){const T=m.indexOf(a),y=T>0?`${T+1}`:"";o[`${h}axis`]=`${h}${y}`}}}}static addStylingToSeriesData(e,t,n=ce,s=null,o=null,i=null){const r=e;r.marker={line:{}},r.line={width:1},t===u.plot.SeriesPlotStyle.AREA?r.fill="tozeroy":t===u.plot.SeriesPlotStyle.STACKED_AREA?r.stackgroup="stack":t===u.plot.SeriesPlotStyle.STEP?r.line.shape="hv":t===u.plot.SeriesPlotStyle.HISTOGRAM?(r.width=[],r.marker.line!==void 0&&Object.assign(r.marker.line,{color:n.paper_bgcolor,width:1})):t===u.plot.SeriesPlotStyle.OHLC?(r.increasing={line:{color:n.ohlc_increasing}},r.decreasing={line:{color:n.ohlc_decreasing}}):t===u.plot.SeriesPlotStyle.PIE?(r.textinfo="label+percent",r.outsidetextfont={color:n.title_color}):t===u.plot.SeriesPlotStyle.TREEMAP&&(r.hoverinfo="text",r.textinfo="label+text",r.tiling={packing:"squarify",pad:0},r.textposition="middle center",r.outsidetextfont={color:n.title_color}),s!=null&&(t===u.plot.SeriesPlotStyle.BAR?r.marker.color=s:r.line.color=s),o!=null&&(r.marker.color=o),i!=null&&t!==u.plot.SeriesPlotStyle.PIE&&(r.visible=i)}static getAxisFormats(e,t){const n=new Map,s={tickformat:null,ticksuffix:null},o=b.getAllAxes(e),i=b.groupArray(o,"type"),{charts:r}=e;for(let a=0;a<r.length;a+=1){const l=r[a];for(let c=0;c<l.series.length;c+=1){const h=l.series[c],{sources:m}=h,T=m.filter(y=>y.axis);for(let y=0;y<T.length;y+=1){const M=T[y],{axis:E}=M,{type:A}=E,O=i.get(A);Le(O);const x=O.indexOf(E),v=b.getAxisPropertyName(A);if(v!=null){const k=b.getAxisLayoutProperty(v,x);if(n.has(k))He.debug(`${k} already added.`);else{He.debug(`Adding ${k} to axisFormats.`);const V=b.getPlotlyAxisFormat(M,t);if(V===null)n.set(k,s);else{n.set(k,V);const{businessCalendar:U}=E;if(U!=null){const P=[],{businessPeriods:ie,businessDays:oe,holidays:re,timeZone:Se}=U,w=t==null?void 0:t.getColumnTypeFormatter(Dt);let I;vt(w)&&(I=w.dhTimeZone);const S=I?(Se.standardOffset-I.standardOffset)/60:0;re.length>0&&P.push(...b.createRangeBreakValuesFromHolidays(re,Se,I)),ie.forEach(F=>P.push({pattern:"hour",bounds:[b.periodToDecimal(F.close)+S,b.periodToDecimal(F.open)+S]})),oe.length<fe.length&&b.createBoundsFromDays(oe).forEach(F=>P.push({pattern:"day of week",bounds:F})),V.rangebreaks=P}if(n.size===l.axes.length)return n}}}}}}return n}static getChartType(e,t){switch(e){case u.plot.SeriesPlotStyle.HISTOGRAM:return"bar";default:return b.getPlotlyChartType(e,t)}}static getAxisPropertyName(e){switch(e){case u.plot.AxisType.X:return"x";case u.plot.AxisType.Y:return"y";default:return null}}static getAxisSide(e){switch(e){case u.plot.AxisPosition.BOTTOM:return"bottom";case u.plot.AxisPosition.TOP:return"top";case u.plot.AxisPosition.LEFT:return"left";case u.plot.AxisPosition.RIGHT:return"right";default:return}}static getAllAxes(e){return e.charts.reduce((t,n)=>[...t,...n.axes],[])}static getChartForSeries(e,t){const{charts:n}=e;for(let s=0;s<n.length;s+=1){const o=n[s];for(let i=0;i<o.series.length;i+=1)if(t===o.series[i])return o}return null}static getLayoutRanges(e){const t={},n=Object.keys(e).filter(s=>s.indexOf("axis")>=0);for(let s=0;s<n.length;s+=1){const o=n[s],i=e[o];Ms(i)&&(t[o]=[...i.range])}return t}static updateFigureAxes(e,t,n,s=0,o=0,i=ce){const r=e,a=b.getAllAxes(t);for(let l=0;l<t.charts.length;l+=1){const c=t.charts[l],h=n==null?void 0:n(c),m=b.getChartBounds(t,c,s,o);b.updateLayoutAxes(r,c.axes,a,s,o,m,h,i)}b.removeStaleAxes(r,a)}static getChartBounds(e,t,n=0,s=0){var v;const{cols:o,rows:i}=e,{column:r,colspan:a,row:l,rowspan:c}=t,h=r+a,m=l+c,T=1/o,y=1/i,M=b.AXIS_SIZE_PX/n,E=b.AXIS_SIZE_PX/s,A={left:r*T+(r>0?M/2:0),bottom:l*y+(l>0?E/2:0),top:m*y-(m<i?E/2:0),right:h*T-(h<o?M/2:0)};return((v=b.groupArray(t.axes,"position").get(u.plot.AxisPosition.RIGHT))!=null?v:[]).length>0&&(n>0?A.right-=(A.right-A.left)*Math.max(0,Math.min(b.LEGEND_WIDTH_PX/n,b.MAX_LEGEND_SIZE)):A.right-=(A.right-A.left)*b.DEFAULT_AXIS_SIZE),A}static updateLayoutAxes(e,t,n,s=0,o=0,i={left:0,top:0,right:1,bottom:1},r,a=ce){const l=s>0?Math.max(b.MIN_AXIS_SIZE,Math.min(b.AXIS_SIZE_PX/o,b.MAX_AXIS_SIZE)):b.DEFAULT_AXIS_SIZE,c=o>0?Math.max(b.MIN_AXIS_SIZE,Math.min(b.AXIS_SIZE_PX/s,b.MAX_AXIS_SIZE)):b.DEFAULT_AXIS_SIZE,h=e,m=b.groupArray(t,"position"),T=b.groupArray(t,"type"),y=[...T.keys()],M=b.groupArray(n,"type");for(let E=0;E<y.length;E+=1){const A=y[E],O=b.getAxisPropertyName(A);if(O!=null){const x=T.get(A),v=M.get(A),V=A===u.plot.AxisType.Y?o:s;Le(x),Le(v);for(let U=0;U<x.length;U+=1){const P=x[U],ie=v.indexOf(P),oe=b.getAxisLayoutProperty(O,ie);h[oe]==null&&(h[oe]=b.makeLayoutAxis(A,a));const re=h[oe];if(re!=null){b.updateLayoutAxis(re,P,U,m,l,c,i);const{range:Se,autorange:w}=re;if(r!=null&&Se!==void 0&&(w===void 0||w===!1)){const I=r(P),[S,F]=I(Se);He.debug("Setting downsample range",V,S,F),P.range(V,S,F)}else P.range(V)}}}}}static removeStaleAxes(e,t){const n=e,s=b.groupArray(t,"type"),o=[...s.keys()];for(let i=0;i<o.length;i+=1){const r=o[i],a=s.get(r);Le(a);let l=a.length;const c=b.getAxisPropertyName(r);if(c!=null){let h=b.getAxisLayoutProperty(c,l);for(;n[h]!=null;)delete n[h],l+=1,h=b.getAxisLayoutProperty(c,l)}}}static getAxisLayoutProperty(e,t){const n=t>0?`${t+1}`:"";return`${e!=null?e:""}axis${n}`}static updateLayoutAxis(e,t,n,s,o,i,r){var m,T,y;const l=t.type===u.plot.AxisType.Y?i:o,c=e,h=(m=t.label)!=null?m:"";if(c.title!==void 0&&typeof c.title!="string"?c.title.text=h:c.title={text:h},t.log&&(c.type="log"),c.side=b.getAxisSide(t.position),n>0){c.overlaying=(T=b.getAxisPropertyName(t.type))!=null?T:void 0;const M=(y=s.get(t.position))!=null?y:[],E=M.indexOf(t);E>0&&(c.anchor="free",t.position===u.plot.AxisPosition.RIGHT?c.position=r.right+(E-M.length+1)*l:t.position===u.plot.AxisPosition.TOP?c.position=r.top+(E-M.length+1)*l:t.position===u.plot.AxisPosition.BOTTOM?c.position=r.bottom+(M.length-E+1)*l:t.position===u.plot.AxisPosition.LEFT&&(c.position=r.left+(M.length-E+1)*l))}else if(t.type===u.plot.AxisType.X){const M=s.get(u.plot.AxisPosition.LEFT)||[],E=s.get(u.plot.AxisPosition.RIGHT)||[],A=Math.max(r.left,r.left+(M.length-1)*i),O=Math.min(r.right-(E.length-1)*i,r.right);c.domain=[A,O]}else if(t.type===u.plot.AxisType.Y){const M=s.get(u.plot.AxisPosition.BOTTOM)||[],E=s.get(u.plot.AxisPosition.TOP)||[],A=Math.max(r.bottom,r.bottom+(M.length-1)*o),O=Math.min(r.top-(E.length-1)*o,r.top);c.domain=[A,O]}}static periodToDecimal(e){const t=e.split(":");return Number(t[0])+Number(t[1])/60}static createBoundsFromDays(e){const t=e.map(i=>fe.indexOf(i)),n=fe.filter(i=>!e.includes(i)).map(i=>fe.indexOf(i)),s=new Set;n.forEach(i=>{for(let r=i+1;r<i+fe.length;r+=1){const a=r%fe.length;if(t.includes(a)){s.add(a);break}}});const o=[];return s.forEach(i=>{for(let r=i-1;r>i-fe.length;r-=1){const a=r<0?r+fe.length:r;if(t.includes(a)){const l=(a+1)%7;o.push([l,i]);break}}}),o}static createRangeBreakValuesFromHolidays(e,t,n){const s=[],o=[];return e.forEach(i=>{i.businessPeriods.length>0?o.push(...b.createPartialHoliday(i,t,n)):s.push(b.createFullHoliday(i,t,n))}),[{values:s},...o]}static createFullHoliday(e,t,n){return b.adjustDateForTimeZone(`${e.date.toString()} 00:00:00.000000`,t,n)}static createPartialHoliday(e,t,n){const s=e.date.toString(),o=["00:00"];e.businessPeriods.forEach(r=>{o.push(r.open),o.push(r.close)}),o.push("24:00");const i=[];for(let r=0;r<o.length;r+=2){const a=o[r],l=o[r+1];if(a!==l){const c=[b.adjustDateForTimeZone(`${s} ${a}:00.000000`,t,n)],h=bs*(b.periodToDecimal(l)-b.periodToDecimal(a));i.push({values:c,dvalue:h})}}return i}static adjustDateForTimeZone(e,t,n){return n&&n.standardOffset!==t.standardOffset?b.unwrapValue(b.wrapValue(e,Dt,t),n):e}static groupArray(e,t){return e.reduce((n,s)=>{var r;const o=s[t],i=(r=n.get(o))!=null?r:[];return i.push(s),n.set(o,i),n},new Map)}static unwrapValue(e,t){if(e!=null){if(Ts(e))return u.i18n.DateTimeFormat.format(b.DATE_FORMAT,e,t);if(Es(e))return e.asNumber()}return e}static wrapValue(e,t,n=null){if(K.isDateType(t)&&typeof e=="string"){const s=e,o=b.DATE_FORMAT.substr(0,e.length),i=u.i18n.DateTimeFormat.parse(o,s);if(!n)return i;const r=`${o} Z`,a=u.i18n.DateTimeFormat.format("Z",i,n),l=u.i18n.DateTimeFormat.parse(r,`${s} ${a}`),c=u.i18n.DateTimeFormat.format("Z",l,n);return u.i18n.DateTimeFormat.parse(r,`${s} ${c}`)}return e}static makeLayoutAxis(e,t=ce){const n={automargin:!0,gridcolor:t.gridcolor,linecolor:t.linecolor,rangeslider:{visible:!1},showline:!0,ticklen:5,tickcolor:t.paper_bgcolor,tickfont:{color:t.zerolinecolor},title:{font:{color:t.title_color}}};return e===u.plot.AxisType.X?Object.assign(n,{showgrid:!0}):e===u.plot.AxisType.Y&&Object.assign(n,{zerolinecolor:t.zerolinecolor,zerolinewidth:2}),n}static getColorwayFromTheme(e=ce){let t=[];return e.colorway&&(Array.isArray(e.colorway)?t=e.colorway:typeof e.colorway=="string"?t=e.colorway.split(" "):He.warn(`Unable to handle colorway property: ${e.colorway}`)),t}static makeDefaultLayout(e=ce){const t={...e,autosize:!0,colorway:b.getColorwayFromTheme(e),font:{family:"'Fira Sans', sans-serif"},title:{font:{color:e.title_color},yanchor:"top",pad:{...b.DEFAULT_TITLE_PADDING},y:1},legend:{font:{color:e.title_color}},margin:{...b.DEFAULT_MARGIN},xaxis:b.makeLayoutAxis(u.plot.AxisType.X,e),yaxis:b.makeLayoutAxis(u.plot.AxisType.Y,e)};return t.datarevision=0,t}static hydrateSettings(e){return{...e,type:u.plot.SeriesPlotStyle[e.type]}}static titleFromSettings(e){const{series:t,xAxis:n,title:s=`${t.join(", ")} by ${n}`}=e;return s}static makeFigureSettings(e,t){const{series:n,xAxis:s,type:o}=e,i=b.titleFromSettings(e),r={formatType:`${u.plot.AxisFormatType.NUMBER}`,type:`${u.plot.AxisType.X}`,position:`${u.plot.AxisPosition.BOTTOM}`},a={formatType:`${u.plot.AxisFormatType.NUMBER}`,type:`${u.plot.AxisType.Y}`,position:`${u.plot.AxisPosition.LEFT}`};return{charts:[{chartType:`${u.plot.ChartType.XY}`,axes:[r,a],series:n.map(l=>({plotStyle:`${o}`,name:l,dataSources:[{type:`${u.plot.SourceType.X}`,columnName:s,axis:r,table:t},{type:`${u.plot.SourceType.Y}`,columnName:l,axis:a,table:t}]}))}],title:i}}};let R=b;R.DEFAULT_AXIS_SIZE=.15;R.MIN_AXIS_SIZE=.025;R.MAX_AXIS_SIZE=.2;R.AXIS_SIZE_PX=75;R.LEGEND_WIDTH_PX=50;R.MAX_LEGEND_SIZE=.25;R.ORIENTATION=Object.freeze({HORIZONTAL:"h",VERTICAL:"v"});R.DATE_FORMAT="yyyy-MM-dd HH:mm:ss.SSSSSS";R.DEFAULT_MARGIN=Object.freeze({l:60,r:50,t:30,b:60,pad:0});R.DEFAULT_TITLE_PADDING=Object.freeze({t:8});R.SUBTITLE_LINE_HEIGHT=25;const ge=H.module("Chart"),Pe=class extends C.exports.Component{constructor(e){super(e),this.getCachedConfig=In((t,n,s,o)=>{const i=[],r=Boolean(t);if(r&&i.push({name:`Downsampling failed: ${t}`,click:()=>{},icon:Pe.convertIcon(zn),attr:"fill-warning"}),n||s||o||r){const a=Pe.downsampleButtonTitle(s,o),l=Pe.downsampleButtonAttr(s,o),c=s?Ht:Kn;i.push({name:a,icon:Pe.convertIcon(c),click:this.handleDownsampleClick,attr:l})}return{displaylogo:!1,displayModeBar:s||r?!0:"hover",modeBarButtons:[i,["toImage"],["zoom2d","pan2d"],["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]]}}),this.handleAfterPlot=this.handleAfterPlot.bind(this),this.handleDownsampleClick=this.handleDownsampleClick.bind(this),this.handleModelEvent=this.handleModelEvent.bind(this),this.handlePlotUpdate=this.handlePlotUpdate.bind(this),this.handleRelayout=this.handleRelayout.bind(this),this.handleRestyle=this.handleRestyle.bind(this),this.plot=D.createRef(),this.plotWrapper=D.createRef(),this.columnFormats=[],this.dateTimeFormatterOptions={},this.decimalFormatOptions={},this.integerFormatOptions={},this.isSubscribed=!1,this.isLoadedFired=!1,this.currentSeries=0,this.state={data:null,downsamplingError:null,isDownsampleFinished:!1,isDownsampleInProgress:!1,isDownsamplingDisabled:!1,layout:{datarevision:0},revision:0}}static convertIcon(e){const[t,,,,n]=e.icon,s=`${n}`;return{width:t,path:s,ascent:t,descent:0,transform:"matrix(1, 0, 0, 1, 0, 0)"}}static downsampleButtonTitle(e,t){return e?"Downsampling in progress...":t?"Downsampling disabled, click to enable":"Downsampling enabled, click to disable"}static downsampleButtonAttr(e,t){return e?"animation-spin":t?void 0:"fill-active"}componentDidMount(){this.updateDimensions(),this.updateModelDimensions(),this.initData(),this.initFormatter();const{isActive:e}=this.props;e&&this.subscribe()}componentDidUpdate(e){const{isActive:t,settings:n}=this.props;this.updateFormatterSettings(n),t!==e.isActive&&(t?this.subscribe():this.unsubscribe())}componentWillUnmount(){this.unsubscribe()}getPlotRect(){var e,t;return(t=(e=this.plotWrapper.current)==null?void 0:e.getBoundingClientRect())!=null?t:null}initData(){const{model:e}=this.props,{layout:t}=this.state;this.setState({data:e.getData(),layout:{...t,...e.getLayout()}})}subscribe(){if(this.isSubscribed)return;const{model:e}=this.props;if(!this.rect||this.rect.width===0||this.rect.height===0){ge.debug2("Delaying subscription until model dimensions are set");return}e.subscribe(this.handleModelEvent),this.isSubscribed=!0}unsubscribe(){if(!this.isSubscribed)return;const{model:e}=this.props;e.unsubscribe(this.handleModelEvent),this.isSubscribed=!1}handleAfterPlot(){this.plot.current!=null}handleDownsampleClick(){this.setState(({isDownsamplingDisabled:e})=>({downsamplingError:null,isDownsampleInProgress:!1,isDownsampleFinished:!1,isDownsamplingDisabled:!e}),()=>{const{model:e}=this.props,{isDownsamplingDisabled:t}=this.state;e.setDownsamplingDisabled(t)})}handleModelEvent(e){var s;const{type:t,detail:n}=e;switch(ge.debug2("Received data update",t,n),t){case z.EVENT_UPDATED:{this.currentSeries+=1,this.setState(i=>{const{layout:r,revision:a}=i;return typeof r.datarevision=="number"&&(r.datarevision+=1),{data:n,layout:r,revision:a+1}});const{onUpdate:o}=this.props;o({isLoading:!this.isLoadedFired});break}case z.EVENT_LOADFINISHED:{const{onUpdate:o}=this.props;this.isLoadedFired=!0,o({isLoading:!1});break}case z.EVENT_DISCONNECT:{const{onDisconnect:o}=this.props;o();break}case z.EVENT_RECONNECT:{const{onReconnect:o}=this.props;o();break}case z.EVENT_DOWNSAMPLESTARTED:{this.setState({isDownsampleFinished:!1,isDownsampleInProgress:!0,downsamplingError:null});break}case z.EVENT_DOWNSAMPLEFINISHED:{this.setState({isDownsampleFinished:!0,isDownsampleInProgress:!1,downsamplingError:null});break}case z.EVENT_DOWNSAMPLENEEDED:case z.EVENT_DOWNSAMPLEFAILED:{const o=(s=n.message)!=null?s:n;this.setState({isDownsampleFinished:!1,isDownsampleInProgress:!1,isDownsamplingDisabled:!1,downsamplingError:o});const{onError:i}=this.props;i(new Error(o));break}default:ge.debug("Unknown event type",t,e)}}handlePlotUpdate(e){const{layout:t}=e,n=R.getLayoutRanges(t);!Re(n,this.ranges)&&(this.ranges=n,this.updateModelDimensions(!0))}handleRelayout(e){if(ge.debug("handleRelayout",e),e.hiddenlabels!=null){const{onSettingsChanged:t}=this.props,n=[...e.hiddenlabels];t({hiddenSeries:n})}this.updateModelDimensions()}handleRestyle([e,t]){if(ge.debug("handleRestyle",e,t),Object.keys(e).includes("visible")){const{data:n}=this.state,{onSettingsChanged:s}=this.props;if(n!=null){const o=n.reduce((i,{name:r,visible:a})=>r!=null&&a==="legendonly"?[...i,r]:i,[]);s({hiddenSeries:o})}}}updateModelDimensions(e=!1){const t=this.getPlotRect();if(!t){ge.warn("Unable to get plotting rect");return}if(!this.rect||this.rect.width!==t.width||this.rect.height!==t.height||e){this.rect=t;const{isActive:s,model:o}=this.props;o.setDimensions(t),s&&this.subscribe()}}initFormatter(){const{settings:e}=this.props;this.updateFormatterSettings(e)}updateFormatterSettings(e){const t=it.getColumnFormats(e),n=it.getDateTimeFormatterOptions(e),{decimalFormatOptions:s={},integerFormatOptions:o={}}=e;(!Re(this.columnFormats,t)||!Re(this.dateTimeFormatterOptions,n)||!Re(this.decimalFormatOptions,s)||!Re(this.integerFormatOptions,o))&&(this.columnFormats=it.getColumnFormats(e),this.dateTimeFormatterOptions=n,this.decimalFormatOptions=s,this.integerFormatOptions=o,this.updateFormatter())}updateFormatter(){const e=new mt(this.columnFormats,this.dateTimeFormatterOptions,this.decimalFormatOptions,this.integerFormatOptions),{model:t}=this.props;t.setFormatter(e)}updateDimensions(){const e=this.getPlotRect();this.plot.current!=null&&e!=null&&e.width>0&&e.height>0&&Ge.relayout(this.plot.current.el,{autosize:!0}).catch(t=>{ge.debug("Unable to resize, promise rejected",t)})}render(){const{data:e,downsamplingError:t,isDownsampleFinished:n,isDownsampleInProgress:s,isDownsamplingDisabled:o,layout:i,revision:r}=this.state,a=this.getCachedConfig(t,n,s,o),l=e!=null;return p("div",{className:"h-100 w-100 chart-wrapper",ref:this.plotWrapper,children:l&&p(ds,{ref:this.plot,data:e,layout:i,revision:r,config:a,onAfterPlot:this.handleAfterPlot,onError:ge.error,onRelayout:this.handleRelayout,onUpdate:this.handlePlotUpdate,onRestyle:this.handleRestyle,useResizeHandler:!0,style:{height:"100%",width:"100%"}})})}};let Qt=Pe;Qt.defaultProps={isActive:!0,settings:{timeZone:"America/New_York",defaultDateTimeFormat:Ve.FULL_DATE_FORMAT,showTimeZone:!1,showTSeparator:!0,formatter:[]},onDisconnect:()=>{},onReconnect:()=>{},onUpdate:()=>{},onError:()=>{},onSettingsChanged:()=>{}};const Z=H.module("FigureChartModel"),Jt=class extends z{constructor(e,t={},n=ce){super(),this.addPendingSeries=ut(()=>{const o=R.getAllAxes(this.figure),{pendingSeries:i}=this;for(let r=0;r<i.length;r+=1){const a=i[r];this.addSeries(a,o),a.subscribe()}this.pendingSeries=[]},Jt.ADD_SERIES_DEBOUNCE),this.getTimeZone=G((o,i)=>{if(i!=null){const r=i.getColumnTypeFormatter(o);if(r!=null)return r.dhTimeZone}return null}),this.getValueTranslator=G((o,i)=>{const r=this.getTimeZone(o,i);return a=>R.unwrapValue(a,r)}),this.getValueParser=G((o,i)=>{const r=this.getTimeZone(o,i);return a=>R.wrapValue(a,o,r)}),this.getRangeParser=G((o,i)=>r=>{let[a,l]=r;const c=this.getValueParser(o,i);return a=c(a),l=c(l),[a,l]}),this.getAxisRangeParser=G((o,i)=>r=>{const a=R.getSourceForAxis(o,r);return a?this.getRangeParser(a.columnType,i):l=>l}),this.handleFigureUpdated=this.handleFigureUpdated.bind(this),this.handleFigureDisconnected=this.handleFigureDisconnected.bind(this),this.handleFigureReconnected=this.handleFigureReconnected.bind(this),this.handleFigureSeriesAdded=this.handleFigureSeriesAdded.bind(this),this.handleDownsampleStart=this.handleDownsampleStart.bind(this),this.handleDownsampleFinish=this.handleDownsampleFinish.bind(this),this.handleDownsampleFail=this.handleDownsampleFail.bind(this),this.handleDownsampleNeeded=this.handleDownsampleNeeded.bind(this),this.handleRequestFailed=this.handleRequestFailed.bind(this),this.figure=e,this.settings=t,this.theme=n,this.data=[];const s={data:{},layout:R.makeDefaultLayout(n)};this.layout={grid:{rows:e.rows,columns:e.cols,pattern:"independent"},template:s},this.seriesDataMap=new Map,this.pendingSeries=[],this.oneClicks=[],this.filterColumnMap=new Map,this.lastFilter=new Map,this.isConnected=!0,this.seriesToProcess=new Set,this.setTitle(this.getDefaultTitle()),this.initAllSeries(),this.updateAxisPositions(),this.startListeningFigure()}close(){this.figure.close(),this.addPendingSeries.cancel(),this.stopListeningFigure()}getDefaultTitle(){return this.figure.charts.length>0?this.figure.charts[0].title:""}initAllSeries(){this.oneClicks=[],this.filterColumnMap.clear();const{charts:e}=this.figure,t=R.getAllAxes(this.figure),n=[];for(let i=0;i<e.length;i+=1){const r=e[i];for(let a=0;a<r.series.length;a+=1){const l=r.series[a];n.push(l.name),this.addSeries(l,t)}}const o=[...this.seriesDataMap.keys()].filter(i=>n.indexOf(i)<0);for(let i=0;i<o.length;i+=1){const r=o[i];this.seriesDataMap.delete(r)}this.seriesToProcess=new Set([...this.seriesDataMap.keys()])}addSeries(e,t){const n=R.groupArray(t,"type"),s=R.makeSeriesDataFromSeries(e,n,R.getSeriesVisibility(e.name,this.settings),this.theme);if(this.seriesDataMap.set(e.name,s),this.data=[...this.seriesDataMap.values()],e.plotStyle===u.plot.SeriesPlotStyle.STACKED_BAR?this.layout.barmode="stack":e.plotStyle===u.plot.SeriesPlotStyle.PIE&&(this.layout.hiddenlabels=R.getHiddenLabels(this.settings)),this.layout.showlegend=this.data.length>1||e.plotStyle===u.plot.SeriesPlotStyle.PIE,e.oneClick!=null){const{oneClick:o}=e,{columns:i}=o;for(let r=0;r<i.length;r+=1)this.filterColumnMap.set(i[r].name,i[r]);this.oneClicks.push(o)}this.updateLayoutFormats()}subscribe(e){super.subscribe(e),this.listeners.length===1&&(this.initAllSeries(),this.subscribeFigure())}unsubscribe(e){super.unsubscribe(e),this.listeners.length===0&&this.unsubscribeFigure()}subscribeFigure(){if(!this.isConnected){Z.debug("Ignoring subscribe when figure in disconnected state");return}this.figure.subscribe(this.isDownsamplingDisabled?u.plot.DownsampleOptions.DISABLE:u.plot.DownsampleOptions.DEFAULT)}unsubscribeFigure(){this.figure.unsubscribe()}startListeningFigure(){this.figure.addEventListener(u.plot.Figure.EVENT_UPDATED,this.handleFigureUpdated),this.figure.addEventListener(u.plot.Figure.EVENT_SERIES_ADDED,this.handleFigureSeriesAdded),this.figure.addEventListener(u.plot.Figure.EVENT_DISCONNECT,this.handleFigureDisconnected),this.figure.addEventListener(u.plot.Figure.EVENT_RECONNECT,this.handleFigureReconnected),this.figure.addEventListener(u.plot.Figure.EVENT_DOWNSAMPLESTARTED,this.handleDownsampleStart),this.figure.addEventListener(u.plot.Figure.EVENT_DOWNSAMPLEFINISHED,this.handleDownsampleFinish),this.figure.addEventListener(u.plot.Figure.EVENT_DOWNSAMPLEFAILED,this.handleDownsampleFail),this.figure.addEventListener(u.plot.Figure.EVENT_DOWNSAMPLENEEDED,this.handleDownsampleNeeded),this.figure.addEventListener(u.Client.EVENT_REQUEST_FAILED,this.handleRequestFailed)}stopListeningFigure(){this.figure.removeEventListener(u.plot.Figure.EVENT_UPDATED,this.handleFigureUpdated),this.figure.removeEventListener(u.plot.Figure.EVENT_SERIES_ADDED,this.handleFigureSeriesAdded),this.figure.removeEventListener(u.plot.Figure.EVENT_DISCONNECT,this.handleFigureDisconnected),this.figure.removeEventListener(u.plot.Figure.EVENT_RECONNECT,this.handleFigureReconnected),this.figure.removeEventListener(u.plot.Figure.EVENT_DOWNSAMPLESTARTED,this.handleDownsampleStart),this.figure.removeEventListener(u.plot.Figure.EVENT_DOWNSAMPLEFINISHED,this.handleDownsampleFinish),this.figure.removeEventListener(u.plot.Figure.EVENT_DOWNSAMPLEFAILED,this.handleDownsampleFail),this.figure.removeEventListener(u.plot.Figure.EVENT_DOWNSAMPLENEEDED,this.handleDownsampleNeeded),this.figure.removeEventListener(u.Client.EVENT_REQUEST_FAILED,this.handleRequestFailed)}handleDownsampleStart(e){Z.debug("Downsample started",e),this.fireDownsampleStart(e.detail)}handleDownsampleFinish(e){Z.debug("Downsample finished",e),this.fireDownsampleFinish(e.detail)}handleDownsampleFail(e){Z.error("Downsample failed",e),this.fireDownsampleFail(e.detail)}handleDownsampleNeeded(e){Z.info("Downsample needed",e),this.fireDownsampleNeeded(e.detail)}handleFigureUpdated(e){const{detail:t}=e,{series:n}=t;Z.debug2("handleFigureUpdated",n);for(let o=0;o<n.length;o+=1){const i=n[o];Z.debug2("handleFigureUpdated updating series",i.name);const{sources:r}=i;for(let a=0;a<r.length;a+=1){const l=r[a],{columnType:c,type:h}=l,m=this.getValueTranslator(c,this.formatter),T=t.getArray(i,h,m);this.setDataArrayForSeries(i,h,T)}this.seriesToProcess.delete(i.name),this.seriesToProcess.size===0&&this.fireLoadFinished(),this.cleanSeries(i)}const{data:s}=this;this.fireUpdate(s)}handleRequestFailed(e){Z.error("Request failed",e)}resubscribe(){this.listeners.length>0&&(this.unsubscribeFigure(),this.subscribeFigure())}setFormatter(e){super.setFormatter(e),this.updateLayoutFormats(),this.resubscribe()}setDownsamplingDisabled(e){super.setDownsamplingDisabled(e),this.resubscribe()}handleFigureDisconnected(e){Z.debug("Figure disconnected",e),this.isConnected=!1,this.listeners.length>0&&this.unsubscribeFigure(),this.fireDisconnect()}handleFigureReconnected(e){Z.debug("Figure reconnected",e),this.isConnected=!0,this.initAllSeries(),this.fireReconnect(),this.listeners.length>0&&this.subscribeFigure()}handleFigureSeriesAdded(e){const{detail:t}=e;Z.debug("handleFigureSeriesAdded",t),this.pendingSeries.push(t),this.addPendingSeries()}setDimensions(e){super.setDimensions(e),this.updateAxisPositions()}setTitle(e){var s,o;super.setTitle(e);const t=(o=(s=(e!=null?e:"").match(/<br>/g))==null?void 0:s.length)!=null?o:0,n=R.DEFAULT_MARGIN.t+t*R.SUBTITLE_LINE_HEIGHT;this.layout.margin?this.layout.margin.t=n:this.layout.margin={t:n},typeof this.layout.title=="string"?this.layout.title=e:(this.layout.title={...this.layout.title},this.layout.title.text=e,this.layout.title.pad={...this.layout.title.pad},this.layout.title.pad.t=R.DEFAULT_TITLE_PADDING.t+t*R.SUBTITLE_LINE_HEIGHT*.5)}getPlotWidth(){var e,t,n,s;return!this.rect||!this.rect.width?0:Math.max(this.rect.width-((t=(e=this.layout.margin)==null?void 0:e.l)!=null?t:0)-((s=(n=this.layout.margin)==null?void 0:n.r)!=null?s:0),0)}getPlotHeight(){var e,t,n,s;return!this.rect||!this.rect.height?0:Math.max(this.rect.height-((t=(e=this.layout.margin)==null?void 0:e.t)!=null?t:0)-((s=(n=this.layout.margin)==null?void 0:n.b)!=null?s:0),0)}updateAxisPositions(){const e=this.getPlotWidth(),t=this.getPlotHeight();R.updateFigureAxes(this.layout,this.figure,n=>this.getAxisRangeParser(n,this.formatter),e,t,this.theme)}updateLayoutFormats(){if(!this.formatter)return;R.getAxisFormats(this.figure,this.formatter).forEach((t,n)=>{Z.debug(`Assigning ${n}`,this.layout[n],t);const s=this.layout[n];s!=null?Object.assign(s,t):Z.debug(`Ignoring null layout.${n}`)})}setDataArrayForSeries(e,t,n){const{name:s,plotStyle:o}=e,i=this.seriesDataMap.get(s),r=R.getPlotlyProperty(o,t);i&&_t(i,r,n)}cleanSeries(e){const{name:t,plotStyle:n}=e,s=this.seriesDataMap.get(t);if(s!=null){if(n===u.plot.SeriesPlotStyle.HISTOGRAM){const{xLow:o,xHigh:i}=s;if(o&&i&&o.length===i.length){const r=[];for(let a=0;a<o.length;a+=1)r.push(i[a]-o[a]);s.width=r}}else if(n===u.plot.SeriesPlotStyle.LINE){const{x:o,xLow:i,xHigh:r,y:a,yLow:l,yHigh:c}=s;i&&r&&i!==o&&(s.error_x=R.getPlotlyErrorBars(o,i,r)),l&&c&&l!==a&&(s.error_y=R.getPlotlyErrorBars(a,l,c))}else if(n===u.plot.SeriesPlotStyle.TREEMAP){const{ids:o,labels:i}=s;o!==void 0&&i===void 0&&(s.labels=o)}}}getData(){return this.data}getLayout(){return this.layout}getFilterColumnMap(){return new Map(this.filterColumnMap)}isFilterRequired(){return this.oneClicks.find(e=>e.requireAllFiltersToDisplay)!=null}setFilter(e){if(this.oneClicks.length===0){Z.warn("Trying to set a filter, but no one click!");return}Z.debug("setFilter",e);for(let t=0;t<this.oneClicks.length;t+=1){const n=this.oneClicks[t],{columns:s}=n;new Set([...e.keys(),...this.lastFilter.keys()]).forEach(i=>{const r=e.get(i);this.lastFilter.get(i)!==r&&s.find(a=>a.name===i)!=null&&n.setValueForColumn(i,r)})}this.lastFilter=new Map(e)}setFigure(e){this.close(),this.figure=e,this.setTitle(this.getDefaultTitle()),this.initAllSeries(),this.updateAxisPositions(),this.startListeningFigure(),this.listeners.length>0&&this.subscribeFigure()}updateSettings(e){this.settings=e}};let at=Jt;at.ADD_SERIES_DEBOUNCE=50;class ft{static async makeModelFromSettings(t,n,s=ce){const o=await ft.makeFigureFromSettings(t,n);return new at(o,t,s)}static async makeFigureFromSettings(t,n){const s=await n.copy();return s.applyCustomColumns(n.customColumns),s.applyFilter(n.filter),s.applySort(n.sort),u.plot.Figure.create(R.makeFigureSettings(t,s))}static async makeModel(t,n,s=ce){return new at(n,t,s)}}const Is="#1a171a",Cs="#f0f0ee",xs="#fcd65b",Ds="#9edc6f",vs="#76d9e4",ws="#aa9af4",Ns="#f37e3f",As="#f95d84",Fs="#4878ea",Os="#5b5a5c",ks="#9edc6f",Rs="#fcd65b",Ls="#f37e3f",Ps="#f95d84",_s="#fcfcfa",Vs="#929192",Us="#373438",$s="#f0f0ee",Hs="#1a171a",Bs="#2d2a2e",Ws="#1a171a",qs="#f0f0ee",Ks="0.15s",zs={"gray-100":"#fcfcfa","gray-200":"#f0f0ee","gray-300":"#c0bfbf","gray-400":"#929192","gray-500":"#5b5a5c","gray-600":"#555356","gray-700":"#403e41","gray-800":"#373438","gray-850":"#322f33","gray-900":"#211f22",black:Is,white:Cs,yellow:xs,green:Ds,blue:vs,purple:ws,orange:Ns,red:As,primary:Fs,"primary-hover":"#235de6","primary-dark":"#343e5d",secondary:Os,success:ks,info:Rs,warning:Ls,danger:Ps,light:_s,mid:Vs,dark:Us,"text-muted":"#929192",interfacewhite:$s,interfaceblack:Hs,interfacegray:Bs,"content-bg":"#2d2a2e",background:Ws,foreground:qs,transition:Ks},Yt=Object.freeze({transitionMs:150,transitionMidMs:200,transitionLongMs:300,transitionSlowMs:1e3,...zs});class xe extends C.exports.Component{constructor(t){super(t),this.handleEnter=this.handleEnter.bind(this),this.handleExit=this.handleExit.bind(this),this.handleBlur=this.handleBlur.bind(this),this.element=document.createElement("div"),this.element.className="popper-container",this.container=D.createRef(),this.rAF=0;const{isShown:n}=this.props;this.state={show:n,popper:null}}componentDidUpdate(t){const{isShown:n}=this.props;t.isShown!==n&&(n?(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{this.show()})):this.hide())}componentWillUnmount(){this.destroyPopper(!1)}getVisibleElement(t){return t==null||t.clientHeight>0||t.clientWidth>0?t:this.getVisibleElement(t.parentElement)}initPopper(){let{popper:t}=this.state;const{closeOnBlur:n,referenceObject:s}=this.props;if(t||this.container.current===null)return;let{options:o}=this.props;o={placement:"auto",...o},document.body.appendChild(this.element);let i=this.getVisibleElement(this.container.current);i==null&&(i=this.container.current),t=new Cn(s||i,this.element,o),t.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(n&&!this.element.contains(document.activeElement)){const r=this.element.firstElementChild;r instanceof HTMLElement&&r.focus()}}),this.setState({popper:t})}destroyPopper(t=!0){cancelAnimationFrame(this.rAF);const{popper:n}=this.state;!n||(n.destroy(),document.body.contains(this.element)&&document.body.removeChild(this.element),t&&this.setState({popper:null}))}show(){this.initPopper(),this.setState({show:!0})}hide(){this.setState({show:!1})}scheduleUpdate(){const{popper:t}=this.state;t&&t.scheduleUpdate()}handleBlur(t){t.relatedTarget instanceof HTMLElement&&(this.element.contains(t.relatedTarget)||this.hide())}handleEnter(){const{onEntered:t}=this.props;t()}handleExit(){const{onExited:t}=this.props,{show:n}=this.state;n||this.destroyPopper(),t()}renderContent(){const{className:t,children:n,timeout:s,interactive:o,closeOnBlur:i}=this.props,{show:r}=this.state;return p(dt,{in:r,timeout:s,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,children:p("div",{onClick:a=>{a.stopPropagation()},onKeyDown:a=>{a.key==="Escape"&&this.hide()},className:N("popper",{interactive:o},t),onBlur:i?this.handleBlur:void 0,tabIndex:i?-1:void 0,role:"presentation",children:L("div",{className:"popper-content",children:[n,p("div",{className:"popper-arrow","x-arrow":""})]})})})}render(){const{popper:t}=this.state,{"data-testid":n}=this.props;return p("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":n,children:t&&Vt.createPortal(this.renderContent(),this.element)})}}xe.propTypes={children:d.exports.node.isRequired,options:d.exports.shape({}),className:d.exports.string,timeout:d.exports.number,onEntered:d.exports.func,onExited:d.exports.func,isShown:d.exports.bool,closeOnBlur:d.exports.bool,interactive:d.exports.bool,referenceObject:d.exports.shape({}),"data-testid":d.exports.string};xe.defaultProps={options:{},className:"",timeout:Yt.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0};const Gs=H.module("Tooltip"),Y=class extends C.exports.Component{constructor(e){super(e),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowMouseMove=this.handleWindowMouseMove.bind(this),this.handleWheel=this.handleWheel.bind(this),this.handleTimeout=this.handleTimeout.bind(this),this.handleExited=this.handleExited.bind(this),this.stopShowingTooltip=this.stopShowingTooltip.bind(this),this.container=D.createRef(),this.popper=D.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}static handleHidden(){Y.shownTooltipCount-=1,Y.shownTooltipCount===0&&(Y.lastHiddenTime=Date.now())}static handleShown(){Y.shownTooltipCount+=1}componentDidMount(){this.startListening();const{timeout:e}=this.props;e===0&&this.show()}componentDidUpdate(e,t){const{isShown:n}=t,{isShown:s}=this.state;s!==n&&(s?Y.handleShown():Y.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();const{isShown:e}=this.state;e&&Y.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){Gs.error("Tooltip doesn't have a container or a parent set!");return}this.parent=this.container.current.parentElement,this.parent.addEventListener("mousemove",this.handleMouseMove),this.parent.addEventListener("mouseleave",this.handleMouseLeave),this.parent.addEventListener("mousedown",this.stopShowingTooltip)}stopListening(){!this.parent||(this.parent.removeEventListener("mousemove",this.handleMouseMove),this.parent.removeEventListener("mouseleave",this.handleMouseLeave),this.parent.removeEventListener("mousedown",this.stopShowingTooltip))}startListeningWindow(){window.addEventListener("mousemove",this.handleWindowMouseMove,!0),window.addEventListener("contextmenu",this.stopShowingTooltip,!0),window.addEventListener("wheel",this.handleWheel)}stopListeningWindow(){window.removeEventListener("mousemove",this.handleWindowMouseMove,!0),window.removeEventListener("contextmenu",this.stopShowingTooltip,!0),window.removeEventListener("wheel",this.handleWheel)}handleMouseMove(){this.startTimer()}handleWheel(){const{isShown:e}=this.state;this.popper.current&&this.parent&&e&&!this.popper.current.element.matches(":hover")&&!this.parent.matches(":hover")&&(this.stopTimer(),this.hide())}handleMouseLeave(){const{isShown:e}=this.state;this.stopTimer();const{interactive:t}=this.props;!t&&e&&this.hide()}handleTimeout(){this.show()}handleWindowMouseMove(e){const t=e.clientX,n=e.clientY,{isShown:s}=this.state;if(!this.popper.current||!this.parent)return;const o=this.popper.current.element.getBoundingClientRect(),i=this.parent.getBoundingClientRect();t>=o.left&&t<=o.left+o.width&&n>=o.top&&n<=o.top+o.height?this.handleMouseMove():t>=i.left&&t<=i.left+i.width&&n>=i.top&&n<=i.top+i.height?this.handleMouseMove():s&&(this.stopTimer(),this.hide())}startTimer(){this.stopTimer();const{timeout:e,reshowTimeout:t}=this.props;let n=e;(Y.shownTooltipCount>0||Date.now()-Y.lastHiddenTime<Y.triggerReshowThreshold)&&(n=t),this.timer=window.setTimeout(this.handleTimeout,n)}stopTimer(){this.timer!=null&&(clearTimeout(this.timer),this.timer=null)}show(){var t;const{isShown:e}=this.state;if(this.stopTimer(),!e){(t=this.popper.current)==null||t.show(),this.setState({isShown:!0});const{interactive:n}=this.props;n&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)==null||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)==null||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});const{onExited:e}=this.props;e()}stopShowingTooltip(){const{isShown:e}=this.state;this.stopTimer(),e&&this.hide()}render(){const{interactive:e,children:t,options:n,referenceObject:s,popperClassName:o,"data-testid":i,onEntered:r}=this.props,{isShown:a}=this.state;return p("div",{ref:this.container,style:{display:"none"},"data-testid":i,children:p(xe,{className:N(o),options:n,ref:this.popper,onEntered:r,onExited:this.handleExited,interactive:e,referenceObject:s,children:L("div",{className:"tooltip-content",children:[" ",a&&t]})})})}};let be=Y;be.defaultTimeout=500;be.defaultReshowTimeout=100;be.triggerReshowThreshold=300;be.shownTooltipCount=0;be.lastHiddenTime=Date.now();be.defaultProps={interactive:!1,options:{},popperClassName:"",reshowTimeout:Y.defaultReshowTimeout,timeout:Y.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0};const js=100;var en=(e=>(e.UP="UP",e.DOWN="DOWN",e))(en||{});const Ee=class extends C.exports.Component{constructor(e){super(e),this.getCachedFilteredOptions=G((n,s)=>n.filter(o=>o.title.toLowerCase().indexOf(s.toLowerCase())>=0));let{popperOptions:t}=this.props;t={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=ut(this.updateInputValue,js),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=D.createRef(),this.cbContainer=D.createRef(),this.menuContainer=D.createRef(),this.input=D.createRef()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}getValueAndValidate(e){if(!e)return this.setState({invalid:!1}),{value:e,isValid:!1};const{options:t}=this.props,n=t.filter(s=>s.title.toLowerCase()===e.toLowerCase());return n.length<1?(this.setState({invalid:!0}),{value:e,isValid:!1}):(this.setState({invalid:!1}),{value:n[0].value,isValid:!0})}updateInputValue(e){const{menuIsOpen:t}=this.state,{value:n,isValid:s}=this.getValueAndValidate(e);t&&this.processFilterChange(e),this.fireOnChange(n,s)}fireOnChange(e,t=!0){const{onChange:n}=this.props;n(e,t)}processFilterChange(e){var i;const{options:t}=this.props,{menuIsOpen:n}=this.state,s=e?this.getCachedFilteredOptions(t,e):t,o=s.length===1&&s[0].title===e;if(this.setState({filteredOptions:s,keyboardOptionIndex:0}),o&&n){this.closeMenu();return}(i=this.popper.current)==null||i.scheduleUpdate()}resetValue(){this.setState({title:""}),this.fireOnChange("")}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var o;const{filteredOptions:t,keyboardOptionIndex:n}=this.state,s=t[n];switch(e.key){case"Enter":case"ArrowRight":e.stopPropagation(),e.preventDefault(),s!=null&&(this.setState({title:s.title,invalid:!1}),this.fireOnChange(s.value)),this.closeMenu(),(o=this.input.current)==null||o.focus();break;case"ArrowUp":e.stopPropagation(),e.preventDefault(),this.navigateMenu(Ee.MENU_NAVIGATION_DIRECTION.UP);break;case"ArrowDown":e.stopPropagation(),e.preventDefault(),this.navigateMenu(Ee.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Tab":if(e.stopPropagation(),e.preventDefault(),e.shiftKey){this.navigateMenu(Ee.MENU_NAVIGATION_DIRECTION.UP);break}this.navigateMenu(Ee.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Escape":e.preventDefault(),e.stopPropagation(),this.closeMenu();break}}navigateMenu(e){const{filteredOptions:t,keyboardOptionIndex:n}=this.state;let s=n;e===Ee.MENU_NAVIGATION_DIRECTION.UP?n>0?(s=(s-1)%t.length,this.setState({keyboardOptionIndex:s})):n===0&&(s=t.length-1,this.setState({keyboardOptionIndex:s})):e===Ee.MENU_NAVIGATION_DIRECTION.DOWN&&n<t.length&&(s=(s+1)%t.length,this.setState({keyboardOptionIndex:s})),this.scrollOptionIntoView(s)}handleInputKeyDown(e){const{onEnter:t}=this.props,{menuIsOpen:n}=this.state;n?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.focus()}handelInputFocus(){const{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputClick(){const{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputBlur(e){const{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.focus()}handleMenuExited(){const{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}openMenu(){const{title:e}=this.state;this.processFilterChange(e),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var t;(t=this.popper.current)==null||t.show()})}closeMenu(e=!0){var t,n;this.setState({menuIsOpen:!1,keyboardOptionIndex:0}),e&&((t=this.input.current)==null||t.focus()),(n=this.popper.current)==null||n.hide()}scrollOptionIntoView(e){var t;this.menuContainer.current&&((t=this.menuContainer.current.children.item(e))==null||t.scrollIntoView({behavior:"smooth",block:"nearest"}))}renderMenuElement(){const{inputWidth:e}=this.state;return p("div",{className:N("aci-options"),ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,style:{width:e},onBlur:this.handleMenuBlur,children:this.renderOptions()})}renderOptions(){const{noMatchText:e}=this.props,{title:t,filteredOptions:n}=this.state;return t&&n.length===0?p("div",{className:"no-match",children:e}):n.map((s,o)=>this.renderOption(s,o))}renderOption(e,t){const{keyboardOptionIndex:n}=this.state,s=`option-${t}-${e.value}`;return p("button",{type:"button",className:N("aci-option-btn",{"keyboard-active":n===t}),onClick:()=>this.handleOptionClick(e),onFocus:()=>this.setState({keyboardOptionIndex:t}),children:e.title},s)}render(){const{options:e,inputPlaceholder:t,disabled:n,className:s,defaultTitle:o,spellCheck:i,"data-testid":r}=this.props,{title:a,menuIsOpen:l,popperOptions:c,invalid:h}=this.state;return L("div",{className:"aci-container",ref:this.cbContainer,children:[p("input",{value:a||o,className:N("form-control",s,"aci-input",{"is-invalid":h&&!l}),ref:this.input,onChange:this.handleInputChange,placeholder:t||e[0].title,disabled:n,onFocus:this.handelInputFocus,onClick:this.handleInputClick,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:i,"data-testid":r}),p(xe,{ref:this.popper,options:c,className:N("aci-options-popper interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})}};let gt=Ee;gt.propTypes={options:d.exports.arrayOf(d.exports.shape({title:d.exports.string.isRequired,value:d.exports.string.isRequired})).isRequired,popperOptions:d.exports.shape({}),onChange:d.exports.func,inputPlaceholder:d.exports.string,disabled:d.exports.bool,className:d.exports.string,defaultTitle:d.exports.string,spellCheck:d.exports.bool,onEnter:d.exports.func,noMatchText:d.exports.string,"data-testid":d.exports.string};gt.defaultProps={onChange(){},inputPlaceholder:"",disabled:!1,className:"",defaultTitle:"",popperOptions:null,spellCheck:!0,onEnter(){},noMatchText:"No matching items found","data-testid":void 0};gt.MENU_NAVIGATION_DIRECTION=en;d.exports.string.isRequired,d.exports.func.isRequired,d.exports.string,d.exports.string,d.exports.bool,d.exports.bool,d.exports.string,d.exports.string,d.exports.string;d.exports.node.isRequired,d.exports.string,d.exports.object,d.exports.string;const Xs=["primary","secondary","tertiary","success","danger","inline","ghost"],Zs=["group-end"];function Qs(e,t){switch(e){case"primary":return"btn-primary";case"secondary":return"btn-outline-primary";case"tertiary":return"btn-secondary";case"success":return"btn-success";case"danger":return"btn-danger";case"inline":return"btn-inline";case"ghost":return N("btn-link",{"btn-link-icon":t,"btn-link-icon-only":t})}}function Js(e){switch(e){case"group-end":return N("pl-2","pr-3")}}const $e=D.forwardRef((e,t)=>{const{kind:n,variant:s,type:o,tooltip:i,icon:r,disabled:a,active:l,onClick:c,onMouseDown:h,onMouseUp:m,className:T,style:y,children:M,tabIndex:E,"data-testid":A,"aria-label":O}=e,x=Boolean(r&&M==null),v=Qs(n,x);let k;s&&(k=Js(s));let V;r&&(V=D.isValidElement(r)?r:p(X,{icon:r}));let U;i!==void 0&&(U=typeof i=="string"?p(be,{children:i}):i);let P=O;O===void 0&&x&&i!=null&&typeof i=="string"&&(P=i);const ie=L("button",{"data-testid":A,ref:t,type:o,className:N("btn",v,k,{active:l},T),onClick:c,onMouseUp:m,onMouseDown:h,style:y,disabled:a,tabIndex:E,"aria-label":P,children:[r&&V,M,i!=null&&(a===void 0||!a)&&U]});return a!==void 0&&a?L("span",{className:"btn-disabled-wrapper",children:[ie,i!==void 0&&U]}):ie});$e.displayName="Button";$e.propTypes={kind:d.exports.oneOf(Xs).isRequired,variant:d.exports.oneOf(Zs),type:d.exports.oneOf(["submit","reset","button"]),tooltip(e){const{tooltip:t,icon:n,children:s}=e;return t===void 0&&n!=null&&s==null?new Error("Tooltip is required for icon only buttons"):null},icon(e){const{children:t,icon:n}=e;return n==null&&t==null?new Error("Icon is required if no children are provided"):t==null&&!D.isValidElement(n)&&(n==null||n.iconName===""||n.iconName==null)?new Error("Icon must be react element or fontawesome IconDefinition"):null},disabled:d.exports.bool,active:d.exports.bool,onClick(e){const{onClick:t,type:n}=e;return n==="button"&&typeof t!="function"?new Error("type button requires an onClick function"):t!==void 0&&typeof t!="function"?new Error("onClick must be a function"):null},onMouseUp:d.exports.func,onMouseDown:d.exports.func,tabIndex:d.exports.number,children:d.exports.node,className:d.exports.string,style:d.exports.object,"data-testid":d.exports.string};$e.defaultProps={type:"button",onClick:void 0,onMouseUp:void 0,onMouseDown:void 0,variant:void 0,tooltip:void 0,icon:void 0,disabled:!1,active:void 0,tabIndex:void 0,children:void 0,className:void 0,style:{},"data-testid":void 0};d.exports.bool.isRequired,d.exports.string.isRequired,d.exports.oneOfType([d.exports.string,d.exports.func]).isRequired,d.exports.func,d.exports.func.isRequired,d.exports.func,d.exports.func,d.exports.string,d.exports.string,d.exports.string,d.exports.node,d.exports.string;const yt=D.forwardRef((e,t)=>{const{children:n,className:s,disabled:o,onClick:i,style:r,id:a}=e;return p("button",{ref:t,type:"button",className:N("btn",s),onClick:i,style:r,disabled:o,id:a,children:n})});yt.displayName="Button";yt.propTypes={children:d.exports.node,className:d.exports.string,disabled:d.exports.bool,onClick:d.exports.func,style:d.exports.shape({}),id:d.exports.string};yt.defaultProps={children:null,className:"",disabled:!1,onClick:()=>null,style:{},id:""};function ot(e){return e.then!==void 0}const ye=class{static disableAllActions(){ye.actionsDisabled=!0}static enableAllActions(){ye.actionsDisabled=!1}static isContextActionEvent(e){return Array.isArray(e.contextActions)}static compareActions(e,t){var n,s,o,i,r,a;return e.group!==t.group?((n=e.group)!=null?n:0)>((s=t.group)!=null?s:0)?1:-1:e.order!==t.order?((o=e.order)!=null?o:0)>((i=t.order)!=null?i:0)?1:-1:e.title!==t.title?((r=e.title)!=null?r:"")>((a=t.title)!=null?a:"")?1:-1:e!==t?e>t?1:-1:0}static sortActions(e){if(e==null||!Array.isArray(e))return[];const t=e.slice();return t.sort(ye.compareActions),t}static isMacPlatform(){const{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return ye.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){const t=ye.getModifierKey();return e[t]}static copyToClipboard(e){const{clipboard:t}=navigator;return t===void 0?(ye.copyToClipboardExecCommand(e),Promise.resolve()):navigator.clipboard.writeText(e).catch(()=>{ye.copyToClipboardExecCommand(e)})}static copyToClipboardExecCommand(e){const t=document.activeElement,n=document.createElement("textarea");if(n.value=e,document.body.appendChild(n),n.focus(),n.select(),!document.execCommand("copy"))throw new Error("Unable to execute copy command");document.body.removeChild(n),t instanceof HTMLElement&&t.focus()}static getMenuItems(e,t=!0){let n=[],s=e;Array.isArray(s)||(s=[s]);for(let o=0;o<s.length;o+=1){const i=s[o];let r;typeof i=="function"?r=i():r=i,r!=null&&(r instanceof Promise?t&&n.push(r):Array.isArray(r)?n=n.concat(r):n.push(r))}return n=n.filter(o=>o.title!==void 0||o.then||o.menuElement),n}static getNextMenuItem(e,t,n){let s=e;s<0&&t<0&&(s=n.length);for(let o=1;o<n.length+1;o+=1){const i=(s+t*o+n.length)%n.length,r=n[i];if(!(r instanceof Promise)&&r.disabled!==!0)return i}return e}};let $=ye;$.actionsDisabled=!1;const wt=H.module("GlobalContextAction");class Ys extends C.exports.Component{constructor(t){super(t),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(t){const n=t;n.contextActions==null&&(n.contextActions=[]);const{action:s}=this.props;s.title==null&&!s.menuElement||(n.contextActions==null&&(n.contextActions=[]),n.contextActions.push(s),wt.debug("Received context menu event at global action! Menu items are now: ",n.contextActions))}handleKeyDown(t){var s;const{action:n}=this.props;!$.actionsDisabled&&n.shortcut!==void 0&&n.shortcut.matchesEvent(t)&&(wt.debug("Global hotkey matched!",t),(s=n.action)==null||s.call(n,t),t.preventDefault(),t.stopPropagation())}render(){return null}}class ei extends C.exports.Component{render(){const{actions:t,"data-testid":n}=this.props,s=[];for(let o=0;o<t.length;o+=1){const i=t[o],{shortcut:r}=i;if(i.title!=null||i.menuElement||r){const a=p(Ys,{action:i,"data-testid":n},`${i.title}.${r==null?void 0:r.id}`);s.push(a)}}return s}}const Be=H.module("ContextActions");class ti extends C.exports.Component{constructor(t){super(t),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=D.createRef(),this.state={globalActions:[],keyboardActions:[]}}static triggerMenu(t,n,s,o){if(o.length===0)return;const i=new MouseEvent("contextmenu",{clientX:n,clientY:s,bubbles:!0,cancelable:!0});i.contextActions=o,t.dispatchEvent(i)}static getDerivedStateFromProps(t){if(t.actions==null||!Array.isArray(t.actions))return{globalActions:[],keyboardActions:[]};const n=t.actions.filter(o=>!ot(o)&&typeof o!="function"&&o.isGlobal),s=t.actions.filter(o=>!ot(o)&&typeof o!="function"&&(o.isGlobal===void 0||!o.isGlobal)&&o.shortcut!=null);return{globalActions:n,keyboardActions:s}}componentDidMount(){var t;(t=this.container.current)!=null&&t.parentElement&&(this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.addEventListener("keydown",this.handleKeyDown))}componentWillUnmount(){var t;(t=this.container.current)!=null&&t.parentElement&&(this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.removeEventListener("keydown",this.handleKeyDown))}handleContextMenu(t){const{ignoreClassNames:n=[]}=this.props;if(n.length>0){let o=t.target;for(;o!=null;){const{classList:i}=o,r=n.find(a=>i.contains(a));if(r!==void 0){Be.debug2(`Contextmenu event ignored based on the target className "${r}"`);return}o=o.parentElement}}if($.isContextActionEvent(t)||(t.contextActions=[]),!$.isContextActionEvent(t))return;const{actions:s}=this.props;if(s!=null){let o=s;Array.isArray(o)&&(o=o.filter(i=>ot(i)||typeof i=="function"||i.isGlobal===void 0||!i.isGlobal)),t.contextActions=t.contextActions.concat(o)}Be.debug("Received context menu event! Menu items are now: ",t.contextActions)}handleKeyDown(t){var s;const{keyboardActions:n}=this.state;for(let o=0;o<n.length;o+=1){const i=n[o];!$.actionsDisabled&&i.shortcut!=null&&i.shortcut.matchesEvent(t)&&(Be.debug("Context hotkey matched!",t),(s=i.action)==null||s.call(i,t),t.stopPropagation(),t.preventDefault(),Be.debug2("Matched hotkey returned false, key event not consumed"))}}render(){const{"data-testid":t}=this.props,{globalActions:n}=this.state;return p("div",{className:"context-actions-listener",ref:this.container,"data-testid":t,children:p(ei,{actions:n})})}}ti.groups={default:null,high:100,medium:5e3,low:1e4,global:1e5,edit:100};const Ze=D.forwardRef((e,t)=>{var A,O;function n(x){const{menuItem:v,onMenuItemClick:k}=e;k(v,x)}function s(x){const{menuItem:v,onMenuItemMouseMove:k}=e;k(v,x)}function o(x){const{menuItem:v,onMenuItemContextMenu:k}=e;k(v,x)}function i(x,v,k){if(typeof x.type=="string")return x;const{closeMenu:V,menuItem:U,isKeyboardSelected:P,isMouseSelected:ie,"data-testid":oe}=e,re={menuItem:U,closeMenu:V,isKeyboardSelected:P,isMouseSelected:ie,iconElement:v,displayShortcut:k,"data-testid":oe};return D.cloneElement(x,{forwardedProps:re})}const{children:r,menuItem:a,isKeyboardSelected:l,isMouseSelected:c,"data-testid":h}=e,m=(A=a.shortcut)==null?void 0:A.getDisplayText();let T=null;if(a.icon){const x=a.icon;if(D.isValidElement(x))T=x;else{let v;a.iconColor!=null&&(a.disabled===void 0||!a.disabled)&&(v={color:a.iconColor}),T=p(X,{icon:x,style:v})}}let y=null;const M=Boolean(r);a.actions&&(y=p(X,{icon:_n}));let E=null;if(a.menuElement)E=p("div",{className:"custom-menu-item",onMouseMove:s,children:i(a.menuElement,T,m)});else{const x=a.disabled,v=a.iconOutline;E=p("button",{type:"button",className:N("btn-context-menu",{disabled:x},{active:(M||c)&&(x===void 0||!x)},{"keyboard-active":l!==void 0&&l&&(x===void 0||!x)}),onClick:n,onMouseMove:s,onContextMenu:o,title:(O=a.description)!=null?O:"",children:L("div",{className:"btn-context-menu-wrapper",children:[p("span",{className:N("icon",{outline:v}),children:T}),p("span",{className:"title",children:a.title}),m!==void 0&&p("span",{className:"shortcut",children:m}),y&&p("span",{className:N("submenu-indicator",{disabled:x}),children:y})]})})}return L("div",{className:"context-menu-item",ref:t,"data-testid":h,children:[r,E]})});Ze.displayName="ContextMenuItem";Ze.defaultProps={children:null,isKeyboardSelected:!1,isMouseSelected:!1,"data-testid":void 0};const tn=({className:e="","data-testid":t})=>L("div",{className:N("loading-spinner fa-layers",e),"data-testid":t,children:[p(X,{icon:Vn,className:"text-white-50"}),p(X,{icon:Ht,className:"text-primary",spin:!0})]}),Nt=H.module("ContextMenu"),lt=class extends C.exports.PureComponent{constructor(e){super(e),this.handleBlur=this.handleBlur.bind(this),this.handleCloseSubMenu=this.handleCloseSubMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMenuItemClick=this.handleMenuItemClick.bind(this),this.handleMenuItemContextMenu=this.handleMenuItemContextMenu.bind(this),this.handleMenuItemMouseMove=this.handleMenuItemMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowResize=this.handleWindowResize.bind(this),this.container=D.createRef(),this.oldFocus=document.activeElement,this.activeSubMenuRef=D.createRef(),this.subMenuTimer=0,this.rAF=0,this.initialPosition={top:e.top,left:e.left},this.state={menuItems:[],pendingItems:[],activeSubMenu:null,hasOverflow:!1,subMenuTop:null,subMenuLeft:null,subMenuParentWidth:0,subMenuParentHeight:0,keyboardIndex:-1,mouseIndex:-1}}static handleContextMenu(e){e.metaKey||(e.stopPropagation(),e.preventDefault())}componentDidMount(){this.initMenu(),this.verifyPosition(),window.addEventListener("resize",this.handleWindowResize),this.rAF=window.requestAnimationFrame(()=>{var t;(t=this.container.current)==null||t.focus();const{onMenuOpened:e}=this.props;e(this)})}componentDidUpdate(e,t){var o,i;const{actions:n}=this.props,{activeSubMenu:s}=this.state;s!==t.activeSubMenu&&(s==null?(o=this.container.current)==null||o.focus():this.setActiveSubMenuPosition()),e.actions!==n&&(this.initMenu(),(this.container.current==null||!this.container.current.contains(document.activeElement))&&((i=this.container.current)==null||i.focus())),this.verifyPosition()}componentWillUnmount(){this.cancelPromises(),window.removeEventListener("resize",this.handleWindowResize),cancelAnimationFrame(this.rAF)}getKeyboardIndex(){const{options:e}=this.props;if(e.separateKeyboardMouse!==void 0&&e.separateKeyboardMouse){const{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){const{options:t}=this.props;t.separateKeyboardMouse!==void 0&&t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){const{mouseIndex:e}=this.state;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){this.cancelPromises(),cancelAnimationFrame(this.rAF);const{options:e}=this.props;let t=e.initialKeyboardIndex;t===void 0&&(t=-1);const{actions:n}=this.props,s=$.getMenuItems(n),o=[];for(let i=s.length-1;i>=0;i-=1){const r=s[i];r instanceof Promise?this.initMenuPromise(r):o.push(r)}this.setState({mouseIndex:-1,keyboardIndex:t,activeSubMenu:null,menuItems:$.sortActions(o)})}initMenuPromise(e){const t=rt.makeCancelable(e);this.setState(n=>({pendingItems:n.pendingItems.concat(t)})),t.then(n=>{this.setState(s=>{const o=s.pendingItems.indexOf(t);if(o>=0){const i=s.pendingItems.slice();return i.splice(o,1),{menuItems:$.sortActions(s.menuItems.concat(n)),pendingItems:i}}return null})},n=>{rt.isCanceled(n)||(this.setState(s=>{const o=s.pendingItems.indexOf(t);if(o>=0){const i=s.pendingItems.slice();return i.splice(o,1),{pendingItems:i}}return null}),Nt.error(n))})}cancelPromises(){const{pendingItems:e}=this.state;e.map(t=>t.cancel())}setActiveSubMenuPosition(){if(this.activeSubMenuRef.current===null)return;const e=this.activeSubMenuRef.current.getBoundingClientRect();this.setState({subMenuTop:e.top,subMenuLeft:e.right,subMenuParentHeight:e.height,subMenuParentWidth:e.width})}verifyPosition(){var m,T,y,M;const{options:e,updatePosition:t,subMenuParentWidth:n,subMenuParentHeight:s,top:o,left:i}=this.props;if(!this.container.current||e.doNotVerifyPosition!=null&&e.doNotVerifyPosition)return;let{top:r,left:a}=this.initialPosition;const{width:l,height:c}=(T=(m=this.container.current)==null?void 0:m.getBoundingClientRect())!=null?T:{width:0,height:0},h=((M=(y=this.container.current)==null?void 0:y.scrollHeight)!=null?M:0)>window.innerHeight;c===0||l===0||(r+c>window.innerHeight&&(r-c-s>0?r-=c-s:r=window.innerHeight-c),a+l>window.innerWidth&&(a=a-l-n),(i!==a||o!==r)&&(this.setState({hasOverflow:h}),t(r,a)))}handleWindowResize(){!this.container.current||this.closeMenu(!0)}handleBlur(e){if(!this.container.current){Nt.warn("Container is null!");return}if(!this.container.current.contains(e.relatedTarget)){let t=e.relatedTarget,n=!1;for(;t&&!n;)n=t.hasAttribute("data-dh-context-menu"),t=t.parentElement;n||this.closeMenu(!0)}}isEscapeKey(e){const{left:t}=this.props;return e==="Escape"||t<0&&e==="ArrowRight"||e==="ArrowLeft"}handleKeyDown(e){const{menuItems:t}=this.state,n=this.getKeyboardIndex();let s=n,o=!1;if(e.key==="Enter"||e.key===" "){n>=0&&n<t.length&&this.handleMenuItemClick(t[n],e);return}if(e.key==="ArrowRight"?n>=0&&n<=t.length?o=!0:s=0:this.isEscapeKey(e.key)?s=null:e.key==="ArrowUp"||e.shiftKey&&e.key==="Tab"?s=$.getNextMenuItem(s,-1,t):(e.key==="ArrowDown"||e.key==="Tab")&&(s=$.getNextMenuItem(s,1,t)),o){this.openSubMenu(n),e.preventDefault(),e.stopPropagation();return}n!==s&&(s!==null?this.setKeyboardIndex(s):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}openSubMenu(e){const{menuItems:t,activeSubMenu:n}=this.state,s=t[e].actions?e:null;n!==s&&this.setState({activeSubMenu:s,subMenuTop:null,subMenuLeft:null})}closeMenu(e=!1){const{closeMenu:t,onMenuClosed:n}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),n(this)})}closeSubMenu(){this.setState({activeSubMenu:null})}handleCloseSubMenu(e){e?this.closeMenu(!0):this.closeSubMenu()}handleMenuItemClick(e,t){t.preventDefault(),t.stopPropagation();const{menuItems:n}=this.state;e!=null&&(e.disabled===void 0||!e.disabled)&&(e.actions!=null?this.openSubMenu(n.indexOf(e)):e.action!=null&&(e.action(),this.closeMenu(!0)))}handleMenuItemContextMenu(e,t){t.metaKey||this.handleMenuItemClick(e,t)}handleMenuItemMouseMove(e){const{menuItems:t}=this.state,n=t.indexOf(e);this.setMouseIndex(n),n>=0&&n<t.length&&(e.disabled===void 0||!e.disabled)&&this.openSubMenu(n)}handleMouseLeave(){this.setMouseIndex(-1)}render(){const e=[],{top:t,left:n}=this.props,{activeSubMenu:s,hasOverflow:o,keyboardIndex:i,menuItems:r,mouseIndex:a,pendingItems:l,subMenuTop:c,subMenuLeft:h,subMenuParentWidth:m,subMenuParentHeight:T}=this.state;for(let O=0;O<r.length;O+=1){const x=r[O];O>0&&x.group!==r[O-1].group&&e.push(p("hr",{},`${O}.separator`));const v=p(Ze,{ref:s===O?this.activeSubMenuRef:null,isKeyboardSelected:i===O,isMouseSelected:a===O,menuItem:x,closeMenu:this.handleCloseSubMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:this.handleMenuItemContextMenu},O);e.push(v)}let y=null;l.length>0&&(y=p("div",{className:"loading",children:p(tn,{})}));const{menuStyle:M,"data-testid":E}=this.props,A=s!==null&&c!==null&&h!==null;return L(xn,{children:[L("div",{className:N({"has-overflow":o},"context-menu-container"),style:{top:t,left:n,...M},ref:this.container,"data-dh-context-menu":!0,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,onContextMenu:lt.handleContextMenu,role:"menuitem",tabIndex:0,"data-testid":E,children:[e,y]}),A&&s!==null&&c!==null&&h!==null&&p(lt,{actions:r[s].actions||[],closeMenu:this.handleCloseSubMenu,top:c,left:h,updatePosition:(O,x)=>{this.setState({subMenuTop:O,subMenuLeft:x})},subMenuParentWidth:m,subMenuParentHeight:T},`sub-${s}`)]})}};let nn=lt;nn.defaultProps={subMenuParentWidth:0,subMenuParentHeight:0,closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0};class ni extends C.exports.Component{constructor(t){super(t),this.handleMenuClose=this.handleMenuClose.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.container=D.createRef(),this.openMenu=D.createRef(),this.state={actions:null,left:0,top:0}}componentDidMount(){var t;(t=this.container.current)!=null&&t.parentElement&&this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu)}componentWillUnmount(){var t;(t=this.container.current)!=null&&t.parentElement&&this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu)}handleContextMenu(t){if(!$.isContextActionEvent(t)||!this.container.current||t.metaKey||t.ctrlKey)return;const n=$.getMenuItems(t.contextActions),s=this.container.current.getBoundingClientRect(),o=t.clientY-s.top,i=t.clientX-s.left;if(n.length===0){if(t.target===this.container.current){t.preventDefault(),this.setState({actions:null},()=>{const r=document.elementFromPoint(i,o),a=new MouseEvent("contextmenu",{clientX:t.clientX,clientY:t.clientY,bubbles:!0,cancelable:!0});r==null||r.dispatchEvent(a)});return}return}t.preventDefault(),this.setState({actions:n,top:o,left:i})}handleMenuClose(t){t===this.openMenu.current&&this.setState({actions:null})}render(){let t=null;const{"data-testid":n}=this.props,{actions:s,top:o,left:i}=this.state;return s&&(t=p(nn,{ref:this.openMenu,actions:s,onMenuClosed:this.handleMenuClose,top:o,left:i,updatePosition:(r,a)=>{this.setState({top:r,left:a})},"data-testid":n})),p("div",{className:N("context-menu-root",{active:s}),ref:this.container,children:t})}}const Me=class extends C.exports.Component{static handleEnter(e){const t=e;t.style.height="0"}static handleEntering(e){const t=e;t.style.height=`${Me.getHeight(t)}px`}static handleExiting(e){const t=e;t.style.height="0"}static handleExit(e){const t=e;t.style.height=`${Me.getHeight(t)}px`}static getHeight(e){const t=e.scrollWidth-e.clientWidth;return e.scrollHeight-t}constructor(e){super(e),this.handleEntered=this.handleEntered.bind(this)}handleEntered(e){const t=e;t.style.height="";const{autoFocusOnShow:n}=this.props;if(n!==void 0&&n){const s=t.querySelector("input, select, textarea");s!=null&&s.focus()}}render(){const{children:e,className:t,in:n,"data-testid":s}=this.props;return p(dt,{in:n,classNames:{enterActive:"collapsing",enterDone:"collapse show",exitActive:"collapsing",exitDone:"collapse"},onEnter:Me.handleEnter,onEntering:Me.handleEntering,onEntered:this.handleEntered,onExit:Me.handleExit,onExiting:Me.handleExiting,timeout:350,children:o=>p("div",{className:N({collapse:o==="exited"},t),"data-testid":s,children:e})})}};let sn=Me;sn.propTypes={className:d.exports.string,in:d.exports.bool.isRequired,children:d.exports.node.isRequired,autoFocusOnShow:d.exports.bool,"data-testid":d.exports.string};sn.defaultProps={className:"",autoFocusOnShow:!1,"data-testid":void 0};function on(e){const t=C.exports.useRef(null);return C.exports.useEffect(function(){!e||(typeof e=="function"?e(t.current):e.current=t.current)}),t}const Oe=D.forwardRef((e,t)=>{const{checked:n=!1,children:s,className:o,disabled:i,inputClassName:r,isInvalid:a,labelClassName:l,name:c,onChange:h,"data-testid":m}=e,[T]=C.exports.useState(Ut()),y=on(t);C.exports.useEffect(function(){y.current&&(y.current.indeterminate=n===null)},[y,n]);const M=C.exports.useCallback(E=>{y.current&&(y.current.indeterminate=n===null),h&&h(E)},[y,n,h]);return L("div",{className:N("custom-control custom-checkbox",o),children:[p("input",{type:"checkbox",ref:y,checked:n!=null?n:!1,className:N("custom-control-input",r,{"is-invalid":a}),disabled:i,id:T,name:c,onChange:M,"data-testid":m}),p("label",{className:N("custom-control-label",l),htmlFor:T,children:s})]})});Oe.displayName="Checkbox";Oe.propTypes={checked:(e,t)=>{const{[t]:n}=e;return n!==null&&typeof n!="boolean"?new Error("Checked must be a boolean or null for indeterminate"):null},children:d.exports.node.isRequired,className:d.exports.string,disabled:d.exports.bool,inputClassName:d.exports.string,isInvalid:d.exports.bool,labelClassName:d.exports.string,name:d.exports.string,onChange:d.exports.func,"data-testid":d.exports.string};Oe.defaultProps={checked:!1,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};class bt extends C.exports.PureComponent{constructor(t){super(t),this.inputField=D.createRef()}focus(){var t;(t=this.inputField.current)==null||t.focus()}render(){const{value:t,placeholder:n,onBlur:s,onChange:o,className:i,disabled:r,matchCount:a,id:l,onKeyDown:c,"data-testid":h}=this.props;return L("div",{className:N("search-group",i),children:[p("input",{type:"search",value:t,onBlur:s,onChange:o,onKeyDown:c,className:"form-control",disabled:r,placeholder:n,ref:this.inputField,id:l,"data-testid":h}),a!=null&&p("span",{className:"search-match",children:a}),p("span",{className:"search-icon",children:p(X,{icon:Hn})})]})}}bt.defaultProps={placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0};var rn=(e=>(e.UP="UP",e.DOWN="DOWN",e))(rn||{});const _e=class extends C.exports.Component{constructor(e){super(e),this.getCachedFilteredOptions=G((t,n)=>t.filter(s=>s.title.toLowerCase().indexOf(n.toLowerCase())>=0||s.value.toLowerCase().indexOf(n.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=D.createRef(),this.cbContainer=D.createRef(),this.toggleButton=D.createRef(),this.menuContainer=D.createRef(),this.input=D.createRef(),this.searchInput=D.createRef()}componentDidUpdate(){const{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.focus()}resetValue(){this.setState({value:""})}updateInputValue(e){const{onChange:t}=this.props;this.setState({value:e}),t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var r,a;const{filter:t,filteredOptions:n,keyboardOptionIndex:s}=this.state,{options:o}=this.props,i=t?n:o;switch(e.key){case"Enter":((r=i[s])==null?void 0:r.value)!=null&&this.updateInputValue(i[s].value),this.closeMenu(),(a=this.input.current)==null||a.focus(),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(_e.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(_e.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":t!==""?(this.setState({filter:""}),e.stopPropagation()):this.closeMenu();break;case"Tab":!e.shiftKey&&s===i.length-1&&this.closeMenu();break}}handleMenuNavigation(e){const{filter:t,filteredOptions:n,keyboardOptionIndex:s}=this.state,{options:o}=this.props,r=(t?n:o).length;let a=0;switch(e){case _e.MENU_NAVIGATION_DIRECTION.UP:a=-1;break;case _e.MENU_NAVIGATION_DIRECTION.DOWN:a=1;break}a!==0&&this.setState({keyboardOptionIndex:(s+a+r)%r})}handleInputKeyDown(e){const{onEnter:t}=this.props,{menuIsOpen:n}=this.state;e.key==="ArrowDown"||e.key==="ArrowUp"?n||this.openMenu():e.key==="Enter"&&t()}handleInputChange(e){this.updateInputValue(e.target.value)}handleOptionClick(e){var r;const t=Number(e.currentTarget.value),{filter:n,filteredOptions:s}=this.state,{options:o}=this.props,i=n?s:o;this.updateInputValue(i[t].value),this.closeMenu(),(r=this.input.current)==null||r.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleFilterChange(e){var o;const{options:t}=this.props,n=e.target.value,s=this.getCachedFilteredOptions(t,n);this.setState({filter:n,filteredOptions:s,keyboardOptionIndex:0}),(o=this.popper.current)==null||o.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){const{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.focus()}handleMenuExited(){var t;const{menuIsOpen:e}=this.state;e&&(this.setState({menuIsOpen:!1}),(t=this.popper.current)==null||t.hide()),this.setState({filter:""})}toggleMenu(e){const{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.show()})}closeMenu(e=!0){var t,n;this.setState({menuIsOpen:!1}),e&&((t=this.input.current)==null||t.focus()),(n=this.popper.current)==null||n.hide()}updateKeyboardIndex(){const{value:e,filter:t,filteredOptions:n}=this.state,{options:s}=this.props,i=(t?n:s).findIndex(r=>r.value===e);this.setState({keyboardOptionIndex:i})}scrollOptionIntoView(){var t;const e=(t=this.menuContainer.current)==null?void 0:t.querySelector(".cb-option-btn.keyboard-active");e instanceof HTMLElement&&e.scrollIntoView({block:"nearest",inline:"nearest"})}renderMenuElement(){const{searchPlaceholder:e}=this.props,{filter:t,inputWidth:n}=this.state;return L("div",{className:"cb-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:s=>{s.stopPropagation()},style:{width:n},onBlur:this.handleMenuBlur,children:[p("div",{className:"cb-search-input-container",children:p(bt,{value:t,ref:this.searchInput,onChange:this.handleFilterChange,className:"cb-search-input",placeholder:e})}),p("div",{className:"cb-options-container",children:p("div",{className:"cb-options",children:this.renderOptions()})})]})}renderOptions(){const{options:e}=this.props,{keyboardOptionIndex:t,filter:n,filteredOptions:s}=this.state;return(n?s:e).map((i,r)=>{const a=`option-${r}-${i.value}`;return p("button",{type:"button",value:r,className:N("cb-option-btn",{"keyboard-active":t===r}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:i.title},a)})}render(){const{options:e,inputPlaceholder:t,disabled:n,className:s,defaultValue:o,spellCheck:i,"data-testid":r}=this.props,{value:a}=this.state;let{popperOptions:l}=this.props;return l={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...l},L("div",{className:"input-group cb-container",ref:this.cbContainer,children:[p("input",{value:a||o,className:N("form-control",s,"cb-input"),ref:this.input,onChange:this.handleInputChange,placeholder:t||(e[0]!=null?e[0].title:void 0),disabled:n,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:i,"data-testid":r!==void 0?`${r}-input`:void 0}),p("div",{className:"input-group-append cb-dropdown",children:L("button",{type:"button",className:"btn cb-btn form-control",ref:this.toggleButton,onClick:this.toggleMenu,onKeyDown:this.handleInputKeyDown,disabled:n,"data-testid":r!==void 0?`${r}-btn`:void 0,children:[p(X,{icon:Bn}),p(xe,{ref:this.popper,options:l,className:N("combobox interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})})]})}};let Qe=_e;Qe.MENU_NAVIGATION_DIRECTION=rn;Qe.DROP_DOWN_MENU_HEIGHT=200;Qe.propTypes={options:d.exports.arrayOf(d.exports.shape({title:d.exports.string.isRequired,value:d.exports.string.isRequired})).isRequired,popperOptions:d.exports.shape({title:d.exports.string.isRequired,value:d.exports.string.isRequired}),onChange:d.exports.func,inputPlaceholder:d.exports.string,searchPlaceholder:d.exports.string,disabled:d.exports.bool,className:d.exports.string,defaultValue:d.exports.string,spellCheck:d.exports.bool,onEnter:d.exports.func,"data-testid":d.exports.string};Qe.defaultProps={onChange(){},inputPlaceholder:"",searchPlaceholder:"Search",disabled:!1,className:"",defaultValue:"",popperOptions:null,spellCheck:!0,onEnter(){},"data-testid":void 0};const te=H.module("MaskedInput"),De={FORWARD:"forward",BACKWARD:"backward",NONE:"none"},We="\u2007";function St(e,t,n){return e.substring(0,t)+n+e.substring(t+1)}function si(e,t,n){return e.length<n?`${e}${t.substring(e.length,n)}`:e}function At(e,t){let{length:n}=e;for(let s=e.length-1;s>=0&&t[s]===e[s];s-=1)n=s;return e.substring(0,n)}const Je=D.forwardRef((e,t)=>{const{className:n,example:s,getNextSegmentValue:o=(w,I,S)=>S,getPreferredReplacementString:i=St,onChange:r=()=>!1,onSelect:a=()=>!1,pattern:l,placeholder:c,selection:h,value:m,onFocus:T=()=>!1,onBlur:y=()=>!1,"data-testid":M}=e,E=on(t),A=C.exports.useMemo(()=>Array.isArray(s)?s:[s],[s]),O=C.exports.useMemo(()=>A[0].replace(/[a-zA-Z0-9]/g,We),[A]);C.exports.useEffect(function(){var I;if(h!=null){te.debug("setting selection...",h);const{selectionStart:S,selectionEnd:F,selectionDirection:B}=h;(I=E.current)==null||I.setSelectionRange(S,F,B),te.debug("selection set!")}},[h,E]);const x=C.exports.useCallback(w=>{let I=w,S=w;const F=A.length>0?A[0]:m;for(let _=I-1;_>=0&&/[a-zA-Z0-9]/g.test(F.charAt(_));_-=1)I=_;for(let _=S;_<F.length&&/[a-zA-Z0-9]/g.test(F.charAt(_));_+=1)S=_+1;const B=I===S?De.NONE:De.BACKWARD;return{selectionStart:I,selectionEnd:S,selectionDirection:B}},[A,m]);function v(w,I,S=w.length){let F="";for(let B=0;B<S;B+=1)w.charAt(B)!==We?F=F.concat(w[B]):F=F.concat(I[B]);return F=F.concat(I.substring(S)),F}function k(w,I=w.length){const S=new RegExp(`^${l}$`);if(S.test(w))return!0;for(let F=0;F<A.length;F+=1){const B=v(w,A[F],I);if(S.test(B))return!0}return!1}function V(w){const I=x(w),S=I.selectionEnd+1;return S>=m.length?I:x(S)}function U(w){const I=x(w),S=I.selectionStart-1;return S<=0?I:x(S)}function P(w,I){const S=x(w),F=m.substring(S.selectionStart,S.selectionEnd),B=o(S,I,F,m),_=m.substring(0,S.selectionStart)+B+m.substring(S.selectionEnd);k(_,S.selectionEnd)&&(r(_),a(S))}const ie=C.exports.useCallback(w=>{const{selectionStart:I=0,selectionEnd:S=0,selectionDirection:F="none"}=w.target;if(I===null||S===null||F===null){te.error("Selection attempted on non-text input element",w.target);return}if(te.debug2("handleSelect",I,S,F),!(h!=null&&I===h.selectionStart&&S===h.selectionEnd)){if(h!=null&&I===m.length&&S===m.length&&w.nativeEvent.type!=="mouseup"){a({...h});return}if(I===S){const B=x(I);te.debug("Selection segment from ",I,S,"=>",B),a(B)}else a({selectionStart:I,selectionEnd:S,selectionDirection:F})}},[x,a,h,m]),oe=C.exports.useCallback(w=>{var S;if(!E.current)return;te.debug("handleSelectCapture",w);const I=(S=E.current.selectionStart)!=null?S:0;I===m.length&&h!=null&&I!==h.selectionStart&&(w.preventDefault(),w.stopPropagation())},[E,h,m]);function re(w){if(w.preventDefault(),w.stopPropagation(),!E.current)return;const{key:I}=w,{selectionStart:S=0,selectionEnd:F=0}=E.current;if(S===null||F===null){te.error("Selection arrow nvaigation attempted on non-text input element",w.target);return}I==="ArrowLeft"?a(U(S)):I==="ArrowRight"?a(V(F)):I==="ArrowUp"?P(S,-1):I==="ArrowDown"&&P(S,1)}function Se(w){if(!E.current)return;te.debug("handleKeyDown",w);const{key:I}=w,{selectionStart:S=0,selectionEnd:F=0}=E.current;if(S===null||F===null){te.error("Selection key event on non-text input element",w.target);return}if(I.startsWith("Arrow")){re(w);return}if(I==="Delete"||I==="Backspace"){if(w.preventDefault(),w.stopPropagation(),F>=At(m,O).length){const _=m.substring(0,S===F?S-1:S),ae=At(_,O);ae!==m&&(r(ae),a({selectionStart:ae.length,selectionEnd:ae.length,selectionDirection:De.NONE}));return}if(S!==F){const _=m.substring(0,S)+m.substring(S,F).replace(/[a-zA-Z0-9]/g,We)+m.substring(F);te.debug("Range ",S,F,"deleted, setting value",_),r(_),a({selectionStart:S,selectionEnd:S,selectionDirection:De.NONE})}else if(S>0)for(let _=S-1;_>=0;_-=1){const ae=m.substring(0,_)+m.substring(_,S).replace(/[a-zA-Z0-9]/g,We)+m.substring(S);if(ae!==m){r(ae),a({selectionStart:_,selectionEnd:_,selectionDirection:De.NONE});return}}return}if(w.altKey||w.metaKey||w.ctrlKey||I.length>1)return;w.preventDefault(),w.stopPropagation();const B=Array.from(new Set([I,I.toUpperCase(),I.toLowerCase()]));for(let _=0;_<B.length;_+=1){const ae=B[_],En=/[a-zA-Z0-9]/g.test(ae)?A[0].length-1:S;for(let me=S;me<=En;me+=1){const Mn=si(m,A[0],me+1),Ye=i(Mn,me,ae,S,F);if(k(Ye,me+1)){const Mt=x(me),et=me+1;let tt={selectionStart:et,selectionEnd:et,selectionDirection:De.NONE};if(et>=Mt.selectionEnd){const It=V(me);It.selectionStart!==Mt.selectionStart&&(tt=It)}te.debug("handleKeyDown",I,"=>",Ye,tt),r(Ye),a(tt);return}}}}return p("input",{ref:E,className:N("form-control masked-input",n),type:"text",pattern:l,placeholder:c,value:m,onChange:()=>{},onKeyDown:Se,onSelect:ie,onSelectCapture:oe,onFocus:T,onBlur:y,"data-testid":M})});Je.defaultProps={className:"",placeholder:void 0,onChange(){},onSelect(){},getNextSegmentValue:(e,t,n)=>n,getPreferredReplacementString:St,selection:void 0,onFocus(){},onBlur(){},"data-testid":void 0};const ii=H.module("TimeInput"),oi="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]",ri=["00:00:00","12:34:56","23:59:59"],an=D.forwardRef((e,t)=>{const{allowValueWrapping:n=!0,className:s="",onChange:o=()=>!1,value:i=0,onFocus:r=()=>!1,onBlur:a=()=>!1,onSelect:l=()=>!1,"data-testid":c}=e,[h,m]=C.exports.useState(Ie.formatTime(i)),[T,y]=C.exports.useState(),M=C.exports.useRef(null);C.exports.useImperativeHandle(t,()=>({focus:()=>{var v;(v=M.current)==null||v.focus()},setSelection:v=>{var k;(k=M.current)==null||k.focus(),y(v)}}),[]),C.exports.useEffect(function(){m(Ie.formatTime(i))},[i]);function E(v,k,V){const U=v.selectionStart===0?24:60;let P=parseInt(V,10)-k;return Number.isNaN(P)?P=0:n?P=(P%U+U)%U:P=Math.min(Math.max(0,P),U-1),`${P}`.padStart(2,"0")}function A(v,k,V,U,P){return U===0&&P===2&&k===1&&parseInt(V,10)>1?`0${V}${v.substring(2)}`:St(v,k,V)}function O(v){ii.debug("handleChange",v),m(v),Ie.isTimeString(v)&&o(Ie.parseTime(v))}const x=C.exports.useCallback(v=>{y(v),l(v)},[l]);return p(Je,{ref:M,className:s,example:ri,getNextSegmentValue:E,getPreferredReplacementString:A,onChange:O,onSelect:x,pattern:oi,selection:T,value:h,onFocus:r,onBlur:a,"data-testid":c})});an.defaultProps={allowValueWrapping:!0,className:"",onChange:()=>!1,onSelect:()=>!1,value:0,onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};class ln extends C.exports.PureComponent{constructor(t){var o;super(t),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=D.createRef(),this.oldFocus=document.activeElement,this.rAF=0;const{options:n}=t,s=(o=n.initialKeyboardIndex)!=null?o:-1;this.state={menuItems:[],keyboardIndex:s,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.rAF=window.requestAnimationFrame(()=>{var n;(n=this.container.current)==null||n.focus();const{onMenuOpened:t}=this.props;t(this)})}componentDidUpdate(t){const{actions:n}=this.props;t.actions!==n&&this.initMenu()}componentWillUnmount(){cancelAnimationFrame(this.rAF)}getKeyboardIndex(){const{options:t}=this.props;if(t.separateKeyboardMouse!==void 0&&t.separateKeyboardMouse){const{keyboardIndex:n}=this.state;return n}return this.getMouseIndex()}setKeyboardIndex(t){const{options:n}=this.props;n.separateKeyboardMouse!==void 0&&n.separateKeyboardMouse?this.setState({keyboardIndex:t}):this.setMouseIndex(t)}getMouseIndex(){const{mouseIndex:t}=this.state;return t}setMouseIndex(t){this.setState({mouseIndex:t})}initMenu(){cancelAnimationFrame(this.rAF),this.setState({menuItems:[]});const{actions:t}=this.props,n=$.getMenuItems(t,!1);n.length>0&&this.setState(s=>({menuItems:$.sortActions(s.menuItems.concat(n))}))}handleKeyDown(t){const{menuItems:n}=this.state,s=this.getKeyboardIndex();let o=s;if(t.key==="Enter"||t.key===" "){s!=null&&s>=0&&s<n.length&&this.handleMenuItemClick(n[s],t);return}t.key==="Escape"?o=null:t.key==="ArrowUp"||t.key==="Tab"&&t.shiftKey===!0?o=$.getNextMenuItem(o!=null?o:0,-1,n):(t.key==="ArrowDown"||t.key==="Tab"&&t.shiftKey===!1)&&(o=$.getNextMenuItem(o!=null?o:0,1,n)),s!==o&&(o!==null?this.setKeyboardIndex(o):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),t.preventDefault(),t.stopPropagation())}closeMenu(t=!1){const{closeMenu:n,onMenuClosed:s}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{n(t),s(this)})}handleCloseMenu(){this.closeMenu()}handleMenuItemClick(t,n){n.preventDefault(),n.stopPropagation(),t!=null&&(t.disabled===void 0||!t.disabled)&&t.action!=null&&(t.action(),this.closeMenu(!0))}handleMenuItemMouseMove(t){const{menuItems:n}=this.state,s=n.indexOf(t);this.setMouseIndex(s)}handleMouseLeave(){this.setMouseIndex(-1)}render(){const t=[],{"data-testid":n}=this.props,{keyboardIndex:s,menuItems:o,mouseIndex:i}=this.state;for(let a=0;a<o.length;a+=1){const l=o[a];a>0&&l.group!==o[a-1].group&&t.push(p("hr",{},`${a}.separator`));const c=p(Ze,{isKeyboardSelected:s===a,isMouseSelected:i===a,menuItem:l,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},a);t.push(c)}const{menuStyle:r}=this.props;return p("div",{className:"context-menu-container",style:{...r},ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":n,children:t})}}ln.defaultProps={closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0};class cn extends C.exports.PureComponent{constructor(t){super(t),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=D.createRef(),this.parent=null,this.popper=D.createRef(),this.isOpen=!1}componentDidMount(){var n;const{isShown:t}=this.props;t===null?(n=this.container.current)!=null&&n.parentElement&&(this.parent=this.container.current.parentElement,this.parent.addEventListener("click",this.handleClick)):t&&this.openMenu()}componentDidUpdate(t){const{isShown:n}=this.props;t.isShown!==n&&(n!==null&&n?window.requestAnimationFrame(()=>{this.openMenu()}):this.closeMenu())}componentWillUnmount(){this.parent&&this.parent.removeEventListener("click",this.handleClick)}closeMenu(){var t;(t=this.popper.current)==null||t.hide()}openMenu(){this.popper.current&&!this.isOpen&&(this.popper.current.show(),this.isOpen=!0)}scheduleUpdate(){var t;(t=this.popper.current)==null||t.scheduleUpdate()}handleClick(t){t.preventDefault(),t.stopPropagation(),this.openMenu()}handleCloseMenu(){this.closeMenu()}handleExited(){this.isOpen=!1;const{onMenuClosed:t}=this.props;t()}render(){const{actions:t,onMenuOpened:n,popperClassName:s,"data-testid":o}=this.props,{menuStyle:i}=this.props;let{options:r,popperOptions:a}=this.props;return a={placement:"bottom",...a},r={separateKeyboardMouse:!0,...r},p("div",{className:"menu-actions-listener",ref:this.container,"data-testid":o,children:p(xe,{ref:this.popper,options:a,className:N("menu-popper",s),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:p(ln,{actions:t,closeMenu:this.handleCloseMenu,onMenuOpened:n,options:r,menuStyle:i})})})}}cn.defaultProps={isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0};const Ft=-1;var un=(e=>(e.UP="UP",e.DOWN="DOWN",e))(un||{});const he=class extends C.exports.Component{constructor(e){super(e);const{value:t,valueToTime:n}=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=D.createRef(),this.menuContainer=D.createRef(),this.button=D.createRef(),this.input=D.createRef(),this.state={keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,customTime:n(t),inputFocused:!1}}getSelectedText(){const{options:e,value:t,placeholder:n}=this.props,{customTime:s}=this.state;if(t===null)return n;for(let o=0;o<e.length;o+=1){const i=e[o];if(i.value===t)return i.title}return Ie.formatTime(s)}setInputWidth(){this.csContainer.current&&this.setState({inputWidth:this.csContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.button.current)==null||e.focus()}updateInputValue(e){const{onChange:t}=this.props;t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var o;const{keyboardOptionIndex:t,inputFocused:n}=this.state,{options:s}=this.props;switch(e.key){case"Enter":case" ":n?this.updateFromCustom():this.updateInputValue(s[t].value),this.closeMenu(),(o=this.button.current)==null||o.focus(),e.stopPropagation(),e.preventDefault();break;case"Tab":e.shiftKey?this.handleMenuNavigation(he.MENU_NAVIGATION_DIRECTION.UP):this.handleMenuNavigation(he.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(he.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(he.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":this.closeMenu();break}}handleMenuNavigation(e){const{keyboardOptionIndex:t,inputFocused:n}=this.state,{options:s}=this.props,o=s.length;let i=t;switch(e){case he.MENU_NAVIGATION_DIRECTION.UP:if(!n&&t===0){this.focusInput();break}else n&&this.focusOption(t);t>0&&!n?(i=(i-1)%o,this.setState({keyboardOptionIndex:i})):t===0&&(i=o-1,this.setState({keyboardOptionIndex:i})),this.scrollOptionIntoView(i);break;case he.MENU_NAVIGATION_DIRECTION.DOWN:if(!n&&t===o-1){this.focusInput();break}else n&&this.focusOption(t);t<o&&!(n&&t===0)&&(i=(i+1)%o,this.setState({keyboardOptionIndex:i})),this.scrollOptionIntoView(i);break}}handleOptionClick(e){const t=Number(e.currentTarget.value),{options:n,timeToValue:s}=this.props,{customTime:o}=this.state;if(t===Ft){const i=s(o);this.updateAndClose(i)}else this.updateAndClose(n[t].value)}updateAndClose(e){var t;this.updateInputValue(e),this.closeMenu(),(t=this.button.current)==null||t.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleMenuOpened(){var i;const{options:e,value:t}=this.props,{keyboardOptionIndex:n}=this.state;this.scrollOptionIntoView(n);const s=(i=this.menuContainer.current)==null?void 0:i.querySelector(".cs-option-btn.keyboard-active");if(s instanceof HTMLElement&&s.focus(),t===null)return;e.map(r=>r.value).indexOf(t)<0&&this.focusInput()}focusInput(){var e;(e=this.input.current)==null||e.focus()}focusOption(e){var n;const t=(n=this.menuContainer.current)==null?void 0:n.querySelector(".cs-options");if(t&&t.children!=null){const s=t.children.item(e);s instanceof HTMLElement&&s.focus()}}handleMenuExited(){const{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}handleCustomInput(e){const{timeToValue:t}=this.props,n=t(e);this.updateInputValue(n),this.setState({customTime:e})}updateFromCustom(){const{timeToValue:e}=this.props,{customTime:t}=this.state,n=e(t);this.updateInputValue(n)}toggleMenu(e){const{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0})}closeMenu(e=!0){var t;this.setState({menuIsOpen:!1}),e&&((t=this.button.current)==null||t.focus())}updateKeyboardIndex(){const{options:e,value:t}=this.props;if(t===null)return;const n=e.map(s=>s.value).indexOf(t);n>0&&this.setState({keyboardOptionIndex:n})}scrollOptionIntoView(e){var n;const t=(n=this.menuContainer.current)==null?void 0:n.querySelector(".cs-options");if(t&&t.children!=null){const s=t.children.item(e);s instanceof HTMLElement&&s.offsetTop>he.DROP_DOWN_MENU_HEIGHT?t.scrollTop=s.offsetTop-he.DROP_DOWN_MENU_HEIGHT:(s instanceof HTMLElement&&s.offsetTop<0||e===0)&&(t.scrollTop=0)}}renderMenuElement(){const{inputWidth:e}=this.state;return p("div",{className:"cs-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:t=>{t.stopPropagation()},style:{width:e},children:p("div",{className:"cs-options-container",children:p("div",{className:"cs-options",children:this.renderOptions()})})})}renderOptions(){const{options:e,value:t,icon:n,customText:s}=this.props,{keyboardOptionIndex:o,customTime:i,inputFocused:r}=this.state;let a=!1;const l=[];for(let c=0;c<e.length;c+=1){const h=e[c],m=`option-${c}-${h.value}`;a=a||h.value===t,l.push(L("button",{type:"button",value:c,className:N("cs-option-btn",{"keyboard-active":o===c&&!r}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[h.value===t&&p(X,{icon:n,className:"mr-2"}),h.value!==t&&p("span",{className:"mr-4"}),h.title]},m))}return l.push(p("hr",{className:"cs-divider"},"option-divider")),l.push(L("button",{type:"button",value:Ft,className:N("cs-option-btn",{"keyboard-active":r}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[!a&&t!==null?p(X,{icon:n,className:"mr-2"}):p("span",{className:"mr-4"}),s]},"option-custom-label")),l.push(L("div",{className:"cs-custom-container",children:[p("span",{className:"mr-2"}),p(an,{ref:this.input,onChange:this.handleCustomInput,value:i,onFocus:()=>this.setState({inputFocused:!0}),onBlur:()=>this.setState({inputFocused:!1})},"option-input"),p("span",{className:"ml-2"})]},"cs-custom-container")),l.push(p("hr",{className:"mb-2"},"option-end")),l}render(){const{disabled:e,invalid:t,value:n,"data-testid":s}=this.props,{menuIsOpen:o}=this.state;let{popperOptions:i}=this.props;return i={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...i},p("div",{className:"input-group cs-container context-menu",ref:this.csContainer,"data-testid":s,children:p("div",{className:N("input-group-append cs-dropdown",{"cs-dropdown-invalid":t}),children:L("button",{type:"button",className:N("btn cs-btn form-control",{"cs-btn-invalid":t}),ref:this.button,onClick:this.toggleMenu,disabled:e,children:[p("span",{className:N({"text-muted":n===null}),children:this.getSelectedText()}),p("span",{children:p(X,{icon:Bt,className:"cs-caret"})}),p(cn,{isShown:o,actions:{menuElement:this.renderMenuElement()},popperOptions:i,popperClassName:"CustomTimeSelect",onMenuOpened:this.handleMenuOpened,onMenuClosed:this.handleMenuExited,menuStyle:{maxWidth:"100rem"}})]})})})}};let Tt=he;Tt.MENU_NAVIGATION_DIRECTION=un;Tt.DROP_DOWN_MENU_HEIGHT=125;Tt.defaultProps={onChange(){},value:null,disabled:!1,popperOptions:{},icon:Pn,customText:"Custom",placeholder:"Select a time",valueToTime:e=>e===null?0:Math.round(e/1e3),timeToValue:e=>e*1e3,invalid:!1,"data-testid":void 0};function ve(e,t,n,s,o){const i=s-n+1;return`${((parseInt(t,10)-e-n)%i+i)%i+n}`.padStart(o,"0")}function dn(e,t,n){const{selectionStart:s}=e;return s===0?ve(t,n,1900,2099,4):s===5?ve(t,n,1,12,2):s===8?ve(t,n,1,31,2):s===11?ve(t,n,0,23,2):s===17||s===14?ve(t,n,0,59,2):s===20||s===24||s===28?ve(t,n,0,999,3):n}const ai=H.module("DateTimeInput"),li="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",ci="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]\\.[0-9]{3}\u200B[0-9]{3}\u200B[0-9]{3}",ui=`${li} ${ci}`,Ke="2022-01-01",hn=`${Ke} 00:00:00.000000000`,di="YYYY-MM-DD HH:MM:SS.SSSSSSSSS";function Ot(e){return e!=null&&e.length>=Ke.length?`${e.substring(0,Ke.length)}${e.substring(Ke.length).replace(/\u2007/g,"0")}${hn.substring(e.length)}`:e}function ct(e){const t=e.substring(0,23),n=e.substring(23,26),s=e.substring(26);return[t,n,s].filter(o=>o!=="").join("\u200B")}const kt=e=>e.replace(/\u200B/g,""),hi=[ct(hn)],pn=D.forwardRef((e,t)=>{const{className:n="",onChange:s=()=>{},defaultValue:o="",onFocus:i=()=>{},onBlur:r=()=>{},"data-testid":a}=e,[l,c]=C.exports.useState(o.length>0?ct(o):""),[h,m]=C.exports.useState(),T=C.exports.useCallback(M=>{ai.debug("handleChange",M),c(M),s(Ot(kt(M)))},[s]),y=C.exports.useCallback(()=>{const M=kt(l),E=Ot(M);E!==M&&c(ct(E)),r()},[l,r]);return p("div",{className:"d-flex flex-row align-items-center",children:p(Je,{ref:t,className:N(n),example:hi,getNextSegmentValue:dn,onChange:T,onSelect:m,pattern:ui,placeholder:di,selection:h,value:l,onFocus:i,onBlur:y,"data-testid":a})})});pn.displayName="DateTimeInput";pn.defaultProps={className:"",onChange:()=>{},defaultValue:"",onFocus:()=>{},onBlur:()=>{},"data-testid":void 0};const pi=H.module("DateInput"),mi="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",fi=["2000-01-01","2022-12-31"],gi="YYYY-MM-DD",mn=D.forwardRef((e,t)=>{const{className:n="",onChange:s=()=>{},defaultValue:o="",onFocus:i=()=>{},onBlur:r=()=>{},"data-testid":a}=e,[l,c]=C.exports.useState(o),[h,m]=C.exports.useState(),T=C.exports.useCallback(y=>{pi.debug("handleChange",y),c(y),s(y)},[s]);return p("div",{className:"d-flex flex-row align-items-center",children:p(Je,{ref:t,className:N(n),example:fi,getNextSegmentValue:dn,onChange:T,onSelect:m,pattern:mi,placeholder:gi,selection:h,value:l,onFocus:i,onBlur:r,"data-testid":a})})});mn.displayName="DateInput";mn.defaultProps={className:"",onChange:()=>!1,defaultValue:"",onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};class yi extends C.exports.PureComponent{constructor(t){super(t),this.searchInput=D.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=ut(this.sendUpdate.bind(this),t.debounceMs),this.state={value:t.value}}componentDidUpdate(t){const{value:n}=this.props;t.value!==n&&this.setState({value:n})}focus(){var t;(t=this.searchInput.current)==null||t.focus()}handleChange(t){this.setState({value:t.target.value},this.sendUpdate)}sendUpdate(){const{onChange:t}=this.props,{value:n}=this.state;t(n)}render(){const{placeholder:t,className:n,matchCount:s,id:o,"data-testid":i}=this.props,{value:r}=this.state;return p(bt,{value:r,placeholder:t,onChange:this.handleChange,className:n,matchCount:s,ref:this.searchInput,id:o,"data-testid":i})}}yi.defaultProps={placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0};const bi=H.module("ItemListItem"),fn=class extends C.exports.Component{constructor(e){super(e),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=D.createRef()}static handleKeyDown(){return bi.log("ItemListItem.handleKeyDown false"),!1}handleBlur(e){const{itemIndex:t,onBlur:n}=this.props;n(t,e)}handleFocus(e){const{itemIndex:t,onFocus:n}=this.props;n(t,e)}handleClick(e){const{itemIndex:t,onClick:n}=this.props;n(t,e)}handleContextMenu(e){const{itemIndex:t,onContextMenu:n}=this.props;n(t,e)}handleDragStart(e){const{itemIndex:t,onDragStart:n}=this.props;n(t,e)}handleDrag(e){const{itemIndex:t,onDrag:n}=this.props;n(t,e)}handleDragOver(e){e.preventDefault();const{itemIndex:t,onDragOver:n}=this.props;n(t,e)}handleDragEnd(e){const{itemIndex:t,onDragEnd:n}=this.props;n(t,e)}handleDrop(e){const{itemIndex:t,onDrop:n}=this.props;n(t,e)}handleDoubleClick(e){const{itemIndex:t,onDoubleClick:n}=this.props;n(t,e)}handleMouseMove(e){const{itemIndex:t,onMouseMove:n}=this.props;n(t,e)}handleMouseDown(e){const{itemIndex:t,onMouseDown:n}=this.props;n(t,e)}handleMouseUp(e){const{itemIndex:t,onMouseUp:n}=this.props;n(t,e)}render(){const{isDraggable:e,isFocused:t,isSelected:n,style:s,children:o,"data-testid":i}=this.props;return p("div",{className:N("item-list-item",{active:n},{"is-focused":t},{"is-draggable":e}),onKeyDown:fn.handleKeyDown,onContextMenu: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:s,onFocus:this.handleFocus,onBlur:this.handleBlur,draggable:e,"data-testid":i,children:o})}};let gn=fn;gn.defaultProps={children:null,isDraggable:!1,isFocused:!1,isSelected:!1,itemIndex:0,disableSelect:!1,"data-testid":void 0,onBlur(){},onClick(){},onContextMenu(){},onDragStart(){},onDrag(){},onDragOver(){},onDragEnd(){},onDrop(){},onDoubleClick(){},onFocus(){},onMouseDown(){},onMouseMove(){},onMouseUp(){},style:{}};const Rt=H.module("ItemList"),Fe=class extends C.exports.PureComponent{constructor(e){super(e),this.getItemSelected=G((s,o)=>le.isSelected(o,s),{max:Fe.CACHE_SIZE}),this.getCachedItem=G((s,o,i,r,a,l,c,h)=>{const m=l({item:i,itemIndex:s,isFocused:r,isSelected:a,style:c});return p(gn,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:h,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:r,isSelected:a,itemIndex:s,style:c,children:m},o)},{max:Fe.CACHE_SIZE}),this.getOuterElement=G(s=>{const o=D.forwardRef((i,r)=>p("div",{ref:r,tabIndex:-1,onKeyDown:s,role:"presentation",...i}));return o.displayName="ItemListOuterElement",o}),this.getInnerElement=G(()=>{const s=D.forwardRef((o,i)=>p("div",{className:"item-list-inner-element",ref:i,...o}));return s.displayName="ItemListInnerElement",s}),this.getItemData=G((s,o,i)=>({items:s,selectedRanges:o,renderItem:i})),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=D.createRef(),this.listContainer=D.createRef();const{isStickyBottom:t,selectedRanges:n}=e;this.state={focusIndex:null,mouseDownIndex:null,selectedRanges:n,overscanStartIndex:0,height:null,isDragging:!1,isStuckToBottom:t,scrollOffset:null}}static renderItem({item:e}){var t,n;return p("div",{className:"item-list-item-content",children:e!=null&&((n=(t=e.displayValue)!=null?t:e.value)!=null?n:`${e}`)})}componentDidMount(){const{isStickyBottom:e}=this.props;e&&!this.isListAtBottom()&&this.scrollToBottom()}componentDidUpdate(e,t){const{selectedRanges:n}=this.props,{focusIndex:s,isStuckToBottom:o,scrollOffset:i,height:r,selectedRanges:a}=this.state;if(o&&!this.isListAtBottom()&&this.scrollToBottom(),(i!==t.scrollOffset||r!==t.height)&&this.sendViewportUpdate(),n!==e.selectedRanges&&n!==a)this.setSelectedRanges(n);else if(a!==t.selectedRanges){const{onSelectionChange:l}=this.props;l(a)}if(s!==t.focusIndex){const{onFocusChange:l}=this.props;l(s)}}componentWillUnmount(){window.removeEventListener("mouseup",this.handleWindowMouseUp)}focus(){var e;(e=this.listContainer.current)==null||e.focus()}getElement(e){if(this.listContainer.current==null)return null;const{focusSelector:t}=this.props,{overscanStartIndex:n}=this.state,s=this.listContainer.current.querySelectorAll(t),o=e-n;return s[o]}focusItem(e){const{disableSelect:t}=this.props;if(t)return;this.setState({focusIndex:e});const n=this.getElement(e);n instanceof HTMLElement&&n.focus()}scrollToItem(e){const t=this.getElement(e);t!=null&&t.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){const{selectedRanges:n}=this.state,o=le.isSelected(n,e)||$.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,o,!1)}handleItemDoubleClick(e,t){const{isDoubleClickSelect:n,onSelect:s}=this.props;n&&this.setState(({selectedRanges:o})=>({selectedRanges:le.selectRange(o,[e,e])}),()=>{s(e,t)})}handleItemMouseDown(e,t){const{selectedRanges:n}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(t.button===2&&n.length===0){this.focusItem(e),this.selectItem(e);return}t.button!=null&&t.button!==0||(this.setState({mouseDownIndex:e}),window.addEventListener("mouseup",this.handleWindowMouseUp))}}handleItemBlur(e,t){Rt.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){Rt.debug2("item focus",e,t.target),this.setState(n=>{const{focusIndex:s}=n;return s!==e?{focusIndex:e}:null})}handleItemMouseMove(e,t){const{isDragSelect:n,isMultiSelect:s,disableSelect:o}=this.props,{mouseDownIndex:i,selectedRanges:r}=this.state;i==null||o||(this.setState({isDragging:!0}),(n||i===e)&&(this.focusItem(e),s?(!n&&!this.getItemSelected(e,r)&&!$.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(i,e),Math.max(i,e)])):this.toggleSelect(e,t.shiftKey,$.isModifierKeyDown(t),!1)))}handleItemMouseUp(e,t){const{isDeselectOnClick:n,isDoubleClickSelect:s,onSelect:o}=this.props,{mouseDownIndex:i,isDragging:r}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(i===e&&!r){const a=t.shiftKey,l=$.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,a,l,n),!s&&!a&&!l&&o(e,t)}this.resetMouseState()}}handleItemsRendered({overscanStartIndex:e}){this.setState({overscanStartIndex:e})}handleResize({height:e}){this.setState({height:e})}handleMouseLeave(){this.setState({mouseDownIndex:null})}handleWindowMouseUp(){this.resetMouseState(),window.removeEventListener("mouseup",this.handleWindowMouseUp)}handleKeyDown(e){var r;const{isMultiSelect:t,itemCount:n,onSelect:s}=this.props,{focusIndex:o}=this.state;let i=o;if(e.key==="Enter"||e.key===" "){!t&&i!=null&&this.setState({selectedRanges:[[i,i]]},()=>{i!=null&&s(i,e)});return}if(e.key==="ArrowUp")i!=null&&i>=0?i=Math.max(0,i-1):i=n-1;else if(e.key==="ArrowDown")i!=null&&i>=0?i=Math.min(i+1,n-1):i=0;else return;if(o!==i){e.stopPropagation(),e.preventDefault(),this.focusItem(i);const{selectedRanges:a}=this.state;if(e.shiftKey&&a.length>0){const l=a[a.length-1];this.selectRange([Math.min(i,l[0]),Math.max(i,l[1])])}else this.deselectAll(),i!==null?this.selectItem(i):(r=this.listContainer.current)==null||r.focus();this.scrollIntoView(i)}}handleScroll({scrollUpdateWasRequested:e,scrollOffset:t}){this.setState(n=>{if(e)return{scrollOffset:t};const{isStickyBottom:s}=this.props,{height:o}=n;return{isStuckToBottom:s&&this.isListAtBottom({scrollOffset:t,height:o}),scrollOffset:t}})}resetMouseState(){this.setState({mouseDownIndex:null,isDragging:!1})}scrollToBottom(){const{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,n,s=!0){const{isMultiSelect:o}=this.props,{selectedRanges:i}=this.state;if(o&&t&&i.length>0){const r=i[i.length-1];this.selectRange([Math.min(r[0],e),Math.max(e,r[1])])}else o&&i.length===1&&i[0][0]===e&&i[0][1]===e?s&&this.deselectItem(e):o&&n?this.getItemSelected(e,i)?s&&this.deselectItem(e):this.selectItem(e):(this.deselectAll(),this.selectItem(e))}deselectAll(){const{itemCount:e}=this.props;this.deselectRange([0,e])}deselectItem(e){this.deselectRange([e,e])}deselectRange(e){le.validateRange(e),this.setState(({selectedRanges:t})=>({selectedRanges:le.deselectRange(t,e)}))}selectItem(e){const{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){le.validateRange(e),this.setState(({selectedRanges:t})=>({selectedRanges:le.selectRange(t,e)}))}setSelectedRanges(e){this.setState({selectedRanges:e})}sendViewportUpdate(){const{scrollOffset:e,height:t}=this.state;if(e!=null&&t!=null){const{onViewportChange:n,rowHeight:s}=this.props,o=Math.floor(e/s),i=o+Math.ceil(t/s);n(o,i)}}isListAtBottom({scrollOffset:e,height:t}=this.state){if(t==null||e==null)return!1;const{itemCount:n,rowHeight:s}=this.props;return e+t>=n*s}renderInnerElement({index:e,style:t}){const{items:n,offset:s,renderItem:o,disableSelect:i}=this.props,{focusIndex:r,selectedRanges:a}=this.state;if(e<s||e>=s+n.length)return null;const l=n[e-s];return this.getCachedItem(e,e,l,e===r&&!i,this.getItemSelected(e,a),o,t,i)}render(){const{items:e,itemCount:t,overscanCount:n,renderItem:s,rowHeight:o,"data-testid":i}=this.props,{selectedRanges:r}=this.state;return p(Dn,{className:"item-list-auto-sizer",onResize:this.handleResize,children:({width:a,height:l})=>p(vn,{className:"item-list-scroll-pane",height:l,width:a,itemCount:t,itemSize:o,itemData:this.getItemData(e,r,s),onScroll:this.handleScroll,onItemsRendered:this.handleItemsRendered,ref:this.list,outerElementType:this.getOuterElement(this.handleKeyDown),outerRef:this.listContainer,innerElementType:this.getInnerElement(),overscanCount:n,"data-testid":i,children:this.renderInnerElement})})}};let ke=Fe;ke.CACHE_SIZE=1e3;ke.DEFAULT_ROW_HEIGHT=20;ke.DEFAULT_OVERSCAN=10;ke.defaultProps={offset:0,items:[],rowHeight:Fe.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:Fe.DEFAULT_OVERSCAN,renderItem:Fe.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0};const Ce=class extends C.exports.PureComponent{constructor(e){super(e),this.getCachedDraggableItem=G((t,n,s,o,i,r,a,l)=>p(wn,{draggableId:Ce.getDraggableId(t,o),index:o,isDragDisabled:a,children:c=>p("div",{role:"menuitem",className:"draggable-item-list-item",ref:c.innerRef,tabIndex:-1,...c.draggableProps,...c.dragHandleProps,children:n({item:s,itemIndex:o,isFocused:i,isSelected:r,style:l,isClone:!1})})},o),{max:ke.CACHE_SIZE}),this.getCachedRenderDraggableItem=G((t,n,s)=>({item:o,itemIndex:i,isFocused:r,isSelected:a,style:l})=>this.getCachedDraggableItem(t,s,o,i,r,a,n,l),{max:1}),this.getCachedRenderClone=G((t,n,s,o)=>(i,r,a)=>{const{selectedCount:l}=this.state,{index:c}=a.source,h=n[c-s];return p("div",{className:N("draggable-item-list-dragging-item-container",t),...i.draggableProps,...i.dragHandleProps,ref:i.innerRef,children:p("div",{className:N("draggable-item-list-dragging-item",{"two-dragged":l===2},{"multiple-dragged":l>2}),children:o({item:h,itemIndex:c,isFocused:!1,isSelected:!0,style:{},isClone:!0,selectedCount:l})})})},{max:1}),this.handleSelectionChange=this.handleSelectionChange.bind(this),this.itemList=D.createRef(),this.state={selectedCount:0}}static renderHandle(){return L("div",{children:[p(be,{children:"Drag to re-order"}),p(X,{icon:Un})]})}static renderBadge({text:e}){return e!=null&&e.length>0?p("span",{className:"number-badge",children:e}):null}static renderTextItem({text:e,badgeText:t="",className:n=""}){return L("div",{className:N("item-list-item-content","draggable-item-list-item-content",n),children:[p("span",{className:"title",children:e}),Ce.renderBadge({text:t}),Ce.renderHandle()]})}static renderItem({item:e,isClone:t,selectedCount:n}){var r,a;const s=e!=null?(a=(r=e.displayValue)!=null?r:e.value)!=null?a:`${e}`:"",o=t!==void 0&&t?`${n}`:"",i=t!==void 0&&t?"item-list-item-clone":"";return Ce.renderTextItem({text:s,badgeText:o,className:i})}static getDraggableId(e,t){return`${e}/${t}`}static getDraggableIndex(e){const t=e.split("/").pop();return parseInt(t!==void 0?t:"",10)}selectItem(e){var t;(t=this.itemList.current)==null||t.selectItem(e)}focusItem(e){var t;(t=this.itemList.current)==null||t.focusItem(e)}scrollToItem(e){var t;(t=this.itemList.current)==null||t.scrollToItem(e)}handleSelectionChange(e){this.setState({selectedCount:le.count(e)});const{onSelectionChange:t}=this.props;t(e)}render(){const{className:e,draggablePrefix:t,draggingItemClassName:n,droppableId:s,isDoubleClickSelect:o,isDragDisabled:i,isDropDisabled:r,isMultiSelect:a,isStickyBottom:l,itemCount:c,items:h,offset:m,onFocusChange:T,onSelect:y,onViewportChange:M,renderItem:E,rowHeight:A,selectedRanges:O,style:x,"data-testid":v}=this.props;return p(Nn,{isDropDisabled:r,droppableId:s,mode:"virtual",renderClone:this.getCachedRenderClone(n,h,m,E),"data-testid":v,children:(k,V)=>p("div",{role:"menu",className:N("draggable-item-list",e,{"is-drop-disabled":r,"is-drag-disabled":i,"is-dragging-from-this":V.draggingFromThisWith,"is-dragging-over":V.isDraggingOver,"is-dropping":V.draggingOverWith}),style:x,ref:k.innerRef,...k.droppableProps,children:p(ke,{focusSelector:".draggable-item-list-item",isDoubleClickSelect:o,isDragSelect:!1,isMultiSelect:a,isStickyBottom:l,itemCount:c,items:h,onFocusChange:T,onSelect:y,onSelectionChange:this.handleSelectionChange,onViewportChange:M,offset:m,ref:this.itemList,renderItem:this.getCachedRenderDraggableItem(t,i,E),rowHeight:A,selectedRanges:O})})})}};let yn=Ce;yn.DEFAULT_ROW_HEIGHT=30;yn.defaultProps={className:"",draggingItemClassName:"",offset:0,items:[],rowHeight:Ce.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!0,isDropDisabled:!1,isDragDisabled:!1,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,style:null,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},renderItem:Ce.renderItem,selectedRanges:[],draggablePrefix:"draggable-item",droppableId:"droppable-item-list","data-testid":void 0};const ze=class extends C.exports.Component{static isParentSelected(e,t){const n=t.get(e);if(n===void 0)return!1;if(typeof n=="boolean")return n;const s=Array.from(n.values()).includes(!0),o=Array.from(n.values()).includes(!1);return s&&o?null:s}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=>{const{menuIsOpen:n}=t;return{menuIsOpen:!n}})}toggleValueFor(e,t){const{valueMap:n,onUpdateValueMap:s}=this.props,o=new Map(n),i=o.get(e);if(i instanceof Map){const a=new Map(i);if(t!=null)a.set(t,i.get(t)===void 0);else{const l=ze.isParentSelected(e,o),c=l==null||!l;i.forEach((h,m)=>a.set(m,c))}o.set(e,a)}else o.set(e,i==null||!i);const r=o.get(e);if(t===void 0&&r!==void 0&&typeof r!="boolean"){const a=ze.isParentSelected(e,n);a!=null&&a?r.forEach((l,c)=>r.set(c,!1)):r.forEach((l,c)=>r.set(c,!0))}s(o)}setAllValues(e){const{valueMap:t,onUpdateValueMap:n}=this.props,s=new Map;t.forEach((o,i)=>{if(typeof o=="boolean")s.set(i,e);else{const r=new Map;o.forEach((a,l)=>r.set(l,e)),s.set(i,r)}}),n(s)}selectAll(){this.setAllValues(!0)}clear(){this.setAllValues(!1)}renderMenuElement(){const{valueMap:e,"data-testid":t}=this.props;return L("div",{className:"hcm-menu-container",children:[Array.from(e.entries()).map(([n,s])=>L("div",{children:[p(Oe,{className:"hcm-parent",checked:ze.isParentSelected(n,e),onChange:()=>this.toggleValueFor(n),children:n}),s!==void 0&&typeof s!="boolean"&&Array.from(s.entries()).map(([o,i])=>p(Oe,{className:"hcm-child",checked:i,onChange:()=>this.toggleValueFor(n,o),children:o},o))]},n)),p($e,{kind:"ghost",onClick:this.selectAll,"data-testid":t!==void 0?`${t}-btn-select-all`:void 0,children:"Select All"}),p($e,{kind:"ghost",onClick:this.clear,"data-testid":t!==void 0?`${t}-btn-clear`:void 0,children:"Clear"})]})}render(){const{menuText:e,className:t,icon:n,id:s,"data-testid":o}=this.props,{menuIsOpen:i}=this.state;return L("button",{type:"button",className:N("btn hcm-btn",t),onClick:this.toggleMenu,id:s,"data-testid":o,children:[L("span",{children:[n&&p(X,{icon:n,className:"hcm-icon mr-1"}),e]}),p(X,{icon:Bt,className:"hcm-icon ml-1"}),p(xe,{options:{placement:"bottom"},isShown:i,onExited:()=>{this.setState({menuIsOpen:!1})},closeOnBlur:!0,interactive:!0,children:this.renderMenuElement()})]})}};let Si=ze;Si.defaultProps={className:"",icon:null,id:"","data-testid":void 0};const Ti=({isLoaded:e=!1,isLoading:t=!0,errorMessage:n=null,"data-testid":s})=>p(dt,{in:Boolean(n)||!e||t,timeout:Yt.transitionMs,classNames:e?"fade":"",mountOnEnter:!0,unmountOnExit:!0,children:p("div",{className:"fill-parent-absolute","data-testid":s,children:p("div",{className:N("iris-panel-message-overlay","fill-parent-absolute",{"iris-panel-scrim-background":e}),children:L("div",{className:"message-content",children:[L("div",{className:"message-icon",children:[t&&p(tn,{}),!t&&n&&p(X,{icon:Wn})]}),p("div",{className:"message-text",children:n})]})})})});const bn=D.forwardRef((e,t)=>{const{checked:n,children:s,className:o="",disabled:i=!1,inputClassName:r="",isInvalid:a=!1,labelClassName:l="",name:c,onChange:h,value:m,"data-testid":T}=e,[y]=C.exports.useState(Ut());return L("div",{className:N("custom-control custom-radio",o),children:[p("input",{type:"radio",id:y,"data-testid":T,name:c,ref:t,className:N("custom-control-input",r,{"is-invalid":a}),checked:n,disabled:i,value:m,onChange:h}),p("label",{className:N("custom-control-label",l),htmlFor:y,children:s})]})});bn.displayName="RadioItem";bn.defaultProps={checked:void 0,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};class Ei extends C.exports.PureComponent{constructor(t){super(t),this.getCachedItem=G((n,s,o,i,r,a,l)=>{const c={height:r},h=i!=null?i:o;return p("li",{className:"value-list-item",style:c,tabIndex:-1,children:p(Oe,{checked:a,disabled:l,onChange:()=>this.handleSelect(n),children:h})},s)},{max:1e3}),this.getCachedItems=G((n,s,o,i)=>{const r=[];for(let a=0;a<n.length;a+=1){const l=n[a],{value:c,displayValue:h,isSelected:m}=l,T=o+a,y=T,M=this.getCachedItem(T,y,c,h,s,m,i);r.push(M)}return r},{max:1}),this.handleBlur=this.handleBlur.bind(this),this.handleScroll=this.handleScroll.bind(this),this.handleSelect=this.handleSelect.bind(this),this.list=D.createRef(),this.topRow=null,this.bottomRow=null}componentDidMount(){this.sendViewportUpdate()}componentDidUpdate(){this.sendViewportUpdate()}handleBlur(t){if(!t.relatedTarget||this.list.current&&t.relatedTarget instanceof HTMLElement&&!this.list.current.contains(t.relatedTarget)){const{onBlur:n}=this.props;n==null||n(t)}}handleScroll(){this.sendViewportUpdate()}handleSelect(t){const{items:n,offset:s,onSelect:o}=this.props,i=t-s;if(i>=0&&i<n.length){const r=n[i],{value:a}=r;o(t,a)}else o(t,null)}sendViewportUpdate(){if(!this.list.current||this.list.current.clientHeight===0)return;const{onViewportChange:t,rowHeight:n}=this.props,s=this.list.current.scrollTop,o=s+this.list.current.clientHeight,i=Math.floor(s/n),r=Math.ceil(o/n);(this.topRow!==i||this.bottomRow!==r)&&(this.topRow=i,this.bottomRow=r,t(i,r))}getElement(t){return this.list.current==null?null:this.list.current.querySelectorAll(".value-list-item")[t]}scrollIntoView(t){const n=this.getElement(t);n==null||n.scrollIntoView({block:"center"})}render(){const{className:t,disabled:n,isInvalid:s,items:o,itemCount:i,offset:r,rowHeight:a,"data-testid":l}=this.props,c=this.getCachedItems(o,a,r,n);return p("div",{className:N("select-value-list-scroll-pane h-100 w-100",{"is-invalid":s},t),onBlur:this.handleBlur,onScroll:this.handleScroll,ref:this.list,"data-testid":l,children:p("div",{className:"select-value-list",style:{height:i*a},children:p("ol",{className:"select-value-list-content",style:{position:"absolute",height:o.length*a,top:r*a,left:0},children:c})})})}}Ei.defaultProps={disabled:!1,rowHeight:21,onBlur:()=>{},"data-testid":void 0};const Lt=H.module("Shortcut");var ne=(e=>(e.CTRL="MODIFIER_CTRL",e.CMD="MODIFIER_CMD",e.ALT="MODIFIER_ALT",e.OPTION="MODIFIER_OPTION",e.SHIFT="MODIFIER_SHIFT",e))(ne||{}),J=(e=>(e.A="A",e.B="B",e.C="C",e.D="D",e.E="E",e.F="F",e.G="G",e.H="H",e.I="I",e.J="J",e.K="K",e.L="L",e.M="M",e.N="N",e.O="O",e.P="P",e.Q="Q",e.R="R",e.S="S",e.T="T",e.U="U",e.V="V",e.W="W",e.X="X",e.Y="Y",e.Z="Z",e.ZERO="0",e.ONE="1",e.TWO="2",e.THREE="3",e.FOUR="4",e.FIVE="5",e.SIX="6",e.SEVEN="7",e.EIGHT="8",e.NINE="9",e.BACKSPACE="Backspace",e.ESCAPE="Escape",e.ENTER="Enter",e.DELETE="Delete",e.SLASH="/",e.QUESTION_MARK="?",e.BACKSLASH="\\",e.PIPE="|",e.MINUS="-",e.UNDERSCORE="_",e.EQUALS="=",e.PLUS="+",e.BACKTICK="`",e.TILDE="~",e.COMMA=",",e.LEFT_CHEVRON="<",e.PERIOD=".",e.RIGHT_CHEVRON=">",e.SEMICOLON=";",e.COLON=":",e.SINGLE_QUOTE="'",e.DOUBLE_QUOTE='"',e.LEFT_BRACKET="[",e.RIGHT_BRACKET="]",e.LEFT_CURLY="{",e.RIGHT_CURLY="}",e.F1="F1",e.F2="F2",e.F3="F3",e.F4="F4",e.F5="F5",e.F6="F6",e.F7="F7",e.F8="F8",e.F9="F9",e.F10="F10",e.F11="F11",e.F12="F12",e))(J||{});const Mi=new Set(["Enter","Delete","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"]),q=class extends $t{constructor({id:e,shortcut:t,macShortcut:n,isEditable:s=!0,name:o,tooltip:i}){super(),this.id=e,this.name=o,this.tooltip=i,this.isEditable=s;const a=q.isMacPlatform?n:t;this.defaultKeyState=q.createKeyState(a),this.keyState=this.defaultKeyState}static isAllowedKey(e){return Object.values(J).includes(e)}static isValidKeyState(e){const{keyValue:t}=e;return t===null?!0:!q.isMacPlatform&&e.metaKey||!q.isAllowedKey(t)?!1:!(!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey)||Mi.has(t)}static createKeyState(e){const t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(n=>{switch(n){case"MODIFIER_CTRL":t.ctrlKey=!0;break;case"MODIFIER_ALT":case"MODIFIER_OPTION":t.altKey=!0;break;case"MODIFIER_CMD":t.metaKey=!0;break;case"MODIFIER_SHIFT":t.shiftKey=!0;break}}),t}static getKeyStateFromEvent(e){const{key:t,keyCode:n}=e;let s="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?s="":!q.isAllowedKey(t)&&q.isAllowedKey(String.fromCharCode(n))?s=String.fromCharCode(n):s=t,{keyValue:s,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey}}static getWindowsDisplayText(e){let t="";return e.ctrlKey&&(t+="Ctrl+"),e.altKey&&(t+="Alt+"),e.shiftKey&&(t+="Shift+"),e.keyValue==="Escape"?t+="Esc":e.keyValue!==null&&(t+=e.keyValue),t}static getMacDisplayText(e){let t="";switch(e.ctrlKey&&(t+="\u2303"),e.altKey&&(t+="\u2325"),e.shiftKey&&(t+="\u21E7"),e.metaKey&&(t+="\u2318"),e.keyValue){case"Enter":t+="\u23CE";break;case"Escape":t+="\u238B";break;case"Backspace":t+="\u232B";break;case"Delete":t+="\u2326";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){var n,s;return((n=e.keyValue)==null?void 0:n.toUpperCase())===((s=t.keyValue)==null?void 0:s.toUpperCase())&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey&&e.shiftKey===t.shiftKey}static getDisplayText(e){return e.keyValue===null?"":q.isMacPlatform?q.getMacDisplayText(e):q.getWindowsDisplayText(e)}getDisplayText(){return q.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){q.isValidKeyState(e)?(Lt.debug2(`Shortcut ${this.id} updated to ${JSON.stringify(e)}`),this.keyState=e,this.dispatchEvent(new jt("onUpdate",{detail:this}))):Lt.debug2(`Shortcut ${this.id} tried to update to invalid keyState ${JSON.stringify(e)}`)}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return q.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState(q.NULL_KEY_STATE)}isNull(){return q.doKeyStatesMatch(this.keyState,q.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return q.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState(q.getKeyStateFromEvent(e))}};let Et=q;Et.NULL_KEY_STATE={metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null};Et.isMacPlatform=$.isMacPlatform();const Pt=H.module("ShortcutRegistry");class Ii extends $t{constructor(){super(...arguments),this.shortcutMap=new Map,this.shortcutsByCategory=new Map}createAndAdd(t){const n=new Et(t);return this.add(n)}add(t){var o;const n=this.shortcutMap.get(t.id);if(n)return Pt.warn(`Skipping attempt to add duplicate shortcut ID to registry: ${t.id}`),n;Pt.debug2(`Adding shortcut to registry: ${t.id}`),t.addEventListener("onUpdate",({detail:i})=>this.dispatchEvent(new jt("onUpdate",{detail:i})));const s=t.id.split(".")[0];return this.shortcutMap.set(t.id,t),this.shortcutsByCategory.has(s)?(o=this.shortcutsByCategory.get(s))==null||o.push(t):this.shortcutsByCategory.set(s,[t]),t}get(t){return this.shortcutMap.get(t)}getConflictingShortcuts(t){return Array.from(this.shortcutMap.values()).filter(n=>!n.isNull()&&n.matchesKeyState(t))}}const we=Object.freeze(new Ii);we.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[ne.CTRL,J.C],macShortcut:[ne.CMD,J.C],isEditable:!1}),we.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[ne.CTRL,J.V],macShortcut:[ne.CMD,J.V],isEditable:!1}),we.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[ne.CTRL,J.S],macShortcut:[ne.CMD,J.S],isEditable:!1}),we.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[ne.CTRL,J.A],macShortcut:[ne.CMD,J.A],isEditable:!1}),we.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[ne.CTRL,J.L],macShortcut:[ne.CMD,J.L]}),we.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[J.ESCAPE],macShortcut:[J.ESCAPE],isEditable:!1});const Sn=D.forwardRef((e,t)=>{const{children:n,className:s,disabled:o,isLinked:i,isLinkedSource:r,isInvalid:a,onClick:l,onMouseEnter:c,onMouseLeave:h,style:m,"data-testid":T}=e;return L("button",{ref:t,type:"button",className:N("btn-socketed",{"btn-socketed-linked":i!==void 0&&i||r},{"btn-socketed-linked-source":r},{"is-invalid":a},s),onClick:l,onMouseEnter:c,onMouseLeave:h,style:m,disabled:o,"data-testid":T,children:[n,p(X,{icon:$n,className:"linked btn-socketed-icon",transform:"down-1"}),p(X,{icon:qn,className:"is-invalid btn-socketed-icon"})]})});Sn.displayName="SocketedButton";Sn.defaultProps={children:void 0,className:"",disabled:!1,isLinked:!1,isLinkedSource:!1,isInvalid:!1,onClick:void 0,onMouseEnter:void 0,onMouseLeave:void 0,style:void 0,"data-testid":void 0};const Ci="_track_xvu02_28",xi="_handle_xvu02_11",Di="_ticks_xvu02_96",Tn={"handle-size":"15px","popover-width":"90px","time-slider":"_time-slider_xvu02_1","time-slider-popovers":"_time-slider-popovers_xvu02_6","handle-popper":"_handle-popper_xvu02_11","flex-spacer":"_flex-spacer_xvu02_24",track:Ci,"track-fills":"_track-fills_xvu02_35","track-fill":"_track-fill_xvu02_35","track-fill-start":"_track-fill-start_xvu02_53","track-fill-middle":"_track-fill-middle_xvu02_54","track-fill-end":"_track-fill-end_xvu02_57","handle-track":"_handle-track_xvu02_60",handle:xi,ticks:Di,"tick-labels":"_tick-labels_xvu02_114","tick-label":"_tick-label_xvu02_114","tick-label-wrapper":"_tick-label-wrapper_xvu02_130"};parseInt(Tn["handle-size"],10);parseInt(Tn["popover-width"],10);Object.freeze({ERROR:"error"});const Ne=H.module("EmbedChart.App");async function vi(e,t){Ne.info(`Fetching figure ${t}...`);const n={name:t,type:u.VariableType.FIGURE};return e.getObject(n)}function wi(){const[e,t]=C.exports.useState(),[n,s]=C.exports.useState(),[o,i]=C.exports.useState(!0),r=C.exports.useMemo(()=>new URLSearchParams(window.location.search),[]);C.exports.useEffect(function(){async function c(){try{const h=r.get("name");if(h==null)throw new Error("No name param provided");const m=new URL("/jsapi",`${window.location}`),T=`${m.protocol}//${m.host}`;Ne.debug("Starting connection...");const y=new u.IdeConnection(T);Ne.debug("Loading figure",h,"...");const M=await vi(y,h);Ne.debug("Creating model...");const E=await ft.makeModel(void 0,M);t(E),Ne.debug("Figure successfully loaded!")}catch(h){Ne.error("Unable to load figure",h),s(`${h}`)}i(!1)}c()},[r]);const a=e!=null;return L("div",{className:"App",children:[a&&p(Qt,{model:e}),!a&&p(Ti,{isLoaded:a,isLoading:o,errorMessage:n!=null?n:null}),p(ni,{})]})}Vt.render(p(wi,{}),document.getElementById("root"));
|
|
2
|
+
//# sourceMappingURL=index.d1cbf0c3.js.map
|