@deephaven/embed-chart 0.47.1-beta.2 → 0.47.1-dynamic-import.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/assets/{App-b726b424.js → App-58a5420f.js} +2 -2
- package/build/assets/{App-b726b424.js.map → App-58a5420f.js.map} +1 -1
- package/build/assets/index-5db87124.js +2 -0
- package/build/assets/index-5db87124.js.map +1 -0
- package/build/assets/index-90e5577a.js +9 -0
- package/build/assets/index-90e5577a.js.map +1 -0
- package/build/assets/index-d63c566b.css +1 -0
- package/build/assets/{plotly-416911dc.js → plotly-ec6334b5.js} +2 -2
- package/build/assets/{plotly-416911dc.js.map → plotly-ec6334b5.js.map} +1 -1
- package/build/assets/useConnection-40666c17.js +2 -0
- package/build/assets/{useConnection-a2eee2d2.js.map → useConnection-40666c17.js.map} +1 -1
- package/build/assets/vendor-7af3c298.js +1176 -0
- package/build/assets/vendor-7af3c298.js.map +1 -0
- package/build/assets/vendor-b58e2f70.css +1 -0
- package/build/index.html +3 -3
- package/package.json +13 -13
- package/build/assets/index-56720879.js +0 -2
- package/build/assets/index-56720879.js.map +0 -1
- package/build/assets/index-7925f7e7.css +0 -1
- package/build/assets/index-a9b64aac.js +0 -9
- package/build/assets/index-a9b64aac.js.map +0 -1
- package/build/assets/useConnection-a2eee2d2.js +0 -2
- package/build/assets/vendor-b4933991.js +0 -1175
- package/build/assets/vendor-b4933991.js.map +0 -1
- package/build/assets/vendor-e75c4614.css +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{C as u,$ as rs,M as ei,N as on,F as X,O as ti,P as ln,r as c,K as Be,Q as xe,S as is,T as ni,U as as,V as ri,W as ss,X as os,Y as Vn,G as M,Z as ls,D as Ne,E as I,R as ii,_ as m,L as re,a0 as us,a1 as cs,a2 as ds,a3 as hs,a4 as fs,a5 as ps,a6 as vs,a7 as ms,a8 as gs,a9 as bs,aa as ys,ab as Ke,ac as ws,ad as Cs,ae as Ss,af as Os,ag as ai}from"./vendor-7af3c298.js";import{L as $,c as xs,e as Es,f as si,T as fe,M as un,g as cn,h as oi,i as Ts,j as Ps,k as Is,l as Ms,m as li,n as Ns,o as Ds,p as js,q as As,r as ks,s as ui,t as Rs,u as Ls,w as _s,b as De,x as ci,A as $s,y as di}from"./index-5db87124.js";import{d as pt,e as Q,i as Dt,f as hi,a as Fs,C as Us,g as fi,h as Vs,c as Ee,j as We,k as pi,B as Bs,l as Ks,m as Hs,D as Ws,n as Gs,o as zs,b as vi,F as Ft,I as qs,S as Zs,p as Xs,T as mi,q as Js,r as dn,s as Qs,t as gi,v as bi,w as hn,x as fn,y as yi,z as wi,A as Ci,E as Si,G as Ys,H as eo,J as pn,K as ot,L as to,M as Oi,P as Bn,N as no,O as ro,Q as io,R as ao}from"./useConnection-40666c17.js";import{U as rf,u as af}from"./useConnection-40666c17.js";import"./helpers-042e6b4d.js";function Kn(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function so(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Kn(a,r,i,s,o,"next",l)}function o(l){Kn(a,r,i,s,o,"throw",l)}s(void 0)})}}function oo(n){return Ut.apply(this,arguments)}function Ut(){return Ut=so(function*(n){var{clipboard:e}=navigator;if(e!==void 0)try{return navigator.clipboard.writeText(n)}catch{return Hn(n)}Hn(n)}),Ut.apply(this,arguments)}function Hn(n){var e=document.activeElement,t=document.createElement("textarea");t.value=n,document.body.appendChild(t),t.focus(),t.select();var r=document.execCommand("copy");if(document.body.removeChild(t),e instanceof HTMLElement&&e.focus(),!r)throw new Error("Unable to execute copy command")}function lo(n){return n instanceof HTMLElement?n:null}class xi extends CustomEvent{constructor(e,t){super(e,t)}}function He(n){var e=n;n instanceof CustomEvent&&(e=n.detail);var t="";if(e instanceof Error?t=e.message:e!=null&&(t="".concat(e)),t=t.trim(),t.length>0)return t}class vn{static isValidRange(e){return e!=null&&e.length===2&&Number.isInteger(e[0])&&Number.isInteger(e[1])&&e[0]<=e[1]}static validateRange(e){if(!vn.isValidRange(e))throw new Error("Invalid range! ".concat(e))}static isSelected(e,t){for(var r=0;r<e.length;r+=1){var i=e[r],a=i[0],s=i[1];if(a<=t&&t<=s)return!0}return!1}static selectRange(e,t){for(var[r,i]=t,a=[...e],s=a.length-1;s>=0;s-=1){var o=a[s],l=o[0],d=o[1];if(l<=r&&i<=d)return a;r<=d&&l<=i&&(r=Math.min(r,l),i=Math.max(i,d),a.splice(s,1))}return a.push([r,i]),a}static deselectRange(e,t){for(var[r,i]=t,a=[...e],s=a.length-1;s>=0;s-=1){var o=a[s],l=o[0],d=o[1];if(!(i<l||d<r))if(l<r&&i<d){a[s]=[l,r-1],a.splice(s+1,0,[i+1,d]);break}else r<=l&&d<=i?a.splice(s,1):l<r?a[s]=[l,r-1]:a[s]=[i+1,d]}return a}static count(e){return e.reduce((t,r)=>t+(r[1]-r[0]+1),0)}static getItemsInRanges(e,t){return t.reduce((r,i)=>{for(var a=[...r],s=i[0];s<=i[1];s+=1)a.push(e[s]);return a},[])}}const ue=vn;function*uo(n,e){for(var t=n;t<=e;++t)yield t}function Ei(n,e,t){return e=co(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function co(n){var e=ho(n,"string");return typeof e=="symbol"?e:String(e)}function ho(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Je{static formatElapsedTime(e){if(typeof e!="number"||!Number.isInteger(e))throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60;return"".concat(t>0?"".concat(t,"h "):"")+"".concat(r>0||t>0?"".concat(r,"m "):"")+"".concat(e>=60?"".concat(i,"s").padStart(3,"0"):"".concat(i,"s"))}static formatTime(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=String(Math.floor(e/(60*60))).padStart(2,"0"),r=e%(60*60),i=String(Math.floor(r/60)).padStart(2,"0"),a=r%60,s=String(Math.ceil(a)).padStart(2,"0");return"".concat(t,":").concat(i,":").concat(s)}static isTimeString(e){return new RegExp(Je.TIME_PATTERN).test(e)}static parseTime(e){if(e==null||typeof e!="string")throw new Error("".concat(e," is not a valid string"));var t=e.split(":");if(t.length!==3)throw new Error("".concat(e," is not a time string that can be parsed"));return Number(t[0])*60*60+Number(t[1])*60+Number(t[2])}}Ei(Je,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");Ei(Je,"TIME_ZONES",Object.freeze([{label:"Tokyo UTC+9 No DST",value:"Asia/Tokyo"},{label:"Seoul UTC+9 No DST",value:"Asia/Seoul"},{label:"Hong Kong UTC+8 No DST",value:"Asia/Hong_Kong"},{label:"Singapore UTC+8 No DST",value:"Asia/Singapore"},{label:"Kolkata UTC+5:30 No DST",value:"Asia/Kolkata"},{label:"Berlin UTC+1",value:"Europe/Berlin"},{label:"UTC UTC±0 No DST",value:"UTC"},{label:"London UTC±0",value:"Europe/London"},{label:"Sao Paulo UTC-2",value:"America/Sao_Paulo"},{label:"Newfoundland UTC-3:30",value:"America/St_Johns"},{label:"Halifax UTC-4",value:"America/Halifax"},{label:"New York UTC−5",value:"America/New_York"},{label:"Chicago UTC-6",value:"America/Chicago"},{label:"Denver UTC-7",value:"America/Denver"},{label:"Los Angeles UTC-8",value:"America/Los_Angeles"},{label:"Anchorage UTC-9",value:"America/Anchorage"},{label:"Honolulu UTC-10 No DST",value:"Pacific/Honolulu"},{label:"Zurich UTC+1",value:"Europe/Zurich"},{label:"Amsterdam UTC+1",value:"Europe/Amsterdam"},{label:"Taipei UTC+8 No DST",value:"Asia/Taipei"},{label:"Sydney UTC+10",value:"Australia/Sydney"}]));const qe=Je;var Ti=24,fo=32,po=33,vo=150,Pi=200,Ii=500,Mi=250,mo={spellCheck:!1},go=["ariaLabel","icon","isQuiet","labelText","children","onOpenChange"];function Wn(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Gn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Wn(Object(t),!0).forEach(function(r){bo(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Wn(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function bo(n,e,t){return e=yo(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yo(n){var e=wo(n,"string");return typeof e=="symbol"?e:String(e)}function wo(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Co(n,e){if(n==null)return{};var t=So(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function So(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function Ni(n){var{ariaLabel:e,icon:t,isQuiet:r,labelText:i,children:a,onOpenChange:s}=n,o=Co(n,go);return u.jsxs(rs,{type:"popover",onOpenChange:s,children:[u.jsxs(ei,Gn(Gn({},o),{},{"aria-label":e??i,isQuiet:r,children:[u.jsx(on,{children:u.jsx(X,{icon:t})}),i==null?null:u.jsx(ti,{children:i})]})),a]})}function Oo(n,e){return n===0?0:e==="all"||n===e.size?"all":e.size}function Di(n,e){return n===e?!0:n==="all"||e==="all"||n.size!==e.size?!1:[...n.keys()].every(t=>e.has(t))}function ji(n,e){return n.isInverted===e.isInverted&&Di(n.selection,e.selection)}function Ai(n,e,t){if(n==="all")return"all";var r=[...n.keys()];return new Set(r.map(i=>t(e(i))))}function ki(n,e){var t=n==="all"||n.size>e/2,r=n;return t&&(r=n==="all"?new Set:new Set([...uo(0,e-1)].filter(i=>!n.has(String(i))).map(i=>String(i)))),{selection:r,isInverted:t}}function xo(n,e){return n?{}:{errorMessage:e,validationState:"invalid"}}function Ri(n){var e;return(e=n==null?void 0:n.UNSAFE_getDOMNode())!==null&&e!==void 0?e:null}function Eo(n){var e=n==null?void 0:n.UNSAFE_getDOMNode().lastElementChild;return Li(e)}function To(n){var e=n==null?void 0:n.UNSAFE_getDOMNode(),t=e==null?void 0:e.querySelector("input"),r=t==null?void 0:t.getAttribute("aria-controls"),i=r==null?null:document.getElementById(r);return i}function Li(n){return n instanceof HTMLElement?n:null}function ye(n,e,t){return e=Po(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Po(n){var e=Io(n,"string");return typeof e=="symbol"?e:String(e)}function Io(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var W;(function(n){n.DEBUG="D",n.LOG="L",n.WARN="W",n.ERROR="E",n.UNCAUGHT_ERROR="U"})(W||(W={}));function je(n,e){return new CustomEvent(n,{detail:e})}class Mo{constructor(){ye(this,"isEnabled",!1),ye(this,"debug",void 0),ye(this,"log",void 0),ye(this,"warn",void 0),ye(this,"error",void 0),ye(this,"eventTarget",void 0),ye(this,"handleUncaughtError",e=>{var t=[];e.error!=null&&t.push(e.error),e.message&&t.push(e.message),this.eventTarget.dispatchEvent(je(W.UNCAUGHT_ERROR,t))}),ye(this,"handleUncaughtRejection",e=>{var t=[];e.promise!=null&&t.push(e.promise.toString()),e.reason&&t.push(e.reason),this.eventTarget.dispatchEvent(je(W.UNCAUGHT_ERROR,t))}),this.debug=console.debug,this.log=console.log,this.warn=console.warn,this.error=console.error,this.eventTarget=new ln}enable(){var e=this;this.isEnabled||(console.debug=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e.eventTarget.dispatchEvent(je(W.DEBUG,r)),e.debug.apply(console,r)},console.log=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e.eventTarget.dispatchEvent(je(W.LOG,r)),e.log.apply(console,r)},console.warn=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e.eventTarget.dispatchEvent(je(W.WARN,r)),e.warn.apply(console,r)},console.error=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e.eventTarget.dispatchEvent(je(W.ERROR,r)),e.error.apply(console,r)},window.addEventListener("error",this.handleUncaughtError),window.addEventListener("unhandledrejection",this.handleUncaughtRejection),$.setLogLevel($.level),this.isEnabled=!0)}disable(){this.isEnabled&&(console.debug=this.debug,console.log=this.log,console.warn=this.warn,console.error=this.error,window.removeEventListener("error",this.handleUncaughtError),window.removeEventListener("unhandledrejection",this.handleUncaughtRejection),$.setLogLevel($.level),this.isEnabled=!1)}addEventListener(e,t){this.eventTarget.addEventListener(e,t)}removeEventListener(e,t){this.eventTarget.removeEventListener(e,t)}}const No=Mo;function ze(n,e,t){return e=Do(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Do(n){var e=jo(n,"string");return typeof e=="symbol"?e:String(e)}function jo(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class lt{static formatMessages(e){var t=e.map(r=>{if(typeof r=="string")return r;var i="";try{i=JSON.stringify(r)}catch{i=r.toString()}return i==="{}"?r.toString():i});return t.join(" ")}static formatStack(e,t){if(e==="")return"";var r=e.split(`
|
|
2
|
+
`).map(i=>i.trim());switch(t){case W.ERROR:r=r.splice(e[0]==="Error"?4:3);break;case W.UNCAUGHT_ERROR:r=r.splice(e[0]==="Error"?3:2);break}return r!=null?" ".concat(r.join(`
|
|
3
|
+
`)):""}constructor(e){ze(this,"history",void 0),ze(this,"offset",void 0),ze(this,"limit",void 0),ze(this,"isEnabled",void 0),ze(this,"proxy",void 0),this.history=[],this.offset=0,this.limit=1e4,this.isEnabled=!1,this.proxy=e,this.addHistory=this.addHistory.bind(this)}enable(){this.isEnabled||(this.proxy.addEventListener(W.DEBUG,this.addHistory),this.proxy.addEventListener(W.LOG,this.addHistory),this.proxy.addEventListener(W.WARN,this.addHistory),this.proxy.addEventListener(W.ERROR,this.addHistory),this.proxy.addEventListener(W.UNCAUGHT_ERROR,this.addHistory),this.isEnabled=!0)}disable(){this.isEnabled&&(this.proxy.removeEventListener(W.DEBUG,this.addHistory),this.proxy.removeEventListener(W.LOG,this.addHistory),this.proxy.removeEventListener(W.WARN,this.addHistory),this.proxy.removeEventListener(W.ERROR,this.addHistory),this.proxy.removeEventListener(W.UNCAUGHT_ERROR,this.addHistory),this.isEnabled=!1)}addHistory(e){var{type:t,detail:r}=e,i={type:t,messages:r,time:new Date};switch(t){case W.ERROR:case W.UNCAUGHT_ERROR:i.stack=Error().stack;break}this.history[this.offset%this.limit]=i,this.offset+=1}getHistory(){if(this.offset>this.limit){var e=this.offset%this.limit;this.history=this.history.slice(e).concat(this.history.slice(0,e)),this.offset=this.limit}return this.history}getFormattedHistory(){var e=this.getHistory().map(t=>"".concat(t.time.toISOString()," ").concat(t.type," ")+"".concat(lt.formatMessages(t.messages))+(t.stack!=null?`
|
|
4
|
+
`.concat(lt.formatStack(t.stack,t.type)):""));return e.join(`
|
|
5
|
+
`)}}const Ao=lt,ko=Object.freeze(Object.defineProperty({__proto__:null,Log:$,LogHistory:Ao,LogProxy:No,Logger:xs,LoggerLevel:Es,default:$},Symbol.toStringTag,{value:"Module"}));function _i(){var n=c.useRef(!1);return c.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function zn(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function Ro(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){zn(a,r,i,s,o,"next",l)}function o(l){zn(a,r,i,s,o,"throw",l)}s(void 0)})}}var jt=$.module("useAsyncInterval");function Lo(n,e){var t=_i(),r=c.useRef(0),i=c.useRef(0),a=c.useRef(null),s=c.useCallback(Ro(function*(){var o=Date.now();i.current+=1;var l=a.current==null?e:o-a.current;if(jt.debug("tick #".concat(i.current,"."),l,"ms elapsed since last tick."),a.current=o,yield n(),!!t.current){l+=Date.now()-a.current;var d=Math.max(0,l-e),h=Math.max(0,e-d);jt.debug("Next tick target:",e,", overage",d,", adjusted:",h),r.current=window.setTimeout(s,h)}}),[n,t,e]);c.useEffect(()=>(jt.debug("Setting target interval:",e),a.current=null,s(),()=>{window.clearTimeout(r.current)}),[e,s])}function _o(n,e){return c.useCallback(function(){var t=n(...arguments);return e(),t},[e,n])}function ut(n,e){var t=c.useMemo(()=>Be(n,e),[n,e]);return c.useEffect(()=>()=>t.cancel(),[t]),t}function $o(n){var[e,t]=c.useState(n);return c.useEffect(()=>{t(n)},[n]),[e,t]}function Fo(n,e,t,r){var i=c.useRef(0);c.useEffect(()=>{i.current>=t||r&&(i.current+=1,n())},[t,r,...e])}function $i(n,e){var t=c.useRef(n),r=e(t.current,n)?t.current:n;return t.current=r,r}function Fi(n){var e=c.useRef();return c.useEffect(function(){e.current=n}),e.current}function mn(n){var e=c.useRef(null);return c.useEffect(function(){n&&(typeof n=="function"?n(e.current):n.current=e.current)}),e}var Uo=3500,Vo=$.module("useCopyToClipboard");function Ui(){var[n,e]=c.useState(!1),t=c.useRef(null),r=c.useCallback(i=>{oo(i).then(()=>{e(!0)}).catch(a=>Vo.error("Unable to copy ".concat(i),`
|
|
6
|
+
`,a))},[]);return c.useEffect(()=>(t.current&&clearTimeout(t.current),n&&(t.current=setTimeout(()=>{e(!1)},Uo)),()=>{t.current&&clearTimeout(t.current)}),[n]),[n,r]}function Bo(n){n.preventDefault()}function Vi(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=c.useMemo(()=>"useSubmitButtonRef-".concat(xe()),[]),t=c.useCallback(a=>{a==null||a.UNSAFE_getDOMNode().setAttribute("form",e)},[e]),r=c.useMemo(()=>({id:e,onSubmit:n?void 0:Bo}),[e,n]),i=c.useMemo(()=>({form:e,ref:t}),[e,t]);return{formProps:r,submitButtonProps:i}}function Bi(n,e){return c.useCallback(t=>{typeof n=="function"?n(e(t)):n.current=e(t)},[e,n])}function Ki(n,e){var{getItem:t,selectedKeys:r,items:i}=n;return c.useMemo(()=>{var{selection:a,isInverted:s}=ki(r,i.length);return{selection:Ai(a,t,e),isInverted:s}},[r,i.length,t,e])}function Ko(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:lo,t=c.useRef();return c.useEffect(()=>()=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t)},[]),c.useCallback(r=>{var i;(i=t.current)===null||i===void 0||i.call(t);var a=e(r);a&&(a.addEventListener("scroll",n),t.current=()=>{a.removeEventListener("scroll",n),t.current=void 0})},[e,n])}function qn(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function Ho(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){qn(a,r,i,s,o,"next",l)}function o(l){qn(a,r,i,s,o,"throw",l)}s(void 0)})}}function Wo(n,e,t){var r=c.useRef(null),[i,a]=c.useState(null),s=c.useCallback(Ho(function*(){if(!(i==null||t==null)){var l=yield t();i.scroll(0,l)}}),[t,i]);c.useEffect(()=>(i==null||i.addEventListener("scroll",e),s(),()=>{i==null||i.removeEventListener("scroll",e)}),[e,i,s]);var o=c.useCallback(l=>{l&&setTimeout(()=>{a(n(r.current))},0)},[n]);return{ref:r,onOpenChange:o}}function Zn(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function Go(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Zn(a,r,i,s,o,"next",l)}function o(l){Zn(a,r,i,s,o,"throw",l)}s(void 0)})}}function Xe(n,e){var{autoLoad:t=!0}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},[r,i]=c.useState(null),[a,s]=c.useState(null),[o,l]=c.useState(!1),d=c.useCallback(Go(function*(){l(!0);try{var h=yield n(...e);i(h),s(null)}catch(f){i(null),s(f)}finally{l(!1)}}),[n,...e]);return c.useEffect(()=>{t&&d()},[t,d]),{data:r,error:a,isError:a!=null,isLoading:o,reload:d}}function Xn(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Jn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Xn(Object(t),!0).forEach(function(r){zo(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Xn(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function zo(n,e,t){return e=qo(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qo(n){var e=Zo(n,"string");return typeof e=="symbol"?e:String(e)}function Zo(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Xo(n,e,t,r){var i=arguments.length===4;return c.useCallback(a=>{var s=i?a??r:a;t(Jn(Jn({},n),{},{[e]:s}))},[t,n,e,i,r])}function Hi(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=c.useRef(),i=c.useRef(0);return c.useCallback(a=>{window.clearTimeout(r.current),r.current=window.setTimeout(()=>{var s=Math.floor(a.target.scrollTop/n);i.current!==s&&(i.current=s,e(s))},t)},[t,n,e])}function vt(n,e){var[t,r]=c.useState(n);return c.useEffect(()=>{var i=setTimeout(()=>{r(n)},e);return()=>{clearTimeout(i)}},[n,e]),t}function Wi(n,e){return c.useCallback(t=>{if(t!=null){var r=e==null?[t]:t.querySelectorAll(e);r.forEach(i=>{Object.entries(n).forEach(a=>{var[s,o]=a;i.setAttribute(s,o)})})}},[n,e])}function Jo(n){var e=Wi(mo,n);return Bi(e,Ri)}function Gi(){var{getKey:n=zi}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},[e,t]=c.useState([]),[r,i]=c.useState(()=>new Set),a=c.useCallback(g=>b=>n(b)===g,[n]),s=c.useCallback(g=>{var b;return(b=e.find(a(g)))!==null&&b!==void 0?b:null},[e,a]),o=c.useCallback(g=>{var b=s(g);if(b==null)throw new Error("No item found matching key: ".concat(g));return b},[s]),l=c.useCallback(g=>{t(b=>[...b,...g])},[]),d=c.useCallback((g,b)=>{t(w=>[...w.slice(0,g),...b,...w.slice(g)])},[]),h=c.useCallback(g=>{var b=new Set(g);t(w=>w.filter(x=>!b.has(n(x))))},[n]),f=c.useCallback((g,b)=>{var w=e.findIndex(a(g));w!==-1&&t(x=>[...x.slice(0,w),b,...x.slice(w+1)])},[e,a]),p=c.useCallback(g=>{if(g.size!==0){var b=[],w=new Map;for(var x of g.keys()){var P=e.findIndex(a(x));b.push(P),w.set(P,x)}b.sort((k,O)=>k-O);var C=[];e.forEach((k,O)=>{if(b[0]===O){var A=w.get(b.shift()),N=g.get(A);C.push(N)}else C.push(k)}),t(C)}},[e,a]),v=c.useMemo(()=>({items:e,selectedKeys:r,append:l,bulkUpdate:p,findItem:s,getItem:o,insert:d,remove:h,setItems:t,setSelectedKeys:i,update:f}),[l,p,s,o,d,e,h,t,r,f]);return v}function zi(n){var e=n!=null&&typeof n=="object"&&"key"in n;if(!e)throw new Error("Item does not have a `key` prop.");return n.key}const Qo=Object.freeze(Object.defineProperty({__proto__:null,createValidationProps:xo,defaultGetKey:zi,extractSpectrumHTMLElement:Ri,extractSpectrumLastChildHTMLElement:Eo,findSpectrumComboBoxScrollArea:To,getSelectedItemCountOrAll:Oo,identityExtractHTMLElement:Li,isSelectionEqual:Di,isSelectionMaybeInvertedEqual:ji,mapSelection:Ai,optimizeSelection:ki,useAsyncInterval:Lo,useCallbackWithAction:_o,useContextOrThrow:pt,useCopyToClipboard:Ui,useDebouncedCallback:ut,useDebouncedValue:vt,useDependentState:$o,useEffectNTimesWhen:Fo,useFormWithDetachedSubmitButton:Vi,useForwardedRef:mn,useIsEqualMemo:$i,useIsMountedRef:_i,useMappedRef:Bi,useMappedSelection:Ki,useOnScrollOffsetChangeCallback:Hi,useOnScrollRef:Ko,usePopoverOnScrollRef:Wo,usePrevious:Fi,usePromiseFactory:Xe,usePropChangeCallback:Xo,useSetAttributesCallback:Wi,useSpectrumDisableSpellcheckRef:Jo,useWindowedListData:Gi},Symbol.toStringTag,{value:"Module"})),Yo="_spectrumActionBar_tmmkp_5",el="_spectrumDialogComponentHeading_tmmkp_9",tl="_spectrumEllipsis_tmmkp_14",gn={spectrumActionBar:Yo,spectrumDialogComponentHeading:el,spectrumEllipsis:tl};function Qn(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function et(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Qn(Object(t),!0).forEach(function(r){nl(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Qn(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function nl(n,e,t){return e=rl(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rl(n){var e=il(n,"string");return typeof e=="symbol"?e:String(e)}function il(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function qi(n){var{heading:e,confirmationButtonLabel:t,children:r,onCancel:i,onConfirm:a}=n,{formProps:s,submitButtonProps:o}=Vi();return u.jsxs(is,{children:[u.jsx(ni,{level:3,UNSAFE_className:gn.spectrumDialogComponentHeading,children:e}),u.jsx(as,{}),u.jsx(ri,{children:u.jsx(ss,et(et({},s),{},{children:r}))}),u.jsxs(os,{children:[u.jsx(Vn,{variant:"secondary",onPress:i,children:"Cancel"}),u.jsx(Vn,et(et({},o),{},{style:"fill",variant:"negative",onPress:a,type:"submit",children:t}))]})]})}function al(n){var{ariaLabel:e,heading:t,confirmationButtonLabel:r,isHidden:i,children:a,onConfirm:s}=n,o=c.useCallback(l=>u.jsx(qi,{heading:t,confirmationButtonLabel:r,onCancel:l,onConfirm:()=>{l(),s()},children:a}),[a,r,t,s]);return u.jsx(Ni,{ariaLabel:e,icon:si,isHidden:i,isQuiet:!0,height:Ti,children:o})}var sl=["icon","label"];function Yn(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function er(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Yn(Object(t),!0).forEach(function(r){ol(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Yn(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ol(n,e,t){return e=ll(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ll(n){var e=ul(n,"string");return typeof e=="symbol"?e:String(e)}function ul(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function cl(n,e){if(n==null)return{};var t=dl(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function dl(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function Zi(n){var{icon:e,label:t}=n,r=cl(n,sl);return u.jsx(ei,er(er({},r),{},{"aria-label":t,isQuiet:!0,height:Ti,children:u.jsx(on,{children:u.jsx(X,{icon:e})})}))}Zi.displayName="IconActionButton";function tr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function hl(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?tr(Object(t),!0).forEach(function(r){Fe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):tr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Fe(n,e,t){return e=fl(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function fl(n){var e=pl(n,"string");return typeof e=="symbol"?e:String(e)}function pl(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class bn extends c.Component{constructor(e){super(e),Fe(this,"element",void 0),Fe(this,"container",void 0),Fe(this,"rAF",void 0),this.handleEnter=this.handleEnter.bind(this),this.handleExit=this.handleExit.bind(this),this.handleBlur=this.handleBlur.bind(this),this.element=document.createElement("div"),this.element.className="popper-container",this.container=M.createRef(),this.rAF=0;var{isShown:t}=this.props;this.state={show:t,popper:null}}componentDidUpdate(e){var{isShown:t}=this.props;e.isShown!==t&&(t?(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{this.show()})):this.hide())}componentWillUnmount(){this.destroyPopper(!1)}getVisibleElement(e){return e==null||e.clientHeight>0||e.clientWidth>0?e:this.getVisibleElement(e.parentElement)}initPopper(){var{popper:e}=this.state,{closeOnBlur:t,referenceObject:r}=this.props;if(!e&&this.container.current!==null){var{options:i}=this.props;i=hl({placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}}},i),document.body.appendChild(this.element);var a=this.getVisibleElement(this.container.current);a==null&&(a=this.container.current),e=new ls(r||a,this.element,i),e.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(t&&!this.element.contains(document.activeElement)){var s=this.element.firstElementChild;s instanceof HTMLElement&&s.focus()}}),this.setState({popper:e})}}destroyPopper(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;cancelAnimationFrame(this.rAF);var{popper:t}=this.state;t&&(t.destroy(),document.body.contains(this.element)&&document.body.removeChild(this.element),e&&this.setState({popper:null}))}show(){this.initPopper(),this.setState({show:!0})}hide(){this.setState({show:!1})}scheduleUpdate(){var{popper:e}=this.state;e&&e.scheduleUpdate()}handleBlur(e){e.relatedTarget instanceof HTMLElement&&(this.element.contains(e.relatedTarget)||this.hide())}handleEnter(){var{onEntered:e}=this.props;e()}handleExit(){var{onExited:e}=this.props,{show:t}=this.state;t||this.destroyPopper(),e()}renderContent(){var{className:e,children:t,timeout:r,interactive:i,closeOnBlur:a}=this.props,{show:s}=this.state;return u.jsx(Ne,{in:s,timeout:r,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,children:u.jsx("div",{onClick:o=>{o.stopPropagation()},onKeyDown:o=>{o.key==="Escape"&&this.hide()},className:I("popper",{interactive:i},e),onBlur:a?this.handleBlur:void 0,tabIndex:a?-1:void 0,role:"presentation",children:u.jsxs("div",{className:"popper-content",children:[t,u.jsx("div",{className:"popper-arrow","x-arrow":""})]})})})}render(){var{popper:e}=this.state,{"data-testid":t}=this.props;return u.jsx("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":t,children:e&&ii.createPortal(this.renderContent(),this.element)})}}Fe(bn,"propTypes",{children:m.node.isRequired,options:m.shape({}),className:m.string,timeout:m.number,onEntered:m.func,onExited:m.func,isShown:m.bool,closeOnBlur:m.bool,interactive:m.bool,referenceObject:m.shape({}),"data-testid":m.string});Fe(bn,"defaultProps",{options:{},className:"",timeout:fe.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0});const Ge=bn;function nr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function vl(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?nr(Object(t),!0).forEach(function(r){le(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):nr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function le(n,e,t){return e=ml(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ml(n){var e=gl(n,"string");return typeof e=="symbol"?e:String(e)}function gl(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var bl=$.module("Tooltip");class z extends c.Component{static handleHidden(){z.shownTooltipCount-=1,z.shownTooltipCount===0&&(z.lastHiddenTime=Date.now())}static handleShown(){z.shownTooltipCount+=1}constructor(e){super(e),le(this,"container",void 0),le(this,"popper",void 0),le(this,"parent",void 0),le(this,"timer",void 0),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowMouseMove=this.handleWindowMouseMove.bind(this),this.handleWheel=this.handleWheel.bind(this),this.handleTimeout=this.handleTimeout.bind(this),this.handleExited=this.handleExited.bind(this),this.stopShowingTooltip=this.stopShowingTooltip.bind(this),this.container=M.createRef(),this.popper=M.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}componentDidMount(){this.startListening();var{timeout:e}=this.props;e===0&&this.show()}componentDidUpdate(e,t){var{isShown:r}=t,{isShown:i}=this.state;i!==r&&(i?z.handleShown():z.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();var{isShown:e}=this.state;e&&z.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){bl.error("Tooltip doesn't have a container or a parent set!");return}this.parent=this.container.current.parentElement,this.parent.addEventListener("mousemove",this.handleMouseMove),this.parent.addEventListener("mouseleave",this.handleMouseLeave),this.parent.addEventListener("mousedown",this.stopShowingTooltip)}stopListening(){this.parent&&(this.parent.removeEventListener("mousemove",this.handleMouseMove),this.parent.removeEventListener("mouseleave",this.handleMouseLeave),this.parent.removeEventListener("mousedown",this.stopShowingTooltip))}startListeningWindow(){window.addEventListener("mousemove",this.handleWindowMouseMove,!0),window.addEventListener("contextmenu",this.stopShowingTooltip,!0),window.addEventListener("wheel",this.handleWheel)}stopListeningWindow(){window.removeEventListener("mousemove",this.handleWindowMouseMove,!0),window.removeEventListener("contextmenu",this.stopShowingTooltip,!0),window.removeEventListener("wheel",this.handleWheel)}handleMouseMove(){this.startTimer()}handleWheel(){var{isShown:e}=this.state;this.popper.current&&this.parent&&e&&!this.popper.current.element.matches(":hover")&&!this.parent.matches(":hover")&&(this.stopTimer(),this.hide())}handleMouseLeave(){var{isShown:e}=this.state;this.stopTimer();var{interactive:t}=this.props;!t&&e&&this.hide()}handleTimeout(){this.show()}handleWindowMouseMove(e){var t=e.clientX,r=e.clientY,{isShown:i}=this.state;if(!(!this.popper.current||!this.parent)){var a=this.popper.current.element.getBoundingClientRect(),s=this.parent.getBoundingClientRect();t>=a.left&&t<=a.left+a.width&&r>=a.top&&r<=a.top+a.height?this.handleMouseMove():t>=s.left&&t<=s.left+s.width&&r>=s.top&&r<=s.top+s.height?this.handleMouseMove():i&&(this.stopTimer(),this.hide())}}startTimer(){this.stopTimer();var{timeout:e,reshowTimeout:t}=this.props,r=e;(z.shownTooltipCount>0||Date.now()-z.lastHiddenTime<z.triggerReshowThreshold)&&(r=t),this.timer=window.setTimeout(this.handleTimeout,r)}stopTimer(){this.timer!=null&&(clearTimeout(this.timer),this.timer=null)}show(){var{isShown:e}=this.state;if(this.stopTimer(),!e){var t;(t=this.popper.current)===null||t===void 0||t.show(),this.setState({isShown:!0});var{interactive:r}=this.props;r&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)===null||e===void 0||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});var{onExited:e}=this.props;e()}stopShowingTooltip(){var{isShown:e}=this.state;this.stopTimer(),e&&this.hide()}render(){var{interactive:e,children:t,referenceObject:r,popperClassName:i,"data-testid":a,onEntered:s}=this.props,{isShown:o}=this.state,{options:l}=this.props;return l=vl({placement:"bottom"},l),u.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":a,children:u.jsx(Ge,{className:I(i),options:l,ref:this.popper,onEntered:s,onExited:this.handleExited,interactive:e,referenceObject:r,children:u.jsxs("div",{className:"tooltip-content",children:[" ",o&&t]})})})}}le(z,"defaultTimeout",500);le(z,"defaultReshowTimeout",100);le(z,"triggerReshowThreshold",300);le(z,"shownTooltipCount",0);le(z,"lastHiddenTime",Date.now());le(z,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:z.defaultReshowTimeout,timeout:z.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});const mt=z;function rr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function yl(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?rr(Object(t),!0).forEach(function(r){ve(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):rr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ve(n,e,t){return e=wl(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wl(n){var e=Cl(n,"string");return typeof e=="symbol"?e:String(e)}function Cl(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Sl=100,Vt;(function(n){n.UP="UP",n.DOWN="DOWN"})(Vt||(Vt={}));class oe extends c.Component{constructor(e){super(e),ve(this,"popper",void 0),ve(this,"cbContainer",void 0),ve(this,"menuContainer",void 0),ve(this,"input",void 0),ve(this,"getCachedFilteredOptions",re((r,i)=>r.filter(a=>a.title.toLowerCase().indexOf(i.toLowerCase())>=0)));var{popperOptions:t}=this.props;t=yl({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=Be(this.updateInputValue,Sl),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=M.createRef(),this.cbContainer=M.createRef(),this.menuContainer=M.createRef(),this.input=M.createRef()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}getValueAndValidate(e){if(!e)return this.setState({invalid:!1}),{value:e,isValid:!1};var{options:t}=this.props,r=t.filter(i=>i.title.toLowerCase()===e.toLowerCase());return r.length<1?(this.setState({invalid:!0}),{value:e,isValid:!1}):(this.setState({invalid:!1}),{value:r[0].value,isValid:!0})}updateInputValue(e){var{menuIsOpen:t}=this.state,{value:r,isValid:i}=this.getValueAndValidate(e);t&&this.processFilterChange(e),this.fireOnChange(r,i)}fireOnChange(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,{onChange:r}=this.props;r(e,t)}processFilterChange(e){var t,{options:r}=this.props,{menuIsOpen:i}=this.state,a=e?this.getCachedFilteredOptions(r,e):r,s=a.length===1&&a[0].title===e;if(this.setState({filteredOptions:a,keyboardOptionIndex:0}),s&&i){this.closeMenu();return}(t=this.popper.current)===null||t===void 0||t.scheduleUpdate()}resetValue(){this.setState({title:""}),this.fireOnChange("")}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var t,{filteredOptions:r,keyboardOptionIndex:i}=this.state,a=r[i];switch(e.key){case"Enter":case"ArrowRight":e.stopPropagation(),e.preventDefault(),a!=null&&(this.setState({title:a.title,invalid:!1}),this.fireOnChange(a.value)),this.closeMenu(),(t=this.input.current)===null||t===void 0||t.focus();break;case"ArrowUp":e.stopPropagation(),e.preventDefault(),this.navigateMenu(oe.MENU_NAVIGATION_DIRECTION.UP);break;case"ArrowDown":e.stopPropagation(),e.preventDefault(),this.navigateMenu(oe.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Tab":if(e.stopPropagation(),e.preventDefault(),e.shiftKey){this.navigateMenu(oe.MENU_NAVIGATION_DIRECTION.UP);break}this.navigateMenu(oe.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Escape":e.preventDefault(),e.stopPropagation(),this.closeMenu();break}}navigateMenu(e){var{filteredOptions:t,keyboardOptionIndex:r}=this.state,i=r;e===oe.MENU_NAVIGATION_DIRECTION.UP?r>0?(i=(i-1)%t.length,this.setState({keyboardOptionIndex:i})):r===0&&(i=t.length-1,this.setState({keyboardOptionIndex:i})):e===oe.MENU_NAVIGATION_DIRECTION.DOWN&&r<t.length&&(i=(i+1)%t.length,this.setState({keyboardOptionIndex:i})),this.scrollOptionIntoView(i)}handleInputKeyDown(e){var{onEnter:t}=this.props,{menuIsOpen:r}=this.state;r?this.handleMenuKeyDown(e):e.key==="Enter"?t():e.key==="Escape"?(this.resetValue(),e.preventDefault(),e.stopPropagation()):e.key==="ArrowRight"||e.key==="ArrowLeft"||e.key==="Tab"||e.key==="Shift"||this.openMenu()}handleInputChange(e){this.setState({title:e.target.value}),this.updateInputValue(e.target.value)}handleOptionClick(e){var t;this.setState({title:e.title,invalid:!1}),this.fireOnChange(e.value),this.closeMenu(),(t=this.input.current)===null||t===void 0||t.focus()}handelInputFocus(){var{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputClick(){var{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputBlur(e){var{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&this.popper.current!==null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuBlur(e){e.relatedTarget===this.input.current||e.relatedTarget instanceof Element&&this.popper.current!==null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuOpened(){var e;(e=this.input.current)===null||e===void 0||e.focus()}handleMenuExited(){var{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}openMenu(){var{title:e}=this.state;this.processFilterChange(e),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var t;(t=this.popper.current)===null||t===void 0||t.show()})}closeMenu(){var e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(this.setState({menuIsOpen:!1,keyboardOptionIndex:0}),t){var r;(r=this.input.current)===null||r===void 0||r.focus()}(e=this.popper.current)===null||e===void 0||e.hide()}scrollOptionIntoView(e){if(this.menuContainer.current){var t;(t=this.menuContainer.current.children.item(e))===null||t===void 0||t.scrollIntoView({behavior:"smooth",block:"nearest"})}}renderMenuElement(){var{inputWidth:e}=this.state;return u.jsx("div",{className:I("aci-options"),ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,style:{width:e},onBlur:this.handleMenuBlur,children:this.renderOptions()})}renderOptions(){var{noMatchText:e}=this.props,{title:t,filteredOptions:r}=this.state;return t&&r.length===0?u.jsx("div",{className:"no-match",children:e}):r.map((i,a)=>this.renderOption(i,a))}renderOption(e,t){var{keyboardOptionIndex:r}=this.state,i="option-".concat(t,"-").concat(e.value);return u.jsx("button",{type:"button",className:I("aci-option-btn",{"keyboard-active":r===t}),onClick:()=>this.handleOptionClick(e),onFocus:()=>this.setState({keyboardOptionIndex:t}),children:e.title},i)}render(){var{options:e,inputPlaceholder:t,disabled:r,className:i,defaultTitle:a,spellCheck:s,"data-testid":o}=this.props,{title:l,menuIsOpen:d,popperOptions:h,invalid:f}=this.state;return u.jsxs("div",{className:"aci-container",ref:this.cbContainer,children:[u.jsx("input",{value:l||a,className:I("form-control",i,"aci-input",{"is-invalid":f&&!d}),ref:this.input,onChange:this.handleInputChange,placeholder:t||e[0].title,disabled:r,onFocus:this.handelInputFocus,onClick:this.handleInputClick,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:s,"data-testid":o}),u.jsx(Ge,{ref:this.popper,options:h,className:I("aci-options-popper interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})}}ve(oe,"propTypes",{options:m.arrayOf(m.shape({title:m.string.isRequired,value:m.string.isRequired})).isRequired,popperOptions:m.shape({}),onChange:m.func,inputPlaceholder:m.string,disabled:m.bool,className:m.string,defaultTitle:m.string,spellCheck:m.bool,onEnter:m.func,noMatchText:m.string,"data-testid":m.string});ve(oe,"defaultProps",{onChange(){},inputPlaceholder:"",disabled:!1,className:"",defaultTitle:"",popperOptions:null,spellCheck:!0,onEnter(){},noMatchText:"No matching items found","data-testid":void 0});ve(oe,"MENU_NAVIGATION_DIRECTION",Vt);const Ol=oe;function yn(n){var{className:e="",value:t,onChange:r,spellCheck:i=!1,placeholder:a="",disabled:s=!1,delimiter:o="",id:l="","data-testid":d}=n,[h,f]=c.useState(t),[p,v]=c.useState(!1),g=c.useRef(null);c.useEffect(function(){f(t)},[t]);function b(N){return N.trim().split(o).filter(R=>R).join(`
|
|
7
|
+
`.concat(o.trim()))}function w(N){return N.split(`
|
|
8
|
+
`).map(R=>R.trim()).join(" ")}function x(){if(g.current){g.current.style.height="0";var N=g.current.scrollHeight+(g.current.offsetHeight-g.current.clientHeight);N>0&&(g.current.style.height="".concat(N,"px"))}}function P(N){var R=N.target.value;p&&(o&&(R=b(R)),v(!1)),f(R),r(R)}function C(){g.current&&(o&&(f(b(h)),x()),g.current.scrollLeft=0)}function k(){g.current&&document.activeElement!==g.current&&g.current.focus()}function O(){o&&(f(w(h)),r(w(h)))}function A(){v(!0)}return c.useEffect(function(){x()},[h]),u.jsx("textarea",{ref:g,id:l,className:I(e,"auto-resize-textarea form-control"),placeholder:a,value:h,rows:1,onChange:P,onFocus:C,onMouseDown:k,onBlur:O,onPaste:A,spellCheck:i,disabled:s,"data-testid":d})}yn.propTypes={value:m.string.isRequired,onChange:m.func.isRequired,className:m.string,placeholder:m.string,spellCheck:m.bool,disabled:m.bool,delimiter:m.string,id:m.string,"data-testid":m.string};yn.defaultProps={className:"",id:"",placeholder:"",disabled:!1,spellCheck:!1,delimiter:"","data-testid":void 0};function Qe(n){var{children:e,className:t,style:r,"data-testid":i}=n;return u.jsx("div",{className:I("btn-group",t),style:r,role:"group","data-testid":i,children:e})}Qe.displayName="ButtonGroup";Qe.propTypes={children:m.node.isRequired,className:m.string,style:m.object,"data-testid":m.string};Qe.defaultProps={className:null,style:{},"data-testid":void 0};var xl=["kind","variant","type","tooltip","icon","disabled","active","onClick","onContextMenu","onMouseDown","onMouseUp","onMouseEnter","onMouseLeave","onKeyDown","className","style","children","tabIndex","data-testid","aria-label"];function ir(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ar(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ir(Object(t),!0).forEach(function(r){El(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ir(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function El(n,e,t){return e=Tl(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Tl(n){var e=Pl(n,"string");return typeof e=="symbol"?e:String(e)}function Pl(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Il(n,e){if(n==null)return{};var t=Ml(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function Ml(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}var Nl=["primary","secondary","tertiary","success","danger","inline","ghost"],Dl=["group-end"];function jl(n,e){switch(n){case"primary":return"btn-primary";case"secondary":return"btn-outline-primary";case"tertiary":return"btn-secondary";case"success":return"btn-success";case"danger":return"btn-danger";case"inline":return"btn-inline";case"ghost":return I("btn-link",{"btn-link-icon":e,"btn-link-icon-only":e})}}function Al(n){switch(n){case"group-end":return I("pl-2","pr-3")}}var gt=M.forwardRef((n,e)=>{var{kind:t,variant:r,type:i,tooltip:a,icon:s,disabled:o=!1,active:l,onClick:d,onContextMenu:h,onMouseDown:f,onMouseUp:p,onMouseEnter:v,onMouseLeave:g,onKeyDown:b,className:w,style:x,children:P,tabIndex:C,"data-testid":k,"aria-label":O}=n,A=Il(n,xl),N=!!(s&&P==null),R=jl(t,N),G;r&&(G=Al(r));var S;s&&(S=M.isValidElement(s)?s:u.jsx(X,{icon:s}));var D;a!==void 0&&(D=typeof a=="string"?u.jsx(mt,{children:a}):a);var F=O;O===void 0&&N&&a!=null&&typeof a=="string"&&(F=a);var T=u.jsxs("button",ar(ar({"data-testid":k,ref:e,type:i,className:I("btn",R,G,{active:l},w),onClick:d,onContextMenu:h,onMouseUp:p,onMouseDown:f,onMouseEnter:v,onMouseLeave:g,onKeyDown:b,style:x,disabled:o,tabIndex:C,"aria-label":F},A),{},{children:[s&&S,P,a!=null&&!o&&D]}));return o?u.jsxs("span",{className:"btn-disabled-wrapper",children:[T,a!==void 0&&D]}):T});gt.displayName="Button";gt.propTypes={kind:m.oneOf(Nl).isRequired,variant:m.oneOf(Dl),type:m.oneOf(["submit","reset","button"]),tooltip(n){var{tooltip:e,icon:t,children:r}=n;return e===void 0&&t!=null&&r==null?new Error("Tooltip is required for icon only buttons"):null},icon(n){var{children:e,icon:t}=n;return t==null&&e==null?new Error("Icon is required if no children are provided"):e==null&&!M.isValidElement(t)&&(t==null||t.iconName===""||t.iconName==null)?new Error("Icon must be react element or fontawesome IconDefinition"):null},disabled:m.bool,active:m.bool,onClick(n){var{onClick:e,type:t}=n;return t==="button"&&typeof e!="function"?new Error("type button requires an onClick function"):e!==void 0&&typeof e!="function"?new Error("onClick must be a function"):null},onContextMenu:m.func,onMouseUp:m.func,onMouseDown:m.func,onMouseEnter:m.func,onMouseLeave:m.func,onKeyDown:m.func,tabIndex:m.number,children:m.node,className:m.string,style:m.object,"data-testid":m.string};gt.defaultProps={type:"button",onClick:void 0,onContextMenu:void 0,onMouseUp:void 0,onMouseDown:void 0,onMouseEnter:void 0,onMouseLeave:void 0,onKeyDown:void 0,variant:void 0,tooltip:void 0,icon:void 0,disabled:!1,active:void 0,tabIndex:void 0,children:void 0,className:void 0,style:{},"data-testid":void 0};const ie=gt;function kl(n){var{blockInteraction:e=!0,children:t,debounceMs:r,isOpen:i=!1}=n,a=vt(i,r);return u.jsxs(u.Fragment,{children:[e&&i&&u.jsx("div",{className:"modal-backdrop",style:{backgroundColor:"transparent"},"data-testid":"debounced-modal-backdrop"}),M.cloneElement(t,{isOpen:i&&a})]})}function Rl(n){var{className:e,icon:t,isOpen:r=!1,subtitle:i,title:a}=n;return u.jsx(un,{isOpen:r,className:e,children:u.jsx(cn,{children:u.jsxs("div",{className:"info-modal",children:[t!=null&&u.jsx("div",{className:"message-icon",children:u.jsx(X,{icon:t})}),u.jsx("div",{className:"message-header",children:a}),i!=null&&u.jsx("div",{className:"message-content",children:i})]})})})}function Xi(n){var{className:e="modal-footer",children:t,"data-testid":r}=n;return u.jsx("div",{className:e,"data-testid":r,children:t})}function wn(n){var{isOpen:e,headerText:t,bodyText:r,onCancel:i,onConfirm:a,onDiscard:s,onModalDisable:o,cancelButtonText:l="Cancel",confirmButtonText:d="Okay",discardButtonText:h="Discard",isConfirmDanger:f=!1,children:p,"data-testid":v}=n,g=c.useRef(null),b=c.useRef(null),w=c.useCallback(()=>{b.current!==null&&b.current.checked&&o&&o(),a()},[a,o]),x=c.useCallback(()=>{var C;(C=g.current)===null||C===void 0||C.focus()},[]),P="";return e&&(P=typeof r=="function"?r():r),u.jsxs(un,{isOpen:e,className:"theme-bg-light",onOpened:x,children:[u.jsx(oi,{closeButton:!1,children:t}),u.jsx(cn,{children:P}),u.jsxs(Xi,{children:[o&&u.jsxs("div",{className:"custom-control custom-checkbox form-group mr-auto",children:[u.jsx("input",{type:"checkbox",className:"custom-control-input",id:"move-confirmation-checkbox",defaultChecked:!1,ref:b,"data-testid":v!==void 0?"".concat(v,"-checkbox-confirm"):void 0}),u.jsx("label",{className:"custom-control-label",htmlFor:"move-confirmation-checkbox",children:"Don't ask me again"})]}),s&&u.jsx(ie,{kind:"secondary",className:"mr-auto","data-dismiss":"modal",onClick:s,"data-testid":v!==void 0?"".concat(v,"-btn-discard"):void 0,children:h}),i&&u.jsx(ie,{kind:"secondary","data-dismiss":"modal",onClick:i,"data-testid":v!==void 0?"".concat(v,"-btn-cancel"):void 0,children:l}),u.jsxs(Qe,{children:[u.jsx(ie,{kind:f?"danger":"primary",onClick:w,ref:g,"data-testid":v!==void 0?"".concat(v,"-btn-confirm"):void 0,children:d}),p]})]})]})}wn.propTypes={isOpen:m.bool.isRequired,headerText:m.string.isRequired,bodyText:m.oneOfType([m.string,m.func]).isRequired,onCancel:m.func,onConfirm:m.func.isRequired,onDiscard:m.func,onModalDisable:m.func,cancelButtonText:m.string,confirmButtonText:m.string,discardButtonText:m.string,children:m.node,"data-testid":m.string};wn.defaultProps={children:void 0,cancelButtonText:"Cancel",confirmButtonText:"Okay",discardButtonText:"Discard",onCancel:void 0,onDiscard:void 0,onModalDisable:void 0,"data-testid":void 0};var bt=M.forwardRef((n,e)=>{var{children:t,className:r,disabled:i,onClick:a,style:s,id:o}=n;return u.jsx("button",{ref:e,type:"button",className:I("btn",r),onClick:a,style:s,disabled:i,id:o,children:t})});bt.displayName="Button";bt.propTypes={children:m.node,className:m.string,disabled:m.bool,onClick:m.func,style:m.shape({}),id:m.string};bt.defaultProps={children:null,className:"",disabled:!1,onClick:()=>null,style:{},id:""};const Ll=bt;function sr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function or(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?sr(Object(t),!0).forEach(function(r){_l(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):sr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function _l(n,e,t){return e=$l(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function $l(n){var e=Fl(n,"string");return typeof e=="symbol"?e:String(e)}function Fl(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Ul(n){var{styleProps:e,selectedItemCount:t,onClearSelection:r}=n;return u.jsx(us,or(or({UNSAFE_className:gn.spectrumActionBar},e),{},{isEmphasized:!0,selectedItemCount:t,onClearSelection:r}))}function Vl(n){var{className:e,isFlipped:t,children:r,"data-testid":i}=n,a=d=>{if(r.length!==2)throw new Error("CardFlip requires 2 children to function");return r[d]},s=c.useRef(null),o=c.useCallback(d=>{d.target===d.currentTarget&&document.body.classList.add("card-flip--is-flipping")},[]),l=c.useCallback(d=>{d.target===d.currentTarget&&document.body.classList.remove("card-flip--is-flipping")},[]);return c.useEffect(function(){if(!s.current)throw Error("ref undefined");s.current.addEventListener("transitionstart",o);var h=s.current;return function(){if(h!=null)return h.removeEventListener("transitionstart",o)}},[o]),u.jsxs("div",{className:I(e,{"card-flip--show-front":t,"card-flip--show-back":!t}),"data-testid":i,children:[u.jsx("div",{className:"card-flip--back",children:a(0)}),u.jsx("div",{ref:s,className:"card-flip--front",onTransitionEnd:l,children:a(1)})]})}var lr=$.module("GlobalContextAction");class Bl extends c.Component{constructor(e){super(e),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}componentDidMount(){document.body.addEventListener("contextmenu",this.handleContextMenu),document.body.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.body.removeEventListener("contextmenu",this.handleContextMenu),document.body.removeEventListener("keydown",this.handleKeyDown)}handleContextMenu(e){var t=e;t.contextActions==null&&(t.contextActions=[]);var{action:r}=this.props;r.title==null&&!r.menuElement||(t.contextActions==null&&(t.contextActions=[]),t.contextActions.push(r),lr.debug("Received context menu event at global action! Menu items are now: ",t.contextActions))}handleKeyDown(e){var{action:t}=this.props;if(!Q.actionsDisabled&&t.shortcut!==void 0&&t.shortcut.matchesEvent(e)){var r;lr.debug("Global hotkey matched!",e),(r=t.action)===null||r===void 0||r.call(t,e),e.preventDefault(),e.stopPropagation()}}render(){return null}}const Kl=Bl;class Hl extends c.Component{render(){for(var{actions:e,"data-testid":t}=this.props,r=[],i=0;i<e.length;i+=1){var a=e[i],{shortcut:s}=a;if(a.title!=null||a.menuElement||s){var o=u.jsx(Kl,{action:a,"data-testid":t},"".concat(a.title,".").concat(s==null?void 0:s.id));r.push(o)}}return r}}const Wl=Hl;function Ji(n,e,t){return e=Gl(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Gl(n){var e=zl(n,"string");return typeof e=="symbol"?e:String(e)}function zl(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var tt=$.module("ContextActions");class Qi extends c.Component{static triggerMenu(e,t,r,i){if(i.length!==0){var a=new MouseEvent("contextmenu",{clientX:t,clientY:r,bubbles:!0,cancelable:!0});a.contextActions=i,e.dispatchEvent(a)}}constructor(e){super(e),Ji(this,"container",void 0),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=M.createRef(),this.state={globalActions:[],keyboardActions:[]}}static getDerivedStateFromProps(e){if(e.actions==null||!Array.isArray(e.actions))return{globalActions:[],keyboardActions:[]};var t=e.actions.filter(i=>!Dt(i)&&typeof i!="function"&&i.isGlobal),r=e.actions.filter(i=>!Dt(i)&&typeof i!="function"&&(i.isGlobal===void 0||!i.isGlobal)&&i.shortcut!=null);return{globalActions:t,keyboardActions:r}}componentDidMount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&(this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.addEventListener("keydown",this.handleKeyDown))}componentWillUnmount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&(this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.removeEventListener("keydown",this.handleKeyDown))}handleContextMenu(e){var{ignoreClassNames:t=[]}=this.props;if(t.length>0)for(var r=e.target,i=function(){var{classList:d}=r,h=t.find(f=>d.contains(f));if(h!==void 0)return tt.debug2('Contextmenu event ignored based on the target className "'.concat(h,'"')),{v:void 0};r=r.parentElement};r!=null;){var a=i();if(typeof a=="object")return a.v}if(Q.isContextActionEvent(e)||(e.contextActions=[]),!!Q.isContextActionEvent(e)){var{actions:s}=this.props;if(s!=null){var o=s;Array.isArray(o)&&(o=o.filter(l=>Dt(l)||typeof l=="function"||l.isGlobal===void 0||!l.isGlobal)),e.contextActions=e.contextActions.concat(o)}tt.debug("Received context menu event! Menu items are now: ",e.contextActions)}}handleKeyDown(e){for(var{keyboardActions:t}=this.state,r=0;r<t.length;r+=1){var i=t[r];if(!Q.actionsDisabled&&i.shortcut!=null&&i.shortcut.matchesEvent(e)){var a;tt.debug("Context hotkey matched!",e),(a=i.action)===null||a===void 0||a.call(i,e),e.stopPropagation(),e.preventDefault(),tt.debug2("Matched hotkey returned false, key event not consumed")}}}render(){var{"data-testid":e}=this.props,{globalActions:t}=this.state;return u.jsx("div",{className:"context-actions-listener",ref:this.container,"data-testid":e,children:u.jsx(Wl,{actions:t})})}}Ji(Qi,"groups",{default:void 0,high:100,medium:5e3,low:1e4,global:1e5,edit:100});const ql=Qi;function Yi(n,e,t){return e=Zl(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Zl(n){var e=Xl(n,"string");return typeof e=="symbol"?e:String(e)}function Xl(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ce extends c.Component{static handleEnter(e){var t=e;t.style.height="0"}static handleEntering(e){var t=e;t.style.height="".concat(ce.getHeight(t),"px")}static handleExiting(e){var t=e;t.style.height="0"}static handleExit(e){var t=e;t.style.height="".concat(ce.getHeight(t),"px")}static getHeight(e){var t=e.scrollWidth-e.clientWidth;return e.scrollHeight-t}constructor(e){super(e),this.handleEntered=this.handleEntered.bind(this)}handleEntered(e){var t=e;t.style.height="";var{autoFocusOnShow:r}=this.props;if(r!==void 0&&r){var i=t.querySelector("input, select, textarea");i!=null&&i.focus()}}render(){var{children:e,className:t,in:r,"data-testid":i}=this.props;return u.jsx(Ne,{in:r,classNames:{enterActive:"collapsing",enterDone:"collapse show",exitActive:"collapsing",exitDone:"collapse"},onEnter:ce.handleEnter,onEntering:ce.handleEntering,onEntered:this.handleEntered,onExit:ce.handleExit,onExiting:ce.handleExiting,timeout:350,children:a=>u.jsx("div",{className:I({collapse:a==="exited"},t),"data-testid":i,children:e})})}}Yi(ce,"propTypes",{className:m.string,in:m.bool.isRequired,children:m.node.isRequired,autoFocusOnShow:m.bool,"data-testid":m.string});Yi(ce,"defaultProps",{className:"",autoFocusOnShow:!1,"data-testid":void 0});const Jl=ce;var yt=M.forwardRef((n,e)=>{var{checked:t=!1,children:r,className:i,disabled:a,inputClassName:s,isInvalid:o,labelClassName:l,name:d,onChange:h,"data-testid":f}=n,[p]=c.useState(xe()),v=mn(e);c.useEffect(function(){v.current&&(v.current.indeterminate=t===null)},[v,t]);var g=c.useCallback(b=>{v.current&&(v.current.indeterminate=t===null),h&&h(b)},[v,t,h]);return u.jsxs("div",{className:I("custom-control custom-checkbox",i),children:[u.jsx("input",{type:"checkbox",ref:v,checked:t??!1,className:I("custom-control-input",s,{"is-invalid":o}),disabled:a,id:p,name:d,onChange:g,"data-testid":f}),u.jsx("label",{className:I("custom-control-label",l),htmlFor:p,children:r})]})});yt.displayName="Checkbox";yt.propTypes={checked:(n,e)=>{var{[e]:t}=n;return t!==null&&typeof t!="boolean"?new Error("Checked must be a boolean or null for indeterminate"):null},children:m.node.isRequired,className:m.string,disabled:m.bool,inputClassName:m.string,isInvalid:m.bool,labelClassName:m.string,name:m.string,onChange:m.func,"data-testid":m.string};yt.defaultProps={checked:!1,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const ct=yt;function ea(n,e,t){return e=Ql(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ql(n){var e=Yl(n,"string");return typeof e=="symbol"?e:String(e)}function Yl(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ta extends c.PureComponent{constructor(e){super(e),ea(this,"inputField",void 0),this.inputField=M.createRef()}focus(){var e;(e=this.inputField.current)===null||e===void 0||e.focus()}render(){var{value:e,placeholder:t,onBlur:r,onChange:i,className:a,disabled:s,matchCount:o,id:l,onKeyDown:d,"data-testid":h}=this.props;return u.jsxs("div",{className:I("search-group",a),children:[u.jsx("input",{type:"search",value:e,onBlur:r,onChange:i,onKeyDown:d,className:"form-control",disabled:s,placeholder:t,ref:this.inputField,id:l,"data-testid":h}),o!=null&&u.jsx("span",{className:"search-match",children:o}),u.jsx("span",{className:"search-icon",children:u.jsx(X,{icon:Ts})})]})}}ea(ta,"defaultProps",{placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0});const wt=ta;function ur(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function eu(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ur(Object(t),!0).forEach(function(r){te(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ur(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function te(n,e,t){return e=tu(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function tu(n){var e=nu(n,"string");return typeof e=="symbol"?e:String(e)}function nu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Bt;(function(n){n.UP="UP",n.DOWN="DOWN"})(Bt||(Bt={}));class de extends c.Component{constructor(e){super(e),te(this,"popper",void 0),te(this,"cbContainer",void 0),te(this,"toggleButton",void 0),te(this,"menuContainer",void 0),te(this,"input",void 0),te(this,"searchInput",void 0),te(this,"getCachedFilteredOptions",re((t,r)=>t.filter(i=>i.title.toLowerCase().indexOf(r.toLowerCase())>=0||i.value.toLowerCase().indexOf(r.toLowerCase())>=0))),this.state={value:"",filter:"",filteredOptions:e.options,keyboardOptionIndex:-1,menuIsOpen:!1,inputWidth:100},this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handleFilterChange=this.handleFilterChange.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleOptionFocus=this.handleOptionFocus.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=M.createRef(),this.cbContainer=M.createRef(),this.toggleButton=M.createRef(),this.menuContainer=M.createRef(),this.input=M.createRef(),this.searchInput=M.createRef()}componentDidUpdate(){var{menuIsOpen:e,keyboardOptionIndex:t}=this.state;e&&t>=0&&this.scrollOptionIntoView()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.input.current)===null||e===void 0||e.focus()}resetValue(){this.setState({value:""})}updateInputValue(e){var{onChange:t}=this.props;this.setState({value:e}),t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var t,r,{filter:i,filteredOptions:a,keyboardOptionIndex:s}=this.state,{options:o}=this.props,l=i?a:o;switch(e.key){case"Enter":((t=l[s])===null||t===void 0?void 0:t.value)!=null&&this.updateInputValue(l[s].value),this.closeMenu(),(r=this.input.current)===null||r===void 0||r.focus(),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(de.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(de.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":i!==""?(this.setState({filter:""}),e.stopPropagation()):this.closeMenu();break;case"Tab":!e.shiftKey&&s===l.length-1&&this.closeMenu();break}}handleMenuNavigation(e){var{filter:t,filteredOptions:r,keyboardOptionIndex:i}=this.state,{options:a}=this.props,s=t?r:a,o=s.length,l=0;switch(e){case de.MENU_NAVIGATION_DIRECTION.UP:l=-1;break;case de.MENU_NAVIGATION_DIRECTION.DOWN:l=1;break}l!==0&&this.setState({keyboardOptionIndex:(i+l+o)%o})}handleInputKeyDown(e){var{onEnter:t}=this.props,{menuIsOpen:r}=this.state;e.key==="ArrowDown"||e.key==="ArrowUp"?r||this.openMenu():e.key==="Enter"&&t()}handleInputChange(e){this.updateInputValue(e.target.value)}handleOptionClick(e){var t,r=Number(e.currentTarget.value),{filter:i,filteredOptions:a}=this.state,{options:s}=this.props,o=i?a:s;this.updateInputValue(o[r].value),this.closeMenu(),(t=this.input.current)===null||t===void 0||t.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleFilterChange(e){var t,{options:r}=this.props,i=e.target.value,a=this.getCachedFilteredOptions(r,i);this.setState({filter:i,filteredOptions:a,keyboardOptionIndex:0}),(t=this.popper.current)===null||t===void 0||t.scheduleUpdate()}handleMenuBlur(e){e.relatedTarget instanceof Element&&this.popper.current!=null&&this.popper.current.element.contains(e.relatedTarget)||e.relatedTarget===this.toggleButton.current||this.closeMenu(!1)}handleInputBlur(e){var{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&this.popper.current!=null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuOpened(){var e;this.scrollOptionIntoView(),(e=this.searchInput.current)===null||e===void 0||e.focus()}handleMenuExited(){var{menuIsOpen:e}=this.state;if(e){var t;this.setState({menuIsOpen:!1}),(t=this.popper.current)===null||t===void 0||t.hide()}this.setState({filter:""})}toggleMenu(e){var{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var e;(e=this.popper.current)===null||e===void 0||e.show()})}closeMenu(){var e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(this.setState({menuIsOpen:!1}),t){var r;(r=this.input.current)===null||r===void 0||r.focus()}(e=this.popper.current)===null||e===void 0||e.hide()}updateKeyboardIndex(){var{value:e,filter:t,filteredOptions:r}=this.state,{options:i}=this.props,a=t?r:i,s=a.findIndex(o=>o.value===e);this.setState({keyboardOptionIndex:s})}scrollOptionIntoView(){var e,t=(e=this.menuContainer.current)===null||e===void 0?void 0:e.querySelector(".cb-option-btn.keyboard-active");t instanceof HTMLElement&&t.scrollIntoView({block:"nearest",inline:"nearest"})}renderMenuElement(){var{searchPlaceholder:e}=this.props,{filter:t,inputWidth:r}=this.state;return u.jsxs("div",{className:"cb-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:i=>{i.stopPropagation()},style:{width:r},onBlur:this.handleMenuBlur,children:[u.jsx("div",{className:"cb-search-input-container",children:u.jsx(wt,{value:t,ref:this.searchInput,onChange:this.handleFilterChange,className:"cb-search-input",placeholder:e})}),u.jsx("div",{className:"cb-options-container",children:u.jsx("div",{className:"cb-options",children:this.renderOptions()})})]})}renderOptions(){var{options:e}=this.props,{keyboardOptionIndex:t,filter:r,filteredOptions:i}=this.state,a=r?i:e;return a.map((s,o)=>{var l="option-".concat(o,"-").concat(s.value);return u.jsx("button",{type:"button",value:o,className:I("cb-option-btn",{"keyboard-active":t===o}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:s.title},l)})}render(){var{options:e,inputPlaceholder:t,disabled:r,className:i,defaultValue:a,spellCheck:s,"data-testid":o}=this.props,{value:l}=this.state,{popperOptions:d}=this.props;return d=eu({placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}}},d),u.jsxs("div",{className:"input-group cb-container",ref:this.cbContainer,children:[u.jsx("input",{value:l||a,className:I("form-control",i,"cb-input"),ref:this.input,onChange:this.handleInputChange,placeholder:t||(e[0]!=null?e[0].title:void 0),disabled:r,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:s,"data-testid":o!==void 0?"".concat(o,"-input"):void 0}),u.jsx("div",{className:"input-group-append cb-dropdown",children:u.jsxs("button",{type:"button",className:"btn cb-btn form-control",ref:this.toggleButton,onClick:this.toggleMenu,onKeyDown:this.handleInputKeyDown,disabled:r,"data-testid":o!==void 0?"".concat(o,"-btn"):void 0,children:[u.jsx(X,{icon:Ps}),u.jsx(Ge,{ref:this.popper,options:d,className:I("combobox interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})})]})}}te(de,"MENU_NAVIGATION_DIRECTION",Bt);te(de,"DROP_DOWN_MENU_HEIGHT",200);te(de,"propTypes",{options:m.arrayOf(m.shape({title:m.string.isRequired,value:m.string.isRequired})).isRequired,popperOptions:m.shape({title:m.string.isRequired,value:m.string.isRequired}),onChange:m.func,inputPlaceholder:m.string,searchPlaceholder:m.string,disabled:m.bool,className:m.string,defaultValue:m.string,spellCheck:m.bool,onEnter:m.func,"data-testid":m.string});te(de,"defaultProps",{onChange(){},inputPlaceholder:"",searchPlaceholder:"Search",disabled:!1,className:"",defaultValue:"",popperOptions:null,spellCheck:!0,onEnter(){},"data-testid":void 0});const ru=de;function iu(n){var{copy:e,kind:t="ghost",tooltip:r="Copy",className:i,"data-testid":a,children:s}=n,[o,l]=Ui();return u.jsx(ie,{kind:t,className:i,"data-testid":a,icon:o?Is:Ms,tooltip:o?"Copied":r,onClick:()=>{l(typeof e=="function"?e():e)},children:s})}function Ct(n,e,t){return n.substring(0,e)+t+n.substring(e+1)}function na(n,e,t){return n.length<t?"".concat(n).concat(e.substring(n.length,t)):n}function Kt(n,e){for(var{length:t}=n,r=n.length-1;r>=0&&e[r]===n[r];r-=1)t=r;return n.substring(0,t)}function cr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function au(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?cr(Object(t),!0).forEach(function(r){su(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):cr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function su(n,e,t){return e=ou(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ou(n){var e=lu(n,"string");return typeof e=="symbol"?e:String(e)}function lu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var se=$.module("MaskedInput"),Ae={FORWARD:"forward",BACKWARD:"backward",NONE:"none"},nt=" ",ra=M.forwardRef((n,e)=>{var{className:t,example:r,getNextSegmentValue:i=(T,E,y)=>y,getPreferredReplacementString:a=Ct,onChange:s=()=>!1,onSelect:o=()=>!1,onSubmit:l,pattern:d,placeholder:h,selection:f,value:p,onFocus:v=()=>!1,onBlur:g=()=>!1,"data-testid":b}=n,w=mn(e),x=c.useMemo(()=>Array.isArray(r)?r:[r],[r]),P=c.useMemo(()=>x[0].replace(/[a-zA-Z0-9]/g,nt),[x]);c.useEffect(function(){if(f!=null){var E;se.debug("setting selection...",f);var{selectionStart:y,selectionEnd:j,selectionDirection:L}=f;(E=w.current)===null||E===void 0||E.setSelectionRange(y,j,L),se.debug("selection set!")}},[f,w]);var C=c.useCallback(T=>{for(var E=T,y=T,j=x.length>0?x[0]:p,L=E-1;L>=0&&/[a-zA-Z0-9]/g.test(j.charAt(L));L-=1)E=L;for(var K=y;K<j.length&&/[a-zA-Z0-9]/g.test(j.charAt(K));K+=1)y=K+1;var ae=E===y?Ae.NONE:Ae.BACKWARD;return{selectionStart:E,selectionEnd:y,selectionDirection:ae}},[x,p]);function k(T,E){for(var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:T.length,j="",L=0;L<y;L+=1)T.charAt(L)!==nt?j=j.concat(T[L]):j=j.concat(E[L]);return j=j.concat(E.substring(y)),j}function O(T){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:T.length,y=new RegExp("^".concat(d,"$"));if(y.test(T))return!0;for(var j=0;j<x.length;j+=1){var L=k(T,x[j],E);if(y.test(L))return!0}return!1}function A(T){var E=C(T),y=E.selectionEnd+1;return y>=p.length?E:C(y)}function N(T){var E=C(T),y=E.selectionStart-1;return y<=0?E:C(y)}function R(T,E){var y=C(T),j=p.substring(y.selectionStart,y.selectionEnd),L=i(y,E,j,p),K=p.substring(0,y.selectionStart)+L+p.substring(y.selectionEnd);O(K,y.selectionEnd)&&(s(K),o(y))}var G=c.useCallback(T=>{var{selectionStart:E=0,selectionEnd:y=0,selectionDirection:j="none"}=T.target;if(E===null||y===null||j===null){se.error("Selection attempted on non-text input element",T.target);return}if(se.debug2("handleSelect",E,y,j),!(f!=null&&E===f.selectionStart&&y===f.selectionEnd)){if(f!=null&&E===p.length&&y===p.length&&T.nativeEvent.type!=="mouseup"){o(au({},f));return}if(E===y){var L=C(E);se.debug("Selection segment from ",E,y,"=>",L),o(L)}else o({selectionStart:E,selectionEnd:y,selectionDirection:j})}},[C,o,f,p]),S=c.useCallback(T=>{var E;if(w.current){se.debug("handleSelectCapture",T);var y=(E=w.current.selectionStart)!==null&&E!==void 0?E:0;y===p.length&&f!=null&&y!==f.selectionStart&&(T.preventDefault(),T.stopPropagation())}},[w,f,p]);function D(T){if(T.preventDefault(),T.stopPropagation(),!!w.current){var{key:E}=T,{selectionStart:y=0,selectionEnd:j=0}=w.current;if(y===null||j===null){se.error("Selection arrow nvaigation attempted on non-text input element",T.target);return}E==="ArrowLeft"?o(N(y)):E==="ArrowRight"?o(A(j)):E==="ArrowUp"?R(y,-1):E==="ArrowDown"&&R(y,1)}}function F(T){if(w.current){se.debug("handleKeyDown",T);var{key:E}=T,{selectionStart:y=0,selectionEnd:j=0}=w.current;if(y===null||j===null){se.error("Selection key event on non-text input element",T.target);return}if(E==="Enter"){l==null||l(T);return}if(E.startsWith("Arrow")){D(T);return}if(E==="Delete"||E==="Backspace"){if(T.preventDefault(),T.stopPropagation(),j>=Kt(p,P).length){var L=p.substring(0,y===j?y-1:y),K=Kt(L,P);K!==p&&(s(K),o({selectionStart:K.length,selectionEnd:K.length,selectionDirection:Ae.NONE}));return}if(y!==j){var ae=p.substring(0,y)+p.substring(y,j).replace(/[a-zA-Z0-9]/g,nt)+p.substring(j);se.debug("Range ",y,j,"deleted, setting value",ae),s(ae),o({selectionStart:y,selectionEnd:y,selectionDirection:Ae.NONE})}else if(y>0)for(var U=y-1;U>=0;U-=1){var B=p.substring(0,U)+p.substring(U,y).replace(/[a-zA-Z0-9]/g,nt)+p.substring(y);if(B!==p){s(B),o({selectionStart:U,selectionEnd:U,selectionDirection:Ae.NONE});return}}return}if(!(T.altKey||T.metaKey||T.ctrlKey||E.length>1)){T.preventDefault(),T.stopPropagation();for(var V=Array.from(new Set([E,E.toUpperCase(),E.toLowerCase()])),Z=0;Z<V.length;Z+=1)for(var ge=V[Z],Ye=/[a-zA-Z0-9]/g.test(ge)?x[0].length-1:y,be=y;be<=Ye;be+=1){var ns=na(p,x[0],be+1),It=a(ns,be,ge,y,j);if(O(It,be+1)){var Fn=C(be),Mt=be+1,Nt={selectionStart:Mt,selectionEnd:Mt,selectionDirection:Ae.NONE};if(Mt>=Fn.selectionEnd){var Un=A(be);Un.selectionStart!==Fn.selectionStart&&(Nt=Un)}se.debug("handleKeyDown",E,"=>",It,Nt),s(It),o(Nt);return}}}}}return u.jsx("input",{ref:w,className:I("form-control masked-input",t),type:"text",pattern:d,placeholder:h,value:p,onChange:()=>{},onKeyDown:F,onSelect:G,onSelectCapture:S,onFocus:v,onBlur:g,"data-testid":b})});ra.defaultProps={className:"",placeholder:void 0,onChange(){},onSelect(){},getNextSegmentValue:(n,e,t)=>t,getPreferredReplacementString:Ct,selection:void 0,onFocus(){},onBlur(){},"data-testid":void 0};const St=ra;var uu=$.module("TimeInput"),cu="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]",du=["00:00:00","12:34:56","23:59:59"],ia=M.forwardRef((n,e)=>{var{allowValueWrapping:t=!0,className:r="",onChange:i=()=>!1,value:a=0,onFocus:s=()=>!1,onBlur:o=()=>!1,onSelect:l=()=>!1,"data-testid":d}=n,[h,f]=c.useState(qe.formatTime(a)),[p,v]=c.useState(),g=c.useRef(null);c.useImperativeHandle(e,()=>({focus:()=>{var C;(C=g.current)===null||C===void 0||C.focus()},setSelection:C=>{var k;(k=g.current)===null||k===void 0||k.focus(),v(C)}}),[]),c.useEffect(function(){f(qe.formatTime(a))},[a]);function b(C,k,O){var A=C.selectionStart===0?24:60,N=parseInt(O,10)-k;return Number.isNaN(N)?N=0:t?N=(N%A+A)%A:N=Math.min(Math.max(0,N),A-1),"".concat(N).padStart(2,"0")}function w(C,k,O,A,N){return A===0&&N===2&&k===1&&parseInt(O,10)>1?"0".concat(O).concat(C.substring(2)):Ct(C,k,O)}function x(C){uu.debug("handleChange",C),f(C),qe.isTimeString(C)&&i(qe.parseTime(C))}var P=c.useCallback(C=>{v(C),l(C)},[l]);return u.jsx(St,{ref:g,className:r,example:du,getNextSegmentValue:b,getPreferredReplacementString:w,onChange:x,onSelect:P,pattern:cu,selection:p,value:h,onFocus:s,onBlur:o,"data-testid":d})});ia.defaultProps={allowValueWrapping:!0,className:"",onChange:()=>!1,onSelect:()=>!1,value:0,onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};const dt=ia;function dr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function hu(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?dr(Object(t),!0).forEach(function(r){Ze(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):dr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ze(n,e,t){return e=fu(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function fu(n){var e=pu(n,"string");return typeof e=="symbol"?e:String(e)}function pu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}let aa=class extends c.PureComponent{constructor(e){var t;super(e),Ze(this,"container",void 0),Ze(this,"oldFocus",void 0),Ze(this,"rAF",void 0),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMenuItemClick=this.handleMenuItemClick.bind(this),this.handleMenuItemMouseMove=this.handleMenuItemMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.container=M.createRef(),this.oldFocus=document.activeElement,this.rAF=0;var{options:r}=e,i=(t=r.initialKeyboardIndex)!==null&&t!==void 0?t:-1;this.state={menuItems:[],keyboardIndex:i,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.rAF=window.requestAnimationFrame(()=>{var e;(e=this.container.current)===null||e===void 0||e.focus();var{onMenuOpened:t}=this.props;t(this)})}componentDidUpdate(e){var{actions:t}=this.props;e.actions!==t&&this.initMenu()}componentWillUnmount(){cancelAnimationFrame(this.rAF)}getKeyboardIndex(){var{options:e}=this.props;if(e.separateKeyboardMouse!==void 0&&e.separateKeyboardMouse){var{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){var{options:t}=this.props;t.separateKeyboardMouse!==void 0&&t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){var{mouseIndex:e}=this.state;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){cancelAnimationFrame(this.rAF),this.setState({menuItems:[]});var{actions:e}=this.props,t=Q.getMenuItems(e,!1);t.length>0&&this.setState(r=>({menuItems:Q.sortActions(r.menuItems.concat(t))}))}handleKeyDown(e){var{menuItems:t}=this.state,r=this.getKeyboardIndex(),i=r;if(e.key==="Enter"||e.key===" "){r!=null&&r>=0&&r<t.length&&this.handleMenuItemClick(t[r],e);return}if(e.key==="Escape")i=null;else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey===!0){var a;i=Q.getNextMenuItem((a=i)!==null&&a!==void 0?a:0,-1,t)}else if(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1){var s;i=Q.getNextMenuItem((s=i)!==null&&s!==void 0?s:0,1,t)}r!==i&&(i!==null?this.setKeyboardIndex(i):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,{closeMenu:t,onMenuClosed:r}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),r(this)})}handleCloseMenu(){this.closeMenu()}handleMenuItemClick(e,t){t.preventDefault(),t.stopPropagation(),e!=null&&(e.disabled===void 0||!e.disabled)&&e.action!=null&&(e.action(),this.closeMenu(!0))}handleMenuItemMouseMove(e){var{menuItems:t}=this.state,r=t.indexOf(e);this.setMouseIndex(r)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{"data-testid":t}=this.props,{keyboardIndex:r,menuItems:i,mouseIndex:a}=this.state,s=0;s<i.length;s+=1){var o=i[s];s>0&&o.group!==i[s-1].group&&e.push(u.jsx("hr",{},"".concat(s,".separator")));var l=u.jsx(hi,{isKeyboardSelected:r===s,isMouseSelected:a===s,menuItem:o,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},s);e.push(l)}var{menuStyle:d}=this.props;return u.jsx("div",{className:"context-menu-container",style:hu({},d),ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":t,children:e})}};Ze(aa,"defaultProps",{closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});const vu=aa;function hr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function fr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?hr(Object(t),!0).forEach(function(r){Le(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):hr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Le(n,e,t){return e=mu(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mu(n){var e=gu(n,"string");return typeof e=="symbol"?e:String(e)}function gu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class sa extends c.PureComponent{constructor(e){super(e),Le(this,"container",void 0),Le(this,"parent",void 0),Le(this,"popper",void 0),Le(this,"isOpen",void 0),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=M.createRef(),this.parent=null,this.popper=M.createRef(),this.isOpen=!1}componentDidMount(){var{isShown:e}=this.props;if(e===null){var t;(t=this.container.current)!==null&&t!==void 0&&t.parentElement&&(this.parent=this.container.current.parentElement,this.parent.addEventListener("click",this.handleClick))}else e&&this.openMenu()}componentDidUpdate(e){var{isShown:t}=this.props;e.isShown!==t&&(t!==null&&t?window.requestAnimationFrame(()=>{this.openMenu()}):this.closeMenu())}componentWillUnmount(){this.parent&&this.parent.removeEventListener("click",this.handleClick)}closeMenu(){var e;(e=this.popper.current)===null||e===void 0||e.hide()}openMenu(){this.popper.current&&!this.isOpen&&(this.popper.current.show(),this.isOpen=!0)}scheduleUpdate(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleClick(e){e.preventDefault(),e.stopPropagation(),this.openMenu()}handleCloseMenu(){this.closeMenu()}handleExited(){this.isOpen=!1;var{onMenuClosed:e}=this.props;e()}render(){var{actions:e,onMenuOpened:t,popperClassName:r,"data-testid":i}=this.props,{menuStyle:a}=this.props,{options:s,popperOptions:o}=this.props;return o=fr({placement:"bottom"},o),s=fr({separateKeyboardMouse:!0},s),u.jsx("div",{className:"menu-actions-listener",ref:this.container,"data-testid":i,children:u.jsx(Ge,{ref:this.popper,options:o,className:I("menu-popper",r),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:u.jsx(vu,{actions:e,closeMenu:this.handleCloseMenu,onMenuOpened:t,options:s,menuStyle:a})})})}}Le(sa,"defaultProps",{isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0});const oa=sa;function pr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function bu(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?pr(Object(t),!0).forEach(function(r){Oe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):pr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Oe(n,e,t){return e=yu(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yu(n){var e=wu(n,"string");return typeof e=="symbol"?e:String(e)}function wu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var vr=-1,Ht;(function(n){n.UP="UP",n.DOWN="DOWN"})(Ht||(Ht={}));class Y extends c.Component{constructor(e){super(e),Oe(this,"csContainer",void 0),Oe(this,"menuContainer",void 0),Oe(this,"button",void 0),Oe(this,"input",void 0);var{value:t,valueToTime:r}=e;this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleOptionFocus=this.handleOptionFocus.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.handleCustomInput=this.handleCustomInput.bind(this),this.csContainer=M.createRef(),this.menuContainer=M.createRef(),this.button=M.createRef(),this.input=M.createRef(),this.state={keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,customTime:r(t),inputFocused:!1}}getSelectedText(){var{options:e,value:t,placeholder:r}=this.props,{customTime:i}=this.state;if(t===null)return r;for(var a=0;a<e.length;a+=1){var s=e[a];if(s.value===t)return s.title}return qe.formatTime(i)}setInputWidth(){this.csContainer.current&&this.setState({inputWidth:this.csContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.button.current)===null||e===void 0||e.focus()}updateInputValue(e){var{onChange:t}=this.props;t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var t,{keyboardOptionIndex:r,inputFocused:i}=this.state,{options:a}=this.props;switch(e.key){case"Enter":case" ":i?this.updateFromCustom():this.updateInputValue(a[r].value),this.closeMenu(),(t=this.button.current)===null||t===void 0||t.focus(),e.stopPropagation(),e.preventDefault();break;case"Tab":e.shiftKey?this.handleMenuNavigation(Y.MENU_NAVIGATION_DIRECTION.UP):this.handleMenuNavigation(Y.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(Y.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(Y.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":this.closeMenu();break}}handleMenuNavigation(e){var{keyboardOptionIndex:t,inputFocused:r}=this.state,{options:i}=this.props,a=i.length,s=t;switch(e){case Y.MENU_NAVIGATION_DIRECTION.UP:if(!r&&t===0){this.focusInput();break}else r&&this.focusOption(t);t>0&&!r?(s=(s-1)%a,this.setState({keyboardOptionIndex:s})):t===0&&(s=a-1,this.setState({keyboardOptionIndex:s})),this.scrollOptionIntoView(s);break;case Y.MENU_NAVIGATION_DIRECTION.DOWN:if(!r&&t===a-1){this.focusInput();break}else r&&this.focusOption(t);t<a&&!(r&&t===0)&&(s=(s+1)%a,this.setState({keyboardOptionIndex:s})),this.scrollOptionIntoView(s);break}}handleOptionClick(e){var t=Number(e.currentTarget.value),{options:r,timeToValue:i}=this.props,{customTime:a}=this.state;if(t===vr){var s=i(a);this.updateAndClose(s)}else this.updateAndClose(r[t].value)}updateAndClose(e){var t;this.updateInputValue(e),this.closeMenu(),(t=this.button.current)===null||t===void 0||t.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleMenuOpened(){var e,{options:t,value:r}=this.props,{keyboardOptionIndex:i}=this.state;this.scrollOptionIntoView(i);var a=(e=this.menuContainer.current)===null||e===void 0?void 0:e.querySelector(".cs-option-btn.keyboard-active");if(a instanceof HTMLElement&&a.focus(),r!==null){var s=t.map(o=>o.value).indexOf(r);s<0&&this.focusInput()}}focusInput(){var e;(e=this.input.current)===null||e===void 0||e.focus()}focusOption(e){var t,r=(t=this.menuContainer.current)===null||t===void 0?void 0:t.querySelector(".cs-options");if(r&&r.children!=null){var i=r.children.item(e);i instanceof HTMLElement&&i.focus()}}handleMenuExited(){var{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}handleCustomInput(e){var{timeToValue:t}=this.props,r=t(e);this.updateInputValue(r),this.setState({customTime:e})}updateFromCustom(){var{timeToValue:e}=this.props,{customTime:t}=this.state,r=e(t);this.updateInputValue(r)}toggleMenu(e){var{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0})}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(this.setState({menuIsOpen:!1}),e){var t;(t=this.button.current)===null||t===void 0||t.focus()}}updateKeyboardIndex(){var{options:e,value:t}=this.props;if(t!==null){var r=e.map(i=>i.value).indexOf(t);r>0&&this.setState({keyboardOptionIndex:r})}}scrollOptionIntoView(e){var t,r=(t=this.menuContainer.current)===null||t===void 0?void 0:t.querySelector(".cs-options");if(r&&r.children!=null){var i=r.children.item(e);i instanceof HTMLElement&&i.offsetTop>Y.DROP_DOWN_MENU_HEIGHT?r.scrollTop=i.offsetTop-Y.DROP_DOWN_MENU_HEIGHT:(i instanceof HTMLElement&&i.offsetTop<0||e===0)&&(r.scrollTop=0)}}renderMenuElement(){var{inputWidth:e}=this.state;return u.jsx("div",{className:"cs-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:t=>{t.stopPropagation()},style:{width:e},children:u.jsx("div",{className:"cs-options-container",children:u.jsx("div",{className:"cs-options",children:this.renderOptions()})})})}renderOptions(){for(var{options:e,value:t,icon:r,customText:i}=this.props,{keyboardOptionIndex:a,customTime:s,inputFocused:o}=this.state,l=!1,d=[],h=0;h<e.length;h+=1){var f=e[h],p="option-".concat(h,"-").concat(f.value);l=l||f.value===t,d.push(u.jsxs("button",{type:"button",value:h,className:I("cs-option-btn",{"keyboard-active":a===h&&!o}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[f.value===t&&u.jsx(X,{icon:r,className:"mr-2"}),f.value!==t&&u.jsx("span",{className:"mr-4"}),f.title]},p))}return d.push(u.jsx("hr",{className:"cs-divider"},"option-divider")),d.push(u.jsxs("button",{type:"button",value:vr,className:I("cs-option-btn",{"keyboard-active":o}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[!l&&t!==null?u.jsx(X,{icon:r,className:"mr-2"}):u.jsx("span",{className:"mr-4"}),i]},"option-custom-label")),d.push(u.jsxs("div",{className:"cs-custom-container",children:[u.jsx("span",{className:"mr-2"}),u.jsx(dt,{ref:this.input,onChange:this.handleCustomInput,value:s,onFocus:()=>this.setState({inputFocused:!0}),onBlur:()=>this.setState({inputFocused:!1})},"option-input"),u.jsx("span",{className:"ml-2"})]},"cs-custom-container")),d.push(u.jsx("hr",{className:"mb-2"},"option-end")),d}render(){var{disabled:e,invalid:t,value:r,"data-testid":i}=this.props,{menuIsOpen:a}=this.state,{popperOptions:s}=this.props;return s=bu({placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}}},s),u.jsx("div",{className:"input-group cs-container context-menu",ref:this.csContainer,"data-testid":i,children:u.jsx("div",{className:I("input-group-append cs-dropdown",{"cs-dropdown-invalid":t}),children:u.jsxs("button",{type:"button",className:I("btn cs-btn form-control",{"cs-btn-invalid":t}),ref:this.button,onClick:this.toggleMenu,disabled:e,children:[u.jsx("span",{className:I({"text-muted":r===null}),children:this.getSelectedText()}),u.jsx("span",{children:u.jsx(X,{icon:li,className:"cs-caret"})}),u.jsx(oa,{isShown:a,actions:{menuElement:this.renderMenuElement()},popperOptions:s,popperClassName:"CustomTimeSelect",onMenuOpened:this.handleMenuOpened,onMenuClosed:this.handleMenuExited,menuStyle:{maxWidth:"100rem"}})]})})})}}Oe(Y,"MENU_NAVIGATION_DIRECTION",Ht);Oe(Y,"DROP_DOWN_MENU_HEIGHT",125);Oe(Y,"defaultProps",{onChange(){},value:null,disabled:!1,popperOptions:{},icon:Ns,customText:"Custom",placeholder:"Select a time",valueToTime:n=>n===null?0:Math.round(n/1e3),timeToValue:n=>n*1e3,invalid:!1,"data-testid":void 0});const Cu=Y;function ke(n,e,t,r,i){var a=r-t+1,s=((parseInt(e,10)-n-t)%a+a)%a+t;return"".concat(s).padStart(i,"0")}function la(n,e,t){var{selectionStart:r}=n;return r===0?ke(e,t,1900,2099,4):r===5?ke(e,t,1,12,2):r===8?ke(e,t,1,31,2):r===11?ke(e,t,0,23,2):r===17||r===14?ke(e,t,0,59,2):r===20||r===24||r===28?ke(e,t,0,999,3):t}function Wt(n){var e=n.substring(0,23),t=n.substring(23,26),r=n.substring(26);return[e,t,r].filter(i=>i!=="").join("")}var Su=$.module("DateTimeInput"),Ou="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",xu="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]\\.[0-9]{3}[0-9]{3}[0-9]{3}",Eu="".concat(Ou," ").concat(xu),st="2022-01-01",ua="".concat(st," 00:00:00.000000000"),Tu="YYYY-MM-DD HH:MM:SS.SSSSSSSSS";function mr(n){return n!=null&&n.length>=st.length?"".concat(n.substring(0,st.length)).concat(n.substring(st.length).replace(/\u2007/g,"0")).concat(ua.substring(n.length)):n}function gr(n){return n.replace(/\u200B/g,"")}var Pu=[Wt(ua)],Cn=M.forwardRef((n,e)=>{var{className:t="",onChange:r=()=>{},defaultValue:i="",onFocus:a=()=>{},onBlur:s=()=>{},onSubmit:o,"data-testid":l}=n,[d,h]=c.useState(i.length>0?Wt(i):""),[f,p]=c.useState(),v=c.useCallback(b=>{Su.debug("handleChange",b),h(b),r(mr(gr(b)))},[r]),g=c.useCallback(()=>{var b=gr(d),w=mr(b);w!==b&&h(Wt(w)),s()},[d,s]);return u.jsx("div",{className:"d-flex flex-row align-items-center",children:u.jsx(St,{ref:e,className:I(t),example:Pu,getNextSegmentValue:la,onChange:v,onSelect:p,onSubmit:o,pattern:Eu,placeholder:Tu,selection:f,value:d,onFocus:a,onBlur:g,"data-testid":l})})});Cn.displayName="DateTimeInput";Cn.defaultProps={className:"",onChange:()=>{},defaultValue:"",onFocus:()=>{},onBlur:()=>{},"data-testid":void 0};const Iu=Cn;var Mu=$.module("DateInput"),Nu="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",Du=["2000-01-01","2022-12-31"],ju="YYYY-MM-DD",Sn=M.forwardRef((n,e)=>{var{className:t="",onChange:r=()=>{},defaultValue:i="",onFocus:a=()=>{},onBlur:s=()=>{},"data-testid":o}=n,[l,d]=c.useState(i),[h,f]=c.useState(),p=c.useCallback(v=>{Mu.debug("handleChange",v),d(v),r(v)},[r]);return u.jsx("div",{className:"d-flex flex-row align-items-center",children:u.jsx(St,{ref:e,className:I(t),example:Du,getNextSegmentValue:la,onChange:p,onSelect:f,pattern:Nu,placeholder:ju,selection:h,value:l,onFocus:a,onBlur:s,"data-testid":o})})});Sn.displayName="DateInput";Sn.defaultProps={className:"",onChange:()=>!1,defaultValue:"",onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};const Au=Sn;function ca(n,e,t){return e=ku(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ku(n){var e=Ru(n,"string");return typeof e=="symbol"?e:String(e)}function Ru(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class da extends c.PureComponent{constructor(e){super(e),ca(this,"searchInput",void 0),this.searchInput=M.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=Be(this.sendUpdate.bind(this),e.debounceMs),this.state={value:e.value}}componentDidUpdate(e){var{value:t}=this.props;e.value!==t&&this.setState({value:t})}focus(){var e;(e=this.searchInput.current)===null||e===void 0||e.focus()}handleChange(e){this.setState({value:e.target.value},this.sendUpdate)}sendUpdate(){var{onChange:e}=this.props,{value:t}=this.state;e(t)}render(){var{placeholder:e,className:t,matchCount:r,id:i,"data-testid":a}=this.props,{value:s}=this.state;return u.jsx(wt,{value:s,placeholder:e,onChange:this.handleChange,className:t,matchCount:r,ref:this.searchInput,id:i,"data-testid":a})}}ca(da,"defaultProps",{placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0});const Lu=da;function ha(n,e,t){return e=_u(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _u(n){var e=$u(n,"string");return typeof e=="symbol"?e:String(e)}function $u(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Fu=$.module("ItemListItem");class Ot extends c.Component{static handleKeyDown(){return Fu.log("ItemListItem.handleKeyDown false"),!1}constructor(e){super(e),ha(this,"itemRef",void 0),this.handleBlur=this.handleBlur.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleClick=this.handleClick.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleDragStart=this.handleDragStart.bind(this),this.handleDrag=this.handleDrag.bind(this),this.handleDragOver=this.handleDragOver.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.handleDrop=this.handleDrop.bind(this),this.handleDoubleClick=this.handleDoubleClick.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.itemRef=M.createRef()}handleBlur(e){var{itemIndex:t,onBlur:r}=this.props;r(t,e)}handleFocus(e){var{itemIndex:t,onFocus:r}=this.props;r(t,e)}handleClick(e){var{itemIndex:t,onClick:r}=this.props;r(t,e)}handleContextMenu(e){var{itemIndex:t,onContextMenu:r}=this.props;r(t,e)}handleDragStart(e){var{itemIndex:t,onDragStart:r}=this.props;r(t,e)}handleDrag(e){var{itemIndex:t,onDrag:r}=this.props;r(t,e)}handleDragOver(e){e.preventDefault();var{itemIndex:t,onDragOver:r}=this.props;r(t,e)}handleDragEnd(e){var{itemIndex:t,onDragEnd:r}=this.props;r(t,e)}handleDrop(e){var{itemIndex:t,onDrop:r}=this.props;r(t,e)}handleDoubleClick(e){var{itemIndex:t,onDoubleClick:r}=this.props;r(t,e)}handleMouseMove(e){var{itemIndex:t,onMouseMove:r}=this.props;r(t,e)}handleMouseDown(e){var{itemIndex:t,onMouseDown:r}=this.props;r(t,e)}handleMouseUp(e){var{itemIndex:t,onMouseUp:r}=this.props;r(t,e)}render(){var{isDraggable:e,isFocused:t,isSelected:r,style:i,children:a,"data-testid":s}=this.props;return u.jsx("div",{className:I("item-list-item",{active:r},{"is-focused":t},{"is-draggable":e}),onKeyDown:Ot.handleKeyDown,onContextMenuCapture:this.handleContextMenu,onClick:this.handleClick,onDrag:this.handleDrag,onDragStart:this.handleDragStart,onDragOver:this.handleDragOver,onDragEnd:this.handleDragEnd,onDrop:this.handleDrop,onDoubleClick:this.handleDoubleClick,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseUp:this.handleMouseUp,tabIndex:-1,ref:this.itemRef,role:"listitem",style:i,onFocus:this.handleFocus,onBlur:this.handleBlur,draggable:e,"data-testid":s,children:a})}}ha(Ot,"defaultProps",{children:null,isDraggable:!1,isFocused:!1,isSelected:!1,itemIndex:0,"data-testid":void 0,onBlur(){},onClick(){},onContextMenu(){},onDragStart(){},onDrag(){},onDragOver(){},onDragEnd(){},onDrop(){},onDoubleClick(){},onFocus(){},onMouseDown(){},onMouseMove(){},onMouseUp(){},style:{}});const fa=Ot;function br(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function yr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?br(Object(t),!0).forEach(function(r){ne(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):br(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ne(n,e,t){return e=Uu(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Uu(n){var e=Vu(n,"string");return typeof e=="symbol"?e:String(e)}function Vu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var wr=$.module("ItemList"),Cr=5;class J extends c.PureComponent{static renderItem(e){var t,r,{item:i}=e;return u.jsx("div",{className:"item-list-item-content",children:i!=null&&((t=(r=i.displayValue)!==null&&r!==void 0?r:i.value)!==null&&t!==void 0?t:"".concat(i))})}constructor(e){super(e),ne(this,"list",void 0),ne(this,"listContainer",void 0),ne(this,"getItemSelected",re((i,a)=>ue.isSelected(a,i),{max:J.CACHE_SIZE})),ne(this,"getCachedItem",re((i,a,s,o,l,d,h,f)=>{var p=d({item:s,itemIndex:i,isFocused:o,isSelected:l,style:h});return u.jsx(fa,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:f,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:o,isSelected:l,itemIndex:i,style:h,children:p},a)},{max:J.CACHE_SIZE})),ne(this,"getOuterElement",re(i=>{var a=M.forwardRef((s,o)=>u.jsx("div",yr({ref:o,tabIndex:-1,onKeyDown:i,role:"presentation"},s)));return a.displayName="ItemListOuterElement",a})),ne(this,"getInnerElement",re(()=>{var i=M.forwardRef((a,s)=>u.jsx("div",yr({className:"item-list-inner-element",ref:s},a)));return i.displayName="ItemListInnerElement",i})),ne(this,"getItemData",re((i,a,s)=>({items:i,selectedRanges:a,renderItem:s}))),this.handleItemBlur=this.handleItemBlur.bind(this),this.handleItemContextMenu=this.handleItemContextMenu.bind(this),this.handleItemFocus=this.handleItemFocus.bind(this),this.handleItemDoubleClick=this.handleItemDoubleClick.bind(this),this.handleItemMouseDown=this.handleItemMouseDown.bind(this),this.handleItemMouseMove=this.handleItemMouseMove.bind(this),this.handleItemMouseUp=this.handleItemMouseUp.bind(this),this.handleItemsRendered=this.handleItemsRendered.bind(this),this.handleWindowMouseUp=this.handleWindowMouseUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleScroll=this.handleScroll.bind(this),this.handleResize=this.handleResize.bind(this),this.renderInnerElement=this.renderInnerElement.bind(this),this.list=M.createRef(),this.listContainer=M.createRef();var{isStickyBottom:t,selectedRanges:r}=e;this.state={focusIndex:null,mouseDownIndex:null,selectedRanges:r,overscanStartIndex:0,height:null,isDragging:!1,isStuckToBottom:t,scrollOffset:null,mouseX:null,mouseY:null}}componentDidUpdate(e,t){var{selectedRanges:r,itemCount:i}=this.props,{focusIndex:a,isStuckToBottom:s,scrollOffset:o,height:l,selectedRanges:d}=this.state;if(s&&!this.isListAtBottom()&&i>0&&this.scrollToBottom(),(o!==t.scrollOffset||l!==t.height)&&this.sendViewportUpdate(),r!==e.selectedRanges&&r!==d)this.setSelectedRanges(r);else if(d!==t.selectedRanges){var{onSelectionChange:h}=this.props;h(d)}if(a!==t.focusIndex){var{onFocusChange:f}=this.props;f(a)}}componentWillUnmount(){window.removeEventListener("mouseup",this.handleWindowMouseUp)}focus(){var e;(e=this.listContainer.current)===null||e===void 0||e.focus()}restoreScrollPosition(){var{scrollOffset:e}=this.state;if(e!=null){var t;(t=this.listContainer.current)===null||t===void 0||t.scrollTo(0,e)}}getElement(e){if(this.listContainer.current==null)return null;var{focusSelector:t}=this.props,{overscanStartIndex:r}=this.state,i=this.listContainer.current.querySelectorAll(t),a=e-r;return i[a]}focusItem(e){var{disableSelect:t}=this.props;if(!t){this.setState({focusIndex:e});var r=this.getElement(e);r instanceof HTMLElement&&r.focus()}}scrollToItem(e){var t=this.getElement(e);t!=null&&t.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){this.setState({focusIndex:e});var{selectedRanges:r}=this.state,i=ue.isSelected(r,e),a=i||Q.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,a,!1)}handleItemDoubleClick(e,t){var{isDoubleClickSelect:r,onSelect:i}=this.props;r&&this.setState(a=>{var{selectedRanges:s}=a;return{selectedRanges:ue.selectRange(s,[e,e])}},()=>{i(e,t)})}handleItemMouseDown(e,t){var{selectedRanges:r}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(t.button===2&&r.length===0){this.focusItem(e),this.selectItem(e);return}t.button!=null&&t.button!==0||(this.setState({mouseDownIndex:e,mouseX:t.clientX,mouseY:t.clientY}),window.addEventListener("mouseup",this.handleWindowMouseUp))}}handleItemBlur(e,t){wr.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){wr.debug2("item focus",e,t.target),this.setState(r=>{var{focusIndex:i}=r;return i!==e?{focusIndex:e}:null})}handleItemMouseMove(e,t){var{isDragSelect:r,isMultiSelect:i,disableSelect:a}=this.props,{mouseDownIndex:s,selectedRanges:o,mouseX:l,mouseY:d}=this.state;if(!(s==null||a)){var h=Math.abs(t.clientX-(l??0)),f=Math.abs(t.clientY-(d??0));h>Cr&&f>Cr&&this.setState({isDragging:!0}),(r||s===e)&&(this.focusItem(e),i?(!r&&!this.getItemSelected(e,o)&&!Q.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(s,e),Math.max(s,e)])):this.toggleSelect(e,t.shiftKey,Q.isModifierKeyDown(t),!1))}}handleItemMouseUp(e,t){var{isDeselectOnClick:r,isDoubleClickSelect:i,onSelect:a}=this.props,{mouseDownIndex:s,isDragging:o}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(s===e&&!o){var l=t.shiftKey,d=Q.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,l,d,r),!i&&!l&&!d&&a(e,t)}this.resetMouseState()}}handleItemsRendered(e){var{overscanStartIndex:t}=e;this.setState({overscanStartIndex:t})}handleResize(e){var{height:t}=e;this.setState({height:t})}handleMouseLeave(){this.setState({mouseDownIndex:null})}handleWindowMouseUp(){this.resetMouseState(),window.removeEventListener("mouseup",this.handleWindowMouseUp)}handleKeyDown(e){var{isMultiSelect:t,itemCount:r,onSelect:i}=this.props,{focusIndex:a}=this.state,s=a;if(e.key==="Enter"||e.key===" "){!t&&s!=null&&this.setState({selectedRanges:[[s,s]]},()=>{s!=null&&i(s,e)});return}if(e.key==="ArrowUp")s!=null&&s>=0?s=Math.max(0,s-1):s=r-1;else if(e.key==="ArrowDown")s!=null&&s>=0?s=Math.min(s+1,r-1):s=0;else return;if(a!==s){e.stopPropagation(),e.preventDefault(),this.focusItem(s);var{selectedRanges:o}=this.state;if(e.shiftKey&&o.length>0){var l=o[o.length-1];this.selectRange([Math.min(s,l[0]),Math.max(s,l[1])])}else if(this.deselectAll(),s!==null)this.selectItem(s);else{var d;(d=this.listContainer.current)===null||d===void 0||d.focus()}this.scrollIntoView(s)}}handleScroll(e){var{scrollUpdateWasRequested:t,scrollOffset:r}=e;this.setState(i=>{if(t)return{scrollOffset:r};var{isStickyBottom:a}=this.props,{height:s}=i,o=a&&this.isListAtBottom({scrollOffset:r,height:s});return{isStuckToBottom:o,scrollOffset:r}})}resetMouseState(){this.setState({mouseDownIndex:null,isDragging:!1})}scrollToBottom(){var{itemCount:e}=this.props;this.list.current&&this.list.current.scrollToItem(e)}scrollIntoView(e){this.list.current&&this.list.current.scrollToItem(e)}toggleSelect(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,{isMultiSelect:a}=this.props,{selectedRanges:s}=this.state;if(a&&t&&s.length>0){var o=s[s.length-1];this.selectRange([Math.min(o[0],e),Math.max(e,o[1])])}else a&&s.length===1&&s[0][0]===e&&s[0][1]===e?i&&this.deselectItem(e):a&&r?this.getItemSelected(e,s)?i&&this.deselectItem(e):this.selectItem(e):(this.deselectAll(),this.selectItem(e))}deselectAll(){var{itemCount:e}=this.props;this.deselectRange([0,e])}deselectItem(e){this.deselectRange([e,e])}deselectRange(e){ue.validateRange(e),this.setState(t=>{var{selectedRanges:r}=t;return{selectedRanges:ue.deselectRange(r,e)}})}selectItem(e){var{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){ue.validateRange(e),this.setState(t=>{var{selectedRanges:r}=t;return{selectedRanges:ue.selectRange(r,e)}})}setSelectedRanges(e){this.setState({selectedRanges:e})}sendViewportUpdate(){var{scrollOffset:e,height:t}=this.state;if(e!=null&&t!=null){var{onViewportChange:r,rowHeight:i}=this.props,a=Math.floor(e/i),s=a+Math.ceil(t/i);r(a,s)}}isListAtBottom(){var{scrollOffset:e,height:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.state;if(t==null||e==null)return!1;var{itemCount:r,rowHeight:i}=this.props;return e+t>=r*i}renderInnerElement(e){var{index:t,style:r}=e,{items:i,offset:a,renderItem:s,disableSelect:o}=this.props,{focusIndex:l,selectedRanges:d}=this.state;if(t<a||t>=a+i.length)return null;var h=i[t-a];return this.getCachedItem(t,t,h,t===l&&!o,this.getItemSelected(t,d),s,r,o)}render(){var{items:e,itemCount:t,overscanCount:r,renderItem:i,rowHeight:a,"data-testid":s}=this.props,{selectedRanges:o,isStuckToBottom:l}=this.state;return u.jsx(cs,{className:"item-list-auto-sizer",onResize:this.handleResize,children:d=>{var{width:h,height:f}=d;return u.jsx(ds,{className:"item-list-scroll-pane",height:f,width:h,initialScrollOffset:l?t*a:0,itemCount:t,itemSize:a,itemData:this.getItemData(e,o,i),onScroll:this.handleScroll,onItemsRendered:this.handleItemsRendered,ref:this.list,outerElementType:this.getOuterElement(this.handleKeyDown),outerRef:this.listContainer,innerElementType:this.getInnerElement(),overscanCount:r,"data-testid":s,children:this.renderInnerElement})}})}}ne(J,"CACHE_SIZE",1e3);ne(J,"DEFAULT_ROW_HEIGHT",20);ne(J,"DEFAULT_OVERSCAN",10);ne(J,"defaultProps",{offset:0,items:[],rowHeight:J.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:J.DEFAULT_OVERSCAN,renderItem:J.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0});function Sr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function we(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Sr(Object(t),!0).forEach(function(r){Me(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Sr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Me(n,e,t){return e=Bu(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Bu(n){var e=Ku(n,"string");return typeof e=="symbol"?e:String(e)}function Ku(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class he extends c.PureComponent{static renderHandle(){return u.jsxs("div",{children:[u.jsx(mt,{children:"Drag to re-order"}),u.jsx(X,{icon:Ds})]})}static renderBadge(e){var{text:t}=e;return t!=null&&t.length>0?u.jsx("span",{className:"number-badge",children:t}):null}static renderTextItem(e){var{text:t,badgeText:r="",className:i=""}=e;return u.jsxs("div",{className:I("item-list-item-content","draggable-item-list-item-content",i),children:[u.jsx("span",{className:"title",children:t}),he.renderBadge({text:r}),he.renderHandle()]})}static renderItem(e){var t,r,{item:i,isClone:a,selectedCount:s}=e,o=i!=null?(t=(r=i.displayValue)!==null&&r!==void 0?r:i.value)!==null&&t!==void 0?t:"".concat(i):"",l=a!==void 0&&a?"".concat(s):"",d=a!==void 0&&a?"item-list-item-clone":"";return he.renderTextItem({text:o,badgeText:l,className:d})}static getDraggableId(e,t){return"".concat(e,"/").concat(t)}static getDraggableIndex(e){var t=e.split("/").pop();return parseInt(t!==void 0?t:"",10)}constructor(e){super(e),Me(this,"itemList",void 0),Me(this,"getCachedDraggableItem",re((t,r,i,a,s,o,l,d)=>u.jsx(hs,{draggableId:he.getDraggableId(t,a),index:a,isDragDisabled:l,children:h=>u.jsx("div",we(we(we({role:"menuitem",className:"draggable-item-list-item",ref:h.innerRef,tabIndex:-1},h.draggableProps),h.dragHandleProps),{},{children:r({item:i,itemIndex:a,isFocused:s,isSelected:o,style:d,isClone:!1})}))},a),{max:J.CACHE_SIZE})),Me(this,"getCachedRenderDraggableItem",re((t,r,i)=>a=>{var{item:s,itemIndex:o,isFocused:l,isSelected:d,style:h}=a;return this.getCachedDraggableItem(t,i,s,o,l,d,r,h)},{max:1})),Me(this,"getCachedRenderClone",re((t,r,i,a)=>(s,o,l)=>{var{selectedCount:d}=this.state,{draggableProps:h,dragHandleProps:f,innerRef:p}=s,{index:v}=l.source,g=r[v-i];return u.jsx("div",we(we(we({className:I("draggable-item-list-dragging-item-container",t)},h),f),{},{ref:p,children:u.jsx("div",{className:I("draggable-item-list-dragging-item",{"two-dragged":d===2},{"multiple-dragged":d>2}),children:a({item:g,itemIndex:v,isFocused:!1,isSelected:!0,style:{},isClone:!0,selectedCount:d})})}))},{max:1})),this.handleSelectionChange=this.handleSelectionChange.bind(this),this.itemList=M.createRef(),this.state={selectedCount:0}}selectItem(e){var t;(t=this.itemList.current)===null||t===void 0||t.selectItem(e)}focusItem(e){var t;(t=this.itemList.current)===null||t===void 0||t.focusItem(e)}scrollToItem(e){var t;(t=this.itemList.current)===null||t===void 0||t.scrollToItem(e)}handleSelectionChange(e){this.setState({selectedCount:ue.count(e)});var{onSelectionChange:t}=this.props;t(e)}render(){var{className:e,draggablePrefix:t,draggingItemClassName:r,droppableId:i,isDoubleClickSelect:a,isDragDisabled:s,isDropDisabled:o,isMultiSelect:l,isStickyBottom:d,itemCount:h,items:f,offset:p,onFocusChange:v,onSelect:g,onViewportChange:b,renderItem:w,rowHeight:x,selectedRanges:P,style:C,"data-testid":k}=this.props;return u.jsx(fs,{isDropDisabled:o,droppableId:i,mode:"virtual",renderClone:this.getCachedRenderClone(r,f,p,w),"data-testid":k,children:(O,A)=>u.jsx("div",we(we({role:"menu",className:I("draggable-item-list",e,{"is-drop-disabled":o,"is-drag-disabled":s,"is-dragging-from-this":A.draggingFromThisWith,"is-dragging-over":A.isDraggingOver,"is-dropping":A.draggingOverWith}),style:C,ref:O.innerRef},O.droppableProps),{},{children:u.jsx(J,{focusSelector:".draggable-item-list-item",isDoubleClickSelect:a,isDragSelect:!1,isMultiSelect:l,isStickyBottom:d,itemCount:h,items:f,onFocusChange:v,onSelect:g,onSelectionChange:this.handleSelectionChange,onViewportChange:b,offset:p,ref:this.itemList,renderItem:this.getCachedRenderDraggableItem(t,s,w),rowHeight:x,selectedRanges:P})}))})}}Me(he,"DEFAULT_ROW_HEIGHT",30);Me(he,"defaultProps",{className:"",draggingItemClassName:"",offset:0,items:[],rowHeight:he.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!0,isDropDisabled:!1,isDragDisabled:!1,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,style:null,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},renderItem:he.renderItem,selectedRanges:[],draggablePrefix:"draggable-item",droppableId:"droppable-item-list","data-testid":void 0});const Hu=he;class ht{static reorder(e,t,r,i){var a=e===r?ht.adjustDestinationIndex(i,t):i,s=ht.removeItems(e,t);return r.splice(a,0,...s),s}static removeItems(e,t){for(var r=[],i=t.map((h,f)=>({range:h,index:f})).sort((h,f)=>f.range[0]-h.range[0]),a=0;a<i.length;a+=1){var{range:s,index:o}=i[a],[l,d]=s;r[o]=e.splice(l,d-l+1)}return ps(r)}static adjustDestinationIndex(e,t){for(var r=e,i=0;i<t.length;i+=1){var[a,s]=t[i];if(a>e)break;r-=Math.min(s,e-1)-a+1}return r}static startDragging(){document.documentElement.classList.add("drag-pointer-events-none")}static stopDragging(){document.documentElement.classList.remove("drag-pointer-events-none")}}const Wu=ht;function Gu(n){var{isInvalid:e=!1,items:t,onAdd:r=()=>{},onDelete:i=()=>{},validate:a=()=>null}=n,[s,o]=c.useState(null),[l,d]=c.useState([]),[h,f]=c.useState(""),p=c.useCallback(C=>{d(C)},[]),v=c.useCallback(()=>{i(ue.getItemsInRanges(t,l)),d([])},[t,l,i]),g=c.useCallback(()=>{if(h!==""){var C=a(h);C==null?(r(h),f("")):o(C)}},[h,r,a]),b=c.useCallback(C=>{var{value:k}=C.target;f(k),o(k===""?null:a(k))},[a]),w=c.useCallback(()=>{d([])},[]),x=c.useCallback(C=>{C.key==="Enter"&&g()},[g]),P=c.useMemo(()=>14+vs(t.length,1,6)*J.DEFAULT_ROW_HEIGHT,[t.length]);return u.jsxs("div",{className:I("editable-item-list-container",{"is-invalid":e}),children:[u.jsx("div",{style:{height:P},children:u.jsx(J,{itemCount:t.length,items:t.map((C,k)=>({value:C,isSelected:ue.isSelected(l,k)})),offset:0,selectedRanges:l,onSelectionChange:p,isMultiSelect:!0})}),u.jsxs("div",{className:"d-flex flex-row pt-2",children:[u.jsx("div",{className:"d-flex flex-grow-1",children:u.jsx("input",{className:I("form-control",{"is-invalid":s!=null}),placeholder:"Enter value",type:"text",value:h,onChange:b,onFocus:w,onKeyDown:x})}),u.jsxs("div",{className:"d-flex align-items-start mt-1 ml-2",children:[u.jsx(ie,{kind:"ghost",onClick:g,disabled:s!=null||h==="",icon:js,tooltip:"Add new item","data-testid":"add-item-button"}),u.jsx(ie,{kind:"ghost",onClick:v,disabled:l.length===0,icon:si,tooltip:"Delete selected items","data-testid":"delete-item-button"})]})]})]})}function zu(n,e,t){return e=qu(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qu(n){var e=Zu(n,"string");return typeof e=="symbol"?e:String(e)}function Zu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ue extends c.Component{static isParentSelected(e,t){var r=t.get(e);if(r===void 0)return!1;if(typeof r=="boolean")return r;var i=Array.from(r.values()).includes(!0),a=Array.from(r.values()).includes(!1);return i&&a?null:i}constructor(e){super(e),this.toggleMenu=this.toggleMenu.bind(this),this.toggleValueFor=this.toggleValueFor.bind(this),this.selectAll=this.selectAll.bind(this),this.clear=this.clear.bind(this),this.state={menuIsOpen:!1}}toggleMenu(e){e.stopPropagation(),e.preventDefault(),this.setState(t=>{var{menuIsOpen:r}=t;return{menuIsOpen:!r}})}toggleValueFor(e,t){var{valueMap:r,onUpdateValueMap:i}=this.props,a=new Map(r),s=a.get(e);if(s instanceof Map){var o=new Map(s);if(t!=null)o.set(t,s.get(t)===void 0);else{var l=Ue.isParentSelected(e,a),d=l==null||!l;s.forEach((p,v)=>o.set(v,d))}a.set(e,o)}else a.set(e,s==null||!s);var h=a.get(e);if(t===void 0&&h!==void 0&&typeof h!="boolean"){var f=Ue.isParentSelected(e,r);f!=null&&f?h.forEach((p,v)=>h.set(v,!1)):h.forEach((p,v)=>h.set(v,!0))}i(a)}setAllValues(e){var{valueMap:t,onUpdateValueMap:r}=this.props,i=new Map;t.forEach((a,s)=>{if(typeof a=="boolean")i.set(s,e);else{var o=new Map;a.forEach((l,d)=>o.set(d,e)),i.set(s,o)}}),r(i)}selectAll(){this.setAllValues(!0)}clear(){this.setAllValues(!1)}renderMenuElement(){var{valueMap:e,"data-testid":t}=this.props;return u.jsxs("div",{className:"hcm-menu-container",children:[Array.from(e.entries()).map(r=>{var[i,a]=r;return u.jsxs("div",{children:[u.jsx(ct,{className:"hcm-parent",checked:Ue.isParentSelected(i,e),onChange:()=>this.toggleValueFor(i),children:i}),a!==void 0&&typeof a!="boolean"&&Array.from(a.entries()).map(s=>{var[o,l]=s;return u.jsx(ct,{className:"hcm-child",checked:l,onChange:()=>this.toggleValueFor(i,o),children:o},o)})]},i)}),u.jsx(ie,{kind:"ghost",onClick:this.selectAll,"data-testid":t!==void 0?"".concat(t,"-btn-select-all"):void 0,children:"Select All"}),u.jsx(ie,{kind:"ghost",onClick:this.clear,"data-testid":t!==void 0?"".concat(t,"-btn-clear"):void 0,children:"Clear"})]})}render(){var{menuText:e,className:t,icon:r,id:i,"data-testid":a}=this.props,{menuIsOpen:s}=this.state;return u.jsxs("button",{type:"button",className:I("btn hcm-btn",t),onClick:this.toggleMenu,id:i,"data-testid":a,children:[u.jsxs("span",{children:[r&&u.jsx(X,{icon:r,className:"hcm-icon mr-1"}),e]}),u.jsx(X,{icon:li,className:"hcm-icon ml-1"}),u.jsx(Ge,{options:{placement:"bottom"},isShown:s,onExited:()=>{this.setState({menuIsOpen:!1})},closeOnBlur:!0,interactive:!0,children:this.renderMenuElement()})]})}}zu(Ue,"defaultProps",{className:"",icon:null,id:"","data-testid":void 0});const Xu=Ue;function pa(n){var{on:e,id:t,className:r,isInvalid:i,disabled:a=!1,onClick:s,"data-testid":o}=n;return u.jsx("button",{type:"button",className:I("btn","btn-switch",r,{active:e},{"is-invalid":i}),id:t,onClick:s,disabled:a,"data-testid":o,children:u.jsx("div",{className:"handle"})})}function Or(n){return n.isOn!==void 0}function va(n){var{item:e,onSelect:t=()=>{},"data-testid":r}=n,{icon:i,subtitle:a,title:s}=e,o=c.useMemo(()=>Or(e)?()=>{e.onChange(!e.isOn)}:t,[e,t]);return u.jsxs("div",{className:"btn btn-navigation-menu-item","data-testid":"menu-item-".concat(s),onClick:o,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&o()},tabIndex:0,role:"menuitem",children:[i!==void 0&&u.jsx("div",{className:"icon",children:u.jsx(X,{icon:i})}),u.jsx("div",{className:"title",children:s}),a!==void 0&&u.jsx("div",{className:"shortcut",children:a}),u.jsx("div",{className:"accessory","data-testid":r,children:Or(e)?u.jsx(pa,{on:e.isOn,onClick:l=>{l.stopPropagation(),o()}}):u.jsx(X,{icon:As})})]})}function Ju(n){var{items:e,onSelect:t=()=>{},"data-testid":r}=n;return u.jsx("div",{className:"navigation-menu-view","data-testid":r,children:u.jsx("ul",{className:"navigation-menu-list",children:e.map((i,a)=>u.jsx("li",{children:u.jsx(va,{item:i,onSelect:()=>{t(a)}})},i.title))})})}function Qu(n){var{children:e,onBack:t,onClose:r,title:i,"data-testid":a}=n;return u.jsxs("div",{className:"navigation-page","data-testid":a,children:[u.jsxs("div",{className:"navigation-title-bar",children:[u.jsx("div",{className:"navigation-left-buttons",children:t!==void 0&&u.jsx(ie,{kind:"ghost",className:"btn-back","data-testid":"btn-page-back",onClick:t,icon:ks,children:"Back"})}),u.jsx("div",{className:"navigation-title",children:i}),u.jsx("div",{className:"navigation-right-buttons",children:r!==void 0&&u.jsx(ie,{kind:"ghost",className:"btn-close px-2 m-1","data-testid":"btn-page-close",onClick:r,icon:ui,tooltip:"Close"})})]}),u.jsx("div",{className:"navigation-content",children:e})]})}function Yu(n){var{children:e,"data-testid":t}=n,r=c.useMemo(()=>M.Children.toArray(e),[e]),i=Fi(r),[a,s]=c.useState(r[r.length-1]),[o,l]=c.useState(null),[d,h]=c.useState(null);c.useEffect(function(){if(!(i===void 0||r===i)){var g=r[r.length-1];r.length===i.length||i.length===0||o!==null||d!==null?o!==null&&g!==o?l(g):g!==d&&g!==a&&s(g):r.length>i.length?l(g):r.length<i.length&&(s(g),h(i[i.length-1]))}},[r,i,o,d,a]);var f=c.useCallback(()=>{s(o),l(null)},[o]),p=c.useCallback(()=>{h(null)},[]);return u.jsxs("div",{className:"navigation-stack",children:[u.jsx("div",{className:"main-view","data-testid":t,children:a}),u.jsx(Ne,{in:d!=null,timeout:fe.transitionMidMs,classNames:"slide-right",onEntered:p,children:u.jsx(u.Fragment,{children:d!=null&&u.jsx("div",{className:"popping-view",children:d})})}),u.jsx(Ne,{in:o!=null,timeout:fe.transitionMidMs,classNames:"slide-left",onEntered:f,children:u.jsx(u.Fragment,{children:o!=null&&u.jsx("div",{className:"pushing-view",children:o})})})]})}function ec(n){var{children:e,disabled:t,value:r,"data-testid":i}=n;return u.jsx("option",{value:r,disabled:t,"data-testid":i,children:e})}function tc(n){var{children:e,disabled:t=!1,name:r,onChange:i,value:a="","data-testid":s}=n,[o]=c.useState(r??xe());return u.jsx(u.Fragment,{children:M.Children.map(e,l=>{var d,h;return l?M.cloneElement(l,{name:o,onChange:(d=l.props.onChange)!==null&&d!==void 0?d:i,checked:a===l.props.value,disabled:(h=l.props.disabled)!==null&&h!==void 0?h:t,"data-testid":s}):null})})}var On=M.forwardRef((n,e)=>{var{checked:t,children:r,className:i="",disabled:a=!1,inputClassName:s="",isInvalid:o=!1,labelClassName:l="",name:d,onChange:h,value:f,"data-testid":p}=n,[v]=c.useState(xe());return u.jsxs("div",{className:I("custom-control custom-radio",i),children:[u.jsx("input",{type:"radio",id:v,"data-testid":p,name:d,ref:e,className:I("custom-control-input",s,{"is-invalid":o}),checked:t,disabled:a,value:f,onChange:h}),u.jsx("label",{className:I("custom-control-label",l),htmlFor:v,children:r})]})});On.displayName="RadioItem";On.defaultProps={checked:void 0,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const nc=On;var rc=.025,ic=.9,ac=.1,sc=.618,At=fe["primary-dark"],xr=80,oc=fe["gray-800"],lc=fe["gray-900"],Te={SIZE:8,DOT_SIZE:2,FILL_OPACITY:.25},Ce=18,uc=250,cc=60*1e3,dc=M.memo(()=>{var n=c.useRef(null),e=c.useRef(null),[t,r]=c.useState(!1),i=window.devicePixelRatio,a,s,o,l,d,h=null,f=[];function p(){var S;e.current!=null&&(o=e.current.offsetWidth,l=e.current.offsetHeight),n.current!=null&&(n.current.style.width="".concat(o,"px"),n.current.style.height="".concat(l,"px"),n.current.width=o*i,n.current.height=l*i),(S=a)===null||S===void 0||S.scale(i,i)}function v(){var S=document.createElement("canvas");S.width=Te.SIZE,S.height=Te.SIZE;var D=S.getContext("2d");return D!=null&&(D.fillStyle=At,D.fillRect(0,0,Te.DOT_SIZE,Te.DOT_SIZE),D.fillStyle=At+Math.round(255*Te.FILL_OPACITY).toString(16).padStart(2,"0"),D.fillRect(0,0,Te.SIZE,Te.SIZE)),D==null?void 0:D.createPattern(S,"repeat")}function g(S){var D=Math.random()-.5,F=rc*D;return S<ac?F=Math.abs(F):S>ic&&(F=-Math.abs(F)),S+F}function b(){for(var S=[],D=sc,F=0;F<o+Ce;F+=1)D=g(D),S.push(D);return S}function w(){for(;f.length>=o+Ce;)f.pop();for(;f.length<o+Ce;)f.push(g(f[f.length-1]))}function x(S,D){D.beginPath(),D.moveTo(-1,l+1),D.lineTo(-1,l*S[0]);for(var F=0;F<S.length;F+=1)D.lineTo(F,l*S[F]);D.lineTo(o+Ce,l*S[S.length-1]),D.lineTo(o+Ce,l+1),D.closePath()}function P(S){S.beginPath();for(var D=1;D<o;D+=xr)S.moveTo(D,0),S.lineTo(D,l);for(var F=1;F<l;F+=xr)S.moveTo(0,F),S.lineTo(o,F)}function C(S){var D,F,T;h=(D=h)!==null&&D!==void 0?D:S,Fs(a),a.fillStyle=lc,a.fillRect(0,0,o,l),P(a),a.lineWidth=1,a.strokeStyle=oc,a.stroke();var E=(((F=h)!==null&&F!==void 0?F:0)-(S??0))/(1e3/Ce);if(a.translate(E,0),x(f,a),a.lineWidth=2,a.strokeStyle=At,a.stroke(),a.translate(-E,0),s!=null&&(a.fillStyle=s),a.fill(),a.setTransform(i,0,0,i,0,0),(S??0)-((T=h)!==null&&T!==void 0?T:0)>1e3/Ce){for(var y,j=Math.floor(((S??0)-((y=h)!==null&&y!==void 0?y:0))/(1e3/Ce)),L=0;L<j;L+=1)f.shift(),f.push(g(f[f.length-1]));h=S}d!=null&&cancelAnimationFrame(d),d=requestAnimationFrame(C)}var k=Be(()=>{d=requestAnimationFrame(S=>{p(),w(),r(!1),C(S)})},uc,{leading:!0});function O(){r(!0),d!=null&&cancelAnimationFrame(d),d=null,h=null}var A=Be(()=>{O()},cc);function N(){d==null&&(r(!1),p(),w(),d=requestAnimationFrame(C)),A()}function R(){document.hasFocus()&&N()}function G(){d!=null&&cancelAnimationFrame(d),A(),k()}return c.useEffect(()=>{var S;return a=(S=n.current)===null||S===void 0?void 0:S.getContext("2d",{alpha:!1}),p(),f=b(),s=v(),C(),A(),window.addEventListener("resize",G),window.addEventListener("focus",N),window.addEventListener("blur",O),window.addEventListener("mousemove",R),window.addEventListener("keydown",R),()=>{d!=null&&cancelAnimationFrame(d),window.removeEventListener("resize",G),window.removeEventListener("focus",N),window.removeEventListener("blur",O),window.removeEventListener("mousemove",R),window.removeEventListener("keydown",R),A.cancel(),k.cancel()}},[]),u.jsx("div",{className:"random-area-plot-animation-container",ref:e,children:u.jsx("canvas",{ref:n,className:t?"shade":""})})});const ma=dc;function ga(n){var{text:e,placement:t="top-start"}=n,r=c.useMemo(()=>({placement:t}),[t]);return u.jsxs(u.Fragment,{children:[u.jsx(ti,{UNSAFE_className:gn.spectrumEllipsis,children:e??u.jsx(u.Fragment,{children:" "})}),e==null||e===""?null:u.jsx(mt,{options:r,children:e})]})}var hc=["scrollRef","getItemDisplayText","getKey"];function Er(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Tr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Er(Object(t),!0).forEach(function(r){fc(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Er(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function fc(n,e,t){return e=pc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function pc(n){var e=vc(n,"string");return typeof e=="symbol"?e:String(e)}function vc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function mc(n,e){if(n==null)return{};var t=gc(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function gc(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function bc(n){var{scrollRef:e,getItemDisplayText:t,getKey:r}=n,i=mc(n,hc),a=c.useCallback(s=>{var o=r(s),l=t(s);return u.jsx(ms,{textValue:l??String(o),children:u.jsx(ga,{text:l})},o)},[t,r]);return u.jsx(gs,Tr(Tr({},i),{},{ref:e,menuTrigger:"focus",onSelectionChange:i.onSelectionChange,children:a}))}function yc(n){var{children:e,onBlur:t,onChange:r,className:i,defaultValue:a,name:s,value:o,disabled:l,"data-testid":d}=n,h=c.useCallback(f=>{r(f.target.value)},[r]);return u.jsx("select",{className:I("custom-select",i),onBlur:t,onChange:h,defaultValue:a,value:o,name:s,disabled:l,"data-testid":d,children:e})}function Re(n,e,t){return e=wc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wc(n){var e=Cc(n,"string");return typeof e=="symbol"?e:String(e)}function Cc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ba extends c.PureComponent{constructor(e){super(e),Re(this,"list",void 0),Re(this,"topRow",void 0),Re(this,"bottomRow",void 0),Re(this,"getCachedItem",re((t,r,i,a,s,o,l)=>{var d={height:s},h=a??i;return u.jsx("li",{className:"value-list-item",style:d,tabIndex:-1,children:u.jsx(ct,{checked:o,disabled:l,onChange:()=>this.handleSelect(t),children:h})},r)},{max:1e3})),Re(this,"getCachedItems",re((t,r,i,a)=>{for(var s=[],o=0;o<t.length;o+=1){var l=t[o],{value:d,displayValue:h,isSelected:f}=l,p=i+o,v=p,g=this.getCachedItem(p,v,d,h,r,f,a);s.push(g)}return s},{max:1})),this.handleBlur=this.handleBlur.bind(this),this.handleScroll=this.handleScroll.bind(this),this.handleSelect=this.handleSelect.bind(this),this.list=M.createRef(),this.topRow=null,this.bottomRow=null}componentDidMount(){this.sendViewportUpdate()}componentDidUpdate(){this.sendViewportUpdate()}handleBlur(e){if(!e.relatedTarget||this.list.current&&e.relatedTarget instanceof HTMLElement&&!this.list.current.contains(e.relatedTarget)){var{onBlur:t}=this.props;t==null||t(e)}}handleScroll(){this.sendViewportUpdate()}handleSelect(e){var{items:t,offset:r,onSelect:i}=this.props,a=e-r;if(a>=0&&a<t.length){var s=t[a],{value:o}=s;i(e,o)}else i(e,null)}sendViewportUpdate(){if(!(!this.list.current||this.list.current.clientHeight===0)){var{onViewportChange:e,rowHeight:t}=this.props,r=this.list.current.scrollTop,i=r+this.list.current.clientHeight,a=Math.floor(r/t),s=Math.ceil(i/t);(this.topRow!==a||this.bottomRow!==s)&&(this.topRow=a,this.bottomRow=s,e(a,s))}}getElement(e){if(this.list.current==null)return null;var t=this.list.current.querySelectorAll(".value-list-item");return t[e]}scrollIntoView(e){var t=this.getElement(e);t==null||t.scrollIntoView({block:"center"})}render(){var{className:e,disabled:t,isInvalid:r,items:i,itemCount:a,offset:s,rowHeight:o,"data-testid":l}=this.props,d=this.getCachedItems(i,o,s,t);return u.jsx("div",{className:I("select-value-list-scroll-pane h-100 w-100",{"is-invalid":r},e),onBlur:this.handleBlur,onScroll:this.handleScroll,ref:this.list,"data-testid":l,children:u.jsx("div",{className:"select-value-list",style:{height:a*o},children:u.jsx("ol",{className:"select-value-list-content",style:{position:"absolute",height:i.length*o,top:s*o,left:0},children:d})})})}}Re(ba,"defaultProps",{disabled:!1,rowHeight:21,onBlur:()=>{},"data-testid":void 0});const ya=ba;function Se(n,e,t){return e=Sc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Sc(n){var e=Oc(n,"string");return typeof e=="symbol"?e:String(e)}function Oc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Pr=$.module("Shortcut"),q;(function(n){n.CTRL="MODIFIER_CTRL",n.CMD="MODIFIER_CMD",n.ALT="MODIFIER_ALT",n.OPTION="MODIFIER_OPTION",n.SHIFT="MODIFIER_SHIFT"})(q||(q={}));var _;(function(n){n.A="A",n.B="B",n.C="C",n.D="D",n.E="E",n.F="F",n.G="G",n.H="H",n.I="I",n.J="J",n.K="K",n.L="L",n.M="M",n.N="N",n.O="O",n.P="P",n.Q="Q",n.R="R",n.S="S",n.T="T",n.U="U",n.V="V",n.W="W",n.X="X",n.Y="Y",n.Z="Z",n.ZERO="0",n.ONE="1",n.TWO="2",n.THREE="3",n.FOUR="4",n.FIVE="5",n.SIX="6",n.SEVEN="7",n.EIGHT="8",n.NINE="9",n.BACKSPACE="Backspace",n.ESCAPE="Escape",n.ENTER="Enter",n.DELETE="Delete",n.SLASH="/",n.QUESTION_MARK="?",n.BACKSLASH="\\",n.PIPE="|",n.MINUS="-",n.UNDERSCORE="_",n.EQUALS="=",n.PLUS="+",n.BACKTICK="`",n.TILDE="~",n.COMMA=",",n.LEFT_CHEVRON="<",n.PERIOD=".",n.RIGHT_CHEVRON=">",n.SEMICOLON=";",n.COLON=":",n.SINGLE_QUOTE="'",n.DOUBLE_QUOTE='"',n.LEFT_BRACKET="[",n.RIGHT_BRACKET="]",n.LEFT_CURLY="{",n.RIGHT_CURLY="}",n.F1="F1",n.F2="F2",n.F3="F3",n.F4="F4",n.F5="F5",n.F6="F6",n.F7="F7",n.F8="F8",n.F9="F9",n.F10="F10",n.F11="F11",n.F12="F12"})(_||(_={}));var xc=new Set([_.ENTER,_.DELETE,_.F1,_.F2,_.F3,_.F4,_.F5,_.F6,_.F7,_.F8,_.F9,_.F10,_.F11,_.F12]);class H extends ln{static isAllowedKey(e){return Object.values(_).includes(e)}static isValidKeyState(e){var{keyValue:t}=e;if(t===null)return!0;if(!H.isMacPlatform&&e.metaKey||!H.isAllowedKey(t))return!1;var r=!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey;return!r||xc.has(t)}static createKeyState(e){var t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(r=>{switch(r){case q.CTRL:t.ctrlKey=!0;break;case q.ALT:case q.OPTION:t.altKey=!0;break;case q.CMD:t.metaKey=!0;break;case q.SHIFT:t.shiftKey=!0;break}}),t}static getKeyStateFromEvent(e){var{key:t,keyCode:r}=e,i="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?i="":!H.isAllowedKey(t)&&H.isAllowedKey(String.fromCharCode(r))?i=String.fromCharCode(r):i=t,{keyValue:i,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey}}static getWindowsDisplayText(e){var t="";return e.ctrlKey&&(t+="Ctrl+"),e.altKey&&(t+="Alt+"),e.shiftKey&&(t+="Shift+"),e.keyValue===_.ESCAPE?t+="Esc":e.keyValue!==null&&(t+=e.keyValue),t}static getMacDisplayText(e){var t="";switch(e.ctrlKey&&(t+="⌃"),e.altKey&&(t+="⌥"),e.shiftKey&&(t+="⇧"),e.metaKey&&(t+="⌘"),e.keyValue){case _.ENTER:t+="⏎";break;case _.ESCAPE:t+="⎋";break;case _.BACKSPACE:t+="⌫";break;case _.DELETE:t+="⌦";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){var r,i;return((r=e.keyValue)===null||r===void 0?void 0:r.toUpperCase())===((i=t.keyValue)===null||i===void 0?void 0:i.toUpperCase())&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey&&e.shiftKey===t.shiftKey}static getDisplayText(e){return e.keyValue===null?"":H.isMacPlatform?H.getMacDisplayText(e):H.getWindowsDisplayText(e)}constructor(e){var{id:t,shortcut:r,macShortcut:i,isEditable:a=!0,name:s,tooltip:o}=e;super(),Se(this,"id",void 0),Se(this,"name",void 0),Se(this,"tooltip",void 0),Se(this,"isEditable",void 0),Se(this,"defaultKeyState",void 0),Se(this,"keyState",void 0),this.id=t,this.name=s,this.tooltip=o,this.isEditable=a;var l=H.isMacPlatform,d=l?i:r;this.defaultKeyState=H.createKeyState(d),this.keyState=this.defaultKeyState}getDisplayText(){return H.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){H.isValidKeyState(e)?(Pr.debug2("Shortcut ".concat(this.id," updated to ").concat(JSON.stringify(e))),this.keyState=e,this.dispatchEvent(new xi("onUpdate",{detail:this}))):Pr.debug2("Shortcut ".concat(this.id," tried to update to invalid keyState ").concat(JSON.stringify(e)))}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return H.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState(H.NULL_KEY_STATE)}isNull(){return H.doKeyStatesMatch(this.keyState,H.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return H.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState(H.getKeyStateFromEvent(e))}}Se(H,"NULL_KEY_STATE",{metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null});Se(H,"isMacPlatform",Q.isMacPlatform());function Ir(n,e,t){return e=Ec(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ec(n){var e=Tc(n,"string");return typeof e=="symbol"?e:String(e)}function Tc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Mr=$.module("ShortcutRegistry");class Pc extends ln{constructor(){super(...arguments),Ir(this,"shortcutMap",new Map),Ir(this,"shortcutsByCategory",new Map)}createAndAdd(e){var t=new H(e);return this.add(t)}add(e){var t=this.shortcutMap.get(e.id);if(t)return Mr.warn("Skipping attempt to add duplicate shortcut ID to registry: ".concat(e.id)),t;Mr.debug2("Adding shortcut to registry: ".concat(e.id)),e.addEventListener("onUpdate",a=>{var{detail:s}=a;return this.dispatchEvent(new xi("onUpdate",{detail:s}))});var r=e.id.split(".")[0];if(this.shortcutMap.set(e.id,e),this.shortcutsByCategory.has(r)){var i;(i=this.shortcutsByCategory.get(r))===null||i===void 0||i.push(e)}else this.shortcutsByCategory.set(r,[e]);return e}get(e){return this.shortcutMap.get(e)}getConflictingShortcuts(e){return Array.from(this.shortcutMap.values()).filter(t=>!t.isNull()&&t.matchesKeyState(e))}}var Ic=Object.freeze(new Pc);const Pe=Ic;var Mc={COPY:Pe.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[q.CTRL,_.C],macShortcut:[q.CMD,_.C],isEditable:!1}),PASTE:Pe.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[q.CTRL,_.V],macShortcut:[q.CMD,_.V],isEditable:!1}),SAVE:Pe.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[q.CTRL,_.S],macShortcut:[q.CMD,_.S],isEditable:!1}),SELECT_ALL:Pe.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[q.CTRL,_.A],macShortcut:[q.CMD,_.A],isEditable:!1}),LINKER:Pe.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[q.CTRL,_.L],macShortcut:[q.CMD,_.L]}),LINKER_CLOSE:Pe.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[_.ESCAPE],macShortcut:[_.ESCAPE],isEditable:!1})};const Nc=Mc;var xn=M.forwardRef((n,e)=>{var{children:t,className:r,disabled:i,id:a,isLinked:s,isLinkedSource:o,isInvalid:l,onClick:d,onMouseEnter:h,onMouseLeave:f,style:p,"data-testid":v}=n;return u.jsxs("button",{ref:e,type:"button",className:I("btn-socketed",{"btn-socketed-linked":s!==void 0&&s||o},{"btn-socketed-linked-source":o},{"is-invalid":l},r),id:a,onClick:d,onMouseEnter:h,onMouseLeave:f,style:p,disabled:i,"data-testid":v,children:[t,u.jsx(X,{icon:Rs,className:"linked btn-socketed-icon",transform:"down-1"}),u.jsx(X,{icon:Ls,className:"is-invalid btn-socketed-icon"})]})});xn.displayName="SocketedButton";xn.defaultProps={children:void 0,className:"",disabled:!1,id:void 0,isLinked:!1,isLinkedSource:!1,isInvalid:!1,onClick:void 0,onMouseEnter:void 0,onMouseLeave:void 0,style:void 0,"data-testid":void 0};const Dc=xn,jc={"dh-spectrum-theme--dark":"_dh-spectrum-theme--dark_1qqxl_5"},Ac={"dh-spectrum-theme--light":"_dh-spectrum-theme--light_oc9vy_5"};function Nr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function rt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Nr(Object(t),!0).forEach(function(r){kc(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Nr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function kc(n,e,t){return e=Rc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Rc(n){var e=Lc(n,"string");return typeof e=="symbol"?e:String(e)}function Lc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var{global:_c,light:$c,dark:Fc,medium:Uc,large:Vc}=bs,Bc={global:_c,light:rt(rt({},$c),Ac),dark:rt(rt({},Fc),jc),medium:Uc,large:Vc},Kc=500;function Hc(n){var{heading:e,content:t,delayMs:r=Kc}=n,[i,a]=c.useState(!1);return c.useEffect(()=>{window.setTimeout(()=>{a(!0)},r)},[r]),i?u.jsxs(ys,{children:[u.jsx(on,{size:"XXL",children:u.jsx(X,{icon:_s})}),u.jsx(ni,{children:e}),t==null?null:u.jsx(ri,{children:t})]}):null}const Wc="_track_1ermw_30",Gc="_handle_1ermw_13",zc="_ticks_1ermw_98",wa={"handle-size":"15px","popover-width":"90px","time-slider":"_time-slider_1ermw_3","time-slider-popovers":"_time-slider-popovers_1ermw_8","handle-popper":"_handle-popper_1ermw_13","flex-spacer":"_flex-spacer_1ermw_26",track:Wc,"track-fills":"_track-fills_1ermw_37","track-fill":"_track-fill_1ermw_37","track-fill-start":"_track-fill-start_1ermw_55","track-fill-middle":"_track-fill-middle_1ermw_56","track-fill-end":"_track-fill-end_1ermw_59","handle-track":"_handle-track_1ermw_62",handle:Gc,ticks:zc,"tick-labels":"_tick-labels_1ermw_116","tick-label":"_tick-label_1ermw_116","tick-label-wrapper":"_tick-label-wrapper_1ermw_132"};var it=parseInt(wa["handle-size"],10),Dr=parseInt(wa["popover-width"],10),ee=24*60*60-1,jr=5*60;function qc(n){var{startTime:e,endTime:t,onChange:r,isStartModified:i=!1,isEndModified:a=!1,"data-testid":s}=n,[o,l]=c.useState(e),[d,h]=c.useState(t),f=c.useRef(null);c.useEffect(function(){l(e),h(t)},[e,t]);var p=c.useCallback((b,w)=>{var x=b,P=w;x===P&&(P<ee?P+=1:x-=1),l(x),h(P),r({startTime:x,endTime:P})},[l,h,r]),v=c.useCallback(b=>{p(b,d)},[p,d]),g=c.useCallback(b=>{p(o,b)},[p,o]);return u.jsxs("div",{className:"time-slider","data-testid":s,children:[u.jsx(Zc,{startTime:o,endTime:d,onStartTimeChange:v,onEndTimeChange:g,isStartModified:i,isEndModified:a}),u.jsxs("div",{className:"track",ref:f,children:[u.jsx(Xc,{startTime:o,endTime:d}),u.jsx("div",{className:"ticks",children:Array(24).fill(null).map((b,w)=>u.jsx("div",{className:"tick"},w))}),u.jsx(Ar,{track:f,time:o,setTime:v}),u.jsx(Ar,{track:f,time:d,setTime:g})]}),u.jsxs("div",{className:"tick-labels",children:[u.jsx("div",{className:"tick-label",children:"0:00"}),u.jsx("div",{className:"tick-label-wrapper",children:Array(24).fill(null).map((b,w)=>u.jsx("div",{className:"tick-label",children:"".concat(w+1,":00")},w))})]})]})}function Zc(n){var{startTime:e,endTime:t,onStartTimeChange:r,onEndTimeChange:i,isStartModified:a,isEndModified:s,"data-testid":o}=n,l=e>t,[d,h]=c.useState(l?t:e),[f,p]=c.useState(l?e:t),v=c.useRef(null),g=c.useRef(null),b=c.useRef(null),w=c.useRef(null);c.useEffect(function(){h(e>t?t:e),p(e>t?e:t)},[e,t]),c.useEffect(function(){if(b.current!==null){var A;(A=g.current)===null||A===void 0||A.setSelection(b.current)}if(w.current!==null){var N;(N=v.current)===null||N===void 0||N.setSelection(w.current)}},[l]);function x(O){e<=t?r(O):i(O)}function P(O){e<=t?i(O):r(O)}var C=c.useCallback(O=>{b.current=O,w.current=null},[]),k=c.useCallback(O=>{b.current=null,w.current=O},[]);return u.jsxs("div",{className:"time-slider-popovers",children:[u.jsx("div",{className:"flex",style:{flexBasis:"calc(".concat(d/ee*100,"% - ").concat(Dr/2,"px)")}}),u.jsxs("div",{className:"handle-popper",children:[u.jsx("label",{className:I({modified:l?s:a}),children:l?"End Time":"Start Time"}),u.jsx(dt,{ref:v,allowValueWrapping:!1,value:d,onChange:x,onSelect:C,"data-testid":o!==void 0?"".concat(o,"-input-1"):void 0})]}),u.jsx("div",{className:"flex-spacer"}),u.jsxs("div",{className:"handle-popper",children:[u.jsx("label",{className:I({modified:l?a:s}),children:l?"Start Time":"End Time"}),u.jsx(dt,{ref:g,allowValueWrapping:!1,value:f,onChange:P,onSelect:k,"data-testid":o!==void 0?"".concat(o,"-input-2"):void 0})]}),u.jsx("div",{className:"flex",style:{flexBasis:"calc(".concat((ee-f)/ee*100,"% - ").concat(Dr/2,"px)")}})]})}function Xc(n){var{startTime:e,endTime:t,"data-testid":r}=n;return u.jsxs("div",{className:"track-fills","data-testid":r,children:[e>t&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"track-fill track-fill-start",style:{transform:"scaleX(".concat(t/ee,")")}}),u.jsx("div",{className:"track-fill track-fill-end",style:{transform:"scaleX(".concat((ee-e)/ee,")")}})]}),e<t&&u.jsx("div",{className:"track-fill track-fill-middle",style:{transform:"translateX(".concat(e/ee*100,"%) scaleX(").concat((t-e)/ee,")")}})]})}function Ar(n){var{track:e,time:t,setTime:r,"data-testid":i}=n,a=c.useMemo(()=>{var p=3600,v=it/2;return t<p?v=t/p*(it/2):t>23*p&&(v=it/2+1/(ee-23*p)*(t-23*p)*(it/2)),"translateX(calc(".concat(t/ee*100,"% - ").concat(v,"px))")},[t]),s=c.useCallback(p=>{if(!e.current)return 0;var v=e.current.getBoundingClientRect(),g=Math.max(p-v.left,0),b=ee*Math.min(1,g/v.width),w=jr*Math.round(b/jr),x=Math.min(ee,w);return x},[e]),o=c.useCallback(p=>{var{clientX:v}=p;r(s(v))},[r,s]),l=c.useCallback(p=>{var{clientX:v}=p;r(s(v)),window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",l),document.documentElement.classList.remove("drag-pointer-events-none")},[r,s,o]),d=c.useCallback(()=>{window.addEventListener("mousemove",o),window.addEventListener("mouseup",l),document.documentElement.classList.add("drag-pointer-events-none")},[o,l]),h=c.useCallback(()=>{window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",l),document.documentElement.classList.remove("drag-pointer-events-none")},[o,l]),f=c.useCallback(()=>{d()},[d]);return c.useEffect(function(){return()=>{h()}},[h]),u.jsx("div",{className:"handle-track",style:{transform:a},children:u.jsx("button",{className:"handle",type:"button","aria-label":"Change time",onMouseDown:f,"data-testid":i})})}function Ca(n){var{buttons:e,isShown:t=!1,classNames:r,message:i,type:a,onClick:s,onDismiss:o,"data-testid":l}=n,d=e&&e.length!==0;return u.jsx(Ne,{in:t,timeout:fe.transitionMs,classNames:"toast-notification-slide-up",mountOnEnter:!0,unmountOnExit:!0,children:u.jsxs("div",{className:I("toast-notification",r,a),role:"presentation",onClick:s,onKeyPress:s,"data-testid":l,children:[u.jsx("div",{className:"message-container",children:u.jsx("span",{className:"message",children:i})}),u.jsx(Ne,{in:d,timeout:fe.transitionSlowMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:u.jsx("div",{className:"buttons-container",children:e})}),o&&u.jsx(ie,{kind:"ghost",icon:ui,tooltip:"Close notification",className:"my-2",onClick:o})]})})}Ca.TYPE=Object.freeze({ERROR:"error"});function Jc(n){var{children:e,className:t,labelText:r,hintText:i,isModified:a,validationError:s,showValidationError:o=!0,"data-testid":l,id:d}=n,{current:h}=c.useRef(d??xe());return u.jsxs(u.Fragment,{children:[u.jsx("label",{className:I("validate-label",t,{modified:a}),htmlFor:h,"data-testid":l,children:r}),M.Children.toArray(e).map(f=>M.isValidElement(f)?M.cloneElement(f,{className:I(f.props.className,{"is-invalid":s})}):u.jsx("div",{className:I(t),children:f})),i!==void 0&&u.jsx("small",{className:"form-text text-muted",children:i}),s!==void 0&&o&&u.jsx("p",{className:"validate-label-error text-danger",children:s})]})}const Qc=Object.freeze(Object.defineProperty({__proto__:null,ActionButtonDialogTrigger:Ni,AutoCompleteInput:Ol,AutoResizeTextarea:yn,BasicModal:wn,BulkActionBar:Ul,Button:ie,ButtonGroup:Qe,ButtonOld:Ll,CardFlip:Vl,Checkbox:ct,Collapse:Jl,ComboBox:ru,ConfirmActionButton:al,ConfirmationDialog:qi,ContextActionUtils:Q,ContextActions:ql,ContextMenuItem:hi,ContextMenuRoot:Us,CopyButton:iu,CustomTimeSelect:Cu,DEFAULT_GET_PREFERRED_REPLACEMENT_STRING:Ct,DateInput:Au,DateTimeInput:Iu,DebouncedModal:kl,DebouncedSearchInput:Lu,DragUtils:Wu,DraggableItemList:Hu,DropdownMenu:oa,EditableItemList:Gu,GLOBAL_SHORTCUTS:Nc,HierarchicalCheckboxMenu:Xu,IconActionButton:Zi,InfoModal:Rl,ItemList:J,ItemListItem:fa,get KEY(){return _},LoadingOverlay:De,LoadingSpinner:ci,get MODIFIER(){return q},MaskedInput:St,Menu:Ju,MenuItem:va,Modal:un,ModalBody:cn,ModalFooter:Xi,ModalHeader:oi,Option:ec,Page:Qu,Popper:Ge,RadioGroup:tc,RadioItem:nc,RandomAreaPlotAnimation:ma,SearchInput:wt,SearchableCombobox:bc,Select:yc,SelectValueList:ya,Shortcut:H,ShortcutRegistry:Pe,SocketedButton:Dc,Stack:Yu,TableViewEmptyState:Hc,TextWithTooltip:ga,ThemeExport:fe,TimeInput:dt,TimeSlider:qc,ToastNotification:Ca,Tooltip:mt,UISwitch:pa,ValidateLabelInput:Jc,fillToLength:na,themeDHDefault:Bc,trimTrailingMask:Kt},Symbol.toStringTag,{value:"Module"})),Yc=Object.freeze(Object.defineProperty({__proto__:null,ApiBootstrap:$s,ApiContext:di,ClientBootstrap:fi,ClientContext:Vs,useApi:Ee,useClient:We},Symbol.toStringTag,{value:"Module"}));var Sa=1e4;function ed(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Sa;return new Promise((r,i)=>{var a,s=setTimeout(()=>{var l;(l=a)===null||l===void 0||l(),i(new pi("Variable ".concat(e," not found")))},t);function o(l){var d=l.created.find(f=>f.title===e);if(d!=null){var h;clearTimeout(s),(h=a)===null||h===void 0||h(),r(d)}}a=n.subscribeToFieldUpdates(o)})}function kr(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function td(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){kr(a,r,i,s,o,"next",l)}function o(l){kr(a,r,i,s,o,"throw",l)}s(void 0)})}}var kt=$.module("MessageUtils"),Oa="io.deephaven.message.LoginOptions.request",xa="io.deephaven.message.SessionDetails.request",Ea="io.deephaven.broadcast",En="io.deephaven.broadcast.Login",Ta="io.deephaven.broadcast.Logout";function xt(n){var e=n;return e!=null&&typeof e.id=="string"&&typeof e.message=="string"}function Pa(n){return xt(n)&&n.message===En}function Ia(n){return xt(n)&&n.message===Ta}function Ma(n){var e=n;return e!=null&&typeof e.id=="string"}function Tn(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xe(),t=arguments.length>2?arguments[2]:void 0;return{message:n,id:e,payload:t}}function nd(n,e){return{id:n,payload:e}}function Pn(){return window.opener!=null?window.opener:window.parent!=null&&window.parent!==window?window.parent:null}function In(n){return Gt.apply(this,arguments)}function Gt(){return Gt=td(function*(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3e4,t=Pn();if(t==null)throw new Error("window parent is null, unable to send request.");return new Promise((r,i)=>{var a,s=xe(),o=l=>{var{data:d}=l;if(!Ma(d)){kt.debug("Ignoring non-deephaven response",d);return}if(kt.debug("Received message",d),(d==null?void 0:d.id)!==s){kt.debug("Ignore message, id doesn't match",d);return}window.clearTimeout(a),window.removeEventListener("message",o),r(d.payload)};window.addEventListener("message",o),a=window.setTimeout(()=>{window.removeEventListener("message",o),i(new pi("Request timed out"))},e),t.postMessage(Tn(n,s),"*")})}),Gt.apply(this,arguments)}function rd(n,e,t){return e=id(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function id(n){var e=ad(n,"string");return typeof e=="symbol"?e:String(e)}function ad(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Na extends Error{constructor(){super(...arguments),rd(this,"isNoConsolesError",!0)}}function Da(n){return n.isNoConsolesError}function Rr(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function Et(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Rr(a,r,i,s,o,"next",l)}function o(l){Rr(a,r,i,s,o,"throw",l)}s(void 0)})}}var _e=$.module("SessionUtils");function sd(n,e){return _e.info("Starting connection to '".concat(e,"'...")),new n.IdeConnection(e)}function ja(n,e,t){return zt.apply(this,arguments)}function zt(){return zt=Et(function*(n,e,t){_e.info("Getting console types...");var r=yield e.getConsoleTypes();if(r.length===0)throw new Na("No console types available");_e.info("Available types:",r);var i=r[0];_e.info("Starting session with type",i);var a=yield e.startSession(i),s={type:i,id:xe.generate()};return _e.info("Console session established",s),{session:a,config:s,connection:e,details:t,dh:n}}),zt.apply(this,arguments)}function od(n,e,t){return _e.info("createCoreClient",e),new n.CoreClient(e,t)}function ld(n){return n!=null&&typeof n=="object"}function ud(){return qt.apply(this,arguments)}function qt(){return qt=Et(function*(){var n=yield In(xa);if(!ld(n))throw new Error("Unexpected session details response: ".concat(n));return n}),qt.apply(this,arguments)}function cd(){return Zt.apply(this,arguments)}function Zt(){return Zt=Et(function*(){var n=new URLSearchParams(window.location.search);switch(n.get("authProvider")){case"parent":return ud()}return{}}),Zt.apply(this,arguments)}function dd(n,e,t){return Xt.apply(this,arguments)}function Xt(){return Xt=Et(function*(n,e,t){var r;try{r=yield ja(n,e,t)}catch(i){if(!Da(i))throw i}return r}),Xt.apply(this,arguments)}const hd=Object.freeze(Object.defineProperty({__proto__:null,BROADCAST_CHANNEL_NAME:Ea,BROADCAST_LOGIN_MESSAGE:En,BROADCAST_LOGOUT_MESSAGE:Ta,BooleanColumnFormatter:Bs,CharColumnFormatter:Ks,DateTimeColumnFormatter:Hs,DateUtils:Ws,DecimalColumnFormatter:Gs,DefaultColumnFormatter:zs,FETCH_TIMEOUT:Sa,Formatter:vi,FormatterUtils:Ft,IntegerColumnFormatter:qs,LOGIN_OPTIONS_REQUEST:Oa,NoConsolesError:Na,SESSION_DETAILS_REQUEST:xa,StringColumnFormatter:Zs,TableColumnFormatter:Xs,TableUtils:mi,createComboboxFilterArgs:Js,createConnection:sd,createCoreClient:od,createFilterConditionFactory:dn,createKeyFromOffsetRow:Qs,createNotNullOrEmptyFilterCondition:gi,createOnTableUpdatedHandler:bi,createSearchTextFilter:hn,createSelectedValuesFilter:fn,createSessionWrapper:ja,createShowOnlyEmptyFilterCondition:yi,createValueFilter:wi,defaultRowDeserializer:Ci,fetchVariableDefinition:ed,generateEmptyKeyedItems:Si,getColumnFormats:Ys,getDateTimeFormatterOptions:eo,getSessionDetails:cd,getSize:pn,getWindowParent:Pn,isBroadcastLoginMessage:Pa,isBroadcastLogoutMessage:Ia,isClosed:ot,isCustomColumnFormatDefined:to,isMessage:xt,isNoConsolesError:Da,isResponse:Ma,loadSessionWrapper:dd,makeMessage:Tn,makeResponse:nd,padFirstAndLastRow:Oi,requestParentResponse:In},Symbol.toStringTag,{value:"Module"}));function fd(n){return function(t){var{children:r}=t;return u.jsx(di.Provider,{value:n,children:r})}}var Lr=$.module("useTableListener"),pd=(n,e,t)=>c.useEffect(function(){if(n==null){Lr.debug2("Emitter undefined, skipping addEventListener",e);return}return Lr.debug2("Adding listener",e),n.addEventListener(e,t)},[n,e,t]);const Ve=pd;function vd(n,e,t){return e=md(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function md(n){var e=gd(n,"string");return typeof e=="symbol"?e:String(e)}function gd(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class bd extends Error{constructor(){super(...arguments),vd(this,"isColumnNameError",!0)}}const yd=bd;function wd(n,e,t){return e=Cd(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Cd(n){var e=Sd(n,"string");return typeof e=="symbol"?e:String(e)}function Sd(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Od extends Error{constructor(){super(...arguments),wd(this,"isTableDisconnectError",!0)}}const xd=Od;var at=$.module("useTable"),Ed=(n,e,t,r)=>{var i=Ee(),[a,s]=c.useState(void 0),[o,l]=c.useState([]),[d,h]=c.useState(null),[f,p]=c.useState(null);c.useEffect(()=>{if(r===void 0){s(n==null?void 0:n.columns),h(null);return}try{s(n==null?void 0:n.findColumns(r)),h(null)}catch(w){at.error("Column not found",w,r),h(new yd("Invalid columnNames argument"))}},[n,r]),c.useEffect(()=>{if(!a||!n){at.debug2("Table or column not initialized, skip viewport update.");return}at.debug2("Setting viewport",e,t),n.setViewport(e,t,a)},[a,n,e,t]);var v=c.useCallback(w=>{var{detail:x}=w;if(!a){at.error("Columns not initialized.");return}var P=a.map(C=>x.rows.map(k=>k.get(C)));l(P)},[a]),g=c.useCallback(()=>{p(new xd("Table disconnected"))},[]),b=c.useCallback(()=>{p(null)},[]);return Ve(n,i.Table.EVENT_UPDATED,v),Ve(n,i.Table.EVENT_DISCONNECT,g),Ve(n,i.Table.EVENT_RECONNECT,b),{columns:a,data:o,error:f??d}};const Aa=Ed;var Td=(n,e,t,r)=>{var i=c.useMemo(()=>[r],[r]),{columns:a=[],data:s=[],error:o}=Aa(n,e,t,i);return{column:a[0],data:s[0],error:o}};const ka=Td;function _r(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function Pd(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){_r(a,r,i,s,o,"next",l)}function o(l){_r(a,r,i,s,o,"throw",l)}s(void 0)})}}var pe=$.module("TableInput"),Rt=250;function Mn(n){var e,t,{className:r=void 0,columnName:i,settings:a,defaultValue:s=[],isInvalid:o=!1,onChange:l=()=>!1,onBlur:d=()=>!1,table:h}=n,f=c.useRef(null),p=Ee(),v=c.useMemo(()=>{var U=Ft.getColumnFormats(a),B=Ft.getDateTimeFormatterOptions(a),{defaultDecimalFormatOptions:V={},defaultIntegerFormatOptions:Z={}}=a;return new vi(p,U,B,V,Z)},[p,a]),[g,b]=c.useState(""),[w,x]=c.useState(new Set(s)),[P,C]=c.useState(),k=c.useRef(null),O=Math.min((e=P==null?void 0:P.size)!==null&&e!==void 0?e:0,Rt),{column:A,data:N,error:R}=ka(P,0,Rt-1,i),G=c.useCallback(U=>A?v.getFormattedString(U,A.type,A.name):"".concat(U),[A,v]),[S,D]=c.useMemo(()=>{var U=new Set(w),B=[];if(N==null)return[B,null];if(N.forEach(Z=>{var ge="".concat(Z),Ye=w.has(ge);Ye&&U.delete(ge),B.push({value:ge,displayValue:G(Z),isSelected:Ye})}),U.size>0){pe.debug2("Selection has items that are missing from the viewport");var V=new Set(w);return Array.from(U).forEach(Z=>{V.delete(Z)}),[B,V]}return[B,null]},[N,w,G]);c.useEffect(()=>{D!==null&&(x(D),l(Array.from(D)))},[l,D]);var F=c.useCallback(function(){var U=Pd(function*(B){try{var V=yield B;pe.debug("Table resolved",V),C(V)}catch(Z){if(Bn.isCanceled(Z))return;pe.error(Z)}});return function(B){return U.apply(this,arguments)}}(),[]);c.useEffect(()=>{var U=Bn.makeCancelable(h);return F(U),()=>{pe.debug2("Cancel table promise"),U.cancel()}},[h,F]);var T=c.useCallback(U=>{var{value:B}=U.target;b(B);var V=S.findIndex(ge=>ge.displayValue.includes(B));if(V>-1){var Z;pe.debug2("Found ".concat(B," at index ").concat(V)),(Z=k.current)===null||Z===void 0||Z.scrollIntoView(V)}else pe.debug2("".concat(B," not found"))},[S,k]),E=c.useCallback(U=>{if(pe.debug("handleSelect",U),U>=S.length){pe.error("Invalid index",U);return}var B=S[U].value,V=new Set(w);S[U].isSelected?V.delete(B):V.add(B),x(V),l(Array.from(V))},[l,S,w]),y=c.useCallback(()=>{var U=S.map(V=>V.value),B=new Set(U);x(B),l(U)},[S,l]),j=c.useCallback(()=>{x(new Set),l([])},[l]),L=c.useCallback(()=>{},[]),K=c.useCallback(U=>{var B,{relatedTarget:V}=U;pe.debug("handleChildBlur",V,V instanceof HTMLElement,f.current,(B=f.current)===null||B===void 0?void 0:B.contains(V)),(!V||f.current&&V instanceof HTMLElement&&!f.current.contains(V))&&d()},[d]),ae=S.length===0;return u.jsxs("div",{ref:f,className:I("table-input-container d-flex flex-column position-relative",r),children:[u.jsx(wt,{disabled:!!R||ae,value:g,placeholder:"Search",onChange:T,className:"mb-2 d-flex",onBlur:K}),u.jsx(ya,{className:"table-input-list",disabled:P===void 0||ae,isInvalid:o,items:ae?[{value:"Empty",isSelected:!1}]:S,itemCount:O,offset:0,onSelect:E,onViewportChange:L,ref:k,onBlur:K}),P&&u.jsxs("div",{className:"meta-row",children:[u.jsx("div",{className:"d-flex align-items-center text-muted small",children:P!=null&&P.size>O&&u.jsxs(u.Fragment,{children:["Table is too large, showing the first ",Rt," items."]})}),u.jsxs("div",{children:[u.jsx("button",{type:"button",className:"btn btn-link",onBlur:K,onClick:y,children:"Select All"}),u.jsx("button",{type:"button",className:"btn btn-link mr-a",onBlur:K,onClick:j,children:"Clear"})]})]}),P==null||R&&u.jsx("div",{className:"h-100 w-100 position-absolute",children:u.jsx(De,{isLoaded:P!=null,isLoading:P==null&&R==null,errorMessage:(t=R==null?void 0:R.message)!==null&&t!==void 0?t:null})})]})}Mn.displayName="TableInput";Mn.defaultProps={isInvalid:!1,className:void 0};var $r=$.module("useBroadcastChannel");function Nn(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:no,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ea,t=c.useMemo(()=>new BroadcastChannel(e),[e]);return c.useEffect(()=>()=>{t.close()},[t]),c.useEffect(()=>{function r(i){var{data:a}=i;if(!xt(a)){$r.debug("Ignoring non-deephaven message",a);return}$r.debug("event received",a),n(i)}return t.addEventListener("message",r),()=>{t.removeEventListener("message",r)}},[t,n]),t}function Tt(n,e){var t=c.useCallback(r=>{Pa(r.data)?n==null||n(r.data):Ia(r.data)&&(e==null||e(r.data))},[n,e]);Nn(t)}var ft="io.deephaven.web.client.auth.refreshToken",Ra=c.createContext(null),Id=$.module("RefreshTokenUtils");function Jt(){var n=Ke.get(ft);try{if(n!=null)return JSON.parse(n)}catch(e){Id.error("Error parsing refresh token",n,e)}return null}function Qt(n){if(n==null){Ke.remove(ft);return}var e=JSON.stringify({bytes:n.bytes,expiry:n.expiry}),t=new Date(n.expiry);Ke.set(ft,e,{secure:!0,sameSite:"strict",expires:t})}function La(n){var{children:e}=n,t=Ee(),r=We(),[i,a]=c.useState(Jt());c.useEffect(function(){var d=r.addEventListener(t.CoreClient.EVENT_REFRESH_TOKEN_UPDATED,h=>{var{detail:f}=h;Qt(f),a(f)});return d},[t,r,i]);var s=c.useCallback(()=>{a(Jt())},[]),o=c.useCallback(()=>{Qt(null),a(null)},[]);return Tt(s,o),u.jsx(Ra.Provider,{value:i,children:e})}function me(){var n=Ee();return c.useMemo(()=>new mi(n),[n])}function Md(n,e,t,r){var i=me(),[a,s]=c.useState(""),o=vt(a,t),l=c.useCallback(p=>{s(p.trim())},[]),{data:d,isLoading:h}=Xe(i.doesColumnValueExist,[n,e,o,r]),f=h||a!==o?null:d;return{valueTrimmed:a,valueTrimmedDebounced:o,valueExists:f,trimAndUpdateValue:l}}var Fr=$.module("useDebouncedViewportSearch"),Nd=200;function Dd(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Nd,r=me(),{table:i,applyFiltersAndRefresh:a}=n,s=c.useMemo(()=>Be(o=>{if(Fr.debug("Applying debounced searchText '".concat(o,"'")),i!=null){var l=o.trim();if(l===""){a([]);return}var d=i.findColumn(e),h=r.makeFilterValue(d.type,l),f=[d.filter().contains(h)];a(f)}},t),[a,e,t,i,r]);return c.useEffect(()=>()=>{Fr.debug("Cancelling debounced search function"),s.cancel()},[s]),s}var _a=300;function jd(n){var{viewportData:e,columnName:t,shouldSelectAllOnNoSelection:r,mapItemToValue:i}=n,a=me(),s=Ki(e,i),o=vt(s,_a),l=$i(o,ji);return c.useMemo(()=>fn(a,t,l.selection,r,l.isInverted),[t,l,r,a])}function Dn(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return c.useMemo(()=>ro(...t.map(i=>i(n))),[n,...t])}function Ad(n,e,t,r){var i=c.useRef("");return i.current=t,c.useMemo(()=>{var a=n.length>0&&n[0].item==null;return!a&&r!=null&&(i.current===""||r.toLowerCase().includes(i.current.toLowerCase()))?[{key:r,item:{[e]:r}},...n]:n},[r,e,n])}function Ur(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function kd(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Ur(a,r,i,s,o,"next",l)}function o(l){Ur(a,r,i,s,o,"throw",l)}s(void 0)})}}function Rd(n){var{table:e,columnName:t,defaultValue:r,itemHeight:i,topOffset:a=0,value:s}=n;return c.useCallback(kd(function*(){if(e==null||s===""||s===r)return a;var o=e.findColumn(t),l=yield e.seekRow(0,o,"String",s),d=r==null?0:1;return(l+d)*i+a}),[t,r,i,e,a,s])}function jn(n){var[,e]=c.useState(0),t=Ee();return Ve(n,t.Table.EVENT_SIZECHANGED,()=>{e(r=>r+1)}),pn(n)}var Ld=$.module("useInitializeViewportData");function $a(n){var e=Gi({}),t=Math.max(0,jn(n));return c.useEffect(()=>{var r=e.items.length;t!==r&&(Ld.debug("size changed:",{currentSize:r,targetSize:t}),e.setItems(Array.from(Si(0,t-1))))},[t,n]),e}function Fa(n,e,t){return c.useCallback(function(i){var[a,s]=Oi(i,e,t,pn(n));n==null||n.setViewport(a,s)},[n,t,e])}var Vr=$.module("useViewportData");function An(n){var{table:e,itemHeight:t=1,scrollDebounce:r=vo,viewportSize:i=10,viewportPadding:a=50,deserializeRow:s=Ci}=n,o=$a(e),l=Fa(e,i,a),d=c.useCallback(b=>{e&&!ot(e)?l(b):Vr.debug("setViewport called on closed table.",e)},[e,l]),h=c.useCallback(b=>{e&&!ot(e)?(e.applyFilter(b),d(0)):Vr.debug("applyFiltersAndRefresh called on closed table.",e)},[d,e]),f=Ee(),p=c.useMemo(()=>bi(o,s),[s,o]);Ve(e,f.Table.EVENT_UPDATED,p);var v=jn(e);c.useEffect(()=>{d(0)},[e,d,v]);var g=Hi(t,d,r);return c.useMemo(()=>({viewportData:o,size:v,table:e,applyFiltersAndRefresh:h,setViewport:d,onScroll:g}),[h,g,d,v,e,o])}function kn(n,e){var{applyFiltersAndRefresh:t}=n;c.useEffect(()=>{t(e)},[t,e])}function _d(n,e){for(var t=me(),[r,i]=c.useState(""),a=c.useMemo(()=>hn(t,e,r),[e,r,t]),s=ut(i,Pi),o=An({table:n,itemHeight:po,viewportSize:Ii,viewportPadding:Mi}),l=arguments.length,d=new Array(l>2?l-2:0),h=2;h<l;h++)d[h-2]=arguments[h];var f=Dn(o.table,a,...d);return kn(o,f),{list:o,onSearchTextChange:s}}function $d(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"or",t=me(),r=c.useMemo(()=>gi(t),[t]);return c.useMemo(()=>dn(n,r,e),[n,e,r])}function Ua(n){c.useEffect(()=>()=>{n!=null&&(ot(n)||n.close())},[n])}function Fd(n,e,t){for(var r=me(),[i,a]=c.useState(""),[s,o]=c.useState(""),[l,d]=c.useState(null),[h,f]=c.useState(()=>new Map),{data:p,isLoading:v}=Xe(r.doesColumnValueExist,[n,e,s,!1]),g=v||s!==i?null:p,b=c.useMemo(()=>hn(r,e,s),[e,s,r]),w=c.useMemo(()=>fn(r,e,new Set(h.keys()),!1,!0),[e,h,r]),x=arguments.length,P=new Array(x>3?x-3:0),C=3;C<x;C++)P[C-3]=arguments[C];var{data:k}=Xe(r.createDistinctSortedColumnTable,[n,e,"asc",...P]);Ua(k);var O=An({table:k,itemHeight:fo,viewportSize:Ii,viewportPadding:Mi}),A=i.length>0&&O.size===0,N=h.has(i),R=ut(o,Pi),G=c.useCallback(y=>{a(y),R(y)},[R]),S=ut(d,0),D=c.useCallback(y=>{if(a(""),o(""),d(y),S(null),y!=null){var j=O.viewportData.findItem(y);if(j!=null){var L=t(j);f(K=>{var ae=new Map(K);return ae.set(L,{value:L}),ae})}}},[S,O.viewportData,t]),F=c.useCallback(y=>{f(j=>{if(y.size===0)return j;var L=new Map(j);for(var K of y)L.set(K,{value:K});return L})},[]),T=c.useCallback(y=>{f(j=>{if(y==="all")return new Map;var L=new Map(j);for(var K of y)L.delete(K);return L})},[]),E=Dn(O.table,b,w);return kn(O,E),c.useMemo(()=>({list:O,hasSearchTextWithZeroResults:A,searchText:i,searchTextExists:g,searchTextIsInSelectedValues:N,selectedKey:l,selectedValueMap:h,onSearchTextChange:G,onSelectKey:D,onAddValues:F,onRemoveValues:T}),[A,O,F,T,G,D,i,g,N,l,h])}function Br(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function Ud(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Br(a,r,i,s,o,"next",l)}function o(l){Br(a,r,i,s,o,"throw",l)}s(void 0)})}}function Vd(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];var i=c.useCallback(Ud(function*(){var d;return(d=n==null?void 0:n.selectDistinct(n.findColumns(t)))!==null&&d!==void 0?d:null}),[n,...t]),{data:a,error:s,isError:o,isLoading:l}=Xe(i,[]);return c.useEffect(()=>()=>{a==null||a.close()},[a]),{distinctTable:a,error:s,isError:o,isLoading:l}}function Bd(n,e){var t=me(),r=c.useMemo(()=>yi(t,n),[n,t]);return c.useMemo(()=>dn(e,r),[e,r])}function Kd(n,e,t){var r=me();return c.useMemo(()=>wi(r,n,e,t),[n,t,r,e])}const Hd=Object.freeze(Object.defineProperty({__proto__:null,DEBOUNCE_MS:_a,REFRESH_TOKEN_KEY:ft,RefreshTokenBootstrap:La,RefreshTokenContext:Ra,TableInput:Mn,makeApiContextWrapper:fd,readRefreshToken:Jt,storeRefreshToken:Qt,useBroadcastChannel:Nn,useBroadcastLoginListener:Tt,useCheckIfExistsValue:Md,useDebouncedViewportSearch:Dd,useDebouncedViewportSelectionFilter:jd,useFilterConditionFactories:Dn,useFilteredItemsWithDefaultValue:Ad,useGetItemPosition:Rd,useInitializeViewportData:$a,useNotNullOrEmptyFilter:$d,usePickerWithSelectedValues:Fd,useSearchableViewportData:_d,useSelectDistinctTable:Vd,useSetPaddedViewportCallback:Fa,useShowOnlyEmptyFilter:Bd,useTable:Aa,useTableClose:Ua,useTableColumn:ka,useTableListener:Ve,useTableSize:jn,useTableUtils:me,useValueFilter:Kd,useViewportData:An,useViewportFilter:kn},Symbol.toStringTag,{value:"Module"}));var Va=c.createContext(!1);function Wd(n){var{fontClassNames:e=["fira-sans-regular","fira-sans-semibold","fira-mono"],children:t}=n,[r,i]=c.useState(!1);return c.useEffect(function(){document.fonts.ready.then(()=>{i(!0)})},[]),u.jsxs(u.Fragment,{children:[u.jsx(Va.Provider,{value:r,children:t}),u.jsx("div",{id:"preload-fonts",style:{visibility:"hidden",position:"absolute",top:-1e4},children:e.map(a=>u.jsx("p",{className:a,children:"preload"},a))})]})}var Ba=Object.freeze({AUTH_PLUGIN:"AuthPlugin",DASHBOARD_PLUGIN:"DashboardPlugin",TABLE_PLUGIN:"TablePlugin"});function Gd(n){return"DashboardPlugin"in n}function Yt(n){return"AuthPlugin"in n}function zd(n){return"TablePlugin"in n}function qd(n){return Gd(n)||Yt(n)||zd(n)}function Zd(n){return"type"in n&&n.type===Ba.AUTH_PLUGIN}function Xd(n){if(n==null)return!1;var e=n;return e.Component!==void 0&&typeof e.isAvailable=="function"}var Ka="io.deephaven.auth.AnonymousAuthenticationHandler",Jd="io.deephaven.authentication.psk.PskAuthenticationHandler";function Kr(n,e,t){return e=Qd(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Qd(n){var e=Yd(n,"string");return typeof e=="symbol"?e:String(e)}function Yd(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class eh extends Error{constructor(){super(...arguments),Kr(this,"name","AuthenticationError"),Kr(this,"isAuthenticationError",!0)}}const Ha=eh;function Hr(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function th(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Hr(a,r,i,s,o,"next",l)}function o(l){Hr(a,r,i,s,o,"throw",l)}s(void 0)})}}var Wr=$.module("AuthPluginBase");function Rn(n){var{children:e,getLoginOptions:t}=n,r=We(),[i,a]=c.useState(),[s,o]=c.useState(!1);return c.useEffect(()=>{var l=!1;function d(){if(l)throw new io("Login canceled.")}function h(){return f.apply(this,arguments)}function f(){return f=th(function*(){try{var p=yield t();d(),Wr.info("Logging in..."),yield r.login(p),d(),o(!0)}catch(b){if(!l){var v;Wr.error("Unable to login:",b);var g=(v=He(b))!==null&&v!==void 0?v:"Unable to login. Verify credentials.";a(new Ha(g)),o(!1)}}}),f.apply(this,arguments)}return h(),()=>{l=!0}},[r,t]),s?u.jsx(u.Fragment,{children:e}):u.jsx(De,{"data-testid":"auth-base-loading",isLoading:i==null,isLoaded:!1,errorMessage:He(i)})}var Wa=c.createContext({}),Pt=c.createContext({}),Ln=c.createContext(null),nh={canLogout:!1};function rh(n){var{children:e}=n,t=Ee(),r=c.useCallback(()=>({type:t.CoreClient.LOGIN_TYPE_ANONYMOUS}),[t]);return u.jsx(Rn,{getLoginOptions:r,children:u.jsx(Pt.Provider,{value:nh,children:e})})}var ih={Component:rh,isAvailable:n=>n.includes(Ka)};const Ga=ih;function Gr(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function ah(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Gr(a,r,i,s,o,"next",l)}function o(l){Gr(a,r,i,s,o,"throw",l)}s(void 0)})}}var sh=$.module("AuthPluginParent"),oh={canLogout:!1};function lh(n){return n!=null&&typeof n.type=="string"}function uh(){return en.apply(this,arguments)}function en(){return en=ah(function*(){sh.info("Logging in by delegating to parent window...");var n=yield In(Oa);if(!lh(n))throw new Error("Unexpected login options response: ".concat(n));return n}),en.apply(this,arguments)}function ch(){var n;return(n=new URLSearchParams(window.location.search).get("authProvider"))!==null&&n!==void 0?n:""}function dh(n){var{children:e}=n;return u.jsx(Rn,{getLoginOptions:uh,children:u.jsx(Pt.Provider,{value:oh,children:e})})}var hh={Component:dh,isAvailable:()=>Pn()!=null&&ch()==="parent"};const za=hh;function qa(n){var{children:e,errorMessage:t,isLoggingIn:r=!1,onSubmit:i}=n;return u.jsxs("form",{className:"login-form",onSubmit:a=>{a.preventDefault(),a.stopPropagation(),i==null||i(a)},children:[u.jsx("div",{className:"flex-spacer"}),u.jsxs("div",{className:"flex-wrapper",children:[u.jsx("fieldset",{disabled:r,className:"container-fluid",children:e}),u.jsx("div",{className:"form-group d-flex justify-content-end align-items-center mb-0",children:u.jsxs("button",{type:"submit",className:I("btn btn-primary",{"btn-spinner":r},{"btn-cancelable":r}),"data-testid":"btn-login",children:[r&&u.jsxs("span",{children:[u.jsx(ci,{}),u.jsx("span",{className:"btn-normal-content",children:"Logging in"}),u.jsx("span",{className:"btn-hover-content",children:"Cancel"})]}),!r&&"Login"]})})]}),u.jsx("div",{className:"flex-spacer",children:t!=null&&u.jsx("p",{className:"error-message mb-0",role:"alert",children:"".concat(t)})})]})}function Za(n){var{children:e,logoPath:t="./logo.png"}=n;return u.jsxs("div",{className:"login-container",children:[u.jsx(ma,{}),u.jsxs("div",{className:"login-box",children:[u.jsx("div",{className:"logo",children:u.jsx("img",{src:t,alt:"Deephaven Data Labs"})}),e,u.jsxs("p",{className:"footer",children:["© 2016-",new Date().getFullYear()," Deephaven Data Labs LLC. Patent Pending."]})]})]})}function zr(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function Lt(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){zr(a,r,i,s,o,"next",l)}function o(l){zr(a,r,i,s,o,"throw",l)}s(void 0)})}}var tn="io.deephaven.authentication.psk.PskAuthenticationHandler",Xa="psk",nn="io.deephaven.web.client.auth.psk.token",$e=$.module("AuthPluginPsk");function fh(){return new URLSearchParams(window.location.search).get(Xa)}function ph(){$e.debug2("clearWindowToken");var n=new URL(window.location.href);n.searchParams.delete(Xa),window.history.replaceState(null,"",n.href)}function qr(){var n;return(n=Ke.get(nn))!==null&&n!==void 0?n:null}function _t(n){$e.debug2("Storing token in cookie",n),n!=null?Ke.set(nn,n,{secure:!0,sameSite:"strict"}):Ke.remove(nn)}function vh(n){var{children:e,logoPath:t}=n,r=We(),i=c.useRef(null),a=c.useRef(null),[s,o]=c.useState(),[l,d]=c.useState(!1),[h,f]=c.useState(!1),[p,v]=c.useState(!1),[g,b]=c.useState(""),w=c.useCallback(function(){var O=Lt(function*(A){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;$e.info("Logging in..."),v(!0);var R=null;try{if(R=r.login({type:tn,token:A}),a.current=R,yield R,$e.info("Logged in successfully"),a.current!==R)return;_t(A),f(!0)}catch(D){if(a.current!==R)return;if(d(!0),N){var G;$e.error("Unable to login",D);var S=(G=He(D))!==null&&G!==void 0?G:"Unable to login: Verify credentials.";o(new Ha(S))}}v(!1)});return function(A){return O.apply(this,arguments)}}(),[r]),x=c.useCallback(()=>{a.current=null,v(!1)},[]),P=c.useCallback(Lt(function*(){$e.debug("onLogin");var O=qr();h||p||O==null||w(O,!1)}),[h,p,w]),C=c.useCallback(()=>{_t(null)},[]);Tt(P,C),c.useEffect(()=>{var O=!1;function A(){return N.apply(this,arguments)}function N(){return N=Lt(function*(){var R,G=(R=fh())!==null&&R!==void 0?R:qr();if(ph(),G==null){d(!0);return}v(!0);try{yield r.login({type:tn,token:G}),O||(_t(G),f(!0),v(!1))}catch{O||(d(!0),v(!1))}}),N.apply(this,arguments)}return A(),()=>{O=!0}},[r]);var k=c.useCallback(()=>{p?x():w(g)},[x,p,w,g]);return c.useEffect(function(){var A;(A=i.current)===null||A===void 0||A.focus()},[i,l]),u.jsxs(u.Fragment,{children:[h&&e,l&&u.jsx(Ne,{in:!h,timeout:fe.transitionMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:u.jsx(Za,{logoPath:t,children:u.jsx(qa,{errorMessage:He(s),isLoggingIn:p,onSubmit:k,children:u.jsxs("div",{className:"form-group",children:[u.jsx("label",{htmlFor:"auth-psk-token-input",children:"Token"}),u.jsx("input",{id:"auth-psk-token-input",name:"token",className:"input-token form-control",type:"text",autoComplete:"username",autoCapitalize:"none",autoCorrect:"off",spellCheck:"false",ref:i,value:g,onChange:O=>{o(void 0),b(O.target.value)}})]})})})}),u.jsx(De,{"data-testid":"auth-psk-loading",isLoaded:h||l,isLoading:!h&&!l})]})}var mh={Component:vh,isAvailable:n=>n.includes(tn)};const Ja=mh;function Zr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function $t(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Zr(Object(t),!0).forEach(function(r){gh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Zr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function gh(n,e,t){return e=bh(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function bh(n){var e=yh(n,"string");return typeof e=="symbol"?e:String(e)}function yh(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var wh=$.module("UserUtils");function Qa(n,e){return n.get("internal.webClient.appInit.".concat(e))}function Ya(n){var e,t,r,i,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};function o(w){return Qa(n,w)}function l(w,x){var P=o(w);return P==="true"?!0:P==="false"?!1:(P!==void 0&&wh.warn("Unexpected value for ".concat(w,": ").concat(P)),x)}var d=(e=o("name"))!==null&&e!==void 0?e:"",h=(t=o("operateAs"))!==null&&t!==void 0?t:d,f=(r=(i=o("groups"))===null||i===void 0?void 0:i.split(","))!==null&&r!==void 0?r:[],p=l("canCopy",!0),v=l("canDownloadCsv",!0),g=l("canUsePanels",!0),b=l("canLogout",!0);return $t($t({name:d,operateAs:h,groups:f},a),{},{permissions:$t({canUsePanels:g,canCopy:p,canDownloadCsv:v,canLogout:b},s)})}const Ch=Object.freeze(Object.defineProperty({__proto__:null,AUTH_HANDLER_TYPE_ANONYMOUS:Ka,AUTH_HANDLER_TYPE_PSK:Jd,AuthPluginAnonymous:Ga,AuthPluginBase:Rn,AuthPluginParent:za,AuthPluginPsk:Ja,Login:Za,LoginForm:qa,UserContext:Ln,UserOverrideContext:Wa,UserPermissionsOverrideContext:Pt,getAppInitValue:Qa,getUserFromConfig:Ya,isAuthPlugin:Xd},Symbol.toStringTag,{value:"Module"}));var es={react:M,"react-dom":ii,redux:ws,"react-redux":Cs,"@deephaven/auth-plugins":Ch,"@deephaven/components":Qc,"@deephaven/jsapi-bootstrap":Yc,"@deephaven/jsapi-components":Hd,"@deephaven/jsapi-utils":hd,"@deephaven/log":ko,"@deephaven/react-hooks":Qo},Sh=Ss.createRequires(es),Oh=Os({requires:Sh});const xh=Oh;function Xr(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function _n(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Xr(a,r,i,s,o,"next",l)}function o(l){Xr(a,r,i,s,o,"throw",l)}s(void 0)})}}var Ie=$.module("@deephaven/app-utils.PluginUtils");function Eh(n){return rn.apply(this,arguments)}function rn(){return rn=_n(function*(n){var e=yield xh(n);return e}),rn.apply(this,arguments)}function Th(n){return an.apply(this,arguments)}function an(){return an=_n(function*(n){var e=yield fetch(n);if(!e.ok)throw new Error(e.statusText);try{return yield e.json()}catch{throw new Error("Could not be parsed as JSON")}}),an.apply(this,arguments)}function Ph(n){return sn.apply(this,arguments)}function sn(){return sn=_n(function*(n){Ie.debug("Loading plugins...");try{var e=yield Th("".concat(n,"/manifest.json"));if(!Array.isArray(e.plugins))throw new Error("Plugin manifest JSON does not contain plugins array");Ie.debug("Plugin manifest loaded:",e);for(var t=[],r=0;r<e.plugins.length;r+=1){var{name:i,main:a}=e.plugins[r],s="".concat(n,"/").concat(i,"/").concat(a);t.push(Eh(s))}for(var o=yield Promise.allSettled(t),l=new Map,d=0;d<o.length;d+=1){var h=o[d],{name:f}=e.plugins[d];h.status==="fulfilled"?l.set(f,qd(h.value)?h.value:h.value.default):Ie.error("Unable to load plugin ".concat(f),h.reason)}return Ie.info("Plugins loaded:",l),l}catch(p){return Ie.error("Unable to load plugins:",p),new Map}}),sn.apply(this,arguments)}function Ih(n){var e,t;return(e=(t=n.get("AuthHandlers"))===null||t===void 0?void 0:t.split(","))!==null&&e!==void 0?e:[]}function Mh(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Map,r=Ih(e),i=[...n.entries(),...t.entries()].filter(l=>{var[,d]=l;return Zd(d)||Yt(d)}).map(l=>{var[d,h]=l;return Yt(h)?{type:Ba.AUTH_PLUGIN,name:d,component:h.AuthPlugin.Component,isAvailable:h.AuthPlugin.isAvailable}:h}),a=i.filter(l=>{var{isAvailable:d}=l;return d(r,e)});if(a.length===0)throw new Error("No login plugins found, please register a login plugin for auth handlers: ".concat(r));a.length>1&&Ie.warn("More than one login plugin available, will use the first one: ",a.map(l=>{var{name:d}=l;return d}).join(", "));var{name:s,component:o}=a[0];return Ie.info("Using LoginPlugin",s),o}var Nh=ai.createRequires(()=>es),Dh=ai.createRemoteComponent({requires:Nh});const Xh=Dh;function Jr(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function jh(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Jr(a,r,i,s,o,"next",l)}function o(l){Jr(a,r,i,s,o,"throw",l)}s(void 0)})}}var $n=c.createContext(null);function Ah(n){var{pluginsUrl:e,children:t}=n,[r,i]=c.useState(null);return c.useEffect(function(){var s=!1;function o(){return l.apply(this,arguments)}function l(){return l=jh(function*(){var d=yield Ph(e);s||i(d)}),l.apply(this,arguments)}return o(),()=>{s=!0}},[e]),u.jsx($n.Provider,{value:r,children:t})}function kh(){var n=Nn();return c.useEffect(function(){n.postMessage(Tn(En))},[n]),null}function Qr(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function Rh(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Qr(a,r,i,s,o,"next",l)}function o(l){Qr(a,r,i,s,o,"throw",l)}s(void 0)})}}var Lh=new Map([["@deephaven/auth-plugins.AuthPluginParent",{AuthPlugin:za}],["@deephaven/auth-plugins.AuthPluginPsk",{AuthPlugin:Ja}],["@deephaven/auth-plugins.AuthPluginAnonymous",{AuthPlugin:Ga}]]);function _h(n){var{children:e}=n,t=We(),r=c.useContext($n),[i,a]=c.useState(),[s,o]=c.useState();c.useEffect(function(){var f=!1;function p(){return v.apply(this,arguments)}function v(){return v=Rh(function*(){try{var g=yield t.getAuthConfigValues();f||a(new Map(g))}catch(b){f||o(b)}}),v.apply(this,arguments)}return p(),()=>{f=!0}},[t]);var l=c.useMemo(()=>{if(!(r==null||i==null))try{return Mh(r,i,Lh)}catch(h){o(h)}},[i,r]),d=l==null||i==null;return d||s!=null?u.jsx(De,{isLoading:d&&s==null,errorMessage:He(s)}):u.jsx(l,{authConfigValues:i,children:u.jsxs(u.Fragment,{children:[u.jsx(kh,{}),e]})})}function Jh(n){return new URL(n,"".concat(window.location))}function $h(){var n=new URLSearchParams(window.location.search);return n.get("envoyPrefix")}function Fh(){var n=$h();return n!=null?{headers:{"envoy-prefix":n}}:{headers:{}}}function Uh(n){var{children:e}=n,t=c.useContext(Va);return t?u.jsx(u.Fragment,{children:e}):u.jsx(De,{"data-testid":"fonts-loaded-loading"})}function Yr(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function Vh(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Yr(a,r,i,s,o,"next",l)}function o(l){Yr(a,r,i,s,o,"throw",l)}s(void 0)})}}var ts=c.createContext(null);function Bh(n){var{children:e}=n,t=We(),[r,i]=c.useState(),[a,s]=c.useState();c.useEffect(function(){var d=!1;function h(){return f.apply(this,arguments)}function f(){return f=Vh(function*(){try{var p=yield t.getServerConfigValues();d||i(new Map(p))}catch(v){d||s(v)}}),f.apply(this,arguments)}return h(),()=>{d=!0}},[t]);var o=r==null;return o||a!=null?u.jsx(De,{isLoading:o&&a==null,errorMessage:He(a)}):u.jsx(ts.Provider,{value:r,children:e})}function Kh(){return pt(ts,"No server config available in useServerConfig. Was code wrapped in ServerConfigBootstrap or ServerConfigContext.Provider?")}function Hh(n){var{children:e}=n,t=Kh(),r=c.useContext(Wa),i=c.useContext(Pt),a=Ya(t,r,i);return u.jsx(Ln.Provider,{value:a,children:e})}function Qh(n){var{fontClassNames:e,pluginsUrl:t,serverUrl:r,children:i}=n,a=c.useMemo(()=>Fh(),[]),[s,o]=c.useState(0),l=c.useCallback(()=>{},[]),d=c.useCallback(()=>{o(h=>h+1)},[]);return Tt(l,d),u.jsx(Wd,{fontClassNames:e,children:u.jsx(Ah,{pluginsUrl:t,children:u.jsx(fi,{serverUrl:r,options:a,children:u.jsx(La,{children:u.jsx(_h,{children:u.jsx(Bh,{children:u.jsx(Hh,{children:u.jsx(ao,{children:u.jsx(Uh,{children:i})})})})})})},s)})})}function Yh(){return pt($n,"No Plugins available in usePlugins. Was code wrapped in PluginsBootstrap or PluginsContext.Provider?")}function ef(){return pt(Ln,"No user available in useUser. Was code wrapped in UserBootstrap or UserContext.Provider?")}export{Qh as AppBootstrap,_h as AuthBootstrap,ao as ConnectionBootstrap,rf as ConnectionContext,Wd as FontBootstrap,Uh as FontsLoaded,Va as FontsLoadedContext,Ah as PluginsBootstrap,$n as PluginsContext,Xh as RemoteComponent,Ih as getAuthHandlers,Mh as getAuthPluginComponent,Jh as getBaseUrl,Fh as getConnectOptions,$h as getEnvoyPrefix,Th as loadJson,Eh as loadModulePlugin,Ph as loadModulePlugins,af as useConnection,Yh as usePlugins,Kh as useServerConfig,ef as useUser};
|
|
9
|
+
//# sourceMappingURL=index-90e5577a.js.map
|