@marimo-team/frontend 0.14.11-dev34 → 0.14.11-dev36
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/dist/assets/{ConnectedDataExplorerComponent-bUN80_ih.js → ConnectedDataExplorerComponent-CWG5nz1x.js} +1 -1
- package/dist/assets/{ImageComparisonComponent-B_df-yps.js → ImageComparisonComponent-CfRrH1Jg.js} +1 -1
- package/dist/assets/{VegaLite-D4xDrYyM.js → VegaLite-QF3g-Lep.js} +1 -1
- package/dist/assets/{_baseEach-Dltt-w_B.js → _baseEach-iXjsozEK.js} +1 -1
- package/dist/assets/_baseMap-CFSo7H5d.js +1 -0
- package/dist/assets/{_baseUniq-DfS0Ssf6.js → _baseUniq-CIXXnV06.js} +1 -1
- package/dist/assets/{_createAggregator-BxxX1OlM.js → _createAggregator-CEOx6Mv_.js} +1 -1
- package/dist/assets/{any-language-editor-DWufnd_2.js → any-language-editor-dvn0jXIm.js} +1 -1
- package/dist/assets/{architectureDiagram-NQ2NVSRB-B6igHf-3.js → architectureDiagram-NQ2NVSRB-CFapovxN.js} +1 -1
- package/dist/assets/{blockDiagram-PHRCVELO-BJLO1sW6.js → blockDiagram-PHRCVELO-CeJys_Vy.js} +1 -1
- package/dist/assets/{c4Diagram-6F6E4RAY-BU7fmlOj.js → c4Diagram-6F6E4RAY-Dr9lJT7D.js} +1 -1
- package/dist/assets/channel-BChhPVO9.js +1 -0
- package/dist/assets/{chunk-353BL4L5-DPdHUZ4C.js → chunk-353BL4L5-DpA0sHdE.js} +1 -1
- package/dist/assets/{chunk-67H74DCK-CUQaQOjI.js → chunk-67H74DCK-a6sjvQrN.js} +1 -1
- package/dist/assets/{chunk-6OLS64BW-BrtaWVQq.js → chunk-6OLS64BW-CtRiAe-s.js} +1 -1
- package/dist/assets/{chunk-AACKK3MU-7iWp2ygA.js → chunk-AACKK3MU-oiGiewoc.js} +1 -1
- package/dist/assets/{chunk-BFAMUDN2-Cf44f9b_.js → chunk-BFAMUDN2-BcH_w1MX.js} +1 -1
- package/dist/assets/{chunk-E2GYISFI-C0U67kx3.js → chunk-E2GYISFI-DALCxiNa.js} +1 -1
- package/dist/assets/{chunk-QEP2MXWD-Bxtgz2JY.js → chunk-QEP2MXWD-DKhdgr8i.js} +1 -1
- package/dist/assets/{chunk-SKB7J2MH-BZwlh5kT.js → chunk-SKB7J2MH-D-OZdgah.js} +1 -1
- package/dist/assets/{circle-play-DztHV2mT.js → circle-play-c_TN-Uet.js} +1 -1
- package/dist/assets/classDiagram-BGRH5UQR-ytQpgpI-.js +1 -0
- package/dist/assets/classDiagram-v2-O24JOBDK-ytQpgpI-.js +1 -0
- package/dist/assets/clone-BiHmz0Cp.js +1 -0
- package/dist/assets/{compile-B-R519nb.js → compile-d4_So9Wd.js} +1 -1
- package/dist/assets/{dagre-FFZHY6LT-z4SZNoY-.js → dagre-FFZHY6LT-CTtvbJD7.js} +1 -1
- package/dist/assets/{data-editor-DC7kKj8L.js → data-editor-BYRA0Z35.js} +1 -1
- package/dist/assets/{diagram-3EMPZRKU-BIHgHmgi.js → diagram-3EMPZRKU-BrvS7S6k.js} +1 -1
- package/dist/assets/{diagram-5UYTHUR4-D-3SPDI0.js → diagram-5UYTHUR4-DdF-4K9j.js} +1 -1
- package/dist/assets/{diagram-ZTM2IBQH-CQS3FAPu.js → diagram-ZTM2IBQH-BPhCaqwi.js} +1 -1
- package/dist/assets/{edit-page-DhG0gJ0x.js → edit-page-CNQxB001.js} +3 -3
- package/dist/assets/{erDiagram-R3QVA2FD-X1pyIK3y.js → erDiagram-R3QVA2FD-BKh8Yt5g.js} +1 -1
- package/dist/assets/{flowDiagram-PKI6S5ZS-DHc9ftR2.js → flowDiagram-PKI6S5ZS-Cbk9b1pv.js} +1 -1
- package/dist/assets/{ganttDiagram-EK5VF46D-BUjn0bJ4.js → ganttDiagram-EK5VF46D-gVLWczYq.js} +1 -1
- package/dist/assets/{gitGraphDiagram-GW3U2K7C-DoasUuRn.js → gitGraphDiagram-GW3U2K7C-ZEUTs3M0.js} +1 -1
- package/dist/assets/{graph-MZ-nIJA2.js → graph-jcBhwogT.js} +1 -1
- package/dist/assets/{home-page-C3FBcBF-.js → home-page-B0J68aZX.js} +1 -1
- package/dist/assets/{index-BFG3UDcz.js → index-B3bNwjTZ.js} +1 -1
- package/dist/assets/{index-BlcLf0z7.js → index-BHBxrreJ.js} +1 -1
- package/dist/assets/{index-DsZ6EdmC.js → index-BQhe2kkf.js} +1 -1
- package/dist/assets/{index-DSNqx2PG.js → index-ByAB5vqI.js} +1 -1
- package/dist/assets/{index-CGvy-jXz.js → index-C08ZoK5W.js} +1 -1
- package/dist/assets/{index-DECiXEU1.js → index-C3UQadfc.js} +1 -1
- package/dist/assets/{index-CjU87QDC.js → index-C5eTVpXk.js} +1 -1
- package/dist/assets/{index-bXn5Ht5K.js → index-CE6dVo4s.js} +1 -1
- package/dist/assets/{index-CR9FW0Wm.js → index-CHyVAvwp.js} +1 -1
- package/dist/assets/{index-DmcZAU56.js → index-CTcbLmMr.js} +1 -1
- package/dist/assets/{index-qw98GvuM.js → index-CiFsZ8jm.js} +1 -1
- package/dist/assets/{index-CVVfkMNo.js → index-Cjln_Oqz.js} +1 -1
- package/dist/assets/{index-CFwjsdSI.js → index-CrCStvOz.js} +1 -1
- package/dist/assets/{index-BvsoLT88.js → index-DG5XtgdS.js} +1 -1
- package/dist/assets/{index-B6-ULkNY.js → index-DT10yvPX.js} +1 -1
- package/dist/assets/{index-BCB-2T1U.js → index-GZ4F9LuZ.js} +1 -1
- package/dist/assets/{index-B7Dq-6Eb.js → index-KEegLFWn.js} +1 -1
- package/dist/assets/{index-5_FgE_hJ.js → index-cNKrt3_y.js} +1 -1
- package/dist/assets/{index-hY-TVbau.js → index-j8CmuYN5.js} +12 -12
- package/dist/assets/infoDiagram-RLU2ROGC-Dz0yMiT1.js +2 -0
- package/dist/assets/{journeyDiagram-EWQZEKCU-BNszQBQS.js → journeyDiagram-EWQZEKCU-CRgGSvWg.js} +1 -1
- package/dist/assets/{kanban-definition-ILFWEQ3N-cnaXuNGE.js → kanban-definition-ILFWEQ3N-EtDZYHre.js} +1 -1
- package/dist/assets/{layout-G1k5ZlwX.js → layout-BTu8P8H0.js} +1 -1
- package/dist/assets/{linear-BykHQG6m.js → linear-Besjv1F6.js} +1 -1
- package/dist/assets/{links--aNXkRJy.js → links-B2AS4wbN.js} +2 -2
- package/dist/assets/{mermaid-CEnds-v7.js → mermaid-xvSMEDMp.js} +4 -4
- package/dist/assets/{min-CN6F-Wak.js → min-CL8kGbaN.js} +1 -1
- package/dist/assets/{mindmap-definition-CZNETY7S-CBtZB6ID.js → mindmap-definition-CZNETY7S-CwcoCTfM.js} +1 -1
- package/dist/assets/{pieDiagram-NIOCPIFQ-CgrXrj8C.js → pieDiagram-NIOCPIFQ-CoZakTgV.js} +1 -1
- package/dist/assets/{quadrantDiagram-2OG54O6I-CDngCmlF.js → quadrantDiagram-2OG54O6I-BSH8puU7.js} +1 -1
- package/dist/assets/{react-plotly-BsD4Y8bg.js → react-plotly-o0JYqZSX.js} +1 -1
- package/dist/assets/{requirementDiagram-SO3GGRV7-DNjM6uoU.js → requirementDiagram-SO3GGRV7-zZREz3U_.js} +1 -1
- package/dist/assets/{run-page-D-mcpw6q.js → run-page-BXejL4hK.js} +1 -1
- package/dist/assets/{sankeyDiagram-4UZDY2LN-CCBO0h7j.js → sankeyDiagram-4UZDY2LN-B95arVFY.js} +1 -1
- package/dist/assets/{sequenceDiagram-ZIKVLSP4-CGEjEdDd.js → sequenceDiagram-ZIKVLSP4-718sQZWu.js} +1 -1
- package/dist/assets/{slides-component-AClPxNTA.js → slides-component-DB6kLL9e.js} +1 -1
- package/dist/assets/{sortBy-ivQLE_rw.js → sortBy-CWBD-dXG.js} +1 -1
- package/dist/assets/{stateDiagram-XX37X6EN-c_6rJzBh.js → stateDiagram-XX37X6EN-DYxjVLKQ.js} +1 -1
- package/dist/assets/stateDiagram-v2-GD6S3NHB-BhxEBY-a.js +1 -0
- package/dist/assets/{storage-DPQi4ucw.js → storage-BaEQKmhG.js} +3 -3
- package/dist/assets/{terminal-BS7wwx8O.js → terminal-Ct8pIhb9.js} +1 -1
- package/dist/assets/{time-CxHzdJhN.js → time-BwucAGDv.js} +1 -1
- package/dist/assets/{timeline-definition-RI47OAVP-DNny8b3c.js → timeline-definition-RI47OAVP-DtHza-tv.js} +1 -1
- package/dist/assets/{tracing-d_os5FRh.js → tracing-BuELwTiu.js} +2 -2
- package/dist/assets/{treemap-FKARHQ26-BT8Hnvg4.js → treemap-FKARHQ26-BrbeZviV.js} +1 -1
- package/dist/assets/{vega-component-0-gNnSCs.js → vega-component-DjYGkUm0.js} +1 -1
- package/dist/assets/{xychartDiagram-H2YORKM3-DTnprJ9M.js → xychartDiagram-H2YORKM3-D1SgsQKX.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/_baseMap-DOildTF2.js +0 -1
- package/dist/assets/channel-BQe9yl_h.js +0 -1
- package/dist/assets/classDiagram-BGRH5UQR-DW-y-2cH.js +0 -1
- package/dist/assets/classDiagram-v2-O24JOBDK-DW-y-2cH.js +0 -1
- package/dist/assets/clone-TZOZrpCW.js +0 -1
- package/dist/assets/infoDiagram-RLU2ROGC-B4q5BeVD.js +0 -2
- package/dist/assets/stateDiagram-v2-GD6S3NHB-oNalqyuu.js +0 -1
@@ -1,5 +1,5 @@
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./tracing-
|
2
|
-
var yz=Object.defineProperty;var E3=Lt=>{throw TypeError(Lt)};var wz=(Lt,Et,fn)=>Et in Lt?yz(Lt,Et,{enumerable:!0,configurable:!0,writable:!0,value:fn}):Lt[Et]=fn;var ee=(Lt,Et,fn)=>wz(Lt,typeof Et!="symbol"?Et+"":Et,fn),vz=(Lt,Et,fn)=>Et.has(Lt)||E3("Cannot "+fn);var I3=(Lt,Et,fn)=>(vz(Lt,Et,"read from private field"),fn?fn.call(Lt):Et.get(Lt)),A3=(Lt,Et,fn)=>Et.has(Lt)?E3("Cannot add the same private member more than once"):Et instanceof WeakSet?Et.add(Lt):Et.set(Lt,fn);import{u as Oe,S as M,ij as kz,ik as Sz,il as T3,im as Cz,io as Nz,ip as jz,a as X,iq as Ez,ir as Ir,is as Iz,it as nm,iu as M3,iv as Az,iw as Tz,ix as O3,iy as Kl,c as K,eF as Mz,as as ct,j as c,ai as Qn,ap as rr,ao as Es,aq as Is,bt as sr,X as Me,ar as bn,iz as Wi,an as ir,aT as Hn,at as qi,a5 as Te,a1 as Zt,dX as om,eQ as As,iA as Oz,aO as Ke,aa as Mt,iB as Dz,eW as Wn,iC as D3,iD as R3,iE as rm,iF as P3,iG as Rz,L as Ct,dE as Xl,a_ as ar,iH as Zl,b0 as sm,aw as un,iI as Pz,a8 as Ql,iJ as Lz,iK as L3,eV as F3,$ as qt,b6 as z3,iL as B3,cG as im,iM as Fz,dO as at,iN as U3,dV as am,iO as zz,iP as ec,_ as Ue,be as qn,iQ as tc,iR as nc,eL as Ts,iS as Bz,iT as Gi,iU as Uz,eT as Vz,iV as V3,iW as $3,eo as lm,iX as fo,iY as Ar,aY as oc,iZ as $z,i_ as rc,i$ as H3,a6 as Tr,ec as W3,a7 as Yi,j0 as Hz,j1 as cm,j2 as Mr,bv as Or,eM as Dr,ft as q3,gd as Rr,fI as Wz,bh as on,j3 as qz,j4 as Gz,gb as dm,aQ as sc,j5 as um,j6 as Yz,j7 as G3,j8 as hm,j9 as Jz,ja as Kz,jb as mo,jc as Y3,gh as fm,jd as Ji,je as ic,et as yt,ev as Ms,jf as Nt,jg as qe,jh as ft,ji as mm,jj as Xz,jk as pm,jl as wt,jm as J3,dy as ac,du as lc,dv as cc,dw as dc,dt as Ki,jn as Zz,fG as gm,b5 as Sn,aK as Gn,fw as K3,fy as X3,fz as Qz,fE as eB,fA as Z3,jo as Q3,W as Ne,en as tB,aW as Pr,b3 as Lr,aX as Fr,b1 as Gt,eU as Cn,jp as e4,fC as t4,jq as nB,jr as oB,fu as n4,fv as o4,js as Os,dx as r4,jt as s4,ju as rB,jv as sB,am as iB,al as aB,jw as _m,dB as lB,dD as bm,fh as uc,jx as hc,jy as fc,by as Nn,jz as cB,eP as Xi,fe as hn,bm as i4,dY as Bt,jA as dB,ei as uB,aj as xm,jB as Zi,jC as mc,jD as hB,jE as fB,jF as a4,jG as rn,aZ as mB,av as ym,gg as l4,ep as pc,jH as pB,gC as wm,bl as gc,jI as vm,ak as gB,jJ as _B,au as Qi,eG as c4,bp as bB,jK as xB,jL as d4,jM as yB,jN as wB,jO as vB,jP as kB,jQ as SB,dz as Fo,jR as CB,jS as _c,jT as Ds,o as zo,n as et,fX as jn,jU as En,jV as lt,jW as Rs,jX as Ot,gc as Yt,jY as km,es as eo,jZ as NB,j_ as jB,bj as u4,bk as h4,j$ as f4,k0 as EB,gE as Ps,k1 as bc,bg as xc,gF as zr,eX as Sm,k2 as IB,k3 as AB,k4 as TB,k5 as MB,k6 as m4,k7 as ea,k8 as p4,k9 as OB,ka as g4,kb as _4,kc as DB,kd as b4,ke as x4,eY as yc,kf as RB,kg as y4,kh as ta,ki as na,kj as wc,kk as lr,kl as w4,km as Bo,kn as Ls,ko as Cm,kp as oa,kq as Fs,kr as Nm,ks as jm,kt as v4,ku as vc,kv as PB,T as ra,kw as sa,kx as LB,dU as kc,ky as FB,kz as Em,kA as zB,kB as BB,kC as Sc,e1 as UB,kD as Im,kE as zs,kF as Cc,kG as Bs,fW as Yn,g5 as Uo,fT as k4,cr as S4,kH as Am,fF as C4,kI as Tm,kJ as N4,kK as ia,kL as j4,kM as Nc,kN as Mm,kO as aa,kP as la,kQ as ca,kR as VB,fP as jc,kS as Ec,kT as Ic,eh as $B,fQ as HB,kU as WB,kV as qB,kW as GB,kX as YB,r as JB,kY as KB,kZ as XB,k_ as ZB,f_ as QB,k$ as cr,l0 as eU,l1 as E4,t as P,l2 as tU,l3 as nU,l4 as oU,l5 as rU,l6 as sU,l7 as iU,l8 as aU,l9 as lU,la as cU,lb as dU,lc as uU,ld as hU,le as fU,lf as mU,lg as pU,lh as gU,li as _U,lj as bU,lk as xU,ll as yU,lm as wU,ln as vU,lo as kU,lp as SU,lq as CU,lr as NU,ls as jU,lt as EU,lu as IU,lv as Om,lw as Ac,lx as I4,ly as AU,lz as TU,lA as A4,lB as MU,lC as Us,lD as Jn,lE as OU,lF as DU,lG as RU,lH as PU,lI as LU,lJ as FU,lK as zU,lL as BU,lM as UU,lN as VU,lO as dr,lP as $U,lQ as HU,lR as WU,lS as qU,d_ as GU,lT as YU,lU as T4,e2 as JU,lV as Tc,lW as KU,lX as XU,lY as ZU,lZ as QU,Y as ur,l_ as Mc,l$ as eV,m0 as tV,m1 as M4,m2 as Dm,gD as Vs,m3 as nV,m4 as oV,m5 as rV,m6 as sV,g3 as iV,bs as aV,a0 as Rm,m7 as O4,m8 as lV,m9 as cV,ma as Pm,mb as Lm,mc as dV,md as D4,me as R4,mf as Oc,fS as uV,ad as P4,dM as hV,mg as L4,fr as jt,mh as da,mi as $s,mj as fV,mk as mV,ml as Fm,mm as pV,cq as zm,mn as gV,V as hr,bi as F4,mo as _V,mp as bV,mq as Dc,mr as z4,dK as Rc,bu as B4,ms as xV,mt as yV,mu as U4,mv as wV,mw as vV,mx as V4,ae as Pc,my as kV,bw as $4,mz as SV,eO as CV,mA as Vo,el as H4,mB as W4,eS as q4,fJ as Lc,mC as Bm,mD as G4,aV as Um,em as Fc,mE as Y4,mF as NV,mG as jV,mH as EV,fq as IV,mI as AV,gu as TV,fx as MV,fB as Vm,gx as OV,br as ua,mJ as DV,mK as J4,mL as $m,mM as RV,mN as PV,mO as LV,af as In,mP as FV,mQ as zV,mR as K4,fj as Hm,dG as X4,mS as BV,mT as UV,mU as VV,aP as $V,mV as HV,mW as WV,mX as qV,mY as GV,ab as YV,mZ as zc,ac as JV,m_ as Z4,ff as KV,m$ as Q4,fN as XV,n0 as ZV,gs as QV,n1 as e$,n2 as eS,n3 as t$,n4 as Hs,n5 as n$,n6 as Bc,n7 as o$,n8 as r$,z as tS,n9 as s$,dm as i$,na as ha,nb as nS,nc as oS,nd as rS,ne as sS,nf as a$,C as iS,ng as l$,nh as c$,ni as d$,E as Br,f1 as aS,bf as u$,bd as h$,nj as f$,nk as m$,a3 as Uc,nl as p$,a4 as fr,dJ as lS,nm as Wm,nn as g$,dW as cS,no as _$,np as dS,nq as b$,nr as uS,ns as x$,nt as y$,nu as hS,nv as fS,nw as mS,fd as pS,nx as w$,ny as v$,nz as gS,nA as _S,nB as Vc,nC as bS,nD as xS,nE as k$,nF as yS,nG as S$,nH as C$,nI as wS,nJ as N$,nK as j$,nL as E$,nM as I$,nN as A$,nO as T$,dT as M$,nP as O$,nQ as D$,g4 as qm,nR as R$,nS as P$,nT as L$,nU as F$,nV as z$,nW as B$,nX as U$,nY as V$,nZ as $$,n_ as H$,n$ as Gm,o0 as W$,fV as q$,o1 as G$,o2 as Y$,o3 as J$,o4 as vS,o5 as K$,a9 as X$,o6 as Z$,a2 as Q$,eI as eH,gm as tH,o7 as nH,o8 as oH,go as Ym,gk as Ws,gp as Ur,gl as Vr,gq as Jm,gr as Km,o9 as kS,gn as rH,oa as SS,ob as sH,oc as CS,od as mr,oe as NS,gw as iH,of as aH,og as lH,oh as cH,oi as dH,oj as uH,ok as hH,ol as jS,ez as fH,om as Xm,ax as $c,on as ES,oo as IS,az as AS,ay as mH,dS as pH,__tla as gH}from"./index-hY-TVbau.js";import{b as qs,A as _H,L as TS,g as bH,G as xH,o as MS,s as yH,k as wH,B as OS,a as vH,M as kH,Y as SH,c as xn,u as fa,C as CH,S as NH,K as jH,d as EH,i as IH,e as DS,f as AH,h as TH,j as ma,P as pa,l as RS,m as MH,n as OH,p as DH,q as RH,r as PS,t as Zm,T as PH}from"./links--aNXkRJy.js";import{V as LS,d as Gs,I as Qm,N as FS,S as zS,e as BS,f as US,L as VS,g as $S,F as HS,M as LH,l as WS,h as FH,j as po,k as Hc,m as Wc,i as zH,E as qS,n as BH,o as ep,p as UH,q as VH,s as $H,t as HH,v as WH,w as qH,x as GH,y as YH,a as JH,C as KH,R as GS,A as XH,b as ZH,T as QH,z as eW,B as tW,D as nW,G as oW,O as rW,c as sW,P as iW,__tla as aW}from"./storage-DPQi4ucw.js";import{c as lW}from"./_createAggregator-BxxX1OlM.js";import{s as to,i as pr,T as tp,a as np}from"./transform-DetRMEbJ.js";import{g as YS}from"./timer-Bqd5yn_a.js";import{i as cW}from"./zoom-COrs4lFh.js";import{s as ga}from"./sortBy-ivQLE_rw.js";let op,qc,yn,Gc,JS,_a,dW=Promise.all([(()=>{try{return gH}catch{}})(),(()=>{try{return aW}catch{}})()]).then(async()=>{var Jl,C3;var Lt=lW(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});let Et,fn,rp,Yc,Ys,$r,sp,ip,ap,lp,ba,Jc,cp,xa,dp,Kc,up,hp,Xc,fp,mp,pp,ya,gp,Zc,_p,bp,xp,yp,wp,vp,Qc,kp,ed,td,Sp,Cp,Np,jp,Ep,wa,Ip,Ap,nd,Tp,Mp,Op,od,Dp,Rp,Pp,va,rd,sd,Lp,Fp,zp,Bp,Up,Vp,$p,Hp,Wp,id,ad,qp,Gp,Yp,ka,An,Tn;Et=Oe("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),fn=Oe("arrow-right-to-line",[["path",{d:"M17 12H3",key:"8awo09"}],["path",{d:"m11 18 6-6-6-6",key:"8c2y43"}],["path",{d:"M21 5v14",key:"nzette"}]]),rp=Oe("arrow-right-from-line",[["path",{d:"M3 5v14",key:"1nt18q"}],["path",{d:"M21 12H7",key:"13ipq5"}],["path",{d:"m15 18 6-6-6-6",key:"6tx3qv"}]]),Yc=Oe("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),Ys=Oe("ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]),$r=Oe("between-horizontal-start",[["rect",{width:"13",height:"7",x:"8",y:"3",rx:"1",key:"pkso9a"}],["path",{d:"m2 9 3 3-3 3",key:"1agib5"}],["rect",{width:"13",height:"7",x:"8",y:"14",rx:"1",key:"1q5fc1"}]]),sp=Oe("chevrons-down",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]),ip=Oe("chevrons-up",[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]]),Gc=Oe("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),ap=Oe("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),lp=Oe("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),ba=Oe("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),Jc=Oe("clipboard-copy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]),cp=Oe("clipboard-paste",[["path",{d:"M11 14h10",key:"1w8e9d"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v1.344",key:"1e62lh"}],["path",{d:"m17 18 4-4-4-4",key:"z2g111"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113",key:"bjbb7m"}],["rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",key:"ublpy"}]]),xa=Oe("cloud-download",[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]]),dp=Oe("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]),Kc=Oe("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"}]]),up=Oe("copy-minus",[["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),hp=Oe("diamond-plus",[["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41L13.7 2.71a2.41 2.41 0 0 0-3.41 0z",key:"1ey20j"}],["path",{d:"M8 12h8",key:"1wcyev"}]]),Xc=Oe("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),fp=Oe("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"}]]),mp=Oe("fast-forward",[["polygon",{points:"13 19 22 12 13 5 13 19",key:"587y9g"}],["polygon",{points:"2 19 11 12 2 5 2 19",key:"3pweh0"}]]),pp=Oe("file-pen",[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]]),ya=Oe("file-plus-2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M3 15h6",key:"4e2qda"}],["path",{d:"M6 12v6",key:"1u72j0"}]]),gp=Oe("files",[["path",{d:"M20 7h-3a2 2 0 0 1-2-2V2",key:"x099mo"}],["path",{d:"M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z",key:"18t6ie"}],["path",{d:"M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8",key:"1nja0z"}]]),Zc=Oe("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"}]]),_p=Oe("folder-tree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]),bp=Oe("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),xp=Oe("hard-drive-download",[["path",{d:"M12 2v8",key:"1q4o3n"}],["path",{d:"m16 6-4 4-4-4",key:"6wukr"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",key:"w68u3i"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 18h.01",key:"h775k"}]]),yp=Oe("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]),wp=Oe("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]),vp=Oe("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]),Qc=Oe("key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]),kp=Oe("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]),ed=Oe("layout-template",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]),td=Oe("list-tree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]),Sp=Oe("list",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]),Cp=Oe("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]),Np=Oe("memory-stick",[["path",{d:"M6 19v-3",key:"1nvgqn"}],["path",{d:"M10 19v-3",key:"iu8nkm"}],["path",{d:"M14 19v-3",key:"kcehxu"}],["path",{d:"M18 19v-3",key:"1vh91z"}],["path",{d:"M8 11V9",key:"63erz4"}],["path",{d:"M16 11V9",key:"fru6f3"}],["path",{d:"M12 11V9",key:"ha00sb"}],["path",{d:"M2 15h20",key:"16ne18"}],["path",{d:"M2 7a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v1.1a2 2 0 0 0 0 3.837V17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-5.1a2 2 0 0 0 0-3.837Z",key:"lhddv3"}]]),jp=Oe("message-circle-question-mark",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Ep=Oe("microchip",[["path",{d:"M18 12h2",key:"quuxs7"}],["path",{d:"M18 16h2",key:"zsn3lv"}],["path",{d:"M18 20h2",key:"9x5y9y"}],["path",{d:"M18 4h2",key:"1luxfb"}],["path",{d:"M18 8h2",key:"nxqzg"}],["path",{d:"M4 12h2",key:"1ltxp0"}],["path",{d:"M4 16h2",key:"8a5zha"}],["path",{d:"M4 20h2",key:"27dk57"}],["path",{d:"M4 4h2",key:"10groj"}],["path",{d:"M4 8h2",key:"18vq6w"}],["path",{d:"M8 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2h-1.5c-.276 0-.494.227-.562.495a2 2 0 0 1-3.876 0C9.994 2.227 9.776 2 9.5 2z",key:"1681fp"}]]),wa=Oe("network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]),Ip=Oe("octagon-alert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]),Ap=Oe("package-check",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),nd=Oe("package-x",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["path",{d:"m17 13 5 5m-5 0 5-5",key:"im3w4b"}]]),Tp=Oe("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Mp=Oe("party-popper",[["path",{d:"M5.8 11.3 2 22l10.7-3.79",key:"gwxi1d"}],["path",{d:"M4 3h.01",key:"1vcuye"}],["path",{d:"M22 8h.01",key:"1mrtc2"}],["path",{d:"M15 2h.01",key:"1cjtqr"}],["path",{d:"M22 20h.01",key:"1mrys2"}],["path",{d:"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10",key:"hbicv8"}],["path",{d:"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17",key:"1i94pl"}],["path",{d:"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7",key:"1cofks"}],["path",{d:"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z",key:"4kbmks"}]]),Op=Oe("pen-line",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]),od=Oe("presentation",[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]),Dp=Oe("regex",[["path",{d:"M17 3v10",key:"15fgeh"}],["path",{d:"m12.67 5.5 8.66 5",key:"1gpheq"}],["path",{d:"m12.67 10.5 8.66-5",key:"1dkfa6"}],["path",{d:"M9 17a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-2z",key:"swwfx4"}]]),Rp=Oe("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),Pp=Oe("rows-3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]]),va=Oe("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]),rd=Oe("scissors",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]),sd=Oe("scroll-text",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]),Lp=Oe("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),Fp=Oe("square-code",[["path",{d:"m10 9-3 3 3 3",key:"1oro0q"}],["path",{d:"m14 15 3-3-3-3",key:"bz13h7"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]),zp=Oe("square-dashed-bottom-code",[["path",{d:"M10 9.5 8 12l2 2.5",key:"3mjy60"}],["path",{d:"M14 21h1",key:"v9vybs"}],["path",{d:"m14 9.5 2 2.5-2 2.5",key:"1bir2l"}],["path",{d:"M5 21a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2",key:"as5y1o"}],["path",{d:"M9 21h1",key:"15o7lz"}]]),Bp=Oe("square-equal",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 10h10",key:"1101jm"}],["path",{d:"M7 14h10",key:"1mhdw3"}]]),Up=Oe("square-m",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 16V8l4 4 4-4v8",key:"141u4e"}]]),Vp=Oe("square-play",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 8 6 4-6 4Z",key:"f1r3lt"}]]),$p=Oe("square-power",[["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M7.998 9.003a5 5 0 1 0 8-.005",key:"1pek45"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]),Hp=Oe("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]),Wp=Oe("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"}]]),id=Oe("text-search",[["path",{d:"M21 6H3",key:"1jwq7v"}],["path",{d:"M10 12H3",key:"1ulcyk"}],["path",{d:"M10 18H3",key:"13769t"}],["circle",{cx:"17",cy:"15",r:"3",key:"1upz2a"}],["path",{d:"m21 19-1.9-1.9",key:"dwi7p8"}]]),ad=Oe("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"}]]),qp=Oe("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]),Gp=Oe("view",[["path",{d:"M21 17v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2",key:"mrq65r"}],["path",{d:"M21 7V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2",key:"be3xqs"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["path",{d:"M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0",key:"11ak4c"}]]),Yp=Oe("whole-word",[["circle",{cx:"7",cy:"12",r:"3",key:"12clwm"}],["path",{d:"M10 9v6",key:"17i7lo"}],["circle",{cx:"17",cy:"12",r:"3",key:"gl7c2s"}],["path",{d:"M14 7v8",key:"dl84cr"}],["path",{d:"M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1",key:"lt2kga"}]]),ka=Oe("workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]),An=Oe("zap-off",[["path",{d:"M10.513 4.856 13.12 2.17a.5.5 0 0 1 .86.46l-1.377 4.317",key:"193nxd"}],["path",{d:"M15.656 10H20a1 1 0 0 1 .78 1.63l-1.72 1.773",key:"27a7lr"}],["path",{d:"M16.273 16.273 10.88 21.83a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14H4a1 1 0 0 1-.78-1.63l4.507-4.643",key:"1e0qe9"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),Tn=Oe("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);const KS=M.createContext({}),XS=M.forwardRef(function(t,e){[t,e]=Nz(t,e,KS);let{toolbarProps:n}=function(s,i){const{"aria-label":a,"aria-labelledby":l,orientation:d="horizontal"}=s;let[u,h]=M.useState(!1);kz(()=>{var p;h(!(!i.current||!(!((p=i.current.parentElement)===null||p===void 0)&&p.closest('[role="toolbar"]'))))});const{direction:f}=Sz(),m=f==="rtl"&&d==="horizontal";let _=Cz(i);const g=M.useRef(null);return{toolbarProps:{...T3(s,{labelable:!0}),role:u?"group":"toolbar","aria-orientation":d,"aria-label":a,"aria-labelledby":a==null?l:void 0,onKeyDownCapture:u?void 0:p=>{if(p.currentTarget.contains(p.target)){if(d==="horizontal"&&p.key==="ArrowRight"||d==="vertical"&&p.key==="ArrowDown")m?_.focusPrevious():_.focusNext();else{if(!(d==="horizontal"&&p.key==="ArrowLeft"||d==="vertical"&&p.key==="ArrowUp"))return p.key==="Tab"?(p.stopPropagation(),g.current=document.activeElement,void(p.shiftKey?_.focusFirst():_.focusLast())):void 0;m?_.focusNext():_.focusPrevious()}p.stopPropagation(),p.preventDefault()}},onFocusCapture:u?void 0:p=>{var b,x;g.current&&!p.currentTarget.contains(p.relatedTarget)&&(!((b=i.current)===null||b===void 0)&&b.contains(p.target))&&((x=g.current)===null||x===void 0||x.focus(),g.current=null)},onBlurCapture:u?void 0:p=>{p.currentTarget.contains(p.relatedTarget)||g.current||(g.current=p.target)}}}}(t,e),o=jz({...t,values:{orientation:t.orientation||"horizontal"},defaultClassName:"react-aria-Toolbar"}),r=T3(t);return delete r.id,X.createElement("div",{...Ez(n,r),...o,ref:e,slot:t.slot||void 0,"data-orientation":t.orientation||"horizontal"},o.children)});function Sa(t,e){const n=+Ir(t)-+Ir(e);return n<0?-1:n>0?1:n}function ZS(t,e){const n=Ir(t,e==null?void 0:e.in);return+function(o,r){const s=Ir(o,r==null?void 0:r.in);return s.setHours(23,59,59,999),s}(n,e)==+function(o,r){const s=Ir(o,r==null?void 0:r.in),i=s.getMonth();return s.setFullYear(s.getFullYear(),i+1,0),s.setHours(23,59,59,999),s}(n,e)}function QS(t,e,n){const[o,r,s]=nm(n==null?void 0:n.in,t,t,e),i=Sa(r,s),a=Math.abs(function(u,h,f){const[m,_]=nm(f==null?void 0:f.in,u,h);return 12*(m.getFullYear()-_.getFullYear())+(m.getMonth()-_.getMonth())}(r,s));if(a<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-i*a);let l=Sa(r,s)===-i;ZS(o)&&a===1&&Sa(o,s)===1&&(l=!1);const d=i*(a-+l);return d===0?0:d}function eC(t,e,n){const o=function(r,s){return+Ir(r)-+Ir(s)}(t,e)/1e3;return(r=>{const s=(0,Math.trunc)(r);return s===0?0:s})(o)}function tC(t,e){return function(n,o,r){const s=Az(),i=(r==null?void 0:r.locale)??s.locale??Tz,a=Sa(n,o);if(isNaN(a))throw new RangeError("Invalid time value");const l=Object.assign({},r,{addSuffix:r==null?void 0:r.addSuffix,comparison:a}),[d,u]=nm(r==null?void 0:r.in,...a>0?[o,n]:[n,o]),h=eC(u,d),f=(M3(u)-M3(d))/1e3,m=Math.round((h-f)/60);let _;if(m<2)return m===0?i.formatDistance("lessThanXMinutes",1,l):i.formatDistance("xMinutes",m,l);if(m<45)return i.formatDistance("xMinutes",m,l);if(m<90)return i.formatDistance("aboutXHours",1,l);if(m<O3){const g=Math.round(m/60);return i.formatDistance("aboutXHours",g,l)}if(m<2520)return i.formatDistance("xDays",1,l);if(m<Kl){const g=Math.round(m/O3);return i.formatDistance("xDays",g,l)}if(m<2*Kl)return _=Math.round(m/Kl),i.formatDistance("aboutXMonths",_,l);if(_=QS(u,d),_<12){const g=Math.round(m/Kl);return i.formatDistance("xMonths",g,l)}{const g=_%12,p=Math.trunc(_/12);return g<3?i.formatDistance("aboutXYears",p,l):g<9?i.formatDistance("overXYears",p,l):i.formatDistance("almostXYears",p+1,l)}}(t,function(n){return Iz(n,Date.now())}(t),e)}const Ca="https://static.marimo.app",nC=t=>{const e=K.c(24),{onClose:n}=t,[o,r]=M.useState("");let s;s=Math.random().toString(36).slice(2,6);const i=`${o}-${s}`,a=`${Ca}/static/${i}`;let l,d,u,h,f,m,_,g,p,b,x;return e[0]!==n||e[1]!==i?(l=async y=>{y.preventDefault(),n();const v=await Mz({download:!1,includeCode:!0,files:LS.INSTANCE.filenames()}),C=ct({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${Ca}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:v,path:i})}).catch(()=>{C.dismiss(),ct({title:"Error uploading static page",description:c.jsxs("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",c.jsx("a",{href:Qn.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),C.dismiss(),ct({title:"Static page uploaded!",description:c.jsxs("div",{children:["The URL has been copied to your clipboard.",c.jsx("br",{}),"You can share it with anyone."]})})},e[0]=n,e[1]=i,e[2]=l):l=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(d=c.jsx(rr,{children:"Share static notebook"}),e[3]=d):d=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(u=c.jsxs(Es,{children:[d,c.jsxs(Is,{children:["You can publish a static, non-interactive version of this notebook to the public web. We will create a link for you that lives on"," ",c.jsx("a",{href:Ca,target:"_blank",children:Ca}),"."]})]}),e[4]=u):u=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(h=y=>{const v=y.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,"");r(v)},e[5]=h):h=e[5],e[6]!==o?(f=c.jsx(sr,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:h,required:!0,autoComplete:"off"}),e[6]=o,e[7]=f):f=e[7],e[8]!==a?(m=c.jsxs("div",{className:"font-semibold text-sm text-muted-foreground gap-2 flex flex-col",children:["Anyone will be able to access your notebook at this URL:",c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(oC,{text:a}),c.jsx("span",{className:"text-primary",children:a})]})]}),e[8]=a,e[9]=m):m=e[9],e[10]!==f||e[11]!==m?(_=c.jsxs("div",{className:"flex flex-col gap-6 py-4",children:[f,m]}),e[10]=f,e[11]=m,e[12]=_):_=e[12],e[13]!==n?(g=c.jsx(Me,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),e[13]=n,e[14]=g):g=e[14],e[15]!==a?(p=c.jsx(Me,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await bn(a)},children:"Create"}),e[15]=a,e[16]=p):p=e[16],e[17]!==p||e[18]!==g?(b=c.jsxs(Wi,{children:[g,p]}),e[17]=p,e[18]=g,e[19]=b):b=e[19],e[20]!==b||e[21]!==l||e[22]!==_?(x=c.jsx(ir,{className:"w-fit",children:c.jsxs("form",{onSubmit:l,children:[u,_,b]})}),e[20]=b,e[21]=l,e[22]=_,e[23]=x):x=e[23],x},oC=t=>{const e=K.c(8),[n,o]=X.useState(!1);let r;e[0]!==t.text?(r=Hn.stopPropagation(async d=>{d.preventDefault(),await bn(t.text),o(!0),setTimeout(()=>o(!1),2e3)}),e[0]=t.text,e[1]=r):r=e[1];const s=r;let i,a,l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(qi,{size:14,strokeWidth:1.5}),e[2]=i):i=e[2],e[3]!==s?(a=c.jsx(Me,{"data-testid":"copy-static-notebook-url-button",onClick:s,size:"xs",variant:"secondary",children:i}),e[3]=s,e[4]=a):a=e[4],e[5]!==n||e[6]!==a?(l=c.jsx(Te,{content:"Copied!",open:n,children:a}),e[5]=n,e[6]=a,e[7]=l):l=e[7],l};function Jp(){const t=K.c(2),e=Zt(om);let n;return t[0]!==e?(n=()=>{const o=document.getElementsByClassName("output-area"),r=window.innerHeight||document.documentElement.clientHeight;let s=null;for(const i of Array.from(o)){const a=i.getBoundingClientRect();if(a.top>=0&&a.top<=r||a.bottom>=0&&a.bottom<=r){s=As.parse(i.parentNode.id);break}}e(i=>({mode:Oz(i.mode),cellAnchor:s})),requestAnimationFrame(()=>{var i;s!==null&&((i=document.getElementById(As.create(s)))==null||i.scrollIntoView())})},t[0]=e,t[1]=n):n=t[1],n}function ld(t){const e=K.c(3),n=cd();let o;return e[0]!==t||e[1]!==n?(o=()=>{t!==void 0&&n([t])},e[0]=t,e[1]=n,e[2]=o):o=e[2],Ke(o)}function Kp(){const t=K.c(2),e=cd();let n;return t[0]!==e?(n=()=>e(D3(Wn())),t[0]=e,t[1]=n):n=t[1],Ke(n)}function cd(){const t=K.c(2),{prepareForRun:e}=Mt();let n;return t[0]!==e?(n=async o=>{var a,l;if(o.length===0)return;const{cellHandles:r,cellData:s}=Wn(),i=[];for(const d of o){const u=r[d],h=(a=u==null?void 0:u.current)==null?void 0:a.editorView;let f;h?(R3(h)!=="markdown"&&rm(h),f=P3(h)):f=((l=s[d])==null?void 0:l.code)||"",i.push(f),e({cellId:d})}await Rz({cellIds:o,codes:i}).catch(rC)},t[0]=e,t[1]=n):n=t[1],Ke(n)}function rC(t){Ct.error(t)}const dd=[{type:"files",Icon:_p,tooltip:"View files",position:"sidebar"},{type:"variables",Icon:Xl,tooltip:"Explore variables",position:"sidebar"},{type:"datasources",Icon:ar,tooltip:"Explore data sources",position:"sidebar"},{type:"dependencies",Icon:wa,tooltip:"Explore dependencies",position:"sidebar"},{type:"packages",Icon:qs,tooltip:"Manage packages",position:"sidebar"},{type:"outline",Icon:sd,tooltip:"View outline",position:"sidebar"},{type:"chat",Icon:Zl,tooltip:"Chat with AI",position:"sidebar"},{type:"documentation",Icon:id,tooltip:"View live docs",position:"sidebar"},{type:"logs",Icon:sm,tooltip:"Notebook logs",position:"sidebar"},{type:"tracing",Icon:_H,tooltip:"Tracing",position:"sidebar"},{type:"snippets",Icon:zp,tooltip:"Snippets",position:"sidebar"},{type:"secrets",Icon:vp,tooltip:"Secrets",hidden:un(),position:"sidebar"},{type:"scratchpad",Icon:Pz,tooltip:"Scratchpad",position:"sidebar"},{type:"errors",Icon:Ql,tooltip:"View errors",position:"footer"}];function sC(){const t=K.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],t[0]=e):e=t[0];const[n,o]=function(i,a){const l=K.c(11);let d;l[0]!==a?(d=new Lz(a),l[0]=a,l[1]=d):d=l[1];const u=d;let h;l[2]!==i||l[3]!==u?(h=()=>u.get(i),l[2]=i,l[3]=u,l[4]=h):h=l[4];const[f,m]=M.useState(h);let _;l[5]!==i||l[6]!==u?(_=b=>{m(b),u.set(i,b)},l[5]=i,l[6]=u,l[7]=_):_=l[7];const g=_;let p;return l[8]!==g||l[9]!==f?(p=[f,g],l[8]=g,l[9]=f,l[10]=p):p=l[10],p}("marimo:commands",e);let r,s;return t[1]!==n||t[2]!==o?(r=i=>{const a=(l=[i,...n],[...new Set(l)]);var l;o(a.slice(0,3))},t[1]=n,t[2]=o,t[3]=r):r=t[3],t[4]!==n||t[5]!==r?(s={recentCommands:n,addRecentCommand:r},t[4]=n,t[5]=r,t[6]=s):s=t[6],s}function Xp(t){return t.dropdown!==void 0}function Na(t,e=""){return t.flatMap(n=>n.label?Xp(n)?Na(n.dropdown,`${e+n.label} > `):{...n,label:e+n.label}:[])}const Js=t=>{const e=K.c(8),{children:n,layerTop:o}=t,r=o!==void 0&&o;let s;e[0]!==n?(s=X.Children.toArray(n),e[0]=n,e[1]=s):s=e[1];const[i,a]=s,l=`second-icon absolute ${r?"top-[-2px] left-[-2px]":"bottom-[-2px] right-[-2px]"} rounded-full`;let d,u;return e[2]!==a||e[3]!==l?(d=c.jsx("div",{className:l,children:a}),e[2]=a,e[3]=l,e[4]=d):d=e[4],e[5]!==i||e[6]!==d?(u=c.jsxs("div",{className:"multi-icon relative w-fit",children:[i,d]}),e[5]=i,e[6]=d,e[7]=u):u=e[7],u},ja=qt(null),iC=qt(!1),ud=z3("marimo:ai:chatState:v3",{chats:[],activeChatId:null}),aC=qt(t=>{const e=t(ud);return e.chats.find(n=>n.id===e.activeChatId)},(t,e,n)=>{e(ud,o=>({...o,activeChatId:n}))});function Zp(t){return t!==B3&&!!(t&&t.trim().length>0)}const hd=t=>{const e=K.c(7);let n,o;e[0]!==t?(n=a=>{var l;(a.ctrlKey||a.metaKey)&&a.key==="z"&&(a.preventDefault(),a.stopPropagation(),(l=t.onClick)==null||l.call(t,a))},e[0]=t,e[1]=n):n=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(o={capture:!0},e[2]=o):o=e[2],im(window,"keydown",n,o);const r=t.children??"Undo";let s,i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(s=c.jsx(Fz,{className:"ml-2",shortcut:"cmd-z"}),e[3]=s):s=e[3],e[4]!==r||e[5]!==t?(i=c.jsxs(Me,{"data-testid":"undo-button",size:"sm",variant:"outline",...t,children:[r," ",s]}),e[4]=r,e[5]=t,e[6]=i):i=e[6],i};function fd(){const t=K.c(3),{deleteCell:e,undoDeleteCell:n}=Mt();let o;return t[0]!==e||t[1]!==n?(o=r=>{var l;if(at.get(U3))return;const{cellId:s}=r,i=at.get(am),a=(((l=i.cellData[s])==null?void 0:l.code)??"").trim()==="";if(e({cellId:s}),zz({cellId:s}).catch(()=>{n()}),!a){const{dismiss:d}=ct({title:"Cell deleted",description:"You can bring it back by clicking undo or through the command palette.",action:c.jsx(hd,{"data-testid":"undo-delete-button",onClick:()=>{n(),u()}})}),u=d}},t[0]=e,t[1]=n,t[2]=o):o=t[2],Ke(o)}function Qp(){const t=K.c(3),{splitCell:e,undoSplitCell:n}=Mt();let o;return t[0]!==e||t[1]!==n?(o=r=>{const s=ec(r.cellId);if(!s)return;const i=P3(s);e(r);const{dismiss:a}=ct({title:"Cell split",action:c.jsx(hd,{"data-testid":"undo-split-button",size:"sm",variant:"outline",onClick:()=>{n({...r,snapshot:i}),l()},children:"Undo"})}),l=a},t[0]=e,t[1]=n,t[2]=o):o=t[2],Ke(o)}function md(t){const e=K.c(49),{cell:n}=t,{createNewCell:o,updateCellConfig:r,updateCellName:s,moveCell:i,sendToTop:a,sendToBottom:l,addColumnBreakpoint:d,clearCellOutput:u}=Mt(),h=Qp(),f=ld(n==null?void 0:n.cellId),m=!Ue(U3),_=fd(),{openModal:g}=qn(),p=Zt(ja),b=Ue(tc),x=Ue(nc),y=Ue(Ts),v=Ue(Bz);if(!n||y){let E;return e[0]===Symbol.for("react.memo_cache_sentinel")?(E=[],e[0]=E):E=e[0],E}const{cellId:C,config:k,getEditorView:N,name:j,hasOutput:I,hasConsoleOutput:T,status:A}=n;let R;e[1]!==C||e[2]!==k.disabled||e[3]!==r?(R=async()=>{const E={disabled:!k.disabled};await Mr({configs:{[C]:E}}),r({cellId:C,config:E})},e[1]=C,e[2]=k.disabled,e[3]=r,e[4]=R):R=e[4];const z=R;let D;e[5]!==C||e[6]!==k.hide_code||e[7]!==N||e[8]!==r?(D=async()=>{const E={hide_code:!k.hide_code};await Mr({configs:{[C]:E}}),r({cellId:C,config:E});const W=N();W&&(E.hide_code?W.contentDOM.blur():W.focus())},e[5]=C,e[6]=k.hide_code,e[7]=N,e[8]=r,e[9]=D):D=e[9];const F=D;let B,U,O,S,$;return e[10]===Symbol.for("react.memo_cache_sentinel")?(B=c.jsx(Wp,{size:13,strokeWidth:1.5}),e[10]=B):B=e[10],e[11]!==C||e[12]!==j||e[13]!==g||e[14]!==s?(U=()=>{g(c.jsxs(ir,{children:[c.jsx(Es,{children:c.jsx(rr,{children:"Rename cell"})}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(Or,{htmlFor:"cell-name",children:"Cell name"}),c.jsx(FS,{placeholder:"cell name",value:j,onKeyDown:E=>{E.key==="Enter"&&(E.preventDefault(),E.stopPropagation(),g(null))},onChange:E=>s({cellId:C,name:E})})]})]}))},e[11]=C,e[12]=j,e[13]=g,e[14]=s,e[15]=U):U=e[15],e[16]!==C||e[17]!==s?(O=E=>s({cellId:C,name:E}),e[16]=C,e[17]=s,e[18]=O):O=e[18],e[19]!==j||e[20]!==O?(S=c.jsx(FS,{placeholder:"cell name",value:j,onChange:O}),e[19]=j,e[20]=O,e[21]=S):S=e[21],e[22]!==d||e[23]!==b||e[24]!==v||e[25]!==x||e[26]!==m||e[27]!==C||e[28]!==u||e[29]!==k.disabled||e[30]!==k.hide_code||e[31]!==o||e[32]!==_||e[33]!==N||e[34]!==T||e[35]!==I||e[36]!==i||e[37]!==j||e[38]!==f||e[39]!==l||e[40]!==a||e[41]!==p||e[42]!==h||e[43]!==A||e[44]!==U||e[45]!==S||e[46]!==z||e[47]!==F?($=[[{icon:B,label:"Name",disableClick:!0,handle:uC,handleHeadless:U,rightElement:S},{icon:c.jsx(Gs,{size:13,strokeWidth:1.5}),label:"Run cell",hotkey:"cell.run",hidden:A==="running"||A==="queued"||A==="disabled-transitively"||k.disabled,handle:()=>f()},{icon:c.jsx(Gi,{size:13,strokeWidth:1.5}),label:"AI completion",hidden:!b,handle:()=>{p(E=>(E==null?void 0:E.cellId)===C?null:{cellId:C})},hotkey:"cell.aiCompletion"},{icon:c.jsx(rd,{size:13,strokeWidth:1.5}),label:"Split cell",hotkey:"cell.splitCell",handle:()=>h({cellId:C})},{icon:c.jsx(Qm,{size:13,strokeWidth:1.5}),label:"Export output as PNG",hidden:!I,handle:()=>function(E){const W=document.getElementById(L3.create(E));W&&(W.classList.add("printing-output"),F3(W,"result.png").finally(()=>{W.classList.remove("printing-output")}))}(C)},{icon:c.jsx(Vz,{size:13,strokeWidth:1.5}),label:"Format cell",hotkey:"cell.format",handle:()=>{const E=N();E&&Uz({[C]:E})}},{icon:k.hide_code?c.jsx(V3,{size:13,strokeWidth:1.5}):c.jsx($3,{size:13,strokeWidth:1.5}),label:k.hide_code?"Show code":"Hide code",handle:F,hotkey:"cell.hideCode"},{icon:k.disabled?c.jsx(An,{size:13,strokeWidth:1.5}):c.jsx(Tn,{size:13,strokeWidth:1.5}),label:"Reactive execution",rightElement:c.jsx(lm,{"data-testid":"cell-disable-switch",checked:!k.disabled,size:"sm",onCheckedChange:z}),handle:z},{icon:c.jsx(Ql,{size:13,strokeWidth:1.5}),label:"Clear output",hidden:!(I||T),handle:()=>{u({cellId:C})}}],[{icon:c.jsx(oc,{}),label:"Convert to Markdown",hotkey:"cell.viewAsMarkdown",handle:()=>{const E=N();E&&(fo(x,o),Ar(E,{language:"markdown",keepCodeAsIs:!1}))}},{icon:c.jsx(ar,{size:13,strokeWidth:1.5}),label:"Convert to SQL",handle:()=>{const E=N();E&&(fo(x,o),Ar(E,{language:"sql",keepCodeAsIs:!1}))}},{icon:c.jsx(rc,{}),label:"Toggle as Python",handle:()=>{const E=N();E&&(fo(x,o),$z(E,"python",{force:!0}))}}],[{icon:c.jsxs(Js,{children:[c.jsx(ba,{size:13,strokeWidth:1.5}),c.jsx(H3,{size:8,strokeWidth:2})]}),label:"Create cell above",hotkey:"cell.createAbove",handle:()=>o({cellId:C,before:!0})},{icon:c.jsxs(Js,{children:[c.jsx(ba,{size:13,strokeWidth:1.5}),c.jsx(Tr,{size:8,strokeWidth:2})]}),label:"Create cell below",hotkey:"cell.createBelow",handle:()=>o({cellId:C,before:!1})},{icon:c.jsx(H3,{size:13,strokeWidth:1.5}),label:"Move cell up",hotkey:"cell.moveUp",handle:()=>i({cellId:C,before:!0})},{icon:c.jsx(Tr,{size:13,strokeWidth:1.5}),label:"Move cell down",hotkey:"cell.moveDown",handle:()=>i({cellId:C,before:!1})},{icon:c.jsx(W3,{size:13,strokeWidth:1.5}),label:"Move cell left",hotkey:"cell.moveLeft",handle:()=>i({cellId:C,direction:"left"}),hidden:v!=="columns"},{icon:c.jsx(Yi,{size:13,strokeWidth:1.5}),label:"Move cell right",hotkey:"cell.moveRight",handle:()=>i({cellId:C,direction:"right"}),hidden:v!=="columns"},{icon:c.jsx(ip,{size:13,strokeWidth:1.5}),label:"Send to top",hotkey:"cell.sendToTop",handle:()=>a({cellId:C,scroll:!1})},{icon:c.jsx(sp,{size:13,strokeWidth:1.5}),label:"Send to bottom",hotkey:"cell.sendToBottom",handle:()=>l({cellId:C,scroll:!1})},{icon:c.jsx(Hz,{size:13,strokeWidth:1.5}),label:"Break into new column",hotkey:"cell.addColumnBreakpoint",hidden:v!=="columns",handle:()=>d({cellId:C})}],[{icon:c.jsx(TS,{size:13,strokeWidth:1.5}),label:"Copy link to cell",disabled:!Zp(j),tooltip:Zp(j)?void 0:"Only named cells can be linked to",handle:async()=>{await bn(function(E){const W=new URL(window.location.href);return W.hash=`scrollTo=${encodeURIComponent(E)}`,W.toString()}(j)),ct({description:"Link copied to clipboard"})}}],[{label:"Delete",hidden:!m,variant:"danger",icon:c.jsx(cm,{size:13,strokeWidth:1.5}),handle:()=>{_({cellId:C})}}]].map(cC).filter(lC),e[22]=d,e[23]=b,e[24]=v,e[25]=x,e[26]=m,e[27]=C,e[28]=u,e[29]=k.disabled,e[30]=k.hide_code,e[31]=o,e[32]=_,e[33]=N,e[34]=T,e[35]=I,e[36]=i,e[37]=j,e[38]=f,e[39]=l,e[40]=a,e[41]=p,e[42]=h,e[43]=A,e[44]=U,e[45]=S,e[46]=z,e[47]=F,e[48]=$):$=e[48],$}function lC(t){return t.length>0}function cC(t){return t.filter(dC)}function dC(t){return!t.hidden}function uC(t){t==null||t.stopPropagation(),t==null||t.preventDefault()}function hC(t){return!t.hidden}const pd=qt(!1),eg=()=>{const t=K.c(37),[e,n]=on(pd),o=qz(),r=Ue(Gz),s=Ue(dm);let i;t[0]!==r?(i={cell:r},t[0]=r,t[1]=i):i=t[1];let a=md(i).flat();a=Na(a);const l=function(){const O=K.c(61),[S,$]=Dr(),[E,W]=q3();let G;O[0]!==$?(G=async Q=>{await Rr({config:Q}).then(()=>{$(Q)})},O[0]=$,O[1]=G):G=O[1];const q=G;let Y;O[2]!==W?(Y=async Q=>{await Wz({config:Q}).then(()=>{W(Q)})},O[2]=W,O[3]=Y):Y=O[3];const te=Y;let oe;if(O[4]!==E||O[5]!==S||O[6]!==te||O[7]!==q){let Q,ue,me,ce,fe;O[9]!==E?(Q=Re=>Re!==E.width,O[9]=E,O[10]=Q):Q=O[10],O[11]!==E||O[12]!==te?(ue=Re=>({label:`App config > Set width=${Re}`,handle:()=>{te({...E,width:Re})}}),O[11]=E,O[12]=te,O[13]=ue):ue=O[13],O[14]!==S||O[15]!==q?(me={label:"Config > Set theme: dark",handle:()=>{q({...S,display:{...S.display,theme:"dark"}})}},O[14]=S,O[15]=q,O[16]=me):me=O[16],O[17]!==S||O[18]!==q?(ce={label:"Config > Set theme: light",handle:()=>{q({...S,display:{...S.display,theme:"light"}})}},O[17]=S,O[18]=q,O[19]=ce):ce=O[19],O[20]!==S||O[21]!==q?(fe={label:"Config > Set theme: system",handle:()=>{q({...S,display:{...S.display,theme:"system"}})}},O[20]=S,O[21]=q,O[22]=fe):fe=O[22];const de=S.keymap.preset==="vim";let ke,Se;O[23]!==S||O[24]!==q?(ke=()=>{q({...S,keymap:{...S.keymap,preset:"vim"}})},O[23]=S,O[24]=q,O[25]=ke):ke=O[25],O[26]!==de||O[27]!==ke?(Se={label:"Config > Switch keymap to VIM",hidden:de,handle:ke},O[26]=de,O[27]=ke,O[28]=Se):Se=O[28];const ie=S.keymap.preset==="default";let je,pe,Ae;O[29]!==S||O[30]!==q?(je=()=>{q({...S,keymap:{...S.keymap,preset:"default"}})},O[29]=S,O[30]=q,O[31]=je):je=O[31],O[32]!==ie||O[33]!==je?(pe={label:"Config > Switch keymap to default (current: VIM)",hidden:ie,handle:je},O[32]=ie,O[33]=je,O[34]=pe):pe=O[34],O[35]!==S||O[36]!==q?(Ae=()=>{q({...S,completion:{...S.completion,copilot:!1}})},O[35]=S,O[36]=q,O[37]=Ae):Ae=O[37];const Fe=S.completion.copilot!=="github";let De,Ve;O[38]!==Ae||O[39]!==Fe?(De={label:"Config > Disable GitHub Copilot",handle:Ae,hidden:Fe},O[38]=Ae,O[39]=Fe,O[40]=De):De=O[40],O[41]!==S||O[42]!==q?(Ve=()=>{q({...S,completion:{...S.completion,copilot:"github"}})},O[41]=S,O[42]=q,O[43]=Ve):Ve=O[43];const Le=S.completion.copilot==="github";let ot;O[44]!==Ve||O[45]!==Le?(ot={label:"Config > Enable GitHub Copilot",handle:Ve,hidden:Le},O[44]=Ve,O[45]=Le,O[46]=ot):ot=O[46];const Qe=!S.display.reference_highlighting;let tt,ne,ve,Ce;O[47]!==S||O[48]!==q?(tt=()=>{q({...S,display:{...S.display,reference_highlighting:!1}})},O[47]=S,O[48]=q,O[49]=tt):tt=O[49],O[50]!==Qe||O[51]!==tt?(ne={label:"Config > Disable reference highlighting",hidden:Qe,handle:tt},O[50]=Qe,O[51]=tt,O[52]=ne):ne=O[52],O[53]!==S||O[54]!==q?(ve=()=>{q({...S,display:{...S.display,reference_highlighting:!0}})},O[53]=S,O[54]=q,O[55]=ve):ve=O[55],O[56]!==S.display.reference_highlighting||O[57]!==ve?(Ce={label:"Config > Enable reference highlighting",hidden:S.display.reference_highlighting,handle:ve},O[56]=S.display.reference_highlighting,O[57]=ve,O[58]=Ce):Ce=O[58],oe=[...bH().filter(Q).map(ue),me,ce,fe,Se,pe,De,ot,ne,Ce],O[4]=E,O[5]=S,O[6]=te,O[7]=q,O[8]=oe}else oe=O[8];const se=oe;let Z;return O[59]!==se?(Z=se.filter(hC),O[59]=se,O[60]=Z):Z=O[60],Z}();let d=Ag();d=[...Na(d),...Na(l)];const u=d.filter(fC),h=sc.keyBy(u,mC),{recentCommands:f,addRecentCommand:m}=sC();let _;t[2]!==f?(_=new Set(f),t[2]=f,t[3]=_):_=t[3];const g=_;let p,b;t[4]!==s||t[5]!==n?(p=O=>{Kz(s.getHotkey("global.commandPalette").key)(O)&&(O.preventDefault(),n(pC))},t[4]=s,t[5]=n,t[6]=p):p=t[6],im(document,"keydown",p),t[7]!==m||t[8]!==s||t[9]!==o||t[10]!==n?(b=(O,S)=>{const $=o[O];if(!$)return null;const E=s.getHotkey(O);return c.jsxs(mo,{disabled:S.disabled,onSelect:()=>{m(O),n(!1),requestAnimationFrame(()=>{$()})},value:E.name,children:[c.jsxs("span",{children:[E.name,S.tooltip&&c.jsx("span",{className:"ml-2",children:S.tooltip})]}),c.jsx(Y3,{children:c.jsx(fm,{shortcut:E.key})})]},O)},t[7]=m,t[8]=s,t[9]=o,t[10]=n,t[11]=b):b=t[11];const x=b;let y;t[12]!==m||t[13]!==s||t[14]!==n?(y=O=>{const{label:S,handle:$,props:E,hotkey:W}=O,G=E===void 0?{}:E;return c.jsxs(mo,{disabled:G.disabled,onSelect:()=>{m(S),n(!1),requestAnimationFrame(()=>{$()})},value:S,children:[c.jsxs("span",{children:[S,G.tooltip&&c.jsxs("span",{className:"ml-2",children:["(",G.tooltip,")"]})]}),W&&c.jsx(Y3,{children:c.jsx(fm,{shortcut:s.getHotkey(W).key})})]},S)},t[12]=m,t[13]=s,t[14]=n,t[15]=y):y=t[15];const v=y,C=Jz;let k;t[16]===Symbol.for("react.memo_cache_sentinel")?(k=c.jsx(Ji,{placeholder:"Type to search..."}),t[16]=k):k=t[16];const N=hm;let j;t[17]===Symbol.for("react.memo_cache_sentinel")?(j=c.jsx(ic,{children:"No results found."}),t[17]=j):j=t[17];const I=f.length>0&&c.jsxs(c.Fragment,{children:[c.jsx(um,{heading:"Recently Used",children:f.map(O=>{const S=h[O];return Yz(O)?x(O,{disabled:S==null?void 0:S.disabled,tooltip:S==null?void 0:S.tooltip}):S&&!Xp(S)?v({label:S.label,handle:S.handleHeadless||S.handle,props:{disabled:S.disabled,tooltip:S.tooltip}}):null})}),c.jsx(G3,{})]}),T=um,A=s.iterate().map(O=>{if(g.has(O))return null;const S=h[O];return x(O,{disabled:S==null?void 0:S.disabled,tooltip:S==null?void 0:S.tooltip})}),R=u.map(O=>g.has(O.label)?null:v({label:O.label,handle:O.handleHeadless||O.handle,props:{disabled:O.disabled,tooltip:O.tooltip}}));let z;t[18]!==g||t[19]!==v?(z=O=>g.has(O.label)?null:v({label:`Cell > ${O.label}`,handle:O.handleHeadless||O.handle,props:{disabled:O.disabled,tooltip:O.tooltip}}),t[18]=g,t[19]=v,t[20]=z):z=t[20];const D=a.map(z);let F,B,U;return t[21]!==T||t[22]!==R||t[23]!==D||t[24]!==A?(F=c.jsxs(T,{heading:"Commands",children:[A,R,D]}),t[21]=T,t[22]=R,t[23]=D,t[24]=A,t[25]=F):F=t[25],t[26]!==N||t[27]!==F||t[28]!==j||t[29]!==I?(B=c.jsxs(N,{children:[j,I,F]}),t[26]=N,t[27]=F,t[28]=j,t[29]=I,t[30]=B):B=t[30],t[31]!==C||t[32]!==e||t[33]!==n||t[34]!==B||t[35]!==k?(U=c.jsxs(C,{open:e,onOpenChange:n,children:[k,B]}),t[31]=C,t[32]=e,t[33]=n,t[34]=B,t[35]=k,t[36]=U):U=t[36],U};function fC(t){return!t.hotkey}function mC(t){return t.label}function pC(t){return!t}function gr(){return ft().optional().describe(qe.of({label:"Password",inputType:"password",placeholder:"password",optionRegex:".*password.*"}))}function tg(){return ft().optional().describe(qe.of({label:"Token",inputType:"password",placeholder:"token",optionRegex:".*token.*"}))}function Ea(){return ft().optional().describe(qe.of({label:"Warehouse Name",placeholder:"warehouse",optionRegex:".*warehouse.*"}))}function ng(){return ft().optional().describe(qe.of({label:"URI",optionRegex:".*uri.*"}))}function _r(){return ft().nonempty().describe(qe.of({label:"Host",placeholder:"localhost",optionRegex:".*host.*"}))}function go(){return ft().describe(qe.of({label:"Database",placeholder:"db name",optionRegex:".*database.*"}))}function br(){return ft().nonempty().describe(qe.of({label:"Username",placeholder:"username",optionRegex:".*username.*"}))}function xr(t){const e=Xz.string().describe(qe.of({label:"Port",inputType:"number",placeholder:t==null?void 0:t.toString()})).transform(Number).refine(n=>n>=0&&n<=65535,{message:"Port must be between 0 and 65535"});return t!==void 0?e.default(t.toString()):e}function og(){return Ms().default(!1).describe(qe.of({label:"Read Only"}))}const rg=yt({type:Nt("postgres"),host:_r(),port:xr(5432).optional(),database:go(),username:br(),password:gr(),ssl:Ms().default(!1).describe(qe.of({label:"Use SSL"}))}).describe(qe.of({direction:"two-columns"})),sg=yt({type:Nt("mysql"),host:_r(),port:xr(3306),database:go(),username:br(),password:gr(),ssl:Ms().default(!1).describe(qe.of({label:"Use SSL"}))}).describe(qe.of({direction:"two-columns"})),ig=yt({type:Nt("sqlite"),database:go().describe(qe.of({label:"Database Path"}))}).describe(qe.of({direction:"two-columns"})),ag=yt({type:Nt("duckdb"),database:go().describe(qe.of({label:"Database Path"})),read_only:og()}).describe(qe.of({direction:"two-columns"})),lg=yt({type:Nt("motherduck"),database:go().default("my_db").describe(qe.of({label:"Database Name"})),token:tg()}).describe(qe.of({direction:"two-columns"})),cg=yt({type:Nt("snowflake"),account:ft().nonempty().describe(qe.of({label:"Account",optionRegex:".*snowflake.*"})),warehouse:ft().optional().describe(qe.of({label:"Warehouse",optionRegex:".*snowflake.*"})),database:go(),schema:ft().optional().describe(qe.of({label:"Schema",optionRegex:".*snowflake.*"})),username:br(),password:gr(),role:ft().optional().describe(qe.of({label:"Role"}))}).describe(qe.of({direction:"two-columns"})),dg=yt({type:Nt("bigquery"),project:ft().nonempty().describe(qe.of({label:"Project ID",optionRegex:".*bigquery.*"})),dataset:ft().nonempty().describe(qe.of({label:"Dataset",optionRegex:".*bigquery.*"})),credentials_json:ft().describe(qe.of({label:"Credentials JSON",inputType:"textarea"}))}).describe(qe.of({direction:"two-columns"})),ug=yt({type:Nt("clickhouse_connect"),host:_r(),port:xr(8123).optional(),username:br(),password:gr(),secure:Ms().default(!1).describe(qe.of({label:"Use HTTPs"}))}).describe(qe.of({direction:"two-columns"})),hg=yt({type:Nt("timeplus"),host:_r().default("localhost"),port:xr(8123).optional(),username:br().default("default"),password:gr().default("")}).describe(qe.of({direction:"two-columns"})),fg=yt({type:Nt("chdb"),database:go().describe(qe.of({label:"Database Path"})),read_only:og()}).describe(qe.of({direction:"two-columns"})),mg=yt({type:Nt("trino"),host:_r(),port:xr(8080),database:go(),schema:ft().describe(qe.of({label:"Schema",placeholder:"schema name",optionRegex:".*schema.*"})).optional(),username:br(),password:gr(),async_support:Ms().default(!1).describe(qe.of({label:"Async Support"}))}).describe(qe.of({direction:"two-columns"})),pg=yt({type:Nt("iceberg"),name:ft().describe(qe.of({label:"Catalog Name"})),catalog:mm("type",[yt({type:Nt("REST"),warehouse:Ea(),uri:ft().optional().describe(qe.of({label:"URI",placeholder:"https://",optionRegex:".*uri.*"})),token:tg()}),yt({type:Nt("SQL"),warehouse:Ea(),uri:ft().optional().describe(qe.of({label:"URI",placeholder:"jdbc:iceberg://host:port/database",optionRegex:".*uri.*"}))}),yt({type:Nt("Hive"),warehouse:Ea(),uri:ng()}),yt({type:Nt("Glue"),warehouse:Ea(),uri:ng()}),yt({type:Nt("DynamoDB"),"dynamodb.profile-name":ft().optional().describe(qe.of({label:"Profile Name"})),"dynamodb.region":ft().optional().describe(qe.of({label:"Region"})),"dynamodb.access-key-id":ft().optional().describe(qe.of({label:"Access Key ID"})),"dynamodb.secret-access-key":ft().optional().describe(qe.of({label:"Secret Access Key",inputType:"password"})),"dynamodb.session-token":ft().optional().describe(qe.of({label:"Session Token",inputType:"password"}))})]).default({type:"REST"}).describe(qe.of({special:"tabs"}))}),gg=yt({type:Nt("datafusion"),sessionContext:Ms().optional().describe(qe.of({label:"Use Session Context"}))}),_g=yt({type:Nt("pyspark"),host:_r().optional(),port:xr().optional()}),bg=yt({type:Nt("redshift"),host:_r(),port:xr(5439),connectionType:mm("type",[yt({type:Nt("IAM credentials"),region:ft().describe(qe.of({label:"Region"})),aws_access_key_id:ft().nonempty().describe(qe.of({label:"AWS Access Key ID",inputType:"password",optionRegex:".*aws_access_key_id.*"})),aws_secret_access_key:ft().nonempty().describe(qe.of({label:"AWS Secret Access Key",inputType:"password",optionRegex:".*aws_secret_access_key.*"})),aws_session_token:ft().optional().describe(qe.of({label:"AWS Session Token",inputType:"password",optionRegex:".*aws_session_token.*"}))}),yt({type:Nt("DB credentials"),user:br(),password:gr()})]).default({type:"IAM credentials",aws_access_key_id:"",aws_secret_access_key:"",region:""}),database:go()}).describe(qe.of({direction:"two-columns"})),gC=mm("type",[rg,sg,ig,ag,lg,cg,dg,ug,hg,fg,mg,pg,gg,_g,bg]),gd="env:";function Ia(t){return typeof t=="string"&&t.startsWith(gd)}function _d(t){return`${gd}${t}`}const xg={sqlmodel:"SQLModel",sqlalchemy:"SQLAlchemy",duckdb:"DuckDB",clickhouse_connect:"ClickHouse Connect",chdb:"chDB",pyiceberg:"PyIceberg",ibis:"Ibis",motherduck:"MotherDuck",redshift:"Redshift"};class sn{constructor(e,n,o){this.connection=void 0,this.orm=void 0,this.secrets=void 0,this.connection=e,this.orm=n,this.secrets=o}get imports(){const e=new Set(this.generateImports());switch(this.orm){case"sqlalchemy":e.add("import sqlalchemy");break;case"sqlmodel":e.add("import sqlmodel");break;case"duckdb":e.add("import duckdb")}return e}}class _C{constructor(){this.secrets={}}get imports(){return Object.keys(this.secrets).length===0?new Set:new Set(["import os"])}print(e,n,o){if(e=(r=>`_${r}`)(e),Ia(n)){const r=n.replace(gd,""),s=o?`os.environ.get("${r}", "${o}")`:`os.environ.get("${r}")`;return this.secrets[e]=s,e}if(o!=null){const r=`os.environ.get("${n}", "${o}")`;return this.secrets[e]=r,e}return typeof n=="number"||typeof n=="number"?`${n}`:typeof n=="boolean"?Hr(n):n?`"${n}"`:""}printInFString(e,n,o){if(n===void 0)return"";if(typeof n=="number")return`${n}`;if(typeof n=="boolean")return Hr(n);const r=this.print(e,n,o);return r.startsWith('"')&&r.endsWith('"')?r.slice(1,-1):`{${r}}`}printPassword(e,n,o){const r=o?this.printInFString.bind(this):this.print.bind(this);return Ia(e)?r("password",e):r("password",n,e)}getSecrets(){return this.secrets}formatSecrets(){return Object.keys(this.secrets).length===0?"":Object.entries(this.secrets).map(([e,n])=>`${e} = ${n}`).join(`
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./tracing-BuELwTiu.js","./index-j8CmuYN5.js","./index-j7kA8ETF.css","./compile-d4_So9Wd.js","./time-BwucAGDv.js","./timer-Bqd5yn_a.js","./linear-Besjv1F6.js","./init-DLRA0X12.js","./range-CtcPcB_L.js","./zoom-COrs4lFh.js","./ordinal-DDUp3AbE.js","./colors-bszWmPJw.js","./step-BwsUM5iJ.js","./arc-CfyY4LWz.js","./index-BEQfoZiP.js","./storage-BaEQKmhG.js","./index-CTcbLmMr.js","./index-CE6dVo4s.js","./index-C08ZoK5W.js","./index-ByAB5vqI.js","./index-BHBxrreJ.js","./index-DT10yvPX.js","./index-CiFsZ8jm.js","./index-BQhe2kkf.js","./index-C5eTVpXk.js","./index-cNKrt3_y.js","./index-B3bNwjTZ.js","./index-CHyVAvwp.js","./index-Cjln_Oqz.js","./apl-CXdQSnD-.js","./asciiarmor-D5V0T9Cu.js","./asterisk-B46aRdXb.js","./brainfuck-CtZaYBKt.js","./clike-BgBwzOhw.js","./cmake-DXn5xaP-.js","./cobol-stawOqaz.js","./coffeescript-BTDxI-eT.js","./commonlisp-vq6DHwts.js","./crystal-CRzZ78HM.js","./cypher-gJDei3ni.js","./d-BShv7fp-.js","./diff-UJJ5BM9S.js","./dockerfile-knGOOxt4.js","./simple-mode-C3vEBAcb.js","./dtd-DI9Herc-.js","./dylan-DkEP81N9.js","./ebnf-B-Df8AvO.js","./ecl-DPFc0Uaf.js","./eiffel-DR5c0IrL.js","./elm-DompmV0j.js","./erlang-BuqgqA5h.js","./factor-CFXhaUWb.js","./fcl-CVaBTCzQ.js","./forth-POgR1ypr.js","./fortran-DL7KluxX.js","./gas-bV0CklSb.js","./gherkin-B6X1vGSW.js","./groovy-DnIzCrpZ.js","./haskell-CLQs6EAM.js","./haxe-D25e-2l-.js","./http-BKJkqRj4.js","./idl-pcmmZuaN.js","./jinja2-DhgKlfW7.js","./julia-DjdwvFuI.js","./livescript-HO6ttBFx.js","./lua-8DXOpKDz.js","./mathematica-IIbmv7SK.js","./mbox-z_N2Mo3d.js","./mirc-DkvFAiy5.js","./modelica-DSrSSXCg.js","./mscgen-B2igx18G.js","./mumps-zvxmGV4l.js","./nginx-B4hAVlXN.js","./nsis-BvKfQ9lQ.js","./ntriples-BSwWqoLa.js","./octave-C4hdQ5Hf.js","./oz-qQq7irPq.js","./pascal-CafrKXZF.js","./perl-tdMlh9QA.js","./pig-CwGJVRC4.js","./powershell-D1ly3AHC.js","./properties-_nPj978X.js","./protobuf-B4y9do6W.js","./puppet-Bc-yJKzi.js","./q-B0kTJ4cI.js","./r-BA4EbLKE.js","./ruby-CR-u2WLS.js","./sas-Bqaci40L.js","./scheme-qjP0V5Ag.js","./shell-BLav31RL.js","./sieve-r025o_jW.js","./smalltalk-C7J3IyEP.js","./solr-78MBEUkU.js","./sparql-BRLJFz69.js","./spreadsheet-CGlWr0eM.js","./stylus-Bdo_Aemu.js","./swift-B_XXVlXX.js","./tcl-B2fODqDH.js","./textile-BuVhTOzU.js","./tiddlywiki-BgR6AEZu.js","./tiki-CI-ztowC.js","./toml-wcPdHu67.js","./troff-Ce85hlLp.js","./ttcn-BxnYHtq8.js","./turtle-BkSuIpt-.js","./vb-BHgjm0DN.js","./vbscript-Dawdd5GZ.js","./velocity-BdD_26Jv.js","./verilog-B4LBqg_1.js","./vhdl-CWWH2SUo.js","./webidl-CGwyPRYs.js","./xquery-CVDBqZPY.js","./yacas-I8QjZlxf.js","./z80-D8p3gKXp.js","./storage-De8XnUVS.css","./links-B2AS4wbN.js","./index-KEegLFWn.js","./links-C1rhMrxo.css","./circle-play-c_TN-Uet.js","./_createAggregator-CEOx6Mv_.js","./_baseEach-iXjsozEK.js","./transform-DetRMEbJ.js","./sortBy-CWBD-dXG.js","./_baseMap-CFSo7H5d.js","./terminal-Ct8pIhb9.js","./terminal-WqMRJt5Z.css"])))=>i.map(i=>d[i]);
|
2
|
+
var yz=Object.defineProperty;var E3=Lt=>{throw TypeError(Lt)};var wz=(Lt,Et,fn)=>Et in Lt?yz(Lt,Et,{enumerable:!0,configurable:!0,writable:!0,value:fn}):Lt[Et]=fn;var ee=(Lt,Et,fn)=>wz(Lt,typeof Et!="symbol"?Et+"":Et,fn),vz=(Lt,Et,fn)=>Et.has(Lt)||E3("Cannot "+fn);var I3=(Lt,Et,fn)=>(vz(Lt,Et,"read from private field"),fn?fn.call(Lt):Et.get(Lt)),A3=(Lt,Et,fn)=>Et.has(Lt)?E3("Cannot add the same private member more than once"):Et instanceof WeakSet?Et.add(Lt):Et.set(Lt,fn);import{u as Oe,S as M,ij as kz,ik as Sz,il as T3,im as Cz,io as Nz,ip as jz,a as X,iq as Ez,ir as Ir,is as Iz,it as nm,iu as M3,iv as Az,iw as Tz,ix as O3,iy as Kl,c as K,eF as Mz,as as ct,j as c,ai as Qn,ap as rr,ao as Es,aq as Is,bt as sr,X as Me,ar as bn,iz as Wi,an as ir,aT as Hn,at as qi,a5 as Te,a1 as Zt,dX as om,eQ as As,iA as Oz,aO as Ke,aa as Mt,iB as Dz,eW as Wn,iC as D3,iD as R3,iE as rm,iF as P3,iG as Rz,L as Ct,dE as Xl,a_ as ar,iH as Zl,b0 as sm,aw as un,iI as Pz,a8 as Ql,iJ as Lz,iK as L3,eV as F3,$ as qt,b6 as z3,iL as B3,cG as im,iM as Fz,dO as at,iN as U3,dV as am,iO as zz,iP as ec,_ as Ue,be as qn,iQ as tc,iR as nc,eL as Ts,iS as Bz,iT as Gi,iU as Uz,eT as Vz,iV as V3,iW as $3,eo as lm,iX as fo,iY as Ar,aY as oc,iZ as $z,i_ as rc,i$ as H3,a6 as Tr,ec as W3,a7 as Yi,j0 as Hz,j1 as cm,j2 as Mr,bv as Or,eM as Dr,ft as q3,gd as Rr,fI as Wz,bh as on,j3 as qz,j4 as Gz,gb as dm,aQ as sc,j5 as um,j6 as Yz,j7 as G3,j8 as hm,j9 as Jz,ja as Kz,jb as mo,jc as Y3,gh as fm,jd as Ji,je as ic,et as yt,ev as Ms,jf as Nt,jg as qe,jh as ft,ji as mm,jj as Xz,jk as pm,jl as wt,jm as J3,dy as ac,du as lc,dv as cc,dw as dc,dt as Ki,jn as Zz,fG as gm,b5 as Sn,aK as Gn,fw as K3,fy as X3,fz as Qz,fE as eB,fA as Z3,jo as Q3,W as Ne,en as tB,aW as Pr,b3 as Lr,aX as Fr,b1 as Gt,eU as Cn,jp as e4,fC as t4,jq as nB,jr as oB,fu as n4,fv as o4,js as Os,dx as r4,jt as s4,ju as rB,jv as sB,am as iB,al as aB,jw as _m,dB as lB,dD as bm,fh as uc,jx as hc,jy as fc,by as Nn,jz as cB,eP as Xi,fe as hn,bm as i4,dY as Bt,jA as dB,ei as uB,aj as xm,jB as Zi,jC as mc,jD as hB,jE as fB,jF as a4,jG as rn,aZ as mB,av as ym,gg as l4,ep as pc,jH as pB,gC as wm,bl as gc,jI as vm,ak as gB,jJ as _B,au as Qi,eG as c4,bp as bB,jK as xB,jL as d4,jM as yB,jN as wB,jO as vB,jP as kB,jQ as SB,dz as Fo,jR as CB,jS as _c,jT as Ds,o as zo,n as et,fX as jn,jU as En,jV as lt,jW as Rs,jX as Ot,gc as Yt,jY as km,es as eo,jZ as NB,j_ as jB,bj as u4,bk as h4,j$ as f4,k0 as EB,gE as Ps,k1 as bc,bg as xc,gF as zr,eX as Sm,k2 as IB,k3 as AB,k4 as TB,k5 as MB,k6 as m4,k7 as ea,k8 as p4,k9 as OB,ka as g4,kb as _4,kc as DB,kd as b4,ke as x4,eY as yc,kf as RB,kg as y4,kh as ta,ki as na,kj as wc,kk as lr,kl as w4,km as Bo,kn as Ls,ko as Cm,kp as oa,kq as Fs,kr as Nm,ks as jm,kt as v4,ku as vc,kv as PB,T as ra,kw as sa,kx as LB,dU as kc,ky as FB,kz as Em,kA as zB,kB as BB,kC as Sc,e1 as UB,kD as Im,kE as zs,kF as Cc,kG as Bs,fW as Yn,g5 as Uo,fT as k4,cr as S4,kH as Am,fF as C4,kI as Tm,kJ as N4,kK as ia,kL as j4,kM as Nc,kN as Mm,kO as aa,kP as la,kQ as ca,kR as VB,fP as jc,kS as Ec,kT as Ic,eh as $B,fQ as HB,kU as WB,kV as qB,kW as GB,kX as YB,r as JB,kY as KB,kZ as XB,k_ as ZB,f_ as QB,k$ as cr,l0 as eU,l1 as E4,t as P,l2 as tU,l3 as nU,l4 as oU,l5 as rU,l6 as sU,l7 as iU,l8 as aU,l9 as lU,la as cU,lb as dU,lc as uU,ld as hU,le as fU,lf as mU,lg as pU,lh as gU,li as _U,lj as bU,lk as xU,ll as yU,lm as wU,ln as vU,lo as kU,lp as SU,lq as CU,lr as NU,ls as jU,lt as EU,lu as IU,lv as Om,lw as Ac,lx as I4,ly as AU,lz as TU,lA as A4,lB as MU,lC as Us,lD as Jn,lE as OU,lF as DU,lG as RU,lH as PU,lI as LU,lJ as FU,lK as zU,lL as BU,lM as UU,lN as VU,lO as dr,lP as $U,lQ as HU,lR as WU,lS as qU,d_ as GU,lT as YU,lU as T4,e2 as JU,lV as Tc,lW as KU,lX as XU,lY as ZU,lZ as QU,Y as ur,l_ as Mc,l$ as eV,m0 as tV,m1 as M4,m2 as Dm,gD as Vs,m3 as nV,m4 as oV,m5 as rV,m6 as sV,g3 as iV,bs as aV,a0 as Rm,m7 as O4,m8 as lV,m9 as cV,ma as Pm,mb as Lm,mc as dV,md as D4,me as R4,mf as Oc,fS as uV,ad as P4,dM as hV,mg as L4,fr as jt,mh as da,mi as $s,mj as fV,mk as mV,ml as Fm,mm as pV,cq as zm,mn as gV,V as hr,bi as F4,mo as _V,mp as bV,mq as Dc,mr as z4,dK as Rc,bu as B4,ms as xV,mt as yV,mu as U4,mv as wV,mw as vV,mx as V4,ae as Pc,my as kV,bw as $4,mz as SV,eO as CV,mA as Vo,el as H4,mB as W4,eS as q4,fJ as Lc,mC as Bm,mD as G4,aV as Um,em as Fc,mE as Y4,mF as NV,mG as jV,mH as EV,fq as IV,mI as AV,gu as TV,fx as MV,fB as Vm,gx as OV,br as ua,mJ as DV,mK as J4,mL as $m,mM as RV,mN as PV,mO as LV,af as In,mP as FV,mQ as zV,mR as K4,fj as Hm,dG as X4,mS as BV,mT as UV,mU as VV,aP as $V,mV as HV,mW as WV,mX as qV,mY as GV,ab as YV,mZ as zc,ac as JV,m_ as Z4,ff as KV,m$ as Q4,fN as XV,n0 as ZV,gs as QV,n1 as e$,n2 as eS,n3 as t$,n4 as Hs,n5 as n$,n6 as Bc,n7 as o$,n8 as r$,z as tS,n9 as s$,dm as i$,na as ha,nb as nS,nc as oS,nd as rS,ne as sS,nf as a$,C as iS,ng as l$,nh as c$,ni as d$,E as Br,f1 as aS,bf as u$,bd as h$,nj as f$,nk as m$,a3 as Uc,nl as p$,a4 as fr,dJ as lS,nm as Wm,nn as g$,dW as cS,no as _$,np as dS,nq as b$,nr as uS,ns as x$,nt as y$,nu as hS,nv as fS,nw as mS,fd as pS,nx as w$,ny as v$,nz as gS,nA as _S,nB as Vc,nC as bS,nD as xS,nE as k$,nF as yS,nG as S$,nH as C$,nI as wS,nJ as N$,nK as j$,nL as E$,nM as I$,nN as A$,nO as T$,dT as M$,nP as O$,nQ as D$,g4 as qm,nR as R$,nS as P$,nT as L$,nU as F$,nV as z$,nW as B$,nX as U$,nY as V$,nZ as $$,n_ as H$,n$ as Gm,o0 as W$,fV as q$,o1 as G$,o2 as Y$,o3 as J$,o4 as vS,o5 as K$,a9 as X$,o6 as Z$,a2 as Q$,eI as eH,gm as tH,o7 as nH,o8 as oH,go as Ym,gk as Ws,gp as Ur,gl as Vr,gq as Jm,gr as Km,o9 as kS,gn as rH,oa as SS,ob as sH,oc as CS,od as mr,oe as NS,gw as iH,of as aH,og as lH,oh as cH,oi as dH,oj as uH,ok as hH,ol as jS,ez as fH,om as Xm,ax as $c,on as ES,oo as IS,az as AS,ay as mH,dS as pH,__tla as gH}from"./index-j8CmuYN5.js";import{b as qs,A as _H,L as TS,g as bH,G as xH,o as MS,s as yH,k as wH,B as OS,a as vH,M as kH,Y as SH,c as xn,u as fa,C as CH,S as NH,K as jH,d as EH,i as IH,e as DS,f as AH,h as TH,j as ma,P as pa,l as RS,m as MH,n as OH,p as DH,q as RH,r as PS,t as Zm,T as PH}from"./links-B2AS4wbN.js";import{V as LS,d as Gs,I as Qm,N as FS,S as zS,e as BS,f as US,L as VS,g as $S,F as HS,M as LH,l as WS,h as FH,j as po,k as Hc,m as Wc,i as zH,E as qS,n as BH,o as ep,p as UH,q as VH,s as $H,t as HH,v as WH,w as qH,x as GH,y as YH,a as JH,C as KH,R as GS,A as XH,b as ZH,T as QH,z as eW,B as tW,D as nW,G as oW,O as rW,c as sW,P as iW,__tla as aW}from"./storage-BaEQKmhG.js";import{c as lW}from"./_createAggregator-CEOx6Mv_.js";import{s as to,i as pr,T as tp,a as np}from"./transform-DetRMEbJ.js";import{g as YS}from"./timer-Bqd5yn_a.js";import{i as cW}from"./zoom-COrs4lFh.js";import{s as ga}from"./sortBy-CWBD-dXG.js";let op,qc,yn,Gc,JS,_a,dW=Promise.all([(()=>{try{return gH}catch{}})(),(()=>{try{return aW}catch{}})()]).then(async()=>{var Jl,C3;var Lt=lW(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});let Et,fn,rp,Yc,Ys,$r,sp,ip,ap,lp,ba,Jc,cp,xa,dp,Kc,up,hp,Xc,fp,mp,pp,ya,gp,Zc,_p,bp,xp,yp,wp,vp,Qc,kp,ed,td,Sp,Cp,Np,jp,Ep,wa,Ip,Ap,nd,Tp,Mp,Op,od,Dp,Rp,Pp,va,rd,sd,Lp,Fp,zp,Bp,Up,Vp,$p,Hp,Wp,id,ad,qp,Gp,Yp,ka,An,Tn;Et=Oe("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),fn=Oe("arrow-right-to-line",[["path",{d:"M17 12H3",key:"8awo09"}],["path",{d:"m11 18 6-6-6-6",key:"8c2y43"}],["path",{d:"M21 5v14",key:"nzette"}]]),rp=Oe("arrow-right-from-line",[["path",{d:"M3 5v14",key:"1nt18q"}],["path",{d:"M21 12H7",key:"13ipq5"}],["path",{d:"m15 18 6-6-6-6",key:"6tx3qv"}]]),Yc=Oe("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),Ys=Oe("ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]),$r=Oe("between-horizontal-start",[["rect",{width:"13",height:"7",x:"8",y:"3",rx:"1",key:"pkso9a"}],["path",{d:"m2 9 3 3-3 3",key:"1agib5"}],["rect",{width:"13",height:"7",x:"8",y:"14",rx:"1",key:"1q5fc1"}]]),sp=Oe("chevrons-down",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]),ip=Oe("chevrons-up",[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]]),Gc=Oe("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),ap=Oe("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),lp=Oe("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),ba=Oe("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),Jc=Oe("clipboard-copy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]),cp=Oe("clipboard-paste",[["path",{d:"M11 14h10",key:"1w8e9d"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v1.344",key:"1e62lh"}],["path",{d:"m17 18 4-4-4-4",key:"z2g111"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113",key:"bjbb7m"}],["rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",key:"ublpy"}]]),xa=Oe("cloud-download",[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]]),dp=Oe("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]),Kc=Oe("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"}]]),up=Oe("copy-minus",[["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),hp=Oe("diamond-plus",[["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41L13.7 2.71a2.41 2.41 0 0 0-3.41 0z",key:"1ey20j"}],["path",{d:"M8 12h8",key:"1wcyev"}]]),Xc=Oe("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),fp=Oe("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"}]]),mp=Oe("fast-forward",[["polygon",{points:"13 19 22 12 13 5 13 19",key:"587y9g"}],["polygon",{points:"2 19 11 12 2 5 2 19",key:"3pweh0"}]]),pp=Oe("file-pen",[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]]),ya=Oe("file-plus-2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M3 15h6",key:"4e2qda"}],["path",{d:"M6 12v6",key:"1u72j0"}]]),gp=Oe("files",[["path",{d:"M20 7h-3a2 2 0 0 1-2-2V2",key:"x099mo"}],["path",{d:"M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z",key:"18t6ie"}],["path",{d:"M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8",key:"1nja0z"}]]),Zc=Oe("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"}]]),_p=Oe("folder-tree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]),bp=Oe("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),xp=Oe("hard-drive-download",[["path",{d:"M12 2v8",key:"1q4o3n"}],["path",{d:"m16 6-4 4-4-4",key:"6wukr"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",key:"w68u3i"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 18h.01",key:"h775k"}]]),yp=Oe("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]),wp=Oe("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]),vp=Oe("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]),Qc=Oe("key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]),kp=Oe("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]),ed=Oe("layout-template",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]),td=Oe("list-tree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]),Sp=Oe("list",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]),Cp=Oe("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]),Np=Oe("memory-stick",[["path",{d:"M6 19v-3",key:"1nvgqn"}],["path",{d:"M10 19v-3",key:"iu8nkm"}],["path",{d:"M14 19v-3",key:"kcehxu"}],["path",{d:"M18 19v-3",key:"1vh91z"}],["path",{d:"M8 11V9",key:"63erz4"}],["path",{d:"M16 11V9",key:"fru6f3"}],["path",{d:"M12 11V9",key:"ha00sb"}],["path",{d:"M2 15h20",key:"16ne18"}],["path",{d:"M2 7a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v1.1a2 2 0 0 0 0 3.837V17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-5.1a2 2 0 0 0 0-3.837Z",key:"lhddv3"}]]),jp=Oe("message-circle-question-mark",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Ep=Oe("microchip",[["path",{d:"M18 12h2",key:"quuxs7"}],["path",{d:"M18 16h2",key:"zsn3lv"}],["path",{d:"M18 20h2",key:"9x5y9y"}],["path",{d:"M18 4h2",key:"1luxfb"}],["path",{d:"M18 8h2",key:"nxqzg"}],["path",{d:"M4 12h2",key:"1ltxp0"}],["path",{d:"M4 16h2",key:"8a5zha"}],["path",{d:"M4 20h2",key:"27dk57"}],["path",{d:"M4 4h2",key:"10groj"}],["path",{d:"M4 8h2",key:"18vq6w"}],["path",{d:"M8 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2h-1.5c-.276 0-.494.227-.562.495a2 2 0 0 1-3.876 0C9.994 2.227 9.776 2 9.5 2z",key:"1681fp"}]]),wa=Oe("network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]),Ip=Oe("octagon-alert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]),Ap=Oe("package-check",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),nd=Oe("package-x",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["path",{d:"m17 13 5 5m-5 0 5-5",key:"im3w4b"}]]),Tp=Oe("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Mp=Oe("party-popper",[["path",{d:"M5.8 11.3 2 22l10.7-3.79",key:"gwxi1d"}],["path",{d:"M4 3h.01",key:"1vcuye"}],["path",{d:"M22 8h.01",key:"1mrtc2"}],["path",{d:"M15 2h.01",key:"1cjtqr"}],["path",{d:"M22 20h.01",key:"1mrys2"}],["path",{d:"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10",key:"hbicv8"}],["path",{d:"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17",key:"1i94pl"}],["path",{d:"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7",key:"1cofks"}],["path",{d:"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z",key:"4kbmks"}]]),Op=Oe("pen-line",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]),od=Oe("presentation",[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]),Dp=Oe("regex",[["path",{d:"M17 3v10",key:"15fgeh"}],["path",{d:"m12.67 5.5 8.66 5",key:"1gpheq"}],["path",{d:"m12.67 10.5 8.66-5",key:"1dkfa6"}],["path",{d:"M9 17a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-2z",key:"swwfx4"}]]),Rp=Oe("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),Pp=Oe("rows-3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]]),va=Oe("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]),rd=Oe("scissors",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]),sd=Oe("scroll-text",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]),Lp=Oe("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),Fp=Oe("square-code",[["path",{d:"m10 9-3 3 3 3",key:"1oro0q"}],["path",{d:"m14 15 3-3-3-3",key:"bz13h7"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]),zp=Oe("square-dashed-bottom-code",[["path",{d:"M10 9.5 8 12l2 2.5",key:"3mjy60"}],["path",{d:"M14 21h1",key:"v9vybs"}],["path",{d:"m14 9.5 2 2.5-2 2.5",key:"1bir2l"}],["path",{d:"M5 21a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2",key:"as5y1o"}],["path",{d:"M9 21h1",key:"15o7lz"}]]),Bp=Oe("square-equal",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 10h10",key:"1101jm"}],["path",{d:"M7 14h10",key:"1mhdw3"}]]),Up=Oe("square-m",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 16V8l4 4 4-4v8",key:"141u4e"}]]),Vp=Oe("square-play",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 8 6 4-6 4Z",key:"f1r3lt"}]]),$p=Oe("square-power",[["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M7.998 9.003a5 5 0 1 0 8-.005",key:"1pek45"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]),Hp=Oe("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]),Wp=Oe("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"}]]),id=Oe("text-search",[["path",{d:"M21 6H3",key:"1jwq7v"}],["path",{d:"M10 12H3",key:"1ulcyk"}],["path",{d:"M10 18H3",key:"13769t"}],["circle",{cx:"17",cy:"15",r:"3",key:"1upz2a"}],["path",{d:"m21 19-1.9-1.9",key:"dwi7p8"}]]),ad=Oe("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"}]]),qp=Oe("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]),Gp=Oe("view",[["path",{d:"M21 17v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2",key:"mrq65r"}],["path",{d:"M21 7V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2",key:"be3xqs"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["path",{d:"M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0",key:"11ak4c"}]]),Yp=Oe("whole-word",[["circle",{cx:"7",cy:"12",r:"3",key:"12clwm"}],["path",{d:"M10 9v6",key:"17i7lo"}],["circle",{cx:"17",cy:"12",r:"3",key:"gl7c2s"}],["path",{d:"M14 7v8",key:"dl84cr"}],["path",{d:"M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1",key:"lt2kga"}]]),ka=Oe("workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]),An=Oe("zap-off",[["path",{d:"M10.513 4.856 13.12 2.17a.5.5 0 0 1 .86.46l-1.377 4.317",key:"193nxd"}],["path",{d:"M15.656 10H20a1 1 0 0 1 .78 1.63l-1.72 1.773",key:"27a7lr"}],["path",{d:"M16.273 16.273 10.88 21.83a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14H4a1 1 0 0 1-.78-1.63l4.507-4.643",key:"1e0qe9"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),Tn=Oe("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);const KS=M.createContext({}),XS=M.forwardRef(function(t,e){[t,e]=Nz(t,e,KS);let{toolbarProps:n}=function(s,i){const{"aria-label":a,"aria-labelledby":l,orientation:d="horizontal"}=s;let[u,h]=M.useState(!1);kz(()=>{var p;h(!(!i.current||!(!((p=i.current.parentElement)===null||p===void 0)&&p.closest('[role="toolbar"]'))))});const{direction:f}=Sz(),m=f==="rtl"&&d==="horizontal";let _=Cz(i);const g=M.useRef(null);return{toolbarProps:{...T3(s,{labelable:!0}),role:u?"group":"toolbar","aria-orientation":d,"aria-label":a,"aria-labelledby":a==null?l:void 0,onKeyDownCapture:u?void 0:p=>{if(p.currentTarget.contains(p.target)){if(d==="horizontal"&&p.key==="ArrowRight"||d==="vertical"&&p.key==="ArrowDown")m?_.focusPrevious():_.focusNext();else{if(!(d==="horizontal"&&p.key==="ArrowLeft"||d==="vertical"&&p.key==="ArrowUp"))return p.key==="Tab"?(p.stopPropagation(),g.current=document.activeElement,void(p.shiftKey?_.focusFirst():_.focusLast())):void 0;m?_.focusNext():_.focusPrevious()}p.stopPropagation(),p.preventDefault()}},onFocusCapture:u?void 0:p=>{var b,x;g.current&&!p.currentTarget.contains(p.relatedTarget)&&(!((b=i.current)===null||b===void 0)&&b.contains(p.target))&&((x=g.current)===null||x===void 0||x.focus(),g.current=null)},onBlurCapture:u?void 0:p=>{p.currentTarget.contains(p.relatedTarget)||g.current||(g.current=p.target)}}}}(t,e),o=jz({...t,values:{orientation:t.orientation||"horizontal"},defaultClassName:"react-aria-Toolbar"}),r=T3(t);return delete r.id,X.createElement("div",{...Ez(n,r),...o,ref:e,slot:t.slot||void 0,"data-orientation":t.orientation||"horizontal"},o.children)});function Sa(t,e){const n=+Ir(t)-+Ir(e);return n<0?-1:n>0?1:n}function ZS(t,e){const n=Ir(t,e==null?void 0:e.in);return+function(o,r){const s=Ir(o,r==null?void 0:r.in);return s.setHours(23,59,59,999),s}(n,e)==+function(o,r){const s=Ir(o,r==null?void 0:r.in),i=s.getMonth();return s.setFullYear(s.getFullYear(),i+1,0),s.setHours(23,59,59,999),s}(n,e)}function QS(t,e,n){const[o,r,s]=nm(n==null?void 0:n.in,t,t,e),i=Sa(r,s),a=Math.abs(function(u,h,f){const[m,_]=nm(f==null?void 0:f.in,u,h);return 12*(m.getFullYear()-_.getFullYear())+(m.getMonth()-_.getMonth())}(r,s));if(a<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-i*a);let l=Sa(r,s)===-i;ZS(o)&&a===1&&Sa(o,s)===1&&(l=!1);const d=i*(a-+l);return d===0?0:d}function eC(t,e,n){const o=function(r,s){return+Ir(r)-+Ir(s)}(t,e)/1e3;return(r=>{const s=(0,Math.trunc)(r);return s===0?0:s})(o)}function tC(t,e){return function(n,o,r){const s=Az(),i=(r==null?void 0:r.locale)??s.locale??Tz,a=Sa(n,o);if(isNaN(a))throw new RangeError("Invalid time value");const l=Object.assign({},r,{addSuffix:r==null?void 0:r.addSuffix,comparison:a}),[d,u]=nm(r==null?void 0:r.in,...a>0?[o,n]:[n,o]),h=eC(u,d),f=(M3(u)-M3(d))/1e3,m=Math.round((h-f)/60);let _;if(m<2)return m===0?i.formatDistance("lessThanXMinutes",1,l):i.formatDistance("xMinutes",m,l);if(m<45)return i.formatDistance("xMinutes",m,l);if(m<90)return i.formatDistance("aboutXHours",1,l);if(m<O3){const g=Math.round(m/60);return i.formatDistance("aboutXHours",g,l)}if(m<2520)return i.formatDistance("xDays",1,l);if(m<Kl){const g=Math.round(m/O3);return i.formatDistance("xDays",g,l)}if(m<2*Kl)return _=Math.round(m/Kl),i.formatDistance("aboutXMonths",_,l);if(_=QS(u,d),_<12){const g=Math.round(m/Kl);return i.formatDistance("xMonths",g,l)}{const g=_%12,p=Math.trunc(_/12);return g<3?i.formatDistance("aboutXYears",p,l):g<9?i.formatDistance("overXYears",p,l):i.formatDistance("almostXYears",p+1,l)}}(t,function(n){return Iz(n,Date.now())}(t),e)}const Ca="https://static.marimo.app",nC=t=>{const e=K.c(24),{onClose:n}=t,[o,r]=M.useState("");let s;s=Math.random().toString(36).slice(2,6);const i=`${o}-${s}`,a=`${Ca}/static/${i}`;let l,d,u,h,f,m,_,g,p,b,x;return e[0]!==n||e[1]!==i?(l=async y=>{y.preventDefault(),n();const v=await Mz({download:!1,includeCode:!0,files:LS.INSTANCE.filenames()}),C=ct({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${Ca}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:v,path:i})}).catch(()=>{C.dismiss(),ct({title:"Error uploading static page",description:c.jsxs("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",c.jsx("a",{href:Qn.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),C.dismiss(),ct({title:"Static page uploaded!",description:c.jsxs("div",{children:["The URL has been copied to your clipboard.",c.jsx("br",{}),"You can share it with anyone."]})})},e[0]=n,e[1]=i,e[2]=l):l=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(d=c.jsx(rr,{children:"Share static notebook"}),e[3]=d):d=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(u=c.jsxs(Es,{children:[d,c.jsxs(Is,{children:["You can publish a static, non-interactive version of this notebook to the public web. We will create a link for you that lives on"," ",c.jsx("a",{href:Ca,target:"_blank",children:Ca}),"."]})]}),e[4]=u):u=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(h=y=>{const v=y.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,"");r(v)},e[5]=h):h=e[5],e[6]!==o?(f=c.jsx(sr,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:h,required:!0,autoComplete:"off"}),e[6]=o,e[7]=f):f=e[7],e[8]!==a?(m=c.jsxs("div",{className:"font-semibold text-sm text-muted-foreground gap-2 flex flex-col",children:["Anyone will be able to access your notebook at this URL:",c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(oC,{text:a}),c.jsx("span",{className:"text-primary",children:a})]})]}),e[8]=a,e[9]=m):m=e[9],e[10]!==f||e[11]!==m?(_=c.jsxs("div",{className:"flex flex-col gap-6 py-4",children:[f,m]}),e[10]=f,e[11]=m,e[12]=_):_=e[12],e[13]!==n?(g=c.jsx(Me,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),e[13]=n,e[14]=g):g=e[14],e[15]!==a?(p=c.jsx(Me,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await bn(a)},children:"Create"}),e[15]=a,e[16]=p):p=e[16],e[17]!==p||e[18]!==g?(b=c.jsxs(Wi,{children:[g,p]}),e[17]=p,e[18]=g,e[19]=b):b=e[19],e[20]!==b||e[21]!==l||e[22]!==_?(x=c.jsx(ir,{className:"w-fit",children:c.jsxs("form",{onSubmit:l,children:[u,_,b]})}),e[20]=b,e[21]=l,e[22]=_,e[23]=x):x=e[23],x},oC=t=>{const e=K.c(8),[n,o]=X.useState(!1);let r;e[0]!==t.text?(r=Hn.stopPropagation(async d=>{d.preventDefault(),await bn(t.text),o(!0),setTimeout(()=>o(!1),2e3)}),e[0]=t.text,e[1]=r):r=e[1];const s=r;let i,a,l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(qi,{size:14,strokeWidth:1.5}),e[2]=i):i=e[2],e[3]!==s?(a=c.jsx(Me,{"data-testid":"copy-static-notebook-url-button",onClick:s,size:"xs",variant:"secondary",children:i}),e[3]=s,e[4]=a):a=e[4],e[5]!==n||e[6]!==a?(l=c.jsx(Te,{content:"Copied!",open:n,children:a}),e[5]=n,e[6]=a,e[7]=l):l=e[7],l};function Jp(){const t=K.c(2),e=Zt(om);let n;return t[0]!==e?(n=()=>{const o=document.getElementsByClassName("output-area"),r=window.innerHeight||document.documentElement.clientHeight;let s=null;for(const i of Array.from(o)){const a=i.getBoundingClientRect();if(a.top>=0&&a.top<=r||a.bottom>=0&&a.bottom<=r){s=As.parse(i.parentNode.id);break}}e(i=>({mode:Oz(i.mode),cellAnchor:s})),requestAnimationFrame(()=>{var i;s!==null&&((i=document.getElementById(As.create(s)))==null||i.scrollIntoView())})},t[0]=e,t[1]=n):n=t[1],n}function ld(t){const e=K.c(3),n=cd();let o;return e[0]!==t||e[1]!==n?(o=()=>{t!==void 0&&n([t])},e[0]=t,e[1]=n,e[2]=o):o=e[2],Ke(o)}function Kp(){const t=K.c(2),e=cd();let n;return t[0]!==e?(n=()=>e(D3(Wn())),t[0]=e,t[1]=n):n=t[1],Ke(n)}function cd(){const t=K.c(2),{prepareForRun:e}=Mt();let n;return t[0]!==e?(n=async o=>{var a,l;if(o.length===0)return;const{cellHandles:r,cellData:s}=Wn(),i=[];for(const d of o){const u=r[d],h=(a=u==null?void 0:u.current)==null?void 0:a.editorView;let f;h?(R3(h)!=="markdown"&&rm(h),f=P3(h)):f=((l=s[d])==null?void 0:l.code)||"",i.push(f),e({cellId:d})}await Rz({cellIds:o,codes:i}).catch(rC)},t[0]=e,t[1]=n):n=t[1],Ke(n)}function rC(t){Ct.error(t)}const dd=[{type:"files",Icon:_p,tooltip:"View files",position:"sidebar"},{type:"variables",Icon:Xl,tooltip:"Explore variables",position:"sidebar"},{type:"datasources",Icon:ar,tooltip:"Explore data sources",position:"sidebar"},{type:"dependencies",Icon:wa,tooltip:"Explore dependencies",position:"sidebar"},{type:"packages",Icon:qs,tooltip:"Manage packages",position:"sidebar"},{type:"outline",Icon:sd,tooltip:"View outline",position:"sidebar"},{type:"chat",Icon:Zl,tooltip:"Chat with AI",position:"sidebar"},{type:"documentation",Icon:id,tooltip:"View live docs",position:"sidebar"},{type:"logs",Icon:sm,tooltip:"Notebook logs",position:"sidebar"},{type:"tracing",Icon:_H,tooltip:"Tracing",position:"sidebar"},{type:"snippets",Icon:zp,tooltip:"Snippets",position:"sidebar"},{type:"secrets",Icon:vp,tooltip:"Secrets",hidden:un(),position:"sidebar"},{type:"scratchpad",Icon:Pz,tooltip:"Scratchpad",position:"sidebar"},{type:"errors",Icon:Ql,tooltip:"View errors",position:"footer"}];function sC(){const t=K.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],t[0]=e):e=t[0];const[n,o]=function(i,a){const l=K.c(11);let d;l[0]!==a?(d=new Lz(a),l[0]=a,l[1]=d):d=l[1];const u=d;let h;l[2]!==i||l[3]!==u?(h=()=>u.get(i),l[2]=i,l[3]=u,l[4]=h):h=l[4];const[f,m]=M.useState(h);let _;l[5]!==i||l[6]!==u?(_=b=>{m(b),u.set(i,b)},l[5]=i,l[6]=u,l[7]=_):_=l[7];const g=_;let p;return l[8]!==g||l[9]!==f?(p=[f,g],l[8]=g,l[9]=f,l[10]=p):p=l[10],p}("marimo:commands",e);let r,s;return t[1]!==n||t[2]!==o?(r=i=>{const a=(l=[i,...n],[...new Set(l)]);var l;o(a.slice(0,3))},t[1]=n,t[2]=o,t[3]=r):r=t[3],t[4]!==n||t[5]!==r?(s={recentCommands:n,addRecentCommand:r},t[4]=n,t[5]=r,t[6]=s):s=t[6],s}function Xp(t){return t.dropdown!==void 0}function Na(t,e=""){return t.flatMap(n=>n.label?Xp(n)?Na(n.dropdown,`${e+n.label} > `):{...n,label:e+n.label}:[])}const Js=t=>{const e=K.c(8),{children:n,layerTop:o}=t,r=o!==void 0&&o;let s;e[0]!==n?(s=X.Children.toArray(n),e[0]=n,e[1]=s):s=e[1];const[i,a]=s,l=`second-icon absolute ${r?"top-[-2px] left-[-2px]":"bottom-[-2px] right-[-2px]"} rounded-full`;let d,u;return e[2]!==a||e[3]!==l?(d=c.jsx("div",{className:l,children:a}),e[2]=a,e[3]=l,e[4]=d):d=e[4],e[5]!==i||e[6]!==d?(u=c.jsxs("div",{className:"multi-icon relative w-fit",children:[i,d]}),e[5]=i,e[6]=d,e[7]=u):u=e[7],u},ja=qt(null),iC=qt(!1),ud=z3("marimo:ai:chatState:v3",{chats:[],activeChatId:null}),aC=qt(t=>{const e=t(ud);return e.chats.find(n=>n.id===e.activeChatId)},(t,e,n)=>{e(ud,o=>({...o,activeChatId:n}))});function Zp(t){return t!==B3&&!!(t&&t.trim().length>0)}const hd=t=>{const e=K.c(7);let n,o;e[0]!==t?(n=a=>{var l;(a.ctrlKey||a.metaKey)&&a.key==="z"&&(a.preventDefault(),a.stopPropagation(),(l=t.onClick)==null||l.call(t,a))},e[0]=t,e[1]=n):n=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(o={capture:!0},e[2]=o):o=e[2],im(window,"keydown",n,o);const r=t.children??"Undo";let s,i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(s=c.jsx(Fz,{className:"ml-2",shortcut:"cmd-z"}),e[3]=s):s=e[3],e[4]!==r||e[5]!==t?(i=c.jsxs(Me,{"data-testid":"undo-button",size:"sm",variant:"outline",...t,children:[r," ",s]}),e[4]=r,e[5]=t,e[6]=i):i=e[6],i};function fd(){const t=K.c(3),{deleteCell:e,undoDeleteCell:n}=Mt();let o;return t[0]!==e||t[1]!==n?(o=r=>{var l;if(at.get(U3))return;const{cellId:s}=r,i=at.get(am),a=(((l=i.cellData[s])==null?void 0:l.code)??"").trim()==="";if(e({cellId:s}),zz({cellId:s}).catch(()=>{n()}),!a){const{dismiss:d}=ct({title:"Cell deleted",description:"You can bring it back by clicking undo or through the command palette.",action:c.jsx(hd,{"data-testid":"undo-delete-button",onClick:()=>{n(),u()}})}),u=d}},t[0]=e,t[1]=n,t[2]=o):o=t[2],Ke(o)}function Qp(){const t=K.c(3),{splitCell:e,undoSplitCell:n}=Mt();let o;return t[0]!==e||t[1]!==n?(o=r=>{const s=ec(r.cellId);if(!s)return;const i=P3(s);e(r);const{dismiss:a}=ct({title:"Cell split",action:c.jsx(hd,{"data-testid":"undo-split-button",size:"sm",variant:"outline",onClick:()=>{n({...r,snapshot:i}),l()},children:"Undo"})}),l=a},t[0]=e,t[1]=n,t[2]=o):o=t[2],Ke(o)}function md(t){const e=K.c(49),{cell:n}=t,{createNewCell:o,updateCellConfig:r,updateCellName:s,moveCell:i,sendToTop:a,sendToBottom:l,addColumnBreakpoint:d,clearCellOutput:u}=Mt(),h=Qp(),f=ld(n==null?void 0:n.cellId),m=!Ue(U3),_=fd(),{openModal:g}=qn(),p=Zt(ja),b=Ue(tc),x=Ue(nc),y=Ue(Ts),v=Ue(Bz);if(!n||y){let E;return e[0]===Symbol.for("react.memo_cache_sentinel")?(E=[],e[0]=E):E=e[0],E}const{cellId:C,config:k,getEditorView:N,name:j,hasOutput:I,hasConsoleOutput:T,status:A}=n;let R;e[1]!==C||e[2]!==k.disabled||e[3]!==r?(R=async()=>{const E={disabled:!k.disabled};await Mr({configs:{[C]:E}}),r({cellId:C,config:E})},e[1]=C,e[2]=k.disabled,e[3]=r,e[4]=R):R=e[4];const z=R;let D;e[5]!==C||e[6]!==k.hide_code||e[7]!==N||e[8]!==r?(D=async()=>{const E={hide_code:!k.hide_code};await Mr({configs:{[C]:E}}),r({cellId:C,config:E});const W=N();W&&(E.hide_code?W.contentDOM.blur():W.focus())},e[5]=C,e[6]=k.hide_code,e[7]=N,e[8]=r,e[9]=D):D=e[9];const F=D;let B,U,O,S,$;return e[10]===Symbol.for("react.memo_cache_sentinel")?(B=c.jsx(Wp,{size:13,strokeWidth:1.5}),e[10]=B):B=e[10],e[11]!==C||e[12]!==j||e[13]!==g||e[14]!==s?(U=()=>{g(c.jsxs(ir,{children:[c.jsx(Es,{children:c.jsx(rr,{children:"Rename cell"})}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(Or,{htmlFor:"cell-name",children:"Cell name"}),c.jsx(FS,{placeholder:"cell name",value:j,onKeyDown:E=>{E.key==="Enter"&&(E.preventDefault(),E.stopPropagation(),g(null))},onChange:E=>s({cellId:C,name:E})})]})]}))},e[11]=C,e[12]=j,e[13]=g,e[14]=s,e[15]=U):U=e[15],e[16]!==C||e[17]!==s?(O=E=>s({cellId:C,name:E}),e[16]=C,e[17]=s,e[18]=O):O=e[18],e[19]!==j||e[20]!==O?(S=c.jsx(FS,{placeholder:"cell name",value:j,onChange:O}),e[19]=j,e[20]=O,e[21]=S):S=e[21],e[22]!==d||e[23]!==b||e[24]!==v||e[25]!==x||e[26]!==m||e[27]!==C||e[28]!==u||e[29]!==k.disabled||e[30]!==k.hide_code||e[31]!==o||e[32]!==_||e[33]!==N||e[34]!==T||e[35]!==I||e[36]!==i||e[37]!==j||e[38]!==f||e[39]!==l||e[40]!==a||e[41]!==p||e[42]!==h||e[43]!==A||e[44]!==U||e[45]!==S||e[46]!==z||e[47]!==F?($=[[{icon:B,label:"Name",disableClick:!0,handle:uC,handleHeadless:U,rightElement:S},{icon:c.jsx(Gs,{size:13,strokeWidth:1.5}),label:"Run cell",hotkey:"cell.run",hidden:A==="running"||A==="queued"||A==="disabled-transitively"||k.disabled,handle:()=>f()},{icon:c.jsx(Gi,{size:13,strokeWidth:1.5}),label:"AI completion",hidden:!b,handle:()=>{p(E=>(E==null?void 0:E.cellId)===C?null:{cellId:C})},hotkey:"cell.aiCompletion"},{icon:c.jsx(rd,{size:13,strokeWidth:1.5}),label:"Split cell",hotkey:"cell.splitCell",handle:()=>h({cellId:C})},{icon:c.jsx(Qm,{size:13,strokeWidth:1.5}),label:"Export output as PNG",hidden:!I,handle:()=>function(E){const W=document.getElementById(L3.create(E));W&&(W.classList.add("printing-output"),F3(W,"result.png").finally(()=>{W.classList.remove("printing-output")}))}(C)},{icon:c.jsx(Vz,{size:13,strokeWidth:1.5}),label:"Format cell",hotkey:"cell.format",handle:()=>{const E=N();E&&Uz({[C]:E})}},{icon:k.hide_code?c.jsx(V3,{size:13,strokeWidth:1.5}):c.jsx($3,{size:13,strokeWidth:1.5}),label:k.hide_code?"Show code":"Hide code",handle:F,hotkey:"cell.hideCode"},{icon:k.disabled?c.jsx(An,{size:13,strokeWidth:1.5}):c.jsx(Tn,{size:13,strokeWidth:1.5}),label:"Reactive execution",rightElement:c.jsx(lm,{"data-testid":"cell-disable-switch",checked:!k.disabled,size:"sm",onCheckedChange:z}),handle:z},{icon:c.jsx(Ql,{size:13,strokeWidth:1.5}),label:"Clear output",hidden:!(I||T),handle:()=>{u({cellId:C})}}],[{icon:c.jsx(oc,{}),label:"Convert to Markdown",hotkey:"cell.viewAsMarkdown",handle:()=>{const E=N();E&&(fo(x,o),Ar(E,{language:"markdown",keepCodeAsIs:!1}))}},{icon:c.jsx(ar,{size:13,strokeWidth:1.5}),label:"Convert to SQL",handle:()=>{const E=N();E&&(fo(x,o),Ar(E,{language:"sql",keepCodeAsIs:!1}))}},{icon:c.jsx(rc,{}),label:"Toggle as Python",handle:()=>{const E=N();E&&(fo(x,o),$z(E,"python",{force:!0}))}}],[{icon:c.jsxs(Js,{children:[c.jsx(ba,{size:13,strokeWidth:1.5}),c.jsx(H3,{size:8,strokeWidth:2})]}),label:"Create cell above",hotkey:"cell.createAbove",handle:()=>o({cellId:C,before:!0})},{icon:c.jsxs(Js,{children:[c.jsx(ba,{size:13,strokeWidth:1.5}),c.jsx(Tr,{size:8,strokeWidth:2})]}),label:"Create cell below",hotkey:"cell.createBelow",handle:()=>o({cellId:C,before:!1})},{icon:c.jsx(H3,{size:13,strokeWidth:1.5}),label:"Move cell up",hotkey:"cell.moveUp",handle:()=>i({cellId:C,before:!0})},{icon:c.jsx(Tr,{size:13,strokeWidth:1.5}),label:"Move cell down",hotkey:"cell.moveDown",handle:()=>i({cellId:C,before:!1})},{icon:c.jsx(W3,{size:13,strokeWidth:1.5}),label:"Move cell left",hotkey:"cell.moveLeft",handle:()=>i({cellId:C,direction:"left"}),hidden:v!=="columns"},{icon:c.jsx(Yi,{size:13,strokeWidth:1.5}),label:"Move cell right",hotkey:"cell.moveRight",handle:()=>i({cellId:C,direction:"right"}),hidden:v!=="columns"},{icon:c.jsx(ip,{size:13,strokeWidth:1.5}),label:"Send to top",hotkey:"cell.sendToTop",handle:()=>a({cellId:C,scroll:!1})},{icon:c.jsx(sp,{size:13,strokeWidth:1.5}),label:"Send to bottom",hotkey:"cell.sendToBottom",handle:()=>l({cellId:C,scroll:!1})},{icon:c.jsx(Hz,{size:13,strokeWidth:1.5}),label:"Break into new column",hotkey:"cell.addColumnBreakpoint",hidden:v!=="columns",handle:()=>d({cellId:C})}],[{icon:c.jsx(TS,{size:13,strokeWidth:1.5}),label:"Copy link to cell",disabled:!Zp(j),tooltip:Zp(j)?void 0:"Only named cells can be linked to",handle:async()=>{await bn(function(E){const W=new URL(window.location.href);return W.hash=`scrollTo=${encodeURIComponent(E)}`,W.toString()}(j)),ct({description:"Link copied to clipboard"})}}],[{label:"Delete",hidden:!m,variant:"danger",icon:c.jsx(cm,{size:13,strokeWidth:1.5}),handle:()=>{_({cellId:C})}}]].map(cC).filter(lC),e[22]=d,e[23]=b,e[24]=v,e[25]=x,e[26]=m,e[27]=C,e[28]=u,e[29]=k.disabled,e[30]=k.hide_code,e[31]=o,e[32]=_,e[33]=N,e[34]=T,e[35]=I,e[36]=i,e[37]=j,e[38]=f,e[39]=l,e[40]=a,e[41]=p,e[42]=h,e[43]=A,e[44]=U,e[45]=S,e[46]=z,e[47]=F,e[48]=$):$=e[48],$}function lC(t){return t.length>0}function cC(t){return t.filter(dC)}function dC(t){return!t.hidden}function uC(t){t==null||t.stopPropagation(),t==null||t.preventDefault()}function hC(t){return!t.hidden}const pd=qt(!1),eg=()=>{const t=K.c(37),[e,n]=on(pd),o=qz(),r=Ue(Gz),s=Ue(dm);let i;t[0]!==r?(i={cell:r},t[0]=r,t[1]=i):i=t[1];let a=md(i).flat();a=Na(a);const l=function(){const O=K.c(61),[S,$]=Dr(),[E,W]=q3();let G;O[0]!==$?(G=async Q=>{await Rr({config:Q}).then(()=>{$(Q)})},O[0]=$,O[1]=G):G=O[1];const q=G;let Y;O[2]!==W?(Y=async Q=>{await Wz({config:Q}).then(()=>{W(Q)})},O[2]=W,O[3]=Y):Y=O[3];const te=Y;let oe;if(O[4]!==E||O[5]!==S||O[6]!==te||O[7]!==q){let Q,ue,me,ce,fe;O[9]!==E?(Q=Re=>Re!==E.width,O[9]=E,O[10]=Q):Q=O[10],O[11]!==E||O[12]!==te?(ue=Re=>({label:`App config > Set width=${Re}`,handle:()=>{te({...E,width:Re})}}),O[11]=E,O[12]=te,O[13]=ue):ue=O[13],O[14]!==S||O[15]!==q?(me={label:"Config > Set theme: dark",handle:()=>{q({...S,display:{...S.display,theme:"dark"}})}},O[14]=S,O[15]=q,O[16]=me):me=O[16],O[17]!==S||O[18]!==q?(ce={label:"Config > Set theme: light",handle:()=>{q({...S,display:{...S.display,theme:"light"}})}},O[17]=S,O[18]=q,O[19]=ce):ce=O[19],O[20]!==S||O[21]!==q?(fe={label:"Config > Set theme: system",handle:()=>{q({...S,display:{...S.display,theme:"system"}})}},O[20]=S,O[21]=q,O[22]=fe):fe=O[22];const de=S.keymap.preset==="vim";let ke,Se;O[23]!==S||O[24]!==q?(ke=()=>{q({...S,keymap:{...S.keymap,preset:"vim"}})},O[23]=S,O[24]=q,O[25]=ke):ke=O[25],O[26]!==de||O[27]!==ke?(Se={label:"Config > Switch keymap to VIM",hidden:de,handle:ke},O[26]=de,O[27]=ke,O[28]=Se):Se=O[28];const ie=S.keymap.preset==="default";let je,pe,Ae;O[29]!==S||O[30]!==q?(je=()=>{q({...S,keymap:{...S.keymap,preset:"default"}})},O[29]=S,O[30]=q,O[31]=je):je=O[31],O[32]!==ie||O[33]!==je?(pe={label:"Config > Switch keymap to default (current: VIM)",hidden:ie,handle:je},O[32]=ie,O[33]=je,O[34]=pe):pe=O[34],O[35]!==S||O[36]!==q?(Ae=()=>{q({...S,completion:{...S.completion,copilot:!1}})},O[35]=S,O[36]=q,O[37]=Ae):Ae=O[37];const Fe=S.completion.copilot!=="github";let De,Ve;O[38]!==Ae||O[39]!==Fe?(De={label:"Config > Disable GitHub Copilot",handle:Ae,hidden:Fe},O[38]=Ae,O[39]=Fe,O[40]=De):De=O[40],O[41]!==S||O[42]!==q?(Ve=()=>{q({...S,completion:{...S.completion,copilot:"github"}})},O[41]=S,O[42]=q,O[43]=Ve):Ve=O[43];const Le=S.completion.copilot==="github";let ot;O[44]!==Ve||O[45]!==Le?(ot={label:"Config > Enable GitHub Copilot",handle:Ve,hidden:Le},O[44]=Ve,O[45]=Le,O[46]=ot):ot=O[46];const Qe=!S.display.reference_highlighting;let tt,ne,ve,Ce;O[47]!==S||O[48]!==q?(tt=()=>{q({...S,display:{...S.display,reference_highlighting:!1}})},O[47]=S,O[48]=q,O[49]=tt):tt=O[49],O[50]!==Qe||O[51]!==tt?(ne={label:"Config > Disable reference highlighting",hidden:Qe,handle:tt},O[50]=Qe,O[51]=tt,O[52]=ne):ne=O[52],O[53]!==S||O[54]!==q?(ve=()=>{q({...S,display:{...S.display,reference_highlighting:!0}})},O[53]=S,O[54]=q,O[55]=ve):ve=O[55],O[56]!==S.display.reference_highlighting||O[57]!==ve?(Ce={label:"Config > Enable reference highlighting",hidden:S.display.reference_highlighting,handle:ve},O[56]=S.display.reference_highlighting,O[57]=ve,O[58]=Ce):Ce=O[58],oe=[...bH().filter(Q).map(ue),me,ce,fe,Se,pe,De,ot,ne,Ce],O[4]=E,O[5]=S,O[6]=te,O[7]=q,O[8]=oe}else oe=O[8];const se=oe;let Z;return O[59]!==se?(Z=se.filter(hC),O[59]=se,O[60]=Z):Z=O[60],Z}();let d=Ag();d=[...Na(d),...Na(l)];const u=d.filter(fC),h=sc.keyBy(u,mC),{recentCommands:f,addRecentCommand:m}=sC();let _;t[2]!==f?(_=new Set(f),t[2]=f,t[3]=_):_=t[3];const g=_;let p,b;t[4]!==s||t[5]!==n?(p=O=>{Kz(s.getHotkey("global.commandPalette").key)(O)&&(O.preventDefault(),n(pC))},t[4]=s,t[5]=n,t[6]=p):p=t[6],im(document,"keydown",p),t[7]!==m||t[8]!==s||t[9]!==o||t[10]!==n?(b=(O,S)=>{const $=o[O];if(!$)return null;const E=s.getHotkey(O);return c.jsxs(mo,{disabled:S.disabled,onSelect:()=>{m(O),n(!1),requestAnimationFrame(()=>{$()})},value:E.name,children:[c.jsxs("span",{children:[E.name,S.tooltip&&c.jsx("span",{className:"ml-2",children:S.tooltip})]}),c.jsx(Y3,{children:c.jsx(fm,{shortcut:E.key})})]},O)},t[7]=m,t[8]=s,t[9]=o,t[10]=n,t[11]=b):b=t[11];const x=b;let y;t[12]!==m||t[13]!==s||t[14]!==n?(y=O=>{const{label:S,handle:$,props:E,hotkey:W}=O,G=E===void 0?{}:E;return c.jsxs(mo,{disabled:G.disabled,onSelect:()=>{m(S),n(!1),requestAnimationFrame(()=>{$()})},value:S,children:[c.jsxs("span",{children:[S,G.tooltip&&c.jsxs("span",{className:"ml-2",children:["(",G.tooltip,")"]})]}),W&&c.jsx(Y3,{children:c.jsx(fm,{shortcut:s.getHotkey(W).key})})]},S)},t[12]=m,t[13]=s,t[14]=n,t[15]=y):y=t[15];const v=y,C=Jz;let k;t[16]===Symbol.for("react.memo_cache_sentinel")?(k=c.jsx(Ji,{placeholder:"Type to search..."}),t[16]=k):k=t[16];const N=hm;let j;t[17]===Symbol.for("react.memo_cache_sentinel")?(j=c.jsx(ic,{children:"No results found."}),t[17]=j):j=t[17];const I=f.length>0&&c.jsxs(c.Fragment,{children:[c.jsx(um,{heading:"Recently Used",children:f.map(O=>{const S=h[O];return Yz(O)?x(O,{disabled:S==null?void 0:S.disabled,tooltip:S==null?void 0:S.tooltip}):S&&!Xp(S)?v({label:S.label,handle:S.handleHeadless||S.handle,props:{disabled:S.disabled,tooltip:S.tooltip}}):null})}),c.jsx(G3,{})]}),T=um,A=s.iterate().map(O=>{if(g.has(O))return null;const S=h[O];return x(O,{disabled:S==null?void 0:S.disabled,tooltip:S==null?void 0:S.tooltip})}),R=u.map(O=>g.has(O.label)?null:v({label:O.label,handle:O.handleHeadless||O.handle,props:{disabled:O.disabled,tooltip:O.tooltip}}));let z;t[18]!==g||t[19]!==v?(z=O=>g.has(O.label)?null:v({label:`Cell > ${O.label}`,handle:O.handleHeadless||O.handle,props:{disabled:O.disabled,tooltip:O.tooltip}}),t[18]=g,t[19]=v,t[20]=z):z=t[20];const D=a.map(z);let F,B,U;return t[21]!==T||t[22]!==R||t[23]!==D||t[24]!==A?(F=c.jsxs(T,{heading:"Commands",children:[A,R,D]}),t[21]=T,t[22]=R,t[23]=D,t[24]=A,t[25]=F):F=t[25],t[26]!==N||t[27]!==F||t[28]!==j||t[29]!==I?(B=c.jsxs(N,{children:[j,I,F]}),t[26]=N,t[27]=F,t[28]=j,t[29]=I,t[30]=B):B=t[30],t[31]!==C||t[32]!==e||t[33]!==n||t[34]!==B||t[35]!==k?(U=c.jsxs(C,{open:e,onOpenChange:n,children:[k,B]}),t[31]=C,t[32]=e,t[33]=n,t[34]=B,t[35]=k,t[36]=U):U=t[36],U};function fC(t){return!t.hotkey}function mC(t){return t.label}function pC(t){return!t}function gr(){return ft().optional().describe(qe.of({label:"Password",inputType:"password",placeholder:"password",optionRegex:".*password.*"}))}function tg(){return ft().optional().describe(qe.of({label:"Token",inputType:"password",placeholder:"token",optionRegex:".*token.*"}))}function Ea(){return ft().optional().describe(qe.of({label:"Warehouse Name",placeholder:"warehouse",optionRegex:".*warehouse.*"}))}function ng(){return ft().optional().describe(qe.of({label:"URI",optionRegex:".*uri.*"}))}function _r(){return ft().nonempty().describe(qe.of({label:"Host",placeholder:"localhost",optionRegex:".*host.*"}))}function go(){return ft().describe(qe.of({label:"Database",placeholder:"db name",optionRegex:".*database.*"}))}function br(){return ft().nonempty().describe(qe.of({label:"Username",placeholder:"username",optionRegex:".*username.*"}))}function xr(t){const e=Xz.string().describe(qe.of({label:"Port",inputType:"number",placeholder:t==null?void 0:t.toString()})).transform(Number).refine(n=>n>=0&&n<=65535,{message:"Port must be between 0 and 65535"});return t!==void 0?e.default(t.toString()):e}function og(){return Ms().default(!1).describe(qe.of({label:"Read Only"}))}const rg=yt({type:Nt("postgres"),host:_r(),port:xr(5432).optional(),database:go(),username:br(),password:gr(),ssl:Ms().default(!1).describe(qe.of({label:"Use SSL"}))}).describe(qe.of({direction:"two-columns"})),sg=yt({type:Nt("mysql"),host:_r(),port:xr(3306),database:go(),username:br(),password:gr(),ssl:Ms().default(!1).describe(qe.of({label:"Use SSL"}))}).describe(qe.of({direction:"two-columns"})),ig=yt({type:Nt("sqlite"),database:go().describe(qe.of({label:"Database Path"}))}).describe(qe.of({direction:"two-columns"})),ag=yt({type:Nt("duckdb"),database:go().describe(qe.of({label:"Database Path"})),read_only:og()}).describe(qe.of({direction:"two-columns"})),lg=yt({type:Nt("motherduck"),database:go().default("my_db").describe(qe.of({label:"Database Name"})),token:tg()}).describe(qe.of({direction:"two-columns"})),cg=yt({type:Nt("snowflake"),account:ft().nonempty().describe(qe.of({label:"Account",optionRegex:".*snowflake.*"})),warehouse:ft().optional().describe(qe.of({label:"Warehouse",optionRegex:".*snowflake.*"})),database:go(),schema:ft().optional().describe(qe.of({label:"Schema",optionRegex:".*snowflake.*"})),username:br(),password:gr(),role:ft().optional().describe(qe.of({label:"Role"}))}).describe(qe.of({direction:"two-columns"})),dg=yt({type:Nt("bigquery"),project:ft().nonempty().describe(qe.of({label:"Project ID",optionRegex:".*bigquery.*"})),dataset:ft().nonempty().describe(qe.of({label:"Dataset",optionRegex:".*bigquery.*"})),credentials_json:ft().describe(qe.of({label:"Credentials JSON",inputType:"textarea"}))}).describe(qe.of({direction:"two-columns"})),ug=yt({type:Nt("clickhouse_connect"),host:_r(),port:xr(8123).optional(),username:br(),password:gr(),secure:Ms().default(!1).describe(qe.of({label:"Use HTTPs"}))}).describe(qe.of({direction:"two-columns"})),hg=yt({type:Nt("timeplus"),host:_r().default("localhost"),port:xr(8123).optional(),username:br().default("default"),password:gr().default("")}).describe(qe.of({direction:"two-columns"})),fg=yt({type:Nt("chdb"),database:go().describe(qe.of({label:"Database Path"})),read_only:og()}).describe(qe.of({direction:"two-columns"})),mg=yt({type:Nt("trino"),host:_r(),port:xr(8080),database:go(),schema:ft().describe(qe.of({label:"Schema",placeholder:"schema name",optionRegex:".*schema.*"})).optional(),username:br(),password:gr(),async_support:Ms().default(!1).describe(qe.of({label:"Async Support"}))}).describe(qe.of({direction:"two-columns"})),pg=yt({type:Nt("iceberg"),name:ft().describe(qe.of({label:"Catalog Name"})),catalog:mm("type",[yt({type:Nt("REST"),warehouse:Ea(),uri:ft().optional().describe(qe.of({label:"URI",placeholder:"https://",optionRegex:".*uri.*"})),token:tg()}),yt({type:Nt("SQL"),warehouse:Ea(),uri:ft().optional().describe(qe.of({label:"URI",placeholder:"jdbc:iceberg://host:port/database",optionRegex:".*uri.*"}))}),yt({type:Nt("Hive"),warehouse:Ea(),uri:ng()}),yt({type:Nt("Glue"),warehouse:Ea(),uri:ng()}),yt({type:Nt("DynamoDB"),"dynamodb.profile-name":ft().optional().describe(qe.of({label:"Profile Name"})),"dynamodb.region":ft().optional().describe(qe.of({label:"Region"})),"dynamodb.access-key-id":ft().optional().describe(qe.of({label:"Access Key ID"})),"dynamodb.secret-access-key":ft().optional().describe(qe.of({label:"Secret Access Key",inputType:"password"})),"dynamodb.session-token":ft().optional().describe(qe.of({label:"Session Token",inputType:"password"}))})]).default({type:"REST"}).describe(qe.of({special:"tabs"}))}),gg=yt({type:Nt("datafusion"),sessionContext:Ms().optional().describe(qe.of({label:"Use Session Context"}))}),_g=yt({type:Nt("pyspark"),host:_r().optional(),port:xr().optional()}),bg=yt({type:Nt("redshift"),host:_r(),port:xr(5439),connectionType:mm("type",[yt({type:Nt("IAM credentials"),region:ft().describe(qe.of({label:"Region"})),aws_access_key_id:ft().nonempty().describe(qe.of({label:"AWS Access Key ID",inputType:"password",optionRegex:".*aws_access_key_id.*"})),aws_secret_access_key:ft().nonempty().describe(qe.of({label:"AWS Secret Access Key",inputType:"password",optionRegex:".*aws_secret_access_key.*"})),aws_session_token:ft().optional().describe(qe.of({label:"AWS Session Token",inputType:"password",optionRegex:".*aws_session_token.*"}))}),yt({type:Nt("DB credentials"),user:br(),password:gr()})]).default({type:"IAM credentials",aws_access_key_id:"",aws_secret_access_key:"",region:""}),database:go()}).describe(qe.of({direction:"two-columns"})),gC=mm("type",[rg,sg,ig,ag,lg,cg,dg,ug,hg,fg,mg,pg,gg,_g,bg]),gd="env:";function Ia(t){return typeof t=="string"&&t.startsWith(gd)}function _d(t){return`${gd}${t}`}const xg={sqlmodel:"SQLModel",sqlalchemy:"SQLAlchemy",duckdb:"DuckDB",clickhouse_connect:"ClickHouse Connect",chdb:"chDB",pyiceberg:"PyIceberg",ibis:"Ibis",motherduck:"MotherDuck",redshift:"Redshift"};class sn{constructor(e,n,o){this.connection=void 0,this.orm=void 0,this.secrets=void 0,this.connection=e,this.orm=n,this.secrets=o}get imports(){const e=new Set(this.generateImports());switch(this.orm){case"sqlalchemy":e.add("import sqlalchemy");break;case"sqlmodel":e.add("import sqlmodel");break;case"duckdb":e.add("import duckdb")}return e}}class _C{constructor(){this.secrets={}}get imports(){return Object.keys(this.secrets).length===0?new Set:new Set(["import os"])}print(e,n,o){if(e=(r=>`_${r}`)(e),Ia(n)){const r=n.replace(gd,""),s=o?`os.environ.get("${r}", "${o}")`:`os.environ.get("${r}")`;return this.secrets[e]=s,e}if(o!=null){const r=`os.environ.get("${n}", "${o}")`;return this.secrets[e]=r,e}return typeof n=="number"||typeof n=="number"?`${n}`:typeof n=="boolean"?Hr(n):n?`"${n}"`:""}printInFString(e,n,o){if(n===void 0)return"";if(typeof n=="number")return`${n}`;if(typeof n=="boolean")return Hr(n);const r=this.print(e,n,o);return r.startsWith('"')&&r.endsWith('"')?r.slice(1,-1):`{${r}}`}printPassword(e,n,o){const r=o?this.printInFString.bind(this):this.print.bind(this);return Ia(e)?r("password",e):r("password",n,e)}getSecrets(){return this.secrets}formatSecrets(){return Object.keys(this.secrets).length===0?"":Object.entries(this.secrets).map(([e,n])=>`${e} = ${n}`).join(`
|
3
3
|
`)}}class bC extends sn{generateImports(){return[]}generateConnectionCode(){const e=this.connection.ssl?", connect_args={'sslmode': 'require'}":"",n=this.secrets.printPassword(this.connection.password,"POSTGRES_PASSWORD",!0),o=this.secrets.printInFString("username",this.connection.username),r=this.secrets.printInFString("host",this.connection.host),s=this.secrets.printInFString("port",this.connection.port),i=this.secrets.printInFString("database",this.connection.database);return wt(`
|
4
4
|
DATABASE_URL = f"postgresql://${o}:${n}@${r}:${s}/${i}"
|
5
5
|
engine = ${this.orm}.create_engine(DATABASE_URL${e})
|
@@ -141,4 +141,4 @@ ${T}
|
|
141
141
|
`)}),includeOtherCode:jc("")}),onFinish:T=>{e(A=>eh(A,A.activeChatId,T.id,"assistant",T.content,T.parts))},onToolCall:async({toolCall:T})=>{try{const A=await d$({toolName:T.toolName,arguments:T.args});return A.result||A.error}catch(A){return Ct.error("Tool call failed:",A),`Error: ${A instanceof Error?A.message:String(A)}`}},onError:T=>{Ct.error("An error occurred:",T)},onResponse:T=>{Ct.debug("Received HTTP response from server:",T)}}),k=y==="submitted"||y==="streaming";M.useEffect(()=>{if(!t.activeChatId||f.length===0)return;const T=f[f.length-1];if((T==null?void 0:T.role)!=="user")return;const A=t.chats.find(D=>D.id===t.activeChatId);if(!A)return;const R=new Set(A.messages.map(D=>D.id)),z=f.filter(D=>D.role==="user"&&!R.has(D.id));z.length>0&&e(D=>{let F=D;for(const B of z)F=eh(F,D.activeChatId,B.id,"user",B.content);return F})},[f,t.activeChatId,t.chats,e]);const N=k&&f.length>0&&(T=>{if(T.length===0)return!1;const A=T.at(-1);if(!A||A.role!=="assistant"||!A.parts)return!1;const R=A.parts;return R.length===0?!1:R[R.length-1].type==="reasoning"})(f);M.useEffect(()=>{requestAnimationFrame(()=>{if(l.current){const T=l.current;T.scrollTop=T.scrollHeight}})},[t.activeChatId]);const j=(T,A)=>{g(R=>R.slice(0,T)),t.activeChatId&&e(R=>({...R,chats:R.chats.map(z=>z.id===t.activeChatId?{...z,messages:z.messages.slice(0,T),updatedAt:Date.now()}:z)})),p({role:"user",content:A})},I=()=>{r.trim()&&(T=>{const A=Date.now(),R={id:aS(),title:T.length>50?`${T.slice(0,50)}...`:T,messages:[],createdAt:A,updatedAt:A};e(D=>({...D,chats:[...D.chats,R],activeChatId:R.id}));const z=aS();p({id:z,role:"user",content:T}),_("")})(r.trim())};return c.jsxs("div",{className:"flex flex-col h-[calc(100%-53px)]",children:[c.jsx(Bm,{children:c.jsx(nR,{onNewChat:()=>{o(null),_(""),s("")},activeChatId:n==null?void 0:n.id,setActiveChat:o,chats:[...t.chats].sort((T,A)=>A.updatedAt-T.updatedAt)})}),c.jsxs("div",{className:"flex-1 px-3 bg-[var(--slate-1)] gap-4 py-3 flex flex-col overflow-y-auto",ref:l,children:[(!f||f.length===0)&&c.jsxs("div",{className:"flex flex-col rounded-md border bg-background",children:[c.jsx("div",{className:"px-1",children:c.jsx(Dc,{value:r,placeholder:"Ask anything, @ to include context about tables or dataframes",theme:u,onClose:()=>{var T,A;return(A=(T=i.current)==null?void 0:T.editor)==null?void 0:A.blur()},onChange:s,onSubmit:I},"new-thread-input")}),c.jsx(Oh,{input:r,onSendClick:I,isLoading:k,onStop:C})]}),f.map((T,A)=>c.jsx(gv,{message:T,index:A,theme:u,onEdit:j,setChatState:e,chatState:t,isStreamingReasoning:N,totalMessages:f.length},A)),k&&c.jsx("div",{className:"flex justify-center py-4",children:c.jsx(Rc,{className:"h-4 w-4 animate-spin"})}),x&&c.jsxs("div",{className:"flex items-center justify-center space-x-2 mb-4",children:[c.jsx(Br,{error:x}),c.jsx(Me,{variant:"outline",size:"sm",onClick:()=>{v()},children:"Retry"})]}),c.jsx("div",{ref:d})]}),k&&c.jsx("div",{className:"w-full flex justify-center items-center z-20 border-t",children:c.jsx(Me,{variant:"linkDestructive",size:"sm",onClick:C,children:"Stop"})}),f&&f.length>0&&c.jsx(_v,{input:m,setInput:_,onSubmit:(T,A)=>{A.trim()&&b(T)},theme:u,inputRef:a,isLoading:k,onStop:C})]})};function sR(){}function iR(){}function aR(t){return c.jsx(Ki,{value:t,className:"text-sm",children:t},t)}function dn(t){if(typeof t=="string"||typeof t=="number")return""+t;let e="";if(Array.isArray(t))for(let n,o=0;o<t.length;o++)(n=dn(t[o]))!==""&&(e+=(e&&" ")+n);else for(let n in t)t[n]&&(e+=(e&&" ")+n);return e}const{useDebugValue:lR}=X,{useSyncExternalStoreWithSelector:cR}=f$,dR=t=>t;function bv(t,e=dR,n){const o=cR(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return lR(o),o}const xv=(t,e)=>{const n=m$(t),o=(r,s=e)=>bv(n,r,s);return Object.assign(o,n),o};function tn(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[o,r]of t)if(!Object.is(r,e.get(o)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const o of t)if(!e.has(o))return!1;return!0}const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(e,o)||!Object.is(t[o],e[o]))return!1;return!0}function uo(t,e){if(t=function(s){let i;for(;i=s.sourceEvent;)s=i;return s}(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=t.clientX,o.y=t.clientY,[(o=o.matrixTransform(e.getScreenCTM().inverse())).x,o.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}const uR={passive:!1},Oi={capture:!0,passive:!1};function Dh(t){t.stopImmediatePropagation()}function ps(t){t.preventDefault(),t.stopImmediatePropagation()}function yv(t){var e=t.document.documentElement,n=to(t).on("dragstart.drag",ps,Oi);"onselectstart"in e?n.on("selectstart.drag",ps,Oi):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function wv(t,e){var n=t.document.documentElement,o=to(t).on("dragstart.drag",null);e&&(o.on("click.drag",ps,Oi),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Rl=t=>()=>t;function Rh(t,{sourceEvent:e,subject:n,target:o,identifier:r,active:s,x:i,y:a,dx:l,dy:d,dispatch:u}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:u}})}function hR(t){return!t.ctrlKey&&!t.button}function fR(){return this.parentNode}function mR(t,e){return e??{x:t.x,y:t.y}}function pR(){return navigator.maxTouchPoints||"ontouchstart"in this}Rh.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};const Pl=t=>()=>t;function gR(t,{sourceEvent:e,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function Ph(t){t.stopImmediatePropagation()}function Di(t){t.preventDefault(),t.stopImmediatePropagation()}function _R(t){return!(t.ctrlKey&&t.type!=="wheel"||t.button)}function bR(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function vv(){return this.__zoom||pr}function xR(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function yR(){return navigator.maxTouchPoints||"ontouchstart"in this}function wR(t,e,n){var o=t.invertX(e[0][0])-n[0][0],r=t.invertX(e[1][0])-n[1][0],s=t.invertY(e[0][1])-n[0][1],i=t.invertY(e[1][1])-n[1][1];return t.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),i>s?(s+i)/2:Math.min(0,s)||Math.max(0,i))}const Ll=M.createContext(null),vR=Ll.Provider,kR=t=>`Node type "${t}" not found. Using fallback type "default".`,SR=()=>"The React Flow parent container needs a width and a height to render the graph.",CR=()=>"Only child nodes can use a parent extent.",NR=t=>`Marker type "${t}" doesn't exist.`,jR=(t,e)=>`Couldn't create edge for ${t?"target":"source"} handle id: "${t?e.targetHandle:e.sourceHandle}", edge id: ${e.id}.`,ER=()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",IR=t=>`Edge type "${t}" not found. Using fallback type "default".`,AR=t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,kv="[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001";function mt(t,e){const n=M.useContext(Ll);if(n===null)throw new Error(kv);return bv(n,t,e)}const Ht=()=>{const t=M.useContext(Ll);if(t===null)throw new Error(kv);return M.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe,destroy:t.destroy}),[t])},TR=t=>t.userSelectionActive?"none":"all";function Fl({position:t,children:e,className:n,style:o,...r}){const s=mt(TR),i=`${t}`.split("-");return X.createElement("div",{className:dn(["react-flow__panel",n,...i]),style:{...o,pointerEvents:s},...r},e)}function MR({proOptions:t,position:e="bottom-right"}){return t!=null&&t.hideAttribution?null:X.createElement(Fl,{position:e,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},X.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}var OR=M.memo(({x:t,y:e,label:n,labelStyle:o={},labelShowBg:r=!0,labelBgStyle:s={},labelBgPadding:i=[2,4],labelBgBorderRadius:a=2,children:l,className:d,...u})=>{const h=M.useRef(null),[f,m]=M.useState({x:0,y:0,width:0,height:0}),_=dn(["react-flow__edge-textwrapper",d]);return M.useEffect(()=>{if(h.current){const g=h.current.getBBox();m({x:g.x,y:g.y,width:g.width,height:g.height})}},[n]),n!==void 0&&n?X.createElement("g",{transform:`translate(${t-f.width/2} ${e-f.height/2})`,className:_,visibility:f.width?"visible":"hidden",...u},r&&X.createElement("rect",{width:f.width+2*i[0],x:-i[0],y:-i[1],height:f.height+2*i[1],className:"react-flow__edge-textbg",style:s,rx:a,ry:a}),X.createElement("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:h,style:o},n),l):null});const Lh=t=>({width:t.offsetWidth,height:t.offsetHeight}),gs=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),Fh=(t={x:0,y:0},e)=>({x:gs(t.x,e[0][0],e[1][0]),y:gs(t.y,e[0][1],e[1][1])}),Sv=(t,e,n)=>t<e?gs(Math.abs(t-e),1,50)/50:t>n?-gs(Math.abs(t-n),1,50)/50:0,Cv=(t,e)=>[20*Sv(t.x,35,e.width-35),20*Sv(t.y,35,e.height-35)],Nv=t=>{var e;return((e=t.getRootNode)==null?void 0:e.call(t))||(window==null?void 0:window.document)},zh=({x:t,y:e,width:n,height:o})=>({x:t,y:e,x2:t+n,y2:e+o}),jv=t=>({...t.positionAbsolute||{x:0,y:0},width:t.width||0,height:t.height||0}),Bh=(t,e)=>{const n=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),o=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(n*o)},Un=t=>!isNaN(t)&&isFinite(t),kt=Symbol.for("internals"),Ev=["Enter"," ","Escape"];function Uh(t){var o,r;const e=(s=>"nativeEvent"in s)(t)?t.nativeEvent:t,n=((r=(o=e.composedPath)==null?void 0:o.call(e))==null?void 0:r[0])||t.target;return["INPUT","SELECT","TEXTAREA"].includes(n==null?void 0:n.nodeName)||(n==null?void 0:n.hasAttribute("contenteditable"))||!!(n!=null&&n.closest(".nokey"))}const Iv=t=>"clientX"in t,Zo=(t,e)=>{var s,i;const n=Iv(t),o=n?t.clientX:(s=t.touches)==null?void 0:s[0].clientX,r=n?t.clientY:(i=t.touches)==null?void 0:i[0].clientY;return{x:o-((e==null?void 0:e.left)??0),y:r-((e==null?void 0:e.top)??0)}},zl=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0},Ri=({id:t,path:e,labelX:n,labelY:o,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:d,style:u,markerEnd:h,markerStart:f,interactionWidth:m=20})=>X.createElement(X.Fragment,null,X.createElement("path",{id:t,style:u,d:e,fill:"none",className:"react-flow__edge-path",markerEnd:h,markerStart:f}),m&&X.createElement("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:m,className:"react-flow__edge-interaction"}),r&&Un(n)&&Un(o)?X.createElement(OR,{x:n,y:o,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:d}):null);function Pi(t,e,n){return n===void 0?n:o=>{const r=e().edges.find(s=>s.id===t);r&&n(o,{...r})}}function Av({sourceX:t,sourceY:e,targetX:n,targetY:o}){const r=Math.abs(n-t)/2,s=n<t?n+r:n-r,i=Math.abs(o-e)/2;return[s,o<e?o+i:o-i,r,i]}function Tv({sourceX:t,sourceY:e,targetX:n,targetY:o,sourceControlX:r,sourceControlY:s,targetControlX:i,targetControlY:a}){const l=.125*t+.375*r+.375*i+.125*n,d=.125*e+.375*s+.375*a+.125*o;return[l,d,Math.abs(l-t),Math.abs(d-e)]}var jr,Mv,Qo,Vh,Li,Ov,er,Fi,_s,Dv,Be,Bl;function Rv({pos:t,x1:e,y1:n,x2:o,y2:r}){return t===Be.Left||t===Be.Right?[.5*(e+o),n]:[e,.5*(n+r)]}function Pv({sourceX:t,sourceY:e,sourcePosition:n=Be.Bottom,targetX:o,targetY:r,targetPosition:s=Be.Top}){const[i,a]=Rv({pos:n,x1:t,y1:e,x2:o,y2:r}),[l,d]=Rv({pos:s,x1:o,y1:r,x2:t,y2:e}),[u,h,f,m]=Tv({sourceX:t,sourceY:e,targetX:o,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:l,targetControlY:d});return[`M${t},${e} C${i},${a} ${l},${d} ${o},${r}`,u,h,f,m]}Ri.displayName="BaseEdge",(Mv=jr||(jr={})).Strict="strict",Mv.Loose="loose",(Vh=Qo||(Qo={})).Free="free",Vh.Vertical="vertical",Vh.Horizontal="horizontal",(Ov=Li||(Li={})).Partial="partial",Ov.Full="full",(Fi=er||(er={})).Bezier="default",Fi.Straight="straight",Fi.Step="step",Fi.SmoothStep="smoothstep",Fi.SimpleBezier="simplebezier",(Dv=_s||(_s={})).Arrow="arrow",Dv.ArrowClosed="arrowclosed",(Bl=Be||(Be={})).Left="left",Bl.Top="top",Bl.Right="right",Bl.Bottom="bottom";const $h=M.memo(({sourceX:t,sourceY:e,targetX:n,targetY:o,sourcePosition:r=Be.Bottom,targetPosition:s=Be.Top,label:i,labelStyle:a,labelShowBg:l,labelBgStyle:d,labelBgPadding:u,labelBgBorderRadius:h,style:f,markerEnd:m,markerStart:_,interactionWidth:g})=>{const[p,b,x]=Pv({sourceX:t,sourceY:e,sourcePosition:r,targetX:n,targetY:o,targetPosition:s});return X.createElement(Ri,{path:p,labelX:b,labelY:x,label:i,labelStyle:a,labelShowBg:l,labelBgStyle:d,labelBgPadding:u,labelBgBorderRadius:h,style:f,markerEnd:m,markerStart:_,interactionWidth:g})});$h.displayName="SimpleBezierEdge";const Lv={[Be.Left]:{x:-1,y:0},[Be.Right]:{x:1,y:0},[Be.Top]:{x:0,y:-1},[Be.Bottom]:{x:0,y:1}},Fv=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function DR({source:t,sourcePosition:e=Be.Bottom,target:n,targetPosition:o=Be.Top,center:r,offset:s}){const i=Lv[e],a=Lv[o],l={x:t.x+i.x*s,y:t.y+i.y*s},d={x:n.x+a.x*s,y:n.y+a.y*s},u=(({source:k,sourcePosition:N=Be.Bottom,target:j})=>N===Be.Left||N===Be.Right?k.x<j.x?{x:1,y:0}:{x:-1,y:0}:k.y<j.y?{x:0,y:1}:{x:0,y:-1})({source:l,sourcePosition:e,target:d}),h=u.x!==0?"x":"y",f=u[h];let m,_,g=[];const p={x:0,y:0},b={x:0,y:0},[x,y,v,C]=Av({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(i[h]*a[h]===-1){m=r.x??x,_=r.y??y;const k=[{x:m,y:l.y},{x:m,y:d.y}],N=[{x:l.x,y:_},{x:d.x,y:_}];g=i[h]===f?h==="x"?k:N:h==="x"?N:k}else{const k=[{x:l.x,y:d.y}],N=[{x:d.x,y:l.y}];if(g=h==="x"?i.x===f?N:k:i.y===f?k:N,e===o){const T=Math.abs(t[h]-n[h]);if(T<=s){const A=Math.min(s-1,s-T);i[h]===f?p[h]=(l[h]>t[h]?-1:1)*A:b[h]=(d[h]>n[h]?-1:1)*A}}if(e!==o){const T=h==="x"?"y":"x",A=i[h]===a[T],R=l[T]>d[T],z=l[T]<d[T];(i[h]===1&&(!A&&R||A&&z)||i[h]!==1&&(!A&&z||A&&R))&&(g=h==="x"?k:N)}const j={x:l.x+p.x,y:l.y+p.y},I={x:d.x+b.x,y:d.y+b.y};Math.max(Math.abs(j.x-g[0].x),Math.abs(I.x-g[0].x))>=Math.max(Math.abs(j.y-g[0].y),Math.abs(I.y-g[0].y))?(m=(j.x+I.x)/2,_=g[0].y):(m=g[0].x,_=(j.y+I.y)/2)}return[[t,{x:l.x+p.x,y:l.y+p.y},...g,{x:d.x+b.x,y:d.y+b.y},n],m,_,v,C]}function Hh({sourceX:t,sourceY:e,sourcePosition:n=Be.Bottom,targetX:o,targetY:r,targetPosition:s=Be.Top,borderRadius:i=5,centerX:a,centerY:l,offset:d=20}){const[u,h,f,m,_]=DR({source:{x:t,y:e},sourcePosition:n,target:{x:o,y:r},targetPosition:s,center:{x:a,y:l},offset:d});return[u.reduce((g,p,b)=>{let x="";return x=b>0&&b<u.length-1?function(y,v,C,k){const N=Math.min(Fv(y,v)/2,Fv(v,C)/2,k),{x:j,y:I}=v;if(y.x===j&&j===C.x||y.y===I&&I===C.y)return`L${j} ${I}`;if(y.y===I)return`L ${j+N*(y.x<C.x?-1:1)},${I}Q ${j},${I} ${j},${I+N*(y.y<C.y?1:-1)}`;const T=y.x<C.x?1:-1;return`L ${j},${I+N*(y.y<C.y?-1:1)}Q ${j},${I} ${j+N*T},${I}`}(u[b-1],p,u[b+1],i):`${b===0?"M":"L"}${p.x} ${p.y}`,g+=x},""),h,f,m,_]}const Ul=M.memo(({sourceX:t,sourceY:e,targetX:n,targetY:o,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:d,style:u,sourcePosition:h=Be.Bottom,targetPosition:f=Be.Top,markerEnd:m,markerStart:_,pathOptions:g,interactionWidth:p})=>{const[b,x,y]=Hh({sourceX:t,sourceY:e,sourcePosition:h,targetX:n,targetY:o,targetPosition:f,borderRadius:g==null?void 0:g.borderRadius,offset:g==null?void 0:g.offset});return X.createElement(Ri,{path:b,labelX:x,labelY:y,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:d,style:u,markerEnd:m,markerStart:_,interactionWidth:p})});Ul.displayName="SmoothStepEdge";const Wh=M.memo(t=>{var e;return X.createElement(Ul,{...t,pathOptions:M.useMemo(()=>{var n;return{borderRadius:0,offset:(n=t.pathOptions)==null?void 0:n.offset}},[(e=t.pathOptions)==null?void 0:e.offset])})});Wh.displayName="StepEdge";const qh=M.memo(({sourceX:t,sourceY:e,targetX:n,targetY:o,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:d,style:u,markerEnd:h,markerStart:f,interactionWidth:m})=>{const[_,g,p]=function({sourceX:b,sourceY:x,targetX:y,targetY:v}){const[C,k,N,j]=Av({sourceX:b,sourceY:x,targetX:y,targetY:v});return[`M ${b},${x}L ${y},${v}`,C,k,N,j]}({sourceX:t,sourceY:e,targetX:n,targetY:o});return X.createElement(Ri,{path:_,labelX:g,labelY:p,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:d,style:u,markerEnd:h,markerStart:f,interactionWidth:m})});function Vl(t,e){return t>=0?.5*t:25*e*Math.sqrt(-t)}function zv({pos:t,x1:e,y1:n,x2:o,y2:r,c:s}){switch(t){case Be.Left:return[e-Vl(e-o,s),n];case Be.Right:return[e+Vl(o-e,s),n];case Be.Top:return[e,n-Vl(n-r,s)];case Be.Bottom:return[e,n+Vl(r-n,s)]}}function Bv({sourceX:t,sourceY:e,sourcePosition:n=Be.Bottom,targetX:o,targetY:r,targetPosition:s=Be.Top,curvature:i=.25}){const[a,l]=zv({pos:n,x1:t,y1:e,x2:o,y2:r,c:i}),[d,u]=zv({pos:s,x1:o,y1:r,x2:t,y2:e,c:i}),[h,f,m,_]=Tv({sourceX:t,sourceY:e,targetX:o,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:d,targetControlY:u});return[`M${t},${e} C${a},${l} ${d},${u} ${o},${r}`,h,f,m,_]}qh.displayName="StraightEdge";const $l=M.memo(({sourceX:t,sourceY:e,targetX:n,targetY:o,sourcePosition:r=Be.Bottom,targetPosition:s=Be.Top,label:i,labelStyle:a,labelShowBg:l,labelBgStyle:d,labelBgPadding:u,labelBgBorderRadius:h,style:f,markerEnd:m,markerStart:_,pathOptions:g,interactionWidth:p})=>{const[b,x,y]=Bv({sourceX:t,sourceY:e,sourcePosition:r,targetX:n,targetY:o,targetPosition:s,curvature:g==null?void 0:g.curvature});return X.createElement(Ri,{path:b,labelX:x,labelY:y,label:i,labelStyle:a,labelShowBg:l,labelBgStyle:d,labelBgPadding:u,labelBgBorderRadius:h,style:f,markerEnd:m,markerStart:_,interactionWidth:p})});$l.displayName="BezierEdge";const Gh=M.createContext(null),RR=Gh.Provider;Gh.Consumer;const PR=({source:t,sourceHandle:e,target:n,targetHandle:o})=>`reactflow__edge-${t}${e||""}-${n}${o||""}`,Yh=(t,e)=>t===void 0?"":typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(n=>`${n}=${t[n]}`).join("&")}`,Jh=({x:t,y:e},[n,o,r],s,[i,a])=>{const l={x:(t-n)/r,y:(e-o)/r};return s?{x:i*Math.round(l.x/i),y:a*Math.round(l.y/a)}:l},Uv=({x:t,y:e},[n,o,r])=>({x:t*r+n,y:e*r+o}),bs=(t,e=[0,0])=>{if(!t)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(t.width??0)*e[0],o=(t.height??0)*e[1],r={x:t.position.x-n,y:t.position.y-o};return{...r,positionAbsolute:t.positionAbsolute?{x:t.positionAbsolute.x-n,y:t.positionAbsolute.y-o}:r}},Kh=(t,e=[0,0])=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const n=t.reduce((o,r)=>{const{x:s,y:i}=bs(r,e).positionAbsolute;return a=o,l=zh({x:s,y:i,width:r.width||0,height:r.height||0}),{x:Math.min(a.x,l.x),y:Math.min(a.y,l.y),x2:Math.max(a.x2,l.x2),y2:Math.max(a.y2,l.y2)};var a,l},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return(({x:o,y:r,x2:s,y2:i})=>({x:o,y:r,width:s-o,height:i-r}))(n)},Vv=(t,e,[n,o,r]=[0,0,1],s=!1,i=!1,a=[0,0])=>{const l={x:(e.x-n)/r,y:(e.y-o)/r,width:e.width/r,height:e.height/r},d=[];return t.forEach(u=>{const{width:h,height:f,selectable:m=!0,hidden:_=!1}=u;if(i&&!m||_)return!1;const{positionAbsolute:g}=bs(u,a),p={x:g.x,y:g.y,width:h||0,height:f||0},b=Bh(l,p);(h===void 0||f===void 0||h===null||f===null||s&&b>0||b>=(h||0)*(f||0)||u.dragging)&&d.push(u)}),d},$v=(t,e)=>{const n=t.map(o=>o.id);return e.filter(o=>n.includes(o.source)||n.includes(o.target))},Hv=(t,e,n,o,r,s=.1)=>{const i=e/(t.width*(1+s)),a=n/(t.height*(1+s)),l=Math.min(i,a),d=gs(l,o,r);return{x:e/2-(t.x+t.width/2)*d,y:n/2-(t.y+t.height/2)*d,zoom:d}},Er=(t,e=0)=>t.transition().duration(e);function Wv(t,e,n,o){return(e[n]||[]).reduce((r,s)=>{var i,a;return`${t.id}-${s.id}-${n}`!==o&&r.push({id:s.id||null,type:n,nodeId:t.id,x:(((i=t.positionAbsolute)==null?void 0:i.x)??0)+s.x+s.width/2,y:(((a=t.positionAbsolute)==null?void 0:a.y)??0)+s.y+s.height/2}),r},[])}const LR={source:null,target:null,sourceHandle:null,targetHandle:null},qv=()=>({handleDomNode:null,isValid:!1,connection:LR,endHandle:null});function Gv(t,e,n,o,r,s,i){const a=r==="target",l=i.querySelector(`.react-flow__handle[data-id="${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`),d={...qv(),handleDomNode:l};if(l){const u=Xh(void 0,l),h=l.getAttribute("data-nodeid"),f=l.getAttribute("data-handleid"),m=l.classList.contains("connectable"),_=l.classList.contains("connectableend"),g={source:a?h:n,sourceHandle:a?f:o,target:a?n:h,targetHandle:a?o:f};d.connection=g,m&&_&&(e===jr.Strict?a&&u==="source"||!a&&u==="target":h!==n||f!==o)&&(d.endHandle={nodeId:h,handleId:f,type:u},d.isValid=s(g))}return d}function Xh(t,e){return t||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function Zh(t){t==null||t.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function FR(t,e){let n=null;return e?n="valid":t&&!e&&(n="invalid"),n}function Yv({event:t,handleId:e,nodeId:n,onConnect:o,isTarget:r,getState:s,setState:i,isValidConnection:a,edgeUpdaterType:l,onReconnectEnd:d}){const u=Nv(t.target),{connectionMode:h,domNode:f,autoPanOnConnect:m,connectionRadius:_,onConnectStart:g,panBy:p,getNodes:b,cancelConnection:x}=s();let y,v=0;const{x:C,y:k}=Zo(t),N=u==null?void 0:u.elementFromPoint(C,k),j=Xh(l,N),I=f==null?void 0:f.getBoundingClientRect();if(!I||!j)return;let T,A=Zo(t,I),R=!1,z=null,D=!1,F=null;const B=function({nodes:$,nodeId:E,handleId:W,handleType:G}){return $.reduce((q,Y)=>{if(Y[kt]){const{handleBounds:te}=Y[kt];let oe=[],se=[];te&&(oe=Wv(Y,te,"source",`${E}-${W}-${G}`),se=Wv(Y,te,"target",`${E}-${W}-${G}`)),q.push(...oe,...se)}return q},[])}({nodes:b(),nodeId:n,handleId:e,handleType:j}),U=()=>{if(!m)return;const[$,E]=Cv(A,I);p({x:$,y:E}),v=requestAnimationFrame(U)};function O($){const{transform:E}=s();A=Zo($,I);const{handle:W,validHandleResult:G}=function(q,Y,te,oe,se,Z){const{x:Q,y:ue}=Zo(q),me=Y.elementsFromPoint(Q,ue).find(Se=>Se.classList.contains("react-flow__handle"));if(me){const Se=me.getAttribute("data-nodeid");if(Se){const ie=Xh(void 0,me),je=me.getAttribute("data-handleid"),pe=Z({nodeId:Se,id:je,type:ie});if(pe){const Ae=se.find(Fe=>Fe.nodeId===Se&&Fe.type===ie&&Fe.id===je);return{handle:{id:je,type:ie,nodeId:Se,x:(Ae==null?void 0:Ae.x)||te.x,y:(Ae==null?void 0:Ae.y)||te.y},validHandleResult:pe}}}}let ce=[],fe=1/0;if(se.forEach(Se=>{const ie=Math.sqrt((Se.x-te.x)**2+(Se.y-te.y)**2);if(ie<=oe){const je=Z(Se);ie<=fe&&(ie<fe?ce=[{handle:Se,validHandleResult:je}]:ie===fe&&ce.push({handle:Se,validHandleResult:je}),fe=ie)}}),!ce.length)return{handle:null,validHandleResult:qv()};if(ce.length===1)return ce[0];const de=ce.some(({validHandleResult:Se})=>Se.isValid),ke=ce.some(({handle:Se})=>Se.type==="target");return ce.find(({handle:Se,validHandleResult:ie})=>ke?Se.type==="target":!de||ie.isValid)||ce[0]}($,u,Jh(A,E,!1,[1,1]),_,B,q=>Gv(q,h,n,e,r?"target":"source",a,u));if(y=W,R||(U(),R=!0),F=G.handleDomNode,z=G.connection,D=G.isValid,i({connectionPosition:y&&D?Uv({x:y.x,y:y.y},E):A,connectionStatus:FR(!!y,D),connectionEndHandle:G.endHandle}),!y&&!D&&!F)return Zh(T);z.source!==z.target&&F&&(Zh(T),T=F,F.classList.add("connecting","react-flow__handle-connecting"),F.classList.toggle("valid",D),F.classList.toggle("react-flow__handle-valid",D))}function S($){var E,W;(y||F)&&z&&D&&(o==null||o(z)),(W=(E=s()).onConnectEnd)==null||W.call(E,$),l&&(d==null||d($)),Zh(T),x(),cancelAnimationFrame(v),R=!1,D=!1,z=null,F=null,u.removeEventListener("mousemove",O),u.removeEventListener("mouseup",S),u.removeEventListener("touchmove",O),u.removeEventListener("touchend",S)}i({connectionPosition:A,connectionStatus:null,connectionNodeId:n,connectionHandleId:e,connectionHandleType:j,connectionStartHandle:{nodeId:n,handleId:e,type:j},connectionEndHandle:null}),g==null||g(t,{nodeId:n,handleId:e,handleType:j}),u.addEventListener("mousemove",O),u.addEventListener("mouseup",S),u.addEventListener("touchmove",O),u.addEventListener("touchend",S)}const Jv=()=>!0,zR=t=>({connectionStartHandle:t.connectionStartHandle,connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName}),Kv=M.forwardRef(({type:t="source",position:e=Be.Top,isValidConnection:n,isConnectable:o=!0,isConnectableStart:r=!0,isConnectableEnd:s=!0,id:i,onConnect:a,children:l,className:d,onMouseDown:u,onTouchStart:h,...f},m)=>{var j,I;const _=i||null,g=t==="target",p=Ht(),b=M.useContext(Gh),{connectOnClick:x,noPanClassName:y}=mt(zR,tn),{connecting:v,clickConnecting:C}=mt(((T,A,R)=>z=>{const{connectionStartHandle:D,connectionEndHandle:F,connectionClickStartHandle:B}=z;return{connecting:(D==null?void 0:D.nodeId)===T&&(D==null?void 0:D.handleId)===A&&(D==null?void 0:D.type)===R||(F==null?void 0:F.nodeId)===T&&(F==null?void 0:F.handleId)===A&&(F==null?void 0:F.type)===R,clickConnecting:(B==null?void 0:B.nodeId)===T&&(B==null?void 0:B.handleId)===A&&(B==null?void 0:B.type)===R}})(b,_,t),tn);b||((I=(j=p.getState()).onError)==null||I.call(j,"010",ER()));const k=T=>{const{defaultEdgeOptions:A,onConnect:R,hasDefaultEdges:z}=p.getState(),D={...A,...T};if(z){const{edges:F,setEdges:B}=p.getState();B(((U,O)=>{if(!U.source||!U.target)return O;let S;return S=($=>"id"in $&&"source"in $&&"target"in $)(U)?{...U}:{...U,id:PR(U)},(($,E)=>E.some(W=>!(W.source!==$.source||W.target!==$.target||W.sourceHandle!==$.sourceHandle&&(W.sourceHandle||$.sourceHandle)||W.targetHandle!==$.targetHandle&&(W.targetHandle||$.targetHandle))))(S,O)?O:O.concat(S)})(D,F))}R==null||R(D),a==null||a(D)},N=T=>{if(!b)return;const A=Iv(T);r&&(A&&T.button===0||!A)&&Yv({event:T,handleId:_,nodeId:b,onConnect:k,isTarget:g,getState:p.getState,setState:p.setState,isValidConnection:n||p.getState().isValidConnection||Jv}),A?u==null||u(T):h==null||h(T)};return X.createElement("div",{"data-handleid":_,"data-nodeid":b,"data-handlepos":e,"data-id":`${b}-${_}-${t}`,className:dn(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",y,d,{source:!g,target:g,connectable:o,connectablestart:r,connectableend:s,connecting:C,connectionindicator:o&&(r&&!v||s&&v)}]),onMouseDown:N,onTouchStart:N,onClick:x?T=>{const{onClickConnectStart:A,onClickConnectEnd:R,connectionClickStartHandle:z,connectionMode:D,isValidConnection:F}=p.getState();if(!b||!z&&!r)return;if(!z)return A==null||A(T,{nodeId:b,handleId:_,handleType:t}),void p.setState({connectionClickStartHandle:{nodeId:b,type:t,handleId:_}});const B=Nv(T.target),U=n||F||Jv,{connection:O,isValid:S}=Gv({nodeId:b,id:_,type:t},D,z.nodeId,z.handleId||null,z.type,U,B);S&&k(O),R==null||R(T),p.setState({connectionClickStartHandle:null})}:void 0,ref:m,...f},l)});Kv.displayName="Handle";var tr=M.memo(Kv);const Xv=({data:t,isConnectable:e,targetPosition:n=Be.Top,sourcePosition:o=Be.Bottom})=>X.createElement(X.Fragment,null,X.createElement(tr,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label,X.createElement(tr,{type:"source",position:o,isConnectable:e}));Xv.displayName="DefaultNode";var Qh=M.memo(Xv);const Zv=({data:t,isConnectable:e,sourcePosition:n=Be.Bottom})=>X.createElement(X.Fragment,null,t==null?void 0:t.label,X.createElement(tr,{type:"source",position:n,isConnectable:e}));Zv.displayName="InputNode";var Qv=M.memo(Zv);const e2=({data:t,isConnectable:e,targetPosition:n=Be.Top})=>X.createElement(X.Fragment,null,X.createElement(tr,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label);e2.displayName="OutputNode";var t2=M.memo(e2);const ef=()=>null;ef.displayName="GroupNode";const BR=t=>({selectedNodes:t.getNodes().filter(e=>e.selected),selectedEdges:t.edges.filter(e=>e.selected).map(e=>({...e}))}),Hl=t=>t.id;function UR(t,e){return tn(t.selectedNodes.map(Hl),e.selectedNodes.map(Hl))&&tn(t.selectedEdges.map(Hl),e.selectedEdges.map(Hl))}const n2=M.memo(({onSelectionChange:t})=>{const e=Ht(),{selectedNodes:n,selectedEdges:o}=mt(BR,UR);return M.useEffect(()=>{const r={nodes:n,edges:o};t==null||t(r),e.getState().onSelectionChange.forEach(s=>s(r))},[n,o,t]),null});n2.displayName="SelectionListener";const VR=t=>!!t.onSelectionChange;function $R({onSelectionChange:t}){const e=mt(VR);return t||e?X.createElement(n2,{onSelectionChange:t}):null}const HR=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset});function xs(t,e){M.useEffect(()=>{t!==void 0&&e(t)},[t])}function nt(t,e,n){M.useEffect(()=>{e!==void 0&&n({[t]:e})},[e])}const WR=({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,onConnect:r,onConnectStart:s,onConnectEnd:i,onClickConnectStart:a,onClickConnectEnd:l,nodesDraggable:d,nodesConnectable:u,nodesFocusable:h,edgesFocusable:f,edgesUpdatable:m,elevateNodesOnSelect:_,minZoom:g,maxZoom:p,nodeExtent:b,onNodesChange:x,onEdgesChange:y,elementsSelectable:v,connectionMode:C,snapGrid:k,snapToGrid:N,translateExtent:j,connectOnClick:I,defaultEdgeOptions:T,fitView:A,fitViewOptions:R,onNodesDelete:z,onEdgesDelete:D,onNodeDrag:F,onNodeDragStart:B,onNodeDragStop:U,onSelectionDrag:O,onSelectionDragStart:S,onSelectionDragStop:$,noPanClassName:E,nodeOrigin:W,rfId:G,autoPanOnConnect:q,autoPanOnNodeDrag:Y,onError:te,connectionRadius:oe,isValidConnection:se,nodeDragThreshold:Z})=>{const{setNodes:Q,setEdges:ue,setDefaultNodesAndEdges:me,setMinZoom:ce,setMaxZoom:fe,setTranslateExtent:de,setNodeExtent:ke,reset:Se}=mt(HR,tn),ie=Ht();return M.useEffect(()=>{const je=o==null?void 0:o.map(pe=>({...pe,...T}));return me(n,je),()=>{Se()}},[]),nt("defaultEdgeOptions",T,ie.setState),nt("connectionMode",C,ie.setState),nt("onConnect",r,ie.setState),nt("onConnectStart",s,ie.setState),nt("onConnectEnd",i,ie.setState),nt("onClickConnectStart",a,ie.setState),nt("onClickConnectEnd",l,ie.setState),nt("nodesDraggable",d,ie.setState),nt("nodesConnectable",u,ie.setState),nt("nodesFocusable",h,ie.setState),nt("edgesFocusable",f,ie.setState),nt("edgesUpdatable",m,ie.setState),nt("elementsSelectable",v,ie.setState),nt("elevateNodesOnSelect",_,ie.setState),nt("snapToGrid",N,ie.setState),nt("snapGrid",k,ie.setState),nt("onNodesChange",x,ie.setState),nt("onEdgesChange",y,ie.setState),nt("connectOnClick",I,ie.setState),nt("fitViewOnInit",A,ie.setState),nt("fitViewOnInitOptions",R,ie.setState),nt("onNodesDelete",z,ie.setState),nt("onEdgesDelete",D,ie.setState),nt("onNodeDrag",F,ie.setState),nt("onNodeDragStart",B,ie.setState),nt("onNodeDragStop",U,ie.setState),nt("onSelectionDrag",O,ie.setState),nt("onSelectionDragStart",S,ie.setState),nt("onSelectionDragStop",$,ie.setState),nt("noPanClassName",E,ie.setState),nt("nodeOrigin",W,ie.setState),nt("rfId",G,ie.setState),nt("autoPanOnConnect",q,ie.setState),nt("autoPanOnNodeDrag",Y,ie.setState),nt("onError",te,ie.setState),nt("connectionRadius",oe,ie.setState),nt("isValidConnection",se,ie.setState),nt("nodeDragThreshold",Z,ie.setState),xs(t,Q),xs(e,ue),xs(g,ce),xs(p,fe),xs(j,de),xs(b,ke),null},o2={display:"none"},qR={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},r2="react-flow__node-desc",s2="react-flow__edge-desc",GR=t=>t.ariaLiveMessage;function YR({rfId:t}){const e=mt(GR);return X.createElement("div",{id:`react-flow__aria-live-${t}`,"aria-live":"assertive","aria-atomic":"true",style:qR},e)}function JR({rfId:t,disableKeyboardA11y:e}){return X.createElement(X.Fragment,null,X.createElement("div",{id:`${r2}-${t}`,style:o2},"Press enter or space to select a node.",!e&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),X.createElement("div",{id:`${s2}-${t}`,style:o2},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!e&&X.createElement(YR,{rfId:t}))}var zi=(t=null,e={actInsideInputWithModifier:!0})=>{const[n,o]=M.useState(!1),r=M.useRef(!1),s=M.useRef(new Set([])),[i,a]=M.useMemo(()=>{if(t!==null){const l=(Array.isArray(t)?t:[t]).filter(u=>typeof u=="string").map(u=>u.split("+")),d=l.reduce((u,h)=>u.concat(...h),[]);return[l,d]}return[[],[]]},[t]);return M.useEffect(()=>{const l=typeof document<"u"?document:null,d=(e==null?void 0:e.target)||l;if(t!==null){const u=m=>{if(r.current=m.ctrlKey||m.metaKey||m.shiftKey,(!r.current||r.current&&!e.actInsideInputWithModifier)&&Uh(m))return!1;const _=a2(m.code,a);s.current.add(m[_]),i2(i,s.current,!1)&&(m.preventDefault(),o(!0))},h=m=>{if((!r.current||r.current&&!e.actInsideInputWithModifier)&&Uh(m))return!1;const _=a2(m.code,a);i2(i,s.current,!0)?(o(!1),s.current.clear()):s.current.delete(m[_]),m.key==="Meta"&&s.current.clear(),r.current=!1},f=()=>{s.current.clear(),o(!1)};return d==null||d.addEventListener("keydown",u),d==null||d.addEventListener("keyup",h),window.addEventListener("blur",f),()=>{d==null||d.removeEventListener("keydown",u),d==null||d.removeEventListener("keyup",h),window.removeEventListener("blur",f)}}},[t,o]),n};function i2(t,e,n){return t.filter(o=>n||o.length===e.size).some(o=>o.every(r=>e.has(r)))}function a2(t,e){return e.includes(t)?"code":"key"}function l2(t,e,n,o){var a,l;const r=t.parentNode||t.parentId;if(!r)return n;const s=e.get(r),i=bs(s,o);return l2(s,e,{x:(n.x??0)+i.x,y:(n.y??0)+i.y,z:(((a=s[kt])==null?void 0:a.z)??0)>(n.z??0)?((l=s[kt])==null?void 0:l.z)??0:n.z??0},o)}function c2(t,e,n){t.forEach(o=>{var s;const r=o.parentNode||o.parentId;if(r&&!t.has(r))throw new Error(`Parent node ${r} not found`);if(r||n!=null&&n[o.id]){const{x:i,y:a,z:l}=l2(o,t,{...o.position,z:((s=o[kt])==null?void 0:s.z)??0},e);o.positionAbsolute={x:i,y:a},o[kt].z=l,n!=null&&n[o.id]&&(o[kt].isParent=!0)}})}function tf(t,e,n,o){const r=new Map,s={},i=o?1e3:0;return t.forEach(a=>{var m;const l=(Un(a.zIndex)?a.zIndex:0)+(a.selected?i:0),d=e.get(a.id),u={...a,positionAbsolute:{x:a.position.x,y:a.position.y}},h=a.parentNode||a.parentId;h&&(s[h]=!0);const f=(d==null?void 0:d.type)&&(d==null?void 0:d.type)!==a.type;Object.defineProperty(u,kt,{enumerable:!1,value:{handleBounds:f||(m=d==null?void 0:d[kt])==null?void 0:m.handleBounds,z:l}}),r.set(a.id,u)}),c2(r,n,s),r}function d2(t,e={}){const{getNodes:n,width:o,height:r,minZoom:s,maxZoom:i,d3Zoom:a,d3Selection:l,fitViewOnInitDone:d,fitViewOnInit:u,nodeOrigin:h}=t(),f=e.initial&&!d&&u;if(a&&l&&(f||!e.initial)){const m=n().filter(g=>{var b;const p=e.includeHiddenNodes?g.width&&g.height:!g.hidden;return(b=e.nodes)!=null&&b.length?p&&e.nodes.some(x=>x.id===g.id):p}),_=m.every(g=>g.width&&g.height);if(m.length>0&&_){const g=Kh(m,h),{x:p,y:b,zoom:x}=Hv(g,o,r,e.minZoom??s,e.maxZoom??i,e.padding??.1),y=pr.translate(p,b).scale(x);return typeof e.duration=="number"&&e.duration>0?a.transform(Er(l,e.duration),y):a.transform(l,y),!0}}return!1}function KR(t,e){return t.forEach(n=>{const o=e.get(n.id);o&&e.set(o.id,{...o,[kt]:o[kt],selected:n.selected})}),new Map(e)}function XR(t,e){return e.map(n=>{const o=t.find(r=>r.id===n.id);return o&&(n.selected=o.selected),n})}function Wl({changedNodes:t,changedEdges:e,get:n,set:o}){const{nodeInternals:r,edges:s,onNodesChange:i,onEdgesChange:a,hasDefaultNodes:l,hasDefaultEdges:d}=n();t!=null&&t.length&&(l&&o({nodeInternals:KR(t,r)}),i==null||i(t)),e!=null&&e.length&&(d&&o({edges:XR(e,s)}),a==null||a(e))}const ys=()=>{},ZR={zoomIn:ys,zoomOut:ys,zoomTo:ys,getZoom:()=>1,setViewport:ys,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:ys,fitBounds:ys,project:t=>t,screenToFlowPosition:t=>t,flowToScreenPosition:t=>t,viewportInitialized:!1},QR=t=>({d3Zoom:t.d3Zoom,d3Selection:t.d3Selection});function Bi(){const t=(()=>{const g=Ht(),{d3Zoom:p,d3Selection:b}=mt(QR,tn);return M.useMemo(()=>b&&p?{zoomIn:y=>p.scaleBy(Er(b,y==null?void 0:y.duration),1.2),zoomOut:y=>p.scaleBy(Er(b,y==null?void 0:y.duration),1/1.2),zoomTo:(y,v)=>p.scaleTo(Er(b,v==null?void 0:v.duration),y),getZoom:()=>g.getState().transform[2],setViewport:(y,v)=>{const[C,k,N]=g.getState().transform,j=pr.translate(y.x??C,y.y??k).scale(y.zoom??N);p.transform(Er(b,v==null?void 0:v.duration),j)},getViewport:()=>{const[y,v,C]=g.getState().transform;return{x:y,y:v,zoom:C}},fitView:y=>d2(g.getState,y),setCenter:(y,v,C)=>{const{width:k,height:N,maxZoom:j}=g.getState(),I=(C==null?void 0:C.zoom)!==void 0?C.zoom:j,T=k/2-y*I,A=N/2-v*I,R=pr.translate(T,A).scale(I);p.transform(Er(b,C==null?void 0:C.duration),R)},fitBounds:(y,v)=>{const{width:C,height:k,minZoom:N,maxZoom:j}=g.getState(),{x:I,y:T,zoom:A}=Hv(y,C,k,N,j,(v==null?void 0:v.padding)??.1),R=pr.translate(I,T).scale(A);p.transform(Er(b,v==null?void 0:v.duration),R)},project:y=>{const{transform:v,snapToGrid:C,snapGrid:k}=g.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),Jh(y,v,C,k)},screenToFlowPosition:y=>{const{transform:v,snapToGrid:C,snapGrid:k,domNode:N}=g.getState();if(!N)return y;const{x:j,y:I}=N.getBoundingClientRect(),T={x:y.x-j,y:y.y-I};return Jh(T,v,C,k)},flowToScreenPosition:y=>{const{transform:v,domNode:C}=g.getState();if(!C)return y;const{x:k,y:N}=C.getBoundingClientRect(),j=Uv(y,v);return{x:j.x+k,y:j.y+N}},viewportInitialized:!0}:ZR,[p,b])})(),e=Ht(),n=M.useCallback(()=>e.getState().getNodes().map(g=>({...g})),[]),o=M.useCallback(g=>e.getState().nodeInternals.get(g),[]),r=M.useCallback(()=>{const{edges:g=[]}=e.getState();return g.map(p=>({...p}))},[]),s=M.useCallback(g=>{const{edges:p=[]}=e.getState();return p.find(b=>b.id===g)},[]),i=M.useCallback(g=>{const{getNodes:p,setNodes:b,hasDefaultNodes:x,onNodesChange:y}=e.getState(),v=p(),C=typeof g=="function"?g(v):g;if(x)b(C);else if(y){const k=C.length===0?v.map(N=>({type:"remove",id:N.id})):C.map(N=>({item:N,type:"reset"}));y(k)}},[]),a=M.useCallback(g=>{const{edges:p=[],setEdges:b,hasDefaultEdges:x,onEdgesChange:y}=e.getState(),v=typeof g=="function"?g(p):g;x?b(v):y&&y(v.length===0?p.map(C=>({type:"remove",id:C.id})):v.map(C=>({item:C,type:"reset"})))},[]),l=M.useCallback(g=>{const p=Array.isArray(g)?g:[g],{getNodes:b,setNodes:x,hasDefaultNodes:y,onNodesChange:v}=e.getState();if(y)x([...b(),...p]);else if(v){const C=p.map(k=>({item:k,type:"add"}));v(C)}},[]),d=M.useCallback(g=>{const p=Array.isArray(g)?g:[g],{edges:b=[],setEdges:x,hasDefaultEdges:y,onEdgesChange:v}=e.getState();y?x([...b,...p]):v&&v(p.map(C=>({item:C,type:"add"})))},[]),u=M.useCallback(()=>{const{getNodes:g,edges:p=[],transform:b}=e.getState(),[x,y,v]=b;return{nodes:g().map(C=>({...C})),edges:p.map(C=>({...C})),viewport:{x,y,zoom:v}}},[]),h=M.useCallback(({nodes:g,edges:p})=>{const{nodeInternals:b,getNodes:x,edges:y,hasDefaultNodes:v,hasDefaultEdges:C,onNodesDelete:k,onEdgesDelete:N,onNodesChange:j,onEdgesChange:I}=e.getState(),T=(g||[]).map(F=>F.id),A=(p||[]).map(F=>F.id),R=x().reduce((F,B)=>{const U=B.parentNode||B.parentId,O=!T.includes(B.id)&&U&&F.find(S=>S.id===U);return(typeof B.deletable!="boolean"||B.deletable)&&(T.includes(B.id)||O)&&F.push(B),F},[]),z=y.filter(F=>typeof F.deletable!="boolean"||F.deletable),D=z.filter(F=>A.includes(F.id));if(R||D){const F=$v(R,z),B=[...D,...F],U=B.reduce((O,S)=>(O.includes(S.id)||O.push(S.id),O),[]);(C||v)&&(C&&e.setState({edges:y.filter(O=>!U.includes(O.id))}),v&&(R.forEach(O=>{b.delete(O.id)}),e.setState({nodeInternals:new Map(b)}))),U.length>0&&(N==null||N(B),I&&I(U.map(O=>({id:O,type:"remove"})))),R.length>0&&(k==null||k(R),j)&&j(R.map(O=>({id:O.id,type:"remove"})))}},[]),f=M.useCallback(g=>{const p=Un((b=g).width)&&Un(b.height)&&Un(b.x)&&Un(b.y);var b;const x=p?null:e.getState().nodeInternals.get(g.id);return!p&&!x?[null,null,p]:[p?g:jv(x),x,p]},[]),m=M.useCallback((g,p=!0,b)=>{const[x,y,v]=f(g);return x?(b||e.getState().getNodes()).filter(C=>{if(!(v||C.id!==y.id&&C.positionAbsolute))return!1;const k=jv(C),N=Bh(k,x);return p&&N>0||N>=x.width*x.height}):[]},[]),_=M.useCallback((g,p,b=!0)=>{const[x]=f(g);if(!x)return!1;const y=Bh(x,p);return b&&y>0||y>=x.width*x.height},[]);return M.useMemo(()=>({...t,getNodes:n,getNode:o,getEdges:r,getEdge:s,setNodes:i,setEdges:a,addNodes:l,addEdges:d,toObject:u,deleteElements:h,getIntersectingNodes:m,isNodeIntersecting:_}),[t,n,o,r,s,i,a,l,d,u,h,m,_])}const eP={actInsideInputWithModifier:!1},nf={position:"absolute",width:"100%",height:"100%",top:0,left:0},ql=t=>({x:t.x,y:t.y,zoom:t.k}),ws=(t,e)=>t.target.closest(`.${e}`),u2=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),h2=t=>{const e=t.ctrlKey&&zl()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e},tP=t=>({d3Zoom:t.d3Zoom,d3Selection:t.d3Selection,d3ZoomHandler:t.d3ZoomHandler,userSelectionActive:t.userSelectionActive}),nP=({onMove:t,onMoveStart:e,onMoveEnd:n,onPaneContextMenu:o,zoomOnScroll:r=!0,zoomOnPinch:s=!0,panOnScroll:i=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=Qo.Free,zoomOnDoubleClick:d=!0,elementsSelectable:u,panOnDrag:h=!0,defaultViewport:f,translateExtent:m,minZoom:_,maxZoom:g,zoomActivationKeyCode:p,preventScrolling:b=!0,children:x,noWheelClassName:y,noPanClassName:v})=>{const C=M.useRef(),k=Ht(),N=M.useRef(!1),j=M.useRef(!1),I=M.useRef(null),T=M.useRef({x:0,y:0,zoom:0}),{d3Zoom:A,d3Selection:R,d3ZoomHandler:z,userSelectionActive:D}=mt(tP,tn),F=zi(p),B=M.useRef(0),U=M.useRef(!1),O=M.useRef();return function(S){const $=Ht();M.useEffect(()=>{let E;const W=()=>{var q,Y;if(!S.current)return;const G=Lh(S.current);G.height!==0&&G.width!==0||((Y=(q=$.getState()).onError)==null||Y.call(q,"004",SR())),$.setState({width:G.width||500,height:G.height||500})};return W(),window.addEventListener("resize",W),S.current&&(E=new ResizeObserver(()=>W()),E.observe(S.current)),()=>{window.removeEventListener("resize",W),E&&S.current&&E.unobserve(S.current)}},[])}(I),M.useEffect(()=>{if(I.current){const S=I.current.getBoundingClientRect(),$=function(){var Y,te,oe,se=_R,Z=bR,Q=wR,ue=xR,me=yR,ce=[0,1/0],fe=[[-1/0,-1/0],[1/0,1/0]],de=250,ke=cW,Se=YS("start","zoom","end"),ie=0,je=10;function pe(J){J.property("__zoom",vv).on("wheel.zoom",Qe,{passive:!1}).on("mousedown.zoom",tt).on("dblclick.zoom",ne).filter(me).on("touchstart.zoom",ve).on("touchmove.zoom",Ce).on("touchend.zoom touchcancel.zoom",Re).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function Ae(J,ae){return(ae=Math.max(ce[0],Math.min(ce[1],ae)))===J.k?J:new tp(ae,J.x,J.y)}function Fe(J,ae,_e){var ge=ae[0]-_e[0]*J.k,ye=ae[1]-_e[1]*J.k;return ge===J.x&&ye===J.y?J:new tp(J.k,ge,ye)}function De(J){return[(+J[0][0]+ +J[1][0])/2,(+J[0][1]+ +J[1][1])/2]}function Ve(J,ae,_e,ge){J.on("start.zoom",function(){Le(this,arguments).event(ge).start()}).on("interrupt.zoom end.zoom",function(){Le(this,arguments).event(ge).end()}).tween("zoom",function(){var ye=this,$e=arguments,ze=Le(ye,$e).event(ge),rt=Z.apply(ye,$e),le=_e==null?De(rt):typeof _e=="function"?_e.apply(ye,$e):_e,Ie=Math.max(rt[1][0]-rt[0][0],rt[1][1]-rt[0][1]),Ee=ye.__zoom,He=typeof ae=="function"?ae.apply(ye,$e):ae,Ge=ke(Ee.invert(le).concat(Ie/Ee.k),He.invert(le).concat(Ie/He.k));return function(Pe){if(Pe===1)Pe=He;else{var Ye=Ge(Pe),st=Ie/Ye[2];Pe=new tp(st,le[0]-Ye[0]*st,le[1]-Ye[1]*st)}ze.zoom(null,Pe)}})}function Le(J,ae,_e){return!_e&&J.__zooming||new ot(J,ae)}function ot(J,ae){this.that=J,this.args=ae,this.active=0,this.sourceEvent=null,this.extent=Z.apply(J,ae),this.taps=0}function Qe(J,...ae){if(se.apply(this,arguments)){var _e=Le(this,ae).event(J),ge=this.__zoom,ye=Math.max(ce[0],Math.min(ce[1],ge.k*Math.pow(2,ue.apply(this,arguments)))),$e=uo(J);if(_e.wheel)_e.mouse[0][0]===$e[0]&&_e.mouse[0][1]===$e[1]||(_e.mouse[1]=ge.invert(_e.mouse[0]=$e)),clearTimeout(_e.wheel);else{if(ge.k===ye)return;_e.mouse=[$e,ge.invert($e)],np(this),_e.start()}Di(J),_e.wheel=setTimeout(function(){_e.wheel=null,_e.end()},150),_e.zoom("mouse",Q(Fe(Ae(ge,ye),_e.mouse[0],_e.mouse[1]),_e.extent,fe))}}function tt(J,...ae){if(!oe&&se.apply(this,arguments)){var _e=J.currentTarget,ge=Le(this,ae,!0).event(J),ye=to(J.view).on("mousemove.zoom",function(le){if(Di(le),!ge.moved){var Ie=le.clientX-ze,Ee=le.clientY-rt;ge.moved=Ie*Ie+Ee*Ee>ie}ge.event(le).zoom("mouse",Q(Fe(ge.that.__zoom,ge.mouse[0]=uo(le,_e),ge.mouse[1]),ge.extent,fe))},!0).on("mouseup.zoom",function(le){ye.on("mousemove.zoom mouseup.zoom",null),wv(le.view,ge.moved),Di(le),ge.event(le).end()},!0),$e=uo(J,_e),ze=J.clientX,rt=J.clientY;yv(J.view),Ph(J),ge.mouse=[$e,this.__zoom.invert($e)],np(this),ge.start()}}function ne(J,...ae){if(se.apply(this,arguments)){var _e=this.__zoom,ge=uo(J.changedTouches?J.changedTouches[0]:J,this),ye=_e.invert(ge),$e=_e.k*(J.shiftKey?.5:2),ze=Q(Fe(Ae(_e,$e),ge,ye),Z.apply(this,ae),fe);Di(J),de>0?to(this).transition().duration(de).call(Ve,ze,ge,J):to(this).call(pe.transform,ze,ge,J)}}function ve(J,...ae){if(se.apply(this,arguments)){var _e,ge,ye,$e,ze=J.touches,rt=ze.length,le=Le(this,ae,J.changedTouches.length===rt).event(J);for(Ph(J),ge=0;ge<rt;++ge)$e=[$e=uo(ye=ze[ge],this),this.__zoom.invert($e),ye.identifier],le.touch0?le.touch1||le.touch0[2]===$e[2]||(le.touch1=$e,le.taps=0):(le.touch0=$e,_e=!0,le.taps=1+!!Y);Y&&(Y=clearTimeout(Y)),_e&&(le.taps<2&&(te=$e[0],Y=setTimeout(function(){Y=null},500)),np(this),le.start())}}function Ce(J,...ae){if(this.__zooming){var _e,ge,ye,$e,ze=Le(this,ae).event(J),rt=J.changedTouches,le=rt.length;for(Di(J),_e=0;_e<le;++_e)ye=uo(ge=rt[_e],this),ze.touch0&&ze.touch0[2]===ge.identifier?ze.touch0[0]=ye:ze.touch1&&ze.touch1[2]===ge.identifier&&(ze.touch1[0]=ye);if(ge=ze.that.__zoom,ze.touch1){var Ie=ze.touch0[0],Ee=ze.touch0[1],He=ze.touch1[0],Ge=ze.touch1[1],Pe=(Pe=He[0]-Ie[0])*Pe+(Pe=He[1]-Ie[1])*Pe,Ye=(Ye=Ge[0]-Ee[0])*Ye+(Ye=Ge[1]-Ee[1])*Ye;ge=Ae(ge,Math.sqrt(Pe/Ye)),ye=[(Ie[0]+He[0])/2,(Ie[1]+He[1])/2],$e=[(Ee[0]+Ge[0])/2,(Ee[1]+Ge[1])/2]}else{if(!ze.touch0)return;ye=ze.touch0[0],$e=ze.touch0[1]}ze.zoom("touch",Q(Fe(ge,ye,$e),ze.extent,fe))}}function Re(J,...ae){if(this.__zooming){var _e,ge,ye=Le(this,ae).event(J),$e=J.changedTouches,ze=$e.length;for(Ph(J),oe&&clearTimeout(oe),oe=setTimeout(function(){oe=null},500),_e=0;_e<ze;++_e)ge=$e[_e],ye.touch0&&ye.touch0[2]===ge.identifier?delete ye.touch0:ye.touch1&&ye.touch1[2]===ge.identifier&&delete ye.touch1;if(ye.touch1&&!ye.touch0&&(ye.touch0=ye.touch1,delete ye.touch1),ye.touch0)ye.touch0[1]=this.__zoom.invert(ye.touch0[0]);else if(ye.end(),ye.taps===2&&(ge=uo(ge,this),Math.hypot(te[0]-ge[0],te[1]-ge[1])<je)){var rt=to(this).on("dblclick.zoom");rt&&rt.apply(this,arguments)}}}return pe.transform=function(J,ae,_e,ge){var ye=J.selection?J.selection():J;ye.property("__zoom",vv),J!==ye?Ve(J,ae,_e,ge):ye.interrupt().each(function(){Le(this,arguments).event(ge).start().zoom(null,typeof ae=="function"?ae.apply(this,arguments):ae).end()})},pe.scaleBy=function(J,ae,_e,ge){pe.scaleTo(J,function(){return this.__zoom.k*(typeof ae=="function"?ae.apply(this,arguments):ae)},_e,ge)},pe.scaleTo=function(J,ae,_e,ge){pe.transform(J,function(){var ye=Z.apply(this,arguments),$e=this.__zoom,ze=_e==null?De(ye):typeof _e=="function"?_e.apply(this,arguments):_e,rt=$e.invert(ze),le=typeof ae=="function"?ae.apply(this,arguments):ae;return Q(Fe(Ae($e,le),ze,rt),ye,fe)},_e,ge)},pe.translateBy=function(J,ae,_e,ge){pe.transform(J,function(){return Q(this.__zoom.translate(typeof ae=="function"?ae.apply(this,arguments):ae,typeof _e=="function"?_e.apply(this,arguments):_e),Z.apply(this,arguments),fe)},null,ge)},pe.translateTo=function(J,ae,_e,ge,ye){pe.transform(J,function(){var $e=Z.apply(this,arguments),ze=this.__zoom,rt=ge==null?De($e):typeof ge=="function"?ge.apply(this,arguments):ge;return Q(pr.translate(rt[0],rt[1]).scale(ze.k).translate(typeof ae=="function"?-ae.apply(this,arguments):-ae,typeof _e=="function"?-_e.apply(this,arguments):-_e),$e,fe)},ge,ye)},ot.prototype={event:function(J){return J&&(this.sourceEvent=J),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(J,ae){return this.mouse&&J!=="mouse"&&(this.mouse[1]=ae.invert(this.mouse[0])),this.touch0&&J!=="touch"&&(this.touch0[1]=ae.invert(this.touch0[0])),this.touch1&&J!=="touch"&&(this.touch1[1]=ae.invert(this.touch1[0])),this.that.__zoom=ae,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(J){var ae=to(this.that).datum();Se.call(J,this.that,new gR(J,{sourceEvent:this.sourceEvent,target:pe,transform:this.that.__zoom,dispatch:Se}),ae)}},pe.wheelDelta=function(J){return arguments.length?(ue=typeof J=="function"?J:Pl(+J),pe):ue},pe.filter=function(J){return arguments.length?(se=typeof J=="function"?J:Pl(!!J),pe):se},pe.touchable=function(J){return arguments.length?(me=typeof J=="function"?J:Pl(!!J),pe):me},pe.extent=function(J){return arguments.length?(Z=typeof J=="function"?J:Pl([[+J[0][0],+J[0][1]],[+J[1][0],+J[1][1]]]),pe):Z},pe.scaleExtent=function(J){return arguments.length?(ce[0]=+J[0],ce[1]=+J[1],pe):[ce[0],ce[1]]},pe.translateExtent=function(J){return arguments.length?(fe[0][0]=+J[0][0],fe[1][0]=+J[1][0],fe[0][1]=+J[0][1],fe[1][1]=+J[1][1],pe):[[fe[0][0],fe[0][1]],[fe[1][0],fe[1][1]]]},pe.constrain=function(J){return arguments.length?(Q=J,pe):Q},pe.duration=function(J){return arguments.length?(de=+J,pe):de},pe.interpolate=function(J){return arguments.length?(ke=J,pe):ke},pe.on=function(){var J=Se.on.apply(Se,arguments);return J===Se?pe:J},pe.clickDistance=function(J){return arguments.length?(ie=(J=+J)*J,pe):Math.sqrt(ie)},pe.tapDistance=function(J){return arguments.length?(je=+J,pe):je},pe}().scaleExtent([_,g]).translateExtent(m),E=to(I.current).call($),W=pr.translate(f.x,f.y).scale(gs(f.zoom,_,g)),G=[[0,0],[S.width,S.height]],q=$.constrain()(W,G,m);$.transform(E,q),$.wheelDelta(h2),k.setState({d3Zoom:$,d3Selection:E,d3ZoomHandler:E.on("wheel.zoom"),transform:[q.x,q.y,q.k],domNode:I.current.closest(".react-flow")})}},[]),M.useEffect(()=>{R&&A&&(!i||F||D?z!==void 0&&R.on("wheel.zoom",function(S,$){if(!b&&S.type==="wheel"&&!S.ctrlKey||ws(S,y))return null;S.preventDefault(),z.call(this,S,$)},{passive:!1}):R.on("wheel.zoom",S=>{if(ws(S,y))return!1;S.preventDefault(),S.stopImmediatePropagation();const $=R.property("__zoom").k||1;if(S.ctrlKey&&s){const se=uo(S),Z=h2(S),Q=$*Math.pow(2,Z);return void A.scaleTo(R,Q,se,S)}const E=S.deltaMode===1?20:1;let W=l===Qo.Vertical?0:S.deltaX*E,G=l===Qo.Horizontal?0:S.deltaY*E;!zl()&&S.shiftKey&&l!==Qo.Vertical&&(W=S.deltaY*E,G=0),A.translateBy(R,-W/$*a,-G/$*a,{internal:!0});const q=ql(R.property("__zoom")),{onViewportChangeStart:Y,onViewportChange:te,onViewportChangeEnd:oe}=k.getState();clearTimeout(O.current),U.current||(U.current=!0,e==null||e(S,q),Y==null||Y(q)),U.current&&(t==null||t(S,q),te==null||te(q),O.current=setTimeout(()=>{n==null||n(S,q),oe==null||oe(q),U.current=!1},150))},{passive:!1}))},[D,i,l,R,A,z,F,s,b,y,e,t,n]),M.useEffect(()=>{A&&A.on("start",S=>{var W,G;if(!S.sourceEvent||S.sourceEvent.internal)return null;B.current=(W=S.sourceEvent)==null?void 0:W.button;const{onViewportChangeStart:$}=k.getState(),E=ql(S.transform);N.current=!0,T.current=E,((G=S.sourceEvent)==null?void 0:G.type)==="mousedown"&&k.setState({paneDragging:!0}),$==null||$(E),e==null||e(S.sourceEvent,E)})},[A,e]),M.useEffect(()=>{A&&(D&&!N.current?A.on("zoom",null):D||A.on("zoom",S=>{var E;const{onViewportChange:$}=k.getState();if(k.setState({transform:[S.transform.x,S.transform.y,S.transform.k]}),j.current=!(!o||!u2(h,B.current??0)),(t||$)&&!((E=S.sourceEvent)!=null&&E.internal)){const W=ql(S.transform);$==null||$(W),t==null||t(S.sourceEvent,W)}}))},[D,A,t,h,o]),M.useEffect(()=>{A&&A.on("end",S=>{if(!S.sourceEvent||S.sourceEvent.internal)return null;const{onViewportChangeEnd:$}=k.getState();if(N.current=!1,k.setState({paneDragging:!1}),o&&u2(h,B.current??0)&&!j.current&&o(S.sourceEvent),j.current=!1,(n||$)&&(E=T.current,W=S.transform,E.x!==W.x||E.y!==W.y||E.zoom!==W.k)){const G=ql(S.transform);T.current=G,clearTimeout(C.current),C.current=setTimeout(()=>{$==null||$(G),n==null||n(S.sourceEvent,G)},i?150:0)}var E,W})},[A,i,h,n,o]),M.useEffect(()=>{A&&A.filter(S=>{const $=F||r,E=s&&S.ctrlKey;if((h===!0||Array.isArray(h)&&h.includes(1))&&S.button===1&&S.type==="mousedown"&&(ws(S,"react-flow__node")||ws(S,"react-flow__edge")))return!0;if(!(h||$||i||d||s)||D||!d&&S.type==="dblclick"||ws(S,y)&&S.type==="wheel"||ws(S,v)&&(S.type!=="wheel"||i&&S.type==="wheel"&&!F)||!s&&S.ctrlKey&&S.type==="wheel"||!$&&!i&&!E&&S.type==="wheel"||!h&&(S.type==="mousedown"||S.type==="touchstart")||Array.isArray(h)&&!h.includes(S.button)&&S.type==="mousedown")return!1;const W=Array.isArray(h)&&h.includes(S.button)||!S.button||S.button<=1;return(!S.ctrlKey||S.type==="wheel")&&W})},[D,A,r,s,i,d,h,u,F]),X.createElement("div",{className:"react-flow__renderer",ref:I,style:nf},x)},oP=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function rP(){const{userSelectionActive:t,userSelectionRect:e}=mt(oP,tn);return t&&e?X.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:e.width,height:e.height,transform:`translate(${e.x}px, ${e.y}px)`}}):null}function f2(t,e){const n=e.parentNode||e.parentId,o=t.find(r=>r.id===n);if(o){const r=e.position.x+e.width-o.width,s=e.position.y+e.height-o.height;if(r>0||s>0||e.position.x<0||e.position.y<0){if(o.style={...o.style},o.style.width=o.style.width??o.width,o.style.height=o.style.height??o.height,r>0&&(o.style.width+=r),s>0&&(o.style.height+=s),e.position.x<0){const i=Math.abs(e.position.x);o.position.x=o.position.x-i,o.style.width+=i,e.position.x=0}if(e.position.y<0){const i=Math.abs(e.position.y);o.position.y=o.position.y-i,o.style.height+=i,e.position.y=0}o.width=o.style.width,o.height=o.style.height}}}function m2(t,e){if(t.some(o=>o.type==="reset"))return t.filter(o=>o.type==="reset").map(o=>o.item);const n=t.filter(o=>o.type==="add").map(o=>o.item);return e.reduce((o,r)=>{const s=t.filter(a=>a.id===r.id);if(s.length===0)return o.push(r),o;const i={...r};for(const a of s)if(a)switch(a.type){case"select":i.selected=a.selected;break;case"position":a.position!==void 0&&(i.position=a.position),a.positionAbsolute!==void 0&&(i.positionAbsolute=a.positionAbsolute),a.dragging!==void 0&&(i.dragging=a.dragging),i.expandParent&&f2(o,i);break;case"dimensions":a.dimensions!==void 0&&(i.width=a.dimensions.width,i.height=a.dimensions.height),a.updateStyle!==void 0&&(i.style={...i.style||{},...a.dimensions}),typeof a.resizing=="boolean"&&(i.resizing=a.resizing),i.expandParent&&f2(o,i);break;case"remove":return o}return o.push(i),o},n)}function p2(t,e){return m2(t,e)}const nr=(t,e)=>({id:t,type:"select",selected:e});function vs(t,e){return t.reduce((n,o)=>{const r=e.includes(o.id);return!o.selected&&r?(o.selected=!0,n.push(nr(o.id,!0))):o.selected&&!r&&(o.selected=!1,n.push(nr(o.id,!1))),n},[])}const of=(t,e)=>n=>{n.target===e.current&&(t==null||t(n))},sP=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,dragging:t.paneDragging}),g2=M.memo(({isSelecting:t,selectionMode:e=Li.Full,panOnDrag:n,onSelectionStart:o,onSelectionEnd:r,onPaneClick:s,onPaneContextMenu:i,onPaneScroll:a,onPaneMouseEnter:l,onPaneMouseMove:d,onPaneMouseLeave:u,children:h})=>{const f=M.useRef(null),m=Ht(),_=M.useRef(0),g=M.useRef(0),p=M.useRef(),{userSelectionActive:b,elementsSelectable:x,dragging:y}=mt(sP,tn),v=()=>{m.setState({userSelectionActive:!1,userSelectionRect:null}),_.current=0,g.current=0},C=j=>{s==null||s(j),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},k=a?j=>a(j):void 0,N=x&&(t||b);return X.createElement("div",{className:dn(["react-flow__pane",{dragging:y,selection:t}]),onClick:N?void 0:of(C,f),onContextMenu:of(j=>{Array.isArray(n)&&(n!=null&&n.includes(2))?j.preventDefault():i==null||i(j)},f),onWheel:of(k,f),onMouseEnter:N?void 0:l,onMouseDown:N?j=>{const{resetSelectedElements:I,domNode:T}=m.getState();if(p.current=T==null?void 0:T.getBoundingClientRect(),!x||!t||j.button!==0||j.target!==f.current||!p.current)return;const{x:A,y:R}=Zo(j,p.current);I(),m.setState({userSelectionRect:{width:0,height:0,startX:A,startY:R,x:A,y:R}}),o==null||o(j)}:void 0,onMouseMove:N?j=>{const{userSelectionRect:I,nodeInternals:T,edges:A,transform:R,onNodesChange:z,onEdgesChange:D,nodeOrigin:F,getNodes:B}=m.getState();if(!t||!p.current||!I)return;m.setState({userSelectionActive:!0,nodesSelectionActive:!1});const U=Zo(j,p.current),O=I.startX??0,S=I.startY??0,$={...I,x:U.x<O?U.x:O,y:U.y<S?U.y:S,width:Math.abs(U.x-O),height:Math.abs(U.y-S)},E=B(),W=Vv(T,$,R,e===Li.Partial,!0,F),G=$v(W,A).map(Y=>Y.id),q=W.map(Y=>Y.id);if(_.current!==q.length){_.current=q.length;const Y=vs(E,q);Y.length&&(z==null||z(Y))}if(g.current!==G.length){g.current=G.length;const Y=vs(A,G);Y.length&&(D==null||D(Y))}m.setState({userSelectionRect:$})}:d,onMouseUp:N?j=>{if(j.button!==0)return;const{userSelectionRect:I}=m.getState();!b&&I&&j.target===f.current&&(C==null||C(j)),m.setState({nodesSelectionActive:_.current>0}),v(),r==null||r(j)}:void 0,onMouseLeave:N?j=>{b&&(m.setState({nodesSelectionActive:_.current>0}),r==null||r(j)),v()}:u,ref:f,style:nf},h,X.createElement(rP,null))});function _2(t,e){const n=t.parentNode||t.parentId;if(!n)return!1;const o=e.get(n);return!!o&&(!!o.selected||_2(o,e))}function b2(t,e,n){let o=t;do{if(o!=null&&o.matches(e))return!0;if(o===n.current)return!1;o=o.parentElement}while(o);return!1}function iP(t,e,n,o){return Array.from(t.values()).filter(r=>(r.selected||r.id===o)&&(!r.parentNode||r.parentId||!_2(r,t))&&(r.draggable||e&&r.draggable===void 0)).map(r=>{var s,i;return{id:r.id,position:r.position||{x:0,y:0},positionAbsolute:r.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((s=r.positionAbsolute)==null?void 0:s.x)??0),y:n.y-(((i=r.positionAbsolute)==null?void 0:i.y)??0)},delta:{x:0,y:0},extent:r.extent,parentNode:r.parentNode||r.parentId,parentId:r.parentNode||r.parentId,width:r.width,height:r.height,expandParent:r.expandParent}})}function x2(t,e,n,o,r=[0,0],s){const i=function(h,f){return f&&f!=="parent"?[f[0],[f[1][0]-(h.width||0),f[1][1]-(h.height||0)]]:f}(t,t.extent||o);let a=i;const l=t.parentNode||t.parentId;if(t.extent!=="parent"||t.expandParent){if(t.extent&&l&&t.extent!=="parent"){const h=n.get(l),{x:f,y:m}=bs(h,r).positionAbsolute;a=[[t.extent[0][0]+f,t.extent[0][1]+m],[t.extent[1][0]+f,t.extent[1][1]+m]]}}else if(l&&t.width&&t.height){const h=n.get(l),{x:f,y:m}=bs(h,r).positionAbsolute;a=h&&Un(f)&&Un(m)&&Un(h.width)&&Un(h.height)?[[f+t.width*r[0],m+t.height*r[1]],[f+h.width-t.width+t.width*r[0],m+h.height-t.height+t.height*r[1]]]:a}else s==null||s("005",CR()),a=i;let d={x:0,y:0};if(l){const h=n.get(l);d=bs(h,r).positionAbsolute}const u=a&&a!=="parent"?Fh(e,a):e;return{position:{x:u.x-d.x,y:u.y-d.y},positionAbsolute:u}}function rf({nodeId:t,dragItems:e,nodeInternals:n}){const o=e.map(r=>({...n.get(r.id),position:r.position,positionAbsolute:r.positionAbsolute}));return[t?o.find(r=>r.id===t):o[0],o]}g2.displayName="Pane";const y2=(t,e,n,o)=>{const r=e.querySelectorAll(t);if(!r||!r.length)return null;const s=Array.from(r),i=e.getBoundingClientRect(),a=i.width*o[0],l=i.height*o[1];return s.map(d=>{const u=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),position:d.getAttribute("data-handlepos"),x:(u.left-i.left-a)/n,y:(u.top-i.top-l)/n,...Lh(d)}})};function Ui(t,e,n){return n===void 0?n:o=>{const r=e().nodeInternals.get(t);r&&n(o,{...r})}}function sf({id:t,store:e,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:r,unselectNodesAndEdges:s,multiSelectionActive:i,nodeInternals:a,onError:l}=e.getState(),d=a.get(t);d?(e.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&i)&&(s({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var u;return(u=o==null?void 0:o.current)==null?void 0:u.blur()})):r([t])):l==null||l("012",AR(t))}function af(t){return(e,n,o)=>t==null?void 0:t(e,o)}function w2({nodeRef:t,disabled:e=!1,noDragClassName:n,handleSelector:o,nodeId:r,isSelectable:s,selectNodesOnDrag:i}){const a=Ht(),[l,d]=M.useState(!1),u=M.useRef([]),h=M.useRef({x:null,y:null}),f=M.useRef(0),m=M.useRef(null),_=M.useRef({x:0,y:0}),g=M.useRef(null),p=M.useRef(!1),b=M.useRef(!1),x=M.useRef(!1),y=function(){const v=Ht();return M.useCallback(({sourceEvent:k})=>{const{transform:N,snapGrid:j,snapToGrid:I}=v.getState(),T=k.touches?k.touches[0].clientX:k.clientX,A=k.touches?k.touches[0].clientY:k.clientY,R={x:(T-N[0])/N[2],y:(A-N[1])/N[2]};return{xSnapped:I?j[0]*Math.round(R.x/j[0]):R.x,ySnapped:I?j[1]*Math.round(R.y/j[1]):R.y,...R}},[])}();return M.useEffect(()=>{if(t!=null&&t.current){const v=to(t.current),C=({x:j,y:I})=>{const{nodeInternals:T,onNodeDrag:A,onSelectionDrag:R,updateNodePositions:z,nodeExtent:D,snapGrid:F,snapToGrid:B,nodeOrigin:U,onError:O}=a.getState();h.current={x:j,y:I};let S=!1,$={x:0,y:0,x2:0,y2:0};if(u.current.length>1&&D){const W=Kh(u.current,U);$=zh(W)}if(u.current=u.current.map(W=>{const G={x:j-W.distance.x,y:I-W.distance.y};B&&(G.x=F[0]*Math.round(G.x/F[0]),G.y=F[1]*Math.round(G.y/F[1]));const q=[[D[0][0],D[0][1]],[D[1][0],D[1][1]]];u.current.length>1&&D&&!W.extent&&(q[0][0]=W.positionAbsolute.x-$.x+D[0][0],q[1][0]=W.positionAbsolute.x+(W.width??0)-$.x2+D[1][0],q[0][1]=W.positionAbsolute.y-$.y+D[0][1],q[1][1]=W.positionAbsolute.y+(W.height??0)-$.y2+D[1][1]);const Y=x2(W,G,T,q,U,O);return S=S||W.position.x!==Y.position.x||W.position.y!==Y.position.y,W.position=Y.position,W.positionAbsolute=Y.positionAbsolute,W}),!S)return;z(u.current,!0,!0),d(!0);const E=r?A:af(R);if(E&&g.current){const[W,G]=rf({nodeId:r,dragItems:u.current,nodeInternals:T});E(g.current,W,G)}},k=()=>{if(!m.current)return;const[j,I]=Cv(_.current,m.current);if(j!==0||I!==0){const{transform:T,panBy:A}=a.getState();h.current.x=(h.current.x??0)-j/T[2],h.current.y=(h.current.y??0)-I/T[2],A({x:j,y:I})&&C(h.current)}f.current=requestAnimationFrame(k)},N=j=>{var U;const{nodeInternals:I,multiSelectionActive:T,nodesDraggable:A,unselectNodesAndEdges:R,onNodeDragStart:z,onSelectionDragStart:D}=a.getState();b.current=!0;const F=r?z:af(D);i&&s||T||!r||(U=I.get(r))!=null&&U.selected||R(),r&&s&&i&&sf({id:r,store:a,nodeRef:t});const B=y(j);if(h.current=B,u.current=iP(I,A,B,r),F&&u.current){const[O,S]=rf({nodeId:r,dragItems:u.current,nodeInternals:I});F(j.sourceEvent,O,S)}};if(!e){const j=function(){var I,T,A,R,z=hR,D=fR,F=mR,B=pR,U={},O=YS("start","drag","end"),S=0,$=0;function E(Z){Z.on("mousedown.drag",W).filter(B).on("touchstart.drag",Y).on("touchmove.drag",te,uR).on("touchend.drag touchcancel.drag",oe).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function W(Z,Q){if(!R&&z.call(this,Z,Q)){var ue=se(this,D.call(this,Z,Q),Z,Q,"mouse");ue&&(to(Z.view).on("mousemove.drag",G,Oi).on("mouseup.drag",q,Oi),yv(Z.view),Dh(Z),A=!1,I=Z.clientX,T=Z.clientY,ue("start",Z))}}function G(Z){if(ps(Z),!A){var Q=Z.clientX-I,ue=Z.clientY-T;A=Q*Q+ue*ue>$}U.mouse("drag",Z)}function q(Z){to(Z.view).on("mousemove.drag mouseup.drag",null),wv(Z.view,A),ps(Z),U.mouse("end",Z)}function Y(Z,Q){if(z.call(this,Z,Q)){var ue,me,ce=Z.changedTouches,fe=D.call(this,Z,Q),de=ce.length;for(ue=0;ue<de;++ue)(me=se(this,fe,Z,Q,ce[ue].identifier,ce[ue]))&&(Dh(Z),me("start",Z,ce[ue]))}}function te(Z){var Q,ue,me=Z.changedTouches,ce=me.length;for(Q=0;Q<ce;++Q)(ue=U[me[Q].identifier])&&(ps(Z),ue("drag",Z,me[Q]))}function oe(Z){var Q,ue,me=Z.changedTouches,ce=me.length;for(R&&clearTimeout(R),R=setTimeout(function(){R=null},500),Q=0;Q<ce;++Q)(ue=U[me[Q].identifier])&&(Dh(Z),ue("end",Z,me[Q]))}function se(Z,Q,ue,me,ce,fe){var de,ke,Se,ie=O.copy(),je=uo(fe||ue,Q);if((Se=F.call(Z,new Rh("beforestart",{sourceEvent:ue,target:E,identifier:ce,active:S,x:je[0],y:je[1],dx:0,dy:0,dispatch:ie}),me))!=null)return de=Se.x-je[0]||0,ke=Se.y-je[1]||0,function pe(Ae,Fe,De){var Ve,Le=je;switch(Ae){case"start":U[ce]=pe,Ve=S++;break;case"end":delete U[ce],--S;case"drag":je=uo(De||Fe,Q),Ve=S}ie.call(Ae,Z,new Rh(Ae,{sourceEvent:Fe,subject:Se,target:E,identifier:ce,active:Ve,x:je[0]+de,y:je[1]+ke,dx:je[0]-Le[0],dy:je[1]-Le[1],dispatch:ie}),me)}}return E.filter=function(Z){return arguments.length?(z=typeof Z=="function"?Z:Rl(!!Z),E):z},E.container=function(Z){return arguments.length?(D=typeof Z=="function"?Z:Rl(Z),E):D},E.subject=function(Z){return arguments.length?(F=typeof Z=="function"?Z:Rl(Z),E):F},E.touchable=function(Z){return arguments.length?(B=typeof Z=="function"?Z:Rl(!!Z),E):B},E.on=function(){var Z=O.on.apply(O,arguments);return Z===O?E:Z},E.clickDistance=function(Z){return arguments.length?($=(Z=+Z)*Z,E):Math.sqrt($)},E}().on("start",I=>{const{domNode:T,nodeDragThreshold:A}=a.getState();A===0&&N(I),x.current=!1;const R=y(I);h.current=R,m.current=(T==null?void 0:T.getBoundingClientRect())||null,_.current=Zo(I.sourceEvent,m.current)}).on("drag",I=>{var z,D;const T=y(I),{autoPanOnNodeDrag:A,nodeDragThreshold:R}=a.getState();if(I.sourceEvent.type==="touchmove"&&I.sourceEvent.touches.length>1&&(x.current=!0),!x.current){if(!p.current&&b.current&&A&&(p.current=!0,k()),!b.current){const F=T.xSnapped-(((z=h==null?void 0:h.current)==null?void 0:z.x)??0),B=T.ySnapped-(((D=h==null?void 0:h.current)==null?void 0:D.y)??0);Math.sqrt(F*F+B*B)>R&&N(I)}(h.current.x!==T.xSnapped||h.current.y!==T.ySnapped)&&u.current&&b.current&&(g.current=I.sourceEvent,_.current=Zo(I.sourceEvent,m.current),C(T))}}).on("end",I=>{if(b.current&&!x.current&&(d(!1),p.current=!1,b.current=!1,cancelAnimationFrame(f.current),u.current)){const{updateNodePositions:T,nodeInternals:A,onNodeDragStop:R,onSelectionDragStop:z}=a.getState(),D=r?R:af(z);if(T(u.current,!1,!1),D){const[F,B]=rf({nodeId:r,dragItems:u.current,nodeInternals:A});D(I.sourceEvent,F,B)}}}).filter(I=>{const T=I.target;return!I.button&&(!n||!b2(T,`.${n}`,t))&&(!o||b2(T,o,t))});return v.call(j),()=>{v.on(".drag",null)}}v.on(".drag",null)}},[t,e,n,o,s,a,r,i,y]),l}function v2(){const t=Ht();return M.useCallback(n=>{const{nodeInternals:o,nodeExtent:r,updateNodePositions:s,getNodes:i,snapToGrid:a,snapGrid:l,onError:d,nodesDraggable:u}=t.getState(),h=i().filter(x=>x.selected&&(x.draggable||u&&x.draggable===void 0)),f=a?l[0]:5,m=a?l[1]:5,_=n.isShiftPressed?4:1,g=n.x*f*_,p=n.y*m*_,b=h.map(x=>{if(x.positionAbsolute){const y={x:x.positionAbsolute.x+g,y:x.positionAbsolute.y+p};a&&(y.x=l[0]*Math.round(y.x/l[0]),y.y=l[1]*Math.round(y.y/l[1]));const{positionAbsolute:v,position:C}=x2(x,y,o,r,void 0,d);x.position=C,x.positionAbsolute=v}return x});s(b,!0,!1)},[])}const ks={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var Vi=t=>{const e=({id:n,type:o,data:r,xPos:s,yPos:i,xPosOrigin:a,yPosOrigin:l,selected:d,onClick:u,onMouseEnter:h,onMouseMove:f,onMouseLeave:m,onContextMenu:_,onDoubleClick:g,style:p,className:b,isDraggable:x,isSelectable:y,isConnectable:v,isFocusable:C,selectNodesOnDrag:k,sourcePosition:N,targetPosition:j,hidden:I,resizeObserver:T,dragHandle:A,zIndex:R,isParent:z,noDragClassName:D,noPanClassName:F,initialized:B,disableKeyboardA11y:U,ariaLabel:O,rfId:S,hasHandleBounds:$})=>{const E=Ht(),W=M.useRef(null),G=M.useRef(null),q=M.useRef(N),Y=M.useRef(j),te=M.useRef(o),oe=y||x||u||h||f||m,se=v2(),Z=Ui(n,E.getState,h),Q=Ui(n,E.getState,f),ue=Ui(n,E.getState,m),me=Ui(n,E.getState,_),ce=Ui(n,E.getState,g);M.useEffect(()=>()=>{G.current&&(T==null||T.unobserve(G.current),G.current=null)},[]),M.useEffect(()=>{if(W.current&&!I){const de=W.current;B&&$&&G.current===de||(G.current&&(T==null||T.unobserve(G.current)),T==null||T.observe(de),G.current=de)}},[I,B,$]),M.useEffect(()=>{const de=te.current!==o,ke=q.current!==N,Se=Y.current!==j;W.current&&(de||ke||Se)&&(de&&(te.current=o),ke&&(q.current=N),Se&&(Y.current=j),E.getState().updateNodeDimensions([{id:n,nodeElement:W.current,forceUpdate:!0}]))},[n,o,N,j]);const fe=w2({nodeRef:W,disabled:I||!x,noDragClassName:D,handleSelector:A,nodeId:n,isSelectable:y,selectNodesOnDrag:k});return I?null:X.createElement("div",{className:dn(["react-flow__node",`react-flow__node-${o}`,{[F]:x},b,{selected:d,selectable:y,parent:z,dragging:fe}]),ref:W,style:{zIndex:R,transform:`translate(${a}px,${l}px)`,pointerEvents:oe?"all":"none",visibility:B?"visible":"hidden",...p},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:Z,onMouseMove:Q,onMouseLeave:ue,onContextMenu:me,onClick:de=>{const{nodeDragThreshold:ke}=E.getState();if(y&&(!k||!x||ke>0)&&sf({id:n,store:E,nodeRef:W}),u){const Se=E.getState().nodeInternals.get(n);Se&&u(de,{...Se})}},onDoubleClick:ce,onKeyDown:C?de=>{if(!Uh(de)&&!U)if(Ev.includes(de.key)&&y){const ke=de.key==="Escape";sf({id:n,store:E,unselect:ke,nodeRef:W})}else x&&d&&Object.prototype.hasOwnProperty.call(ks,de.key)&&(E.setState({ariaLiveMessage:`Moved selected node ${de.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~s}, y: ${~~i}`}),se({x:ks[de.key].x,y:ks[de.key].y,isShiftPressed:de.shiftKey}))}:void 0,tabIndex:C?0:void 0,role:C?"button":void 0,"aria-describedby":U?void 0:`${r2}-${S}`,"aria-label":O},X.createElement(RR,{value:n},X.createElement(t,{id:n,data:r,type:o,xPos:s,yPos:i,selected:d,isConnectable:v,sourcePosition:N,targetPosition:j,dragging:fe,dragHandle:A,zIndex:R})))};return e.displayName="NodeWrapper",M.memo(e)};const aP=t=>{const e=t.getNodes().filter(n=>n.selected);return{...Kh(e,t.nodeOrigin),transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`,userSelectionActive:t.userSelectionActive}};var lP=M.memo(function({onSelectionContextMenu:t,noPanClassName:e,disableKeyboardA11y:n}){const o=Ht(),{width:r,height:s,x:i,y:a,transformString:l,userSelectionActive:d}=mt(aP,tn),u=v2(),h=M.useRef(null);if(M.useEffect(()=>{var m;n||((m=h.current)==null||m.focus({preventScroll:!0}))},[n]),w2({nodeRef:h}),d||!r||!s)return null;const f=t?m=>{const _=o.getState().getNodes().filter(g=>g.selected);t(m,_)}:void 0;return X.createElement("div",{className:dn(["react-flow__nodesselection","react-flow__container",e]),style:{transform:l}},X.createElement("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:m=>{Object.prototype.hasOwnProperty.call(ks,m.key)&&u({x:ks[m.key].x,y:ks[m.key].y,isShiftPressed:m.shiftKey})},style:{width:r,height:s,top:a,left:i}}))});const cP=t=>t.nodesSelectionActive,k2=({children:t,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:i,deleteKeyCode:a,onMove:l,onMoveStart:d,onMoveEnd:u,selectionKeyCode:h,selectionOnDrag:f,selectionMode:m,onSelectionStart:_,onSelectionEnd:g,multiSelectionKeyCode:p,panActivationKeyCode:b,zoomActivationKeyCode:x,elementsSelectable:y,zoomOnScroll:v,zoomOnPinch:C,panOnScroll:k,panOnScrollSpeed:N,panOnScrollMode:j,zoomOnDoubleClick:I,panOnDrag:T,defaultViewport:A,translateExtent:R,minZoom:z,maxZoom:D,preventScrolling:F,onSelectionContextMenu:B,noWheelClassName:U,noPanClassName:O,disableKeyboardA11y:S})=>{const $=mt(cP),E=zi(h),W=zi(b),G=W||T,q=W||k,Y=E||f&&G!==!0;return(({deleteKeyCode:te,multiSelectionKeyCode:oe})=>{const se=Ht(),{deleteElements:Z}=Bi(),Q=zi(te,eP),ue=zi(oe);M.useEffect(()=>{if(Q){const{edges:me,getNodes:ce}=se.getState(),fe=ce().filter(ke=>ke.selected),de=me.filter(ke=>ke.selected);Z({nodes:fe,edges:de}),se.setState({nodesSelectionActive:!1})}},[Q]),M.useEffect(()=>{se.setState({multiSelectionActive:ue})},[ue])})({deleteKeyCode:a,multiSelectionKeyCode:p}),X.createElement(nP,{onMove:l,onMoveStart:d,onMoveEnd:u,onPaneContextMenu:s,elementsSelectable:y,zoomOnScroll:v,zoomOnPinch:C,panOnScroll:q,panOnScrollSpeed:N,panOnScrollMode:j,zoomOnDoubleClick:I,panOnDrag:!E&&G,defaultViewport:A,translateExtent:R,minZoom:z,maxZoom:D,zoomActivationKeyCode:x,preventScrolling:F,noWheelClassName:U,noPanClassName:O},X.createElement(g2,{onSelectionStart:_,onSelectionEnd:g,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:i,panOnDrag:G,isSelecting:!!Y,selectionMode:m},t,$&&X.createElement(lP,{onSelectionContextMenu:B,noPanClassName:O,disableKeyboardA11y:S})))};k2.displayName="FlowRenderer";var dP=M.memo(k2);function uP(t){return{input:Vi(t.input||Qv),default:Vi(t.default||Qh),output:Vi(t.output||t2),group:Vi(t.group||ef),...Object.keys(t).filter(e=>!["input","default","output","group"].includes(e)).reduce((e,n)=>(e[n]=Vi(t[n]||Qh),e),{})}}const hP=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,updateNodeDimensions:t.updateNodeDimensions,onError:t.onError}),S2=t=>{const{nodesDraggable:e,nodesConnectable:n,nodesFocusable:o,elementsSelectable:r,updateNodeDimensions:s,onError:i}=mt(hP,tn),a=(l=t.onlyRenderVisibleElements,mt(M.useCallback(h=>l?Vv(h.nodeInternals,{x:0,y:0,width:h.width,height:h.height},h.transform,!0):h.getNodes(),[l])));var l;const d=M.useRef(),u=M.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const h=new ResizeObserver(f=>{const m=f.map(_=>({id:_.target.getAttribute("data-id"),nodeElement:_.target,forceUpdate:!0}));s(m)});return d.current=h,h},[]);return M.useEffect(()=>()=>{var h;(h=d==null?void 0:d.current)==null||h.disconnect()},[]),X.createElement("div",{className:"react-flow__nodes",style:nf},a.map(h=>{var k,N,j;let f=h.type||"default";t.nodeTypes[f]||(i==null||i("003",kR(f)),f="default");const m=t.nodeTypes[f]||t.nodeTypes.default,_=!!(h.draggable||e&&h.draggable===void 0),g=!!(h.selectable||r&&h.selectable===void 0),p=!!(h.connectable||n&&h.connectable===void 0),b=!!(h.focusable||o&&h.focusable===void 0),x=t.nodeExtent?Fh(h.positionAbsolute,t.nodeExtent):h.positionAbsolute,y=(x==null?void 0:x.x)??0,v=(x==null?void 0:x.y)??0,C=(({x:I,y:T,width:A,height:R,origin:z})=>A&&R?z[0]<0||z[1]<0||z[0]>1||z[1]>1?{x:I,y:T}:{x:I-A*z[0],y:T-R*z[1]}:{x:I,y:T})({x:y,y:v,width:h.width??0,height:h.height??0,origin:t.nodeOrigin});return X.createElement(m,{key:h.id,id:h.id,className:h.className,style:h.style,type:f,data:h.data,sourcePosition:h.sourcePosition||Be.Bottom,targetPosition:h.targetPosition||Be.Top,hidden:h.hidden,xPos:y,yPos:v,xPosOrigin:C.x,yPosOrigin:C.y,selectNodesOnDrag:t.selectNodesOnDrag,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,selected:!!h.selected,isDraggable:_,isSelectable:g,isConnectable:p,isFocusable:b,resizeObserver:u,dragHandle:h.dragHandle,zIndex:((k=h[kt])==null?void 0:k.z)??0,isParent:!!((N=h[kt])!=null&&N.isParent),noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,initialized:!!h.width&&!!h.height,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,ariaLabel:h.ariaLabel,hasHandleBounds:!!((j=h[kt])!=null&&j.handleBounds)})}))};S2.displayName="NodeRenderer";var fP=M.memo(S2);const mP=(t,e,n)=>n===Be.Left?t-e:n===Be.Right?t+e:t,pP=(t,e,n)=>n===Be.Top?t-e:n===Be.Bottom?t+e:t,C2="react-flow__edgeupdater",N2=({position:t,centerX:e,centerY:n,radius:o=10,onMouseDown:r,onMouseEnter:s,onMouseOut:i,type:a})=>X.createElement("circle",{onMouseDown:r,onMouseEnter:s,onMouseOut:i,className:dn([C2,`${C2}-${a}`]),cx:mP(e,o,t),cy:pP(n,o,t),r:o,stroke:"transparent",fill:"transparent"}),gP=()=>!0;var Ss=t=>{const e=({id:n,className:o,type:r,data:s,onClick:i,onEdgeDoubleClick:a,selected:l,animated:d,label:u,labelStyle:h,labelShowBg:f,labelBgStyle:m,labelBgPadding:_,labelBgBorderRadius:g,style:p,source:b,target:x,sourceX:y,sourceY:v,targetX:C,targetY:k,sourcePosition:N,targetPosition:j,elementsSelectable:I,hidden:T,sourceHandleId:A,targetHandleId:R,onContextMenu:z,onMouseEnter:D,onMouseMove:F,onMouseLeave:B,reconnectRadius:U,onReconnect:O,onReconnectStart:S,onReconnectEnd:$,markerEnd:E,markerStart:W,rfId:G,ariaLabel:q,isFocusable:Y,isReconnectable:te,pathOptions:oe,interactionWidth:se,disableKeyboardA11y:Z})=>{const Q=M.useRef(null),[ue,me]=M.useState(!1),[ce,fe]=M.useState(!1),de=Ht(),ke=M.useMemo(()=>`url('#${Yh(W,G)}')`,[W,G]),Se=M.useMemo(()=>`url('#${Yh(E,G)}')`,[E,G]);if(T)return null;const ie=Pi(n,de.getState,a),je=Pi(n,de.getState,z),pe=Pi(n,de.getState,D),Ae=Pi(n,de.getState,F),Fe=Pi(n,de.getState,B),De=(Qe,tt)=>{if(Qe.button!==0)return;const{edges:ne,isValidConnection:ve}=de.getState(),Ce=tt?x:b,Re=(tt?R:A)||null,J=tt?"target":"source",ae=ve||gP,_e=tt,ge=ne.find(ye=>ye.id===n);fe(!0),S==null||S(Qe,ge,J),Yv({event:Qe,handleId:Re,nodeId:Ce,onConnect:ye=>O==null?void 0:O(ge,ye),isTarget:_e,getState:de.getState,setState:de.setState,isValidConnection:ae,edgeUpdaterType:J,onReconnectEnd:ye=>{fe(!1),$==null||$(ye,ge,J)}})},Ve=()=>me(!0),Le=()=>me(!1),ot=!I&&!i;return X.createElement("g",{className:dn(["react-flow__edge",`react-flow__edge-${r}`,o,{selected:l,animated:d,inactive:ot,updating:ue}]),onClick:Qe=>{var J;const{edges:tt,addSelectedEdges:ne,unselectNodesAndEdges:ve,multiSelectionActive:Ce}=de.getState(),Re=tt.find(ae=>ae.id===n);Re&&(I&&(de.setState({nodesSelectionActive:!1}),Re.selected&&Ce?(ve({nodes:[],edges:[Re]}),(J=Q.current)==null||J.blur()):ne([n])),i&&i(Qe,Re))},onDoubleClick:ie,onContextMenu:je,onMouseEnter:pe,onMouseMove:Ae,onMouseLeave:Fe,onKeyDown:Y?Qe=>{var tt;if(!Z&&Ev.includes(Qe.key)&&I){const{unselectNodesAndEdges:ne,addSelectedEdges:ve,edges:Ce}=de.getState();Qe.key==="Escape"?((tt=Q.current)==null||tt.blur(),ne({edges:[Ce.find(Re=>Re.id===n)]})):ve([n])}}:void 0,tabIndex:Y?0:void 0,role:Y?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":q===null?void 0:q||`Edge from ${b} to ${x}`,"aria-describedby":Y?`${s2}-${G}`:void 0,ref:Q},!ce&&X.createElement(t,{id:n,source:b,target:x,selected:l,animated:d,label:u,labelStyle:h,labelShowBg:f,labelBgStyle:m,labelBgPadding:_,labelBgBorderRadius:g,data:s,style:p,sourceX:y,sourceY:v,targetX:C,targetY:k,sourcePosition:N,targetPosition:j,sourceHandleId:A,targetHandleId:R,markerStart:ke,markerEnd:Se,pathOptions:oe,interactionWidth:se}),te&&X.createElement(X.Fragment,null,(te==="source"||te===!0)&&X.createElement(N2,{position:N,centerX:y,centerY:v,radius:U,onMouseDown:Qe=>De(Qe,!0),onMouseEnter:Ve,onMouseOut:Le,type:"source"}),(te==="target"||te===!0)&&X.createElement(N2,{position:j,centerX:C,centerY:k,radius:U,onMouseDown:Qe=>De(Qe,!1),onMouseEnter:Ve,onMouseOut:Le,type:"target"})))};return e.displayName="EdgeWrapper",M.memo(e)};function _P(t){return{default:Ss(t.default||$l),straight:Ss(t.bezier||qh),step:Ss(t.step||Wh),smoothstep:Ss(t.step||Ul),simplebezier:Ss(t.simplebezier||$h),...Object.keys(t).filter(e=>!["default","bezier"].includes(e)).reduce((e,n)=>(e[n]=Ss(t[n]||$l),e),{})}}function j2(t,e,n=null){const o=((n==null?void 0:n.x)||0)+e.x,r=((n==null?void 0:n.y)||0)+e.y,s=(n==null?void 0:n.width)||e.width,i=(n==null?void 0:n.height)||e.height;switch(t){case Be.Top:return{x:o+s/2,y:r};case Be.Right:return{x:o+s,y:r+i/2};case Be.Bottom:return{x:o+s/2,y:r+i};case Be.Left:return{x:o,y:r+i/2}}}function E2(t,e){return t?t.length!==1&&e?e&&t.find(n=>n.id===e)||null:t[0]:null}function I2(t){var o,r,s,i,a;const e=((o=t==null?void 0:t[kt])==null?void 0:o.handleBounds)||null,n=e&&(t==null?void 0:t.width)&&(t==null?void 0:t.height)&&((r=t==null?void 0:t.positionAbsolute)==null?void 0:r.x)!==void 0&&((s=t==null?void 0:t.positionAbsolute)==null?void 0:s.y)!==void 0;return[{x:((i=t==null?void 0:t.positionAbsolute)==null?void 0:i.x)||0,y:((a=t==null?void 0:t.positionAbsolute)==null?void 0:a.y)||0,width:(t==null?void 0:t.width)||0,height:(t==null?void 0:t.height)||0},e,!!n]}const bP=[{level:0,isMaxLevel:!0,edges:[]}];function xP(t,e,n){return function(o,r,s=!1){let i=-1;const a=o.reduce((d,u)=>{var m,_;const h=Un(u.zIndex);let f=h?u.zIndex:0;if(s){const g=r.get(u.target),p=r.get(u.source),b=u.selected||(g==null?void 0:g.selected)||(p==null?void 0:p.selected),x=Math.max(((m=p==null?void 0:p[kt])==null?void 0:m.z)||0,((_=g==null?void 0:g[kt])==null?void 0:_.z)||0,1e3);f=(h?u.zIndex:0)+(b?x:0)}return d[f]?d[f].push(u):d[f]=[u],i=f>i?f:i,d},{}),l=Object.entries(a).map(([d,u])=>{const h=+d;return{edges:u,level:h,isMaxLevel:h===i}});return l.length===0?bP:l}(mt(M.useCallback(o=>t?o.edges.filter(r=>{const s=e.get(r.source),i=e.get(r.target);return(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&(i==null?void 0:i.width)&&(i==null?void 0:i.height)&&function({sourcePos:a,targetPos:l,sourceWidth:d,sourceHeight:u,targetWidth:h,targetHeight:f,width:m,height:_,transform:g}){const p={x:Math.min(a.x,l.x),y:Math.min(a.y,l.y),x2:Math.max(a.x+d,l.x+h),y2:Math.max(a.y+u,l.y+f)};p.x===p.x2&&(p.x2+=1),p.y===p.y2&&(p.y2+=1);const b=zh({x:(0-g[0])/g[2],y:(0-g[1])/g[2],width:m/g[2],height:_/g[2]}),x=Math.max(0,Math.min(b.x2,p.x2)-Math.max(b.x,p.x)),y=Math.max(0,Math.min(b.y2,p.y2)-Math.max(b.y,p.y));return Math.ceil(x*y)>0}({sourcePos:s.positionAbsolute||{x:0,y:0},targetPos:i.positionAbsolute||{x:0,y:0},sourceWidth:s.width,sourceHeight:s.height,targetWidth:i.width,targetHeight:i.height,width:o.width,height:o.height,transform:o.transform})}):o.edges,[t,e])),e,n)}const A2={[_s.Arrow]:({color:t="none",strokeWidth:e=1})=>X.createElement("polyline",{style:{stroke:t,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),[_s.ArrowClosed]:({color:t="none",strokeWidth:e=1})=>X.createElement("polyline",{style:{stroke:t,fill:t,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},yP=({id:t,type:e,color:n,width:o=12.5,height:r=12.5,markerUnits:s="strokeWidth",strokeWidth:i,orient:a="auto-start-reverse"})=>{const l=function(d){const u=Ht();return M.useMemo(()=>{var h,f;return Object.prototype.hasOwnProperty.call(A2,d)?A2[d]:((f=(h=u.getState()).onError)==null||f.call(h,"009",NR(d)),null)},[d])}(e);return l?X.createElement("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${o}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:a,refX:"0",refY:"0"},X.createElement(l,{color:n,strokeWidth:i})):null},T2=({defaultColor:t,rfId:e})=>{const n=mt(M.useCallback((({defaultColor:o,rfId:r})=>s=>{const i=[];return s.edges.reduce((a,l)=>([l.markerStart,l.markerEnd].forEach(d=>{if(d&&typeof d=="object"){const u=Yh(d,r);i.includes(u)||(a.push({id:u,color:d.color||o,...d}),i.push(u))}}),a),[]).sort((a,l)=>a.id.localeCompare(l.id))})({defaultColor:t,rfId:e}),[t,e]),(o,r)=>!(o.length!==r.length||o.some((s,i)=>s.id!==r[i].id)));return X.createElement("defs",null,n.map(o=>X.createElement(yP,{id:o.id,key:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient})))};T2.displayName="MarkerDefinitions";var wP=M.memo(T2);const vP=t=>({nodesConnectable:t.nodesConnectable,edgesFocusable:t.edgesFocusable,edgesUpdatable:t.edgesUpdatable,elementsSelectable:t.elementsSelectable,width:t.width,height:t.height,connectionMode:t.connectionMode,nodeInternals:t.nodeInternals,onError:t.onError}),M2=({defaultMarkerColor:t,onlyRenderVisibleElements:e,elevateEdgesOnSelect:n,rfId:o,edgeTypes:r,noPanClassName:s,onEdgeContextMenu:i,onEdgeMouseEnter:a,onEdgeMouseMove:l,onEdgeMouseLeave:d,onEdgeClick:u,onEdgeDoubleClick:h,onReconnect:f,onReconnectStart:m,onReconnectEnd:_,reconnectRadius:g,children:p,disableKeyboardA11y:b})=>{const{edgesFocusable:x,edgesUpdatable:y,elementsSelectable:v,width:C,height:k,connectionMode:N,nodeInternals:j,onError:I}=mt(vP,tn),T=xP(e,j,n);return C?X.createElement(X.Fragment,null,T.map(({level:A,edges:R,isMaxLevel:z})=>X.createElement("svg",{key:A,style:{zIndex:A},width:C,height:k,className:"react-flow__edges react-flow__container"},z&&X.createElement(wP,{defaultColor:t,rfId:o}),X.createElement("g",null,R.map(D=>{const[F,B,U]=I2(j.get(D.source)),[O,S,$]=I2(j.get(D.target));if(!U||!$)return null;let E=D.type||"default";r[E]||(I==null||I("011",IR(E)),E="default");const W=r[E]||r.default,G=N===jr.Strict?S.target:(S.target??[]).concat(S.source??[]),q=E2(B.source,D.sourceHandle),Y=E2(G,D.targetHandle),te=(q==null?void 0:q.position)||Be.Bottom,oe=(Y==null?void 0:Y.position)||Be.Top,se=!!(D.focusable||x&&D.focusable===void 0),Z=D.reconnectable||D.updatable,Q=f!==void 0&&(Z||y&&Z===void 0);if(!q||!Y)return I==null||I("008",jR(q,D)),null;const{sourceX:ue,sourceY:me,targetX:ce,targetY:fe}=((de,ke,Se,ie,je,pe)=>{const Ae=j2(Se,de,ke),Fe=j2(pe,ie,je);return{sourceX:Ae.x,sourceY:Ae.y,targetX:Fe.x,targetY:Fe.y}})(F,q,te,O,Y,oe);return X.createElement(W,{key:D.id,id:D.id,className:dn([D.className,s]),type:E,data:D.data,selected:!!D.selected,animated:!!D.animated,hidden:!!D.hidden,label:D.label,labelStyle:D.labelStyle,labelShowBg:D.labelShowBg,labelBgStyle:D.labelBgStyle,labelBgPadding:D.labelBgPadding,labelBgBorderRadius:D.labelBgBorderRadius,style:D.style,source:D.source,target:D.target,sourceHandleId:D.sourceHandle,targetHandleId:D.targetHandle,markerEnd:D.markerEnd,markerStart:D.markerStart,sourceX:ue,sourceY:me,targetX:ce,targetY:fe,sourcePosition:te,targetPosition:oe,elementsSelectable:v,onContextMenu:i,onMouseEnter:a,onMouseMove:l,onMouseLeave:d,onClick:u,onEdgeDoubleClick:h,onReconnect:f,onReconnectStart:m,onReconnectEnd:_,reconnectRadius:g,rfId:o,ariaLabel:D.ariaLabel,isFocusable:se,isReconnectable:Q,pathOptions:"pathOptions"in D?D.pathOptions:void 0,interactionWidth:D.interactionWidth,disableKeyboardA11y:b})})))),p):null};M2.displayName="EdgeRenderer";var kP=M.memo(M2);const SP=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function CP({children:t}){const e=mt(SP);return X.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:e}},t)}const NP={[Be.Left]:Be.Right,[Be.Right]:Be.Left,[Be.Top]:Be.Bottom,[Be.Bottom]:Be.Top},O2=({nodeId:t,handleType:e,style:n,type:o=er.Bezier,CustomComponent:r,connectionStatus:s})=>{var k,N,j;const{fromNode:i,handleId:a,toX:l,toY:d,connectionMode:u}=mt(M.useCallback(I=>({fromNode:I.nodeInternals.get(t),handleId:I.connectionHandleId,toX:(I.connectionPosition.x-I.transform[0])/I.transform[2],toY:(I.connectionPosition.y-I.transform[1])/I.transform[2],connectionMode:I.connectionMode}),[t]),tn),h=(k=i==null?void 0:i[kt])==null?void 0:k.handleBounds;let f=h==null?void 0:h[e];if(u===jr.Loose&&(f=f||(h==null?void 0:h[e==="source"?"target":"source"])),!i||!f)return null;const m=a?f.find(I=>I.id===a):f[0],_=m?m.x+m.width/2:(i.width??0)/2,g=m?m.y+m.height/2:i.height??0,p=(((N=i.positionAbsolute)==null?void 0:N.x)??0)+_,b=(((j=i.positionAbsolute)==null?void 0:j.y)??0)+g,x=m==null?void 0:m.position,y=x?NP[x]:null;if(!x||!y)return null;if(r)return X.createElement(r,{connectionLineType:o,connectionLineStyle:n,fromNode:i,fromHandle:m,fromX:p,fromY:b,toX:l,toY:d,fromPosition:x,toPosition:y,connectionStatus:s});let v="";const C={sourceX:p,sourceY:b,sourcePosition:x,targetX:l,targetY:d,targetPosition:y};return o===er.Bezier?[v]=Bv(C):o===er.Step?[v]=Hh({...C,borderRadius:0}):o===er.SmoothStep?[v]=Hh(C):o===er.SimpleBezier?[v]=Pv(C):v=`M${p},${b} ${l},${d}`,X.createElement("path",{d:v,fill:"none",className:"react-flow__connection-path",style:n})};O2.displayName="ConnectionLine";const jP=t=>({nodeId:t.connectionNodeId,handleType:t.connectionHandleType,nodesConnectable:t.nodesConnectable,connectionStatus:t.connectionStatus,width:t.width,height:t.height});function EP({containerStyle:t,style:e,type:n,component:o}){const{nodeId:r,handleType:s,nodesConnectable:i,width:a,height:l,connectionStatus:d}=mt(jP,tn);return r&&s&&a&&i?X.createElement("svg",{style:t,width:a,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container"},X.createElement("g",{className:dn(["react-flow__connection",d])},X.createElement(O2,{nodeId:r,handleType:s,style:e,type:n,CustomComponent:o,connectionStatus:d}))):null}function D2(t,e){return M.useRef(null),Ht(),M.useMemo(()=>e(t),[t])}const R2=({nodeTypes:t,edgeTypes:e,onMove:n,onMoveStart:o,onMoveEnd:r,onInit:s,onNodeClick:i,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:d,onNodeMouseEnter:u,onNodeMouseMove:h,onNodeMouseLeave:f,onNodeContextMenu:m,onSelectionContextMenu:_,onSelectionStart:g,onSelectionEnd:p,connectionLineType:b,connectionLineStyle:x,connectionLineComponent:y,connectionLineContainerStyle:v,selectionKeyCode:C,selectionOnDrag:k,selectionMode:N,multiSelectionKeyCode:j,panActivationKeyCode:I,zoomActivationKeyCode:T,deleteKeyCode:A,onlyRenderVisibleElements:R,elementsSelectable:z,selectNodesOnDrag:D,defaultViewport:F,translateExtent:B,minZoom:U,maxZoom:O,preventScrolling:S,defaultMarkerColor:$,zoomOnScroll:E,zoomOnPinch:W,panOnScroll:G,panOnScrollSpeed:q,panOnScrollMode:Y,zoomOnDoubleClick:te,panOnDrag:oe,onPaneClick:se,onPaneMouseEnter:Z,onPaneMouseMove:Q,onPaneMouseLeave:ue,onPaneScroll:me,onPaneContextMenu:ce,onEdgeContextMenu:fe,onEdgeMouseEnter:de,onEdgeMouseMove:ke,onEdgeMouseLeave:Se,onReconnect:ie,onReconnectStart:je,onReconnectEnd:pe,reconnectRadius:Ae,noDragClassName:Fe,noWheelClassName:De,noPanClassName:Ve,elevateEdgesOnSelect:Le,disableKeyboardA11y:ot,nodeOrigin:Qe,nodeExtent:tt,rfId:ne})=>{const ve=D2(t,uP),Ce=D2(e,_P);return function(Re){const J=Bi(),ae=M.useRef(!1);M.useEffect(()=>{!ae.current&&J.viewportInitialized&&Re&&(setTimeout(()=>Re(J),1),ae.current=!0)},[Re,J.viewportInitialized])}(s),X.createElement(dP,{onPaneClick:se,onPaneMouseEnter:Z,onPaneMouseMove:Q,onPaneMouseLeave:ue,onPaneContextMenu:ce,onPaneScroll:me,deleteKeyCode:A,selectionKeyCode:C,selectionOnDrag:k,selectionMode:N,onSelectionStart:g,onSelectionEnd:p,multiSelectionKeyCode:j,panActivationKeyCode:I,zoomActivationKeyCode:T,elementsSelectable:z,onMove:n,onMoveStart:o,onMoveEnd:r,zoomOnScroll:E,zoomOnPinch:W,zoomOnDoubleClick:te,panOnScroll:G,panOnScrollSpeed:q,panOnScrollMode:Y,panOnDrag:oe,defaultViewport:F,translateExtent:B,minZoom:U,maxZoom:O,onSelectionContextMenu:_,preventScrolling:S,noDragClassName:Fe,noWheelClassName:De,noPanClassName:Ve,disableKeyboardA11y:ot},X.createElement(CP,null,X.createElement(kP,{edgeTypes:Ce,onEdgeClick:a,onEdgeDoubleClick:d,onlyRenderVisibleElements:R,onEdgeContextMenu:fe,onEdgeMouseEnter:de,onEdgeMouseMove:ke,onEdgeMouseLeave:Se,onReconnect:ie,onReconnectStart:je,onReconnectEnd:pe,reconnectRadius:Ae,defaultMarkerColor:$,noPanClassName:Ve,elevateEdgesOnSelect:!!Le,disableKeyboardA11y:ot,rfId:ne},X.createElement(EP,{style:x,type:b,component:y,containerStyle:v})),X.createElement("div",{className:"react-flow__edgelabel-renderer"}),X.createElement(fP,{nodeTypes:ve,onNodeClick:i,onNodeDoubleClick:l,onNodeMouseEnter:u,onNodeMouseMove:h,onNodeMouseLeave:f,onNodeContextMenu:m,selectNodesOnDrag:D,onlyRenderVisibleElements:R,noPanClassName:Ve,noDragClassName:Fe,disableKeyboardA11y:ot,nodeOrigin:Qe,nodeExtent:tt,rfId:ne})))};R2.displayName="GraphView";var IP=M.memo(R2);const lf=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],or={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:lf,nodeExtent:lf,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:jr.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:(t,e)=>{},isValidConnection:void 0},AP=()=>((t,e)=>t?xv(t,e):xv)((t,e)=>({...or,setNodes:n=>{const{nodeInternals:o,nodeOrigin:r,elevateNodesOnSelect:s}=e();t({nodeInternals:tf(n,o,r,s)})},getNodes:()=>Array.from(e().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:o={}}=e();t({edges:n.map(r=>({...o,...r}))})},setDefaultNodesAndEdges:(n,o)=>{const r=n!==void 0,s=o!==void 0,i=r?tf(n,new Map,e().nodeOrigin,e().elevateNodesOnSelect):new Map;t({nodeInternals:i,edges:s?o:[],hasDefaultNodes:r,hasDefaultEdges:s})},updateNodeDimensions:n=>{const{onNodesChange:o,nodeInternals:r,fitViewOnInit:s,fitViewOnInitDone:i,fitViewOnInitOptions:a,domNode:l,nodeOrigin:d}=e(),u=l==null?void 0:l.querySelector(".react-flow__viewport");if(!u)return;const h=window.getComputedStyle(u),{m22:f}=new window.DOMMatrixReadOnly(h.transform),m=n.reduce((g,p)=>{const b=r.get(p.id);if(b!=null&&b.hidden)r.set(b.id,{...b,[kt]:{...b[kt],handleBounds:void 0}});else if(b){const x=Lh(p.nodeElement);!(!x.width||!x.height||b.width===x.width&&b.height===x.height&&!p.forceUpdate)&&(r.set(b.id,{...b,[kt]:{...b[kt],handleBounds:{source:y2(".source",p.nodeElement,f,d),target:y2(".target",p.nodeElement,f,d)}},...x}),g.push({id:b.id,type:"dimensions",dimensions:x}))}return g},[]);c2(r,d);const _=i||s&&!i&&d2(e,{initial:!0,...a});t({nodeInternals:new Map(r),fitViewOnInitDone:_}),(m==null?void 0:m.length)>0&&(o==null||o(m))},updateNodePositions:(n,o=!0,r=!1)=>{const{triggerNodeChanges:s}=e(),i=n.map(a=>{const l={id:a.id,type:"position",dragging:r};return o&&(l.positionAbsolute=a.positionAbsolute,l.position=a.position),l});s(i)},triggerNodeChanges:n=>{const{onNodesChange:o,nodeInternals:r,hasDefaultNodes:s,nodeOrigin:i,getNodes:a,elevateNodesOnSelect:l}=e();if(n!=null&&n.length){if(s){const d=tf(p2(n,a()),r,i,l);t({nodeInternals:d})}o==null||o(n)}},addSelectedNodes:n=>{const{multiSelectionActive:o,edges:r,getNodes:s}=e();let i,a=null;o?i=n.map(l=>nr(l,!0)):(i=vs(s(),n),a=vs(r,[])),Wl({changedNodes:i,changedEdges:a,get:e,set:t})},addSelectedEdges:n=>{const{multiSelectionActive:o,edges:r,getNodes:s}=e();let i,a=null;o?i=n.map(l=>nr(l,!0)):(i=vs(r,n),a=vs(s(),[])),Wl({changedNodes:a,changedEdges:i,get:e,set:t})},unselectNodesAndEdges:({nodes:n,edges:o}={})=>{const{edges:r,getNodes:s}=e(),i=o||r;Wl({changedNodes:(n||s()).map(a=>(a.selected=!1,nr(a.id,!1))),changedEdges:i.map(a=>nr(a.id,!1)),get:e,set:t})},setMinZoom:n=>{const{d3Zoom:o,maxZoom:r}=e();o==null||o.scaleExtent([n,r]),t({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:o,minZoom:r}=e();o==null||o.scaleExtent([r,n]),t({maxZoom:n})},setTranslateExtent:n=>{var o;(o=e().d3Zoom)==null||o.translateExtent(n),t({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:o}=e();Wl({changedNodes:o().filter(r=>r.selected).map(r=>nr(r.id,!1)),changedEdges:n.filter(r=>r.selected).map(r=>nr(r.id,!1)),get:e,set:t})},setNodeExtent:n=>{const{nodeInternals:o}=e();o.forEach(r=>{r.positionAbsolute=Fh(r.position,n)}),t({nodeExtent:n,nodeInternals:new Map(o)})},panBy:n=>{const{transform:o,width:r,height:s,d3Zoom:i,d3Selection:a,translateExtent:l}=e();if(!i||!a||!n.x&&!n.y)return!1;const d=pr.translate(o[0]+n.x,o[1]+n.y).scale(o[2]),u=[[0,0],[r,s]],h=i==null?void 0:i.constrain()(d,u,l);return i.transform(a,h),o[0]!==h.x||o[1]!==h.y||o[2]!==h.k},cancelConnection:()=>t({connectionNodeId:or.connectionNodeId,connectionHandleId:or.connectionHandleId,connectionHandleType:or.connectionHandleType,connectionStatus:or.connectionStatus,connectionStartHandle:or.connectionStartHandle,connectionEndHandle:or.connectionEndHandle}),reset:()=>t({...or})}),Object.is),cf=({children:t})=>{const e=M.useRef(null);return e.current||(e.current=AP()),X.createElement(vR,{value:e.current},t)};cf.displayName="ReactFlowProvider";const P2=({children:t})=>M.useContext(Ll)?X.createElement(X.Fragment,null,t):X.createElement(cf,null,t);P2.displayName="ReactFlowWrapper";const TP={input:Qv,default:Qh,output:t2,group:ef},MP={default:$l,straight:qh,step:Wh,smoothstep:Ul,simplebezier:$h},OP=[0,0],DP=[15,15],RP={x:0,y:0,zoom:1},PP={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},df=M.forwardRef(({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,className:r,nodeTypes:s=TP,edgeTypes:i=MP,onNodeClick:a,onEdgeClick:l,onInit:d,onMove:u,onMoveStart:h,onMoveEnd:f,onConnect:m,onConnectStart:_,onConnectEnd:g,onClickConnectStart:p,onClickConnectEnd:b,onNodeMouseEnter:x,onNodeMouseMove:y,onNodeMouseLeave:v,onNodeContextMenu:C,onNodeDoubleClick:k,onNodeDragStart:N,onNodeDrag:j,onNodeDragStop:I,onNodesDelete:T,onEdgesDelete:A,onSelectionChange:R,onSelectionDragStart:z,onSelectionDrag:D,onSelectionDragStop:F,onSelectionContextMenu:B,onSelectionStart:U,onSelectionEnd:O,connectionMode:S=jr.Strict,connectionLineType:$=er.Bezier,connectionLineStyle:E,connectionLineComponent:W,connectionLineContainerStyle:G,deleteKeyCode:q="Backspace",selectionKeyCode:Y="Shift",selectionOnDrag:te=!1,selectionMode:oe=Li.Full,panActivationKeyCode:se="Space",multiSelectionKeyCode:Z=zl()?"Meta":"Control",zoomActivationKeyCode:Q=zl()?"Meta":"Control",snapToGrid:ue=!1,snapGrid:me=DP,onlyRenderVisibleElements:ce=!1,selectNodesOnDrag:fe=!0,nodesDraggable:de,nodesConnectable:ke,nodesFocusable:Se,nodeOrigin:ie=OP,edgesFocusable:je,edgesUpdatable:pe,elementsSelectable:Ae,defaultViewport:Fe=RP,minZoom:De=.5,maxZoom:Ve=2,translateExtent:Le=lf,preventScrolling:ot=!0,nodeExtent:Qe,defaultMarkerColor:tt="#b1b1b7",zoomOnScroll:ne=!0,zoomOnPinch:ve=!0,panOnScroll:Ce=!1,panOnScrollSpeed:Re=.5,panOnScrollMode:J=Qo.Free,zoomOnDoubleClick:ae=!0,panOnDrag:_e=!0,onPaneClick:ge,onPaneMouseEnter:ye,onPaneMouseMove:$e,onPaneMouseLeave:ze,onPaneScroll:rt,onPaneContextMenu:le,children:Ie,onEdgeContextMenu:Ee,onEdgeDoubleClick:He,onEdgeMouseEnter:Ge,onEdgeMouseMove:Pe,onEdgeMouseLeave:Ye,onEdgeUpdate:st,onEdgeUpdateStart:Xe,onEdgeUpdateEnd:dt,onReconnect:St,onReconnectStart:zt,onReconnectEnd:nn,reconnectRadius:Wt=10,edgeUpdaterRadius:_n=10,onNodesChange:Ns,onEdgesChange:ho,noDragClassName:Lo="nodrag",noWheelClassName:$n="nowheel",noPanClassName:js="nopan",fitView:Hi=!1,fitViewOptions:rz,connectOnClick:sz=!0,attributionPosition:iz,proOptions:az,defaultEdgeOptions:lz,elevateNodesOnSelect:cz=!0,elevateEdgesOnSelect:dz=!1,disableKeyboardA11y:N3=!1,autoPanOnConnect:uz=!0,autoPanOnNodeDrag:hz=!0,connectionRadius:fz=20,isValidConnection:mz,onError:pz,style:gz,id:j3,nodeDragThreshold:_z,...bz},xz)=>{const tm=j3||"1";return X.createElement("div",{...bz,style:{...gz,...PP},ref:xz,className:dn(["react-flow",r]),"data-testid":"rf__wrapper",id:j3},X.createElement(P2,null,X.createElement(IP,{onInit:d,onMove:u,onMoveStart:h,onMoveEnd:f,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:x,onNodeMouseMove:y,onNodeMouseLeave:v,onNodeContextMenu:C,onNodeDoubleClick:k,nodeTypes:s,edgeTypes:i,connectionLineType:$,connectionLineStyle:E,connectionLineComponent:W,connectionLineContainerStyle:G,selectionKeyCode:Y,selectionOnDrag:te,selectionMode:oe,deleteKeyCode:q,multiSelectionKeyCode:Z,panActivationKeyCode:se,zoomActivationKeyCode:Q,onlyRenderVisibleElements:ce,selectNodesOnDrag:fe,defaultViewport:Fe,translateExtent:Le,minZoom:De,maxZoom:Ve,preventScrolling:ot,zoomOnScroll:ne,zoomOnPinch:ve,zoomOnDoubleClick:ae,panOnScroll:Ce,panOnScrollSpeed:Re,panOnScrollMode:J,panOnDrag:_e,onPaneClick:ge,onPaneMouseEnter:ye,onPaneMouseMove:$e,onPaneMouseLeave:ze,onPaneScroll:rt,onPaneContextMenu:le,onSelectionContextMenu:B,onSelectionStart:U,onSelectionEnd:O,onEdgeContextMenu:Ee,onEdgeDoubleClick:He,onEdgeMouseEnter:Ge,onEdgeMouseMove:Pe,onEdgeMouseLeave:Ye,onReconnect:St??st,onReconnectStart:zt??Xe,onReconnectEnd:nn??dt,reconnectRadius:Wt??_n,defaultMarkerColor:tt,noDragClassName:Lo,noWheelClassName:$n,noPanClassName:js,elevateEdgesOnSelect:dz,rfId:tm,disableKeyboardA11y:N3,nodeOrigin:ie,nodeExtent:Qe}),X.createElement(WR,{nodes:t,edges:e,defaultNodes:n,defaultEdges:o,onConnect:m,onConnectStart:_,onConnectEnd:g,onClickConnectStart:p,onClickConnectEnd:b,nodesDraggable:de,nodesConnectable:ke,nodesFocusable:Se,edgesFocusable:je,edgesUpdatable:pe,elementsSelectable:Ae,elevateNodesOnSelect:cz,minZoom:De,maxZoom:Ve,nodeExtent:Qe,onNodesChange:Ns,onEdgesChange:ho,snapToGrid:ue,snapGrid:me,connectionMode:S,translateExtent:Le,connectOnClick:sz,defaultEdgeOptions:lz,fitView:Hi,fitViewOptions:rz,onNodesDelete:T,onEdgesDelete:A,onNodeDragStart:N,onNodeDrag:j,onNodeDragStop:I,onSelectionDrag:D,onSelectionDragStart:z,onSelectionDragStop:F,noPanClassName:js,nodeOrigin:ie,rfId:tm,autoPanOnConnect:uz,autoPanOnNodeDrag:hz,onError:pz,connectionRadius:fz,isValidConnection:mz,nodeDragThreshold:_z}),X.createElement($R,{onSelectionChange:R}),Ie,X.createElement(MR,{proOptions:az,position:iz}),X.createElement(JR,{rfId:tm,disableKeyboardA11y:N3})))});function L2(t){return e=>{const[n,o]=M.useState(e),r=M.useCallback(s=>o(i=>t(s,i)),[]);return[n,o,r]}}df.displayName="ReactFlow";const F2=L2(p2),z2=L2(function(t,e){return m2(t,e)});function LP(){return X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},X.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function FP(){return X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},X.createElement("path",{d:"M0 0h32v4.2H0z"}))}function zP(){return X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},X.createElement("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"}))}function BP(){return X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},X.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"}))}function UP(){return X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},X.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"}))}const Cs=({children:t,className:e,...n})=>X.createElement("button",{type:"button",className:dn(["react-flow__controls-button",e]),...n},t);Cs.displayName="ControlButton";const VP=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom}),B2=({style:t,showZoom:e=!0,showFitView:n=!0,showInteractive:o=!0,fitViewOptions:r,onZoomIn:s,onZoomOut:i,onFitView:a,onInteractiveChange:l,className:d,children:u,position:h="bottom-left"})=>{const f=Ht(),[m,_]=M.useState(!1),{isInteractive:g,minZoomReached:p,maxZoomReached:b}=mt(VP,tn),{zoomIn:x,zoomOut:y,fitView:v}=Bi();return M.useEffect(()=>{_(!0)},[]),m?X.createElement(Fl,{className:dn(["react-flow__controls",d]),position:h,style:t,"data-testid":"rf__controls"},e&&X.createElement(X.Fragment,null,X.createElement(Cs,{onClick:()=>{x(),s==null||s()},className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:b},X.createElement(LP,null)),X.createElement(Cs,{onClick:()=>{y(),i==null||i()},className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:p},X.createElement(FP,null))),n&&X.createElement(Cs,{className:"react-flow__controls-fitview",onClick:()=>{v(r),a==null||a()},title:"fit view","aria-label":"fit view"},X.createElement(zP,null)),o&&X.createElement(Cs,{className:"react-flow__controls-interactive",onClick:()=>{f.setState({nodesDraggable:!g,nodesConnectable:!g,elementsSelectable:!g}),l==null||l(!g)},title:"toggle interactivity","aria-label":"toggle interactivity"},g?X.createElement(UP,null):X.createElement(BP,null)),u):null};B2.displayName="Controls";var Vn,$P=M.memo(B2);function HP({color:t,dimensions:e,lineWidth:n}){return X.createElement("path",{stroke:t,strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})}function WP({color:t,radius:e}){return X.createElement("circle",{cx:e,cy:e,r:e,fill:t})}(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Vn||(Vn={}));const qP={[Vn.Dots]:"#91919a",[Vn.Lines]:"#eee",[Vn.Cross]:"#e2e2e2"},GP={[Vn.Dots]:1,[Vn.Lines]:1,[Vn.Cross]:6},YP=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function U2({id:t,variant:e=Vn.Dots,gap:n=20,size:o,lineWidth:r=1,offset:s=2,color:i,style:a,className:l}){const d=M.useRef(null),{transform:u,patternId:h}=mt(YP,tn),f=i||qP[e],m=o||GP[e],_=e===Vn.Dots,g=e===Vn.Cross,p=Array.isArray(n)?n:[n,n],b=[p[0]*u[2]||1,p[1]*u[2]||1],x=m*u[2],y=g?[x,x]:b,v=_?[x/s,x/s]:[y[0]/s,y[1]/s];return X.createElement("svg",{className:dn(["react-flow__background",l]),style:{...a,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:d,"data-testid":"rf__background"},X.createElement("pattern",{id:h+t,x:u[0]%b[0],y:u[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${v[0]},-${v[1]})`},_?X.createElement(WP,{color:f,radius:x/s}):X.createElement(HP,{dimensions:y,color:f,lineWidth:r})),X.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${h+t})`}))}U2.displayName="Background";var JP=M.memo(U2);function uf(t){return Math.min(11*t+35,200)}const V2=X.createContext("LR"),$2=M.memo(t=>{const e=K.c(51),{data:n,selected:o}=t,r=Ue(n.atom),s=Uc().inOrderIds.indexOf(r.id),i=o?"var(--gray-9)":"var(--gray-3)",a=mt(KP),l=M.use(V2);let d,u,h,f,m;if(e[0]!==r.code||e[1]!==i||e[2]!==l||e[3]!==o){const A=r.code.split(`
|
142
142
|
`).length,R=l==="LR"?Be.Left:Be.Top;let z;e[8]!==i?(z={background:i},e[8]=i,e[9]=z):z=e[9],e[10]!==R||e[11]!==z?(h=c.jsx(tr,{type:"target",id:"inputs",position:R,style:z}),e[10]=R,e[11]=z,e[12]=h):h=e[12];const D=l==="LR"?Be.Left:Be.Top;let F;e[13]!==i?(F={background:i},e[13]=i,e[14]=F):F=e[14],e[15]!==D||e[16]!==F?(f=c.jsx(tr,{type:"source",id:"inputs",position:D,style:F}),e[15]=D,e[16]=F,e[17]=f):f=e[17];const B=o&&"border-primary";e[18]!==B?(u=Ne("flex flex-col bg-card border border-input/50 rounded-md mx-[2px] overflow-hidden",B),e[18]=B,e[19]=u):u=e[19],d=uf(A),e[0]=r.code,e[1]=i,e[2]=l,e[3]=o,e[4]=d,e[5]=u,e[6]=h,e[7]=f}else d=e[4],u=e[5],h=e[6],f=e[7];var _;let g;e[20]!==n.forceWidth||e[21]!==a?(m=n.forceWidth||(_=a,Math.min(Math.max(_-100,100),400)),e[20]=n.forceWidth,e[21]=a,e[22]=m):m=e[22],e[23]!==d||e[24]!==m?(g={height:d,width:m},e[23]=d,e[24]=m,e[25]=g):g=e[25];const p=p$(r.name,s);let b,x,y;e[26]!==p?(b=c.jsx("div",{className:"text-muted-foreground font-semibold text-xs py-1 px-2 bg-muted border-b",children:p}),e[26]=p,e[27]=b):b=e[27],e[28]!==r.code?(x=c.jsx(QH,{code:r.code}),e[28]=r.code,e[29]=x):x=e[29],e[30]!==u||e[31]!==g||e[32]!==b||e[33]!==x?(y=c.jsxs("div",{className:u,style:g,children:[b,x]}),e[30]=u,e[31]=g,e[32]=b,e[33]=x,e[34]=y):y=e[34];const v=l==="LR"?Be.Right:Be.Bottom;let C,k;e[35]!==i?(C={background:i},e[35]=i,e[36]=C):C=e[36],e[37]!==v||e[38]!==C?(k=c.jsx(tr,{type:"source",id:"outputs",position:v,style:C}),e[37]=v,e[38]=C,e[39]=k):k=e[39];const N=l==="LR"?Be.Right:Be.Bottom;let j,I,T;return e[40]!==i?(j={background:i},e[40]=i,e[41]=j):j=e[41],e[42]!==N||e[43]!==j?(I=c.jsx(tr,{type:"target",id:"outputs",position:N,style:j}),e[42]=N,e[43]=j,e[44]=I):I=e[44],e[45]!==y||e[46]!==k||e[47]!==I||e[48]!==h||e[49]!==f?(T=c.jsxs("div",{children:[h,f,y,k,I]}),e[45]=y,e[46]=k,e[47]=I,e[48]=h,e[49]=f,e[50]=T):T=e[50],T},(t,e)=>["data","selected","id"].every(n=>t[n]===e[n]));$2.displayName="CustomNode";const H2={custom:$2};function KP(t){const{width:e}=t;return e}const W2=t=>{const e=K.c(18),{maxCount:n,cellIds:o,onClick:r,skipScroll:s}=t,i=Uc();let a,l,d,u;if(e[0]!==o||e[1]!==i||e[2]!==n||e[3]!==r||e[4]!==s){d=Symbol.for("react.early_return_sentinel");e:{let h;e[8]!==i?(h=(_,g)=>i.inOrderIds.indexOf(_)-i.inOrderIds.indexOf(g),e[8]=i,e[9]=h):h=e[9];const f=[...o].sort(h);if(o.length===0){let _;e[10]===Symbol.for("react.memo_cache_sentinel")?(_=c.jsx("div",{className:"text-muted-foreground",children:"--"}),e[10]=_):_=e[10],d=_;break e}let m;e[11]!==o.length||e[12]!==r||e[13]!==s?(m=(_,g)=>c.jsxs("span",{className:"truncate",children:[c.jsx(fr,{variant:"focus",cellId:_,skipScroll:s,className:"whitespace-nowrap",onClick:r?()=>r(_):void 0},_),g<o.length-1&&", "]},_),e[11]=o.length,e[12]=r,e[13]=s,e[14]=m):m=e[14],a=f.slice(0,n).map(m),l=o.length>n&&c.jsxs(zr,{children:[c.jsx(Vs,{asChild:!0,children:c.jsxs("span",{className:"whitespace-nowrap text-muted-foreground text-xs hover:underline cursor-pointer",children:["+",o.length-n," more"]})}),c.jsx(Ps,{className:"w-auto",children:c.jsx("div",{className:"flex flex-col gap-1 py-1",children:f.slice(n).map(_=>c.jsx(fr,{variant:"focus",cellId:_,className:"whitespace-nowrap",onClick:r?()=>r(_):void 0},_))})})]})}e[0]=o,e[1]=i,e[2]=n,e[3]=r,e[4]=s,e[5]=a,e[6]=l,e[7]=d}else a=e[5],l=e[6],d=e[7];return d!==Symbol.for("react.early_return_sentinel")?d:(e[15]!==a||e[16]!==l?(u=c.jsxs(c.Fragment,{children:[a,l]}),e[15]=a,e[16]=l,e[17]=u):u=e[17],u)},hf=t=>{const e=K.c(15);let n,o,r,s;e[0]!==t?({name:o,declaredBy:n,onClick:r,...s}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=r,e[4]=s):(n=e[1],o=e[2],r=e[3],s=e[4]);const i=n.length>1?"destructive":"outline";let a,l,d;return e[5]!==o||e[6]!==r?(a=async u=>{r?r(u):(await bn(o),ct({title:"Copied to clipboard"}))},e[5]=o,e[6]=r,e[7]=a):a=e[7],e[8]!==o||e[9]!==i||e[10]!==a?(l=c.jsx(lS,{title:o,variant:i,className:"rounded-sm text-ellipsis block overflow-hidden max-w-fit cursor-pointer font-medium",onClick:a,children:o}),e[8]=o,e[9]=i,e[10]=a,e[11]=l):l=e[11],e[12]!==s||e[13]!==l?(d=c.jsx("div",{className:"max-w-[130px]",...s,children:l}),e[12]=s,e[13]=l,e[14]=d):d=e[14],d},ff=M.memo(t=>{const e=K.c(38),{onChange:n,view:o,settings:r,onSettingsChange:s}=t;let i;e[0]!==s||e[1]!==r?(i=(D,F)=>{s({...r,[D]:F})},e[0]=s,e[1]=r,e[2]=i):i=e[2];const a=i;let l,d,u,h,f,m;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(Vs,{asChild:!0,children:c.jsx(Me,{variant:"text",size:"xs",children:c.jsx(wm,{className:"w-4 h-4"})})}),e[3]=l):l=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(d=c.jsx("div",{className:"font-semibold pb-4",children:"Settings"}),e[4]=d):d=e[4],e[5]!==a?(u=D=>a("hidePureMarkdown",!!D),e[5]=a,e[6]=u):u=e[6],e[7]!==r.hidePureMarkdown||e[8]!==u?(h=c.jsx(B4,{"data-testid":"hide-pure-markdown-checkbox",id:"hide-pure-markdown",checked:r.hidePureMarkdown,onCheckedChange:u}),e[7]=r.hidePureMarkdown,e[8]=u,e[9]=h):h=e[9],e[10]===Symbol.for("react.memo_cache_sentinel")?(f=c.jsx(Or,{htmlFor:"hide-pure-markdown",children:"Hide pure markdown"}),e[10]=f):f=e[10],e[11]!==h?(m=c.jsxs(zr,{children:[l,c.jsxs(Ps,{className:"w-auto p-2 text-muted-foreground",children:[d,c.jsxs("div",{className:"flex items-center gap-2",children:[h,f]})]})]}),e[11]=h,e[12]=m):m=e[12];const _=m,g=o==="_minimap_";let p,b,x;e[13]!==n?(p=()=>n("_minimap_"),e[13]=n,e[14]=p):p=e[14],e[15]===Symbol.for("react.memo_cache_sentinel")?(b=c.jsx(Pp,{className:"w-4 h-4 mr-1"}),e[15]=b):b=e[15],e[16]!==g||e[17]!==p?(x=c.jsxs(Me,{variant:"outline",className:"bg-background","aria-selected":g,size:"xs",onClick:p,children:[b,"Mini Map"]}),e[16]=g,e[17]=p,e[18]=x):x=e[18];const y=o==="TB";let v,C,k;e[19]!==n?(v=()=>n("TB"),e[19]=n,e[20]=v):v=e[20],e[21]===Symbol.for("react.memo_cache_sentinel")?(C=c.jsx(wa,{className:"w-4 h-4 mr-1"}),e[21]=C):C=e[21],e[22]!==y||e[23]!==v?(k=c.jsxs(Me,{variant:"outline",className:"bg-background","aria-selected":y,size:"xs",onClick:v,children:[C,"Vertical Tree"]}),e[22]=y,e[23]=v,e[24]=k):k=e[24];const N=o==="LR";let j,I,T,A;e[25]!==n?(j=()=>n("LR"),e[25]=n,e[26]=j):j=e[26],e[27]===Symbol.for("react.memo_cache_sentinel")?(I=c.jsx(wa,{className:"w-4 h-4 mr-1 transform -rotate-90"}),e[27]=I):I=e[27],e[28]!==N||e[29]!==j?(T=c.jsxs(Me,{variant:"outline",className:"bg-background","aria-selected":N,size:"xs",onClick:j,children:[I," ","Horizontal Tree"]}),e[28]=N,e[29]=j,e[30]=T):T=e[30],e[31]!==x||e[32]!==k||e[33]!==T?(A=c.jsxs("div",{className:"flex gap-2",children:[x,k,T]}),e[31]=x,e[32]=k,e[33]=T,e[34]=A):A=e[34];const R=o!=="_minimap_"&&_;let z;return e[35]!==A||e[36]!==R?(z=c.jsxs(Fl,{position:"top-right",className:"flex flex-col items-end gap-2",children:[A,R]}),e[35]=A,e[36]=R,e[37]=z):z=e[37],z});ff.displayName="GraphToolbar";const Gl=M.memo(t=>{const e=K.c(11),{selection:n,variables:o,onClearSelection:r}=t;if(!n)return null;const s=XP;let i;e[0]!==r||e[1]!==n.id||e[2]!==n.source||e[3]!==n.target||e[4]!==n.type||e[5]!==o?(i=()=>{if(n.type==="node"){const u=Object.values(o).filter(m=>m.usedBy.includes(n.id)),h=Object.values(o).filter(m=>m.declaredBy.includes(n.id)),f=(m,_)=>c.jsxs(c.Fragment,{children:[m.length===0&&c.jsx("div",{className:"text-muted-foreground text-sm text-center",children:"--"}),c.jsx("div",{className:"grid grid-cols-5 gap-3 items-center text-sm py-1 flex-1 empty:hidden",children:m.map(g=>c.jsxs(X.Fragment,{children:[c.jsx(hf,{declaredBy:g.declaredBy,name:g.name}),c.jsxs("div",{className:"truncate col-span-2",title:g.value??"",children:[g.value,c.jsxs("span",{className:"ml-1 truncate text-foreground/60 font-mono",children:["(",g.dataType,")"]})]}),c.jsx("div",{className:"truncate col-span-2 gap-1 items-center",children:c.jsx(W2,{skipScroll:!0,onClick:()=>s(_==="in"?g.declaredBy[0]:g.usedBy[0],g.name),maxCount:3,cellIds:g.usedBy})})]},g.name))})]});return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"font-bold py-2 flex items-center gap-2 border-b px-3",children:[c.jsx(Xl,{className:"w-5 h-5"}),c.jsx(fr,{cellId:n.id}),c.jsx("div",{className:"flex-1"}),c.jsx(_0,{cellId:n.id,children:c.jsx(Me,{variant:"ghost",size:"icon",children:c.jsx(Xc,{className:"w-4 h-4"})})}),c.jsx(Me,{variant:"text",size:"icon",onClick:()=>{r()},children:c.jsx(eo,{className:"w-4 h-4"})})]}),c.jsxs("div",{className:"text-sm flex flex-col py-3 pl-2 pr-4 flex-1 justify-center",children:[c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsxs("span",{className:"flex items-center gap-2 font-semibold",children:[c.jsx(rp,{className:"w-4 h-4"}),"Outputs"]}),f(h,"out")]}),c.jsx("hr",{className:"border-divider my-3"}),c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsxs("span",{className:"flex items-center gap-2 font-semibold",children:[c.jsx(fn,{className:"w-4 h-4"}),"Inputs"]}),f(u,"in")]})]})]})}if(n.type==="edge"){const u=Object.values(o).filter(h=>h.declaredBy.includes(n.source)&&h.usedBy.includes(n.target));return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"font-bold py-2 flex items-center gap-2 border-b px-3",children:[c.jsx(ka,{className:"w-4 h-4"}),c.jsx(fr,{cellId:n.source}),c.jsx(Yc,{className:"w-4 h-4"}),c.jsx(fr,{cellId:n.target})]}),c.jsx("div",{className:"grid grid-cols-4 gap-3 max-w-[350px] items-center text-sm p-3 flex-1",children:u.map(h=>c.jsxs(X.Fragment,{children:[c.jsx(hf,{declaredBy:h.declaredBy,name:h.name,onClick:()=>{s(h.declaredBy[0],h.name)}}),c.jsx("div",{className:"truncate text-foreground/60 font-mono",children:h.dataType}),c.jsx("div",{className:"truncate col-span-2",title:h.value??"",children:h.value})]},h.name))})]})}},e[0]=r,e[1]=n.id,e[2]=n.source,e[3]=n.target,e[4]=n.type,e[5]=o,e[6]=i):i=e[6];const a=i;let l,d;return e[7]!==a?(l=a(),e[7]=a,e[8]=l):l=e[8],e[9]!==l?(d=c.jsx(Fl,{position:"bottom-left",className:"max-h-[90%] flex flex-col w-[calc(100%-5rem)]",children:c.jsx("div",{className:"min-h-[100px] shadow-md rounded-md border max-w-[550px] border-primary/40 my-4 min-w-[240px] bg-[var(--slate-1)] text-muted-foreground/80 flex flex-col overflow-y-auto",children:l})}),e[9]=l,e[10]=d):d=e[10],d});function XP(t,e){const n=ec(t);n&&Wm(n,e)}function q2(){const t=K.c(7),e=Bi(),n=mt(QP),o=mt(ZP);let r;t[0]!==e?(r=()=>{e.fitView({duration:100})},t[0]=e,t[1]=r):r=t[1];const s=g$(r,100);let i,a;t[2]!==s||t[3]!==o||t[4]!==n?(i=()=>{n&&o&&s()},a=[n,o,s],t[2]=s,t[3]=o,t[4]=n,t[5]=i,t[6]=a):(i=t[5],a=t[6]),M.useEffect(i,a)}function ZP(t){const{height:e}=t;return e}function QP(t){const{width:e}=t;return e}Gl.displayName="GraphSelectionPanel";const G2=new class{createEdge(t,e,n){return{type:"smoothstep",pathOptions:{offset:20,borderRadius:100},data:{direction:n},markerEnd:{type:_s.Arrow},id:`${t}-${e}-${n}`,source:t,sourceHandle:n,targetHandle:n,target:e}}createNode(t,e,n){return{id:t,data:{atom:e},width:250,type:"custom",height:uf(at.get(e).code.trim().split(`
|
143
143
|
`).length),position:{x:0,y:n+20}}}createElements(t,e,n,o){let r=0;const s=[],i=[];for(const[l,d]of $m.zip(t,e)){const u=this.createNode(l,d,r);s.push(u),r=u.position.y+(u.height||0)}const a=new Set;for(const l of Object.values(n)){const{declaredBy:d,usedBy:u}=l;for(const h of d)for(const f of u){const m=`${h}-${f}`;a.has(m)||(a.add(m),i.push(this.createEdge(h,f,"inputs"),this.createEdge(h,f,"outputs")))}}return{nodes:s,edges:i}}},eL=t=>{const e=K.c(37),{cellIds:n,variables:o,cellAtoms:r,children:s}=t;let i;e[0]!==r||e[1]!==n||e[2]!==o?(i=G2.createElements(n,r,o,!1),e[0]=r,e[1]=n,e[2]=o,e[3]=i):i=e[3];const{nodes:a,edges:l}=i;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=[],e[4]=d):d=e[4];const[u,h]=z2(d),[f,m]=F2(a),[_,g]=M.useState(),[p,b]=M.useState(),x=M.useRef(!1);q2();const y=mt(tL);let v;e[5]!==h||e[6]!==m?(v=S=>{m(S.nodes),h([])},e[5]=h,e[6]=m,e[7]=v):v=e[7];const C=Ke(v);let k,N,j,I;e[8]!==r||e[9]!==n||e[10]!==C||e[11]!==o?(k=()=>{x.current?C(G2.createElements(n,r,o,!1)):x.current=!0},N=[n,o,r,C],e[8]=r,e[9]=n,e[10]=C,e[11]=o,e[12]=k,e[13]=N):(k=e[12],N=e[13]),M.useEffect(k,N),e[14]!==l||e[15]!==_||e[16]!==h?(j=()=>{if(_){const S=l.filter($=>{const{source:E,target:W,data:G}=$;return E===_&&G.direction==="outputs"||W===_&&G.direction==="inputs"});h(S)}},I=[_,h,l],e[14]=l,e[15]=_,e[16]=h,e[17]=j,e[18]=I):(j=e[17],I=e[18]),M.useEffect(j,I);const T=function(S,$){const E=K.c(17);let W,G;if(E[0]!==$||E[1]!==S){let Q;E[3]!==$?(Q=(ue,me)=>{const{position:ce}=me;return Math.min(ue,ce.y-$/2-10)},E[3]=$,E[4]=Q):Q=E[4],G=S.reduce(Q,Number.POSITIVE_INFINITY),E[0]=$,E[1]=S,E[2]=G}else G=E[2];const q=G;let Y;if(E[5]!==$||E[6]!==S){let Q;E[8]!==$?(Q=(ue,me)=>{const{position:ce}=me;return Math.max(ue,ce.y+$/2+10)},E[8]=$,E[9]=Q):Q=E[9],Y=S.reduce(Q,Number.NEGATIVE_INFINITY),E[5]=$,E[6]=S,E[7]=Y}else Y=E[7];const te=Y;let oe,se,Z;return E[10]!==q?(oe=[Number.NEGATIVE_INFINITY,q],E[10]=q,E[11]=oe):oe=E[11],E[12]!==te?(se=[Number.POSITIVE_INFINITY,te],E[12]=te,E[13]=se):se=E[13],E[14]!==oe||E[15]!==se?(Z=[oe,se],E[14]=oe,E[15]=se,E[16]=Z):Z=E[16],W=Z,W}(f,y);let A;e[19]===Symbol.for("react.memo_cache_sentinel")?(A=()=>{g(void 0),b(void 0)},e[19]=A):A=e[19];const R=A;let z;e[20]!==u||e[21]!==p||e[22]!==_||e[23]!==o?(z=()=>p?c.jsx(Gl,{selection:{type:"edge",source:p.source,target:p.target},onClearSelection:R,variables:o,edges:u}):_?c.jsx(Gl,{selection:{type:"node",id:_},variables:o,edges:u,onClearSelection:R}):null,e[20]=u,e[21]=p,e[22]=_,e[23]=o,e[24]=z):z=e[24];const D=z;let F,B,U,O;return e[25]!==h?(F=(S,$)=>{const E=$.id;g(E),b(void 0),h([])},e[25]=h,e[26]=F):F=e[26],e[27]===Symbol.for("react.memo_cache_sentinel")?(B=(S,$)=>{b($)},e[27]=B):B=e[27],e[28]!==D?(U=D(),e[28]=D,e[29]=U):U=e[29],e[30]!==s||e[31]!==u||e[32]!==f||e[33]!==F||e[34]!==U||e[35]!==T?(O=c.jsxs(df,{nodes:f,edges:u,nodeTypes:H2,translateExtent:T,onNodeClick:F,onNodeDoubleClick:nL,onEdgeClick:B,snapToGrid:!0,fitView:!0,elementsSelectable:!0,minZoom:1,maxZoom:1,draggable:!1,panOnScrollMode:Qo.Vertical,zoomOnDoubleClick:!1,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,edgesFocusable:!1,selectNodesOnDrag:!1,panOnDrag:!1,preventScrolling:!1,zoomOnPinch:!1,panOnScroll:!0,autoPanOnNodeDrag:!1,autoPanOnConnect:!1,children:[U,s]}),e[30]=s,e[31]=u,e[32]=f,e[33]=F,e[34]=U,e[35]=T,e[36]=O):O=e[36],O};function tL(t){const{height:e}=t;return e}function nL(t,e){cS(e.id,"focus")}var mf,Y2,J2,K2,X2,Z2,pf,Q2,gf,ek,_f,tk,bf,nk,xf,ok,yf,rk,wf,sk,vf,ik,kf,ak,Sf,lk,Cf,ck,Nf,dk,jf,uk,Ef,hk,fk,mk,pk,gk,_k,bk,If,xk,Af,yk,Tf,wk,Mf,vk,Of,kk,Df,Sk,Rf,Ck,Pf,Nk,Lf,jk,Ff,Ek,zf,Ik,Bf,Ak,Uf,Tk,Vf,Mk,Ok,Dk,Rk,Pk,Lk,Fk,$f,zk,Hf,Bk,Uk,Vk,Wf,$k,qf,Hk,Gf,Wk,Yf,qk,Jf,Gk,Yk,Jk,Kk,Xk;function Kf(){if(Y2)return mf;Y2=1;var t="\0";function e(s,i){s[i]?s[i]++:s[i]=1}function n(s,i){--s[i]||delete s[i]}function o(s,i,a,l){var d=""+i,u=""+a;if(!s&&d>u){var h=d;d=u,u=h}return d+""+u+""+(l===void 0?"\0":l)}function r(s,i){return o(s,i.v,i.w,i.name)}return mf=class{constructor(s){ee(this,"_isDirected",!0);ee(this,"_isMultigraph",!1);ee(this,"_isCompound",!1);ee(this,"_label");ee(this,"_defaultNodeLabelFn",()=>{});ee(this,"_defaultEdgeLabelFn",()=>{});ee(this,"_nodes",{});ee(this,"_in",{});ee(this,"_preds",{});ee(this,"_out",{});ee(this,"_sucs",{});ee(this,"_edgeObjs",{});ee(this,"_edgeLabels",{});ee(this,"_nodeCount",0);ee(this,"_edgeCount",0);ee(this,"_parent");ee(this,"_children");s&&(this._isDirected=!Object.hasOwn(s,"directed")||s.directed,this._isMultigraph=!!Object.hasOwn(s,"multigraph")&&s.multigraph,this._isCompound=!!Object.hasOwn(s,"compound")&&s.compound),this._isCompound&&(this._parent={},this._children={},this._children[t]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(s){return this._label=s,this}graph(){return this._label}setDefaultNodeLabel(s){return this._defaultNodeLabelFn=s,typeof s!="function"&&(this._defaultNodeLabelFn=()=>s),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var s=this;return this.nodes().filter(i=>Object.keys(s._in[i]).length===0)}sinks(){var s=this;return this.nodes().filter(i=>Object.keys(s._out[i]).length===0)}setNodes(s,i){var a=arguments,l=this;return s.forEach(function(d){a.length>1?l.setNode(d,i):l.setNode(d)}),this}setNode(s,i){return Object.hasOwn(this._nodes,s)?(arguments.length>1&&(this._nodes[s]=i),this):(this._nodes[s]=arguments.length>1?i:this._defaultNodeLabelFn(s),this._isCompound&&(this._parent[s]=t,this._children[s]={},this._children[t][s]=!0),this._in[s]={},this._preds[s]={},this._out[s]={},this._sucs[s]={},++this._nodeCount,this)}node(s){return this._nodes[s]}hasNode(s){return Object.hasOwn(this._nodes,s)}removeNode(s){var i=this;if(Object.hasOwn(this._nodes,s)){var a=l=>i.removeEdge(i._edgeObjs[l]);delete this._nodes[s],this._isCompound&&(this._removeFromParentsChildList(s),delete this._parent[s],this.children(s).forEach(function(l){i.setParent(l)}),delete this._children[s]),Object.keys(this._in[s]).forEach(a),delete this._in[s],delete this._preds[s],Object.keys(this._out[s]).forEach(a),delete this._out[s],delete this._sucs[s],--this._nodeCount}return this}setParent(s,i){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(i===void 0)i=t;else{for(var a=i+="";a!==void 0;a=this.parent(a))if(a===s)throw new Error("Setting "+i+" as parent of "+s+" would create a cycle");this.setNode(i)}return this.setNode(s),this._removeFromParentsChildList(s),this._parent[s]=i,this._children[i][s]=!0,this}_removeFromParentsChildList(s){delete this._children[this._parent[s]][s]}parent(s){if(this._isCompound){var i=this._parent[s];if(i!==t)return i}}children(s=t){if(this._isCompound){var i=this._children[s];if(i)return Object.keys(i)}else{if(s===t)return this.nodes();if(this.hasNode(s))return[]}}predecessors(s){var i=this._preds[s];if(i)return Object.keys(i)}successors(s){var i=this._sucs[s];if(i)return Object.keys(i)}neighbors(s){var i=this.predecessors(s);if(i){const l=new Set(i);for(var a of this.successors(s))l.add(a);return Array.from(l.values())}}isLeaf(s){return(this.isDirected()?this.successors(s):this.neighbors(s)).length===0}filterNodes(s){var i=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});i.setGraph(this.graph());var a=this;Object.entries(this._nodes).forEach(function([u,h]){s(u)&&i.setNode(u,h)}),Object.values(this._edgeObjs).forEach(function(u){i.hasNode(u.v)&&i.hasNode(u.w)&&i.setEdge(u,a.edge(u))});var l={};function d(u){var h=a.parent(u);return h===void 0||i.hasNode(h)?(l[u]=h,h):h in l?l[h]:d(h)}return this._isCompound&&i.nodes().forEach(u=>i.setParent(u,d(u))),i}setDefaultEdgeLabel(s){return this._defaultEdgeLabelFn=s,typeof s!="function"&&(this._defaultEdgeLabelFn=()=>s),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(s,i){var a=this,l=arguments;return s.reduce(function(d,u){return l.length>1?a.setEdge(d,u,i):a.setEdge(d,u),u}),this}setEdge(){var s,i,a,l,d=!1,u=arguments[0];typeof u=="object"&&u!==null&&"v"in u?(s=u.v,i=u.w,a=u.name,arguments.length===2&&(l=arguments[1],d=!0)):(s=u,i=arguments[1],a=arguments[3],arguments.length>2&&(l=arguments[2],d=!0)),s=""+s,i=""+i,a!==void 0&&(a=""+a);var h=o(this._isDirected,s,i,a);if(Object.hasOwn(this._edgeLabels,h))return d&&(this._edgeLabels[h]=l),this;if(a!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(s),this.setNode(i),this._edgeLabels[h]=d?l:this._defaultEdgeLabelFn(s,i,a);var f=function(m,_,g,p){var b=""+_,x=""+g;if(!m&&b>x){var y=b;b=x,x=y}var v={v:b,w:x};return p&&(v.name=p),v}(this._isDirected,s,i,a);return s=f.v,i=f.w,Object.freeze(f),this._edgeObjs[h]=f,e(this._preds[i],s),e(this._sucs[s],i),this._in[i][h]=f,this._out[s][h]=f,this._edgeCount++,this}edge(s,i,a){var l=arguments.length===1?r(this._isDirected,arguments[0]):o(this._isDirected,s,i,a);return this._edgeLabels[l]}edgeAsObj(){const s=this.edge(...arguments);return typeof s!="object"?{label:s}:s}hasEdge(s,i,a){var l=arguments.length===1?r(this._isDirected,arguments[0]):o(this._isDirected,s,i,a);return Object.hasOwn(this._edgeLabels,l)}removeEdge(s,i,a){var l=arguments.length===1?r(this._isDirected,arguments[0]):o(this._isDirected,s,i,a),d=this._edgeObjs[l];return d&&(s=d.v,i=d.w,delete this._edgeLabels[l],delete this._edgeObjs[l],n(this._preds[i],s),n(this._sucs[s],i),delete this._in[i][l],delete this._out[s][l],this._edgeCount--),this}inEdges(s,i){var a=this._in[s];if(a){var l=Object.values(a);return i?l.filter(d=>d.v===i):l}}outEdges(s,i){var a=this._out[s];if(a){var l=Object.values(a);return i?l.filter(d=>d.w===i):l}}nodeEdges(s,i){var a=this.inEdges(s,i);if(a)return a.concat(this.outEdges(s,i))}},mf}function oL(){return Z2?X2:(Z2=1,X2={Graph:Kf(),version:K2?J2:(K2=1,J2="2.2.4")})}function rL(){if(Q2)return pf;Q2=1;var t=Kf();function e(o){return o.nodes().map(function(r){var s=o.node(r),i=o.parent(r),a={v:r};return s!==void 0&&(a.value=s),i!==void 0&&(a.parent=i),a})}function n(o){return o.edges().map(function(r){var s=o.edge(r),i={v:r.v,w:r.w};return r.name!==void 0&&(i.name=r.name),s!==void 0&&(i.value=s),i})}return pf={write:function(o){var r={options:{directed:o.isDirected(),multigraph:o.isMultigraph(),compound:o.isCompound()},nodes:e(o),edges:n(o)};return o.graph()!==void 0&&(r.value=structuredClone(o.graph())),r},read:function(o){var r=new t(o.options).setGraph(o.value);return o.nodes.forEach(function(s){r.setNode(s.v,s.value),s.parent&&r.setParent(s.v,s.parent)}),o.edges.forEach(function(s){r.setEdge({v:s.v,w:s.w,name:s.name},s.value)}),r}},pf}function sL(){return ek||(ek=1,gf=function(t){var e,n={},o=[];function r(s){Object.hasOwn(n,s)||(n[s]=!0,e.push(s),t.successors(s).forEach(r),t.predecessors(s).forEach(r))}return t.nodes().forEach(function(s){e=[],r(s),e.length&&o.push(e)}),o}),gf}function Zk(){return tk?_f:(tk=1,_f=class{constructor(){ee(this,"_arr",[]);ee(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(t){return t.key})}has(t){return Object.hasOwn(this._keyIndices,t)}priority(t){var e=this._keyIndices[t];if(e!==void 0)return this._arr[e].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(t,e){var n=this._keyIndices;if(t=String(t),!Object.hasOwn(n,t)){var o=this._arr,r=o.length;return n[t]=r,o.push({key:t,priority:e}),this._decrease(r),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key}decrease(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)}_heapify(t){var e=this._arr,n=2*t,o=n+1,r=t;n<e.length&&(r=e[n].priority<e[r].priority?n:r,o<e.length&&(r=e[o].priority<e[r].priority?o:r),r!==t&&(this._swap(t,r),this._heapify(r)))}_decrease(t){for(var e,n=this._arr,o=n[t].priority;t!==0&&!(n[e=t>>1].priority<o);)this._swap(t,e),t=e}_swap(t,e){var n=this._arr,o=this._keyIndices,r=n[t],s=n[e];n[t]=s,n[e]=r,o[s.key]=t,o[r.key]=e}},_f)}function Qk(){if(nk)return bf;nk=1;var t=Zk();bf=function(n,o,r,s){return function(i,a,l,d){var u,h,f={},m=new t,_=function(g){var p=g.v!==u?g.v:g.w,b=f[p],x=l(g),y=h.distance+x;if(x<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+g+" Weight: "+x);y<b.distance&&(b.distance=y,b.predecessor=u,m.decrease(p,y))};for(i.nodes().forEach(function(g){var p=g===a?0:Number.POSITIVE_INFINITY;f[g]={distance:p},m.add(g,p)});m.size()>0&&(u=m.removeMin(),(h=f[u]).distance!==Number.POSITIVE_INFINITY);)d(u).forEach(_);return f}(n,String(o),r||e,s||function(i){return n.outEdges(i)})};var e=()=>1;return bf}function iL(){if(ok)return xf;ok=1;var t=Qk();return xf=function(e,n,o){return e.nodes().reduce(function(r,s){return r[s]=t(e,s,n,o),r},{})},xf}function e3(){return rk||(rk=1,yf=function(t){var e=0,n=[],o={},r=[];function s(i){var a=o[i]={onStack:!0,lowlink:e,index:e++};if(n.push(i),t.successors(i).forEach(function(u){Object.hasOwn(o,u)?o[u].onStack&&(a.lowlink=Math.min(a.lowlink,o[u].index)):(s(u),a.lowlink=Math.min(a.lowlink,o[u].lowlink))}),a.lowlink===a.index){var l,d=[];do l=n.pop(),o[l].onStack=!1,d.push(l);while(i!==l);r.push(d)}}return t.nodes().forEach(function(i){Object.hasOwn(o,i)||s(i)}),r}),yf}function aL(){if(sk)return wf;sk=1;var t=e3();return wf=function(e){return t(e).filter(function(n){return n.length>1||n.length===1&&e.hasEdge(n[0],n[0])})},wf}function lL(){if(ik)return vf;ik=1,vf=function(e,n,o){return function(r,s,i){var a={},l=r.nodes();return l.forEach(function(d){a[d]={},a[d][d]={distance:0},l.forEach(function(u){d!==u&&(a[d][u]={distance:Number.POSITIVE_INFINITY})}),i(d).forEach(function(u){var h=u.v===d?u.w:u.v,f=s(u);a[d][h]={distance:f,predecessor:d}})}),l.forEach(function(d){var u=a[d];l.forEach(function(h){var f=a[h];l.forEach(function(m){var _=f[d],g=u[m],p=f[m],b=_.distance+g.distance;b<p.distance&&(p.distance=b,p.predecessor=g.predecessor)})})}),a}(e,n||t,o||function(r){return e.outEdges(r)})};var t=()=>1;return vf}function t3(){if(ak)return kf;function t(n){var o={},r={},s=[];if(n.sinks().forEach(function i(a){if(Object.hasOwn(r,a))throw new e;Object.hasOwn(o,a)||(r[a]=!0,o[a]=!0,n.predecessors(a).forEach(i),delete r[a],s.push(a))}),Object.keys(o).length!==n.nodeCount())throw new e;return s}ak=1;class e extends Error{constructor(){super(...arguments)}}return kf=t,t.CycleException=e,kf}function cL(){if(lk)return Sf;lk=1;var t=t3();return Sf=function(e){try{t(e)}catch(n){if(n instanceof t.CycleException)return!1;throw n}return!0},Sf}function n3(){if(ck)return Cf;function t(o,r,s,i){for(var a=[[o,!1]];a.length>0;){var l=a.pop();l[1]?i.push(l[0]):Object.hasOwn(s,l[0])||(s[l[0]]=!0,a.push([l[0],!0]),n(r(l[0]),d=>a.push([d,!1])))}}function e(o,r,s,i){for(var a=[o];a.length>0;){var l=a.pop();Object.hasOwn(s,l)||(s[l]=!0,i.push(l),n(r(l),d=>a.push(d)))}}function n(o,r){for(var s=o.length;s--;)r(o[s],s,o);return o}return ck=1,Cf=function(o,r,s){Array.isArray(r)||(r=[r]);var i=o.isDirected()?u=>o.successors(u):u=>o.neighbors(u),a=s==="post"?t:e,l=[],d={};return r.forEach(u=>{if(!o.hasNode(u))throw new Error("Graph does not have node: "+u);a(u,i,d,l)}),l},Cf}function dL(){if(dk)return Nf;dk=1;var t=n3();return Nf=function(e,n){return t(e,n,"post")},Nf}function uL(){if(uk)return jf;uk=1;var t=n3();return jf=function(e,n){return t(e,n,"pre")},jf}function hL(){if(hk)return Ef;hk=1;var t=Kf(),e=Zk();return Ef=function(n,o){var r,s=new t,i={},a=new e;function l(u){var h=u.v===r?u.w:u.v,f=a.priority(h);if(f!==void 0){var m=o(u);m<f&&(i[h]=r,a.decrease(h,m))}}if(n.nodeCount()===0)return s;n.nodes().forEach(function(u){a.add(u,Number.POSITIVE_INFINITY),s.setNode(u)}),a.decrease(n.nodes()[0],0);for(var d=!1;a.size()>0;){if(r=a.removeMin(),Object.hasOwn(i,r))s.setEdge(r,i[r]);else{if(d)throw new Error("Input graph is not connected: "+n);d=!0}n.nodeEdges(r).forEach(l)}return s},Ef}function Zn(){if(gk)return pk;gk=1;var t=oL();return pk={Graph:t.Graph,json:rL(),alg:mk?fk:(mk=1,fk={components:sL(),dijkstra:Qk(),dijkstraAll:iL(),findCycles:aL(),floydWarshall:lL(),isAcyclic:cL(),postorder:dL(),preorder:uL(),prim:hL(),tarjan:e3(),topsort:t3()}),version:t.version}}function fL(){if(xk)return If;xk=1;let t=Zn().Graph,e=function(){if(bk)return _k;function s(a){a._prev._next=a._next,a._next._prev=a._prev,delete a._next,delete a._prev}function i(a,l){if(a!=="_next"&&a!=="_prev")return l}return bk=1,_k=class{constructor(){let a={};a._next=a._prev=a,this._sentinel=a}dequeue(){let a=this._sentinel,l=a._prev;if(l!==a)return s(l),l}enqueue(a){let l=this._sentinel;a._prev&&a._next&&s(a),a._next=l._next,l._next._prev=a,l._next=a,a._prev=l}toString(){let a=[],l=this._sentinel,d=l._prev;for(;d!==l;)a.push(JSON.stringify(d,i)),d=d._prev;return"["+a.join(", ")+"]"}}}();If=function(s,i){if(s.nodeCount()<=1)return[];let a=function(l,d){let u=new t,h=0,f=0;l.nodes().forEach(g=>{u.setNode(g,{v:g,in:0,out:0})}),l.edges().forEach(g=>{let p=u.edge(g.v,g.w)||0,b=d(g),x=p+b;u.setEdge(g.v,g.w,x),f=Math.max(f,u.node(g.v).out+=b),h=Math.max(h,u.node(g.w).in+=b)});let m=function(g){const p=[];for(let b=0;b<g;b++)p.push(b);return p}(f+h+3).map(()=>new e),_=h+1;return u.nodes().forEach(g=>{r(m,_,u.node(g))}),{graph:u,buckets:m,zeroIdx:_}}(s,i||n);return function(l,d,u){let h,f=[],m=d[d.length-1],_=d[0];for(;l.nodeCount();){for(;h=_.dequeue();)o(l,d,u,h);for(;h=m.dequeue();)o(l,d,u,h);if(l.nodeCount()){for(let g=d.length-2;g>0;--g)if(h=d[g].dequeue(),h){f=f.concat(o(l,d,u,h,!0));break}}}return f}(a.graph,a.buckets,a.zeroIdx).flatMap(l=>s.outEdges(l.v,l.w))};let n=()=>1;function o(s,i,a,l,d){let u=d?[]:void 0;return s.inEdges(l.v).forEach(h=>{let f=s.edge(h),m=s.node(h.v);d&&u.push({v:h.v,w:h.w}),m.out-=f,r(i,a,m)}),s.outEdges(l.v).forEach(h=>{let f=s.edge(h),m=h.w,_=s.node(m);_.in-=f,r(i,a,_)}),s.removeNode(l.v),u}function r(s,i,a){a.out?a.in?s[a.out-a.in+i].enqueue(a):s[s.length-1].enqueue(a):s[0].enqueue(a)}return If}function Pt(){if(yk)return Af;yk=1;let t=Zn().Graph;function e(d,u,h,f){for(var m=f;d.hasNode(m);)m=i(f);return h.dummy=u,d.setNode(m,h),m}Af={addBorderNode:function(d,u,h,f){let m={width:0,height:0};return arguments.length>=4&&(m.rank=h,m.order=f),e(d,"border",m,u)},addDummyNode:e,applyWithChunking:o,asNonCompoundGraph:function(d){let u=new t({multigraph:d.isMultigraph()}).setGraph(d.graph());return d.nodes().forEach(h=>{d.children(h).length||u.setNode(h,d.node(h))}),d.edges().forEach(h=>{u.setEdge(h,d.edge(h))}),u},buildLayerMatrix:function(d){let u=a(r(d)+1).map(()=>[]);return d.nodes().forEach(h=>{let f=d.node(h),m=f.rank;m!==void 0&&(u[m][f.order]=h)}),u},intersectRect:function(d,u){let h,f,m=d.x,_=d.y,g=u.x-m,p=u.y-_,b=d.width/2,x=d.height/2;if(!g&&!p)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(p)*b>Math.abs(g)*x?(p<0&&(x=-x),h=x*g/p,f=x):(g<0&&(b=-b),h=b,f=b*p/g),{x:m+h,y:_+f}},mapValues:function(d,u){let h=u;return typeof u=="string"&&(h=f=>f[u]),Object.entries(d).reduce((f,[m,_])=>(f[m]=h(_,m),f),{})},maxRank:r,normalizeRanks:function(d){let u=d.nodes().map(f=>{let m=d.node(f).rank;return m===void 0?Number.MAX_VALUE:m}),h=o(Math.min,u);d.nodes().forEach(f=>{let m=d.node(f);Object.hasOwn(m,"rank")&&(m.rank-=h)})},notime:function(d,u){return u()},partition:function(d,u){let h={lhs:[],rhs:[]};return d.forEach(f=>{u(f)?h.lhs.push(f):h.rhs.push(f)}),h},pick:function(d,u){const h={};for(const f of u)d[f]!==void 0&&(h[f]=d[f]);return h},predecessorWeights:function(d){let u=d.nodes().map(h=>{let f={};return d.inEdges(h).forEach(m=>{f[m.v]=(f[m.v]||0)+d.edge(m).weight}),f});return l(d.nodes(),u)},range:a,removeEmptyRanks:function(d){let u=d.nodes().map(g=>d.node(g).rank),h=o(Math.min,u),f=[];d.nodes().forEach(g=>{let p=d.node(g).rank-h;f[p]||(f[p]=[]),f[p].push(g)});let m=0,_=d.graph().nodeRankFactor;Array.from(f).forEach((g,p)=>{g===void 0&&p%_!==0?--m:g!==void 0&&m&&g.forEach(b=>d.node(b).rank+=m)})},simplify:function(d){let u=new t().setGraph(d.graph());return d.nodes().forEach(h=>u.setNode(h,d.node(h))),d.edges().forEach(h=>{let f=u.edge(h.v,h.w)||{weight:0,minlen:1},m=d.edge(h);u.setEdge(h.v,h.w,{weight:f.weight+m.weight,minlen:Math.max(f.minlen,m.minlen)})}),u},successorWeights:function(d){let u=d.nodes().map(h=>{let f={};return d.outEdges(h).forEach(m=>{f[m.w]=(f[m.w]||0)+d.edge(m).weight}),f});return l(d.nodes(),u)},time:function(d,u){let h=Date.now();try{return u()}finally{console.log(d+" time: "+(Date.now()-h)+"ms")}},uniqueId:i,zipObject:l};const n=65535;function o(d,u){if(u.length>n){const h=function(f,m=n){const _=[];for(let g=0;g<f.length;g+=m){const p=f.slice(g,g+m);_.push(p)}return _}(u);return d.apply(null,h.map(f=>d.apply(null,f)))}return d.apply(null,u)}function r(d){const u=d.nodes().map(h=>{let f=d.node(h).rank;return f===void 0?Number.MIN_VALUE:f});return o(Math.max,u)}let s=0;function i(d){return d+""+ ++s}function a(d,u,h=1){u==null&&(u=d,d=0);let f=_=>_<u;h<0&&(f=_=>u<_);const m=[];for(let _=d;f(_);_+=h)m.push(_);return m}function l(d,u){return d.reduce((h,f,m)=>(h[f]=u[m],h),{})}return Af}function mL(){if(wk)return Tf;wk=1;let t=fL(),e=Pt().uniqueId;return Tf={run:function(n){(n.graph().acyclicer==="greedy"?t(n,function(r){return s=>r.edge(s).weight}(n)):function(r){let s=[],i={},a={};function l(d){Object.hasOwn(a,d)||(a[d]=!0,i[d]=!0,r.outEdges(d).forEach(u=>{Object.hasOwn(i,u.w)?s.push(u):l(u.w)}),delete i[d])}return r.nodes().forEach(l),s}(n)).forEach(r=>{let s=n.edge(r);n.removeEdge(r),s.forwardName=r.name,s.reversed=!0,n.setEdge(r.w,r.v,s,e("rev"))})},undo:function(n){n.edges().forEach(o=>{let r=n.edge(o);if(r.reversed){n.removeEdge(o);let s=r.forwardName;delete r.reversed,delete r.forwardName,n.setEdge(o.w,o.v,r,s)}})}},Tf}function pL(){if(vk)return Mf;vk=1;let t=Pt();return Mf={run:function(e){e.graph().dummyChains=[],e.edges().forEach(n=>function(o,r){let s,i,a,l=r.v,d=o.node(l).rank,u=r.w,h=o.node(u).rank,f=r.name,m=o.edge(r),_=m.labelRank;if(h!==d+1){for(o.removeEdge(r),a=0,++d;d<h;++a,++d)m.points=[],i={width:0,height:0,edgeLabel:m,edgeObj:r,rank:d},s=t.addDummyNode(o,"edge",i,"_d"),d===_&&(i.width=m.width,i.height=m.height,i.dummy="edge-label",i.labelpos=m.labelpos),o.setEdge(l,s,{weight:m.weight},f),a===0&&o.graph().dummyChains.push(s),l=s;o.setEdge(l,u,{weight:m.weight},f)}}(e,n))},undo:function(e){e.graph().dummyChains.forEach(n=>{let o,r=e.node(n),s=r.edgeLabel;for(e.setEdge(r.edgeObj,s);r.dummy;)o=e.successors(n)[0],e.removeNode(n),s.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(s.x=r.x,s.y=r.y,s.width=r.width,s.height=r.height),n=o,r=e.node(n)})}},Mf}function Yl(){if(kk)return Of;kk=1;const{applyWithChunking:t}=Pt();return Of={longestPath:function(e){var n={};e.sources().forEach(function o(r){var s=e.node(r);if(Object.hasOwn(n,r))return s.rank;n[r]=!0;let i=e.outEdges(r).map(l=>l==null?Number.POSITIVE_INFINITY:o(l.w)-e.edge(l).minlen);var a=t(Math.min,i);return a===Number.POSITIVE_INFINITY&&(a=0),s.rank=a})},slack:function(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}},Of}function o3(){if(Sk)return Df;Sk=1;var t=Zn().Graph,e=Yl().slack;function n(s,i){return s.nodes().forEach(function a(l){i.nodeEdges(l).forEach(d=>{var u=d.v,h=l===u?d.w:u;s.hasNode(h)||e(i,d)||(s.setNode(h,{}),s.setEdge(l,h,{}),a(h))})}),s.nodeCount()}function o(s,i){return i.edges().reduce((a,l)=>{let d=Number.POSITIVE_INFINITY;return s.hasNode(l.v)!==s.hasNode(l.w)&&(d=e(i,l)),d<a[0]?[d,l]:a},[Number.POSITIVE_INFINITY,null])[1]}function r(s,i,a){s.nodes().forEach(l=>i.node(l).rank+=a)}return Df=function(s){var i,a,l=new t({directed:!1}),d=s.nodes()[0],u=s.nodeCount();for(l.setNode(d,{});n(l,s)<u;)i=o(l,s),a=l.hasNode(i.v)?e(s,i):-e(s,i),r(l,s,a);return l},Df}function gL(){if(Ck)return Rf;Ck=1;var t=o3(),e=Yl().slack,n=Yl().longestPath,o=Zn().alg.preorder,r=Zn().alg.postorder,s=Pt().simplify;function i(g){g=s(g),n(g);var p,b=t(g);for(d(b),a(b,g);p=h(b);)m(b,g,p,f(b,g,p))}function a(g,p){var b=r(g,g.nodes());(b=b.slice(0,b.length-1)).forEach(x=>function(y,v,C){var k=y.node(C),N=k.parent;y.edge(C,N).cutvalue=l(y,v,C)}(g,p,x))}function l(g,p,b){var x=g.node(b).parent,y=!0,v=p.edge(b,x),C=0;return v||(y=!1,v=p.edge(x,b)),C=v.weight,p.nodeEdges(b).forEach(k=>{var N,j,I=k.v===b,T=I?k.w:k.v;if(T!==x){var A=I===y,R=p.edge(k).weight;if(C+=A?R:-R,N=b,j=T,g.hasEdge(N,j)){var z=g.edge(b,T).cutvalue;C+=A?-z:z}}}),C}function d(g,p){arguments.length<2&&(p=g.nodes()[0]),u(g,{},1,p)}function u(g,p,b,x,y){var v=b,C=g.node(x);return p[x]=!0,g.neighbors(x).forEach(k=>{Object.hasOwn(p,k)||(b=u(g,p,b,k,x))}),C.low=v,C.lim=b++,y?C.parent=y:delete C.parent,b}function h(g){return g.edges().find(p=>g.edge(p).cutvalue<0)}function f(g,p,b){var x=b.v,y=b.w;p.hasEdge(x,y)||(x=b.w,y=b.v);var v=g.node(x),C=g.node(y),k=v,N=!1;v.lim>C.lim&&(k=C,N=!0);var j=p.edges().filter(I=>N===_(g,g.node(I.v),k)&&N!==_(g,g.node(I.w),k));return j.reduce((I,T)=>e(p,T)<e(p,I)?T:I)}function m(g,p,b,x){var y=b.v,v=b.w;g.removeEdge(y,v),g.setEdge(x.v,x.w,{}),d(g),a(g,p),function(C,k){var N=C.nodes().find(I=>!k.node(I).parent),j=o(C,N);(j=j.slice(1)).forEach(I=>{var T=C.node(I).parent,A=k.edge(I,T),R=!1;A||(A=k.edge(T,I),R=!0),k.node(I).rank=k.node(T).rank+(R?A.minlen:-A.minlen)})}(g,p)}function _(g,p,b){return b.low<=p.lim&&p.lim<=b.lim}return Rf=i,i.initLowLimValues=d,i.initCutValues=a,i.calcCutValue=l,i.leaveEdge=h,i.enterEdge=f,i.exchangeEdges=m,Rf}function _L(){if(Nk)return Pf;Nk=1;var t=Yl().longestPath,e=o3(),n=gL();Pf=function(s){var i=s.graph().ranker;if(i instanceof Function)return i(s);switch(s.graph().ranker){case"network-simplex":default:r(s);break;case"tight-tree":(function(a){t(a),e(a)})(s);break;case"longest-path":o(s);case"none":}};var o=t;function r(s){n(s)}return Pf}function bL(){return jk||(jk=1,Lf=function(t){let e=function(n){let o={},r=0;function s(i){let a=r;n.children(i).forEach(s),o[i]={low:a,lim:r++}}return n.children().forEach(s),o}(t);t.graph().dummyChains.forEach(n=>{let o=t.node(n),r=o.edgeObj,s=function(h,f,m,_){let g,p,b=[],x=[],y=Math.min(f[m].low,f[_].low),v=Math.max(f[m].lim,f[_].lim);g=m;do g=h.parent(g),b.push(g);while(g&&(f[g].low>y||v>f[g].lim));for(p=g,g=_;(g=h.parent(g))!==p;)x.push(g);return{path:b.concat(x.reverse()),lca:p}}(t,e,r.v,r.w),i=s.path,a=s.lca,l=0,d=i[l],u=!0;for(;n!==r.w;){if(o=t.node(n),u){for(;(d=i[l])!==a&&t.node(d).maxRank<o.rank;)l++;d===a&&(u=!1)}if(!u){for(;l<i.length-1&&t.node(d=i[l+1]).minRank<=o.rank;)l++;d=i[l]}t.setParent(n,d),n=t.successors(n)[0]}})}),Lf}function xL(){if(Ek)return Ff;Ek=1;let t=Pt();function e(n,o,r,s,i,a,l){let d=n.children(l);if(!d.length)return void(l!==o&&n.setEdge(o,l,{weight:0,minlen:r}));let u=t.addBorderNode(n,"_bt"),h=t.addBorderNode(n,"_bb"),f=n.node(l);n.setParent(u,l),f.borderTop=u,n.setParent(h,l),f.borderBottom=h,d.forEach(m=>{e(n,o,r,s,i,a,m);let _=n.node(m),g=_.borderTop?_.borderTop:m,p=_.borderBottom?_.borderBottom:m,b=_.borderTop?s:2*s,x=g!==p?1:i-a[l]+1;n.setEdge(u,g,{weight:b,minlen:x,nestingEdge:!0}),n.setEdge(p,h,{weight:b,minlen:x,nestingEdge:!0})}),n.parent(l)||n.setEdge(o,u,{weight:0,minlen:i+a[l]})}return Ff={run:function(n){let o=t.addDummyNode(n,"root",{},"_root"),r=function(d){var u={};function h(f,m){var _=d.children(f);_&&_.length&&_.forEach(g=>h(g,m+1)),u[f]=m}return d.children().forEach(f=>h(f,1)),u}(n),s=Object.values(r),i=t.applyWithChunking(Math.max,s)-1,a=2*i+1;n.graph().nestingRoot=o,n.edges().forEach(d=>n.edge(d).minlen*=a);let l=function(d){return d.edges().reduce((u,h)=>u+d.edge(h).weight,0)}(n)+1;n.children().forEach(d=>e(n,o,a,l,i,r,d)),n.graph().nodeRankFactor=a},cleanup:function(n){var o=n.graph();n.removeNode(o.nestingRoot),delete o.nestingRoot,n.edges().forEach(r=>{n.edge(r).nestingEdge&&n.removeEdge(r)})}},Ff}function yL(){if(Ak)return Bf;function t(r){r.nodes().forEach(s=>e(r.node(s))),r.edges().forEach(s=>e(r.edge(s)))}function e(r){let s=r.width;r.width=r.height,r.height=s}function n(r){r.y=-r.y}function o(r){let s=r.x;r.x=r.y,r.y=s}return Ak=1,Bf={adjust:function(r){let s=r.graph().rankdir.toLowerCase();s!=="lr"&&s!=="rl"||t(r)},undo:function(r){let s=r.graph().rankdir.toLowerCase();s!=="bt"&&s!=="rl"||function(i){i.nodes().forEach(a=>n(i.node(a))),i.edges().forEach(a=>{let l=i.edge(a);l.points.forEach(n),Object.hasOwn(l,"y")&&n(l)})}(r),s!=="lr"&&s!=="rl"||(function(i){i.nodes().forEach(a=>o(i.node(a))),i.edges().forEach(a=>{let l=i.edge(a);l.points.forEach(o),Object.hasOwn(l,"x")&&o(l)})}(r),t(r))}},Bf}function wL(){if(Pk)return Rk;Pk=1;let t=Pt();return Rk=function(e,n){let o={};return e.forEach((r,s)=>{let i=o[r.v]={indegree:0,in:[],out:[],vs:[r.v],i:s};r.barycenter!==void 0&&(i.barycenter=r.barycenter,i.weight=r.weight)}),n.edges().forEach(r=>{let s=o[r.v],i=o[r.w];s!==void 0&&i!==void 0&&(i.indegree++,s.out.push(o[r.w]))}),function(r){let s=[];function i(l){return d=>{d.merged||(d.barycenter===void 0||l.barycenter===void 0||d.barycenter>=l.barycenter)&&function(u,h){let f=0,m=0;u.weight&&(f+=u.barycenter*u.weight,m+=u.weight),h.weight&&(f+=h.barycenter*h.weight,m+=h.weight),u.vs=h.vs.concat(u.vs),u.barycenter=f/m,u.weight=m,u.i=Math.min(h.i,u.i),h.merged=!0}(l,d)}}function a(l){return d=>{d.in.push(l),--d.indegree===0&&r.push(d)}}for(;r.length;){let l=r.pop();s.push(l),l.in.reverse().forEach(i(l)),l.out.forEach(a(l))}return s.filter(l=>!l.merged).map(l=>t.pick(l,["vs","i","barycenter","weight"]))}(Object.values(o).filter(r=>!r.indegree))}}function vL(){if(zk)return $f;zk=1;let t=(Dk||(Dk=1,Ok=function(o,r=[]){return r.map(s=>{let i=o.inEdges(s);if(i.length){let a=i.reduce((l,d)=>{let u=o.edge(d),h=o.node(d.v);return{sum:l.sum+u.weight*h.order,weight:l.weight+u.weight}},{sum:0,weight:0});return{v:s,barycenter:a.sum/a.weight,weight:a.weight}}return{v:s}})}),Ok),e=wL(),n=function(){if(Fk)return Lk;Fk=1;let o=Pt();function r(s,i,a){let l;for(;i.length&&(l=i[i.length-1]).i<=a;)i.pop(),s.push(l.vs),a++;return a}return Lk=function(s,i){let a=o.partition(s,p=>Object.hasOwn(p,"barycenter")),l=a.lhs,d=a.rhs.sort((p,b)=>b.i-p.i),u=[],h=0,f=0,m=0;var _;l.sort((_=!!i,(p,b)=>p.barycenter<b.barycenter?-1:p.barycenter>b.barycenter?1:_?b.i-p.i:p.i-b.i)),m=r(u,d,m),l.forEach(p=>{m+=p.vs.length,u.push(p.vs),h+=p.barycenter*p.weight,f+=p.weight,m=r(u,d,m)});let g={vs:u.flat(!0)};return f&&(g.barycenter=h/f,g.weight=f),g}}();return $f=function o(r,s,i,a){let l=r.children(s),d=r.node(s),u=d?d.borderLeft:void 0,h=d?d.borderRight:void 0,f={};u&&(l=l.filter(p=>p!==u&&p!==h));let m=t(r,l);m.forEach(p=>{if(r.children(p.v).length){let y=o(r,p.v,i,a);f[p.v]=y,Object.hasOwn(y,"barycenter")&&(x=y,(b=p).barycenter!==void 0?(b.barycenter=(b.barycenter*b.weight+x.barycenter*x.weight)/(b.weight+x.weight),b.weight+=x.weight):(b.barycenter=x.barycenter,b.weight=x.weight))}var b,x});let _=e(m,i);(function(p,b){p.forEach(x=>{x.vs=x.vs.flatMap(y=>b[y]?b[y].vs:y)})})(_,f);let g=n(_,a);if(u&&(g.vs=[u,g.vs,h].flat(!0),r.predecessors(u).length)){let p=r.node(r.predecessors(u)[0]),b=r.node(r.predecessors(h)[0]);Object.hasOwn(g,"barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+p.order+b.order)/(g.weight+2),g.weight+=2}return g},$f}function kL(){if(Bk)return Hf;Bk=1;let t=Zn().Graph,e=Pt();return Hf=function(n,o,r){let s=function(a){for(var l;a.hasNode(l=e.uniqueId("_root")););return l}(n),i=new t({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(a=>n.node(a));return n.nodes().forEach(a=>{let l=n.node(a),d=n.parent(a);(l.rank===o||l.minRank<=o&&o<=l.maxRank)&&(i.setNode(a),i.setParent(a,d||s),n[r](a).forEach(u=>{let h=u.v===a?u.w:u.v,f=i.edge(h,a),m=f!==void 0?f.weight:0;i.setEdge(h,a,{weight:n.edge(u).weight+m})}),Object.hasOwn(l,"minRank")&&i.setNode(a,{borderLeft:l.borderLeft[o],borderRight:l.borderRight[o]}))}),i},Hf}function SL(){if($k)return Wf;$k=1;let t=function(){if(Tk)return Uf;Tk=1;let u=Pt();return Uf=function(h){let f={},m=h.nodes().filter(x=>!h.children(x).length),_=m.map(x=>h.node(x).rank),g=u.applyWithChunking(Math.max,_),p=u.range(g+1).map(()=>[]);function b(x){if(f[x])return;f[x]=!0;let y=h.node(x);p[y.rank].push(x),h.successors(x).forEach(b)}return m.sort((x,y)=>h.node(x).rank-h.node(y).rank).forEach(b),p},Uf}(),e=function(){if(Mk)return Vf;Mk=1;let u=Pt().zipObject;function h(f,m,_){let g=u(_,_.map((C,k)=>k)),p=m.flatMap(C=>f.outEdges(C).map(k=>({pos:g[k.w],weight:f.edge(k).weight})).sort((k,N)=>k.pos-N.pos)),b=1;for(;b<_.length;)b<<=1;let x=2*b-1;b-=1;let y=new Array(x).fill(0),v=0;return p.forEach(C=>{let k=C.pos+b;y[k]+=C.weight;let N=0;for(;k>0;)k%2&&(N+=y[k+1]),k=k-1>>1,y[k]+=C.weight;v+=C.weight*N}),v}return Vf=function(f,m){let _=0;for(let g=1;g<m.length;++g)_+=h(f,m[g-1],m[g]);return _},Vf}(),n=vL(),o=kL(),r=(Vk||(Vk=1,Uk=function(u,h,f){let m,_={};f.forEach(g=>{let p,b,x=u.parent(g);for(;x;){if(p=u.parent(x),p?(b=_[p],_[p]=x):(b=m,m=x),b&&b!==x)return void h.setEdge(b,x);x=p}})}),Uk),s=Zn().Graph,i=Pt();function a(u,h,f){return h.map(function(m){return o(u,m,f)})}function l(u,h){let f=new s;u.forEach(function(m){let _=m.graph().root,g=n(m,_,f,h);g.vs.forEach((p,b)=>m.node(p).order=b),r(m,f,g.vs)})}function d(u,h){Object.values(h).forEach(f=>f.forEach((m,_)=>u.node(m).order=_))}return Wf=function u(h,f){if(f&&typeof f.customOrder=="function")return void f.customOrder(h,u);let m=i.maxRank(h),_=a(h,i.range(1,m+1),"inEdges"),g=a(h,i.range(m-1,-1,-1),"outEdges"),p=t(h);if(d(h,p),f&&f.disableOptimalOrderHeuristic)return;let b,x=Number.POSITIVE_INFINITY;for(let y=0,v=0;v<4;++y,++v){l(y%2?_:g,y%4>=2),p=i.buildLayerMatrix(h);let C=e(h,p);C<x&&(v=0,b=Object.assign({},p),x=C)}d(h,b)},Wf}function CL(){if(Hk)return qf;Hk=1;let t=Zn().Graph,e=Pt();function n(h,f){let m={};return f.length&&f.reduce(function(_,g){let p=0,b=0,x=_.length,y=g[g.length-1];return g.forEach((v,C)=>{let k=function(j,I){if(j.node(I).dummy)return j.predecessors(I).find(T=>j.node(T).dummy)}(h,v),N=k?h.node(k).order:x;(k||v===y)&&(g.slice(b,C+1).forEach(j=>{h.predecessors(j).forEach(I=>{let T=h.node(I),A=T.order;!(A<p||N<A)||T.dummy&&h.node(j).dummy||r(m,I,j)})}),b=C+1,p=N)}),g}),m}function o(h,f){let m={};function _(g,p,b,x,y){let v;e.range(p,b).forEach(C=>{v=g[C],h.node(v).dummy&&h.predecessors(v).forEach(k=>{let N=h.node(k);N.dummy&&(N.order<x||N.order>y)&&r(m,k,v)})})}return f.length&&f.reduce(function(g,p){let b,x=-1,y=0;return p.forEach((v,C)=>{if(h.node(v).dummy==="border"){let k=h.predecessors(v);k.length&&(b=h.node(k[0]).order,_(p,y,C,x,b),y=C,x=b)}_(p,y,p.length,b,g.length)}),p}),m}function r(h,f,m){if(f>m){let g=f;f=m,m=g}let _=h[f];_||(h[f]=_={}),_[m]=!0}function s(h,f,m){if(f>m){let _=f;f=m,m=_}return!!h[f]&&Object.hasOwn(h[f],m)}function i(h,f,m,_){let g={},p={},b={};return f.forEach(x=>{x.forEach((y,v)=>{g[y]=y,p[y]=y,b[y]=v})}),f.forEach(x=>{let y=-1;x.forEach(v=>{let C=_(v);if(C.length){C=C.sort((N,j)=>b[N]-b[j]);let k=(C.length-1)/2;for(let N=Math.floor(k),j=Math.ceil(k);N<=j;++N){let I=C[N];p[v]===v&&y<b[I]&&!s(m,v,I)&&(p[I]=v,p[v]=g[v]=g[I],y=b[I])}}})}),{root:g,align:p}}function a(h,f,m,_,g){let p={},b=function(v,C,k,N){let j=new t,I=v.graph(),T=function(A,R,z){return(D,F,B)=>{let U,O=D.node(F),S=D.node(B),$=0;if($+=O.width/2,Object.hasOwn(O,"labelpos"))switch(O.labelpos.toLowerCase()){case"l":U=-O.width/2;break;case"r":U=O.width/2}if(U&&($+=z?U:-U),U=0,$+=(O.dummy?R:A)/2,$+=(S.dummy?R:A)/2,$+=S.width/2,Object.hasOwn(S,"labelpos"))switch(S.labelpos.toLowerCase()){case"l":U=S.width/2;break;case"r":U=-S.width/2}return U&&($+=z?U:-U),U=0,$}}(I.nodesep,I.edgesep,N);return C.forEach(A=>{let R;A.forEach(z=>{let D=k[z];if(j.setNode(D),R){var F=k[R],B=j.edge(F,D);j.setEdge(F,D,Math.max(T(v,z,R),B||0))}R=z})}),j}(h,f,m,g),x=g?"borderLeft":"borderRight";function y(v,C){let k=b.nodes(),N=k.pop(),j={};for(;N;)j[N]?v(N):(j[N]=!0,k.push(N),k=k.concat(C(N))),N=k.pop()}return y(function(v){p[v]=b.inEdges(v).reduce((C,k)=>Math.max(C,p[k.v]+b.edge(k)),0)},b.predecessors.bind(b)),y(function(v){let C=b.outEdges(v).reduce((N,j)=>Math.min(N,p[j.w]-b.edge(j)),Number.POSITIVE_INFINITY),k=h.node(v);C!==Number.POSITIVE_INFINITY&&k.borderType!==x&&(p[v]=Math.max(p[v],C))},b.successors.bind(b)),Object.keys(_).forEach(v=>p[v]=p[m[v]]),p}function l(h,f){return Object.values(f).reduce((m,_)=>{let g=Number.NEGATIVE_INFINITY,p=Number.POSITIVE_INFINITY;Object.entries(_).forEach(([x,y])=>{let v=function(C,k){return C.node(k).width}(h,x)/2;g=Math.max(y+v,g),p=Math.min(y-v,p)});const b=g-p;return b<m[0]&&(m=[b,_]),m},[Number.POSITIVE_INFINITY,null])[1]}function d(h,f){let m=Object.values(f),_=e.applyWithChunking(Math.min,m),g=e.applyWithChunking(Math.max,m);["u","d"].forEach(p=>{["l","r"].forEach(b=>{let x=p+b,y=h[x];if(y===f)return;let v=Object.values(y),C=_-e.applyWithChunking(Math.min,v);b!=="l"&&(C=g-e.applyWithChunking(Math.max,v)),C&&(h[x]=e.mapValues(y,k=>k+C))})})}function u(h,f){return e.mapValues(h.ul,(m,_)=>{if(f)return h[f.toLowerCase()][_];{let g=Object.values(h).map(p=>p[_]).sort((p,b)=>p-b);return(g[1]+g[2])/2}})}return qf={positionX:function(h){let f,m=e.buildLayerMatrix(h),_=Object.assign(n(h,m),o(h,m)),g={};["u","d"].forEach(b=>{f=b==="u"?m:Object.values(m).reverse(),["l","r"].forEach(x=>{x==="r"&&(f=f.map(k=>Object.values(k).reverse()));let y=(b==="u"?h.predecessors:h.successors).bind(h),v=i(h,f,_,y),C=a(h,f,v.root,v.align,x==="r");x==="r"&&(C=e.mapValues(C,k=>-k)),g[b+x]=C})});let p=l(h,g);return d(g,p),u(g,h.graph().align)},findType1Conflicts:n,findType2Conflicts:o,addConflict:r,hasConflict:s,verticalAlignment:i,horizontalCompaction:a,alignCoordinates:d,findSmallestWidthAlignment:l,balance:u},qf}function NL(){if(Wk)return Gf;Wk=1;let t=Pt(),e=CL().positionX;return Gf=function(n){n=t.asNonCompoundGraph(n),function(o){let r=t.buildLayerMatrix(o),s=o.graph().ranksep,i=0;r.forEach(a=>{const l=a.reduce((d,u)=>{const h=o.node(u).height;return d>h?d:h},0);a.forEach(d=>o.node(d).y=i+l/2),i+=l+s})}(n),Object.entries(e(n)).forEach(([o,r])=>n.node(o).x=r)},Gf}function jL(){if(qk)return Yf;qk=1;let t=mL(),e=pL(),n=_L(),o=Pt().normalizeRanks,r=bL(),s=Pt().removeEmptyRanks,i=xL(),a=function(){if(Ik)return zf;Ik=1;let N=Pt();function j(I,T,A,R,z,D){let F={width:0,height:0,rank:D,borderType:T},B=z[T][D-1],U=N.addDummyNode(I,"border",F,A);z[T][D]=U,I.setParent(U,R),B&&I.setEdge(B,U,{weight:1})}return zf=function(I){I.children().forEach(function T(A){let R=I.children(A),z=I.node(A);if(R.length&&R.forEach(T),Object.hasOwn(z,"minRank")){z.borderLeft=[],z.borderRight=[];for(let D=z.minRank,F=z.maxRank+1;D<F;++D)j(I,"borderLeft","_bl",A,z,D),j(I,"borderRight","_br",A,z,D)}})},zf}(),l=yL(),d=SL(),u=NL(),h=Pt(),f=Zn().Graph;Yf=function(N,j){let I=j&&j.debugTiming?h.time:h.notime;I("layout",()=>{let T=I(" buildLayoutGraph",()=>function(A){let R=new f({multigraph:!0,compound:!0}),z=k(A.graph());return R.setGraph(Object.assign({},_,C(z,m),h.pick(z,g))),A.nodes().forEach(D=>{const F=C(k(A.node(D)),p);Object.keys(b).forEach(B=>{F[B]===void 0&&(F[B]=b[B])}),R.setNode(D,F),R.setParent(D,A.parent(D))}),A.edges().forEach(D=>{let F=k(A.edge(D));R.setEdge(D,Object.assign({},y,C(F,x),h.pick(F,v)))}),R}(N));I(" runLayout",()=>function(A,R,z){R(" makeSpaceForEdgeLabels",()=>function(D){let F=D.graph();F.ranksep/=2,D.edges().forEach(B=>{let U=D.edge(B);U.minlen*=2,U.labelpos.toLowerCase()!=="c"&&(F.rankdir==="TB"||F.rankdir==="BT"?U.width+=U.labeloffset:U.height+=U.labeloffset)})}(A)),R(" removeSelfEdges",()=>function(D){D.edges().forEach(F=>{if(F.v===F.w){var B=D.node(F.v);B.selfEdges||(B.selfEdges=[]),B.selfEdges.push({e:F,label:D.edge(F)}),D.removeEdge(F)}})}(A)),R(" acyclic",()=>t.run(A)),R(" nestingGraph.run",()=>i.run(A)),R(" rank",()=>n(h.asNonCompoundGraph(A))),R(" injectEdgeLabelProxies",()=>function(D){D.edges().forEach(F=>{let B=D.edge(F);if(B.width&&B.height){let U=D.node(F.v),O={rank:(D.node(F.w).rank-U.rank)/2+U.rank,e:F};h.addDummyNode(D,"edge-proxy",O,"_ep")}})}(A)),R(" removeEmptyRanks",()=>s(A)),R(" nestingGraph.cleanup",()=>i.cleanup(A)),R(" normalizeRanks",()=>o(A)),R(" assignRankMinMax",()=>function(D){let F=0;D.nodes().forEach(B=>{let U=D.node(B);U.borderTop&&(U.minRank=D.node(U.borderTop).rank,U.maxRank=D.node(U.borderBottom).rank,F=Math.max(F,U.maxRank))}),D.graph().maxRank=F}(A)),R(" removeEdgeLabelProxies",()=>function(D){D.nodes().forEach(F=>{let B=D.node(F);B.dummy==="edge-proxy"&&(D.edge(B.e).labelRank=B.rank,D.removeNode(F))})}(A)),R(" normalize.run",()=>e.run(A)),R(" parentDummyChains",()=>r(A)),R(" addBorderSegments",()=>a(A)),R(" order",()=>d(A,z)),R(" insertSelfEdges",()=>function(D){var F=h.buildLayerMatrix(D);F.forEach(B=>{var U=0;B.forEach((O,S)=>{var $=D.node(O);$.order=S+U,($.selfEdges||[]).forEach(E=>{h.addDummyNode(D,"selfedge",{width:E.label.width,height:E.label.height,rank:$.rank,order:S+ ++U,e:E.e,label:E.label},"_se")}),delete $.selfEdges})})}(A)),R(" adjustCoordinateSystem",()=>l.adjust(A)),R(" position",()=>u(A)),R(" positionSelfEdges",()=>function(D){D.nodes().forEach(F=>{var B=D.node(F);if(B.dummy==="selfedge"){var U=D.node(B.e.v),O=U.x+U.width/2,S=U.y,$=B.x-O,E=U.height/2;D.setEdge(B.e,B.label),D.removeNode(F),B.label.points=[{x:O+2*$/3,y:S-E},{x:O+5*$/6,y:S-E},{x:O+$,y:S},{x:O+5*$/6,y:S+E},{x:O+2*$/3,y:S+E}],B.label.x=B.x,B.label.y=B.y}})}(A)),R(" removeBorderNodes",()=>function(D){D.nodes().forEach(F=>{if(D.children(F).length){let B=D.node(F),U=D.node(B.borderTop),O=D.node(B.borderBottom),S=D.node(B.borderLeft[B.borderLeft.length-1]),$=D.node(B.borderRight[B.borderRight.length-1]);B.width=Math.abs($.x-S.x),B.height=Math.abs(O.y-U.y),B.x=S.x+B.width/2,B.y=U.y+B.height/2}}),D.nodes().forEach(F=>{D.node(F).dummy==="border"&&D.removeNode(F)})}(A)),R(" normalize.undo",()=>e.undo(A)),R(" fixupEdgeLabelCoords",()=>function(D){D.edges().forEach(F=>{let B=D.edge(F);if(Object.hasOwn(B,"x"))switch(B.labelpos!=="l"&&B.labelpos!=="r"||(B.width-=B.labeloffset),B.labelpos){case"l":B.x-=B.width/2+B.labeloffset;break;case"r":B.x+=B.width/2+B.labeloffset}})}(A)),R(" undoCoordinateSystem",()=>l.undo(A)),R(" translateGraph",()=>function(D){let F=Number.POSITIVE_INFINITY,B=0,U=Number.POSITIVE_INFINITY,O=0,S=D.graph(),$=S.marginx||0,E=S.marginy||0;function W(G){let q=G.x,Y=G.y,te=G.width,oe=G.height;F=Math.min(F,q-te/2),B=Math.max(B,q+te/2),U=Math.min(U,Y-oe/2),O=Math.max(O,Y+oe/2)}D.nodes().forEach(G=>W(D.node(G))),D.edges().forEach(G=>{let q=D.edge(G);Object.hasOwn(q,"x")&&W(q)}),F-=$,U-=E,D.nodes().forEach(G=>{let q=D.node(G);q.x-=F,q.y-=U}),D.edges().forEach(G=>{let q=D.edge(G);q.points.forEach(Y=>{Y.x-=F,Y.y-=U}),Object.hasOwn(q,"x")&&(q.x-=F),Object.hasOwn(q,"y")&&(q.y-=U)}),S.width=B-F+$,S.height=O-U+E}(A)),R(" assignNodeIntersects",()=>function(D){D.edges().forEach(F=>{let B,U,O=D.edge(F),S=D.node(F.v),$=D.node(F.w);O.points?(B=O.points[0],U=O.points[O.points.length-1]):(O.points=[],B=$,U=S),O.points.unshift(h.intersectRect(S,B)),O.points.push(h.intersectRect($,U))})}(A)),R(" reversePoints",()=>function(D){D.edges().forEach(F=>{let B=D.edge(F);B.reversed&&B.points.reverse()})}(A)),R(" acyclic.undo",()=>t.undo(A))}(T,I,j)),I(" updateInputGraph",()=>function(A,R){A.nodes().forEach(z=>{let D=A.node(z),F=R.node(z);D&&(D.x=F.x,D.y=F.y,D.rank=F.rank,R.children(z).length&&(D.width=F.width,D.height=F.height))}),A.edges().forEach(z=>{let D=A.edge(z),F=R.edge(z);D.points=F.points,Object.hasOwn(F,"x")&&(D.x=F.x,D.y=F.y)}),A.graph().width=R.graph().width,A.graph().height=R.graph().height}(N,T))})};let m=["nodesep","edgesep","ranksep","marginx","marginy"],_={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},g=["acyclicer","ranker","rankdir","align"],p=["width","height","rank"],b={width:0,height:0},x=["minlen","weight","width","height","labeloffset"],y={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},v=["labelpos"];function C(N,j){return h.mapValues(h.pick(N,j),Number)}function k(N){var j={};return N&&Object.entries(N).forEach(([I,T])=>{typeof I=="string"&&(I=I.toLowerCase()),j[I]=T}),j}return Yf}function EL(){if(Gk)return Jf;Gk=1;let t=Pt(),e=Zn().Graph;return Jf={debugOrdering:function(n){let o=t.buildLayerMatrix(n),r=new e({compound:!0,multigraph:!0}).setGraph({});return n.nodes().forEach(s=>{r.setNode(s,{label:s}),r.setParent(s,"layer"+n.node(s).rank)}),n.edges().forEach(s=>r.setEdge(s.v,s.w,{},s.name)),o.forEach((s,i)=>{let a="layer"+i;r.setNode(a,{rank:"same"}),s.reduce((l,d)=>(r.setEdge(l,d,{style:"invis"}),d))}),r}},Jf}var r3=Xk?Kk:(Xk=1,Kk={graphlib:Zn(),layout:jL(),debug:EL(),util:{time:Pt().time,notime:Pt().notime},version:Jk?Yk:(Jk=1,Yk="1.1.5")});const $i=new r3.graphlib.Graph().setDefaultEdgeLabel(()=>({})),s3=({nodes:t,edges:e,direction:n})=>($i.setGraph({rankdir:n,nodesep:150,ranksep:200,ranker:"longest-path"}),e.forEach(o=>$i.setEdge(o.source,o.target)),t.forEach(o=>$i.setNode(o.id,{...o,width:o.width??0,height:o.height??0})),r3.layout($i),{nodes:t.map(o=>{const{x:r,y:s}=$i.node(o.id);return{...o,position:{x:r,y:s}}}),edges:e}),i3=new class{createEdge(t,e){return{animated:!0,markerEnd:{type:_s.ArrowClosed},id:`${t}-${e}`,style:{strokeWidth:2},source:t,sourceHandle:"outputs",targetHandle:"inputs",target:e}}createNode(t,e){return{id:t,data:{atom:e,forceWidth:300},width:300,type:"custom",height:uf(at.get(e).code.trim().split(`
|
144
|
-
`).length),position:{x:0,y:0}}}createElements(t,e,n,o){const r=[],s=[],i=new Set,a=new Set;for(const l of Object.values(n)){if(l.value==="marimo"&&l.name==="mo")continue;const{declaredBy:d,usedBy:u}=l;for(const h of d)for(const f of u){const m=`${h}-${f}`;a.has(m)||(a.add(m),i.add(h),i.add(f),s.push(this.createEdge(h,f)))}}for(const[l,d]of $m.zip(t,e)){o||r.push(this.createNode(l,d));const u=i.has(l),h=at.get(d).code.trim().startsWith("mo.md");!u&&h||r.push(this.createNode(l,d))}return{nodes:r,edges:s}}},IL=t=>{const e=K.c(43),{cellIds:n,variables:o,cellAtoms:r,children:s,layoutDirection:i,settings:a}=t;let l;e[0]!==r||e[1]!==n||e[2]!==i||e[3]!==a.hidePureMarkdown||e[4]!==o?(l=()=>{let S=i3.createElements(n,r,o,a.hidePureMarkdown);return S=s3({nodes:S.nodes,edges:S.edges,direction:i}),S},e[0]=r,e[1]=n,e[2]=i,e[3]=a.hidePureMarkdown,e[4]=o,e[5]=l):l=e[5];const[d]=M.useState(l),[u,h,f]=F2(d.nodes),[m,_,g]=z2(d.edges),p=Bi();let b;e[6]!==i||e[7]!==_||e[8]!==h?(b=S=>{const $=s3({nodes:S.nodes,edges:S.edges,direction:i});h($.nodes),_($.edges)},e[6]=i,e[7]=_,e[8]=h,e[9]=b):b=e[9];const x=Ke(b);let y,v;e[10]!==r||e[11]!==n||e[12]!==a.hidePureMarkdown||e[13]!==x||e[14]!==o?(y=()=>{x(i3.createElements(n,r,o,a.hidePureMarkdown))},v=[n,o,r,x,a.hidePureMarkdown],e[10]=r,e[11]=n,e[12]=a.hidePureMarkdown,e[13]=x,e[14]=o,e[15]=y,e[16]=v):(y=e[15],v=e[16]),M.useEffect(y,v);const[C,k]=M.useState();let N;q2(),e[17]===Symbol.for("react.memo_cache_sentinel")?(N=()=>{k(void 0)},e[17]=N):N=e[17];const j=N;let I,T,A,R,z,D,F,B,U,O;return e[18]===Symbol.for("react.memo_cache_sentinel")?(I={minZoom:.5,maxZoom:1.5},T=(S,$)=>{k({type:"node",id:$.id})},A=(S,$)=>{const{source:E,target:W}=$;k({type:"edge",source:E,target:W})},e[18]=I,e[19]=T,e[20]=A):(I=e[18],T=e[19],A=e[20]),e[21]===Symbol.for("react.memo_cache_sentinel")?(R=c.jsx(JP,{color:"#ccc",variant:Vn.Dots}),e[21]=R):R=e[21],e[22]!==p||e[23]!==u?(z=()=>{const S=at.get(_$);if(S){const $=u.find(E=>E.id===S);$&&(p.fitView({padding:1,duration:600,nodes:[$]}),k({type:"node",id:S}))}},e[22]=p,e[23]=u,e[24]=z):z=e[24],e[25]===Symbol.for("react.memo_cache_sentinel")?(D=c.jsx(Cp,{className:"size-4"}),e[25]=D):D=e[25],e[26]!==z?(F=c.jsx($P,{position:"bottom-right",showInteractive:!1,children:c.jsx(Te,{content:"Jump to focused cell",delayDuration:200,side:"left",asChild:!1,children:c.jsx(Cs,{onMouseDown:Hn.preventFocus,onClick:z,children:D})})}),e[26]=z,e[27]=F):F=e[27],e[28]!==m||e[29]!==C||e[30]!==o?(B=c.jsx(Gl,{selection:C,variables:o,edges:m,onClearSelection:j}),e[28]=m,e[29]=C,e[30]=o,e[31]=B):B=e[31],e[32]!==s||e[33]!==m||e[34]!==u||e[35]!==g||e[36]!==f||e[37]!==F||e[38]!==B?(U=c.jsxs(df,{nodes:u,edges:m,nodeTypes:H2,minZoom:.2,fitViewOptions:I,onNodeClick:T,onEdgeClick:A,onNodeDoubleClick:AL,fitView:!0,onNodesChange:f,onEdgesChange:g,zoomOnDoubleClick:!1,nodesConnectable:!1,children:[R,F,B,s]}),e[32]=s,e[33]=m,e[34]=u,e[35]=g,e[36]=f,e[37]=F,e[38]=B,e[39]=U):U=e[39],e[40]!==i||e[41]!==U?(O=c.jsx(V2,{value:i,children:U}),e[40]=i,e[41]=U,e[42]=O):O=e[42],O};function AL(t,e){cS(e.id,"focus")}const TL=qt("_minimap_"),ML=qt({hidePureMarkdown:!0}),OL=t=>{const e=K.c(11),[n,o]=on(TL),[r,s]=on(ML);let i;e[0]!==n||e[1]!==t||e[2]!==o||e[3]!==s||e[4]!==r?(i=()=>n==="_minimap_"?c.jsx(eL,{...t,children:c.jsx(ff,{settings:r,onSettingsChange:s,view:n,onChange:o})}):c.jsx(IL,{...t,settings:r,layoutDirection:n,children:c.jsx(ff,{settings:r,onSettingsChange:s,view:n,onChange:o})}),e[0]=n,e[1]=t,e[2]=o,e[3]=s,e[4]=r,e[5]=i):i=e[5];const a=i;let l,d;return e[6]!==a?(l=a(),e[6]=a,e[7]=l):l=e[7],e[8]!==n||e[9]!==l?(d=c.jsx(cf,{children:l},n),e[8]=n,e[9]=l,e[10]=d):d=e[10],d},DL=()=>{const t=K.c(5),e=dS(),n=Uc(),[o]=b$();let r,s;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=Ne("w-full h-full flex-1 mx-auto -mb-4 relative"),t[0]=r):r=t[0],t[1]!==n.inOrderIds||t[2]!==o||t[3]!==e?(s=c.jsx("div",{className:r,children:c.jsx(OL,{cellAtoms:o,variables:e,cellIds:n.inOrderIds})}),t[1]=n.inOrderIds,t[2]=o,t[3]=e,t[4]=s):s=t[4],s},RL=t=>{const e=K.c(4),{isOpen:n,children:o}=t,[r,s]=X.useState(!1);let i,a;return e[0]!==r||e[1]!==n?(i=()=>{n&&!r&&s(!0)},a=[n,r],e[0]=r,e[1]=n,e[2]=i,e[3]=a):(i=e[2],a=e[3]),X.useEffect(i,a),r?o:null},PL=t=>{const e=K.c(8),{variableName:n,className:o}=t;let r;e[0]!==n?(r=()=>{const l=function(u){const h=at.get(uS)[u];if(h)return h.declaredBy[0]}(n);if(!l)return;const d=ec(l);d&&Wm(d,n)},e[0]=n,e[1]=r):r=e[1];const s=r;let i,a;return e[2]!==o?(i=Ne("text-link opacity-80 hover:opacity-100 hover:underline",o),e[2]=o,e[3]=i):i=e[3],e[4]!==s||e[5]!==i||e[6]!==n?(a=c.jsx("button",{type:"button",onClick:s,className:i,children:n}),e[4]=s,e[5]=i,e[6]=n,e[7]=a):a=e[7],a},LL=qt(t=>{const e=t(x$),n=t(uS),o=t(Z4);return ga(e,r=>{if(!r.variable_name)return-1;const s=Object.values(n).find(a=>a.name===r.variable_name);if(!s)return 0;const i=o.inOrderIds.indexOf(s.declaredBy[0]);return i===-1?0:i})}),FL=qt(t=>{const e=new Map(t(y$));for(const n of hS){const o=e.get(n);o&&o.databases.length===0&&e.delete(n)}return ga([...e.values()],n=>hS.has(n.name)?1:0)}),zL=()=>{const t=K.c(32),[e,n]=X.useState(""),o=Zt(fS),r=Ue(LL),s=Ue(FL);if(r.length===0&&s.length===0){let b;return t[0]===Symbol.for("react.memo_cache_sentinel")?(b=c.jsx(yn,{title:"No tables found",description:"Any datasets/dataframes in the global scope will be shown here.",action:c.jsx(Cg,{children:c.jsxs(Me,{variant:"outline",size:"sm",children:["Add database or catalog",c.jsx(ur,{className:"h-4 w-4 ml-2"})]})}),icon:c.jsx(ar,{})}),t[0]=b):b=t[0],b}const i=!!e.trim();let a,l,d,u,h,f,m,_,g,p;if(t[1]!==o?(a=b=>{o(b.length>0),n(b)},t[1]=o,t[2]=a):a=t[2],t[3]!==e||t[4]!==a?(l=c.jsx(Ji,{placeholder:"Search tables...",className:"h-6 m-1",value:e,onValueChange:a,rootClassName:"flex-1 border-r"}),t[3]=e,t[4]=a,t[5]=l):l=t[5],t[6]!==i?(d=i&&c.jsx("button",{type:"button",className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",onClick:()=>n(""),children:c.jsx(eo,{className:"h-4 w-4"})}),t[6]=i,t[7]=d):d=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(u=c.jsx(Cg,{children:c.jsx("button",{type:"button",className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:c.jsx(ur,{className:"h-4 w-4"})})}),t[8]=u):u=t[8],t[9]!==l||t[10]!==d?(h=c.jsxs("div",{className:"flex items-center w-full",children:[l,d,u]}),t[9]=l,t[10]=d,t[11]=h):h=t[11],t[12]!==s||t[13]!==i||t[14]!==e){let b;t[16]!==i||t[17]!==e?(b=x=>c.jsx(BL,{connection:x,hasChildren:x.databases.length>0,children:x.databases.map(y=>c.jsx(UL,{engineName:x.name,database:y,hasSearch:i,children:c.jsx(VL,{schemas:y.schemas,defaultSchema:x.default_schema,defaultDatabase:x.default_database,engineName:x.name,databaseName:y.name,hasSearch:i,searchValue:e})},y.name))},x.name),t[16]=i,t[17]=e,t[18]=b):b=t[18],f=s.map(b),t[12]=s,t[13]=i,t[14]=e,t[15]=f}else f=t[15];return t[19]!==s.length||t[20]!==r.length?(m=s.length>0&&r.length>0&&c.jsxs(mS,{children:[c.jsx(rc,{className:"h-4 w-4 text-muted-foreground"}),c.jsx("span",{className:"text-xs",children:"Python"})]}),t[19]=s.length,t[20]=r.length,t[21]=m):m=t[21],t[22]!==e||t[23]!==r?(_=r.length>0&&c.jsx(a3,{tables:r,searchValue:e}),t[22]=e,t[23]=r,t[24]=_):_=t[24],t[25]!==f||t[26]!==m||t[27]!==_?(g=c.jsxs(Dm,{className:"flex flex-col",children:[f,m,_]}),t[25]=f,t[26]=m,t[27]=_,t[28]=g):g=t[28],t[29]!==h||t[30]!==g?(p=c.jsxs(bc,{className:"border-b bg-background rounded-none h-full pb-10 overflow-auto outline-none",shouldFilter:!1,children:[h,g]}),t[29]=h,t[30]=g,t[31]=p):p=t[31],p},BL=t=>{const e=K.c(25),{connection:n,children:o,hasChildren:r}=t,s=n.name===w$,i=s?"In-Memory":n.name,[a,l]=X.useState(!1);let d;e[0]!==n.name?(d=async()=>{l(!0),await k$({engine:n.name}),setTimeout(()=>l(!1),500)},e[0]=n.name,e[1]=d):d=e[1];const u=d;let h,f,m;e[2]!==n.dialect?(h=c.jsx(s4,{className:"h-4 w-4 text-muted-foreground",name:n.dialect}),e[2]=n.dialect,e[3]=h):h=e[3],e[4]!==n.dialect?(f=v$(n.dialect),e[4]=n.dialect,e[5]=f):f=e[5],e[6]!==f?(m=c.jsx("span",{className:"text-xs",children:f}),e[6]=f,e[7]=m):m=e[7];const _=i;let g,p,b,x,y;return e[8]!==_?(g=c.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",c.jsx(PL,{variableName:_}),")"]}),e[8]=_,e[9]=g):g=e[9],e[10]!==u||e[11]!==s||e[12]!==a?(p=!s&&c.jsx(Te,{content:"Refresh connection",children:c.jsx(Me,{variant:"ghost",size:"icon",className:"ml-auto hover:bg-transparent hover:shadow-none",onClick:u,children:c.jsx(Ac,{className:Ne("h-4 w-4 text-muted-foreground hover:text-foreground",a&&"animate-[spin_0.5s]")})})}),e[10]=u,e[11]=s,e[12]=a,e[13]=p):p=e[13],e[14]!==h||e[15]!==m||e[16]!==g||e[17]!==p?(b=c.jsxs(mS,{children:[h,m,g,p]}),e[14]=h,e[15]=m,e[16]=g,e[17]=p,e[18]=b):b=e[18],e[19]!==o||e[20]!==r?(x=r?o:c.jsx(Vc,{content:"No databases available",className:"pl-2"}),e[19]=o,e[20]=r,e[21]=x):x=e[21],e[22]!==b||e[23]!==x?(y=c.jsxs(c.Fragment,{children:[b,x]}),e[22]=b,e[23]=x,e[24]=y):y=e[24],y},UL=t=>{const e=K.c(28),{hasSearch:n,engineName:o,database:r,children:s}=t,[i,a]=X.useState(!1),[l,d]=X.useState(!1);let u,h,f;e[0]!==n?(u=()=>{a(n)},h=[n],e[0]=n,e[1]=u,e[2]=h):(u=e[1],h=e[2]),X.useEffect(u,h),e[3]!==i||e[4]!==l?(f=()=>{a(!i),d(!l)},e[3]=i,e[4]=l,e[5]=f):f=e[5];const m=`${o}:${r.name}`;let _;e[6]!==i?(_=c.jsx(yS,{isExpanded:i}),e[6]=i,e[7]=_):_=e[7];const g=l&&i?"text-foreground":"text-muted-foreground";let p,b;e[8]!==g?(p=Ne("h-4 w-4",g),e[8]=g,e[9]=p):p=e[9],e[10]!==p?(b=c.jsx(ar,{className:p}),e[10]=p,e[11]=b):b=e[11];const x=l&&i&&"font-semibold";let y,v,C,k;e[12]!==x?(y=Ne(x),e[12]=x,e[13]=y):y=e[13],e[14]!==r.name?(v=r.name===""?c.jsx("i",{children:"Not connected"}):r.name,e[14]=r.name,e[15]=v):v=e[15],e[16]!==y||e[17]!==v?(C=c.jsx("span",{className:y,children:v}),e[16]=y,e[17]=v,e[18]=C):C=e[18],e[19]!==C||e[20]!==f||e[21]!==m||e[22]!==_||e[23]!==b?(k=c.jsxs(mo,{className:"text-sm flex flex-row gap-1 items-center cursor-pointer rounded-none",onSelect:f,value:m,children:[_,b,C]}),e[19]=C,e[20]=f,e[21]=m,e[22]=_,e[23]=b,e[24]=k):k=e[24];const N=i&&s;let j;return e[25]!==k||e[26]!==N?(j=c.jsxs(c.Fragment,{children:[k,N]}),e[25]=k,e[26]=N,e[27]=j):j=e[27],j},VL=t=>{const e=K.c(20),{schemas:n,defaultSchema:o,defaultDatabase:r,engineName:s,databaseName:i,hasSearch:a,searchValue:l}=t;if(n.length===0){let h;return e[0]===Symbol.for("react.memo_cache_sentinel")?(h=c.jsx(Vc,{content:"No schemas available",className:"pl-6"}),e[0]=h):h=e[0],h}let d,u;if(e[1]!==i||e[2]!==r||e[3]!==o||e[4]!==s||e[5]!==a||e[6]!==n||e[7]!==l){let h;e[9]!==l?(h=_=>!l||_.tables.some(g=>g.name.toLowerCase().includes(l.toLowerCase())),e[9]=l,e[10]=h):h=e[10];const f=n.filter(h);let m;e[11]!==i||e[12]!==r||e[13]!==o||e[14]!==s||e[15]!==a||e[16]!==l?(m=_=>c.jsx($L,{databaseName:i,schema:_,hasSearch:a,children:c.jsx(a3,{tables:_.tables,searchValue:l,sqlTableContext:{engine:s,database:i,schema:_.name,defaultSchema:o,defaultDatabase:r}})},_.name),e[11]=i,e[12]=r,e[13]=o,e[14]=s,e[15]=a,e[16]=l,e[17]=m):m=e[17],d=f.map(m),e[1]=i,e[2]=r,e[3]=o,e[4]=s,e[5]=a,e[6]=n,e[7]=l,e[8]=d}else d=e[8];return e[18]!==d?(u=c.jsx(c.Fragment,{children:d}),e[18]=d,e[19]=u):u=e[19],u},$L=t=>{const e=K.c(26),{databaseName:n,schema:o,children:r,hasSearch:s}=t,[i,a]=X.useState(!1),[l,d]=X.useState(!1),u=`${n}:${o.name}`;let h,f,m,_;if(e[0]!==s?(h=()=>{a(s)},f=[s],e[0]=s,e[1]=h,e[2]=f):(h=e[1],f=e[2]),X.useEffect(h,f),xS(o.name))return r;e[3]!==i||e[4]!==l?(m=()=>{a(!i),d(!l)},e[3]=i,e[4]=l,e[5]=m):m=e[5],e[6]!==i?(_=c.jsx(yS,{isExpanded:i}),e[6]=i,e[7]=_):_=e[7];const g=l&&i&&"text-foreground";let p,b;e[8]!==g?(p=Ne("h-4 w-4 text-muted-foreground",g),e[8]=g,e[9]=p):p=e[9],e[10]!==p?(b=c.jsx(A$,{className:p}),e[10]=p,e[11]=b):b=e[11];const x=l&&i&&"font-semibold";let y,v,C;e[12]!==x?(y=Ne(x),e[12]=x,e[13]=y):y=e[13],e[14]!==o.name||e[15]!==y?(v=c.jsx("span",{className:y,children:o.name}),e[14]=o.name,e[15]=y,e[16]=v):v=e[16],e[17]!==v||e[18]!==m||e[19]!==_||e[20]!==b||e[21]!==u?(C=c.jsxs(mo,{className:"text-sm flex flex-row gap-1 items-center pl-5 cursor-pointer rounded-none",onSelect:m,value:u,children:[_,b,v]}),e[17]=v,e[18]=m,e[19]=_,e[20]=b,e[21]=u,e[22]=C):C=e[22];const k=i&&r;let N;return e[23]!==C||e[24]!==k?(N=c.jsxs(c.Fragment,{children:[C,k]}),e[23]=C,e[24]=k,e[25]=N):N=e[25],N},a3=t=>{const e=K.c(24),{tables:n,sqlTableContext:o,searchValue:r}=t,{addTableList:s}=pS(),[i,a]=X.useState(!1),[l,d]=X.useState(!1);let u,h;e[0]!==s||e[1]!==o||e[2]!==n.length||e[3]!==i?(u=async()=>{if(n.length===0&&o&&!i){a(!0),d(!0);const{engine:p,database:b,schema:x}=o,y=await eW.request({engine:p,database:b,schema:x});if(!(y!=null&&y.tables))throw d(!1),new Error("No tables available");s({tables:y.tables,sqlTableContext:o}),d(!1)}},e[0]=s,e[1]=o,e[2]=n.length,e[3]=i,e[4]=u):u=e[4],e[5]!==o||e[6]!==n.length||e[7]!==i?(h=[n.length,o,i],e[5]=o,e[6]=n.length,e[7]=i,e[8]=h):h=e[8];const{isPending:f,error:m}=Gn(u,h);if(f||l){let p;return e[9]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx(gS,{message:"Loading tables...",className:"pl-12"}),e[9]=p):p=e[9],p}if(m){let p;return e[10]!==m?(p=c.jsx(_S,{error:m,className:"pl-12"}),e[10]=m,e[11]=p):p=e[11],p}if(n.length===0){let p;return e[12]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx(Vc,{content:"No tables found",className:"pl-9"}),e[12]=p):p=e[12],p}let _,g;if(e[13]!==r||e[14]!==o||e[15]!==n){let p;e[17]!==r?(p=y=>!r||y.name.toLowerCase().includes(r.toLowerCase()),e[17]=r,e[18]=p):p=e[18];const b=n.filter(p);let x;e[19]!==r||e[20]!==o?(x=y=>c.jsx(HL,{table:y,sqlTableContext:o,isSearching:!!r},y.name),e[19]=r,e[20]=o,e[21]=x):x=e[21],_=b.map(x),e[13]=r,e[14]=o,e[15]=n,e[16]=_}else _=e[16];return e[22]!==_?(g=c.jsx(c.Fragment,{children:_}),e[22]=_,e[23]=g):g=e[23],g},HL=t=>{const e=K.c(64),{table:n,sqlTableContext:o,isSearching:r}=t,{addTable:s}=pS(),[i,a]=X.useState(!1),[l,d]=X.useState(!1),u=n.columns.length>0;let h,f;e[0]!==s||e[1]!==i||e[2]!==o||e[3]!==n.name||e[4]!==u||e[5]!==l?(h=async()=>{if(i&&!u&&o&&!l){d(!0);const{engine:oe,database:se,schema:Z}=o,Q=await tW.request({engine:oe,database:se,schema:Z,tableName:n.name});if(!(Q!=null&&Q.table))throw new Error("No table details available");s({table:Q.table,sqlTableContext:o})}},e[0]=s,e[1]=i,e[2]=o,e[3]=n.name,e[4]=u,e[5]=l,e[6]=h):h=e[6],e[7]!==i||e[8]!==u?(f=[i,u],e[7]=i,e[8]=u,e[9]=f):f=e[9];const{isFetching:m,isPending:_,error:g}=Gn(h,f),p=Ue(nc),b=Os(),{createNewCell:x}=Mt(),y=bS();let v;e[10]!==y||e[11]!==p||e[12]!==x||e[13]!==b||e[14]!==o||e[15]!==n?(v=()=>{fo(p,x,b),y((()=>{if(n.source_type==="catalog"){const oe=o!=null&&o.database?`${o.database}.${n.name}`:n.name;return`${n.engine}.load_table("${oe}")`}if(o)return wS({table:n,columnName:"*",sqlTableContext:o});switch(n.source_type){case"local":return`mo.ui.table(${n.name})`;case"duckdb":case"connection":return wS({table:n,columnName:"*",sqlTableContext:o});default:return uc(n.source_type),""}})())},e[10]=y,e[11]=p,e[12]=x,e[13]=b,e[14]=o,e[15]=n,e[16]=v):v=e[16];const C=v;let k;e[17]!==n.num_columns||e[18]!==n.num_rows?(k=()=>{const oe=[];return n.num_rows!=null&&oe.push(`${n.num_rows} rows`),n.num_columns!=null&&oe.push(`${n.num_columns} columns`),oe.length===0?null:c.jsx("div",{className:"flex flex-row gap-2 items-center pl-6 group-hover:hidden",children:c.jsx("span",{className:"text-xs text-muted-foreground",children:oe.join(", ")})})},e[17]=n.num_columns,e[18]=n.num_rows,e[19]=k):k=e[19];const N=k;let j;e[20]!==g||e[21]!==m||e[22]!==_||e[23]!==o||e[24]!==n?(j=()=>{if(_||m)return c.jsx(gS,{message:"Loading columns...",className:"pl-12"});if(g)return c.jsx(_S,{error:g,className:"pl-12"});const oe=n.columns;return oe.length===0?c.jsx(Vc,{content:"No columns found",className:"pl-12"}):oe.map(se=>c.jsx(WL,{table:n,column:se,sqlTableContext:o},se.name))},e[20]=g,e[21]=m,e[22]=_,e[23]=o,e[24]=n,e[25]=j):j=e[25];const I=j;let T;e[26]!==i||e[27]!==r||e[28]!==n.source_type||e[29]!==n.type?(T=()=>{if(n.source_type==="local")return;const oe=n.type==="table"?S$:V3;return c.jsx(oe,{className:"h-3 w-3",strokeWidth:i||r?2.5:void 0})},e[26]=i,e[27]=r,e[28]=n.source_type,e[29]=n.type,e[30]=T):T=e[30];const A=T,R=o?`${o.database}.${o.schema}.${n.name}`:n.name,z=o&&(xS(o.schema)?"pl-9":"pl-12"),D=(i||r)&&"font-semibold";let F,B,U,O,S,$,E,W,G,q,Y,te;return e[31]!==z||e[32]!==D?(F=Ne("rounded-none group h-8 cursor-pointer",z,D),e[31]=z,e[32]=D,e[33]=F):F=e[33],e[34]!==i?(B=()=>a(!i),e[34]=i,e[35]=B):B=e[35],e[36]!==A?(U=A(),e[36]=A,e[37]=U):U=e[37],e[38]!==n.name?(O=c.jsx("span",{className:"text-sm",children:n.name}),e[38]=n.name,e[39]=O):O=e[39],e[40]!==U||e[41]!==O?(S=c.jsxs("div",{className:"flex gap-2 items-center flex-1",children:[U,O]}),e[40]=U,e[41]=O,e[42]=S):S=e[42],e[43]!==N?($=N(),e[43]=N,e[44]=$):$=e[44],e[45]!==C?(E=Hn.stopPropagation(()=>C()),e[45]=C,e[46]=E):E=e[46],e[47]===Symbol.for("react.memo_cache_sentinel")?(W=c.jsx(C$,{className:"h-3 w-3"}),e[47]=W):W=e[47],e[48]!==E?(G=c.jsx(Te,{content:"Add table to notebook",delayDuration:400,children:c.jsx(Me,{className:"group-hover:inline-flex hidden",variant:"text",size:"icon",onClick:E,children:W})}),e[48]=E,e[49]=G):G=e[49],e[50]!==i||e[51]!==B||e[52]!==S||e[53]!==$||e[54]!==G||e[55]!==F||e[56]!==R?(q=c.jsxs(mo,{className:F,value:R,"aria-selected":i,forceMount:!0,onSelect:B,children:[S,$,G]}),e[50]=i,e[51]=B,e[52]=S,e[53]=$,e[54]=G,e[55]=F,e[56]=R,e[57]=q):q=e[57],e[58]!==i||e[59]!==I?(Y=i&&I(),e[58]=i,e[59]=I,e[60]=Y):Y=e[60],e[61]!==q||e[62]!==Y?(te=c.jsxs(c.Fragment,{children:[q,Y]}),e[61]=q,e[62]=Y,e[63]=te):te=e[63],te},WL=t=>{var E,W;const e=K.c(51),{table:n,column:o,sqlTableContext:r}=t,[s,i]=X.useState(!1),a=Ue(fS),l=Zt(N$);let d,u;e[0]!==a?(d=()=>{a&&i(!1)},u=[a],e[0]=a,e[1]=d,e[2]=u):(d=e[1],u=e[2]),X.useEffect(d,u),l(s?G=>new Set([...G,`${n.name}:${o.name}`]):G=>(G.delete(`${n.name}:${o.name}`),new Set(G)));const h=bS(),{columnsPreviews:f}=j$();let m;e[3]!==o.name||e[4]!==n.primary_keys?(m=((E=n.primary_keys)==null?void 0:E.includes(o.name))||!1,e[3]=o.name,e[4]=n.primary_keys,e[5]=m):m=e[5];const _=m;let g;e[6]!==o.name||e[7]!==n.indexes?(g=((W=n.indexes)==null?void 0:W.includes(o.name))||!1,e[6]=o.name,e[7]=n.indexes,e[8]=g):g=e[8];const p=g;let b;e[9]!==h?(b=G=>{h(G)},e[9]=h,e[10]=b):b=e[10];const x=b,y=qL,v=s?"font-semibold":"";let C;e[11]!==o.name||e[12]!==v?(C=c.jsx("span",{className:v,children:o.name}),e[11]=o.name,e[12]=v,e[13]=C):C=e[13];const k=C,N=`${n.name}.${o.name}`,j=`${n.name}.${o.name}`;let I;e[14]!==s?(I=()=>i(!s),e[14]=s,e[15]=I):I=e[15];const T=r?"pl-14":"pl-7";let A,R,z,D,F,B,U,O,S,$;return e[16]!==T?(A=Ne("flex flex-row gap-2 items-center flex-1",T),e[16]=T,e[17]=A):A=e[17],e[18]!==o.type||e[19]!==k?(R=c.jsx(E$,{columnName:k,dataType:o.type}),e[18]=o.type,e[19]=k,e[20]=R):R=e[20],e[21]!==_?(z=_&&y({tooltipContent:"Primary key",content:"PK"}),e[21]=_,e[22]=z):z=e[22],e[23]!==p?(D=p&&y({tooltipContent:"Indexed",content:"IDX"}),e[23]=p,e[24]=D):D=e[24],e[25]!==A||e[26]!==R||e[27]!==z||e[28]!==D?(F=c.jsxs("div",{className:A,children:[R,z,D]}),e[25]=A,e[26]=R,e[27]=z,e[28]=D,e[29]=F):F=e[29],e[30]!==o.name?(B=c.jsx(Te,{content:"Copy column name",delayDuration:400,children:c.jsx(Me,{variant:"text",size:"icon",className:"group-hover:opacity-100 opacity-0 hover:bg-muted text-muted-foreground hover:text-foreground",children:c.jsx(iS,{tooltip:!1,value:o.name,className:"h-3 w-3"})})}),e[30]=o.name,e[31]=B):B=e[31],e[32]!==o.external_type?(U=c.jsx("span",{className:"text-xs text-muted-foreground",children:o.external_type}),e[32]=o.external_type,e[33]=U):U=e[33],e[34]!==I||e[35]!==F||e[36]!==B||e[37]!==U||e[38]!==N||e[39]!==j?(O=c.jsxs(mo,{className:"rounded-none py-1 group cursor-pointer",value:j,onSelect:I,children:[F,B,U]},N),e[34]=I,e[35]=F,e[36]=B,e[37]=U,e[38]=N,e[39]=j,e[40]=O):O=e[40],e[41]!==o||e[42]!==f||e[43]!==x||e[44]!==s||e[45]!==r||e[46]!==n?(S=s&&c.jsx("div",{className:"pl-10 pr-2 py-2 bg-[var(--slate-1)] shadow-inner border-b",children:c.jsx(xc,{children:c.jsx(I$,{table:n,column:o,onAddColumnChart:x,preview:f.get(r?`${r.database}.${r.schema}.${n.name}:${o.name}`:`${n.name}:${o.name}`),sqlTableContext:r})})}),e[41]=o,e[42]=f,e[43]=x,e[44]=s,e[45]=r,e[46]=n,e[47]=S):S=e[47],e[48]!==O||e[49]!==S?($=c.jsxs(c.Fragment,{children:[O,S]}),e[48]=O,e[49]=S,e[50]=$):$=e[50],$};function qL(t){const{tooltipContent:e,content:n}=t;return c.jsx(Te,{content:e,delayDuration:100,children:c.jsx("span",{className:"text-xs text-black bg-gray-100 dark:invert rounded px-1",children:n})})}const GL=()=>{const t=K.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx(zL,{}),t[0]=e):e=t[0],e},YL=()=>{const t=K.c(5),{documentation:e}=Ue(T$);if(!e){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=c.jsx(yn,{title:"View docs as you type",description:"Move your text cursor over a symbol to see its documentation.",icon:c.jsx(id,{})}),t[0]=r):r=t[0],r}let n,o;return t[1]!==e?(n=Hm({html:e}),t[1]=e,t[2]=n):n=t[2],t[3]!==n?(o=c.jsx("div",{className:"p-3 overflow-y-auto overflow-x-hidden h-full docs-documentation flex flex-col gap-4",children:n}),t[3]=n,t[4]=o):o=t[4],o},JL=()=>{const t=K.c(5),e=M$();if(e.length===0){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=c.jsx(yn,{title:"No errors!",icon:c.jsx(Mp,{})}),t[0]=r):r=t[0],r}let n,o;return t[1]!==e?(n=e.map(KL),t[1]=e,t[2]=n):n=t[2],t[3]!==n?(o=c.jsx("div",{className:"flex flex-col overflow-auto",children:n}),t[3]=n,t[4]=o):o=t[4],o};function KL(t){return c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-mono font-semibold bg-muted border-y px-2 py-1",children:c.jsx(O$,{cellId:t.cellId})}),c.jsx("div",{className:"px-2",children:c.jsx(D$,{errors:t.output.data,cellId:t.cellId},t.cellId)},t.cellId)]},t.cellId)}const Xf=new Map,XL=({file:t,onOpenNotebook:e})=>{const{theme:n}=hr(),o=Ue(dm),[r,s]=M.useState(""),{data:i,isPending:a,error:l,setData:d}=Gn(async()=>{const g=await qm({path:t.path}),p=g.contents||"";return s(Xf.get(t.path)||p),g},[t.path]),u=async()=>{r!==(i==null?void 0:i.contents)&&await V$({path:t.path,contents:r}).then(g=>{g.success&&(d(p=>({...p,contents:r})),s(r))})},h=M.useRef(r);if(h.current=r,M.useEffect(()=>()=>{if(!(i!=null&&i.contents))return;const g=h.current;g===i.contents?Xf.delete(t.path):Xf.set(t.path,g)},[t.path,i==null?void 0:i.contents]),l)return c.jsx(Br,{error:l});if(a||!i)return null;const f=i.mimeType||"text/plain",m=f in Zf;if(!i.contents&&!m)return c.jsxs("div",{className:"grid grid-cols-2 gap-2 p-6",children:[c.jsx("div",{className:"font-bold text-muted-foreground",children:"Name"}),c.jsx("div",{children:i.file.name}),c.jsx("div",{className:"font-bold text-muted-foreground",children:"Type"}),c.jsx("div",{children:f})]});const _=c.jsxs("div",{className:"text-xs text-muted-foreground p-1 flex justify-end gap-2 border-b",children:[t.isMarimoFile&&!un()&&c.jsx(Te,{content:"Open notebook",children:c.jsx(xn,{size:"small",onClick:g=>e(g),children:c.jsx(gc,{})})}),c.jsx(Te,{content:"Download",children:c.jsx(xn,{size:"small",onClick:()=>{if(l3(f)){const g=B$(i.contents,f);return void U$(g,i.file.name)}Qi(new Blob([i.contents||r],{type:f}),i.file.name)},children:c.jsx(ym,{})})}),!l3(f)&&c.jsxs(c.Fragment,{children:[c.jsx(Te,{content:"Copy contents to clipboard",children:c.jsx(xn,{size:"small",onClick:async()=>{await bn(r)},children:c.jsx(qi,{})})}),c.jsx(Te,{content:rn("global.save"),children:c.jsx(xn,{size:"small",color:r===i.contents?void 0:"green",onClick:u,disabled:r===i.contents,children:c.jsx(va,{})})})]})]});return f.startsWith("image/")?c.jsxs(c.Fragment,{children:[_,c.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:c.jsx(R$,{base64:i.contents,mime:f})})]}):f==="text/csv"&&i.contents?c.jsxs(c.Fragment,{children:[_,c.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:c.jsx(P$,{contents:i.contents})})]}):f.startsWith("audio/")?c.jsxs(c.Fragment,{children:[_,c.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:c.jsx(L$,{base64:i.contents,mime:f})})]}):f.startsWith("video/")?c.jsxs(c.Fragment,{children:[_,c.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:c.jsx(F$,{base64:i.contents,mime:f})})]}):f.startsWith("application/pdf")?c.jsxs(c.Fragment,{children:[_,c.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:c.jsx(z$,{base64:i.contents,mime:f})})]}):c.jsxs(c.Fragment,{children:[_,c.jsx("div",{className:"flex-1 overflow-auto",children:c.jsx(M.Suspense,{children:c.jsx(ha,{theme:n==="dark"?"dark":"light",language:Zf[f]||Zf.default,className:"border-b",extensions:[et.lineWrapping,Yn.of([{key:o.getHotkey("global.save").key,stopPropagation:!0,run:()=>r!==i.contents&&(u(),!0)}])],value:r,onChange:s})})})]})},l3=t=>t.startsWith("image/")||t.startsWith("audio/")||t.startsWith("video/")||t.startsWith("application/pdf"),Zf={"application/javascript":"javascript","text/markdown":"markdown","text/html":"html","text/css":"css","text/x-python":"python","application/json":"json","application/xml":"xml","text/x-yaml":"yaml","text/csv":"markdown","text/plain":"markdown",default:"markdown"},c3=qt(new class{constructor(t){this.callbacks=t,this.delegate=new Zm([]),this.rootPath="",this.onChange=Sn.NOOP,this.path=new fc("/"),this.initialize=async e=>{if(this.onChange=e,this.delegate.data.length===0)try{const n=await this.callbacks.listFiles({path:this.rootPath});this.delegate=new Zm(n.files),this.rootPath=n.root,this.path=fc.guessDeliminator(n.root)}catch(n){ct({title:"Failed",description:F4(n)})}this.onChange(this.delegate.data)},this.refreshAll=async e=>{const n=[this.rootPath,...e.map(r=>{var s;return(s=this.delegate.find(r))==null?void 0:s.data.path})].filter(Boolean),o=await Promise.all(n.map(r=>this.callbacks.listFiles({path:r}).catch(()=>({files:[]}))));for(const[r,s]of n.entries()){const i=o[r];s===this.rootPath?this.delegate=new Zm(i.files):this.delegate.update({id:s,changes:{children:i.files}})}this.onChange(this.delegate.data)},this.relativeFromRoot=e=>{const n=this.rootPath.endsWith(this.path.deliminator)?this.rootPath:`${this.rootPath}${this.path.deliminator}`;return e.startsWith(n)?e.slice(n.length):e},this.handleResponse=e=>e.success?e:(ct({title:"Failed",description:e.message}),null)}async expand(t){const e=this.delegate.find(t);if(!e||!e.data.isDirectory)return!1;if(e.children&&e.children.length>0)return!0;const n=await this.callbacks.listFiles({path:e.data.path});return this.delegate.update({id:t,changes:{children:n.files}}),this.onChange(this.delegate.data),!0}async rename(t,e){const n=this.delegate.find(t);if(!n)return;const o=n.data.path,r=this.path.join(this.path.dirname(o),e);await this.callbacks.renameFileOrFolder({path:o,newPath:r}).then(this.handleResponse),this.delegate.update({id:t,changes:{name:e,path:r}}),this.onChange(this.delegate.data),await this.refreshAll([r])}async move(t,e){var o;const n=e?((o=this.delegate.find(e))==null?void 0:o.data.path)??e:this.rootPath;await Promise.all(t.map(r=>{this.delegate.move({id:r,parentId:e,index:0});const s=this.delegate.find(r);if(!s)return Promise.resolve();const i=this.path.join(n,this.path.basename(s.data.path));return this.delegate.update({id:r,changes:{path:i}}),this.callbacks.renameFileOrFolder({path:s.data.path,newPath:i}).then(this.handleResponse)})),this.onChange(this.delegate.data),await this.refreshAll([n])}async createFile(t,e){var r;const n=e?((r=this.delegate.find(e))==null?void 0:r.data.path)??e:this.rootPath,o=await this.callbacks.createFileOrFolder({path:n,type:"file",name:t}).then(this.handleResponse);o!=null&&o.info&&(this.delegate.create({parentId:e,index:0,data:o.info}),this.onChange(this.delegate.data),await this.refreshAll([n]))}async createFolder(t,e){var r;const n=e?((r=this.delegate.find(e))==null?void 0:r.data.path)??e:this.rootPath,o=await this.callbacks.createFileOrFolder({path:n,type:"directory",name:t}).then(this.handleResponse);o!=null&&o.info&&(this.delegate.create({parentId:e,index:0,data:o.info}),this.onChange(this.delegate.data),await this.refreshAll([n]))}async delete(t){const e=this.delegate.find(t);e&&(await this.callbacks.deleteFileOrFolder({path:e.data.path}).then(this.handleResponse),this.delegate.drop({id:t}),this.onChange(this.delegate.data))}}({listFiles:f4,createFileOrFolder:Gm,deleteFileOrFolder:H$,renameFileOrFolder:$$})),ZL=qt({});function QL(t){return new Promise((e,n)=>{const o=new FileReader;o.onload=r=>{var s;e((s=r.target)==null?void 0:s.result)},o.onerror=r=>{n(new Error(`Failed to read blob: ${r.type}`))},o.readAsDataURL(t)})}function d3(t){const e=K.c(4);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const o=n;let r;return e[2]!==o?(r={multiple:!0,maxSize:104857600,onError:rF,onDropRejected:tF,onDrop:eF,...o},e[2]=o,e[3]=r):r=e[3],W$(r)}async function eF(t){for(const e of t){const n=iF(sF(e));let o="";n&&(o=fc.guessDeliminator(n).dirname(n));const r=(await QL(e)).split(",")[1];await Gm({path:o,type:"file",name:e.name,contents:r})}await async function(){await at.get(c3).refreshAll([])}()}function tF(t){ct({title:"File upload failed",description:c.jsx("div",{className:"flex flex-col gap-1",children:t.map(nF)}),variant:"danger"})}function nF(t){return c.jsxs("div",{children:[t.file.name," (",t.errors.map(oF).join(", "),")"]},t.file.name)}function oF(t){return t.message}function rF(t){Ct.error(t),ct({title:"File upload failed",description:t.message,variant:"danger"})}function sF(t){return t.webkitRelativePath?t.webkitRelativePath:"path"in t&&typeof t.path=="string"?t.path:"relativePath"in t&&typeof t.relativePath=="string"?t.relativePath:void 0}function iF(t){if(t)return t.replace(/^\/+/,"")}const u3=X.createContext(null),aF=t=>{const e=K.c(60),{height:n}=t,o=M.useRef(null),[r]=on(c3);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[0]=s):s=e[0];const[i,a]=M.useState(s),[l,d]=M.useState(null),{openPrompt:u}=qn(),[h,f]=on(ZL);let m,_;e[1]!==r?(m=()=>r.initialize(a),e[1]=r,e[2]=m):m=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(_=[],e[3]=_):_=e[3];const{isPending:g,error:p}=Gn(m,_);let b;e[4]!==h||e[5]!==r?(b=()=>{r.refreshAll(Object.keys(h).filter(S=>h[S]))},e[4]=h,e[5]=r,e[6]=b):b=e[6];const x=Ke(b);let y;e[7]!==u||e[8]!==r?(y=async()=>{u({title:"Folder name",onConfirm:async S=>{r.createFolder(S,null)}})},e[7]=u,e[8]=r,e[9]=y):y=e[9];const v=Ke(y);let C;e[10]!==u||e[11]!==r?(C=async()=>{u({title:"File name",onConfirm:async S=>{r.createFile(S,null)}})},e[10]=u,e[11]=r,e[12]=C):C=e[12];const k=Ke(C);let N;e[13]!==f?(N=()=>{var S;(S=o.current)==null||S.closeAll(),f({})},e[13]=f,e[14]=N):N=e[14];const j=Ke(N);if(g){let S;return e[15]===Symbol.for("react.memo_cache_sentinel")?(S=c.jsx(In,{size:"medium",centered:!0}),e[15]=S):S=e[15],S}if(p){let S;return e[16]!==p?(S=c.jsx(Br,{error:p}),e[16]=p,e[17]=S):S=e[17],S}if(l){let S,$,E,W,G,q;return e[18]===Symbol.for("react.memo_cache_sentinel")?(S=()=>d(null),e[18]=S):S=e[18],e[19]===Symbol.for("react.memo_cache_sentinel")?($=c.jsx(Me,{onClick:S,"data-testid":"file-explorer-back-button",variant:"text",size:"xs",className:"mb-0",children:c.jsx(Et,{size:16})}),e[19]=$):$=e[19],e[20]!==l.name?(E=c.jsxs("div",{className:"flex items-center pl-1 pr-3 flex-shrink-0 border-b justify-between",children:[$,c.jsx("span",{className:"font-bold",children:l.name})]}),e[20]=l.name,e[21]=E):E=e[21],e[22]!==l.path||e[23]!==r?(W=Y=>h3(Y,r.relativeFromRoot(l.path)),e[22]=l.path,e[23]=r,e[24]=W):W=e[24],e[25]!==l||e[26]!==W?(G=c.jsx(M.Suspense,{children:c.jsx(XL,{onOpenNotebook:W,file:l})}),e[25]=l,e[26]=W,e[27]=G):G=e[27],e[28]!==E||e[29]!==G?(q=c.jsxs(c.Fragment,{children:[E,G]}),e[28]=E,e[29]=G,e[30]=q):q=e[30],q}let I;e[31]!==j||e[32]!==k||e[33]!==v||e[34]!==x||e[35]!==r?(I=c.jsx(cF,{onRefresh:x,onCreateFile:k,onCreateFolder:v,onCollapseAll:j,tree:r}),e[31]=j,e[32]=k,e[33]=v,e[34]=x,e[35]=r,e[36]=I):I=e[36];const T=n-33;let A,R,z,D,F,B,U,O;return e[37]!==r?(A=async S=>{const{ids:$}=S;for(const E of $)await r.delete(E)},R=async S=>{const{id:$,name:E}=S;await r.rename($,E)},z=async S=>{const{dragIds:$,parentId:E}=S;await r.move($,E)},e[37]=r,e[38]=A,e[39]=R,e[40]=z):(A=e[38],R=e[39],z=e[40]),e[41]===Symbol.for("react.memo_cache_sentinel")?(D=S=>{const $=S[0];$&&($.data.isDirectory||d($.data))},e[41]=D):D=e[41],e[42]!==h||e[43]!==f||e[44]!==r?(F=async S=>{if(await r.expand(S)){const $=h[S]??!1;f({...h,[S]:!$})}},e[42]=h,e[43]=f,e[44]=r,e[45]=F):F=e[45],e[46]!==i||e[47]!==h||e[48]!==A||e[49]!==R||e[50]!==z||e[51]!==F||e[52]!==T?(B=c.jsx(PH,{width:"100%",ref:o,height:T,className:"h-full",data:i,initialOpenState:h,openByDefault:!1,renderCursor:mF,disableDrop:pF,onDelete:A,onRename:R,onMove:z,onSelect:D,onToggle:F,padding:15,rowHeight:30,indent:lF,overscanCount:1e3,disableMultiSelection:!0,children:hF}),e[46]=i,e[47]=h,e[48]=A,e[49]=R,e[50]=z,e[51]=F,e[52]=T,e[53]=B):B=e[53],e[54]!==B||e[55]!==r?(U=c.jsx(u3,{value:r,children:B}),e[54]=B,e[55]=r,e[56]=U):U=e[56],e[57]!==U||e[58]!==I?(O=c.jsxs(c.Fragment,{children:[I,U]}),e[57]=U,e[58]=I,e[59]=O):O=e[59],O},lF=15,cF=t=>{const e=K.c(30),{onRefresh:n,onCreateFile:o,onCreateFolder:r,onCollapseAll:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={noDrag:!0,noDragEventsBubbling:!0},e[0]=i):i=e[0];const{getRootProps:a,getInputProps:l}=d3(i);let d,u,h,f,m,_,g,p,b,x,y,v,C,k,N;return e[1]===Symbol.for("react.memo_cache_sentinel")?(d=c.jsx(ya,{size:16}),e[1]=d):d=e[1],e[2]!==o?(u=c.jsx(Te,{content:"Add file",children:c.jsx(Me,{"data-testid":"file-explorer-add-file-button",onClick:o,variant:"text",size:"xs",children:d})}),e[2]=o,e[3]=u):u=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(h=c.jsx(Zc,{size:16}),e[4]=h):h=e[4],e[5]!==r?(f=c.jsx(Te,{content:"Add folder",children:c.jsx(Me,{"data-testid":"file-explorer-add-folder-button",onClick:r,variant:"text",size:"xs",children:h})}),e[5]=r,e[6]=f):f=e[6],e[7]!==a?(m=a({}),e[7]=a,e[8]=m):m=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(_=q$({variant:"text",size:"xs"}),g=c.jsx(Y$,{size:16}),e[9]=_,e[10]=g):(_=e[9],g=e[10]),e[11]!==m?(p=c.jsx(Te,{content:"Upload file",children:c.jsx("button",{"data-testid":"file-explorer-upload-button",...m,className:_,children:g})}),e[11]=m,e[12]=p):p=e[12],e[13]!==l?(b=l({}),e[13]=l,e[14]=b):b=e[14],e[15]!==b?(x=c.jsx("input",{...b,type:"file"}),e[15]=b,e[16]=x):x=e[16],e[17]===Symbol.for("react.memo_cache_sentinel")?(y=c.jsx($4,{size:16}),e[17]=y):y=e[17],e[18]!==n?(v=c.jsx(Te,{content:"Refresh",children:c.jsx(Me,{"data-testid":"file-explorer-refresh-button",onClick:n,variant:"text",size:"xs",children:y})}),e[18]=n,e[19]=v):v=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(C=c.jsx(up,{size:16}),e[20]=C):C=e[20],e[21]!==s?(k=c.jsx(Te,{content:"Collapse all folders",children:c.jsx(Me,{"data-testid":"file-explorer-collapse-button",onClick:s,variant:"text",size:"xs",children:C})}),e[21]=s,e[22]=k):k=e[22],e[23]!==x||e[24]!==v||e[25]!==k||e[26]!==u||e[27]!==f||e[28]!==p?(N=c.jsxs("div",{className:"flex items-center justify-end px-2 flex-shrink-0 border-b",children:[u,f,p,x,v,k]}),e[23]=x,e[24]=v,e[25]=k,e[26]=u,e[27]=f,e[28]=p,e[29]=N):N=e[29],N},dF=t=>{const e=K.c(9),{node:n,onOpenMarimoFile:o}=t;let r,s,i;return e[0]!==n?(r=a=>{n.data.isDirectory||(a.stopPropagation(),n.select())},e[0]=n,e[1]=r):r=e[1],e[2]!==n.data.isMarimoFile||e[3]!==o?(s=n.data.isMarimoFile&&!un()&&c.jsxs("span",{className:"flex-shrink-0 ml-2 text-sm hidden group-hover:inline hover:underline",onClick:o,children:["open ",c.jsx(gc,{className:"inline ml-1",size:12})]}),e[2]=n.data.isMarimoFile,e[3]=o,e[4]=s):s=e[4],e[5]!==n.data.name||e[6]!==r||e[7]!==s?(i=c.jsxs("span",{className:"flex-1 overflow-hidden text-ellipsis",onClick:r,children:[n.data.name,s]}),e[5]=n.data.name,e[6]=r,e[7]=s,e[8]=i):i=e[8],i},uF=t=>{const e=K.c(10),{node:n}=t,o=M.useRef(null);let r,s,i,a,l;return e[0]!==n.data.name?(r=()=>{var d,u;(d=o.current)==null||d.focus(),(u=o.current)==null||u.setSelectionRange(0,n.data.name.lastIndexOf("."))},s=[n.data.name],e[0]=n.data.name,e[1]=r,e[2]=s):(r=e[1],s=e[2]),M.useEffect(r,s),e[3]!==n?(i=()=>n.reset(),a=d=>{d.key==="Escape"&&n.reset(),d.key==="Enter"&&n.submit(d.currentTarget.value)},e[3]=n,e[4]=i,e[5]=a):(i=e[4],a=e[5]),e[6]!==n.data.name||e[7]!==i||e[8]!==a?(l=c.jsx("input",{ref:o,className:"flex-1 bg-transparent border border-border text-muted-foreground",defaultValue:n.data.name,onClick:gF,onBlur:i,onKeyDown:a}),e[6]=n.data.name,e[7]=i,e[8]=a,e[9]=l):l=e[9],l},hF=({node:t,style:e,dragHandle:n})=>{const o=t.data.isDirectory?"directory":u4(t.data.name),r=h4[o],{openConfirm:s,openPrompt:i}=qn(),{createNewCell:a}=Mt(),l=Os(),d=M.use(u3),u=async g=>{h3(g,d?d.relativeFromRoot(t.data.path):t.data.path)},h=async g=>{g.stopPropagation(),g.preventDefault(),s({title:"Delete file",description:`Are you sure you want to delete ${t.data.name}?`,confirmAction:c.jsx(i4,{onClick:async()=>{await t.tree.delete(t.id)},"aria-label":"Confirm",children:"Delete"})})},f=Ke(async()=>{t.open(),i({title:"Folder name",onConfirm:async g=>{d==null||d.createFolder(g,t.id)}})}),m=Ke(async()=>{t.open(),i({title:"File name",onConfirm:async g=>{d==null||d.createFile(g,t.id)}})}),_=Ke(async()=>{var x;if(!d||t.data.isDirectory)return;const[g,p]=G$(t.data.name),b=`${g}_copy${p}`;try{const y=await qm({path:t.data.path}),v=((x=t.parent)==null?void 0:x.data.path)||"";await Gm({path:v,type:"file",name:b,contents:y.contents?btoa(y.contents):void 0}),await d.refreshAll([v])}catch{ct({title:"Failed to duplicate file",description:"Unable to create a duplicate of the file",variant:"danger"})}});return c.jsxs("div",{style:e,ref:n,className:Ne("flex items-center cursor-pointer ml-1 text-muted-foreground whitespace-nowrap group"),draggable:!0,onClick:g=>{g.stopPropagation(),t.data.isDirectory&&t.toggle()},children:[c.jsx(fF,{node:t}),c.jsxs("span",{className:Ne("flex items-center pl-1 py-1 cursor-pointer hover:bg-accent/50 hover:text-accent-foreground rounded-l flex-1 overflow-hidden group",t.willReceiveDrop&&t.data.isDirectory&&"bg-accent/80 hover:bg-accent/80 text-accent-foreground"),children:[t.data.isMarimoFile?c.jsx("img",{src:"./favicon.ico",className:"w-5 h-5 flex-shrink-0 mr-2 filter grayscale",alt:"Marimo"}):c.jsx(r,{className:"w-5 h-5 flex-shrink-0 mr-2",strokeWidth:1.5}),t.isEditing?c.jsx(uF,{node:t}):c.jsx(dF,{node:t,onOpenMarimoFile:u}),c.jsxs(Pr,{modal:!1,children:[c.jsx(Lr,{asChild:!0,tabIndex:-1,onClick:g=>g.stopPropagation(),children:c.jsx(Me,{"data-testid":"file-explorer-more-button",variant:"text",tabIndex:-1,size:"xs",className:"mb-0","aria-label":"More options",children:c.jsx(Xc,{strokeWidth:2,className:"w-5 h-5 hidden group-hover:block"})})}),(()=>{const g={size:14,strokeWidth:1.5,className:"mr-2"};return c.jsxs(Fr,{align:"end",className:"no-print w-[220px]",onClick:p=>p.stopPropagation(),onCloseAutoFocus:p=>p.preventDefault(),children:[!t.data.isDirectory&&c.jsxs(Gt,{onSelect:()=>t.select(),children:[c.jsx(Gp,{...g}),"Open file"]}),!t.data.isDirectory&&!un()&&c.jsxs(Gt,{onSelect:()=>{J$({path:t.data.path})},children:[c.jsx(gc,{...g}),"Open file in external editor"]}),t.data.isDirectory&&c.jsxs(c.Fragment,{children:[c.jsxs(Gt,{onSelect:()=>m(),children:[c.jsx(ya,{...g}),"Create file"]}),c.jsxs(Gt,{onSelect:()=>f(),children:[c.jsx(Zc,{...g}),"Create folder"]}),c.jsx(Cn,{})]}),c.jsxs(Gt,{onSelect:()=>t.edit(),children:[c.jsx(Op,{...g}),"Rename"]}),!t.data.isDirectory&&c.jsxs(Gt,{onSelect:_,children:[c.jsx(qi,{...g}),"Duplicate"]}),c.jsxs(Gt,{onSelect:async()=>{await bn(t.data.path),ct({title:"Copied to clipboard"})},children:[c.jsx(td,{...g}),"Copy path"]}),d&&c.jsxs(Gt,{onSelect:async()=>{await bn(d.relativeFromRoot(t.data.path)),ct({title:"Copied to clipboard"})},children:[c.jsx(td,{...g}),"Copy relative path"]}),c.jsx(Cn,{}),c.jsxs(Gt,{onSelect:()=>{const{path:p}=t.data;(b=>{a({code:b,before:!1,cellId:l??"__end__"})})(vS[o](p))},children:[c.jsx($r,{...g}),"Insert snippet for reading file"]}),c.jsxs(Gt,{onSelect:async()=>{ct({title:"Copied to clipboard",description:"Code to open the file has been copied to your clipboard. You can also drag and drop this file into the editor"});const{path:p}=t.data,b=vS[o](p);await bn(b)},children:[c.jsx(K$,{...g}),"Copy snippet for reading file"]}),t.data.isMarimoFile&&!un()&&c.jsxs(c.Fragment,{children:[c.jsx(Cn,{}),c.jsxs(Gt,{onSelect:u,children:[c.jsx(Vp,{...g}),"Open notebook"]})]}),c.jsx(Cn,{}),!t.data.isDirectory&&c.jsxs(c.Fragment,{children:[c.jsxs(Gt,{onSelect:async()=>{const p=(await qm({path:t.data.path})).contents||"";Qi(new Blob([p]),t.data.name)},children:[c.jsx(ym,{...g}),"Download"]}),c.jsx(Cn,{})]}),c.jsxs(Gt,{onSelect:h,variant:"danger",children:[c.jsx(cm,{...g}),"Delete"]})]})})()]})]})]})},fF=t=>{const e=K.c(3),{node:n}=t;if(!n.data.isDirectory){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=c.jsx("span",{className:"w-5 h-5 flex-shrink-0"}),e[0]=r):r=e[0],r}let o;return e[1]!==n.isOpen?(o=n.isOpen?c.jsx(Tr,{className:"w-5 h-5 flex-shrink-0"}):c.jsx(Yi,{className:"w-5 h-5 flex-shrink-0"}),e[1]=n.isOpen,e[2]=o):o=e[2],o};function h3(t,e){t.stopPropagation(),t.preventDefault(),MS(e)}function mF(){return null}function pF(t){const{parentNode:e}=t;return!e.data.isDirectory}function gF(t){return t.stopPropagation()}let f3,m3,p3;f3=()=>{const t=K.c(20),{ref:e,height:n}=X$(),o=n===void 0?1:n;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={noClick:!0,noKeyboard:!0},t[0]=r):r=t[0];const{getRootProps:s,getInputProps:i,isDragActive:a}=d3(r);let l,d,u,h,f,m,_,g;return t[1]!==s?(l=s(),t[1]=s,t[2]=l):l=t[2],t[3]===Symbol.for("react.memo_cache_sentinel")?(d=Ne("flex flex-col flex-1 overflow-hidden relative"),t[3]=d):d=t[3],t[4]!==i?(u=i(),t[4]=i,t[5]=u):u=t[5],t[6]!==u?(h=c.jsx("input",{...u}),t[6]=u,t[7]=h):h=t[7],t[8]!==a?(f=a&&c.jsx("div",{className:"absolute inset-0 flex items-center uppercase justify-center text-xl font-bold text-primary/90 bg-accent/85 z-10 border-2 border-dashed border-primary/90 rounded-lg pointer-events-none",children:"Drop files here"}),t[8]=a,t[9]=f):f=t[9],t[10]!==o?(m=c.jsx(aF,{height:o}),t[10]=o,t[11]=m):m=t[11],t[12]!==e||t[13]!==m?(_=c.jsx("div",{ref:e,className:"flex flex-col flex-1 overflow-hidden",children:m}),t[12]=e,t[13]=m,t[14]=_):_=t[14],t[15]!==l||t[16]!==h||t[17]!==f||t[18]!==_?(g=c.jsxs("div",{...l,className:d,children:[h,f,_]}),t[15]=l,t[16]=h,t[17]=f,t[18]=_,t[19]=g):g=t[19],g},op=t=>{const e=K.c(6),n=t.dataTestId;let o,r;return e[0]!==t.className?(o=Ne("text-xs font-semibold text-accent-foreground",t.className),e[0]=t.className,e[1]=o):o=e[1],e[2]!==t.dataTestId||e[3]!==t.onClick||e[4]!==o?(r=c.jsx("button",{type:"button","data-testid":n,className:o,onClick:t.onClick,children:"Clear"}),e[2]=t.dataTestId,e[3]=t.onClick,e[4]=o,e[5]=r):r=e[5],r},m3=()=>{const t=K.c(9),e=Z$(),{clearLogs:n}=Mt();if(e.length===0){let i,a;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx("code",{className:"border rounded px-1",children:"stdout"}),t[0]=i):i=t[0],t[1]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(yn,{title:"No logs",description:c.jsxs("span",{children:[i," and"," ",c.jsx("code",{className:"border rounded px-1",children:"stderr"})," logs will appear here."]}),icon:c.jsx(sm,{})}),t[1]=a):a=t[1],a}let o,r,s;return t[2]!==n?(o=c.jsx("div",{className:"flex flex-row justify-end px-2 py-1",children:c.jsx(op,{dataTestId:"clear-logs-button",onClick:n})}),t[2]=n,t[3]=o):o=t[3],t[4]!==e?(r=c.jsx("div",{className:"overflow-auto flex-1",children:c.jsx(p3,{logs:e,className:"min-w-[300px]"})}),t[4]=e,t[5]=r):r=t[5],t[6]!==o||t[7]!==r?(s=c.jsxs(c.Fragment,{children:[o,r]}),t[6]=o,t[7]=r,t[8]=s):s=t[8],s},p3=t=>{const e=K.c(10),{logs:n,className:o}=t;let r,s,i,a,l;return e[0]!==o?(r=Ne("flex flex-col",o),e[0]=o,e[1]=r):r=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(s={whiteSpace:"pre-wrap"},e[2]=s):s=e[2],e[3]!==n?(i=n.map(xF),e[3]=n,e[4]=i):i=e[4],e[5]!==i?(a=c.jsx("pre",{className:"grid text-xs font-mono gap-1 whitespace-break-spaces font-semibold align-left",children:c.jsx("div",{className:"grid grid-cols-[30px,1fr]",style:s,children:i})}),e[5]=i,e[6]=a):a=e[6],e[7]!==r||e[8]!==a?(l=c.jsx("div",{className:r,children:a}),e[7]=r,e[8]=a,e[9]=l):l=e[9],l};function _F(t){const e=Q$(t.timestamp),n=bF[t.level],o=t.level.toUpperCase();return c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"flex-shrink-0 text-[var(--gray-10)] dark:text-[var(--gray-11)]",children:["[",e,"]"]}),c.jsx("span",{className:Ne("flex-shrink-0",n),children:o}),c.jsxs("span",{className:"flex-shrink-0 text-[var(--gray-10)]",children:["(",c.jsx(fr,{cellId:t.cellId}),")"]}),t.message]})}const bF={stdout:"text-[var(--grass-9)]",stderr:"text-[var(--red-9)]"};function xF(t,e){return c.jsxs("div",{className:"contents group",children:[c.jsx("span",{className:Ne("opacity-70 group-hover:bg-[var(--gray-3)] group-hover:opacity-100","text-right col-span-1 py-1 pr-1"),children:e+1}),c.jsx("span",{className:Ne("opacity-70 group-hover:bg-[var(--gray-3)] group-hover:opacity-100","px-2 flex gap-x-1.5 py-1 flex-wrap"),children:_F(t)})]},e)}const yF=()=>{const t=K.c(7),{items:e}=Ue(eH);let n,o;t[0]!==e?(o=nW(e),t[0]=e,t[1]=o):o=t[1],n=o;const r=n,{activeHeaderId:s,activeOccurrences:i}=oW(r);if(e.length===0){let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(yn,{title:"No outline",description:"Add markdown headings to your notebook to create an outline.",icon:c.jsx(sd,{})}),t[2]=l):l=t[2],l}let a;return t[3]!==s||t[4]!==i||t[5]!==e?(a=c.jsx(rW,{items:e,activeHeaderId:s,activeOccurrences:i}),t[3]=s,t[4]=i,t[5]=e,t[6]=a):a=t[6],a},g3=qt(null),_3=t=>{const e=K.c(9),{onClick:n,loading:o,children:r,className:s}=t;if(o){let d;return e[0]===Symbol.for("react.memo_cache_sentinel")?(d=c.jsx(In,{size:"small",className:"h-4 w-4 shrink-0 opacity-50"}),e[0]=d):d=e[0],d}let i,a,l;return e[1]!==s?(i=Ne("px-2 h-full text-xs text-muted-foreground hover:text-foreground","invisible group-hover:visible",s),e[1]=s,e[2]=i):i=e[2],e[3]!==n?(a=Hn.stopPropagation(n),e[3]=n,e[4]=a):a=e[4],e[5]!==r||e[6]!==i||e[7]!==a?(l=c.jsx("button",{type:"button",className:i,onClick:a,children:r}),e[5]=r,e[6]=i,e[7]=a,e[8]=l):l=e[8],l},wF=()=>{var v,C;const t=K.c(27),[e]=Dr(),n=e.package_management.manager,[o,r]=X.useState(null);let s;t[0]!==n?(s=[n],t[0]=n,t[1]=s):s=t[1];const{data:i,error:a,refetch:l,isPending:d}=Gn(CF,s);if(d){let k;return t[2]===Symbol.for("react.memo_cache_sentinel")?(k=c.jsx(In,{size:"medium",centered:!0}),t[2]=k):k=t[2],k}if(a){let k;return t[3]!==a?(k=c.jsx(Br,{error:a}),t[3]=a,t[4]=k):k=t[4],k}const u=i.tree!=null;let h;t[5]!==u||t[6]!==o?(h=function(k,N){return k==="list"?"list":N?k||"tree":"list"}(o,u),t[5]=u,t[6]=o,t[7]=h):h=t[7];const f=h,m=(v=i.tree)==null?void 0:v.name,_=(C=i==null?void 0:i.tree)==null?void 0:C.version,g=m==="<root>";let p,b,x,y;return t[8]!==n||t[9]!==l?(p=c.jsx(vF,{packageManager:n,onSuccess:l}),t[8]=n,t[9]=l,t[10]=p):p=t[10],t[11]!==g||t[12]!==u||t[13]!==m||t[14]!==_||t[15]!==f?(b=u&&c.jsxs("div",{className:"flex items-center justify-between px-2 py-1 border-b",children:[c.jsxs("div",{className:"flex gap-1",children:[c.jsx("button",{type:"button",className:Ne("px-2 py-1 text-xs rounded",f==="list"?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground"),onClick:()=>r("list"),children:"List"}),c.jsx("button",{type:"button",className:Ne("px-2 py-1 text-xs rounded",f==="tree"?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground"),onClick:()=>r("tree"),children:"Tree"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"items-center border px-2 py-0.5 text-xs transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium",title:g?"sandbox":"project",children:g?"sandbox":"project"}),m&&!g&&c.jsxs("span",{className:"text-xs text-muted-foreground",children:[m,_&&` v${_}`]})]})]}),t[11]=g,t[12]=u,t[13]=m,t[14]=_,t[15]=f,t[16]=b):b=t[16],t[17]!==i.list||t[18]!==i.tree||t[19]!==a||t[20]!==l||t[21]!==f?(x=f==="list"?c.jsx(kF,{packages:i.list,onSuccess:l}):c.jsx(SF,{tree:i.tree,error:a,onSuccess:l}),t[17]=i.list,t[18]=i.tree,t[19]=a,t[20]=l,t[21]=f,t[22]=x):x=t[22],t[23]!==p||t[24]!==b||t[25]!==x?(y=c.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[p,b,x]}),t[23]=p,t[24]=b,t[25]=x,t[26]=y):y=t[26],y},vF=t=>{const e=K.c(40),{onSuccess:n,packageManager:o}=t,[r,s]=X.useState(""),{handleClick:i}=ma(),a=Ue(g3),l=Zt(g3);let d,u;e[0]!==a||e[1]!==l?(d=()=>{a&&(s(a),l(null))},u=[a,l],e[0]=a,e[1]=l,e[2]=d,e[3]=u):(d=e[2],u=e[3]),X.useEffect(d,u);const{loading:h,handleInstallPackages:f}=oH();let m;e[4]!==n?(m=()=>{n(),s("")},e[4]=n,e[5]=m):m=e[5];const _=m;let g;e[6]!==f||e[7]!==r||e[8]!==_?(g=()=>{f(r.split(",").map(NF),_)},e[6]=f,e[7]=r,e[8]=_,e[9]=g):g=e[9];const p=g,b=`Install packages with ${o}...`;let x,y,v,C,k,N,j,I,T,A,R,z,D,F;e[10]!==h||e[11]!==i?(x=h?c.jsx(In,{size:"small",className:"mr-2 h-4 w-4 shrink-0 opacity-50"}):c.jsx(Te,{content:"Change package manager",children:c.jsx(qs,{onClick:()=>i("packageManagement"),className:"mr-2 h-4 w-4 shrink-0 opacity-50 hover:opacity-80 cursor-pointer"})}),e[10]=h,e[11]=i,e[12]=x):x=e[12],e[13]!==p?(y=E=>{E.key==="Enter"&&(E.preventDefault(),p())},e[13]=p,e[14]=y):y=e[14],e[15]===Symbol.for("react.memo_cache_sentinel")?(v=E=>s(E.target.value),e[15]=v):v=e[15],e[16]!==r||e[17]!==b||e[18]!==x||e[19]!==y?(C=c.jsx(kS,{placeholder:b,id:j1,icon:x,rootClassName:"flex-1 border-none",value:r,onKeyDown:y,onChange:v}),e[16]=r,e[17]=b,e[18]=x,e[19]=y,e[20]=C):C=e[20],e[21]===Symbol.for("react.memo_cache_sentinel")?(k=c.jsx("span",{className:"font-bold tracking-wide",children:"Package name:"}),e[21]=k):k=e[21],e[22]===Symbol.for("react.memo_cache_sentinel")?(N=c.jsxs("div",{children:[k," A package name; this will install the latest version.",c.jsx("div",{className:"text-muted-foreground",children:"Example: httpx"})]}),j=c.jsx("span",{className:"font-bold tracking-wide",children:"Package and version:"}),e[22]=N,e[23]=j):(N=e[22],j=e[23]),e[24]===Symbol.for("react.memo_cache_sentinel")?(I=c.jsxs("div",{children:[j," ","A package with a specific version or version range.",c.jsx("div",{className:"text-muted-foreground",children:"Examples: httpx==0.27.0, httpx>=0.27.0"})]}),T=c.jsx("span",{className:"font-bold tracking-wide",children:"Git:"}),e[24]=I,e[25]=T):(I=e[24],T=e[25]),e[26]===Symbol.for("react.memo_cache_sentinel")?(A=c.jsxs("div",{children:[T," A Git repository",c.jsx("div",{className:"text-muted-foreground",children:"Example: git+https://github.com/encode/httpx"})]}),R=c.jsx("span",{className:"font-bold tracking-wide",children:"URL:"}),e[26]=A,e[27]=R):(A=e[26],R=e[27]),e[28]===Symbol.for("react.memo_cache_sentinel")?(z=c.jsxs("div",{children:[R," A remote wheel or source distribution.",c.jsx("div",{className:"text-muted-foreground",children:"Example: https://example.com/httpx-0.27.0.tar.gz"})]}),D=c.jsx("span",{className:"font-bold tracking-wide",children:"Path:"}),e[28]=z,e[29]=D):(z=e[28],D=e[29]),e[30]===Symbol.for("react.memo_cache_sentinel")?(F=c.jsx(Te,{delayDuration:300,side:"left",align:"start",content:c.jsxs("div",{className:"text-sm flex flex-col w-full max-w-[360px]",children:["Packages are installed using the package manager specified in your user configuration. Depending on your package manager, you can install packages with various formats:",c.jsxs("div",{className:"flex flex-col gap-2 mt-2",children:[N,I,A,z,c.jsxs("div",{children:[D," A local wheel, source distribution, or project directory.",c.jsx("div",{className:"text-muted-foreground",children:"Example: /example/foo-0.1.0-py3-none-any.whl"})]})]})]}),children:c.jsx(Um,{className:"h-4 w-4 cursor-help text-muted-foreground hover:text-foreground bg-transparent"})}),e[30]=F):F=e[30];const B=r&&"bg-accent text-accent-foreground";let U;e[31]!==B?(U=Ne("float-right px-2 m-0 h-full text-sm text-secondary-foreground ml-2",B,"disabled:cursor-not-allowed disabled:opacity-50"),e[31]=B,e[32]=U):U=e[32];const O=!r;let S,$;return e[33]!==p||e[34]!==U||e[35]!==O?(S=c.jsx("button",{type:"button",className:U,onClick:p,disabled:O,children:"Add"}),e[33]=p,e[34]=U,e[35]=O,e[36]=S):S=e[36],e[37]!==S||e[38]!==C?($=c.jsxs("div",{className:"flex items-center w-full border-b",children:[C,F,S]}),e[37]=S,e[38]=C,e[39]=$):$=e[39],$},kF=t=>{const e=K.c(9),{onSuccess:n,packages:o}=t;if(o.length===0){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(yn,{title:"No packages",description:"No packages are installed in this environment.",icon:c.jsx(qs,{})}),e[0]=a):a=e[0],a}let r,s,i;if(e[1]===Symbol.for("react.memo_cache_sentinel")?(r=c.jsx(Ym,{children:c.jsxs(Ws,{children:[c.jsx(Ur,{children:"Name"}),c.jsx(Ur,{children:"Version"}),c.jsx(Ur,{})]})}),e[1]=r):r=e[1],e[2]!==n||e[3]!==o){let a;e[5]!==n?(a=l=>c.jsxs(Ws,{className:"group",onClick:async()=>{await bn(`${l.name}==${l.version}`),ct({title:"Copied to clipboard"})},children:[c.jsx(Vr,{children:l.name}),c.jsx(Vr,{children:l.version}),c.jsxs(Vr,{className:"flex justify-end",children:[c.jsx(b3,{packageName:l.name,onSuccess:n}),c.jsx(x3,{packageName:l.name,onSuccess:n})]})]},l.name),e[5]=n,e[6]=a):a=e[6],s=o.map(a),e[2]=n,e[3]=o,e[4]=s}else s=e[4];return e[7]!==s?(i=c.jsxs(Jm,{className:"overflow-auto flex-1",children:[r,c.jsx(Km,{children:s})]}),e[7]=s,e[8]=i):i=e[8],i},b3=({packageName:t,onSuccess:e})=>{const[n,o]=X.useState(!1);return un()?null:c.jsx(_3,{onClick:async()=>{try{o(!0);const r=await rH({package:t,upgrade:!0});r.success?(e(),SS(t)):SS(t,r.error)}finally{o(!1)}},loading:n,children:"Upgrade"})},x3=({packageName:t,onSuccess:e})=>{const[n,o]=X.useState(!1);return c.jsx(_3,{onClick:async()=>{try{o(!0);const r=await sH({package:t});r.success?(e(),CS(t)):CS(t,r.error)}finally{o(!1)}},loading:n,children:"Remove"})},SF=t=>{const e=K.c(18),{tree:n,error:o,onSuccess:r}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=new Set,e[0]=s):s=e[0];const[i,a]=X.useState(s);let l,d,u;if(e[1]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{a(new Set)},e[1]=l):l=e[1],e[2]!==n?(d=[n],e[2]=n,e[3]=d):d=e[3],X.useEffect(l,d),o){let _;return e[4]!==o?(_=c.jsx(Br,{error:o}),e[4]=o,e[5]=_):_=e[5],_}if(!n){let _;return e[6]===Symbol.for("react.memo_cache_sentinel")?(_=c.jsx(In,{size:"medium",centered:!0}),e[6]=_):_=e[6],_}if(n.dependencies.length===0){let _;return e[7]===Symbol.for("react.memo_cache_sentinel")?(_=c.jsx(yn,{title:"No dependencies",description:"No package dependencies found in this environment.",icon:c.jsx(qs,{})}),e[7]=_):_=e[7],_}e[8]===Symbol.for("react.memo_cache_sentinel")?(u=_=>{a(g=>{const p=new Set(g);return p.has(_)?p.delete(_):p.add(_),p})},e[8]=u):u=e[8];const h=u;let f,m;if(e[9]!==i||e[10]!==r||e[11]!==n.dependencies){let _;e[13]!==i||e[14]!==r?(_=(g,p)=>c.jsx("div",{className:"border-b",children:c.jsx(y3,{nodeId:`root-${p}`,node:g,level:0,isTopLevel:!0,expandedNodes:i,onToggle:h,onSuccess:r})},`${g.name}-${p}`),e[13]=i,e[14]=r,e[15]=_):_=e[15],f=n.dependencies.map(_),e[9]=i,e[10]=r,e[11]=n.dependencies,e[12]=f}else f=e[12];return e[16]!==f?(m=c.jsx("div",{className:"flex-1 overflow-auto",children:c.jsx("div",{children:f})}),e[16]=f,e[17]=m):m=e[17],m},y3=t=>{const e=K.c(57),{nodeId:n,node:o,level:r,isTopLevel:s,expandedNodes:i,onToggle:a,onSuccess:l}=t,d=s!==void 0&&s,u=o.dependencies.length>0;let h;e[0]!==i||e[1]!==n?(h=i.has(n),e[0]=i,e[1]=n,e[2]=h):h=e[2];const f=h,m=d?0:16+16*r;let _;e[3]!==u||e[4]!==n||e[5]!==a?(_=U=>{U.key!=="Enter"&&U.key!==" "||(U.preventDefault(),u&&a(n))},e[3]=u,e[4]=n,e[5]=a,e[6]=_):_=e[6];const g=_;let p;e[7]!==u||e[8]!==n||e[9]!==a?(p=U=>{U.stopPropagation(),u&&a(n)},e[7]=u,e[8]=n,e[9]=a,e[10]=p):p=e[10];const b=p,x=u&&"select-none",y=d?"px-2 py-0.5":"";let v,C;e[11]!==x||e[12]!==y?(v=Ne("flex items-center group cursor-pointer text-sm whitespace-nowrap","hover:bg-[var(--slate-2)] focus:bg-[var(--slate-2)] focus:outline-none",x,y),e[11]=x,e[12]=y,e[13]=v):v=e[13],e[14]!==m||e[15]!==d?(C=d?{}:{paddingLeft:`${m}px`},e[14]=m,e[15]=d,e[16]=C):C=e[16];const k=u?f:void 0;let N,j,I,T,A,R,z,D,F,B;return e[17]!==u||e[18]!==f?(N=u?f?c.jsx(Tr,{className:"w-4 h-4 mr-2 flex-shrink-0"}):c.jsx(Yi,{className:"w-4 h-4 mr-2 flex-shrink-0"}):c.jsx("div",{className:"w-4 mr-2 flex-shrink-0"}),e[17]=u,e[18]=f,e[19]=N):N=e[19],e[20]!==o.name?(j=c.jsx("span",{className:"font-medium truncate",children:o.name}),e[20]=o.name,e[21]=j):j=e[21],e[22]!==o.version?(I=o.version&&c.jsxs("span",{className:"text-muted-foreground text-xs",children:["v",o.version]}),e[22]=o.version,e[23]=I):I=e[23],e[24]!==j||e[25]!==I?(T=c.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0 py-1.5",children:[j,I]}),e[24]=j,e[25]=I,e[26]=T):T=e[26],e[27]!==o.tags?(A=o.tags.map(jF),e[27]=o.tags,e[28]=A):A=e[28],e[29]!==A?(R=c.jsx("div",{className:"flex items-center gap-1 ml-2",children:A}),e[29]=A,e[30]=R):R=e[30],e[31]!==d||e[32]!==o.name||e[33]!==l?(z=d&&c.jsxs("div",{className:"flex gap-1 invisible group-hover:visible",children:[c.jsx(b3,{packageName:o.name,onSuccess:l}),c.jsx(x3,{packageName:o.name,onSuccess:l})]}),e[31]=d,e[32]=o.name,e[33]=l,e[34]=z):z=e[34],e[35]!==b||e[36]!==g||e[37]!==N||e[38]!==T||e[39]!==R||e[40]!==z||e[41]!==v||e[42]!==C||e[43]!==k?(D=c.jsxs("div",{className:v,style:C,onClick:b,onKeyDown:g,tabIndex:0,role:"treeitem","aria-selected":!1,"aria-expanded":k,children:[N,T,R,z]}),e[35]=b,e[36]=g,e[37]=N,e[38]=T,e[39]=R,e[40]=z,e[41]=v,e[42]=C,e[43]=k,e[44]=D):D=e[44],e[45]!==i||e[46]!==u||e[47]!==f||e[48]!==r||e[49]!==o.dependencies||e[50]!==n||e[51]!==l||e[52]!==a?(F=u&&f&&c.jsx("div",{role:"group",children:o.dependencies.map((U,O)=>c.jsx(y3,{nodeId:`${n}-${O}`,node:U,level:r+1,isTopLevel:!1,expandedNodes:i,onToggle:a,onSuccess:l},`${U.name}-${O}`))}),e[45]=i,e[46]=u,e[47]=f,e[48]=r,e[49]=o.dependencies,e[50]=n,e[51]=l,e[52]=a,e[53]=F):F=e[53],e[54]!==D||e[55]!==F?(B=c.jsxs("div",{children:[D,F]}),e[54]=D,e[55]=F,e[56]=B):B=e[56],B};async function CF(){const[t,e]=await Promise.all([tH(),nH()]);return{list:t.packages,tree:e.tree}}function NF(t){return t.trim()}function jF(t,e){return t.kind==="cycle"?c.jsx("div",{className:"items-center border px-2 py-0.5 text-xs transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium border-orange-300 dark:border-orange-700 text-orange-700 dark:text-orange-300",title:"cycle",children:"cycle"},e):t.kind==="extra"?c.jsx("div",{className:"items-center border px-2 py-0.5 text-xs transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium border-blue-300 dark:border-blue-700 text-blue-700 dark:text-blue-300",title:t.value,children:t.value},e):t.kind==="group"?c.jsx("div",{className:"items-center border px-2 py-0.5 text-xs transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium border-green-300 dark:border-green-700 text-green-700 dark:text-green-300",title:t.value,children:t.value},e):null}const Qf=z3("marimo:scratchpadHistory:v1",[]),EF=qt(!1),IF=qt(null,(t,e,n)=>{if(!(n=n.trim()))return;const o=t(Qf),r=[n,...o.filter(s=>s!==n)].slice(0,15);e(Qf,r)}),AF={hide_code:!1,disabled:!1},TF=()=>{const t=K.c(69),e=yc(),[n]=Dr(),{theme:o}=hr(),r=M.useRef(null),s=Os(),{createNewCell:i,updateCellCode:a}=Mt(),l=e.cellRuntime[mr],d=l==null?void 0:l.output,u=l==null?void 0:l.status,h=l==null?void 0:l.consoleOutputs,f=e.cellData[mr],m=(f==null?void 0:f.code)??"",_=Zt(IF),[g,p]=on(EF),b=Ue(Qf);let x;t[0]!==_||t[1]!==m?(x=()=>{NS({code:m}),_(m)},t[0]=_,t[1]=m,t[2]=x):x=t[2];const y=Ke(x);let v;t[3]!==m||t[4]!==i||t[5]!==s?(v=()=>{m.trim()&&i({code:m,before:!1,cellId:s??"__end__"})},t[3]=m,t[4]=i,t[5]=s,t[6]=v):v=t[6];const C=Ke(v);let k;t[7]!==a?(k=()=>{a({cellId:mr,code:"",formattingChange:!1}),NS({code:""});const ie=r.current;ie&&ie.dispatch({changes:{from:0,to:ie.state.doc.length,insert:""}})},t[7]=a,t[8]=k):k=t[8];const N=Ke(k);let j;t[9]!==p||t[10]!==a?(j=ie=>{p(!1),a({cellId:mr,code:ie,formattingChange:!1});const je=r.current;je&&je.dispatch({changes:{from:0,to:je.state.doc.length,insert:ie}})},t[9]=p,t[10]=a,t[11]=j):j=t[11];const I=Ke(j),[T,A]=M.useState();let R;t[12]!==m||t[13]!==h||t[14]!==y||t[15]!==T||t[16]!==d||t[17]!==o||t[18]!==n?(R=()=>c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"overflow-auto flex-shrink-0 max-h-[40%]",children:c.jsx(qu,{theme:o,showPlaceholder:!1,id:mr,code:m,config:AF,status:"idle",serializedEditorState:null,runCell:y,userConfig:n,editorViewRef:r,setEditorView:ie=>{r.current=ie},hidden:!1,temporarilyShowCode:Sn.NOOP,languageAdapter:T,setLanguageAdapter:A})}),c.jsx("div",{className:"flex-1 overflow-auto flex-shrink-0",children:c.jsx(Fc,{allowExpand:!1,output:d,className:"output-area",cellId:mr,stale:!1,loading:!1})}),c.jsx("div",{className:"overflow-auto flex-shrink-0 max-h-[35%]",children:c.jsx(ep,{consoleOutputs:h,className:"overflow-auto",stale:!1,cellName:B3,onSubmitDebugger:Sn.NOOP,cellId:mr,debuggerActive:!1})})]}),t[12]=m,t[13]=h,t[14]=y,t[15]=T,t[16]=d,t[17]=o,t[18]=n,t[19]=R):R=t[19];const z=R;let D;t[20]!==I||t[21]!==b||t[22]!==g||t[23]!==o?(D=()=>g?c.jsx("div",{className:"absolute inset-0 z-100 bg-background p-3 border-none overflow-auto",children:c.jsx("div",{className:"overflow-auto flex flex-col gap-3",children:b.map((ie,je)=>c.jsx("div",{className:"border rounded-md hover:shadow-sm cursor-pointer hover:border-input overflow-hidden",onClick:()=>I(ie),children:c.jsx(M.Suspense,{children:c.jsx(ha,{language:"python",theme:o,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1},value:ie.trim(),editable:!1,readOnly:!0})})},je))})}):null,t[20]=I,t[21]=b,t[22]=g,t[23]=o,t[24]=D):D=t[24];const F=D;let B,U,O,S,$,E,W,G,q,Y,te;t[25]===Symbol.for("react.memo_cache_sentinel")?(B=As.create(mr),U=c.jsx("p",{className:"mx-2 my-2 text-muted-foreground text-sm",children:"Use this scratchpad cell to experiment with code without restrictions on variable names. Scratchpad code is ephemeral: variables defined in the scratchpad aren't saved to notebook memory, and the code is not saved in the notebook file."}),t[25]=B,t[26]=U):(B=t[25],U=t[26]),t[27]===Symbol.for("react.memo_cache_sentinel")?(O=rn("cell.run"),t[27]=O):O=t[27],t[28]===Symbol.for("react.memo_cache_sentinel")?(S=c.jsx(Gs,{color:"var(--grass-11)",size:16}),t[28]=S):S=t[28],t[29]!==y||t[30]!==g?($=c.jsx(Te,{content:O,children:c.jsx(Me,{"data-testid":"scratchpad-run-button",onClick:y,disabled:g,variant:"text",size:"xs",children:S})}),t[29]=y,t[30]=g,t[31]=$):$=t[31],t[32]===Symbol.for("react.memo_cache_sentinel")?(E=c.jsx(fp,{size:16}),t[32]=E):E=t[32],t[33]!==N||t[34]!==g?(W=c.jsx(Te,{content:"Clear code and outputs",children:c.jsx(Me,{disabled:g,size:"xs",variant:"text",onClick:N,children:E})}),t[33]=N,t[34]=g,t[35]=W):W=t[35],t[36]===Symbol.for("react.memo_cache_sentinel")?(G=c.jsx($r,{size:16}),t[36]=G):G=t[36],t[37]!==C||t[38]!==g?(q=c.jsx(Xs,{children:c.jsx(Te,{content:"Insert code",children:c.jsx(Me,{disabled:g,size:"xs",variant:"text",onClick:C,children:G})})}),t[37]=C,t[38]=g,t[39]=q):q=t[39],t[40]!==u?(Y=(u==="running"||u==="queued")&&c.jsx(In,{className:"inline",size:"small"}),t[40]=u,t[41]=Y):Y=t[41],t[42]===Symbol.for("react.memo_cache_sentinel")?(te=c.jsx("div",{className:"flex-1"}),t[42]=te):te=t[42];const oe=g&&"bg-[var(--sky-3)] rounded-none";let se,Z;t[43]!==oe?(se=Ne(oe),t[43]=oe,t[44]=se):se=t[44],t[45]!==g||t[46]!==p?(Z=()=>p(!g),t[45]=g,t[46]=p,t[47]=Z):Z=t[47];const Q=b.length===0;let ue,me,ce,fe,de,ke,Se;return t[48]===Symbol.for("react.memo_cache_sentinel")?(ue=c.jsx(yp,{size:16}),t[48]=ue):ue=t[48],t[49]!==se||t[50]!==Z||t[51]!==Q?(me=c.jsx(Te,{content:"Toggle history",children:c.jsx(Me,{size:"xs",variant:"text",className:se,onClick:Z,disabled:Q,children:ue})}),t[49]=se,t[50]=Z,t[51]=Q,t[52]=me):me=t[52],t[53]!==$||t[54]!==W||t[55]!==q||t[56]!==Y||t[57]!==me?(ce=c.jsxs("div",{className:"flex items-center flex-shrink-0",children:[$,W,q,Y,te,me]}),t[53]=$,t[54]=W,t[55]=q,t[56]=Y,t[57]=me,t[58]=ce):ce=t[58],t[59]!==z?(fe=z(),t[59]=z,t[60]=fe):fe=t[60],t[61]!==F?(de=F(),t[61]=F,t[62]=de):de=t[62],t[63]!==fe||t[64]!==de?(ke=c.jsxs("div",{className:"flex-1 divide-y relative overflow-hidden flex flex-col",children:[fe,de]}),t[63]=fe,t[64]=de,t[65]=ke):ke=t[65],t[66]!==ce||t[67]!==ke?(Se=c.jsxs("div",{className:"flex flex-col h-full overflow-hidden divide-y",id:B,children:[U,ce,ke]}),t[66]=ce,t[67]=ke,t[68]=Se):Se=t[68],Se},MF=()=>{const t=K.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx(TF,{}),t[0]=e):e=t[0],e},OF=()=>{const t=K.c(23),{openModal:e,closeModal:n}=qn();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],t[0]=o):o=t[0];const{data:r,isPending:s,error:i,refetch:a}=Gn(RF,o);if(s){let b;return t[1]===Symbol.for("react.memo_cache_sentinel")?(b=c.jsx(In,{size:"medium",centered:!0}),t[1]=b):b=t[1],b}if(i){let b;return t[2]!==i?(b=c.jsx(Br,{error:i}),t[2]=i,t[3]=b):b=t[3],b}let l;t[4]!==r?(l=r.filter(PF).map(LF),t[4]=r,t[5]=l):l=t[5];const d=l;if(r.length===0){let b;return t[6]===Symbol.for("react.memo_cache_sentinel")?(b=c.jsx(yn,{title:"No environment variables",description:"No environment variables are available in this notebook.",icon:c.jsx(Qc,{})}),t[6]=b):b=t[6],b}let u,h,f,m,_,g,p;return t[7]!==n||t[8]!==e||t[9]!==d||t[10]!==a?(u=()=>e(c.jsx(wg,{providerNames:d,onSuccess:()=>{a(),n()},onClose:n})),t[7]=n,t[8]=e,t[9]=d,t[10]=a,t[11]=u):u=t[11],t[12]===Symbol.for("react.memo_cache_sentinel")?(h=c.jsx(ur,{className:"h-4 w-4"}),t[12]=h):h=t[12],t[13]!==u?(f=c.jsx("div",{className:"flex justify-end h-8 border-b",children:c.jsx("button",{type:"button",className:"float-right border-l px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",onClick:u,children:h})}),t[13]=u,t[14]=f):f=t[14],t[15]===Symbol.for("react.memo_cache_sentinel")?(m=c.jsx(Ym,{children:c.jsxs(Ws,{children:[c.jsx(Ur,{children:"Environment Variable"}),c.jsx(Ur,{children:"Source"}),c.jsx(Ur,{})]})}),t[15]=m):m=t[15],t[16]!==r?(_=r.map(FF),t[16]=r,t[17]=_):_=t[17],t[18]!==_?(g=c.jsxs(Jm,{className:"overflow-auto flex-1 mb-16",children:[m,c.jsx(Km,{children:_})]}),t[18]=_,t[19]=g):g=t[19],t[20]!==f||t[21]!==g?(p=c.jsxs("div",{className:"flex flex-col h-full",children:[f,g]}),t[20]=f,t[21]=g,t[22]=p):p=t[22],p},DF=t=>{const e=K.c(9),{className:n,ariaLabel:o,onCopy:r}=t,[s,i]=X.useState(!1);let a;e[0]!==r?(a=()=>{r(),i(!0),setTimeout(()=>i(!1),1e3)},e[0]=r,e[1]=a):a=e[1];const l=a;let d,u;return e[2]!==s?(d=s?c.jsx(pc,{className:"w-3 h-3 text-green-700 rounded"}):c.jsx(qi,{className:"w-3 h-3 hover:bg-muted rounded"}),e[2]=s,e[3]=d):d=e[3],e[4]!==o||e[5]!==n||e[6]!==l||e[7]!==d?(u=c.jsx("button",{type:"button",className:n,onClick:l,"aria-label":o,children:d}),e[4]=o,e[5]=n,e[6]=l,e[7]=d,e[8]=u):u=e[8],u};async function RF(){return yg((await zS.request({})).secrets)}function PF(t){return t.provider!=="env"}function LF(t){return t.name}function FF(t){return t.keys.map(e=>c.jsxs(Ws,{className:"group",children:[c.jsx(Vr,{children:e}),c.jsx(Vr,{children:t.provider!=="env"&&c.jsx(lS,{variant:"outline",className:"select-none",children:t.name})}),c.jsx(Vr,{children:c.jsx(DF,{ariaLabel:`Copy ${e}`,onCopy:async()=>{await bn(`os.environ["${e}"]`),ct({title:"Copied to clipboard",description:`os.environ["${e}"] has been copied to your clipboard.`})},className:Ne("float-right px-2 h-full text-xs text-muted-foreground hover:text-foreground","invisible group-hover:visible")})})]},`${t.name}-${e}`))}const zF=t=>{const e=K.c(6),{children:n}=t,{openModal:o,closeModal:r}=qn();let s,i;return e[0]!==r||e[1]!==o?(s=()=>o(c.jsx(UF,{onClose:r})),e[0]=r,e[1]=o,e[2]=s):s=e[2],e[3]!==n||e[4]!==s?(i=c.jsx(eS,{onClick:s,children:n}),e[3]=n,e[4]=s,e[5]=i):i=e[5],i},BF=[et.lineWrapping],UF=t=>{const e=K.c(23),{onClose:n}=t,[o,r]=M.useState(""),{theme:s}=hr();let i,a,l,d,u,h;e[0]!==n?(i=async y=>{y.preventDefault();const v=new FormData(y.target),C=v.get("title"),k=v.get("description"),N=v.get("code");fetch("https://marimo.io/api/suggest-snippet",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:C,description:k,code:N})}),n(),ct({title:"Snippet Submitted",description:"Thank you for contributing! We will review your snippet shortly."})},e[0]=n,e[1]=i):i=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(rr,{children:"Contribute a Snippet"}),e[2]=a):a=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsxs(Es,{children:[a,c.jsxs(Is,{children:["Have a useful snippet you want to share with the community? Submit it here or make a pull request"," ",c.jsx("a",{href:Qn.githubPage,target:"_blank",className:"underline",children:"on GitHub"}),"."]})]}),e[3]=l):l=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(d=c.jsx(sr,{id:"title",name:"title",autoFocus:!0,placeholder:"Title",required:!0,autoComplete:"off"}),u=c.jsx(iH,{id:"description",name:"description",autoFocus:!0,placeholder:"Description",rows:5,required:!0,autoComplete:"off"}),e[4]=d,e[5]=u):(d=e[4],u=e[5]),e[6]!==o?(h=c.jsx("input",{type:"hidden",name:"code",value:o}),e[6]=o,e[7]=h):h=e[7];const f=s==="dark"?"dark":"light";let m,_,g,p,b,x;return e[8]!==o||e[9]!==f?(m=c.jsx(ha,{theme:f,language:"python",className:"cm border rounded overflow-hidden",extensions:BF,value:o,onChange:r}),e[8]=o,e[9]=f,e[10]=m):m=e[10],e[11]!==h||e[12]!==m?(_=c.jsxs("div",{className:"flex flex-col gap-6 py-4",children:[d,u,h,m]}),e[11]=h,e[12]=m,e[13]=_):_=e[13],e[14]!==n?(g=c.jsx(Me,{"data-testid":"snippet-cancel-button",variant:"secondary",onClick:n,children:"Cancel"}),e[14]=n,e[15]=g):g=e[15],e[16]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx(Me,{"data-testid":"snippet-send-button","aria-label":"Save",variant:"default",type:"submit",children:"Send"}),e[16]=p):p=e[16],e[17]!==g?(b=c.jsxs(Wi,{children:[g,p]}),e[17]=g,e[18]=b):b=e[18],e[19]!==i||e[20]!==b||e[21]!==_?(x=c.jsx(ir,{className:"w-fit",children:c.jsxs("form",{onSubmit:i,children:[l,_,b]})}),e[19]=i,e[20]=b,e[21]=_,e[22]=x):x=e[22],x},VF=[et.lineWrapping],$F=()=>{const t=K.c(20),[e,n]=X.useState();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],t[0]=o):o=t[0];const{data:r,error:s,isPending:i}=Gn(qF,o);if(s){let b;return t[1]!==s?(b=c.jsx(Br,{error:s}),t[1]=s,t[2]=b):b=t[2],b}if(i||!r){let b;return t[3]===Symbol.for("react.memo_cache_sentinel")?(b=c.jsx(In,{size:"medium",centered:!0}),t[3]=b):b=t[3],b}const a=e?"h-1/3":"h-full";let l,d,u,h,f,m,_,g,p;return t[4]!==a?(l=Ne("border-b rounded-none",a),t[4]=a,t[5]=l):l=t[5],t[6]===Symbol.for("react.memo_cache_sentinel")?(d=c.jsx(Ji,{placeholder:"Search snippets...",className:"h-6 m-1",rootClassName:"flex-1 border-r"}),t[6]=d):d=t[6],t[7]===Symbol.for("react.memo_cache_sentinel")?(u=c.jsxs("div",{className:"flex items-center w-full",children:[d,c.jsx(zF,{children:c.jsx("button",{className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:c.jsx(ur,{className:"h-4 w-4"})})})]}),h=c.jsx(ic,{children:"No results"}),t[7]=u,t[8]=h):(u=t[7],h=t[8]),t[9]===Symbol.for("react.memo_cache_sentinel")?(f=b=>n(b),t[9]=f):f=t[9],t[10]!==r.snippets?(m=c.jsx(WF,{onSelect:f,snippets:r.snippets}),t[10]=r.snippets,t[11]=m):m=t[11],t[12]!==l||t[13]!==m?(_=c.jsxs(bc,{className:l,children:[u,h,m]}),t[12]=l,t[13]=m,t[14]=_):_=t[14],t[15]!==e?(g=c.jsx(M.Suspense,{children:c.jsx("div",{className:"h-2/3 snippet-viewer flex flex-col",children:e?c.jsx(HF,{snippet:e},e.title):c.jsx(yn,{title:"",description:"Click on a snippet to view its content."})})}),t[15]=e,t[16]=g):g=t[16],t[17]!==_||t[18]!==g?(p=c.jsxs("div",{className:"flex-1 overflow-hidden",children:[_,g]}),t[17]=_,t[18]=g,t[19]=p):p=t[19],p},HF=t=>{const e=K.c(27),{snippet:n}=t,{theme:o}=hr(),{createNewCell:r}=Mt(),s=Os();let i;e[0]!==r||e[1]!==s||e[2]!==n.sections?(i=()=>{for(const p of[...n.sections].reverse())p.code&&r({code:p.code,before:!1,cellId:s??"__end__",skipIfCodeExists:!0})},e[0]=r,e[1]=s,e[2]=n.sections,e[3]=i):i=e[3];const a=i;let l;e[4]!==r||e[5]!==s?(l=p=>{r({code:p,before:!1,cellId:s??"__end__"})},e[4]=r,e[5]=s,e[6]=l):l=e[6];const d=l;let u,h,f,m,_,g;if(e[7]!==n.title?(u=c.jsx("div",{className:"text-sm font-semibold bg-muted border-y px-2 py-1",children:n.title}),e[7]=n.title,e[8]=u):u=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(h=c.jsx($r,{className:"ml-2 h-4 w-4"}),e[9]=h):h=e[9],e[10]!==a?(f=c.jsx("div",{className:"flex justify-end",children:c.jsx(Xs,{children:c.jsxs(Me,{className:"float-right",size:"xs",variant:"outline",onClick:a,children:["Insert snippet",h]})})}),e[10]=a,e[11]=f):f=e[11],e[12]!==d||e[13]!==n.sections||e[14]!==n.title||e[15]!==o){let p;e[17]!==d||e[18]!==n.title||e[19]!==o?(p=b=>{const{code:x,html:y,id:v}=b;return y?c.jsx("div",{children:Hm({html:y})},`${n.title}-${v}`):x?c.jsxs("div",{className:"relative hover-actions-parent pr-2",children:[c.jsx(Xs,{children:c.jsx(Te,{content:"Insert snippet",children:c.jsx(Me,{className:"absolute -top-2 -right-1 z-10 hover-action px-2 bg-background",size:"sm",variant:"outline",onClick:()=>{d(x)},children:c.jsx($r,{className:"h-5 w-5"})})})}),c.jsx(M.Suspense,{children:c.jsx(ha,{theme:o==="dark"?"dark":"light",language:"python",className:"cm border rounded overflow-hidden",extensions:VF,value:x,readOnly:!0},`${n.title}-${v}`)})]},`${n.title}-${v}`):null},e[17]=d,e[18]=n.title,e[19]=o,e[20]=p):p=e[20],m=n.sections.map(p),e[12]=d,e[13]=n.sections,e[14]=n.title,e[15]=o,e[16]=m}else m=e[16];return e[21]!==f||e[22]!==m?(_=c.jsxs("div",{className:"px-2 py-2 space-y-4 overflow-auto flex-1",children:[f,m]}),e[21]=f,e[22]=m,e[23]=_):_=e[23],e[24]!==u||e[25]!==_?(g=c.jsxs(c.Fragment,{children:[u,_]}),e[24]=u,e[25]=_,e[26]=g):g=e[26],g},WF=t=>{const e=K.c(7),{snippets:n,onSelect:o}=t;let r,s;if(e[0]!==o||e[1]!==n){let i;e[3]!==o?(i=a=>c.jsx(mo,{className:"rounded-none",onSelect:()=>o(a),children:c.jsx("div",{className:"flex flex-row gap-2 items-center",children:c.jsx("span",{className:"mt-1 text-accent-foreground",children:a.title})})},a.title),e[3]=o,e[4]=i):i=e[4],r=n.map(i),e[0]=o,e[1]=n,e[2]=r}else r=e[2];return e[5]!==r?(s=c.jsx(Dm,{className:"flex flex-col overflow-auto",children:r}),e[5]=r,e[6]=s):s=e[6],s};function qF(){return aH()}const GF=X.lazy(()=>Rm(()=>import("./tracing-d_os5FRh.js").then(async t=>(await t.__tla,t)),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123]),import.meta.url).then(t=>({default:t.Tracing}))),YF=()=>{const t=K.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx(X.Suspense,{fallback:c.jsx(JF,{}),children:c.jsx(GF,{})}),t[0]=e):e=t[0],e},JF=()=>{const t=K.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:c.jsx(In,{})}),t[0]=e):e=t[0],e},w3="name",v3="type-value",em="defs-refs",KF=[{id:w3,accessorFn:t=>[t.name,t.declaredBy],enableSorting:!0,sortingFn:"alphanumeric",header:({column:t})=>c.jsx(Xm,{header:"Name",column:t}),cell:({getValue:t})=>{const[e,n]=t();return c.jsx(hf,{name:e,declaredBy:n})}},{id:v3,accessorFn:t=>[t.dataType,t.value],enableSorting:!0,sortingFn:"alphanumeric",header:({column:t})=>c.jsx(Xm,{header:c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx("span",{children:"Type"}),c.jsx("span",{children:"Value"})]}),column:t}),cell:({getValue:t})=>{const[e,n]=t();return c.jsxs("div",{className:"max-w-[150px]",children:[c.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap text-muted-foreground font-mono text-xs",children:e}),c.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap",title:n??"",children:n})]})}},{id:em,accessorFn:t=>[t.declaredBy,t.usedBy,t.name,t.declaredByNames,t.usedByNames],enableSorting:!0,sortingFn:"basic",header:({column:t})=>c.jsx(Xm,{header:c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx("span",{children:"Declared By"}),c.jsx("span",{children:"Used By"})]}),column:t}),cell:({getValue:t})=>{const[e,n,o]=t(),r=s=>{const i=ec(s);i&&Wm(i,o)};return c.jsxs("div",{className:"flex flex-col gap-1 py-1",children:[c.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-center",children:[c.jsx("span",{title:"Declared by",children:c.jsx(Bp,{className:"w-3.5 h-3.5 text-muted-foreground"})}),e.length===1?c.jsx(fr,{variant:"focus",cellId:e[0],skipScroll:!0,onClick:()=>r(e[0])}):c.jsx("div",{className:"text-destructive flex flex-row gap-2",children:e.slice(0,3).map((s,i)=>c.jsxs("span",{className:"flex",children:[c.jsx(fr,{variant:"focus",cellId:s,skipScroll:!0,className:"whitespace-nowrap text-destructive",onClick:()=>r(s)},s),i<e.length-1&&", "]},s))})]}),c.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-baseline",children:[c.jsx("span",{title:"Used by",children:c.jsx(ka,{className:"w-3.5 h-3.5 text-muted-foreground"})}),c.jsx(W2,{maxCount:3,cellIds:n,skipScroll:!0,onClick:r})]})]})}}],k3=M.memo(({className:t,cellIds:e,variables:n})=>{const[o,r]=X.useState([]),[s,i]=X.useState(""),a=lH(),l=M.useMemo(()=>{const h=f=>{const m=a[f];return fH(m)?`cell-${e.indexOf(f)}`:m??`cell-${e.indexOf(f)}`};return Object.values(n).map(f=>({...f,declaredByNames:f.declaredBy.map(h),usedByNames:f.usedBy.map(h)}))},[n,a,e]),d=M.useMemo(()=>{const h=new Map;return e.forEach((f,m)=>h.set(f,m)),function({variables:f,sort:m,cellIdToIndex:_}){m||(m={id:em,desc:!1});let g=[];switch(m.id){case w3:g=ga(f,p=>p.name);break;case v3:g=ga(f,p=>p.dataType);break;case em:g=ga(f,p=>_.get(p.declaredBy[0]))}return m.desc?g.reverse():g}({variables:l,sort:o[0],cellIdToIndex:h})},[l,o,e]),u=cH({data:d,columns:KF,getCoreRowModel:hH(),onGlobalFilterChange:i,getFilteredRowModel:uH(),enableFilters:!0,enableGlobalFilter:!0,enableColumnPinning:!1,getColumnCanGlobalFilter:h=>h.columnDef.enableGlobalFilter??!0,globalFilterFn:"auto",manualSorting:!0,onSortingChange:r,getSortedRowModel:dH(),state:{sorting:o,globalFilter:s}});return c.jsxs(c.Fragment,{children:[c.jsx(kS,{className:"w-full",placeholder:"Search",value:s,onChange:h=>i(h.target.value)}),c.jsxs(Jm,{className:Ne("w-full text-sm flex-1 border-separate border-spacing-0",t),children:[c.jsx(Ym,{children:c.jsx(Ws,{className:"whitespace-nowrap text-xs",children:u.getFlatHeaders().map(h=>c.jsx(Ur,{className:"sticky top-0 bg-background border-b",children:jS(h.column.columnDef.header,h.getContext())},h.id))})}),c.jsx(Km,{children:u.getRowModel().rows.map(h=>c.jsx(Ws,{className:"hover:bg-accent",children:h.getVisibleCells().map(f=>c.jsx(Vr,{className:"border-b",children:jS(f.column.columnDef.cell,f.getContext())},f.id))},h.id))})]})]})});k3.displayName="VariableTable";const XF=()=>{const t=K.c(4),e=dS(),n=Uc();if(Object.keys(e).length===0){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=c.jsx(yn,{title:"No variables",description:"Global variables will appear here.",icon:c.jsx(Xl,{})}),t[0]=r):r=t[0],r}let o;return t[1]!==n.inOrderIds||t[2]!==e?(o=c.jsx(k3,{className:"flex-1",cellIds:n.inOrderIds,variables:e}),t[1]=n.inOrderIds,t[2]=e,t[3]=o):o=t[3],o},ZF=X.lazy(()=>Rm(()=>import("./terminal-BS7wwx8O.js"),__vite__mapDeps([124,1,2,125]),import.meta.url)),QF=t=>{const e=K.c(121),{children:n}=t,{isSidebarOpen:o,isTerminalOpen:r,selectedPanel:s}=mc(),{setIsSidebarOpen:i,setIsTerminalOpen:a}=Zi(),l=X.useRef(null),d=X.useRef(null);let u,h,f,m,_;e[0]!==o?(u=()=>{if(!l.current)return;const ye=l.current.isCollapsed();o&&ye&&l.current.expand(),o||ye||l.current.collapse(),requestAnimationFrame(tz)},h=[o],e[0]=o,e[1]=u,e[2]=h):(u=e[1],h=e[2]),M.useEffect(u,h),e[3]!==r?(f=()=>{if(!d.current)return;const ye=d.current.isCollapsed();r&&ye&&d.current.expand(),r||ye||d.current.collapse(),requestAnimationFrame(oz)},m=[r],e[3]=r,e[4]=f,e[5]=m):(f=e[4],m=e[5]),M.useEffect(f,m),e[6]!==n?(_=c.jsx($c,{id:"app",className:"relative h-full",children:c.jsx(M.Suspense,{children:n})},"app"),e[6]=n,e[7]=_):_=e[7];const g=_,p=o?"resize-handle":"resize-handle-collapsed";let b,x;e[8]!==p?(b=Ne("border-border no-print z-10",p,"vertical"),e[8]=p,e[9]=b):b=e[9],e[10]!==b?(x=c.jsx(ES,{onDragging:IS,className:b}),e[10]=b,e[11]=x):x=e[11];const y=x,v=r?"resize-handle":"resize-handle-collapsed";let C,k;e[12]!==v?(C=Ne("border-border no-print z-20",v,"horizontal"),e[12]=v,e[13]=C):C=e[13],e[14]!==C?(k=c.jsx(ES,{onDragging:IS,className:C}),e[14]=C,e[15]=k):k=e[15];const N=k;let j,I,T,A,R,z,D,F,B,U,O,S,$,E,W,G,q,Y,te,oe,se;e[16]!==s?(j=c.jsx("div",{className:"text-sm text-[var(--slate-11)] uppercase tracking-wide font-semibold flex-1",children:s}),e[16]=s,e[17]=j):j=e[17],e[18]!==i?(I=()=>i(!1),e[18]=i,e[19]=I):I=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(T=c.jsx(eo,{className:"w-4 h-4"}),e[20]=T):T=e[20],e[21]!==I?(A=c.jsx(Me,{"data-testid":"close-helper-pane",className:"m-0",size:"xs",variant:"text",onClick:I,children:T}),e[21]=I,e[22]=A):A=e[22],e[23]!==j||e[24]!==A?(R=c.jsxs("div",{className:"p-3 border-b flex justify-between items-center",children:[j,A]}),e[23]=j,e[24]=A,e[25]=R):R=e[25],e[26]!==s?(z=s==="files"&&c.jsx(f3,{}),e[26]=s,e[27]=z):z=e[27],e[28]!==s?(D=s==="errors"&&c.jsx(JL,{}),e[28]=s,e[29]=D):D=e[29],e[30]!==s?(F=s==="variables"&&c.jsx(XF,{}),e[30]=s,e[31]=F):F=e[31],e[32]!==s?(B=s==="dependencies"&&c.jsx(DL,{}),e[32]=s,e[33]=B):B=e[33],e[34]!==s?(U=s==="packages"&&c.jsx(wF,{}),e[34]=s,e[35]=U):U=e[35],e[36]!==s?(O=s==="outline"&&c.jsx(yF,{}),e[36]=s,e[37]=O):O=e[37],e[38]!==s?(S=s==="datasources"&&c.jsx(GL,{}),e[38]=s,e[39]=S):S=e[39],e[40]!==s?($=s==="documentation"&&c.jsx(YL,{}),e[40]=s,e[41]=$):$=e[41],e[42]!==s?(E=s==="snippets"&&c.jsx($F,{}),e[42]=s,e[43]=E):E=e[43],e[44]!==s?(W=s==="scratchpad"&&c.jsx(MF,{}),e[44]=s,e[45]=W):W=e[45],e[46]!==s?(G=s==="chat"&&c.jsx(oR,{}),e[46]=s,e[47]=G):G=e[47],e[48]!==s?(q=s==="logs"&&c.jsx(m3,{}),e[48]=s,e[49]=q):q=e[49],e[50]!==s?(Y=s==="tracing"&&c.jsx(YF,{}),e[50]=s,e[51]=Y):Y=e[51],e[52]!==s?(te=s==="secrets"&&c.jsx(OF,{}),e[52]=s,e[53]=te):te=e[53],e[54]!==z||e[55]!==D||e[56]!==F||e[57]!==B||e[58]!==U||e[59]!==O||e[60]!==S||e[61]!==$||e[62]!==E||e[63]!==W||e[64]!==G||e[65]!==q||e[66]!==Y||e[67]!==te?(oe=c.jsx(M.Suspense,{children:c.jsxs(zc,{children:[z,D,F,B,U,O,S,$,E,W,G,q,Y,te]})}),e[54]=z,e[55]=D,e[56]=F,e[57]=B,e[58]=U,e[59]=O,e[60]=S,e[61]=$,e[62]=E,e[63]=W,e[64]=G,e[65]=q,e[66]=Y,e[67]=te,e[68]=oe):oe=e[68],e[69]!==R||e[70]!==oe?(se=c.jsx(xc,{children:c.jsxs("div",{className:"flex flex-col h-full flex-1 overflow-hidden mr-[-4px]",children:[R,oe]})}),e[69]=R,e[70]=oe,e[71]=se):se=e[71];const Z=se,Q=o&&"border-r border-l border-[var(--slate-7)]";let ue,me,ce,fe,de,ke;e[72]!==Q?(ue=Ne("dark:bg-[var(--slate-1)] no-print print:hidden hide-on-fullscreen",Q),e[72]=Q,e[73]=ue):ue=e[73],e[74]===Symbol.for("react.memo_cache_sentinel")?(me=(ye,$e)=>{var ze;$e===0&&ye===10&&((ze=l.current)==null||ze.resize(30))},e[74]=me):me=e[74],e[75]!==i?(ce=()=>i(!1),fe=()=>i(!0),e[75]=i,e[76]=ce,e[77]=fe):(ce=e[76],fe=e[77]),e[78]!==Z||e[79]!==y?(de=c.jsxs("span",{className:"flex flex-row h-full",children:[Z," ",y]}),e[78]=Z,e[79]=y,e[80]=de):de=e[80],e[81]!==ue||e[82]!==ce||e[83]!==fe||e[84]!==de?(ke=c.jsx($c,{ref:l,id:"helper",collapsedSize:0,collapsible:!0,className:ue,minSize:10,defaultSize:0,maxSize:75,onResize:me,onCollapse:ce,onExpand:fe,children:de},"helper"),e[81]=ue,e[82]=ce,e[83]=fe,e[84]=de,e[85]=ke):ke=e[85];const Se=ke,ie=r&&"border-[var(--slate-7)]";let je,pe,Ae,Fe,De,Ve,Le,ot,Qe;e[86]!==ie?(je=Ne("dark:bg-[var(--slate-1)] no-print print:hidden hide-on-fullscreen",ie),e[86]=ie,e[87]=je):je=e[87],e[88]===Symbol.for("react.memo_cache_sentinel")?(pe=(ye,$e)=>{var ze;$e===0&&ye===10&&((ze=d.current)==null||ze.resize(30))},e[88]=pe):pe=e[88],e[89]!==a?(Ae=()=>a(!1),Fe=()=>a(!0),e[89]=a,e[90]=Ae,e[91]=Fe):(Ae=e[90],Fe=e[91]),e[92]===Symbol.for("react.memo_cache_sentinel")?(De=c.jsx("div",{}),e[92]=De):De=e[92],e[93]!==a?(Ve=()=>a(!1),e[93]=a,e[94]=Ve):Ve=e[94],e[95]!==r||e[96]!==Ve?(Le=c.jsx(M.Suspense,{fallback:De,children:c.jsx(ZF,{visible:r,onClose:Ve})}),e[95]=r,e[96]=Ve,e[97]=Le):Le=e[97],e[98]!==r||e[99]!==Le?(ot=c.jsx(RL,{isOpen:r,children:Le}),e[98]=r,e[99]=Le,e[100]=ot):ot=e[100],e[101]!==je||e[102]!==Ae||e[103]!==Fe||e[104]!==ot||e[105]!==N?(Qe=c.jsxs($c,{ref:d,id:"terminal",collapsedSize:0,collapsible:!0,className:je,minSize:10,defaultSize:0,maxSize:75,onResize:pe,onCollapse:Ae,onExpand:Fe,children:[N,ot]},"terminal"),e[101]=je,e[102]=Ae,e[103]=Fe,e[104]=ot,e[105]=N,e[106]=Qe):Qe=e[106];const tt=Qe;let ne,ve,Ce,Re,J,ae,_e,ge;return e[107]===Symbol.for("react.memo_cache_sentinel")?(ne=sW(),e[107]=ne):ne=e[107],e[108]===Symbol.for("react.memo_cache_sentinel")?(ve=c.jsx(zc,{children:c.jsx(FO,{})}),e[108]=ve):ve=e[108],e[109]!==tt?(Ce=c.jsx(Fy,{capability:"terminal",children:tt}),e[109]=tt,e[110]=Ce):Ce=e[110],e[111]!==g||e[112]!==Ce?(Re=c.jsx($c,{children:c.jsxs(AS,{autoSaveId:"marimo:chrome:v1:l1",direction:"vertical",children:[g,Ce]})}),e[111]=g,e[112]=Ce,e[113]=Re):Re=e[113],e[114]===Symbol.for("react.memo_cache_sentinel")?(J=c.jsx(mH,{}),e[114]=J):J=e[114],e[115]!==Se||e[116]!==Re?(ae=c.jsxs(AS,{autoSaveId:"marimo:chrome:v1:l2",direction:"horizontal",storage:ne,children:[ve,Se,Re,J]}),e[115]=Se,e[116]=Re,e[117]=ae):ae=e[117],e[118]===Symbol.for("react.memo_cache_sentinel")?(_e=c.jsx(xc,{children:c.jsx(zc,{children:c.jsx(OO,{})})}),e[118]=_e):_e=e[118],e[119]!==ae?(ge=c.jsxs(iW,{children:[ae,_e]}),e[119]=ae,e[120]=ge):ge=e[120],ge};function ez(){window.dispatchEvent(new Event("resize"))}function tz(){requestAnimationFrame(ez)}function nz(){window.dispatchEvent(new Event("resize"))}function oz(){requestAnimationFrame(nz)}let S3;S3=new URL(window.location.href).searchParams.get(pH.showChrome)==="false",JS=Object.freeze(Object.defineProperty({__proto__:null,default:t=>{const e=K.c(10);if(S3){let s,i,a;return e[0]!==t?(s=c.jsx(Ly,{hideControls:!0,...t}),e[0]=t,e[1]=s):s=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(eg,{}),e[2]=i):i=e[2],e[3]!==s?(a=c.jsxs(c.Fragment,{children:[s,i]}),e[3]=s,e[4]=a):a=e[4],a}let n,o,r;return e[5]!==t?(n=c.jsx(Ly,{...t}),e[5]=t,e[6]=n):n=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(o=c.jsx(eg,{}),e[7]=o):o=e[7],e[8]!==n?(r=c.jsxs(QF,{children:[n,o]}),e[8]=n,e[9]=r):r=e[9],r}},Symbol.toStringTag,{value:"Module"}))});export{op as C,qc as E,yn as P,dW as __tla,Gc as a,JS as e,_a as f};
|
144
|
+
`).length),position:{x:0,y:0}}}createElements(t,e,n,o){const r=[],s=[],i=new Set,a=new Set;for(const l of Object.values(n)){if(l.value==="marimo"&&l.name==="mo")continue;const{declaredBy:d,usedBy:u}=l;for(const h of d)for(const f of u){const m=`${h}-${f}`;a.has(m)||(a.add(m),i.add(h),i.add(f),s.push(this.createEdge(h,f)))}}for(const[l,d]of $m.zip(t,e)){o||r.push(this.createNode(l,d));const u=i.has(l),h=at.get(d).code.trim().startsWith("mo.md");!u&&h||r.push(this.createNode(l,d))}return{nodes:r,edges:s}}},IL=t=>{const e=K.c(43),{cellIds:n,variables:o,cellAtoms:r,children:s,layoutDirection:i,settings:a}=t;let l;e[0]!==r||e[1]!==n||e[2]!==i||e[3]!==a.hidePureMarkdown||e[4]!==o?(l=()=>{let S=i3.createElements(n,r,o,a.hidePureMarkdown);return S=s3({nodes:S.nodes,edges:S.edges,direction:i}),S},e[0]=r,e[1]=n,e[2]=i,e[3]=a.hidePureMarkdown,e[4]=o,e[5]=l):l=e[5];const[d]=M.useState(l),[u,h,f]=F2(d.nodes),[m,_,g]=z2(d.edges),p=Bi();let b;e[6]!==i||e[7]!==_||e[8]!==h?(b=S=>{const $=s3({nodes:S.nodes,edges:S.edges,direction:i});h($.nodes),_($.edges)},e[6]=i,e[7]=_,e[8]=h,e[9]=b):b=e[9];const x=Ke(b);let y,v;e[10]!==r||e[11]!==n||e[12]!==a.hidePureMarkdown||e[13]!==x||e[14]!==o?(y=()=>{x(i3.createElements(n,r,o,a.hidePureMarkdown))},v=[n,o,r,x,a.hidePureMarkdown],e[10]=r,e[11]=n,e[12]=a.hidePureMarkdown,e[13]=x,e[14]=o,e[15]=y,e[16]=v):(y=e[15],v=e[16]),M.useEffect(y,v);const[C,k]=M.useState();let N;q2(),e[17]===Symbol.for("react.memo_cache_sentinel")?(N=()=>{k(void 0)},e[17]=N):N=e[17];const j=N;let I,T,A,R,z,D,F,B,U,O;return e[18]===Symbol.for("react.memo_cache_sentinel")?(I={minZoom:.5,maxZoom:1.5},T=(S,$)=>{k({type:"node",id:$.id})},A=(S,$)=>{const{source:E,target:W}=$;k({type:"edge",source:E,target:W})},e[18]=I,e[19]=T,e[20]=A):(I=e[18],T=e[19],A=e[20]),e[21]===Symbol.for("react.memo_cache_sentinel")?(R=c.jsx(JP,{color:"#ccc",variant:Vn.Dots}),e[21]=R):R=e[21],e[22]!==p||e[23]!==u?(z=()=>{const S=at.get(_$);if(S){const $=u.find(E=>E.id===S);$&&(p.fitView({padding:1,duration:600,nodes:[$]}),k({type:"node",id:S}))}},e[22]=p,e[23]=u,e[24]=z):z=e[24],e[25]===Symbol.for("react.memo_cache_sentinel")?(D=c.jsx(Cp,{className:"size-4"}),e[25]=D):D=e[25],e[26]!==z?(F=c.jsx($P,{position:"bottom-right",showInteractive:!1,children:c.jsx(Te,{content:"Jump to focused cell",delayDuration:200,side:"left",asChild:!1,children:c.jsx(Cs,{onMouseDown:Hn.preventFocus,onClick:z,children:D})})}),e[26]=z,e[27]=F):F=e[27],e[28]!==m||e[29]!==C||e[30]!==o?(B=c.jsx(Gl,{selection:C,variables:o,edges:m,onClearSelection:j}),e[28]=m,e[29]=C,e[30]=o,e[31]=B):B=e[31],e[32]!==s||e[33]!==m||e[34]!==u||e[35]!==g||e[36]!==f||e[37]!==F||e[38]!==B?(U=c.jsxs(df,{nodes:u,edges:m,nodeTypes:H2,minZoom:.2,fitViewOptions:I,onNodeClick:T,onEdgeClick:A,onNodeDoubleClick:AL,fitView:!0,onNodesChange:f,onEdgesChange:g,zoomOnDoubleClick:!1,nodesConnectable:!1,children:[R,F,B,s]}),e[32]=s,e[33]=m,e[34]=u,e[35]=g,e[36]=f,e[37]=F,e[38]=B,e[39]=U):U=e[39],e[40]!==i||e[41]!==U?(O=c.jsx(V2,{value:i,children:U}),e[40]=i,e[41]=U,e[42]=O):O=e[42],O};function AL(t,e){cS(e.id,"focus")}const TL=qt("_minimap_"),ML=qt({hidePureMarkdown:!0}),OL=t=>{const e=K.c(11),[n,o]=on(TL),[r,s]=on(ML);let i;e[0]!==n||e[1]!==t||e[2]!==o||e[3]!==s||e[4]!==r?(i=()=>n==="_minimap_"?c.jsx(eL,{...t,children:c.jsx(ff,{settings:r,onSettingsChange:s,view:n,onChange:o})}):c.jsx(IL,{...t,settings:r,layoutDirection:n,children:c.jsx(ff,{settings:r,onSettingsChange:s,view:n,onChange:o})}),e[0]=n,e[1]=t,e[2]=o,e[3]=s,e[4]=r,e[5]=i):i=e[5];const a=i;let l,d;return e[6]!==a?(l=a(),e[6]=a,e[7]=l):l=e[7],e[8]!==n||e[9]!==l?(d=c.jsx(cf,{children:l},n),e[8]=n,e[9]=l,e[10]=d):d=e[10],d},DL=()=>{const t=K.c(5),e=dS(),n=Uc(),[o]=b$();let r,s;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=Ne("w-full h-full flex-1 mx-auto -mb-4 relative"),t[0]=r):r=t[0],t[1]!==n.inOrderIds||t[2]!==o||t[3]!==e?(s=c.jsx("div",{className:r,children:c.jsx(OL,{cellAtoms:o,variables:e,cellIds:n.inOrderIds})}),t[1]=n.inOrderIds,t[2]=o,t[3]=e,t[4]=s):s=t[4],s},RL=t=>{const e=K.c(4),{isOpen:n,children:o}=t,[r,s]=X.useState(!1);let i,a;return e[0]!==r||e[1]!==n?(i=()=>{n&&!r&&s(!0)},a=[n,r],e[0]=r,e[1]=n,e[2]=i,e[3]=a):(i=e[2],a=e[3]),X.useEffect(i,a),r?o:null},PL=t=>{const e=K.c(8),{variableName:n,className:o}=t;let r;e[0]!==n?(r=()=>{const l=function(u){const h=at.get(uS)[u];if(h)return h.declaredBy[0]}(n);if(!l)return;const d=ec(l);d&&Wm(d,n)},e[0]=n,e[1]=r):r=e[1];const s=r;let i,a;return e[2]!==o?(i=Ne("text-link opacity-80 hover:opacity-100 hover:underline",o),e[2]=o,e[3]=i):i=e[3],e[4]!==s||e[5]!==i||e[6]!==n?(a=c.jsx("button",{type:"button",onClick:s,className:i,children:n}),e[4]=s,e[5]=i,e[6]=n,e[7]=a):a=e[7],a},LL=qt(t=>{const e=t(x$),n=t(uS),o=t(Z4);return ga(e,r=>{if(!r.variable_name)return-1;const s=Object.values(n).find(a=>a.name===r.variable_name);if(!s)return 0;const i=o.inOrderIds.indexOf(s.declaredBy[0]);return i===-1?0:i})}),FL=qt(t=>{const e=new Map(t(y$));for(const n of hS){const o=e.get(n);o&&o.databases.length===0&&e.delete(n)}return ga([...e.values()],n=>hS.has(n.name)?1:0)}),zL=()=>{const t=K.c(32),[e,n]=X.useState(""),o=Zt(fS),r=Ue(LL),s=Ue(FL);if(r.length===0&&s.length===0){let b;return t[0]===Symbol.for("react.memo_cache_sentinel")?(b=c.jsx(yn,{title:"No tables found",description:"Any datasets/dataframes in the global scope will be shown here.",action:c.jsx(Cg,{children:c.jsxs(Me,{variant:"outline",size:"sm",children:["Add database or catalog",c.jsx(ur,{className:"h-4 w-4 ml-2"})]})}),icon:c.jsx(ar,{})}),t[0]=b):b=t[0],b}const i=!!e.trim();let a,l,d,u,h,f,m,_,g,p;if(t[1]!==o?(a=b=>{o(b.length>0),n(b)},t[1]=o,t[2]=a):a=t[2],t[3]!==e||t[4]!==a?(l=c.jsx(Ji,{placeholder:"Search tables...",className:"h-6 m-1",value:e,onValueChange:a,rootClassName:"flex-1 border-r"}),t[3]=e,t[4]=a,t[5]=l):l=t[5],t[6]!==i?(d=i&&c.jsx("button",{type:"button",className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",onClick:()=>n(""),children:c.jsx(eo,{className:"h-4 w-4"})}),t[6]=i,t[7]=d):d=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(u=c.jsx(Cg,{children:c.jsx("button",{type:"button",className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:c.jsx(ur,{className:"h-4 w-4"})})}),t[8]=u):u=t[8],t[9]!==l||t[10]!==d?(h=c.jsxs("div",{className:"flex items-center w-full",children:[l,d,u]}),t[9]=l,t[10]=d,t[11]=h):h=t[11],t[12]!==s||t[13]!==i||t[14]!==e){let b;t[16]!==i||t[17]!==e?(b=x=>c.jsx(BL,{connection:x,hasChildren:x.databases.length>0,children:x.databases.map(y=>c.jsx(UL,{engineName:x.name,database:y,hasSearch:i,children:c.jsx(VL,{schemas:y.schemas,defaultSchema:x.default_schema,defaultDatabase:x.default_database,engineName:x.name,databaseName:y.name,hasSearch:i,searchValue:e})},y.name))},x.name),t[16]=i,t[17]=e,t[18]=b):b=t[18],f=s.map(b),t[12]=s,t[13]=i,t[14]=e,t[15]=f}else f=t[15];return t[19]!==s.length||t[20]!==r.length?(m=s.length>0&&r.length>0&&c.jsxs(mS,{children:[c.jsx(rc,{className:"h-4 w-4 text-muted-foreground"}),c.jsx("span",{className:"text-xs",children:"Python"})]}),t[19]=s.length,t[20]=r.length,t[21]=m):m=t[21],t[22]!==e||t[23]!==r?(_=r.length>0&&c.jsx(a3,{tables:r,searchValue:e}),t[22]=e,t[23]=r,t[24]=_):_=t[24],t[25]!==f||t[26]!==m||t[27]!==_?(g=c.jsxs(Dm,{className:"flex flex-col",children:[f,m,_]}),t[25]=f,t[26]=m,t[27]=_,t[28]=g):g=t[28],t[29]!==h||t[30]!==g?(p=c.jsxs(bc,{className:"border-b bg-background rounded-none h-full pb-10 overflow-auto outline-none",shouldFilter:!1,children:[h,g]}),t[29]=h,t[30]=g,t[31]=p):p=t[31],p},BL=t=>{const e=K.c(25),{connection:n,children:o,hasChildren:r}=t,s=n.name===w$,i=s?"In-Memory":n.name,[a,l]=X.useState(!1);let d;e[0]!==n.name?(d=async()=>{l(!0),await k$({engine:n.name}),setTimeout(()=>l(!1),500)},e[0]=n.name,e[1]=d):d=e[1];const u=d;let h,f,m;e[2]!==n.dialect?(h=c.jsx(s4,{className:"h-4 w-4 text-muted-foreground",name:n.dialect}),e[2]=n.dialect,e[3]=h):h=e[3],e[4]!==n.dialect?(f=v$(n.dialect),e[4]=n.dialect,e[5]=f):f=e[5],e[6]!==f?(m=c.jsx("span",{className:"text-xs",children:f}),e[6]=f,e[7]=m):m=e[7];const _=i;let g,p,b,x,y;return e[8]!==_?(g=c.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",c.jsx(PL,{variableName:_}),")"]}),e[8]=_,e[9]=g):g=e[9],e[10]!==u||e[11]!==s||e[12]!==a?(p=!s&&c.jsx(Te,{content:"Refresh connection",children:c.jsx(Me,{variant:"ghost",size:"icon",className:"ml-auto hover:bg-transparent hover:shadow-none",onClick:u,children:c.jsx(Ac,{className:Ne("h-4 w-4 text-muted-foreground hover:text-foreground",a&&"animate-[spin_0.5s]")})})}),e[10]=u,e[11]=s,e[12]=a,e[13]=p):p=e[13],e[14]!==h||e[15]!==m||e[16]!==g||e[17]!==p?(b=c.jsxs(mS,{children:[h,m,g,p]}),e[14]=h,e[15]=m,e[16]=g,e[17]=p,e[18]=b):b=e[18],e[19]!==o||e[20]!==r?(x=r?o:c.jsx(Vc,{content:"No databases available",className:"pl-2"}),e[19]=o,e[20]=r,e[21]=x):x=e[21],e[22]!==b||e[23]!==x?(y=c.jsxs(c.Fragment,{children:[b,x]}),e[22]=b,e[23]=x,e[24]=y):y=e[24],y},UL=t=>{const e=K.c(28),{hasSearch:n,engineName:o,database:r,children:s}=t,[i,a]=X.useState(!1),[l,d]=X.useState(!1);let u,h,f;e[0]!==n?(u=()=>{a(n)},h=[n],e[0]=n,e[1]=u,e[2]=h):(u=e[1],h=e[2]),X.useEffect(u,h),e[3]!==i||e[4]!==l?(f=()=>{a(!i),d(!l)},e[3]=i,e[4]=l,e[5]=f):f=e[5];const m=`${o}:${r.name}`;let _;e[6]!==i?(_=c.jsx(yS,{isExpanded:i}),e[6]=i,e[7]=_):_=e[7];const g=l&&i?"text-foreground":"text-muted-foreground";let p,b;e[8]!==g?(p=Ne("h-4 w-4",g),e[8]=g,e[9]=p):p=e[9],e[10]!==p?(b=c.jsx(ar,{className:p}),e[10]=p,e[11]=b):b=e[11];const x=l&&i&&"font-semibold";let y,v,C,k;e[12]!==x?(y=Ne(x),e[12]=x,e[13]=y):y=e[13],e[14]!==r.name?(v=r.name===""?c.jsx("i",{children:"Not connected"}):r.name,e[14]=r.name,e[15]=v):v=e[15],e[16]!==y||e[17]!==v?(C=c.jsx("span",{className:y,children:v}),e[16]=y,e[17]=v,e[18]=C):C=e[18],e[19]!==C||e[20]!==f||e[21]!==m||e[22]!==_||e[23]!==b?(k=c.jsxs(mo,{className:"text-sm flex flex-row gap-1 items-center cursor-pointer rounded-none",onSelect:f,value:m,children:[_,b,C]}),e[19]=C,e[20]=f,e[21]=m,e[22]=_,e[23]=b,e[24]=k):k=e[24];const N=i&&s;let j;return e[25]!==k||e[26]!==N?(j=c.jsxs(c.Fragment,{children:[k,N]}),e[25]=k,e[26]=N,e[27]=j):j=e[27],j},VL=t=>{const e=K.c(20),{schemas:n,defaultSchema:o,defaultDatabase:r,engineName:s,databaseName:i,hasSearch:a,searchValue:l}=t;if(n.length===0){let h;return e[0]===Symbol.for("react.memo_cache_sentinel")?(h=c.jsx(Vc,{content:"No schemas available",className:"pl-6"}),e[0]=h):h=e[0],h}let d,u;if(e[1]!==i||e[2]!==r||e[3]!==o||e[4]!==s||e[5]!==a||e[6]!==n||e[7]!==l){let h;e[9]!==l?(h=_=>!l||_.tables.some(g=>g.name.toLowerCase().includes(l.toLowerCase())),e[9]=l,e[10]=h):h=e[10];const f=n.filter(h);let m;e[11]!==i||e[12]!==r||e[13]!==o||e[14]!==s||e[15]!==a||e[16]!==l?(m=_=>c.jsx($L,{databaseName:i,schema:_,hasSearch:a,children:c.jsx(a3,{tables:_.tables,searchValue:l,sqlTableContext:{engine:s,database:i,schema:_.name,defaultSchema:o,defaultDatabase:r}})},_.name),e[11]=i,e[12]=r,e[13]=o,e[14]=s,e[15]=a,e[16]=l,e[17]=m):m=e[17],d=f.map(m),e[1]=i,e[2]=r,e[3]=o,e[4]=s,e[5]=a,e[6]=n,e[7]=l,e[8]=d}else d=e[8];return e[18]!==d?(u=c.jsx(c.Fragment,{children:d}),e[18]=d,e[19]=u):u=e[19],u},$L=t=>{const e=K.c(26),{databaseName:n,schema:o,children:r,hasSearch:s}=t,[i,a]=X.useState(!1),[l,d]=X.useState(!1),u=`${n}:${o.name}`;let h,f,m,_;if(e[0]!==s?(h=()=>{a(s)},f=[s],e[0]=s,e[1]=h,e[2]=f):(h=e[1],f=e[2]),X.useEffect(h,f),xS(o.name))return r;e[3]!==i||e[4]!==l?(m=()=>{a(!i),d(!l)},e[3]=i,e[4]=l,e[5]=m):m=e[5],e[6]!==i?(_=c.jsx(yS,{isExpanded:i}),e[6]=i,e[7]=_):_=e[7];const g=l&&i&&"text-foreground";let p,b;e[8]!==g?(p=Ne("h-4 w-4 text-muted-foreground",g),e[8]=g,e[9]=p):p=e[9],e[10]!==p?(b=c.jsx(A$,{className:p}),e[10]=p,e[11]=b):b=e[11];const x=l&&i&&"font-semibold";let y,v,C;e[12]!==x?(y=Ne(x),e[12]=x,e[13]=y):y=e[13],e[14]!==o.name||e[15]!==y?(v=c.jsx("span",{className:y,children:o.name}),e[14]=o.name,e[15]=y,e[16]=v):v=e[16],e[17]!==v||e[18]!==m||e[19]!==_||e[20]!==b||e[21]!==u?(C=c.jsxs(mo,{className:"text-sm flex flex-row gap-1 items-center pl-5 cursor-pointer rounded-none",onSelect:m,value:u,children:[_,b,v]}),e[17]=v,e[18]=m,e[19]=_,e[20]=b,e[21]=u,e[22]=C):C=e[22];const k=i&&r;let N;return e[23]!==C||e[24]!==k?(N=c.jsxs(c.Fragment,{children:[C,k]}),e[23]=C,e[24]=k,e[25]=N):N=e[25],N},a3=t=>{const e=K.c(24),{tables:n,sqlTableContext:o,searchValue:r}=t,{addTableList:s}=pS(),[i,a]=X.useState(!1),[l,d]=X.useState(!1);let u,h;e[0]!==s||e[1]!==o||e[2]!==n.length||e[3]!==i?(u=async()=>{if(n.length===0&&o&&!i){a(!0),d(!0);const{engine:p,database:b,schema:x}=o,y=await eW.request({engine:p,database:b,schema:x});if(!(y!=null&&y.tables))throw d(!1),new Error("No tables available");s({tables:y.tables,sqlTableContext:o}),d(!1)}},e[0]=s,e[1]=o,e[2]=n.length,e[3]=i,e[4]=u):u=e[4],e[5]!==o||e[6]!==n.length||e[7]!==i?(h=[n.length,o,i],e[5]=o,e[6]=n.length,e[7]=i,e[8]=h):h=e[8];const{isPending:f,error:m}=Gn(u,h);if(f||l){let p;return e[9]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx(gS,{message:"Loading tables...",className:"pl-12"}),e[9]=p):p=e[9],p}if(m){let p;return e[10]!==m?(p=c.jsx(_S,{error:m,className:"pl-12"}),e[10]=m,e[11]=p):p=e[11],p}if(n.length===0){let p;return e[12]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx(Vc,{content:"No tables found",className:"pl-9"}),e[12]=p):p=e[12],p}let _,g;if(e[13]!==r||e[14]!==o||e[15]!==n){let p;e[17]!==r?(p=y=>!r||y.name.toLowerCase().includes(r.toLowerCase()),e[17]=r,e[18]=p):p=e[18];const b=n.filter(p);let x;e[19]!==r||e[20]!==o?(x=y=>c.jsx(HL,{table:y,sqlTableContext:o,isSearching:!!r},y.name),e[19]=r,e[20]=o,e[21]=x):x=e[21],_=b.map(x),e[13]=r,e[14]=o,e[15]=n,e[16]=_}else _=e[16];return e[22]!==_?(g=c.jsx(c.Fragment,{children:_}),e[22]=_,e[23]=g):g=e[23],g},HL=t=>{const e=K.c(64),{table:n,sqlTableContext:o,isSearching:r}=t,{addTable:s}=pS(),[i,a]=X.useState(!1),[l,d]=X.useState(!1),u=n.columns.length>0;let h,f;e[0]!==s||e[1]!==i||e[2]!==o||e[3]!==n.name||e[4]!==u||e[5]!==l?(h=async()=>{if(i&&!u&&o&&!l){d(!0);const{engine:oe,database:se,schema:Z}=o,Q=await tW.request({engine:oe,database:se,schema:Z,tableName:n.name});if(!(Q!=null&&Q.table))throw new Error("No table details available");s({table:Q.table,sqlTableContext:o})}},e[0]=s,e[1]=i,e[2]=o,e[3]=n.name,e[4]=u,e[5]=l,e[6]=h):h=e[6],e[7]!==i||e[8]!==u?(f=[i,u],e[7]=i,e[8]=u,e[9]=f):f=e[9];const{isFetching:m,isPending:_,error:g}=Gn(h,f),p=Ue(nc),b=Os(),{createNewCell:x}=Mt(),y=bS();let v;e[10]!==y||e[11]!==p||e[12]!==x||e[13]!==b||e[14]!==o||e[15]!==n?(v=()=>{fo(p,x,b),y((()=>{if(n.source_type==="catalog"){const oe=o!=null&&o.database?`${o.database}.${n.name}`:n.name;return`${n.engine}.load_table("${oe}")`}if(o)return wS({table:n,columnName:"*",sqlTableContext:o});switch(n.source_type){case"local":return`mo.ui.table(${n.name})`;case"duckdb":case"connection":return wS({table:n,columnName:"*",sqlTableContext:o});default:return uc(n.source_type),""}})())},e[10]=y,e[11]=p,e[12]=x,e[13]=b,e[14]=o,e[15]=n,e[16]=v):v=e[16];const C=v;let k;e[17]!==n.num_columns||e[18]!==n.num_rows?(k=()=>{const oe=[];return n.num_rows!=null&&oe.push(`${n.num_rows} rows`),n.num_columns!=null&&oe.push(`${n.num_columns} columns`),oe.length===0?null:c.jsx("div",{className:"flex flex-row gap-2 items-center pl-6 group-hover:hidden",children:c.jsx("span",{className:"text-xs text-muted-foreground",children:oe.join(", ")})})},e[17]=n.num_columns,e[18]=n.num_rows,e[19]=k):k=e[19];const N=k;let j;e[20]!==g||e[21]!==m||e[22]!==_||e[23]!==o||e[24]!==n?(j=()=>{if(_||m)return c.jsx(gS,{message:"Loading columns...",className:"pl-12"});if(g)return c.jsx(_S,{error:g,className:"pl-12"});const oe=n.columns;return oe.length===0?c.jsx(Vc,{content:"No columns found",className:"pl-12"}):oe.map(se=>c.jsx(WL,{table:n,column:se,sqlTableContext:o},se.name))},e[20]=g,e[21]=m,e[22]=_,e[23]=o,e[24]=n,e[25]=j):j=e[25];const I=j;let T;e[26]!==i||e[27]!==r||e[28]!==n.source_type||e[29]!==n.type?(T=()=>{if(n.source_type==="local")return;const oe=n.type==="table"?S$:V3;return c.jsx(oe,{className:"h-3 w-3",strokeWidth:i||r?2.5:void 0})},e[26]=i,e[27]=r,e[28]=n.source_type,e[29]=n.type,e[30]=T):T=e[30];const A=T,R=o?`${o.database}.${o.schema}.${n.name}`:n.name,z=o&&(xS(o.schema)?"pl-9":"pl-12"),D=(i||r)&&"font-semibold";let F,B,U,O,S,$,E,W,G,q,Y,te;return e[31]!==z||e[32]!==D?(F=Ne("rounded-none group h-8 cursor-pointer",z,D),e[31]=z,e[32]=D,e[33]=F):F=e[33],e[34]!==i?(B=()=>a(!i),e[34]=i,e[35]=B):B=e[35],e[36]!==A?(U=A(),e[36]=A,e[37]=U):U=e[37],e[38]!==n.name?(O=c.jsx("span",{className:"text-sm",children:n.name}),e[38]=n.name,e[39]=O):O=e[39],e[40]!==U||e[41]!==O?(S=c.jsxs("div",{className:"flex gap-2 items-center flex-1",children:[U,O]}),e[40]=U,e[41]=O,e[42]=S):S=e[42],e[43]!==N?($=N(),e[43]=N,e[44]=$):$=e[44],e[45]!==C?(E=Hn.stopPropagation(()=>C()),e[45]=C,e[46]=E):E=e[46],e[47]===Symbol.for("react.memo_cache_sentinel")?(W=c.jsx(C$,{className:"h-3 w-3"}),e[47]=W):W=e[47],e[48]!==E?(G=c.jsx(Te,{content:"Add table to notebook",delayDuration:400,children:c.jsx(Me,{className:"group-hover:inline-flex hidden",variant:"text",size:"icon",onClick:E,children:W})}),e[48]=E,e[49]=G):G=e[49],e[50]!==i||e[51]!==B||e[52]!==S||e[53]!==$||e[54]!==G||e[55]!==F||e[56]!==R?(q=c.jsxs(mo,{className:F,value:R,"aria-selected":i,forceMount:!0,onSelect:B,children:[S,$,G]}),e[50]=i,e[51]=B,e[52]=S,e[53]=$,e[54]=G,e[55]=F,e[56]=R,e[57]=q):q=e[57],e[58]!==i||e[59]!==I?(Y=i&&I(),e[58]=i,e[59]=I,e[60]=Y):Y=e[60],e[61]!==q||e[62]!==Y?(te=c.jsxs(c.Fragment,{children:[q,Y]}),e[61]=q,e[62]=Y,e[63]=te):te=e[63],te},WL=t=>{var E,W;const e=K.c(51),{table:n,column:o,sqlTableContext:r}=t,[s,i]=X.useState(!1),a=Ue(fS),l=Zt(N$);let d,u;e[0]!==a?(d=()=>{a&&i(!1)},u=[a],e[0]=a,e[1]=d,e[2]=u):(d=e[1],u=e[2]),X.useEffect(d,u),l(s?G=>new Set([...G,`${n.name}:${o.name}`]):G=>(G.delete(`${n.name}:${o.name}`),new Set(G)));const h=bS(),{columnsPreviews:f}=j$();let m;e[3]!==o.name||e[4]!==n.primary_keys?(m=((E=n.primary_keys)==null?void 0:E.includes(o.name))||!1,e[3]=o.name,e[4]=n.primary_keys,e[5]=m):m=e[5];const _=m;let g;e[6]!==o.name||e[7]!==n.indexes?(g=((W=n.indexes)==null?void 0:W.includes(o.name))||!1,e[6]=o.name,e[7]=n.indexes,e[8]=g):g=e[8];const p=g;let b;e[9]!==h?(b=G=>{h(G)},e[9]=h,e[10]=b):b=e[10];const x=b,y=qL,v=s?"font-semibold":"";let C;e[11]!==o.name||e[12]!==v?(C=c.jsx("span",{className:v,children:o.name}),e[11]=o.name,e[12]=v,e[13]=C):C=e[13];const k=C,N=`${n.name}.${o.name}`,j=`${n.name}.${o.name}`;let I;e[14]!==s?(I=()=>i(!s),e[14]=s,e[15]=I):I=e[15];const T=r?"pl-14":"pl-7";let A,R,z,D,F,B,U,O,S,$;return e[16]!==T?(A=Ne("flex flex-row gap-2 items-center flex-1",T),e[16]=T,e[17]=A):A=e[17],e[18]!==o.type||e[19]!==k?(R=c.jsx(E$,{columnName:k,dataType:o.type}),e[18]=o.type,e[19]=k,e[20]=R):R=e[20],e[21]!==_?(z=_&&y({tooltipContent:"Primary key",content:"PK"}),e[21]=_,e[22]=z):z=e[22],e[23]!==p?(D=p&&y({tooltipContent:"Indexed",content:"IDX"}),e[23]=p,e[24]=D):D=e[24],e[25]!==A||e[26]!==R||e[27]!==z||e[28]!==D?(F=c.jsxs("div",{className:A,children:[R,z,D]}),e[25]=A,e[26]=R,e[27]=z,e[28]=D,e[29]=F):F=e[29],e[30]!==o.name?(B=c.jsx(Te,{content:"Copy column name",delayDuration:400,children:c.jsx(Me,{variant:"text",size:"icon",className:"group-hover:opacity-100 opacity-0 hover:bg-muted text-muted-foreground hover:text-foreground",children:c.jsx(iS,{tooltip:!1,value:o.name,className:"h-3 w-3"})})}),e[30]=o.name,e[31]=B):B=e[31],e[32]!==o.external_type?(U=c.jsx("span",{className:"text-xs text-muted-foreground",children:o.external_type}),e[32]=o.external_type,e[33]=U):U=e[33],e[34]!==I||e[35]!==F||e[36]!==B||e[37]!==U||e[38]!==N||e[39]!==j?(O=c.jsxs(mo,{className:"rounded-none py-1 group cursor-pointer",value:j,onSelect:I,children:[F,B,U]},N),e[34]=I,e[35]=F,e[36]=B,e[37]=U,e[38]=N,e[39]=j,e[40]=O):O=e[40],e[41]!==o||e[42]!==f||e[43]!==x||e[44]!==s||e[45]!==r||e[46]!==n?(S=s&&c.jsx("div",{className:"pl-10 pr-2 py-2 bg-[var(--slate-1)] shadow-inner border-b",children:c.jsx(xc,{children:c.jsx(I$,{table:n,column:o,onAddColumnChart:x,preview:f.get(r?`${r.database}.${r.schema}.${n.name}:${o.name}`:`${n.name}:${o.name}`),sqlTableContext:r})})}),e[41]=o,e[42]=f,e[43]=x,e[44]=s,e[45]=r,e[46]=n,e[47]=S):S=e[47],e[48]!==O||e[49]!==S?($=c.jsxs(c.Fragment,{children:[O,S]}),e[48]=O,e[49]=S,e[50]=$):$=e[50],$};function qL(t){const{tooltipContent:e,content:n}=t;return c.jsx(Te,{content:e,delayDuration:100,children:c.jsx("span",{className:"text-xs text-black bg-gray-100 dark:invert rounded px-1",children:n})})}const GL=()=>{const t=K.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx(zL,{}),t[0]=e):e=t[0],e},YL=()=>{const t=K.c(5),{documentation:e}=Ue(T$);if(!e){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=c.jsx(yn,{title:"View docs as you type",description:"Move your text cursor over a symbol to see its documentation.",icon:c.jsx(id,{})}),t[0]=r):r=t[0],r}let n,o;return t[1]!==e?(n=Hm({html:e}),t[1]=e,t[2]=n):n=t[2],t[3]!==n?(o=c.jsx("div",{className:"p-3 overflow-y-auto overflow-x-hidden h-full docs-documentation flex flex-col gap-4",children:n}),t[3]=n,t[4]=o):o=t[4],o},JL=()=>{const t=K.c(5),e=M$();if(e.length===0){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=c.jsx(yn,{title:"No errors!",icon:c.jsx(Mp,{})}),t[0]=r):r=t[0],r}let n,o;return t[1]!==e?(n=e.map(KL),t[1]=e,t[2]=n):n=t[2],t[3]!==n?(o=c.jsx("div",{className:"flex flex-col overflow-auto",children:n}),t[3]=n,t[4]=o):o=t[4],o};function KL(t){return c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-mono font-semibold bg-muted border-y px-2 py-1",children:c.jsx(O$,{cellId:t.cellId})}),c.jsx("div",{className:"px-2",children:c.jsx(D$,{errors:t.output.data,cellId:t.cellId},t.cellId)},t.cellId)]},t.cellId)}const Xf=new Map,XL=({file:t,onOpenNotebook:e})=>{const{theme:n}=hr(),o=Ue(dm),[r,s]=M.useState(""),{data:i,isPending:a,error:l,setData:d}=Gn(async()=>{const g=await qm({path:t.path}),p=g.contents||"";return s(Xf.get(t.path)||p),g},[t.path]),u=async()=>{r!==(i==null?void 0:i.contents)&&await V$({path:t.path,contents:r}).then(g=>{g.success&&(d(p=>({...p,contents:r})),s(r))})},h=M.useRef(r);if(h.current=r,M.useEffect(()=>()=>{if(!(i!=null&&i.contents))return;const g=h.current;g===i.contents?Xf.delete(t.path):Xf.set(t.path,g)},[t.path,i==null?void 0:i.contents]),l)return c.jsx(Br,{error:l});if(a||!i)return null;const f=i.mimeType||"text/plain",m=f in Zf;if(!i.contents&&!m)return c.jsxs("div",{className:"grid grid-cols-2 gap-2 p-6",children:[c.jsx("div",{className:"font-bold text-muted-foreground",children:"Name"}),c.jsx("div",{children:i.file.name}),c.jsx("div",{className:"font-bold text-muted-foreground",children:"Type"}),c.jsx("div",{children:f})]});const _=c.jsxs("div",{className:"text-xs text-muted-foreground p-1 flex justify-end gap-2 border-b",children:[t.isMarimoFile&&!un()&&c.jsx(Te,{content:"Open notebook",children:c.jsx(xn,{size:"small",onClick:g=>e(g),children:c.jsx(gc,{})})}),c.jsx(Te,{content:"Download",children:c.jsx(xn,{size:"small",onClick:()=>{if(l3(f)){const g=B$(i.contents,f);return void U$(g,i.file.name)}Qi(new Blob([i.contents||r],{type:f}),i.file.name)},children:c.jsx(ym,{})})}),!l3(f)&&c.jsxs(c.Fragment,{children:[c.jsx(Te,{content:"Copy contents to clipboard",children:c.jsx(xn,{size:"small",onClick:async()=>{await bn(r)},children:c.jsx(qi,{})})}),c.jsx(Te,{content:rn("global.save"),children:c.jsx(xn,{size:"small",color:r===i.contents?void 0:"green",onClick:u,disabled:r===i.contents,children:c.jsx(va,{})})})]})]});return f.startsWith("image/")?c.jsxs(c.Fragment,{children:[_,c.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:c.jsx(R$,{base64:i.contents,mime:f})})]}):f==="text/csv"&&i.contents?c.jsxs(c.Fragment,{children:[_,c.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:c.jsx(P$,{contents:i.contents})})]}):f.startsWith("audio/")?c.jsxs(c.Fragment,{children:[_,c.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:c.jsx(L$,{base64:i.contents,mime:f})})]}):f.startsWith("video/")?c.jsxs(c.Fragment,{children:[_,c.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:c.jsx(F$,{base64:i.contents,mime:f})})]}):f.startsWith("application/pdf")?c.jsxs(c.Fragment,{children:[_,c.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:c.jsx(z$,{base64:i.contents,mime:f})})]}):c.jsxs(c.Fragment,{children:[_,c.jsx("div",{className:"flex-1 overflow-auto",children:c.jsx(M.Suspense,{children:c.jsx(ha,{theme:n==="dark"?"dark":"light",language:Zf[f]||Zf.default,className:"border-b",extensions:[et.lineWrapping,Yn.of([{key:o.getHotkey("global.save").key,stopPropagation:!0,run:()=>r!==i.contents&&(u(),!0)}])],value:r,onChange:s})})})]})},l3=t=>t.startsWith("image/")||t.startsWith("audio/")||t.startsWith("video/")||t.startsWith("application/pdf"),Zf={"application/javascript":"javascript","text/markdown":"markdown","text/html":"html","text/css":"css","text/x-python":"python","application/json":"json","application/xml":"xml","text/x-yaml":"yaml","text/csv":"markdown","text/plain":"markdown",default:"markdown"},c3=qt(new class{constructor(t){this.callbacks=t,this.delegate=new Zm([]),this.rootPath="",this.onChange=Sn.NOOP,this.path=new fc("/"),this.initialize=async e=>{if(this.onChange=e,this.delegate.data.length===0)try{const n=await this.callbacks.listFiles({path:this.rootPath});this.delegate=new Zm(n.files),this.rootPath=n.root,this.path=fc.guessDeliminator(n.root)}catch(n){ct({title:"Failed",description:F4(n)})}this.onChange(this.delegate.data)},this.refreshAll=async e=>{const n=[this.rootPath,...e.map(r=>{var s;return(s=this.delegate.find(r))==null?void 0:s.data.path})].filter(Boolean),o=await Promise.all(n.map(r=>this.callbacks.listFiles({path:r}).catch(()=>({files:[]}))));for(const[r,s]of n.entries()){const i=o[r];s===this.rootPath?this.delegate=new Zm(i.files):this.delegate.update({id:s,changes:{children:i.files}})}this.onChange(this.delegate.data)},this.relativeFromRoot=e=>{const n=this.rootPath.endsWith(this.path.deliminator)?this.rootPath:`${this.rootPath}${this.path.deliminator}`;return e.startsWith(n)?e.slice(n.length):e},this.handleResponse=e=>e.success?e:(ct({title:"Failed",description:e.message}),null)}async expand(t){const e=this.delegate.find(t);if(!e||!e.data.isDirectory)return!1;if(e.children&&e.children.length>0)return!0;const n=await this.callbacks.listFiles({path:e.data.path});return this.delegate.update({id:t,changes:{children:n.files}}),this.onChange(this.delegate.data),!0}async rename(t,e){const n=this.delegate.find(t);if(!n)return;const o=n.data.path,r=this.path.join(this.path.dirname(o),e);await this.callbacks.renameFileOrFolder({path:o,newPath:r}).then(this.handleResponse),this.delegate.update({id:t,changes:{name:e,path:r}}),this.onChange(this.delegate.data),await this.refreshAll([r])}async move(t,e){var o;const n=e?((o=this.delegate.find(e))==null?void 0:o.data.path)??e:this.rootPath;await Promise.all(t.map(r=>{this.delegate.move({id:r,parentId:e,index:0});const s=this.delegate.find(r);if(!s)return Promise.resolve();const i=this.path.join(n,this.path.basename(s.data.path));return this.delegate.update({id:r,changes:{path:i}}),this.callbacks.renameFileOrFolder({path:s.data.path,newPath:i}).then(this.handleResponse)})),this.onChange(this.delegate.data),await this.refreshAll([n])}async createFile(t,e){var r;const n=e?((r=this.delegate.find(e))==null?void 0:r.data.path)??e:this.rootPath,o=await this.callbacks.createFileOrFolder({path:n,type:"file",name:t}).then(this.handleResponse);o!=null&&o.info&&(this.delegate.create({parentId:e,index:0,data:o.info}),this.onChange(this.delegate.data),await this.refreshAll([n]))}async createFolder(t,e){var r;const n=e?((r=this.delegate.find(e))==null?void 0:r.data.path)??e:this.rootPath,o=await this.callbacks.createFileOrFolder({path:n,type:"directory",name:t}).then(this.handleResponse);o!=null&&o.info&&(this.delegate.create({parentId:e,index:0,data:o.info}),this.onChange(this.delegate.data),await this.refreshAll([n]))}async delete(t){const e=this.delegate.find(t);e&&(await this.callbacks.deleteFileOrFolder({path:e.data.path}).then(this.handleResponse),this.delegate.drop({id:t}),this.onChange(this.delegate.data))}}({listFiles:f4,createFileOrFolder:Gm,deleteFileOrFolder:H$,renameFileOrFolder:$$})),ZL=qt({});function QL(t){return new Promise((e,n)=>{const o=new FileReader;o.onload=r=>{var s;e((s=r.target)==null?void 0:s.result)},o.onerror=r=>{n(new Error(`Failed to read blob: ${r.type}`))},o.readAsDataURL(t)})}function d3(t){const e=K.c(4);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const o=n;let r;return e[2]!==o?(r={multiple:!0,maxSize:104857600,onError:rF,onDropRejected:tF,onDrop:eF,...o},e[2]=o,e[3]=r):r=e[3],W$(r)}async function eF(t){for(const e of t){const n=iF(sF(e));let o="";n&&(o=fc.guessDeliminator(n).dirname(n));const r=(await QL(e)).split(",")[1];await Gm({path:o,type:"file",name:e.name,contents:r})}await async function(){await at.get(c3).refreshAll([])}()}function tF(t){ct({title:"File upload failed",description:c.jsx("div",{className:"flex flex-col gap-1",children:t.map(nF)}),variant:"danger"})}function nF(t){return c.jsxs("div",{children:[t.file.name," (",t.errors.map(oF).join(", "),")"]},t.file.name)}function oF(t){return t.message}function rF(t){Ct.error(t),ct({title:"File upload failed",description:t.message,variant:"danger"})}function sF(t){return t.webkitRelativePath?t.webkitRelativePath:"path"in t&&typeof t.path=="string"?t.path:"relativePath"in t&&typeof t.relativePath=="string"?t.relativePath:void 0}function iF(t){if(t)return t.replace(/^\/+/,"")}const u3=X.createContext(null),aF=t=>{const e=K.c(60),{height:n}=t,o=M.useRef(null),[r]=on(c3);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[0]=s):s=e[0];const[i,a]=M.useState(s),[l,d]=M.useState(null),{openPrompt:u}=qn(),[h,f]=on(ZL);let m,_;e[1]!==r?(m=()=>r.initialize(a),e[1]=r,e[2]=m):m=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(_=[],e[3]=_):_=e[3];const{isPending:g,error:p}=Gn(m,_);let b;e[4]!==h||e[5]!==r?(b=()=>{r.refreshAll(Object.keys(h).filter(S=>h[S]))},e[4]=h,e[5]=r,e[6]=b):b=e[6];const x=Ke(b);let y;e[7]!==u||e[8]!==r?(y=async()=>{u({title:"Folder name",onConfirm:async S=>{r.createFolder(S,null)}})},e[7]=u,e[8]=r,e[9]=y):y=e[9];const v=Ke(y);let C;e[10]!==u||e[11]!==r?(C=async()=>{u({title:"File name",onConfirm:async S=>{r.createFile(S,null)}})},e[10]=u,e[11]=r,e[12]=C):C=e[12];const k=Ke(C);let N;e[13]!==f?(N=()=>{var S;(S=o.current)==null||S.closeAll(),f({})},e[13]=f,e[14]=N):N=e[14];const j=Ke(N);if(g){let S;return e[15]===Symbol.for("react.memo_cache_sentinel")?(S=c.jsx(In,{size:"medium",centered:!0}),e[15]=S):S=e[15],S}if(p){let S;return e[16]!==p?(S=c.jsx(Br,{error:p}),e[16]=p,e[17]=S):S=e[17],S}if(l){let S,$,E,W,G,q;return e[18]===Symbol.for("react.memo_cache_sentinel")?(S=()=>d(null),e[18]=S):S=e[18],e[19]===Symbol.for("react.memo_cache_sentinel")?($=c.jsx(Me,{onClick:S,"data-testid":"file-explorer-back-button",variant:"text",size:"xs",className:"mb-0",children:c.jsx(Et,{size:16})}),e[19]=$):$=e[19],e[20]!==l.name?(E=c.jsxs("div",{className:"flex items-center pl-1 pr-3 flex-shrink-0 border-b justify-between",children:[$,c.jsx("span",{className:"font-bold",children:l.name})]}),e[20]=l.name,e[21]=E):E=e[21],e[22]!==l.path||e[23]!==r?(W=Y=>h3(Y,r.relativeFromRoot(l.path)),e[22]=l.path,e[23]=r,e[24]=W):W=e[24],e[25]!==l||e[26]!==W?(G=c.jsx(M.Suspense,{children:c.jsx(XL,{onOpenNotebook:W,file:l})}),e[25]=l,e[26]=W,e[27]=G):G=e[27],e[28]!==E||e[29]!==G?(q=c.jsxs(c.Fragment,{children:[E,G]}),e[28]=E,e[29]=G,e[30]=q):q=e[30],q}let I;e[31]!==j||e[32]!==k||e[33]!==v||e[34]!==x||e[35]!==r?(I=c.jsx(cF,{onRefresh:x,onCreateFile:k,onCreateFolder:v,onCollapseAll:j,tree:r}),e[31]=j,e[32]=k,e[33]=v,e[34]=x,e[35]=r,e[36]=I):I=e[36];const T=n-33;let A,R,z,D,F,B,U,O;return e[37]!==r?(A=async S=>{const{ids:$}=S;for(const E of $)await r.delete(E)},R=async S=>{const{id:$,name:E}=S;await r.rename($,E)},z=async S=>{const{dragIds:$,parentId:E}=S;await r.move($,E)},e[37]=r,e[38]=A,e[39]=R,e[40]=z):(A=e[38],R=e[39],z=e[40]),e[41]===Symbol.for("react.memo_cache_sentinel")?(D=S=>{const $=S[0];$&&($.data.isDirectory||d($.data))},e[41]=D):D=e[41],e[42]!==h||e[43]!==f||e[44]!==r?(F=async S=>{if(await r.expand(S)){const $=h[S]??!1;f({...h,[S]:!$})}},e[42]=h,e[43]=f,e[44]=r,e[45]=F):F=e[45],e[46]!==i||e[47]!==h||e[48]!==A||e[49]!==R||e[50]!==z||e[51]!==F||e[52]!==T?(B=c.jsx(PH,{width:"100%",ref:o,height:T,className:"h-full",data:i,initialOpenState:h,openByDefault:!1,renderCursor:mF,disableDrop:pF,onDelete:A,onRename:R,onMove:z,onSelect:D,onToggle:F,padding:15,rowHeight:30,indent:lF,overscanCount:1e3,disableMultiSelection:!0,children:hF}),e[46]=i,e[47]=h,e[48]=A,e[49]=R,e[50]=z,e[51]=F,e[52]=T,e[53]=B):B=e[53],e[54]!==B||e[55]!==r?(U=c.jsx(u3,{value:r,children:B}),e[54]=B,e[55]=r,e[56]=U):U=e[56],e[57]!==U||e[58]!==I?(O=c.jsxs(c.Fragment,{children:[I,U]}),e[57]=U,e[58]=I,e[59]=O):O=e[59],O},lF=15,cF=t=>{const e=K.c(30),{onRefresh:n,onCreateFile:o,onCreateFolder:r,onCollapseAll:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={noDrag:!0,noDragEventsBubbling:!0},e[0]=i):i=e[0];const{getRootProps:a,getInputProps:l}=d3(i);let d,u,h,f,m,_,g,p,b,x,y,v,C,k,N;return e[1]===Symbol.for("react.memo_cache_sentinel")?(d=c.jsx(ya,{size:16}),e[1]=d):d=e[1],e[2]!==o?(u=c.jsx(Te,{content:"Add file",children:c.jsx(Me,{"data-testid":"file-explorer-add-file-button",onClick:o,variant:"text",size:"xs",children:d})}),e[2]=o,e[3]=u):u=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(h=c.jsx(Zc,{size:16}),e[4]=h):h=e[4],e[5]!==r?(f=c.jsx(Te,{content:"Add folder",children:c.jsx(Me,{"data-testid":"file-explorer-add-folder-button",onClick:r,variant:"text",size:"xs",children:h})}),e[5]=r,e[6]=f):f=e[6],e[7]!==a?(m=a({}),e[7]=a,e[8]=m):m=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(_=q$({variant:"text",size:"xs"}),g=c.jsx(Y$,{size:16}),e[9]=_,e[10]=g):(_=e[9],g=e[10]),e[11]!==m?(p=c.jsx(Te,{content:"Upload file",children:c.jsx("button",{"data-testid":"file-explorer-upload-button",...m,className:_,children:g})}),e[11]=m,e[12]=p):p=e[12],e[13]!==l?(b=l({}),e[13]=l,e[14]=b):b=e[14],e[15]!==b?(x=c.jsx("input",{...b,type:"file"}),e[15]=b,e[16]=x):x=e[16],e[17]===Symbol.for("react.memo_cache_sentinel")?(y=c.jsx($4,{size:16}),e[17]=y):y=e[17],e[18]!==n?(v=c.jsx(Te,{content:"Refresh",children:c.jsx(Me,{"data-testid":"file-explorer-refresh-button",onClick:n,variant:"text",size:"xs",children:y})}),e[18]=n,e[19]=v):v=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(C=c.jsx(up,{size:16}),e[20]=C):C=e[20],e[21]!==s?(k=c.jsx(Te,{content:"Collapse all folders",children:c.jsx(Me,{"data-testid":"file-explorer-collapse-button",onClick:s,variant:"text",size:"xs",children:C})}),e[21]=s,e[22]=k):k=e[22],e[23]!==x||e[24]!==v||e[25]!==k||e[26]!==u||e[27]!==f||e[28]!==p?(N=c.jsxs("div",{className:"flex items-center justify-end px-2 flex-shrink-0 border-b",children:[u,f,p,x,v,k]}),e[23]=x,e[24]=v,e[25]=k,e[26]=u,e[27]=f,e[28]=p,e[29]=N):N=e[29],N},dF=t=>{const e=K.c(9),{node:n,onOpenMarimoFile:o}=t;let r,s,i;return e[0]!==n?(r=a=>{n.data.isDirectory||(a.stopPropagation(),n.select())},e[0]=n,e[1]=r):r=e[1],e[2]!==n.data.isMarimoFile||e[3]!==o?(s=n.data.isMarimoFile&&!un()&&c.jsxs("span",{className:"flex-shrink-0 ml-2 text-sm hidden group-hover:inline hover:underline",onClick:o,children:["open ",c.jsx(gc,{className:"inline ml-1",size:12})]}),e[2]=n.data.isMarimoFile,e[3]=o,e[4]=s):s=e[4],e[5]!==n.data.name||e[6]!==r||e[7]!==s?(i=c.jsxs("span",{className:"flex-1 overflow-hidden text-ellipsis",onClick:r,children:[n.data.name,s]}),e[5]=n.data.name,e[6]=r,e[7]=s,e[8]=i):i=e[8],i},uF=t=>{const e=K.c(10),{node:n}=t,o=M.useRef(null);let r,s,i,a,l;return e[0]!==n.data.name?(r=()=>{var d,u;(d=o.current)==null||d.focus(),(u=o.current)==null||u.setSelectionRange(0,n.data.name.lastIndexOf("."))},s=[n.data.name],e[0]=n.data.name,e[1]=r,e[2]=s):(r=e[1],s=e[2]),M.useEffect(r,s),e[3]!==n?(i=()=>n.reset(),a=d=>{d.key==="Escape"&&n.reset(),d.key==="Enter"&&n.submit(d.currentTarget.value)},e[3]=n,e[4]=i,e[5]=a):(i=e[4],a=e[5]),e[6]!==n.data.name||e[7]!==i||e[8]!==a?(l=c.jsx("input",{ref:o,className:"flex-1 bg-transparent border border-border text-muted-foreground",defaultValue:n.data.name,onClick:gF,onBlur:i,onKeyDown:a}),e[6]=n.data.name,e[7]=i,e[8]=a,e[9]=l):l=e[9],l},hF=({node:t,style:e,dragHandle:n})=>{const o=t.data.isDirectory?"directory":u4(t.data.name),r=h4[o],{openConfirm:s,openPrompt:i}=qn(),{createNewCell:a}=Mt(),l=Os(),d=M.use(u3),u=async g=>{h3(g,d?d.relativeFromRoot(t.data.path):t.data.path)},h=async g=>{g.stopPropagation(),g.preventDefault(),s({title:"Delete file",description:`Are you sure you want to delete ${t.data.name}?`,confirmAction:c.jsx(i4,{onClick:async()=>{await t.tree.delete(t.id)},"aria-label":"Confirm",children:"Delete"})})},f=Ke(async()=>{t.open(),i({title:"Folder name",onConfirm:async g=>{d==null||d.createFolder(g,t.id)}})}),m=Ke(async()=>{t.open(),i({title:"File name",onConfirm:async g=>{d==null||d.createFile(g,t.id)}})}),_=Ke(async()=>{var x;if(!d||t.data.isDirectory)return;const[g,p]=G$(t.data.name),b=`${g}_copy${p}`;try{const y=await qm({path:t.data.path}),v=((x=t.parent)==null?void 0:x.data.path)||"";await Gm({path:v,type:"file",name:b,contents:y.contents?btoa(y.contents):void 0}),await d.refreshAll([v])}catch{ct({title:"Failed to duplicate file",description:"Unable to create a duplicate of the file",variant:"danger"})}});return c.jsxs("div",{style:e,ref:n,className:Ne("flex items-center cursor-pointer ml-1 text-muted-foreground whitespace-nowrap group"),draggable:!0,onClick:g=>{g.stopPropagation(),t.data.isDirectory&&t.toggle()},children:[c.jsx(fF,{node:t}),c.jsxs("span",{className:Ne("flex items-center pl-1 py-1 cursor-pointer hover:bg-accent/50 hover:text-accent-foreground rounded-l flex-1 overflow-hidden group",t.willReceiveDrop&&t.data.isDirectory&&"bg-accent/80 hover:bg-accent/80 text-accent-foreground"),children:[t.data.isMarimoFile?c.jsx("img",{src:"./favicon.ico",className:"w-5 h-5 flex-shrink-0 mr-2 filter grayscale",alt:"Marimo"}):c.jsx(r,{className:"w-5 h-5 flex-shrink-0 mr-2",strokeWidth:1.5}),t.isEditing?c.jsx(uF,{node:t}):c.jsx(dF,{node:t,onOpenMarimoFile:u}),c.jsxs(Pr,{modal:!1,children:[c.jsx(Lr,{asChild:!0,tabIndex:-1,onClick:g=>g.stopPropagation(),children:c.jsx(Me,{"data-testid":"file-explorer-more-button",variant:"text",tabIndex:-1,size:"xs",className:"mb-0","aria-label":"More options",children:c.jsx(Xc,{strokeWidth:2,className:"w-5 h-5 hidden group-hover:block"})})}),(()=>{const g={size:14,strokeWidth:1.5,className:"mr-2"};return c.jsxs(Fr,{align:"end",className:"no-print w-[220px]",onClick:p=>p.stopPropagation(),onCloseAutoFocus:p=>p.preventDefault(),children:[!t.data.isDirectory&&c.jsxs(Gt,{onSelect:()=>t.select(),children:[c.jsx(Gp,{...g}),"Open file"]}),!t.data.isDirectory&&!un()&&c.jsxs(Gt,{onSelect:()=>{J$({path:t.data.path})},children:[c.jsx(gc,{...g}),"Open file in external editor"]}),t.data.isDirectory&&c.jsxs(c.Fragment,{children:[c.jsxs(Gt,{onSelect:()=>m(),children:[c.jsx(ya,{...g}),"Create file"]}),c.jsxs(Gt,{onSelect:()=>f(),children:[c.jsx(Zc,{...g}),"Create folder"]}),c.jsx(Cn,{})]}),c.jsxs(Gt,{onSelect:()=>t.edit(),children:[c.jsx(Op,{...g}),"Rename"]}),!t.data.isDirectory&&c.jsxs(Gt,{onSelect:_,children:[c.jsx(qi,{...g}),"Duplicate"]}),c.jsxs(Gt,{onSelect:async()=>{await bn(t.data.path),ct({title:"Copied to clipboard"})},children:[c.jsx(td,{...g}),"Copy path"]}),d&&c.jsxs(Gt,{onSelect:async()=>{await bn(d.relativeFromRoot(t.data.path)),ct({title:"Copied to clipboard"})},children:[c.jsx(td,{...g}),"Copy relative path"]}),c.jsx(Cn,{}),c.jsxs(Gt,{onSelect:()=>{const{path:p}=t.data;(b=>{a({code:b,before:!1,cellId:l??"__end__"})})(vS[o](p))},children:[c.jsx($r,{...g}),"Insert snippet for reading file"]}),c.jsxs(Gt,{onSelect:async()=>{ct({title:"Copied to clipboard",description:"Code to open the file has been copied to your clipboard. You can also drag and drop this file into the editor"});const{path:p}=t.data,b=vS[o](p);await bn(b)},children:[c.jsx(K$,{...g}),"Copy snippet for reading file"]}),t.data.isMarimoFile&&!un()&&c.jsxs(c.Fragment,{children:[c.jsx(Cn,{}),c.jsxs(Gt,{onSelect:u,children:[c.jsx(Vp,{...g}),"Open notebook"]})]}),c.jsx(Cn,{}),!t.data.isDirectory&&c.jsxs(c.Fragment,{children:[c.jsxs(Gt,{onSelect:async()=>{const p=(await qm({path:t.data.path})).contents||"";Qi(new Blob([p]),t.data.name)},children:[c.jsx(ym,{...g}),"Download"]}),c.jsx(Cn,{})]}),c.jsxs(Gt,{onSelect:h,variant:"danger",children:[c.jsx(cm,{...g}),"Delete"]})]})})()]})]})]})},fF=t=>{const e=K.c(3),{node:n}=t;if(!n.data.isDirectory){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=c.jsx("span",{className:"w-5 h-5 flex-shrink-0"}),e[0]=r):r=e[0],r}let o;return e[1]!==n.isOpen?(o=n.isOpen?c.jsx(Tr,{className:"w-5 h-5 flex-shrink-0"}):c.jsx(Yi,{className:"w-5 h-5 flex-shrink-0"}),e[1]=n.isOpen,e[2]=o):o=e[2],o};function h3(t,e){t.stopPropagation(),t.preventDefault(),MS(e)}function mF(){return null}function pF(t){const{parentNode:e}=t;return!e.data.isDirectory}function gF(t){return t.stopPropagation()}let f3,m3,p3;f3=()=>{const t=K.c(20),{ref:e,height:n}=X$(),o=n===void 0?1:n;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={noClick:!0,noKeyboard:!0},t[0]=r):r=t[0];const{getRootProps:s,getInputProps:i,isDragActive:a}=d3(r);let l,d,u,h,f,m,_,g;return t[1]!==s?(l=s(),t[1]=s,t[2]=l):l=t[2],t[3]===Symbol.for("react.memo_cache_sentinel")?(d=Ne("flex flex-col flex-1 overflow-hidden relative"),t[3]=d):d=t[3],t[4]!==i?(u=i(),t[4]=i,t[5]=u):u=t[5],t[6]!==u?(h=c.jsx("input",{...u}),t[6]=u,t[7]=h):h=t[7],t[8]!==a?(f=a&&c.jsx("div",{className:"absolute inset-0 flex items-center uppercase justify-center text-xl font-bold text-primary/90 bg-accent/85 z-10 border-2 border-dashed border-primary/90 rounded-lg pointer-events-none",children:"Drop files here"}),t[8]=a,t[9]=f):f=t[9],t[10]!==o?(m=c.jsx(aF,{height:o}),t[10]=o,t[11]=m):m=t[11],t[12]!==e||t[13]!==m?(_=c.jsx("div",{ref:e,className:"flex flex-col flex-1 overflow-hidden",children:m}),t[12]=e,t[13]=m,t[14]=_):_=t[14],t[15]!==l||t[16]!==h||t[17]!==f||t[18]!==_?(g=c.jsxs("div",{...l,className:d,children:[h,f,_]}),t[15]=l,t[16]=h,t[17]=f,t[18]=_,t[19]=g):g=t[19],g},op=t=>{const e=K.c(6),n=t.dataTestId;let o,r;return e[0]!==t.className?(o=Ne("text-xs font-semibold text-accent-foreground",t.className),e[0]=t.className,e[1]=o):o=e[1],e[2]!==t.dataTestId||e[3]!==t.onClick||e[4]!==o?(r=c.jsx("button",{type:"button","data-testid":n,className:o,onClick:t.onClick,children:"Clear"}),e[2]=t.dataTestId,e[3]=t.onClick,e[4]=o,e[5]=r):r=e[5],r},m3=()=>{const t=K.c(9),e=Z$(),{clearLogs:n}=Mt();if(e.length===0){let i,a;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx("code",{className:"border rounded px-1",children:"stdout"}),t[0]=i):i=t[0],t[1]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(yn,{title:"No logs",description:c.jsxs("span",{children:[i," and"," ",c.jsx("code",{className:"border rounded px-1",children:"stderr"})," logs will appear here."]}),icon:c.jsx(sm,{})}),t[1]=a):a=t[1],a}let o,r,s;return t[2]!==n?(o=c.jsx("div",{className:"flex flex-row justify-end px-2 py-1",children:c.jsx(op,{dataTestId:"clear-logs-button",onClick:n})}),t[2]=n,t[3]=o):o=t[3],t[4]!==e?(r=c.jsx("div",{className:"overflow-auto flex-1",children:c.jsx(p3,{logs:e,className:"min-w-[300px]"})}),t[4]=e,t[5]=r):r=t[5],t[6]!==o||t[7]!==r?(s=c.jsxs(c.Fragment,{children:[o,r]}),t[6]=o,t[7]=r,t[8]=s):s=t[8],s},p3=t=>{const e=K.c(10),{logs:n,className:o}=t;let r,s,i,a,l;return e[0]!==o?(r=Ne("flex flex-col",o),e[0]=o,e[1]=r):r=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(s={whiteSpace:"pre-wrap"},e[2]=s):s=e[2],e[3]!==n?(i=n.map(xF),e[3]=n,e[4]=i):i=e[4],e[5]!==i?(a=c.jsx("pre",{className:"grid text-xs font-mono gap-1 whitespace-break-spaces font-semibold align-left",children:c.jsx("div",{className:"grid grid-cols-[30px,1fr]",style:s,children:i})}),e[5]=i,e[6]=a):a=e[6],e[7]!==r||e[8]!==a?(l=c.jsx("div",{className:r,children:a}),e[7]=r,e[8]=a,e[9]=l):l=e[9],l};function _F(t){const e=Q$(t.timestamp),n=bF[t.level],o=t.level.toUpperCase();return c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"flex-shrink-0 text-[var(--gray-10)] dark:text-[var(--gray-11)]",children:["[",e,"]"]}),c.jsx("span",{className:Ne("flex-shrink-0",n),children:o}),c.jsxs("span",{className:"flex-shrink-0 text-[var(--gray-10)]",children:["(",c.jsx(fr,{cellId:t.cellId}),")"]}),t.message]})}const bF={stdout:"text-[var(--grass-9)]",stderr:"text-[var(--red-9)]"};function xF(t,e){return c.jsxs("div",{className:"contents group",children:[c.jsx("span",{className:Ne("opacity-70 group-hover:bg-[var(--gray-3)] group-hover:opacity-100","text-right col-span-1 py-1 pr-1"),children:e+1}),c.jsx("span",{className:Ne("opacity-70 group-hover:bg-[var(--gray-3)] group-hover:opacity-100","px-2 flex gap-x-1.5 py-1 flex-wrap"),children:_F(t)})]},e)}const yF=()=>{const t=K.c(7),{items:e}=Ue(eH);let n,o;t[0]!==e?(o=nW(e),t[0]=e,t[1]=o):o=t[1],n=o;const r=n,{activeHeaderId:s,activeOccurrences:i}=oW(r);if(e.length===0){let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(yn,{title:"No outline",description:"Add markdown headings to your notebook to create an outline.",icon:c.jsx(sd,{})}),t[2]=l):l=t[2],l}let a;return t[3]!==s||t[4]!==i||t[5]!==e?(a=c.jsx(rW,{items:e,activeHeaderId:s,activeOccurrences:i}),t[3]=s,t[4]=i,t[5]=e,t[6]=a):a=t[6],a},g3=qt(null),_3=t=>{const e=K.c(9),{onClick:n,loading:o,children:r,className:s}=t;if(o){let d;return e[0]===Symbol.for("react.memo_cache_sentinel")?(d=c.jsx(In,{size:"small",className:"h-4 w-4 shrink-0 opacity-50"}),e[0]=d):d=e[0],d}let i,a,l;return e[1]!==s?(i=Ne("px-2 h-full text-xs text-muted-foreground hover:text-foreground","invisible group-hover:visible",s),e[1]=s,e[2]=i):i=e[2],e[3]!==n?(a=Hn.stopPropagation(n),e[3]=n,e[4]=a):a=e[4],e[5]!==r||e[6]!==i||e[7]!==a?(l=c.jsx("button",{type:"button",className:i,onClick:a,children:r}),e[5]=r,e[6]=i,e[7]=a,e[8]=l):l=e[8],l},wF=()=>{var v,C;const t=K.c(27),[e]=Dr(),n=e.package_management.manager,[o,r]=X.useState(null);let s;t[0]!==n?(s=[n],t[0]=n,t[1]=s):s=t[1];const{data:i,error:a,refetch:l,isPending:d}=Gn(CF,s);if(d){let k;return t[2]===Symbol.for("react.memo_cache_sentinel")?(k=c.jsx(In,{size:"medium",centered:!0}),t[2]=k):k=t[2],k}if(a){let k;return t[3]!==a?(k=c.jsx(Br,{error:a}),t[3]=a,t[4]=k):k=t[4],k}const u=i.tree!=null;let h;t[5]!==u||t[6]!==o?(h=function(k,N){return k==="list"?"list":N?k||"tree":"list"}(o,u),t[5]=u,t[6]=o,t[7]=h):h=t[7];const f=h,m=(v=i.tree)==null?void 0:v.name,_=(C=i==null?void 0:i.tree)==null?void 0:C.version,g=m==="<root>";let p,b,x,y;return t[8]!==n||t[9]!==l?(p=c.jsx(vF,{packageManager:n,onSuccess:l}),t[8]=n,t[9]=l,t[10]=p):p=t[10],t[11]!==g||t[12]!==u||t[13]!==m||t[14]!==_||t[15]!==f?(b=u&&c.jsxs("div",{className:"flex items-center justify-between px-2 py-1 border-b",children:[c.jsxs("div",{className:"flex gap-1",children:[c.jsx("button",{type:"button",className:Ne("px-2 py-1 text-xs rounded",f==="list"?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground"),onClick:()=>r("list"),children:"List"}),c.jsx("button",{type:"button",className:Ne("px-2 py-1 text-xs rounded",f==="tree"?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground"),onClick:()=>r("tree"),children:"Tree"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"items-center border px-2 py-0.5 text-xs transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium",title:g?"sandbox":"project",children:g?"sandbox":"project"}),m&&!g&&c.jsxs("span",{className:"text-xs text-muted-foreground",children:[m,_&&` v${_}`]})]})]}),t[11]=g,t[12]=u,t[13]=m,t[14]=_,t[15]=f,t[16]=b):b=t[16],t[17]!==i.list||t[18]!==i.tree||t[19]!==a||t[20]!==l||t[21]!==f?(x=f==="list"?c.jsx(kF,{packages:i.list,onSuccess:l}):c.jsx(SF,{tree:i.tree,error:a,onSuccess:l}),t[17]=i.list,t[18]=i.tree,t[19]=a,t[20]=l,t[21]=f,t[22]=x):x=t[22],t[23]!==p||t[24]!==b||t[25]!==x?(y=c.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[p,b,x]}),t[23]=p,t[24]=b,t[25]=x,t[26]=y):y=t[26],y},vF=t=>{const e=K.c(40),{onSuccess:n,packageManager:o}=t,[r,s]=X.useState(""),{handleClick:i}=ma(),a=Ue(g3),l=Zt(g3);let d,u;e[0]!==a||e[1]!==l?(d=()=>{a&&(s(a),l(null))},u=[a,l],e[0]=a,e[1]=l,e[2]=d,e[3]=u):(d=e[2],u=e[3]),X.useEffect(d,u);const{loading:h,handleInstallPackages:f}=oH();let m;e[4]!==n?(m=()=>{n(),s("")},e[4]=n,e[5]=m):m=e[5];const _=m;let g;e[6]!==f||e[7]!==r||e[8]!==_?(g=()=>{f(r.split(",").map(NF),_)},e[6]=f,e[7]=r,e[8]=_,e[9]=g):g=e[9];const p=g,b=`Install packages with ${o}...`;let x,y,v,C,k,N,j,I,T,A,R,z,D,F;e[10]!==h||e[11]!==i?(x=h?c.jsx(In,{size:"small",className:"mr-2 h-4 w-4 shrink-0 opacity-50"}):c.jsx(Te,{content:"Change package manager",children:c.jsx(qs,{onClick:()=>i("packageManagement"),className:"mr-2 h-4 w-4 shrink-0 opacity-50 hover:opacity-80 cursor-pointer"})}),e[10]=h,e[11]=i,e[12]=x):x=e[12],e[13]!==p?(y=E=>{E.key==="Enter"&&(E.preventDefault(),p())},e[13]=p,e[14]=y):y=e[14],e[15]===Symbol.for("react.memo_cache_sentinel")?(v=E=>s(E.target.value),e[15]=v):v=e[15],e[16]!==r||e[17]!==b||e[18]!==x||e[19]!==y?(C=c.jsx(kS,{placeholder:b,id:j1,icon:x,rootClassName:"flex-1 border-none",value:r,onKeyDown:y,onChange:v}),e[16]=r,e[17]=b,e[18]=x,e[19]=y,e[20]=C):C=e[20],e[21]===Symbol.for("react.memo_cache_sentinel")?(k=c.jsx("span",{className:"font-bold tracking-wide",children:"Package name:"}),e[21]=k):k=e[21],e[22]===Symbol.for("react.memo_cache_sentinel")?(N=c.jsxs("div",{children:[k," A package name; this will install the latest version.",c.jsx("div",{className:"text-muted-foreground",children:"Example: httpx"})]}),j=c.jsx("span",{className:"font-bold tracking-wide",children:"Package and version:"}),e[22]=N,e[23]=j):(N=e[22],j=e[23]),e[24]===Symbol.for("react.memo_cache_sentinel")?(I=c.jsxs("div",{children:[j," ","A package with a specific version or version range.",c.jsx("div",{className:"text-muted-foreground",children:"Examples: httpx==0.27.0, httpx>=0.27.0"})]}),T=c.jsx("span",{className:"font-bold tracking-wide",children:"Git:"}),e[24]=I,e[25]=T):(I=e[24],T=e[25]),e[26]===Symbol.for("react.memo_cache_sentinel")?(A=c.jsxs("div",{children:[T," A Git repository",c.jsx("div",{className:"text-muted-foreground",children:"Example: git+https://github.com/encode/httpx"})]}),R=c.jsx("span",{className:"font-bold tracking-wide",children:"URL:"}),e[26]=A,e[27]=R):(A=e[26],R=e[27]),e[28]===Symbol.for("react.memo_cache_sentinel")?(z=c.jsxs("div",{children:[R," A remote wheel or source distribution.",c.jsx("div",{className:"text-muted-foreground",children:"Example: https://example.com/httpx-0.27.0.tar.gz"})]}),D=c.jsx("span",{className:"font-bold tracking-wide",children:"Path:"}),e[28]=z,e[29]=D):(z=e[28],D=e[29]),e[30]===Symbol.for("react.memo_cache_sentinel")?(F=c.jsx(Te,{delayDuration:300,side:"left",align:"start",content:c.jsxs("div",{className:"text-sm flex flex-col w-full max-w-[360px]",children:["Packages are installed using the package manager specified in your user configuration. Depending on your package manager, you can install packages with various formats:",c.jsxs("div",{className:"flex flex-col gap-2 mt-2",children:[N,I,A,z,c.jsxs("div",{children:[D," A local wheel, source distribution, or project directory.",c.jsx("div",{className:"text-muted-foreground",children:"Example: /example/foo-0.1.0-py3-none-any.whl"})]})]})]}),children:c.jsx(Um,{className:"h-4 w-4 cursor-help text-muted-foreground hover:text-foreground bg-transparent"})}),e[30]=F):F=e[30];const B=r&&"bg-accent text-accent-foreground";let U;e[31]!==B?(U=Ne("float-right px-2 m-0 h-full text-sm text-secondary-foreground ml-2",B,"disabled:cursor-not-allowed disabled:opacity-50"),e[31]=B,e[32]=U):U=e[32];const O=!r;let S,$;return e[33]!==p||e[34]!==U||e[35]!==O?(S=c.jsx("button",{type:"button",className:U,onClick:p,disabled:O,children:"Add"}),e[33]=p,e[34]=U,e[35]=O,e[36]=S):S=e[36],e[37]!==S||e[38]!==C?($=c.jsxs("div",{className:"flex items-center w-full border-b",children:[C,F,S]}),e[37]=S,e[38]=C,e[39]=$):$=e[39],$},kF=t=>{const e=K.c(9),{onSuccess:n,packages:o}=t;if(o.length===0){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(yn,{title:"No packages",description:"No packages are installed in this environment.",icon:c.jsx(qs,{})}),e[0]=a):a=e[0],a}let r,s,i;if(e[1]===Symbol.for("react.memo_cache_sentinel")?(r=c.jsx(Ym,{children:c.jsxs(Ws,{children:[c.jsx(Ur,{children:"Name"}),c.jsx(Ur,{children:"Version"}),c.jsx(Ur,{})]})}),e[1]=r):r=e[1],e[2]!==n||e[3]!==o){let a;e[5]!==n?(a=l=>c.jsxs(Ws,{className:"group",onClick:async()=>{await bn(`${l.name}==${l.version}`),ct({title:"Copied to clipboard"})},children:[c.jsx(Vr,{children:l.name}),c.jsx(Vr,{children:l.version}),c.jsxs(Vr,{className:"flex justify-end",children:[c.jsx(b3,{packageName:l.name,onSuccess:n}),c.jsx(x3,{packageName:l.name,onSuccess:n})]})]},l.name),e[5]=n,e[6]=a):a=e[6],s=o.map(a),e[2]=n,e[3]=o,e[4]=s}else s=e[4];return e[7]!==s?(i=c.jsxs(Jm,{className:"overflow-auto flex-1",children:[r,c.jsx(Km,{children:s})]}),e[7]=s,e[8]=i):i=e[8],i},b3=({packageName:t,onSuccess:e})=>{const[n,o]=X.useState(!1);return un()?null:c.jsx(_3,{onClick:async()=>{try{o(!0);const r=await rH({package:t,upgrade:!0});r.success?(e(),SS(t)):SS(t,r.error)}finally{o(!1)}},loading:n,children:"Upgrade"})},x3=({packageName:t,onSuccess:e})=>{const[n,o]=X.useState(!1);return c.jsx(_3,{onClick:async()=>{try{o(!0);const r=await sH({package:t});r.success?(e(),CS(t)):CS(t,r.error)}finally{o(!1)}},loading:n,children:"Remove"})},SF=t=>{const e=K.c(18),{tree:n,error:o,onSuccess:r}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=new Set,e[0]=s):s=e[0];const[i,a]=X.useState(s);let l,d,u;if(e[1]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{a(new Set)},e[1]=l):l=e[1],e[2]!==n?(d=[n],e[2]=n,e[3]=d):d=e[3],X.useEffect(l,d),o){let _;return e[4]!==o?(_=c.jsx(Br,{error:o}),e[4]=o,e[5]=_):_=e[5],_}if(!n){let _;return e[6]===Symbol.for("react.memo_cache_sentinel")?(_=c.jsx(In,{size:"medium",centered:!0}),e[6]=_):_=e[6],_}if(n.dependencies.length===0){let _;return e[7]===Symbol.for("react.memo_cache_sentinel")?(_=c.jsx(yn,{title:"No dependencies",description:"No package dependencies found in this environment.",icon:c.jsx(qs,{})}),e[7]=_):_=e[7],_}e[8]===Symbol.for("react.memo_cache_sentinel")?(u=_=>{a(g=>{const p=new Set(g);return p.has(_)?p.delete(_):p.add(_),p})},e[8]=u):u=e[8];const h=u;let f,m;if(e[9]!==i||e[10]!==r||e[11]!==n.dependencies){let _;e[13]!==i||e[14]!==r?(_=(g,p)=>c.jsx("div",{className:"border-b",children:c.jsx(y3,{nodeId:`root-${p}`,node:g,level:0,isTopLevel:!0,expandedNodes:i,onToggle:h,onSuccess:r})},`${g.name}-${p}`),e[13]=i,e[14]=r,e[15]=_):_=e[15],f=n.dependencies.map(_),e[9]=i,e[10]=r,e[11]=n.dependencies,e[12]=f}else f=e[12];return e[16]!==f?(m=c.jsx("div",{className:"flex-1 overflow-auto",children:c.jsx("div",{children:f})}),e[16]=f,e[17]=m):m=e[17],m},y3=t=>{const e=K.c(57),{nodeId:n,node:o,level:r,isTopLevel:s,expandedNodes:i,onToggle:a,onSuccess:l}=t,d=s!==void 0&&s,u=o.dependencies.length>0;let h;e[0]!==i||e[1]!==n?(h=i.has(n),e[0]=i,e[1]=n,e[2]=h):h=e[2];const f=h,m=d?0:16+16*r;let _;e[3]!==u||e[4]!==n||e[5]!==a?(_=U=>{U.key!=="Enter"&&U.key!==" "||(U.preventDefault(),u&&a(n))},e[3]=u,e[4]=n,e[5]=a,e[6]=_):_=e[6];const g=_;let p;e[7]!==u||e[8]!==n||e[9]!==a?(p=U=>{U.stopPropagation(),u&&a(n)},e[7]=u,e[8]=n,e[9]=a,e[10]=p):p=e[10];const b=p,x=u&&"select-none",y=d?"px-2 py-0.5":"";let v,C;e[11]!==x||e[12]!==y?(v=Ne("flex items-center group cursor-pointer text-sm whitespace-nowrap","hover:bg-[var(--slate-2)] focus:bg-[var(--slate-2)] focus:outline-none",x,y),e[11]=x,e[12]=y,e[13]=v):v=e[13],e[14]!==m||e[15]!==d?(C=d?{}:{paddingLeft:`${m}px`},e[14]=m,e[15]=d,e[16]=C):C=e[16];const k=u?f:void 0;let N,j,I,T,A,R,z,D,F,B;return e[17]!==u||e[18]!==f?(N=u?f?c.jsx(Tr,{className:"w-4 h-4 mr-2 flex-shrink-0"}):c.jsx(Yi,{className:"w-4 h-4 mr-2 flex-shrink-0"}):c.jsx("div",{className:"w-4 mr-2 flex-shrink-0"}),e[17]=u,e[18]=f,e[19]=N):N=e[19],e[20]!==o.name?(j=c.jsx("span",{className:"font-medium truncate",children:o.name}),e[20]=o.name,e[21]=j):j=e[21],e[22]!==o.version?(I=o.version&&c.jsxs("span",{className:"text-muted-foreground text-xs",children:["v",o.version]}),e[22]=o.version,e[23]=I):I=e[23],e[24]!==j||e[25]!==I?(T=c.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0 py-1.5",children:[j,I]}),e[24]=j,e[25]=I,e[26]=T):T=e[26],e[27]!==o.tags?(A=o.tags.map(jF),e[27]=o.tags,e[28]=A):A=e[28],e[29]!==A?(R=c.jsx("div",{className:"flex items-center gap-1 ml-2",children:A}),e[29]=A,e[30]=R):R=e[30],e[31]!==d||e[32]!==o.name||e[33]!==l?(z=d&&c.jsxs("div",{className:"flex gap-1 invisible group-hover:visible",children:[c.jsx(b3,{packageName:o.name,onSuccess:l}),c.jsx(x3,{packageName:o.name,onSuccess:l})]}),e[31]=d,e[32]=o.name,e[33]=l,e[34]=z):z=e[34],e[35]!==b||e[36]!==g||e[37]!==N||e[38]!==T||e[39]!==R||e[40]!==z||e[41]!==v||e[42]!==C||e[43]!==k?(D=c.jsxs("div",{className:v,style:C,onClick:b,onKeyDown:g,tabIndex:0,role:"treeitem","aria-selected":!1,"aria-expanded":k,children:[N,T,R,z]}),e[35]=b,e[36]=g,e[37]=N,e[38]=T,e[39]=R,e[40]=z,e[41]=v,e[42]=C,e[43]=k,e[44]=D):D=e[44],e[45]!==i||e[46]!==u||e[47]!==f||e[48]!==r||e[49]!==o.dependencies||e[50]!==n||e[51]!==l||e[52]!==a?(F=u&&f&&c.jsx("div",{role:"group",children:o.dependencies.map((U,O)=>c.jsx(y3,{nodeId:`${n}-${O}`,node:U,level:r+1,isTopLevel:!1,expandedNodes:i,onToggle:a,onSuccess:l},`${U.name}-${O}`))}),e[45]=i,e[46]=u,e[47]=f,e[48]=r,e[49]=o.dependencies,e[50]=n,e[51]=l,e[52]=a,e[53]=F):F=e[53],e[54]!==D||e[55]!==F?(B=c.jsxs("div",{children:[D,F]}),e[54]=D,e[55]=F,e[56]=B):B=e[56],B};async function CF(){const[t,e]=await Promise.all([tH(),nH()]);return{list:t.packages,tree:e.tree}}function NF(t){return t.trim()}function jF(t,e){return t.kind==="cycle"?c.jsx("div",{className:"items-center border px-2 py-0.5 text-xs transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium border-orange-300 dark:border-orange-700 text-orange-700 dark:text-orange-300",title:"cycle",children:"cycle"},e):t.kind==="extra"?c.jsx("div",{className:"items-center border px-2 py-0.5 text-xs transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium border-blue-300 dark:border-blue-700 text-blue-700 dark:text-blue-300",title:t.value,children:t.value},e):t.kind==="group"?c.jsx("div",{className:"items-center border px-2 py-0.5 text-xs transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium border-green-300 dark:border-green-700 text-green-700 dark:text-green-300",title:t.value,children:t.value},e):null}const Qf=z3("marimo:scratchpadHistory:v1",[]),EF=qt(!1),IF=qt(null,(t,e,n)=>{if(!(n=n.trim()))return;const o=t(Qf),r=[n,...o.filter(s=>s!==n)].slice(0,15);e(Qf,r)}),AF={hide_code:!1,disabled:!1},TF=()=>{const t=K.c(69),e=yc(),[n]=Dr(),{theme:o}=hr(),r=M.useRef(null),s=Os(),{createNewCell:i,updateCellCode:a}=Mt(),l=e.cellRuntime[mr],d=l==null?void 0:l.output,u=l==null?void 0:l.status,h=l==null?void 0:l.consoleOutputs,f=e.cellData[mr],m=(f==null?void 0:f.code)??"",_=Zt(IF),[g,p]=on(EF),b=Ue(Qf);let x;t[0]!==_||t[1]!==m?(x=()=>{NS({code:m}),_(m)},t[0]=_,t[1]=m,t[2]=x):x=t[2];const y=Ke(x);let v;t[3]!==m||t[4]!==i||t[5]!==s?(v=()=>{m.trim()&&i({code:m,before:!1,cellId:s??"__end__"})},t[3]=m,t[4]=i,t[5]=s,t[6]=v):v=t[6];const C=Ke(v);let k;t[7]!==a?(k=()=>{a({cellId:mr,code:"",formattingChange:!1}),NS({code:""});const ie=r.current;ie&&ie.dispatch({changes:{from:0,to:ie.state.doc.length,insert:""}})},t[7]=a,t[8]=k):k=t[8];const N=Ke(k);let j;t[9]!==p||t[10]!==a?(j=ie=>{p(!1),a({cellId:mr,code:ie,formattingChange:!1});const je=r.current;je&&je.dispatch({changes:{from:0,to:je.state.doc.length,insert:ie}})},t[9]=p,t[10]=a,t[11]=j):j=t[11];const I=Ke(j),[T,A]=M.useState();let R;t[12]!==m||t[13]!==h||t[14]!==y||t[15]!==T||t[16]!==d||t[17]!==o||t[18]!==n?(R=()=>c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"overflow-auto flex-shrink-0 max-h-[40%]",children:c.jsx(qu,{theme:o,showPlaceholder:!1,id:mr,code:m,config:AF,status:"idle",serializedEditorState:null,runCell:y,userConfig:n,editorViewRef:r,setEditorView:ie=>{r.current=ie},hidden:!1,temporarilyShowCode:Sn.NOOP,languageAdapter:T,setLanguageAdapter:A})}),c.jsx("div",{className:"flex-1 overflow-auto flex-shrink-0",children:c.jsx(Fc,{allowExpand:!1,output:d,className:"output-area",cellId:mr,stale:!1,loading:!1})}),c.jsx("div",{className:"overflow-auto flex-shrink-0 max-h-[35%]",children:c.jsx(ep,{consoleOutputs:h,className:"overflow-auto",stale:!1,cellName:B3,onSubmitDebugger:Sn.NOOP,cellId:mr,debuggerActive:!1})})]}),t[12]=m,t[13]=h,t[14]=y,t[15]=T,t[16]=d,t[17]=o,t[18]=n,t[19]=R):R=t[19];const z=R;let D;t[20]!==I||t[21]!==b||t[22]!==g||t[23]!==o?(D=()=>g?c.jsx("div",{className:"absolute inset-0 z-100 bg-background p-3 border-none overflow-auto",children:c.jsx("div",{className:"overflow-auto flex flex-col gap-3",children:b.map((ie,je)=>c.jsx("div",{className:"border rounded-md hover:shadow-sm cursor-pointer hover:border-input overflow-hidden",onClick:()=>I(ie),children:c.jsx(M.Suspense,{children:c.jsx(ha,{language:"python",theme:o,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1},value:ie.trim(),editable:!1,readOnly:!0})})},je))})}):null,t[20]=I,t[21]=b,t[22]=g,t[23]=o,t[24]=D):D=t[24];const F=D;let B,U,O,S,$,E,W,G,q,Y,te;t[25]===Symbol.for("react.memo_cache_sentinel")?(B=As.create(mr),U=c.jsx("p",{className:"mx-2 my-2 text-muted-foreground text-sm",children:"Use this scratchpad cell to experiment with code without restrictions on variable names. Scratchpad code is ephemeral: variables defined in the scratchpad aren't saved to notebook memory, and the code is not saved in the notebook file."}),t[25]=B,t[26]=U):(B=t[25],U=t[26]),t[27]===Symbol.for("react.memo_cache_sentinel")?(O=rn("cell.run"),t[27]=O):O=t[27],t[28]===Symbol.for("react.memo_cache_sentinel")?(S=c.jsx(Gs,{color:"var(--grass-11)",size:16}),t[28]=S):S=t[28],t[29]!==y||t[30]!==g?($=c.jsx(Te,{content:O,children:c.jsx(Me,{"data-testid":"scratchpad-run-button",onClick:y,disabled:g,variant:"text",size:"xs",children:S})}),t[29]=y,t[30]=g,t[31]=$):$=t[31],t[32]===Symbol.for("react.memo_cache_sentinel")?(E=c.jsx(fp,{size:16}),t[32]=E):E=t[32],t[33]!==N||t[34]!==g?(W=c.jsx(Te,{content:"Clear code and outputs",children:c.jsx(Me,{disabled:g,size:"xs",variant:"text",onClick:N,children:E})}),t[33]=N,t[34]=g,t[35]=W):W=t[35],t[36]===Symbol.for("react.memo_cache_sentinel")?(G=c.jsx($r,{size:16}),t[36]=G):G=t[36],t[37]!==C||t[38]!==g?(q=c.jsx(Xs,{children:c.jsx(Te,{content:"Insert code",children:c.jsx(Me,{disabled:g,size:"xs",variant:"text",onClick:C,children:G})})}),t[37]=C,t[38]=g,t[39]=q):q=t[39],t[40]!==u?(Y=(u==="running"||u==="queued")&&c.jsx(In,{className:"inline",size:"small"}),t[40]=u,t[41]=Y):Y=t[41],t[42]===Symbol.for("react.memo_cache_sentinel")?(te=c.jsx("div",{className:"flex-1"}),t[42]=te):te=t[42];const oe=g&&"bg-[var(--sky-3)] rounded-none";let se,Z;t[43]!==oe?(se=Ne(oe),t[43]=oe,t[44]=se):se=t[44],t[45]!==g||t[46]!==p?(Z=()=>p(!g),t[45]=g,t[46]=p,t[47]=Z):Z=t[47];const Q=b.length===0;let ue,me,ce,fe,de,ke,Se;return t[48]===Symbol.for("react.memo_cache_sentinel")?(ue=c.jsx(yp,{size:16}),t[48]=ue):ue=t[48],t[49]!==se||t[50]!==Z||t[51]!==Q?(me=c.jsx(Te,{content:"Toggle history",children:c.jsx(Me,{size:"xs",variant:"text",className:se,onClick:Z,disabled:Q,children:ue})}),t[49]=se,t[50]=Z,t[51]=Q,t[52]=me):me=t[52],t[53]!==$||t[54]!==W||t[55]!==q||t[56]!==Y||t[57]!==me?(ce=c.jsxs("div",{className:"flex items-center flex-shrink-0",children:[$,W,q,Y,te,me]}),t[53]=$,t[54]=W,t[55]=q,t[56]=Y,t[57]=me,t[58]=ce):ce=t[58],t[59]!==z?(fe=z(),t[59]=z,t[60]=fe):fe=t[60],t[61]!==F?(de=F(),t[61]=F,t[62]=de):de=t[62],t[63]!==fe||t[64]!==de?(ke=c.jsxs("div",{className:"flex-1 divide-y relative overflow-hidden flex flex-col",children:[fe,de]}),t[63]=fe,t[64]=de,t[65]=ke):ke=t[65],t[66]!==ce||t[67]!==ke?(Se=c.jsxs("div",{className:"flex flex-col h-full overflow-hidden divide-y",id:B,children:[U,ce,ke]}),t[66]=ce,t[67]=ke,t[68]=Se):Se=t[68],Se},MF=()=>{const t=K.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx(TF,{}),t[0]=e):e=t[0],e},OF=()=>{const t=K.c(23),{openModal:e,closeModal:n}=qn();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],t[0]=o):o=t[0];const{data:r,isPending:s,error:i,refetch:a}=Gn(RF,o);if(s){let b;return t[1]===Symbol.for("react.memo_cache_sentinel")?(b=c.jsx(In,{size:"medium",centered:!0}),t[1]=b):b=t[1],b}if(i){let b;return t[2]!==i?(b=c.jsx(Br,{error:i}),t[2]=i,t[3]=b):b=t[3],b}let l;t[4]!==r?(l=r.filter(PF).map(LF),t[4]=r,t[5]=l):l=t[5];const d=l;if(r.length===0){let b;return t[6]===Symbol.for("react.memo_cache_sentinel")?(b=c.jsx(yn,{title:"No environment variables",description:"No environment variables are available in this notebook.",icon:c.jsx(Qc,{})}),t[6]=b):b=t[6],b}let u,h,f,m,_,g,p;return t[7]!==n||t[8]!==e||t[9]!==d||t[10]!==a?(u=()=>e(c.jsx(wg,{providerNames:d,onSuccess:()=>{a(),n()},onClose:n})),t[7]=n,t[8]=e,t[9]=d,t[10]=a,t[11]=u):u=t[11],t[12]===Symbol.for("react.memo_cache_sentinel")?(h=c.jsx(ur,{className:"h-4 w-4"}),t[12]=h):h=t[12],t[13]!==u?(f=c.jsx("div",{className:"flex justify-end h-8 border-b",children:c.jsx("button",{type:"button",className:"float-right border-l px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",onClick:u,children:h})}),t[13]=u,t[14]=f):f=t[14],t[15]===Symbol.for("react.memo_cache_sentinel")?(m=c.jsx(Ym,{children:c.jsxs(Ws,{children:[c.jsx(Ur,{children:"Environment Variable"}),c.jsx(Ur,{children:"Source"}),c.jsx(Ur,{})]})}),t[15]=m):m=t[15],t[16]!==r?(_=r.map(FF),t[16]=r,t[17]=_):_=t[17],t[18]!==_?(g=c.jsxs(Jm,{className:"overflow-auto flex-1 mb-16",children:[m,c.jsx(Km,{children:_})]}),t[18]=_,t[19]=g):g=t[19],t[20]!==f||t[21]!==g?(p=c.jsxs("div",{className:"flex flex-col h-full",children:[f,g]}),t[20]=f,t[21]=g,t[22]=p):p=t[22],p},DF=t=>{const e=K.c(9),{className:n,ariaLabel:o,onCopy:r}=t,[s,i]=X.useState(!1);let a;e[0]!==r?(a=()=>{r(),i(!0),setTimeout(()=>i(!1),1e3)},e[0]=r,e[1]=a):a=e[1];const l=a;let d,u;return e[2]!==s?(d=s?c.jsx(pc,{className:"w-3 h-3 text-green-700 rounded"}):c.jsx(qi,{className:"w-3 h-3 hover:bg-muted rounded"}),e[2]=s,e[3]=d):d=e[3],e[4]!==o||e[5]!==n||e[6]!==l||e[7]!==d?(u=c.jsx("button",{type:"button",className:n,onClick:l,"aria-label":o,children:d}),e[4]=o,e[5]=n,e[6]=l,e[7]=d,e[8]=u):u=e[8],u};async function RF(){return yg((await zS.request({})).secrets)}function PF(t){return t.provider!=="env"}function LF(t){return t.name}function FF(t){return t.keys.map(e=>c.jsxs(Ws,{className:"group",children:[c.jsx(Vr,{children:e}),c.jsx(Vr,{children:t.provider!=="env"&&c.jsx(lS,{variant:"outline",className:"select-none",children:t.name})}),c.jsx(Vr,{children:c.jsx(DF,{ariaLabel:`Copy ${e}`,onCopy:async()=>{await bn(`os.environ["${e}"]`),ct({title:"Copied to clipboard",description:`os.environ["${e}"] has been copied to your clipboard.`})},className:Ne("float-right px-2 h-full text-xs text-muted-foreground hover:text-foreground","invisible group-hover:visible")})})]},`${t.name}-${e}`))}const zF=t=>{const e=K.c(6),{children:n}=t,{openModal:o,closeModal:r}=qn();let s,i;return e[0]!==r||e[1]!==o?(s=()=>o(c.jsx(UF,{onClose:r})),e[0]=r,e[1]=o,e[2]=s):s=e[2],e[3]!==n||e[4]!==s?(i=c.jsx(eS,{onClick:s,children:n}),e[3]=n,e[4]=s,e[5]=i):i=e[5],i},BF=[et.lineWrapping],UF=t=>{const e=K.c(23),{onClose:n}=t,[o,r]=M.useState(""),{theme:s}=hr();let i,a,l,d,u,h;e[0]!==n?(i=async y=>{y.preventDefault();const v=new FormData(y.target),C=v.get("title"),k=v.get("description"),N=v.get("code");fetch("https://marimo.io/api/suggest-snippet",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:C,description:k,code:N})}),n(),ct({title:"Snippet Submitted",description:"Thank you for contributing! We will review your snippet shortly."})},e[0]=n,e[1]=i):i=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(rr,{children:"Contribute a Snippet"}),e[2]=a):a=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsxs(Es,{children:[a,c.jsxs(Is,{children:["Have a useful snippet you want to share with the community? Submit it here or make a pull request"," ",c.jsx("a",{href:Qn.githubPage,target:"_blank",className:"underline",children:"on GitHub"}),"."]})]}),e[3]=l):l=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(d=c.jsx(sr,{id:"title",name:"title",autoFocus:!0,placeholder:"Title",required:!0,autoComplete:"off"}),u=c.jsx(iH,{id:"description",name:"description",autoFocus:!0,placeholder:"Description",rows:5,required:!0,autoComplete:"off"}),e[4]=d,e[5]=u):(d=e[4],u=e[5]),e[6]!==o?(h=c.jsx("input",{type:"hidden",name:"code",value:o}),e[6]=o,e[7]=h):h=e[7];const f=s==="dark"?"dark":"light";let m,_,g,p,b,x;return e[8]!==o||e[9]!==f?(m=c.jsx(ha,{theme:f,language:"python",className:"cm border rounded overflow-hidden",extensions:BF,value:o,onChange:r}),e[8]=o,e[9]=f,e[10]=m):m=e[10],e[11]!==h||e[12]!==m?(_=c.jsxs("div",{className:"flex flex-col gap-6 py-4",children:[d,u,h,m]}),e[11]=h,e[12]=m,e[13]=_):_=e[13],e[14]!==n?(g=c.jsx(Me,{"data-testid":"snippet-cancel-button",variant:"secondary",onClick:n,children:"Cancel"}),e[14]=n,e[15]=g):g=e[15],e[16]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx(Me,{"data-testid":"snippet-send-button","aria-label":"Save",variant:"default",type:"submit",children:"Send"}),e[16]=p):p=e[16],e[17]!==g?(b=c.jsxs(Wi,{children:[g,p]}),e[17]=g,e[18]=b):b=e[18],e[19]!==i||e[20]!==b||e[21]!==_?(x=c.jsx(ir,{className:"w-fit",children:c.jsxs("form",{onSubmit:i,children:[l,_,b]})}),e[19]=i,e[20]=b,e[21]=_,e[22]=x):x=e[22],x},VF=[et.lineWrapping],$F=()=>{const t=K.c(20),[e,n]=X.useState();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],t[0]=o):o=t[0];const{data:r,error:s,isPending:i}=Gn(qF,o);if(s){let b;return t[1]!==s?(b=c.jsx(Br,{error:s}),t[1]=s,t[2]=b):b=t[2],b}if(i||!r){let b;return t[3]===Symbol.for("react.memo_cache_sentinel")?(b=c.jsx(In,{size:"medium",centered:!0}),t[3]=b):b=t[3],b}const a=e?"h-1/3":"h-full";let l,d,u,h,f,m,_,g,p;return t[4]!==a?(l=Ne("border-b rounded-none",a),t[4]=a,t[5]=l):l=t[5],t[6]===Symbol.for("react.memo_cache_sentinel")?(d=c.jsx(Ji,{placeholder:"Search snippets...",className:"h-6 m-1",rootClassName:"flex-1 border-r"}),t[6]=d):d=t[6],t[7]===Symbol.for("react.memo_cache_sentinel")?(u=c.jsxs("div",{className:"flex items-center w-full",children:[d,c.jsx(zF,{children:c.jsx("button",{className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:c.jsx(ur,{className:"h-4 w-4"})})})]}),h=c.jsx(ic,{children:"No results"}),t[7]=u,t[8]=h):(u=t[7],h=t[8]),t[9]===Symbol.for("react.memo_cache_sentinel")?(f=b=>n(b),t[9]=f):f=t[9],t[10]!==r.snippets?(m=c.jsx(WF,{onSelect:f,snippets:r.snippets}),t[10]=r.snippets,t[11]=m):m=t[11],t[12]!==l||t[13]!==m?(_=c.jsxs(bc,{className:l,children:[u,h,m]}),t[12]=l,t[13]=m,t[14]=_):_=t[14],t[15]!==e?(g=c.jsx(M.Suspense,{children:c.jsx("div",{className:"h-2/3 snippet-viewer flex flex-col",children:e?c.jsx(HF,{snippet:e},e.title):c.jsx(yn,{title:"",description:"Click on a snippet to view its content."})})}),t[15]=e,t[16]=g):g=t[16],t[17]!==_||t[18]!==g?(p=c.jsxs("div",{className:"flex-1 overflow-hidden",children:[_,g]}),t[17]=_,t[18]=g,t[19]=p):p=t[19],p},HF=t=>{const e=K.c(27),{snippet:n}=t,{theme:o}=hr(),{createNewCell:r}=Mt(),s=Os();let i;e[0]!==r||e[1]!==s||e[2]!==n.sections?(i=()=>{for(const p of[...n.sections].reverse())p.code&&r({code:p.code,before:!1,cellId:s??"__end__",skipIfCodeExists:!0})},e[0]=r,e[1]=s,e[2]=n.sections,e[3]=i):i=e[3];const a=i;let l;e[4]!==r||e[5]!==s?(l=p=>{r({code:p,before:!1,cellId:s??"__end__"})},e[4]=r,e[5]=s,e[6]=l):l=e[6];const d=l;let u,h,f,m,_,g;if(e[7]!==n.title?(u=c.jsx("div",{className:"text-sm font-semibold bg-muted border-y px-2 py-1",children:n.title}),e[7]=n.title,e[8]=u):u=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(h=c.jsx($r,{className:"ml-2 h-4 w-4"}),e[9]=h):h=e[9],e[10]!==a?(f=c.jsx("div",{className:"flex justify-end",children:c.jsx(Xs,{children:c.jsxs(Me,{className:"float-right",size:"xs",variant:"outline",onClick:a,children:["Insert snippet",h]})})}),e[10]=a,e[11]=f):f=e[11],e[12]!==d||e[13]!==n.sections||e[14]!==n.title||e[15]!==o){let p;e[17]!==d||e[18]!==n.title||e[19]!==o?(p=b=>{const{code:x,html:y,id:v}=b;return y?c.jsx("div",{children:Hm({html:y})},`${n.title}-${v}`):x?c.jsxs("div",{className:"relative hover-actions-parent pr-2",children:[c.jsx(Xs,{children:c.jsx(Te,{content:"Insert snippet",children:c.jsx(Me,{className:"absolute -top-2 -right-1 z-10 hover-action px-2 bg-background",size:"sm",variant:"outline",onClick:()=>{d(x)},children:c.jsx($r,{className:"h-5 w-5"})})})}),c.jsx(M.Suspense,{children:c.jsx(ha,{theme:o==="dark"?"dark":"light",language:"python",className:"cm border rounded overflow-hidden",extensions:VF,value:x,readOnly:!0},`${n.title}-${v}`)})]},`${n.title}-${v}`):null},e[17]=d,e[18]=n.title,e[19]=o,e[20]=p):p=e[20],m=n.sections.map(p),e[12]=d,e[13]=n.sections,e[14]=n.title,e[15]=o,e[16]=m}else m=e[16];return e[21]!==f||e[22]!==m?(_=c.jsxs("div",{className:"px-2 py-2 space-y-4 overflow-auto flex-1",children:[f,m]}),e[21]=f,e[22]=m,e[23]=_):_=e[23],e[24]!==u||e[25]!==_?(g=c.jsxs(c.Fragment,{children:[u,_]}),e[24]=u,e[25]=_,e[26]=g):g=e[26],g},WF=t=>{const e=K.c(7),{snippets:n,onSelect:o}=t;let r,s;if(e[0]!==o||e[1]!==n){let i;e[3]!==o?(i=a=>c.jsx(mo,{className:"rounded-none",onSelect:()=>o(a),children:c.jsx("div",{className:"flex flex-row gap-2 items-center",children:c.jsx("span",{className:"mt-1 text-accent-foreground",children:a.title})})},a.title),e[3]=o,e[4]=i):i=e[4],r=n.map(i),e[0]=o,e[1]=n,e[2]=r}else r=e[2];return e[5]!==r?(s=c.jsx(Dm,{className:"flex flex-col overflow-auto",children:r}),e[5]=r,e[6]=s):s=e[6],s};function qF(){return aH()}const GF=X.lazy(()=>Rm(()=>import("./tracing-BuELwTiu.js").then(async t=>(await t.__tla,t)),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123]),import.meta.url).then(t=>({default:t.Tracing}))),YF=()=>{const t=K.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx(X.Suspense,{fallback:c.jsx(JF,{}),children:c.jsx(GF,{})}),t[0]=e):e=t[0],e},JF=()=>{const t=K.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:c.jsx(In,{})}),t[0]=e):e=t[0],e},w3="name",v3="type-value",em="defs-refs",KF=[{id:w3,accessorFn:t=>[t.name,t.declaredBy],enableSorting:!0,sortingFn:"alphanumeric",header:({column:t})=>c.jsx(Xm,{header:"Name",column:t}),cell:({getValue:t})=>{const[e,n]=t();return c.jsx(hf,{name:e,declaredBy:n})}},{id:v3,accessorFn:t=>[t.dataType,t.value],enableSorting:!0,sortingFn:"alphanumeric",header:({column:t})=>c.jsx(Xm,{header:c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx("span",{children:"Type"}),c.jsx("span",{children:"Value"})]}),column:t}),cell:({getValue:t})=>{const[e,n]=t();return c.jsxs("div",{className:"max-w-[150px]",children:[c.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap text-muted-foreground font-mono text-xs",children:e}),c.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap",title:n??"",children:n})]})}},{id:em,accessorFn:t=>[t.declaredBy,t.usedBy,t.name,t.declaredByNames,t.usedByNames],enableSorting:!0,sortingFn:"basic",header:({column:t})=>c.jsx(Xm,{header:c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx("span",{children:"Declared By"}),c.jsx("span",{children:"Used By"})]}),column:t}),cell:({getValue:t})=>{const[e,n,o]=t(),r=s=>{const i=ec(s);i&&Wm(i,o)};return c.jsxs("div",{className:"flex flex-col gap-1 py-1",children:[c.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-center",children:[c.jsx("span",{title:"Declared by",children:c.jsx(Bp,{className:"w-3.5 h-3.5 text-muted-foreground"})}),e.length===1?c.jsx(fr,{variant:"focus",cellId:e[0],skipScroll:!0,onClick:()=>r(e[0])}):c.jsx("div",{className:"text-destructive flex flex-row gap-2",children:e.slice(0,3).map((s,i)=>c.jsxs("span",{className:"flex",children:[c.jsx(fr,{variant:"focus",cellId:s,skipScroll:!0,className:"whitespace-nowrap text-destructive",onClick:()=>r(s)},s),i<e.length-1&&", "]},s))})]}),c.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-baseline",children:[c.jsx("span",{title:"Used by",children:c.jsx(ka,{className:"w-3.5 h-3.5 text-muted-foreground"})}),c.jsx(W2,{maxCount:3,cellIds:n,skipScroll:!0,onClick:r})]})]})}}],k3=M.memo(({className:t,cellIds:e,variables:n})=>{const[o,r]=X.useState([]),[s,i]=X.useState(""),a=lH(),l=M.useMemo(()=>{const h=f=>{const m=a[f];return fH(m)?`cell-${e.indexOf(f)}`:m??`cell-${e.indexOf(f)}`};return Object.values(n).map(f=>({...f,declaredByNames:f.declaredBy.map(h),usedByNames:f.usedBy.map(h)}))},[n,a,e]),d=M.useMemo(()=>{const h=new Map;return e.forEach((f,m)=>h.set(f,m)),function({variables:f,sort:m,cellIdToIndex:_}){m||(m={id:em,desc:!1});let g=[];switch(m.id){case w3:g=ga(f,p=>p.name);break;case v3:g=ga(f,p=>p.dataType);break;case em:g=ga(f,p=>_.get(p.declaredBy[0]))}return m.desc?g.reverse():g}({variables:l,sort:o[0],cellIdToIndex:h})},[l,o,e]),u=cH({data:d,columns:KF,getCoreRowModel:hH(),onGlobalFilterChange:i,getFilteredRowModel:uH(),enableFilters:!0,enableGlobalFilter:!0,enableColumnPinning:!1,getColumnCanGlobalFilter:h=>h.columnDef.enableGlobalFilter??!0,globalFilterFn:"auto",manualSorting:!0,onSortingChange:r,getSortedRowModel:dH(),state:{sorting:o,globalFilter:s}});return c.jsxs(c.Fragment,{children:[c.jsx(kS,{className:"w-full",placeholder:"Search",value:s,onChange:h=>i(h.target.value)}),c.jsxs(Jm,{className:Ne("w-full text-sm flex-1 border-separate border-spacing-0",t),children:[c.jsx(Ym,{children:c.jsx(Ws,{className:"whitespace-nowrap text-xs",children:u.getFlatHeaders().map(h=>c.jsx(Ur,{className:"sticky top-0 bg-background border-b",children:jS(h.column.columnDef.header,h.getContext())},h.id))})}),c.jsx(Km,{children:u.getRowModel().rows.map(h=>c.jsx(Ws,{className:"hover:bg-accent",children:h.getVisibleCells().map(f=>c.jsx(Vr,{className:"border-b",children:jS(f.column.columnDef.cell,f.getContext())},f.id))},h.id))})]})]})});k3.displayName="VariableTable";const XF=()=>{const t=K.c(4),e=dS(),n=Uc();if(Object.keys(e).length===0){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=c.jsx(yn,{title:"No variables",description:"Global variables will appear here.",icon:c.jsx(Xl,{})}),t[0]=r):r=t[0],r}let o;return t[1]!==n.inOrderIds||t[2]!==e?(o=c.jsx(k3,{className:"flex-1",cellIds:n.inOrderIds,variables:e}),t[1]=n.inOrderIds,t[2]=e,t[3]=o):o=t[3],o},ZF=X.lazy(()=>Rm(()=>import("./terminal-Ct8pIhb9.js"),__vite__mapDeps([124,1,2,125]),import.meta.url)),QF=t=>{const e=K.c(121),{children:n}=t,{isSidebarOpen:o,isTerminalOpen:r,selectedPanel:s}=mc(),{setIsSidebarOpen:i,setIsTerminalOpen:a}=Zi(),l=X.useRef(null),d=X.useRef(null);let u,h,f,m,_;e[0]!==o?(u=()=>{if(!l.current)return;const ye=l.current.isCollapsed();o&&ye&&l.current.expand(),o||ye||l.current.collapse(),requestAnimationFrame(tz)},h=[o],e[0]=o,e[1]=u,e[2]=h):(u=e[1],h=e[2]),M.useEffect(u,h),e[3]!==r?(f=()=>{if(!d.current)return;const ye=d.current.isCollapsed();r&&ye&&d.current.expand(),r||ye||d.current.collapse(),requestAnimationFrame(oz)},m=[r],e[3]=r,e[4]=f,e[5]=m):(f=e[4],m=e[5]),M.useEffect(f,m),e[6]!==n?(_=c.jsx($c,{id:"app",className:"relative h-full",children:c.jsx(M.Suspense,{children:n})},"app"),e[6]=n,e[7]=_):_=e[7];const g=_,p=o?"resize-handle":"resize-handle-collapsed";let b,x;e[8]!==p?(b=Ne("border-border no-print z-10",p,"vertical"),e[8]=p,e[9]=b):b=e[9],e[10]!==b?(x=c.jsx(ES,{onDragging:IS,className:b}),e[10]=b,e[11]=x):x=e[11];const y=x,v=r?"resize-handle":"resize-handle-collapsed";let C,k;e[12]!==v?(C=Ne("border-border no-print z-20",v,"horizontal"),e[12]=v,e[13]=C):C=e[13],e[14]!==C?(k=c.jsx(ES,{onDragging:IS,className:C}),e[14]=C,e[15]=k):k=e[15];const N=k;let j,I,T,A,R,z,D,F,B,U,O,S,$,E,W,G,q,Y,te,oe,se;e[16]!==s?(j=c.jsx("div",{className:"text-sm text-[var(--slate-11)] uppercase tracking-wide font-semibold flex-1",children:s}),e[16]=s,e[17]=j):j=e[17],e[18]!==i?(I=()=>i(!1),e[18]=i,e[19]=I):I=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(T=c.jsx(eo,{className:"w-4 h-4"}),e[20]=T):T=e[20],e[21]!==I?(A=c.jsx(Me,{"data-testid":"close-helper-pane",className:"m-0",size:"xs",variant:"text",onClick:I,children:T}),e[21]=I,e[22]=A):A=e[22],e[23]!==j||e[24]!==A?(R=c.jsxs("div",{className:"p-3 border-b flex justify-between items-center",children:[j,A]}),e[23]=j,e[24]=A,e[25]=R):R=e[25],e[26]!==s?(z=s==="files"&&c.jsx(f3,{}),e[26]=s,e[27]=z):z=e[27],e[28]!==s?(D=s==="errors"&&c.jsx(JL,{}),e[28]=s,e[29]=D):D=e[29],e[30]!==s?(F=s==="variables"&&c.jsx(XF,{}),e[30]=s,e[31]=F):F=e[31],e[32]!==s?(B=s==="dependencies"&&c.jsx(DL,{}),e[32]=s,e[33]=B):B=e[33],e[34]!==s?(U=s==="packages"&&c.jsx(wF,{}),e[34]=s,e[35]=U):U=e[35],e[36]!==s?(O=s==="outline"&&c.jsx(yF,{}),e[36]=s,e[37]=O):O=e[37],e[38]!==s?(S=s==="datasources"&&c.jsx(GL,{}),e[38]=s,e[39]=S):S=e[39],e[40]!==s?($=s==="documentation"&&c.jsx(YL,{}),e[40]=s,e[41]=$):$=e[41],e[42]!==s?(E=s==="snippets"&&c.jsx($F,{}),e[42]=s,e[43]=E):E=e[43],e[44]!==s?(W=s==="scratchpad"&&c.jsx(MF,{}),e[44]=s,e[45]=W):W=e[45],e[46]!==s?(G=s==="chat"&&c.jsx(oR,{}),e[46]=s,e[47]=G):G=e[47],e[48]!==s?(q=s==="logs"&&c.jsx(m3,{}),e[48]=s,e[49]=q):q=e[49],e[50]!==s?(Y=s==="tracing"&&c.jsx(YF,{}),e[50]=s,e[51]=Y):Y=e[51],e[52]!==s?(te=s==="secrets"&&c.jsx(OF,{}),e[52]=s,e[53]=te):te=e[53],e[54]!==z||e[55]!==D||e[56]!==F||e[57]!==B||e[58]!==U||e[59]!==O||e[60]!==S||e[61]!==$||e[62]!==E||e[63]!==W||e[64]!==G||e[65]!==q||e[66]!==Y||e[67]!==te?(oe=c.jsx(M.Suspense,{children:c.jsxs(zc,{children:[z,D,F,B,U,O,S,$,E,W,G,q,Y,te]})}),e[54]=z,e[55]=D,e[56]=F,e[57]=B,e[58]=U,e[59]=O,e[60]=S,e[61]=$,e[62]=E,e[63]=W,e[64]=G,e[65]=q,e[66]=Y,e[67]=te,e[68]=oe):oe=e[68],e[69]!==R||e[70]!==oe?(se=c.jsx(xc,{children:c.jsxs("div",{className:"flex flex-col h-full flex-1 overflow-hidden mr-[-4px]",children:[R,oe]})}),e[69]=R,e[70]=oe,e[71]=se):se=e[71];const Z=se,Q=o&&"border-r border-l border-[var(--slate-7)]";let ue,me,ce,fe,de,ke;e[72]!==Q?(ue=Ne("dark:bg-[var(--slate-1)] no-print print:hidden hide-on-fullscreen",Q),e[72]=Q,e[73]=ue):ue=e[73],e[74]===Symbol.for("react.memo_cache_sentinel")?(me=(ye,$e)=>{var ze;$e===0&&ye===10&&((ze=l.current)==null||ze.resize(30))},e[74]=me):me=e[74],e[75]!==i?(ce=()=>i(!1),fe=()=>i(!0),e[75]=i,e[76]=ce,e[77]=fe):(ce=e[76],fe=e[77]),e[78]!==Z||e[79]!==y?(de=c.jsxs("span",{className:"flex flex-row h-full",children:[Z," ",y]}),e[78]=Z,e[79]=y,e[80]=de):de=e[80],e[81]!==ue||e[82]!==ce||e[83]!==fe||e[84]!==de?(ke=c.jsx($c,{ref:l,id:"helper",collapsedSize:0,collapsible:!0,className:ue,minSize:10,defaultSize:0,maxSize:75,onResize:me,onCollapse:ce,onExpand:fe,children:de},"helper"),e[81]=ue,e[82]=ce,e[83]=fe,e[84]=de,e[85]=ke):ke=e[85];const Se=ke,ie=r&&"border-[var(--slate-7)]";let je,pe,Ae,Fe,De,Ve,Le,ot,Qe;e[86]!==ie?(je=Ne("dark:bg-[var(--slate-1)] no-print print:hidden hide-on-fullscreen",ie),e[86]=ie,e[87]=je):je=e[87],e[88]===Symbol.for("react.memo_cache_sentinel")?(pe=(ye,$e)=>{var ze;$e===0&&ye===10&&((ze=d.current)==null||ze.resize(30))},e[88]=pe):pe=e[88],e[89]!==a?(Ae=()=>a(!1),Fe=()=>a(!0),e[89]=a,e[90]=Ae,e[91]=Fe):(Ae=e[90],Fe=e[91]),e[92]===Symbol.for("react.memo_cache_sentinel")?(De=c.jsx("div",{}),e[92]=De):De=e[92],e[93]!==a?(Ve=()=>a(!1),e[93]=a,e[94]=Ve):Ve=e[94],e[95]!==r||e[96]!==Ve?(Le=c.jsx(M.Suspense,{fallback:De,children:c.jsx(ZF,{visible:r,onClose:Ve})}),e[95]=r,e[96]=Ve,e[97]=Le):Le=e[97],e[98]!==r||e[99]!==Le?(ot=c.jsx(RL,{isOpen:r,children:Le}),e[98]=r,e[99]=Le,e[100]=ot):ot=e[100],e[101]!==je||e[102]!==Ae||e[103]!==Fe||e[104]!==ot||e[105]!==N?(Qe=c.jsxs($c,{ref:d,id:"terminal",collapsedSize:0,collapsible:!0,className:je,minSize:10,defaultSize:0,maxSize:75,onResize:pe,onCollapse:Ae,onExpand:Fe,children:[N,ot]},"terminal"),e[101]=je,e[102]=Ae,e[103]=Fe,e[104]=ot,e[105]=N,e[106]=Qe):Qe=e[106];const tt=Qe;let ne,ve,Ce,Re,J,ae,_e,ge;return e[107]===Symbol.for("react.memo_cache_sentinel")?(ne=sW(),e[107]=ne):ne=e[107],e[108]===Symbol.for("react.memo_cache_sentinel")?(ve=c.jsx(zc,{children:c.jsx(FO,{})}),e[108]=ve):ve=e[108],e[109]!==tt?(Ce=c.jsx(Fy,{capability:"terminal",children:tt}),e[109]=tt,e[110]=Ce):Ce=e[110],e[111]!==g||e[112]!==Ce?(Re=c.jsx($c,{children:c.jsxs(AS,{autoSaveId:"marimo:chrome:v1:l1",direction:"vertical",children:[g,Ce]})}),e[111]=g,e[112]=Ce,e[113]=Re):Re=e[113],e[114]===Symbol.for("react.memo_cache_sentinel")?(J=c.jsx(mH,{}),e[114]=J):J=e[114],e[115]!==Se||e[116]!==Re?(ae=c.jsxs(AS,{autoSaveId:"marimo:chrome:v1:l2",direction:"horizontal",storage:ne,children:[ve,Se,Re,J]}),e[115]=Se,e[116]=Re,e[117]=ae):ae=e[117],e[118]===Symbol.for("react.memo_cache_sentinel")?(_e=c.jsx(xc,{children:c.jsx(zc,{children:c.jsx(OO,{})})}),e[118]=_e):_e=e[118],e[119]!==ae?(ge=c.jsxs(iW,{children:[ae,_e]}),e[119]=ae,e[120]=ge):ge=e[120],ge};function ez(){window.dispatchEvent(new Event("resize"))}function tz(){requestAnimationFrame(ez)}function nz(){window.dispatchEvent(new Event("resize"))}function oz(){requestAnimationFrame(nz)}let S3;S3=new URL(window.location.href).searchParams.get(pH.showChrome)==="false",JS=Object.freeze(Object.defineProperty({__proto__:null,default:t=>{const e=K.c(10);if(S3){let s,i,a;return e[0]!==t?(s=c.jsx(Ly,{hideControls:!0,...t}),e[0]=t,e[1]=s):s=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(eg,{}),e[2]=i):i=e[2],e[3]!==s?(a=c.jsxs(c.Fragment,{children:[s,i]}),e[3]=s,e[4]=a):a=e[4],a}let n,o,r;return e[5]!==t?(n=c.jsx(Ly,{...t}),e[5]=t,e[6]=n):n=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(o=c.jsx(eg,{}),e[7]=o):o=e[7],e[8]!==n?(r=c.jsxs(QF,{children:[n,o]}),e[8]=n,e[9]=r):r=e[9],r}},Symbol.toStringTag,{value:"Module"}))});export{op as C,qc as E,yn as P,dW as __tla,Gc as a,JS as e,_a as f};
|