@deephaven/embed-widget 1.29.1 → 1.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/assets/{App-CNBTVP3F.js → App-BIR5Ft4v.js} +2 -2
- package/build/assets/{App-CNBTVP3F.js.map → App-BIR5Ft4v.js.map} +1 -1
- package/build/assets/{Chart-B9U8ykLB.js → Chart-CzNj2UdN.js} +2 -2
- package/build/assets/{Chart-B9U8ykLB.js.map → Chart-CzNj2UdN.js.map} +1 -1
- package/build/assets/{IrisGrid-C_cRw4OE.js → IrisGrid-BdHI_4d6.js} +2 -2
- package/build/assets/{IrisGrid-C_cRw4OE.js.map → IrisGrid-BdHI_4d6.js.map} +1 -1
- package/build/assets/{IrisGridContextProvider-CjUMzLgo.js → IrisGridContextProvider-DOF6Qgxe.js} +37 -37
- package/build/assets/IrisGridContextProvider-DOF6Qgxe.js.map +1 -0
- package/build/assets/{LocalWorkspaceStorage-CmltrtYF.js → LocalWorkspaceStorage-CODn6a3s.js} +2 -2
- package/build/assets/{LocalWorkspaceStorage-CmltrtYF.js.map → LocalWorkspaceStorage-CODn6a3s.js.map} +1 -1
- package/build/assets/{LogPanel-Cjxontrv.js → LogPanel-Cs3EDdyn.js} +2 -2
- package/build/assets/LogPanel-Cs3EDdyn.js.map +1 -0
- package/build/assets/{MarkdownEditor-9po928ZN.js → MarkdownEditor-0dC8Se2n.js} +2 -2
- package/build/assets/{MarkdownEditor-9po928ZN.js.map → MarkdownEditor-0dC8Se2n.js.map} +1 -1
- package/build/assets/{MarkdownNotebook-B3AH8xCy.js → MarkdownNotebook-D2fF-qP0.js} +2 -2
- package/build/assets/{MarkdownNotebook-B3AH8xCy.js.map → MarkdownNotebook-D2fF-qP0.js.map} +1 -1
- package/build/assets/{index-BPqVqHHU.js → index-B7sJHdj3.js} +2 -2
- package/build/assets/{index-BPqVqHHU.js.map → index-B7sJHdj3.js.map} +1 -1
- package/build/assets/{index-AMgj1Mpo.js → index-D4csj_3a.js} +6 -6
- package/build/assets/{index-AMgj1Mpo.js.map → index-D4csj_3a.js.map} +1 -1
- package/build/assets/{index-Oy8wDWCt.js → index-DEfo-X7q.js} +3 -3
- package/build/assets/{index-Oy8wDWCt.js.map → index-DEfo-X7q.js.map} +1 -1
- package/build/index.html +2 -2
- package/package.json +9 -9
- package/build/assets/IrisGridContextProvider-CjUMzLgo.js.map +0 -1
- package/build/assets/LogPanel-Cjxontrv.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Plot-Sa49zHi-.js","./Plotly-Cx5aoB3L.js","./plotly-D195aZMi.js","./helpers-BosuxZz1.js","./vendor-DNp6JF3q.js","./vendor-BSYTbjlr.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{ao as Au,a as B,aP as Ns,T as ku,X as Nu,Y as Lu,V as Ru,a4 as $u,O as Fu,z as Hu,a8 as Uu,d as Ls,G as Rs,e as $s,q as Bu,aQ as Wu,aI as Ku,aR as Fs,aS as zu,aT as Vu,L as Kn,ac as Gu,_ as Zu,aU as Hs,u as W,t as Us,Z as Xu,aV as qu,aO as Yu,aK as Bs,aL as Qu,f as Ws,n as Ju,aM as ai,aW as ed,aX as td,aY as to,aZ as nd,a_ as rd,a$ as id,b0 as od,v as ad,k as Ks,aG as sd,h as Gr,aB as ld,b1 as ud,b2 as no,aE as dd,b3 as ro,b4 as zs,b5 as cd,av as hd,b6 as md,b7 as pd,b8 as fd,b9 as vd,ba as gd,bb as bd}from"./index-
|
|
2
|
+
import{ao as Au,a as B,aP as Ns,T as ku,X as Nu,Y as Lu,V as Ru,a4 as $u,O as Fu,z as Hu,a8 as Uu,d as Ls,G as Rs,e as $s,q as Bu,aQ as Wu,aI as Ku,aR as Fs,aS as zu,aT as Vu,L as Kn,ac as Gu,_ as Zu,aU as Hs,u as W,t as Us,Z as Xu,aV as qu,aO as Yu,aK as Bs,aL as Qu,f as Ws,n as Ju,aM as ai,aW as ed,aX as td,aY as to,aZ as nd,a_ as rd,a$ as id,b0 as od,v as ad,k as Ks,aG as sd,h as Gr,aB as ld,b1 as ud,b2 as no,aE as dd,b3 as ro,b4 as zs,b5 as cd,av as hd,b6 as md,b7 as pd,b8 as fd,b9 as vd,ba as gd,bb as bd}from"./index-DEfo-X7q.js";import{r as m,am as zn,bz as Mr,D as c,bP as yd,J as k,G as U,bQ as Vs,bR as si,H as Sd,R as xi,bS as Cd,bT as _d,bB as wd,I as me,C as Pt,bU as Ed,ad as Pd,ae as Td,E as Gs,al as vn,bV as Od,bW as Id,bX as xd,bY as Dd,bM as li,bZ as O,b_ as io,bO as pe,L as Zs,N as Xs,b$ as Md,bN as Vn,bJ as _n,_ as jd,bk as Re,c0 as Ad,ah as kd,aB as Nd,bn as oo,c1 as Ld,c2 as ao,bm as rt,c3 as qs,c4 as Rd,bK as nt,bL as en,c5 as so,bl as $d,bI as Fd,c6 as Fn}from"./vendor-DNp6JF3q.js";var Hd=Object.freeze([]),OS=new Map,Ys=()=>{};function IS(n){return Array.isArray(n)?n:[n]}function xS(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return e.filter(r=>r!=null)}function Ud(n,e,t){return(e=Bd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Bd(n){var e=Wd(n,"string");return typeof e=="symbol"?e:e+""}function Wd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class lo extends Error{constructor(){super(...arguments),Ud(this,"isCanceled",!0)}}function Kd(n,e,t){return(e=zd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function zd(n){var e=Vd(n,"string");return typeof e=="symbol"?e:e+""}function Vd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Gd extends Error{constructor(){super(...arguments),Kd(this,"isClipboardPermissionsDeniedError",!0)}}function Zd(n,e,t){return(e=Xd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Xd(n){var e=qd(n,"string");return typeof e=="symbol"?e:e+""}function qd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Zr extends Error{constructor(){super(...arguments),Zd(this,"isClipboardUnavailableError",!0)}}function Yd(n,e,t){return(e=Qd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Qd(n){var e=Jd(n,"string");return typeof e=="symbol"?e:e+""}function Jd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Qs extends Error{constructor(){super(...arguments),Yd(this,"isPermissionUnsupported",!0)}}function uo(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function ec(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){uo(o,r,i,a,s,"next",l)}function s(l){uo(o,r,i,a,s,"throw",l)}a(void 0)})}}function co(n){return ui.apply(this,arguments)}function ui(){return ui=ec(function*(n){try{var e=n;return(yield navigator.permissions.query({name:e})).state}catch(t){throw t instanceof TypeError?new Qs:t}}),ui.apply(this,arguments)}function ho(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Js(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){ho(o,r,i,a,s,"next",l)}function s(l){ho(o,r,i,a,s,"throw",l)}a(void 0)})}}function el(n){return di.apply(this,arguments)}function di(){return di=Js(function*(n){var e=navigator,t=e.clipboard;if(t!==void 0)try{return yield navigator.clipboard.writeText(n)}catch{}tc(n)}),di.apply(this,arguments)}function tc(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 DS(){return ci.apply(this,arguments)}function ci(){return ci=Js(function*(){try{var n=navigator,e=n.clipboard;if(e===void 0)throw new Zr;var t=yield co("clipboard-read");if(t==="granted"){var r=yield e.readText();return r}if(t==="prompt"){try{yield e.readText()}catch{}if(t=yield co("clipboard-read"),t==="granted"){var i=yield e.readText();return i}}if(t==="prompt"||t==="denied")throw new Gd}catch(o){throw o instanceof Qs?new Zr:o}throw new Zr}),ci.apply(this,arguments)}var Mn;function rn(n,e,t){return(e=nc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nc(n){var e=rc(n,"string");return typeof e=="symbol"?e:e+""}function rc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ic="table_",tl="column_",oc=new Set(["in","not","i","ii","k"]),ac=new Set(["abstract","continue","for","new","switch","assert","default","if","package","synchronized","boolean","do","goto","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","null","true","false"]),sc=/[^a-zA-Z0-9_$\-+@]/g,lc=/[^A-Za-z0-9_$]/g,uc=/^[a-zA-Z_$][a-zA-Z0-9_$\-+@]*$/,dc=/[^a-zA-Z0-9_]/g;function cc(n){return n.replace(/[ -]/g,"_")}function hc(n){return n.replace(/\s/g,"_")}class gt{}Mn=gt;rn(gt,"legalize",(n,e,t,r,i,o)=>{var a=e(n.trim());return i&&(oc.has(a)||ac.has(a))&&(a=t+a),a=a.replace(r,""),a?(/^[0-9-]/.test(a)&&(a=t+a),a):t+o});rn(gt,"legalizeTableName",n=>Mn.legalize(n,hc,ic,sc,!1,0));rn(gt,"makeVariableName",n=>Mn.legalizeTableName(n).replace(dc,"_"));rn(gt,"legalizeColumnNames",n=>{var e=[];return n.forEach((t,r)=>{var i=Mn.legalizeColumnName(t,r);e.includes(i)&&(i=tl+r),e.push(i)}),e});rn(gt,"legalizeColumnName",function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Mn.legalize(n,cc,tl,lc,!0,e)});rn(gt,"isValidTableName",n=>uc.test(n));rn(gt,"isValidColumnName",n=>Mn.legalizeColumnName(n)===n);class nl extends CustomEvent{constructor(e,t){super(e,t)}}class Qe{static makeCancelable(e,t){var r=!1,i,o,a=new Promise((s,l)=>{o=l,Promise.resolve(e).then(u=>{r?t&&t(u):(i=u,s(u))}).catch(u=>l(u))});return a.cancel=()=>{r=!0,o(new lo),i!=null&&t&&t(i)},a}static isCanceled(e){return e instanceof lo}static isTimedOut(e){return e instanceof Au}static withTimeout(e,t){return new Promise((r,i)=>{setTimeout(()=>{try{r(t())}catch(o){i(o)}},e)})}}function mo(n,e,t){return(e=mc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mc(n){var e=pc(n,"string");return typeof e=="symbol"?e:e+""}function pc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class jr{constructor(){mo(this,"pending",[]),mo(this,"resolved",[])}add(e,t){var r=Qe.makeCancelable(e,t);return this.pending.push(r),r.then(()=>{this.resolve(r)},()=>{this.resolve(r)}),r}remove(e){for(var t=0;t<this.pending.length;t+=1)if(this.pending[t]===e){this.pending.splice(t,1);return}}resolve(e){this.remove(e),this.resolved.push(e)}cancel(){for(var e=[...this.pending,...this.resolved],t=0;t<e.length;t+=1)e[t].cancel();this.pending=[],this.resolved=[]}}function MS(n){var e=n;n instanceof CustomEvent&&(e=n.detail);var t="";if(e instanceof Error?t=e.message:e!=null&&(t="".concat(e)),t=t.trim(),t.length>0)return t}function po(n,e){return bc(n)||gc(n,e)||vc(n,e)||fc()}function fc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vc(n,e){if(n){if(typeof n=="string")return fo(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?fo(n,e):void 0}}function fo(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function gc(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function bc(n){if(Array.isArray(n))return n}class lt{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(!lt.isValidRange(e))throw new Error("Invalid range! ".concat(e))}static isSelected(e,t){for(var r=0;r<e.length;r+=1){var i=e[r],o=i[0],a=i[1];if(o<=t&&t<=a)return!0}return!1}static selectRange(e,t){for(var r=po(t,2),i=r[0],o=r[1],a=[...e],s=a.length-1;s>=0;s-=1){var l=a[s],u=l[0],d=l[1];if(u<=i&&o<=d)return a;i<=d&&u<=o&&(i=Math.min(i,u),o=Math.max(o,d),a.splice(s,1))}return a.push([i,o]),a}static deselectRange(e,t){for(var r=po(t,2),i=r[0],o=r[1],a=[...e],s=a.length-1;s>=0;s-=1){var l=a[s],u=l[0],d=l[1];if(!(o<u||d<i))if(u<i&&o<d){a[s]=[u,i-1],a.splice(s+1,0,[o+1,d]);break}else i<=u&&d<=o?a.splice(s,1):u<i?a[s]=[u,i-1]:a[s]=[o+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 o=[...r],a=i[0];a<=i[1];a+=1)o.push(e[a]);return o},[])}}function*jS(n,e){for(var t=n;t<=e;++t)yield t}var AS=" ";class yc{static join(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"and";if(e==null||e.length===0)return"";if(e.length===1)return e[0];if(e.length===2)return"".concat(e[0]," ").concat(t," ").concat(e[1]);var r=e.slice(0,e.length-1).join(", "),i=e[e.length-1];return"".concat(r,", ").concat(t," ").concat(i)}static toLower(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==null){if(t)return"";throw new Error("Null string passed in to TextUtils.toLower")}return e.toLowerCase()}static sort(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e<t?r?-1:1:e>t?r?1:-1:0}static pluralize(e,t,r){return e===1?t:r??"".concat(t,"s")}}var Gn;function on(n,e,t){return(e=Sc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Sc(n){var e=Cc(n,"string");return typeof e=="symbol"?e:e+""}function Cc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var _c=[{name:"Tokyo",value:"Asia/Tokyo",noDst:!0},{name:"Seoul",value:"Asia/Seoul",noDst:!0},{name:"Hong Kong",value:"Asia/Hong_Kong",noDst:!0},{name:"Singapore",value:"Asia/Singapore",noDst:!0},{name:"Kolkata",value:"Asia/Kolkata",noDst:!0},{name:"Berlin",value:"Europe/Berlin",noDst:!1},{name:"UTC",value:"UTC",noDst:!0},{name:"London",value:"Europe/London",noDst:!1},{name:"Sao Paulo",value:"America/Sao_Paulo",noDst:!0},{name:"Newfoundland",value:"America/St_Johns",noDst:!1},{name:"Halifax",value:"America/Halifax",noDst:!1},{name:"New York",value:"America/New_York",noDst:!1},{name:"Chicago",value:"America/Chicago",noDst:!1},{name:"Denver",value:"America/Denver",noDst:!1},{name:"Los Angeles",value:"America/Los_Angeles",noDst:!1},{name:"Anchorage",value:"America/Anchorage",noDst:!1},{name:"Honolulu",value:"Pacific/Honolulu",noDst:!0},{name:"Zurich",value:"Europe/Zurich",noDst:!1},{name:"Amsterdam",value:"Europe/Amsterdam",noDst:!1},{name:"Taipei",value:"Asia/Taipei",noDst:!0},{name:"Sydney",value:"Australia/Sydney",noDst:!1}],vo=[],go="";class He{static get TIME_ZONES(){var e=new Date,t=e.toISOString().slice(0,16);return go!==t&&(go=t,vo=Object.freeze(_c.map(r=>{var i=r.name,o=r.value,a=r.noDst;return{label:"".concat(i," ").concat(He.getTimeZoneOffset(o,e)).concat(a?" No DST":""),value:o}}))),vo}static getTimeZoneOffset(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Date,i=(t=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"shortOffset"}).formatToParts(r).find(o=>o.type==="timeZoneName"))===null||t===void 0?void 0:t.value;return i==null||i==="GMT"||/^GMT[+-]0(?::00)?$/.test(i)?"UTC±0":i.replace("GMT","UTC")}static formatElapsedTime(e){if(typeof e!="number"||!Number.isInteger(e))throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60;return"".concat(t>0?"".concat(t,"h "):"")+"".concat(r>0||t>0?"".concat(r,"m "):"")+"".concat(e>=60?"".concat(i,"s").padStart(3,"0"):"".concat(i,"s"))}static formatTime(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=String(Math.floor(e/(60*60))).padStart(2,"0"),r=e%(60*60),i=String(Math.floor(r/60)).padStart(2,"0"),o=r%60,a=String(Math.ceil(o)).padStart(2,"0");return"".concat(t,":").concat(i,":").concat(a)}static isTimeString(e){return new RegExp(He.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])}static formatDuration(e){var t=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60;return t>0?"".concat(t,"h ").concat(r,"m ").concat(i,"s"):r>0?"".concat(r,"m ").concat(i.toFixed(1),"s"):"".concat(i.toFixed(2),"s")}static formatConvertedDuration(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"ms";if(e==null||t===""||t===0||t==null)return null;var i=1,o=null,a=null;if(r==="ms")i=1e3,o=new Date(e).valueOf(),a=new Date(t).valueOf();else if(r==="ns")i=1e9,o=Number(e),a=Number(t);else return null;var s=(a-o)/i;return this.formatDuration(s)}}Gn=He;on(He,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");on(He,"MILLIS_PER_SECOND",1e3);on(He,"NANOS_PER_SECOND",1e9);on(He,"NANOS_PER_MIN",60*Gn.NANOS_PER_SECOND);on(He,"NANOS_PER_HOUR",60*Gn.NANOS_PER_MIN);on(He,"MILLIS_PER_MIN",60*Gn.MILLIS_PER_SECOND);on(He,"MILLIS_PER_HOUR",60*Gn.MILLIS_PER_MIN);function wc(n,e,t){return(e=Ec(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ec(n){var e=Pc(n,"string");return typeof e=="symbol"?e:e+""}function Pc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Hn extends Error{constructor(){super(...arguments),wc(this,"isInvalid",!0)}}function rl(){var n=m.useRef(!1);return m.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function bo(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Tc(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){bo(o,r,i,a,s,"next",l)}function s(l){bo(o,r,i,a,s,"throw",l)}a(void 0)})}}var Oc=B.module("useAsyncInterval");function Ic(n,e){var t=rl(),r=m.useRef(0),i=m.useRef(0),o=m.useRef(null),a=m.useCallback(Tc(function*(){var s=Date.now();i.current+=1;var l=o.current==null?e:s-o.current;o.current=s;try{yield n()}catch(h){Oc.error("A tick error occurred:",h)}if(t.current){l+=Date.now()-o.current;var u=Math.max(0,l-e),d=Math.max(0,e-u);r.current=window.setTimeout(a,d)}}),[n,t,e]);m.useEffect(()=>(o.current=null,a(),()=>{window.clearTimeout(r.current)}),[e,a])}function Zn(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"No value available in context. Was code wrapped in a provider?",t=m.useContext(n);if(t==null)throw new Error(e);return t}function xc(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=t.leading,i=r===void 0?!1:r,o=t.trailing,a=o===void 0?!0:o,s=t.maxWait,l=m.useMemo(()=>zn(n,e,s!=null?{leading:i,trailing:a,maxWait:s}:{leading:i,trailing:a}),[n,e,i,a,s]);return m.useEffect(()=>()=>l.cancel(),[l]),l}function Dc(n){var e=m.useRef();return m.useEffect(function(){e.current=n}),e.current}function Mc(n,e,t){var r=m.useRef(t),i=m.useRef(n);i.current=n;var o=m.useMemo(()=>Mr(function(){return i.current(...arguments)},e,r.current),[e]);return m.useEffect(()=>()=>{var a,s;(a=(s=r.current)===null||s===void 0?void 0:s.flushOnUnmount)!==null&&a!==void 0&&a?o.flush():o.cancel()},[o]),o}function il(n){var e=m.useRef(null);return m.useEffect(function(){n&&(typeof n=="function"?n(e.current):n.current=e.current)}),e}function jc(n,e){return Lc(n)||Nc(n,e)||kc(n,e)||Ac()}function Ac(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kc(n,e){if(n){if(typeof n=="string")return yo(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?yo(n,e):void 0}}function yo(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Nc(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Lc(n){if(Array.isArray(n))return n}var Rc=3500,$c=B.module("useCopyToClipboard");function Fc(){var n=m.useState(!1),e=jc(n,2),t=e[0],r=e[1],i=m.useRef(null),o=m.useCallback(a=>{el(a).then(()=>{r(!0)}).catch(s=>$c.error("Unable to copy ".concat(a),`
|
|
5
5
|
`,s))},[]);return m.useEffect(()=>(i.current&&clearTimeout(i.current),t&&(i.current=setTimeout(()=>{r(!1)},Rc)),()=>{i.current&&clearTimeout(i.current)}),[t]),[t,o]}var Hc=["gray-50","gray-75","gray-100","gray-200","gray-300","gray-400","gray-500","gray-600","gray-700","gray-800","gray-900","red-100","red-200","red-300","red-400","red-500","red-600","red-700","red-800","red-900","red-1000","red-1100","red-1200","red-1300","red-1400","orange-100","orange-200","orange-300","orange-400","orange-500","orange-600","orange-700","orange-800","orange-900","orange-1000","orange-1100","orange-1200","orange-1300","orange-1400","yellow-100","yellow-200","yellow-300","yellow-400","yellow-500","yellow-600","yellow-700","yellow-800","yellow-900","yellow-1000","yellow-1100","yellow-1200","yellow-1300","yellow-1400","chartreuse-100","chartreuse-200","chartreuse-300","chartreuse-400","chartreuse-500","chartreuse-600","chartreuse-700","chartreuse-800","chartreuse-900","chartreuse-1000","chartreuse-1100","chartreuse-1200","chartreuse-1300","chartreuse-1400","celery-100","celery-200","celery-300","celery-400","celery-500","celery-600","celery-700","celery-800","celery-900","celery-1000","celery-1100","celery-1200","celery-1300","celery-1400","green-100","green-200","green-300","green-400","green-500","green-600","green-700","green-800","green-900","green-1000","green-1100","green-1200","green-1300","green-1400","seafoam-100","seafoam-200","seafoam-300","seafoam-400","seafoam-500","seafoam-600","seafoam-700","seafoam-800","seafoam-900","seafoam-1000","seafoam-1100","seafoam-1200","seafoam-1300","seafoam-1400","cyan-100","cyan-200","cyan-300","cyan-400","cyan-500","cyan-600","cyan-700","cyan-800","cyan-900","cyan-1000","cyan-1100","cyan-1200","cyan-1300","cyan-1400","blue-100","blue-200","blue-300","blue-400","blue-500","blue-600","blue-700","blue-800","blue-900","blue-1000","blue-1100","blue-1200","blue-1300","blue-1400","indigo-100","indigo-200","indigo-300","indigo-400","indigo-500","indigo-600","indigo-700","indigo-800","indigo-900","indigo-1000","indigo-1100","indigo-1200","indigo-1300","indigo-1400","purple-100","purple-200","purple-300","purple-400","purple-500","purple-600","purple-700","purple-800","purple-900","purple-1000","purple-1100","purple-1200","purple-1300","purple-1400","fuchsia-100","fuchsia-200","fuchsia-300","fuchsia-400","fuchsia-500","fuchsia-600","fuchsia-700","fuchsia-800","fuchsia-900","fuchsia-1000","fuchsia-1100","fuchsia-1200","fuchsia-1300","fuchsia-1400","magenta-100","magenta-200","magenta-300","magenta-400","magenta-500","magenta-600","magenta-700","magenta-800","magenta-900","magenta-1000","magenta-1100","magenta-1200","magenta-1300","magenta-1400","negative","notice","positive","info","accent","accent-100","accent-200","accent-300","accent-400","accent-500","accent-600","accent-700","accent-800","accent-900","accent-1000","accent-1100","accent-1200","accent-1300","accent-1400","bg","content-bg","subdued-content-bg","surface-bg","fg"];function Uc(n){return typeof n=="string"&&Hc.includes(n)}function ol(n){return n!=null&&Uc(n)?"var(--dh-color-".concat(n,")"):n}var Bc=["color","UNSAFE_style"];function So(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ar(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?So(Object(t),!0).forEach(function(r){Wc(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):So(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Wc(n,e,t){return(e=Kc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Kc(n){var e=zc(n,"string");return typeof e=="symbol"?e:e+""}function zc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Vc(n,e){if(n==null)return{};var t,r,i=Gc(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function Gc(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}var al=m.forwardRef((n,e)=>{var t=n.color,r=n.UNSAFE_style,i=Vc(n,Bc),o=m.useMemo(()=>ar(ar({},r),{},{color:ol(t)}),[t,r]);return c.jsx(yd,ar(ar({},i),{},{ref:e,UNSAFE_style:o}))});al.displayName="Text";function Co(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function jt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Co(Object(t),!0).forEach(function(r){gn(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Co(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function gn(n,e,t){return(e=Zc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Zc(n){var e=Xc(n,"string");return typeof e=="symbol"?e:e+""}function Xc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var _o="popper",qc="popper-container",Yc={placement:"bottom-end",modifiers:{preventOverflow:{boundariesElement:"scrollParent",fn:(n,e)=>{var t,r,i=(t=Vs.Defaults.modifiers)===null||t===void 0||(t=t.preventOverflow)===null||t===void 0||(r=t.fn)===null||r===void 0?void 0:r.call(t,n,e);return i==null?n:(i.styles.maxHeight="".concat(document.documentElement.clientHeight-n.offsets.popper.top-2*e.padding,"px"),i??n)}},flip:{enabled:!1}}};class Ar extends m.Component{constructor(e){super(e),gn(this,"element",void 0),gn(this,"container",void 0),gn(this,"nodeRef",k.createRef()),gn(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.updateContainerClassName(e.containerClassName,e.isMaximized),this.container=k.createRef(),this.rAF=0;var t=this.props.isShown;this.state={show:t,popper:null}}componentDidUpdate(e){var t=this.props,r=t.isShown,i=t.containerClassName,o=t.isMaximized,a=this.state.popper;(e.containerClassName!==i||e.isMaximized!==o)&&this.updateContainerClassName(i,o),e.isShown!==r&&(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{r?this.show():this.hide()})),a&&a.scheduleUpdate()}componentWillUnmount(){this.destroyPopper(!1)}updateContainerClassName(e,t){this.element.className=U(qc,e,{maximized:t})}getVisibleElement(e){return e==null||e.clientHeight>0||e.clientWidth>0?e:this.getVisibleElement(e.parentElement)}initPopper(){var e,t,r=this.state.popper,i=this.props,o=i.closeOnBlur,a=i.referenceObject;if(!r&&this.container.current!==null){var s=this.props,l=s.options,u=s.keepInParent,d=u?Yc:{placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}}},h=jt(jt(jt({},d),l),{},{modifiers:jt(jt(jt({},d.modifiers),l.modifiers),{},{preventOverflow:jt(jt({},(e=d.modifiers)===null||e===void 0?void 0:e.preventOverflow),(t=l.modifiers)===null||t===void 0?void 0:t.preventOverflow)})});document.body.appendChild(this.element);var p=this.getVisibleElement(this.container.current);p==null&&(p=this.container.current);var f=new Vs(a||p,this.element,h);f.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(o){var v=this.element.querySelector(".".concat(_o));v instanceof HTMLElement&&!v.contains(document.activeElement)&&v.focus()}}),si.flushSync(()=>{this.setState({popper:f})})}}destroyPopper(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;cancelAnimationFrame(this.rAF);var t=this.state.popper;t&&(t.destroy(),document.body.contains(this.element)&&document.body.removeChild(this.element),e&&this.setState({popper:null}))}show(){this.initPopper(),si.flushSync(()=>{this.setState({show:!0})})}hide(){this.setState({show:!1})}scheduleUpdate(){var e=this.state.popper;e&&e.scheduleUpdate()}handleBlur(e){var t=this.props,r=t.closeOnBlur,i=t.onBlur;e.relatedTarget instanceof HTMLElement&&(this.element.contains(e.relatedTarget)||(i==null||i(e),r&&this.hide()))}handleEnter(){var e=this.props.onEntered;e()}handleExit(){var e=this.props.onExited,t=this.state.show;t||this.destroyPopper(),e()}renderContent(){var e=this.props,t=e.className,r=e.children,i=e.timeout,o=e.interactive,a=e.closeOnBlur,s=e.containPortals,l=this.state.show,u=s?c.jsx(Cd,{getContainer:()=>this.element,children:r}):r;return c.jsx(Ns,{isPortal:!0,children:c.jsx(Sd,{in:l,timeout:i,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,nodeRef:this.nodeRef,children:c.jsx("div",{ref:this.nodeRef,onClick:d=>{d.stopPropagation()},onKeyDown:d=>{d.key==="Escape"&&this.hide()},className:U(_o,{interactive:o},t),onBlur:this.handleBlur,tabIndex:a?-1:void 0,role:"presentation",children:c.jsxs("div",{className:U("popper-content",{"popper-content--contain-portals":s}),children:[u,c.jsx("div",{className:"popper-arrow","x-arrow":""})]})})})})}render(){var e=this.state.popper,t=this.props["data-testid"];return c.jsx("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":t,children:e&&xi.createPortal(this.renderContent(),this.element)})}}gn(Ar,"defaultProps",{options:{},className:"",containerClassName:"",isMaximized:!1,timeout:ku.transitionMs,onEntered(){},onExited(){},onBlur(){},isShown:!1,interactive:!1,closeOnBlur:!1,keepInParent:!1,containPortals:!1,referenceObject:null,"data-testid":void 0});var hi;function wo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Qc(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?wo(Object(t),!0).forEach(function(r){ut(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):wo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ut(n,e,t){return(e=Jc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Jc(n){var e=eh(n,"string");return typeof e=="symbol"?e:e+""}function eh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var th=B.module("Tooltip");class ue extends m.Component{static handleHidden(){ue.shownTooltipCount-=1,ue.shownTooltipCount===0&&(ue.lastHiddenTime=Date.now())}static handleShown(){ue.shownTooltipCount+=1}constructor(e){super(e),ut(this,"container",void 0),ut(this,"popper",void 0),ut(this,"parent",void 0),ut(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=k.createRef(),this.popper=k.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}componentDidMount(){this.startListening();var e=this.props.timeout;e===0&&this.show()}componentDidUpdate(e,t){var r=t.isShown,i=this.state.isShown;i!==r&&(i?ue.handleShown():ue.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();var e=this.state.isShown;e&&ue.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){th.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 e=this.state.isShown;this.popper.current&&this.parent&&e&&!this.popper.current.element.matches(":hover")&&!this.parent.matches(":hover")&&(this.stopTimer(),this.hide())}handleMouseLeave(){var e=this.state.isShown;this.stopTimer();var t=this.props.interactive;!t&&e&&this.hide()}handleTimeout(){this.show()}handleWindowMouseMove(e){var t=e.clientX,r=e.clientY,i=this.state.isShown;if(!(!this.popper.current||!this.parent)){var o=this.popper.current.element.getBoundingClientRect(),a=this.parent.getBoundingClientRect();t>=o.left&&t<=o.left+o.width&&r>=o.top&&r<=o.top+o.height?this.handleMouseMove():t>=a.left&&t<=a.left+a.width&&r>=a.top&&r<=a.top+a.height?this.handleMouseMove():i&&(this.stopTimer(),this.hide())}}startTimer(){this.stopTimer();var e=this.props,t=e.timeout,r=e.reshowTimeout,i=t;(ue.shownTooltipCount>0||Date.now()-ue.lastHiddenTime<ue.triggerReshowThreshold)&&(i=r),this.timer=window.setTimeout(this.handleTimeout,i)}stopTimer(){this.timer!=null&&(clearTimeout(this.timer),this.timer=null)}show(){var e=this.state.isShown;if(this.stopTimer(),!e){var t;(t=this.popper.current)===null||t===void 0||t.show(),si.flushSync(()=>{this.setState({isShown:!0})});var r=this.props.interactive;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 e=this.props.onExited;e()}stopShowingTooltip(){var e=this.state.isShown;this.stopTimer(),e&&this.hide()}render(){var e=this.props,t=e.interactive,r=e.children,i=e.referenceObject,o=e.popperClassName,a=e["data-testid"],s=e.onEntered,l=this.state.isShown,u=this.props.options;return u=Qc({placement:"bottom"},u),c.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":a,children:c.jsx(Ar,{className:U(o,"popper-tooltip"),options:u,ref:this.popper,onEntered:s,onExited:this.handleExited,interactive:t,referenceObject:i,children:c.jsxs("div",{className:"tooltip-content",children:[" ",l&&r]})})})}}hi=ue;ut(ue,"defaultTimeout",500);ut(ue,"defaultReshowTimeout",100);ut(ue,"triggerReshowThreshold",300);ut(ue,"shownTooltipCount",0);ut(ue,"lastHiddenTime",Date.now());ut(ue,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:hi.defaultReshowTimeout,timeout:hi.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});function Eo(n,e){return oh(n)||ih(n,e)||rh(n,e)||nh()}function nh(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
@@ -43,4 +43,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
43
43
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Z0(n,e){if(n){if(typeof n=="string")return ws(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ws(n,e):void 0}}function ws(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function X0(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function q0(n){if(Array.isArray(n))return n}var Es=B.module("FileListItemEditor"),Y0=()=>Promise.resolve();function Q0(n){var e=n.item,t=n.onCancel,r=n.onSubmit,i=n.validate,o=i===void 0?Y0:i,a=m.useRef(null),s=m.useState(e.basename),l=ri(s,2),u=l[0],d=l[1],h=m.useState(),p=ri(h,2),f=p[0],v=p[1],g=m.useState(Promise.resolve()),b=ri(g,2),y=b[0],S=b[1],C=m.useCallback(()=>{var x;(x=a.current)===null||x===void 0||x.focus()},[a]),_=m.useCallback(x=>x.stopPropagation(),[]),w=m.useCallback(()=>{y.then(()=>{r(u)}).catch(x=>Es.info("Unable to validate name",x))},[r,u,y]);m.useEffect(function(){var j=Qe.makeCancelable(o(u));return j.then(()=>v(void 0)).catch(L=>{Qe.isCanceled(L)||v(L)}),S(j),()=>j.cancel()},[o,u]),m.useEffect(function(){C()},[C]);var D=m.useCallback(()=>{Es.debug2("handleBlur"),w()},[w]),F=m.useCallback(x=>{var j=x.target.value;d(j)},[]),N=m.useCallback(x=>{x.stopPropagation();var j=x.key;switch(j){case"Enter":{w();break}case"Escape":{t();break}}},[t,w]);return c.jsxs("div",{className:"file-list-item-editor",children:[c.jsx("input",{type:"text",className:U("form-control file-list-item-editor-input",{"is-invalid":f}),value:u,ref:a,onBlur:D,onKeyDown:N,onChange:F,onClick:_,onDoubleClick:_,onMouseDown:_}),f&&c.jsx("div",{className:"invalid-feedback",children:"".concat(f)})]})}function Ps(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 ii(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ps(Object(t),!0).forEach(function(r){J0(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ps(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function J0(n,e,t){return(e=eS(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function eS(n){var e=tS(n,"string");return typeof e=="symbol"?e:e+""}function tS(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function oi(n,e){return oS(n)||iS(n,e)||rS(n,e)||nS()}function nS(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
44
44
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rS(n,e){if(n){if(typeof n=="string")return Ts(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ts(n,e):void 0}}function Ts(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function iS(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function oS(n){if(Array.isArray(n))return n}function Mu(n){var e=n.isMultiSelect,t=e===void 0?!1:e,r=n.focusedPath,i=n.showContextMenu,o=i===void 0?!1:i,a=n.onCreateFile,s=n.onCreateFolder,l=n.onCopy,u=n.onDelete,d=n.onMove,h=n.onRename,p=n.onSelect,f=n.onSelectionChange,v=n.table,g=n.rowHeight,b=g===void 0?Ji:g,y=n.validateRename,S=y===void 0?()=>Promise.resolve():y,C=m.useState(),_=oi(C,2),w=_[0],D=_[1],F=m.useState([]),N=oi(F,2),x=N[0],j=N[1],L=m.useState(),re=oi(L,2),A=re[0],Z=re[1],ie=m.useCallback(M=>{j(M),f==null||f(M)},[f]),oe=m.useCallback(M=>{Z(M)},[]),be=m.useCallback(()=>{A&&(l==null||l(A))},[A,l]),ye=m.useCallback(()=>{x.length>0&&(u==null||u(x))},[u,x]),Oe=m.useCallback(()=>{a==null||a()},[a]),we=m.useCallback(()=>{A&&(s==null||s($.getPath(A.filename)))},[A,s]),ce=m.useCallback(()=>{A&&D(A)},[A]),q=m.useCallback(()=>{D(void 0)},[]),V=m.useCallback(M=>{w&&(h==null||h(w,M),D(void 0))},[h,w]),te=m.useMemo(()=>{if(w)return[];var M=[];return a&&M.push({title:"New File",description:"Create new file",action:Oe,group:de.groups.medium}),s&&M.push({title:"New Folder",description:"Create new folder",action:we,group:de.groups.medium}),l&&M.push({title:"Copy File",description:"Copy the selected file",action:be,group:de.groups.low,disabled:A==null||dt(A)}),u&&x.length>0&&M.push({title:"Delete",description:"Delete",shortcut:_s.FILE_EXPLORER.DELETE,action:ye,group:de.groups.low}),h&&M.push({title:"Rename",description:"Rename",shortcut:_s.FILE_EXPLORER.RENAME,action:ce,group:de.groups.low,disabled:A==null}),M},[be,ye,Oe,we,ce,A,l,a,s,u,h,x,w]),G=m.useCallback(M=>(W(w),S(w,M)),[w,S]),Q=m.useCallback(M=>{var Ze=M.item;return w&&w.filename===Ze.filename?c.jsx(Ii,ii(ii({},M),{},{children:c.jsx(Q0,{item:Ze,validate:G,onSubmit:V,onCancel:q})})):c.jsx(Ii,ii({},M))},[q,V,w,G]);return c.jsxs("div",{className:"file-list-container",children:[v!=null&&c.jsx(z0,{onMove:d,onSelect:p,onSelectionChange:ie,onFocusChange:oe,renderItem:Q,rowHeight:b,table:v,isMultiSelect:t,focusedPath:r}),o&&c.jsx(de,{actions:te})]})}Mu.displayName="FileListContainer";function Os(n,e,t){return(e=aS(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function aS(n){var e=sS(n,"string");return typeof e=="symbol"?e:e+""}function sS(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class _r extends Hn{constructor(e){super("Name already exists"),Os(this,"isExistingFile",!0),Os(this,"info",void 0),this.info=e}}function Is(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function xs(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Is(o,r,i,a,s,"next",l)}function s(l){Is(o,r,i,a,s,"throw",l)}a(void 0)})}}function Ds(n,e){return cS(n)||dS(n,e)||uS(n,e)||lS()}function lS(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
45
45
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uS(n,e){if(n){if(typeof n=="string")return Ms(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ms(n,e):void 0}}function Ms(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function dS(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function cS(n){if(Array.isArray(n))return n}var pt=B.module("FileExplorer");function eo(n){var e=n.storage,t=n.isMultiSelect,r=t===void 0?!1:t,i=n.focusedPath,o=n.onCopy,a=o===void 0?()=>{}:o,s=n.onDelete,l=s===void 0?()=>{}:s,u=n.onRename,d=u===void 0?()=>{}:u,h=n.onCreateFile,p=h===void 0?()=>{}:h,f=n.onCreateFolder,v=f===void 0?()=>{}:f,g=n.onSelect,b=n.onSelectionChange,y=n.rowHeight,S=y===void 0?Ji:y,C=m.useState([]),_=Ds(C,2),w=_[0],D=_[1],F=m.useState(),N=Ds(F,2),x=N[0],j=N[1];m.useEffect(function(){var te;function G(){return Q.apply(this,arguments)}function Q(){return Q=xs(function*(){pt.debug("initTable"),te=Qe.makeCancelable(e.getTable(),M=>M.close());try{j(yield te)}catch(M){Qe.isCanceled(M)||pt.error("Unable to initialize table",M)}}),Q.apply(this,arguments)}return G(),()=>{te.cancel()}},[e]);var L=m.useCallback(V=>{Qe.isCanceled(V)||pt.error(V)},[]),re=m.useCallback(()=>{pt.debug("handleCreateFile"),p()},[p]),A=m.useCallback(()=>{pt.debug("handleCreateFolder"),v()},[v]),Z=m.useCallback(V=>{pt.debug("handleCopyFile",V.filename),a(V)},[a]),ie=m.useCallback(V=>{pt.debug("handleDelete, pending confirmation",V),D(V)},[]),oe=m.useCallback(()=>{pt.debug("handleDeleteConfirm",w),w.forEach(V=>e.deleteFile(dt(V)?$.makePath(V.filename):V.filename)),l(w),D([])},[w,l,e]),be=m.useCallback(()=>{pt.debug("handleDeleteCancel"),D([])},[]),ye=m.useCallback((V,te)=>{var G=$.reducePaths(V.map(Q=>dt(Q)?$.makePath(Q.filename):Q.filename));G.forEach(Q=>{var M=$.isPath(Q)?"".concat(te).concat($.getBaseName(Q.substring(0,Q.length-1)),"/"):"".concat(te).concat($.getBaseName(Q));e.moveFile(Q,M).then(()=>{d(Q,M)}).catch(L)})},[L,d,e]),Oe=m.useCallback((V,te)=>{var G=V.filename,Q=dt(V);Q&&!G.endsWith("/")&&(G="".concat(G,"/"));var M="".concat($.getParent(G)).concat(te);Q&&!M.endsWith("/")&&(M="".concat(M,"/")),pt.debug2("handleRename",G,M),e.moveFile(G,M).catch(L),d(G,M)},[L,d,e]),we=m.useCallback(function(){var V=xs(function*(te,G){if(G!==te.basename){$.validateName(G);var Q="".concat($.getPath(te.filename)).concat(G);try{var M=yield e.info(Q);throw new _r(M)}catch(Ze){if(!(Ze instanceof Qi))throw Ze}}});return function(te,G){return V.apply(this,arguments)}}(),[e]),ce=w.length>0,q=m.useMemo(()=>w.length===1?'Are you sure you want to delete "'.concat(w[0].filename,'"?'):"Are you sure you want to delete the selected files?",[w]);return c.jsxs("div",{className:"file-explorer",children:[x&&c.jsx(Mu,{isMultiSelect:r,focusedPath:i,showContextMenu:!0,onCopy:Z,onCreateFolder:A,onCreateFile:re,onMove:ye,onDelete:ie,onRename:Oe,onSelect:g,onSelectionChange:b,rowHeight:S,table:x,validateRename:we}),c.jsx(mi,{isOpen:ce,headerText:q,bodyText:"You cannot undo this action.",onCancel:be,onConfirm:oe,confirmButtonText:"Delete"})]})}eo.displayName="FileExplorer";function js(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function hS(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){js(o,r,i,a,s,"next",l)}function s(l){js(o,r,i,a,s,"throw",l)}a(void 0)})}}function Qt(n,e,t){return(e=mS(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mS(n){var e=pS(n,"string");return typeof e=="symbol"?e:e+""}function pS(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Zt=B.module("NewItemModal");class Pn extends m.PureComponent{static getValidationMessage(e){return e instanceof _r&&e.info.type==="directory"?"Error: Cannot overwrite existing directory":"".concat(e)}static handleError(e){Qe.isCanceled(e)||Zt.error(e)}constructor(e){super(e),Qt(this,"inputRef",k.createRef()),Qt(this,"cancelableValidatePromise",void 0),Qt(this,"cancelableExistingItemPromise",void 0),Qt(this,"pending",new jr),Qt(this,"pathMap",new Map),Qt(this,"isInitialLoad",!0),this.handleModalSubmit=this.handleModalSubmit.bind(this),this.handleModalOpened=this.handleModalOpened.bind(this),this.handleSelect=this.handleSelect.bind(this),this.handleChange=this.handleChange.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleValidationError=this.handleValidationError.bind(this),this.handleOverwriteCancel=this.handleOverwriteCancel.bind(this),this.handleOverwriteConfirm=this.handleOverwriteConfirm.bind(this),this.handleExtensionChangeCancel=this.handleExtensionChangeCancel.bind(this),this.handleExtensionChangeConfirm=this.handleExtensionChangeConfirm.bind(this),this.handleBreadcrumbSelect=this.handleBreadcrumbSelect.bind(this);var t=e.defaultValue,r=$.hasPath(t)?$.getPath(t):"/";this.state={isSubmitting:!1,path:r,prevExtension:$.getExtension(t),showExtensionChangeModal:!1,showOverwriteModal:!1,value:$.getBaseName(t)}}componentDidUpdate(e,t){var r=this.props.isOpen,i=e.isOpen,o=this.state,a=o.value,s=o.path;!i&&r&&(this.resetValue(),this.isInitialLoad=!0),i&&r&&(!this.isInitialLoad&&(s!==t.path||a!==t.value)&&this.updateValidationStatus(s,a),this.isInitialLoad=!1)}componentWillUnmount(){this.pending.cancel(),this.cancelableValidatePromise&&this.cancelableValidatePromise.cancel(),this.cancelableExistingItemPromise&&this.cancelableExistingItemPromise.cancel()}resetValue(){var e=this.props,t=e.defaultValue,r=$.hasPath(t)?$.getPath(t):"/";this.setState({path:r,value:$.getBaseName(t),validationError:void 0,prevExtension:$.getExtension(t),isSubmitting:!1})}getValidationPromise(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.cancelableValidatePromise&&this.cancelableValidatePromise.cancel(),this.cancelableValidatePromise=Qe.makeCancelable(this.validateName(e,t,r)),this.cancelableValidatePromise}validateName(e,t,r){var i=this;return hS(function*(){$.validateName(t);var o=i.props,a=o.defaultValue,s=o.storage;if(r){var l="".concat(e).concat(t);if(l!==a)try{var u=yield s.info(l);throw new _r(u)}catch(d){if(!(d instanceof Qi))throw d}}return t})()}updateValidationStatus(e,t){this.getValidationPromise(e,t).then(()=>{this.setState({validationError:void 0})}).catch(this.handleValidationError).catch(Pn.handleError)}handleModalOpened(){this.focusRenameInput()}handleModalSubmit(){this.submitModal()}handleChange(e){var t=e.target.value;this.setState({value:t})}handleSelect(e){if(Zt.debug("handleSelect",e),e.type==="directory")this.setState({path:$.makePath(e.filename)});else{var t=e.basename,r=$.getPath(e.filename);this.setState({value:t,path:r},()=>{this.focusRenameInput()})}}handleKeyDown(e){var t=e.key;switch(e.stopPropagation(),t){case"Enter":{e.preventDefault(),this.submitModal();break}case"Escape":{e.preventDefault();var r=this.props.onCancel;r();break}}}handleValidationError(e){if(!(e instanceof Hn))throw e;Zt.debug("Validation error",e),this.setState({validationError:e})}handleOverwriteCancel(){this.setState({showOverwriteModal:!1,isSubmitting:!1})}handleOverwriteConfirm(){this.setState({showOverwriteModal:!1});var e=this.props.onSubmit,t=this.state,r=t.path,i=t.value;Zt.debug("handleOverwriteConfirm",r,i),e("".concat(r).concat(i),!0)}handleExtensionChangeCancel(){Zt.debug("handleExtensionChangeCancel"),this.setState(e=>{var t=e.value,r=e.prevExtension,i=$.replaceExtension(t,r);return{showExtensionChangeModal:!1,value:i}}),this.submitModal(!0)}handleExtensionChangeConfirm(){Zt.debug("handleExtensionChangeConfirm"),this.setState({showExtensionChangeModal:!1}),this.submitModal(!0)}focusRenameInput(){var e=this.inputRef.current;if(e){var t=this.props.type,r=e.value,i=t==="directory"?r.length:r.lastIndexOf(".");e.focus(),e.setSelectionRange(0,i>0?i:r.length)}}submitModal(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.setState(t=>{var r=t.prevExtension,i=t.value,o=t.path,a=this.props,s=a.notifyOnExtensionChange,l=a.type;Zt.debug("submitModal",r,i);var u=$.getExtension(i);return s&&!e&&r!==null&&r!==u?{isSubmitting:!1,showExtensionChangeModal:!0,newExtension:u}:(this.getValidationPromise(o,i,!0).then(d=>{var h=this.props.onSubmit;h("".concat(o).concat(i))}).catch(d=>{if(d instanceof _r&&l!=="directory"&&d.info.type!=="directory"){this.setState({showOverwriteModal:!0});return}throw d}).catch(d=>{throw Qe.isCanceled(d)&&this.setState({isSubmitting:!1}),d}).catch(this.handleValidationError).catch(Pn.handleError),{isSubmitting:!0,showExtensionChangeModal:!1,newExtension:void 0})})}handleBreadcrumbSelect(e){this.setState({path:e})}renderPathButtons(e){var t=e.split("/");return t.pop(),t.map((r,i)=>{for(var o="",a=0;a<i;a+=1)o+="".concat(t[a],"/");return o+="".concat(r,"/"),c.jsxs(k.Fragment,{children:[c.jsx(ne,{kind:"ghost",className:"directory-breadcrumbs",onClick:()=>this.handleBreadcrumbSelect(o),"aria-label":i===0?"Home":void 0,icon:i===0?c.jsx(me,{icon:gd,transform:"right-1.6"}):void 0,tooltip:i===0?"Home":void 0,children:r}),"/"]},o)})}render(){var e=this.props,t=e.storage,r=e.isOpen,i=e.onCancel,o=e.placeholder,a=e.title,s=e.type,l=this.state,u=l.isSubmitting,d=l.path,h=l.showExtensionChangeModal,p=l.showOverwriteModal,f=l.validationError,v=l.value,g=l.prevExtension,b=l.newExtension,y=s==="directory",S=$.fileExtensionToString(g),C=$.fileExtensionToString(b),_=y?"Create":"Save",w=y?"New folder name":"Save file as";return c.jsxs(c.Fragment,{children:[c.jsxs(Ls,{isOpen:r,toggle:i,onOpened:this.handleModalOpened,className:"modal-dialog-centered new-file-modal",children:[c.jsx(Rs,{toggle:i,children:a}),c.jsx($s,{children:c.jsx("form",{children:c.jsxs("div",{className:"d-flex flex-column new-file-modal-content",children:[c.jsxs("div",{className:"flex-grow-0 mb-4",children:[c.jsx("label",{htmlFor:"file-name-input",children:w}),c.jsx("input",{id:"file-name-input",type:"text",autoComplete:"off",autoCapitalize:"none",autoCorrect:"off",spellCheck:"false",className:U("form-control",{"is-invalid":f}),value:v,placeholder:o,ref:this.inputRef,onKeyDown:this.handleKeyDown,onChange:this.handleChange}),f&&c.jsx("div",{className:"invalid-feedback",children:Pn.getValidationMessage(f)})]}),c.jsxs("div",{className:"flex-grow-0",children:[c.jsx("label",{children:"Directory: /"}),this.renderPathButtons(d)]}),c.jsx("div",{className:"flex-grow-1 file-explorer-container",children:c.jsx(eo,{onSelect:this.handleSelect,storage:t,focusedPath:d})})]})})}),c.jsxs(ul,{children:[c.jsx(ne,{kind:"secondary",onClick:i,children:"Cancel"}),c.jsx(ne,{kind:"primary",disabled:u,onClick:this.handleModalSubmit,children:_})]})]}),c.jsx(mi,{isOpen:p,headerText:"Confirm overwrite",bodyText:"File with this name already exists, are you sure you want to overwrite it?",onCancel:this.handleOverwriteCancel,onConfirm:this.handleOverwriteConfirm,cancelButtonText:"Cancel",confirmButtonText:"Overwrite"}),c.jsx(mi,{isOpen:h,headerText:"Confirm extension change",bodyText:'Are you sure you want to change extension from "'.concat(S,'" to "').concat(C,'"?'),onCancel:this.handleExtensionChangeCancel,onConfirm:this.handleExtensionChangeConfirm,cancelButtonText:'Keep "'.concat(S,'"'),confirmButtonText:'Use "'.concat(C,'"')})]})}}Qt(Pn,"defaultProps",{isOpen:!1,defaultValue:"/",notifyOnExtensionChange:!1,placeholder:"",onSubmit:(n,e)=>{},onCancel:()=>{}});function fS(n){var e=n.createFile,t=n.createFolder,r=n.onSearchChange,i=n.defaultSearchText,o=i===void 0?"":i;return c.jsxs("div",{className:"file-explorer-toolbar",children:[c.jsxs("div",{className:"file-explorer-toolbar-buttons",children:[c.jsx(ne,{kind:"ghost",icon:zs,tooltip:"New notebook",onClick:e,"aria-label":"New notebook"}),c.jsx(ne,{kind:"ghost",icon:bd,tooltip:"New folder",onClick:t,"aria-label":"New folder"})]}),r&&c.jsx("div",{className:"file-explorer-toolbar-search",children:c.jsx(bl,{value:o,onChange:r,placeholder:"Search by name"})})]})}function As(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function vS(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){As(o,r,i,a,s,"next",l)}function s(l){As(o,r,i,a,s,"throw",l)}a(void 0)})}}function ju(n,e,t){return(e=gS(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function gS(n){var e=bS(n,"string");return typeof e=="symbol"?e:e+""}function bS(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Xt=B.module("FileExplorerPanel"),yS=(n,e)=>{var t=Um(n),r=Br(n,e.localDashboardId),i=r??{},o=i.session,a=i.config,s=a==null?void 0:a.type;return{fileStorage:t,language:s,session:o}},SS=Vn(yS,null,null,{forwardRef:!0});function CS(n){var e=n;return e!=null&&typeof e.button=="number"}class Dn extends k.Component{static handleError(e){Xt.error(e)}static isFocusEvent(e){return CS(e)?e.detail>=2:!0}constructor(e){super(e),this.handleFileSelect=this.handleFileSelect.bind(this),this.handleCopyFile=this.handleCopyFile.bind(this),this.handleCreateFile=this.handleCreateFile.bind(this),this.handleCreateDirectory=this.handleCreateDirectory.bind(this),this.handleCreateDirectoryCancel=this.handleCreateDirectoryCancel.bind(this),this.handleCreateDirectorySubmit=this.handleCreateDirectorySubmit.bind(this),this.handleDelete=this.handleDelete.bind(this),this.handleRename=this.handleRename.bind(this),this.handleSessionOpened=this.handleSessionOpened.bind(this),this.handleSessionClosed=this.handleSessionClosed.bind(this),this.handleShow=this.handleShow.bind(this),this.handleSelectionChange=this.handleSelectionChange.bind(this);var t=e.session,r=e.language;this.state={isShown:!1,language:r,session:t,showCreateFolder:!1,focusedFilePath:"/"}}componentDidMount(){this.isHidden()||this.setState({isShown:!0})}handleCreateFile(){var e=this.props.glEventHub,t=this.state,r=t.session,i=t.language,o={language:i,value:""};Xt.debug("handleCreateFile",r,i,o),e.emit(Fe.CREATE_NOTEBOOK,r,i,o)}handleCreateDirectory(){this.setState({showCreateFolder:!0})}handleCreateDirectoryCancel(){Xt.debug("handleCreateDirectoryCancel"),this.setState({showCreateFolder:!1})}handleCreateDirectorySubmit(e){Xt.debug("handleCreateDirectorySubmit",e),this.setState({showCreateFolder:!1});var t=this.props.fileStorage;t.createDirectory(e).catch(Dn.handleError)}handleCopyFile(e){var t=this;return vS(function*(){var r=t.props.fileStorage;if(dt(e)){Xt.error("Invalid item in handleCopyItem",e);return}var i=yield $.getUniqueCopyFileName(r,e.filename);yield r.copyFile(e.filename,i)})()}handleDelete(e){var t=this.props.glEventHub;e.forEach(r=>{t.emit(Fe.CLOSE_FILE,{id:r.filename,itemName:r.filename})})}handleSelectionChange(e){var t="/";e.length===1&&(e[0].type==="directory"?t=$.makePath(e[0].filename):t=$.getPath(e[0].filename)),this.setState({focusedFilePath:t})}handleFileSelect(e,t){if(Xt.debug("fileSelect",e),e.type!=="directory"){var r=Dn.isFocusEvent(t),i={id:e.filename,itemName:e.filename},o=this.props.glEventHub,a=this.state,s=a.session,l=a.language,u={value:null,language:l};o.emit(Fe.SELECT_NOTEBOOK,s,l,u,i,r)}}handleRename(e,t){var r=this.props.glEventHub;Xt.debug("handleRename",e,t),r.emit(Fe.RENAME_FILE,e,t)}handleSessionOpened(e){var t=e.session,r=e.language;this.setState({session:t,language:r})}handleSessionClosed(){this.setState({session:void 0,language:void 0})}handleShow(){this.setState({isShown:!0})}isHidden(){var e=this.props.glContainer,t=e.isHidden;return t}render(){var e=this.props,t=e.fileStorage,r=e.glContainer,i=e.glEventHub,o=this.state,a=o.isShown,s=o.showCreateFolder,l=o.focusedFilePath;return c.jsxs(Hr,{className:"file-explorer-panel",componentPanel:this,glContainer:r,glEventHub:i,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,onShow:this.handleShow,children:[c.jsx(fS,{createFile:this.handleCreateFile,createFolder:this.handleCreateDirectory}),a&&c.jsx(eo,{isMultiSelect:!0,storage:t,onCopy:this.handleCopyFile,onCreateFile:this.handleCreateFile,onCreateFolder:this.handleCreateDirectory,onDelete:this.handleDelete,onRename:this.handleRename,onSelect:this.handleFileSelect,onSelectionChange:this.handleSelectionChange}),c.jsx(Pn,{isOpen:s,type:"directory",title:"Create New Folder",storage:t,onSubmit:this.handleCreateDirectorySubmit,onCancel:this.handleCreateDirectoryCancel,defaultValue:l})]})}}ju(Dn,"COMPONENT","FileExplorerPanel");ju(Dn,"TITLE","File Explorer");var n_=SS(Dn);function Wn(n,e,t){return(e=_S(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _S(n){var e=wS(n,"string");return typeof e=="symbol"?e:e+""}function wS(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ks=B.module("LogPanel");class Kr extends m.PureComponent{constructor(e){super(e),Wn(this,"isBottomVisible",void 0),Wn(this,"logView",void 0),this.handleResize=this.handleResize.bind(this),this.handleShow=this.handleShow.bind(this),this.handleHide=this.handleHide.bind(this),this.handleSessionOpened=this.handleSessionOpened.bind(this),this.handleSessionClosed=this.handleSessionClosed.bind(this),this.isBottomVisible=!0,this.logView=null;var t=this.props.session;this.state={session:t}}handleResize(){this.updateDimensions()}handleShow(){this.updateDimensions(),this.logView&&(this.logView.triggerFindWidget(),this.isBottomVisible&&this.logView.scrollToBottom())}handleHide(){this.logView&&(this.isBottomVisible=this.logView.isBottomVisible())}handleSessionOpened(e){var t=e.session;ks.debug("Session opened",[t]),this.setState({session:t})}handleSessionClosed(e){ks.debug("Session closed",e)}updateDimensions(){this.logView&&this.logView.updateDimensions()}render(){var e=this.props,t=e.glContainer,r=e.glEventHub,i=this.state.session;return c.jsxs(Hr,{componentPanel:this,glContainer:t,glEventHub:r,onResize:this.handleResize,onHide:this.handleHide,onShow:this.handleShow,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,children:[i==null&&c.jsx("div",{className:"log-panel-disconnected-message",children:"Waiting for session connection"}),i!=null&&c.jsx(ve,{session:i,ref:o=>{this.logView=o}})]})}}Wn(Kr,"defaultProps",{session:null});Wn(Kr,"COMPONENT","LogPanel");Wn(Kr,"TITLE","Log");var ES=(n,e)=>{var t;return{session:(t=Br(n,e.localDashboardId))===null||t===void 0?void 0:t.session}},r_=Vn(ES,null,null,{forwardRef:!0})(Kr);export{mh as $,ue as A,Qe as B,ge as C,cl as D,Hd as E,He as F,kr as G,ll as H,ct as I,ne as J,E as K,fl as L,P as M,hl as N,de as O,Ar as P,Nr as Q,lt as R,fe as S,al as T,yn as U,mi as V,Hc as W,bl as X,Lr as Y,ul as Z,Sl as _,NC as a,cv as a$,Di as a0,kS as a1,pm as a2,Mi as a3,NS as a4,pl as a5,Cl as a6,ml as a7,Uc as a8,kh as a9,ou as aA,fv as aB,ee as aC,Ki as aD,nu as aE,cu as aF,Hv as aG,su as aH,fr as aI,ru as aJ,bg as aK,gg as aL,mC as aM,gC as aN,fC as aO,yC as aP,ga as aQ,TC as aR,De as aS,OC as aT,uu as aU,iu as aV,LC as aW,kC as aX,lv as aY,dv as aZ,uv as a_,wr as aa,Cm as ab,Et as ac,Ge as ad,Tt as ae,K as af,Ye as ag,El as ah,wl as ai,_l as aj,LS as ak,RS as al,$S as am,eC as an,T as ao,dC as ap,IC as aq,Dg as ar,vg as as,fg as at,AC as au,Jr as av,hu as aw,DC as ax,CC as ay,_C as az,Pv as b,Zy as b$,cC as b0,uC as b1,_v as b2,du as b3,xv as b4,wC as b5,EC as b6,PC as b7,RC as b8,pC as b9,pp as bA,mp as bB,Al as bC,gi as bD,vp as bE,Ml as bF,Dl as bG,vi as bH,Xn as bI,na as bJ,JS as bK,oC as bL,ra as bM,MS as bN,lo as bO,Ug as bP,Zi as bQ,FC as bR,Gg as bS,Zg as bT,Te as bU,Vb as bV,R as bW,Ut as bX,bu as bY,Le as bZ,xr as b_,bC as ba,vC as bb,SC as bc,MC as bd,$C as be,mn as bf,hC as bg,Zv as bh,Np as bi,tC as bj,Wt as bk,xl as bl,sC as bm,Mp as bn,nC as bo,rC as bp,iC as bq,Dp as br,Ap as bs,kp as bt,aC as bu,gp as bv,fp as bw,jl as bx,hp as by,cp as bz,mm as c,ot as c$,Du as c0,yu as c1,cb as c2,wu as c3,tb as c4,On as c5,Su as c6,In as c7,My as c8,Or as c9,Zm as cA,Xm as cB,qm as cC,dp as cD,nl as cE,OS as cF,el as cG,Hr as cH,XC as cI,mt as cJ,vt as cK,YS as cL,GC as cM,BS as cN,ZC as cO,VC as cP,qC as cQ,jr as cR,FS as cS,KC as cT,HS as cU,zC as cV,qS as cW,Um as cX,US as cY,Br as cZ,Fe as c_,l0 as ca,ve as cb,Pi as cc,gu as cd,En as ce,Ai as cf,$ as cg,Qi as ch,t_ as ci,Ri as cj,av as ck,jC as cl,tp as cm,e_ as cn,r_ as co,JC as cp,n_ as cq,yc as cr,xS as cs,Vm as ct,zm as cu,zS as cv,WS as cw,KS as cx,VS as cy,Gm as cz,ZS as d,Pn as d0,dt as d1,Wm as d2,Ne as d3,BC as d4,HC as d5,QC as d6,YC as d7,v0 as d8,f0 as d9,WC as da,UC as db,AS as dc,gt as dd,DS as de,Zr as df,Gd as dg,Hn as dh,sv as e,QS as f,Tm as g,GS as h,Il as i,XS as j,jS as k,Ic as l,Zn as m,Fc as n,xc as o,il as p,rl as q,le as r,xC as s,Dc as t,Pm as u,Mc as v,sl as w,Ys as x,ol as y,IS as z};
|
|
46
|
-
//# sourceMappingURL=LogPanel-
|
|
46
|
+
//# sourceMappingURL=LogPanel-Cs3EDdyn.js.map
|