@marimo-team/frontend 0.14.8-dev5 → 0.14.8-dev6
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-DEfuvRlm.js → ConnectedDataExplorerComponent-CYmpnTn_.js} +1 -1
- package/dist/assets/{ImageComparisonComponent-CM5mcXb2.js → ImageComparisonComponent--5-lO_ES.js} +1 -1
- package/dist/assets/{VegaLite-f5rO5fju.js → VegaLite-DLW84dFp.js} +1 -1
- package/dist/assets/{_baseEach-DoSMVVEH.js → _baseEach-FnH5SKIB.js} +1 -1
- package/dist/assets/_baseMap-KGy9mFen.js +1 -0
- package/dist/assets/{_baseUniq-BVVpHwSp.js → _baseUniq-BzMvLNro.js} +1 -1
- package/dist/assets/{_createAggregator-BS668Eim.js → _createAggregator-Cvb8EMxO.js} +1 -1
- package/dist/assets/{any-language-editor-DDE_A41z.js → any-language-editor-DxHcCRUo.js} +1 -1
- package/dist/assets/{architectureDiagram-IEHRJDOE-60TZkOSo.js → architectureDiagram-IEHRJDOE-CO83sI0X.js} +1 -1
- package/dist/assets/{blockDiagram-JOT3LUYC-D_bfYQ1W.js → blockDiagram-JOT3LUYC-oxKIgJ23.js} +1 -1
- package/dist/assets/{c4Diagram-VJAJSXHY-2RnlK5MW.js → c4Diagram-VJAJSXHY-B1nBFpfO.js} +1 -1
- package/dist/assets/channel-BzmH5ale.js +1 -0
- package/dist/assets/{chunk-4BMEZGHF-DjDWkboJ.js → chunk-4BMEZGHF-BPuJg8QQ.js} +1 -1
- package/dist/assets/{chunk-A2AXSNBT-Bphhjp_9.js → chunk-A2AXSNBT-CFIg1rGY.js} +1 -1
- package/dist/assets/{chunk-AEK57VVT-EHtcMbuG.js → chunk-AEK57VVT-CuK-nwV4.js} +1 -1
- package/dist/assets/{chunk-D6G4REZN-CaiEek1J.js → chunk-D6G4REZN-BNb4759I.js} +1 -1
- package/dist/assets/{chunk-RZ5BOZE2-DtGrt2KV.js → chunk-RZ5BOZE2-BeZYs5Ig.js} +1 -1
- package/dist/assets/{chunk-XZIHB7SX-C3JxGRwm.js → chunk-XZIHB7SX-D72sGxGq.js} +1 -1
- package/dist/assets/{circle-play-BGaLsUGT.js → circle-play-Cvl-9kpT.js} +1 -1
- package/dist/assets/classDiagram-GIVACNV2-DHdsmdYC.js +1 -0
- package/dist/assets/classDiagram-v2-COTLJTTW-DHdsmdYC.js +1 -0
- package/dist/assets/clone-CLY66C3E.js +1 -0
- package/dist/assets/{compile-II-_FrhU.js → compile-BMCn2vE3.js} +1 -1
- package/dist/assets/{dagre-OKDRZEBW-CfwPCOPe.js → dagre-OKDRZEBW-BbWEbhHb.js} +1 -1
- package/dist/assets/{data-editor-Bo1cJUED.js → data-editor-DO8px2IC.js} +1 -1
- package/dist/assets/{diagram-SSKATNLV-DQ2HFnf1.js → diagram-SSKATNLV-CmcpVSp6.js} +1 -1
- package/dist/assets/{diagram-VNBRO52H-Bkfi9ixf.js → diagram-VNBRO52H-CjiRqp8W.js} +1 -1
- package/dist/assets/{edit-page-C_mv2M9Y.js → edit-page-DpIs4Jeh.js} +3 -3
- package/dist/assets/{erDiagram-Q7BY3M3F-XXo5vM2J.js → erDiagram-Q7BY3M3F-D23p5cbI.js} +1 -1
- package/dist/assets/{flowDiagram-4HSFHLVR-ClYS30J_.js → flowDiagram-4HSFHLVR-3ExDKEGl.js} +1 -1
- package/dist/assets/{ganttDiagram-APWFNJXF-PYCGdNTL.js → ganttDiagram-APWFNJXF-D9VTD9XD.js} +1 -1
- package/dist/assets/{gitGraphDiagram-7IBYFJ6S-BmrwYh6H.js → gitGraphDiagram-7IBYFJ6S-Bn_pINfE.js} +1 -1
- package/dist/assets/{graph-CWfI8ofr.js → graph-Cv0AtaRf.js} +1 -1
- package/dist/assets/{home-page-BtzHBDBc.js → home-page-CRP3IHpV.js} +1 -1
- package/dist/assets/{index-DxuMI5IZ.js → index-B2gQZNft.js} +1 -1
- package/dist/assets/{index-Bgn8C5u3.js → index-B6DH7WAG.js} +1 -1
- package/dist/assets/{index-BeAR3ttA.js → index-BKIw-nTk.js} +1 -1
- package/dist/assets/{index-DUTwfd2N.js → index-BTMKLO1n.js} +1 -1
- package/dist/assets/{index-CBxgNTzl.js → index-BoVrSPna.js} +1 -1
- package/dist/assets/{index-Bo_YimmO.js → index-C1GzY49R.js} +1 -1
- package/dist/assets/{index-B_zAOTnu.js → index-CH_vjHJs.js} +1 -1
- package/dist/assets/{index-BAKLY1vn.js → index-Cb2EzYJO.js} +1 -1
- package/dist/assets/{index-BXk22EGt.js → index-Cd9N2R3M.js} +1 -1
- package/dist/assets/{index-GkTVrWOP.js → index-CfCsWmku.js} +1 -1
- package/dist/assets/{index-C80lzoSZ.js → index-D-01nLUB.js} +1 -1
- package/dist/assets/{index-DyngPC-h.js → index-DJwntWVz.js} +1 -1
- package/dist/assets/{index-C97E4DPL.js → index-DW39dZX6.js} +1 -1
- package/dist/assets/{index-_5U3krjw.js → index-DdLVbr3B.js} +1 -1
- package/dist/assets/{index-BjEFPOfG.js → index-DlZmbF5y.js} +1 -1
- package/dist/assets/{index-C242JsH1.js → index-Dneegn3v.js} +1 -1
- package/dist/assets/{index-D3ETG5lC.js → index-G5_5OkDd.js} +1 -1
- package/dist/assets/{index-BogUqXsb.js → index-UohZ6mc7.js} +1 -1
- package/dist/assets/{index-BRG7BYdR.js → index-l_wokygA.js} +12 -12
- package/dist/assets/{infoDiagram-PH2N3AL5-uxYNd2te.js → infoDiagram-PH2N3AL5-Bf4uF_kd.js} +1 -1
- package/dist/assets/{journeyDiagram-U35MCT3I-BgHIlgOe.js → journeyDiagram-U35MCT3I-Dm-d6spo.js} +1 -1
- package/dist/assets/{kanban-definition-NDS4AKOZ-C8w2m7XV.js → kanban-definition-NDS4AKOZ-Dp7Lt7a7.js} +1 -1
- package/dist/assets/{layout-D4Hi2l3_.js → layout-DBIauRjl.js} +1 -1
- package/dist/assets/{mermaid-Dia-lIHk.js → mermaid-Cb2iP_U0.js} +4 -4
- package/dist/assets/{min-Cpvs9FX2.js → min-DWa_Ex5z.js} +1 -1
- package/dist/assets/{mindmap-definition-ALO5MXBD-Cl7WFdOL.js → mindmap-definition-ALO5MXBD-BK82nZEj.js} +1 -1
- package/dist/assets/{pieDiagram-IB7DONF6-BCkALcKk.js → pieDiagram-IB7DONF6-CrSKNHpL.js} +1 -1
- package/dist/assets/{quadrantDiagram-7GDLP6J5-Bm4DXZnX.js → quadrantDiagram-7GDLP6J5-DBYendvc.js} +1 -1
- package/dist/assets/{radar-MK3ICKWK-m1qGKX1l.js → radar-MK3ICKWK-D4iXNJyD.js} +1 -1
- package/dist/assets/{react-plotly-BLm9UAMh.js → react-plotly-jrAUcM2q.js} +1 -1
- package/dist/assets/{requirementDiagram-KVF5MWMF-DxiCXyRK.js → requirementDiagram-KVF5MWMF-Cvshvvk-.js} +1 -1
- package/dist/assets/{run-page-BRrMRpkE.js → run-page-Bep2eRDR.js} +1 -1
- package/dist/assets/{sankeyDiagram-QLVOVGJD-DsbFddGV.js → sankeyDiagram-QLVOVGJD-Dp3RYFKL.js} +1 -1
- package/dist/assets/{sequenceDiagram-X6HHIX6F-CKKF3iN6.js → sequenceDiagram-X6HHIX6F-DkbSZR7j.js} +1 -1
- package/dist/assets/{shutdown-button-BRqNY4x0.js → shutdown-button-D0N1es_c.js} +1 -1
- package/dist/assets/{slides-component-d0lnbGkP.js → slides-component-DN5s759D.js} +1 -1
- package/dist/assets/{sortBy-DKAw-tZa.js → sortBy-C53me3k8.js} +1 -1
- package/dist/assets/{stateDiagram-DGXRK772-DC5pw4fa.js → stateDiagram-DGXRK772-DL3Ta588.js} +1 -1
- package/dist/assets/stateDiagram-v2-YXO3MK2T-CzvyvBru.js +1 -0
- package/dist/assets/{storage-ouQPa_tr.js → storage-BhACHptC.js} +6 -6
- package/dist/assets/{terminal--YvoRK0r.js → terminal-GCVl-wqy.js} +1 -1
- package/dist/assets/{timeline-definition-BDJGKUSR-CupfhmvP.js → timeline-definition-BDJGKUSR-Dea-r6Ah.js} +1 -1
- package/dist/assets/{tracing-BQXBWY23.js → tracing-ChqPtgQh.js} +2 -2
- package/dist/assets/{transform-CzICUQw2.js → transform-Bze8Q3sQ.js} +1 -1
- package/dist/assets/{vega-component-DtuPSr8Q.js → vega-component-DJl4V3OP.js} +1 -1
- package/dist/assets/{xychartDiagram-VJFVF3MP-BLmNorBW.js → xychartDiagram-VJFVF3MP-JON3t4jP.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/_baseMap-DxzKXZWb.js +0 -1
- package/dist/assets/channel-DjeZJwED.js +0 -1
- package/dist/assets/classDiagram-GIVACNV2-C0Z_9O7c.js +0 -1
- package/dist/assets/classDiagram-v2-COTLJTTW-C0Z_9O7c.js +0 -1
- package/dist/assets/clone-B_4k1gKL.js +0 -1
- package/dist/assets/stateDiagram-v2-YXO3MK2T-BFTFqSej.js +0 -1
@@ -1,5 +1,5 @@
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./tracing-
|
2
|
-
var tz=Object.defineProperty;var B3=Bt=>{throw TypeError(Bt)};var nz=(Bt,Et,gn)=>Et in Bt?tz(Bt,Et,{enumerable:!0,configurable:!0,writable:!0,value:gn}):Bt[Et]=gn;var Q=(Bt,Et,gn)=>nz(Bt,typeof Et!="symbol"?Et+"":Et,gn),oz=(Bt,Et,gn)=>Et.has(Bt)||B3("Cannot "+gn);var U3=(Bt,Et,gn)=>(oz(Bt,Et,"read from private field"),gn?gn.call(Bt):Et.get(Bt)),V3=(Bt,Et,gn)=>Et.has(Bt)?B3("Cannot add the same private member more than once"):Et instanceof WeakSet?Et.add(Bt):Et.set(Bt,gn);import{u as De,Y as A,g$ as rz,h0 as sz,h1 as $3,h2 as iz,h3 as az,h4 as lz,a as Y,h5 as cz,h6 as Rr,h7 as dz,h8 as um,h9 as H3,ha as uz,hb as hz,hc as W3,hd as cc,c as J,eR as fz,ax as lt,j as u,an as no,au as ar,at as Ls,av as Fs,bB as lr,a1 as Me,aw as xn,he as oa,as as cr,a$ as Hn,ay as ra,ab as Te,a7 as Qt,ec as hm,e$ as zs,hf as mz,aW as et,af as Ot,hg as pz,f5 as Wn,hh as q3,hi as G3,hj as fm,hk as Y3,hl as gz,L as Dt,dV as dc,b6 as dr,hm as uc,b8 as mm,aB as In,hn as _z,ae as pm,ho as bz,hp as J3,f4 as K3,a5 as en,bf as X3,hq as Z3,cv as gm,hr as yz,e3 as dt,hs as Q3,ea as _m,ht as xz,hu as hc,a4 as $e,bm as qn,hv as fc,hw as Bs,eW as Us,hx as wz,hy as sa,hz as vz,f2 as kz,hA as e4,hB as t4,eF as Sz,hC as ur,hD as Pr,b4 as mc,hE as Cz,hF as pc,hG as n4,ac as Vs,et as o4,ad as ia,hH as Nz,hI as bm,hJ as Lr,bD as Fr,$ as zo,eX as $s,fD as r4,gn as zr,fS as jz,bp as an,hK as Ez,hL as Iz,gl as ym,aY as gc,hM as xm,hN as Az,hO as s4,hP as wm,hQ as Tz,hR as Mz,hS as go,hT as i4,gr as vm,hU as aa,hV as _c,eK as Se,hW as Ge,hX as km,hY as St,hZ as a4,dP as bc,dL as yc,dM as xc,dN as wc,dK as la,h_ as Oz,fQ as Sm,be as An,aS as Gn,fG as l4,fI as c4,fJ as Dz,fO as Rz,fK as d4,a0 as Ie,eE as Pz,b2 as Hs,bc as Ws,b3 as qs,b9 as Gt,f3 as _o,h$ as Lz,fM as u4,i0 as Fz,fE as h4,fF as f4,i1 as Br,dO as m4,i2 as p4,i3 as zz,i4 as Bz,ar as Uz,aq as Vz,i5 as Cm,dS as $z,dU as Nm,fs as vc,i6 as kc,i7 as Sc,bG as Tn,i8 as Hz,e_ as ca,fp as mn,bu as g4,ed as Vt,i9 as Wz,ez as qz,ao as jm,ia as da,ib as Cc,ic as Gz,id as Yz,ie as _4,ig as pn,gq as b4,eG as Nc,bx as Jz,ih as Kz,aA as Em,b5 as Xz,ii as Zz,gM as Im,bt as jc,ij as Am,az as ua,eS as y4,ik as Qz,ap as eB,il as x4,im as tB,io as nB,ip as oB,iq as rB,ir as sB,dQ as Bo,is as iB,it as Ec,iu as Gs,o as Uo,n as st,g5 as Mn,iv as On,iw as ut,ix as Ys,iy as zt,gm as Yt,iz as Tm,eJ as oo,iA as aB,iB as lB,br as w4,bs as v4,iC as k4,iD as cB,gP as Js,iE as Ic,bo as Ac,gO as Ur,f6 as Mm,iF as dB,iG as uB,iH as hB,iI as fB,iJ as S4,iK as ha,iL as C4,iM as mB,iN as N4,iO as j4,iP as pB,iQ as E4,iR as I4,f7 as Tc,iS as gB,iT as A4,iU as fa,iV as ma,iW as Mc,iX as hr,iY as T4,iZ as Vo,i_ as Ks,i$ as Om,j0 as pa,j1 as Xs,j2 as Dm,j3 as Rm,j4 as M4,j5 as Oc,j6 as _B,Z as ga,j7 as _a,j8 as bB,e9 as Dc,j9 as yB,ja as Pm,jb as xB,jc as wB,jd as Rc,ei as vB,je as Lm,jf as Zs,jg as Pc,jh as Qs,g4 as Yn,gf as $o,g1 as O4,cb as D4,ji as Fm,fP as ba,jj as zm,jk as R4,jl as P4,jm as Bm,jn as ya,jo as xa,jp as wa,jq as kB,fZ as Lc,jr as Fc,js as zc,ey as SB,f_ as CB,jt as NB,ju as jB,r as EB,jv as IB,jw as AB,jx as TB,g8 as MB,jy as fr,jz as OB,jA as L4,t as R,jB as DB,jC as RB,jD as PB,jE as LB,jF as FB,jG as zB,jH as BB,jI as UB,jJ as VB,jK as $B,jL as HB,jM as WB,jN as qB,jO as GB,jP as YB,jQ as JB,jR as KB,jS as XB,jT as ZB,jU as QB,jV as eU,jW as tU,jX as nU,jY as oU,jZ as rU,j_ as sU,j$ as F4,k0 as iU,k1 as aU,k2 as lU,k3 as Um,k4 as Bc,k5 as z4,k6 as cU,k7 as dU,k8 as B4,k9 as uU,ka as ei,kb as Jn,kc as hU,kd as fU,ke as mU,kf as pU,kg as gU,kh as _U,ki as bU,kj as yU,kk as xU,kl as wU,km as mr,kn as vU,ko as kU,kp as SU,kq as CU,ef as NU,kr as jU,ks as U4,ej as EU,kt as Uc,ku as IU,kv as AU,kw as TU,kx as MU,a2 as pr,ky as Vc,kz as OU,kA as DU,kB as V4,kC as Vm,gN as ti,kD as RU,kE as PU,kF as LU,kG as FU,gd as zU,bA as BU,a6 as $m,kH as $4,kI as UU,kJ as VU,kK as Hm,kL as Wm,kM as $U,kN as H4,kO as W4,kP as $c,g0 as HU,ai as q4,e1 as WU,kQ as G4,fB as jt,kR as va,kS as ni,kT as qU,kU as GU,kV as qm,kW as YU,ca as Gm,kX as JU,bq as Y4,kY as KU,kZ as XU,k_ as Hc,k$ as J4,d$ as Ym,bC as K4,l0 as ZU,l1 as QU,l2 as X4,l3 as eV,l4 as tV,l5 as Z4,aj as Jm,l6 as nV,bE as Q4,l7 as oV,eZ as rV,l8 as Ho,eC as eS,l9 as tS,f1 as nS,fT as Wc,la as Km,lb as oS,b1 as Xm,eD as qc,lc as rS,ld as sV,le as iV,lf as aV,lg as sS,lh as lV,li as iS,lj as cV,gE as dV,fH as uV,fL as Zm,gH as hV,bz as Gc,lk as fV,ll as aS,lm as Qm,ln as mV,lo as pV,lp as gV,lq as _V,lr as lS,fu as ep,dX as cS,ls as bV,lt as yV,lu as xV,aX as wV,lv as vV,lw as kV,lx as SV,ly as CV,ag as NV,lz as Yc,ah as jV,lA as dS,fq as EV,lB as uS,ak as Kn,fX as IV,lC as AV,lD as TV,lE as hS,lF as MV,lG as oi,lH as OV,lI as Jc,lJ as DV,lK as RV,D as fS,lL as PV,du as LV,lM as ka,lN as FV,lO as zV,lP as BV,lQ as UV,C as mS,lR as VV,lS as $V,lT as HV,E as Vr,fc as WV,bn as qV,bl as GV,lU as YV,lV as JV,dx as pS,lW as KV,a9 as Kc,lX as XV,aa as gr,d_ as gS,lY as tp,lZ as ZV,eb as _S,l_ as QV,l$ as bS,m0 as e$,m1 as yS,m2 as t$,m3 as n$,m4 as xS,m5 as wS,m6 as vS,fo as kS,m7 as o$,m8 as r$,m9 as SS,ma as CS,mb as Xc,mc as NS,md as s$,me as jS,mf as i$,mg as a$,mh as ES,mi as l$,mj as c$,mk as d$,ml as u$,mm as h$,mn as f$,mo as m$,e8 as p$,mp as g$,mq as _$,ge as np,mr as b$,ms as y$,mt as x$,mu as w$,mv as v$,mw as k$,mx as S$,my as C$,mz as N$,mA as j$,mB as op,mC as E$,g3 as I$,mD as A$,mE as T$,mF as M$,mG as IS,mH as O$,mI as D$,a8 as R$,eU as P$,gw as L$,mJ as F$,mK as AS,mL as TS,gy as rp,gu as ri,gz as $r,gv as Hr,gA as sp,gB as ip,gx as MS,mM as z$,mN as _r,mO as OS,gG as B$,mP as U$,mQ as V$,mR as $$,mS as H$,mT as W$,mU as q$,mV as DS,eL as G$,mW as ap,aC as Zc,mX as RS,mY as PS,aE as LS,aD as Y$,e7 as J$,__tla as K$}from"./index-BRG7BYdR.js";import{b as si,A as X$,L as FS,g as Z$,G as Q$,s as eH,k as tH,B as zS,a as nH,M as oH,Y as rH,c as wn,u as Sa,C as sH,S as iH,K as aH,d as lH,i as cH,e as BS,f as dH,h as uH,j as Ca,P as lp,l as US,m as hH,n as fH,o as mH,p as VS,q as cp,T as pH}from"./shutdown-button-BRqNY4x0.js";import{V as $S,d as ii,I as dp,N as HS,S as WS,e as qS,f as GS,L as YS,F as JS,g as KS,M as gH,l as XS,h as _H,j as br,k as Qc,i as bH,E as ZS,m as up,n as yH,o as hp,p as xH,q as wH,s as vH,t as kH,v as SH,w as CH,x as NH,y as jH,a as EH,C as IH,R as QS,A as AH,b as TH,T as MH,z as OH,B as DH,D as RH,G as PH,O as LH,c as FH,P as zH,__tla as BH}from"./storage-ouQPa_tr.js";import{c as UH}from"./_createAggregator-BS668Eim.js";import{s as ro,i as yr,T as fp,a as mp}from"./transform-CzICUQw2.js";import{s as Na}from"./sortBy-DKAw-tZa.js";let pp,ed,vn,td,eC,ja,gp,VH=Promise.all([(()=>{try{return K$}catch{}})(),(()=>{try{return BH}catch{}})()]).then(async()=>{var ic,z3;var Bt=UH(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});let Et,gn,_p,nd,ai,Wr,bp,yp,xp,wp,Ea,od,vp,Ia,kp,rd,Sp,Cp,sd,Np,jp,Ep,Aa,Ip,id,Ap,Tp,Mp,Op,Dp,Rp,ad,Pp,ld,cd,Lp,Fp,zp,Bp,Up,Ta,Vp,$p,dd,Hp,Wp,qp,ud,Gp,Yp,Jp,Ma,hd,fd,Kp,Xp,Zp,Qp,eg,tg,ng,og,rg,md,pd,sg,ig,ag,Oa,xr,wr;Et=De("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),gn=De("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"}]]),_p=De("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"}]]),nd=De("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),ai=De("ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]),Wr=De("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"}]]),bp=De("chevrons-down",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]),yp=De("chevrons-up",[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]]),td=De("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),xp=De("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),wp=De("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),Ea=De("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),od=De("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"}]]),vp=De("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"}]]),Ia=De("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"}]]),kp=De("code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]),rd=De("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"}]]),Sp=De("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"}]]),Cp=De("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"}]]),sd=De("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"}]]),Np=De("eraser",[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]]),jp=De("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"}]]),Ep=De("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"}]]),Aa=De("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"}]]),Ip=De("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"}]]),id=De("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"}]]),Ap=De("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"}]]),Tp=De("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"}]]),Mp=De("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"}]]),Op=De("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"}]]),Dp=De("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"}]]),Rp=De("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"}]]),ad=De("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"}]]),Pp=De("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"}]]),ld=De("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"}]]),cd=De("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"}]]),Lp=De("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"}]]),Fp=De("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"}]]),zp=De("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"}]]),Bp=De("message-circle-question",[["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"}]]),Up=De("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"}]]),Ta=De("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"}]]),Vp=De("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"}]]),$p=De("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"}]]),dd=De("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"}]]),Hp=De("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Wp=De("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"}]]),qp=De("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"}]]),ud=De("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"}]]),Gp=De("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"}]]),Yp=De("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"}]]),Jp=De("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"}]]),Ma=De("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"}]]),hd=De("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"}]]),fd=De("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"}]]),Kp=De("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"}]]),Xp=De("square-code",[["path",{d:"M10 9.5 8 12l2 2.5",key:"3mjy60"}],["path",{d:"m14 9.5 2 2.5-2 2.5",key:"1bir2l"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),Zp=De("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"}]]),Qp=De("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"}]]),eg=De("square-m",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 16V8l4 4 4-4v8",key:"141u4e"}]]),tg=De("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"}]]),ng=De("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"}]]),og=De("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"}]]),rg=De("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"}]]),md=De("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"}]]),pd=De("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"}]]),sg=De("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]),ig=De("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"}]]),ag=De("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"}]]),Oa=De("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"}]]),xr=De("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"}]]),wr=De("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 tC=A.createContext({}),nC=A.forwardRef(function(t,e){[t,e]=az(t,e,tC);let{toolbarProps:n}=function(s,i){const{"aria-label":a,"aria-labelledby":l,orientation:c="horizontal"}=s;let[d,h]=A.useState(!1);rz(()=>{var p;h(!(!i.current||!(!((p=i.current.parentElement)===null||p===void 0)&&p.closest('[role="toolbar"]'))))});const{direction:f}=sz(),m=f==="rtl"&&c==="horizontal";let _=iz(i);const g=A.useRef(null);return{toolbarProps:{...$3(s,{labelable:!0}),role:d?"group":"toolbar","aria-orientation":c,"aria-label":a,"aria-labelledby":a==null?l:void 0,onKeyDownCapture:d?void 0:p=>{if(p.currentTarget.contains(p.target)){if(c==="horizontal"&&p.key==="ArrowRight"||c==="vertical"&&p.key==="ArrowDown")m?_.focusPrevious():_.focusNext();else{if(!(c==="horizontal"&&p.key==="ArrowLeft"||c==="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:d?void 0:p=>{var b,y;g.current&&!p.currentTarget.contains(p.relatedTarget)&&(!((b=i.current)===null||b===void 0)&&b.contains(p.target))&&((y=g.current)===null||y===void 0||y.focus(),g.current=null)},onBlurCapture:d?void 0:p=>{p.currentTarget.contains(p.relatedTarget)||g.current||(g.current=p.target)}}}}(t,e),o=lz({...t,values:{orientation:t.orientation||"horizontal"},defaultClassName:"react-aria-Toolbar"}),r=$3(t);return delete r.id,Y.createElement("div",{...cz(n,r),...o,ref:e,slot:t.slot||void 0,"data-orientation":t.orientation||"horizontal"},o.children)});function Da(t,e){const n=+Rr(t)-+Rr(e);return n<0?-1:n>0?1:n}function oC(t,e){const n=Rr(t,e==null?void 0:e.in);return+function(o,r){const s=Rr(o,r==null?void 0:r.in);return s.setHours(23,59,59,999),s}(n,e)==+function(o,r){const s=Rr(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 rC(t,e,n){const[o,r,s]=um(n==null?void 0:n.in,t,t,e),i=Da(r,s),a=Math.abs(function(d,h,f){const[m,_]=um(f==null?void 0:f.in,d,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=Da(r,s)===-i;oC(o)&&a===1&&Da(o,s)===1&&(l=!1);const c=i*(a-+l);return c===0?0:c}function sC(t,e,n){const o=function(r,s){return+Rr(r)-+Rr(s)}(t,e)/1e3;return(r=>{const s=(0,Math.trunc)(r);return s===0?0:s})(o)}function iC(t,e){return function(n,o,r){const s=uz(),i=(r==null?void 0:r.locale)??s.locale??hz,a=Da(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}),[c,d]=um(r==null?void 0:r.in,...a>0?[o,n]:[n,o]),h=sC(d,c),f=(H3(d)-H3(c))/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<W3){const g=Math.round(m/60);return i.formatDistance("aboutXHours",g,l)}if(m<2520)return i.formatDistance("xDays",1,l);if(m<cc){const g=Math.round(m/W3);return i.formatDistance("xDays",g,l)}if(m<2*cc)return _=Math.round(m/cc),i.formatDistance("aboutXMonths",_,l);if(_=rC(d,c),_<12){const g=Math.round(m/cc);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 dz(n,Date.now())}(t),e)}const Ra="https://static.marimo.app",aC=t=>{const e=J.c(24),{onClose:n}=t,[o,r]=A.useState("");let s;s=Math.random().toString(36).slice(2,6);const i=`${o}-${s}`,a=`${Ra}/static/${i}`;let l,c,d,h,f,m,_,g,p,b,y;return e[0]!==n||e[1]!==i?(l=async x=>{x.preventDefault(),n();const v=await fz({download:!1,includeCode:!0,files:$S.INSTANCE.filenames()}),S=lt({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${Ra}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:v,path:i})}).catch(()=>{S.dismiss(),lt({title:"Error uploading static page",description:u.jsxs("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",u.jsx("a",{href:no.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),S.dismiss(),lt({title:"Static page uploaded!",description:u.jsxs("div",{children:["The URL has been copied to your clipboard.",u.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")?(c=u.jsx(ar,{children:"Share static notebook"}),e[3]=c):c=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(d=u.jsxs(Ls,{children:[c,u.jsxs(Fs,{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"," ",u.jsx("a",{href:Ra,target:"_blank",children:Ra}),"."]})]}),e[4]=d):d=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(h=x=>{const v=x.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,"");r(v)},e[5]=h):h=e[5],e[6]!==o?(f=u.jsx(lr,{"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=u.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:",u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(lC,{text:a}),u.jsx("span",{className:"text-primary",children:a})]})]}),e[8]=a,e[9]=m):m=e[9],e[10]!==f||e[11]!==m?(_=u.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=u.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=u.jsx(Me,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await xn(a)},children:"Create"}),e[15]=a,e[16]=p):p=e[16],e[17]!==p||e[18]!==g?(b=u.jsxs(oa,{children:[g,p]}),e[17]=p,e[18]=g,e[19]=b):b=e[19],e[20]!==b||e[21]!==l||e[22]!==_?(y=u.jsx(cr,{className:"w-fit",children:u.jsxs("form",{onSubmit:l,children:[d,_,b]})}),e[20]=b,e[21]=l,e[22]=_,e[23]=y):y=e[23],y},lC=t=>{const e=J.c(8),[n,o]=Y.useState(!1);let r;e[0]!==t.text?(r=Hn.stopPropagation(async c=>{c.preventDefault(),await xn(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=u.jsx(ra,{size:14,strokeWidth:1.5}),e[2]=i):i=e[2],e[3]!==s?(a=u.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=u.jsx(Te,{content:"Copied!",open:n,children:a}),e[5]=n,e[6]=a,e[7]=l):l=e[7],l};function lg(){const t=J.c(2),e=Qt(hm);let n;return t[0]!==e?(n=()=>{const o=document.getElementsByClassName("output-area"),r=window.innerHeight||document.documentElement.clientHeight;let s;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=zs.parse(i.parentNode.id);break}}e(i=>({mode:mz(i.mode),cellAnchor:s})),requestAnimationFrame(()=>{var i;s!==null&&((i=document.getElementById(zs.create(s)))==null||i.scrollIntoView())})},t[0]=e,t[1]=n):n=t[1],n}function gd(t){const e=J.c(3),n=_d();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],et(o)}function cg(){const t=J.c(2),e=_d();let n;return t[0]!==e?(n=()=>e(q3(Wn())),t[0]=e,t[1]=n):n=t[1],et(n)}function _d(){const t=J.c(2),{prepareForRun:e}=Ot();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 c of o){const d=r[c],h=(a=d==null?void 0:d.current)==null?void 0:a.editorView;let f;h?(G3(h)!=="markdown"&&fm(h),f=Y3(h)):f=((l=s[c])==null?void 0:l.code)||"",i.push(f),e({cellId:c})}await gz({cellIds:o,codes:i}).catch(cC)},t[0]=e,t[1]=n):n=t[1],et(n)}function cC(t){Dt.error(t)}const bd=[{type:"files",Icon:Ap,tooltip:"View files",position:"sidebar"},{type:"variables",Icon:dc,tooltip:"Explore variables",position:"sidebar"},{type:"datasources",Icon:dr,tooltip:"Explore data sources",position:"sidebar"},{type:"dependencies",Icon:Ta,tooltip:"Explore dependencies",position:"sidebar"},{type:"packages",Icon:si,tooltip:"Manage packages",position:"sidebar"},{type:"outline",Icon:fd,tooltip:"View outline",position:"sidebar"},{type:"chat",Icon:uc,tooltip:"Chat with AI",position:"sidebar"},{type:"documentation",Icon:md,tooltip:"View live docs",position:"sidebar"},{type:"logs",Icon:mm,tooltip:"Notebook logs",position:"sidebar"},{type:"tracing",Icon:X$,tooltip:"Tracing",position:"sidebar"},{type:"snippets",Icon:Zp,tooltip:"Snippets",position:"sidebar"},{type:"secrets",Icon:Rp,tooltip:"Secrets",hidden:In(),position:"sidebar"},{type:"scratchpad",Icon:_z,tooltip:"Scratchpad",position:"sidebar"},{type:"errors",Icon:pm,tooltip:"View errors",position:"footer"}];function dC(){const t=J.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=J.c(11);let c;l[0]!==a?(c=new bz(a),l[0]=a,l[1]=c):c=l[1];const d=c;let h;l[2]!==i||l[3]!==d?(h=()=>d.get(i),l[2]=i,l[3]=d,l[4]=h):h=l[4];const[f,m]=A.useState(h);let _;l[5]!==i||l[6]!==d?(_=b=>{m(b),d.set(i,b)},l[5]=i,l[6]=d,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 dg(t){return t.dropdown!==void 0}function Pa(t,e=""){return t.flatMap(n=>n.label?dg(n)?Pa(n.dropdown,`${e+n.label} > `):{...n,label:e+n.label}:[])}const li=t=>{const e=J.c(8),{children:n,layerTop:o}=t,r=o!==void 0&&o;let s;e[0]!==n?(s=Y.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 c,d;return e[2]!==a||e[3]!==l?(c=u.jsx("div",{className:l,children:a}),e[2]=a,e[3]=l,e[4]=c):c=e[4],e[5]!==i||e[6]!==c?(d=u.jsxs("div",{className:"multi-icon relative w-fit",children:[i,c]}),e[5]=i,e[6]=c,e[7]=d):d=e[7],d},La=en(null),uC=en(!1),yd=X3("marimo:ai:chatState:v2",{chats:[],activeChatId:null}),hC=en(t=>{const e=t(yd);return e.chats.find(n=>n.id===e.activeChatId)},(t,e,n)=>{e(yd,o=>({...o,activeChatId:n}))});function ug(t){return t!==Z3&&!!(t&&t.trim().length>0)}const xd=t=>{const e=J.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],gm(window,"keydown",n,o);const r=t.children??"Undo";let s,i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(s=u.jsx(yz,{className:"ml-2",shortcut:"cmd-z"}),e[3]=s):s=e[3],e[4]!==r||e[5]!==t?(i=u.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 wd(){const t=J.c(3),{deleteCell:e,undoDeleteCell:n}=Ot();let o;return t[0]!==e||t[1]!==n?(o=r=>{var l;if(dt.get(Q3))return;const{cellId:s}=r,i=dt.get(_m),a=(((l=i.cellData[s])==null?void 0:l.code)??"").trim()==="";if(e({cellId:s}),xz({cellId:s}).catch(()=>{n()}),!a){const{dismiss:c}=lt({title:"Cell deleted",description:"You can bring it back by clicking undo or through the command palette.",action:u.jsx(xd,{"data-testid":"undo-delete-button",onClick:()=>{n(),d()}})}),d=c}},t[0]=e,t[1]=n,t[2]=o):o=t[2],et(o)}function hg(){const t=J.c(3),{splitCell:e,undoSplitCell:n}=Ot();let o;return t[0]!==e||t[1]!==n?(o=r=>{const s=hc(r.cellId);if(!s)return;const i=Y3(s);e(r);const{dismiss:a}=lt({title:"Cell split",action:u.jsx(xd,{"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],et(o)}function vd(t){const e=J.c(49),{cell:n}=t,{createNewCell:o,updateCellConfig:r,updateCellName:s,moveCell:i,sendToTop:a,sendToBottom:l,addColumnBreakpoint:c,clearCellOutput:d}=Ot(),h=hg(),f=gd(n==null?void 0:n.cellId),m=!$e(Q3),_=wd(),{openModal:g}=qn(),p=Qt(La),b=$e(fc),y=$e(Bs),x=$e(Us),v=$e(wz);if(!n||x){let j;return e[0]===Symbol.for("react.memo_cache_sentinel")?(j=[],e[0]=j):j=e[0],j}const{cellId:S,config:k,getEditorView:E,name:N,hasOutput:I,hasConsoleOutput:T,status:M}=n;let D;e[1]!==S||e[2]!==k.disabled||e[3]!==r?(D=async()=>{const j={disabled:!k.disabled};await Lr({configs:{[S]:j}}),r({cellId:S,config:j})},e[1]=S,e[2]=k.disabled,e[3]=r,e[4]=D):D=e[4];const z=D;let O;e[5]!==S||e[6]!==k.hide_code||e[7]!==E||e[8]!==r?(O=async()=>{const j={hide_code:!k.hide_code};await Lr({configs:{[S]:j}}),r({cellId:S,config:j});const W=E();W&&(j.hide_code?W.contentDOM.blur():W.focus())},e[5]=S,e[6]=k.hide_code,e[7]=E,e[8]=r,e[9]=O):O=e[9];const F=O;let B,V,L,C,$;return e[10]===Symbol.for("react.memo_cache_sentinel")?(B=u.jsx(rg,{size:13,strokeWidth:1.5}),e[10]=B):B=e[10],e[11]!==S||e[12]!==N||e[13]!==g||e[14]!==s?(V=()=>{g(u.jsxs(cr,{children:[u.jsx(Ls,{children:u.jsx(ar,{children:"Rename cell"})}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(Fr,{htmlFor:"cell-name",children:"Cell name"}),u.jsx(HS,{placeholder:"cell name",value:N,onKeyDown:j=>{j.key==="Enter"&&(j.preventDefault(),j.stopPropagation(),g(null))},onChange:j=>s({cellId:S,name:j})})]})]}))},e[11]=S,e[12]=N,e[13]=g,e[14]=s,e[15]=V):V=e[15],e[16]!==S||e[17]!==s?(L=j=>s({cellId:S,name:j}),e[16]=S,e[17]=s,e[18]=L):L=e[18],e[19]!==N||e[20]!==L?(C=u.jsx(HS,{placeholder:"cell name",value:N,onChange:L}),e[19]=N,e[20]=L,e[21]=C):C=e[21],e[22]!==c||e[23]!==b||e[24]!==v||e[25]!==y||e[26]!==m||e[27]!==S||e[28]!==d||e[29]!==k.disabled||e[30]!==k.hide_code||e[31]!==o||e[32]!==_||e[33]!==E||e[34]!==T||e[35]!==I||e[36]!==i||e[37]!==N||e[38]!==f||e[39]!==l||e[40]!==a||e[41]!==p||e[42]!==h||e[43]!==M||e[44]!==V||e[45]!==C||e[46]!==z||e[47]!==F?($=[[{icon:B,label:"Name",disableClick:!0,handle:gC,handleHeadless:V,rightElement:C},{icon:u.jsx(ii,{size:13,strokeWidth:1.5}),label:"Run cell",hotkey:"cell.run",hidden:M==="running"||M==="queued"||M==="disabled-transitively"||k.disabled,handle:()=>f()},{icon:u.jsx(sa,{size:13,strokeWidth:1.5}),label:"AI completion",hidden:!b,handle:()=>{p(j=>(j==null?void 0:j.cellId)===S?null:{cellId:S})},hotkey:"cell.aiCompletion"},{icon:u.jsx(hd,{size:13,strokeWidth:1.5}),label:"Split cell",hotkey:"cell.splitCell",handle:()=>h({cellId:S})},{icon:u.jsx(dp,{size:13,strokeWidth:1.5}),label:"Export output as PNG",hidden:!I,handle:()=>function(j){const W=document.getElementById(J3.create(j));W&&(W.classList.add("printing-output"),K3(W,"result.png").finally(()=>{W.classList.remove("printing-output")}))}(S)},{icon:u.jsx(kz,{size:13,strokeWidth:1.5}),label:"Format cell",hotkey:"cell.format",handle:()=>{const j=E();j&&vz({[S]:j})}},{icon:k.hide_code?u.jsx(e4,{size:13,strokeWidth:1.5}):u.jsx(t4,{size:13,strokeWidth:1.5}),label:k.hide_code?"Show code":"Hide code",handle:F,hotkey:"cell.hideCode"},{icon:k.disabled?u.jsx(xr,{size:13,strokeWidth:1.5}):u.jsx(wr,{size:13,strokeWidth:1.5}),label:"Reactive execution",rightElement:u.jsx(Sz,{"data-testid":"cell-disable-switch",checked:!k.disabled,size:"sm",onCheckedChange:z}),handle:z},{icon:u.jsx(pm,{size:13,strokeWidth:1.5}),label:"Clear output",hidden:!(I||T),handle:()=>{d({cellId:S})}}],[{icon:u.jsx(mc,{}),label:"Convert to Markdown",hotkey:"cell.viewAsMarkdown",handle:()=>{const j=E();j&&(ur(y,o),Pr(j,"markdown",{keepCodeAsIs:!1}))}},{icon:u.jsx(dr,{size:13,strokeWidth:1.5}),label:"Convert to SQL",handle:()=>{const j=E();j&&(ur(y,o),Pr(j,"sql",{keepCodeAsIs:!1}))}},{icon:u.jsx(pc,{}),label:"Toggle as Python",handle:()=>{const j=E();j&&(ur(y,o),Cz(j,"python",{force:!0}))}}],[{icon:u.jsxs(li,{children:[u.jsx(Ea,{size:13,strokeWidth:1.5}),u.jsx(n4,{size:8,strokeWidth:2})]}),label:"Create cell above",hotkey:"cell.createAbove",handle:()=>o({cellId:S,before:!0})},{icon:u.jsxs(li,{children:[u.jsx(Ea,{size:13,strokeWidth:1.5}),u.jsx(Vs,{size:8,strokeWidth:2})]}),label:"Create cell below",hotkey:"cell.createBelow",handle:()=>o({cellId:S,before:!1})},{icon:u.jsx(n4,{size:13,strokeWidth:1.5}),label:"Move cell up",hotkey:"cell.moveUp",handle:()=>i({cellId:S,before:!0})},{icon:u.jsx(Vs,{size:13,strokeWidth:1.5}),label:"Move cell down",hotkey:"cell.moveDown",handle:()=>i({cellId:S,before:!1})},{icon:u.jsx(o4,{size:13,strokeWidth:1.5}),label:"Move cell left",hotkey:"cell.moveLeft",handle:()=>i({cellId:S,direction:"left"}),hidden:v!=="columns"},{icon:u.jsx(ia,{size:13,strokeWidth:1.5}),label:"Move cell right",hotkey:"cell.moveRight",handle:()=>i({cellId:S,direction:"right"}),hidden:v!=="columns"},{icon:u.jsx(yp,{size:13,strokeWidth:1.5}),label:"Send to top",hotkey:"cell.sendToTop",handle:()=>a({cellId:S})},{icon:u.jsx(bp,{size:13,strokeWidth:1.5}),label:"Send to bottom",hotkey:"cell.sendToBottom",handle:()=>l({cellId:S})},{icon:u.jsx(Nz,{size:13,strokeWidth:1.5}),label:"Break into new column",hotkey:"cell.addColumnBreakpoint",hidden:v!=="columns",handle:()=>c({cellId:S})}],[{icon:u.jsx(FS,{size:13,strokeWidth:1.5}),label:"Copy link to cell",disabled:!ug(N),tooltip:ug(N)?void 0:"Only named cells can be linked to",handle:async()=>{await xn(function(j){const W=new URL(window.location.href);return W.hash=`scrollTo=${encodeURIComponent(j)}`,W.toString()}(N)),lt({description:"Link copied to clipboard"})}}],[{label:"Delete",hidden:!m,variant:"danger",icon:u.jsx(bm,{size:13,strokeWidth:1.5}),handle:()=>{_({cellId:S})}}]].map(mC).filter(fC),e[22]=c,e[23]=b,e[24]=v,e[25]=y,e[26]=m,e[27]=S,e[28]=d,e[29]=k.disabled,e[30]=k.hide_code,e[31]=o,e[32]=_,e[33]=E,e[34]=T,e[35]=I,e[36]=i,e[37]=N,e[38]=f,e[39]=l,e[40]=a,e[41]=p,e[42]=h,e[43]=M,e[44]=V,e[45]=C,e[46]=z,e[47]=F,e[48]=$):$=e[48],$}function fC(t){return t.length>0}function mC(t){return t.filter(pC)}function pC(t){return!t.hidden}function gC(t){t==null||t.stopPropagation(),t==null||t.preventDefault()}function _C(t){return!t.hidden}const kd=en(!1),fg=()=>{const t=J.c(37),[e,n]=an(kd),o=Ez(),r=$e(Iz),s=$e(ym);let i;t[0]!==r?(i={cell:r},t[0]=r,t[1]=i):i=t[1];let a=vd(i).flat();a=Pa(a);const l=function(){const L=J.c(45),{theme:C}=zo(),[$,j]=$s(),[W,K]=r4();let Z;L[0]!==j?(Z=async ce=>{await zr({config:ce}).then(()=>{j(ce)})},L[0]=j,L[1]=Z):Z=L[1];const q=Z;let te;L[2]!==K?(te=async ce=>{await jz({config:ce}).then(()=>{K(ce)})},L[2]=K,L[3]=te):te=L[3];const re=te;let ae;if(L[4]!==W||L[5]!==$||L[6]!==re||L[7]!==q||L[8]!==C){let ce,me,ue;L[10]!==W?(ce=Qe=>Qe!==W.width,L[10]=W,L[11]=ce):ce=L[11],L[12]!==W||L[13]!==re?(me=Qe=>({label:`App config > Set width=${Qe}`,handle:()=>{re({...W,width:Qe})}}),L[12]=W,L[13]=re,L[14]=me):me=L[14],L[15]!==$||L[16]!==q||L[17]!==C?(ue={label:"Config > Toggle dark mode",handle:()=>{q({...$,display:{...$.display,theme:C==="dark"?"light":"dark"}})}},L[15]=$,L[16]=q,L[17]=C,L[18]=ue):ue=L[18];const pe=$.keymap.preset==="vim";let de,Ce;L[19]!==$||L[20]!==q?(de=()=>{q({...$,keymap:{...$.keymap,preset:"vim"}})},L[19]=$,L[20]=q,L[21]=de):de=L[21],L[22]!==pe||L[23]!==de?(Ce={label:"Config > Switch keymap to VIM",hidden:pe,handle:de},L[22]=pe,L[23]=de,L[24]=Ce):Ce=L[24];const Ne=$.keymap.preset==="default";let se,Ae,be;L[25]!==$||L[26]!==q?(se=()=>{q({...$,keymap:{...$.keymap,preset:"default"}})},L[25]=$,L[26]=q,L[27]=se):se=L[27],L[28]!==se||L[29]!==Ne?(Ae={label:"Config > Switch keymap to default (current: VIM)",hidden:Ne,handle:se},L[28]=se,L[29]=Ne,L[30]=Ae):Ae=L[30],L[31]!==$||L[32]!==q?(be=()=>{q({...$,completion:{...$.completion,copilot:!1}})},L[31]=$,L[32]=q,L[33]=be):be=L[33];const Re=$.completion.copilot!=="github";let ze,qe;L[34]!==be||L[35]!==Re?(ze={label:"Config > Disable GitHub Copilot",handle:be,hidden:Re},L[34]=be,L[35]=Re,L[36]=ze):ze=L[36],L[37]!==$||L[38]!==q?(qe=()=>{q({...$,completion:{...$.completion,copilot:"github"}})},L[37]=$,L[38]=q,L[39]=qe):qe=L[39];const Ze=$.completion.copilot==="github";let Pe;L[40]!==qe||L[41]!==Ze?(Pe={label:"Config > Enable GitHub Copilot",handle:qe,hidden:Ze},L[40]=qe,L[41]=Ze,L[42]=Pe):Pe=L[42],ae=[...Z$().filter(ce).map(me),ue,Ce,Ae,ze,Pe],L[4]=W,L[5]=$,L[6]=re,L[7]=q,L[8]=C,L[9]=ae}else ae=L[9];const X=ae;let ee;return L[43]!==X?(ee=X.filter(_C),L[43]=X,L[44]=ee):ee=L[44],ee}();let c=$g();c=[...Pa(c),...Pa(l)];const d=c.filter(bC),h=gc.keyBy(d,yC),{recentCommands:f,addRecentCommand:m}=dC();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=L=>{Mz(s.getHotkey("global.commandPalette").key)(L)&&(L.preventDefault(),n(xC))},t[4]=s,t[5]=n,t[6]=p):p=t[6],gm(document,"keydown",p),t[7]!==m||t[8]!==s||t[9]!==o||t[10]!==n?(b=(L,C)=>{const $=o[L];if(!$)return null;const j=s.getHotkey(L);return u.jsxs(go,{disabled:C.disabled,onSelect:()=>{m(L),n(!1),requestAnimationFrame(()=>{$()})},value:j.name,children:[u.jsxs("span",{children:[j.name,C.tooltip&&u.jsx("span",{className:"ml-2",children:C.tooltip})]}),u.jsx(i4,{children:u.jsx(vm,{shortcut:j.key})})]},L)},t[7]=m,t[8]=s,t[9]=o,t[10]=n,t[11]=b):b=t[11];const y=b;let x;t[12]!==m||t[13]!==s||t[14]!==n?(x=(L,C,$,j)=>{const W=$===void 0?{}:$;return u.jsxs(go,{disabled:W.disabled,onSelect:()=>{m(L),n(!1),requestAnimationFrame(()=>{C()})},value:L,children:[u.jsxs("span",{children:[L,W.tooltip&&u.jsxs("span",{className:"ml-2",children:["(",W.tooltip,")"]})]}),j&&u.jsx(i4,{children:u.jsx(vm,{shortcut:s.getHotkey(j).key})})]},L)},t[12]=m,t[13]=s,t[14]=n,t[15]=x):x=t[15];const v=x,S=Tz;let k;t[16]===Symbol.for("react.memo_cache_sentinel")?(k=u.jsx(aa,{placeholder:"Type to search..."}),t[16]=k):k=t[16];const E=wm;let N;t[17]===Symbol.for("react.memo_cache_sentinel")?(N=u.jsx(_c,{children:"No results found."}),t[17]=N):N=t[17];const I=f.length>0&&u.jsxs(u.Fragment,{children:[u.jsx(xm,{heading:"Recently Used",children:f.map(L=>{const C=h[L];return Az(L)?y(L,{disabled:C==null?void 0:C.disabled,tooltip:C==null?void 0:C.tooltip}):C&&!dg(C)?v(C.label,C.handleHeadless||C.handle,{disabled:C.disabled,tooltip:C.tooltip}):null})}),u.jsx(s4,{})]}),T=xm,M=s.iterate().map(L=>{if(g.has(L))return null;const C=h[L];return y(L,{disabled:C==null?void 0:C.disabled,tooltip:C==null?void 0:C.tooltip})}),D=d.map(L=>g.has(L.label)?null:v(L.label,L.handleHeadless||L.handle,{disabled:L.disabled,tooltip:L.tooltip}));let z;t[18]!==g||t[19]!==v?(z=L=>g.has(L.label)?null:v(`Cell > ${L.label}`,L.handleHeadless||L.handle,{disabled:L.disabled,tooltip:L.tooltip}),t[18]=g,t[19]=v,t[20]=z):z=t[20];const O=a.map(z);let F,B,V;return t[21]!==T||t[22]!==D||t[23]!==O||t[24]!==M?(F=u.jsxs(T,{heading:"Commands",children:[M,D,O]}),t[21]=T,t[22]=D,t[23]=O,t[24]=M,t[25]=F):F=t[25],t[26]!==E||t[27]!==F||t[28]!==N||t[29]!==I?(B=u.jsxs(E,{children:[N,I,F]}),t[26]=E,t[27]=F,t[28]=N,t[29]=I,t[30]=B):B=t[30],t[31]!==S||t[32]!==e||t[33]!==n||t[34]!==B||t[35]!==k?(V=u.jsxs(S,{open:e,onOpenChange:n,children:[k,B]}),t[31]=S,t[32]=e,t[33]=n,t[34]=B,t[35]=k,t[36]=V):V=t[36],V};function bC(t){return!t.hotkey}function yC(t){return t.label}function xC(t){return!t}function vr(){return Se.string().optional().describe(Ge.of({label:"Password",inputType:"password",placeholder:"password",optionRegex:".*password.*"}))}function mg(){return Se.string().optional().describe(Ge.of({label:"Token",inputType:"password",placeholder:"token",optionRegex:".*token.*"}))}function Fa(){return Se.string().optional().describe(Ge.of({label:"Warehouse Name",placeholder:"warehouse",optionRegex:".*warehouse.*"}))}function pg(){return Se.string().optional().describe(Ge.of({label:"URI",optionRegex:".*uri.*"}))}function kr(){return Se.string().nonempty().describe(Ge.of({label:"Host",placeholder:"localhost",optionRegex:".*host.*"}))}function bo(){return Se.string().describe(Ge.of({label:"Database",placeholder:"db name",optionRegex:".*database.*"}))}function Sr(){return Se.string().nonempty().describe(Ge.of({label:"Username",placeholder:"username",optionRegex:".*username.*"}))}function Cr(t){const e=Se.coerce.string().describe(Ge.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 gg(){return Se.boolean().default(!1).describe(Ge.of({label:"Read Only"}))}const _g=Se.object({type:Se.literal("postgres"),host:kr(),port:Cr(5432).optional(),database:bo(),username:Sr(),password:vr(),ssl:Se.boolean().default(!1).describe(Ge.of({label:"Use SSL"}))}).describe(Ge.of({direction:"two-columns"})),bg=Se.object({type:Se.literal("mysql"),host:kr(),port:Cr(3306),database:bo(),username:Sr(),password:vr(),ssl:Se.boolean().default(!1).describe(Ge.of({label:"Use SSL"}))}).describe(Ge.of({direction:"two-columns"})),yg=Se.object({type:Se.literal("sqlite"),database:bo().describe(Ge.of({label:"Database Path"}))}).describe(Ge.of({direction:"two-columns"})),xg=Se.object({type:Se.literal("duckdb"),database:bo().describe(Ge.of({label:"Database Path"})),read_only:gg()}).describe(Ge.of({direction:"two-columns"})),wg=Se.object({type:Se.literal("motherduck"),database:bo().default("my_db").describe(Ge.of({label:"Database Name"})),token:mg()}).describe(Ge.of({direction:"two-columns"})),vg=Se.object({type:Se.literal("snowflake"),account:Se.string().nonempty().describe(Ge.of({label:"Account",optionRegex:".*snowflake.*"})),warehouse:Se.string().optional().describe(Ge.of({label:"Warehouse",optionRegex:".*snowflake.*"})),database:bo(),schema:Se.string().optional().describe(Ge.of({label:"Schema",optionRegex:".*snowflake.*"})),username:Sr(),password:vr(),role:Se.string().optional().describe(Ge.of({label:"Role"}))}).describe(Ge.of({direction:"two-columns"})),kg=Se.object({type:Se.literal("bigquery"),project:Se.string().nonempty().describe(Ge.of({label:"Project ID",optionRegex:".*bigquery.*"})),dataset:Se.string().nonempty().describe(Ge.of({label:"Dataset",optionRegex:".*bigquery.*"})),credentials_json:Se.string().describe(Ge.of({label:"Credentials JSON",inputType:"textarea"}))}).describe(Ge.of({direction:"two-columns"})),Sg=Se.object({type:Se.literal("clickhouse_connect"),host:kr(),port:Cr(8123).optional(),username:Sr(),password:vr(),secure:Se.boolean().default(!1).describe(Ge.of({label:"Use HTTPs"}))}).describe(Ge.of({direction:"two-columns"})),Cg=Se.object({type:Se.literal("timeplus"),host:kr().default("localhost"),port:Cr(8123).optional(),username:Sr().default("default"),password:vr().default("")}).describe(Ge.of({direction:"two-columns"})),Ng=Se.object({type:Se.literal("chdb"),database:bo().describe(Ge.of({label:"Database Path"})),read_only:gg()}).describe(Ge.of({direction:"two-columns"})),jg=Se.object({type:Se.literal("trino"),host:kr(),port:Cr(8080),database:bo(),schema:Se.string().describe(Ge.of({label:"Schema",placeholder:"schema name",optionRegex:".*schema.*"})).optional(),username:Sr(),password:vr(),async_support:Se.boolean().default(!1).describe(Ge.of({label:"Async Support"}))}).describe(Ge.of({direction:"two-columns"})),Eg=Se.object({type:Se.literal("iceberg"),name:Se.string().describe(Ge.of({label:"Catalog Name"})),catalog:Se.discriminatedUnion("type",[Se.object({type:Se.literal("REST"),warehouse:Fa(),uri:Se.string().optional().describe(Ge.of({label:"URI",placeholder:"https://",optionRegex:".*uri.*"})),token:mg()}),Se.object({type:Se.literal("SQL"),warehouse:Fa(),uri:Se.string().optional().describe(Ge.of({label:"URI",placeholder:"jdbc:iceberg://host:port/database",optionRegex:".*uri.*"}))}),Se.object({type:Se.literal("Hive"),warehouse:Fa(),uri:pg()}),Se.object({type:Se.literal("Glue"),warehouse:Fa(),uri:pg()}),Se.object({type:Se.literal("DynamoDB"),"dynamodb.profile-name":Se.string().optional().describe(Ge.of({label:"Profile Name"})),"dynamodb.region":Se.string().optional().describe(Ge.of({label:"Region"})),"dynamodb.access-key-id":Se.string().optional().describe(Ge.of({label:"Access Key ID"})),"dynamodb.secret-access-key":Se.string().optional().describe(Ge.of({label:"Secret Access Key",inputType:"password"})),"dynamodb.session-token":Se.string().optional().describe(Ge.of({label:"Session Token",inputType:"password"}))})]).default({type:"REST"}).describe(Ge.of({special:"tabs"}))}),Ig=Se.object({type:Se.literal("datafusion"),sessionContext:Se.boolean().optional().describe(Ge.of({label:"Use Session Context"}))}),Ag=Se.object({type:Se.literal("pyspark"),host:kr().optional(),port:Cr().optional()}),Tg=Se.object({type:Se.literal("redshift"),host:kr(),port:Cr(5439),connectionType:Se.discriminatedUnion("type",[Se.object({type:Se.literal("IAM credentials"),region:Se.string().describe(Ge.of({label:"Region"})),aws_access_key_id:Se.string().nonempty().describe(Ge.of({label:"AWS Access Key ID",inputType:"password",optionRegex:".*aws_access_key_id.*"})),aws_secret_access_key:Se.string().nonempty().describe(Ge.of({label:"AWS Secret Access Key",inputType:"password",optionRegex:".*aws_secret_access_key.*"})),aws_session_token:Se.string().optional().describe(Ge.of({label:"AWS Session Token",inputType:"password",optionRegex:".*aws_session_token.*"}))}),Se.object({type:Se.literal("DB credentials"),user:Sr(),password:vr()})]).default({type:"IAM credentials",aws_access_key_id:"",aws_secret_access_key:"",region:""}),database:bo()}).describe(Ge.of({direction:"two-columns"})),wC=Se.discriminatedUnion("type",[_g,bg,yg,xg,wg,vg,kg,Sg,Cg,Ng,jg,Eg,Ig,Ag,Tg]),Sd="env:";function za(t){return typeof t=="string"&&t.startsWith(Sd)}function Cd(t){return`${Sd}${t}`}const Mg={sqlmodel:"SQLModel",sqlalchemy:"SQLAlchemy",duckdb:"DuckDB",clickhouse_connect:"ClickHouse Connect",chdb:"chDB",pyiceberg:"PyIceberg",ibis:"Ibis",motherduck:"MotherDuck",redshift:"Redshift"};class ln{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 vC{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),za(n)){const r=n.replace(Sd,""),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"?qr(n):n?`"${n}"`:""}printInFString(e,n,o){if(n===void 0)return"";if(typeof n=="number")return`${n}`;if(typeof n=="boolean")return qr(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 za(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-ChqPtgQh.js","./index-l_wokygA.js","./index-7fo-bO1b.css","./compile-BMCn2vE3.js","./storage-BhACHptC.js","./index-DW39dZX6.js","./index-DJwntWVz.js","./index-Dneegn3v.js","./index-D-01nLUB.js","./index-CfCsWmku.js","./index-Cd9N2R3M.js","./index-BKIw-nTk.js","./index-Cb2EzYJO.js","./index-BoVrSPna.js","./index-UohZ6mc7.js","./index-DlZmbF5y.js","./index-B6DH7WAG.js","./index-CH_vjHJs.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","./shutdown-button-D0N1es_c.js","./index-C1GzY49R.js","./shutdown-button-C1rhMrxo.css","./circle-play-Cvl-9kpT.js","./_createAggregator-Cvb8EMxO.js","./_baseEach-FnH5SKIB.js","./transform-Bze8Q3sQ.js","./sortBy-C53me3k8.js","./_baseMap-KGy9mFen.js","./terminal-GCVl-wqy.js","./terminal-WqMRJt5Z.css"])))=>i.map(i=>d[i]);
|
2
|
+
var tz=Object.defineProperty;var B3=Bt=>{throw TypeError(Bt)};var nz=(Bt,Et,gn)=>Et in Bt?tz(Bt,Et,{enumerable:!0,configurable:!0,writable:!0,value:gn}):Bt[Et]=gn;var Q=(Bt,Et,gn)=>nz(Bt,typeof Et!="symbol"?Et+"":Et,gn),oz=(Bt,Et,gn)=>Et.has(Bt)||B3("Cannot "+gn);var U3=(Bt,Et,gn)=>(oz(Bt,Et,"read from private field"),gn?gn.call(Bt):Et.get(Bt)),V3=(Bt,Et,gn)=>Et.has(Bt)?B3("Cannot add the same private member more than once"):Et instanceof WeakSet?Et.add(Bt):Et.set(Bt,gn);import{u as De,Y as A,g$ as rz,h0 as sz,h1 as $3,h2 as iz,h3 as az,h4 as lz,a as Y,h5 as cz,h6 as Rr,h7 as dz,h8 as um,h9 as H3,ha as uz,hb as hz,hc as W3,hd as cc,c as J,eR as fz,ax as lt,j as u,an as no,au as ar,at as Ls,av as Fs,bB as lr,a1 as Me,aw as xn,he as oa,as as cr,a$ as Hn,ay as ra,ab as Te,a7 as Qt,ec as hm,e$ as zs,hf as mz,aW as et,af as Ot,hg as pz,f5 as Wn,hh as q3,hi as G3,hj as fm,hk as Y3,hl as gz,L as Dt,dV as dc,b6 as dr,hm as uc,b8 as mm,aB as In,hn as _z,ae as pm,ho as bz,hp as J3,f4 as K3,a5 as en,bf as X3,hq as Z3,cv as gm,hr as yz,e3 as dt,hs as Q3,ea as _m,ht as xz,hu as hc,a4 as $e,bm as qn,hv as fc,hw as Bs,eW as Us,hx as wz,hy as sa,hz as vz,f2 as kz,hA as e4,hB as t4,eF as Sz,hC as ur,hD as Pr,b4 as mc,hE as Cz,hF as pc,hG as n4,ac as Vs,et as o4,ad as ia,hH as Nz,hI as bm,hJ as Lr,bD as Fr,$ as zo,eX as $s,fD as r4,gn as zr,fS as jz,bp as an,hK as Ez,hL as Iz,gl as ym,aY as gc,hM as xm,hN as Az,hO as s4,hP as wm,hQ as Tz,hR as Mz,hS as go,hT as i4,gr as vm,hU as aa,hV as _c,eK as Se,hW as Ge,hX as km,hY as St,hZ as a4,dP as bc,dL as yc,dM as xc,dN as wc,dK as la,h_ as Oz,fQ as Sm,be as An,aS as Gn,fG as l4,fI as c4,fJ as Dz,fO as Rz,fK as d4,a0 as Ie,eE as Pz,b2 as Hs,bc as Ws,b3 as qs,b9 as Gt,f3 as _o,h$ as Lz,fM as u4,i0 as Fz,fE as h4,fF as f4,i1 as Br,dO as m4,i2 as p4,i3 as zz,i4 as Bz,ar as Uz,aq as Vz,i5 as Cm,dS as $z,dU as Nm,fs as vc,i6 as kc,i7 as Sc,bG as Tn,i8 as Hz,e_ as ca,fp as mn,bu as g4,ed as Vt,i9 as Wz,ez as qz,ao as jm,ia as da,ib as Cc,ic as Gz,id as Yz,ie as _4,ig as pn,gq as b4,eG as Nc,bx as Jz,ih as Kz,aA as Em,b5 as Xz,ii as Zz,gM as Im,bt as jc,ij as Am,az as ua,eS as y4,ik as Qz,ap as eB,il as x4,im as tB,io as nB,ip as oB,iq as rB,ir as sB,dQ as Bo,is as iB,it as Ec,iu as Gs,o as Uo,n as st,g5 as Mn,iv as On,iw as ut,ix as Ys,iy as zt,gm as Yt,iz as Tm,eJ as oo,iA as aB,iB as lB,br as w4,bs as v4,iC as k4,iD as cB,gP as Js,iE as Ic,bo as Ac,gO as Ur,f6 as Mm,iF as dB,iG as uB,iH as hB,iI as fB,iJ as S4,iK as ha,iL as C4,iM as mB,iN as N4,iO as j4,iP as pB,iQ as E4,iR as I4,f7 as Tc,iS as gB,iT as A4,iU as fa,iV as ma,iW as Mc,iX as hr,iY as T4,iZ as Vo,i_ as Ks,i$ as Om,j0 as pa,j1 as Xs,j2 as Dm,j3 as Rm,j4 as M4,j5 as Oc,j6 as _B,Z as ga,j7 as _a,j8 as bB,e9 as Dc,j9 as yB,ja as Pm,jb as xB,jc as wB,jd as Rc,ei as vB,je as Lm,jf as Zs,jg as Pc,jh as Qs,g4 as Yn,gf as $o,g1 as O4,cb as D4,ji as Fm,fP as ba,jj as zm,jk as R4,jl as P4,jm as Bm,jn as ya,jo as xa,jp as wa,jq as kB,fZ as Lc,jr as Fc,js as zc,ey as SB,f_ as CB,jt as NB,ju as jB,r as EB,jv as IB,jw as AB,jx as TB,g8 as MB,jy as fr,jz as OB,jA as L4,t as R,jB as DB,jC as RB,jD as PB,jE as LB,jF as FB,jG as zB,jH as BB,jI as UB,jJ as VB,jK as $B,jL as HB,jM as WB,jN as qB,jO as GB,jP as YB,jQ as JB,jR as KB,jS as XB,jT as ZB,jU as QB,jV as eU,jW as tU,jX as nU,jY as oU,jZ as rU,j_ as sU,j$ as F4,k0 as iU,k1 as aU,k2 as lU,k3 as Um,k4 as Bc,k5 as z4,k6 as cU,k7 as dU,k8 as B4,k9 as uU,ka as ei,kb as Jn,kc as hU,kd as fU,ke as mU,kf as pU,kg as gU,kh as _U,ki as bU,kj as yU,kk as xU,kl as wU,km as mr,kn as vU,ko as kU,kp as SU,kq as CU,ef as NU,kr as jU,ks as U4,ej as EU,kt as Uc,ku as IU,kv as AU,kw as TU,kx as MU,a2 as pr,ky as Vc,kz as OU,kA as DU,kB as V4,kC as Vm,gN as ti,kD as RU,kE as PU,kF as LU,kG as FU,gd as zU,bA as BU,a6 as $m,kH as $4,kI as UU,kJ as VU,kK as Hm,kL as Wm,kM as $U,kN as H4,kO as W4,kP as $c,g0 as HU,ai as q4,e1 as WU,kQ as G4,fB as jt,kR as va,kS as ni,kT as qU,kU as GU,kV as qm,kW as YU,ca as Gm,kX as JU,bq as Y4,kY as KU,kZ as XU,k_ as Hc,k$ as J4,d$ as Ym,bC as K4,l0 as ZU,l1 as QU,l2 as X4,l3 as eV,l4 as tV,l5 as Z4,aj as Jm,l6 as nV,bE as Q4,l7 as oV,eZ as rV,l8 as Ho,eC as eS,l9 as tS,f1 as nS,fT as Wc,la as Km,lb as oS,b1 as Xm,eD as qc,lc as rS,ld as sV,le as iV,lf as aV,lg as sS,lh as lV,li as iS,lj as cV,gE as dV,fH as uV,fL as Zm,gH as hV,bz as Gc,lk as fV,ll as aS,lm as Qm,ln as mV,lo as pV,lp as gV,lq as _V,lr as lS,fu as ep,dX as cS,ls as bV,lt as yV,lu as xV,aX as wV,lv as vV,lw as kV,lx as SV,ly as CV,ag as NV,lz as Yc,ah as jV,lA as dS,fq as EV,lB as uS,ak as Kn,fX as IV,lC as AV,lD as TV,lE as hS,lF as MV,lG as oi,lH as OV,lI as Jc,lJ as DV,lK as RV,D as fS,lL as PV,du as LV,lM as ka,lN as FV,lO as zV,lP as BV,lQ as UV,C as mS,lR as VV,lS as $V,lT as HV,E as Vr,fc as WV,bn as qV,bl as GV,lU as YV,lV as JV,dx as pS,lW as KV,a9 as Kc,lX as XV,aa as gr,d_ as gS,lY as tp,lZ as ZV,eb as _S,l_ as QV,l$ as bS,m0 as e$,m1 as yS,m2 as t$,m3 as n$,m4 as xS,m5 as wS,m6 as vS,fo as kS,m7 as o$,m8 as r$,m9 as SS,ma as CS,mb as Xc,mc as NS,md as s$,me as jS,mf as i$,mg as a$,mh as ES,mi as l$,mj as c$,mk as d$,ml as u$,mm as h$,mn as f$,mo as m$,e8 as p$,mp as g$,mq as _$,ge as np,mr as b$,ms as y$,mt as x$,mu as w$,mv as v$,mw as k$,mx as S$,my as C$,mz as N$,mA as j$,mB as op,mC as E$,g3 as I$,mD as A$,mE as T$,mF as M$,mG as IS,mH as O$,mI as D$,a8 as R$,eU as P$,gw as L$,mJ as F$,mK as AS,mL as TS,gy as rp,gu as ri,gz as $r,gv as Hr,gA as sp,gB as ip,gx as MS,mM as z$,mN as _r,mO as OS,gG as B$,mP as U$,mQ as V$,mR as $$,mS as H$,mT as W$,mU as q$,mV as DS,eL as G$,mW as ap,aC as Zc,mX as RS,mY as PS,aE as LS,aD as Y$,e7 as J$,__tla as K$}from"./index-l_wokygA.js";import{b as si,A as X$,L as FS,g as Z$,G as Q$,s as eH,k as tH,B as zS,a as nH,M as oH,Y as rH,c as wn,u as Sa,C as sH,S as iH,K as aH,d as lH,i as cH,e as BS,f as dH,h as uH,j as Ca,P as lp,l as US,m as hH,n as fH,o as mH,p as VS,q as cp,T as pH}from"./shutdown-button-D0N1es_c.js";import{V as $S,d as ii,I as dp,N as HS,S as WS,e as qS,f as GS,L as YS,F as JS,g as KS,M as gH,l as XS,h as _H,j as br,k as Qc,i as bH,E as ZS,m as up,n as yH,o as hp,p as xH,q as wH,s as vH,t as kH,v as SH,w as CH,x as NH,y as jH,a as EH,C as IH,R as QS,A as AH,b as TH,T as MH,z as OH,B as DH,D as RH,G as PH,O as LH,c as FH,P as zH,__tla as BH}from"./storage-BhACHptC.js";import{c as UH}from"./_createAggregator-Cvb8EMxO.js";import{s as ro,i as yr,T as fp,a as mp}from"./transform-Bze8Q3sQ.js";import{s as Na}from"./sortBy-C53me3k8.js";let pp,ed,vn,td,eC,ja,gp,VH=Promise.all([(()=>{try{return K$}catch{}})(),(()=>{try{return BH}catch{}})()]).then(async()=>{var ic,z3;var Bt=UH(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});let Et,gn,_p,nd,ai,Wr,bp,yp,xp,wp,Ea,od,vp,Ia,kp,rd,Sp,Cp,sd,Np,jp,Ep,Aa,Ip,id,Ap,Tp,Mp,Op,Dp,Rp,ad,Pp,ld,cd,Lp,Fp,zp,Bp,Up,Ta,Vp,$p,dd,Hp,Wp,qp,ud,Gp,Yp,Jp,Ma,hd,fd,Kp,Xp,Zp,Qp,eg,tg,ng,og,rg,md,pd,sg,ig,ag,Oa,xr,wr;Et=De("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),gn=De("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"}]]),_p=De("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"}]]),nd=De("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),ai=De("ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]),Wr=De("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"}]]),bp=De("chevrons-down",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]),yp=De("chevrons-up",[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]]),td=De("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),xp=De("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),wp=De("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),Ea=De("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),od=De("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"}]]),vp=De("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"}]]),Ia=De("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"}]]),kp=De("code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]),rd=De("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"}]]),Sp=De("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"}]]),Cp=De("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"}]]),sd=De("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"}]]),Np=De("eraser",[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]]),jp=De("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"}]]),Ep=De("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"}]]),Aa=De("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"}]]),Ip=De("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"}]]),id=De("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"}]]),Ap=De("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"}]]),Tp=De("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"}]]),Mp=De("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"}]]),Op=De("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"}]]),Dp=De("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"}]]),Rp=De("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"}]]),ad=De("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"}]]),Pp=De("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"}]]),ld=De("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"}]]),cd=De("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"}]]),Lp=De("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"}]]),Fp=De("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"}]]),zp=De("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"}]]),Bp=De("message-circle-question",[["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"}]]),Up=De("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"}]]),Ta=De("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"}]]),Vp=De("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"}]]),$p=De("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"}]]),dd=De("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"}]]),Hp=De("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Wp=De("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"}]]),qp=De("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"}]]),ud=De("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"}]]),Gp=De("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"}]]),Yp=De("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"}]]),Jp=De("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"}]]),Ma=De("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"}]]),hd=De("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"}]]),fd=De("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"}]]),Kp=De("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"}]]),Xp=De("square-code",[["path",{d:"M10 9.5 8 12l2 2.5",key:"3mjy60"}],["path",{d:"m14 9.5 2 2.5-2 2.5",key:"1bir2l"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),Zp=De("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"}]]),Qp=De("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"}]]),eg=De("square-m",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 16V8l4 4 4-4v8",key:"141u4e"}]]),tg=De("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"}]]),ng=De("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"}]]),og=De("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"}]]),rg=De("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"}]]),md=De("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"}]]),pd=De("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"}]]),sg=De("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]),ig=De("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"}]]),ag=De("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"}]]),Oa=De("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"}]]),xr=De("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"}]]),wr=De("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 tC=A.createContext({}),nC=A.forwardRef(function(t,e){[t,e]=az(t,e,tC);let{toolbarProps:n}=function(s,i){const{"aria-label":a,"aria-labelledby":l,orientation:c="horizontal"}=s;let[d,h]=A.useState(!1);rz(()=>{var p;h(!(!i.current||!(!((p=i.current.parentElement)===null||p===void 0)&&p.closest('[role="toolbar"]'))))});const{direction:f}=sz(),m=f==="rtl"&&c==="horizontal";let _=iz(i);const g=A.useRef(null);return{toolbarProps:{...$3(s,{labelable:!0}),role:d?"group":"toolbar","aria-orientation":c,"aria-label":a,"aria-labelledby":a==null?l:void 0,onKeyDownCapture:d?void 0:p=>{if(p.currentTarget.contains(p.target)){if(c==="horizontal"&&p.key==="ArrowRight"||c==="vertical"&&p.key==="ArrowDown")m?_.focusPrevious():_.focusNext();else{if(!(c==="horizontal"&&p.key==="ArrowLeft"||c==="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:d?void 0:p=>{var b,y;g.current&&!p.currentTarget.contains(p.relatedTarget)&&(!((b=i.current)===null||b===void 0)&&b.contains(p.target))&&((y=g.current)===null||y===void 0||y.focus(),g.current=null)},onBlurCapture:d?void 0:p=>{p.currentTarget.contains(p.relatedTarget)||g.current||(g.current=p.target)}}}}(t,e),o=lz({...t,values:{orientation:t.orientation||"horizontal"},defaultClassName:"react-aria-Toolbar"}),r=$3(t);return delete r.id,Y.createElement("div",{...cz(n,r),...o,ref:e,slot:t.slot||void 0,"data-orientation":t.orientation||"horizontal"},o.children)});function Da(t,e){const n=+Rr(t)-+Rr(e);return n<0?-1:n>0?1:n}function oC(t,e){const n=Rr(t,e==null?void 0:e.in);return+function(o,r){const s=Rr(o,r==null?void 0:r.in);return s.setHours(23,59,59,999),s}(n,e)==+function(o,r){const s=Rr(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 rC(t,e,n){const[o,r,s]=um(n==null?void 0:n.in,t,t,e),i=Da(r,s),a=Math.abs(function(d,h,f){const[m,_]=um(f==null?void 0:f.in,d,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=Da(r,s)===-i;oC(o)&&a===1&&Da(o,s)===1&&(l=!1);const c=i*(a-+l);return c===0?0:c}function sC(t,e,n){const o=function(r,s){return+Rr(r)-+Rr(s)}(t,e)/1e3;return(r=>{const s=(0,Math.trunc)(r);return s===0?0:s})(o)}function iC(t,e){return function(n,o,r){const s=uz(),i=(r==null?void 0:r.locale)??s.locale??hz,a=Da(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}),[c,d]=um(r==null?void 0:r.in,...a>0?[o,n]:[n,o]),h=sC(d,c),f=(H3(d)-H3(c))/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<W3){const g=Math.round(m/60);return i.formatDistance("aboutXHours",g,l)}if(m<2520)return i.formatDistance("xDays",1,l);if(m<cc){const g=Math.round(m/W3);return i.formatDistance("xDays",g,l)}if(m<2*cc)return _=Math.round(m/cc),i.formatDistance("aboutXMonths",_,l);if(_=rC(d,c),_<12){const g=Math.round(m/cc);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 dz(n,Date.now())}(t),e)}const Ra="https://static.marimo.app",aC=t=>{const e=J.c(24),{onClose:n}=t,[o,r]=A.useState("");let s;s=Math.random().toString(36).slice(2,6);const i=`${o}-${s}`,a=`${Ra}/static/${i}`;let l,c,d,h,f,m,_,g,p,b,y;return e[0]!==n||e[1]!==i?(l=async x=>{x.preventDefault(),n();const v=await fz({download:!1,includeCode:!0,files:$S.INSTANCE.filenames()}),S=lt({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${Ra}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:v,path:i})}).catch(()=>{S.dismiss(),lt({title:"Error uploading static page",description:u.jsxs("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",u.jsx("a",{href:no.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),S.dismiss(),lt({title:"Static page uploaded!",description:u.jsxs("div",{children:["The URL has been copied to your clipboard.",u.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")?(c=u.jsx(ar,{children:"Share static notebook"}),e[3]=c):c=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(d=u.jsxs(Ls,{children:[c,u.jsxs(Fs,{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"," ",u.jsx("a",{href:Ra,target:"_blank",children:Ra}),"."]})]}),e[4]=d):d=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(h=x=>{const v=x.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,"");r(v)},e[5]=h):h=e[5],e[6]!==o?(f=u.jsx(lr,{"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=u.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:",u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(lC,{text:a}),u.jsx("span",{className:"text-primary",children:a})]})]}),e[8]=a,e[9]=m):m=e[9],e[10]!==f||e[11]!==m?(_=u.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=u.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=u.jsx(Me,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await xn(a)},children:"Create"}),e[15]=a,e[16]=p):p=e[16],e[17]!==p||e[18]!==g?(b=u.jsxs(oa,{children:[g,p]}),e[17]=p,e[18]=g,e[19]=b):b=e[19],e[20]!==b||e[21]!==l||e[22]!==_?(y=u.jsx(cr,{className:"w-fit",children:u.jsxs("form",{onSubmit:l,children:[d,_,b]})}),e[20]=b,e[21]=l,e[22]=_,e[23]=y):y=e[23],y},lC=t=>{const e=J.c(8),[n,o]=Y.useState(!1);let r;e[0]!==t.text?(r=Hn.stopPropagation(async c=>{c.preventDefault(),await xn(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=u.jsx(ra,{size:14,strokeWidth:1.5}),e[2]=i):i=e[2],e[3]!==s?(a=u.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=u.jsx(Te,{content:"Copied!",open:n,children:a}),e[5]=n,e[6]=a,e[7]=l):l=e[7],l};function lg(){const t=J.c(2),e=Qt(hm);let n;return t[0]!==e?(n=()=>{const o=document.getElementsByClassName("output-area"),r=window.innerHeight||document.documentElement.clientHeight;let s;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=zs.parse(i.parentNode.id);break}}e(i=>({mode:mz(i.mode),cellAnchor:s})),requestAnimationFrame(()=>{var i;s!==null&&((i=document.getElementById(zs.create(s)))==null||i.scrollIntoView())})},t[0]=e,t[1]=n):n=t[1],n}function gd(t){const e=J.c(3),n=_d();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],et(o)}function cg(){const t=J.c(2),e=_d();let n;return t[0]!==e?(n=()=>e(q3(Wn())),t[0]=e,t[1]=n):n=t[1],et(n)}function _d(){const t=J.c(2),{prepareForRun:e}=Ot();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 c of o){const d=r[c],h=(a=d==null?void 0:d.current)==null?void 0:a.editorView;let f;h?(G3(h)!=="markdown"&&fm(h),f=Y3(h)):f=((l=s[c])==null?void 0:l.code)||"",i.push(f),e({cellId:c})}await gz({cellIds:o,codes:i}).catch(cC)},t[0]=e,t[1]=n):n=t[1],et(n)}function cC(t){Dt.error(t)}const bd=[{type:"files",Icon:Ap,tooltip:"View files",position:"sidebar"},{type:"variables",Icon:dc,tooltip:"Explore variables",position:"sidebar"},{type:"datasources",Icon:dr,tooltip:"Explore data sources",position:"sidebar"},{type:"dependencies",Icon:Ta,tooltip:"Explore dependencies",position:"sidebar"},{type:"packages",Icon:si,tooltip:"Manage packages",position:"sidebar"},{type:"outline",Icon:fd,tooltip:"View outline",position:"sidebar"},{type:"chat",Icon:uc,tooltip:"Chat with AI",position:"sidebar"},{type:"documentation",Icon:md,tooltip:"View live docs",position:"sidebar"},{type:"logs",Icon:mm,tooltip:"Notebook logs",position:"sidebar"},{type:"tracing",Icon:X$,tooltip:"Tracing",position:"sidebar"},{type:"snippets",Icon:Zp,tooltip:"Snippets",position:"sidebar"},{type:"secrets",Icon:Rp,tooltip:"Secrets",hidden:In(),position:"sidebar"},{type:"scratchpad",Icon:_z,tooltip:"Scratchpad",position:"sidebar"},{type:"errors",Icon:pm,tooltip:"View errors",position:"footer"}];function dC(){const t=J.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=J.c(11);let c;l[0]!==a?(c=new bz(a),l[0]=a,l[1]=c):c=l[1];const d=c;let h;l[2]!==i||l[3]!==d?(h=()=>d.get(i),l[2]=i,l[3]=d,l[4]=h):h=l[4];const[f,m]=A.useState(h);let _;l[5]!==i||l[6]!==d?(_=b=>{m(b),d.set(i,b)},l[5]=i,l[6]=d,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 dg(t){return t.dropdown!==void 0}function Pa(t,e=""){return t.flatMap(n=>n.label?dg(n)?Pa(n.dropdown,`${e+n.label} > `):{...n,label:e+n.label}:[])}const li=t=>{const e=J.c(8),{children:n,layerTop:o}=t,r=o!==void 0&&o;let s;e[0]!==n?(s=Y.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 c,d;return e[2]!==a||e[3]!==l?(c=u.jsx("div",{className:l,children:a}),e[2]=a,e[3]=l,e[4]=c):c=e[4],e[5]!==i||e[6]!==c?(d=u.jsxs("div",{className:"multi-icon relative w-fit",children:[i,c]}),e[5]=i,e[6]=c,e[7]=d):d=e[7],d},La=en(null),uC=en(!1),yd=X3("marimo:ai:chatState:v2",{chats:[],activeChatId:null}),hC=en(t=>{const e=t(yd);return e.chats.find(n=>n.id===e.activeChatId)},(t,e,n)=>{e(yd,o=>({...o,activeChatId:n}))});function ug(t){return t!==Z3&&!!(t&&t.trim().length>0)}const xd=t=>{const e=J.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],gm(window,"keydown",n,o);const r=t.children??"Undo";let s,i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(s=u.jsx(yz,{className:"ml-2",shortcut:"cmd-z"}),e[3]=s):s=e[3],e[4]!==r||e[5]!==t?(i=u.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 wd(){const t=J.c(3),{deleteCell:e,undoDeleteCell:n}=Ot();let o;return t[0]!==e||t[1]!==n?(o=r=>{var l;if(dt.get(Q3))return;const{cellId:s}=r,i=dt.get(_m),a=(((l=i.cellData[s])==null?void 0:l.code)??"").trim()==="";if(e({cellId:s}),xz({cellId:s}).catch(()=>{n()}),!a){const{dismiss:c}=lt({title:"Cell deleted",description:"You can bring it back by clicking undo or through the command palette.",action:u.jsx(xd,{"data-testid":"undo-delete-button",onClick:()=>{n(),d()}})}),d=c}},t[0]=e,t[1]=n,t[2]=o):o=t[2],et(o)}function hg(){const t=J.c(3),{splitCell:e,undoSplitCell:n}=Ot();let o;return t[0]!==e||t[1]!==n?(o=r=>{const s=hc(r.cellId);if(!s)return;const i=Y3(s);e(r);const{dismiss:a}=lt({title:"Cell split",action:u.jsx(xd,{"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],et(o)}function vd(t){const e=J.c(49),{cell:n}=t,{createNewCell:o,updateCellConfig:r,updateCellName:s,moveCell:i,sendToTop:a,sendToBottom:l,addColumnBreakpoint:c,clearCellOutput:d}=Ot(),h=hg(),f=gd(n==null?void 0:n.cellId),m=!$e(Q3),_=wd(),{openModal:g}=qn(),p=Qt(La),b=$e(fc),y=$e(Bs),x=$e(Us),v=$e(wz);if(!n||x){let j;return e[0]===Symbol.for("react.memo_cache_sentinel")?(j=[],e[0]=j):j=e[0],j}const{cellId:S,config:k,getEditorView:E,name:N,hasOutput:I,hasConsoleOutput:T,status:M}=n;let D;e[1]!==S||e[2]!==k.disabled||e[3]!==r?(D=async()=>{const j={disabled:!k.disabled};await Lr({configs:{[S]:j}}),r({cellId:S,config:j})},e[1]=S,e[2]=k.disabled,e[3]=r,e[4]=D):D=e[4];const z=D;let O;e[5]!==S||e[6]!==k.hide_code||e[7]!==E||e[8]!==r?(O=async()=>{const j={hide_code:!k.hide_code};await Lr({configs:{[S]:j}}),r({cellId:S,config:j});const W=E();W&&(j.hide_code?W.contentDOM.blur():W.focus())},e[5]=S,e[6]=k.hide_code,e[7]=E,e[8]=r,e[9]=O):O=e[9];const F=O;let B,V,L,C,$;return e[10]===Symbol.for("react.memo_cache_sentinel")?(B=u.jsx(rg,{size:13,strokeWidth:1.5}),e[10]=B):B=e[10],e[11]!==S||e[12]!==N||e[13]!==g||e[14]!==s?(V=()=>{g(u.jsxs(cr,{children:[u.jsx(Ls,{children:u.jsx(ar,{children:"Rename cell"})}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(Fr,{htmlFor:"cell-name",children:"Cell name"}),u.jsx(HS,{placeholder:"cell name",value:N,onKeyDown:j=>{j.key==="Enter"&&(j.preventDefault(),j.stopPropagation(),g(null))},onChange:j=>s({cellId:S,name:j})})]})]}))},e[11]=S,e[12]=N,e[13]=g,e[14]=s,e[15]=V):V=e[15],e[16]!==S||e[17]!==s?(L=j=>s({cellId:S,name:j}),e[16]=S,e[17]=s,e[18]=L):L=e[18],e[19]!==N||e[20]!==L?(C=u.jsx(HS,{placeholder:"cell name",value:N,onChange:L}),e[19]=N,e[20]=L,e[21]=C):C=e[21],e[22]!==c||e[23]!==b||e[24]!==v||e[25]!==y||e[26]!==m||e[27]!==S||e[28]!==d||e[29]!==k.disabled||e[30]!==k.hide_code||e[31]!==o||e[32]!==_||e[33]!==E||e[34]!==T||e[35]!==I||e[36]!==i||e[37]!==N||e[38]!==f||e[39]!==l||e[40]!==a||e[41]!==p||e[42]!==h||e[43]!==M||e[44]!==V||e[45]!==C||e[46]!==z||e[47]!==F?($=[[{icon:B,label:"Name",disableClick:!0,handle:gC,handleHeadless:V,rightElement:C},{icon:u.jsx(ii,{size:13,strokeWidth:1.5}),label:"Run cell",hotkey:"cell.run",hidden:M==="running"||M==="queued"||M==="disabled-transitively"||k.disabled,handle:()=>f()},{icon:u.jsx(sa,{size:13,strokeWidth:1.5}),label:"AI completion",hidden:!b,handle:()=>{p(j=>(j==null?void 0:j.cellId)===S?null:{cellId:S})},hotkey:"cell.aiCompletion"},{icon:u.jsx(hd,{size:13,strokeWidth:1.5}),label:"Split cell",hotkey:"cell.splitCell",handle:()=>h({cellId:S})},{icon:u.jsx(dp,{size:13,strokeWidth:1.5}),label:"Export output as PNG",hidden:!I,handle:()=>function(j){const W=document.getElementById(J3.create(j));W&&(W.classList.add("printing-output"),K3(W,"result.png").finally(()=>{W.classList.remove("printing-output")}))}(S)},{icon:u.jsx(kz,{size:13,strokeWidth:1.5}),label:"Format cell",hotkey:"cell.format",handle:()=>{const j=E();j&&vz({[S]:j})}},{icon:k.hide_code?u.jsx(e4,{size:13,strokeWidth:1.5}):u.jsx(t4,{size:13,strokeWidth:1.5}),label:k.hide_code?"Show code":"Hide code",handle:F,hotkey:"cell.hideCode"},{icon:k.disabled?u.jsx(xr,{size:13,strokeWidth:1.5}):u.jsx(wr,{size:13,strokeWidth:1.5}),label:"Reactive execution",rightElement:u.jsx(Sz,{"data-testid":"cell-disable-switch",checked:!k.disabled,size:"sm",onCheckedChange:z}),handle:z},{icon:u.jsx(pm,{size:13,strokeWidth:1.5}),label:"Clear output",hidden:!(I||T),handle:()=>{d({cellId:S})}}],[{icon:u.jsx(mc,{}),label:"Convert to Markdown",hotkey:"cell.viewAsMarkdown",handle:()=>{const j=E();j&&(ur(y,o),Pr(j,"markdown",{keepCodeAsIs:!1}))}},{icon:u.jsx(dr,{size:13,strokeWidth:1.5}),label:"Convert to SQL",handle:()=>{const j=E();j&&(ur(y,o),Pr(j,"sql",{keepCodeAsIs:!1}))}},{icon:u.jsx(pc,{}),label:"Toggle as Python",handle:()=>{const j=E();j&&(ur(y,o),Cz(j,"python",{force:!0}))}}],[{icon:u.jsxs(li,{children:[u.jsx(Ea,{size:13,strokeWidth:1.5}),u.jsx(n4,{size:8,strokeWidth:2})]}),label:"Create cell above",hotkey:"cell.createAbove",handle:()=>o({cellId:S,before:!0})},{icon:u.jsxs(li,{children:[u.jsx(Ea,{size:13,strokeWidth:1.5}),u.jsx(Vs,{size:8,strokeWidth:2})]}),label:"Create cell below",hotkey:"cell.createBelow",handle:()=>o({cellId:S,before:!1})},{icon:u.jsx(n4,{size:13,strokeWidth:1.5}),label:"Move cell up",hotkey:"cell.moveUp",handle:()=>i({cellId:S,before:!0})},{icon:u.jsx(Vs,{size:13,strokeWidth:1.5}),label:"Move cell down",hotkey:"cell.moveDown",handle:()=>i({cellId:S,before:!1})},{icon:u.jsx(o4,{size:13,strokeWidth:1.5}),label:"Move cell left",hotkey:"cell.moveLeft",handle:()=>i({cellId:S,direction:"left"}),hidden:v!=="columns"},{icon:u.jsx(ia,{size:13,strokeWidth:1.5}),label:"Move cell right",hotkey:"cell.moveRight",handle:()=>i({cellId:S,direction:"right"}),hidden:v!=="columns"},{icon:u.jsx(yp,{size:13,strokeWidth:1.5}),label:"Send to top",hotkey:"cell.sendToTop",handle:()=>a({cellId:S})},{icon:u.jsx(bp,{size:13,strokeWidth:1.5}),label:"Send to bottom",hotkey:"cell.sendToBottom",handle:()=>l({cellId:S})},{icon:u.jsx(Nz,{size:13,strokeWidth:1.5}),label:"Break into new column",hotkey:"cell.addColumnBreakpoint",hidden:v!=="columns",handle:()=>c({cellId:S})}],[{icon:u.jsx(FS,{size:13,strokeWidth:1.5}),label:"Copy link to cell",disabled:!ug(N),tooltip:ug(N)?void 0:"Only named cells can be linked to",handle:async()=>{await xn(function(j){const W=new URL(window.location.href);return W.hash=`scrollTo=${encodeURIComponent(j)}`,W.toString()}(N)),lt({description:"Link copied to clipboard"})}}],[{label:"Delete",hidden:!m,variant:"danger",icon:u.jsx(bm,{size:13,strokeWidth:1.5}),handle:()=>{_({cellId:S})}}]].map(mC).filter(fC),e[22]=c,e[23]=b,e[24]=v,e[25]=y,e[26]=m,e[27]=S,e[28]=d,e[29]=k.disabled,e[30]=k.hide_code,e[31]=o,e[32]=_,e[33]=E,e[34]=T,e[35]=I,e[36]=i,e[37]=N,e[38]=f,e[39]=l,e[40]=a,e[41]=p,e[42]=h,e[43]=M,e[44]=V,e[45]=C,e[46]=z,e[47]=F,e[48]=$):$=e[48],$}function fC(t){return t.length>0}function mC(t){return t.filter(pC)}function pC(t){return!t.hidden}function gC(t){t==null||t.stopPropagation(),t==null||t.preventDefault()}function _C(t){return!t.hidden}const kd=en(!1),fg=()=>{const t=J.c(37),[e,n]=an(kd),o=Ez(),r=$e(Iz),s=$e(ym);let i;t[0]!==r?(i={cell:r},t[0]=r,t[1]=i):i=t[1];let a=vd(i).flat();a=Pa(a);const l=function(){const L=J.c(45),{theme:C}=zo(),[$,j]=$s(),[W,K]=r4();let Z;L[0]!==j?(Z=async ce=>{await zr({config:ce}).then(()=>{j(ce)})},L[0]=j,L[1]=Z):Z=L[1];const q=Z;let te;L[2]!==K?(te=async ce=>{await jz({config:ce}).then(()=>{K(ce)})},L[2]=K,L[3]=te):te=L[3];const re=te;let ae;if(L[4]!==W||L[5]!==$||L[6]!==re||L[7]!==q||L[8]!==C){let ce,me,ue;L[10]!==W?(ce=Qe=>Qe!==W.width,L[10]=W,L[11]=ce):ce=L[11],L[12]!==W||L[13]!==re?(me=Qe=>({label:`App config > Set width=${Qe}`,handle:()=>{re({...W,width:Qe})}}),L[12]=W,L[13]=re,L[14]=me):me=L[14],L[15]!==$||L[16]!==q||L[17]!==C?(ue={label:"Config > Toggle dark mode",handle:()=>{q({...$,display:{...$.display,theme:C==="dark"?"light":"dark"}})}},L[15]=$,L[16]=q,L[17]=C,L[18]=ue):ue=L[18];const pe=$.keymap.preset==="vim";let de,Ce;L[19]!==$||L[20]!==q?(de=()=>{q({...$,keymap:{...$.keymap,preset:"vim"}})},L[19]=$,L[20]=q,L[21]=de):de=L[21],L[22]!==pe||L[23]!==de?(Ce={label:"Config > Switch keymap to VIM",hidden:pe,handle:de},L[22]=pe,L[23]=de,L[24]=Ce):Ce=L[24];const Ne=$.keymap.preset==="default";let se,Ae,be;L[25]!==$||L[26]!==q?(se=()=>{q({...$,keymap:{...$.keymap,preset:"default"}})},L[25]=$,L[26]=q,L[27]=se):se=L[27],L[28]!==se||L[29]!==Ne?(Ae={label:"Config > Switch keymap to default (current: VIM)",hidden:Ne,handle:se},L[28]=se,L[29]=Ne,L[30]=Ae):Ae=L[30],L[31]!==$||L[32]!==q?(be=()=>{q({...$,completion:{...$.completion,copilot:!1}})},L[31]=$,L[32]=q,L[33]=be):be=L[33];const Re=$.completion.copilot!=="github";let ze,qe;L[34]!==be||L[35]!==Re?(ze={label:"Config > Disable GitHub Copilot",handle:be,hidden:Re},L[34]=be,L[35]=Re,L[36]=ze):ze=L[36],L[37]!==$||L[38]!==q?(qe=()=>{q({...$,completion:{...$.completion,copilot:"github"}})},L[37]=$,L[38]=q,L[39]=qe):qe=L[39];const Ze=$.completion.copilot==="github";let Pe;L[40]!==qe||L[41]!==Ze?(Pe={label:"Config > Enable GitHub Copilot",handle:qe,hidden:Ze},L[40]=qe,L[41]=Ze,L[42]=Pe):Pe=L[42],ae=[...Z$().filter(ce).map(me),ue,Ce,Ae,ze,Pe],L[4]=W,L[5]=$,L[6]=re,L[7]=q,L[8]=C,L[9]=ae}else ae=L[9];const X=ae;let ee;return L[43]!==X?(ee=X.filter(_C),L[43]=X,L[44]=ee):ee=L[44],ee}();let c=$g();c=[...Pa(c),...Pa(l)];const d=c.filter(bC),h=gc.keyBy(d,yC),{recentCommands:f,addRecentCommand:m}=dC();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=L=>{Mz(s.getHotkey("global.commandPalette").key)(L)&&(L.preventDefault(),n(xC))},t[4]=s,t[5]=n,t[6]=p):p=t[6],gm(document,"keydown",p),t[7]!==m||t[8]!==s||t[9]!==o||t[10]!==n?(b=(L,C)=>{const $=o[L];if(!$)return null;const j=s.getHotkey(L);return u.jsxs(go,{disabled:C.disabled,onSelect:()=>{m(L),n(!1),requestAnimationFrame(()=>{$()})},value:j.name,children:[u.jsxs("span",{children:[j.name,C.tooltip&&u.jsx("span",{className:"ml-2",children:C.tooltip})]}),u.jsx(i4,{children:u.jsx(vm,{shortcut:j.key})})]},L)},t[7]=m,t[8]=s,t[9]=o,t[10]=n,t[11]=b):b=t[11];const y=b;let x;t[12]!==m||t[13]!==s||t[14]!==n?(x=(L,C,$,j)=>{const W=$===void 0?{}:$;return u.jsxs(go,{disabled:W.disabled,onSelect:()=>{m(L),n(!1),requestAnimationFrame(()=>{C()})},value:L,children:[u.jsxs("span",{children:[L,W.tooltip&&u.jsxs("span",{className:"ml-2",children:["(",W.tooltip,")"]})]}),j&&u.jsx(i4,{children:u.jsx(vm,{shortcut:s.getHotkey(j).key})})]},L)},t[12]=m,t[13]=s,t[14]=n,t[15]=x):x=t[15];const v=x,S=Tz;let k;t[16]===Symbol.for("react.memo_cache_sentinel")?(k=u.jsx(aa,{placeholder:"Type to search..."}),t[16]=k):k=t[16];const E=wm;let N;t[17]===Symbol.for("react.memo_cache_sentinel")?(N=u.jsx(_c,{children:"No results found."}),t[17]=N):N=t[17];const I=f.length>0&&u.jsxs(u.Fragment,{children:[u.jsx(xm,{heading:"Recently Used",children:f.map(L=>{const C=h[L];return Az(L)?y(L,{disabled:C==null?void 0:C.disabled,tooltip:C==null?void 0:C.tooltip}):C&&!dg(C)?v(C.label,C.handleHeadless||C.handle,{disabled:C.disabled,tooltip:C.tooltip}):null})}),u.jsx(s4,{})]}),T=xm,M=s.iterate().map(L=>{if(g.has(L))return null;const C=h[L];return y(L,{disabled:C==null?void 0:C.disabled,tooltip:C==null?void 0:C.tooltip})}),D=d.map(L=>g.has(L.label)?null:v(L.label,L.handleHeadless||L.handle,{disabled:L.disabled,tooltip:L.tooltip}));let z;t[18]!==g||t[19]!==v?(z=L=>g.has(L.label)?null:v(`Cell > ${L.label}`,L.handleHeadless||L.handle,{disabled:L.disabled,tooltip:L.tooltip}),t[18]=g,t[19]=v,t[20]=z):z=t[20];const O=a.map(z);let F,B,V;return t[21]!==T||t[22]!==D||t[23]!==O||t[24]!==M?(F=u.jsxs(T,{heading:"Commands",children:[M,D,O]}),t[21]=T,t[22]=D,t[23]=O,t[24]=M,t[25]=F):F=t[25],t[26]!==E||t[27]!==F||t[28]!==N||t[29]!==I?(B=u.jsxs(E,{children:[N,I,F]}),t[26]=E,t[27]=F,t[28]=N,t[29]=I,t[30]=B):B=t[30],t[31]!==S||t[32]!==e||t[33]!==n||t[34]!==B||t[35]!==k?(V=u.jsxs(S,{open:e,onOpenChange:n,children:[k,B]}),t[31]=S,t[32]=e,t[33]=n,t[34]=B,t[35]=k,t[36]=V):V=t[36],V};function bC(t){return!t.hotkey}function yC(t){return t.label}function xC(t){return!t}function vr(){return Se.string().optional().describe(Ge.of({label:"Password",inputType:"password",placeholder:"password",optionRegex:".*password.*"}))}function mg(){return Se.string().optional().describe(Ge.of({label:"Token",inputType:"password",placeholder:"token",optionRegex:".*token.*"}))}function Fa(){return Se.string().optional().describe(Ge.of({label:"Warehouse Name",placeholder:"warehouse",optionRegex:".*warehouse.*"}))}function pg(){return Se.string().optional().describe(Ge.of({label:"URI",optionRegex:".*uri.*"}))}function kr(){return Se.string().nonempty().describe(Ge.of({label:"Host",placeholder:"localhost",optionRegex:".*host.*"}))}function bo(){return Se.string().describe(Ge.of({label:"Database",placeholder:"db name",optionRegex:".*database.*"}))}function Sr(){return Se.string().nonempty().describe(Ge.of({label:"Username",placeholder:"username",optionRegex:".*username.*"}))}function Cr(t){const e=Se.coerce.string().describe(Ge.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 gg(){return Se.boolean().default(!1).describe(Ge.of({label:"Read Only"}))}const _g=Se.object({type:Se.literal("postgres"),host:kr(),port:Cr(5432).optional(),database:bo(),username:Sr(),password:vr(),ssl:Se.boolean().default(!1).describe(Ge.of({label:"Use SSL"}))}).describe(Ge.of({direction:"two-columns"})),bg=Se.object({type:Se.literal("mysql"),host:kr(),port:Cr(3306),database:bo(),username:Sr(),password:vr(),ssl:Se.boolean().default(!1).describe(Ge.of({label:"Use SSL"}))}).describe(Ge.of({direction:"two-columns"})),yg=Se.object({type:Se.literal("sqlite"),database:bo().describe(Ge.of({label:"Database Path"}))}).describe(Ge.of({direction:"two-columns"})),xg=Se.object({type:Se.literal("duckdb"),database:bo().describe(Ge.of({label:"Database Path"})),read_only:gg()}).describe(Ge.of({direction:"two-columns"})),wg=Se.object({type:Se.literal("motherduck"),database:bo().default("my_db").describe(Ge.of({label:"Database Name"})),token:mg()}).describe(Ge.of({direction:"two-columns"})),vg=Se.object({type:Se.literal("snowflake"),account:Se.string().nonempty().describe(Ge.of({label:"Account",optionRegex:".*snowflake.*"})),warehouse:Se.string().optional().describe(Ge.of({label:"Warehouse",optionRegex:".*snowflake.*"})),database:bo(),schema:Se.string().optional().describe(Ge.of({label:"Schema",optionRegex:".*snowflake.*"})),username:Sr(),password:vr(),role:Se.string().optional().describe(Ge.of({label:"Role"}))}).describe(Ge.of({direction:"two-columns"})),kg=Se.object({type:Se.literal("bigquery"),project:Se.string().nonempty().describe(Ge.of({label:"Project ID",optionRegex:".*bigquery.*"})),dataset:Se.string().nonempty().describe(Ge.of({label:"Dataset",optionRegex:".*bigquery.*"})),credentials_json:Se.string().describe(Ge.of({label:"Credentials JSON",inputType:"textarea"}))}).describe(Ge.of({direction:"two-columns"})),Sg=Se.object({type:Se.literal("clickhouse_connect"),host:kr(),port:Cr(8123).optional(),username:Sr(),password:vr(),secure:Se.boolean().default(!1).describe(Ge.of({label:"Use HTTPs"}))}).describe(Ge.of({direction:"two-columns"})),Cg=Se.object({type:Se.literal("timeplus"),host:kr().default("localhost"),port:Cr(8123).optional(),username:Sr().default("default"),password:vr().default("")}).describe(Ge.of({direction:"two-columns"})),Ng=Se.object({type:Se.literal("chdb"),database:bo().describe(Ge.of({label:"Database Path"})),read_only:gg()}).describe(Ge.of({direction:"two-columns"})),jg=Se.object({type:Se.literal("trino"),host:kr(),port:Cr(8080),database:bo(),schema:Se.string().describe(Ge.of({label:"Schema",placeholder:"schema name",optionRegex:".*schema.*"})).optional(),username:Sr(),password:vr(),async_support:Se.boolean().default(!1).describe(Ge.of({label:"Async Support"}))}).describe(Ge.of({direction:"two-columns"})),Eg=Se.object({type:Se.literal("iceberg"),name:Se.string().describe(Ge.of({label:"Catalog Name"})),catalog:Se.discriminatedUnion("type",[Se.object({type:Se.literal("REST"),warehouse:Fa(),uri:Se.string().optional().describe(Ge.of({label:"URI",placeholder:"https://",optionRegex:".*uri.*"})),token:mg()}),Se.object({type:Se.literal("SQL"),warehouse:Fa(),uri:Se.string().optional().describe(Ge.of({label:"URI",placeholder:"jdbc:iceberg://host:port/database",optionRegex:".*uri.*"}))}),Se.object({type:Se.literal("Hive"),warehouse:Fa(),uri:pg()}),Se.object({type:Se.literal("Glue"),warehouse:Fa(),uri:pg()}),Se.object({type:Se.literal("DynamoDB"),"dynamodb.profile-name":Se.string().optional().describe(Ge.of({label:"Profile Name"})),"dynamodb.region":Se.string().optional().describe(Ge.of({label:"Region"})),"dynamodb.access-key-id":Se.string().optional().describe(Ge.of({label:"Access Key ID"})),"dynamodb.secret-access-key":Se.string().optional().describe(Ge.of({label:"Secret Access Key",inputType:"password"})),"dynamodb.session-token":Se.string().optional().describe(Ge.of({label:"Session Token",inputType:"password"}))})]).default({type:"REST"}).describe(Ge.of({special:"tabs"}))}),Ig=Se.object({type:Se.literal("datafusion"),sessionContext:Se.boolean().optional().describe(Ge.of({label:"Use Session Context"}))}),Ag=Se.object({type:Se.literal("pyspark"),host:kr().optional(),port:Cr().optional()}),Tg=Se.object({type:Se.literal("redshift"),host:kr(),port:Cr(5439),connectionType:Se.discriminatedUnion("type",[Se.object({type:Se.literal("IAM credentials"),region:Se.string().describe(Ge.of({label:"Region"})),aws_access_key_id:Se.string().nonempty().describe(Ge.of({label:"AWS Access Key ID",inputType:"password",optionRegex:".*aws_access_key_id.*"})),aws_secret_access_key:Se.string().nonempty().describe(Ge.of({label:"AWS Secret Access Key",inputType:"password",optionRegex:".*aws_secret_access_key.*"})),aws_session_token:Se.string().optional().describe(Ge.of({label:"AWS Session Token",inputType:"password",optionRegex:".*aws_session_token.*"}))}),Se.object({type:Se.literal("DB credentials"),user:Sr(),password:vr()})]).default({type:"IAM credentials",aws_access_key_id:"",aws_secret_access_key:"",region:""}),database:bo()}).describe(Ge.of({direction:"two-columns"})),wC=Se.discriminatedUnion("type",[_g,bg,yg,xg,wg,vg,kg,Sg,Cg,Ng,jg,Eg,Ig,Ag,Tg]),Sd="env:";function za(t){return typeof t=="string"&&t.startsWith(Sd)}function Cd(t){return`${Sd}${t}`}const Mg={sqlmodel:"SQLModel",sqlalchemy:"SQLAlchemy",duckdb:"DuckDB",clickhouse_connect:"ClickHouse Connect",chdb:"chDB",pyiceberg:"PyIceberg",ibis:"Ibis",motherduck:"MotherDuck",redshift:"Redshift"};class ln{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 vC{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),za(n)){const r=n.replace(Sd,""),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"?qr(n):n?`"${n}"`:""}printInFString(e,n,o){if(n===void 0)return"";if(typeof n=="number")return`${n}`;if(typeof n=="boolean")return qr(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 za(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 kC extends ln{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 St(`
|
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:Lc("")}),onFinish:T=>{e(M=>Ll(M,M.activeChatId,"assistant",T.content,T.parts))},onToolCall:async({toolCall:T})=>{try{const M=await HV({toolName:T.toolName,arguments:T.args});return M.result||M.error}catch(M){return Dt.error("Tool call failed:",M),`Error: ${M instanceof Error?M.message:String(M)}`}},onError:T=>{Dt.error("An error occurred:",T)},onResponse:T=>{Dt.debug("Received HTTP response from server:",T)}}),k=x==="submitted"||x==="streaming",E=k&&f.length>0&&(T=>{if(T.length===0)return!1;const M=T.at(-1);if(!M||M.role!=="assistant"||!M.parts)return!1;const D=M.parts;return D.length===0?!1:D[D.length-1].type==="reasoning"})(f);A.useEffect(()=>{requestAnimationFrame(()=>{if(l.current){const T=l.current;T.scrollTop=T.scrollHeight}})},[t.activeChatId]);const N=(T,M)=>{g(D=>D.slice(0,T)),t.activeChatId&&e(D=>({...D,chats:D.chats.map(z=>z.id===t.activeChatId?{...z,messages:z.messages.slice(0,T),updatedAt:Date.now()}:z)})),p({role:"user",content:M}),t.activeChatId&&e(D=>Ll(D,t.activeChatId,"user",M))},I=()=>{r.trim()&&(T=>{const M={id:WV(),title:T.length>50?`${T.slice(0,50)}...`:T,messages:[],createdAt:Date.now(),updatedAt:Date.now()};e(D=>({chats:[...D.chats,M],activeChatId:M.id})),_(""),p({role:"user",content:T})})(r.trim())};return u.jsxs("div",{className:"flex flex-col h-[calc(100%-53px)]",children:[u.jsx(Km,{children:u.jsx(eR,{onNewChat:()=>{o(null),_(""),s("")},activeChatId:n==null?void 0:n.id,setActiveChat:o,chats:[...t.chats].sort((T,M)=>M.updatedAt-T.updatedAt)})}),u.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)&&u.jsxs("div",{className:"flex flex-col rounded-md border bg-background",children:[u.jsx("div",{className:"px-1",children:u.jsx(Hc,{value:r,placeholder:"Ask anything, @ to include context about tables or dataframes",theme:d,onClose:()=>{var T,M;return(M=(T=i.current)==null?void 0:T.editor)==null?void 0:M.blur()},onChange:s,onSubmit:I},"new-thread-input")}),u.jsx(Bh,{input:r,onSendClick:I,isLoading:k,onStop:S})]}),f.map((T,M)=>u.jsx(jv,{message:T,index:M,theme:d,onEdit:N,setChatState:e,chatState:t,isStreamingReasoning:E,totalMessages:f.length},M)),k&&u.jsx("div",{className:"flex justify-center py-4",children:u.jsx(Ym,{className:"h-4 w-4 animate-spin"})}),y&&u.jsxs("div",{className:"flex items-center justify-center space-x-2 mb-4",children:[u.jsx(Vr,{error:y}),u.jsx(Me,{variant:"outline",size:"sm",onClick:()=>{v()},children:"Retry"})]}),u.jsx("div",{ref:c})]}),k&&u.jsx("div",{className:"w-full flex justify-center items-center z-20 border-t",children:u.jsx(Me,{variant:"linkDestructive",size:"sm",onClick:S,children:"Stop"})}),f&&f.length>0&&u.jsx(Ev,{input:m,setInput:_,onSubmit:(T,M)=>{M.trim()&&(b(T),t.activeChatId&&e(D=>Ll(D,t.activeChatId,"user",M)))},theme:d,inputRef:a,isLoading:k,onStop:S})]})};function oR(){}function rR(){}function sR(t){return u.jsx(la,{value:t,className:"text-sm",children:t},t)}function hn(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=hn(t[o]))!==""&&(e+=(e&&" ")+n);else for(let n in t)t[n]&&(e+=(e&&" ")+n);return e}const{useDebugValue:iR}=Y,{useSyncExternalStoreWithSelector:aR}=YV,lR=t=>t;function Iv(t,e=lR,n){const o=aR(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return iR(o),o}const Av=(t,e)=>{const n=JV(t),o=(r,s=e)=>Iv(n,r,s);return Object.assign(o,n),o};function on(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 mo(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 cR={passive:!1},qi={capture:!0,passive:!1};function Uh(t){t.stopImmediatePropagation()}function _s(t){t.preventDefault(),t.stopImmediatePropagation()}function Tv(t){var e=t.document.documentElement,n=ro(t).on("dragstart.drag",_s,qi);"onselectstart"in e?n.on("selectstart.drag",_s,qi):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Mv(t,e){var n=t.document.documentElement,o=ro(t).on("dragstart.drag",null);e&&(o.on("click.drag",_s,qi),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 ql=t=>()=>t;function Vh(t,{sourceEvent:e,subject:n,target:o,identifier:r,active:s,x:i,y:a,dx:l,dy:c,dispatch:d}){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:c,enumerable:!0,configurable:!0},_:{value:d}})}function dR(t){return!t.ctrlKey&&!t.button}function uR(){return this.parentNode}function hR(t,e){return e??{x:t.x,y:t.y}}function fR(){return navigator.maxTouchPoints||"ontouchstart"in this}Vh.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};const Gl=t=>()=>t;function mR(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 $h(t){t.stopImmediatePropagation()}function Gi(t){t.preventDefault(),t.stopImmediatePropagation()}function pR(t){return!(t.ctrlKey&&t.type!=="wheel"||t.button)}function gR(){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 Ov(){return this.__zoom||yr}function _R(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function bR(){return navigator.maxTouchPoints||"ontouchstart"in this}function yR(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 Yl=A.createContext(null),xR=Yl.Provider,wR=t=>`Node type "${t}" not found. Using fallback type "default".`,vR=()=>"The React Flow parent container needs a width and a height to render the graph.",kR=()=>"Only child nodes can use a parent extent.",SR=t=>`Marker type "${t}" doesn't exist.`,CR=(t,e)=>`Couldn't create edge for ${t?"target":"source"} handle id: "${t?e.targetHandle:e.sourceHandle}", edge id: ${e.id}.`,NR=()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",jR=t=>`Edge type "${t}" not found. Using fallback type "default".`,ER=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.`,Dv="[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=A.useContext(Yl);if(n===null)throw new Error(Dv);return Iv(n,t,e)}const qt=()=>{const t=A.useContext(Yl);if(t===null)throw new Error(Dv);return A.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe,destroy:t.destroy}),[t])},IR=t=>t.userSelectionActive?"none":"all";function Jl({position:t,children:e,className:n,style:o,...r}){const s=mt(IR),i=`${t}`.split("-");return Y.createElement("div",{className:hn(["react-flow__panel",n,...i]),style:{...o,pointerEvents:s},...r},e)}function AR({proOptions:t,position:e="bottom-right"}){return t!=null&&t.hideAttribution?null:Y.createElement(Jl,{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"},Y.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}var TR=A.memo(({x:t,y:e,label:n,labelStyle:o={},labelShowBg:r=!0,labelBgStyle:s={},labelBgPadding:i=[2,4],labelBgBorderRadius:a=2,children:l,className:c,...d})=>{const h=A.useRef(null),[f,m]=A.useState({x:0,y:0,width:0,height:0}),_=hn(["react-flow__edge-textwrapper",c]);return A.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?Y.createElement("g",{transform:`translate(${t-f.width/2} ${e-f.height/2})`,className:_,visibility:f.width?"visible":"hidden",...d},r&&Y.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}),Y.createElement("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:h,style:o},n),l):null});const Hh=t=>({width:t.offsetWidth,height:t.offsetHeight}),bs=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),Wh=(t={x:0,y:0},e)=>({x:bs(t.x,e[0][0],e[1][0]),y:bs(t.y,e[0][1],e[1][1])}),Rv=(t,e,n)=>t<e?bs(Math.abs(t-e),1,50)/50:t>n?-bs(Math.abs(t-n),1,50)/50:0,Pv=(t,e)=>[20*Rv(t.x,35,e.width-35),20*Rv(t.y,35,e.height-35)],Lv=t=>{var e;return((e=t.getRootNode)==null?void 0:e.call(t))||(window==null?void 0:window.document)},qh=({x:t,y:e,width:n,height:o})=>({x:t,y:e,x2:t+n,y2:e+o}),Fv=t=>({...t.positionAbsolute||{x:0,y:0},width:t.width||0,height:t.height||0}),Gh=(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)},Vn=t=>!isNaN(t)&&isFinite(t),Nt=Symbol.for("internals"),zv=["Enter"," ","Escape"];function Yh(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 Bv=t=>"clientX"in t,er=(t,e)=>{var s,i;const n=Bv(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)}},Kl=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0},Yi=({id:t,path:e,labelX:n,labelY:o,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:h,markerStart:f,interactionWidth:m=20})=>Y.createElement(Y.Fragment,null,Y.createElement("path",{id:t,style:d,d:e,fill:"none",className:"react-flow__edge-path",markerEnd:h,markerStart:f}),m&&Y.createElement("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:m,className:"react-flow__edge-interaction"}),r&&Vn(n)&&Vn(o)?Y.createElement(TR,{x:n,y:o,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null);function Ji(t,e,n){return n===void 0?n:o=>{const r=e().edges.find(s=>s.id===t);r&&n(o,{...r})}}function Uv({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 Vv({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,c=.125*e+.375*s+.375*a+.125*o;return[l,c,Math.abs(l-t),Math.abs(c-e)]}var Or,$v,tr,Jh,Ki,Hv,nr,Xi,ys,Wv,Ue,Xl;function qv({pos:t,x1:e,y1:n,x2:o,y2:r}){return t===Ue.Left||t===Ue.Right?[.5*(e+o),n]:[e,.5*(n+r)]}function Gv({sourceX:t,sourceY:e,sourcePosition:n=Ue.Bottom,targetX:o,targetY:r,targetPosition:s=Ue.Top}){const[i,a]=qv({pos:n,x1:t,y1:e,x2:o,y2:r}),[l,c]=qv({pos:s,x1:o,y1:r,x2:t,y2:e}),[d,h,f,m]=Vv({sourceX:t,sourceY:e,targetX:o,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:l,targetControlY:c});return[`M${t},${e} C${i},${a} ${l},${c} ${o},${r}`,d,h,f,m]}Yi.displayName="BaseEdge",($v=Or||(Or={})).Strict="strict",$v.Loose="loose",(Jh=tr||(tr={})).Free="free",Jh.Vertical="vertical",Jh.Horizontal="horizontal",(Hv=Ki||(Ki={})).Partial="partial",Hv.Full="full",(Xi=nr||(nr={})).Bezier="default",Xi.Straight="straight",Xi.Step="step",Xi.SmoothStep="smoothstep",Xi.SimpleBezier="simplebezier",(Wv=ys||(ys={})).Arrow="arrow",Wv.ArrowClosed="arrowclosed",(Xl=Ue||(Ue={})).Left="left",Xl.Top="top",Xl.Right="right",Xl.Bottom="bottom";const Kh=A.memo(({sourceX:t,sourceY:e,targetX:n,targetY:o,sourcePosition:r=Ue.Bottom,targetPosition:s=Ue.Top,label:i,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:f,markerEnd:m,markerStart:_,interactionWidth:g})=>{const[p,b,y]=Gv({sourceX:t,sourceY:e,sourcePosition:r,targetX:n,targetY:o,targetPosition:s});return Y.createElement(Yi,{path:p,labelX:b,labelY:y,label:i,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:f,markerEnd:m,markerStart:_,interactionWidth:g})});Kh.displayName="SimpleBezierEdge";const Yv={[Ue.Left]:{x:-1,y:0},[Ue.Right]:{x:1,y:0},[Ue.Top]:{x:0,y:-1},[Ue.Bottom]:{x:0,y:1}},Jv=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function MR({source:t,sourcePosition:e=Ue.Bottom,target:n,targetPosition:o=Ue.Top,center:r,offset:s}){const i=Yv[e],a=Yv[o],l={x:t.x+i.x*s,y:t.y+i.y*s},c={x:n.x+a.x*s,y:n.y+a.y*s},d=(({source:k,sourcePosition:E=Ue.Bottom,target:N})=>E===Ue.Left||E===Ue.Right?k.x<N.x?{x:1,y:0}:{x:-1,y:0}:k.y<N.y?{x:0,y:1}:{x:0,y:-1})({source:l,sourcePosition:e,target:c}),h=d.x!==0?"x":"y",f=d[h];let m,_,g=[];const p={x:0,y:0},b={x:0,y:0},[y,x,v,S]=Uv({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(i[h]*a[h]===-1){m=r.x??y,_=r.y??x;const k=[{x:m,y:l.y},{x:m,y:c.y}],E=[{x:l.x,y:_},{x:c.x,y:_}];g=i[h]===f?h==="x"?k:E:h==="x"?E:k}else{const k=[{x:l.x,y:c.y}],E=[{x:c.x,y:l.y}];if(g=h==="x"?i.x===f?E:k:i.y===f?k:E,e===o){const T=Math.abs(t[h]-n[h]);if(T<=s){const M=Math.min(s-1,s-T);i[h]===f?p[h]=(l[h]>t[h]?-1:1)*M:b[h]=(c[h]>n[h]?-1:1)*M}}if(e!==o){const T=h==="x"?"y":"x",M=i[h]===a[T],D=l[T]>c[T],z=l[T]<c[T];(i[h]===1&&(!M&&D||M&&z)||i[h]!==1&&(!M&&z||M&&D))&&(g=h==="x"?k:E)}const N={x:l.x+p.x,y:l.y+p.y},I={x:c.x+b.x,y:c.y+b.y};Math.max(Math.abs(N.x-g[0].x),Math.abs(I.x-g[0].x))>=Math.max(Math.abs(N.y-g[0].y),Math.abs(I.y-g[0].y))?(m=(N.x+I.x)/2,_=g[0].y):(m=g[0].x,_=(N.y+I.y)/2)}return[[t,{x:l.x+p.x,y:l.y+p.y},...g,{x:c.x+b.x,y:c.y+b.y},n],m,_,v,S]}function Xh({sourceX:t,sourceY:e,sourcePosition:n=Ue.Bottom,targetX:o,targetY:r,targetPosition:s=Ue.Top,borderRadius:i=5,centerX:a,centerY:l,offset:c=20}){const[d,h,f,m,_]=MR({source:{x:t,y:e},sourcePosition:n,target:{x:o,y:r},targetPosition:s,center:{x:a,y:l},offset:c});return[d.reduce((g,p,b)=>{let y="";return y=b>0&&b<d.length-1?function(x,v,S,k){const E=Math.min(Jv(x,v)/2,Jv(v,S)/2,k),{x:N,y:I}=v;if(x.x===N&&N===S.x||x.y===I&&I===S.y)return`L${N} ${I}`;if(x.y===I)return`L ${N+E*(x.x<S.x?-1:1)},${I}Q ${N},${I} ${N},${I+E*(x.y<S.y?1:-1)}`;const T=x.x<S.x?1:-1;return`L ${N},${I+E*(x.y<S.y?-1:1)}Q ${N},${I} ${N+E*T},${I}`}(d[b-1],p,d[b+1],i):`${b===0?"M":"L"}${p.x} ${p.y}`,g+=y},""),h,f,m,_]}const Zl=A.memo(({sourceX:t,sourceY:e,targetX:n,targetY:o,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,sourcePosition:h=Ue.Bottom,targetPosition:f=Ue.Top,markerEnd:m,markerStart:_,pathOptions:g,interactionWidth:p})=>{const[b,y,x]=Xh({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 Y.createElement(Yi,{path:b,labelX:y,labelY:x,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:m,markerStart:_,interactionWidth:p})});Zl.displayName="SmoothStepEdge";const Zh=A.memo(t=>{var e;return Y.createElement(Zl,{...t,pathOptions:A.useMemo(()=>{var n;return{borderRadius:0,offset:(n=t.pathOptions)==null?void 0:n.offset}},[(e=t.pathOptions)==null?void 0:e.offset])})});Zh.displayName="StepEdge";const Qh=A.memo(({sourceX:t,sourceY:e,targetX:n,targetY:o,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:h,markerStart:f,interactionWidth:m})=>{const[_,g,p]=function({sourceX:b,sourceY:y,targetX:x,targetY:v}){const[S,k,E,N]=Uv({sourceX:b,sourceY:y,targetX:x,targetY:v});return[`M ${b},${y}L ${x},${v}`,S,k,E,N]}({sourceX:t,sourceY:e,targetX:n,targetY:o});return Y.createElement(Yi,{path:_,labelX:g,labelY:p,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:h,markerStart:f,interactionWidth:m})});function Ql(t,e){return t>=0?.5*t:25*e*Math.sqrt(-t)}function Kv({pos:t,x1:e,y1:n,x2:o,y2:r,c:s}){switch(t){case Ue.Left:return[e-Ql(e-o,s),n];case Ue.Right:return[e+Ql(o-e,s),n];case Ue.Top:return[e,n-Ql(n-r,s)];case Ue.Bottom:return[e,n+Ql(r-n,s)]}}function Xv({sourceX:t,sourceY:e,sourcePosition:n=Ue.Bottom,targetX:o,targetY:r,targetPosition:s=Ue.Top,curvature:i=.25}){const[a,l]=Kv({pos:n,x1:t,y1:e,x2:o,y2:r,c:i}),[c,d]=Kv({pos:s,x1:o,y1:r,x2:t,y2:e,c:i}),[h,f,m,_]=Vv({sourceX:t,sourceY:e,targetX:o,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:d});return[`M${t},${e} C${a},${l} ${c},${d} ${o},${r}`,h,f,m,_]}Qh.displayName="StraightEdge";const ec=A.memo(({sourceX:t,sourceY:e,targetX:n,targetY:o,sourcePosition:r=Ue.Bottom,targetPosition:s=Ue.Top,label:i,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:f,markerEnd:m,markerStart:_,pathOptions:g,interactionWidth:p})=>{const[b,y,x]=Xv({sourceX:t,sourceY:e,sourcePosition:r,targetX:n,targetY:o,targetPosition:s,curvature:g==null?void 0:g.curvature});return Y.createElement(Yi,{path:b,labelX:y,labelY:x,label:i,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:f,markerEnd:m,markerStart:_,interactionWidth:p})});ec.displayName="BezierEdge";const ef=A.createContext(null),OR=ef.Provider;ef.Consumer;const DR=({source:t,sourceHandle:e,target:n,targetHandle:o})=>`reactflow__edge-${t}${e||""}-${n}${o||""}`,tf=(t,e)=>t===void 0?"":typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(n=>`${n}=${t[n]}`).join("&")}`,nf=({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},Zv=({x:t,y:e},[n,o,r])=>({x:t*r+n,y:e*r+o}),xs=(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}},of=(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}=xs(r,e).positionAbsolute;return a=o,l=qh({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)},Qv=(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},c=[];return t.forEach(d=>{const{width:h,height:f,selectable:m=!0,hidden:_=!1}=d;if(i&&!m||_)return!1;const{positionAbsolute:g}=xs(d,a),p={x:g.x,y:g.y,width:h||0,height:f||0},b=Gh(l,p);(h===void 0||f===void 0||h===null||f===null||s&&b>0||b>=(h||0)*(f||0)||d.dragging)&&c.push(d)}),c},e2=(t,e)=>{const n=t.map(o=>o.id);return e.filter(o=>n.includes(o.source)||n.includes(o.target))},t2=(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),c=bs(l,o,r);return{x:e/2-(t.x+t.width/2)*c,y:n/2-(t.y+t.height/2)*c,zoom:c}},Dr=(t,e=0)=>t.transition().duration(e);function n2(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 RR={source:null,target:null,sourceHandle:null,targetHandle:null},o2=()=>({handleDomNode:null,isValid:!1,connection:RR,endHandle:null});function r2(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}"]`),c={...o2(),handleDomNode:l};if(l){const d=rf(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};c.connection=g,m&&_&&(e===Or.Strict?a&&d==="source"||!a&&d==="target":h!==n||f!==o)&&(c.endHandle={nodeId:h,handleId:f,type:d},c.isValid=s(g))}return c}function rf(t,e){return t||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function sf(t){t==null||t.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function PR(t,e){let n=null;return e?n="valid":t&&!e&&(n="invalid"),n}function s2({event:t,handleId:e,nodeId:n,onConnect:o,isTarget:r,getState:s,setState:i,isValidConnection:a,edgeUpdaterType:l,onReconnectEnd:c}){const d=Lv(t.target),{connectionMode:h,domNode:f,autoPanOnConnect:m,connectionRadius:_,onConnectStart:g,panBy:p,getNodes:b,cancelConnection:y}=s();let x,v=0;const{x:S,y:k}=er(t),E=d==null?void 0:d.elementFromPoint(S,k),N=rf(l,E),I=f==null?void 0:f.getBoundingClientRect();if(!I||!N)return;let T,M=er(t,I),D=!1,z=null,O=!1,F=null;const B=function({nodes:$,nodeId:j,handleId:W,handleType:K}){return $.reduce((Z,q)=>{if(q[Nt]){const{handleBounds:te}=q[Nt];let re=[],ae=[];te&&(re=n2(q,te,"source",`${j}-${W}-${K}`),ae=n2(q,te,"target",`${j}-${W}-${K}`)),Z.push(...re,...ae)}return Z},[])}({nodes:b(),nodeId:n,handleId:e,handleType:N}),V=()=>{if(!m)return;const[$,j]=Pv(M,I);p({x:$,y:j}),v=requestAnimationFrame(V)};function L($){const{transform:j}=s();M=er($,I);const{handle:W,validHandleResult:K}=function(Z,q,te,re,ae,X){const{x:ee,y:ce}=er(Z),me=q.elementsFromPoint(ee,ce).find(Ne=>Ne.classList.contains("react-flow__handle"));if(me){const Ne=me.getAttribute("data-nodeid");if(Ne){const se=rf(void 0,me),Ae=me.getAttribute("data-handleid"),be=X({nodeId:Ne,id:Ae,type:se});if(be){const Re=ae.find(ze=>ze.nodeId===Ne&&ze.type===se&&ze.id===Ae);return{handle:{id:Ae,type:se,nodeId:Ne,x:(Re==null?void 0:Re.x)||te.x,y:(Re==null?void 0:Re.y)||te.y},validHandleResult:be}}}}let ue=[],pe=1/0;if(ae.forEach(Ne=>{const se=Math.sqrt((Ne.x-te.x)**2+(Ne.y-te.y)**2);if(se<=re){const Ae=X(Ne);se<=pe&&(se<pe?ue=[{handle:Ne,validHandleResult:Ae}]:se===pe&&ue.push({handle:Ne,validHandleResult:Ae}),pe=se)}}),!ue.length)return{handle:null,validHandleResult:o2()};if(ue.length===1)return ue[0];const de=ue.some(({validHandleResult:Ne})=>Ne.isValid),Ce=ue.some(({handle:Ne})=>Ne.type==="target");return ue.find(({handle:Ne,validHandleResult:se})=>Ce?Ne.type==="target":!de||se.isValid)||ue[0]}($,d,nf(M,j,!1,[1,1]),_,B,Z=>r2(Z,h,n,e,r?"target":"source",a,d));if(x=W,D||(V(),D=!0),F=K.handleDomNode,z=K.connection,O=K.isValid,i({connectionPosition:x&&O?Zv({x:x.x,y:x.y},j):M,connectionStatus:PR(!!x,O),connectionEndHandle:K.endHandle}),!x&&!O&&!F)return sf(T);z.source!==z.target&&F&&(sf(T),T=F,F.classList.add("connecting","react-flow__handle-connecting"),F.classList.toggle("valid",O),F.classList.toggle("react-flow__handle-valid",O))}function C($){var j,W;(x||F)&&z&&O&&(o==null||o(z)),(W=(j=s()).onConnectEnd)==null||W.call(j,$),l&&(c==null||c($)),sf(T),y(),cancelAnimationFrame(v),D=!1,O=!1,z=null,F=null,d.removeEventListener("mousemove",L),d.removeEventListener("mouseup",C),d.removeEventListener("touchmove",L),d.removeEventListener("touchend",C)}i({connectionPosition:M,connectionStatus:null,connectionNodeId:n,connectionHandleId:e,connectionHandleType:N,connectionStartHandle:{nodeId:n,handleId:e,type:N},connectionEndHandle:null}),g==null||g(t,{nodeId:n,handleId:e,handleType:N}),d.addEventListener("mousemove",L),d.addEventListener("mouseup",C),d.addEventListener("touchmove",L),d.addEventListener("touchend",C)}const i2=()=>!0,LR=t=>({connectionStartHandle:t.connectionStartHandle,connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName}),a2=A.forwardRef(({type:t="source",position:e=Ue.Top,isValidConnection:n,isConnectable:o=!0,isConnectableStart:r=!0,isConnectableEnd:s=!0,id:i,onConnect:a,children:l,className:c,onMouseDown:d,onTouchStart:h,...f},m)=>{var N,I;const _=i||null,g=t==="target",p=qt(),b=A.useContext(ef),{connectOnClick:y,noPanClassName:x}=mt(LR,on),{connecting:v,clickConnecting:S}=mt(((T,M,D)=>z=>{const{connectionStartHandle:O,connectionEndHandle:F,connectionClickStartHandle:B}=z;return{connecting:(O==null?void 0:O.nodeId)===T&&(O==null?void 0:O.handleId)===M&&(O==null?void 0:O.type)===D||(F==null?void 0:F.nodeId)===T&&(F==null?void 0:F.handleId)===M&&(F==null?void 0:F.type)===D,clickConnecting:(B==null?void 0:B.nodeId)===T&&(B==null?void 0:B.handleId)===M&&(B==null?void 0:B.type)===D}})(b,_,t),on);b||((I=(N=p.getState()).onError)==null||I.call(N,"010",NR()));const k=T=>{const{defaultEdgeOptions:M,onConnect:D,hasDefaultEdges:z}=p.getState(),O={...M,...T};if(z){const{edges:F,setEdges:B}=p.getState();B(((V,L)=>{if(!V.source||!V.target)return L;let C;return C=($=>"id"in $&&"source"in $&&"target"in $)(V)?{...V}:{...V,id:DR(V)},(($,j)=>j.some(W=>!(W.source!==$.source||W.target!==$.target||W.sourceHandle!==$.sourceHandle&&(W.sourceHandle||$.sourceHandle)||W.targetHandle!==$.targetHandle&&(W.targetHandle||$.targetHandle))))(C,L)?L:L.concat(C)})(O,F))}D==null||D(O),a==null||a(O)},E=T=>{if(!b)return;const M=Bv(T);r&&(M&&T.button===0||!M)&&s2({event:T,handleId:_,nodeId:b,onConnect:k,isTarget:g,getState:p.getState,setState:p.setState,isValidConnection:n||p.getState().isValidConnection||i2}),M?d==null||d(T):h==null||h(T)};return Y.createElement("div",{"data-handleid":_,"data-nodeid":b,"data-handlepos":e,"data-id":`${b}-${_}-${t}`,className:hn(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",x,c,{source:!g,target:g,connectable:o,connectablestart:r,connectableend:s,connecting:S,connectionindicator:o&&(r&&!v||s&&v)}]),onMouseDown:E,onTouchStart:E,onClick:y?T=>{const{onClickConnectStart:M,onClickConnectEnd:D,connectionClickStartHandle:z,connectionMode:O,isValidConnection:F}=p.getState();if(!b||!z&&!r)return;if(!z)return M==null||M(T,{nodeId:b,handleId:_,handleType:t}),void p.setState({connectionClickStartHandle:{nodeId:b,type:t,handleId:_}});const B=Lv(T.target),V=n||F||i2,{connection:L,isValid:C}=r2({nodeId:b,id:_,type:t},O,z.nodeId,z.handleId||null,z.type,V,B);C&&k(L),D==null||D(T),p.setState({connectionClickStartHandle:null})}:void 0,ref:m,...f},l)});a2.displayName="Handle";var or=A.memo(a2);const l2=({data:t,isConnectable:e,targetPosition:n=Ue.Top,sourcePosition:o=Ue.Bottom})=>Y.createElement(Y.Fragment,null,Y.createElement(or,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label,Y.createElement(or,{type:"source",position:o,isConnectable:e}));l2.displayName="DefaultNode";var af=A.memo(l2);const c2=({data:t,isConnectable:e,sourcePosition:n=Ue.Bottom})=>Y.createElement(Y.Fragment,null,t==null?void 0:t.label,Y.createElement(or,{type:"source",position:n,isConnectable:e}));c2.displayName="InputNode";var d2=A.memo(c2);const u2=({data:t,isConnectable:e,targetPosition:n=Ue.Top})=>Y.createElement(Y.Fragment,null,Y.createElement(or,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label);u2.displayName="OutputNode";var h2=A.memo(u2);const lf=()=>null;lf.displayName="GroupNode";const FR=t=>({selectedNodes:t.getNodes().filter(e=>e.selected),selectedEdges:t.edges.filter(e=>e.selected).map(e=>({...e}))}),tc=t=>t.id;function zR(t,e){return on(t.selectedNodes.map(tc),e.selectedNodes.map(tc))&&on(t.selectedEdges.map(tc),e.selectedEdges.map(tc))}const f2=A.memo(({onSelectionChange:t})=>{const e=qt(),{selectedNodes:n,selectedEdges:o}=mt(FR,zR);return A.useEffect(()=>{const r={nodes:n,edges:o};t==null||t(r),e.getState().onSelectionChange.forEach(s=>s(r))},[n,o,t]),null});f2.displayName="SelectionListener";const BR=t=>!!t.onSelectionChange;function UR({onSelectionChange:t}){const e=mt(BR);return t||e?Y.createElement(f2,{onSelectionChange:t}):null}const VR=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 ws(t,e){A.useEffect(()=>{t!==void 0&&e(t)},[t])}function it(t,e,n){A.useEffect(()=>{e!==void 0&&n({[t]:e})},[e])}const $R=({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,onConnect:r,onConnectStart:s,onConnectEnd:i,onClickConnectStart:a,onClickConnectEnd:l,nodesDraggable:c,nodesConnectable:d,nodesFocusable:h,edgesFocusable:f,edgesUpdatable:m,elevateNodesOnSelect:_,minZoom:g,maxZoom:p,nodeExtent:b,onNodesChange:y,onEdgesChange:x,elementsSelectable:v,connectionMode:S,snapGrid:k,snapToGrid:E,translateExtent:N,connectOnClick:I,defaultEdgeOptions:T,fitView:M,fitViewOptions:D,onNodesDelete:z,onEdgesDelete:O,onNodeDrag:F,onNodeDragStart:B,onNodeDragStop:V,onSelectionDrag:L,onSelectionDragStart:C,onSelectionDragStop:$,noPanClassName:j,nodeOrigin:W,rfId:K,autoPanOnConnect:Z,autoPanOnNodeDrag:q,onError:te,connectionRadius:re,isValidConnection:ae,nodeDragThreshold:X})=>{const{setNodes:ee,setEdges:ce,setDefaultNodesAndEdges:me,setMinZoom:ue,setMaxZoom:pe,setTranslateExtent:de,setNodeExtent:Ce,reset:Ne}=mt(VR,on),se=qt();return A.useEffect(()=>{const Ae=o==null?void 0:o.map(be=>({...be,...T}));return me(n,Ae),()=>{Ne()}},[]),it("defaultEdgeOptions",T,se.setState),it("connectionMode",S,se.setState),it("onConnect",r,se.setState),it("onConnectStart",s,se.setState),it("onConnectEnd",i,se.setState),it("onClickConnectStart",a,se.setState),it("onClickConnectEnd",l,se.setState),it("nodesDraggable",c,se.setState),it("nodesConnectable",d,se.setState),it("nodesFocusable",h,se.setState),it("edgesFocusable",f,se.setState),it("edgesUpdatable",m,se.setState),it("elementsSelectable",v,se.setState),it("elevateNodesOnSelect",_,se.setState),it("snapToGrid",E,se.setState),it("snapGrid",k,se.setState),it("onNodesChange",y,se.setState),it("onEdgesChange",x,se.setState),it("connectOnClick",I,se.setState),it("fitViewOnInit",M,se.setState),it("fitViewOnInitOptions",D,se.setState),it("onNodesDelete",z,se.setState),it("onEdgesDelete",O,se.setState),it("onNodeDrag",F,se.setState),it("onNodeDragStart",B,se.setState),it("onNodeDragStop",V,se.setState),it("onSelectionDrag",L,se.setState),it("onSelectionDragStart",C,se.setState),it("onSelectionDragStop",$,se.setState),it("noPanClassName",j,se.setState),it("nodeOrigin",W,se.setState),it("rfId",K,se.setState),it("autoPanOnConnect",Z,se.setState),it("autoPanOnNodeDrag",q,se.setState),it("onError",te,se.setState),it("connectionRadius",re,se.setState),it("isValidConnection",ae,se.setState),it("nodeDragThreshold",X,se.setState),ws(t,ee),ws(e,ce),ws(g,ue),ws(p,pe),ws(N,de),ws(b,Ce),null},m2={display:"none"},HR={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},p2="react-flow__node-desc",g2="react-flow__edge-desc",WR=t=>t.ariaLiveMessage;function qR({rfId:t}){const e=mt(WR);return Y.createElement("div",{id:`react-flow__aria-live-${t}`,"aria-live":"assertive","aria-atomic":"true",style:HR},e)}function GR({rfId:t,disableKeyboardA11y:e}){return Y.createElement(Y.Fragment,null,Y.createElement("div",{id:`${p2}-${t}`,style:m2},"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."," "),Y.createElement("div",{id:`${g2}-${t}`,style:m2},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!e&&Y.createElement(qR,{rfId:t}))}var Zi=(t=null,e={actInsideInputWithModifier:!0})=>{const[n,o]=A.useState(!1),r=A.useRef(!1),s=A.useRef(new Set([])),[i,a]=A.useMemo(()=>{if(t!==null){const l=(Array.isArray(t)?t:[t]).filter(d=>typeof d=="string").map(d=>d.split("+")),c=l.reduce((d,h)=>d.concat(...h),[]);return[l,c]}return[[],[]]},[t]);return A.useEffect(()=>{const l=typeof document<"u"?document:null,c=(e==null?void 0:e.target)||l;if(t!==null){const d=m=>{if(r.current=m.ctrlKey||m.metaKey||m.shiftKey,(!r.current||r.current&&!e.actInsideInputWithModifier)&&Yh(m))return!1;const _=b2(m.code,a);s.current.add(m[_]),_2(i,s.current,!1)&&(m.preventDefault(),o(!0))},h=m=>{if((!r.current||r.current&&!e.actInsideInputWithModifier)&&Yh(m))return!1;const _=b2(m.code,a);_2(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 c==null||c.addEventListener("keydown",d),c==null||c.addEventListener("keyup",h),window.addEventListener("blur",f),()=>{c==null||c.removeEventListener("keydown",d),c==null||c.removeEventListener("keyup",h),window.removeEventListener("blur",f)}}},[t,o]),n};function _2(t,e,n){return t.filter(o=>n||o.length===e.size).some(o=>o.every(r=>e.has(r)))}function b2(t,e){return e.includes(t)?"code":"key"}function y2(t,e,n,o){var a,l;const r=t.parentNode||t.parentId;if(!r)return n;const s=e.get(r),i=xs(s,o);return y2(s,e,{x:(n.x??0)+i.x,y:(n.y??0)+i.y,z:(((a=s[Nt])==null?void 0:a.z)??0)>(n.z??0)?((l=s[Nt])==null?void 0:l.z)??0:n.z??0},o)}function x2(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}=y2(o,t,{...o.position,z:((s=o[Nt])==null?void 0:s.z)??0},e);o.positionAbsolute={x:i,y:a},o[Nt].z=l,n!=null&&n[o.id]&&(o[Nt].isParent=!0)}})}function cf(t,e,n,o){const r=new Map,s={},i=o?1e3:0;return t.forEach(a=>{var m;const l=(Vn(a.zIndex)?a.zIndex:0)+(a.selected?i:0),c=e.get(a.id),d={...a,positionAbsolute:{x:a.position.x,y:a.position.y}},h=a.parentNode||a.parentId;h&&(s[h]=!0);const f=(c==null?void 0:c.type)&&(c==null?void 0:c.type)!==a.type;Object.defineProperty(d,Nt,{enumerable:!1,value:{handleBounds:f||(m=c==null?void 0:c[Nt])==null?void 0:m.handleBounds,z:l}}),r.set(a.id,d)}),x2(r,n,s),r}function w2(t,e={}){const{getNodes:n,width:o,height:r,minZoom:s,maxZoom:i,d3Zoom:a,d3Selection:l,fitViewOnInitDone:c,fitViewOnInit:d,nodeOrigin:h}=t(),f=e.initial&&!c&&d;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(y=>y.id===g.id):p}),_=m.every(g=>g.width&&g.height);if(m.length>0&&_){const g=of(m,h),{x:p,y:b,zoom:y}=t2(g,o,r,e.minZoom??s,e.maxZoom??i,e.padding??.1),x=yr.translate(p,b).scale(y);return typeof e.duration=="number"&&e.duration>0?a.transform(Dr(l,e.duration),x):a.transform(l,x),!0}}return!1}function YR(t,e){return t.forEach(n=>{const o=e.get(n.id);o&&e.set(o.id,{...o,[Nt]:o[Nt],selected:n.selected})}),new Map(e)}function JR(t,e){return e.map(n=>{const o=t.find(r=>r.id===n.id);return o&&(n.selected=o.selected),n})}function nc({changedNodes:t,changedEdges:e,get:n,set:o}){const{nodeInternals:r,edges:s,onNodesChange:i,onEdgesChange:a,hasDefaultNodes:l,hasDefaultEdges:c}=n();t!=null&&t.length&&(l&&o({nodeInternals:YR(t,r)}),i==null||i(t)),e!=null&&e.length&&(c&&o({edges:JR(e,s)}),a==null||a(e))}const vs=()=>{},KR={zoomIn:vs,zoomOut:vs,zoomTo:vs,getZoom:()=>1,setViewport:vs,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:vs,fitBounds:vs,project:t=>t,screenToFlowPosition:t=>t,flowToScreenPosition:t=>t,viewportInitialized:!1},XR=t=>({d3Zoom:t.d3Zoom,d3Selection:t.d3Selection});function Qi(){const t=(()=>{const g=qt(),{d3Zoom:p,d3Selection:b}=mt(XR,on);return A.useMemo(()=>b&&p?{zoomIn:x=>p.scaleBy(Dr(b,x==null?void 0:x.duration),1.2),zoomOut:x=>p.scaleBy(Dr(b,x==null?void 0:x.duration),1/1.2),zoomTo:(x,v)=>p.scaleTo(Dr(b,v==null?void 0:v.duration),x),getZoom:()=>g.getState().transform[2],setViewport:(x,v)=>{const[S,k,E]=g.getState().transform,N=yr.translate(x.x??S,x.y??k).scale(x.zoom??E);p.transform(Dr(b,v==null?void 0:v.duration),N)},getViewport:()=>{const[x,v,S]=g.getState().transform;return{x,y:v,zoom:S}},fitView:x=>w2(g.getState,x),setCenter:(x,v,S)=>{const{width:k,height:E,maxZoom:N}=g.getState(),I=(S==null?void 0:S.zoom)!==void 0?S.zoom:N,T=k/2-x*I,M=E/2-v*I,D=yr.translate(T,M).scale(I);p.transform(Dr(b,S==null?void 0:S.duration),D)},fitBounds:(x,v)=>{const{width:S,height:k,minZoom:E,maxZoom:N}=g.getState(),{x:I,y:T,zoom:M}=t2(x,S,k,E,N,(v==null?void 0:v.padding)??.1),D=yr.translate(I,T).scale(M);p.transform(Dr(b,v==null?void 0:v.duration),D)},project:x=>{const{transform:v,snapToGrid:S,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"),nf(x,v,S,k)},screenToFlowPosition:x=>{const{transform:v,snapToGrid:S,snapGrid:k,domNode:E}=g.getState();if(!E)return x;const{x:N,y:I}=E.getBoundingClientRect(),T={x:x.x-N,y:x.y-I};return nf(T,v,S,k)},flowToScreenPosition:x=>{const{transform:v,domNode:S}=g.getState();if(!S)return x;const{x:k,y:E}=S.getBoundingClientRect(),N=Zv(x,v);return{x:N.x+k,y:N.y+E}},viewportInitialized:!0}:KR,[p,b])})(),e=qt(),n=A.useCallback(()=>e.getState().getNodes().map(g=>({...g})),[]),o=A.useCallback(g=>e.getState().nodeInternals.get(g),[]),r=A.useCallback(()=>{const{edges:g=[]}=e.getState();return g.map(p=>({...p}))},[]),s=A.useCallback(g=>{const{edges:p=[]}=e.getState();return p.find(b=>b.id===g)},[]),i=A.useCallback(g=>{const{getNodes:p,setNodes:b,hasDefaultNodes:y,onNodesChange:x}=e.getState(),v=p(),S=typeof g=="function"?g(v):g;if(y)b(S);else if(x){const k=S.length===0?v.map(E=>({type:"remove",id:E.id})):S.map(E=>({item:E,type:"reset"}));x(k)}},[]),a=A.useCallback(g=>{const{edges:p=[],setEdges:b,hasDefaultEdges:y,onEdgesChange:x}=e.getState(),v=typeof g=="function"?g(p):g;y?b(v):x&&x(v.length===0?p.map(S=>({type:"remove",id:S.id})):v.map(S=>({item:S,type:"reset"})))},[]),l=A.useCallback(g=>{const p=Array.isArray(g)?g:[g],{getNodes:b,setNodes:y,hasDefaultNodes:x,onNodesChange:v}=e.getState();if(x)y([...b(),...p]);else if(v){const S=p.map(k=>({item:k,type:"add"}));v(S)}},[]),c=A.useCallback(g=>{const p=Array.isArray(g)?g:[g],{edges:b=[],setEdges:y,hasDefaultEdges:x,onEdgesChange:v}=e.getState();x?y([...b,...p]):v&&v(p.map(S=>({item:S,type:"add"})))},[]),d=A.useCallback(()=>{const{getNodes:g,edges:p=[],transform:b}=e.getState(),[y,x,v]=b;return{nodes:g().map(S=>({...S})),edges:p.map(S=>({...S})),viewport:{x:y,y:x,zoom:v}}},[]),h=A.useCallback(({nodes:g,edges:p})=>{const{nodeInternals:b,getNodes:y,edges:x,hasDefaultNodes:v,hasDefaultEdges:S,onNodesDelete:k,onEdgesDelete:E,onNodesChange:N,onEdgesChange:I}=e.getState(),T=(g||[]).map(F=>F.id),M=(p||[]).map(F=>F.id),D=y().reduce((F,B)=>{const V=B.parentNode||B.parentId,L=!T.includes(B.id)&&V&&F.find(C=>C.id===V);return(typeof B.deletable!="boolean"||B.deletable)&&(T.includes(B.id)||L)&&F.push(B),F},[]),z=x.filter(F=>typeof F.deletable!="boolean"||F.deletable),O=z.filter(F=>M.includes(F.id));if(D||O){const F=e2(D,z),B=[...O,...F],V=B.reduce((L,C)=>(L.includes(C.id)||L.push(C.id),L),[]);(S||v)&&(S&&e.setState({edges:x.filter(L=>!V.includes(L.id))}),v&&(D.forEach(L=>{b.delete(L.id)}),e.setState({nodeInternals:new Map(b)}))),V.length>0&&(E==null||E(B),I&&I(V.map(L=>({id:L,type:"remove"})))),D.length>0&&(k==null||k(D),N)&&N(D.map(L=>({id:L.id,type:"remove"})))}},[]),f=A.useCallback(g=>{const p=Vn((b=g).width)&&Vn(b.height)&&Vn(b.x)&&Vn(b.y);var b;const y=p?null:e.getState().nodeInternals.get(g.id);return!p&&!y?[null,null,p]:[p?g:Fv(y),y,p]},[]),m=A.useCallback((g,p=!0,b)=>{const[y,x,v]=f(g);return y?(b||e.getState().getNodes()).filter(S=>{if(!(v||S.id!==x.id&&S.positionAbsolute))return!1;const k=Fv(S),E=Gh(k,y);return p&&E>0||E>=y.width*y.height}):[]},[]),_=A.useCallback((g,p,b=!0)=>{const[y]=f(g);if(!y)return!1;const x=Gh(y,p);return b&&x>0||x>=y.width*y.height},[]);return A.useMemo(()=>({...t,getNodes:n,getNode:o,getEdges:r,getEdge:s,setNodes:i,setEdges:a,addNodes:l,addEdges:c,toObject:d,deleteElements:h,getIntersectingNodes:m,isNodeIntersecting:_}),[t,n,o,r,s,i,a,l,c,d,h,m,_])}const ZR={actInsideInputWithModifier:!1},df={position:"absolute",width:"100%",height:"100%",top:0,left:0},oc=t=>({x:t.x,y:t.y,zoom:t.k}),ks=(t,e)=>t.target.closest(`.${e}`),v2=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),k2=t=>{const e=t.ctrlKey&&Kl()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e},QR=t=>({d3Zoom:t.d3Zoom,d3Selection:t.d3Selection,d3ZoomHandler:t.d3ZoomHandler,userSelectionActive:t.userSelectionActive}),eP=({onMove:t,onMoveStart:e,onMoveEnd:n,onPaneContextMenu:o,zoomOnScroll:r=!0,zoomOnPinch:s=!0,panOnScroll:i=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=tr.Free,zoomOnDoubleClick:c=!0,elementsSelectable:d,panOnDrag:h=!0,defaultViewport:f,translateExtent:m,minZoom:_,maxZoom:g,zoomActivationKeyCode:p,preventScrolling:b=!0,children:y,noWheelClassName:x,noPanClassName:v})=>{const S=A.useRef(),k=qt(),E=A.useRef(!1),N=A.useRef(!1),I=A.useRef(null),T=A.useRef({x:0,y:0,zoom:0}),{d3Zoom:M,d3Selection:D,d3ZoomHandler:z,userSelectionActive:O}=mt(QR,on),F=Zi(p),B=A.useRef(0),V=A.useRef(!1),L=A.useRef();return function(C){const $=qt();A.useEffect(()=>{let j;const W=()=>{var Z,q;if(!C.current)return;const K=Hh(C.current);K.height!==0&&K.width!==0||((q=(Z=$.getState()).onError)==null||q.call(Z,"004",vR())),$.setState({width:K.width||500,height:K.height||500})};return W(),window.addEventListener("resize",W),C.current&&(j=new ResizeObserver(()=>W()),j.observe(C.current)),()=>{window.removeEventListener("resize",W),j&&C.current&&j.unobserve(C.current)}},[])}(I),A.useEffect(()=>{if(I.current){const C=I.current.getBoundingClientRect(),$=function(){var q,te,re,ae=pR,X=gR,ee=yR,ce=_R,me=bR,ue=[0,1/0],pe=[[-1/0,-1/0],[1/0,1/0]],de=250,Ce=KV,Ne=pS("start","zoom","end"),se=0,Ae=10;function be(G){G.property("__zoom",Ov).on("wheel.zoom",tt,{passive:!1}).on("mousedown.zoom",at).on("dblclick.zoom",ne).filter(me).on("touchstart.zoom",ke).on("touchmove.zoom",je).on("touchend.zoom touchcancel.zoom",Le).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function Re(G,ge){return(ge=Math.max(ue[0],Math.min(ue[1],ge)))===G.k?G:new fp(ge,G.x,G.y)}function ze(G,ge,_e){var fe=ge[0]-_e[0]*G.k,le=ge[1]-_e[1]*G.k;return fe===G.x&&le===G.y?G:new fp(G.k,fe,le)}function qe(G){return[(+G[0][0]+ +G[1][0])/2,(+G[0][1]+ +G[1][1])/2]}function Ze(G,ge,_e,fe){G.on("start.zoom",function(){Pe(this,arguments).event(fe).start()}).on("interrupt.zoom end.zoom",function(){Pe(this,arguments).event(fe).end()}).tween("zoom",function(){var le=this,Ve=arguments,Fe=Pe(le,Ve).event(fe),Je=X.apply(le,Ve),ie=_e==null?qe(Je):typeof _e=="function"?_e.apply(le,Ve):_e,ve=Math.max(Je[1][0]-Je[0][0],Je[1][1]-Je[0][1]),Ee=le.__zoom,Be=typeof ge=="function"?ge.apply(le,Ve):ge,Ye=Ce(Ee.invert(ie).concat(ve/Ee.k),Be.invert(ie).concat(ve/Be.k));return function(Oe){if(Oe===1)Oe=Be;else{var He=Ye(Oe),rt=ve/He[2];Oe=new fp(rt,ie[0]-He[0]*rt,ie[1]-He[1]*rt)}Fe.zoom(null,Oe)}})}function Pe(G,ge,_e){return!_e&&G.__zooming||new Qe(G,ge)}function Qe(G,ge){this.that=G,this.args=ge,this.active=0,this.sourceEvent=null,this.extent=X.apply(G,ge),this.taps=0}function tt(G,...ge){if(ae.apply(this,arguments)){var _e=Pe(this,ge).event(G),fe=this.__zoom,le=Math.max(ue[0],Math.min(ue[1],fe.k*Math.pow(2,ce.apply(this,arguments)))),Ve=mo(G);if(_e.wheel)_e.mouse[0][0]===Ve[0]&&_e.mouse[0][1]===Ve[1]||(_e.mouse[1]=fe.invert(_e.mouse[0]=Ve)),clearTimeout(_e.wheel);else{if(fe.k===le)return;_e.mouse=[Ve,fe.invert(Ve)],mp(this),_e.start()}Gi(G),_e.wheel=setTimeout(function(){_e.wheel=null,_e.end()},150),_e.zoom("mouse",ee(ze(Re(fe,le),_e.mouse[0],_e.mouse[1]),_e.extent,pe))}}function at(G,...ge){if(!re&&ae.apply(this,arguments)){var _e=G.currentTarget,fe=Pe(this,ge,!0).event(G),le=ro(G.view).on("mousemove.zoom",function(ie){if(Gi(ie),!fe.moved){var ve=ie.clientX-Fe,Ee=ie.clientY-Je;fe.moved=ve*ve+Ee*Ee>se}fe.event(ie).zoom("mouse",ee(ze(fe.that.__zoom,fe.mouse[0]=mo(ie,_e),fe.mouse[1]),fe.extent,pe))},!0).on("mouseup.zoom",function(ie){le.on("mousemove.zoom mouseup.zoom",null),Mv(ie.view,fe.moved),Gi(ie),fe.event(ie).end()},!0),Ve=mo(G,_e),Fe=G.clientX,Je=G.clientY;Tv(G.view),$h(G),fe.mouse=[Ve,this.__zoom.invert(Ve)],mp(this),fe.start()}}function ne(G,...ge){if(ae.apply(this,arguments)){var _e=this.__zoom,fe=mo(G.changedTouches?G.changedTouches[0]:G,this),le=_e.invert(fe),Ve=_e.k*(G.shiftKey?.5:2),Fe=ee(ze(Re(_e,Ve),fe,le),X.apply(this,ge),pe);Gi(G),de>0?ro(this).transition().duration(de).call(Ze,Fe,fe,G):ro(this).call(be.transform,Fe,fe,G)}}function ke(G,...ge){if(ae.apply(this,arguments)){var _e,fe,le,Ve,Fe=G.touches,Je=Fe.length,ie=Pe(this,ge,G.changedTouches.length===Je).event(G);for($h(G),fe=0;fe<Je;++fe)Ve=[Ve=mo(le=Fe[fe],this),this.__zoom.invert(Ve),le.identifier],ie.touch0?ie.touch1||ie.touch0[2]===Ve[2]||(ie.touch1=Ve,ie.taps=0):(ie.touch0=Ve,_e=!0,ie.taps=1+!!q);q&&(q=clearTimeout(q)),_e&&(ie.taps<2&&(te=Ve[0],q=setTimeout(function(){q=null},500)),mp(this),ie.start())}}function je(G,...ge){if(this.__zooming){var _e,fe,le,Ve,Fe=Pe(this,ge).event(G),Je=G.changedTouches,ie=Je.length;for(Gi(G),_e=0;_e<ie;++_e)le=mo(fe=Je[_e],this),Fe.touch0&&Fe.touch0[2]===fe.identifier?Fe.touch0[0]=le:Fe.touch1&&Fe.touch1[2]===fe.identifier&&(Fe.touch1[0]=le);if(fe=Fe.that.__zoom,Fe.touch1){var ve=Fe.touch0[0],Ee=Fe.touch0[1],Be=Fe.touch1[0],Ye=Fe.touch1[1],Oe=(Oe=Be[0]-ve[0])*Oe+(Oe=Be[1]-ve[1])*Oe,He=(He=Ye[0]-Ee[0])*He+(He=Ye[1]-Ee[1])*He;fe=Re(fe,Math.sqrt(Oe/He)),le=[(ve[0]+Be[0])/2,(ve[1]+Be[1])/2],Ve=[(Ee[0]+Ye[0])/2,(Ee[1]+Ye[1])/2]}else{if(!Fe.touch0)return;le=Fe.touch0[0],Ve=Fe.touch0[1]}Fe.zoom("touch",ee(ze(fe,le,Ve),Fe.extent,pe))}}function Le(G,...ge){if(this.__zooming){var _e,fe,le=Pe(this,ge).event(G),Ve=G.changedTouches,Fe=Ve.length;for($h(G),re&&clearTimeout(re),re=setTimeout(function(){re=null},500),_e=0;_e<Fe;++_e)fe=Ve[_e],le.touch0&&le.touch0[2]===fe.identifier?delete le.touch0:le.touch1&&le.touch1[2]===fe.identifier&&delete le.touch1;if(le.touch1&&!le.touch0&&(le.touch0=le.touch1,delete le.touch1),le.touch0)le.touch0[1]=this.__zoom.invert(le.touch0[0]);else if(le.end(),le.taps===2&&(fe=mo(fe,this),Math.hypot(te[0]-fe[0],te[1]-fe[1])<Ae)){var Je=ro(this).on("dblclick.zoom");Je&&Je.apply(this,arguments)}}}return be.transform=function(G,ge,_e,fe){var le=G.selection?G.selection():G;le.property("__zoom",Ov),G!==le?Ze(G,ge,_e,fe):le.interrupt().each(function(){Pe(this,arguments).event(fe).start().zoom(null,typeof ge=="function"?ge.apply(this,arguments):ge).end()})},be.scaleBy=function(G,ge,_e,fe){be.scaleTo(G,function(){return this.__zoom.k*(typeof ge=="function"?ge.apply(this,arguments):ge)},_e,fe)},be.scaleTo=function(G,ge,_e,fe){be.transform(G,function(){var le=X.apply(this,arguments),Ve=this.__zoom,Fe=_e==null?qe(le):typeof _e=="function"?_e.apply(this,arguments):_e,Je=Ve.invert(Fe),ie=typeof ge=="function"?ge.apply(this,arguments):ge;return ee(ze(Re(Ve,ie),Fe,Je),le,pe)},_e,fe)},be.translateBy=function(G,ge,_e,fe){be.transform(G,function(){return ee(this.__zoom.translate(typeof ge=="function"?ge.apply(this,arguments):ge,typeof _e=="function"?_e.apply(this,arguments):_e),X.apply(this,arguments),pe)},null,fe)},be.translateTo=function(G,ge,_e,fe,le){be.transform(G,function(){var Ve=X.apply(this,arguments),Fe=this.__zoom,Je=fe==null?qe(Ve):typeof fe=="function"?fe.apply(this,arguments):fe;return ee(yr.translate(Je[0],Je[1]).scale(Fe.k).translate(typeof ge=="function"?-ge.apply(this,arguments):-ge,typeof _e=="function"?-_e.apply(this,arguments):-_e),Ve,pe)},fe,le)},Qe.prototype={event:function(G){return G&&(this.sourceEvent=G),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(G,ge){return this.mouse&&G!=="mouse"&&(this.mouse[1]=ge.invert(this.mouse[0])),this.touch0&&G!=="touch"&&(this.touch0[1]=ge.invert(this.touch0[0])),this.touch1&&G!=="touch"&&(this.touch1[1]=ge.invert(this.touch1[0])),this.that.__zoom=ge,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(G){var ge=ro(this.that).datum();Ne.call(G,this.that,new mR(G,{sourceEvent:this.sourceEvent,target:be,transform:this.that.__zoom,dispatch:Ne}),ge)}},be.wheelDelta=function(G){return arguments.length?(ce=typeof G=="function"?G:Gl(+G),be):ce},be.filter=function(G){return arguments.length?(ae=typeof G=="function"?G:Gl(!!G),be):ae},be.touchable=function(G){return arguments.length?(me=typeof G=="function"?G:Gl(!!G),be):me},be.extent=function(G){return arguments.length?(X=typeof G=="function"?G:Gl([[+G[0][0],+G[0][1]],[+G[1][0],+G[1][1]]]),be):X},be.scaleExtent=function(G){return arguments.length?(ue[0]=+G[0],ue[1]=+G[1],be):[ue[0],ue[1]]},be.translateExtent=function(G){return arguments.length?(pe[0][0]=+G[0][0],pe[1][0]=+G[1][0],pe[0][1]=+G[0][1],pe[1][1]=+G[1][1],be):[[pe[0][0],pe[0][1]],[pe[1][0],pe[1][1]]]},be.constrain=function(G){return arguments.length?(ee=G,be):ee},be.duration=function(G){return arguments.length?(de=+G,be):de},be.interpolate=function(G){return arguments.length?(Ce=G,be):Ce},be.on=function(){var G=Ne.on.apply(Ne,arguments);return G===Ne?be:G},be.clickDistance=function(G){return arguments.length?(se=(G=+G)*G,be):Math.sqrt(se)},be.tapDistance=function(G){return arguments.length?(Ae=+G,be):Ae},be}().scaleExtent([_,g]).translateExtent(m),j=ro(I.current).call($),W=yr.translate(f.x,f.y).scale(bs(f.zoom,_,g)),K=[[0,0],[C.width,C.height]],Z=$.constrain()(W,K,m);$.transform(j,Z),$.wheelDelta(k2),k.setState({d3Zoom:$,d3Selection:j,d3ZoomHandler:j.on("wheel.zoom"),transform:[Z.x,Z.y,Z.k],domNode:I.current.closest(".react-flow")})}},[]),A.useEffect(()=>{D&&M&&(!i||F||O?z!==void 0&&D.on("wheel.zoom",function(C,$){if(!b&&C.type==="wheel"&&!C.ctrlKey||ks(C,x))return null;C.preventDefault(),z.call(this,C,$)},{passive:!1}):D.on("wheel.zoom",C=>{if(ks(C,x))return!1;C.preventDefault(),C.stopImmediatePropagation();const $=D.property("__zoom").k||1;if(C.ctrlKey&&s){const ae=mo(C),X=k2(C),ee=$*Math.pow(2,X);return void M.scaleTo(D,ee,ae,C)}const j=C.deltaMode===1?20:1;let W=l===tr.Vertical?0:C.deltaX*j,K=l===tr.Horizontal?0:C.deltaY*j;!Kl()&&C.shiftKey&&l!==tr.Vertical&&(W=C.deltaY*j,K=0),M.translateBy(D,-W/$*a,-K/$*a,{internal:!0});const Z=oc(D.property("__zoom")),{onViewportChangeStart:q,onViewportChange:te,onViewportChangeEnd:re}=k.getState();clearTimeout(L.current),V.current||(V.current=!0,e==null||e(C,Z),q==null||q(Z)),V.current&&(t==null||t(C,Z),te==null||te(Z),L.current=setTimeout(()=>{n==null||n(C,Z),re==null||re(Z),V.current=!1},150))},{passive:!1}))},[O,i,l,D,M,z,F,s,b,x,e,t,n]),A.useEffect(()=>{M&&M.on("start",C=>{var W,K;if(!C.sourceEvent||C.sourceEvent.internal)return null;B.current=(W=C.sourceEvent)==null?void 0:W.button;const{onViewportChangeStart:$}=k.getState(),j=oc(C.transform);E.current=!0,T.current=j,((K=C.sourceEvent)==null?void 0:K.type)==="mousedown"&&k.setState({paneDragging:!0}),$==null||$(j),e==null||e(C.sourceEvent,j)})},[M,e]),A.useEffect(()=>{M&&(O&&!E.current?M.on("zoom",null):O||M.on("zoom",C=>{var j;const{onViewportChange:$}=k.getState();if(k.setState({transform:[C.transform.x,C.transform.y,C.transform.k]}),N.current=!(!o||!v2(h,B.current??0)),(t||$)&&!((j=C.sourceEvent)!=null&&j.internal)){const W=oc(C.transform);$==null||$(W),t==null||t(C.sourceEvent,W)}}))},[O,M,t,h,o]),A.useEffect(()=>{M&&M.on("end",C=>{if(!C.sourceEvent||C.sourceEvent.internal)return null;const{onViewportChangeEnd:$}=k.getState();if(E.current=!1,k.setState({paneDragging:!1}),o&&v2(h,B.current??0)&&!N.current&&o(C.sourceEvent),N.current=!1,(n||$)&&(j=T.current,W=C.transform,j.x!==W.x||j.y!==W.y||j.zoom!==W.k)){const K=oc(C.transform);T.current=K,clearTimeout(S.current),S.current=setTimeout(()=>{$==null||$(K),n==null||n(C.sourceEvent,K)},i?150:0)}var j,W})},[M,i,h,n,o]),A.useEffect(()=>{M&&M.filter(C=>{const $=F||r,j=s&&C.ctrlKey;if((h===!0||Array.isArray(h)&&h.includes(1))&&C.button===1&&C.type==="mousedown"&&(ks(C,"react-flow__node")||ks(C,"react-flow__edge")))return!0;if(!(h||$||i||c||s)||O||!c&&C.type==="dblclick"||ks(C,x)&&C.type==="wheel"||ks(C,v)&&(C.type!=="wheel"||i&&C.type==="wheel"&&!F)||!s&&C.ctrlKey&&C.type==="wheel"||!$&&!i&&!j&&C.type==="wheel"||!h&&(C.type==="mousedown"||C.type==="touchstart")||Array.isArray(h)&&!h.includes(C.button)&&C.type==="mousedown")return!1;const W=Array.isArray(h)&&h.includes(C.button)||!C.button||C.button<=1;return(!C.ctrlKey||C.type==="wheel")&&W})},[O,M,r,s,i,c,h,d,F]),Y.createElement("div",{className:"react-flow__renderer",ref:I,style:df},y)},tP=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function nP(){const{userSelectionActive:t,userSelectionRect:e}=mt(tP,on);return t&&e?Y.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 S2(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 C2(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&&S2(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&&S2(o,i);break;case"remove":return o}return o.push(i),o},n)}function N2(t,e){return C2(t,e)}const rr=(t,e)=>({id:t,type:"select",selected:e});function Ss(t,e){return t.reduce((n,o)=>{const r=e.includes(o.id);return!o.selected&&r?(o.selected=!0,n.push(rr(o.id,!0))):o.selected&&!r&&(o.selected=!1,n.push(rr(o.id,!1))),n},[])}const uf=(t,e)=>n=>{n.target===e.current&&(t==null||t(n))},oP=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,dragging:t.paneDragging}),j2=A.memo(({isSelecting:t,selectionMode:e=Ki.Full,panOnDrag:n,onSelectionStart:o,onSelectionEnd:r,onPaneClick:s,onPaneContextMenu:i,onPaneScroll:a,onPaneMouseEnter:l,onPaneMouseMove:c,onPaneMouseLeave:d,children:h})=>{const f=A.useRef(null),m=qt(),_=A.useRef(0),g=A.useRef(0),p=A.useRef(),{userSelectionActive:b,elementsSelectable:y,dragging:x}=mt(oP,on),v=()=>{m.setState({userSelectionActive:!1,userSelectionRect:null}),_.current=0,g.current=0},S=N=>{s==null||s(N),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},k=a?N=>a(N):void 0,E=y&&(t||b);return Y.createElement("div",{className:hn(["react-flow__pane",{dragging:x,selection:t}]),onClick:E?void 0:uf(S,f),onContextMenu:uf(N=>{Array.isArray(n)&&(n!=null&&n.includes(2))?N.preventDefault():i==null||i(N)},f),onWheel:uf(k,f),onMouseEnter:E?void 0:l,onMouseDown:E?N=>{const{resetSelectedElements:I,domNode:T}=m.getState();if(p.current=T==null?void 0:T.getBoundingClientRect(),!y||!t||N.button!==0||N.target!==f.current||!p.current)return;const{x:M,y:D}=er(N,p.current);I(),m.setState({userSelectionRect:{width:0,height:0,startX:M,startY:D,x:M,y:D}}),o==null||o(N)}:void 0,onMouseMove:E?N=>{const{userSelectionRect:I,nodeInternals:T,edges:M,transform:D,onNodesChange:z,onEdgesChange:O,nodeOrigin:F,getNodes:B}=m.getState();if(!t||!p.current||!I)return;m.setState({userSelectionActive:!0,nodesSelectionActive:!1});const V=er(N,p.current),L=I.startX??0,C=I.startY??0,$={...I,x:V.x<L?V.x:L,y:V.y<C?V.y:C,width:Math.abs(V.x-L),height:Math.abs(V.y-C)},j=B(),W=Qv(T,$,D,e===Ki.Partial,!0,F),K=e2(W,M).map(q=>q.id),Z=W.map(q=>q.id);if(_.current!==Z.length){_.current=Z.length;const q=Ss(j,Z);q.length&&(z==null||z(q))}if(g.current!==K.length){g.current=K.length;const q=Ss(M,K);q.length&&(O==null||O(q))}m.setState({userSelectionRect:$})}:c,onMouseUp:E?N=>{if(N.button!==0)return;const{userSelectionRect:I}=m.getState();!b&&I&&N.target===f.current&&(S==null||S(N)),m.setState({nodesSelectionActive:_.current>0}),v(),r==null||r(N)}:void 0,onMouseLeave:E?N=>{b&&(m.setState({nodesSelectionActive:_.current>0}),r==null||r(N)),v()}:d,ref:f,style:df},h,Y.createElement(nP,null))});function E2(t,e){const n=t.parentNode||t.parentId;if(!n)return!1;const o=e.get(n);return!!o&&(!!o.selected||E2(o,e))}function I2(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 rP(t,e,n,o){return Array.from(t.values()).filter(r=>(r.selected||r.id===o)&&(!r.parentNode||r.parentId||!E2(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 A2(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}=xs(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}=xs(h,r).positionAbsolute;a=h&&Vn(f)&&Vn(m)&&Vn(h.width)&&Vn(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",kR()),a=i;let c={x:0,y:0};if(l){const h=n.get(l);c=xs(h,r).positionAbsolute}const d=a&&a!=="parent"?Wh(e,a):e;return{position:{x:d.x-c.x,y:d.y-c.y},positionAbsolute:d}}function hf({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]}j2.displayName="Pane";const T2=(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(c=>{const d=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),position:c.getAttribute("data-handlepos"),x:(d.left-i.left-a)/n,y:(d.top-i.top-l)/n,...Hh(c)}})};function ea(t,e,n){return n===void 0?n:o=>{const r=e().nodeInternals.get(t);r&&n(o,{...r})}}function ff({id:t,store:e,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:r,unselectNodesAndEdges:s,multiSelectionActive:i,nodeInternals:a,onError:l}=e.getState(),c=a.get(t);c?(e.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&i)&&(s({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var d;return(d=o==null?void 0:o.current)==null?void 0:d.blur()})):r([t])):l==null||l("012",ER(t))}function mf(t){return(e,n,o)=>t==null?void 0:t(e,o)}function M2({nodeRef:t,disabled:e=!1,noDragClassName:n,handleSelector:o,nodeId:r,isSelectable:s,selectNodesOnDrag:i}){const a=qt(),[l,c]=A.useState(!1),d=A.useRef([]),h=A.useRef({x:null,y:null}),f=A.useRef(0),m=A.useRef(null),_=A.useRef({x:0,y:0}),g=A.useRef(null),p=A.useRef(!1),b=A.useRef(!1),y=A.useRef(!1),x=function(){const v=qt();return A.useCallback(({sourceEvent:k})=>{const{transform:E,snapGrid:N,snapToGrid:I}=v.getState(),T=k.touches?k.touches[0].clientX:k.clientX,M=k.touches?k.touches[0].clientY:k.clientY,D={x:(T-E[0])/E[2],y:(M-E[1])/E[2]};return{xSnapped:I?N[0]*Math.round(D.x/N[0]):D.x,ySnapped:I?N[1]*Math.round(D.y/N[1]):D.y,...D}},[])}();return A.useEffect(()=>{if(t!=null&&t.current){const v=ro(t.current),S=({x:N,y:I})=>{const{nodeInternals:T,onNodeDrag:M,onSelectionDrag:D,updateNodePositions:z,nodeExtent:O,snapGrid:F,snapToGrid:B,nodeOrigin:V,onError:L}=a.getState();h.current={x:N,y:I};let C=!1,$={x:0,y:0,x2:0,y2:0};if(d.current.length>1&&O){const W=of(d.current,V);$=qh(W)}if(d.current=d.current.map(W=>{const K={x:N-W.distance.x,y:I-W.distance.y};B&&(K.x=F[0]*Math.round(K.x/F[0]),K.y=F[1]*Math.round(K.y/F[1]));const Z=[[O[0][0],O[0][1]],[O[1][0],O[1][1]]];d.current.length>1&&O&&!W.extent&&(Z[0][0]=W.positionAbsolute.x-$.x+O[0][0],Z[1][0]=W.positionAbsolute.x+(W.width??0)-$.x2+O[1][0],Z[0][1]=W.positionAbsolute.y-$.y+O[0][1],Z[1][1]=W.positionAbsolute.y+(W.height??0)-$.y2+O[1][1]);const q=A2(W,K,T,Z,V,L);return C=C||W.position.x!==q.position.x||W.position.y!==q.position.y,W.position=q.position,W.positionAbsolute=q.positionAbsolute,W}),!C)return;z(d.current,!0,!0),c(!0);const j=r?M:mf(D);if(j&&g.current){const[W,K]=hf({nodeId:r,dragItems:d.current,nodeInternals:T});j(g.current,W,K)}},k=()=>{if(!m.current)return;const[N,I]=Pv(_.current,m.current);if(N!==0||I!==0){const{transform:T,panBy:M}=a.getState();h.current.x=(h.current.x??0)-N/T[2],h.current.y=(h.current.y??0)-I/T[2],M({x:N,y:I})&&S(h.current)}f.current=requestAnimationFrame(k)},E=N=>{var V;const{nodeInternals:I,multiSelectionActive:T,nodesDraggable:M,unselectNodesAndEdges:D,onNodeDragStart:z,onSelectionDragStart:O}=a.getState();b.current=!0;const F=r?z:mf(O);i&&s||T||!r||(V=I.get(r))!=null&&V.selected||D(),r&&s&&i&&ff({id:r,store:a,nodeRef:t});const B=x(N);if(h.current=B,d.current=rP(I,M,B,r),F&&d.current){const[L,C]=hf({nodeId:r,dragItems:d.current,nodeInternals:I});F(N.sourceEvent,L,C)}};if(!e){const N=function(){var I,T,M,D,z=dR,O=uR,F=hR,B=fR,V={},L=pS("start","drag","end"),C=0,$=0;function j(X){X.on("mousedown.drag",W).filter(B).on("touchstart.drag",q).on("touchmove.drag",te,cR).on("touchend.drag touchcancel.drag",re).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function W(X,ee){if(!D&&z.call(this,X,ee)){var ce=ae(this,O.call(this,X,ee),X,ee,"mouse");ce&&(ro(X.view).on("mousemove.drag",K,qi).on("mouseup.drag",Z,qi),Tv(X.view),Uh(X),M=!1,I=X.clientX,T=X.clientY,ce("start",X))}}function K(X){if(_s(X),!M){var ee=X.clientX-I,ce=X.clientY-T;M=ee*ee+ce*ce>$}V.mouse("drag",X)}function Z(X){ro(X.view).on("mousemove.drag mouseup.drag",null),Mv(X.view,M),_s(X),V.mouse("end",X)}function q(X,ee){if(z.call(this,X,ee)){var ce,me,ue=X.changedTouches,pe=O.call(this,X,ee),de=ue.length;for(ce=0;ce<de;++ce)(me=ae(this,pe,X,ee,ue[ce].identifier,ue[ce]))&&(Uh(X),me("start",X,ue[ce]))}}function te(X){var ee,ce,me=X.changedTouches,ue=me.length;for(ee=0;ee<ue;++ee)(ce=V[me[ee].identifier])&&(_s(X),ce("drag",X,me[ee]))}function re(X){var ee,ce,me=X.changedTouches,ue=me.length;for(D&&clearTimeout(D),D=setTimeout(function(){D=null},500),ee=0;ee<ue;++ee)(ce=V[me[ee].identifier])&&(Uh(X),ce("end",X,me[ee]))}function ae(X,ee,ce,me,ue,pe){var de,Ce,Ne,se=L.copy(),Ae=mo(pe||ce,ee);if((Ne=F.call(X,new Vh("beforestart",{sourceEvent:ce,target:j,identifier:ue,active:C,x:Ae[0],y:Ae[1],dx:0,dy:0,dispatch:se}),me))!=null)return de=Ne.x-Ae[0]||0,Ce=Ne.y-Ae[1]||0,function be(Re,ze,qe){var Ze,Pe=Ae;switch(Re){case"start":V[ue]=be,Ze=C++;break;case"end":delete V[ue],--C;case"drag":Ae=mo(qe||ze,ee),Ze=C}se.call(Re,X,new Vh(Re,{sourceEvent:ze,subject:Ne,target:j,identifier:ue,active:Ze,x:Ae[0]+de,y:Ae[1]+Ce,dx:Ae[0]-Pe[0],dy:Ae[1]-Pe[1],dispatch:se}),me)}}return j.filter=function(X){return arguments.length?(z=typeof X=="function"?X:ql(!!X),j):z},j.container=function(X){return arguments.length?(O=typeof X=="function"?X:ql(X),j):O},j.subject=function(X){return arguments.length?(F=typeof X=="function"?X:ql(X),j):F},j.touchable=function(X){return arguments.length?(B=typeof X=="function"?X:ql(!!X),j):B},j.on=function(){var X=L.on.apply(L,arguments);return X===L?j:X},j.clickDistance=function(X){return arguments.length?($=(X=+X)*X,j):Math.sqrt($)},j}().on("start",I=>{const{domNode:T,nodeDragThreshold:M}=a.getState();M===0&&E(I),y.current=!1;const D=x(I);h.current=D,m.current=(T==null?void 0:T.getBoundingClientRect())||null,_.current=er(I.sourceEvent,m.current)}).on("drag",I=>{var z,O;const T=x(I),{autoPanOnNodeDrag:M,nodeDragThreshold:D}=a.getState();if(I.sourceEvent.type==="touchmove"&&I.sourceEvent.touches.length>1&&(y.current=!0),!y.current){if(!p.current&&b.current&&M&&(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-(((O=h==null?void 0:h.current)==null?void 0:O.y)??0);Math.sqrt(F*F+B*B)>D&&E(I)}(h.current.x!==T.xSnapped||h.current.y!==T.ySnapped)&&d.current&&b.current&&(g.current=I.sourceEvent,_.current=er(I.sourceEvent,m.current),S(T))}}).on("end",I=>{if(b.current&&!y.current&&(c(!1),p.current=!1,b.current=!1,cancelAnimationFrame(f.current),d.current)){const{updateNodePositions:T,nodeInternals:M,onNodeDragStop:D,onSelectionDragStop:z}=a.getState(),O=r?D:mf(z);if(T(d.current,!1,!1),O){const[F,B]=hf({nodeId:r,dragItems:d.current,nodeInternals:M});O(I.sourceEvent,F,B)}}}).filter(I=>{const T=I.target;return!I.button&&(!n||!I2(T,`.${n}`,t))&&(!o||I2(T,o,t))});return v.call(N),()=>{v.on(".drag",null)}}v.on(".drag",null)}},[t,e,n,o,s,a,r,i,x]),l}function O2(){const t=qt();return A.useCallback(n=>{const{nodeInternals:o,nodeExtent:r,updateNodePositions:s,getNodes:i,snapToGrid:a,snapGrid:l,onError:c,nodesDraggable:d}=t.getState(),h=i().filter(y=>y.selected&&(y.draggable||d&&y.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(y=>{if(y.positionAbsolute){const x={x:y.positionAbsolute.x+g,y:y.positionAbsolute.y+p};a&&(x.x=l[0]*Math.round(x.x/l[0]),x.y=l[1]*Math.round(x.y/l[1]));const{positionAbsolute:v,position:S}=A2(y,x,o,r,void 0,c);y.position=S,y.positionAbsolute=v}return y});s(b,!0,!1)},[])}const Cs={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var ta=t=>{const e=({id:n,type:o,data:r,xPos:s,yPos:i,xPosOrigin:a,yPosOrigin:l,selected:c,onClick:d,onMouseEnter:h,onMouseMove:f,onMouseLeave:m,onContextMenu:_,onDoubleClick:g,style:p,className:b,isDraggable:y,isSelectable:x,isConnectable:v,isFocusable:S,selectNodesOnDrag:k,sourcePosition:E,targetPosition:N,hidden:I,resizeObserver:T,dragHandle:M,zIndex:D,isParent:z,noDragClassName:O,noPanClassName:F,initialized:B,disableKeyboardA11y:V,ariaLabel:L,rfId:C,hasHandleBounds:$})=>{const j=qt(),W=A.useRef(null),K=A.useRef(null),Z=A.useRef(E),q=A.useRef(N),te=A.useRef(o),re=x||y||d||h||f||m,ae=O2(),X=ea(n,j.getState,h),ee=ea(n,j.getState,f),ce=ea(n,j.getState,m),me=ea(n,j.getState,_),ue=ea(n,j.getState,g);A.useEffect(()=>()=>{K.current&&(T==null||T.unobserve(K.current),K.current=null)},[]),A.useEffect(()=>{if(W.current&&!I){const de=W.current;B&&$&&K.current===de||(K.current&&(T==null||T.unobserve(K.current)),T==null||T.observe(de),K.current=de)}},[I,B,$]),A.useEffect(()=>{const de=te.current!==o,Ce=Z.current!==E,Ne=q.current!==N;W.current&&(de||Ce||Ne)&&(de&&(te.current=o),Ce&&(Z.current=E),Ne&&(q.current=N),j.getState().updateNodeDimensions([{id:n,nodeElement:W.current,forceUpdate:!0}]))},[n,o,E,N]);const pe=M2({nodeRef:W,disabled:I||!y,noDragClassName:O,handleSelector:M,nodeId:n,isSelectable:x,selectNodesOnDrag:k});return I?null:Y.createElement("div",{className:hn(["react-flow__node",`react-flow__node-${o}`,{[F]:y},b,{selected:c,selectable:x,parent:z,dragging:pe}]),ref:W,style:{zIndex:D,transform:`translate(${a}px,${l}px)`,pointerEvents:re?"all":"none",visibility:B?"visible":"hidden",...p},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:X,onMouseMove:ee,onMouseLeave:ce,onContextMenu:me,onClick:de=>{const{nodeDragThreshold:Ce}=j.getState();if(x&&(!k||!y||Ce>0)&&ff({id:n,store:j,nodeRef:W}),d){const Ne=j.getState().nodeInternals.get(n);Ne&&d(de,{...Ne})}},onDoubleClick:ue,onKeyDown:S?de=>{if(!Yh(de)&&!V)if(zv.includes(de.key)&&x){const Ce=de.key==="Escape";ff({id:n,store:j,unselect:Ce,nodeRef:W})}else y&&c&&Object.prototype.hasOwnProperty.call(Cs,de.key)&&(j.setState({ariaLiveMessage:`Moved selected node ${de.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~s}, y: ${~~i}`}),ae({x:Cs[de.key].x,y:Cs[de.key].y,isShiftPressed:de.shiftKey}))}:void 0,tabIndex:S?0:void 0,role:S?"button":void 0,"aria-describedby":V?void 0:`${p2}-${C}`,"aria-label":L},Y.createElement(OR,{value:n},Y.createElement(t,{id:n,data:r,type:o,xPos:s,yPos:i,selected:c,isConnectable:v,sourcePosition:E,targetPosition:N,dragging:pe,dragHandle:M,zIndex:D})))};return e.displayName="NodeWrapper",A.memo(e)};const sP=t=>{const e=t.getNodes().filter(n=>n.selected);return{...of(e,t.nodeOrigin),transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`,userSelectionActive:t.userSelectionActive}};var iP=A.memo(function({onSelectionContextMenu:t,noPanClassName:e,disableKeyboardA11y:n}){const o=qt(),{width:r,height:s,x:i,y:a,transformString:l,userSelectionActive:c}=mt(sP,on),d=O2(),h=A.useRef(null);if(A.useEffect(()=>{var m;n||((m=h.current)==null||m.focus({preventScroll:!0}))},[n]),M2({nodeRef:h}),c||!r||!s)return null;const f=t?m=>{const _=o.getState().getNodes().filter(g=>g.selected);t(m,_)}:void 0;return Y.createElement("div",{className:hn(["react-flow__nodesselection","react-flow__container",e]),style:{transform:l}},Y.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(Cs,m.key)&&d({x:Cs[m.key].x,y:Cs[m.key].y,isShiftPressed:m.shiftKey})},style:{width:r,height:s,top:a,left:i}}))});const aP=t=>t.nodesSelectionActive,D2=({children:t,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:i,deleteKeyCode:a,onMove:l,onMoveStart:c,onMoveEnd:d,selectionKeyCode:h,selectionOnDrag:f,selectionMode:m,onSelectionStart:_,onSelectionEnd:g,multiSelectionKeyCode:p,panActivationKeyCode:b,zoomActivationKeyCode:y,elementsSelectable:x,zoomOnScroll:v,zoomOnPinch:S,panOnScroll:k,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:I,panOnDrag:T,defaultViewport:M,translateExtent:D,minZoom:z,maxZoom:O,preventScrolling:F,onSelectionContextMenu:B,noWheelClassName:V,noPanClassName:L,disableKeyboardA11y:C})=>{const $=mt(aP),j=Zi(h),W=Zi(b),K=W||T,Z=W||k,q=j||f&&K!==!0;return(({deleteKeyCode:te,multiSelectionKeyCode:re})=>{const ae=qt(),{deleteElements:X}=Qi(),ee=Zi(te,ZR),ce=Zi(re);A.useEffect(()=>{if(ee){const{edges:me,getNodes:ue}=ae.getState(),pe=ue().filter(Ce=>Ce.selected),de=me.filter(Ce=>Ce.selected);X({nodes:pe,edges:de}),ae.setState({nodesSelectionActive:!1})}},[ee]),A.useEffect(()=>{ae.setState({multiSelectionActive:ce})},[ce])})({deleteKeyCode:a,multiSelectionKeyCode:p}),Y.createElement(eP,{onMove:l,onMoveStart:c,onMoveEnd:d,onPaneContextMenu:s,elementsSelectable:x,zoomOnScroll:v,zoomOnPinch:S,panOnScroll:Z,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:I,panOnDrag:!j&&K,defaultViewport:M,translateExtent:D,minZoom:z,maxZoom:O,zoomActivationKeyCode:y,preventScrolling:F,noWheelClassName:V,noPanClassName:L},Y.createElement(j2,{onSelectionStart:_,onSelectionEnd:g,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:i,panOnDrag:K,isSelecting:!!q,selectionMode:m},t,$&&Y.createElement(iP,{onSelectionContextMenu:B,noPanClassName:L,disableKeyboardA11y:C})))};D2.displayName="FlowRenderer";var lP=A.memo(D2);function cP(t){return{input:ta(t.input||d2),default:ta(t.default||af),output:ta(t.output||h2),group:ta(t.group||lf),...Object.keys(t).filter(e=>!["input","default","output","group"].includes(e)).reduce((e,n)=>(e[n]=ta(t[n]||af),e),{})}}const dP=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,updateNodeDimensions:t.updateNodeDimensions,onError:t.onError}),R2=t=>{const{nodesDraggable:e,nodesConnectable:n,nodesFocusable:o,elementsSelectable:r,updateNodeDimensions:s,onError:i}=mt(dP,on),a=(l=t.onlyRenderVisibleElements,mt(A.useCallback(h=>l?Qv(h.nodeInternals,{x:0,y:0,width:h.width,height:h.height},h.transform,!0):h.getNodes(),[l])));var l;const c=A.useRef(),d=A.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 c.current=h,h},[]);return A.useEffect(()=>()=>{var h;(h=c==null?void 0:c.current)==null||h.disconnect()},[]),Y.createElement("div",{className:"react-flow__nodes",style:df},a.map(h=>{var k,E,N;let f=h.type||"default";t.nodeTypes[f]||(i==null||i("003",wR(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),y=t.nodeExtent?Wh(h.positionAbsolute,t.nodeExtent):h.positionAbsolute,x=(y==null?void 0:y.x)??0,v=(y==null?void 0:y.y)??0,S=(({x:I,y:T,width:M,height:D,origin:z})=>M&&D?z[0]<0||z[1]<0||z[0]>1||z[1]>1?{x:I,y:T}:{x:I-M*z[0],y:T-D*z[1]}:{x:I,y:T})({x,y:v,width:h.width??0,height:h.height??0,origin:t.nodeOrigin});return Y.createElement(m,{key:h.id,id:h.id,className:h.className,style:h.style,type:f,data:h.data,sourcePosition:h.sourcePosition||Ue.Bottom,targetPosition:h.targetPosition||Ue.Top,hidden:h.hidden,xPos:x,yPos:v,xPosOrigin:S.x,yPosOrigin:S.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:d,dragHandle:h.dragHandle,zIndex:((k=h[Nt])==null?void 0:k.z)??0,isParent:!!((E=h[Nt])!=null&&E.isParent),noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,initialized:!!h.width&&!!h.height,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,ariaLabel:h.ariaLabel,hasHandleBounds:!!((N=h[Nt])!=null&&N.handleBounds)})}))};R2.displayName="NodeRenderer";var uP=A.memo(R2);const hP=(t,e,n)=>n===Ue.Left?t-e:n===Ue.Right?t+e:t,fP=(t,e,n)=>n===Ue.Top?t-e:n===Ue.Bottom?t+e:t,P2="react-flow__edgeupdater",L2=({position:t,centerX:e,centerY:n,radius:o=10,onMouseDown:r,onMouseEnter:s,onMouseOut:i,type:a})=>Y.createElement("circle",{onMouseDown:r,onMouseEnter:s,onMouseOut:i,className:hn([P2,`${P2}-${a}`]),cx:hP(e,o,t),cy:fP(n,o,t),r:o,stroke:"transparent",fill:"transparent"}),mP=()=>!0;var Ns=t=>{const e=({id:n,className:o,type:r,data:s,onClick:i,onEdgeDoubleClick:a,selected:l,animated:c,label:d,labelStyle:h,labelShowBg:f,labelBgStyle:m,labelBgPadding:_,labelBgBorderRadius:g,style:p,source:b,target:y,sourceX:x,sourceY:v,targetX:S,targetY:k,sourcePosition:E,targetPosition:N,elementsSelectable:I,hidden:T,sourceHandleId:M,targetHandleId:D,onContextMenu:z,onMouseEnter:O,onMouseMove:F,onMouseLeave:B,reconnectRadius:V,onReconnect:L,onReconnectStart:C,onReconnectEnd:$,markerEnd:j,markerStart:W,rfId:K,ariaLabel:Z,isFocusable:q,isReconnectable:te,pathOptions:re,interactionWidth:ae,disableKeyboardA11y:X})=>{const ee=A.useRef(null),[ce,me]=A.useState(!1),[ue,pe]=A.useState(!1),de=qt(),Ce=A.useMemo(()=>`url('#${tf(W,K)}')`,[W,K]),Ne=A.useMemo(()=>`url('#${tf(j,K)}')`,[j,K]);if(T)return null;const se=Ji(n,de.getState,a),Ae=Ji(n,de.getState,z),be=Ji(n,de.getState,O),Re=Ji(n,de.getState,F),ze=Ji(n,de.getState,B),qe=(tt,at)=>{if(tt.button!==0)return;const{edges:ne,isValidConnection:ke}=de.getState(),je=at?y:b,Le=(at?D:M)||null,G=at?"target":"source",ge=ke||mP,_e=at,fe=ne.find(le=>le.id===n);pe(!0),C==null||C(tt,fe,G),s2({event:tt,handleId:Le,nodeId:je,onConnect:le=>L==null?void 0:L(fe,le),isTarget:_e,getState:de.getState,setState:de.setState,isValidConnection:ge,edgeUpdaterType:G,onReconnectEnd:le=>{pe(!1),$==null||$(le,fe,G)}})},Ze=()=>me(!0),Pe=()=>me(!1),Qe=!I&&!i;return Y.createElement("g",{className:hn(["react-flow__edge",`react-flow__edge-${r}`,o,{selected:l,animated:c,inactive:Qe,updating:ce}]),onClick:tt=>{var G;const{edges:at,addSelectedEdges:ne,unselectNodesAndEdges:ke,multiSelectionActive:je}=de.getState(),Le=at.find(ge=>ge.id===n);Le&&(I&&(de.setState({nodesSelectionActive:!1}),Le.selected&&je?(ke({nodes:[],edges:[Le]}),(G=ee.current)==null||G.blur()):ne([n])),i&&i(tt,Le))},onDoubleClick:se,onContextMenu:Ae,onMouseEnter:be,onMouseMove:Re,onMouseLeave:ze,onKeyDown:q?tt=>{var at;if(!X&&zv.includes(tt.key)&&I){const{unselectNodesAndEdges:ne,addSelectedEdges:ke,edges:je}=de.getState();tt.key==="Escape"?((at=ee.current)==null||at.blur(),ne({edges:[je.find(Le=>Le.id===n)]})):ke([n])}}:void 0,tabIndex:q?0:void 0,role:q?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":Z===null?void 0:Z||`Edge from ${b} to ${y}`,"aria-describedby":q?`${g2}-${K}`:void 0,ref:ee},!ue&&Y.createElement(t,{id:n,source:b,target:y,selected:l,animated:c,label:d,labelStyle:h,labelShowBg:f,labelBgStyle:m,labelBgPadding:_,labelBgBorderRadius:g,data:s,style:p,sourceX:x,sourceY:v,targetX:S,targetY:k,sourcePosition:E,targetPosition:N,sourceHandleId:M,targetHandleId:D,markerStart:Ce,markerEnd:Ne,pathOptions:re,interactionWidth:ae}),te&&Y.createElement(Y.Fragment,null,(te==="source"||te===!0)&&Y.createElement(L2,{position:E,centerX:x,centerY:v,radius:V,onMouseDown:tt=>qe(tt,!0),onMouseEnter:Ze,onMouseOut:Pe,type:"source"}),(te==="target"||te===!0)&&Y.createElement(L2,{position:N,centerX:S,centerY:k,radius:V,onMouseDown:tt=>qe(tt,!1),onMouseEnter:Ze,onMouseOut:Pe,type:"target"})))};return e.displayName="EdgeWrapper",A.memo(e)};function pP(t){return{default:Ns(t.default||ec),straight:Ns(t.bezier||Qh),step:Ns(t.step||Zh),smoothstep:Ns(t.step||Zl),simplebezier:Ns(t.simplebezier||Kh),...Object.keys(t).filter(e=>!["default","bezier"].includes(e)).reduce((e,n)=>(e[n]=Ns(t[n]||ec),e),{})}}function F2(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 Ue.Top:return{x:o+s/2,y:r};case Ue.Right:return{x:o+s,y:r+i/2};case Ue.Bottom:return{x:o+s/2,y:r+i};case Ue.Left:return{x:o,y:r+i/2}}}function z2(t,e){return t?t.length!==1&&e?e&&t.find(n=>n.id===e)||null:t[0]:null}function B2(t){var o,r,s,i,a;const e=((o=t==null?void 0:t[Nt])==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 gP=[{level:0,isMaxLevel:!0,edges:[]}];function _P(t,e,n){return function(o,r,s=!1){let i=-1;const a=o.reduce((c,d)=>{var m,_;const h=Vn(d.zIndex);let f=h?d.zIndex:0;if(s){const g=r.get(d.target),p=r.get(d.source),b=d.selected||(g==null?void 0:g.selected)||(p==null?void 0:p.selected),y=Math.max(((m=p==null?void 0:p[Nt])==null?void 0:m.z)||0,((_=g==null?void 0:g[Nt])==null?void 0:_.z)||0,1e3);f=(h?d.zIndex:0)+(b?y:0)}return c[f]?c[f].push(d):c[f]=[d],i=f>i?f:i,c},{}),l=Object.entries(a).map(([c,d])=>{const h=+c;return{edges:d,level:h,isMaxLevel:h===i}});return l.length===0?gP:l}(mt(A.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:c,sourceHeight:d,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+c,l.x+h),y2:Math.max(a.y+d,l.y+f)};p.x===p.x2&&(p.x2+=1),p.y===p.y2&&(p.y2+=1);const b=qh({x:(0-g[0])/g[2],y:(0-g[1])/g[2],width:m/g[2],height:_/g[2]}),y=Math.max(0,Math.min(b.x2,p.x2)-Math.max(b.x,p.x)),x=Math.max(0,Math.min(b.y2,p.y2)-Math.max(b.y,p.y));return Math.ceil(y*x)>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 U2={[ys.Arrow]:({color:t="none",strokeWidth:e=1})=>Y.createElement("polyline",{style:{stroke:t,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),[ys.ArrowClosed]:({color:t="none",strokeWidth:e=1})=>Y.createElement("polyline",{style:{stroke:t,fill:t,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},bP=({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(c){const d=qt();return A.useMemo(()=>{var h,f;return Object.prototype.hasOwnProperty.call(U2,c)?U2[c]:((f=(h=d.getState()).onError)==null||f.call(h,"009",SR(c)),null)},[c])}(e);return l?Y.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"},Y.createElement(l,{color:n,strokeWidth:i})):null},V2=({defaultColor:t,rfId:e})=>{const n=mt(A.useCallback((({defaultColor:o,rfId:r})=>s=>{const i=[];return s.edges.reduce((a,l)=>([l.markerStart,l.markerEnd].forEach(c=>{if(c&&typeof c=="object"){const d=tf(c,r);i.includes(d)||(a.push({id:d,color:c.color||o,...c}),i.push(d))}}),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 Y.createElement("defs",null,n.map(o=>Y.createElement(bP,{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})))};V2.displayName="MarkerDefinitions";var yP=A.memo(V2);const xP=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}),$2=({defaultMarkerColor:t,onlyRenderVisibleElements:e,elevateEdgesOnSelect:n,rfId:o,edgeTypes:r,noPanClassName:s,onEdgeContextMenu:i,onEdgeMouseEnter:a,onEdgeMouseMove:l,onEdgeMouseLeave:c,onEdgeClick:d,onEdgeDoubleClick:h,onReconnect:f,onReconnectStart:m,onReconnectEnd:_,reconnectRadius:g,children:p,disableKeyboardA11y:b})=>{const{edgesFocusable:y,edgesUpdatable:x,elementsSelectable:v,width:S,height:k,connectionMode:E,nodeInternals:N,onError:I}=mt(xP,on),T=_P(e,N,n);return S?Y.createElement(Y.Fragment,null,T.map(({level:M,edges:D,isMaxLevel:z})=>Y.createElement("svg",{key:M,style:{zIndex:M},width:S,height:k,className:"react-flow__edges react-flow__container"},z&&Y.createElement(yP,{defaultColor:t,rfId:o}),Y.createElement("g",null,D.map(O=>{const[F,B,V]=B2(N.get(O.source)),[L,C,$]=B2(N.get(O.target));if(!V||!$)return null;let j=O.type||"default";r[j]||(I==null||I("011",jR(j)),j="default");const W=r[j]||r.default,K=E===Or.Strict?C.target:(C.target??[]).concat(C.source??[]),Z=z2(B.source,O.sourceHandle),q=z2(K,O.targetHandle),te=(Z==null?void 0:Z.position)||Ue.Bottom,re=(q==null?void 0:q.position)||Ue.Top,ae=!!(O.focusable||y&&O.focusable===void 0),X=O.reconnectable||O.updatable,ee=f!==void 0&&(X||x&&X===void 0);if(!Z||!q)return I==null||I("008",CR(Z,O)),null;const{sourceX:ce,sourceY:me,targetX:ue,targetY:pe}=((de,Ce,Ne,se,Ae,be)=>{const Re=F2(Ne,de,Ce),ze=F2(be,se,Ae);return{sourceX:Re.x,sourceY:Re.y,targetX:ze.x,targetY:ze.y}})(F,Z,te,L,q,re);return Y.createElement(W,{key:O.id,id:O.id,className:hn([O.className,s]),type:j,data:O.data,selected:!!O.selected,animated:!!O.animated,hidden:!!O.hidden,label:O.label,labelStyle:O.labelStyle,labelShowBg:O.labelShowBg,labelBgStyle:O.labelBgStyle,labelBgPadding:O.labelBgPadding,labelBgBorderRadius:O.labelBgBorderRadius,style:O.style,source:O.source,target:O.target,sourceHandleId:O.sourceHandle,targetHandleId:O.targetHandle,markerEnd:O.markerEnd,markerStart:O.markerStart,sourceX:ce,sourceY:me,targetX:ue,targetY:pe,sourcePosition:te,targetPosition:re,elementsSelectable:v,onContextMenu:i,onMouseEnter:a,onMouseMove:l,onMouseLeave:c,onClick:d,onEdgeDoubleClick:h,onReconnect:f,onReconnectStart:m,onReconnectEnd:_,reconnectRadius:g,rfId:o,ariaLabel:O.ariaLabel,isFocusable:ae,isReconnectable:ee,pathOptions:"pathOptions"in O?O.pathOptions:void 0,interactionWidth:O.interactionWidth,disableKeyboardA11y:b})})))),p):null};$2.displayName="EdgeRenderer";var wP=A.memo($2);const vP=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function kP({children:t}){const e=mt(vP);return Y.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:e}},t)}const SP={[Ue.Left]:Ue.Right,[Ue.Right]:Ue.Left,[Ue.Top]:Ue.Bottom,[Ue.Bottom]:Ue.Top},H2=({nodeId:t,handleType:e,style:n,type:o=nr.Bezier,CustomComponent:r,connectionStatus:s})=>{var k,E,N;const{fromNode:i,handleId:a,toX:l,toY:c,connectionMode:d}=mt(A.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]),on),h=(k=i==null?void 0:i[Nt])==null?void 0:k.handleBounds;let f=h==null?void 0:h[e];if(d===Or.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=(((E=i.positionAbsolute)==null?void 0:E.x)??0)+_,b=(((N=i.positionAbsolute)==null?void 0:N.y)??0)+g,y=m==null?void 0:m.position,x=y?SP[y]:null;if(!y||!x)return null;if(r)return Y.createElement(r,{connectionLineType:o,connectionLineStyle:n,fromNode:i,fromHandle:m,fromX:p,fromY:b,toX:l,toY:c,fromPosition:y,toPosition:x,connectionStatus:s});let v="";const S={sourceX:p,sourceY:b,sourcePosition:y,targetX:l,targetY:c,targetPosition:x};return o===nr.Bezier?[v]=Xv(S):o===nr.Step?[v]=Xh({...S,borderRadius:0}):o===nr.SmoothStep?[v]=Xh(S):o===nr.SimpleBezier?[v]=Gv(S):v=`M${p},${b} ${l},${c}`,Y.createElement("path",{d:v,fill:"none",className:"react-flow__connection-path",style:n})};H2.displayName="ConnectionLine";const CP=t=>({nodeId:t.connectionNodeId,handleType:t.connectionHandleType,nodesConnectable:t.nodesConnectable,connectionStatus:t.connectionStatus,width:t.width,height:t.height});function NP({containerStyle:t,style:e,type:n,component:o}){const{nodeId:r,handleType:s,nodesConnectable:i,width:a,height:l,connectionStatus:c}=mt(CP,on);return r&&s&&a&&i?Y.createElement("svg",{style:t,width:a,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container"},Y.createElement("g",{className:hn(["react-flow__connection",c])},Y.createElement(H2,{nodeId:r,handleType:s,style:e,type:n,CustomComponent:o,connectionStatus:c}))):null}function W2(t,e){return A.useRef(null),qt(),A.useMemo(()=>e(t),[t])}const q2=({nodeTypes:t,edgeTypes:e,onMove:n,onMoveStart:o,onMoveEnd:r,onInit:s,onNodeClick:i,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:h,onNodeMouseLeave:f,onNodeContextMenu:m,onSelectionContextMenu:_,onSelectionStart:g,onSelectionEnd:p,connectionLineType:b,connectionLineStyle:y,connectionLineComponent:x,connectionLineContainerStyle:v,selectionKeyCode:S,selectionOnDrag:k,selectionMode:E,multiSelectionKeyCode:N,panActivationKeyCode:I,zoomActivationKeyCode:T,deleteKeyCode:M,onlyRenderVisibleElements:D,elementsSelectable:z,selectNodesOnDrag:O,defaultViewport:F,translateExtent:B,minZoom:V,maxZoom:L,preventScrolling:C,defaultMarkerColor:$,zoomOnScroll:j,zoomOnPinch:W,panOnScroll:K,panOnScrollSpeed:Z,panOnScrollMode:q,zoomOnDoubleClick:te,panOnDrag:re,onPaneClick:ae,onPaneMouseEnter:X,onPaneMouseMove:ee,onPaneMouseLeave:ce,onPaneScroll:me,onPaneContextMenu:ue,onEdgeContextMenu:pe,onEdgeMouseEnter:de,onEdgeMouseMove:Ce,onEdgeMouseLeave:Ne,onReconnect:se,onReconnectStart:Ae,onReconnectEnd:be,reconnectRadius:Re,noDragClassName:ze,noWheelClassName:qe,noPanClassName:Ze,elevateEdgesOnSelect:Pe,disableKeyboardA11y:Qe,nodeOrigin:tt,nodeExtent:at,rfId:ne})=>{const ke=W2(t,cP),je=W2(e,pP);return function(Le){const G=Qi(),ge=A.useRef(!1);A.useEffect(()=>{!ge.current&&G.viewportInitialized&&Le&&(setTimeout(()=>Le(G),1),ge.current=!0)},[Le,G.viewportInitialized])}(s),Y.createElement(lP,{onPaneClick:ae,onPaneMouseEnter:X,onPaneMouseMove:ee,onPaneMouseLeave:ce,onPaneContextMenu:ue,onPaneScroll:me,deleteKeyCode:M,selectionKeyCode:S,selectionOnDrag:k,selectionMode:E,onSelectionStart:g,onSelectionEnd:p,multiSelectionKeyCode:N,panActivationKeyCode:I,zoomActivationKeyCode:T,elementsSelectable:z,onMove:n,onMoveStart:o,onMoveEnd:r,zoomOnScroll:j,zoomOnPinch:W,zoomOnDoubleClick:te,panOnScroll:K,panOnScrollSpeed:Z,panOnScrollMode:q,panOnDrag:re,defaultViewport:F,translateExtent:B,minZoom:V,maxZoom:L,onSelectionContextMenu:_,preventScrolling:C,noDragClassName:ze,noWheelClassName:qe,noPanClassName:Ze,disableKeyboardA11y:Qe},Y.createElement(kP,null,Y.createElement(wP,{edgeTypes:je,onEdgeClick:a,onEdgeDoubleClick:c,onlyRenderVisibleElements:D,onEdgeContextMenu:pe,onEdgeMouseEnter:de,onEdgeMouseMove:Ce,onEdgeMouseLeave:Ne,onReconnect:se,onReconnectStart:Ae,onReconnectEnd:be,reconnectRadius:Re,defaultMarkerColor:$,noPanClassName:Ze,elevateEdgesOnSelect:!!Pe,disableKeyboardA11y:Qe,rfId:ne},Y.createElement(NP,{style:y,type:b,component:x,containerStyle:v})),Y.createElement("div",{className:"react-flow__edgelabel-renderer"}),Y.createElement(uP,{nodeTypes:ke,onNodeClick:i,onNodeDoubleClick:l,onNodeMouseEnter:d,onNodeMouseMove:h,onNodeMouseLeave:f,onNodeContextMenu:m,selectNodesOnDrag:O,onlyRenderVisibleElements:D,noPanClassName:Ze,noDragClassName:ze,disableKeyboardA11y:Qe,nodeOrigin:tt,nodeExtent:at,rfId:ne})))};q2.displayName="GraphView";var jP=A.memo(q2);const pf=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],sr={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:pf,nodeExtent:pf,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Or.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},EP=()=>((t,e)=>t?Av(t,e):Av)((t,e)=>({...sr,setNodes:n=>{const{nodeInternals:o,nodeOrigin:r,elevateNodesOnSelect:s}=e();t({nodeInternals:cf(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?cf(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:c}=e(),d=l==null?void 0:l.querySelector(".react-flow__viewport");if(!d)return;const h=window.getComputedStyle(d),{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,[Nt]:{...b[Nt],handleBounds:void 0}});else if(b){const y=Hh(p.nodeElement);!(!y.width||!y.height||b.width===y.width&&b.height===y.height&&!p.forceUpdate)&&(r.set(b.id,{...b,[Nt]:{...b[Nt],handleBounds:{source:T2(".source",p.nodeElement,f,c),target:T2(".target",p.nodeElement,f,c)}},...y}),g.push({id:b.id,type:"dimensions",dimensions:y}))}return g},[]);x2(r,c);const _=i||s&&!i&&w2(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 c=cf(N2(n,a()),r,i,l);t({nodeInternals:c})}o==null||o(n)}},addSelectedNodes:n=>{const{multiSelectionActive:o,edges:r,getNodes:s}=e();let i,a=null;o?i=n.map(l=>rr(l,!0)):(i=Ss(s(),n),a=Ss(r,[])),nc({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=>rr(l,!0)):(i=Ss(r,n),a=Ss(s(),[])),nc({changedNodes:a,changedEdges:i,get:e,set:t})},unselectNodesAndEdges:({nodes:n,edges:o}={})=>{const{edges:r,getNodes:s}=e(),i=o||r;nc({changedNodes:(n||s()).map(a=>(a.selected=!1,rr(a.id,!1))),changedEdges:i.map(a=>rr(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();nc({changedNodes:o().filter(r=>r.selected).map(r=>rr(r.id,!1)),changedEdges:n.filter(r=>r.selected).map(r=>rr(r.id,!1)),get:e,set:t})},setNodeExtent:n=>{const{nodeInternals:o}=e();o.forEach(r=>{r.positionAbsolute=Wh(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 c=yr.translate(o[0]+n.x,o[1]+n.y).scale(o[2]),d=[[0,0],[r,s]],h=i==null?void 0:i.constrain()(c,d,l);return i.transform(a,h),o[0]!==h.x||o[1]!==h.y||o[2]!==h.k},cancelConnection:()=>t({connectionNodeId:sr.connectionNodeId,connectionHandleId:sr.connectionHandleId,connectionHandleType:sr.connectionHandleType,connectionStatus:sr.connectionStatus,connectionStartHandle:sr.connectionStartHandle,connectionEndHandle:sr.connectionEndHandle}),reset:()=>t({...sr})}),Object.is),gf=({children:t})=>{const e=A.useRef(null);return e.current||(e.current=EP()),Y.createElement(xR,{value:e.current},t)};gf.displayName="ReactFlowProvider";const G2=({children:t})=>A.useContext(Yl)?Y.createElement(Y.Fragment,null,t):Y.createElement(gf,null,t);G2.displayName="ReactFlowWrapper";const IP={input:d2,default:af,output:h2,group:lf},AP={default:ec,straight:Qh,step:Zh,smoothstep:Zl,simplebezier:Kh},TP=[0,0],MP=[15,15],OP={x:0,y:0,zoom:1},DP={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},_f=A.forwardRef(({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,className:r,nodeTypes:s=IP,edgeTypes:i=AP,onNodeClick:a,onEdgeClick:l,onInit:c,onMove:d,onMoveStart:h,onMoveEnd:f,onConnect:m,onConnectStart:_,onConnectEnd:g,onClickConnectStart:p,onClickConnectEnd:b,onNodeMouseEnter:y,onNodeMouseMove:x,onNodeMouseLeave:v,onNodeContextMenu:S,onNodeDoubleClick:k,onNodeDragStart:E,onNodeDrag:N,onNodeDragStop:I,onNodesDelete:T,onEdgesDelete:M,onSelectionChange:D,onSelectionDragStart:z,onSelectionDrag:O,onSelectionDragStop:F,onSelectionContextMenu:B,onSelectionStart:V,onSelectionEnd:L,connectionMode:C=Or.Strict,connectionLineType:$=nr.Bezier,connectionLineStyle:j,connectionLineComponent:W,connectionLineContainerStyle:K,deleteKeyCode:Z="Backspace",selectionKeyCode:q="Shift",selectionOnDrag:te=!1,selectionMode:re=Ki.Full,panActivationKeyCode:ae="Space",multiSelectionKeyCode:X=Kl()?"Meta":"Control",zoomActivationKeyCode:ee=Kl()?"Meta":"Control",snapToGrid:ce=!1,snapGrid:me=MP,onlyRenderVisibleElements:ue=!1,selectNodesOnDrag:pe=!0,nodesDraggable:de,nodesConnectable:Ce,nodesFocusable:Ne,nodeOrigin:se=TP,edgesFocusable:Ae,edgesUpdatable:be,elementsSelectable:Re,defaultViewport:ze=OP,minZoom:qe=.5,maxZoom:Ze=2,translateExtent:Pe=pf,preventScrolling:Qe=!0,nodeExtent:tt,defaultMarkerColor:at="#b1b1b7",zoomOnScroll:ne=!0,zoomOnPinch:ke=!0,panOnScroll:je=!1,panOnScrollSpeed:Le=.5,panOnScrollMode:G=tr.Free,zoomOnDoubleClick:ge=!0,panOnDrag:_e=!0,onPaneClick:fe,onPaneMouseEnter:le,onPaneMouseMove:Ve,onPaneMouseLeave:Fe,onPaneScroll:Je,onPaneContextMenu:ie,children:ve,onEdgeContextMenu:Ee,onEdgeDoubleClick:Be,onEdgeMouseEnter:Ye,onEdgeMouseMove:Oe,onEdgeMouseLeave:He,onEdgeUpdate:rt,onEdgeUpdateStart:Ke,onEdgeUpdateEnd:nt,onReconnect:yt,onReconnectStart:bt,onReconnectEnd:Mt,reconnectRadius:xt=10,edgeUpdaterRadius:rn=10,onNodesChange:Nn,onEdgesChange:fn,noDragClassName:sn="nodrag",noWheelClassName:Zt="nowheel",noPanClassName:to="nopan",fitView:po=!1,fitViewOptions:Es,connectOnClick:Is=!0,attributionPosition:As,proOptions:Ts,defaultEdgeOptions:Ms,elevateNodesOnSelect:ir=!0,elevateEdgesOnSelect:Os=!1,disableKeyboardA11y:Ds=!1,autoPanOnConnect:Rs=!0,autoPanOnNodeDrag:Ft=!0,connectionRadius:wt=20,isValidConnection:jn,onError:En,style:Ps,id:ac,nodeDragThreshold:lm,...cm},lc)=>{const dm=ac||"1";return Y.createElement("div",{...cm,style:{...Ps,...DP},ref:lc,className:hn(["react-flow",r]),"data-testid":"rf__wrapper",id:ac},Y.createElement(G2,null,Y.createElement(jP,{onInit:c,onMove:d,onMoveStart:h,onMoveEnd:f,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:y,onNodeMouseMove:x,onNodeMouseLeave:v,onNodeContextMenu:S,onNodeDoubleClick:k,nodeTypes:s,edgeTypes:i,connectionLineType:$,connectionLineStyle:j,connectionLineComponent:W,connectionLineContainerStyle:K,selectionKeyCode:q,selectionOnDrag:te,selectionMode:re,deleteKeyCode:Z,multiSelectionKeyCode:X,panActivationKeyCode:ae,zoomActivationKeyCode:ee,onlyRenderVisibleElements:ue,selectNodesOnDrag:pe,defaultViewport:ze,translateExtent:Pe,minZoom:qe,maxZoom:Ze,preventScrolling:Qe,zoomOnScroll:ne,zoomOnPinch:ke,zoomOnDoubleClick:ge,panOnScroll:je,panOnScrollSpeed:Le,panOnScrollMode:G,panOnDrag:_e,onPaneClick:fe,onPaneMouseEnter:le,onPaneMouseMove:Ve,onPaneMouseLeave:Fe,onPaneScroll:Je,onPaneContextMenu:ie,onSelectionContextMenu:B,onSelectionStart:V,onSelectionEnd:L,onEdgeContextMenu:Ee,onEdgeDoubleClick:Be,onEdgeMouseEnter:Ye,onEdgeMouseMove:Oe,onEdgeMouseLeave:He,onReconnect:yt??rt,onReconnectStart:bt??Ke,onReconnectEnd:Mt??nt,reconnectRadius:xt??rn,defaultMarkerColor:at,noDragClassName:sn,noWheelClassName:Zt,noPanClassName:to,elevateEdgesOnSelect:Os,rfId:dm,disableKeyboardA11y:Ds,nodeOrigin:se,nodeExtent:tt}),Y.createElement($R,{nodes:t,edges:e,defaultNodes:n,defaultEdges:o,onConnect:m,onConnectStart:_,onConnectEnd:g,onClickConnectStart:p,onClickConnectEnd:b,nodesDraggable:de,nodesConnectable:Ce,nodesFocusable:Ne,edgesFocusable:Ae,edgesUpdatable:be,elementsSelectable:Re,elevateNodesOnSelect:ir,minZoom:qe,maxZoom:Ze,nodeExtent:tt,onNodesChange:Nn,onEdgesChange:fn,snapToGrid:ce,snapGrid:me,connectionMode:C,translateExtent:Pe,connectOnClick:Is,defaultEdgeOptions:Ms,fitView:po,fitViewOptions:Es,onNodesDelete:T,onEdgesDelete:M,onNodeDragStart:E,onNodeDrag:N,onNodeDragStop:I,onSelectionDrag:O,onSelectionDragStart:z,onSelectionDragStop:F,noPanClassName:to,nodeOrigin:se,rfId:dm,autoPanOnConnect:Rs,autoPanOnNodeDrag:Ft,onError:En,connectionRadius:wt,isValidConnection:jn,nodeDragThreshold:lm}),Y.createElement(UR,{onSelectionChange:D}),ve,Y.createElement(AR,{proOptions:Ts,position:As}),Y.createElement(GR,{rfId:dm,disableKeyboardA11y:Ds})))});function Y2(t){return e=>{const[n,o]=A.useState(e),r=A.useCallback(s=>o(i=>t(s,i)),[]);return[n,o,r]}}_f.displayName="ReactFlow";const J2=Y2(N2),K2=Y2(function(t,e){return C2(t,e)});function RP(){return Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},Y.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function PP(){return Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},Y.createElement("path",{d:"M0 0h32v4.2H0z"}))}function LP(){return Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},Y.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 FP(){return Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},Y.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 zP(){return Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},Y.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 js=({children:t,className:e,...n})=>Y.createElement("button",{type:"button",className:hn(["react-flow__controls-button",e]),...n},t);js.displayName="ControlButton";const BP=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom}),X2=({style:t,showZoom:e=!0,showFitView:n=!0,showInteractive:o=!0,fitViewOptions:r,onZoomIn:s,onZoomOut:i,onFitView:a,onInteractiveChange:l,className:c,children:d,position:h="bottom-left"})=>{const f=qt(),[m,_]=A.useState(!1),{isInteractive:g,minZoomReached:p,maxZoomReached:b}=mt(BP,on),{zoomIn:y,zoomOut:x,fitView:v}=Qi();return A.useEffect(()=>{_(!0)},[]),m?Y.createElement(Jl,{className:hn(["react-flow__controls",c]),position:h,style:t,"data-testid":"rf__controls"},e&&Y.createElement(Y.Fragment,null,Y.createElement(js,{onClick:()=>{y(),s==null||s()},className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:b},Y.createElement(RP,null)),Y.createElement(js,{onClick:()=>{x(),i==null||i()},className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:p},Y.createElement(PP,null))),n&&Y.createElement(js,{className:"react-flow__controls-fitview",onClick:()=>{v(r),a==null||a()},title:"fit view","aria-label":"fit view"},Y.createElement(LP,null)),o&&Y.createElement(js,{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?Y.createElement(zP,null):Y.createElement(FP,null)),d):null};X2.displayName="Controls";var $n,UP=A.memo(X2);function VP({color:t,dimensions:e,lineWidth:n}){return Y.createElement("path",{stroke:t,strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})}function $P({color:t,radius:e}){return Y.createElement("circle",{cx:e,cy:e,r:e,fill:t})}(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})($n||($n={}));const HP={[$n.Dots]:"#91919a",[$n.Lines]:"#eee",[$n.Cross]:"#e2e2e2"},WP={[$n.Dots]:1,[$n.Lines]:1,[$n.Cross]:6},qP=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function Z2({id:t,variant:e=$n.Dots,gap:n=20,size:o,lineWidth:r=1,offset:s=2,color:i,style:a,className:l}){const c=A.useRef(null),{transform:d,patternId:h}=mt(qP,on),f=i||HP[e],m=o||WP[e],_=e===$n.Dots,g=e===$n.Cross,p=Array.isArray(n)?n:[n,n],b=[p[0]*d[2]||1,p[1]*d[2]||1],y=m*d[2],x=g?[y,y]:b,v=_?[y/s,y/s]:[x[0]/s,x[1]/s];return Y.createElement("svg",{className:hn(["react-flow__background",l]),style:{...a,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:c,"data-testid":"rf__background"},Y.createElement("pattern",{id:h+t,x:d[0]%b[0],y:d[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${v[0]},-${v[1]})`},_?Y.createElement($P,{color:f,radius:y/s}):Y.createElement(VP,{dimensions:x,color:f,lineWidth:r})),Y.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${h+t})`}))}Z2.displayName="Background";var GP=A.memo(Z2);function bf(t){return Math.min(11*t+35,200)}const Q2=Y.createContext("LR"),ek=A.memo(t=>{const e=J.c(51),{data:n,selected:o}=t,r=$e(n.atom),s=Kc().inOrderIds.indexOf(r.id),i=o?"var(--gray-9)":"var(--gray-3)",a=mt(YP),l=A.use(Q2);let c,d,h,f,m;if(e[0]!==r.code||e[1]!==i||e[2]!==l||e[3]!==o){const M=r.code.split(`
|
142
142
|
`).length,D=l==="LR"?Ue.Left:Ue.Top;let z;e[8]!==i?(z={background:i},e[8]=i,e[9]=z):z=e[9],e[10]!==D||e[11]!==z?(h=u.jsx(or,{type:"target",id:"inputs",position:D,style:z}),e[10]=D,e[11]=z,e[12]=h):h=e[12];const O=l==="LR"?Ue.Left:Ue.Top;let F;e[13]!==i?(F={background:i},e[13]=i,e[14]=F):F=e[14],e[15]!==O||e[16]!==F?(f=u.jsx(or,{type:"source",id:"inputs",position:O,style:F}),e[15]=O,e[16]=F,e[17]=f):f=e[17];const B=o&&"border-primary";e[18]!==B?(d=Ie("flex flex-col bg-card border border-input/50 rounded-md mx-[2px] overflow-hidden",B),e[18]=B,e[19]=d):d=e[19],c=bf(M),e[0]=r.code,e[1]=i,e[2]=l,e[3]=o,e[4]=c,e[5]=d,e[6]=h,e[7]=f}else c=e[4],d=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]!==c||e[24]!==m?(g={height:c,width:m},e[23]=c,e[24]=m,e[25]=g):g=e[25];const p=XV(r.name,s);let b,y,x;e[26]!==p?(b=u.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?(y=u.jsx(MH,{code:r.code}),e[28]=r.code,e[29]=y):y=e[29],e[30]!==d||e[31]!==g||e[32]!==b||e[33]!==y?(x=u.jsxs("div",{className:d,style:g,children:[b,y]}),e[30]=d,e[31]=g,e[32]=b,e[33]=y,e[34]=x):x=e[34];const v=l==="LR"?Ue.Right:Ue.Bottom;let S,k;e[35]!==i?(S={background:i},e[35]=i,e[36]=S):S=e[36],e[37]!==v||e[38]!==S?(k=u.jsx(or,{type:"source",id:"outputs",position:v,style:S}),e[37]=v,e[38]=S,e[39]=k):k=e[39];const E=l==="LR"?Ue.Right:Ue.Bottom;let N,I,T;return e[40]!==i?(N={background:i},e[40]=i,e[41]=N):N=e[41],e[42]!==E||e[43]!==N?(I=u.jsx(or,{type:"target",id:"outputs",position:E,style:N}),e[42]=E,e[43]=N,e[44]=I):I=e[44],e[45]!==x||e[46]!==k||e[47]!==I||e[48]!==h||e[49]!==f?(T=u.jsxs("div",{children:[h,f,x,k,I]}),e[45]=x,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]));ek.displayName="CustomNode";const tk={custom:ek};function YP(t){const{width:e}=t;return e}const nk=t=>{const e=J.c(18),{maxCount:n,cellIds:o,onClick:r,skipScroll:s}=t,i=Kc();let a,l,c,d;if(e[0]!==o||e[1]!==i||e[2]!==n||e[3]!==r||e[4]!==s){c=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")?(_=u.jsx("div",{className:"text-muted-foreground",children:"--"}),e[10]=_):_=e[10],c=_;break e}let m;e[11]!==o.length||e[12]!==r||e[13]!==s?(m=(_,g)=>u.jsxs("span",{className:"truncate",children:[u.jsx(gr,{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&&u.jsxs(Ur,{children:[u.jsx(ti,{asChild:!0,children:u.jsxs("span",{className:"whitespace-nowrap text-muted-foreground text-xs hover:underline cursor-pointer",children:["+",o.length-n," more"]})}),u.jsx(Js,{className:"w-auto",children:u.jsx("div",{className:"flex flex-col gap-1 py-1",children:f.slice(n).map(_=>u.jsx(gr,{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]=c}else a=e[5],l=e[6],c=e[7];return c!==Symbol.for("react.early_return_sentinel")?c:(e[15]!==a||e[16]!==l?(d=u.jsxs(u.Fragment,{children:[a,l]}),e[15]=a,e[16]=l,e[17]=d):d=e[17],d)},yf=t=>{const e=J.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,c;return e[5]!==o||e[6]!==r?(a=async d=>{r?r(d):(await xn(o),lt({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=u.jsx(gS,{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?(c=u.jsx("div",{className:"max-w-[130px]",...s,children:l}),e[12]=s,e[13]=l,e[14]=c):c=e[14],c},xf=A.memo(t=>{const e=J.c(38),{onChange:n,view:o,settings:r,onSettingsChange:s}=t;let i;e[0]!==s||e[1]!==r?(i=(O,F)=>{s({...r,[O]:F})},e[0]=s,e[1]=r,e[2]=i):i=e[2];const a=i;let l,c,d,h,f,m;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=u.jsx(ti,{asChild:!0,children:u.jsx(Me,{variant:"text",size:"xs",children:u.jsx(Im,{className:"w-4 h-4"})})}),e[3]=l):l=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(c=u.jsx("div",{className:"font-semibold pb-4",children:"Settings"}),e[4]=c):c=e[4],e[5]!==a?(d=O=>a("hidePureMarkdown",!!O),e[5]=a,e[6]=d):d=e[6],e[7]!==r.hidePureMarkdown||e[8]!==d?(h=u.jsx(K4,{"data-testid":"hide-pure-markdown-checkbox",id:"hide-pure-markdown",checked:r.hidePureMarkdown,onCheckedChange:d}),e[7]=r.hidePureMarkdown,e[8]=d,e[9]=h):h=e[9],e[10]===Symbol.for("react.memo_cache_sentinel")?(f=u.jsx(Fr,{htmlFor:"hide-pure-markdown",children:"Hide pure markdown"}),e[10]=f):f=e[10],e[11]!==h?(m=u.jsxs(Ur,{children:[l,u.jsxs(Js,{className:"w-auto p-2 text-muted-foreground",children:[c,u.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,y;e[13]!==n?(p=()=>n("_minimap_"),e[13]=n,e[14]=p):p=e[14],e[15]===Symbol.for("react.memo_cache_sentinel")?(b=u.jsx(Jp,{className:"w-4 h-4 mr-1"}),e[15]=b):b=e[15],e[16]!==g||e[17]!==p?(y=u.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]=y):y=e[18];const x=o==="TB";let v,S,k;e[19]!==n?(v=()=>n("TB"),e[19]=n,e[20]=v):v=e[20],e[21]===Symbol.for("react.memo_cache_sentinel")?(S=u.jsx(Ta,{className:"w-4 h-4 mr-1"}),e[21]=S):S=e[21],e[22]!==x||e[23]!==v?(k=u.jsxs(Me,{variant:"outline",className:"bg-background","aria-selected":x,size:"xs",onClick:v,children:[S,"Vertical Tree"]}),e[22]=x,e[23]=v,e[24]=k):k=e[24];const E=o==="LR";let N,I,T,M;e[25]!==n?(N=()=>n("LR"),e[25]=n,e[26]=N):N=e[26],e[27]===Symbol.for("react.memo_cache_sentinel")?(I=u.jsx(Ta,{className:"w-4 h-4 mr-1 transform -rotate-90"}),e[27]=I):I=e[27],e[28]!==E||e[29]!==N?(T=u.jsxs(Me,{variant:"outline",className:"bg-background","aria-selected":E,size:"xs",onClick:N,children:[I," ","Horizontal Tree"]}),e[28]=E,e[29]=N,e[30]=T):T=e[30],e[31]!==y||e[32]!==k||e[33]!==T?(M=u.jsxs("div",{className:"flex gap-2",children:[y,k,T]}),e[31]=y,e[32]=k,e[33]=T,e[34]=M):M=e[34];const D=o!=="_minimap_"&&_;let z;return e[35]!==M||e[36]!==D?(z=u.jsxs(Jl,{position:"top-right",className:"flex flex-col items-end gap-2",children:[M,D]}),e[35]=M,e[36]=D,e[37]=z):z=e[37],z});xf.displayName="GraphToolbar";const rc=A.memo(t=>{const e=J.c(11),{selection:n,variables:o,onClearSelection:r}=t;if(!n)return null;const s=JP;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 d=Object.values(o).filter(m=>m.usedBy.includes(n.id)),h=Object.values(o).filter(m=>m.declaredBy.includes(n.id)),f=(m,_)=>u.jsxs(u.Fragment,{children:[m.length===0&&u.jsx("div",{className:"text-muted-foreground text-sm text-center",children:"--"}),u.jsx("div",{className:"grid grid-cols-5 gap-3 items-center text-sm py-1 flex-1 empty:hidden",children:m.map(g=>u.jsxs(Y.Fragment,{children:[u.jsx(yf,{declaredBy:g.declaredBy,name:g.name}),u.jsxs("div",{className:"truncate col-span-2",title:g.value??"",children:[g.value,u.jsxs("span",{className:"ml-1 truncate text-foreground/60 font-mono",children:["(",g.dataType,")"]})]}),u.jsx("div",{className:"truncate col-span-2 gap-1 items-center",children:u.jsx(nk,{skipScroll:!0,onClick:()=>s(_==="in"?g.declaredBy[0]:g.usedBy[0],g.name),maxCount:3,cellIds:g.usedBy})})]},g.name))})]});return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"font-bold py-2 flex items-center gap-2 border-b px-3",children:[u.jsx(dc,{className:"w-5 h-5"}),u.jsx(gr,{cellId:n.id}),u.jsx("div",{className:"flex-1"}),u.jsx(I0,{cellId:n.id,children:u.jsx(Me,{variant:"ghost",size:"icon",children:u.jsx(sd,{className:"w-4 h-4"})})}),u.jsx(Me,{variant:"text",size:"icon",onClick:()=>{r()},children:u.jsx(oo,{className:"w-4 h-4"})})]}),u.jsxs("div",{className:"text-sm flex flex-col py-3 pl-2 pr-4 flex-1 justify-center",children:[u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsxs("span",{className:"flex items-center gap-2 font-semibold",children:[u.jsx(gn,{className:"w-4 h-4"}),"Outputs"]}),f(h,"out")]}),u.jsx("hr",{className:"border-divider my-3"}),u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsxs("span",{className:"flex items-center gap-2 font-semibold",children:[u.jsx(_p,{className:"w-4 h-4"}),"Inputs"]}),f(d,"in")]})]})]})}if(n.type==="edge"){const d=Object.values(o).filter(h=>h.declaredBy.includes(n.source)&&h.usedBy.includes(n.target));return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"font-bold py-2 flex items-center gap-2 border-b px-3",children:[u.jsx(Oa,{className:"w-4 h-4"}),u.jsx(gr,{cellId:n.source}),u.jsx(nd,{className:"w-4 h-4"}),u.jsx(gr,{cellId:n.target})]}),u.jsx("div",{className:"grid grid-cols-4 gap-3 max-w-[350px] items-center text-sm p-3 flex-1",children:d.map(h=>u.jsxs(Y.Fragment,{children:[u.jsx(yf,{declaredBy:h.declaredBy,name:h.name,onClick:()=>{s(h.declaredBy[0],h.name)}}),u.jsx("div",{className:"truncate text-foreground/60 font-mono",children:h.dataType}),u.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,c;return e[7]!==a?(l=a(),e[7]=a,e[8]=l):l=e[8],e[9]!==l?(c=u.jsx(Jl,{position:"bottom-left",className:"max-h-[90%] flex flex-col w-[calc(100%-5rem)]",children:u.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]=c):c=e[10],c});function JP(t,e){const n=hc(t);n&&tp(n,e)}function ok(){const t=J.c(7),e=Qi(),n=mt(XP),o=mt(KP);let r;t[0]!==e?(r=()=>{e.fitView({duration:100})},t[0]=e,t[1]=r):r=t[1];const s=ZV(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]),A.useEffect(i,a)}function KP(t){const{height:e}=t;return e}function XP(t){const{width:e}=t;return e}rc.displayName="GraphSelectionPanel";const rk=new class{createEdge(t,e,n){return{type:"smoothstep",pathOptions:{offset:20,borderRadius:100},data:{direction:n},markerEnd:{type:ys.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:bf(dt.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,c]of Qm.zip(t,e)){const d=this.createNode(l,c,r);s.push(d),r=d.position.y+(d.height||0)}const a=new Set;for(const l of Object.values(n)){const{declaredBy:c,usedBy:d}=l;for(const h of c)for(const f of d){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}}},ZP=t=>{const e=J.c(37),{cellIds:n,variables:o,cellAtoms:r,children:s}=t;let i;e[0]!==r||e[1]!==n||e[2]!==o?(i=rk.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 c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=[],e[4]=c):c=e[4];const[d,h]=K2(c),[f,m]=J2(a),[_,g]=A.useState(),[p,b]=A.useState(),y=A.useRef(!1);ok();const x=mt(QP);let v;e[5]!==h||e[6]!==m?(v=C=>{m(C.nodes),h([])},e[5]=h,e[6]=m,e[7]=v):v=e[7];const S=et(v);let k,E,N,I;e[8]!==r||e[9]!==n||e[10]!==S||e[11]!==o?(k=()=>{y.current?S(rk.createElements(n,r,o,!1)):y.current=!0},E=[n,o,r,S],e[8]=r,e[9]=n,e[10]=S,e[11]=o,e[12]=k,e[13]=E):(k=e[12],E=e[13]),A.useEffect(k,E),e[14]!==l||e[15]!==_||e[16]!==h?(N=()=>{if(_){const C=l.filter($=>{const{source:j,target:W,data:K}=$;return j===_&&K.direction==="outputs"||W===_&&K.direction==="inputs"});h(C)}},I=[_,h,l],e[14]=l,e[15]=_,e[16]=h,e[17]=N,e[18]=I):(N=e[17],I=e[18]),A.useEffect(N,I);const T=function(C,$){const j=J.c(17);let W,K;if(j[0]!==$||j[1]!==C){let ee;j[3]!==$?(ee=(ce,me)=>{const{position:ue}=me;return Math.min(ce,ue.y-$/2-10)},j[3]=$,j[4]=ee):ee=j[4],K=C.reduce(ee,Number.POSITIVE_INFINITY),j[0]=$,j[1]=C,j[2]=K}else K=j[2];const Z=K;let q;if(j[5]!==$||j[6]!==C){let ee;j[8]!==$?(ee=(ce,me)=>{const{position:ue}=me;return Math.max(ce,ue.y+$/2+10)},j[8]=$,j[9]=ee):ee=j[9],q=C.reduce(ee,Number.NEGATIVE_INFINITY),j[5]=$,j[6]=C,j[7]=q}else q=j[7];const te=q;let re,ae,X;return j[10]!==Z?(re=[Number.NEGATIVE_INFINITY,Z],j[10]=Z,j[11]=re):re=j[11],j[12]!==te?(ae=[Number.POSITIVE_INFINITY,te],j[12]=te,j[13]=ae):ae=j[13],j[14]!==re||j[15]!==ae?(X=[re,ae],j[14]=re,j[15]=ae,j[16]=X):X=j[16],W=X,W}(f,x);let M;e[19]===Symbol.for("react.memo_cache_sentinel")?(M=()=>{g(void 0),b(void 0)},e[19]=M):M=e[19];const D=M;let z;e[20]!==d||e[21]!==p||e[22]!==_||e[23]!==o?(z=()=>p?u.jsx(rc,{selection:{type:"edge",source:p.source,target:p.target},onClearSelection:D,variables:o,edges:d}):_?u.jsx(rc,{selection:{type:"node",id:_},variables:o,edges:d,onClearSelection:D}):null,e[20]=d,e[21]=p,e[22]=_,e[23]=o,e[24]=z):z=e[24];const O=z;let F,B,V,L;return e[25]!==h?(F=(C,$)=>{const j=$.id;g(j),b(void 0),h([])},e[25]=h,e[26]=F):F=e[26],e[27]===Symbol.for("react.memo_cache_sentinel")?(B=(C,$)=>{b($)},e[27]=B):B=e[27],e[28]!==O?(V=O(),e[28]=O,e[29]=V):V=e[29],e[30]!==s||e[31]!==d||e[32]!==f||e[33]!==F||e[34]!==V||e[35]!==T?(L=u.jsxs(_f,{nodes:f,edges:d,nodeTypes:tk,translateExtent:T,onNodeClick:F,onNodeDoubleClick:eL,onEdgeClick:B,snapToGrid:!0,fitView:!0,elementsSelectable:!0,minZoom:1,maxZoom:1,draggable:!1,panOnScrollMode:tr.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:[V,s]}),e[30]=s,e[31]=d,e[32]=f,e[33]=F,e[34]=V,e[35]=T,e[36]=L):L=e[36],L};function QP(t){const{height:e}=t;return e}function eL(t,e){_S(e.id,"focus")}var wf,sk,ik,ak,lk,ck,vf,dk,kf,uk,Sf,hk,Cf,fk,Nf,mk,jf,pk,Ef,gk,If,_k,Af,bk,Tf,yk,Mf,xk,Of,wk,Df,vk,Rf,kk,Sk,Ck,Nk,jk,Ek,Ik,Pf,Ak,Lf,Tk,Ff,Mk,zf,Ok,Bf,Dk,Uf,Rk,Vf,Pk,$f,Lk,Hf,Fk,Wf,zk,qf,Bk,Gf,Uk,Yf,Vk,Jf,$k,Hk,Wk,qk,Gk,Yk,Jk,Kf,Kk,Xf,Xk,Zk,Qk,Zf,e3,Qf,t3,em,n3,tm,o3,nm,r3,s3,i3,a3,l3;function om(){if(sk)return wf;sk=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 c=""+i,d=""+a;if(!s&&c>d){var h=c;c=d,d=h}return c+""+d+""+(l===void 0?"\0":l)}function r(s,i){return o(s,i.v,i.w,i.name)}return wf=class{constructor(s){Q(this,"_isDirected",!0);Q(this,"_isMultigraph",!1);Q(this,"_isCompound",!1);Q(this,"_label");Q(this,"_defaultNodeLabelFn",()=>{});Q(this,"_defaultEdgeLabelFn",()=>{});Q(this,"_nodes",{});Q(this,"_in",{});Q(this,"_preds",{});Q(this,"_out",{});Q(this,"_sucs",{});Q(this,"_edgeObjs",{});Q(this,"_edgeLabels",{});Q(this,"_nodeCount",0);Q(this,"_edgeCount",0);Q(this,"_parent");Q(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(c){a.length>1?l.setNode(c,i):l.setNode(c)}),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([d,h]){s(d)&&i.setNode(d,h)}),Object.values(this._edgeObjs).forEach(function(d){i.hasNode(d.v)&&i.hasNode(d.w)&&i.setEdge(d,a.edge(d))});var l={};function c(d){var h=a.parent(d);return h===void 0||i.hasNode(h)?(l[d]=h,h):h in l?l[h]:c(h)}return this._isCompound&&i.nodes().forEach(d=>i.setParent(d,c(d))),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(c,d){return l.length>1?a.setEdge(c,d,i):a.setEdge(c,d),d}),this}setEdge(){var s,i,a,l,c=!1,d=arguments[0];typeof d=="object"&&d!==null&&"v"in d?(s=d.v,i=d.w,a=d.name,arguments.length===2&&(l=arguments[1],c=!0)):(s=d,i=arguments[1],a=arguments[3],arguments.length>2&&(l=arguments[2],c=!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 c&&(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]=c?l:this._defaultEdgeLabelFn(s,i,a);var f=function(m,_,g,p){var b=""+_,y=""+g;if(!m&&b>y){var x=b;b=y,y=x}var v={v:b,w:y};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),c=this._edgeObjs[l];return c&&(s=c.v,i=c.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(c=>c.v===i):l}}outEdges(s,i){var a=this._out[s];if(a){var l=Object.values(a);return i?l.filter(c=>c.w===i):l}}nodeEdges(s,i){var a=this.inEdges(s,i);if(a)return a.concat(this.outEdges(s,i))}},wf}function tL(){return ck?lk:(ck=1,lk={Graph:om(),version:ak?ik:(ak=1,ik="2.2.4")})}function nL(){if(dk)return vf;dk=1;var t=om();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 vf={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}},vf}function oL(){return uk||(uk=1,kf=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}),kf}function c3(){return hk?Sf:(hk=1,Sf=class{constructor(){Q(this,"_arr",[]);Q(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}},Sf)}function d3(){if(fk)return Cf;fk=1;var t=c3();Cf=function(n,o,r,s){return function(i,a,l,c){var d,h,f={},m=new t,_=function(g){var p=g.v!==d?g.v:g.w,b=f[p],y=l(g),x=h.distance+y;if(y<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+g+" Weight: "+y);x<b.distance&&(b.distance=x,b.predecessor=d,m.decrease(p,x))};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&&(d=m.removeMin(),(h=f[d]).distance!==Number.POSITIVE_INFINITY);)c(d).forEach(_);return f}(n,String(o),r||e,s||function(i){return n.outEdges(i)})};var e=()=>1;return Cf}function rL(){if(mk)return Nf;mk=1;var t=d3();return Nf=function(e,n,o){return e.nodes().reduce(function(r,s){return r[s]=t(e,s,n,o),r},{})},Nf}function u3(){return pk||(pk=1,jf=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(d){Object.hasOwn(o,d)?o[d].onStack&&(a.lowlink=Math.min(a.lowlink,o[d].index)):(s(d),a.lowlink=Math.min(a.lowlink,o[d].lowlink))}),a.lowlink===a.index){var l,c=[];do l=n.pop(),o[l].onStack=!1,c.push(l);while(i!==l);r.push(c)}}return t.nodes().forEach(function(i){Object.hasOwn(o,i)||s(i)}),r}),jf}function sL(){if(gk)return Ef;gk=1;var t=u3();return Ef=function(e){return t(e).filter(function(n){return n.length>1||n.length===1&&e.hasEdge(n[0],n[0])})},Ef}function iL(){if(_k)return If;_k=1,If=function(e,n,o){return function(r,s,i){var a={},l=r.nodes();return l.forEach(function(c){a[c]={},a[c][c]={distance:0},l.forEach(function(d){c!==d&&(a[c][d]={distance:Number.POSITIVE_INFINITY})}),i(c).forEach(function(d){var h=d.v===c?d.w:d.v,f=s(d);a[c][h]={distance:f,predecessor:c}})}),l.forEach(function(c){var d=a[c];l.forEach(function(h){var f=a[h];l.forEach(function(m){var _=f[c],g=d[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 If}function h3(){if(bk)return Af;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}bk=1;class e extends Error{constructor(){super(...arguments)}}return Af=t,t.CycleException=e,Af}function aL(){if(yk)return Tf;yk=1;var t=h3();return Tf=function(e){try{t(e)}catch(n){if(n instanceof t.CycleException)return!1;throw n}return!0},Tf}function f3(){if(xk)return Mf;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]),c=>a.push([c,!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),c=>a.push(c)))}}function n(o,r){for(var s=o.length;s--;)r(o[s],s,o);return o}return xk=1,Mf=function(o,r,s){Array.isArray(r)||(r=[r]);var i=o.isDirected()?d=>o.successors(d):d=>o.neighbors(d),a=s==="post"?t:e,l=[],c={};return r.forEach(d=>{if(!o.hasNode(d))throw new Error("Graph does not have node: "+d);a(d,i,c,l)}),l},Mf}function lL(){if(wk)return Of;wk=1;var t=f3();return Of=function(e,n){return t(e,n,"post")},Of}function cL(){if(vk)return Df;vk=1;var t=f3();return Df=function(e,n){return t(e,n,"pre")},Df}function dL(){if(kk)return Rf;kk=1;var t=om(),e=c3();return Rf=function(n,o){var r,s=new t,i={},a=new e;function l(d){var h=d.v===r?d.w:d.v,f=a.priority(h);if(f!==void 0){var m=o(d);m<f&&(i[h]=r,a.decrease(h,m))}}if(n.nodeCount()===0)return s;n.nodes().forEach(function(d){a.add(d,Number.POSITIVE_INFINITY),s.setNode(d)}),a.decrease(n.nodes()[0],0);for(var c=!1;a.size()>0;){if(r=a.removeMin(),Object.hasOwn(i,r))s.setEdge(r,i[r]);else{if(c)throw new Error("Input graph is not connected: "+n);c=!0}n.nodeEdges(r).forEach(l)}return s},Rf}function eo(){if(jk)return Nk;jk=1;var t=tL();return Nk={Graph:t.Graph,json:nL(),alg:Ck?Sk:(Ck=1,Sk={components:oL(),dijkstra:d3(),dijkstraAll:rL(),findCycles:sL(),floydWarshall:iL(),isAcyclic:aL(),postorder:lL(),preorder:cL(),prim:dL(),tarjan:u3(),topsort:h3()}),version:t.version}}function uL(){if(Ak)return Pf;Ak=1;let t=eo().Graph,e=function(){if(Ik)return Ek;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 Ik=1,Ek=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,c=l._prev;for(;c!==l;)a.push(JSON.stringify(c,i)),c=c._prev;return"["+a.join(", ")+"]"}}}();Pf=function(s,i){if(s.nodeCount()<=1)return[];let a=function(l,c){let d=new t,h=0,f=0;l.nodes().forEach(g=>{d.setNode(g,{v:g,in:0,out:0})}),l.edges().forEach(g=>{let p=d.edge(g.v,g.w)||0,b=c(g),y=p+b;d.setEdge(g.v,g.w,y),f=Math.max(f,d.node(g.v).out+=b),h=Math.max(h,d.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 d.nodes().forEach(g=>{r(m,_,d.node(g))}),{graph:d,buckets:m,zeroIdx:_}}(s,i||n);return function(l,c,d){let h,f=[],m=c[c.length-1],_=c[0];for(;l.nodeCount();){for(;h=_.dequeue();)o(l,c,d,h);for(;h=m.dequeue();)o(l,c,d,h);if(l.nodeCount()){for(let g=c.length-2;g>0;--g)if(h=c[g].dequeue(),h){f=f.concat(o(l,c,d,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,c){let d=c?[]:void 0;return s.inEdges(l.v).forEach(h=>{let f=s.edge(h),m=s.node(h.v);c&&d.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),d}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 Pf}function Lt(){if(Tk)return Lf;Tk=1;let t=eo().Graph;function e(c,d,h,f){let m;do m=i(f);while(c.hasNode(m));return h.dummy=d,c.setNode(m,h),m}Lf={addBorderNode:function(c,d,h,f){let m={width:0,height:0};return arguments.length>=4&&(m.rank=h,m.order=f),e(c,"border",m,d)},addDummyNode:e,applyWithChunking:o,asNonCompoundGraph:function(c){let d=new t({multigraph:c.isMultigraph()}).setGraph(c.graph());return c.nodes().forEach(h=>{c.children(h).length||d.setNode(h,c.node(h))}),c.edges().forEach(h=>{d.setEdge(h,c.edge(h))}),d},buildLayerMatrix:function(c){let d=a(r(c)+1).map(()=>[]);return c.nodes().forEach(h=>{let f=c.node(h),m=f.rank;m!==void 0&&(d[m][f.order]=h)}),d},intersectRect:function(c,d){let h,f,m=c.x,_=c.y,g=d.x-m,p=d.y-_,b=c.width/2,y=c.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)*y?(p<0&&(y=-y),h=y*g/p,f=y):(g<0&&(b=-b),h=b,f=b*p/g),{x:m+h,y:_+f}},mapValues:function(c,d){let h=d;return typeof d=="string"&&(h=f=>f[d]),Object.entries(c).reduce((f,[m,_])=>(f[m]=h(_,m),f),{})},maxRank:r,normalizeRanks:function(c){let d=c.nodes().map(f=>{let m=c.node(f).rank;return m===void 0?Number.MAX_VALUE:m}),h=o(Math.min,d);c.nodes().forEach(f=>{let m=c.node(f);Object.hasOwn(m,"rank")&&(m.rank-=h)})},notime:function(c,d){return d()},partition:function(c,d){let h={lhs:[],rhs:[]};return c.forEach(f=>{d(f)?h.lhs.push(f):h.rhs.push(f)}),h},pick:function(c,d){const h={};for(const f of d)c[f]!==void 0&&(h[f]=c[f]);return h},predecessorWeights:function(c){let d=c.nodes().map(h=>{let f={};return c.inEdges(h).forEach(m=>{f[m.v]=(f[m.v]||0)+c.edge(m).weight}),f});return l(c.nodes(),d)},range:a,removeEmptyRanks:function(c){let d=c.nodes().map(g=>c.node(g).rank),h=o(Math.min,d),f=[];c.nodes().forEach(g=>{let p=c.node(g).rank-h;f[p]||(f[p]=[]),f[p].push(g)});let m=0,_=c.graph().nodeRankFactor;Array.from(f).forEach((g,p)=>{g===void 0&&p%_!==0?--m:g!==void 0&&m&&g.forEach(b=>c.node(b).rank+=m)})},simplify:function(c){let d=new t().setGraph(c.graph());return c.nodes().forEach(h=>d.setNode(h,c.node(h))),c.edges().forEach(h=>{let f=d.edge(h.v,h.w)||{weight:0,minlen:1},m=c.edge(h);d.setEdge(h.v,h.w,{weight:f.weight+m.weight,minlen:Math.max(f.minlen,m.minlen)})}),d},successorWeights:function(c){let d=c.nodes().map(h=>{let f={};return c.outEdges(h).forEach(m=>{f[m.w]=(f[m.w]||0)+c.edge(m).weight}),f});return l(c.nodes(),d)},time:function(c,d){let h=Date.now();try{return d()}finally{console.log(c+" time: "+(Date.now()-h)+"ms")}},uniqueId:i,zipObject:l};const n=65535;function o(c,d){if(d.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 _}(d);return c.apply(null,h.map(f=>c.apply(null,f)))}return c.apply(null,d)}function r(c){const d=c.nodes().map(h=>{let f=c.node(h).rank;return f===void 0?Number.MIN_VALUE:f});return o(Math.max,d)}let s=0;function i(c){var d=++s;return toString(c)+d}function a(c,d,h=1){d==null&&(d=c,c=0);let f=_=>_<d;h<0&&(f=_=>d<_);const m=[];for(let _=c;f(_);_+=h)m.push(_);return m}function l(c,d){return c.reduce((h,f,m)=>(h[f]=d[m],h),{})}return Lf}function hL(){if(Mk)return Ff;Mk=1;let t=uL(),e=Lt().uniqueId;return Ff={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(c){Object.hasOwn(a,c)||(a[c]=!0,i[c]=!0,r.outEdges(c).forEach(d=>{Object.hasOwn(i,d.w)?s.push(d):l(d.w)}),delete i[c])}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)}})}},Ff}function fL(){if(Ok)return zf;Ok=1;let t=Lt();return zf={run:function(e){e.graph().dummyChains=[],e.edges().forEach(n=>function(o,r){let s,i,a,l=r.v,c=o.node(l).rank,d=r.w,h=o.node(d).rank,f=r.name,m=o.edge(r),_=m.labelRank;if(h!==c+1){for(o.removeEdge(r),a=0,++c;c<h;++a,++c)m.points=[],i={width:0,height:0,edgeLabel:m,edgeObj:r,rank:c},s=t.addDummyNode(o,"edge",i,"_d"),c===_&&(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,d,{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)})}},zf}function sc(){if(Dk)return Bf;Dk=1;const{applyWithChunking:t}=Lt();return Bf={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}},Bf}function m3(){if(Rk)return Uf;Rk=1;var t=eo().Graph,e=sc().slack;function n(s,i){return s.nodes().forEach(function a(l){i.nodeEdges(l).forEach(c=>{var d=c.v,h=l===d?c.w:d;s.hasNode(h)||e(i,c)||(s.setNode(h,{}),s.setEdge(l,h,{}),a(h))})}),s.nodeCount()}function o(s,i){return i.edges().reduce((a,l)=>{let c=Number.POSITIVE_INFINITY;return s.hasNode(l.v)!==s.hasNode(l.w)&&(c=e(i,l)),c<a[0]?[c,l]:a},[Number.POSITIVE_INFINITY,null])[1]}function r(s,i,a){s.nodes().forEach(l=>i.node(l).rank+=a)}return Uf=function(s){var i,a,l=new t({directed:!1}),c=s.nodes()[0],d=s.nodeCount();for(l.setNode(c,{});n(l,s)<d;)i=o(l,s),a=l.hasNode(i.v)?e(s,i):-e(s,i),r(l,s,a);return l},Uf}function mL(){if(Pk)return Vf;Pk=1;var t=m3(),e=sc().slack,n=sc().longestPath,o=eo().alg.preorder,r=eo().alg.postorder,s=Lt().simplify;function i(g){g=s(g),n(g);var p,b=t(g);for(c(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(y=>function(x,v,S){var k=x.node(S),E=k.parent;x.edge(S,E).cutvalue=l(x,v,S)}(g,p,y))}function l(g,p,b){var y=g.node(b).parent,x=!0,v=p.edge(b,y),S=0;return v||(x=!1,v=p.edge(y,b)),S=v.weight,p.nodeEdges(b).forEach(k=>{var E,N,I=k.v===b,T=I?k.w:k.v;if(T!==y){var M=I===x,D=p.edge(k).weight;if(S+=M?D:-D,E=b,N=T,g.hasEdge(E,N)){var z=g.edge(b,T).cutvalue;S+=M?-z:z}}}),S}function c(g,p){arguments.length<2&&(p=g.nodes()[0]),d(g,{},1,p)}function d(g,p,b,y,x){var v=b,S=g.node(y);return p[y]=!0,g.neighbors(y).forEach(k=>{Object.hasOwn(p,k)||(b=d(g,p,b,k,y))}),S.low=v,S.lim=b++,x?S.parent=x:delete S.parent,b}function h(g){return g.edges().find(p=>g.edge(p).cutvalue<0)}function f(g,p,b){var y=b.v,x=b.w;p.hasEdge(y,x)||(y=b.w,x=b.v);var v=g.node(y),S=g.node(x),k=v,E=!1;v.lim>S.lim&&(k=S,E=!0);var N=p.edges().filter(I=>E===_(g,g.node(I.v),k)&&E!==_(g,g.node(I.w),k));return N.reduce((I,T)=>e(p,T)<e(p,I)?T:I)}function m(g,p,b,y){var x=b.v,v=b.w;g.removeEdge(x,v),g.setEdge(y.v,y.w,{}),c(g),a(g,p),function(S,k){var E=S.nodes().find(I=>!k.node(I).parent),N=o(S,E);(N=N.slice(1)).forEach(I=>{var T=S.node(I).parent,M=k.edge(I,T),D=!1;M||(M=k.edge(T,I),D=!0),k.node(I).rank=k.node(T).rank+(D?M.minlen:-M.minlen)})}(g,p)}function _(g,p,b){return b.low<=p.lim&&p.lim<=b.lim}return Vf=i,i.initLowLimValues=c,i.initCutValues=a,i.calcCutValue=l,i.leaveEdge=h,i.enterEdge=f,i.exchangeEdges=m,Vf}function pL(){if(Lk)return $f;Lk=1;var t=sc().longestPath,e=m3(),n=mL();$f=function(s){switch(s.graph().ranker){case"network-simplex":default:r(s);break;case"tight-tree":(function(i){t(i),e(i)})(s);break;case"longest-path":o(s)}};var o=t;function r(s){n(s)}return $f}function gL(){return Fk||(Fk=1,Hf=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=[],y=[],x=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>x||v>f[g].lim));for(p=g,g=_;(g=h.parent(g))!==p;)y.push(g);return{path:b.concat(y.reverse()),lca:p}}(t,e,r.v,r.w),i=s.path,a=s.lca,l=0,c=i[l],d=!0;for(;n!==r.w;){if(o=t.node(n),d){for(;(c=i[l])!==a&&t.node(c).maxRank<o.rank;)l++;c===a&&(d=!1)}if(!d){for(;l<i.length-1&&t.node(c=i[l+1]).minRank<=o.rank;)l++;c=i[l]}t.setParent(n,c),n=t.successors(n)[0]}})}),Hf}function _L(){if(zk)return Wf;zk=1;let t=Lt();function e(n,o,r,s,i,a,l){let c=n.children(l);if(!c.length)return void(l!==o&&n.setEdge(o,l,{weight:0,minlen:r}));let d=t.addBorderNode(n,"_bt"),h=t.addBorderNode(n,"_bb"),f=n.node(l);n.setParent(d,l),f.borderTop=d,n.setParent(h,l),f.borderBottom=h,c.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,y=g!==p?1:i-a[l]+1;n.setEdge(d,g,{weight:b,minlen:y,nestingEdge:!0}),n.setEdge(p,h,{weight:b,minlen:y,nestingEdge:!0})}),n.parent(l)||n.setEdge(o,d,{weight:0,minlen:i+a[l]})}return Wf={run:function(n){let o=t.addDummyNode(n,"root",{},"_root"),r=function(c){var d={};function h(f,m){var _=c.children(f);_&&_.length&&_.forEach(g=>h(g,m+1)),d[f]=m}return c.children().forEach(f=>h(f,1)),d}(n),s=Object.values(r),i=t.applyWithChunking(Math.max,s)-1,a=2*i+1;n.graph().nestingRoot=o,n.edges().forEach(c=>n.edge(c).minlen*=a);let l=function(c){return c.edges().reduce((d,h)=>d+c.edge(h).weight,0)}(n)+1;n.children().forEach(c=>e(n,o,a,l,i,r,c)),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)})}},Wf}function bL(){if(Uk)return Gf;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 Uk=1,Gf={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))}},Gf}function yL(){if(Gk)return qk;Gk=1;let t=Lt();return qk=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 c=>{c.merged||(c.barycenter===void 0||l.barycenter===void 0||c.barycenter>=l.barycenter)&&function(d,h){let f=0,m=0;d.weight&&(f+=d.barycenter*d.weight,m+=d.weight),h.weight&&(f+=h.barycenter*h.weight,m+=h.weight),d.vs=h.vs.concat(d.vs),d.barycenter=f/m,d.weight=m,d.i=Math.min(h.i,d.i),h.merged=!0}(l,c)}}function a(l){return c=>{c.in.push(l),--c.indegree===0&&r.push(c)}}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 xL(){if(Kk)return Kf;Kk=1;let t=(Wk||(Wk=1,Hk=function(o,r=[]){return r.map(s=>{let i=o.inEdges(s);if(i.length){let a=i.reduce((l,c)=>{let d=o.edge(c),h=o.node(c.v);return{sum:l.sum+d.weight*h.order,weight:l.weight+d.weight}},{sum:0,weight:0});return{v:s,barycenter:a.sum/a.weight,weight:a.weight}}return{v:s}})}),Hk),e=yL(),n=function(){if(Jk)return Yk;Jk=1;let o=Lt();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 Yk=function(s,i){let a=o.partition(s,p=>Object.hasOwn(p,"barycenter")),l=a.lhs,c=a.rhs.sort((p,b)=>b.i-p.i),d=[],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(d,c,m),l.forEach(p=>{m+=p.vs.length,d.push(p.vs),h+=p.barycenter*p.weight,f+=p.weight,m=r(d,c,m)});let g={vs:d.flat(!0)};return f&&(g.barycenter=h/f,g.weight=f),g}}();return Kf=function o(r,s,i,a){let l=r.children(s),c=r.node(s),d=c?c.borderLeft:void 0,h=c?c.borderRight:void 0,f={};d&&(l=l.filter(p=>p!==d&&p!==h));let m=t(r,l);m.forEach(p=>{if(r.children(p.v).length){let x=o(r,p.v,i,a);f[p.v]=x,Object.hasOwn(x,"barycenter")&&(y=x,(b=p).barycenter!==void 0?(b.barycenter=(b.barycenter*b.weight+y.barycenter*y.weight)/(b.weight+y.weight),b.weight+=y.weight):(b.barycenter=y.barycenter,b.weight=y.weight))}var b,y});let _=e(m,i);(function(p,b){p.forEach(y=>{y.vs=y.vs.flatMap(x=>b[x]?b[x].vs:x)})})(_,f);let g=n(_,a);if(d&&(g.vs=[d,g.vs,h].flat(!0),r.predecessors(d).length)){let p=r.node(r.predecessors(d)[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},Kf}function wL(){if(Xk)return Xf;Xk=1;let t=eo().Graph,e=Lt();return Xf=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),c=n.parent(a);(l.rank===o||l.minRank<=o&&o<=l.maxRank)&&(i.setNode(a),i.setParent(a,c||s),n[r](a).forEach(d=>{let h=d.v===a?d.w:d.v,f=i.edge(h,a),m=f!==void 0?f.weight:0;i.setEdge(h,a,{weight:n.edge(d).weight+m})}),Object.hasOwn(l,"minRank")&&i.setNode(a,{borderLeft:l.borderLeft[o],borderRight:l.borderRight[o]}))}),i},Xf}function vL(){if(e3)return Zf;e3=1;let t=function(){if(Vk)return Yf;Vk=1;let d=Lt();return Yf=function(h){let f={},m=h.nodes().filter(y=>!h.children(y).length),_=m.map(y=>h.node(y).rank),g=d.applyWithChunking(Math.max,_),p=d.range(g+1).map(()=>[]);function b(y){if(f[y])return;f[y]=!0;let x=h.node(y);p[x.rank].push(y),h.successors(y).forEach(b)}return m.sort((y,x)=>h.node(y).rank-h.node(x).rank).forEach(b),p},Yf}(),e=function(){if($k)return Jf;$k=1;let d=Lt().zipObject;function h(f,m,_){let g=d(_,_.map((S,k)=>k)),p=m.flatMap(S=>f.outEdges(S).map(k=>({pos:g[k.w],weight:f.edge(k).weight})).sort((k,E)=>k.pos-E.pos)),b=1;for(;b<_.length;)b<<=1;let y=2*b-1;b-=1;let x=new Array(y).fill(0),v=0;return p.forEach(S=>{let k=S.pos+b;x[k]+=S.weight;let E=0;for(;k>0;)k%2&&(E+=x[k+1]),k=k-1>>1,x[k]+=S.weight;v+=S.weight*E}),v}return Jf=function(f,m){let _=0;for(let g=1;g<m.length;++g)_+=h(f,m[g-1],m[g]);return _},Jf}(),n=xL(),o=wL(),r=(Qk||(Qk=1,Zk=function(d,h,f){let m,_={};f.forEach(g=>{let p,b,y=d.parent(g);for(;y;){if(p=d.parent(y),p?(b=_[p],_[p]=y):(b=m,m=y),b&&b!==y)return void h.setEdge(b,y);y=p}})}),Zk),s=eo().Graph,i=Lt();function a(d,h,f){return h.map(function(m){return o(d,m,f)})}function l(d,h){let f=new s;d.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 c(d,h){Object.values(h).forEach(f=>f.forEach((m,_)=>d.node(m).order=_))}return Zf=function d(h,f){if(f&&typeof f.customOrder=="function")return void f.customOrder(h,d);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(c(h,p),f&&f.disableOptimalOrderHeuristic)return;let b,y=Number.POSITIVE_INFINITY;for(let x=0,v=0;v<4;++x,++v){l(x%2?_:g,x%4>=2),p=i.buildLayerMatrix(h);let S=e(h,p);S<y&&(v=0,b=Object.assign({},p),y=S)}c(h,b)},Zf}function kL(){if(t3)return Qf;t3=1;let t=eo().Graph,e=Lt();function n(h,f){let m={};return f.length&&f.reduce(function(_,g){let p=0,b=0,y=_.length,x=g[g.length-1];return g.forEach((v,S)=>{let k=function(N,I){if(N.node(I).dummy)return N.predecessors(I).find(T=>N.node(T).dummy)}(h,v),E=k?h.node(k).order:y;(k||v===x)&&(g.slice(b,S+1).forEach(N=>{h.predecessors(N).forEach(I=>{let T=h.node(I),M=T.order;!(M<p||E<M)||T.dummy&&h.node(N).dummy||r(m,I,N)})}),b=S+1,p=E)}),g}),m}function o(h,f){let m={};function _(g,p,b,y,x){let v;e.range(p,b).forEach(S=>{v=g[S],h.node(v).dummy&&h.predecessors(v).forEach(k=>{let E=h.node(k);E.dummy&&(E.order<y||E.order>x)&&r(m,k,v)})})}return f.length&&f.reduce(function(g,p){let b,y=-1,x=0;return p.forEach((v,S)=>{if(h.node(v).dummy==="border"){let k=h.predecessors(v);k.length&&(b=h.node(k[0]).order,_(p,x,S,y,b),x=S,y=b)}_(p,x,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(y=>{y.forEach((x,v)=>{g[x]=x,p[x]=x,b[x]=v})}),f.forEach(y=>{let x=-1;y.forEach(v=>{let S=_(v);if(S.length){S=S.sort((E,N)=>b[E]-b[N]);let k=(S.length-1)/2;for(let E=Math.floor(k),N=Math.ceil(k);E<=N;++E){let I=S[E];p[v]===v&&x<b[I]&&!s(m,v,I)&&(p[I]=v,p[v]=g[v]=g[I],x=b[I])}}})}),{root:g,align:p}}function a(h,f,m,_,g){let p={},b=function(v,S,k,E){let N=new t,I=v.graph(),T=function(M,D,z){return(O,F,B)=>{let V,L=O.node(F),C=O.node(B),$=0;if($+=L.width/2,Object.hasOwn(L,"labelpos"))switch(L.labelpos.toLowerCase()){case"l":V=-L.width/2;break;case"r":V=L.width/2}if(V&&($+=z?V:-V),V=0,$+=(L.dummy?D:M)/2,$+=(C.dummy?D:M)/2,$+=C.width/2,Object.hasOwn(C,"labelpos"))switch(C.labelpos.toLowerCase()){case"l":V=C.width/2;break;case"r":V=-C.width/2}return V&&($+=z?V:-V),V=0,$}}(I.nodesep,I.edgesep,E);return S.forEach(M=>{let D;M.forEach(z=>{let O=k[z];if(N.setNode(O),D){var F=k[D],B=N.edge(F,O);N.setEdge(F,O,Math.max(T(v,z,D),B||0))}D=z})}),N}(h,f,m,g),y=g?"borderLeft":"borderRight";function x(v,S){let k=b.nodes(),E=k.pop(),N={};for(;E;)N[E]?v(E):(N[E]=!0,k.push(E),k=k.concat(S(E))),E=k.pop()}return x(function(v){p[v]=b.inEdges(v).reduce((S,k)=>Math.max(S,p[k.v]+b.edge(k)),0)},b.predecessors.bind(b)),x(function(v){let S=b.outEdges(v).reduce((E,N)=>Math.min(E,p[N.w]-b.edge(N)),Number.POSITIVE_INFINITY),k=h.node(v);S!==Number.POSITIVE_INFINITY&&k.borderType!==y&&(p[v]=Math.max(p[v],S))},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(([y,x])=>{let v=function(S,k){return S.node(k).width}(h,y)/2;g=Math.max(x+v,g),p=Math.min(x-v,p)});const b=g-p;return b<m[0]&&(m=[b,_]),m},[Number.POSITIVE_INFINITY,null])[1]}function c(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 y=p+b,x=h[y];if(x===f)return;let v=Object.values(x),S=_-e.applyWithChunking(Math.min,v);b!=="l"&&(S=g-e.applyWithChunking(Math.max,v)),S&&(h[y]=e.mapValues(x,k=>k+S))})})}function d(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(y=>{y==="r"&&(f=f.map(k=>Object.values(k).reverse()));let x=(b==="u"?h.predecessors:h.successors).bind(h),v=i(h,f,_,x),S=a(h,f,v.root,v.align,y==="r");y==="r"&&(S=e.mapValues(S,k=>-k)),g[b+y]=S})});let p=l(h,g);return c(g,p),d(g,h.graph().align)},findType1Conflicts:n,findType2Conflicts:o,addConflict:r,hasConflict:s,verticalAlignment:i,horizontalCompaction:a,alignCoordinates:c,findSmallestWidthAlignment:l,balance:d},Qf}function SL(){if(n3)return em;n3=1;let t=Lt(),e=kL().positionX;return em=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((c,d)=>{const h=o.node(d).height;return c>h?c:h},0);a.forEach(c=>o.node(c).y=i+l/2),i+=l+s})}(n),Object.entries(e(n)).forEach(([o,r])=>n.node(o).x=r)},em}function CL(){if(o3)return tm;o3=1;let t=hL(),e=fL(),n=pL(),o=Lt().normalizeRanks,r=gL(),s=Lt().removeEmptyRanks,i=_L(),a=function(){if(Bk)return qf;Bk=1;let E=Lt();function N(I,T,M,D,z,O){let F={width:0,height:0,rank:O,borderType:T},B=z[T][O-1],V=E.addDummyNode(I,"border",F,M);z[T][O]=V,I.setParent(V,D),B&&I.setEdge(B,V,{weight:1})}return qf=function(I){I.children().forEach(function T(M){let D=I.children(M),z=I.node(M);if(D.length&&D.forEach(T),Object.hasOwn(z,"minRank")){z.borderLeft=[],z.borderRight=[];for(let O=z.minRank,F=z.maxRank+1;O<F;++O)N(I,"borderLeft","_bl",M,z,O),N(I,"borderRight","_br",M,z,O)}})},qf}(),l=bL(),c=vL(),d=SL(),h=Lt(),f=eo().Graph;tm=function(E,N){let I=N&&N.debugTiming?h.time:h.notime;I("layout",()=>{let T=I(" buildLayoutGraph",()=>function(M){let D=new f({multigraph:!0,compound:!0}),z=k(M.graph());return D.setGraph(Object.assign({},_,S(z,m),h.pick(z,g))),M.nodes().forEach(O=>{const F=S(k(M.node(O)),p);Object.keys(b).forEach(B=>{F[B]===void 0&&(F[B]=b[B])}),D.setNode(O,F),D.setParent(O,M.parent(O))}),M.edges().forEach(O=>{let F=k(M.edge(O));D.setEdge(O,Object.assign({},x,S(F,y),h.pick(F,v)))}),D}(E));I(" runLayout",()=>function(M,D,z){D(" makeSpaceForEdgeLabels",()=>function(O){let F=O.graph();F.ranksep/=2,O.edges().forEach(B=>{let V=O.edge(B);V.minlen*=2,V.labelpos.toLowerCase()!=="c"&&(F.rankdir==="TB"||F.rankdir==="BT"?V.width+=V.labeloffset:V.height+=V.labeloffset)})}(M)),D(" removeSelfEdges",()=>function(O){O.edges().forEach(F=>{if(F.v===F.w){var B=O.node(F.v);B.selfEdges||(B.selfEdges=[]),B.selfEdges.push({e:F,label:O.edge(F)}),O.removeEdge(F)}})}(M)),D(" acyclic",()=>t.run(M)),D(" nestingGraph.run",()=>i.run(M)),D(" rank",()=>n(h.asNonCompoundGraph(M))),D(" injectEdgeLabelProxies",()=>function(O){O.edges().forEach(F=>{let B=O.edge(F);if(B.width&&B.height){let V=O.node(F.v),L={rank:(O.node(F.w).rank-V.rank)/2+V.rank,e:F};h.addDummyNode(O,"edge-proxy",L,"_ep")}})}(M)),D(" removeEmptyRanks",()=>s(M)),D(" nestingGraph.cleanup",()=>i.cleanup(M)),D(" normalizeRanks",()=>o(M)),D(" assignRankMinMax",()=>function(O){let F=0;O.nodes().forEach(B=>{let V=O.node(B);V.borderTop&&(V.minRank=O.node(V.borderTop).rank,V.maxRank=O.node(V.borderBottom).rank,F=Math.max(F,V.maxRank))}),O.graph().maxRank=F}(M)),D(" removeEdgeLabelProxies",()=>function(O){O.nodes().forEach(F=>{let B=O.node(F);B.dummy==="edge-proxy"&&(O.edge(B.e).labelRank=B.rank,O.removeNode(F))})}(M)),D(" normalize.run",()=>e.run(M)),D(" parentDummyChains",()=>r(M)),D(" addBorderSegments",()=>a(M)),D(" order",()=>c(M,z)),D(" insertSelfEdges",()=>function(O){var F=h.buildLayerMatrix(O);F.forEach(B=>{var V=0;B.forEach((L,C)=>{var $=O.node(L);$.order=C+V,($.selfEdges||[]).forEach(j=>{h.addDummyNode(O,"selfedge",{width:j.label.width,height:j.label.height,rank:$.rank,order:C+ ++V,e:j.e,label:j.label},"_se")}),delete $.selfEdges})})}(M)),D(" adjustCoordinateSystem",()=>l.adjust(M)),D(" position",()=>d(M)),D(" positionSelfEdges",()=>function(O){O.nodes().forEach(F=>{var B=O.node(F);if(B.dummy==="selfedge"){var V=O.node(B.e.v),L=V.x+V.width/2,C=V.y,$=B.x-L,j=V.height/2;O.setEdge(B.e,B.label),O.removeNode(F),B.label.points=[{x:L+2*$/3,y:C-j},{x:L+5*$/6,y:C-j},{x:L+$,y:C},{x:L+5*$/6,y:C+j},{x:L+2*$/3,y:C+j}],B.label.x=B.x,B.label.y=B.y}})}(M)),D(" removeBorderNodes",()=>function(O){O.nodes().forEach(F=>{if(O.children(F).length){let B=O.node(F),V=O.node(B.borderTop),L=O.node(B.borderBottom),C=O.node(B.borderLeft[B.borderLeft.length-1]),$=O.node(B.borderRight[B.borderRight.length-1]);B.width=Math.abs($.x-C.x),B.height=Math.abs(L.y-V.y),B.x=C.x+B.width/2,B.y=V.y+B.height/2}}),O.nodes().forEach(F=>{O.node(F).dummy==="border"&&O.removeNode(F)})}(M)),D(" normalize.undo",()=>e.undo(M)),D(" fixupEdgeLabelCoords",()=>function(O){O.edges().forEach(F=>{let B=O.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}})}(M)),D(" undoCoordinateSystem",()=>l.undo(M)),D(" translateGraph",()=>function(O){let F=Number.POSITIVE_INFINITY,B=0,V=Number.POSITIVE_INFINITY,L=0,C=O.graph(),$=C.marginx||0,j=C.marginy||0;function W(K){let Z=K.x,q=K.y,te=K.width,re=K.height;F=Math.min(F,Z-te/2),B=Math.max(B,Z+te/2),V=Math.min(V,q-re/2),L=Math.max(L,q+re/2)}O.nodes().forEach(K=>W(O.node(K))),O.edges().forEach(K=>{let Z=O.edge(K);Object.hasOwn(Z,"x")&&W(Z)}),F-=$,V-=j,O.nodes().forEach(K=>{let Z=O.node(K);Z.x-=F,Z.y-=V}),O.edges().forEach(K=>{let Z=O.edge(K);Z.points.forEach(q=>{q.x-=F,q.y-=V}),Object.hasOwn(Z,"x")&&(Z.x-=F),Object.hasOwn(Z,"y")&&(Z.y-=V)}),C.width=B-F+$,C.height=L-V+j}(M)),D(" assignNodeIntersects",()=>function(O){O.edges().forEach(F=>{let B,V,L=O.edge(F),C=O.node(F.v),$=O.node(F.w);L.points?(B=L.points[0],V=L.points[L.points.length-1]):(L.points=[],B=$,V=C),L.points.unshift(h.intersectRect(C,B)),L.points.push(h.intersectRect($,V))})}(M)),D(" reversePoints",()=>function(O){O.edges().forEach(F=>{let B=O.edge(F);B.reversed&&B.points.reverse()})}(M)),D(" acyclic.undo",()=>t.undo(M))}(T,I,N)),I(" updateInputGraph",()=>function(M,D){M.nodes().forEach(z=>{let O=M.node(z),F=D.node(z);O&&(O.x=F.x,O.y=F.y,O.rank=F.rank,D.children(z).length&&(O.width=F.width,O.height=F.height))}),M.edges().forEach(z=>{let O=M.edge(z),F=D.edge(z);O.points=F.points,Object.hasOwn(F,"x")&&(O.x=F.x,O.y=F.y)}),M.graph().width=D.graph().width,M.graph().height=D.graph().height}(E,T))})};let m=["nodesep","edgesep","ranksep","marginx","marginy"],_={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},g=["acyclicer","ranker","rankdir","align"],p=["width","height"],b={width:0,height:0},y=["minlen","weight","width","height","labeloffset"],x={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},v=["labelpos"];function S(E,N){return h.mapValues(h.pick(E,N),Number)}function k(E){var N={};return E&&Object.entries(E).forEach(([I,T])=>{typeof I=="string"&&(I=I.toLowerCase()),N[I]=T}),N}return tm}function NL(){if(r3)return nm;r3=1;let t=Lt(),e=eo().Graph;return nm={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,c)=>(r.setEdge(l,c,{style:"invis"}),c))}),r}},nm}var p3=l3?a3:(l3=1,a3={graphlib:eo(),layout:CL(),debug:NL(),util:{time:Lt().time,notime:Lt().notime},version:i3?s3:(i3=1,s3="1.1.4")});const na=new p3.graphlib.Graph().setDefaultEdgeLabel(()=>({})),g3=(t,e,n)=>(na.setGraph({rankdir:n.direction,nodesep:150,ranksep:200,ranker:"longest-path"}),e.forEach(o=>na.setEdge(o.source,o.target)),t.forEach(o=>na.setNode(o.id,{...o,width:o.width??0,height:o.height??0})),p3.layout(na),{nodes:t.map(o=>{const{x:r,y:s}=na.node(o.id);return{...o,position:{x:r,y:s}}}),edges:e}),_3=new class{createEdge(t,e){return{animated:!0,markerEnd:{type:ys.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:bf(dt.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:c,usedBy:d}=l;for(const h of c)for(const f of d){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,c]of Qm.zip(t,e)){o||r.push(this.createNode(l,c));const d=i.has(l),h=dt.get(c).code.trim().startsWith("mo.md");!d&&h||r.push(this.createNode(l,c))}return{nodes:r,edges:s}}},jL=t=>{const e=J.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 C=_3.createElements(n,r,o,a.hidePureMarkdown);return C=g3(C.nodes,C.edges,{direction:i}),C},e[0]=r,e[1]=n,e[2]=i,e[3]=a.hidePureMarkdown,e[4]=o,e[5]=l):l=e[5];const[c]=A.useState(l),[d,h,f]=J2(c.nodes),[m,_,g]=K2(c.edges),p=Qi();let b;e[6]!==i||e[7]!==_||e[8]!==h?(b=C=>{const $=g3(C.nodes,C.edges,{direction:i});h($.nodes),_($.edges)},e[6]=i,e[7]=_,e[8]=h,e[9]=b):b=e[9];const y=et(b);let x,v;e[10]!==r||e[11]!==n||e[12]!==a.hidePureMarkdown||e[13]!==y||e[14]!==o?(x=()=>{y(_3.createElements(n,r,o,a.hidePureMarkdown))},v=[n,o,r,y,a.hidePureMarkdown],e[10]=r,e[11]=n,e[12]=a.hidePureMarkdown,e[13]=y,e[14]=o,e[15]=x,e[16]=v):(x=e[15],v=e[16]),A.useEffect(x,v);const[S,k]=A.useState();let E;ok(),e[17]===Symbol.for("react.memo_cache_sentinel")?(E=()=>{k(void 0)},e[17]=E):E=e[17];const N=E;let I,T,M,D,z,O,F,B,V,L;return e[18]===Symbol.for("react.memo_cache_sentinel")?(I={minZoom:.5,maxZoom:1.5},T=(C,$)=>{k({type:"node",id:$.id})},M=(C,$)=>{const{source:j,target:W}=$;k({type:"edge",source:j,target:W})},e[18]=I,e[19]=T,e[20]=M):(I=e[18],T=e[19],M=e[20]),e[21]===Symbol.for("react.memo_cache_sentinel")?(D=u.jsx(GP,{color:"#ccc",variant:$n.Dots}),e[21]=D):D=e[21],e[22]!==p||e[23]!==d?(z=()=>{const C=dt.get(QV);if(C){const $=d.find(j=>j.id===C);$&&(p.fitView({padding:1,duration:600,nodes:[$]}),k({type:"node",id:C}))}},e[22]=p,e[23]=d,e[24]=z):z=e[24],e[25]===Symbol.for("react.memo_cache_sentinel")?(O=u.jsx(Fp,{className:"size-4"}),e[25]=O):O=e[25],e[26]!==z?(F=u.jsx(UP,{position:"bottom-right",showInteractive:!1,children:u.jsx(Te,{content:"Jump to focused cell",delayDuration:200,side:"left",asChild:!1,children:u.jsx(js,{onMouseDown:Hn.preventFocus,onClick:z,children:O})})}),e[26]=z,e[27]=F):F=e[27],e[28]!==m||e[29]!==S||e[30]!==o?(B=u.jsx(rc,{selection:S,variables:o,edges:m,onClearSelection:N}),e[28]=m,e[29]=S,e[30]=o,e[31]=B):B=e[31],e[32]!==s||e[33]!==m||e[34]!==d||e[35]!==g||e[36]!==f||e[37]!==F||e[38]!==B?(V=u.jsxs(_f,{nodes:d,edges:m,nodeTypes:tk,minZoom:.2,fitViewOptions:I,onNodeClick:T,onEdgeClick:M,onNodeDoubleClick:EL,fitView:!0,onNodesChange:f,onEdgesChange:g,zoomOnDoubleClick:!1,nodesConnectable:!1,children:[D,F,B,s]}),e[32]=s,e[33]=m,e[34]=d,e[35]=g,e[36]=f,e[37]=F,e[38]=B,e[39]=V):V=e[39],e[40]!==i||e[41]!==V?(L=u.jsx(Q2,{value:i,children:V}),e[40]=i,e[41]=V,e[42]=L):L=e[42],L};function EL(t,e){_S(e.id,"focus")}const IL=en("_minimap_"),AL=en({hidePureMarkdown:!0}),TL=t=>{const e=J.c(11),[n,o]=an(IL),[r,s]=an(AL);let i;e[0]!==n||e[1]!==t||e[2]!==o||e[3]!==s||e[4]!==r?(i=()=>n==="_minimap_"?u.jsx(ZP,{...t,children:u.jsx(xf,{settings:r,onSettingsChange:s,view:n,onChange:o})}):u.jsx(jL,{...t,settings:r,layoutDirection:n,children:u.jsx(xf,{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,c;return e[6]!==a?(l=a(),e[6]=a,e[7]=l):l=e[7],e[8]!==n||e[9]!==l?(c=u.jsx(gf,{children:l},n),e[8]=n,e[9]=l,e[10]=c):c=e[10],c},ML=()=>{const t=J.c(5),e=bS(),n=Kc(),[o]=e$();let r,s;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=Ie("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=u.jsx("div",{className:r,children:u.jsx(TL,{cellAtoms:o,variables:e,cellIds:n.inOrderIds})}),t[1]=n.inOrderIds,t[2]=o,t[3]=e,t[4]=s):s=t[4],s},OL=t=>{const e=J.c(4),{isOpen:n,children:o}=t,[r,s]=Y.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]),Y.useEffect(i,a),r?o:null},DL=t=>{const e=J.c(8),{variableName:n,className:o}=t;let r;e[0]!==n?(r=()=>{const l=function(d){const h=dt.get(yS)[d];if(h)return h.declaredBy[0]}(n);if(!l)return;const c=hc(l);c&&tp(c,n)},e[0]=n,e[1]=r):r=e[1];const s=r;let i,a;return e[2]!==o?(i=Ie("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=u.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},RL=en(t=>{const e=t(t$),n=t(yS),o=t(dS);return Na(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})}),PL=en(t=>{const e=new Map(t(n$));for(const n of xS){const o=e.get(n);o&&o.databases.length===0&&e.delete(n)}return Na([...e.values()],n=>xS.has(n.name)?1:0)}),LL=()=>{const t=J.c(32),[e,n]=Y.useState(""),o=Qt(wS),r=$e(RL),s=$e(PL);if(r.length===0&&s.length===0){let b;return t[0]===Symbol.for("react.memo_cache_sentinel")?(b=u.jsx(vn,{title:"No tables found",description:"Any datasets/dataframes in the global scope will be shown here.",action:u.jsx(Fg,{children:u.jsxs(Me,{variant:"outline",size:"sm",children:["Add database or catalog",u.jsx(pr,{className:"h-4 w-4 ml-2"})]})}),icon:u.jsx(dr,{})}),t[0]=b):b=t[0],b}const i=!!e.trim();let a,l,c,d,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=u.jsx(aa,{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?(c=i&&u.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:u.jsx(oo,{className:"h-4 w-4"})}),t[6]=i,t[7]=c):c=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(d=u.jsx(Fg,{children:u.jsx("button",{type:"button",className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:u.jsx(pr,{className:"h-4 w-4"})})}),t[8]=d):d=t[8],t[9]!==l||t[10]!==c?(h=u.jsxs("div",{className:"flex items-center w-full",children:[l,c,d]}),t[9]=l,t[10]=c,t[11]=h):h=t[11],t[12]!==s||t[13]!==i||t[14]!==e){let b;t[16]!==i||t[17]!==e?(b=y=>u.jsx(FL,{connection:y,hasChildren:y.databases.length>0,children:y.databases.map(x=>u.jsx(zL,{engineName:y.name,database:x,hasSearch:i,children:u.jsx(BL,{schemas:x.schemas,defaultSchema:y.default_schema,defaultDatabase:y.default_database,engineName:y.name,databaseName:x.name,hasSearch:i,searchValue:e})},x.name))},y.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&&u.jsxs(vS,{children:[u.jsx(pc,{className:"h-4 w-4 text-muted-foreground"}),u.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&&u.jsx(b3,{tables:r,searchValue:e}),t[22]=e,t[23]=r,t[24]=_):_=t[24],t[25]!==f||t[26]!==m||t[27]!==_?(g=u.jsxs(Vm,{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=u.jsxs(Ic,{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},FL=t=>{const e=J.c(25),{connection:n,children:o,hasChildren:r}=t,s=n.name===o$,i=s?"In-Memory":n.name,[a,l]=Y.useState(!1);let c;e[0]!==n.name?(c=async()=>{l(!0),await s$({engine:n.name}),setTimeout(()=>l(!1),500)},e[0]=n.name,e[1]=c):c=e[1];const d=c;let h,f,m;e[2]!==n.dialect?(h=u.jsx(p4,{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=r$(n.dialect),e[4]=n.dialect,e[5]=f):f=e[5],e[6]!==f?(m=u.jsx("span",{className:"text-xs",children:f}),e[6]=f,e[7]=m):m=e[7];const _=i;let g,p,b,y,x;return e[8]!==_?(g=u.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",u.jsx(DL,{variableName:_}),")"]}),e[8]=_,e[9]=g):g=e[9],e[10]!==d||e[11]!==s||e[12]!==a?(p=!s&&u.jsx(Te,{content:"Refresh connection",children:u.jsx(Me,{variant:"ghost",size:"icon",className:"ml-auto hover:bg-transparent hover:shadow-none",onClick:d,children:u.jsx(Bc,{className:Ie("h-4 w-4 text-muted-foreground hover:text-foreground",a&&"animate-[spin_0.5s]")})})}),e[10]=d,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=u.jsxs(vS,{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?(y=r?o:u.jsx(Xc,{content:"No databases available",className:"pl-2"}),e[19]=o,e[20]=r,e[21]=y):y=e[21],e[22]!==b||e[23]!==y?(x=u.jsxs(u.Fragment,{children:[b,y]}),e[22]=b,e[23]=y,e[24]=x):x=e[24],x},zL=t=>{const e=J.c(28),{hasSearch:n,engineName:o,database:r,children:s}=t,[i,a]=Y.useState(!1),[l,c]=Y.useState(!1);let d,h,f;e[0]!==n?(d=()=>{a(n)},h=[n],e[0]=n,e[1]=d,e[2]=h):(d=e[1],h=e[2]),Y.useEffect(d,h),e[3]!==i||e[4]!==l?(f=()=>{a(!i),c(!l)},e[3]=i,e[4]=l,e[5]=f):f=e[5];const m=`${o}:${r.name}`;let _;e[6]!==i?(_=u.jsx(jS,{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=Ie("h-4 w-4",g),e[8]=g,e[9]=p):p=e[9],e[10]!==p?(b=u.jsx(dr,{className:p}),e[10]=p,e[11]=b):b=e[11];const y=l&&i&&"font-semibold";let x,v,S,k;e[12]!==y?(x=Ie(y),e[12]=y,e[13]=x):x=e[13],e[14]!==r.name?(v=r.name===""?u.jsx("i",{children:"Not connected"}):r.name,e[14]=r.name,e[15]=v):v=e[15],e[16]!==x||e[17]!==v?(S=u.jsx("span",{className:x,children:v}),e[16]=x,e[17]=v,e[18]=S):S=e[18],e[19]!==S||e[20]!==f||e[21]!==m||e[22]!==_||e[23]!==b?(k=u.jsxs(go,{className:"text-sm flex flex-row gap-1 items-center cursor-pointer rounded-none",onSelect:f,value:m,children:[_,b,S]}),e[19]=S,e[20]=f,e[21]=m,e[22]=_,e[23]=b,e[24]=k):k=e[24];const E=i&&s;let N;return e[25]!==k||e[26]!==E?(N=u.jsxs(u.Fragment,{children:[k,E]}),e[25]=k,e[26]=E,e[27]=N):N=e[27],N},BL=t=>{const e=J.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=u.jsx(Xc,{content:"No schemas available",className:"pl-6"}),e[0]=h):h=e[0],h}let c,d;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=_=>u.jsx(UL,{databaseName:i,schema:_,hasSearch:a,children:u.jsx(b3,{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],c=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]=c}else c=e[8];return e[18]!==c?(d=u.jsx(u.Fragment,{children:c}),e[18]=c,e[19]=d):d=e[19],d},UL=t=>{const e=J.c(26),{databaseName:n,schema:o,children:r,hasSearch:s}=t,[i,a]=Y.useState(!1),[l,c]=Y.useState(!1),d=`${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]),Y.useEffect(h,f),NS(o.name))return r;e[3]!==i||e[4]!==l?(m=()=>{a(!i),c(!l)},e[3]=i,e[4]=l,e[5]=m):m=e[5],e[6]!==i?(_=u.jsx(jS,{isExpanded:i}),e[6]=i,e[7]=_):_=e[7];const g=l&&i&&"text-foreground";let p,b;e[8]!==g?(p=Ie("h-4 w-4 text-muted-foreground",g),e[8]=g,e[9]=p):p=e[9],e[10]!==p?(b=u.jsx(h$,{className:p}),e[10]=p,e[11]=b):b=e[11];const y=l&&i&&"font-semibold";let x,v,S;e[12]!==y?(x=Ie(y),e[12]=y,e[13]=x):x=e[13],e[14]!==o.name||e[15]!==x?(v=u.jsx("span",{className:x,children:o.name}),e[14]=o.name,e[15]=x,e[16]=v):v=e[16],e[17]!==v||e[18]!==m||e[19]!==_||e[20]!==b||e[21]!==d?(S=u.jsxs(go,{className:"text-sm flex flex-row gap-1 items-center pl-5 cursor-pointer rounded-none",onSelect:m,value:d,children:[_,b,v]}),e[17]=v,e[18]=m,e[19]=_,e[20]=b,e[21]=d,e[22]=S):S=e[22];const k=i&&r;let E;return e[23]!==S||e[24]!==k?(E=u.jsxs(u.Fragment,{children:[S,k]}),e[23]=S,e[24]=k,e[25]=E):E=e[25],E},b3=t=>{const e=J.c(24),{tables:n,sqlTableContext:o,searchValue:r}=t,{addTableList:s}=kS(),[i,a]=Y.useState(!1),[l,c]=Y.useState(!1);let d,h;e[0]!==s||e[1]!==o||e[2]!==n.length||e[3]!==i?(d=async()=>{if(n.length===0&&o&&!i){a(!0),c(!0);const{engine:p,database:b,schema:y}=o,x=await OH.request({engine:p,database:b,schema:y});if(!(x!=null&&x.tables))throw c(!1),new Error("No tables available");s({tables:x.tables,sqlTableContext:o}),c(!1)}},e[0]=s,e[1]=o,e[2]=n.length,e[3]=i,e[4]=d):d=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(d,h);if(f||l){let p;return e[9]===Symbol.for("react.memo_cache_sentinel")?(p=u.jsx(SS,{message:"Loading tables...",className:"pl-12"}),e[9]=p):p=e[9],p}if(m){let p;return e[10]!==m?(p=u.jsx(CS,{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=u.jsx(Xc,{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=x=>!r||x.name.toLowerCase().includes(r.toLowerCase()),e[17]=r,e[18]=p):p=e[18];const b=n.filter(p);let y;e[19]!==r||e[20]!==o?(y=x=>u.jsx(VL,{table:x,sqlTableContext:o,isSearching:!!r},x.name),e[19]=r,e[20]=o,e[21]=y):y=e[21],_=b.map(y),e[13]=r,e[14]=o,e[15]=n,e[16]=_}else _=e[16];return e[22]!==_?(g=u.jsx(u.Fragment,{children:_}),e[22]=_,e[23]=g):g=e[23],g},VL=t=>{const e=J.c(62),{table:n,sqlTableContext:o,isSearching:r}=t,{addTable:s}=kS(),[i,a]=Y.useState(!1),[l,c]=Y.useState(!1),d=n.columns.length>0;let h,f;e[0]!==s||e[1]!==i||e[2]!==o||e[3]!==n.name||e[4]!==d||e[5]!==l?(h=async()=>{if(i&&!d&&o&&!l){c(!0);const{engine:q,database:te,schema:re}=o,ae=await DH.request({engine:q,database:te,schema:re,tableName:n.name});if(!(ae!=null&&ae.table))throw new Error("No table details available");s({table:ae.table,sqlTableContext:o})}},e[0]=s,e[1]=i,e[2]=o,e[3]=n.name,e[4]=d,e[5]=l,e[6]=h):h=e[6],e[7]!==i||e[8]!==d?(f=[i,d],e[7]=i,e[8]=d,e[9]=f):f=e[9];const{isPending:m,error:_}=Gn(h,f),g=$e(Bs),p=Br(),{createNewCell:b}=Ot();let y;e[10]!==g||e[11]!==b||e[12]!==p||e[13]!==o||e[14]!==n?(y=()=>{ur(g,b,p),b({code:(()=>{if(n.source_type==="catalog"){const q=o!=null&&o.database?`${o.database}.${n.name}`:n.name;return`${n.engine}.load_table("${q}")`}if(o)return ES(n,"*",o);switch(n.source_type){case"local":return`mo.ui.table(${n.name})`;case"duckdb":case"connection":return ES(n,"*",o);default:return vc(n.source_type),""}})(),before:!1,cellId:p??"__end__"})},e[10]=g,e[11]=b,e[12]=p,e[13]=o,e[14]=n,e[15]=y):y=e[15];const x=y;let v;e[16]!==n.num_columns||e[17]!==n.num_rows?(v=()=>{const q=[];return n.num_rows!=null&&q.push(`${n.num_rows} rows`),n.num_columns!=null&&q.push(`${n.num_columns} columns`),q.length===0?null:u.jsx("div",{className:"flex flex-row gap-2 items-center pl-6 group-hover:hidden",children:u.jsx("span",{className:"text-xs text-muted-foreground",children:q.join(", ")})})},e[16]=n.num_columns,e[17]=n.num_rows,e[18]=v):v=e[18];const S=v;let k;e[19]!==_||e[20]!==m||e[21]!==o||e[22]!==n?(k=()=>{if(m)return u.jsx(SS,{message:"Loading columns...",className:"pl-12"});if(_)return u.jsx(CS,{error:_,className:"pl-12"});const q=n.columns;return q.length===0?u.jsx(Xc,{content:"No columns found",className:"pl-12"}):q.map(te=>u.jsx($L,{table:n,column:te,sqlTableContext:o},te.name))},e[19]=_,e[20]=m,e[21]=o,e[22]=n,e[23]=k):k=e[23];const E=k;let N;e[24]!==i||e[25]!==r||e[26]!==n.source_type||e[27]!==n.type?(N=()=>{if(n.source_type==="local")return;const q=n.type==="table"?i$:e4;return u.jsx(q,{className:"h-3 w-3",strokeWidth:i||r?2.5:void 0})},e[24]=i,e[25]=r,e[26]=n.source_type,e[27]=n.type,e[28]=N):N=e[28];const I=N,T=o?`${o.database}.${o.schema}.${n.name}`:n.name,M=o&&(NS(o.schema)?"pl-9":"pl-12"),D=(i||r)&&"font-semibold";let z,O,F,B,V,L,C,$,j,W,K,Z;return e[29]!==M||e[30]!==D?(z=Ie("rounded-none group h-8 cursor-pointer",M,D),e[29]=M,e[30]=D,e[31]=z):z=e[31],e[32]!==i?(O=()=>a(!i),e[32]=i,e[33]=O):O=e[33],e[34]!==I?(F=I(),e[34]=I,e[35]=F):F=e[35],e[36]!==n.name?(B=u.jsx("span",{className:"text-sm",children:n.name}),e[36]=n.name,e[37]=B):B=e[37],e[38]!==F||e[39]!==B?(V=u.jsxs("div",{className:"flex gap-2 items-center flex-1",children:[F,B]}),e[38]=F,e[39]=B,e[40]=V):V=e[40],e[41]!==S?(L=S(),e[41]=S,e[42]=L):L=e[42],e[43]!==x?(C=Hn.stopPropagation(()=>x()),e[43]=x,e[44]=C):C=e[44],e[45]===Symbol.for("react.memo_cache_sentinel")?($=u.jsx(a$,{className:"h-3 w-3"}),e[45]=$):$=e[45],e[46]!==C?(j=u.jsx(Te,{content:"Add table to notebook",delayDuration:400,children:u.jsx(Me,{className:"group-hover:inline-flex hidden",variant:"text",size:"icon",onClick:C,children:$})}),e[46]=C,e[47]=j):j=e[47],e[48]!==i||e[49]!==O||e[50]!==V||e[51]!==L||e[52]!==j||e[53]!==z||e[54]!==T?(W=u.jsxs(go,{className:z,value:T,"aria-selected":i,forceMount:!0,onSelect:O,children:[V,L,j]}),e[48]=i,e[49]=O,e[50]=V,e[51]=L,e[52]=j,e[53]=z,e[54]=T,e[55]=W):W=e[55],e[56]!==i||e[57]!==E?(K=i&&E(),e[56]=i,e[57]=E,e[58]=K):K=e[58],e[59]!==W||e[60]!==K?(Z=u.jsxs(u.Fragment,{children:[W,K]}),e[59]=W,e[60]=K,e[61]=Z):Z=e[61],Z},$L=t=>{var K,Z;const e=J.c(53),{table:n,column:o,sqlTableContext:r}=t,[s,i]=Y.useState(!1),a=$e(wS),l=Qt(l$);let c,d;e[0]!==a?(c=()=>{a&&i(!1)},d=[a],e[0]=a,e[1]=c,e[2]=d):(c=e[1],d=e[2]),Y.useEffect(c,d),l(s?q=>new Set([...q,`${n.name}:${o.name}`]):q=>(q.delete(`${n.name}:${o.name}`),new Set(q)));const h=$e(Bs),f=Br(),{createNewCell:m}=Ot(),{columnsPreviews:_}=c$();let g;e[3]!==o.name||e[4]!==n.primary_keys?(g=((K=n.primary_keys)==null?void 0:K.includes(o.name))||!1,e[3]=o.name,e[4]=n.primary_keys,e[5]=g):g=e[5];const p=g;let b;e[6]!==o.name||e[7]!==n.indexes?(b=((Z=n.indexes)==null?void 0:Z.includes(o.name))||!1,e[6]=o.name,e[7]=n.indexes,e[8]=b):b=e[8];const y=b;let x;e[9]!==h||e[10]!==m||e[11]!==f?(x=q=>{q.includes("alt")&&f$(h,m,f),m({code:q,before:!1,cellId:f??"__end__"})},e[9]=h,e[10]=m,e[11]=f,e[12]=x):x=e[12];const v=x,S=HL,k=s?"font-semibold":"";let E;e[13]!==o.name||e[14]!==k?(E=u.jsx("span",{className:k,children:o.name}),e[13]=o.name,e[14]=k,e[15]=E):E=e[15];const N=E,I=`${n.name}.${o.name}`,T=`${n.name}.${o.name}`;let M;e[16]!==s?(M=()=>i(!s),e[16]=s,e[17]=M):M=e[17];const D=r?"pl-14":"pl-7";let z,O,F,B,V,L,C,$,j,W;return e[18]!==D?(z=Ie("flex flex-row gap-2 items-center flex-1",D),e[18]=D,e[19]=z):z=e[19],e[20]!==o.type||e[21]!==N?(O=u.jsx(d$,{columnName:N,dataType:o.type}),e[20]=o.type,e[21]=N,e[22]=O):O=e[22],e[23]!==p?(F=p&&S({tooltipContent:"Primary key",content:"PK"}),e[23]=p,e[24]=F):F=e[24],e[25]!==y?(B=y&&S({tooltipContent:"Indexed",content:"IDX"}),e[25]=y,e[26]=B):B=e[26],e[27]!==z||e[28]!==O||e[29]!==F||e[30]!==B?(V=u.jsxs("div",{className:z,children:[O,F,B]}),e[27]=z,e[28]=O,e[29]=F,e[30]=B,e[31]=V):V=e[31],e[32]!==o.name?(L=u.jsx(Te,{content:"Copy column name",delayDuration:400,children:u.jsx(Me,{variant:"text",size:"icon",className:"group-hover:opacity-100 opacity-0 hover:bg-muted text-muted-foreground hover:text-foreground",children:u.jsx(mS,{tooltip:!1,value:o.name,className:"h-3 w-3"})})}),e[32]=o.name,e[33]=L):L=e[33],e[34]!==o.external_type?(C=u.jsx("span",{className:"text-xs text-muted-foreground",children:o.external_type}),e[34]=o.external_type,e[35]=C):C=e[35],e[36]!==M||e[37]!==V||e[38]!==L||e[39]!==C||e[40]!==I||e[41]!==T?($=u.jsxs(go,{className:"rounded-none py-1 group cursor-pointer",value:T,onSelect:M,children:[V,L,C]},I),e[36]=M,e[37]=V,e[38]=L,e[39]=C,e[40]=I,e[41]=T,e[42]=$):$=e[42],e[43]!==o||e[44]!==_||e[45]!==v||e[46]!==s||e[47]!==r||e[48]!==n?(j=s&&u.jsx("div",{className:"pl-10 pr-2 py-2 bg-[var(--slate-1)] shadow-inner border-b",children:u.jsx(Ac,{children:u.jsx(u$,{table:n,column:o,onAddColumnChart:v,preview:_.get(r?`${r.database}.${r.schema}.${n.name}:${o.name}`:`${n.name}:${o.name}`),sqlTableContext:r})})}),e[43]=o,e[44]=_,e[45]=v,e[46]=s,e[47]=r,e[48]=n,e[49]=j):j=e[49],e[50]!==$||e[51]!==j?(W=u.jsxs(u.Fragment,{children:[$,j]}),e[50]=$,e[51]=j,e[52]=W):W=e[52],W};function HL(t){const{tooltipContent:e,content:n}=t;return u.jsx(Te,{content:e,delayDuration:100,children:u.jsx("span",{className:"text-xs text-black bg-gray-100 dark:invert rounded px-1",children:n})})}const WL=()=>{const t=J.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=u.jsx(LL,{}),t[0]=e):e=t[0],e},qL=()=>{const t=J.c(5),{documentation:e}=$e(m$);if(!e){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=u.jsx(vn,{title:"View docs as you type",description:"Move your text cursor over a symbol to see its documentation.",icon:u.jsx(md,{})}),t[0]=r):r=t[0],r}let n,o;return t[1]!==e?(n=ep({html:e}),t[1]=e,t[2]=n):n=t[2],t[3]!==n?(o=u.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},GL=()=>{const t=J.c(5),e=p$();if(e.length===0){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=u.jsx(vn,{title:"No errors!",icon:u.jsx(Wp,{})}),t[0]=r):r=t[0],r}let n,o;return t[1]!==e?(n=e.map(YL),t[1]=e,t[2]=n):n=t[2],t[3]!==n?(o=u.jsx("div",{className:"flex flex-col overflow-auto",children:n}),t[3]=n,t[4]=o):o=t[4],o};function YL(t){return u.jsxs("div",{children:[u.jsx("div",{className:"text-xs font-mono font-semibold bg-muted border-y px-2 py-1",children:u.jsx(g$,{cellId:t.cellId})}),u.jsx("div",{className:"px-2",children:u.jsx(_$,{errors:t.output.data,cellId:t.cellId},t.cellId)},t.cellId)]},t.cellId)}function y3(t,e,n){return t[e]?t[e][0]?t[e][0][n]:t[e][n]:e==="contentBoxSize"?t.contentRect[n==="inlineSize"?"width":"height"]:void 0}gp=function(t){t===void 0&&(t={});var e=t.onResize,n=A.useRef(void 0);n.current=e;var o=t.round||Math.round,r=A.useRef(),s=A.useState({width:void 0,height:void 0}),i=s[0],a=s[1],l=A.useRef(!1);A.useEffect(function(){return l.current=!1,function(){l.current=!0}},[]);var c=A.useRef({width:void 0,height:void 0}),d=function(h,f){var m=A.useRef(null),_=A.useRef(null);_.current=f;var g=A.useRef(null);A.useEffect(function(){p()});var p=A.useCallback(function(){var b=g.current,y=_.current,x=b||(y?y instanceof Element?y:y.current:null);m.current&&m.current.element===x&&m.current.subscriber===h||(m.current&&m.current.cleanup&&m.current.cleanup(),m.current={element:x,subscriber:h,cleanup:x?h(x):void 0})},[h]);return A.useEffect(function(){return function(){m.current&&m.current.cleanup&&(m.current.cleanup(),m.current=null)}},[]),A.useCallback(function(b){g.current=b,p()},[p])}(A.useCallback(function(h){return r.current&&r.current.box===t.box&&r.current.round===o||(r.current={box:t.box,round:o,instance:new ResizeObserver(function(f){var m=f[0],_=t.box==="border-box"?"borderBoxSize":t.box==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",g=y3(m,_,"inlineSize"),p=y3(m,_,"blockSize"),b=g?o(g):void 0,y=p?o(p):void 0;if(c.current.width!==b||c.current.height!==y){var x={width:b,height:y};c.current.width=b,c.current.height=y,n.current?n.current(x):l.current||a(x)}})}),r.current.instance.observe(h,{box:t.box}),function(){r.current&&r.current.instance.unobserve(h)}},[t.box,o]),t.ref);return A.useMemo(function(){return{ref:d,width:i.width,height:i.height}},[d,i.width,i.height])};const rm=new Map,JL=({file:t,onOpenNotebook:e})=>{const{theme:n}=zo(),o=$e(ym),[r,s]=A.useState(""),{data:i,isPending:a,error:l,setData:c}=Gn(async()=>{const g=await np({path:t.path}),p=g.contents||"";return s(rm.get(t.path)||p),g},[t.path]),d=async()=>{r!==(i==null?void 0:i.contents)&&await C$({path:t.path,contents:r}).then(g=>{g.success&&(c(p=>({...p,contents:r})),s(r))})},h=A.useRef(r);if(h.current=r,A.useEffect(()=>()=>{if(!(i!=null&&i.contents))return;const g=h.current;g===i.contents?rm.delete(t.path):rm.set(t.path,g)},[t.path,i==null?void 0:i.contents]),l)return u.jsx(Vr,{error:l});if(a||!i)return null;const f=i.mimeType||"text/plain",m=f in sm;if(!i.contents&&!m)return u.jsxs("div",{className:"grid grid-cols-2 gap-2 p-6",children:[u.jsx("div",{className:"font-bold text-muted-foreground",children:"Name"}),u.jsx("div",{children:i.file.name}),u.jsx("div",{className:"font-bold text-muted-foreground",children:"Type"}),u.jsx("div",{children:f})]});const _=u.jsxs("div",{className:"text-xs text-muted-foreground p-1 flex justify-end gap-2 border-b",children:[t.isMarimoFile&&!In()&&u.jsx(Te,{content:"Open notebook",children:u.jsx(wn,{size:"small",onClick:g=>e(g),children:u.jsx(jc,{})})}),u.jsx(Te,{content:"Download",children:u.jsx(wn,{size:"small",onClick:()=>{if(x3(f)){const g=k$(i.contents,f);return void S$(g,i.file.name)}ua(new Blob([i.contents||r],{type:f}),i.file.name)},children:u.jsx(Em,{})})}),!x3(f)&&u.jsxs(u.Fragment,{children:[u.jsx(Te,{content:"Copy contents to clipboard",children:u.jsx(wn,{size:"small",onClick:async()=>{await xn(r)},children:u.jsx(ra,{})})}),u.jsx(Te,{content:pn("global.save"),children:u.jsx(wn,{size:"small",color:r===i.contents?void 0:"green",onClick:d,disabled:r===i.contents,children:u.jsx(Ma,{})})})]})]});return f.startsWith("image/")?u.jsxs(u.Fragment,{children:[_,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(b$,{base64:i.contents,mime:f})})]}):f==="text/csv"&&i.contents?u.jsxs(u.Fragment,{children:[_,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(y$,{contents:i.contents})})]}):f.startsWith("audio/")?u.jsxs(u.Fragment,{children:[_,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(x$,{base64:i.contents,mime:f})})]}):f.startsWith("video/")?u.jsxs(u.Fragment,{children:[_,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(w$,{base64:i.contents,mime:f})})]}):f.startsWith("application/pdf")?u.jsxs(u.Fragment,{children:[_,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(v$,{base64:i.contents,mime:f})})]}):u.jsxs(u.Fragment,{children:[_,u.jsx("div",{className:"flex-1 overflow-auto",children:u.jsx(A.Suspense,{children:u.jsx(ka,{theme:n==="dark"?"dark":"light",language:sm[f]||sm.default,className:"border-b",extensions:[st.lineWrapping,Yn.of([{key:o.getHotkey("global.save").key,stopPropagation:!0,run:()=>r!==i.contents&&(d(),!0)}])],value:r,onChange:s})})})]})},x3=t=>t.startsWith("image/")||t.startsWith("audio/")||t.startsWith("video/")||t.startsWith("application/pdf"),sm={"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"},w3=en(new class{constructor(t){this.callbacks=t,this.delegate=new cp([]),this.rootPath="",this.onChange=An.NOOP,this.path=new Sc("/"),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 cp(n.files),this.rootPath=n.root,this.path=Sc.guessDeliminator(n.root)}catch(n){lt({title:"Failed",description:Y4(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 cp(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:(lt({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:k4,createFileOrFolder:op,deleteFileOrFolder:j$,renameFileOrFolder:N$})),KL=en({});function XL(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 v3(t){const e=J.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:nF,onDropRejected:QL,onDrop:ZL,...o},e[2]=o,e[3]=r):r=e[3],E$(r)}async function ZL(t){for(const e of t){const n=rF(oF(e));let o="";n&&(o=Sc.guessDeliminator(n).dirname(n));const r=(await XL(e)).split(",")[1];await op({path:o,type:"file",name:e.name,contents:r})}await async function(){await dt.get(w3).refreshAll([])}()}function QL(t){lt({title:"File upload failed",description:u.jsx("div",{className:"flex flex-col gap-1",children:t.map(eF)}),variant:"danger"})}function eF(t){return u.jsxs("div",{children:[t.file.name," (",t.errors.map(tF).join(", "),")"]},t.file.name)}function tF(t){return t.message}function nF(t){Dt.error(t),lt({title:"File upload failed",description:t.message,variant:"danger"})}function oF(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 rF(t){if(t)return t.replace(/^\/+/,"")}const k3=Y.createContext(null),sF=t=>{const e=J.c(60),{height:n}=t,o=A.useRef(null),[r]=an(w3);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[0]=s):s=e[0];const[i,a]=A.useState(s),[l,c]=A.useState(null),{openPrompt:d}=qn(),[h,f]=an(KL);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(C=>h[C]))},e[4]=h,e[5]=r,e[6]=b):b=e[6];const y=et(b);let x;e[7]!==d||e[8]!==r?(x=async()=>{d({title:"Folder name",onConfirm:async C=>{r.createFolder(C,null)}})},e[7]=d,e[8]=r,e[9]=x):x=e[9];const v=et(x);let S;e[10]!==d||e[11]!==r?(S=async()=>{d({title:"File name",onConfirm:async C=>{r.createFile(C,null)}})},e[10]=d,e[11]=r,e[12]=S):S=e[12];const k=et(S);let E;e[13]!==f?(E=()=>{var C;(C=o.current)==null||C.closeAll(),f({})},e[13]=f,e[14]=E):E=e[14];const N=et(E);if(g){let C;return e[15]===Symbol.for("react.memo_cache_sentinel")?(C=u.jsx(Kn,{size:"medium",centered:!0}),e[15]=C):C=e[15],C}if(p){let C;return e[16]!==p?(C=u.jsx(Vr,{error:p}),e[16]=p,e[17]=C):C=e[17],C}if(l){let C,$,j,W,K,Z;return e[18]===Symbol.for("react.memo_cache_sentinel")?(C=()=>c(null),e[18]=C):C=e[18],e[19]===Symbol.for("react.memo_cache_sentinel")?($=u.jsx(Me,{onClick:C,"data-testid":"file-explorer-back-button",variant:"text",size:"xs",className:"mb-0",children:u.jsx(Et,{size:16})}),e[19]=$):$=e[19],e[20]!==l.name?(j=u.jsxs("div",{className:"flex items-center pl-1 pr-3 flex-shrink-0 border-b justify-between",children:[$,u.jsx("span",{className:"font-bold",children:l.name})]}),e[20]=l.name,e[21]=j):j=e[21],e[22]!==l.path||e[23]!==r?(W=q=>S3(q,r.relativeFromRoot(l.path)),e[22]=l.path,e[23]=r,e[24]=W):W=e[24],e[25]!==l||e[26]!==W?(K=u.jsx(A.Suspense,{children:u.jsx(JL,{onOpenNotebook:W,file:l})}),e[25]=l,e[26]=W,e[27]=K):K=e[27],e[28]!==j||e[29]!==K?(Z=u.jsxs(u.Fragment,{children:[j,K]}),e[28]=j,e[29]=K,e[30]=Z):Z=e[30],Z}let I;e[31]!==N||e[32]!==k||e[33]!==v||e[34]!==y||e[35]!==r?(I=u.jsx(aF,{onRefresh:y,onCreateFile:k,onCreateFolder:v,onCollapseAll:N,tree:r}),e[31]=N,e[32]=k,e[33]=v,e[34]=y,e[35]=r,e[36]=I):I=e[36];const T=n-33;let M,D,z,O,F,B,V,L;return e[37]!==r?(M=async C=>{const{ids:$}=C;for(const j of $)await r.delete(j)},D=async C=>{const{id:$,name:j}=C;await r.rename($,j)},z=async C=>{const{dragIds:$,parentId:j}=C;await r.move($,j)},e[37]=r,e[38]=M,e[39]=D,e[40]=z):(M=e[38],D=e[39],z=e[40]),e[41]===Symbol.for("react.memo_cache_sentinel")?(O=C=>{const $=C[0];$&&($.data.isDirectory||c($.data))},e[41]=O):O=e[41],e[42]!==h||e[43]!==f||e[44]!==r?(F=async C=>{if(await r.expand(C)){const $=h[C]??!1;f({...h,[C]:!$})}},e[42]=h,e[43]=f,e[44]=r,e[45]=F):F=e[45],e[46]!==i||e[47]!==h||e[48]!==M||e[49]!==D||e[50]!==z||e[51]!==F||e[52]!==T?(B=u.jsx(pH,{width:"100%",ref:o,height:T,className:"h-full",data:i,initialOpenState:h,openByDefault:!1,renderCursor:hF,disableDrop:fF,onDelete:M,onRename:D,onMove:z,onSelect:O,onToggle:F,padding:15,rowHeight:30,indent:iF,overscanCount:1e3,disableMultiSelection:!0,children:dF}),e[46]=i,e[47]=h,e[48]=M,e[49]=D,e[50]=z,e[51]=F,e[52]=T,e[53]=B):B=e[53],e[54]!==B||e[55]!==r?(V=u.jsx(k3,{value:r,children:B}),e[54]=B,e[55]=r,e[56]=V):V=e[56],e[57]!==V||e[58]!==I?(L=u.jsxs(u.Fragment,{children:[I,V]}),e[57]=V,e[58]=I,e[59]=L):L=e[59],L},iF=15,aF=t=>{const e=J.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}=v3(i);let c,d,h,f,m,_,g,p,b,y,x,v,S,k,E;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=u.jsx(Aa,{size:16}),e[1]=c):c=e[1],e[2]!==o?(d=u.jsx(Te,{content:"Add file",children:u.jsx(Me,{"data-testid":"file-explorer-add-file-button",onClick:o,variant:"text",size:"xs",children:c})}),e[2]=o,e[3]=d):d=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(h=u.jsx(id,{size:16}),e[4]=h):h=e[4],e[5]!==r?(f=u.jsx(Te,{content:"Add folder",children:u.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")?(_=I$({variant:"text",size:"xs"}),g=u.jsx(T$,{size:16}),e[9]=_,e[10]=g):(_=e[9],g=e[10]),e[11]!==m?(p=u.jsx(Te,{content:"Upload file",children:u.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?(y=u.jsx("input",{...b,type:"file"}),e[15]=b,e[16]=y):y=e[16],e[17]===Symbol.for("react.memo_cache_sentinel")?(x=u.jsx(Q4,{size:16}),e[17]=x):x=e[17],e[18]!==n?(v=u.jsx(Te,{content:"Refresh",children:u.jsx(Me,{"data-testid":"file-explorer-refresh-button",onClick:n,variant:"text",size:"xs",children:x})}),e[18]=n,e[19]=v):v=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(S=u.jsx(Sp,{size:16}),e[20]=S):S=e[20],e[21]!==s?(k=u.jsx(Te,{content:"Collapse all folders",children:u.jsx(Me,{"data-testid":"file-explorer-collapse-button",onClick:s,variant:"text",size:"xs",children:S})}),e[21]=s,e[22]=k):k=e[22],e[23]!==y||e[24]!==v||e[25]!==k||e[26]!==d||e[27]!==f||e[28]!==p?(E=u.jsxs("div",{className:"flex items-center justify-end px-2 flex-shrink-0 border-b",children:[d,f,p,y,v,k]}),e[23]=y,e[24]=v,e[25]=k,e[26]=d,e[27]=f,e[28]=p,e[29]=E):E=e[29],E},lF=t=>{const e=J.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&&!In()&&u.jsxs("span",{className:"flex-shrink-0 ml-2 text-sm hidden group-hover:inline hover:underline",onClick:o,children:["open ",u.jsx(jc,{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=u.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},cF=t=>{const e=J.c(10),{node:n}=t,o=A.useRef(null);let r,s,i,a,l;return e[0]!==n.data.name?(r=()=>{var c,d;(c=o.current)==null||c.focus(),(d=o.current)==null||d.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]),A.useEffect(r,s),e[3]!==n?(i=()=>n.reset(),a=c=>{c.key==="Escape"&&n.reset(),c.key==="Enter"&&n.submit(c.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=u.jsx("input",{ref:o,className:"flex-1 bg-transparent border border-border text-muted-foreground",defaultValue:n.data.name,onClick:mF,onBlur:i,onKeyDown:a}),e[6]=n.data.name,e[7]=i,e[8]=a,e[9]=l):l=e[9],l},dF=({node:t,style:e,dragHandle:n})=>{const o=t.data.isDirectory?"directory":w4(t.data.name),r=v4[o],{openConfirm:s,openPrompt:i}=qn(),{createNewCell:a}=Ot(),l=Br(),c=A.use(k3),d=async g=>{S3(g,c?c.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:u.jsx(g4,{onClick:async()=>{await t.tree.delete(t.id)},"aria-label":"Confirm",children:"Delete"})})},f=et(async()=>{t.open(),i({title:"Folder name",onConfirm:async g=>{c==null||c.createFolder(g,t.id)}})}),m=et(async()=>{t.open(),i({title:"File name",onConfirm:async g=>{c==null||c.createFile(g,t.id)}})}),_=et(async()=>{var y;if(!c||t.data.isDirectory)return;const[g,p]=A$(t.data.name),b=`${g}_copy${p}`;try{const x=await np({path:t.data.path}),v=((y=t.parent)==null?void 0:y.data.path)||"";await op({path:v,type:"file",name:b,contents:x.contents?btoa(x.contents):void 0}),await c.refreshAll([v])}catch{lt({title:"Failed to duplicate file",description:"Unable to create a duplicate of the file",variant:"danger"})}});return u.jsxs("div",{style:e,ref:n,className:Ie("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:[u.jsx(uF,{node:t}),u.jsxs("span",{className:Ie("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?u.jsx("img",{src:"./favicon.ico",className:"w-5 h-5 flex-shrink-0 mr-2 filter grayscale",alt:"Marimo"}):u.jsx(r,{className:"w-5 h-5 flex-shrink-0 mr-2",strokeWidth:1.5}),t.isEditing?u.jsx(cF,{node:t}):u.jsx(lF,{node:t,onOpenMarimoFile:d}),u.jsxs(Hs,{modal:!1,children:[u.jsx(Ws,{asChild:!0,tabIndex:-1,onClick:g=>g.stopPropagation(),children:u.jsx(Me,{"data-testid":"file-explorer-more-button",variant:"text",tabIndex:-1,size:"xs",className:"mb-0","aria-label":"More options",children:u.jsx(sd,{strokeWidth:2,className:"w-5 h-5 hidden group-hover:block"})})}),(()=>{const g={size:14,strokeWidth:1.5,className:"mr-2"};return u.jsxs(qs,{align:"end",className:"no-print w-[220px]",onClick:p=>p.stopPropagation(),onCloseAutoFocus:p=>p.preventDefault(),children:[!t.data.isDirectory&&u.jsxs(Gt,{onSelect:()=>t.select(),children:[u.jsx(ig,{...g}),"Open file"]}),!t.data.isDirectory&&!In()&&u.jsxs(Gt,{onSelect:()=>{M$({path:t.data.path})},children:[u.jsx(jc,{...g}),"Open file in external editor"]}),t.data.isDirectory&&u.jsxs(u.Fragment,{children:[u.jsxs(Gt,{onSelect:()=>m(),children:[u.jsx(Aa,{...g}),"Create file"]}),u.jsxs(Gt,{onSelect:()=>f(),children:[u.jsx(id,{...g}),"Create folder"]}),u.jsx(_o,{})]}),u.jsxs(Gt,{onSelect:()=>t.edit(),children:[u.jsx(qp,{...g}),"Rename"]}),!t.data.isDirectory&&u.jsxs(Gt,{onSelect:_,children:[u.jsx(ra,{...g}),"Duplicate"]}),u.jsxs(Gt,{onSelect:async()=>{await xn(t.data.path),lt({title:"Copied to clipboard"})},children:[u.jsx(cd,{...g}),"Copy path"]}),c&&u.jsxs(Gt,{onSelect:async()=>{await xn(c.relativeFromRoot(t.data.path)),lt({title:"Copied to clipboard"})},children:[u.jsx(cd,{...g}),"Copy relative path"]}),u.jsx(_o,{}),u.jsxs(Gt,{onSelect:()=>{const{path:p}=t.data;(b=>{a({code:b,before:!1,cellId:l??"__end__"})})(IS[o](p))},children:[u.jsx(Wr,{...g}),"Insert snippet for reading file"]}),u.jsxs(Gt,{onSelect:async()=>{lt({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=IS[o](p);await xn(b)},children:[u.jsx(O$,{...g}),"Copy snippet for reading file"]}),t.data.isMarimoFile&&!In()&&u.jsxs(u.Fragment,{children:[u.jsx(_o,{}),u.jsxs(Gt,{onSelect:d,children:[u.jsx(tg,{...g}),"Open notebook"]})]}),u.jsx(_o,{}),!t.data.isDirectory&&u.jsxs(u.Fragment,{children:[u.jsxs(Gt,{onSelect:async()=>{const p=(await np({path:t.data.path})).contents||"";ua(new Blob([p]),t.data.name)},children:[u.jsx(Em,{...g}),"Download"]}),u.jsx(_o,{})]}),u.jsxs(Gt,{onSelect:h,variant:"danger",children:[u.jsx(bm,{...g}),"Delete"]})]})})()]})]})]})},uF=t=>{const e=J.c(3),{node:n}=t;if(!n.data.isDirectory){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=u.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?u.jsx(Vs,{className:"w-5 h-5 flex-shrink-0"}):u.jsx(ia,{className:"w-5 h-5 flex-shrink-0"}),e[1]=n.isOpen,e[2]=o):o=e[2],o};function S3(t,e){t.stopPropagation(),t.preventDefault(),window.open(`/?file=${e}`,"_blank")}function hF(){return null}function fF(t){const{parentNode:e}=t;return!e.data.isDirectory}function mF(t){return t.stopPropagation()}let C3,N3,j3;C3=()=>{const t=J.c(20),{ref:e,height:n}=gp(),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}=v3(r);let l,c,d,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")?(c=Ie("flex flex-col flex-1 overflow-hidden relative"),t[3]=c):c=t[3],t[4]!==i?(d=i(),t[4]=i,t[5]=d):d=t[5],t[6]!==d?(h=u.jsx("input",{...d}),t[6]=d,t[7]=h):h=t[7],t[8]!==a?(f=a&&u.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=u.jsx(sF,{height:o}),t[10]=o,t[11]=m):m=t[11],t[12]!==e||t[13]!==m?(_=u.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=u.jsxs("div",{...l,className:c,children:[h,f,_]}),t[15]=l,t[16]=h,t[17]=f,t[18]=_,t[19]=g):g=t[19],g},pp=t=>{const e=J.c(6),n=t.dataTestId;let o,r;return e[0]!==t.className?(o=Ie("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=u.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},N3=()=>{const t=J.c(9),e=D$(),{clearLogs:n}=Ot();if(e.length===0){let i,a;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=u.jsx("code",{className:"border rounded px-1",children:"stdout"}),t[0]=i):i=t[0],t[1]===Symbol.for("react.memo_cache_sentinel")?(a=u.jsx(vn,{title:"No logs",description:u.jsxs("span",{children:[i," and"," ",u.jsx("code",{className:"border rounded px-1",children:"stderr"})," logs will appear here."]}),icon:u.jsx(mm,{})}),t[1]=a):a=t[1],a}let o,r,s;return t[2]!==n?(o=u.jsx("div",{className:"flex flex-row justify-end px-2 py-1",children:u.jsx(pp,{dataTestId:"clear-logs-button",onClick:n})}),t[2]=n,t[3]=o):o=t[3],t[4]!==e?(r=u.jsx("div",{className:"overflow-auto flex-1",children:u.jsx(j3,{logs:e,className:"min-w-[300px]"})}),t[4]=e,t[5]=r):r=t[5],t[6]!==o||t[7]!==r?(s=u.jsxs(u.Fragment,{children:[o,r]}),t[6]=o,t[7]=r,t[8]=s):s=t[8],s},j3=t=>{const e=J.c(10),{logs:n,className:o}=t;let r,s,i,a,l;return e[0]!==o?(r=Ie("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(_F),e[3]=n,e[4]=i):i=e[4],e[5]!==i?(a=u.jsx("pre",{className:"grid text-xs font-mono gap-1 whitespace-break-spaces font-semibold align-left",children:u.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=u.jsx("div",{className:r,children:a}),e[7]=r,e[8]=a,e[9]=l):l=e[9],l};function pF(t){const e=R$(t.timestamp),n=gF[t.level],o=t.level.toUpperCase();return u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"flex-shrink-0 text-[var(--gray-10)] dark:text-[var(--gray-11)]",children:["[",e,"]"]}),u.jsx("span",{className:Ie("flex-shrink-0",n),children:o}),u.jsxs("span",{className:"flex-shrink-0 text-[var(--gray-10)]",children:["(",u.jsx(gr,{cellId:t.cellId}),")"]}),t.message]})}const gF={stdout:"text-[var(--grass-9)]",stderr:"text-[var(--red-9)]"};function _F(t,e){return u.jsxs("div",{className:"contents group",children:[u.jsx("span",{className:Ie("opacity-70 group-hover:bg-[var(--gray-3)] group-hover:opacity-100","text-right col-span-1 py-1 pr-1"),children:e+1}),u.jsx("span",{className:Ie("opacity-70 group-hover:bg-[var(--gray-3)] group-hover:opacity-100","px-2 flex gap-x-1.5 py-1 flex-wrap"),children:pF(t)})]},e)}const bF=()=>{const t=J.c(7),{items:e}=$e(P$);let n,o;t[0]!==e?(o=RH(e),t[0]=e,t[1]=o):o=t[1],n=o;const r=n,{activeHeaderId:s,activeOccurrences:i}=PH(r);if(e.length===0){let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=u.jsx(vn,{title:"No outline",description:"Add markdown headings to your notebook to create an outline.",icon:u.jsx(fd,{})}),t[2]=l):l=t[2],l}let a;return t[3]!==s||t[4]!==i||t[5]!==e?(a=u.jsx(LH,{items:e,activeHeaderId:s,activeOccurrences:i}),t[3]=s,t[4]=i,t[5]=e,t[6]=a):a=t[6],a},E3=(t,e)=>{lt(e?{title:"Failed to add package",description:e,variant:"danger"}:{title:"Package added",description:u.jsxs("div",{children:[u.jsxs("div",{children:["The package ",u.jsx(ba,{className:"inline",children:t})," and its dependencies has been added to your environment."]}),u.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Some Python packages may require a kernel restart to see changes."})]})})},I3=(t,e)=>{lt(e?{title:"Failed to upgrade package",description:e,variant:"danger"}:{title:"Package upgraded",description:u.jsxs("div",{children:[u.jsxs("div",{children:["The package ",u.jsx(ba,{className:"inline",children:t})," has been upgraded."]}),u.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Some Python packages may require a kernel restart to see changes."})]})})},A3=(t,e)=>{lt(e?{title:"Failed to remove package",description:e,variant:"danger"}:{title:"Package removed",description:u.jsxs("div",{children:[u.jsxs("div",{children:["The package ",u.jsx(ba,{className:"inline",children:t})," has been removed from your environment."]}),u.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Some Python packages may require a kernel restart to see changes."})]})})},T3=t=>{const e=J.c(9),{onClick:n,loading:o,children:r,className:s}=t;if(o){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=u.jsx(Kn,{size:"small",className:"h-4 w-4 shrink-0 opacity-50"}),e[0]=c):c=e[0],c}let i,a,l;return e[1]!==s?(i=Ie("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=u.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},yF=()=>{var v,S;const t=J.c(27),[e]=$s(),n=e.package_management.manager,[o,r]=Y.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:c}=Gn(kF,s);if(c){let k;return t[2]===Symbol.for("react.memo_cache_sentinel")?(k=u.jsx(Kn,{size:"medium",centered:!0}),t[2]=k):k=t[2],k}if(a){let k;return t[3]!==a?(k=u.jsx(Vr,{error:a}),t[3]=a,t[4]=k):k=t[4],k}const d=i.tree!=null;let h;t[5]!==d||t[6]!==o?(h=function(k,E){return k==="list"?"list":E?k||"tree":"list"}(o,d),t[5]=d,t[6]=o,t[7]=h):h=t[7];const f=h,m=(v=i.tree)==null?void 0:v.name,_=(S=i==null?void 0:i.tree)==null?void 0:S.version,g=m==="<root>";let p,b,y,x;return t[8]!==n||t[9]!==l?(p=u.jsx(xF,{packageManager:n,onSuccess:l}),t[8]=n,t[9]=l,t[10]=p):p=t[10],t[11]!==g||t[12]!==d||t[13]!==m||t[14]!==_||t[15]!==f?(b=d&&u.jsxs("div",{className:"flex items-center justify-between px-2 py-1 border-b",children:[u.jsxs("div",{className:"flex gap-1",children:[u.jsx("button",{type:"button",className:Ie("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"}),u.jsx("button",{type:"button",className:Ie("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"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.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&&u.jsxs("span",{className:"text-xs text-muted-foreground",children:[m,_&&` v${_}`]})]})]}),t[11]=g,t[12]=d,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?(y=f==="list"?u.jsx(wF,{packages:i.list,onSuccess:l}):u.jsx(vF,{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]=y):y=t[22],t[23]!==p||t[24]!==b||t[25]!==y?(x=u.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[p,b,y]}),t[23]=p,t[24]=b,t[25]=y,t[26]=x):x=t[26],x},xF=({onSuccess:t,packageManager:e})=>{const[n,o]=Y.useState(""),[r,s]=Y.useState(!1),{handleClick:i}=Ca(),a=$e(AS),l=Qt(AS);Y.useEffect(()=>{a&&(o(a),l(null))},[a,l]);const c=async()=>{try{s(!0);const d=n.split(",").map(h=>h.trim());for(const[h,f]of d.entries()){const m=await MS({package:f});m.success?E3(f):E3(f,m.error),h<d.length-1&&await new Promise(_=>setTimeout(_,1e3))}t()}finally{o(""),s(!1)}};return u.jsxs("div",{className:"flex items-center w-full border-b",children:[u.jsx(TS,{placeholder:`Install packages with ${e}...`,id:B1,icon:r?u.jsx(Kn,{size:"small",className:"mr-2 h-4 w-4 shrink-0 opacity-50"}):u.jsx(Te,{content:"Change package manager",children:u.jsx(si,{onClick:()=>i("packageManagement"),className:"mr-2 h-4 w-4 shrink-0 opacity-50 hover:opacity-80 cursor-pointer"})}),rootClassName:"flex-1 border-none",value:n,onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),c())},onChange:d=>o(d.target.value)}),u.jsx(Te,{delayDuration:300,side:"left",align:"start",content:u.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:",u.jsxs("div",{className:"flex flex-col gap-2 mt-2",children:[u.jsxs("div",{children:[u.jsx("span",{className:"font-bold tracking-wide",children:"Package name:"})," A package name; this will install the latest version.",u.jsx("div",{className:"text-muted-foreground",children:"Example: httpx"})]}),u.jsxs("div",{children:[u.jsx("span",{className:"font-bold tracking-wide",children:"Package and version:"})," ","A package with a specific version or version range.",u.jsx("div",{className:"text-muted-foreground",children:"Examples: httpx==0.27.0, httpx>=0.27.0"})]}),u.jsxs("div",{children:[u.jsx("span",{className:"font-bold tracking-wide",children:"Git:"})," A Git repository",u.jsx("div",{className:"text-muted-foreground",children:"Example: git+https://github.com/encode/httpx"})]}),u.jsxs("div",{children:[u.jsx("span",{className:"font-bold tracking-wide",children:"URL:"})," A remote wheel or source distribution.",u.jsx("div",{className:"text-muted-foreground",children:"Example: https://example.com/httpx-0.27.0.tar.gz"})]}),u.jsxs("div",{children:[u.jsx("span",{className:"font-bold tracking-wide",children:"Path:"})," A local wheel, source distribution, or project directory.",u.jsx("div",{className:"text-muted-foreground",children:"Example: /example/foo-0.1.0-py3-none-any.whl"})]})]})]}),children:u.jsx(Xm,{className:"h-4 w-4 cursor-help text-muted-foreground hover:text-foreground bg-transparent"})}),u.jsx("button",{type:"button",className:Ie("float-right px-2 m-0 h-full text-sm text-secondary-foreground ml-2",n&&"bg-accent text-accent-foreground","disabled:cursor-not-allowed disabled:opacity-50"),onClick:c,disabled:!n,children:"Add"})]})},wF=t=>{const e=J.c(9),{onSuccess:n,packages:o}=t;if(o.length===0){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=u.jsx(vn,{title:"No packages",description:"No packages are installed in this environment.",icon:u.jsx(si,{})}),e[0]=a):a=e[0],a}let r,s,i;if(e[1]===Symbol.for("react.memo_cache_sentinel")?(r=u.jsx(rp,{children:u.jsxs(ri,{children:[u.jsx($r,{children:"Name"}),u.jsx($r,{children:"Version"}),u.jsx($r,{})]})}),e[1]=r):r=e[1],e[2]!==n||e[3]!==o){let a;e[5]!==n?(a=l=>u.jsxs(ri,{className:"group",onClick:async()=>{await xn(`${l.name}==${l.version}`),lt({title:"Copied to clipboard"})},children:[u.jsx(Hr,{children:l.name}),u.jsx(Hr,{children:l.version}),u.jsxs(Hr,{className:"flex justify-end",children:[u.jsx(M3,{packageName:l.name,onSuccess:n}),u.jsx(O3,{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=u.jsxs(sp,{className:"overflow-auto flex-1",children:[r,u.jsx(ip,{children:s})]}),e[7]=s,e[8]=i):i=e[8],i},M3=({packageName:t,onSuccess:e})=>{const[n,o]=Y.useState(!1);return In()?null:u.jsx(T3,{onClick:async()=>{try{o(!0);const r=await MS({package:t,upgrade:!0});r.success?(e(),I3(t)):I3(t,r.error)}finally{o(!1)}},loading:n,children:"Upgrade"})},O3=({packageName:t,onSuccess:e})=>{const[n,o]=Y.useState(!1);return u.jsx(T3,{onClick:async()=>{try{o(!0);const r=await z$({package:t});r.success?(e(),A3(t)):A3(t,r.error)}finally{o(!1)}},loading:n,children:"Remove"})},vF=t=>{const e=J.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]=Y.useState(s);let l,c,d;if(e[1]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{a(new Set)},e[1]=l):l=e[1],e[2]!==n?(c=[n],e[2]=n,e[3]=c):c=e[3],Y.useEffect(l,c),o){let _;return e[4]!==o?(_=u.jsx(Vr,{error:o}),e[4]=o,e[5]=_):_=e[5],_}if(!n){let _;return e[6]===Symbol.for("react.memo_cache_sentinel")?(_=u.jsx(Kn,{size:"medium",centered:!0}),e[6]=_):_=e[6],_}if(n.dependencies.length===0){let _;return e[7]===Symbol.for("react.memo_cache_sentinel")?(_=u.jsx(vn,{title:"No dependencies",description:"No package dependencies found in this environment.",icon:u.jsx(si,{})}),e[7]=_):_=e[7],_}e[8]===Symbol.for("react.memo_cache_sentinel")?(d=_=>{a(g=>{const p=new Set(g);return p.has(_)?p.delete(_):p.add(_),p})},e[8]=d):d=e[8];const h=d;let f,m;if(e[9]!==i||e[10]!==r||e[11]!==n.dependencies){let _;e[13]!==i||e[14]!==r?(_=(g,p)=>u.jsx("div",{className:"border-b",children:u.jsx(D3,{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=u.jsx("div",{className:"flex-1 overflow-auto",children:u.jsx("div",{children:f})}),e[16]=f,e[17]=m):m=e[17],m},D3=t=>{const e=J.c(57),{nodeId:n,node:o,level:r,isTopLevel:s,expandedNodes:i,onToggle:a,onSuccess:l}=t,c=s!==void 0&&s,d=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=c?0:16+16*r;let _;e[3]!==d||e[4]!==n||e[5]!==a?(_=V=>{V.key!=="Enter"&&V.key!==" "||(V.preventDefault(),d&&a(n))},e[3]=d,e[4]=n,e[5]=a,e[6]=_):_=e[6];const g=_;let p;e[7]!==d||e[8]!==n||e[9]!==a?(p=V=>{V.stopPropagation(),d&&a(n)},e[7]=d,e[8]=n,e[9]=a,e[10]=p):p=e[10];const b=p,y=d&&"select-none",x=c?"px-2 py-0.5":"";let v,S;e[11]!==y||e[12]!==x?(v=Ie("flex items-center group cursor-pointer text-sm whitespace-nowrap","hover:bg-[var(--slate-2)] focus:bg-[var(--slate-2)] focus:outline-none",y,x),e[11]=y,e[12]=x,e[13]=v):v=e[13],e[14]!==m||e[15]!==c?(S=c?{}:{paddingLeft:`${m}px`},e[14]=m,e[15]=c,e[16]=S):S=e[16];const k=d?f:void 0;let E,N,I,T,M,D,z,O,F,B;return e[17]!==d||e[18]!==f?(E=d?f?u.jsx(Vs,{className:"w-4 h-4 mr-2 flex-shrink-0"}):u.jsx(ia,{className:"w-4 h-4 mr-2 flex-shrink-0"}):u.jsx("div",{className:"w-4 mr-2 flex-shrink-0"}),e[17]=d,e[18]=f,e[19]=E):E=e[19],e[20]!==o.name?(N=u.jsx("span",{className:"font-medium truncate",children:o.name}),e[20]=o.name,e[21]=N):N=e[21],e[22]!==o.version?(I=o.version&&u.jsxs("span",{className:"text-muted-foreground text-xs",children:["v",o.version]}),e[22]=o.version,e[23]=I):I=e[23],e[24]!==N||e[25]!==I?(T=u.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0 py-1.5",children:[N,I]}),e[24]=N,e[25]=I,e[26]=T):T=e[26],e[27]!==o.tags?(M=o.tags.map(SF),e[27]=o.tags,e[28]=M):M=e[28],e[29]!==M?(D=u.jsx("div",{className:"flex items-center gap-1 ml-2",children:M}),e[29]=M,e[30]=D):D=e[30],e[31]!==c||e[32]!==o.name||e[33]!==l?(z=c&&u.jsxs("div",{className:"flex gap-1 invisible group-hover:visible",children:[u.jsx(M3,{packageName:o.name,onSuccess:l}),u.jsx(O3,{packageName:o.name,onSuccess:l})]}),e[31]=c,e[32]=o.name,e[33]=l,e[34]=z):z=e[34],e[35]!==b||e[36]!==g||e[37]!==E||e[38]!==T||e[39]!==D||e[40]!==z||e[41]!==v||e[42]!==S||e[43]!==k?(O=u.jsxs("div",{className:v,style:S,onClick:b,onKeyDown:g,tabIndex:0,role:"treeitem","aria-selected":!1,"aria-expanded":k,children:[E,T,D,z]}),e[35]=b,e[36]=g,e[37]=E,e[38]=T,e[39]=D,e[40]=z,e[41]=v,e[42]=S,e[43]=k,e[44]=O):O=e[44],e[45]!==i||e[46]!==d||e[47]!==f||e[48]!==r||e[49]!==o.dependencies||e[50]!==n||e[51]!==l||e[52]!==a?(F=d&&f&&u.jsx("div",{role:"group",children:o.dependencies.map((V,L)=>u.jsx(D3,{nodeId:`${n}-${L}`,node:V,level:r+1,isTopLevel:!1,expandedNodes:i,onToggle:a,onSuccess:l},`${V.name}-${L}`))}),e[45]=i,e[46]=d,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]!==O||e[55]!==F?(B=u.jsxs("div",{children:[O,F]}),e[54]=O,e[55]=F,e[56]=B):B=e[56],B};async function kF(){const[t,e]=await Promise.all([L$(),F$()]);return{list:t.packages,tree:e.tree}}function SF(t,e){return t.kind==="cycle"?u.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"?u.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"?u.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 im=X3("marimo:scratchpadHistory:v1",[]),CF=en(!1),NF=en(null,(t,e,n)=>{if(!(n=n.trim()))return;const o=t(im),r=[n,...o.filter(s=>s!==n)].slice(0,15);e(im,r)}),jF={hide_code:!1,disabled:!1},EF=()=>{const t=J.c(69),e=Tc(),[n]=$s(),{theme:o}=zo(),r=A.useRef(null),s=Br(),{createNewCell:i,updateCellCode:a}=Ot(),l=e.cellRuntime[_r],c=l==null?void 0:l.output,d=l==null?void 0:l.status,h=l==null?void 0:l.consoleOutputs,f=e.cellData[_r],m=(f==null?void 0:f.code)??"",_=Qt(NF),[g,p]=an(CF),b=$e(im);let y;t[0]!==_||t[1]!==m?(y=()=>{OS({code:m}),_(m)},t[0]=_,t[1]=m,t[2]=y):y=t[2];const x=et(y);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 S=et(v);let k;t[7]!==a?(k=()=>{a({cellId:_r,code:"",formattingChange:!1}),OS({code:""});const se=r.current;se&&se.dispatch({changes:{from:0,to:se.state.doc.length,insert:""}})},t[7]=a,t[8]=k):k=t[8];const E=et(k);let N;t[9]!==p||t[10]!==a?(N=se=>{p(!1),a({cellId:_r,code:se,formattingChange:!1});const Ae=r.current;Ae&&Ae.dispatch({changes:{from:0,to:Ae.state.doc.length,insert:se}})},t[9]=p,t[10]=a,t[11]=N):N=t[11];const I=et(N),[T,M]=A.useState();let D;t[12]!==m||t[13]!==h||t[14]!==x||t[15]!==T||t[16]!==c||t[17]!==o||t[18]!==n?(D=()=>u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"overflow-auto flex-shrink-0 max-h-[40%]",children:u.jsx(eh,{theme:o,showPlaceholder:!1,id:_r,code:m,config:jF,status:"idle",serializedEditorState:null,runCell:x,userConfig:n,editorViewRef:r,setEditorView:se=>{r.current=se},hidden:!1,temporarilyShowCode:An.NOOP,languageAdapter:T,setLanguageAdapter:M})}),u.jsx("div",{className:"flex-1 overflow-auto flex-shrink-0",children:u.jsx(qc,{allowExpand:!1,output:c,className:"output-area",cellId:_r,stale:!1,loading:!1})}),u.jsx("div",{className:"overflow-auto flex-shrink-0 max-h-[35%]",children:u.jsx(hp,{consoleOutputs:h,className:"overflow-auto",stale:!1,cellName:Z3,onSubmitDebugger:An.NOOP,cellId:_r,debuggerActive:!1})})]}),t[12]=m,t[13]=h,t[14]=x,t[15]=T,t[16]=c,t[17]=o,t[18]=n,t[19]=D):D=t[19];const z=D;let O;t[20]!==I||t[21]!==b||t[22]!==g||t[23]!==o?(O=()=>g?u.jsx("div",{className:"absolute inset-0 z-100 bg-background p-3 border-none overflow-auto",children:u.jsx("div",{className:"overflow-auto flex flex-col gap-3",children:b.map((se,Ae)=>u.jsx("div",{className:"border rounded-md hover:shadow-sm cursor-pointer hover:border-input overflow-hidden",onClick:()=>I(se),children:u.jsx(A.Suspense,{children:u.jsx(ka,{language:"python",theme:o,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1},value:se.trim(),editable:!1,readOnly:!0})})},Ae))})}):null,t[20]=I,t[21]=b,t[22]=g,t[23]=o,t[24]=O):O=t[24];const F=O;let B,V,L,C,$,j,W,K,Z,q,te;t[25]===Symbol.for("react.memo_cache_sentinel")?(B=zs.create(_r),V=u.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]=V):(B=t[25],V=t[26]),t[27]===Symbol.for("react.memo_cache_sentinel")?(L=pn("cell.run"),t[27]=L):L=t[27],t[28]===Symbol.for("react.memo_cache_sentinel")?(C=u.jsx(ii,{color:"var(--grass-11)",size:16}),t[28]=C):C=t[28],t[29]!==x||t[30]!==g?($=u.jsx(Te,{content:L,children:u.jsx(Me,{"data-testid":"scratchpad-run-button",onClick:x,disabled:g,variant:"text",size:"xs",children:C})}),t[29]=x,t[30]=g,t[31]=$):$=t[31],t[32]===Symbol.for("react.memo_cache_sentinel")?(j=u.jsx(Np,{size:16}),t[32]=j):j=t[32],t[33]!==E||t[34]!==g?(W=u.jsx(Te,{content:"Clear code and outputs",children:u.jsx(Me,{disabled:g,size:"xs",variant:"text",onClick:E,children:j})}),t[33]=E,t[34]=g,t[35]=W):W=t[35],t[36]===Symbol.for("react.memo_cache_sentinel")?(K=u.jsx(Wr,{size:16}),t[36]=K):K=t[36],t[37]!==S||t[38]!==g?(Z=u.jsx(di,{children:u.jsx(Te,{content:"Insert code",children:u.jsx(Me,{disabled:g,size:"xs",variant:"text",onClick:S,children:K})})}),t[37]=S,t[38]=g,t[39]=Z):Z=t[39],t[40]!==d?(q=(d==="running"||d==="queued")&&u.jsx(Kn,{className:"inline",size:"small"}),t[40]=d,t[41]=q):q=t[41],t[42]===Symbol.for("react.memo_cache_sentinel")?(te=u.jsx("div",{className:"flex-1"}),t[42]=te):te=t[42];const re=g&&"bg-[var(--sky-3)] rounded-none";let ae,X;t[43]!==re?(ae=Ie(re),t[43]=re,t[44]=ae):ae=t[44],t[45]!==g||t[46]!==p?(X=()=>p(!g),t[45]=g,t[46]=p,t[47]=X):X=t[47];const ee=b.length===0;let ce,me,ue,pe,de,Ce,Ne;return t[48]===Symbol.for("react.memo_cache_sentinel")?(ce=u.jsx(Op,{size:16}),t[48]=ce):ce=t[48],t[49]!==ae||t[50]!==X||t[51]!==ee?(me=u.jsx(Te,{content:"Toggle history",children:u.jsx(Me,{size:"xs",variant:"text",className:ae,onClick:X,disabled:ee,children:ce})}),t[49]=ae,t[50]=X,t[51]=ee,t[52]=me):me=t[52],t[53]!==$||t[54]!==W||t[55]!==Z||t[56]!==q||t[57]!==me?(ue=u.jsxs("div",{className:"flex items-center flex-shrink-0",children:[$,W,Z,q,te,me]}),t[53]=$,t[54]=W,t[55]=Z,t[56]=q,t[57]=me,t[58]=ue):ue=t[58],t[59]!==z?(pe=z(),t[59]=z,t[60]=pe):pe=t[60],t[61]!==F?(de=F(),t[61]=F,t[62]=de):de=t[62],t[63]!==pe||t[64]!==de?(Ce=u.jsxs("div",{className:"flex-1 divide-y relative overflow-hidden flex flex-col",children:[pe,de]}),t[63]=pe,t[64]=de,t[65]=Ce):Ce=t[65],t[66]!==ue||t[67]!==Ce?(Ne=u.jsxs("div",{className:"flex flex-col h-full overflow-hidden divide-y",id:B,children:[V,ue,Ce]}),t[66]=ue,t[67]=Ce,t[68]=Ne):Ne=t[68],Ne},IF=()=>{const t=J.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=u.jsx(EF,{}),t[0]=e):e=t[0],e},AF=()=>{const t=J.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(MF,o);if(s){let b;return t[1]===Symbol.for("react.memo_cache_sentinel")?(b=u.jsx(Kn,{size:"medium",centered:!0}),t[1]=b):b=t[1],b}if(i){let b;return t[2]!==i?(b=u.jsx(Vr,{error:i}),t[2]=i,t[3]=b):b=t[3],b}let l;t[4]!==r?(l=r.filter(OF).map(DF),t[4]=r,t[5]=l):l=t[5];const c=l;if(r.length===0){let b;return t[6]===Symbol.for("react.memo_cache_sentinel")?(b=u.jsx(vn,{title:"No environment variables",description:"No environment variables are available in this notebook.",icon:u.jsx(ad,{})}),t[6]=b):b=t[6],b}let d,h,f,m,_,g,p;return t[7]!==n||t[8]!==e||t[9]!==c||t[10]!==a?(d=()=>e(u.jsx(Dg,{providerNames:c,onSuccess:()=>{a(),n()},onClose:n})),t[7]=n,t[8]=e,t[9]=c,t[10]=a,t[11]=d):d=t[11],t[12]===Symbol.for("react.memo_cache_sentinel")?(h=u.jsx(pr,{className:"h-4 w-4"}),t[12]=h):h=t[12],t[13]!==d?(f=u.jsx("div",{className:"flex justify-end h-8 border-b",children:u.jsx("button",{type:"button",className:"float-right border-l px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",onClick:d,children:h})}),t[13]=d,t[14]=f):f=t[14],t[15]===Symbol.for("react.memo_cache_sentinel")?(m=u.jsx(rp,{children:u.jsxs(ri,{children:[u.jsx($r,{children:"Environment Variable"}),u.jsx($r,{children:"Source"}),u.jsx($r,{})]})}),t[15]=m):m=t[15],t[16]!==r?(_=r.map(RF),t[16]=r,t[17]=_):_=t[17],t[18]!==_?(g=u.jsxs(sp,{className:"overflow-auto flex-1 mb-16",children:[m,u.jsx(ip,{children:_})]}),t[18]=_,t[19]=g):g=t[19],t[20]!==f||t[21]!==g?(p=u.jsxs("div",{className:"flex flex-col h-full",children:[f,g]}),t[20]=f,t[21]=g,t[22]=p):p=t[22],p},TF=t=>{const e=J.c(9),{className:n,ariaLabel:o,onCopy:r}=t,[s,i]=Y.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 c,d;return e[2]!==s?(c=s?u.jsx(Nc,{className:"w-3 h-3 text-green-700 rounded"}):u.jsx(ra,{className:"w-3 h-3 hover:bg-muted rounded"}),e[2]=s,e[3]=c):c=e[3],e[4]!==o||e[5]!==n||e[6]!==l||e[7]!==c?(d=u.jsx("button",{type:"button",className:n,onClick:l,"aria-label":o,children:c}),e[4]=o,e[5]=n,e[6]=l,e[7]=c,e[8]=d):d=e[8],d};async function MF(){return Og((await WS.request({})).secrets)}function OF(t){return t.provider!=="env"}function DF(t){return t.name}function RF(t){return t.keys.map(e=>u.jsxs(ri,{className:"group",children:[u.jsx(Hr,{children:e}),u.jsx(Hr,{children:t.provider!=="env"&&u.jsx(gS,{variant:"outline",className:"select-none",children:t.name})}),u.jsx(Hr,{children:u.jsx(TF,{ariaLabel:`Copy ${e}`,onCopy:async()=>{await xn(`os.environ["${e}"]`),lt({title:"Copied to clipboard",description:`os.environ["${e}"] has been copied to your clipboard.`})},className:Ie("float-right px-2 h-full text-xs text-muted-foreground hover:text-foreground","invisible group-hover:visible")})})]},`${t.name}-${e}`))}const PF=t=>{const e=J.c(6),{children:n}=t,{openModal:o,closeModal:r}=qn();let s,i;return e[0]!==r||e[1]!==o?(s=()=>o(u.jsx(FF,{onClose:r})),e[0]=r,e[1]=o,e[2]=s):s=e[2],e[3]!==n||e[4]!==s?(i=u.jsx(hS,{onClick:s,children:n}),e[3]=n,e[4]=s,e[5]=i):i=e[5],i},LF=[st.lineWrapping],FF=t=>{const e=J.c(23),{onClose:n}=t,[o,r]=A.useState(""),{theme:s}=zo();let i,a,l,c,d,h;e[0]!==n?(i=async x=>{x.preventDefault();const v=new FormData(x.target),S=v.get("title"),k=v.get("description"),E=v.get("code");fetch("https://marimo.io/api/suggest-snippet",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:S,description:k,code:E})}),n(),lt({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=u.jsx(ar,{children:"Contribute a Snippet"}),e[2]=a):a=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(l=u.jsxs(Ls,{children:[a,u.jsxs(Fs,{children:["Have a useful snippet you want to share with the community? Submit it here or make a pull request"," ",u.jsx("a",{href:no.githubPage,target:"_blank",className:"underline",children:"on GitHub"}),"."]})]}),e[3]=l):l=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(c=u.jsx(lr,{id:"title",name:"title",autoFocus:!0,placeholder:"Title",required:!0,autoComplete:"off"}),d=u.jsx(B$,{id:"description",name:"description",autoFocus:!0,placeholder:"Description",rows:5,required:!0,autoComplete:"off"}),e[4]=c,e[5]=d):(c=e[4],d=e[5]),e[6]!==o?(h=u.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,y;return e[8]!==o||e[9]!==f?(m=u.jsx(ka,{theme:f,language:"python",className:"cm border rounded overflow-hidden",extensions:LF,value:o,onChange:r}),e[8]=o,e[9]=f,e[10]=m):m=e[10],e[11]!==h||e[12]!==m?(_=u.jsxs("div",{className:"flex flex-col gap-6 py-4",children:[c,d,h,m]}),e[11]=h,e[12]=m,e[13]=_):_=e[13],e[14]!==n?(g=u.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=u.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=u.jsxs(oa,{children:[g,p]}),e[17]=g,e[18]=b):b=e[18],e[19]!==i||e[20]!==b||e[21]!==_?(y=u.jsx(cr,{className:"w-fit",children:u.jsxs("form",{onSubmit:i,children:[l,_,b]})}),e[19]=i,e[20]=b,e[21]=_,e[22]=y):y=e[22],y},zF=[st.lineWrapping],BF=()=>{const t=J.c(20),[e,n]=Y.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($F,o);if(s){let b;return t[1]!==s?(b=u.jsx(Vr,{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=u.jsx(Kn,{size:"medium",centered:!0}),t[3]=b):b=t[3],b}const a=e?"h-1/3":"h-full";let l,c,d,h,f,m,_,g,p;return t[4]!==a?(l=Ie("border-b rounded-none",a),t[4]=a,t[5]=l):l=t[5],t[6]===Symbol.for("react.memo_cache_sentinel")?(c=u.jsx(aa,{placeholder:"Search snippets...",className:"h-6 m-1",rootClassName:"flex-1 border-r"}),t[6]=c):c=t[6],t[7]===Symbol.for("react.memo_cache_sentinel")?(d=u.jsxs("div",{className:"flex items-center w-full",children:[c,u.jsx(PF,{children:u.jsx("button",{className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:u.jsx(pr,{className:"h-4 w-4"})})})]}),h=u.jsx(_c,{children:"No results"}),t[7]=d,t[8]=h):(d=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=u.jsx(VF,{onSelect:f,snippets:r.snippets}),t[10]=r.snippets,t[11]=m):m=t[11],t[12]!==l||t[13]!==m?(_=u.jsxs(Ic,{className:l,children:[d,h,m]}),t[12]=l,t[13]=m,t[14]=_):_=t[14],t[15]!==e?(g=u.jsx(A.Suspense,{children:u.jsx("div",{className:"h-2/3 snippet-viewer flex flex-col",children:e?u.jsx(UF,{snippet:e},e.title):u.jsx(vn,{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=u.jsxs("div",{className:"flex-1 overflow-hidden",children:[_,g]}),t[17]=_,t[18]=g,t[19]=p):p=t[19],p},UF=t=>{const e=J.c(27),{snippet:n}=t,{theme:o}=zo(),{createNewCell:r}=Ot(),s=Br();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 c=l;let d,h,f,m,_,g;if(e[7]!==n.title?(d=u.jsx("div",{className:"text-sm font-semibold bg-muted border-y px-2 py-1",children:n.title}),e[7]=n.title,e[8]=d):d=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(h=u.jsx(Wr,{className:"ml-2 h-4 w-4"}),e[9]=h):h=e[9],e[10]!==a?(f=u.jsx("div",{className:"flex justify-end",children:u.jsx(di,{children:u.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]!==c||e[13]!==n.sections||e[14]!==n.title||e[15]!==o){let p;e[17]!==c||e[18]!==n.title||e[19]!==o?(p=b=>{const{code:y,html:x,id:v}=b;return x?u.jsx("div",{children:ep({html:x})},`${n.title}-${v}`):y?u.jsxs("div",{className:"relative hover-actions-parent pr-2",children:[u.jsx(di,{children:u.jsx(Te,{content:"Insert snippet",children:u.jsx(Me,{className:"absolute -top-2 -right-1 z-10 hover-action px-2 bg-background",size:"sm",variant:"outline",onClick:()=>{c(y)},children:u.jsx(Wr,{className:"h-5 w-5"})})})}),u.jsx(A.Suspense,{children:u.jsx(ka,{theme:o==="dark"?"dark":"light",language:"python",className:"cm border rounded overflow-hidden",extensions:zF,value:y,readOnly:!0},`${n.title}-${v}`)})]},`${n.title}-${v}`):null},e[17]=c,e[18]=n.title,e[19]=o,e[20]=p):p=e[20],m=n.sections.map(p),e[12]=c,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?(_=u.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]!==d||e[25]!==_?(g=u.jsxs(u.Fragment,{children:[d,_]}),e[24]=d,e[25]=_,e[26]=g):g=e[26],g},VF=t=>{const e=J.c(7),{snippets:n,onSelect:o}=t;let r,s;if(e[0]!==o||e[1]!==n){let i;e[3]!==o?(i=a=>u.jsx(go,{className:"rounded-none",onSelect:()=>o(a),children:u.jsx("div",{className:"flex flex-row gap-2 items-center",children:u.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=u.jsx(Vm,{className:"flex flex-col overflow-auto",children:r}),e[5]=r,e[6]=s):s=e[6],s};function $F(){return U$()}const HF=Y.lazy(()=>$m(()=>import("./tracing-BQXBWY23.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]),import.meta.url).then(t=>({default:t.Tracing}))),WF=()=>{const t=J.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=u.jsx(Y.Suspense,{fallback:u.jsx(qF,{}),children:u.jsx(HF,{})}),t[0]=e):e=t[0],e},qF=()=>{const t=J.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=u.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:u.jsx(Kn,{})}),t[0]=e):e=t[0],e},R3="name",P3="type-value",am="defs-refs",GF=[{id:R3,accessorFn:t=>[t.name,t.declaredBy],enableSorting:!0,sortingFn:"alphanumeric",header:({column:t})=>u.jsx(ap,{header:"Name",column:t}),cell:({getValue:t})=>{const[e,n]=t();return u.jsx(yf,{name:e,declaredBy:n})}},{id:P3,accessorFn:t=>[t.dataType,t.value],enableSorting:!0,sortingFn:"alphanumeric",header:({column:t})=>u.jsx(ap,{header:u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx("span",{children:"Type"}),u.jsx("span",{children:"Value"})]}),column:t}),cell:({getValue:t})=>{const[e,n]=t();return u.jsxs("div",{className:"max-w-[150px]",children:[u.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap text-muted-foreground font-mono text-xs",children:e}),u.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap",title:n??"",children:n})]})}},{id:am,accessorFn:t=>[t.declaredBy,t.usedBy,t.name,t.declaredByNames,t.usedByNames],enableSorting:!0,sortingFn:"basic",header:({column:t})=>u.jsx(ap,{header:u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx("span",{children:"Declared By"}),u.jsx("span",{children:"Used By"})]}),column:t}),cell:({getValue:t})=>{const[e,n,o]=t(),r=s=>{const i=hc(s);i&&tp(i,o)};return u.jsxs("div",{className:"flex flex-col gap-1 py-1",children:[u.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-center",children:[u.jsx("span",{title:"Declared by",children:u.jsx(Qp,{className:"w-3.5 h-3.5 text-muted-foreground"})}),e.length===1?u.jsx(gr,{variant:"focus",cellId:e[0],skipScroll:!0,onClick:()=>r(e[0])}):u.jsx("div",{className:"text-destructive flex flex-row gap-2",children:e.slice(0,3).map((s,i)=>u.jsxs("span",{className:"flex",children:[u.jsx(gr,{variant:"focus",cellId:s,skipScroll:!0,className:"whitespace-nowrap text-destructive",onClick:()=>r(s)},s),i<e.length-1&&", "]},s))})]}),u.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-baseline",children:[u.jsx("span",{title:"Used by",children:u.jsx(Oa,{className:"w-3.5 h-3.5 text-muted-foreground"})}),u.jsx(nk,{maxCount:3,cellIds:n,skipScroll:!0,onClick:r})]})]})}}],L3=A.memo(({className:t,cellIds:e,variables:n})=>{const[o,r]=Y.useState([]),[s,i]=Y.useState(""),a=V$(),l=A.useMemo(()=>{const h=f=>{const m=a[f];return G$(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]),c=A.useMemo(()=>{const h=new Map;return e.forEach((f,m)=>h.set(f,m)),function(f,m,_){m||(m={id:am,desc:!1});let g=[];switch(m.id){case R3:g=Na(f,p=>p.name);break;case P3:g=Na(f,p=>p.dataType);break;case am:g=Na(f,p=>_.get(p.declaredBy[0]))}return m.desc?g.reverse():g}(l,o[0],h)},[l,o,e]),d=$$({data:c,columns:GF,getCoreRowModel:q$(),onGlobalFilterChange:i,getFilteredRowModel:W$(),enableFilters:!0,enableGlobalFilter:!0,enableColumnPinning:!1,getColumnCanGlobalFilter:h=>h.columnDef.enableGlobalFilter??!0,globalFilterFn:"auto",manualSorting:!0,onSortingChange:r,getSortedRowModel:H$(),state:{sorting:o,globalFilter:s}});return u.jsxs(u.Fragment,{children:[u.jsx(TS,{className:"w-full",placeholder:"Search",value:s,onChange:h=>i(h.target.value)}),u.jsxs(sp,{className:Ie("w-full text-sm flex-1 border-separate border-spacing-0",t),children:[u.jsx(rp,{children:u.jsx(ri,{className:"whitespace-nowrap text-xs",children:d.getFlatHeaders().map(h=>u.jsx($r,{className:"sticky top-0 bg-background border-b",children:DS(h.column.columnDef.header,h.getContext())},h.id))})}),u.jsx(ip,{children:d.getRowModel().rows.map(h=>u.jsx(ri,{className:"hover:bg-accent",children:h.getVisibleCells().map(f=>u.jsx(Hr,{className:"border-b",children:DS(f.column.columnDef.cell,f.getContext())},f.id))},h.id))})]})]})});L3.displayName="VariableTable";const YF=()=>{const t=J.c(4),e=bS(),n=Kc();if(Object.keys(e).length===0){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=u.jsx(vn,{title:"No variables",description:"Global variables will appear here.",icon:u.jsx(dc,{})}),t[0]=r):r=t[0],r}let o;return t[1]!==n.inOrderIds||t[2]!==e?(o=u.jsx(L3,{className:"flex-1",cellIds:n.inOrderIds,variables:e}),t[1]=n.inOrderIds,t[2]=e,t[3]=o):o=t[3],o},JF=Y.lazy(()=>$m(()=>import("./terminal--YvoRK0r.js"),__vite__mapDeps([113,1,2,114]),import.meta.url)),KF=t=>{const e=J.c(121),{children:n}=t,{isSidebarOpen:o,isTerminalOpen:r,selectedPanel:s}=Cc(),{setIsSidebarOpen:i,setIsTerminalOpen:a}=da(),l=Y.useRef(null),c=Y.useRef(null);let d,h,f,m,_;e[0]!==o?(d=()=>{if(!l.current)return;const le=l.current.isCollapsed();o&&le&&l.current.expand(),o||le||l.current.collapse(),requestAnimationFrame(ZF)},h=[o],e[0]=o,e[1]=d,e[2]=h):(d=e[1],h=e[2]),A.useEffect(d,h),e[3]!==r?(f=()=>{if(!c.current)return;const le=c.current.isCollapsed();r&&le&&c.current.expand(),r||le||c.current.collapse(),requestAnimationFrame(ez)},m=[r],e[3]=r,e[4]=f,e[5]=m):(f=e[4],m=e[5]),A.useEffect(f,m),e[6]!==n?(_=u.jsx(Zc,{id:"app",className:"relative h-full",children:u.jsx(A.Suspense,{children:n})},"app"),e[6]=n,e[7]=_):_=e[7];const g=_,p=o?"resize-handle":"resize-handle-collapsed";let b,y;e[8]!==p?(b=Ie("border-border no-print z-10",p,"vertical"),e[8]=p,e[9]=b):b=e[9],e[10]!==b?(y=u.jsx(RS,{onDragging:PS,className:b}),e[10]=b,e[11]=y):y=e[11];const x=y,v=r?"resize-handle":"resize-handle-collapsed";let S,k;e[12]!==v?(S=Ie("border-border no-print z-20",v,"horizontal"),e[12]=v,e[13]=S):S=e[13],e[14]!==S?(k=u.jsx(RS,{onDragging:PS,className:S}),e[14]=S,e[15]=k):k=e[15];const E=k;let N,I,T,M,D,z,O,F,B,V,L,C,$,j,W,K,Z,q,te,re,ae;e[16]!==s?(N=u.jsx("div",{className:"text-sm text-[var(--slate-11)] uppercase tracking-wide font-semibold flex-1",children:s}),e[16]=s,e[17]=N):N=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=u.jsx(oo,{className:"w-4 h-4"}),e[20]=T):T=e[20],e[21]!==I?(M=u.jsx(Me,{"data-testid":"close-helper-pane",className:"m-0",size:"xs",variant:"text",onClick:I,children:T}),e[21]=I,e[22]=M):M=e[22],e[23]!==N||e[24]!==M?(D=u.jsxs("div",{className:"p-3 border-b flex justify-between items-center",children:[N,M]}),e[23]=N,e[24]=M,e[25]=D):D=e[25],e[26]!==s?(z=s==="files"&&u.jsx(C3,{}),e[26]=s,e[27]=z):z=e[27],e[28]!==s?(O=s==="errors"&&u.jsx(GL,{}),e[28]=s,e[29]=O):O=e[29],e[30]!==s?(F=s==="variables"&&u.jsx(YF,{}),e[30]=s,e[31]=F):F=e[31],e[32]!==s?(B=s==="dependencies"&&u.jsx(ML,{}),e[32]=s,e[33]=B):B=e[33],e[34]!==s?(V=s==="packages"&&u.jsx(yF,{}),e[34]=s,e[35]=V):V=e[35],e[36]!==s?(L=s==="outline"&&u.jsx(bF,{}),e[36]=s,e[37]=L):L=e[37],e[38]!==s?(C=s==="datasources"&&u.jsx(WL,{}),e[38]=s,e[39]=C):C=e[39],e[40]!==s?($=s==="documentation"&&u.jsx(qL,{}),e[40]=s,e[41]=$):$=e[41],e[42]!==s?(j=s==="snippets"&&u.jsx(BF,{}),e[42]=s,e[43]=j):j=e[43],e[44]!==s?(W=s==="scratchpad"&&u.jsx(IF,{}),e[44]=s,e[45]=W):W=e[45],e[46]!==s?(K=s==="chat"&&u.jsx(tR,{}),e[46]=s,e[47]=K):K=e[47],e[48]!==s?(Z=s==="logs"&&u.jsx(N3,{}),e[48]=s,e[49]=Z):Z=e[49],e[50]!==s?(q=s==="tracing"&&u.jsx(WF,{}),e[50]=s,e[51]=q):q=e[51],e[52]!==s?(te=s==="secrets"&&u.jsx(AF,{}),e[52]=s,e[53]=te):te=e[53],e[54]!==z||e[55]!==O||e[56]!==F||e[57]!==B||e[58]!==V||e[59]!==L||e[60]!==C||e[61]!==$||e[62]!==j||e[63]!==W||e[64]!==K||e[65]!==Z||e[66]!==q||e[67]!==te?(re=u.jsx(A.Suspense,{children:u.jsxs(Yc,{children:[z,O,F,B,V,L,C,$,j,W,K,Z,q,te]})}),e[54]=z,e[55]=O,e[56]=F,e[57]=B,e[58]=V,e[59]=L,e[60]=C,e[61]=$,e[62]=j,e[63]=W,e[64]=K,e[65]=Z,e[66]=q,e[67]=te,e[68]=re):re=e[68],e[69]!==D||e[70]!==re?(ae=u.jsx(Ac,{children:u.jsxs("div",{className:"flex flex-col h-full flex-1 overflow-hidden mr-[-4px]",children:[D,re]})}),e[69]=D,e[70]=re,e[71]=ae):ae=e[71];const X=ae,ee=o&&"border-r border-l border-[var(--slate-7)]";let ce,me,ue,pe,de,Ce;e[72]!==ee?(ce=Ie("dark:bg-[var(--slate-1)] no-print print:hidden hide-on-fullscreen",ee),e[72]=ee,e[73]=ce):ce=e[73],e[74]===Symbol.for("react.memo_cache_sentinel")?(me=(le,Ve)=>{var Fe;Ve===0&&le===10&&((Fe=l.current)==null||Fe.resize(30))},e[74]=me):me=e[74],e[75]!==i?(ue=()=>i(!1),pe=()=>i(!0),e[75]=i,e[76]=ue,e[77]=pe):(ue=e[76],pe=e[77]),e[78]!==X||e[79]!==x?(de=u.jsxs("span",{className:"flex flex-row h-full",children:[X," ",x]}),e[78]=X,e[79]=x,e[80]=de):de=e[80],e[81]!==ce||e[82]!==ue||e[83]!==pe||e[84]!==de?(Ce=u.jsx(Zc,{ref:l,id:"helper",collapsedSize:0,collapsible:!0,className:ce,minSize:10,defaultSize:0,maxSize:75,onResize:me,onCollapse:ue,onExpand:pe,children:de},"helper"),e[81]=ce,e[82]=ue,e[83]=pe,e[84]=de,e[85]=Ce):Ce=e[85];const Ne=Ce,se=r&&"border-[var(--slate-7)]";let Ae,be,Re,ze,qe,Ze,Pe,Qe,tt;e[86]!==se?(Ae=Ie("dark:bg-[var(--slate-1)] no-print print:hidden hide-on-fullscreen",se),e[86]=se,e[87]=Ae):Ae=e[87],e[88]===Symbol.for("react.memo_cache_sentinel")?(be=(le,Ve)=>{var Fe;Ve===0&&le===10&&((Fe=c.current)==null||Fe.resize(30))},e[88]=be):be=e[88],e[89]!==a?(Re=()=>a(!1),ze=()=>a(!0),e[89]=a,e[90]=Re,e[91]=ze):(Re=e[90],ze=e[91]),e[92]===Symbol.for("react.memo_cache_sentinel")?(qe=u.jsx("div",{}),e[92]=qe):qe=e[92],e[93]!==a?(Ze=()=>a(!1),e[93]=a,e[94]=Ze):Ze=e[94],e[95]!==r||e[96]!==Ze?(Pe=u.jsx(A.Suspense,{fallback:qe,children:u.jsx(JF,{visible:r,onClose:Ze})}),e[95]=r,e[96]=Ze,e[97]=Pe):Pe=e[97],e[98]!==r||e[99]!==Pe?(Qe=u.jsx(OL,{isOpen:r,children:Pe}),e[98]=r,e[99]=Pe,e[100]=Qe):Qe=e[100],e[101]!==Ae||e[102]!==Re||e[103]!==ze||e[104]!==Qe||e[105]!==E?(tt=u.jsxs(Zc,{ref:c,id:"terminal",collapsedSize:0,collapsible:!0,className:Ae,minSize:10,defaultSize:0,maxSize:75,onResize:be,onCollapse:Re,onExpand:ze,children:[E,Qe]},"terminal"),e[101]=Ae,e[102]=Re,e[103]=ze,e[104]=Qe,e[105]=E,e[106]=tt):tt=e[106];const at=tt;let ne,ke,je,Le,G,ge,_e,fe;return e[107]===Symbol.for("react.memo_cache_sentinel")?(ne=FH(),e[107]=ne):ne=e[107],e[108]===Symbol.for("react.memo_cache_sentinel")?(ke=u.jsx(Yc,{children:u.jsx(LO,{})}),e[108]=ke):ke=e[108],e[109]!==at?(je=u.jsx(Jx,{capability:"terminal",children:at}),e[109]=at,e[110]=je):je=e[110],e[111]!==g||e[112]!==je?(Le=u.jsx(Zc,{children:u.jsxs(LS,{autoSaveId:"marimo:chrome:v1:l1",direction:"vertical",children:[g,je]})}),e[111]=g,e[112]=je,e[113]=Le):Le=e[113],e[114]===Symbol.for("react.memo_cache_sentinel")?(G=u.jsx(Y$,{}),e[114]=G):G=e[114],e[115]!==Ne||e[116]!==Le?(ge=u.jsxs(LS,{autoSaveId:"marimo:chrome:v1:l2",direction:"horizontal",storage:ne,children:[ke,Ne,Le,G]}),e[115]=Ne,e[116]=Le,e[117]=ge):ge=e[117],e[118]===Symbol.for("react.memo_cache_sentinel")?(_e=u.jsx(Ac,{children:u.jsx(Yc,{children:u.jsx(MO,{})})}),e[118]=_e):_e=e[118],e[119]!==ge?(fe=u.jsxs(zH,{children:[ge,_e]}),e[119]=ge,e[120]=fe):fe=e[120],fe};function XF(){window.dispatchEvent(new Event("resize"))}function ZF(){requestAnimationFrame(XF)}function QF(){window.dispatchEvent(new Event("resize"))}function ez(){requestAnimationFrame(QF)}let F3;F3=new URL(window.location.href).searchParams.get(J$.showChrome)==="false",eC=Object.freeze(Object.defineProperty({__proto__:null,default:t=>{const e=J.c(10);if(F3){let s,i,a;return e[0]!==t?(s=u.jsx(Yx,{hideControls:!0,...t}),e[0]=t,e[1]=s):s=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(i=u.jsx(fg,{}),e[2]=i):i=e[2],e[3]!==s?(a=u.jsxs(u.Fragment,{children:[s,i]}),e[3]=s,e[4]=a):a=e[4],a}let n,o,r;return e[5]!==t?(n=u.jsx(Yx,{...t}),e[5]=t,e[6]=n):n=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(o=u.jsx(fg,{}),e[7]=o):o=e[7],e[8]!==n?(r=u.jsxs(KF,{children:[n,o]}),e[8]=n,e[9]=r):r=e[9],r}},Symbol.toStringTag,{value:"Module"}))});export{pp as C,ed as E,vn as P,VH as __tla,td as a,eC as e,ja as f,gp as u};
|
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:c,usedBy:d}=l;for(const h of c)for(const f of d){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,c]of Qm.zip(t,e)){o||r.push(this.createNode(l,c));const d=i.has(l),h=dt.get(c).code.trim().startsWith("mo.md");!d&&h||r.push(this.createNode(l,c))}return{nodes:r,edges:s}}},jL=t=>{const e=J.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 C=_3.createElements(n,r,o,a.hidePureMarkdown);return C=g3(C.nodes,C.edges,{direction:i}),C},e[0]=r,e[1]=n,e[2]=i,e[3]=a.hidePureMarkdown,e[4]=o,e[5]=l):l=e[5];const[c]=A.useState(l),[d,h,f]=J2(c.nodes),[m,_,g]=K2(c.edges),p=Qi();let b;e[6]!==i||e[7]!==_||e[8]!==h?(b=C=>{const $=g3(C.nodes,C.edges,{direction:i});h($.nodes),_($.edges)},e[6]=i,e[7]=_,e[8]=h,e[9]=b):b=e[9];const y=et(b);let x,v;e[10]!==r||e[11]!==n||e[12]!==a.hidePureMarkdown||e[13]!==y||e[14]!==o?(x=()=>{y(_3.createElements(n,r,o,a.hidePureMarkdown))},v=[n,o,r,y,a.hidePureMarkdown],e[10]=r,e[11]=n,e[12]=a.hidePureMarkdown,e[13]=y,e[14]=o,e[15]=x,e[16]=v):(x=e[15],v=e[16]),A.useEffect(x,v);const[S,k]=A.useState();let E;ok(),e[17]===Symbol.for("react.memo_cache_sentinel")?(E=()=>{k(void 0)},e[17]=E):E=e[17];const N=E;let I,T,M,D,z,O,F,B,V,L;return e[18]===Symbol.for("react.memo_cache_sentinel")?(I={minZoom:.5,maxZoom:1.5},T=(C,$)=>{k({type:"node",id:$.id})},M=(C,$)=>{const{source:j,target:W}=$;k({type:"edge",source:j,target:W})},e[18]=I,e[19]=T,e[20]=M):(I=e[18],T=e[19],M=e[20]),e[21]===Symbol.for("react.memo_cache_sentinel")?(D=u.jsx(GP,{color:"#ccc",variant:$n.Dots}),e[21]=D):D=e[21],e[22]!==p||e[23]!==d?(z=()=>{const C=dt.get(QV);if(C){const $=d.find(j=>j.id===C);$&&(p.fitView({padding:1,duration:600,nodes:[$]}),k({type:"node",id:C}))}},e[22]=p,e[23]=d,e[24]=z):z=e[24],e[25]===Symbol.for("react.memo_cache_sentinel")?(O=u.jsx(Fp,{className:"size-4"}),e[25]=O):O=e[25],e[26]!==z?(F=u.jsx(UP,{position:"bottom-right",showInteractive:!1,children:u.jsx(Te,{content:"Jump to focused cell",delayDuration:200,side:"left",asChild:!1,children:u.jsx(js,{onMouseDown:Hn.preventFocus,onClick:z,children:O})})}),e[26]=z,e[27]=F):F=e[27],e[28]!==m||e[29]!==S||e[30]!==o?(B=u.jsx(rc,{selection:S,variables:o,edges:m,onClearSelection:N}),e[28]=m,e[29]=S,e[30]=o,e[31]=B):B=e[31],e[32]!==s||e[33]!==m||e[34]!==d||e[35]!==g||e[36]!==f||e[37]!==F||e[38]!==B?(V=u.jsxs(_f,{nodes:d,edges:m,nodeTypes:tk,minZoom:.2,fitViewOptions:I,onNodeClick:T,onEdgeClick:M,onNodeDoubleClick:EL,fitView:!0,onNodesChange:f,onEdgesChange:g,zoomOnDoubleClick:!1,nodesConnectable:!1,children:[D,F,B,s]}),e[32]=s,e[33]=m,e[34]=d,e[35]=g,e[36]=f,e[37]=F,e[38]=B,e[39]=V):V=e[39],e[40]!==i||e[41]!==V?(L=u.jsx(Q2,{value:i,children:V}),e[40]=i,e[41]=V,e[42]=L):L=e[42],L};function EL(t,e){_S(e.id,"focus")}const IL=en("_minimap_"),AL=en({hidePureMarkdown:!0}),TL=t=>{const e=J.c(11),[n,o]=an(IL),[r,s]=an(AL);let i;e[0]!==n||e[1]!==t||e[2]!==o||e[3]!==s||e[4]!==r?(i=()=>n==="_minimap_"?u.jsx(ZP,{...t,children:u.jsx(xf,{settings:r,onSettingsChange:s,view:n,onChange:o})}):u.jsx(jL,{...t,settings:r,layoutDirection:n,children:u.jsx(xf,{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,c;return e[6]!==a?(l=a(),e[6]=a,e[7]=l):l=e[7],e[8]!==n||e[9]!==l?(c=u.jsx(gf,{children:l},n),e[8]=n,e[9]=l,e[10]=c):c=e[10],c},ML=()=>{const t=J.c(5),e=bS(),n=Kc(),[o]=e$();let r,s;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=Ie("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=u.jsx("div",{className:r,children:u.jsx(TL,{cellAtoms:o,variables:e,cellIds:n.inOrderIds})}),t[1]=n.inOrderIds,t[2]=o,t[3]=e,t[4]=s):s=t[4],s},OL=t=>{const e=J.c(4),{isOpen:n,children:o}=t,[r,s]=Y.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]),Y.useEffect(i,a),r?o:null},DL=t=>{const e=J.c(8),{variableName:n,className:o}=t;let r;e[0]!==n?(r=()=>{const l=function(d){const h=dt.get(yS)[d];if(h)return h.declaredBy[0]}(n);if(!l)return;const c=hc(l);c&&tp(c,n)},e[0]=n,e[1]=r):r=e[1];const s=r;let i,a;return e[2]!==o?(i=Ie("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=u.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},RL=en(t=>{const e=t(t$),n=t(yS),o=t(dS);return Na(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})}),PL=en(t=>{const e=new Map(t(n$));for(const n of xS){const o=e.get(n);o&&o.databases.length===0&&e.delete(n)}return Na([...e.values()],n=>xS.has(n.name)?1:0)}),LL=()=>{const t=J.c(32),[e,n]=Y.useState(""),o=Qt(wS),r=$e(RL),s=$e(PL);if(r.length===0&&s.length===0){let b;return t[0]===Symbol.for("react.memo_cache_sentinel")?(b=u.jsx(vn,{title:"No tables found",description:"Any datasets/dataframes in the global scope will be shown here.",action:u.jsx(Fg,{children:u.jsxs(Me,{variant:"outline",size:"sm",children:["Add database or catalog",u.jsx(pr,{className:"h-4 w-4 ml-2"})]})}),icon:u.jsx(dr,{})}),t[0]=b):b=t[0],b}const i=!!e.trim();let a,l,c,d,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=u.jsx(aa,{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?(c=i&&u.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:u.jsx(oo,{className:"h-4 w-4"})}),t[6]=i,t[7]=c):c=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(d=u.jsx(Fg,{children:u.jsx("button",{type:"button",className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:u.jsx(pr,{className:"h-4 w-4"})})}),t[8]=d):d=t[8],t[9]!==l||t[10]!==c?(h=u.jsxs("div",{className:"flex items-center w-full",children:[l,c,d]}),t[9]=l,t[10]=c,t[11]=h):h=t[11],t[12]!==s||t[13]!==i||t[14]!==e){let b;t[16]!==i||t[17]!==e?(b=y=>u.jsx(FL,{connection:y,hasChildren:y.databases.length>0,children:y.databases.map(x=>u.jsx(zL,{engineName:y.name,database:x,hasSearch:i,children:u.jsx(BL,{schemas:x.schemas,defaultSchema:y.default_schema,defaultDatabase:y.default_database,engineName:y.name,databaseName:x.name,hasSearch:i,searchValue:e})},x.name))},y.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&&u.jsxs(vS,{children:[u.jsx(pc,{className:"h-4 w-4 text-muted-foreground"}),u.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&&u.jsx(b3,{tables:r,searchValue:e}),t[22]=e,t[23]=r,t[24]=_):_=t[24],t[25]!==f||t[26]!==m||t[27]!==_?(g=u.jsxs(Vm,{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=u.jsxs(Ic,{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},FL=t=>{const e=J.c(25),{connection:n,children:o,hasChildren:r}=t,s=n.name===o$,i=s?"In-Memory":n.name,[a,l]=Y.useState(!1);let c;e[0]!==n.name?(c=async()=>{l(!0),await s$({engine:n.name}),setTimeout(()=>l(!1),500)},e[0]=n.name,e[1]=c):c=e[1];const d=c;let h,f,m;e[2]!==n.dialect?(h=u.jsx(p4,{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=r$(n.dialect),e[4]=n.dialect,e[5]=f):f=e[5],e[6]!==f?(m=u.jsx("span",{className:"text-xs",children:f}),e[6]=f,e[7]=m):m=e[7];const _=i;let g,p,b,y,x;return e[8]!==_?(g=u.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",u.jsx(DL,{variableName:_}),")"]}),e[8]=_,e[9]=g):g=e[9],e[10]!==d||e[11]!==s||e[12]!==a?(p=!s&&u.jsx(Te,{content:"Refresh connection",children:u.jsx(Me,{variant:"ghost",size:"icon",className:"ml-auto hover:bg-transparent hover:shadow-none",onClick:d,children:u.jsx(Bc,{className:Ie("h-4 w-4 text-muted-foreground hover:text-foreground",a&&"animate-[spin_0.5s]")})})}),e[10]=d,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=u.jsxs(vS,{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?(y=r?o:u.jsx(Xc,{content:"No databases available",className:"pl-2"}),e[19]=o,e[20]=r,e[21]=y):y=e[21],e[22]!==b||e[23]!==y?(x=u.jsxs(u.Fragment,{children:[b,y]}),e[22]=b,e[23]=y,e[24]=x):x=e[24],x},zL=t=>{const e=J.c(28),{hasSearch:n,engineName:o,database:r,children:s}=t,[i,a]=Y.useState(!1),[l,c]=Y.useState(!1);let d,h,f;e[0]!==n?(d=()=>{a(n)},h=[n],e[0]=n,e[1]=d,e[2]=h):(d=e[1],h=e[2]),Y.useEffect(d,h),e[3]!==i||e[4]!==l?(f=()=>{a(!i),c(!l)},e[3]=i,e[4]=l,e[5]=f):f=e[5];const m=`${o}:${r.name}`;let _;e[6]!==i?(_=u.jsx(jS,{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=Ie("h-4 w-4",g),e[8]=g,e[9]=p):p=e[9],e[10]!==p?(b=u.jsx(dr,{className:p}),e[10]=p,e[11]=b):b=e[11];const y=l&&i&&"font-semibold";let x,v,S,k;e[12]!==y?(x=Ie(y),e[12]=y,e[13]=x):x=e[13],e[14]!==r.name?(v=r.name===""?u.jsx("i",{children:"Not connected"}):r.name,e[14]=r.name,e[15]=v):v=e[15],e[16]!==x||e[17]!==v?(S=u.jsx("span",{className:x,children:v}),e[16]=x,e[17]=v,e[18]=S):S=e[18],e[19]!==S||e[20]!==f||e[21]!==m||e[22]!==_||e[23]!==b?(k=u.jsxs(go,{className:"text-sm flex flex-row gap-1 items-center cursor-pointer rounded-none",onSelect:f,value:m,children:[_,b,S]}),e[19]=S,e[20]=f,e[21]=m,e[22]=_,e[23]=b,e[24]=k):k=e[24];const E=i&&s;let N;return e[25]!==k||e[26]!==E?(N=u.jsxs(u.Fragment,{children:[k,E]}),e[25]=k,e[26]=E,e[27]=N):N=e[27],N},BL=t=>{const e=J.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=u.jsx(Xc,{content:"No schemas available",className:"pl-6"}),e[0]=h):h=e[0],h}let c,d;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=_=>u.jsx(UL,{databaseName:i,schema:_,hasSearch:a,children:u.jsx(b3,{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],c=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]=c}else c=e[8];return e[18]!==c?(d=u.jsx(u.Fragment,{children:c}),e[18]=c,e[19]=d):d=e[19],d},UL=t=>{const e=J.c(26),{databaseName:n,schema:o,children:r,hasSearch:s}=t,[i,a]=Y.useState(!1),[l,c]=Y.useState(!1),d=`${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]),Y.useEffect(h,f),NS(o.name))return r;e[3]!==i||e[4]!==l?(m=()=>{a(!i),c(!l)},e[3]=i,e[4]=l,e[5]=m):m=e[5],e[6]!==i?(_=u.jsx(jS,{isExpanded:i}),e[6]=i,e[7]=_):_=e[7];const g=l&&i&&"text-foreground";let p,b;e[8]!==g?(p=Ie("h-4 w-4 text-muted-foreground",g),e[8]=g,e[9]=p):p=e[9],e[10]!==p?(b=u.jsx(h$,{className:p}),e[10]=p,e[11]=b):b=e[11];const y=l&&i&&"font-semibold";let x,v,S;e[12]!==y?(x=Ie(y),e[12]=y,e[13]=x):x=e[13],e[14]!==o.name||e[15]!==x?(v=u.jsx("span",{className:x,children:o.name}),e[14]=o.name,e[15]=x,e[16]=v):v=e[16],e[17]!==v||e[18]!==m||e[19]!==_||e[20]!==b||e[21]!==d?(S=u.jsxs(go,{className:"text-sm flex flex-row gap-1 items-center pl-5 cursor-pointer rounded-none",onSelect:m,value:d,children:[_,b,v]}),e[17]=v,e[18]=m,e[19]=_,e[20]=b,e[21]=d,e[22]=S):S=e[22];const k=i&&r;let E;return e[23]!==S||e[24]!==k?(E=u.jsxs(u.Fragment,{children:[S,k]}),e[23]=S,e[24]=k,e[25]=E):E=e[25],E},b3=t=>{const e=J.c(24),{tables:n,sqlTableContext:o,searchValue:r}=t,{addTableList:s}=kS(),[i,a]=Y.useState(!1),[l,c]=Y.useState(!1);let d,h;e[0]!==s||e[1]!==o||e[2]!==n.length||e[3]!==i?(d=async()=>{if(n.length===0&&o&&!i){a(!0),c(!0);const{engine:p,database:b,schema:y}=o,x=await OH.request({engine:p,database:b,schema:y});if(!(x!=null&&x.tables))throw c(!1),new Error("No tables available");s({tables:x.tables,sqlTableContext:o}),c(!1)}},e[0]=s,e[1]=o,e[2]=n.length,e[3]=i,e[4]=d):d=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(d,h);if(f||l){let p;return e[9]===Symbol.for("react.memo_cache_sentinel")?(p=u.jsx(SS,{message:"Loading tables...",className:"pl-12"}),e[9]=p):p=e[9],p}if(m){let p;return e[10]!==m?(p=u.jsx(CS,{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=u.jsx(Xc,{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=x=>!r||x.name.toLowerCase().includes(r.toLowerCase()),e[17]=r,e[18]=p):p=e[18];const b=n.filter(p);let y;e[19]!==r||e[20]!==o?(y=x=>u.jsx(VL,{table:x,sqlTableContext:o,isSearching:!!r},x.name),e[19]=r,e[20]=o,e[21]=y):y=e[21],_=b.map(y),e[13]=r,e[14]=o,e[15]=n,e[16]=_}else _=e[16];return e[22]!==_?(g=u.jsx(u.Fragment,{children:_}),e[22]=_,e[23]=g):g=e[23],g},VL=t=>{const e=J.c(62),{table:n,sqlTableContext:o,isSearching:r}=t,{addTable:s}=kS(),[i,a]=Y.useState(!1),[l,c]=Y.useState(!1),d=n.columns.length>0;let h,f;e[0]!==s||e[1]!==i||e[2]!==o||e[3]!==n.name||e[4]!==d||e[5]!==l?(h=async()=>{if(i&&!d&&o&&!l){c(!0);const{engine:q,database:te,schema:re}=o,ae=await DH.request({engine:q,database:te,schema:re,tableName:n.name});if(!(ae!=null&&ae.table))throw new Error("No table details available");s({table:ae.table,sqlTableContext:o})}},e[0]=s,e[1]=i,e[2]=o,e[3]=n.name,e[4]=d,e[5]=l,e[6]=h):h=e[6],e[7]!==i||e[8]!==d?(f=[i,d],e[7]=i,e[8]=d,e[9]=f):f=e[9];const{isPending:m,error:_}=Gn(h,f),g=$e(Bs),p=Br(),{createNewCell:b}=Ot();let y;e[10]!==g||e[11]!==b||e[12]!==p||e[13]!==o||e[14]!==n?(y=()=>{ur(g,b,p),b({code:(()=>{if(n.source_type==="catalog"){const q=o!=null&&o.database?`${o.database}.${n.name}`:n.name;return`${n.engine}.load_table("${q}")`}if(o)return ES(n,"*",o);switch(n.source_type){case"local":return`mo.ui.table(${n.name})`;case"duckdb":case"connection":return ES(n,"*",o);default:return vc(n.source_type),""}})(),before:!1,cellId:p??"__end__"})},e[10]=g,e[11]=b,e[12]=p,e[13]=o,e[14]=n,e[15]=y):y=e[15];const x=y;let v;e[16]!==n.num_columns||e[17]!==n.num_rows?(v=()=>{const q=[];return n.num_rows!=null&&q.push(`${n.num_rows} rows`),n.num_columns!=null&&q.push(`${n.num_columns} columns`),q.length===0?null:u.jsx("div",{className:"flex flex-row gap-2 items-center pl-6 group-hover:hidden",children:u.jsx("span",{className:"text-xs text-muted-foreground",children:q.join(", ")})})},e[16]=n.num_columns,e[17]=n.num_rows,e[18]=v):v=e[18];const S=v;let k;e[19]!==_||e[20]!==m||e[21]!==o||e[22]!==n?(k=()=>{if(m)return u.jsx(SS,{message:"Loading columns...",className:"pl-12"});if(_)return u.jsx(CS,{error:_,className:"pl-12"});const q=n.columns;return q.length===0?u.jsx(Xc,{content:"No columns found",className:"pl-12"}):q.map(te=>u.jsx($L,{table:n,column:te,sqlTableContext:o},te.name))},e[19]=_,e[20]=m,e[21]=o,e[22]=n,e[23]=k):k=e[23];const E=k;let N;e[24]!==i||e[25]!==r||e[26]!==n.source_type||e[27]!==n.type?(N=()=>{if(n.source_type==="local")return;const q=n.type==="table"?i$:e4;return u.jsx(q,{className:"h-3 w-3",strokeWidth:i||r?2.5:void 0})},e[24]=i,e[25]=r,e[26]=n.source_type,e[27]=n.type,e[28]=N):N=e[28];const I=N,T=o?`${o.database}.${o.schema}.${n.name}`:n.name,M=o&&(NS(o.schema)?"pl-9":"pl-12"),D=(i||r)&&"font-semibold";let z,O,F,B,V,L,C,$,j,W,K,Z;return e[29]!==M||e[30]!==D?(z=Ie("rounded-none group h-8 cursor-pointer",M,D),e[29]=M,e[30]=D,e[31]=z):z=e[31],e[32]!==i?(O=()=>a(!i),e[32]=i,e[33]=O):O=e[33],e[34]!==I?(F=I(),e[34]=I,e[35]=F):F=e[35],e[36]!==n.name?(B=u.jsx("span",{className:"text-sm",children:n.name}),e[36]=n.name,e[37]=B):B=e[37],e[38]!==F||e[39]!==B?(V=u.jsxs("div",{className:"flex gap-2 items-center flex-1",children:[F,B]}),e[38]=F,e[39]=B,e[40]=V):V=e[40],e[41]!==S?(L=S(),e[41]=S,e[42]=L):L=e[42],e[43]!==x?(C=Hn.stopPropagation(()=>x()),e[43]=x,e[44]=C):C=e[44],e[45]===Symbol.for("react.memo_cache_sentinel")?($=u.jsx(a$,{className:"h-3 w-3"}),e[45]=$):$=e[45],e[46]!==C?(j=u.jsx(Te,{content:"Add table to notebook",delayDuration:400,children:u.jsx(Me,{className:"group-hover:inline-flex hidden",variant:"text",size:"icon",onClick:C,children:$})}),e[46]=C,e[47]=j):j=e[47],e[48]!==i||e[49]!==O||e[50]!==V||e[51]!==L||e[52]!==j||e[53]!==z||e[54]!==T?(W=u.jsxs(go,{className:z,value:T,"aria-selected":i,forceMount:!0,onSelect:O,children:[V,L,j]}),e[48]=i,e[49]=O,e[50]=V,e[51]=L,e[52]=j,e[53]=z,e[54]=T,e[55]=W):W=e[55],e[56]!==i||e[57]!==E?(K=i&&E(),e[56]=i,e[57]=E,e[58]=K):K=e[58],e[59]!==W||e[60]!==K?(Z=u.jsxs(u.Fragment,{children:[W,K]}),e[59]=W,e[60]=K,e[61]=Z):Z=e[61],Z},$L=t=>{var K,Z;const e=J.c(53),{table:n,column:o,sqlTableContext:r}=t,[s,i]=Y.useState(!1),a=$e(wS),l=Qt(l$);let c,d;e[0]!==a?(c=()=>{a&&i(!1)},d=[a],e[0]=a,e[1]=c,e[2]=d):(c=e[1],d=e[2]),Y.useEffect(c,d),l(s?q=>new Set([...q,`${n.name}:${o.name}`]):q=>(q.delete(`${n.name}:${o.name}`),new Set(q)));const h=$e(Bs),f=Br(),{createNewCell:m}=Ot(),{columnsPreviews:_}=c$();let g;e[3]!==o.name||e[4]!==n.primary_keys?(g=((K=n.primary_keys)==null?void 0:K.includes(o.name))||!1,e[3]=o.name,e[4]=n.primary_keys,e[5]=g):g=e[5];const p=g;let b;e[6]!==o.name||e[7]!==n.indexes?(b=((Z=n.indexes)==null?void 0:Z.includes(o.name))||!1,e[6]=o.name,e[7]=n.indexes,e[8]=b):b=e[8];const y=b;let x;e[9]!==h||e[10]!==m||e[11]!==f?(x=q=>{q.includes("alt")&&f$(h,m,f),m({code:q,before:!1,cellId:f??"__end__"})},e[9]=h,e[10]=m,e[11]=f,e[12]=x):x=e[12];const v=x,S=HL,k=s?"font-semibold":"";let E;e[13]!==o.name||e[14]!==k?(E=u.jsx("span",{className:k,children:o.name}),e[13]=o.name,e[14]=k,e[15]=E):E=e[15];const N=E,I=`${n.name}.${o.name}`,T=`${n.name}.${o.name}`;let M;e[16]!==s?(M=()=>i(!s),e[16]=s,e[17]=M):M=e[17];const D=r?"pl-14":"pl-7";let z,O,F,B,V,L,C,$,j,W;return e[18]!==D?(z=Ie("flex flex-row gap-2 items-center flex-1",D),e[18]=D,e[19]=z):z=e[19],e[20]!==o.type||e[21]!==N?(O=u.jsx(d$,{columnName:N,dataType:o.type}),e[20]=o.type,e[21]=N,e[22]=O):O=e[22],e[23]!==p?(F=p&&S({tooltipContent:"Primary key",content:"PK"}),e[23]=p,e[24]=F):F=e[24],e[25]!==y?(B=y&&S({tooltipContent:"Indexed",content:"IDX"}),e[25]=y,e[26]=B):B=e[26],e[27]!==z||e[28]!==O||e[29]!==F||e[30]!==B?(V=u.jsxs("div",{className:z,children:[O,F,B]}),e[27]=z,e[28]=O,e[29]=F,e[30]=B,e[31]=V):V=e[31],e[32]!==o.name?(L=u.jsx(Te,{content:"Copy column name",delayDuration:400,children:u.jsx(Me,{variant:"text",size:"icon",className:"group-hover:opacity-100 opacity-0 hover:bg-muted text-muted-foreground hover:text-foreground",children:u.jsx(mS,{tooltip:!1,value:o.name,className:"h-3 w-3"})})}),e[32]=o.name,e[33]=L):L=e[33],e[34]!==o.external_type?(C=u.jsx("span",{className:"text-xs text-muted-foreground",children:o.external_type}),e[34]=o.external_type,e[35]=C):C=e[35],e[36]!==M||e[37]!==V||e[38]!==L||e[39]!==C||e[40]!==I||e[41]!==T?($=u.jsxs(go,{className:"rounded-none py-1 group cursor-pointer",value:T,onSelect:M,children:[V,L,C]},I),e[36]=M,e[37]=V,e[38]=L,e[39]=C,e[40]=I,e[41]=T,e[42]=$):$=e[42],e[43]!==o||e[44]!==_||e[45]!==v||e[46]!==s||e[47]!==r||e[48]!==n?(j=s&&u.jsx("div",{className:"pl-10 pr-2 py-2 bg-[var(--slate-1)] shadow-inner border-b",children:u.jsx(Ac,{children:u.jsx(u$,{table:n,column:o,onAddColumnChart:v,preview:_.get(r?`${r.database}.${r.schema}.${n.name}:${o.name}`:`${n.name}:${o.name}`),sqlTableContext:r})})}),e[43]=o,e[44]=_,e[45]=v,e[46]=s,e[47]=r,e[48]=n,e[49]=j):j=e[49],e[50]!==$||e[51]!==j?(W=u.jsxs(u.Fragment,{children:[$,j]}),e[50]=$,e[51]=j,e[52]=W):W=e[52],W};function HL(t){const{tooltipContent:e,content:n}=t;return u.jsx(Te,{content:e,delayDuration:100,children:u.jsx("span",{className:"text-xs text-black bg-gray-100 dark:invert rounded px-1",children:n})})}const WL=()=>{const t=J.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=u.jsx(LL,{}),t[0]=e):e=t[0],e},qL=()=>{const t=J.c(5),{documentation:e}=$e(m$);if(!e){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=u.jsx(vn,{title:"View docs as you type",description:"Move your text cursor over a symbol to see its documentation.",icon:u.jsx(md,{})}),t[0]=r):r=t[0],r}let n,o;return t[1]!==e?(n=ep({html:e}),t[1]=e,t[2]=n):n=t[2],t[3]!==n?(o=u.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},GL=()=>{const t=J.c(5),e=p$();if(e.length===0){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=u.jsx(vn,{title:"No errors!",icon:u.jsx(Wp,{})}),t[0]=r):r=t[0],r}let n,o;return t[1]!==e?(n=e.map(YL),t[1]=e,t[2]=n):n=t[2],t[3]!==n?(o=u.jsx("div",{className:"flex flex-col overflow-auto",children:n}),t[3]=n,t[4]=o):o=t[4],o};function YL(t){return u.jsxs("div",{children:[u.jsx("div",{className:"text-xs font-mono font-semibold bg-muted border-y px-2 py-1",children:u.jsx(g$,{cellId:t.cellId})}),u.jsx("div",{className:"px-2",children:u.jsx(_$,{errors:t.output.data,cellId:t.cellId},t.cellId)},t.cellId)]},t.cellId)}function y3(t,e,n){return t[e]?t[e][0]?t[e][0][n]:t[e][n]:e==="contentBoxSize"?t.contentRect[n==="inlineSize"?"width":"height"]:void 0}gp=function(t){t===void 0&&(t={});var e=t.onResize,n=A.useRef(void 0);n.current=e;var o=t.round||Math.round,r=A.useRef(),s=A.useState({width:void 0,height:void 0}),i=s[0],a=s[1],l=A.useRef(!1);A.useEffect(function(){return l.current=!1,function(){l.current=!0}},[]);var c=A.useRef({width:void 0,height:void 0}),d=function(h,f){var m=A.useRef(null),_=A.useRef(null);_.current=f;var g=A.useRef(null);A.useEffect(function(){p()});var p=A.useCallback(function(){var b=g.current,y=_.current,x=b||(y?y instanceof Element?y:y.current:null);m.current&&m.current.element===x&&m.current.subscriber===h||(m.current&&m.current.cleanup&&m.current.cleanup(),m.current={element:x,subscriber:h,cleanup:x?h(x):void 0})},[h]);return A.useEffect(function(){return function(){m.current&&m.current.cleanup&&(m.current.cleanup(),m.current=null)}},[]),A.useCallback(function(b){g.current=b,p()},[p])}(A.useCallback(function(h){return r.current&&r.current.box===t.box&&r.current.round===o||(r.current={box:t.box,round:o,instance:new ResizeObserver(function(f){var m=f[0],_=t.box==="border-box"?"borderBoxSize":t.box==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",g=y3(m,_,"inlineSize"),p=y3(m,_,"blockSize"),b=g?o(g):void 0,y=p?o(p):void 0;if(c.current.width!==b||c.current.height!==y){var x={width:b,height:y};c.current.width=b,c.current.height=y,n.current?n.current(x):l.current||a(x)}})}),r.current.instance.observe(h,{box:t.box}),function(){r.current&&r.current.instance.unobserve(h)}},[t.box,o]),t.ref);return A.useMemo(function(){return{ref:d,width:i.width,height:i.height}},[d,i.width,i.height])};const rm=new Map,JL=({file:t,onOpenNotebook:e})=>{const{theme:n}=zo(),o=$e(ym),[r,s]=A.useState(""),{data:i,isPending:a,error:l,setData:c}=Gn(async()=>{const g=await np({path:t.path}),p=g.contents||"";return s(rm.get(t.path)||p),g},[t.path]),d=async()=>{r!==(i==null?void 0:i.contents)&&await C$({path:t.path,contents:r}).then(g=>{g.success&&(c(p=>({...p,contents:r})),s(r))})},h=A.useRef(r);if(h.current=r,A.useEffect(()=>()=>{if(!(i!=null&&i.contents))return;const g=h.current;g===i.contents?rm.delete(t.path):rm.set(t.path,g)},[t.path,i==null?void 0:i.contents]),l)return u.jsx(Vr,{error:l});if(a||!i)return null;const f=i.mimeType||"text/plain",m=f in sm;if(!i.contents&&!m)return u.jsxs("div",{className:"grid grid-cols-2 gap-2 p-6",children:[u.jsx("div",{className:"font-bold text-muted-foreground",children:"Name"}),u.jsx("div",{children:i.file.name}),u.jsx("div",{className:"font-bold text-muted-foreground",children:"Type"}),u.jsx("div",{children:f})]});const _=u.jsxs("div",{className:"text-xs text-muted-foreground p-1 flex justify-end gap-2 border-b",children:[t.isMarimoFile&&!In()&&u.jsx(Te,{content:"Open notebook",children:u.jsx(wn,{size:"small",onClick:g=>e(g),children:u.jsx(jc,{})})}),u.jsx(Te,{content:"Download",children:u.jsx(wn,{size:"small",onClick:()=>{if(x3(f)){const g=k$(i.contents,f);return void S$(g,i.file.name)}ua(new Blob([i.contents||r],{type:f}),i.file.name)},children:u.jsx(Em,{})})}),!x3(f)&&u.jsxs(u.Fragment,{children:[u.jsx(Te,{content:"Copy contents to clipboard",children:u.jsx(wn,{size:"small",onClick:async()=>{await xn(r)},children:u.jsx(ra,{})})}),u.jsx(Te,{content:pn("global.save"),children:u.jsx(wn,{size:"small",color:r===i.contents?void 0:"green",onClick:d,disabled:r===i.contents,children:u.jsx(Ma,{})})})]})]});return f.startsWith("image/")?u.jsxs(u.Fragment,{children:[_,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(b$,{base64:i.contents,mime:f})})]}):f==="text/csv"&&i.contents?u.jsxs(u.Fragment,{children:[_,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(y$,{contents:i.contents})})]}):f.startsWith("audio/")?u.jsxs(u.Fragment,{children:[_,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(x$,{base64:i.contents,mime:f})})]}):f.startsWith("video/")?u.jsxs(u.Fragment,{children:[_,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(w$,{base64:i.contents,mime:f})})]}):f.startsWith("application/pdf")?u.jsxs(u.Fragment,{children:[_,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(v$,{base64:i.contents,mime:f})})]}):u.jsxs(u.Fragment,{children:[_,u.jsx("div",{className:"flex-1 overflow-auto",children:u.jsx(A.Suspense,{children:u.jsx(ka,{theme:n==="dark"?"dark":"light",language:sm[f]||sm.default,className:"border-b",extensions:[st.lineWrapping,Yn.of([{key:o.getHotkey("global.save").key,stopPropagation:!0,run:()=>r!==i.contents&&(d(),!0)}])],value:r,onChange:s})})})]})},x3=t=>t.startsWith("image/")||t.startsWith("audio/")||t.startsWith("video/")||t.startsWith("application/pdf"),sm={"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"},w3=en(new class{constructor(t){this.callbacks=t,this.delegate=new cp([]),this.rootPath="",this.onChange=An.NOOP,this.path=new Sc("/"),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 cp(n.files),this.rootPath=n.root,this.path=Sc.guessDeliminator(n.root)}catch(n){lt({title:"Failed",description:Y4(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 cp(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:(lt({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:k4,createFileOrFolder:op,deleteFileOrFolder:j$,renameFileOrFolder:N$})),KL=en({});function XL(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 v3(t){const e=J.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:nF,onDropRejected:QL,onDrop:ZL,...o},e[2]=o,e[3]=r):r=e[3],E$(r)}async function ZL(t){for(const e of t){const n=rF(oF(e));let o="";n&&(o=Sc.guessDeliminator(n).dirname(n));const r=(await XL(e)).split(",")[1];await op({path:o,type:"file",name:e.name,contents:r})}await async function(){await dt.get(w3).refreshAll([])}()}function QL(t){lt({title:"File upload failed",description:u.jsx("div",{className:"flex flex-col gap-1",children:t.map(eF)}),variant:"danger"})}function eF(t){return u.jsxs("div",{children:[t.file.name," (",t.errors.map(tF).join(", "),")"]},t.file.name)}function tF(t){return t.message}function nF(t){Dt.error(t),lt({title:"File upload failed",description:t.message,variant:"danger"})}function oF(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 rF(t){if(t)return t.replace(/^\/+/,"")}const k3=Y.createContext(null),sF=t=>{const e=J.c(60),{height:n}=t,o=A.useRef(null),[r]=an(w3);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[0]=s):s=e[0];const[i,a]=A.useState(s),[l,c]=A.useState(null),{openPrompt:d}=qn(),[h,f]=an(KL);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(C=>h[C]))},e[4]=h,e[5]=r,e[6]=b):b=e[6];const y=et(b);let x;e[7]!==d||e[8]!==r?(x=async()=>{d({title:"Folder name",onConfirm:async C=>{r.createFolder(C,null)}})},e[7]=d,e[8]=r,e[9]=x):x=e[9];const v=et(x);let S;e[10]!==d||e[11]!==r?(S=async()=>{d({title:"File name",onConfirm:async C=>{r.createFile(C,null)}})},e[10]=d,e[11]=r,e[12]=S):S=e[12];const k=et(S);let E;e[13]!==f?(E=()=>{var C;(C=o.current)==null||C.closeAll(),f({})},e[13]=f,e[14]=E):E=e[14];const N=et(E);if(g){let C;return e[15]===Symbol.for("react.memo_cache_sentinel")?(C=u.jsx(Kn,{size:"medium",centered:!0}),e[15]=C):C=e[15],C}if(p){let C;return e[16]!==p?(C=u.jsx(Vr,{error:p}),e[16]=p,e[17]=C):C=e[17],C}if(l){let C,$,j,W,K,Z;return e[18]===Symbol.for("react.memo_cache_sentinel")?(C=()=>c(null),e[18]=C):C=e[18],e[19]===Symbol.for("react.memo_cache_sentinel")?($=u.jsx(Me,{onClick:C,"data-testid":"file-explorer-back-button",variant:"text",size:"xs",className:"mb-0",children:u.jsx(Et,{size:16})}),e[19]=$):$=e[19],e[20]!==l.name?(j=u.jsxs("div",{className:"flex items-center pl-1 pr-3 flex-shrink-0 border-b justify-between",children:[$,u.jsx("span",{className:"font-bold",children:l.name})]}),e[20]=l.name,e[21]=j):j=e[21],e[22]!==l.path||e[23]!==r?(W=q=>S3(q,r.relativeFromRoot(l.path)),e[22]=l.path,e[23]=r,e[24]=W):W=e[24],e[25]!==l||e[26]!==W?(K=u.jsx(A.Suspense,{children:u.jsx(JL,{onOpenNotebook:W,file:l})}),e[25]=l,e[26]=W,e[27]=K):K=e[27],e[28]!==j||e[29]!==K?(Z=u.jsxs(u.Fragment,{children:[j,K]}),e[28]=j,e[29]=K,e[30]=Z):Z=e[30],Z}let I;e[31]!==N||e[32]!==k||e[33]!==v||e[34]!==y||e[35]!==r?(I=u.jsx(aF,{onRefresh:y,onCreateFile:k,onCreateFolder:v,onCollapseAll:N,tree:r}),e[31]=N,e[32]=k,e[33]=v,e[34]=y,e[35]=r,e[36]=I):I=e[36];const T=n-33;let M,D,z,O,F,B,V,L;return e[37]!==r?(M=async C=>{const{ids:$}=C;for(const j of $)await r.delete(j)},D=async C=>{const{id:$,name:j}=C;await r.rename($,j)},z=async C=>{const{dragIds:$,parentId:j}=C;await r.move($,j)},e[37]=r,e[38]=M,e[39]=D,e[40]=z):(M=e[38],D=e[39],z=e[40]),e[41]===Symbol.for("react.memo_cache_sentinel")?(O=C=>{const $=C[0];$&&($.data.isDirectory||c($.data))},e[41]=O):O=e[41],e[42]!==h||e[43]!==f||e[44]!==r?(F=async C=>{if(await r.expand(C)){const $=h[C]??!1;f({...h,[C]:!$})}},e[42]=h,e[43]=f,e[44]=r,e[45]=F):F=e[45],e[46]!==i||e[47]!==h||e[48]!==M||e[49]!==D||e[50]!==z||e[51]!==F||e[52]!==T?(B=u.jsx(pH,{width:"100%",ref:o,height:T,className:"h-full",data:i,initialOpenState:h,openByDefault:!1,renderCursor:hF,disableDrop:fF,onDelete:M,onRename:D,onMove:z,onSelect:O,onToggle:F,padding:15,rowHeight:30,indent:iF,overscanCount:1e3,disableMultiSelection:!0,children:dF}),e[46]=i,e[47]=h,e[48]=M,e[49]=D,e[50]=z,e[51]=F,e[52]=T,e[53]=B):B=e[53],e[54]!==B||e[55]!==r?(V=u.jsx(k3,{value:r,children:B}),e[54]=B,e[55]=r,e[56]=V):V=e[56],e[57]!==V||e[58]!==I?(L=u.jsxs(u.Fragment,{children:[I,V]}),e[57]=V,e[58]=I,e[59]=L):L=e[59],L},iF=15,aF=t=>{const e=J.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}=v3(i);let c,d,h,f,m,_,g,p,b,y,x,v,S,k,E;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=u.jsx(Aa,{size:16}),e[1]=c):c=e[1],e[2]!==o?(d=u.jsx(Te,{content:"Add file",children:u.jsx(Me,{"data-testid":"file-explorer-add-file-button",onClick:o,variant:"text",size:"xs",children:c})}),e[2]=o,e[3]=d):d=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(h=u.jsx(id,{size:16}),e[4]=h):h=e[4],e[5]!==r?(f=u.jsx(Te,{content:"Add folder",children:u.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")?(_=I$({variant:"text",size:"xs"}),g=u.jsx(T$,{size:16}),e[9]=_,e[10]=g):(_=e[9],g=e[10]),e[11]!==m?(p=u.jsx(Te,{content:"Upload file",children:u.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?(y=u.jsx("input",{...b,type:"file"}),e[15]=b,e[16]=y):y=e[16],e[17]===Symbol.for("react.memo_cache_sentinel")?(x=u.jsx(Q4,{size:16}),e[17]=x):x=e[17],e[18]!==n?(v=u.jsx(Te,{content:"Refresh",children:u.jsx(Me,{"data-testid":"file-explorer-refresh-button",onClick:n,variant:"text",size:"xs",children:x})}),e[18]=n,e[19]=v):v=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(S=u.jsx(Sp,{size:16}),e[20]=S):S=e[20],e[21]!==s?(k=u.jsx(Te,{content:"Collapse all folders",children:u.jsx(Me,{"data-testid":"file-explorer-collapse-button",onClick:s,variant:"text",size:"xs",children:S})}),e[21]=s,e[22]=k):k=e[22],e[23]!==y||e[24]!==v||e[25]!==k||e[26]!==d||e[27]!==f||e[28]!==p?(E=u.jsxs("div",{className:"flex items-center justify-end px-2 flex-shrink-0 border-b",children:[d,f,p,y,v,k]}),e[23]=y,e[24]=v,e[25]=k,e[26]=d,e[27]=f,e[28]=p,e[29]=E):E=e[29],E},lF=t=>{const e=J.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&&!In()&&u.jsxs("span",{className:"flex-shrink-0 ml-2 text-sm hidden group-hover:inline hover:underline",onClick:o,children:["open ",u.jsx(jc,{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=u.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},cF=t=>{const e=J.c(10),{node:n}=t,o=A.useRef(null);let r,s,i,a,l;return e[0]!==n.data.name?(r=()=>{var c,d;(c=o.current)==null||c.focus(),(d=o.current)==null||d.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]),A.useEffect(r,s),e[3]!==n?(i=()=>n.reset(),a=c=>{c.key==="Escape"&&n.reset(),c.key==="Enter"&&n.submit(c.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=u.jsx("input",{ref:o,className:"flex-1 bg-transparent border border-border text-muted-foreground",defaultValue:n.data.name,onClick:mF,onBlur:i,onKeyDown:a}),e[6]=n.data.name,e[7]=i,e[8]=a,e[9]=l):l=e[9],l},dF=({node:t,style:e,dragHandle:n})=>{const o=t.data.isDirectory?"directory":w4(t.data.name),r=v4[o],{openConfirm:s,openPrompt:i}=qn(),{createNewCell:a}=Ot(),l=Br(),c=A.use(k3),d=async g=>{S3(g,c?c.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:u.jsx(g4,{onClick:async()=>{await t.tree.delete(t.id)},"aria-label":"Confirm",children:"Delete"})})},f=et(async()=>{t.open(),i({title:"Folder name",onConfirm:async g=>{c==null||c.createFolder(g,t.id)}})}),m=et(async()=>{t.open(),i({title:"File name",onConfirm:async g=>{c==null||c.createFile(g,t.id)}})}),_=et(async()=>{var y;if(!c||t.data.isDirectory)return;const[g,p]=A$(t.data.name),b=`${g}_copy${p}`;try{const x=await np({path:t.data.path}),v=((y=t.parent)==null?void 0:y.data.path)||"";await op({path:v,type:"file",name:b,contents:x.contents?btoa(x.contents):void 0}),await c.refreshAll([v])}catch{lt({title:"Failed to duplicate file",description:"Unable to create a duplicate of the file",variant:"danger"})}});return u.jsxs("div",{style:e,ref:n,className:Ie("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:[u.jsx(uF,{node:t}),u.jsxs("span",{className:Ie("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?u.jsx("img",{src:"./favicon.ico",className:"w-5 h-5 flex-shrink-0 mr-2 filter grayscale",alt:"Marimo"}):u.jsx(r,{className:"w-5 h-5 flex-shrink-0 mr-2",strokeWidth:1.5}),t.isEditing?u.jsx(cF,{node:t}):u.jsx(lF,{node:t,onOpenMarimoFile:d}),u.jsxs(Hs,{modal:!1,children:[u.jsx(Ws,{asChild:!0,tabIndex:-1,onClick:g=>g.stopPropagation(),children:u.jsx(Me,{"data-testid":"file-explorer-more-button",variant:"text",tabIndex:-1,size:"xs",className:"mb-0","aria-label":"More options",children:u.jsx(sd,{strokeWidth:2,className:"w-5 h-5 hidden group-hover:block"})})}),(()=>{const g={size:14,strokeWidth:1.5,className:"mr-2"};return u.jsxs(qs,{align:"end",className:"no-print w-[220px]",onClick:p=>p.stopPropagation(),onCloseAutoFocus:p=>p.preventDefault(),children:[!t.data.isDirectory&&u.jsxs(Gt,{onSelect:()=>t.select(),children:[u.jsx(ig,{...g}),"Open file"]}),!t.data.isDirectory&&!In()&&u.jsxs(Gt,{onSelect:()=>{M$({path:t.data.path})},children:[u.jsx(jc,{...g}),"Open file in external editor"]}),t.data.isDirectory&&u.jsxs(u.Fragment,{children:[u.jsxs(Gt,{onSelect:()=>m(),children:[u.jsx(Aa,{...g}),"Create file"]}),u.jsxs(Gt,{onSelect:()=>f(),children:[u.jsx(id,{...g}),"Create folder"]}),u.jsx(_o,{})]}),u.jsxs(Gt,{onSelect:()=>t.edit(),children:[u.jsx(qp,{...g}),"Rename"]}),!t.data.isDirectory&&u.jsxs(Gt,{onSelect:_,children:[u.jsx(ra,{...g}),"Duplicate"]}),u.jsxs(Gt,{onSelect:async()=>{await xn(t.data.path),lt({title:"Copied to clipboard"})},children:[u.jsx(cd,{...g}),"Copy path"]}),c&&u.jsxs(Gt,{onSelect:async()=>{await xn(c.relativeFromRoot(t.data.path)),lt({title:"Copied to clipboard"})},children:[u.jsx(cd,{...g}),"Copy relative path"]}),u.jsx(_o,{}),u.jsxs(Gt,{onSelect:()=>{const{path:p}=t.data;(b=>{a({code:b,before:!1,cellId:l??"__end__"})})(IS[o](p))},children:[u.jsx(Wr,{...g}),"Insert snippet for reading file"]}),u.jsxs(Gt,{onSelect:async()=>{lt({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=IS[o](p);await xn(b)},children:[u.jsx(O$,{...g}),"Copy snippet for reading file"]}),t.data.isMarimoFile&&!In()&&u.jsxs(u.Fragment,{children:[u.jsx(_o,{}),u.jsxs(Gt,{onSelect:d,children:[u.jsx(tg,{...g}),"Open notebook"]})]}),u.jsx(_o,{}),!t.data.isDirectory&&u.jsxs(u.Fragment,{children:[u.jsxs(Gt,{onSelect:async()=>{const p=(await np({path:t.data.path})).contents||"";ua(new Blob([p]),t.data.name)},children:[u.jsx(Em,{...g}),"Download"]}),u.jsx(_o,{})]}),u.jsxs(Gt,{onSelect:h,variant:"danger",children:[u.jsx(bm,{...g}),"Delete"]})]})})()]})]})]})},uF=t=>{const e=J.c(3),{node:n}=t;if(!n.data.isDirectory){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=u.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?u.jsx(Vs,{className:"w-5 h-5 flex-shrink-0"}):u.jsx(ia,{className:"w-5 h-5 flex-shrink-0"}),e[1]=n.isOpen,e[2]=o):o=e[2],o};function S3(t,e){t.stopPropagation(),t.preventDefault(),window.open(`/?file=${e}`,"_blank")}function hF(){return null}function fF(t){const{parentNode:e}=t;return!e.data.isDirectory}function mF(t){return t.stopPropagation()}let C3,N3,j3;C3=()=>{const t=J.c(20),{ref:e,height:n}=gp(),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}=v3(r);let l,c,d,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")?(c=Ie("flex flex-col flex-1 overflow-hidden relative"),t[3]=c):c=t[3],t[4]!==i?(d=i(),t[4]=i,t[5]=d):d=t[5],t[6]!==d?(h=u.jsx("input",{...d}),t[6]=d,t[7]=h):h=t[7],t[8]!==a?(f=a&&u.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=u.jsx(sF,{height:o}),t[10]=o,t[11]=m):m=t[11],t[12]!==e||t[13]!==m?(_=u.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=u.jsxs("div",{...l,className:c,children:[h,f,_]}),t[15]=l,t[16]=h,t[17]=f,t[18]=_,t[19]=g):g=t[19],g},pp=t=>{const e=J.c(6),n=t.dataTestId;let o,r;return e[0]!==t.className?(o=Ie("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=u.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},N3=()=>{const t=J.c(9),e=D$(),{clearLogs:n}=Ot();if(e.length===0){let i,a;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=u.jsx("code",{className:"border rounded px-1",children:"stdout"}),t[0]=i):i=t[0],t[1]===Symbol.for("react.memo_cache_sentinel")?(a=u.jsx(vn,{title:"No logs",description:u.jsxs("span",{children:[i," and"," ",u.jsx("code",{className:"border rounded px-1",children:"stderr"})," logs will appear here."]}),icon:u.jsx(mm,{})}),t[1]=a):a=t[1],a}let o,r,s;return t[2]!==n?(o=u.jsx("div",{className:"flex flex-row justify-end px-2 py-1",children:u.jsx(pp,{dataTestId:"clear-logs-button",onClick:n})}),t[2]=n,t[3]=o):o=t[3],t[4]!==e?(r=u.jsx("div",{className:"overflow-auto flex-1",children:u.jsx(j3,{logs:e,className:"min-w-[300px]"})}),t[4]=e,t[5]=r):r=t[5],t[6]!==o||t[7]!==r?(s=u.jsxs(u.Fragment,{children:[o,r]}),t[6]=o,t[7]=r,t[8]=s):s=t[8],s},j3=t=>{const e=J.c(10),{logs:n,className:o}=t;let r,s,i,a,l;return e[0]!==o?(r=Ie("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(_F),e[3]=n,e[4]=i):i=e[4],e[5]!==i?(a=u.jsx("pre",{className:"grid text-xs font-mono gap-1 whitespace-break-spaces font-semibold align-left",children:u.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=u.jsx("div",{className:r,children:a}),e[7]=r,e[8]=a,e[9]=l):l=e[9],l};function pF(t){const e=R$(t.timestamp),n=gF[t.level],o=t.level.toUpperCase();return u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"flex-shrink-0 text-[var(--gray-10)] dark:text-[var(--gray-11)]",children:["[",e,"]"]}),u.jsx("span",{className:Ie("flex-shrink-0",n),children:o}),u.jsxs("span",{className:"flex-shrink-0 text-[var(--gray-10)]",children:["(",u.jsx(gr,{cellId:t.cellId}),")"]}),t.message]})}const gF={stdout:"text-[var(--grass-9)]",stderr:"text-[var(--red-9)]"};function _F(t,e){return u.jsxs("div",{className:"contents group",children:[u.jsx("span",{className:Ie("opacity-70 group-hover:bg-[var(--gray-3)] group-hover:opacity-100","text-right col-span-1 py-1 pr-1"),children:e+1}),u.jsx("span",{className:Ie("opacity-70 group-hover:bg-[var(--gray-3)] group-hover:opacity-100","px-2 flex gap-x-1.5 py-1 flex-wrap"),children:pF(t)})]},e)}const bF=()=>{const t=J.c(7),{items:e}=$e(P$);let n,o;t[0]!==e?(o=RH(e),t[0]=e,t[1]=o):o=t[1],n=o;const r=n,{activeHeaderId:s,activeOccurrences:i}=PH(r);if(e.length===0){let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=u.jsx(vn,{title:"No outline",description:"Add markdown headings to your notebook to create an outline.",icon:u.jsx(fd,{})}),t[2]=l):l=t[2],l}let a;return t[3]!==s||t[4]!==i||t[5]!==e?(a=u.jsx(LH,{items:e,activeHeaderId:s,activeOccurrences:i}),t[3]=s,t[4]=i,t[5]=e,t[6]=a):a=t[6],a},E3=(t,e)=>{lt(e?{title:"Failed to add package",description:e,variant:"danger"}:{title:"Package added",description:u.jsxs("div",{children:[u.jsxs("div",{children:["The package ",u.jsx(ba,{className:"inline",children:t})," and its dependencies has been added to your environment."]}),u.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Some Python packages may require a kernel restart to see changes."})]})})},I3=(t,e)=>{lt(e?{title:"Failed to upgrade package",description:e,variant:"danger"}:{title:"Package upgraded",description:u.jsxs("div",{children:[u.jsxs("div",{children:["The package ",u.jsx(ba,{className:"inline",children:t})," has been upgraded."]}),u.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Some Python packages may require a kernel restart to see changes."})]})})},A3=(t,e)=>{lt(e?{title:"Failed to remove package",description:e,variant:"danger"}:{title:"Package removed",description:u.jsxs("div",{children:[u.jsxs("div",{children:["The package ",u.jsx(ba,{className:"inline",children:t})," has been removed from your environment."]}),u.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Some Python packages may require a kernel restart to see changes."})]})})},T3=t=>{const e=J.c(9),{onClick:n,loading:o,children:r,className:s}=t;if(o){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=u.jsx(Kn,{size:"small",className:"h-4 w-4 shrink-0 opacity-50"}),e[0]=c):c=e[0],c}let i,a,l;return e[1]!==s?(i=Ie("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=u.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},yF=()=>{var v,S;const t=J.c(27),[e]=$s(),n=e.package_management.manager,[o,r]=Y.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:c}=Gn(kF,s);if(c){let k;return t[2]===Symbol.for("react.memo_cache_sentinel")?(k=u.jsx(Kn,{size:"medium",centered:!0}),t[2]=k):k=t[2],k}if(a){let k;return t[3]!==a?(k=u.jsx(Vr,{error:a}),t[3]=a,t[4]=k):k=t[4],k}const d=i.tree!=null;let h;t[5]!==d||t[6]!==o?(h=function(k,E){return k==="list"?"list":E?k||"tree":"list"}(o,d),t[5]=d,t[6]=o,t[7]=h):h=t[7];const f=h,m=(v=i.tree)==null?void 0:v.name,_=(S=i==null?void 0:i.tree)==null?void 0:S.version,g=m==="<root>";let p,b,y,x;return t[8]!==n||t[9]!==l?(p=u.jsx(xF,{packageManager:n,onSuccess:l}),t[8]=n,t[9]=l,t[10]=p):p=t[10],t[11]!==g||t[12]!==d||t[13]!==m||t[14]!==_||t[15]!==f?(b=d&&u.jsxs("div",{className:"flex items-center justify-between px-2 py-1 border-b",children:[u.jsxs("div",{className:"flex gap-1",children:[u.jsx("button",{type:"button",className:Ie("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"}),u.jsx("button",{type:"button",className:Ie("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"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.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&&u.jsxs("span",{className:"text-xs text-muted-foreground",children:[m,_&&` v${_}`]})]})]}),t[11]=g,t[12]=d,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?(y=f==="list"?u.jsx(wF,{packages:i.list,onSuccess:l}):u.jsx(vF,{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]=y):y=t[22],t[23]!==p||t[24]!==b||t[25]!==y?(x=u.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[p,b,y]}),t[23]=p,t[24]=b,t[25]=y,t[26]=x):x=t[26],x},xF=({onSuccess:t,packageManager:e})=>{const[n,o]=Y.useState(""),[r,s]=Y.useState(!1),{handleClick:i}=Ca(),a=$e(AS),l=Qt(AS);Y.useEffect(()=>{a&&(o(a),l(null))},[a,l]);const c=async()=>{try{s(!0);const d=n.split(",").map(h=>h.trim());for(const[h,f]of d.entries()){const m=await MS({package:f});m.success?E3(f):E3(f,m.error),h<d.length-1&&await new Promise(_=>setTimeout(_,1e3))}t()}finally{o(""),s(!1)}};return u.jsxs("div",{className:"flex items-center w-full border-b",children:[u.jsx(TS,{placeholder:`Install packages with ${e}...`,id:B1,icon:r?u.jsx(Kn,{size:"small",className:"mr-2 h-4 w-4 shrink-0 opacity-50"}):u.jsx(Te,{content:"Change package manager",children:u.jsx(si,{onClick:()=>i("packageManagement"),className:"mr-2 h-4 w-4 shrink-0 opacity-50 hover:opacity-80 cursor-pointer"})}),rootClassName:"flex-1 border-none",value:n,onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),c())},onChange:d=>o(d.target.value)}),u.jsx(Te,{delayDuration:300,side:"left",align:"start",content:u.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:",u.jsxs("div",{className:"flex flex-col gap-2 mt-2",children:[u.jsxs("div",{children:[u.jsx("span",{className:"font-bold tracking-wide",children:"Package name:"})," A package name; this will install the latest version.",u.jsx("div",{className:"text-muted-foreground",children:"Example: httpx"})]}),u.jsxs("div",{children:[u.jsx("span",{className:"font-bold tracking-wide",children:"Package and version:"})," ","A package with a specific version or version range.",u.jsx("div",{className:"text-muted-foreground",children:"Examples: httpx==0.27.0, httpx>=0.27.0"})]}),u.jsxs("div",{children:[u.jsx("span",{className:"font-bold tracking-wide",children:"Git:"})," A Git repository",u.jsx("div",{className:"text-muted-foreground",children:"Example: git+https://github.com/encode/httpx"})]}),u.jsxs("div",{children:[u.jsx("span",{className:"font-bold tracking-wide",children:"URL:"})," A remote wheel or source distribution.",u.jsx("div",{className:"text-muted-foreground",children:"Example: https://example.com/httpx-0.27.0.tar.gz"})]}),u.jsxs("div",{children:[u.jsx("span",{className:"font-bold tracking-wide",children:"Path:"})," A local wheel, source distribution, or project directory.",u.jsx("div",{className:"text-muted-foreground",children:"Example: /example/foo-0.1.0-py3-none-any.whl"})]})]})]}),children:u.jsx(Xm,{className:"h-4 w-4 cursor-help text-muted-foreground hover:text-foreground bg-transparent"})}),u.jsx("button",{type:"button",className:Ie("float-right px-2 m-0 h-full text-sm text-secondary-foreground ml-2",n&&"bg-accent text-accent-foreground","disabled:cursor-not-allowed disabled:opacity-50"),onClick:c,disabled:!n,children:"Add"})]})},wF=t=>{const e=J.c(9),{onSuccess:n,packages:o}=t;if(o.length===0){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=u.jsx(vn,{title:"No packages",description:"No packages are installed in this environment.",icon:u.jsx(si,{})}),e[0]=a):a=e[0],a}let r,s,i;if(e[1]===Symbol.for("react.memo_cache_sentinel")?(r=u.jsx(rp,{children:u.jsxs(ri,{children:[u.jsx($r,{children:"Name"}),u.jsx($r,{children:"Version"}),u.jsx($r,{})]})}),e[1]=r):r=e[1],e[2]!==n||e[3]!==o){let a;e[5]!==n?(a=l=>u.jsxs(ri,{className:"group",onClick:async()=>{await xn(`${l.name}==${l.version}`),lt({title:"Copied to clipboard"})},children:[u.jsx(Hr,{children:l.name}),u.jsx(Hr,{children:l.version}),u.jsxs(Hr,{className:"flex justify-end",children:[u.jsx(M3,{packageName:l.name,onSuccess:n}),u.jsx(O3,{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=u.jsxs(sp,{className:"overflow-auto flex-1",children:[r,u.jsx(ip,{children:s})]}),e[7]=s,e[8]=i):i=e[8],i},M3=({packageName:t,onSuccess:e})=>{const[n,o]=Y.useState(!1);return In()?null:u.jsx(T3,{onClick:async()=>{try{o(!0);const r=await MS({package:t,upgrade:!0});r.success?(e(),I3(t)):I3(t,r.error)}finally{o(!1)}},loading:n,children:"Upgrade"})},O3=({packageName:t,onSuccess:e})=>{const[n,o]=Y.useState(!1);return u.jsx(T3,{onClick:async()=>{try{o(!0);const r=await z$({package:t});r.success?(e(),A3(t)):A3(t,r.error)}finally{o(!1)}},loading:n,children:"Remove"})},vF=t=>{const e=J.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]=Y.useState(s);let l,c,d;if(e[1]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{a(new Set)},e[1]=l):l=e[1],e[2]!==n?(c=[n],e[2]=n,e[3]=c):c=e[3],Y.useEffect(l,c),o){let _;return e[4]!==o?(_=u.jsx(Vr,{error:o}),e[4]=o,e[5]=_):_=e[5],_}if(!n){let _;return e[6]===Symbol.for("react.memo_cache_sentinel")?(_=u.jsx(Kn,{size:"medium",centered:!0}),e[6]=_):_=e[6],_}if(n.dependencies.length===0){let _;return e[7]===Symbol.for("react.memo_cache_sentinel")?(_=u.jsx(vn,{title:"No dependencies",description:"No package dependencies found in this environment.",icon:u.jsx(si,{})}),e[7]=_):_=e[7],_}e[8]===Symbol.for("react.memo_cache_sentinel")?(d=_=>{a(g=>{const p=new Set(g);return p.has(_)?p.delete(_):p.add(_),p})},e[8]=d):d=e[8];const h=d;let f,m;if(e[9]!==i||e[10]!==r||e[11]!==n.dependencies){let _;e[13]!==i||e[14]!==r?(_=(g,p)=>u.jsx("div",{className:"border-b",children:u.jsx(D3,{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=u.jsx("div",{className:"flex-1 overflow-auto",children:u.jsx("div",{children:f})}),e[16]=f,e[17]=m):m=e[17],m},D3=t=>{const e=J.c(57),{nodeId:n,node:o,level:r,isTopLevel:s,expandedNodes:i,onToggle:a,onSuccess:l}=t,c=s!==void 0&&s,d=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=c?0:16+16*r;let _;e[3]!==d||e[4]!==n||e[5]!==a?(_=V=>{V.key!=="Enter"&&V.key!==" "||(V.preventDefault(),d&&a(n))},e[3]=d,e[4]=n,e[5]=a,e[6]=_):_=e[6];const g=_;let p;e[7]!==d||e[8]!==n||e[9]!==a?(p=V=>{V.stopPropagation(),d&&a(n)},e[7]=d,e[8]=n,e[9]=a,e[10]=p):p=e[10];const b=p,y=d&&"select-none",x=c?"px-2 py-0.5":"";let v,S;e[11]!==y||e[12]!==x?(v=Ie("flex items-center group cursor-pointer text-sm whitespace-nowrap","hover:bg-[var(--slate-2)] focus:bg-[var(--slate-2)] focus:outline-none",y,x),e[11]=y,e[12]=x,e[13]=v):v=e[13],e[14]!==m||e[15]!==c?(S=c?{}:{paddingLeft:`${m}px`},e[14]=m,e[15]=c,e[16]=S):S=e[16];const k=d?f:void 0;let E,N,I,T,M,D,z,O,F,B;return e[17]!==d||e[18]!==f?(E=d?f?u.jsx(Vs,{className:"w-4 h-4 mr-2 flex-shrink-0"}):u.jsx(ia,{className:"w-4 h-4 mr-2 flex-shrink-0"}):u.jsx("div",{className:"w-4 mr-2 flex-shrink-0"}),e[17]=d,e[18]=f,e[19]=E):E=e[19],e[20]!==o.name?(N=u.jsx("span",{className:"font-medium truncate",children:o.name}),e[20]=o.name,e[21]=N):N=e[21],e[22]!==o.version?(I=o.version&&u.jsxs("span",{className:"text-muted-foreground text-xs",children:["v",o.version]}),e[22]=o.version,e[23]=I):I=e[23],e[24]!==N||e[25]!==I?(T=u.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0 py-1.5",children:[N,I]}),e[24]=N,e[25]=I,e[26]=T):T=e[26],e[27]!==o.tags?(M=o.tags.map(SF),e[27]=o.tags,e[28]=M):M=e[28],e[29]!==M?(D=u.jsx("div",{className:"flex items-center gap-1 ml-2",children:M}),e[29]=M,e[30]=D):D=e[30],e[31]!==c||e[32]!==o.name||e[33]!==l?(z=c&&u.jsxs("div",{className:"flex gap-1 invisible group-hover:visible",children:[u.jsx(M3,{packageName:o.name,onSuccess:l}),u.jsx(O3,{packageName:o.name,onSuccess:l})]}),e[31]=c,e[32]=o.name,e[33]=l,e[34]=z):z=e[34],e[35]!==b||e[36]!==g||e[37]!==E||e[38]!==T||e[39]!==D||e[40]!==z||e[41]!==v||e[42]!==S||e[43]!==k?(O=u.jsxs("div",{className:v,style:S,onClick:b,onKeyDown:g,tabIndex:0,role:"treeitem","aria-selected":!1,"aria-expanded":k,children:[E,T,D,z]}),e[35]=b,e[36]=g,e[37]=E,e[38]=T,e[39]=D,e[40]=z,e[41]=v,e[42]=S,e[43]=k,e[44]=O):O=e[44],e[45]!==i||e[46]!==d||e[47]!==f||e[48]!==r||e[49]!==o.dependencies||e[50]!==n||e[51]!==l||e[52]!==a?(F=d&&f&&u.jsx("div",{role:"group",children:o.dependencies.map((V,L)=>u.jsx(D3,{nodeId:`${n}-${L}`,node:V,level:r+1,isTopLevel:!1,expandedNodes:i,onToggle:a,onSuccess:l},`${V.name}-${L}`))}),e[45]=i,e[46]=d,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]!==O||e[55]!==F?(B=u.jsxs("div",{children:[O,F]}),e[54]=O,e[55]=F,e[56]=B):B=e[56],B};async function kF(){const[t,e]=await Promise.all([L$(),F$()]);return{list:t.packages,tree:e.tree}}function SF(t,e){return t.kind==="cycle"?u.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"?u.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"?u.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 im=X3("marimo:scratchpadHistory:v1",[]),CF=en(!1),NF=en(null,(t,e,n)=>{if(!(n=n.trim()))return;const o=t(im),r=[n,...o.filter(s=>s!==n)].slice(0,15);e(im,r)}),jF={hide_code:!1,disabled:!1},EF=()=>{const t=J.c(69),e=Tc(),[n]=$s(),{theme:o}=zo(),r=A.useRef(null),s=Br(),{createNewCell:i,updateCellCode:a}=Ot(),l=e.cellRuntime[_r],c=l==null?void 0:l.output,d=l==null?void 0:l.status,h=l==null?void 0:l.consoleOutputs,f=e.cellData[_r],m=(f==null?void 0:f.code)??"",_=Qt(NF),[g,p]=an(CF),b=$e(im);let y;t[0]!==_||t[1]!==m?(y=()=>{OS({code:m}),_(m)},t[0]=_,t[1]=m,t[2]=y):y=t[2];const x=et(y);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 S=et(v);let k;t[7]!==a?(k=()=>{a({cellId:_r,code:"",formattingChange:!1}),OS({code:""});const se=r.current;se&&se.dispatch({changes:{from:0,to:se.state.doc.length,insert:""}})},t[7]=a,t[8]=k):k=t[8];const E=et(k);let N;t[9]!==p||t[10]!==a?(N=se=>{p(!1),a({cellId:_r,code:se,formattingChange:!1});const Ae=r.current;Ae&&Ae.dispatch({changes:{from:0,to:Ae.state.doc.length,insert:se}})},t[9]=p,t[10]=a,t[11]=N):N=t[11];const I=et(N),[T,M]=A.useState();let D;t[12]!==m||t[13]!==h||t[14]!==x||t[15]!==T||t[16]!==c||t[17]!==o||t[18]!==n?(D=()=>u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"overflow-auto flex-shrink-0 max-h-[40%]",children:u.jsx(eh,{theme:o,showPlaceholder:!1,id:_r,code:m,config:jF,status:"idle",serializedEditorState:null,runCell:x,userConfig:n,editorViewRef:r,setEditorView:se=>{r.current=se},hidden:!1,temporarilyShowCode:An.NOOP,languageAdapter:T,setLanguageAdapter:M})}),u.jsx("div",{className:"flex-1 overflow-auto flex-shrink-0",children:u.jsx(qc,{allowExpand:!1,output:c,className:"output-area",cellId:_r,stale:!1,loading:!1})}),u.jsx("div",{className:"overflow-auto flex-shrink-0 max-h-[35%]",children:u.jsx(hp,{consoleOutputs:h,className:"overflow-auto",stale:!1,cellName:Z3,onSubmitDebugger:An.NOOP,cellId:_r,debuggerActive:!1})})]}),t[12]=m,t[13]=h,t[14]=x,t[15]=T,t[16]=c,t[17]=o,t[18]=n,t[19]=D):D=t[19];const z=D;let O;t[20]!==I||t[21]!==b||t[22]!==g||t[23]!==o?(O=()=>g?u.jsx("div",{className:"absolute inset-0 z-100 bg-background p-3 border-none overflow-auto",children:u.jsx("div",{className:"overflow-auto flex flex-col gap-3",children:b.map((se,Ae)=>u.jsx("div",{className:"border rounded-md hover:shadow-sm cursor-pointer hover:border-input overflow-hidden",onClick:()=>I(se),children:u.jsx(A.Suspense,{children:u.jsx(ka,{language:"python",theme:o,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1},value:se.trim(),editable:!1,readOnly:!0})})},Ae))})}):null,t[20]=I,t[21]=b,t[22]=g,t[23]=o,t[24]=O):O=t[24];const F=O;let B,V,L,C,$,j,W,K,Z,q,te;t[25]===Symbol.for("react.memo_cache_sentinel")?(B=zs.create(_r),V=u.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]=V):(B=t[25],V=t[26]),t[27]===Symbol.for("react.memo_cache_sentinel")?(L=pn("cell.run"),t[27]=L):L=t[27],t[28]===Symbol.for("react.memo_cache_sentinel")?(C=u.jsx(ii,{color:"var(--grass-11)",size:16}),t[28]=C):C=t[28],t[29]!==x||t[30]!==g?($=u.jsx(Te,{content:L,children:u.jsx(Me,{"data-testid":"scratchpad-run-button",onClick:x,disabled:g,variant:"text",size:"xs",children:C})}),t[29]=x,t[30]=g,t[31]=$):$=t[31],t[32]===Symbol.for("react.memo_cache_sentinel")?(j=u.jsx(Np,{size:16}),t[32]=j):j=t[32],t[33]!==E||t[34]!==g?(W=u.jsx(Te,{content:"Clear code and outputs",children:u.jsx(Me,{disabled:g,size:"xs",variant:"text",onClick:E,children:j})}),t[33]=E,t[34]=g,t[35]=W):W=t[35],t[36]===Symbol.for("react.memo_cache_sentinel")?(K=u.jsx(Wr,{size:16}),t[36]=K):K=t[36],t[37]!==S||t[38]!==g?(Z=u.jsx(di,{children:u.jsx(Te,{content:"Insert code",children:u.jsx(Me,{disabled:g,size:"xs",variant:"text",onClick:S,children:K})})}),t[37]=S,t[38]=g,t[39]=Z):Z=t[39],t[40]!==d?(q=(d==="running"||d==="queued")&&u.jsx(Kn,{className:"inline",size:"small"}),t[40]=d,t[41]=q):q=t[41],t[42]===Symbol.for("react.memo_cache_sentinel")?(te=u.jsx("div",{className:"flex-1"}),t[42]=te):te=t[42];const re=g&&"bg-[var(--sky-3)] rounded-none";let ae,X;t[43]!==re?(ae=Ie(re),t[43]=re,t[44]=ae):ae=t[44],t[45]!==g||t[46]!==p?(X=()=>p(!g),t[45]=g,t[46]=p,t[47]=X):X=t[47];const ee=b.length===0;let ce,me,ue,pe,de,Ce,Ne;return t[48]===Symbol.for("react.memo_cache_sentinel")?(ce=u.jsx(Op,{size:16}),t[48]=ce):ce=t[48],t[49]!==ae||t[50]!==X||t[51]!==ee?(me=u.jsx(Te,{content:"Toggle history",children:u.jsx(Me,{size:"xs",variant:"text",className:ae,onClick:X,disabled:ee,children:ce})}),t[49]=ae,t[50]=X,t[51]=ee,t[52]=me):me=t[52],t[53]!==$||t[54]!==W||t[55]!==Z||t[56]!==q||t[57]!==me?(ue=u.jsxs("div",{className:"flex items-center flex-shrink-0",children:[$,W,Z,q,te,me]}),t[53]=$,t[54]=W,t[55]=Z,t[56]=q,t[57]=me,t[58]=ue):ue=t[58],t[59]!==z?(pe=z(),t[59]=z,t[60]=pe):pe=t[60],t[61]!==F?(de=F(),t[61]=F,t[62]=de):de=t[62],t[63]!==pe||t[64]!==de?(Ce=u.jsxs("div",{className:"flex-1 divide-y relative overflow-hidden flex flex-col",children:[pe,de]}),t[63]=pe,t[64]=de,t[65]=Ce):Ce=t[65],t[66]!==ue||t[67]!==Ce?(Ne=u.jsxs("div",{className:"flex flex-col h-full overflow-hidden divide-y",id:B,children:[V,ue,Ce]}),t[66]=ue,t[67]=Ce,t[68]=Ne):Ne=t[68],Ne},IF=()=>{const t=J.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=u.jsx(EF,{}),t[0]=e):e=t[0],e},AF=()=>{const t=J.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(MF,o);if(s){let b;return t[1]===Symbol.for("react.memo_cache_sentinel")?(b=u.jsx(Kn,{size:"medium",centered:!0}),t[1]=b):b=t[1],b}if(i){let b;return t[2]!==i?(b=u.jsx(Vr,{error:i}),t[2]=i,t[3]=b):b=t[3],b}let l;t[4]!==r?(l=r.filter(OF).map(DF),t[4]=r,t[5]=l):l=t[5];const c=l;if(r.length===0){let b;return t[6]===Symbol.for("react.memo_cache_sentinel")?(b=u.jsx(vn,{title:"No environment variables",description:"No environment variables are available in this notebook.",icon:u.jsx(ad,{})}),t[6]=b):b=t[6],b}let d,h,f,m,_,g,p;return t[7]!==n||t[8]!==e||t[9]!==c||t[10]!==a?(d=()=>e(u.jsx(Dg,{providerNames:c,onSuccess:()=>{a(),n()},onClose:n})),t[7]=n,t[8]=e,t[9]=c,t[10]=a,t[11]=d):d=t[11],t[12]===Symbol.for("react.memo_cache_sentinel")?(h=u.jsx(pr,{className:"h-4 w-4"}),t[12]=h):h=t[12],t[13]!==d?(f=u.jsx("div",{className:"flex justify-end h-8 border-b",children:u.jsx("button",{type:"button",className:"float-right border-l px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",onClick:d,children:h})}),t[13]=d,t[14]=f):f=t[14],t[15]===Symbol.for("react.memo_cache_sentinel")?(m=u.jsx(rp,{children:u.jsxs(ri,{children:[u.jsx($r,{children:"Environment Variable"}),u.jsx($r,{children:"Source"}),u.jsx($r,{})]})}),t[15]=m):m=t[15],t[16]!==r?(_=r.map(RF),t[16]=r,t[17]=_):_=t[17],t[18]!==_?(g=u.jsxs(sp,{className:"overflow-auto flex-1 mb-16",children:[m,u.jsx(ip,{children:_})]}),t[18]=_,t[19]=g):g=t[19],t[20]!==f||t[21]!==g?(p=u.jsxs("div",{className:"flex flex-col h-full",children:[f,g]}),t[20]=f,t[21]=g,t[22]=p):p=t[22],p},TF=t=>{const e=J.c(9),{className:n,ariaLabel:o,onCopy:r}=t,[s,i]=Y.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 c,d;return e[2]!==s?(c=s?u.jsx(Nc,{className:"w-3 h-3 text-green-700 rounded"}):u.jsx(ra,{className:"w-3 h-3 hover:bg-muted rounded"}),e[2]=s,e[3]=c):c=e[3],e[4]!==o||e[5]!==n||e[6]!==l||e[7]!==c?(d=u.jsx("button",{type:"button",className:n,onClick:l,"aria-label":o,children:c}),e[4]=o,e[5]=n,e[6]=l,e[7]=c,e[8]=d):d=e[8],d};async function MF(){return Og((await WS.request({})).secrets)}function OF(t){return t.provider!=="env"}function DF(t){return t.name}function RF(t){return t.keys.map(e=>u.jsxs(ri,{className:"group",children:[u.jsx(Hr,{children:e}),u.jsx(Hr,{children:t.provider!=="env"&&u.jsx(gS,{variant:"outline",className:"select-none",children:t.name})}),u.jsx(Hr,{children:u.jsx(TF,{ariaLabel:`Copy ${e}`,onCopy:async()=>{await xn(`os.environ["${e}"]`),lt({title:"Copied to clipboard",description:`os.environ["${e}"] has been copied to your clipboard.`})},className:Ie("float-right px-2 h-full text-xs text-muted-foreground hover:text-foreground","invisible group-hover:visible")})})]},`${t.name}-${e}`))}const PF=t=>{const e=J.c(6),{children:n}=t,{openModal:o,closeModal:r}=qn();let s,i;return e[0]!==r||e[1]!==o?(s=()=>o(u.jsx(FF,{onClose:r})),e[0]=r,e[1]=o,e[2]=s):s=e[2],e[3]!==n||e[4]!==s?(i=u.jsx(hS,{onClick:s,children:n}),e[3]=n,e[4]=s,e[5]=i):i=e[5],i},LF=[st.lineWrapping],FF=t=>{const e=J.c(23),{onClose:n}=t,[o,r]=A.useState(""),{theme:s}=zo();let i,a,l,c,d,h;e[0]!==n?(i=async x=>{x.preventDefault();const v=new FormData(x.target),S=v.get("title"),k=v.get("description"),E=v.get("code");fetch("https://marimo.io/api/suggest-snippet",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:S,description:k,code:E})}),n(),lt({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=u.jsx(ar,{children:"Contribute a Snippet"}),e[2]=a):a=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(l=u.jsxs(Ls,{children:[a,u.jsxs(Fs,{children:["Have a useful snippet you want to share with the community? Submit it here or make a pull request"," ",u.jsx("a",{href:no.githubPage,target:"_blank",className:"underline",children:"on GitHub"}),"."]})]}),e[3]=l):l=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(c=u.jsx(lr,{id:"title",name:"title",autoFocus:!0,placeholder:"Title",required:!0,autoComplete:"off"}),d=u.jsx(B$,{id:"description",name:"description",autoFocus:!0,placeholder:"Description",rows:5,required:!0,autoComplete:"off"}),e[4]=c,e[5]=d):(c=e[4],d=e[5]),e[6]!==o?(h=u.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,y;return e[8]!==o||e[9]!==f?(m=u.jsx(ka,{theme:f,language:"python",className:"cm border rounded overflow-hidden",extensions:LF,value:o,onChange:r}),e[8]=o,e[9]=f,e[10]=m):m=e[10],e[11]!==h||e[12]!==m?(_=u.jsxs("div",{className:"flex flex-col gap-6 py-4",children:[c,d,h,m]}),e[11]=h,e[12]=m,e[13]=_):_=e[13],e[14]!==n?(g=u.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=u.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=u.jsxs(oa,{children:[g,p]}),e[17]=g,e[18]=b):b=e[18],e[19]!==i||e[20]!==b||e[21]!==_?(y=u.jsx(cr,{className:"w-fit",children:u.jsxs("form",{onSubmit:i,children:[l,_,b]})}),e[19]=i,e[20]=b,e[21]=_,e[22]=y):y=e[22],y},zF=[st.lineWrapping],BF=()=>{const t=J.c(20),[e,n]=Y.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($F,o);if(s){let b;return t[1]!==s?(b=u.jsx(Vr,{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=u.jsx(Kn,{size:"medium",centered:!0}),t[3]=b):b=t[3],b}const a=e?"h-1/3":"h-full";let l,c,d,h,f,m,_,g,p;return t[4]!==a?(l=Ie("border-b rounded-none",a),t[4]=a,t[5]=l):l=t[5],t[6]===Symbol.for("react.memo_cache_sentinel")?(c=u.jsx(aa,{placeholder:"Search snippets...",className:"h-6 m-1",rootClassName:"flex-1 border-r"}),t[6]=c):c=t[6],t[7]===Symbol.for("react.memo_cache_sentinel")?(d=u.jsxs("div",{className:"flex items-center w-full",children:[c,u.jsx(PF,{children:u.jsx("button",{className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:u.jsx(pr,{className:"h-4 w-4"})})})]}),h=u.jsx(_c,{children:"No results"}),t[7]=d,t[8]=h):(d=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=u.jsx(VF,{onSelect:f,snippets:r.snippets}),t[10]=r.snippets,t[11]=m):m=t[11],t[12]!==l||t[13]!==m?(_=u.jsxs(Ic,{className:l,children:[d,h,m]}),t[12]=l,t[13]=m,t[14]=_):_=t[14],t[15]!==e?(g=u.jsx(A.Suspense,{children:u.jsx("div",{className:"h-2/3 snippet-viewer flex flex-col",children:e?u.jsx(UF,{snippet:e},e.title):u.jsx(vn,{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=u.jsxs("div",{className:"flex-1 overflow-hidden",children:[_,g]}),t[17]=_,t[18]=g,t[19]=p):p=t[19],p},UF=t=>{const e=J.c(27),{snippet:n}=t,{theme:o}=zo(),{createNewCell:r}=Ot(),s=Br();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 c=l;let d,h,f,m,_,g;if(e[7]!==n.title?(d=u.jsx("div",{className:"text-sm font-semibold bg-muted border-y px-2 py-1",children:n.title}),e[7]=n.title,e[8]=d):d=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(h=u.jsx(Wr,{className:"ml-2 h-4 w-4"}),e[9]=h):h=e[9],e[10]!==a?(f=u.jsx("div",{className:"flex justify-end",children:u.jsx(di,{children:u.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]!==c||e[13]!==n.sections||e[14]!==n.title||e[15]!==o){let p;e[17]!==c||e[18]!==n.title||e[19]!==o?(p=b=>{const{code:y,html:x,id:v}=b;return x?u.jsx("div",{children:ep({html:x})},`${n.title}-${v}`):y?u.jsxs("div",{className:"relative hover-actions-parent pr-2",children:[u.jsx(di,{children:u.jsx(Te,{content:"Insert snippet",children:u.jsx(Me,{className:"absolute -top-2 -right-1 z-10 hover-action px-2 bg-background",size:"sm",variant:"outline",onClick:()=>{c(y)},children:u.jsx(Wr,{className:"h-5 w-5"})})})}),u.jsx(A.Suspense,{children:u.jsx(ka,{theme:o==="dark"?"dark":"light",language:"python",className:"cm border rounded overflow-hidden",extensions:zF,value:y,readOnly:!0},`${n.title}-${v}`)})]},`${n.title}-${v}`):null},e[17]=c,e[18]=n.title,e[19]=o,e[20]=p):p=e[20],m=n.sections.map(p),e[12]=c,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?(_=u.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]!==d||e[25]!==_?(g=u.jsxs(u.Fragment,{children:[d,_]}),e[24]=d,e[25]=_,e[26]=g):g=e[26],g},VF=t=>{const e=J.c(7),{snippets:n,onSelect:o}=t;let r,s;if(e[0]!==o||e[1]!==n){let i;e[3]!==o?(i=a=>u.jsx(go,{className:"rounded-none",onSelect:()=>o(a),children:u.jsx("div",{className:"flex flex-row gap-2 items-center",children:u.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=u.jsx(Vm,{className:"flex flex-col overflow-auto",children:r}),e[5]=r,e[6]=s):s=e[6],s};function $F(){return U$()}const HF=Y.lazy(()=>$m(()=>import("./tracing-ChqPtgQh.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]),import.meta.url).then(t=>({default:t.Tracing}))),WF=()=>{const t=J.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=u.jsx(Y.Suspense,{fallback:u.jsx(qF,{}),children:u.jsx(HF,{})}),t[0]=e):e=t[0],e},qF=()=>{const t=J.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=u.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:u.jsx(Kn,{})}),t[0]=e):e=t[0],e},R3="name",P3="type-value",am="defs-refs",GF=[{id:R3,accessorFn:t=>[t.name,t.declaredBy],enableSorting:!0,sortingFn:"alphanumeric",header:({column:t})=>u.jsx(ap,{header:"Name",column:t}),cell:({getValue:t})=>{const[e,n]=t();return u.jsx(yf,{name:e,declaredBy:n})}},{id:P3,accessorFn:t=>[t.dataType,t.value],enableSorting:!0,sortingFn:"alphanumeric",header:({column:t})=>u.jsx(ap,{header:u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx("span",{children:"Type"}),u.jsx("span",{children:"Value"})]}),column:t}),cell:({getValue:t})=>{const[e,n]=t();return u.jsxs("div",{className:"max-w-[150px]",children:[u.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap text-muted-foreground font-mono text-xs",children:e}),u.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap",title:n??"",children:n})]})}},{id:am,accessorFn:t=>[t.declaredBy,t.usedBy,t.name,t.declaredByNames,t.usedByNames],enableSorting:!0,sortingFn:"basic",header:({column:t})=>u.jsx(ap,{header:u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx("span",{children:"Declared By"}),u.jsx("span",{children:"Used By"})]}),column:t}),cell:({getValue:t})=>{const[e,n,o]=t(),r=s=>{const i=hc(s);i&&tp(i,o)};return u.jsxs("div",{className:"flex flex-col gap-1 py-1",children:[u.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-center",children:[u.jsx("span",{title:"Declared by",children:u.jsx(Qp,{className:"w-3.5 h-3.5 text-muted-foreground"})}),e.length===1?u.jsx(gr,{variant:"focus",cellId:e[0],skipScroll:!0,onClick:()=>r(e[0])}):u.jsx("div",{className:"text-destructive flex flex-row gap-2",children:e.slice(0,3).map((s,i)=>u.jsxs("span",{className:"flex",children:[u.jsx(gr,{variant:"focus",cellId:s,skipScroll:!0,className:"whitespace-nowrap text-destructive",onClick:()=>r(s)},s),i<e.length-1&&", "]},s))})]}),u.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-baseline",children:[u.jsx("span",{title:"Used by",children:u.jsx(Oa,{className:"w-3.5 h-3.5 text-muted-foreground"})}),u.jsx(nk,{maxCount:3,cellIds:n,skipScroll:!0,onClick:r})]})]})}}],L3=A.memo(({className:t,cellIds:e,variables:n})=>{const[o,r]=Y.useState([]),[s,i]=Y.useState(""),a=V$(),l=A.useMemo(()=>{const h=f=>{const m=a[f];return G$(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]),c=A.useMemo(()=>{const h=new Map;return e.forEach((f,m)=>h.set(f,m)),function(f,m,_){m||(m={id:am,desc:!1});let g=[];switch(m.id){case R3:g=Na(f,p=>p.name);break;case P3:g=Na(f,p=>p.dataType);break;case am:g=Na(f,p=>_.get(p.declaredBy[0]))}return m.desc?g.reverse():g}(l,o[0],h)},[l,o,e]),d=$$({data:c,columns:GF,getCoreRowModel:q$(),onGlobalFilterChange:i,getFilteredRowModel:W$(),enableFilters:!0,enableGlobalFilter:!0,enableColumnPinning:!1,getColumnCanGlobalFilter:h=>h.columnDef.enableGlobalFilter??!0,globalFilterFn:"auto",manualSorting:!0,onSortingChange:r,getSortedRowModel:H$(),state:{sorting:o,globalFilter:s}});return u.jsxs(u.Fragment,{children:[u.jsx(TS,{className:"w-full",placeholder:"Search",value:s,onChange:h=>i(h.target.value)}),u.jsxs(sp,{className:Ie("w-full text-sm flex-1 border-separate border-spacing-0",t),children:[u.jsx(rp,{children:u.jsx(ri,{className:"whitespace-nowrap text-xs",children:d.getFlatHeaders().map(h=>u.jsx($r,{className:"sticky top-0 bg-background border-b",children:DS(h.column.columnDef.header,h.getContext())},h.id))})}),u.jsx(ip,{children:d.getRowModel().rows.map(h=>u.jsx(ri,{className:"hover:bg-accent",children:h.getVisibleCells().map(f=>u.jsx(Hr,{className:"border-b",children:DS(f.column.columnDef.cell,f.getContext())},f.id))},h.id))})]})]})});L3.displayName="VariableTable";const YF=()=>{const t=J.c(4),e=bS(),n=Kc();if(Object.keys(e).length===0){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=u.jsx(vn,{title:"No variables",description:"Global variables will appear here.",icon:u.jsx(dc,{})}),t[0]=r):r=t[0],r}let o;return t[1]!==n.inOrderIds||t[2]!==e?(o=u.jsx(L3,{className:"flex-1",cellIds:n.inOrderIds,variables:e}),t[1]=n.inOrderIds,t[2]=e,t[3]=o):o=t[3],o},JF=Y.lazy(()=>$m(()=>import("./terminal-GCVl-wqy.js"),__vite__mapDeps([113,1,2,114]),import.meta.url)),KF=t=>{const e=J.c(121),{children:n}=t,{isSidebarOpen:o,isTerminalOpen:r,selectedPanel:s}=Cc(),{setIsSidebarOpen:i,setIsTerminalOpen:a}=da(),l=Y.useRef(null),c=Y.useRef(null);let d,h,f,m,_;e[0]!==o?(d=()=>{if(!l.current)return;const le=l.current.isCollapsed();o&&le&&l.current.expand(),o||le||l.current.collapse(),requestAnimationFrame(ZF)},h=[o],e[0]=o,e[1]=d,e[2]=h):(d=e[1],h=e[2]),A.useEffect(d,h),e[3]!==r?(f=()=>{if(!c.current)return;const le=c.current.isCollapsed();r&&le&&c.current.expand(),r||le||c.current.collapse(),requestAnimationFrame(ez)},m=[r],e[3]=r,e[4]=f,e[5]=m):(f=e[4],m=e[5]),A.useEffect(f,m),e[6]!==n?(_=u.jsx(Zc,{id:"app",className:"relative h-full",children:u.jsx(A.Suspense,{children:n})},"app"),e[6]=n,e[7]=_):_=e[7];const g=_,p=o?"resize-handle":"resize-handle-collapsed";let b,y;e[8]!==p?(b=Ie("border-border no-print z-10",p,"vertical"),e[8]=p,e[9]=b):b=e[9],e[10]!==b?(y=u.jsx(RS,{onDragging:PS,className:b}),e[10]=b,e[11]=y):y=e[11];const x=y,v=r?"resize-handle":"resize-handle-collapsed";let S,k;e[12]!==v?(S=Ie("border-border no-print z-20",v,"horizontal"),e[12]=v,e[13]=S):S=e[13],e[14]!==S?(k=u.jsx(RS,{onDragging:PS,className:S}),e[14]=S,e[15]=k):k=e[15];const E=k;let N,I,T,M,D,z,O,F,B,V,L,C,$,j,W,K,Z,q,te,re,ae;e[16]!==s?(N=u.jsx("div",{className:"text-sm text-[var(--slate-11)] uppercase tracking-wide font-semibold flex-1",children:s}),e[16]=s,e[17]=N):N=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=u.jsx(oo,{className:"w-4 h-4"}),e[20]=T):T=e[20],e[21]!==I?(M=u.jsx(Me,{"data-testid":"close-helper-pane",className:"m-0",size:"xs",variant:"text",onClick:I,children:T}),e[21]=I,e[22]=M):M=e[22],e[23]!==N||e[24]!==M?(D=u.jsxs("div",{className:"p-3 border-b flex justify-between items-center",children:[N,M]}),e[23]=N,e[24]=M,e[25]=D):D=e[25],e[26]!==s?(z=s==="files"&&u.jsx(C3,{}),e[26]=s,e[27]=z):z=e[27],e[28]!==s?(O=s==="errors"&&u.jsx(GL,{}),e[28]=s,e[29]=O):O=e[29],e[30]!==s?(F=s==="variables"&&u.jsx(YF,{}),e[30]=s,e[31]=F):F=e[31],e[32]!==s?(B=s==="dependencies"&&u.jsx(ML,{}),e[32]=s,e[33]=B):B=e[33],e[34]!==s?(V=s==="packages"&&u.jsx(yF,{}),e[34]=s,e[35]=V):V=e[35],e[36]!==s?(L=s==="outline"&&u.jsx(bF,{}),e[36]=s,e[37]=L):L=e[37],e[38]!==s?(C=s==="datasources"&&u.jsx(WL,{}),e[38]=s,e[39]=C):C=e[39],e[40]!==s?($=s==="documentation"&&u.jsx(qL,{}),e[40]=s,e[41]=$):$=e[41],e[42]!==s?(j=s==="snippets"&&u.jsx(BF,{}),e[42]=s,e[43]=j):j=e[43],e[44]!==s?(W=s==="scratchpad"&&u.jsx(IF,{}),e[44]=s,e[45]=W):W=e[45],e[46]!==s?(K=s==="chat"&&u.jsx(tR,{}),e[46]=s,e[47]=K):K=e[47],e[48]!==s?(Z=s==="logs"&&u.jsx(N3,{}),e[48]=s,e[49]=Z):Z=e[49],e[50]!==s?(q=s==="tracing"&&u.jsx(WF,{}),e[50]=s,e[51]=q):q=e[51],e[52]!==s?(te=s==="secrets"&&u.jsx(AF,{}),e[52]=s,e[53]=te):te=e[53],e[54]!==z||e[55]!==O||e[56]!==F||e[57]!==B||e[58]!==V||e[59]!==L||e[60]!==C||e[61]!==$||e[62]!==j||e[63]!==W||e[64]!==K||e[65]!==Z||e[66]!==q||e[67]!==te?(re=u.jsx(A.Suspense,{children:u.jsxs(Yc,{children:[z,O,F,B,V,L,C,$,j,W,K,Z,q,te]})}),e[54]=z,e[55]=O,e[56]=F,e[57]=B,e[58]=V,e[59]=L,e[60]=C,e[61]=$,e[62]=j,e[63]=W,e[64]=K,e[65]=Z,e[66]=q,e[67]=te,e[68]=re):re=e[68],e[69]!==D||e[70]!==re?(ae=u.jsx(Ac,{children:u.jsxs("div",{className:"flex flex-col h-full flex-1 overflow-hidden mr-[-4px]",children:[D,re]})}),e[69]=D,e[70]=re,e[71]=ae):ae=e[71];const X=ae,ee=o&&"border-r border-l border-[var(--slate-7)]";let ce,me,ue,pe,de,Ce;e[72]!==ee?(ce=Ie("dark:bg-[var(--slate-1)] no-print print:hidden hide-on-fullscreen",ee),e[72]=ee,e[73]=ce):ce=e[73],e[74]===Symbol.for("react.memo_cache_sentinel")?(me=(le,Ve)=>{var Fe;Ve===0&&le===10&&((Fe=l.current)==null||Fe.resize(30))},e[74]=me):me=e[74],e[75]!==i?(ue=()=>i(!1),pe=()=>i(!0),e[75]=i,e[76]=ue,e[77]=pe):(ue=e[76],pe=e[77]),e[78]!==X||e[79]!==x?(de=u.jsxs("span",{className:"flex flex-row h-full",children:[X," ",x]}),e[78]=X,e[79]=x,e[80]=de):de=e[80],e[81]!==ce||e[82]!==ue||e[83]!==pe||e[84]!==de?(Ce=u.jsx(Zc,{ref:l,id:"helper",collapsedSize:0,collapsible:!0,className:ce,minSize:10,defaultSize:0,maxSize:75,onResize:me,onCollapse:ue,onExpand:pe,children:de},"helper"),e[81]=ce,e[82]=ue,e[83]=pe,e[84]=de,e[85]=Ce):Ce=e[85];const Ne=Ce,se=r&&"border-[var(--slate-7)]";let Ae,be,Re,ze,qe,Ze,Pe,Qe,tt;e[86]!==se?(Ae=Ie("dark:bg-[var(--slate-1)] no-print print:hidden hide-on-fullscreen",se),e[86]=se,e[87]=Ae):Ae=e[87],e[88]===Symbol.for("react.memo_cache_sentinel")?(be=(le,Ve)=>{var Fe;Ve===0&&le===10&&((Fe=c.current)==null||Fe.resize(30))},e[88]=be):be=e[88],e[89]!==a?(Re=()=>a(!1),ze=()=>a(!0),e[89]=a,e[90]=Re,e[91]=ze):(Re=e[90],ze=e[91]),e[92]===Symbol.for("react.memo_cache_sentinel")?(qe=u.jsx("div",{}),e[92]=qe):qe=e[92],e[93]!==a?(Ze=()=>a(!1),e[93]=a,e[94]=Ze):Ze=e[94],e[95]!==r||e[96]!==Ze?(Pe=u.jsx(A.Suspense,{fallback:qe,children:u.jsx(JF,{visible:r,onClose:Ze})}),e[95]=r,e[96]=Ze,e[97]=Pe):Pe=e[97],e[98]!==r||e[99]!==Pe?(Qe=u.jsx(OL,{isOpen:r,children:Pe}),e[98]=r,e[99]=Pe,e[100]=Qe):Qe=e[100],e[101]!==Ae||e[102]!==Re||e[103]!==ze||e[104]!==Qe||e[105]!==E?(tt=u.jsxs(Zc,{ref:c,id:"terminal",collapsedSize:0,collapsible:!0,className:Ae,minSize:10,defaultSize:0,maxSize:75,onResize:be,onCollapse:Re,onExpand:ze,children:[E,Qe]},"terminal"),e[101]=Ae,e[102]=Re,e[103]=ze,e[104]=Qe,e[105]=E,e[106]=tt):tt=e[106];const at=tt;let ne,ke,je,Le,G,ge,_e,fe;return e[107]===Symbol.for("react.memo_cache_sentinel")?(ne=FH(),e[107]=ne):ne=e[107],e[108]===Symbol.for("react.memo_cache_sentinel")?(ke=u.jsx(Yc,{children:u.jsx(LO,{})}),e[108]=ke):ke=e[108],e[109]!==at?(je=u.jsx(Jx,{capability:"terminal",children:at}),e[109]=at,e[110]=je):je=e[110],e[111]!==g||e[112]!==je?(Le=u.jsx(Zc,{children:u.jsxs(LS,{autoSaveId:"marimo:chrome:v1:l1",direction:"vertical",children:[g,je]})}),e[111]=g,e[112]=je,e[113]=Le):Le=e[113],e[114]===Symbol.for("react.memo_cache_sentinel")?(G=u.jsx(Y$,{}),e[114]=G):G=e[114],e[115]!==Ne||e[116]!==Le?(ge=u.jsxs(LS,{autoSaveId:"marimo:chrome:v1:l2",direction:"horizontal",storage:ne,children:[ke,Ne,Le,G]}),e[115]=Ne,e[116]=Le,e[117]=ge):ge=e[117],e[118]===Symbol.for("react.memo_cache_sentinel")?(_e=u.jsx(Ac,{children:u.jsx(Yc,{children:u.jsx(MO,{})})}),e[118]=_e):_e=e[118],e[119]!==ge?(fe=u.jsxs(zH,{children:[ge,_e]}),e[119]=ge,e[120]=fe):fe=e[120],fe};function XF(){window.dispatchEvent(new Event("resize"))}function ZF(){requestAnimationFrame(XF)}function QF(){window.dispatchEvent(new Event("resize"))}function ez(){requestAnimationFrame(QF)}let F3;F3=new URL(window.location.href).searchParams.get(J$.showChrome)==="false",eC=Object.freeze(Object.defineProperty({__proto__:null,default:t=>{const e=J.c(10);if(F3){let s,i,a;return e[0]!==t?(s=u.jsx(Yx,{hideControls:!0,...t}),e[0]=t,e[1]=s):s=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(i=u.jsx(fg,{}),e[2]=i):i=e[2],e[3]!==s?(a=u.jsxs(u.Fragment,{children:[s,i]}),e[3]=s,e[4]=a):a=e[4],a}let n,o,r;return e[5]!==t?(n=u.jsx(Yx,{...t}),e[5]=t,e[6]=n):n=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(o=u.jsx(fg,{}),e[7]=o):o=e[7],e[8]!==n?(r=u.jsxs(KF,{children:[n,o]}),e[8]=n,e[9]=r):r=e[9],r}},Symbol.toStringTag,{value:"Module"}))});export{pp as C,ed as E,vn as P,VH as __tla,td as a,eC as e,ja as f,gp as u};
|