@harperfast/harper 5.2.5 → 5.2.6

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.
Files changed (58) hide show
  1. package/bin/restart.ts +48 -23
  2. package/bin/restartExitWatchdog.ts +99 -0
  3. package/bin/run.ts +16 -10
  4. package/dist/bin/restart.js +39 -21
  5. package/dist/bin/restart.js.map +1 -1
  6. package/dist/bin/restartExitWatchdog.d.ts +5 -0
  7. package/dist/bin/restartExitWatchdog.js +100 -0
  8. package/dist/bin/restartExitWatchdog.js.map +1 -0
  9. package/dist/bin/run.d.ts +2 -0
  10. package/dist/bin/run.js +17 -10
  11. package/dist/bin/run.js.map +1 -1
  12. package/dist/resources/DatabaseTransaction.d.ts +18 -1
  13. package/dist/resources/DatabaseTransaction.js +63 -1
  14. package/dist/resources/DatabaseTransaction.js.map +1 -1
  15. package/dist/resources/LMDBTransaction.d.ts +2 -0
  16. package/dist/resources/LMDBTransaction.js +7 -1
  17. package/dist/resources/LMDBTransaction.js.map +1 -1
  18. package/dist/resources/Resource.js +5 -4
  19. package/dist/resources/Resource.js.map +1 -1
  20. package/dist/resources/ResourceInterface.d.ts +5 -0
  21. package/dist/resources/ResourceInterface.js.map +1 -1
  22. package/dist/resources/Table.js +53 -9
  23. package/dist/resources/Table.js.map +1 -1
  24. package/dist/resources/transaction.js +1 -1
  25. package/dist/resources/transaction.js.map +1 -1
  26. package/dist/server/threads/manageThreads.d.ts +1 -0
  27. package/dist/server/threads/manageThreads.js +20 -3
  28. package/dist/server/threads/manageThreads.js.map +1 -1
  29. package/dist/utility/processManagement/processManagement.js +21 -3
  30. package/dist/utility/processManagement/processManagement.js.map +1 -1
  31. package/npm-shrinkwrap.json +2 -2
  32. package/package.json +1 -1
  33. package/resources/DESIGN.md +19 -19
  34. package/resources/DatabaseTransaction.ts +63 -2
  35. package/resources/LMDBTransaction.ts +7 -1
  36. package/resources/Resource.ts +6 -5
  37. package/resources/ResourceInterface.ts +5 -0
  38. package/resources/Table.ts +57 -8
  39. package/resources/transaction.ts +2 -2
  40. package/server/DESIGN.md +6 -0
  41. package/server/threads/manageThreads.js +17 -3
  42. package/studio/web/assets/{Chat-Lgj1d-8d.js → Chat-BNHY84-Z.js} +1 -1
  43. package/studio/web/assets/{FloatingChat-jLWvR4kI.js → FloatingChat-BbztUci0.js} +3 -3
  44. package/studio/web/assets/{apiToken-DYI4DqWa.js → apiToken-D0x_S8Wq.js} +1 -1
  45. package/studio/web/assets/{applications-DCmc9-lk.js → applications-BU83fSEG.js} +1 -1
  46. package/studio/web/assets/{index-CqbCnqsT.js → index-BQB9R8Ug.js} +4 -4
  47. package/studio/web/assets/{index.lazy-BNqr3j0f.js → index.lazy-CtErm5q7.js} +3 -3
  48. package/studio/web/assets/{notifications-Bb2cj14_.js → notifications-B8rDagJM.js} +1 -1
  49. package/studio/web/assets/{notifications-DVlKonbI.js → notifications-CPwYKDDH.js} +1 -1
  50. package/studio/web/assets/{profile-BSQWfYfq.js → profile-D0hB1xdm.js} +1 -1
  51. package/studio/web/assets/{regions-Dk3g8bBF.js → regions-y_jxsBpN.js} +1 -1
  52. package/studio/web/assets/{setComponentFile-DoITgNLb.js → setComponentFile-DSHbURTI.js} +1 -1
  53. package/studio/web/assets/{setup-CiEALLa7.js → setup-J5SrM1Kp.js} +1 -1
  54. package/studio/web/assets/{status-CK9tD-Nd.js → status-IoJkDzlx.js} +1 -1
  55. package/studio/web/assets/{swagger-ui-react-CxjCDFB-.js → swagger-ui-react-BlgSS25O.js} +1 -1
  56. package/studio/web/assets/{useEntityRestURL-Cy-0i1UZ.js → useEntityRestURL-qfahJnvr.js} +1 -1
  57. package/studio/web/index.html +1 -1
  58. package/utility/processManagement/processManagement.js +19 -3
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-Bbo24DGo.js","assets/vendor-datadog-XDrpA25D.js","assets/rolldown-runtime-B0Z9INg1.js","assets/chunk-Y2CYZVJY-DsF7k-Jl.js","assets/src-DUvBCJIr.js","assets/string-f6JzSHaO.js","assets/chunk-I66GZJ75-DHPYnKNr.js","assets/purify.es-DrVcFY1Q.js","assets/isArrayLikeObject-BHDnhloL.js","assets/chunk-NSK5VX7P-DDFNzCU_.js","assets/math-Bi_r_ZWc.js","assets/dist-CeoU7cfW.js","assets/chunk-3NCLNEKW-BVj72ixc.js","assets/chunk-4I5QYGJK-D1FhvtQq.js","assets/chunk-WRU74C26-Dg10j8Pf.js","assets/chunk-7BUUIJ7U-Bb538aSH.js","assets/chunk-UBXNYLIW-rn0yw1mp.js","assets/chunk-W5SLKNZC-DKMlAWZk.js","assets/chunk-QR6OTTB3-Df7OCENk.js","assets/rough.esm-Dy-Kn_BL.js","assets/chunk-7Z6QIM7H-BJhESwQK.js","assets/line-Bom3IjHi.js","assets/path-fybaL0A-.js","assets/array-BifhSqXX.js","assets/chunk-J7OUQ5F2-DcY_kb6i.js","assets/chunk-ZIRB5QZD-O39ZBUk3.js"])))=>i.map(i=>d[i]);
2
- import{a as e,r as t,t as n}from"./rolldown-runtime-B0Z9INg1.js";import{d as r,f as i,g as a,h as o,n as s,t as c}from"./authStore-B3IhXrn6.js";import{E as l,_ as u,c as d,n as f,p,t as m,u as h,y as g}from"./vendor-core-CddkYGh5.js";import{n as _,r as v,t as y}from"./button-DfBmT4rc.js";import{D as b,E as x,H as S,I as C,O as w,T,k as E,w as D,z as O}from"./vendor-tanstack-FsM5XZNE.js";import{a as k,i as ee}from"./vendor-datadog-XDrpA25D.js";import{r as te}from"./vendor-react-BhazFIp8.js";import{r as A}from"./useAuth-DiJUZS1C.js";import{$ as j,Rt as M,it as N}from"./vendor-ui-BLIveqaL.js";import{a as P,i as ne,n as F,r as re,t as ie}from"./card-ByrPS_wa.js";import{t as I}from"./createLucideIcon-BMkDbMrz.js";import{c as L,d as ae,f as oe,i as se,l as ce,n as le,o as ue,p as de,s as fe,t as pe,u as me}from"./select-CKgJgpkn.js";import{a as he,n as ge}from"./getRegistrationInfo--NLLrics.js";import{c as _e}from"./table-BvFflPWi.js";import{i as ve,r as ye,t as be}from"./x-D39AGKMb.js";import{t as xe}from"./chevron-right-CY-tr2sG.js";import{a as Se,i as Ce,n as we,r as Te,t as Ee}from"./tabs-Dd_ElZ36.js";import{c as De,d as Oe,f as ke,g as Ae,h as je,i as Me,l as Ne,m as Pe,n as Fe,o as Ie,r as Le,t as Re}from"./setComponentFile-DoITgNLb.js";import{n as ze}from"./queryClient-BLhQvmWC.js";import{n as Be}from"./setLocalStorage-CD_L8p_D.js";import{t as Ve}from"./useLocalStorage-DetQlhBe.js";import{o as He,r as Ue,s as We}from"./pollUnlessForbidden-DIDXGBc5.js";import{$ as Ge,$n as Ke,$t as qe,A as Je,An as Ye,At as Xe,C as Ze,Ct as Qe,D as $e,E as et,F as tt,Fn as nt,Ft as rt,G as R,Gn as it,Gt as at,Hn as ot,Ht as st,I as ct,In as lt,Jn as ut,Jt as dt,K as ft,Kt as pt,L as mt,Ln as ht,Lt as gt,M as _t,Mn as vt,Mt as yt,N as bt,Nn as xt,Nt as St,O as Ct,On as wt,P as Tt,Pn as Et,Pt as Dt,Q as Ot,Qn as kt,Qt as At,R as jt,Rn as Mt,Rt as Nt,S as Pt,St as Ft,T as It,Tt as Lt,U as Rt,Un as zt,Vt as Bt,W as Vt,Wt as Ht,X as Ut,Xn as Wt,Xt as Gt,Yn as Kt,Yt as qt,Z as Jt,Zn as Yt,Zt as Xt,_ as Zt,an as Qt,ar as $t,at as en,b as tn,bt as nn,cn as rn,cr as an,dt as on,en as sn,er as cn,et as ln,g as un,gt as dn,h as fn,hn as pn,ht as mn,in as hn,it as gn,j as _n,k as vn,l as yn,ln as bn,lr as xn,m as Sn,mn as Cn,mt as wn,nr as Tn,nt as En,on as Dn,ot as On,p as kn,pn as An,pt as jn,q as Mn,qn as Nn,qt as Pn,rn as Fn,rt as In,sn as Ln,sr as Rn,st as z,tn as zn,tr as Bn,tt as Vn,u as Hn,un as Un,ur as Wn,ut as Gn,v as Kn,vt as qn,w as Jn,wt as Yn,x as Xn,xt as Zn,y as Qn,yt as $n,z as er,zn as tr,zt as nr}from"./index-CqbCnqsT.js";import{f as rr,i as ir,p as ar,r as or}from"./editor.api-eUd8PqEu.js";import{t as sr}from"./register-3F1Tje_F.js";import{a as cr,c as lr,i as ur,n as dr,o as fr,r as pr,s as mr,t as hr}from"./alertDialog-BaBrZQ4M.js";import{t as gr}from"./useEntityRestURL-Cy-0i1UZ.js";import"./languageServices-Bl-BvoAb.js";import"./editor-BDfNodZS.js";var _r=I(`arrow-down-a-z`,[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M20 8h-5`,key:`1vsyxs`}],[`path`,{d:`M15 10V6.5a2.5 2.5 0 0 1 5 0V10`,key:`ag13bf`}],[`path`,{d:`M15 14h5l-5 6h5`,key:`ur5jdg`}]]),vr=I(`arrow-up-a-z`,[[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}],[`path`,{d:`M20 8h-5`,key:`1vsyxs`}],[`path`,{d:`M15 10V6.5a2.5 2.5 0 0 1 5 0V10`,key:`ag13bf`}],[`path`,{d:`M15 14h5l-5 6h5`,key:`ur5jdg`}]]),yr=I(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),br=I(`case-lower`,[[`path`,{d:`M10 9v7`,key:`ylp826`}],[`path`,{d:`M14 6v10`,key:`1jy4vg`}],[`circle`,{cx:`17.5`,cy:`12.5`,r:`3.5`,key:`1a9481`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`3.5`,key:`2jlv1r`}]]),xr=I(`case-sensitive`,[[`path`,{d:`m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16`,key:`d5nyq2`}],[`path`,{d:`M22 9v7`,key:`pvm9v3`}],[`path`,{d:`M3.304 13h6.392`,key:`1q3zxz`}],[`circle`,{cx:`18.5`,cy:`12.5`,r:`3.5`,key:`z97x68`}]]),Sr=I(`case-upper`,[[`path`,{d:`M15 11h4.5a1 1 0 0 1 0 5h-4a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h3a1 1 0 0 1 0 5`,key:`nxs35`}],[`path`,{d:`m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16`,key:`d5nyq2`}],[`path`,{d:`M3.304 13h6.392`,key:`1q3zxz`}]]),Cr=I(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),wr=I(`command`,[[`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`,key:`11bfej`}]]),Tr=I(`eraser`,[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]),Er=I(`file-archive`,[[`path`,{d:`M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]),Dr=I(`file-braces`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]]),Or=I(`file-code-corner`,[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]]),kr=I(`file-image`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),Ar=I(`file-key`,[[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M4 12v6`,key:`bg1pfk`}],[`path`,{d:`M4 14h2`,key:`1sf9f8`}],[`path`,{d:`M9.65 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v4`,key:`d56i0q`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),jr=I(`file-plus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),Mr=I(`file-type`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M11 18h2`,key:`12mj7e`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5`,key:`qbrxap`}]]),Nr=I(`fold-vertical`,[[`path`,{d:`M12 22v-6`,key:`6o8u61`}],[`path`,{d:`M12 8V2`,key:`1wkif3`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`m15 19-3-3-3 3`,key:`e37ymu`}],[`path`,{d:`m15 5-3 3-3-3`,key:`19d6lf`}]]),Pr=I(`folder-input`,[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),Fr=I(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Ir=I(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Lr=I(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Rr=I(`git-merge`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]),zr=I(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Br=I(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),Vr=I(`link`,[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]),Hr=I(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),Ur=I(`list-tree`,[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]),Wr=I(`message-square-text`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]),Gr=I(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),Kr=I(`mouse-pointer-click`,[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]),qr=I(`package-open`,[[`path`,{d:`M12 22v-9`,key:`x3hkom`}],[`path`,{d:`M15.17 2.21a1.67 1.67 0 0 1 1.63 0L21 4.57a1.93 1.93 0 0 1 0 3.36L8.82 14.79a1.655 1.655 0 0 1-1.64 0L3 12.43a1.93 1.93 0 0 1 0-3.36z`,key:`2ntwy6`}],[`path`,{d:`M20 13v3.87a2.06 2.06 0 0 1-1.11 1.83l-6 3.08a1.93 1.93 0 0 1-1.78 0l-6-3.08A2.06 2.06 0 0 1 4 16.87V13`,key:`1pmm1c`}],[`path`,{d:`M21 12.43a1.93 1.93 0 0 0 0-3.36L8.83 2.2a1.64 1.64 0 0 0-1.63 0L3 4.57a1.93 1.93 0 0 0 0 3.36l12.18 6.86a1.636 1.636 0 0 0 1.63 0z`,key:`12ttoo`}]]),Jr=I(`panel-right-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]),Yr=I(`panel-right-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),Xr=I(`panel-top`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]),Zr=I(`replace`,[[`path`,{d:`M14 4a1 1 0 0 1 1-1`,key:`dhj8ez`}],[`path`,{d:`M15 10a1 1 0 0 1-1-1`,key:`1mnyi5`}],[`path`,{d:`M21 4a1 1 0 0 0-1-1`,key:`sfs9ap`}],[`path`,{d:`M21 9a1 1 0 0 1-1 1`,key:`mp6qeo`}],[`path`,{d:`m3 7 3 3 3-3`,key:`x25e72`}],[`path`,{d:`M6 10V5a2 2 0 0 1 2-2h2`,key:`15xut4`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}]]),Qr=I(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),$r=I(`text-cursor-input`,[[`path`,{d:`M12 20h-1a2 2 0 0 1-2-2 2 2 0 0 1-2 2H6`,key:`1528k5`}],[`path`,{d:`M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7`,key:`13ksps`}],[`path`,{d:`M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1`,key:`1n9rhb`}],[`path`,{d:`M6 4h1a2 2 0 0 1 2 2 2 2 0 0 1 2-2h1`,key:`1mj8rg`}],[`path`,{d:`M9 6v12`,key:`velyjx`}]]),ei=I(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),ti=I(`unfold-vertical`,[[`path`,{d:`M12 22v-6`,key:`6o8u61`}],[`path`,{d:`M12 8V2`,key:`1wkif3`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`m15 19-3 3-3-3`,key:`11eu04`}],[`path`,{d:`m15 5-3-3-3 3`,key:`itvq4r`}]]),B=e(k(),1);function ni(e,t=!1){let[n,r]=Xe(e,t),i=(0,B.useCallback)(e=>{e?.preventDefault?.(),r(e=>!e)},[r]),a=(0,B.useCallback)(e=>{e?.preventDefault?.(),r(!0)},[r]),o=(0,B.useCallback)(e=>{e?.preventDefault?.(),r(!1)},[r]);return(0,B.useMemo)(()=>({toggled:n,setToggled:r,toggle:i,toggleOn:a,toggleOff:o}),[i,r,o,a,n])}var ri=(0,B.createContext)(null);function V(){return(0,B.useContext)(ri)}var H=te();function ii(){let{reloadRootEntries:e,setFocusedItem:t,setSelectedItems:n}=V(),r=He();return(0,B.useCallback)(async a=>{let o=!1,s=a.filter(e=>e.from!==e.to);if(s.length===0)return!0;let c=`Renaming ${i(s.length,`File`,`Files`)}`,l={duration:6e4,action:{label:`Cancel`,onClick:()=>{o=!0}}};l.id=M.loading(c,{...l,description:(0,H.jsx)(ge,{animated:!0,width:`0%`})});let u=s.length*3,d=0;function f(){d+=1,M.loading(c,{...l,description:(0,H.jsx)(ge,{animated:!0,width:(d===0?0:d/u*100)+`%`})})}try{for(let e of s){let t=e.from.split(`/`),n=t.shift(),i=t.join(`/`),a=e.to.split(`/`),s=a.shift(),c=a.join(`/`),l=await Sn({...r,file:i,project:n,encoding:`base64`});if(o||(f(),await Re({...r,file:c,project:s,encoding:`base64`,payload:l.message}),o)||(f(),await De({...r,file:i,project:n}),o))break;f()}}catch(t){return M.error(`Rename Failed`,{id:l.id,description:t instanceof Error?t.message:`An unexpected error occurred while renaming.`,duration:1e4,action:{label:`OK`,onClick:()=>void 0}}),e(),!1}return d>=u?M.success(`Renamed ${i(s.length,`File`,`Files`)}`,{id:l.id,description:`All done!`,duration:3e3,action:{label:`OK`,onClick:()=>{}}}):M.warning(`Rename Cancelled`,{id:l.id,description:`${d} of ${u} steps completed.`,duration:1e4,action:{label:`OK`,onClick:()=>{}}}),e(),n(e=>{let t=e.slice();for(let e of s){let n=t.indexOf(e.from);n>=0?t.splice(n,1,e.to):t.push(e.to)}return t}),t(e=>{for(let t of s)if(e===t.from)return t.to;return e}),d>=u},[r,e,t,n])}var ai;function oi(e){ai=e}function si(e){return e.files.length>0||e.directories.length>0?ai?new Promise(t=>ai(e,t)):Promise.resolve(!1):Promise.resolve(!0)}function ci(e,t){return e[t]!==void 0}function li(e){return t=>ci(t,e)}var ui={handleGlobal(e,t){if((t.cmd||t.ctrl)&&e===`Delete`)return R(`ShowDeleteDirectoryOrFileModal`,!0),!0},addEditorAction(e){return{id:`delete-file`,label:`Delete File`,keybindings:[e.KeyMod.CtrlCmd|e.KeyCode.Delete],run:Vt(`ShowDeleteDirectoryOrFileModal`,!0)}}},di={handleGlobal(e,t){if(t.ctrl&&t.alt&&t.shift&&e===`˜`)return R(`ShowAddDirectoryOrFileModalType`,`directory`),!0},addEditorAction(e){return{id:`new-directory`,label:`New Directory`,keybindings:[e.KeyMod.WinCtrl|e.KeyMod.Alt|e.KeyMod.Shift|e.KeyCode.KeyN],run:Vt(`ShowAddDirectoryOrFileModalType`,`directory`)}}},fi={handleGlobal(e,t){if(t.ctrl&&e===`n`)return R(`ShowAddDirectoryOrFileModalType`,`file`),!0},addEditorAction(e){return{id:`new-file`,label:`New File`,keybindings:[e.KeyMod.WinCtrl|e.KeyCode.KeyN],run:Vt(`ShowAddDirectoryOrFileModalType`,`file`)}}},pi;function mi(e){pi=e}function hi(){pi?.()}var gi=[ui,di,fi,{handleGlobal(e){if(e===`F2`)return R(`ShowRenameFileModal`,`file`),!0},addEditorAction(e){return{id:`rename-file`,label:`Rename File`,keybindings:[e.KeyMod.WinCtrl|e.KeyMod.Alt|e.KeyCode.KeyR,e.KeyCode.F2],run:Vt(`ShowRenameFileModal`,!0)}}},{addEditorAction(){return{id:`revert-file`,label:`Revert File`,run:yt(`RevertChanges`,!0)}}},{handleGlobal(e,t){if(t.cmd&&e===`s`)return St(`SaveFile`,!0),!0},addEditorAction(e){return{id:`save-file`,label:`Save Changes`,keybindings:[e.KeyMod.CtrlCmd|e.KeyCode.KeyS],run:yt(`SaveFile`,!0)}}}],_i=gi.filter(li(`addEditorAction`)),vi=gi.filter(li(`handleGlobal`));function yi(e){let[t,n]=e,r=_i.map(e=>t.addAction(e.addEditorAction(n)));return()=>{for(let e of r)e?.dispose()}}function bi(){(0,B.useEffect)(()=>(document.addEventListener(`keydown`,xi),()=>{document.removeEventListener(`keydown`,xi)}),[])}function xi(e){let t={cmd:e.getModifierState(`Meta`),alt:e.getModifierState(`Alt`),shift:e.getModifierState(`Shift`),ctrl:e.getModifierState(`Control`)};for(let n of vi)if(n.handleGlobal(e.key,t)){hi(),e.preventDefault();return}}function Si(e){return e.split(`/`).pop()}function Ci(){let[e,t]=(0,B.useState)(!1),[n,r]=(0,B.useState)(void 0),i=(0,B.useCallback)(e=>{if(!e.dataTransfer?.types?.includes(`Files`))return;let n=e.target instanceof Element?e.target:null,i=n?.closest(`.rct-tree-item-button-isFolder`)??n?.closest(`.rct-tree-item-title-container`)?.querySelector(`:scope > .rct-tree-item-button-isFolder`)??null;if(i){let e=i.getAttribute(`data-rct-item-id`);!i.querySelector(`.packageIsLocked`)&&e&&e!==`importedApplications`&&e!==`newApplication`&&r(e=>e===i?e:(e?.classList?.remove?.(`rct-tree-item-title-container-dragging-over`),i.classList.add(`rct-tree-item-title-container-dragging-over`),i))}t(!0)},[]),a=(0,B.useCallback)(()=>{t(!1),r(e=>{e&&e.classList.remove(`rct-tree-item-title-container-dragging-over`)})},[]),o=(0,B.useCallback)(e=>{if(!e.dataTransfer?.types?.includes(`Files`)||e.detail===1337)return;t(!1),n&&(n.classList.remove(`rct-tree-item-title-container-dragging-over`),r(void 0));let i=document.getElementById(`dropTarget`);return i?i.dispatchEvent(new DragEvent(`drop`,{bubbles:!0,detail:1337,cancelable:!0,dataTransfer:e.dataTransfer})):!1},[n]);return(0,B.useEffect)(()=>(document.addEventListener(`dragenter`,i),document.addEventListener(`dragover`,i),document.addEventListener(`dragleave`,a),document.addEventListener(`drop`,o),()=>{document.removeEventListener(`dragenter`,i),document.removeEventListener(`dragover`,i),document.removeEventListener(`dragleave`,a),document.removeEventListener(`drop`,o)}),[i,o,a]),(0,B.useMemo)(()=>({dragging:e,dragTarget:n}),[e,n])}function wi(e){return new Promise((t,n)=>{let r=new FileReader;r.onabort=n,r.onerror=n,r.onload=t,r.readAsDataURL(e)})}var Ti=new Map([[`avif`,`image/avif`],[`bmp`,`image/bmp`],[`css`,`text/css`],[`csv`,`text/csv`],[`doc`,`application/msword`],[`docx`,`application/vnd.openxmlformats-officedocument.wordprocessingml.document`],[`gif`,`image/gif`],[`gz`,`application/gzip`],[`htm`,`text/html`],[`html`,`text/html`],[`ico`,`image/x-icon`],[`jpeg`,`image/jpeg`],[`jpg`,`image/jpeg`],[`js`,`application/javascript`],[`json`,`application/json`],[`md`,`text/markdown`],[`mjs`,`application/javascript`],[`mp3`,`audio/mpeg`],[`mp4`,`video/mp4`],[`ogg`,`audio/ogg`],[`pdf`,`application/pdf`],[`png`,`image/png`],[`ppt`,`application/powerpoint`],[`pptx`,`application/vnd.openxmlformats-officedocument.presentationml.presentation`],[`svg`,`image/svg+xml`],[`tif`,`image/tiff`],[`tiff`,`image/tiff`],[`txt`,`text/plain`],[`wasm`,`application/wasm`],[`wav`,`audio/x-wav`],[`weba`,`audio/webm`],[`webm`,`video/webm`],[`webp`,`image/webp`],[`xls`,`application/vnd.ms-excel`],[`xlsx`,`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`],[`xml`,`application/xml`],[`zip`,`application/zip`]]),Ei=class extends Error{constructor(e){super(`DataTransferItem is not a file`),this.item=e,this.name=`UnexpectedObjectError`}};function Di(e,t,n){let r=e,{webkitRelativePath:i}=e,a=typeof t==`string`?t:typeof i==`string`&&i.length>0?i:`./${e.name}`;return typeof r.path!=`string`&&ki(r,`path`,a),n!==void 0&&Object.defineProperty(r,"handle",{value:n,writable:!1,configurable:!1,enumerable:!0}),ki(r,`relativePath`,a),r}function Oi(e,t=Ti){let{name:n}=e;if(n&&n.lastIndexOf(`.`)!==-1&&!e.type){let r=n.split(`.`).pop().toLowerCase(),i=t.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function ki(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}var Ai=[`.DS_Store`,`Thumbs.db`];async function ji(e,{mimeTypes:t=Ti}={}){return(await Mi(e)).map(e=>e instanceof File?Oi(e,t):e)}async function Mi(e){return Ii(e)&&Ni(e.dataTransfer)?zi(e.dataTransfer,e.type):Pi(e)?Bi(e.clipboardData):Fi(e)?Li(e):Array.isArray(e)&&e.every(e=>`getFile`in e&&typeof e.getFile==`function`)?Ri(e):[]}function Ni(e){return Ii(e)}function Pi(e){return Ii(e)&&Ni(e.clipboardData)}function Fi(e){return Ii(e)&&Ii(e.target)}function Ii(e){return typeof e==`object`&&!!e}function Li(e){return Hi(e.target.files).map(e=>Di(e))}async function Ri(e){return(await Promise.all(e.map(e=>e.getFile()))).map(e=>Di(e))}async function zi(e,t){let n=Hi(e.items).filter(e=>e.kind===`file`);return t===`drop`?Vi(Wi(await Promise.all(n.map(Ui)))):n}function Bi(e){let t=Hi(e.items).filter(e=>e.kind===`file`).map(e=>e.getAsFile()).filter(e=>e!==null);return Vi((t.length>0?t:Hi(e.files)).map(e=>Di(e)))}function Vi(e){return e.filter(e=>Ai.indexOf(e.name)===-1)}function Hi(e){return e===null?[]:Array.from(e)}async function Ui(e){if(typeof e.webkitGetAsEntry!=`function`)return Gi(e);let t=e.webkitGetAsEntry();if(t?.isDirectory){let n=await Ki(e);return n?.kind===`directory`?qi(n,`/${n.name}`):Yi(t)}return Gi(e,t)}function Wi(e){let t=[];for(let n of e)Array.isArray(n)?t.push(...Wi(n)):t.push(n);return t}async function Gi(e,t){let n=e.getAsFile(),r=await Ki(e);if(r!=null){let e=n??await r.getFile();return e.handle=r,Di(e)}if(!n)throw new Ei(e);return Di(n,t?.fullPath??void 0)}async function Ki(e){if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle==`function`)return e.getAsFileSystemHandle()}async function qi(e,t){let n=[];for await(let r of e.values()){let e=`${t}/${r.name}`;if(r.kind===`directory`)n.push(...await qi(r,e));else{let t=await r.getFile();n.push(Di(t,e,r))}}return n}async function Ji(e){return e.isDirectory?Yi(e):Xi(e)}function Yi(e){let t=e.createReader();return new Promise((e,n)=>{let r=[];function i(){t.readEntries(async t=>{if(t.length){let e=Promise.all(t.map(Ji));r.push(e),i()}else try{e(await Promise.all(r))}catch(e){n(e)}},e=>{n(e)})}i()})}async function Xi(e){return new Promise((t,n)=>{e.file(n=>{t(Di(n,e.fullPath))},e=>{n(e)})})}var Zi=e(n((e=>{e.__esModule=!0,e.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(`,`);if(n.length===0)return!0;var r=e.name||``,i=(e.type||``).toLowerCase(),a=i.replace(/\/.*$/,``);return n.some(function(e){var t=e.trim().toLowerCase();return t.charAt(0)===`.`?r.toLowerCase().endsWith(t):t.endsWith(`/*`)?a===t.replace(/\/.*$/,``):i===t})}return!0}}))(),1),Qi=typeof Zi.default==`function`?Zi.default:Zi.default.default,$i=`file-invalid-type`,ea=`file-too-large`,ta=`file-too-small`,na=`too-many-files`;function ra(e=``){let t=e.split(`,`);return{code:$i,message:`File type must be ${t.length>1?`one of ${t.join(`, `)}`:t[0]}`}}var ia=[`KB`,`MB`,`GB`,`TB`,`PB`];function aa(e){if(e<1024)return`${e} ${e===1?`byte`:`bytes`}`;let t=e/1024,n=0;for(;t>=1024&&n<ia.length-1;)t/=1024,n++;return`${Number(t.toFixed(2))} ${ia[n]}`}function oa(e){return{code:ea,message:`File is larger than ${aa(e)}`}}function sa(e){return{code:ta,message:`File is smaller than ${aa(e)}`}}var ca={code:na,message:`Too many files`};function la(e){return e.type===``&&typeof e.getAsFile==`function`}function ua(e,t){let n=e.type===`application/x-moz-file`||Qi(e,t??``)||la(e);return[n,n?null:ra(t)]}function da(e,t,n){if(fa(e.size)){if(fa(t)&&fa(n)){if(e.size>n)return[!1,oa(n)];if(e.size<t)return[!1,sa(t)]}else if(fa(t)&&e.size<t)return[!1,sa(t)];else if(fa(n)&&e.size>n)return[!1,oa(n)]}return[!0,null]}function fa(e){return e!=null}function pa(e){return e!=null&&typeof e.then==`function`}function ma({files:e,accept:t,minSize:n,maxSize:r,multiple:i,maxFiles:a=0,validator:o,getErrorMessage:s}){let c=[],l=[],u=(e,t)=>s&&typeof File<`u`&&t instanceof File?{...e,message:s(e,t)}:e;e.forEach(e=>{let[i,a]=ua(e,t),[o,s]=da(e,n,r);i&&o?c.push(e):l.push({file:e,errors:[a,s].filter(e=>e!=null).map(t=>u(t,e))})});let d=i?a>=1?a:1/0:1;return c.length>d&&c.slice(d).forEach(e=>{l.push({file:e,errors:[u(ca,e)]})}),l.length>0?{verdict:`reject`,rejections:l}:{verdict:o?`unknown`:`accept`,rejections:l}}function ha(e){return typeof e.isPropagationStopped==`function`?e.isPropagationStopped():e.cancelBubble!==void 0&&e.cancelBubble}function ga(e){let t=e.dataTransfer??e.clipboardData;return t?Array.prototype.some.call(t.types,e=>e===`Files`||e===`application/x-moz-file`)||Array.prototype.some.call(t.items??[],_a):!!e.target&&!!e.target.files}function _a(e){return typeof e==`object`&&!!e&&e.kind===`file`}function va(e){e.preventDefault()}function ya(e){return e.indexOf(`MSIE`)!==-1||e.indexOf(`Trident/`)!==-1}function ba(e){return e.indexOf(`Edge/`)!==-1}function xa(e=window.navigator.userAgent){return ya(e)||ba(e)}function Sa(...e){return(t,...n)=>e.some(e=>(!ha(t)&&e&&e(t,...n),ha(t)))}function Ca(){return`showOpenFilePicker`in window}function wa(e){return Array.isArray(e)?e:typeof e==`string`?[e]:[]}function Ta(e){if(fa(e))return Array.isArray(e)?e.filter(e=>fa(e)&&fa(e.accept)):[{accept:e}]}function Ea(e){let t=[],n=Object.keys(e);for(let n of Object.values(e))for(let e of wa(n))t.includes(e)||t.push(e);return t.length>0?t.join(`, `):n.length>0?n.join(`, `):`Files`}function Da(e){let t=Ta(e);if(!fa(t))return;let n={};for(let e of t)for(let[t,r]of Object.entries(e.accept)){let e=n[t]??(n[t]=[]);for(let t of wa(r))e.includes(t)||e.push(t)}return n}function Oa(e){let t=Ta(e);if(!fa(t))return;let n=t.map(e=>{let t=Object.entries(e.accept).filter(([e,t])=>{let n=!0;return Na(e)||(console.warn(`Skipped "${e}" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.`),n=!1),(!(Array.isArray(t)||typeof t==`string`)||!wa(t).every(Fa))&&(console.warn(`Skipped "${e}" because an invalid file extension was provided.`),n=!1),n}).reduce((e,[t,n])=>(e[t]=wa(n),e),{});return{description:fa(e.description)&&e.description!==``?e.description:Ea(t),accept:t}}).filter(e=>Object.keys(e.accept).length>0);return n.length>0?n:void 0}function ka(e,{omitWildcardMimeTypesWithExtensions:t=!1}={}){if(fa(e))return Object.entries(e).reduce((e,[n,r])=>{let i=wa(r);return t&&Pa(n)&&i.some(Fa)?e.push(...i):e.push(n,...i),e},[]).filter(e=>Na(e)||Fa(e)).join(`,`)}function Aa(e){return e instanceof DOMException&&(e.name===`AbortError`||e.code===e.ABORT_ERR)}function ja(e){return e instanceof DOMException&&(e.name===`SecurityError`||e.code===e.SECURITY_ERR)}function Ma(e){return e instanceof DOMException&&e.name===`NotAllowedError`}function Na(e){return e===`audio/*`||e===`video/*`||e===`image/*`||e===`text/*`||e===`application/*`||/\w+\/[-+.\w]+/g.test(e)}function Pa(e){return e.endsWith(`/*`)}function Fa(e){return/^.*\.[\w]+$/.test(e)}var Ia=(0,B.forwardRef)(({children:e,...t},n)=>{let{open:r,...i}=Ra(t);return(0,B.useImperativeHandle)(n,()=>({open:r}),[r]),(0,H.jsx)(H.Fragment,{children:e?.({...i,open:r})})});Ia.displayName=`Dropzone`;var La={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragUnknown:!1,isDragGlobal:!1,isProcessing:!1,acceptedFiles:[],fileRejections:[],dragFileRejections:[]};function Ra(e={}){let{accept:t,disabled:n=!1,getFilesFromEvent:r=ji,maxSize:i=1/0,minSize:a=0,multiple:o=!0,maxFiles:s=0,onDragEnter:c,onDragLeave:l,onDragOver:u,onDrop:d,onDropAccepted:f,onDropRejected:p,onFileDialogCancel:m,onFileDialogOpen:h,useFsAccessApi:g=!1,autoFocus:_=!1,preventDropOnDocument:v=!0,noClick:y=!1,noKeyboard:b=!1,noDrag:x=!1,noDragEventsBubbling:S=!1,noPaste:C=!1,onError:w,validator:T,getErrorMessage:E}=e,D=(0,B.useMemo)(()=>Da(t),[t]),O=(0,B.useMemo)(()=>ka(D),[D]),k=(0,B.useMemo)(()=>ka(D,{omitWildcardMimeTypesWithExtensions:!0}),[D]),ee=(0,B.useMemo)(()=>Oa(t),[t]),te=(0,B.useMemo)(()=>typeof h==`function`?h:Ba,[h]),A=(0,B.useMemo)(()=>typeof m==`function`?m:Ba,[m]),j=(0,B.useRef)(null),M=(0,B.useRef)(null),[N,P]=(0,B.useReducer)(za,La),{isFocused:ne,isFileDialogActive:F}=N,re=(0,B.useRef)(F);re.current=F;let ie=(0,B.useRef)(null),I=(0,B.useCallback)(()=>{ie.current?.abort();let e=new AbortController;return ie.current=e,P({type:`setProcessing`,isProcessing:!0}),e.signal},[]),L=(0,B.useCallback)(e=>{e.aborted||P({type:`setProcessing`,isProcessing:!1})},[]),ae=(0,B.useRef)(typeof window<`u`&&window.isSecureContext&&g&&Ca()),oe=()=>{!ae.current&&F&&setTimeout(()=>{if(M.current){let{files:e}=M.current;e?.length||(P({type:`closeDialog`}),A())}},300)};(0,B.useEffect)(()=>(window.addEventListener(`focus`,oe,!1),()=>{window.removeEventListener(`focus`,oe,!1)}),[M,F,A,ae]);let se=(0,B.useRef)([]),ce=(0,B.useRef)([]),le=e=>{j.current&&e.target&&j.current.contains(e.target)&&e.defaultPrevented||(e.preventDefault(),se.current=[])};(0,B.useEffect)(()=>(v&&(document.addEventListener(`dragover`,va,!1),document.addEventListener(`drop`,le,!1)),()=>{v&&(document.removeEventListener(`dragover`,va),document.removeEventListener(`drop`,le))}),[j,v]),(0,B.useEffect)(()=>{let e=e=>{e.target&&(ce.current=[...ce.current,e.target]),ga(e)&&P({isDragGlobal:!0,type:`setDragGlobal`})},t=e=>{ce.current=ce.current.filter(t=>t!==e.target&&t!==null),!(ce.current.length>0)&&P({isDragGlobal:!1,type:`setDragGlobal`})},n=()=>{ce.current=[],P({isDragGlobal:!1,type:`setDragGlobal`})},r=()=>{ce.current=[],P({isDragGlobal:!1,type:`setDragGlobal`})};return document.addEventListener(`dragenter`,e,!1),document.addEventListener(`dragleave`,t,!1),document.addEventListener(`dragend`,n,!1),document.addEventListener(`drop`,r,!1),()=>{document.removeEventListener(`dragenter`,e),document.removeEventListener(`dragleave`,t),document.removeEventListener(`dragend`,n),document.removeEventListener(`drop`,r)}},[j]),(0,B.useEffect)(()=>(!n&&_&&j.current&&j.current.focus(),()=>{}),[j,_,n]);let ue=(0,B.useCallback)(e=>{w?w(e):console.error(e)},[w]),de=(0,B.useCallback)(e=>{e.preventDefault(),e.persist?.(),Ee(e),!re.current&&(se.current=[...se.current,e.target],ga(e)&&Promise.resolve(r(e)).then(t=>{if(ha(e)&&!S)return;let n=t.length>0?ma({files:t,accept:O,minSize:a,maxSize:i,multiple:o,maxFiles:s,validator:T,getErrorMessage:E}):null;P({isDragAccept:n?.verdict===`accept`,isDragReject:n?.verdict===`reject`,isDragUnknown:n?.verdict===`unknown`,isDragActive:!0,dragFileRejections:n?.rejections??[],type:`setDraggedFiles`}),c&&c(e)}).catch(e=>ue(e)))},[r,c,ue,S,O,a,i,o,s,T,E]),fe=(0,B.useCallback)(e=>{if(e.preventDefault(),e.persist?.(),Ee(e),re.current)return!1;let t=ga(e);if(t&&e.dataTransfer)try{e.dataTransfer.dropEffect=`copy`}catch{}return t&&u&&u(e),!1},[u,S]),pe=(0,B.useCallback)(e=>{e.preventDefault(),e.persist?.(),Ee(e);let t=se.current.filter(e=>j.current?.contains(e)),n=t.indexOf(e.target);n!==-1&&t.splice(n,1),se.current=t,!(t.length>0)&&(P({type:`setDraggedFiles`,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragUnknown:!1,dragFileRejections:[]}),ga(e)&&l&&l(e))},[j,l,S]),me=(0,B.useCallback)(async(e,t,n)=>{let r=(e,t)=>E?{...e,message:E(e,t)}:e,c=e=>{let n=[],i=[];e.forEach(({file:e,accepted:t,acceptError:a,sizeMatch:o,sizeError:s,customErrors:c})=>{if(t&&o&&!c)n.push(e);else{let t=[a,s];c&&(t=t.concat(c)),i.push({file:e,errors:t.filter(e=>e!=null).map(t=>r(t,e))})}});let a=o?s>=1?s:1/0:1;n.length>a&&n.splice(a).forEach(e=>{i.push({file:e,errors:[r(ca,e)]})}),P({acceptedFiles:n,fileRejections:i,type:`setFiles`}),d&&d(n,i,t),i.length>0&&p&&p(i,t),n.length>0&&f&&f(n,t)},l=e.map(e=>{let[t,n]=ua(e,k),[r,o]=da(e,a,i);return{file:e,accepted:t,acceptError:n,sizeMatch:r,sizeError:o,customErrors:T?T(e):null}});if(!l.some(({customErrors:e})=>pa(e))){c(l);return}let u;try{u=await Promise.all(l.map(async({customErrors:e,...t})=>({...t,customErrors:await e})))}catch(e){n.aborted||(L(n),ue(e));return}n.aborted||c(u)},[P,o,k,a,i,s,d,f,p,T,E,ue,L]),he=(0,B.useCallback)(e=>{if(e.preventDefault(),e.persist?.(),Ee(e),se.current=[],!(re.current&&e.dataTransfer)&&(P({type:`reset`}),ga(e))){let t=I();Promise.resolve(r(e)).then(n=>{if(!t.aborted){if(ha(e)&&!S){L(t);return}return me(n,e,t)}}).catch(e=>{t.aborted||(L(t),ue(e))})}},[r,me,ue,S,I,L]),ge=(0,B.useCallback)(e=>{if(!ga(e))return;e.preventDefault(),e.persist?.(),Ee(e);let t=I();Promise.resolve(r(e)).then(n=>{if(!t.aborted){if(ha(e)&&!S){L(t);return}return me(n,e,t)}}).catch(e=>{t.aborted||(L(t),ue(e))})},[r,me,ue,S,I,L]),_e=(0,B.useCallback)(()=>{if(ae.current){P({type:`openDialog`}),te();let e={multiple:o,types:ee},t;window.showOpenFilePicker(e).then(e=>(t=I(),r(e))).then(e=>{if(P({type:`closeDialog`}),!t.aborted)return me(e,null,t)}).catch(e=>{t&&L(t),Aa(e)?(A(e),P({type:`closeDialog`})):ja(e)||Ma(e)?(ae.current=!1,M.current?(M.current.value=``,M.current.click()):ue(Error(`Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided.`))):ue(e)});return}M.current&&(P({type:`openDialog`}),te(),M.current.value=``,M.current.click())},[P,te,A,g,me,ue,ee,o,I,L]),ve=(0,B.useCallback)(e=>{j.current?.isEqualNode(e.target)&&(e.key===` `||e.key===`Enter`||e.keyCode===32||e.keyCode===13)&&(e.preventDefault(),_e())},[j,_e]),ye=(0,B.useCallback)(()=>{P({type:`focus`})},[]),be=(0,B.useCallback)(()=>{P({type:`blur`})},[]),xe=(0,B.useCallback)(()=>{y||(xa()?setTimeout(_e,0):_e())},[y,_e]),Se=e=>n?null:e,Ce=e=>b?null:Se(e),we=e=>x?null:Se(e),Te=e=>C?null:Se(e),Ee=e=>{S&&e.stopPropagation()},De=(0,B.useMemo)(()=>({refKey:e=`ref`,role:t,onKeyDown:r,onFocus:i,onBlur:a,onClick:o,onDragEnter:s,onDragOver:c,onDragLeave:l,onDrop:u,onPaste:d,...f}={})=>({onKeyDown:Ce(Sa(r,ve)),onFocus:Ce(Sa(i,ye)),onBlur:Ce(Sa(a,be)),onClick:Se(Sa(o,xe)),onDragEnter:we(Sa(s,de)),onDragOver:we(Sa(c,fe)),onDragLeave:we(Sa(l,pe)),onDrop:we(Sa(u,he)),onPaste:Te(Sa(d,ge)),role:typeof t==`string`&&t!==``?t:`presentation`,[e]:j,...!n&&!b?{tabIndex:0}:{},...n?{"aria-disabled":!0}:{},...f}),[j,ve,ye,be,xe,de,fe,pe,he,ge,b,x,C,n]),Oe=(0,B.useCallback)(e=>{e.stopPropagation()},[]),ke=(0,B.useMemo)(()=>({refKey:e=`ref`,onChange:t,onClick:n,...r}={})=>({accept:k,multiple:o,type:`file`,"aria-label":`file upload`,style:{border:0,display:`block`,height:0,margin:0,opacity:0,overflow:`hidden`,padding:0,width:0},onChange:Se(Sa(t,he)),onClick:Se(Sa(n,Oe)),tabIndex:-1,[e]:M,...r}),[M,t,o,he,n]);return{...N,isFocused:ne&&!n,getRootProps:De,getInputProps:ke,rootRef:j,inputRef:M,open:Se(_e)}}function za(e,t){switch(t.type){case`focus`:return{...e,isFocused:!0};case`blur`:return{...e,isFocused:!1};case`openDialog`:return{...La,isFileDialogActive:!0};case`closeDialog`:return{...e,isFileDialogActive:!1};case`setDraggedFiles`:return{...e,isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject,isDragUnknown:t.isDragUnknown,dragFileRejections:t.dragFileRejections};case`setProcessing`:return{...e,isProcessing:t.isProcessing};case`setFiles`:return{...e,acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,dragFileRejections:[],isProcessing:!1,isDragReject:!1,isDragUnknown:!1};case`setDragGlobal`:return{...e,isDragGlobal:t.isDragGlobal};case`reset`:return{...La};default:return e}}function Ba(){}function Va(){let[e,t]=(0,B.useState)(``),{clusterId:n}=E({strict:!1}),{openedEntry:r,restrictPackageModification:c,reloadRootEntries:u,entryExists:d}=V(),f=!!r&&!r.package&&!c,p=He(),{dragging:m,dragTarget:h}=Ci(),g=(h?.getAttribute?.(`data-rct-item-id`))?.split?.(`/`)?.pop?.(),_=r?.project,v=!1,y;if(r?.path){let e=r.path.split(`/`),t=z(r);v=f&&(t?e.slice(1):e.slice(1,-1)).join(`/`),y=e[e.length-(t?1:2)]}let b=(0,B.useCallback)(async(e,n)=>{let r=e,a=h?.getAttribute?.(`data-rct-item-id`)?.split?.(`/`),o=a?.length?a[0]:f?_:!1,s=a?.length?a.slice(1).join(`/`):f?v:!1;if(o===!1||o===void 0||s===!1||s===void 0)return;let c=[],l=n.slice(),m=[];for(let e of r){let t=Ha(s,e);e.name.startsWith(`.`)||e.relativePath?.includes(`/.`)?l.push({file:e,errors:[{message:`Sensitive files and folders starting with . are skipped.`,code:`dot-ignored`}]}):d(`${o}/${t}`)?m.push({file:e,path:`${o}/${t}`}):c.push(e)}if(m.length>0){let e=await si({files:m.map(e=>e.path),directories:[]});for(let t of m)e?c.push(t.file):l.push({file:t.file,errors:[{message:`${Ha(s,t.file)} already exists`,code:`duplicate`}]})}let g=!1,y=`uploading-files`,b={label:`Cancel`,onClick:()=>{g=!0}},x={label:`OK`,onClick:()=>void 0};t(`Uploading ${i(c.length,`file`,`files`)}...`);try{let e=c.reduce((e,t)=>e+t.size,0),t=0,n=0;for(let r of c){n+=1,M.loading(`Upload in progress...`,{id:y,descriptionClassName:`whitespace-pre-line`,description:`${n} of ${i(c.length,`file`,`files`)}
2
+ import{a as e,r as t,t as n}from"./rolldown-runtime-B0Z9INg1.js";import{d as r,f as i,g as a,h as o,n as s,t as c}from"./authStore-B3IhXrn6.js";import{E as l,_ as u,c as d,n as f,p,t as m,u as h,y as g}from"./vendor-core-CddkYGh5.js";import{n as _,r as v,t as y}from"./button-DfBmT4rc.js";import{D as b,E as x,H as S,I as C,O as w,T,k as E,w as D,z as O}from"./vendor-tanstack-FsM5XZNE.js";import{a as k,i as ee}from"./vendor-datadog-XDrpA25D.js";import{r as te}from"./vendor-react-BhazFIp8.js";import{r as A}from"./useAuth-DiJUZS1C.js";import{$ as j,Rt as M,it as N}from"./vendor-ui-BLIveqaL.js";import{a as P,i as ne,n as F,r as re,t as ie}from"./card-ByrPS_wa.js";import{t as I}from"./createLucideIcon-BMkDbMrz.js";import{c as L,d as ae,f as oe,i as se,l as ce,n as le,o as ue,p as de,s as fe,t as pe,u as me}from"./select-CKgJgpkn.js";import{a as he,n as ge}from"./getRegistrationInfo--NLLrics.js";import{c as _e}from"./table-BvFflPWi.js";import{i as ve,r as ye,t as be}from"./x-D39AGKMb.js";import{t as xe}from"./chevron-right-CY-tr2sG.js";import{a as Se,i as Ce,n as we,r as Te,t as Ee}from"./tabs-Dd_ElZ36.js";import{c as De,d as Oe,f as ke,g as Ae,h as je,i as Me,l as Ne,m as Pe,n as Fe,o as Ie,r as Le,t as Re}from"./setComponentFile-DSHbURTI.js";import{n as ze}from"./queryClient-BLhQvmWC.js";import{n as Be}from"./setLocalStorage-CD_L8p_D.js";import{t as Ve}from"./useLocalStorage-DetQlhBe.js";import{o as He,r as Ue,s as We}from"./pollUnlessForbidden-DIDXGBc5.js";import{$ as Ge,$n as Ke,$t as qe,A as Je,An as Ye,At as Xe,C as Ze,Ct as Qe,D as $e,E as et,F as tt,Fn as nt,Ft as rt,G as R,Gn as it,Gt as at,Hn as ot,Ht as st,I as ct,In as lt,Jn as ut,Jt as dt,K as ft,Kt as pt,L as mt,Ln as ht,Lt as gt,M as _t,Mn as vt,Mt as yt,N as bt,Nn as xt,Nt as St,O as Ct,On as wt,P as Tt,Pn as Et,Pt as Dt,Q as Ot,Qn as kt,Qt as At,R as jt,Rn as Mt,Rt as Nt,S as Pt,St as Ft,T as It,Tt as Lt,U as Rt,Un as zt,Vt as Bt,W as Vt,Wt as Ht,X as Ut,Xn as Wt,Xt as Gt,Yn as Kt,Yt as qt,Z as Jt,Zn as Yt,Zt as Xt,_ as Zt,an as Qt,ar as $t,at as en,b as tn,bt as nn,cn as rn,cr as an,dt as on,en as sn,er as cn,et as ln,g as un,gt as dn,h as fn,hn as pn,ht as mn,in as hn,it as gn,j as _n,k as vn,l as yn,ln as bn,lr as xn,m as Sn,mn as Cn,mt as wn,nr as Tn,nt as En,on as Dn,ot as On,p as kn,pn as An,pt as jn,q as Mn,qn as Nn,qt as Pn,rn as Fn,rt as In,sn as Ln,sr as Rn,st as z,tn as zn,tr as Bn,tt as Vn,u as Hn,un as Un,ur as Wn,ut as Gn,v as Kn,vt as qn,w as Jn,wt as Yn,x as Xn,xt as Zn,y as Qn,yt as $n,z as er,zn as tr,zt as nr}from"./index-BQB9R8Ug.js";import{f as rr,i as ir,p as ar,r as or}from"./editor.api-eUd8PqEu.js";import{t as sr}from"./register-3F1Tje_F.js";import{a as cr,c as lr,i as ur,n as dr,o as fr,r as pr,s as mr,t as hr}from"./alertDialog-BaBrZQ4M.js";import{t as gr}from"./useEntityRestURL-qfahJnvr.js";import"./languageServices-Bl-BvoAb.js";import"./editor-BDfNodZS.js";var _r=I(`arrow-down-a-z`,[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M20 8h-5`,key:`1vsyxs`}],[`path`,{d:`M15 10V6.5a2.5 2.5 0 0 1 5 0V10`,key:`ag13bf`}],[`path`,{d:`M15 14h5l-5 6h5`,key:`ur5jdg`}]]),vr=I(`arrow-up-a-z`,[[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}],[`path`,{d:`M20 8h-5`,key:`1vsyxs`}],[`path`,{d:`M15 10V6.5a2.5 2.5 0 0 1 5 0V10`,key:`ag13bf`}],[`path`,{d:`M15 14h5l-5 6h5`,key:`ur5jdg`}]]),yr=I(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),br=I(`case-lower`,[[`path`,{d:`M10 9v7`,key:`ylp826`}],[`path`,{d:`M14 6v10`,key:`1jy4vg`}],[`circle`,{cx:`17.5`,cy:`12.5`,r:`3.5`,key:`1a9481`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`3.5`,key:`2jlv1r`}]]),xr=I(`case-sensitive`,[[`path`,{d:`m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16`,key:`d5nyq2`}],[`path`,{d:`M22 9v7`,key:`pvm9v3`}],[`path`,{d:`M3.304 13h6.392`,key:`1q3zxz`}],[`circle`,{cx:`18.5`,cy:`12.5`,r:`3.5`,key:`z97x68`}]]),Sr=I(`case-upper`,[[`path`,{d:`M15 11h4.5a1 1 0 0 1 0 5h-4a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h3a1 1 0 0 1 0 5`,key:`nxs35`}],[`path`,{d:`m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16`,key:`d5nyq2`}],[`path`,{d:`M3.304 13h6.392`,key:`1q3zxz`}]]),Cr=I(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),wr=I(`command`,[[`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`,key:`11bfej`}]]),Tr=I(`eraser`,[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]),Er=I(`file-archive`,[[`path`,{d:`M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]),Dr=I(`file-braces`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]]),Or=I(`file-code-corner`,[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]]),kr=I(`file-image`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),Ar=I(`file-key`,[[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M4 12v6`,key:`bg1pfk`}],[`path`,{d:`M4 14h2`,key:`1sf9f8`}],[`path`,{d:`M9.65 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v4`,key:`d56i0q`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),jr=I(`file-plus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),Mr=I(`file-type`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M11 18h2`,key:`12mj7e`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5`,key:`qbrxap`}]]),Nr=I(`fold-vertical`,[[`path`,{d:`M12 22v-6`,key:`6o8u61`}],[`path`,{d:`M12 8V2`,key:`1wkif3`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`m15 19-3-3-3 3`,key:`e37ymu`}],[`path`,{d:`m15 5-3 3-3-3`,key:`19d6lf`}]]),Pr=I(`folder-input`,[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),Fr=I(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Ir=I(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Lr=I(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Rr=I(`git-merge`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]),zr=I(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Br=I(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),Vr=I(`link`,[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]),Hr=I(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),Ur=I(`list-tree`,[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]),Wr=I(`message-square-text`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]),Gr=I(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),Kr=I(`mouse-pointer-click`,[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]),qr=I(`package-open`,[[`path`,{d:`M12 22v-9`,key:`x3hkom`}],[`path`,{d:`M15.17 2.21a1.67 1.67 0 0 1 1.63 0L21 4.57a1.93 1.93 0 0 1 0 3.36L8.82 14.79a1.655 1.655 0 0 1-1.64 0L3 12.43a1.93 1.93 0 0 1 0-3.36z`,key:`2ntwy6`}],[`path`,{d:`M20 13v3.87a2.06 2.06 0 0 1-1.11 1.83l-6 3.08a1.93 1.93 0 0 1-1.78 0l-6-3.08A2.06 2.06 0 0 1 4 16.87V13`,key:`1pmm1c`}],[`path`,{d:`M21 12.43a1.93 1.93 0 0 0 0-3.36L8.83 2.2a1.64 1.64 0 0 0-1.63 0L3 4.57a1.93 1.93 0 0 0 0 3.36l12.18 6.86a1.636 1.636 0 0 0 1.63 0z`,key:`12ttoo`}]]),Jr=I(`panel-right-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]),Yr=I(`panel-right-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),Xr=I(`panel-top`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]),Zr=I(`replace`,[[`path`,{d:`M14 4a1 1 0 0 1 1-1`,key:`dhj8ez`}],[`path`,{d:`M15 10a1 1 0 0 1-1-1`,key:`1mnyi5`}],[`path`,{d:`M21 4a1 1 0 0 0-1-1`,key:`sfs9ap`}],[`path`,{d:`M21 9a1 1 0 0 1-1 1`,key:`mp6qeo`}],[`path`,{d:`m3 7 3 3 3-3`,key:`x25e72`}],[`path`,{d:`M6 10V5a2 2 0 0 1 2-2h2`,key:`15xut4`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}]]),Qr=I(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),$r=I(`text-cursor-input`,[[`path`,{d:`M12 20h-1a2 2 0 0 1-2-2 2 2 0 0 1-2 2H6`,key:`1528k5`}],[`path`,{d:`M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7`,key:`13ksps`}],[`path`,{d:`M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1`,key:`1n9rhb`}],[`path`,{d:`M6 4h1a2 2 0 0 1 2 2 2 2 0 0 1 2-2h1`,key:`1mj8rg`}],[`path`,{d:`M9 6v12`,key:`velyjx`}]]),ei=I(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),ti=I(`unfold-vertical`,[[`path`,{d:`M12 22v-6`,key:`6o8u61`}],[`path`,{d:`M12 8V2`,key:`1wkif3`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`m15 19-3 3-3-3`,key:`11eu04`}],[`path`,{d:`m15 5-3-3-3 3`,key:`itvq4r`}]]),B=e(k(),1);function ni(e,t=!1){let[n,r]=Xe(e,t),i=(0,B.useCallback)(e=>{e?.preventDefault?.(),r(e=>!e)},[r]),a=(0,B.useCallback)(e=>{e?.preventDefault?.(),r(!0)},[r]),o=(0,B.useCallback)(e=>{e?.preventDefault?.(),r(!1)},[r]);return(0,B.useMemo)(()=>({toggled:n,setToggled:r,toggle:i,toggleOn:a,toggleOff:o}),[i,r,o,a,n])}var ri=(0,B.createContext)(null);function V(){return(0,B.useContext)(ri)}var H=te();function ii(){let{reloadRootEntries:e,setFocusedItem:t,setSelectedItems:n}=V(),r=He();return(0,B.useCallback)(async a=>{let o=!1,s=a.filter(e=>e.from!==e.to);if(s.length===0)return!0;let c=`Renaming ${i(s.length,`File`,`Files`)}`,l={duration:6e4,action:{label:`Cancel`,onClick:()=>{o=!0}}};l.id=M.loading(c,{...l,description:(0,H.jsx)(ge,{animated:!0,width:`0%`})});let u=s.length*3,d=0;function f(){d+=1,M.loading(c,{...l,description:(0,H.jsx)(ge,{animated:!0,width:(d===0?0:d/u*100)+`%`})})}try{for(let e of s){let t=e.from.split(`/`),n=t.shift(),i=t.join(`/`),a=e.to.split(`/`),s=a.shift(),c=a.join(`/`),l=await Sn({...r,file:i,project:n,encoding:`base64`});if(o||(f(),await Re({...r,file:c,project:s,encoding:`base64`,payload:l.message}),o)||(f(),await De({...r,file:i,project:n}),o))break;f()}}catch(t){return M.error(`Rename Failed`,{id:l.id,description:t instanceof Error?t.message:`An unexpected error occurred while renaming.`,duration:1e4,action:{label:`OK`,onClick:()=>void 0}}),e(),!1}return d>=u?M.success(`Renamed ${i(s.length,`File`,`Files`)}`,{id:l.id,description:`All done!`,duration:3e3,action:{label:`OK`,onClick:()=>{}}}):M.warning(`Rename Cancelled`,{id:l.id,description:`${d} of ${u} steps completed.`,duration:1e4,action:{label:`OK`,onClick:()=>{}}}),e(),n(e=>{let t=e.slice();for(let e of s){let n=t.indexOf(e.from);n>=0?t.splice(n,1,e.to):t.push(e.to)}return t}),t(e=>{for(let t of s)if(e===t.from)return t.to;return e}),d>=u},[r,e,t,n])}var ai;function oi(e){ai=e}function si(e){return e.files.length>0||e.directories.length>0?ai?new Promise(t=>ai(e,t)):Promise.resolve(!1):Promise.resolve(!0)}function ci(e,t){return e[t]!==void 0}function li(e){return t=>ci(t,e)}var ui={handleGlobal(e,t){if((t.cmd||t.ctrl)&&e===`Delete`)return R(`ShowDeleteDirectoryOrFileModal`,!0),!0},addEditorAction(e){return{id:`delete-file`,label:`Delete File`,keybindings:[e.KeyMod.CtrlCmd|e.KeyCode.Delete],run:Vt(`ShowDeleteDirectoryOrFileModal`,!0)}}},di={handleGlobal(e,t){if(t.ctrl&&t.alt&&t.shift&&e===`˜`)return R(`ShowAddDirectoryOrFileModalType`,`directory`),!0},addEditorAction(e){return{id:`new-directory`,label:`New Directory`,keybindings:[e.KeyMod.WinCtrl|e.KeyMod.Alt|e.KeyMod.Shift|e.KeyCode.KeyN],run:Vt(`ShowAddDirectoryOrFileModalType`,`directory`)}}},fi={handleGlobal(e,t){if(t.ctrl&&e===`n`)return R(`ShowAddDirectoryOrFileModalType`,`file`),!0},addEditorAction(e){return{id:`new-file`,label:`New File`,keybindings:[e.KeyMod.WinCtrl|e.KeyCode.KeyN],run:Vt(`ShowAddDirectoryOrFileModalType`,`file`)}}},pi;function mi(e){pi=e}function hi(){pi?.()}var gi=[ui,di,fi,{handleGlobal(e){if(e===`F2`)return R(`ShowRenameFileModal`,`file`),!0},addEditorAction(e){return{id:`rename-file`,label:`Rename File`,keybindings:[e.KeyMod.WinCtrl|e.KeyMod.Alt|e.KeyCode.KeyR,e.KeyCode.F2],run:Vt(`ShowRenameFileModal`,!0)}}},{addEditorAction(){return{id:`revert-file`,label:`Revert File`,run:yt(`RevertChanges`,!0)}}},{handleGlobal(e,t){if(t.cmd&&e===`s`)return St(`SaveFile`,!0),!0},addEditorAction(e){return{id:`save-file`,label:`Save Changes`,keybindings:[e.KeyMod.CtrlCmd|e.KeyCode.KeyS],run:yt(`SaveFile`,!0)}}}],_i=gi.filter(li(`addEditorAction`)),vi=gi.filter(li(`handleGlobal`));function yi(e){let[t,n]=e,r=_i.map(e=>t.addAction(e.addEditorAction(n)));return()=>{for(let e of r)e?.dispose()}}function bi(){(0,B.useEffect)(()=>(document.addEventListener(`keydown`,xi),()=>{document.removeEventListener(`keydown`,xi)}),[])}function xi(e){let t={cmd:e.getModifierState(`Meta`),alt:e.getModifierState(`Alt`),shift:e.getModifierState(`Shift`),ctrl:e.getModifierState(`Control`)};for(let n of vi)if(n.handleGlobal(e.key,t)){hi(),e.preventDefault();return}}function Si(e){return e.split(`/`).pop()}function Ci(){let[e,t]=(0,B.useState)(!1),[n,r]=(0,B.useState)(void 0),i=(0,B.useCallback)(e=>{if(!e.dataTransfer?.types?.includes(`Files`))return;let n=e.target instanceof Element?e.target:null,i=n?.closest(`.rct-tree-item-button-isFolder`)??n?.closest(`.rct-tree-item-title-container`)?.querySelector(`:scope > .rct-tree-item-button-isFolder`)??null;if(i){let e=i.getAttribute(`data-rct-item-id`);!i.querySelector(`.packageIsLocked`)&&e&&e!==`importedApplications`&&e!==`newApplication`&&r(e=>e===i?e:(e?.classList?.remove?.(`rct-tree-item-title-container-dragging-over`),i.classList.add(`rct-tree-item-title-container-dragging-over`),i))}t(!0)},[]),a=(0,B.useCallback)(()=>{t(!1),r(e=>{e&&e.classList.remove(`rct-tree-item-title-container-dragging-over`)})},[]),o=(0,B.useCallback)(e=>{if(!e.dataTransfer?.types?.includes(`Files`)||e.detail===1337)return;t(!1),n&&(n.classList.remove(`rct-tree-item-title-container-dragging-over`),r(void 0));let i=document.getElementById(`dropTarget`);return i?i.dispatchEvent(new DragEvent(`drop`,{bubbles:!0,detail:1337,cancelable:!0,dataTransfer:e.dataTransfer})):!1},[n]);return(0,B.useEffect)(()=>(document.addEventListener(`dragenter`,i),document.addEventListener(`dragover`,i),document.addEventListener(`dragleave`,a),document.addEventListener(`drop`,o),()=>{document.removeEventListener(`dragenter`,i),document.removeEventListener(`dragover`,i),document.removeEventListener(`dragleave`,a),document.removeEventListener(`drop`,o)}),[i,o,a]),(0,B.useMemo)(()=>({dragging:e,dragTarget:n}),[e,n])}function wi(e){return new Promise((t,n)=>{let r=new FileReader;r.onabort=n,r.onerror=n,r.onload=t,r.readAsDataURL(e)})}var Ti=new Map([[`avif`,`image/avif`],[`bmp`,`image/bmp`],[`css`,`text/css`],[`csv`,`text/csv`],[`doc`,`application/msword`],[`docx`,`application/vnd.openxmlformats-officedocument.wordprocessingml.document`],[`gif`,`image/gif`],[`gz`,`application/gzip`],[`htm`,`text/html`],[`html`,`text/html`],[`ico`,`image/x-icon`],[`jpeg`,`image/jpeg`],[`jpg`,`image/jpeg`],[`js`,`application/javascript`],[`json`,`application/json`],[`md`,`text/markdown`],[`mjs`,`application/javascript`],[`mp3`,`audio/mpeg`],[`mp4`,`video/mp4`],[`ogg`,`audio/ogg`],[`pdf`,`application/pdf`],[`png`,`image/png`],[`ppt`,`application/powerpoint`],[`pptx`,`application/vnd.openxmlformats-officedocument.presentationml.presentation`],[`svg`,`image/svg+xml`],[`tif`,`image/tiff`],[`tiff`,`image/tiff`],[`txt`,`text/plain`],[`wasm`,`application/wasm`],[`wav`,`audio/x-wav`],[`weba`,`audio/webm`],[`webm`,`video/webm`],[`webp`,`image/webp`],[`xls`,`application/vnd.ms-excel`],[`xlsx`,`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`],[`xml`,`application/xml`],[`zip`,`application/zip`]]),Ei=class extends Error{constructor(e){super(`DataTransferItem is not a file`),this.item=e,this.name=`UnexpectedObjectError`}};function Di(e,t,n){let r=e,{webkitRelativePath:i}=e,a=typeof t==`string`?t:typeof i==`string`&&i.length>0?i:`./${e.name}`;return typeof r.path!=`string`&&ki(r,`path`,a),n!==void 0&&Object.defineProperty(r,"handle",{value:n,writable:!1,configurable:!1,enumerable:!0}),ki(r,`relativePath`,a),r}function Oi(e,t=Ti){let{name:n}=e;if(n&&n.lastIndexOf(`.`)!==-1&&!e.type){let r=n.split(`.`).pop().toLowerCase(),i=t.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function ki(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}var Ai=[`.DS_Store`,`Thumbs.db`];async function ji(e,{mimeTypes:t=Ti}={}){return(await Mi(e)).map(e=>e instanceof File?Oi(e,t):e)}async function Mi(e){return Ii(e)&&Ni(e.dataTransfer)?zi(e.dataTransfer,e.type):Pi(e)?Bi(e.clipboardData):Fi(e)?Li(e):Array.isArray(e)&&e.every(e=>`getFile`in e&&typeof e.getFile==`function`)?Ri(e):[]}function Ni(e){return Ii(e)}function Pi(e){return Ii(e)&&Ni(e.clipboardData)}function Fi(e){return Ii(e)&&Ii(e.target)}function Ii(e){return typeof e==`object`&&!!e}function Li(e){return Hi(e.target.files).map(e=>Di(e))}async function Ri(e){return(await Promise.all(e.map(e=>e.getFile()))).map(e=>Di(e))}async function zi(e,t){let n=Hi(e.items).filter(e=>e.kind===`file`);return t===`drop`?Vi(Wi(await Promise.all(n.map(Ui)))):n}function Bi(e){let t=Hi(e.items).filter(e=>e.kind===`file`).map(e=>e.getAsFile()).filter(e=>e!==null);return Vi((t.length>0?t:Hi(e.files)).map(e=>Di(e)))}function Vi(e){return e.filter(e=>Ai.indexOf(e.name)===-1)}function Hi(e){return e===null?[]:Array.from(e)}async function Ui(e){if(typeof e.webkitGetAsEntry!=`function`)return Gi(e);let t=e.webkitGetAsEntry();if(t?.isDirectory){let n=await Ki(e);return n?.kind===`directory`?qi(n,`/${n.name}`):Yi(t)}return Gi(e,t)}function Wi(e){let t=[];for(let n of e)Array.isArray(n)?t.push(...Wi(n)):t.push(n);return t}async function Gi(e,t){let n=e.getAsFile(),r=await Ki(e);if(r!=null){let e=n??await r.getFile();return e.handle=r,Di(e)}if(!n)throw new Ei(e);return Di(n,t?.fullPath??void 0)}async function Ki(e){if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle==`function`)return e.getAsFileSystemHandle()}async function qi(e,t){let n=[];for await(let r of e.values()){let e=`${t}/${r.name}`;if(r.kind===`directory`)n.push(...await qi(r,e));else{let t=await r.getFile();n.push(Di(t,e,r))}}return n}async function Ji(e){return e.isDirectory?Yi(e):Xi(e)}function Yi(e){let t=e.createReader();return new Promise((e,n)=>{let r=[];function i(){t.readEntries(async t=>{if(t.length){let e=Promise.all(t.map(Ji));r.push(e),i()}else try{e(await Promise.all(r))}catch(e){n(e)}},e=>{n(e)})}i()})}async function Xi(e){return new Promise((t,n)=>{e.file(n=>{t(Di(n,e.fullPath))},e=>{n(e)})})}var Zi=e(n((e=>{e.__esModule=!0,e.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(`,`);if(n.length===0)return!0;var r=e.name||``,i=(e.type||``).toLowerCase(),a=i.replace(/\/.*$/,``);return n.some(function(e){var t=e.trim().toLowerCase();return t.charAt(0)===`.`?r.toLowerCase().endsWith(t):t.endsWith(`/*`)?a===t.replace(/\/.*$/,``):i===t})}return!0}}))(),1),Qi=typeof Zi.default==`function`?Zi.default:Zi.default.default,$i=`file-invalid-type`,ea=`file-too-large`,ta=`file-too-small`,na=`too-many-files`;function ra(e=``){let t=e.split(`,`);return{code:$i,message:`File type must be ${t.length>1?`one of ${t.join(`, `)}`:t[0]}`}}var ia=[`KB`,`MB`,`GB`,`TB`,`PB`];function aa(e){if(e<1024)return`${e} ${e===1?`byte`:`bytes`}`;let t=e/1024,n=0;for(;t>=1024&&n<ia.length-1;)t/=1024,n++;return`${Number(t.toFixed(2))} ${ia[n]}`}function oa(e){return{code:ea,message:`File is larger than ${aa(e)}`}}function sa(e){return{code:ta,message:`File is smaller than ${aa(e)}`}}var ca={code:na,message:`Too many files`};function la(e){return e.type===``&&typeof e.getAsFile==`function`}function ua(e,t){let n=e.type===`application/x-moz-file`||Qi(e,t??``)||la(e);return[n,n?null:ra(t)]}function da(e,t,n){if(fa(e.size)){if(fa(t)&&fa(n)){if(e.size>n)return[!1,oa(n)];if(e.size<t)return[!1,sa(t)]}else if(fa(t)&&e.size<t)return[!1,sa(t)];else if(fa(n)&&e.size>n)return[!1,oa(n)]}return[!0,null]}function fa(e){return e!=null}function pa(e){return e!=null&&typeof e.then==`function`}function ma({files:e,accept:t,minSize:n,maxSize:r,multiple:i,maxFiles:a=0,validator:o,getErrorMessage:s}){let c=[],l=[],u=(e,t)=>s&&typeof File<`u`&&t instanceof File?{...e,message:s(e,t)}:e;e.forEach(e=>{let[i,a]=ua(e,t),[o,s]=da(e,n,r);i&&o?c.push(e):l.push({file:e,errors:[a,s].filter(e=>e!=null).map(t=>u(t,e))})});let d=i?a>=1?a:1/0:1;return c.length>d&&c.slice(d).forEach(e=>{l.push({file:e,errors:[u(ca,e)]})}),l.length>0?{verdict:`reject`,rejections:l}:{verdict:o?`unknown`:`accept`,rejections:l}}function ha(e){return typeof e.isPropagationStopped==`function`?e.isPropagationStopped():e.cancelBubble!==void 0&&e.cancelBubble}function ga(e){let t=e.dataTransfer??e.clipboardData;return t?Array.prototype.some.call(t.types,e=>e===`Files`||e===`application/x-moz-file`)||Array.prototype.some.call(t.items??[],_a):!!e.target&&!!e.target.files}function _a(e){return typeof e==`object`&&!!e&&e.kind===`file`}function va(e){e.preventDefault()}function ya(e){return e.indexOf(`MSIE`)!==-1||e.indexOf(`Trident/`)!==-1}function ba(e){return e.indexOf(`Edge/`)!==-1}function xa(e=window.navigator.userAgent){return ya(e)||ba(e)}function Sa(...e){return(t,...n)=>e.some(e=>(!ha(t)&&e&&e(t,...n),ha(t)))}function Ca(){return`showOpenFilePicker`in window}function wa(e){return Array.isArray(e)?e:typeof e==`string`?[e]:[]}function Ta(e){if(fa(e))return Array.isArray(e)?e.filter(e=>fa(e)&&fa(e.accept)):[{accept:e}]}function Ea(e){let t=[],n=Object.keys(e);for(let n of Object.values(e))for(let e of wa(n))t.includes(e)||t.push(e);return t.length>0?t.join(`, `):n.length>0?n.join(`, `):`Files`}function Da(e){let t=Ta(e);if(!fa(t))return;let n={};for(let e of t)for(let[t,r]of Object.entries(e.accept)){let e=n[t]??(n[t]=[]);for(let t of wa(r))e.includes(t)||e.push(t)}return n}function Oa(e){let t=Ta(e);if(!fa(t))return;let n=t.map(e=>{let t=Object.entries(e.accept).filter(([e,t])=>{let n=!0;return Na(e)||(console.warn(`Skipped "${e}" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.`),n=!1),(!(Array.isArray(t)||typeof t==`string`)||!wa(t).every(Fa))&&(console.warn(`Skipped "${e}" because an invalid file extension was provided.`),n=!1),n}).reduce((e,[t,n])=>(e[t]=wa(n),e),{});return{description:fa(e.description)&&e.description!==``?e.description:Ea(t),accept:t}}).filter(e=>Object.keys(e.accept).length>0);return n.length>0?n:void 0}function ka(e,{omitWildcardMimeTypesWithExtensions:t=!1}={}){if(fa(e))return Object.entries(e).reduce((e,[n,r])=>{let i=wa(r);return t&&Pa(n)&&i.some(Fa)?e.push(...i):e.push(n,...i),e},[]).filter(e=>Na(e)||Fa(e)).join(`,`)}function Aa(e){return e instanceof DOMException&&(e.name===`AbortError`||e.code===e.ABORT_ERR)}function ja(e){return e instanceof DOMException&&(e.name===`SecurityError`||e.code===e.SECURITY_ERR)}function Ma(e){return e instanceof DOMException&&e.name===`NotAllowedError`}function Na(e){return e===`audio/*`||e===`video/*`||e===`image/*`||e===`text/*`||e===`application/*`||/\w+\/[-+.\w]+/g.test(e)}function Pa(e){return e.endsWith(`/*`)}function Fa(e){return/^.*\.[\w]+$/.test(e)}var Ia=(0,B.forwardRef)(({children:e,...t},n)=>{let{open:r,...i}=Ra(t);return(0,B.useImperativeHandle)(n,()=>({open:r}),[r]),(0,H.jsx)(H.Fragment,{children:e?.({...i,open:r})})});Ia.displayName=`Dropzone`;var La={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragUnknown:!1,isDragGlobal:!1,isProcessing:!1,acceptedFiles:[],fileRejections:[],dragFileRejections:[]};function Ra(e={}){let{accept:t,disabled:n=!1,getFilesFromEvent:r=ji,maxSize:i=1/0,minSize:a=0,multiple:o=!0,maxFiles:s=0,onDragEnter:c,onDragLeave:l,onDragOver:u,onDrop:d,onDropAccepted:f,onDropRejected:p,onFileDialogCancel:m,onFileDialogOpen:h,useFsAccessApi:g=!1,autoFocus:_=!1,preventDropOnDocument:v=!0,noClick:y=!1,noKeyboard:b=!1,noDrag:x=!1,noDragEventsBubbling:S=!1,noPaste:C=!1,onError:w,validator:T,getErrorMessage:E}=e,D=(0,B.useMemo)(()=>Da(t),[t]),O=(0,B.useMemo)(()=>ka(D),[D]),k=(0,B.useMemo)(()=>ka(D,{omitWildcardMimeTypesWithExtensions:!0}),[D]),ee=(0,B.useMemo)(()=>Oa(t),[t]),te=(0,B.useMemo)(()=>typeof h==`function`?h:Ba,[h]),A=(0,B.useMemo)(()=>typeof m==`function`?m:Ba,[m]),j=(0,B.useRef)(null),M=(0,B.useRef)(null),[N,P]=(0,B.useReducer)(za,La),{isFocused:ne,isFileDialogActive:F}=N,re=(0,B.useRef)(F);re.current=F;let ie=(0,B.useRef)(null),I=(0,B.useCallback)(()=>{ie.current?.abort();let e=new AbortController;return ie.current=e,P({type:`setProcessing`,isProcessing:!0}),e.signal},[]),L=(0,B.useCallback)(e=>{e.aborted||P({type:`setProcessing`,isProcessing:!1})},[]),ae=(0,B.useRef)(typeof window<`u`&&window.isSecureContext&&g&&Ca()),oe=()=>{!ae.current&&F&&setTimeout(()=>{if(M.current){let{files:e}=M.current;e?.length||(P({type:`closeDialog`}),A())}},300)};(0,B.useEffect)(()=>(window.addEventListener(`focus`,oe,!1),()=>{window.removeEventListener(`focus`,oe,!1)}),[M,F,A,ae]);let se=(0,B.useRef)([]),ce=(0,B.useRef)([]),le=e=>{j.current&&e.target&&j.current.contains(e.target)&&e.defaultPrevented||(e.preventDefault(),se.current=[])};(0,B.useEffect)(()=>(v&&(document.addEventListener(`dragover`,va,!1),document.addEventListener(`drop`,le,!1)),()=>{v&&(document.removeEventListener(`dragover`,va),document.removeEventListener(`drop`,le))}),[j,v]),(0,B.useEffect)(()=>{let e=e=>{e.target&&(ce.current=[...ce.current,e.target]),ga(e)&&P({isDragGlobal:!0,type:`setDragGlobal`})},t=e=>{ce.current=ce.current.filter(t=>t!==e.target&&t!==null),!(ce.current.length>0)&&P({isDragGlobal:!1,type:`setDragGlobal`})},n=()=>{ce.current=[],P({isDragGlobal:!1,type:`setDragGlobal`})},r=()=>{ce.current=[],P({isDragGlobal:!1,type:`setDragGlobal`})};return document.addEventListener(`dragenter`,e,!1),document.addEventListener(`dragleave`,t,!1),document.addEventListener(`dragend`,n,!1),document.addEventListener(`drop`,r,!1),()=>{document.removeEventListener(`dragenter`,e),document.removeEventListener(`dragleave`,t),document.removeEventListener(`dragend`,n),document.removeEventListener(`drop`,r)}},[j]),(0,B.useEffect)(()=>(!n&&_&&j.current&&j.current.focus(),()=>{}),[j,_,n]);let ue=(0,B.useCallback)(e=>{w?w(e):console.error(e)},[w]),de=(0,B.useCallback)(e=>{e.preventDefault(),e.persist?.(),Ee(e),!re.current&&(se.current=[...se.current,e.target],ga(e)&&Promise.resolve(r(e)).then(t=>{if(ha(e)&&!S)return;let n=t.length>0?ma({files:t,accept:O,minSize:a,maxSize:i,multiple:o,maxFiles:s,validator:T,getErrorMessage:E}):null;P({isDragAccept:n?.verdict===`accept`,isDragReject:n?.verdict===`reject`,isDragUnknown:n?.verdict===`unknown`,isDragActive:!0,dragFileRejections:n?.rejections??[],type:`setDraggedFiles`}),c&&c(e)}).catch(e=>ue(e)))},[r,c,ue,S,O,a,i,o,s,T,E]),fe=(0,B.useCallback)(e=>{if(e.preventDefault(),e.persist?.(),Ee(e),re.current)return!1;let t=ga(e);if(t&&e.dataTransfer)try{e.dataTransfer.dropEffect=`copy`}catch{}return t&&u&&u(e),!1},[u,S]),pe=(0,B.useCallback)(e=>{e.preventDefault(),e.persist?.(),Ee(e);let t=se.current.filter(e=>j.current?.contains(e)),n=t.indexOf(e.target);n!==-1&&t.splice(n,1),se.current=t,!(t.length>0)&&(P({type:`setDraggedFiles`,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragUnknown:!1,dragFileRejections:[]}),ga(e)&&l&&l(e))},[j,l,S]),me=(0,B.useCallback)(async(e,t,n)=>{let r=(e,t)=>E?{...e,message:E(e,t)}:e,c=e=>{let n=[],i=[];e.forEach(({file:e,accepted:t,acceptError:a,sizeMatch:o,sizeError:s,customErrors:c})=>{if(t&&o&&!c)n.push(e);else{let t=[a,s];c&&(t=t.concat(c)),i.push({file:e,errors:t.filter(e=>e!=null).map(t=>r(t,e))})}});let a=o?s>=1?s:1/0:1;n.length>a&&n.splice(a).forEach(e=>{i.push({file:e,errors:[r(ca,e)]})}),P({acceptedFiles:n,fileRejections:i,type:`setFiles`}),d&&d(n,i,t),i.length>0&&p&&p(i,t),n.length>0&&f&&f(n,t)},l=e.map(e=>{let[t,n]=ua(e,k),[r,o]=da(e,a,i);return{file:e,accepted:t,acceptError:n,sizeMatch:r,sizeError:o,customErrors:T?T(e):null}});if(!l.some(({customErrors:e})=>pa(e))){c(l);return}let u;try{u=await Promise.all(l.map(async({customErrors:e,...t})=>({...t,customErrors:await e})))}catch(e){n.aborted||(L(n),ue(e));return}n.aborted||c(u)},[P,o,k,a,i,s,d,f,p,T,E,ue,L]),he=(0,B.useCallback)(e=>{if(e.preventDefault(),e.persist?.(),Ee(e),se.current=[],!(re.current&&e.dataTransfer)&&(P({type:`reset`}),ga(e))){let t=I();Promise.resolve(r(e)).then(n=>{if(!t.aborted){if(ha(e)&&!S){L(t);return}return me(n,e,t)}}).catch(e=>{t.aborted||(L(t),ue(e))})}},[r,me,ue,S,I,L]),ge=(0,B.useCallback)(e=>{if(!ga(e))return;e.preventDefault(),e.persist?.(),Ee(e);let t=I();Promise.resolve(r(e)).then(n=>{if(!t.aborted){if(ha(e)&&!S){L(t);return}return me(n,e,t)}}).catch(e=>{t.aborted||(L(t),ue(e))})},[r,me,ue,S,I,L]),_e=(0,B.useCallback)(()=>{if(ae.current){P({type:`openDialog`}),te();let e={multiple:o,types:ee},t;window.showOpenFilePicker(e).then(e=>(t=I(),r(e))).then(e=>{if(P({type:`closeDialog`}),!t.aborted)return me(e,null,t)}).catch(e=>{t&&L(t),Aa(e)?(A(e),P({type:`closeDialog`})):ja(e)||Ma(e)?(ae.current=!1,M.current?(M.current.value=``,M.current.click()):ue(Error(`Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided.`))):ue(e)});return}M.current&&(P({type:`openDialog`}),te(),M.current.value=``,M.current.click())},[P,te,A,g,me,ue,ee,o,I,L]),ve=(0,B.useCallback)(e=>{j.current?.isEqualNode(e.target)&&(e.key===` `||e.key===`Enter`||e.keyCode===32||e.keyCode===13)&&(e.preventDefault(),_e())},[j,_e]),ye=(0,B.useCallback)(()=>{P({type:`focus`})},[]),be=(0,B.useCallback)(()=>{P({type:`blur`})},[]),xe=(0,B.useCallback)(()=>{y||(xa()?setTimeout(_e,0):_e())},[y,_e]),Se=e=>n?null:e,Ce=e=>b?null:Se(e),we=e=>x?null:Se(e),Te=e=>C?null:Se(e),Ee=e=>{S&&e.stopPropagation()},De=(0,B.useMemo)(()=>({refKey:e=`ref`,role:t,onKeyDown:r,onFocus:i,onBlur:a,onClick:o,onDragEnter:s,onDragOver:c,onDragLeave:l,onDrop:u,onPaste:d,...f}={})=>({onKeyDown:Ce(Sa(r,ve)),onFocus:Ce(Sa(i,ye)),onBlur:Ce(Sa(a,be)),onClick:Se(Sa(o,xe)),onDragEnter:we(Sa(s,de)),onDragOver:we(Sa(c,fe)),onDragLeave:we(Sa(l,pe)),onDrop:we(Sa(u,he)),onPaste:Te(Sa(d,ge)),role:typeof t==`string`&&t!==``?t:`presentation`,[e]:j,...!n&&!b?{tabIndex:0}:{},...n?{"aria-disabled":!0}:{},...f}),[j,ve,ye,be,xe,de,fe,pe,he,ge,b,x,C,n]),Oe=(0,B.useCallback)(e=>{e.stopPropagation()},[]),ke=(0,B.useMemo)(()=>({refKey:e=`ref`,onChange:t,onClick:n,...r}={})=>({accept:k,multiple:o,type:`file`,"aria-label":`file upload`,style:{border:0,display:`block`,height:0,margin:0,opacity:0,overflow:`hidden`,padding:0,width:0},onChange:Se(Sa(t,he)),onClick:Se(Sa(n,Oe)),tabIndex:-1,[e]:M,...r}),[M,t,o,he,n]);return{...N,isFocused:ne&&!n,getRootProps:De,getInputProps:ke,rootRef:j,inputRef:M,open:Se(_e)}}function za(e,t){switch(t.type){case`focus`:return{...e,isFocused:!0};case`blur`:return{...e,isFocused:!1};case`openDialog`:return{...La,isFileDialogActive:!0};case`closeDialog`:return{...e,isFileDialogActive:!1};case`setDraggedFiles`:return{...e,isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject,isDragUnknown:t.isDragUnknown,dragFileRejections:t.dragFileRejections};case`setProcessing`:return{...e,isProcessing:t.isProcessing};case`setFiles`:return{...e,acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,dragFileRejections:[],isProcessing:!1,isDragReject:!1,isDragUnknown:!1};case`setDragGlobal`:return{...e,isDragGlobal:t.isDragGlobal};case`reset`:return{...La};default:return e}}function Ba(){}function Va(){let[e,t]=(0,B.useState)(``),{clusterId:n}=E({strict:!1}),{openedEntry:r,restrictPackageModification:c,reloadRootEntries:u,entryExists:d}=V(),f=!!r&&!r.package&&!c,p=He(),{dragging:m,dragTarget:h}=Ci(),g=(h?.getAttribute?.(`data-rct-item-id`))?.split?.(`/`)?.pop?.(),_=r?.project,v=!1,y;if(r?.path){let e=r.path.split(`/`),t=z(r);v=f&&(t?e.slice(1):e.slice(1,-1)).join(`/`),y=e[e.length-(t?1:2)]}let b=(0,B.useCallback)(async(e,n)=>{let r=e,a=h?.getAttribute?.(`data-rct-item-id`)?.split?.(`/`),o=a?.length?a[0]:f?_:!1,s=a?.length?a.slice(1).join(`/`):f?v:!1;if(o===!1||o===void 0||s===!1||s===void 0)return;let c=[],l=n.slice(),m=[];for(let e of r){let t=Ha(s,e);e.name.startsWith(`.`)||e.relativePath?.includes(`/.`)?l.push({file:e,errors:[{message:`Sensitive files and folders starting with . are skipped.`,code:`dot-ignored`}]}):d(`${o}/${t}`)?m.push({file:e,path:`${o}/${t}`}):c.push(e)}if(m.length>0){let e=await si({files:m.map(e=>e.path),directories:[]});for(let t of m)e?c.push(t.file):l.push({file:t.file,errors:[{message:`${Ha(s,t.file)} already exists`,code:`duplicate`}]})}let g=!1,y=`uploading-files`,b={label:`Cancel`,onClick:()=>{g=!0}},x={label:`OK`,onClick:()=>void 0};t(`Uploading ${i(c.length,`file`,`files`)}...`);try{let e=c.reduce((e,t)=>e+t.size,0),t=0,n=0;for(let r of c){n+=1,M.loading(`Upload in progress...`,{id:y,descriptionClassName:`whitespace-pre-line`,description:`${n} of ${i(c.length,`file`,`files`)}
3
3
  ${r.name}
4
4
  ${st(t)} of ${st(e)}`,action:b});let a=Ha(s,r),u=(await wi(r)).target?.result;if(!u)throw Error(`Failed to read file: ${r.name}`);let d=u.indexOf(`base64,`);if(d===-1)throw Error(`Invalid data URL format for file: ${r.name}`);g?l.push({file:r,errors:[{message:`${a} cancelled`,code:`cancelled`}]}):(await Re({...p,file:a,project:o,encoding:`base64`,payload:u.slice(d+7)}),t+=r.size)}M.loading(`Reloading sidebar...`,{id:y,action:x,description:``}),await u(),l.length===0?r.length>0?M.success(`Uploaded ${i(c.length,`file`,`files`)}!`,{id:y,action:x,description:``}):M.dismiss(y):(console.log(l),M.error(g?`Cancelled uploads`:`Rejected uploads`,{id:y,action:x,descriptionClassName:`whitespace-pre-line overflow-y-auto`,description:l.slice(0,5).map(e=>e.errors.map(e=>e.message).join(`
5
5
  `)).join(`