@marimo-team/frontend 0.14.17-dev59 → 0.14.17-dev61
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-Djih2SXL.js → ConnectedDataExplorerComponent-7JKqEZct.js} +1 -1
- package/dist/assets/{ImageComparisonComponent-BpmsOtV9.js → ImageComparisonComponent-DvG7L5NV.js} +1 -1
- package/dist/assets/{VegaLite-wjblaBJ4.js → VegaLite-Ch8bwIbr.js} +1 -1
- package/dist/assets/{_baseEach-DQaEqqAT.js → _baseEach-AJIvfl2o.js} +1 -1
- package/dist/assets/_baseMap-CrkWz8qo.js +1 -0
- package/dist/assets/{_baseUniq-Bxf1l3fJ.js → _baseUniq-ByfpudZb.js} +1 -1
- package/dist/assets/{_createAggregator-D0Df7ZJ8.js → _createAggregator-CzywzDdV.js} +1 -1
- package/dist/assets/{any-language-editor-DH7VtsG5.js → any-language-editor-BeuwXMoZ.js} +1 -1
- package/dist/assets/{architectureDiagram-SUXI7LT5-Cx33zOR_.js → architectureDiagram-SUXI7LT5-DmvXuhR-.js} +1 -1
- package/dist/assets/{blockDiagram-6J76NXCF-DcXvpEvk.js → blockDiagram-6J76NXCF-DgatCDJF.js} +1 -1
- package/dist/assets/{c4Diagram-6F6E4RAY-BwQrEfOc.js → c4Diagram-6F6E4RAY-Bzq-3iMH.js} +1 -1
- package/dist/assets/channel-xZpxy_Wi.js +1 -0
- package/dist/assets/{chunk-353BL4L5-CZAxx0us.js → chunk-353BL4L5-rBYJY3hK.js} +1 -1
- package/dist/assets/{chunk-67H74DCK-BX7dBOEe.js → chunk-67H74DCK-CsGs1ieP.js} +1 -1
- package/dist/assets/{chunk-AACKK3MU-BVZSlZXx.js → chunk-AACKK3MU-uxpu4dYH.js} +1 -1
- package/dist/assets/{chunk-BFAMUDN2-DoHXkz-l.js → chunk-BFAMUDN2-2y-Ti2TR.js} +1 -1
- package/dist/assets/{chunk-E2GYISFI-As700Qbe.js → chunk-E2GYISFI-BR-Sm-Jl.js} +1 -1
- package/dist/assets/{chunk-OW32GOEJ-D1ifAJgw.js → chunk-OW32GOEJ-CJlIiXOq.js} +1 -1
- package/dist/assets/{chunk-SKB7J2MH-B7DOmRKI.js → chunk-SKB7J2MH-B9rxpp7J.js} +1 -1
- package/dist/assets/{chunk-SZ463SBG-PXuRDkrM.js → chunk-SZ463SBG-BUSujdOR.js} +1 -1
- package/dist/assets/{circle-play-B2ERS80f.js → circle-play-BCDLFs3E.js} +1 -1
- package/dist/assets/classDiagram-M3E45YP4-DSdqxQ-X.js +1 -0
- package/dist/assets/classDiagram-v2-YAWTLIQI-DSdqxQ-X.js +1 -0
- package/dist/assets/clone-WC2NjaZh.js +1 -0
- package/dist/assets/{compile-2oegiDov.js → compile-Cl1o_7gd.js} +1 -1
- package/dist/assets/{dagre-JOIXM2OF-D5PRnOjP.js → dagre-JOIXM2OF-CzXNJXTP.js} +1 -1
- package/dist/assets/{data-grid-overlay-editor-DNLFlT0L.js → data-grid-overlay-editor-D0DxYy1A.js} +1 -1
- package/dist/assets/{diagram-5UYTHUR4-TafBcZP1.js → diagram-5UYTHUR4-C6b_xEjg.js} +1 -1
- package/dist/assets/{diagram-VMROVX33-BpNCg6BV.js → diagram-VMROVX33-Bn--MK1N.js} +1 -1
- package/dist/assets/{diagram-ZTM2IBQH-Bjoi--il.js → diagram-ZTM2IBQH-DbRtS5Y3.js} +1 -1
- package/dist/assets/{edit-page-jmIZnyOa.js → edit-page-BvoTwe7s.js} +4 -4
- package/dist/assets/{erDiagram-3M52JZNH-DuoIM194.js → erDiagram-3M52JZNH-DxDs_W1Y.js} +1 -1
- package/dist/assets/{flowDiagram-KYDEHFYC-CEh1Jud6.js → flowDiagram-KYDEHFYC-znOQK42z.js} +1 -1
- package/dist/assets/{ganttDiagram-EK5VF46D-Bd-YJBuA.js → ganttDiagram-EK5VF46D-DbG4ddcH.js} +1 -1
- package/dist/assets/{gitGraphDiagram-GW3U2K7C-DGUgDlaF.js → gitGraphDiagram-GW3U2K7C-Dp85OsRq.js} +1 -1
- package/dist/assets/{glide-data-editor-Ci0XLtzi.js → glide-data-editor-DSuRnkhx.js} +4 -4
- package/dist/assets/{graph-Bch-jdMW.js → graph-nUYmO5D8.js} +1 -1
- package/dist/assets/{home-page-BUuQeusz.js → home-page-BM0K_0DL.js} +1 -1
- package/dist/assets/{index-BzaAdhZw.js → index-B7SVJwxG.js} +1 -1
- package/dist/assets/{index-BE5P5TbR.js → index-BZNmfXXH.js} +1 -1
- package/dist/assets/{index-CAB1ZT9i.js → index-C-QER5Cp.js} +1 -1
- package/dist/assets/{index-Bs3s6YNy.js → index-CKQgVkGV.js} +1 -1
- package/dist/assets/{index-DUjnFVkH.js → index-CUXVTSPJ.js} +1 -1
- package/dist/assets/{index-DaaJWmHT.js → index-CbiaqnTb.js} +1 -1
- package/dist/assets/{index-BiguxnSE.js → index-CbwpqzaQ.js} +1 -1
- package/dist/assets/{index-DgjTi8Bu.js → index-DJxlooVE.js} +1 -1
- package/dist/assets/{index-7k1prhw_.js → index-DaU5TnVr.js} +1 -1
- package/dist/assets/{index-Di8ihmg6.js → index-DwvfLR8r.js} +1 -1
- package/dist/assets/{index-_KU-ZH6l.js → index-Iu6x1Jci.js} +1 -1
- package/dist/assets/{index-C0dSfsHq.js → index-JHUZqRIc.js} +1 -1
- package/dist/assets/{index-ok-zQEES.js → index-Ot6DHYIK.js} +1 -1
- package/dist/assets/{index-Bq6PLEsq.js → index-d72fnN8m.js} +1 -1
- package/dist/assets/{index-B1FcjLRv.js → index-dct4iFjA.js} +1 -1
- package/dist/assets/{index-DREdqSFv.js → index-lIpT5zzE.js} +1 -1
- package/dist/assets/{index-CtodiuDW.js → index-n_GqBKKX.js} +14 -14
- package/dist/assets/{index-C7gCm9ZN.js → index-qKWbz5C3.js} +1 -1
- package/dist/assets/{index-C8pGF2kW.js → index-vW5au9aB.js} +1 -1
- package/dist/assets/infoDiagram-LHK5PUON-BTu6A73N.js +2 -0
- package/dist/assets/{journeyDiagram-EWQZEKCU-YRuyC3Hh.js → journeyDiagram-EWQZEKCU-CvrL4_gC.js} +1 -1
- package/dist/assets/{kanban-definition-ZSS6B67P-DQOeSl4H.js → kanban-definition-ZSS6B67P-Dxja7wwq.js} +1 -1
- package/dist/assets/{layout-Dqm0tECl.js → layout-BB3vKD6E.js} +1 -1
- package/dist/assets/{linear-DvEx4KxP.js → linear-D4x1AG46.js} +1 -1
- package/dist/assets/{links-xo7kqsjU.js → links-BBNCB9lj.js} +1 -1
- package/dist/assets/{mermaid-Bc0HunCt.js → mermaid-DV-bz2RW.js} +4 -4
- package/dist/assets/{min-B7ID8UTg.js → min-Ba0ERLhY.js} +1 -1
- package/dist/assets/{mindmap-definition-6CBA2TL7-Cvl2qCO8.js → mindmap-definition-6CBA2TL7-DJPVOmaY.js} +1 -1
- package/dist/assets/{number-overlay-editor-N0agPBzD.js → number-overlay-editor-C8f_DuIY.js} +1 -1
- package/dist/assets/{pieDiagram-NIOCPIFQ-BkfcR_eC.js → pieDiagram-NIOCPIFQ-cSvINxDe.js} +1 -1
- package/dist/assets/{quadrantDiagram-2OG54O6I-D7OQ3QqB.js → quadrantDiagram-2OG54O6I-YFniQjvx.js} +1 -1
- package/dist/assets/{react-plotly-C0OPBR0j.js → react-plotly-BcKndkmo.js} +1 -1
- package/dist/assets/{requirementDiagram-QOLK2EJ7-CpG-00MV.js → requirementDiagram-QOLK2EJ7--QX9y0w3.js} +1 -1
- package/dist/assets/{run-page-D995mV84.js → run-page-CWy80W0Q.js} +1 -1
- package/dist/assets/{sankeyDiagram-4UZDY2LN-BLFPcwAV.js → sankeyDiagram-4UZDY2LN-2lNeap_b.js} +1 -1
- package/dist/assets/{sequenceDiagram-SKLFT4DO-CXSDArPL.js → sequenceDiagram-SKLFT4DO-JSo3yF97.js} +1 -1
- package/dist/assets/{slides-component-B8dnd7sF.js → slides-component-B0E1yVL0.js} +1 -1
- package/dist/assets/{sortBy-BsgD73pI.js → sortBy-BqJLBYny.js} +1 -1
- package/dist/assets/{stateDiagram-MI5ZYTHO-CljErNtc.js → stateDiagram-MI5ZYTHO-BCr9oXni.js} +1 -1
- package/dist/assets/stateDiagram-v2-5AN5P6BG-BjWnZvF_.js +1 -0
- package/dist/assets/{storage-BXkc653h.js → storage-CKj6hBJ4.js} +3 -3
- package/dist/assets/{terminal-sSuibCH0.js → terminal-YtWC9fV-.js} +1 -1
- package/dist/assets/{time-GDGmDCgA.js → time-BBJ6iAB1.js} +1 -1
- package/dist/assets/{timeline-definition-MYPXXCX6-1r46GIoj.js → timeline-definition-MYPXXCX6-DYyVouo7.js} +1 -1
- package/dist/assets/{tracing-BMsJZmo-.js → tracing-C_dGiPTC.js} +2 -2
- package/dist/assets/{trash-BLPZPeAB.js → trash-CeVKfwMo.js} +1 -1
- package/dist/assets/{treemap-75Q7IDZK-BwNi5C84.js → treemap-75Q7IDZK-hJ27AAOP.js} +1 -1
- package/dist/assets/{vega-component-BA1l_2I_.js → vega-component-BI5ghaV9.js} +1 -1
- package/dist/assets/{xychartDiagram-H2YORKM3-qZOFdfBO.js → xychartDiagram-H2YORKM3-DQ9BSL-5.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/_baseMap-Lg5T9nSM.js +0 -1
- package/dist/assets/channel-BsvCvggN.js +0 -1
- package/dist/assets/classDiagram-M3E45YP4-Cp07gktx.js +0 -1
- package/dist/assets/classDiagram-v2-YAWTLIQI-Cp07gktx.js +0 -1
- package/dist/assets/clone-CqhbJBES.js +0 -1
- package/dist/assets/infoDiagram-LHK5PUON-CY7Zt9Nz.js +0 -2
- package/dist/assets/stateDiagram-v2-5AN5P6BG-Dpny7oFc.js +0 -1
@@ -1,5 +1,5 @@
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./tracing-
|
2
|
-
var RM=Object.defineProperty;var uk=Tt=>{throw TypeError(Tt)};var LM=(Tt,wt,Qt)=>wt in Tt?RM(Tt,wt,{enumerable:!0,configurable:!0,writable:!0,value:Qt}):Tt[wt]=Qt;var Z=(Tt,wt,Qt)=>LM(Tt,typeof wt!="symbol"?wt+"":wt,Qt),FM=(Tt,wt,Qt)=>wt.has(Tt)||uk("Cannot "+Qt);var hk=(Tt,wt,Qt)=>(FM(Tt,wt,"read from private field"),Qt?Qt.call(Tt):wt.get(Tt)),fk=(Tt,wt,Qt)=>wt.has(Tt)?uk("Cannot add the same private member more than once"):wt instanceof WeakSet?wt.add(Tt):wt.set(Tt,Qt);import{c as Ee,is as dr,it as zM,iu as zf,iv as mk,iw as BM,ix as UM,iy as pk,iz as Ul,U as T,iA as $M,iB as VM,iC as gk,iD as HM,dH as WM,dK as qM,b as q,dF as Bf,a as H,T as et,ac as Je,j as c,a1 as Pn,a9 as $o,a8 as os,aa as rs,bn as Vo,a6 as ve,ab as on,iE as Ca,a7 as Ho,aS as Rn,ad as Na,at as Ne,ao as jt,dY as Uf,eM as Ea,iF as GM,aN as Le,S as it,iG as YM,e_ as gn,iH as xk,iI as bk,iJ as $l,iK as yk,L as ft,dx as Vl,aX as Wo,iL as Hl,aZ as $f,ag as Zt,iM as KM,aw as _a,iN as XM,iO as vk,eZ as wk,al as yt,b4 as kk,iP as jk,cA as Wl,iQ as JM,dP as Qe,iR as ql,dW as En,iS as Ia,V as Se,b9 as _n,iT as Gl,iU as Yl,eP as ss,iV as ZM,iW as Aa,iX as Sk,eX as Ck,iY as Vf,iZ as Hf,ep as Wf,i_ as Kn,i$ as ur,aV as Kl,j0 as QM,j1 as Xl,j2 as Jl,au as jo,ed as Nk,av as Ta,j3 as e9,j4 as Zl,bp as hr,eQ as fr,ft as Ek,bd as Ot,j5 as t9,j6 as n9,ga as Ql,aP as ec,j7 as qf,j8 as o9,j9 as _k,ja as Gf,jb as r9,jc as Yf,jd as Xn,je as Ik,gc as Kf,jf as Ma,jg as tc,eu as ut,ew as as,jh as pt,ji as ze,jj as at,jk as Xf,jl as s9,jm as Jf,jn as gt,jo as Ak,dr as Oa,dm as Da,dn as Pa,dp as Ra,dl as is,fG as Zf,b3 as Ln,aJ as In,fw as Tk,fy as Mk,fz as a9,fE as i9,fA as Ok,jp as Dk,ar as xe,eo as l9,b1 as So,a$ as Co,b2 as No,a_ as It,eY as rn,jq as Pk,fC as Rk,jr as c9,js as d9,fu as Lk,fv as Fk,jt as ls,dq as zk,ju as Bk,jv as u9,jw as h9,a5 as f9,a4 as m9,jx as Qf,du as p9,dw as em,fh as nc,jy as oc,jz as rc,bs as xn,eT as La,fe as sn,bi as Uk,dZ as zt,ej as g9,a2 as tm,jA as Fa,jB as sc,jC as x9,jD as b9,jE as $k,a3 as y9,ae as za,eJ as Vk,jF as Wt,aW as v9,af as nm,gf as Hk,eq as ac,jG as w9,gz as om,bh as ic,bk as k9,jH as j9,jI as Wk,gJ as S9,gH as C9,gK as N9,gL as E9,jJ as rm,ds as Fn,jK as _9,jL as lc,jM as cs,q as Jn,o as We,fX as zn,jN as bn,jO as nt,jP as ds,jQ as At,gb as Dt,jR as sm,et as yn,jS as I9,jT as am,bf as qk,bg as Gk,jU as A9,gB as us,jV as cc,bc as dc,gC as mr,e$ as im,jW as T9,jX as Yk,jY as Ba,jZ as Kk,j_ as lm,j$ as Xk,k0 as Jk,k1 as Zk,k2 as Qk,f0 as cm,k3 as M9,k4 as Zn,k5 as uc,k6 as e3,dt as t3,k7 as hc,gw as dm,k8 as Ua,k9 as $a,ka as Va,kb as fc,kc as qo,kd as n3,ke as Eo,kf as hs,kg as um,kh as Ha,ki as fs,kj as hm,kk as fm,kl as o3,km as mc,kn as O9,ay as Wa,ko as qa,kp as D9,dV as pc,kq as P9,kr as mm,ks as R9,kt as L9,ku as gc,e2 as F9,kv as pr,kw as xc,kx as ms,fW as An,g4 as _o,fS as r3,cl as s3,ky as pm,fF as a3,eI as i3,kz as l3,kA as Ga,kB as c3,kC as bc,kD as gm,kE as ps,kF as Ya,kG as Ka,kH as z9,fO as yc,kI as xm,kJ as vc,ei as B9,fP as U9,kK as $9,kL as V9,kM as H9,kN as W9,u as q9,kO as G9,kP as Y9,kQ as K9,f_ as X9,kR as J9,kS as d3,t as L,kT as Z9,kU as Q9,kV as eO,kW as tO,kX as nO,kY as oO,kZ as rO,k_ as sO,k$ as aO,l0 as iO,l1 as lO,l2 as cO,l3 as dO,l4 as uO,l5 as hO,l6 as fO,l7 as mO,l8 as pO,l9 as gO,la as xO,lb as bO,lc as yO,ld as Xa,le as vO,lf as wO,lg as kO,lh as jO,li as SO,lj as CO,lk as NO,ll as EO,lm as bm,ln as wc,lo as u3,lp as _O,lq as IO,lr as h3,ls as AO,lt as gs,lu as Tn,lv as TO,lw as MO,lx as OO,ly as DO,lz as PO,lA as RO,lB as LO,lC as FO,lD as zO,lE as BO,lF as Go,lG as UO,lH as $O,lI as VO,lJ as HO,d$ as WO,lK as qO,lL as f3,e3 as GO,lM as kc,lN as YO,lO as KO,lP as XO,lQ as JO,gM as Yo,lR as jc,lS as ZO,lT as QO,lU as m3,lV as ym,gA as xs,lW as eD,lX as tD,lY as nD,lZ as Ja,l_ as Za,eW as vm,l$ as oD,g3 as rD,bm as sD,an as wm,m0 as p3,m1 as aD,m2 as iD,m3 as km,m4 as jm,m5 as lD,m6 as g3,m7 as x3,m8 as Sc,fR as cD,Y as b3,dN as dD,m9 as y3,fr as vt,ma as Qa,mb as bs,mc as uD,md as hD,me as fD,mf as mD,ck as Sm,mg as pD,am as Ko,be as v3,mh as gD,mi as xD,mj as bD,mk as Cc,ml as w3,dL as Nc,bo as k3,ev as yD,mm as j3,mn as S3,mo as C3,mp as vD,mq as N3,mr as E3,ms as ei,mt as wD,mu as _3,mv as kD,mw as jD,mx as I3,Z as Ec,my as SD,bq as A3,mz as CD,as as Io,mA as ND,mB as ti,mC as ED,mD as T3,eV as M3,fI as _c,mE as Cm,aU as Nm,en as Ic,em as Em,mF as _D,eS as O3,mG as ID,mH as D3,fq as AD,mI as TD,gr as MD,fx as OD,fB as _m,gu as DD,bl as ni,mJ as P3,mK as Im,mL as PD,mM as RD,mN as LD,_ as vn,er as FD,mO as zD,mP as BD,mQ as R3,fj as Am,dz as L3,mR as UD,aq as gr,mS as $D,mT as VD,mU as HD,aO as WD,mV as qD,mW as GD,mX as YD,W as KD,mY as Ac,ff as XD,mZ as F3,fM as JD,gj as ZD,m_ as QD,m$ as z3,n0 as eP,n1 as ys,n2 as tP,n3 as Tc,n4 as nP,n5 as oP,n6 as rP,z as B3,gF as sP,n7 as oi,n8 as U3,n9 as $3,na as V3,nb as H3,nc as aP,C as W3,nd as iP,ne as lP,nf as cP,E as xr,f5 as q3,bb as dP,b8 as uP,ng as hP,nh as fP,ni as mP,dC as G3,nj as Tm,nk as pP,dX as Y3,nl as gP,nm as Mm,nn as xP,no as bP,np as yP,nq as K3,nr as X3,ns as J3,fd as Z3,nt as vP,nu as wP,nv as Q3,nw as ej,nx as Mc,ny as tj,nz as nj,nA as oj,nB as kP,nC as jP,nD as rj,nE as SP,nF as CP,nG as NP,nH as EP,nI as _P,nJ as IP,dU as AP,nK as TP,nL as MP,nM as OP,nN as DP,nO as PP,nP as RP,nQ as LP,nR as FP,nS as zP,nT as BP,nU as UP,fU as $P,nV as VP,nW as HP,nX as sj,nY as WP,ax as qP,nZ as GP,ap as YP,eL as KP,n_ as XP,gm as Om,gk as vs,gn as br,gl as yr,go as Dm,gp as Pm,n$ as aj,o0 as ij,o1 as lj,o2 as Xo,gt as JP,o3 as ZP,o4 as QP,o5 as eR,o6 as tR,o7 as nR,o8 as cj,eA as oR,o9 as Rm,oa as rR,ah as Oc,ob as dj,oc as uj,aj as hj,ai as sR,dT as aR,__tla as iR}from"./index-CtodiuDW.js";import{b as ws,A as lR,L as fj,g as cR,G as dR,o as mj,s as uR,k as hR,B as pj,a as fR,M as mR,Y as pR,c as an,u as ri,C as gR,S as xR,K as bR,d as yR,i as vR,e as gj,f as wR,h as kR,j as si,P as ai,l as xj,m as jR,n as SR,p as CR,D as ks,q as NR,r as bj,t as Lm,T as ER}from"./links-xo7kqsjU.js";import{V as yj,d as vr,I as Fm,N as vj,S as wj,e as kj,f as jj,L as Sj,g as Cj,F as Nj,M as _R,l as Ej,h as IR,E as Dc,i as AR,j as zm,k as Bm,n as TR,o as MR,p as OR,q as DR,s as PR,t as RR,v as LR,w as FR,u as zR,C as BR,R as _j,A as UR,a as $R,T as VR,x as HR,y as WR,m as qR,z as GR,B as YR,O as KR,c as XR,P as JR,__tla as ZR}from"./storage-BXkc653h.js";import{c as QR}from"./_createAggregator-D0Df7ZJ8.js";import{_ as Ij,a as Aj,i as eL,w as tL,L as Tj,A as nL,C as Mj,b as Um,c as Oj,__tla as oL}from"./loro_wasm_bg-C3hKWL9L.js";import{s as Bn,i as Jo,T as $m,a as Vm}from"./transform-B8bpuzxV.js";import{g as Dj}from"./timer-BwIYMJWC.js";import{i as rL}from"./zoom-COrs4lFh.js";import{s as ii}from"./sortBy-BsgD73pI.js";let Hm,Pc,ln,Rc,Pj,js,sL=Promise.all([(()=>{try{return iR}catch{}})(),(()=>{try{return ZR}catch{}})(),(()=>{try{return oL}catch{}})()]).then(async()=>{var Bl,lk;var Tt=QR(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});let wt,Qt,Wm,Lc,Ss,wr,Fc,zc,qm,Gm,li,Bc,Ym,ci,Km,Uc,Xm,Jm,$c,Zm,Qm,ep,di,tp,Vc,np,op,rp,sp,ap,ip,Hc,lp,Wc,qc,cp,dp,up,hp,fp,mp,ui,pp,gp,Gc,xp,bp,yp,Yc,vp,wp,kp,hi,Kc,Xc,jp,Sp,Cp,Np,Ep,_p,Ip,Ap,Tp,Jc,Zc,Mp,Op,Dp,fi,cn,dn;wt=Ee("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),Qt=Ee("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"}]]),Wm=Ee("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"}]]),Lc=Ee("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),Ss=Ee("ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]),wr=Ee("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"}]]),Fc=Ee("chevrons-down",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]),zc=Ee("chevrons-up",[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]]),Rc=Ee("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),qm=Ee("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),Gm=Ee("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),li=Ee("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),Bc=Ee("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"}]]),Ym=Ee("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"}]]),ci=Ee("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"}]]),Km=Ee("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]),Uc=Ee("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"}]]),Xm=Ee("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"}]]),Jm=Ee("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"}]]),$c=Ee("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"}]]),Zm=Ee("eraser",[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]]),Qm=Ee("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=Ee("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"}]]),di=Ee("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"}]]),tp=Ee("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"}]]),Vc=Ee("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"}]]),np=Ee("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"}]]),op=Ee("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"}]]),rp=Ee("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"}]]),sp=Ee("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"}]]),ap=Ee("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"}]]),ip=Ee("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"}]]),Hc=Ee("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"}]]),lp=Ee("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"}]]),Wc=Ee("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"}]]),qc=Ee("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"}]]),cp=Ee("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"}]]),dp=Ee("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"}]]),up=Ee("map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]),hp=Ee("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"}]]),fp=Ee("message-circle-question-mark",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),mp=Ee("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"}]]),ui=Ee("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"}]]),pp=Ee("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"}]]),gp=Ee("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"}]]),Gc=Ee("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"}]]),xp=Ee("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),bp=Ee("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"}]]),yp=Ee("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"}]]),Yc=Ee("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"}]]),vp=Ee("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"}]]),wp=Ee("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"}]]),kp=Ee("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"}]]),hi=Ee("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"}]]),Kc=Ee("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"}]]),Xc=Ee("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"}]]),jp=Ee("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"}]]),Sp=Ee("square-code",[["path",{d:"m10 9-3 3 3 3",key:"1oro0q"}],["path",{d:"m14 15 3-3-3-3",key:"bz13h7"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]),Cp=Ee("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"}]]),Np=Ee("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"}]]),Ep=Ee("square-m",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 16V8l4 4 4-4v8",key:"141u4e"}]]),_p=Ee("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"}]]),Ip=Ee("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"}]]),Ap=Ee("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"}]]),Tp=Ee("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"}]]),Jc=Ee("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"}]]),Zc=Ee("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"}]]),Mp=Ee("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]),Op=Ee("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"}]]),Dp=Ee("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"}]]),fi=Ee("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"}]]),cn=Ee("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"}]]),dn=Ee("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"}]]);function mi(t,e){const n=+dr(t)-+dr(e);return n<0?-1:n>0?1:n}function Rj(t,e){const n=dr(t,e==null?void 0:e.in);return+function(o,r){const s=dr(o,r==null?void 0:r.in);return s.setHours(23,59,59,999),s}(n,e)==+function(o,r){const s=dr(o,r==null?void 0:r.in),a=s.getMonth();return s.setFullYear(s.getFullYear(),a+1,0),s.setHours(23,59,59,999),s}(n,e)}function Lj(t,e,n){const[o,r,s]=zf(n==null?void 0:n.in,t,t,e),a=mi(r,s),i=Math.abs(function(u,h,f){const[m,x]=zf(f==null?void 0:f.in,u,h);return 12*(m.getFullYear()-x.getFullYear())+(m.getMonth()-x.getMonth())}(r,s));if(i<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-a*i);let l=mi(r,s)===-a;Rj(o)&&i===1&&mi(o,s)===1&&(l=!1);const d=a*(i-+l);return d===0?0:d}function Fj(t,e,n){const o=function(r,s){return+dr(r)-+dr(s)}(t,e)/1e3;return(r=>{const s=(0,Math.trunc)(r);return s===0?0:s})(o)}function zj(t,e){return function(n,o,r){const s=BM(),a=(r==null?void 0:r.locale)??s.locale??UM,i=mi(n,o);if(isNaN(i))throw new RangeError("Invalid time value");const l=Object.assign({},r,{addSuffix:r==null?void 0:r.addSuffix,comparison:i}),[d,u]=zf(r==null?void 0:r.in,...i>0?[o,n]:[n,o]),h=Fj(u,d),f=(mk(u)-mk(d))/1e3,m=Math.round((h-f)/60);let x;if(m<2)return m===0?a.formatDistance("lessThanXMinutes",1,l):a.formatDistance("xMinutes",m,l);if(m<45)return a.formatDistance("xMinutes",m,l);if(m<90)return a.formatDistance("aboutXHours",1,l);if(m<pk){const g=Math.round(m/60);return a.formatDistance("aboutXHours",g,l)}if(m<2520)return a.formatDistance("xDays",1,l);if(m<Ul){const g=Math.round(m/pk);return a.formatDistance("xDays",g,l)}if(m<2*Ul)return x=Math.round(m/Ul),a.formatDistance("aboutXMonths",x,l);if(x=Lj(u,d),x<12){const g=Math.round(m/Ul);return a.formatDistance("xMonths",g,l)}{const g=x%12,p=Math.trunc(x/12);return g<3?a.formatDistance("aboutXYears",p,l):g<9?a.formatDistance("overXYears",p,l):a.formatDistance("almostXYears",p+1,l)}}(t,function(n){return zM(n,Date.now())}(t),e)}const Bj=T.createContext({}),Uj=T.forwardRef(function(t,e){[t,e]=WM(t,e,Bj);let{toolbarProps:n}=function(s,a){const{"aria-label":i,"aria-labelledby":l,orientation:d="horizontal"}=s;let[u,h]=T.useState(!1);$M(()=>{var p;h(!(!a.current||!(!((p=a.current.parentElement)===null||p===void 0)&&p.closest('[role="toolbar"]'))))});const{direction:f}=VM(),m=f==="rtl"&&d==="horizontal";let x=HM(a);const g=T.useRef(null);return{toolbarProps:{...gk(s,{labelable:!0}),role:u?"group":"toolbar","aria-orientation":d,"aria-label":i,"aria-labelledby":i==null?l:void 0,onKeyDownCapture:u?void 0:p=>{if(p.currentTarget.contains(p.target)){if(d==="horizontal"&&p.key==="ArrowRight"||d==="vertical"&&p.key==="ArrowDown")m?x.focusPrevious():x.focusNext();else{if(!(d==="horizontal"&&p.key==="ArrowLeft"||d==="vertical"&&p.key==="ArrowUp"))return p.key==="Tab"?(p.stopPropagation(),g.current=document.activeElement,void(p.shiftKey?x.focusFirst():x.focusLast())):void 0;m?x.focusNext():x.focusPrevious()}p.stopPropagation(),p.preventDefault()}},onFocusCapture:u?void 0:p=>{var b,y;g.current&&!p.currentTarget.contains(p.relatedTarget)&&(!((b=a.current)===null||b===void 0)&&b.contains(p.target))&&((y=g.current)===null||y===void 0||y.focus(),g.current=null)},onBlurCapture:u?void 0:p=>{p.currentTarget.contains(p.relatedTarget)||g.current||(g.current=p.target)}}}}(t,e),o=qM({...t,values:{orientation:t.orientation||"horizontal"},defaultClassName:"react-aria-Toolbar"}),r=gk(t);return delete r.id,q.createElement("div",{...Bf(n,r),...o,ref:e,slot:t.slot||void 0,"data-orientation":t.orientation||"horizontal"},o.children)}),pi="https://static.marimo.app",$j=t=>{const e=H.c(25),{onClose:n}=t,[o,r]=T.useState(""),{exportAsHTML:s}=et();let a;a=Math.random().toString(36).slice(2,6);const i=`${o}-${a}`,l=`${pi}/static/${i}`;let d,u,h,f,m,x,g,p,b,y,v;return e[0]!==s||e[1]!==n||e[2]!==i?(d=async w=>{w.preventDefault(),n();const S=await s({download:!1,includeCode:!0,files:yj.INSTANCE.filenames()}),j=Je({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${pi}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:S,path:i})}).catch(()=>{j.dismiss(),Je({title:"Error uploading static page",description:c.jsxs("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",c.jsx("a",{href:Pn.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),j.dismiss(),Je({title:"Static page uploaded!",description:c.jsxs("div",{children:["The URL has been copied to your clipboard.",c.jsx("br",{}),"You can share it with anyone."]})})},e[0]=s,e[1]=n,e[2]=i,e[3]=d):d=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(u=c.jsx($o,{children:"Share static notebook"}),e[4]=u):u=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(h=c.jsxs(os,{children:[u,c.jsxs(rs,{children:["You can publish a static, non-interactive version of this notebook to the public web. We will create a link for you that lives on"," ",c.jsx("a",{href:pi,target:"_blank",children:pi}),"."]})]}),e[5]=h):h=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(f=w=>{const S=w.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,"");r(S)},e[6]=f):f=e[6],e[7]!==o?(m=c.jsx(Vo,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:f,required:!0,autoComplete:"off"}),e[7]=o,e[8]=m):m=e[8],e[9]!==l?(x=c.jsxs("div",{className:"font-semibold text-sm text-muted-foreground gap-2 flex flex-col",children:["Anyone will be able to access your notebook at this URL:",c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Vj,{text:l}),c.jsx("span",{className:"text-primary",children:l})]})]}),e[9]=l,e[10]=x):x=e[10],e[11]!==m||e[12]!==x?(g=c.jsxs("div",{className:"flex flex-col gap-6 py-4",children:[m,x]}),e[11]=m,e[12]=x,e[13]=g):g=e[13],e[14]!==n?(p=c.jsx(ve,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),e[14]=n,e[15]=p):p=e[15],e[16]!==l?(b=c.jsx(ve,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await on(l)},children:"Create"}),e[16]=l,e[17]=b):b=e[17],e[18]!==b||e[19]!==p?(y=c.jsxs(Ca,{children:[p,b]}),e[18]=b,e[19]=p,e[20]=y):y=e[20],e[21]!==y||e[22]!==d||e[23]!==g?(v=c.jsx(Ho,{className:"w-fit",children:c.jsxs("form",{onSubmit:d,children:[h,g,y]})}),e[21]=y,e[22]=d,e[23]=g,e[24]=v):v=e[24],v},Vj=t=>{const e=H.c(8),[n,o]=q.useState(!1);let r;e[0]!==t.text?(r=Rn.stopPropagation(async d=>{d.preventDefault(),await on(t.text),o(!0),setTimeout(()=>o(!1),2e3)}),e[0]=t.text,e[1]=r):r=e[1];const s=r;let a,i,l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(Na,{size:14,strokeWidth:1.5}),e[2]=a):a=e[2],e[3]!==s?(i=c.jsx(ve,{"data-testid":"copy-static-notebook-url-button",onClick:s,size:"xs",variant:"secondary",children:a}),e[3]=s,e[4]=i):i=e[4],e[5]!==n||e[6]!==i?(l=c.jsx(Ne,{content:"Copied!",open:n,children:i}),e[5]=n,e[6]=i,e[7]=l):l=e[7],l};function Pp(){const t=H.c(2),e=jt(Uf);let n;return t[0]!==e?(n=()=>{const o=document.getElementsByClassName("output-area"),r=window.innerHeight||document.documentElement.clientHeight;let s=null;for(const a of Array.from(o)){const i=a.getBoundingClientRect();if(i.top>=0&&i.top<=r||i.bottom>=0&&i.bottom<=r){s=Ea.parse(a.parentNode.id);break}}e(a=>({mode:GM(a.mode),cellAnchor:s})),requestAnimationFrame(()=>{var a;s!==null&&((a=document.getElementById(Ea.create(s)))==null||a.scrollIntoView())})},t[0]=e,t[1]=n):n=t[1],n}function Qc(t){const e=H.c(3),n=Cs();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],Le(o)}function Rp(){const t=H.c(2),e=Cs();let n;return t[0]!==e?(n=()=>e(xk(gn())),t[0]=e,t[1]=n):n=t[1],Le(n)}function Cs(){const t=H.c(3),{prepareForRun:e}=it(),{sendRun:n}=et();let o;return t[0]!==e||t[1]!==n?(o=async r=>{var l,d;if(r.length===0)return;const{cellHandles:s,cellData:a}=gn(),i=[];for(const u of r){const h=s[u],f=(l=h==null?void 0:h.current)==null?void 0:l.editorView;let m;f?(bk(f)!=="markdown"&&$l(f),m=yk(f)):m=((d=a[u])==null?void 0:d.code)||"",i.push(m),e({cellId:u})}await n({cellIds:r,codes:i}).catch(Hj)},t[0]=e,t[1]=n,t[2]=o):o=t[2],Le(o)}function Hj(t){ft.error(t)}const ed=[{type:"files",Icon:np,tooltip:"View files",position:"sidebar"},{type:"variables",Icon:Vl,tooltip:"Explore variables",position:"sidebar"},{type:"datasources",Icon:Wo,tooltip:"Explore data sources",position:"sidebar"},{type:"dependencies",Icon:ui,tooltip:"Explore dependencies",position:"sidebar"},{type:"packages",Icon:ws,tooltip:"Manage packages",position:"sidebar"},{type:"outline",Icon:Xc,tooltip:"View outline",position:"sidebar"},{type:"chat",Icon:Hl,tooltip:"Chat with AI",position:"sidebar"},{type:"documentation",Icon:Jc,tooltip:"View live docs",position:"sidebar"},{type:"logs",Icon:$f,tooltip:"Notebook logs",position:"sidebar"},{type:"tracing",Icon:lR,tooltip:"Tracing",position:"sidebar"},{type:"snippets",Icon:Cp,tooltip:"Snippets",position:"sidebar"},{type:"secrets",Icon:ip,tooltip:"Secrets",hidden:Zt(),position:"sidebar"},{type:"scratchpad",Icon:KM,tooltip:"Scratchpad",position:"sidebar"},{type:"errors",Icon:_a,tooltip:"View errors",position:"footer"}];function Wj(){const t=H.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],t[0]=e):e=t[0];const[n,o]=function(a,i){const l=H.c(11);let d;l[0]!==i?(d=new XM(i),l[0]=i,l[1]=d):d=l[1];const u=d;let h;l[2]!==a||l[3]!==u?(h=()=>u.get(a),l[2]=a,l[3]=u,l[4]=h):h=l[4];const[f,m]=T.useState(h);let x;l[5]!==a||l[6]!==u?(x=b=>{m(b),u.set(a,b)},l[5]=a,l[6]=u,l[7]=x):x=l[7];const g=x;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=a=>{const i=(l=[a,...n],[...new Set(l)]);var l;o(i.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 Lp(t){return t.dropdown!==void 0}function gi(t,e=""){return t.flatMap(n=>n.label?Lp(n)?gi(n.dropdown,`${e+n.label} > `):{...n,label:e+n.label}:[])}const Ns=t=>{const e=H.c(8),{children:n,layerTop:o}=t,r=o!==void 0&&o;let s;e[0]!==n?(s=q.Children.toArray(n),e[0]=n,e[1]=s):s=e[1];const[a,i]=s,l=`second-icon absolute ${r?"top-[-2px] left-[-2px]":"bottom-[-2px] right-[-2px]"} rounded-full`;let d,u;return e[2]!==i||e[3]!==l?(d=c.jsx("div",{className:l,children:i}),e[2]=i,e[3]=l,e[4]=d):d=e[4],e[5]!==a||e[6]!==d?(u=c.jsxs("div",{className:"multi-icon relative w-fit",children:[a,d]}),e[5]=a,e[6]=d,e[7]=u):u=e[7],u},Es=yt(null),qj=yt(!1),td=kk("marimo:ai:chatState:v3",{chats:[],activeChatId:null}),Gj=yt(t=>{const e=t(td);return e.chats.find(n=>n.id===e.activeChatId)},(t,e,n)=>{e(td,o=>({...o,activeChatId:n}))});function Fp(t){return t!==jk&&!!(t&&t.trim().length>0)}const xi=t=>{const e=H.c(7);let n,o;e[0]!==t?(n=i=>{var l;(i.ctrlKey||i.metaKey)&&i.key==="z"&&(i.preventDefault(),i.stopPropagation(),(l=t.onClick)==null||l.call(t,i))},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],Wl(window,"keydown",n,o);const r=t.children??"Undo";let s,a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(s=c.jsx(JM,{className:"ml-2",shortcut:"cmd-z"}),e[3]=s):s=e[3],e[4]!==r||e[5]!==t?(a=c.jsxs(ve,{"data-testid":"undo-button",size:"sm",variant:"outline",...t,children:[r," ",s]}),e[4]=r,e[5]=t,e[6]=a):a=e[6],a};function _s(){const t=H.c(4),{deleteCell:e,undoDeleteCell:n}=it(),{sendDeleteCell:o}=et();let r;return t[0]!==e||t[1]!==o||t[2]!==n?(r=s=>{var d;if(Qe.get(ql))return;const{cellId:a}=s,i=Qe.get(En),l=(((d=i.cellData[a])==null?void 0:d.code)??"").trim()==="";if(e({cellId:a}),o({cellId:a}).catch(()=>{n()}),!l){const{dismiss:u}=Je({title:"Cell deleted",description:"You can bring it back by clicking undo or through the command palette.",action:c.jsx(xi,{"data-testid":"undo-delete-button",onClick:()=>{n(),h()}})}),h=u}},t[0]=e,t[1]=o,t[2]=n,t[3]=r):r=t[3],Le(r)}function Is(){const t=H.c(4),{deleteCell:e,undoDeleteCell:n}=it(),{sendDeleteCell:o}=et();let r;return t[0]!==e||t[1]!==o||t[2]!==n?(r=async s=>{if(Qe.get(ql))return;const{cellIds:a}=s;for(const d of a)await o({cellId:d}).then(()=>{e({cellId:d})});const{dismiss:i}=Je({title:"Cells deleted",action:c.jsx(xi,{"data-testid":"undo-delete-button",onClick:()=>{for(const d of a)n();l()}})}),l=i},t[0]=e,t[1]=o,t[2]=n,t[3]=r):r=t[3],Le(r)}function zp(){const t=H.c(3),{splitCell:e,undoSplitCell:n}=it();let o;return t[0]!==e||t[1]!==n?(o=r=>{const s=Ia(r.cellId);if(!s)return;const a=yk(s);e(r);const{dismiss:i}=Je({title:"Cell split",action:c.jsx(xi,{"data-testid":"undo-split-button",size:"sm",variant:"outline",onClick:()=>{n({...r,snapshot:a}),l()},children:"Undo"})}),l=i},t[0]=e,t[1]=n,t[2]=o):o=t[2],Le(o)}function nd(t){const e=H.c(51),{cell:n}=t,{createNewCell:o,updateCellConfig:r,updateCellName:s,moveCell:a,sendToTop:i,sendToBottom:l,addColumnBreakpoint:d,clearCellOutput:u}=it(),h=zp(),f=Qc(n==null?void 0:n.cellId),m=!Se(ql),x=_s(),{openModal:g}=_n(),p=jt(Es),b=Se(Gl),y=Se(Yl),v=Se(ss),w=Se(ZM),{saveCellConfig:S}=et();if(!n||v){let U;return e[0]===Symbol.for("react.memo_cache_sentinel")?(U=[],e[0]=U):U=e[0],U}const{cellId:j,config:C,getEditorView:_,name:E,hasOutput:M,hasConsoleOutput:I,status:D}=n;let F;e[1]!==j||e[2]!==C.disabled||e[3]!==S||e[4]!==r?(F=async()=>{const U={disabled:!C.disabled};await S({configs:{[j]:U}}),r({cellId:j,config:U})},e[1]=j,e[2]=C.disabled,e[3]=S,e[4]=r,e[5]=F):F=e[5];const O=F;let P;e[6]!==j||e[7]!==C.hide_code||e[8]!==_||e[9]!==S||e[10]!==r?(P=async()=>{const U={hide_code:!C.hide_code};await S({configs:{[j]:U}}),r({cellId:j,config:U});const $=_();$&&(U.hide_code?$.contentDOM.blur():$.focus())},e[6]=j,e[7]=C.hide_code,e[8]=_,e[9]=S,e[10]=r,e[11]=P):P=e[11];const R=P;let z,N,k,B,A;return e[12]===Symbol.for("react.memo_cache_sentinel")?(z=c.jsx(Tp,{size:13,strokeWidth:1.5}),e[12]=z):z=e[12],e[13]!==j||e[14]!==E||e[15]!==g||e[16]!==s?(N=()=>{g(c.jsxs(Ho,{children:[c.jsx(os,{children:c.jsx($o,{children:"Rename cell"})}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(hr,{htmlFor:"cell-name",children:"Cell name"}),c.jsx(vj,{placeholder:"cell name",value:E,onKeyDown:U=>{U.key==="Enter"&&(U.preventDefault(),U.stopPropagation(),g(null))},onChange:U=>s({cellId:j,name:U})})]})]}))},e[13]=j,e[14]=E,e[15]=g,e[16]=s,e[17]=N):N=e[17],e[18]!==j||e[19]!==s?(k=U=>s({cellId:j,name:U}),e[18]=j,e[19]=s,e[20]=k):k=e[20],e[21]!==E||e[22]!==k?(B=c.jsx(vj,{placeholder:"cell name",value:E,onChange:k}),e[21]=E,e[22]=k,e[23]=B):B=e[23],e[24]!==d||e[25]!==b||e[26]!==w||e[27]!==y||e[28]!==m||e[29]!==j||e[30]!==u||e[31]!==C.disabled||e[32]!==C.hide_code||e[33]!==o||e[34]!==x||e[35]!==_||e[36]!==I||e[37]!==M||e[38]!==a||e[39]!==E||e[40]!==f||e[41]!==l||e[42]!==i||e[43]!==p||e[44]!==h||e[45]!==D||e[46]!==N||e[47]!==B||e[48]!==O||e[49]!==R?(A=[[{icon:z,label:"Name",disableClick:!0,handle:Jj,handleHeadless:N,rightElement:B},{icon:c.jsx(vr,{size:13,strokeWidth:1.5}),label:"Run cell",hotkey:"cell.run",hidden:D==="running"||D==="queued"||D==="disabled-transitively"||C.disabled,handle:()=>f()},{icon:c.jsx(Aa,{size:13,strokeWidth:1.5}),label:"AI completion",hidden:!b,handle:()=>{p(U=>(U==null?void 0:U.cellId)===j?null:{cellId:j})},hotkey:"cell.aiCompletion"},{icon:c.jsx(Kc,{size:13,strokeWidth:1.5}),label:"Split cell",hotkey:"cell.splitCell",handle:()=>h({cellId:j})},{icon:c.jsx(Fm,{size:13,strokeWidth:1.5}),label:"Export output as PNG",hidden:!M,handle:()=>function(U){const $=document.getElementById(vk.create(U));$&&($.classList.add("printing-output"),wk($,"result.png").finally(()=>{$.classList.remove("printing-output")}))}(j)},{icon:c.jsx(Ck,{size:13,strokeWidth:1.5}),label:"Format cell",hotkey:"cell.format",handle:()=>{const U=_();U&&Sk({[j]:U})}},{icon:C.hide_code?c.jsx(Vf,{size:13,strokeWidth:1.5}):c.jsx(Hf,{size:13,strokeWidth:1.5}),label:C.hide_code?"Show code":"Hide code",handle:R,hotkey:"cell.hideCode"},{icon:C.disabled?c.jsx(cn,{size:13,strokeWidth:1.5}):c.jsx(dn,{size:13,strokeWidth:1.5}),label:"Reactive execution",rightElement:c.jsx(Wf,{"data-testid":"cell-disable-switch",checked:!C.disabled,size:"sm",onCheckedChange:O}),handle:O},{icon:c.jsx(_a,{size:13,strokeWidth:1.5}),label:"Clear output",hidden:!(M||I),handle:()=>{u({cellId:j})}}],[{icon:c.jsx(Kl,{}),label:"Convert to Markdown",hotkey:"cell.viewAsMarkdown",handle:()=>{const U=_();U&&(Kn({autoInstantiate:y,createNewCell:o}),ur(U,{language:"markdown",keepCodeAsIs:!1}))}},{icon:c.jsx(Wo,{size:13,strokeWidth:1.5}),label:"Convert to SQL",handle:()=>{const U=_();U&&(Kn({autoInstantiate:y,createNewCell:o}),ur(U,{language:"sql",keepCodeAsIs:!1}))}},{icon:c.jsx(Xl,{}),label:"Toggle as Python",handle:()=>{const U=_();U&&(Kn({autoInstantiate:y,createNewCell:o}),QM(U,"python",{force:!0}))}}],[{icon:c.jsxs(Ns,{children:[c.jsx(li,{size:13,strokeWidth:1.5}),c.jsx(Jl,{size:8,strokeWidth:2})]}),label:"Create cell above",hotkey:"cell.createAbove",handle:()=>o({cellId:j,before:!0})},{icon:c.jsxs(Ns,{children:[c.jsx(li,{size:13,strokeWidth:1.5}),c.jsx(jo,{size:8,strokeWidth:2})]}),label:"Create cell below",hotkey:"cell.createBelow",handle:()=>o({cellId:j,before:!1})},{icon:c.jsx(Jl,{size:13,strokeWidth:1.5}),label:"Move cell up",hotkey:"cell.moveUp",handle:()=>a({cellId:j,before:!0})},{icon:c.jsx(jo,{size:13,strokeWidth:1.5}),label:"Move cell down",hotkey:"cell.moveDown",handle:()=>a({cellId:j,before:!1})},{icon:c.jsx(Nk,{size:13,strokeWidth:1.5}),label:"Move cell left",hotkey:"cell.moveLeft",handle:()=>a({cellId:j,direction:"left"}),hidden:w!=="columns"},{icon:c.jsx(Ta,{size:13,strokeWidth:1.5}),label:"Move cell right",hotkey:"cell.moveRight",handle:()=>a({cellId:j,direction:"right"}),hidden:w!=="columns"},{icon:c.jsx(zc,{size:13,strokeWidth:1.5}),label:"Send to top",hotkey:"cell.sendToTop",handle:()=>i({cellId:j,scroll:!1})},{icon:c.jsx(Fc,{size:13,strokeWidth:1.5}),label:"Send to bottom",hotkey:"cell.sendToBottom",handle:()=>l({cellId:j,scroll:!1})},{icon:c.jsx(e9,{size:13,strokeWidth:1.5}),label:"Break into new column",hotkey:"cell.addColumnBreakpoint",hidden:w!=="columns",handle:()=>d({cellId:j})}],[{icon:c.jsx(fj,{size:13,strokeWidth:1.5}),label:"Copy link to cell",disabled:!Fp(E),tooltip:Fp(E)?void 0:"Only named cells can be linked to",handle:async()=>{await on(function(U){const $=new URL(window.location.href);return $.hash=`scrollTo=${encodeURIComponent(U)}`,$.toString()}(E)),Je({description:"Link copied to clipboard"})}}],[{label:"Delete",hidden:!m,variant:"danger",icon:c.jsx(Zl,{size:13,strokeWidth:1.5}),handle:()=>{x({cellId:j})}}]].map(Kj).filter(Yj),e[24]=d,e[25]=b,e[26]=w,e[27]=y,e[28]=m,e[29]=j,e[30]=u,e[31]=C.disabled,e[32]=C.hide_code,e[33]=o,e[34]=x,e[35]=_,e[36]=I,e[37]=M,e[38]=a,e[39]=E,e[40]=f,e[41]=l,e[42]=i,e[43]=p,e[44]=h,e[45]=D,e[46]=N,e[47]=B,e[48]=O,e[49]=R,e[50]=A):A=e[50],A}function Yj(t){return t.length>0}function Kj(t){return t.filter(Xj)}function Xj(t){return!t.hidden}function Jj(t){t==null||t.stopPropagation(),t==null||t.preventDefault()}function Zj(t){return!t.hidden}const od=yt(!1),Bp=()=>{const t=H.c(37),[e,n]=Ot(od),o=t9(),r=Se(n9),s=Se(Ql);let a;t[0]!==r?(a={cell:r},t[0]=r,t[1]=a):a=t[1];let i=nd(a).flat();i=gi(i);const l=function(){const N=H.c(75),[k,B]=fr(),[A,U]=Ek(),{saveAppConfig:$,saveUserConfig:X}=et();let Y;N[0]!==X||N[1]!==B?(Y=async re=>{await X({config:re}).then(()=>{B(re)})},N[0]=X,N[1]=B,N[2]=Y):Y=N[2];const G=Y;let W;N[3]!==$||N[4]!==U?(W=async re=>{await $({config:re}).then(()=>{U(re)})},N[3]=$,N[4]=U,N[5]=W):W=N[5];const J=W;let V;if(N[6]!==A||N[7]!==k||N[8]!==J||N[9]!==G){let re,ne,ae,se,ie;N[11]!==A?(re=He=>He!==A.width,N[11]=A,N[12]=re):re=N[12],N[13]!==A||N[14]!==J?(ne=He=>({label:`App config > Set width=${He}`,handle:()=>{J({...A,width:He})}}),N[13]=A,N[14]=J,N[15]=ne):ne=N[15],N[16]!==k||N[17]!==G?(ae={label:"Config > Set theme: dark",handle:()=>{G({...k,display:{...k.display,theme:"dark"}})}},N[16]=k,N[17]=G,N[18]=ae):ae=N[18],N[19]!==k||N[20]!==G?(se={label:"Config > Set theme: light",handle:()=>{G({...k,display:{...k.display,theme:"light"}})}},N[19]=k,N[20]=G,N[21]=se):se=N[21],N[22]!==k||N[23]!==G?(ie={label:"Config > Set theme: system",handle:()=>{G({...k,display:{...k.display,theme:"system"}})}},N[22]=k,N[23]=G,N[24]=ie):ie=N[24];const ge=k.keymap.preset==="vim";let oe,ue;N[25]!==k||N[26]!==G?(oe=()=>{G({...k,keymap:{...k.keymap,preset:"vim"}})},N[25]=k,N[26]=G,N[27]=oe):oe=N[27],N[28]!==ge||N[29]!==oe?(ue={label:"Config > Switch keymap to VIM",hidden:ge,handle:oe},N[28]=ge,N[29]=oe,N[30]=ue):ue=N[30];const de=k.keymap.preset==="default";let Ce,Te,Fe;N[31]!==k||N[32]!==G?(Ce=()=>{G({...k,keymap:{...k.keymap,preset:"default"}})},N[31]=k,N[32]=G,N[33]=Ce):Ce=N[33],N[34]!==de||N[35]!==Ce?(Te={label:"Config > Switch keymap to default (current: VIM)",hidden:de,handle:Ce},N[34]=de,N[35]=Ce,N[36]=Te):Te=N[36],N[37]!==k||N[38]!==G?(Fe=()=>{G({...k,completion:{...k.completion,copilot:!1}})},N[37]=k,N[38]=G,N[39]=Fe):Fe=N[39];const _e=k.completion.copilot!=="github";let ke,Ye;N[40]!==Fe||N[41]!==_e?(ke={label:"Config > Disable GitHub Copilot",handle:Fe,hidden:_e},N[40]=Fe,N[41]=_e,N[42]=ke):ke=N[42],N[43]!==k||N[44]!==G?(Ye=()=>{G({...k,completion:{...k.completion,copilot:"github"}})},N[43]=k,N[44]=G,N[45]=Ye):Ye=N[45];const Ve=k.completion.copilot==="github";let Ke;N[46]!==Ye||N[47]!==Ve?(Ke={label:"Config > Enable GitHub Copilot",handle:Ye,hidden:Ve},N[46]=Ye,N[47]=Ve,N[48]=Ke):Ke=N[48];const ee=!k.display.reference_highlighting;let ye,we,Ie,K;N[49]!==k||N[50]!==G?(ye=()=>{G({...k,display:{...k.display,reference_highlighting:!1}})},N[49]=k,N[50]=G,N[51]=ye):ye=N[51],N[52]!==ee||N[53]!==ye?(we={label:"Config > Disable reference highlighting",hidden:ee,handle:ye},N[52]=ee,N[53]=ye,N[54]=we):we=N[54],N[55]!==k||N[56]!==G?(Ie=()=>{G({...k,display:{...k.display,reference_highlighting:!0}})},N[55]=k,N[56]=G,N[57]=Ie):Ie=N[57],N[58]!==k.display.reference_highlighting||N[59]!==Ie?(K={label:"Config > Enable reference highlighting",hidden:k.display.reference_highlighting,handle:Ie},N[58]=k.display.reference_highlighting,N[59]=Ie,N[60]=K):K=N[60];const me=k.display.cell_output==="above";let pe,he;N[61]!==k||N[62]!==G?(pe=()=>{G({...k,display:{...k.display,cell_output:"above"}})},N[61]=k,N[62]=G,N[63]=pe):pe=N[63],N[64]!==me||N[65]!==pe?(he={label:"Config > Set cell output area: above",hidden:me,handle:pe},N[64]=me,N[65]=pe,N[66]=he):he=N[66];const je=k.display.cell_output==="below";let Pe,Re;N[67]!==k||N[68]!==G?(Pe=()=>{G({...k,display:{...k.display,cell_output:"below"}})},N[67]=k,N[68]=G,N[69]=Pe):Pe=N[69],N[70]!==je||N[71]!==Pe?(Re={label:"Config > Set cell output area: below",hidden:je,handle:Pe},N[70]=je,N[71]=Pe,N[72]=Re):Re=N[72],V=[...cR().filter(re).map(ne),ae,se,ie,ue,Te,ke,Ke,we,K,he,Re],N[6]=A,N[7]=k,N[8]=J,N[9]=G,N[10]=V}else V=N[10];const Q=V;let te;return N[73]!==Q?(te=Q.filter(Zj),N[73]=Q,N[74]=te):te=N[74],te}();let d=gg();d=[...gi(d),...gi(l)];const u=d.filter(Qj),h=ec.keyBy(u,eS),{recentCommands:f,addRecentCommand:m}=Wj();let x;t[2]!==f?(x=new Set(f),t[2]=f,t[3]=x):x=t[3];const g=x;let p,b;t[4]!==s||t[5]!==n?(p=N=>{Yf(s.getHotkey("global.commandPalette").key)(N)&&(N.preventDefault(),n(tS))},t[4]=s,t[5]=n,t[6]=p):p=t[6],Wl(document,"keydown",p),t[7]!==m||t[8]!==s||t[9]!==o||t[10]!==n?(b=(N,k)=>{const B=o[N];if(!B)return null;const A=s.getHotkey(N);return c.jsxs(Xn,{disabled:k.disabled,onSelect:()=>{m(N),n(!1),requestAnimationFrame(()=>{B()})},value:A.name,children:[c.jsxs("span",{children:[A.name,k.tooltip&&c.jsx("span",{className:"ml-2",children:k.tooltip})]}),c.jsx(Ik,{children:c.jsx(Kf,{shortcut:A.key})})]},N)},t[7]=m,t[8]=s,t[9]=o,t[10]=n,t[11]=b):b=t[11];const y=b;let v;t[12]!==m||t[13]!==s||t[14]!==n?(v=N=>{const{label:k,handle:B,props:A,hotkey:U}=N,$=A===void 0?{}:A;return c.jsxs(Xn,{disabled:$.disabled,onSelect:()=>{m(k),n(!1),requestAnimationFrame(()=>{B()})},value:k,children:[c.jsxs("span",{children:[k,$.tooltip&&c.jsxs("span",{className:"ml-2",children:["(",$.tooltip,")"]})]}),U&&c.jsx(Ik,{children:c.jsx(Kf,{shortcut:s.getHotkey(U).key})})]},k)},t[12]=m,t[13]=s,t[14]=n,t[15]=v):v=t[15];const w=v,S=r9;let j;t[16]===Symbol.for("react.memo_cache_sentinel")?(j=c.jsx(Ma,{placeholder:"Type to search..."}),t[16]=j):j=t[16];const C=Gf;let _;t[17]===Symbol.for("react.memo_cache_sentinel")?(_=c.jsx(tc,{children:"No results found."}),t[17]=_):_=t[17];const E=f.length>0&&c.jsxs(c.Fragment,{children:[c.jsx(qf,{heading:"Recently Used",children:f.map(N=>{const k=h[N];return o9(N)?y(N,{disabled:k==null?void 0:k.disabled,tooltip:k==null?void 0:k.tooltip}):k&&!Lp(k)?w({label:k.label,handle:k.handleHeadless||k.handle,props:{disabled:k.disabled,tooltip:k.tooltip}}):null})}),c.jsx(_k,{})]}),M=qf,I=s.iterate().map(N=>{if(g.has(N))return null;const k=h[N];return y(N,{disabled:k==null?void 0:k.disabled,tooltip:k==null?void 0:k.tooltip})}),D=u.map(N=>g.has(N.label)?null:w({label:N.label,handle:N.handleHeadless||N.handle,props:{disabled:N.disabled,tooltip:N.tooltip}}));let F;t[18]!==g||t[19]!==w?(F=N=>g.has(N.label)?null:w({label:`Cell > ${N.label}`,handle:N.handleHeadless||N.handle,props:{disabled:N.disabled,tooltip:N.tooltip}}),t[18]=g,t[19]=w,t[20]=F):F=t[20];const O=i.map(F);let P,R,z;return t[21]!==M||t[22]!==D||t[23]!==O||t[24]!==I?(P=c.jsxs(M,{heading:"Commands",children:[I,D,O]}),t[21]=M,t[22]=D,t[23]=O,t[24]=I,t[25]=P):P=t[25],t[26]!==C||t[27]!==P||t[28]!==_||t[29]!==E?(R=c.jsxs(C,{children:[_,E,P]}),t[26]=C,t[27]=P,t[28]=_,t[29]=E,t[30]=R):R=t[30],t[31]!==S||t[32]!==e||t[33]!==n||t[34]!==R||t[35]!==j?(z=c.jsxs(S,{open:e,onOpenChange:n,children:[j,R]}),t[31]=S,t[32]=e,t[33]=n,t[34]=R,t[35]=j,t[36]=z):z=t[36],z};function Qj(t){return!t.hotkey}function eS(t){return t.label}function tS(t){return!t}function Zo(){return at().optional().describe(ze.of({label:"Password",inputType:"password",placeholder:"password",optionRegex:".*password.*"}))}function Up(){return at().optional().describe(ze.of({label:"Token",inputType:"password",placeholder:"token",optionRegex:".*token.*"}))}function bi(){return at().optional().describe(ze.of({label:"Warehouse Name",placeholder:"warehouse",optionRegex:".*warehouse.*"}))}function $p(){return at().optional().describe(ze.of({label:"URI",optionRegex:".*uri.*"}))}function Qo(){return at().nonempty().describe(ze.of({label:"Host",placeholder:"localhost",optionRegex:".*host.*"}))}function Qn(){return at().describe(ze.of({label:"Database",placeholder:"db name",optionRegex:".*database.*"}))}function er(){return at().nonempty().describe(ze.of({label:"Username",placeholder:"username",optionRegex:".*username.*"}))}function tr(t){const e=s9.string().describe(ze.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 Vp(){return as().default(!1).describe(ze.of({label:"Read Only"}))}const Hp=ut({type:pt("postgres"),host:Qo(),port:tr(5432).optional(),database:Qn(),username:er(),password:Zo(),ssl:as().default(!1).describe(ze.of({label:"Use SSL"}))}).describe(ze.of({direction:"two-columns"})),Wp=ut({type:pt("mysql"),host:Qo(),port:tr(3306),database:Qn(),username:er(),password:Zo(),ssl:as().default(!1).describe(ze.of({label:"Use SSL"}))}).describe(ze.of({direction:"two-columns"})),qp=ut({type:pt("sqlite"),database:Qn().describe(ze.of({label:"Database Path"}))}).describe(ze.of({direction:"two-columns"})),Gp=ut({type:pt("duckdb"),database:Qn().describe(ze.of({label:"Database Path"})),read_only:Vp()}).describe(ze.of({direction:"two-columns"})),Yp=ut({type:pt("motherduck"),database:Qn().default("my_db").describe(ze.of({label:"Database Name"})),token:Up()}).describe(ze.of({direction:"two-columns"})),Kp=ut({type:pt("snowflake"),account:at().nonempty().describe(ze.of({label:"Account",optionRegex:".*snowflake.*"})),warehouse:at().optional().describe(ze.of({label:"Warehouse",optionRegex:".*snowflake.*"})),database:Qn(),schema:at().optional().describe(ze.of({label:"Schema",optionRegex:".*snowflake.*"})),username:er(),password:Zo(),role:at().optional().describe(ze.of({label:"Role"}))}).describe(ze.of({direction:"two-columns"})),Xp=ut({type:pt("bigquery"),project:at().nonempty().describe(ze.of({label:"Project ID",optionRegex:".*bigquery.*"})),dataset:at().nonempty().describe(ze.of({label:"Dataset",optionRegex:".*bigquery.*"})),credentials_json:at().describe(ze.of({label:"Credentials JSON",inputType:"textarea"}))}).describe(ze.of({direction:"two-columns"})),Jp=ut({type:pt("clickhouse_connect"),host:Qo(),port:tr(8123).optional(),username:er(),password:Zo(),secure:as().default(!1).describe(ze.of({label:"Use HTTPs"}))}).describe(ze.of({direction:"two-columns"})),Zp=ut({type:pt("timeplus"),host:Qo().default("localhost"),port:tr(8123).optional(),username:er().default("default"),password:Zo().default("")}).describe(ze.of({direction:"two-columns"})),Qp=ut({type:pt("chdb"),database:Qn().describe(ze.of({label:"Database Path"})),read_only:Vp()}).describe(ze.of({direction:"two-columns"})),eg=ut({type:pt("trino"),host:Qo(),port:tr(8080),database:Qn(),schema:at().describe(ze.of({label:"Schema",placeholder:"schema name",optionRegex:".*schema.*"})).optional(),username:er(),password:Zo(),async_support:as().default(!1).describe(ze.of({label:"Async Support"}))}).describe(ze.of({direction:"two-columns"})),tg=ut({type:pt("iceberg"),name:at().describe(ze.of({label:"Catalog Name"})),catalog:Xf("type",[ut({type:pt("REST"),warehouse:bi(),uri:at().optional().describe(ze.of({label:"URI",placeholder:"https://",optionRegex:".*uri.*"})),token:Up()}),ut({type:pt("SQL"),warehouse:bi(),uri:at().optional().describe(ze.of({label:"URI",placeholder:"jdbc:iceberg://host:port/database",optionRegex:".*uri.*"}))}),ut({type:pt("Hive"),warehouse:bi(),uri:$p()}),ut({type:pt("Glue"),warehouse:bi(),uri:$p()}),ut({type:pt("DynamoDB"),"dynamodb.profile-name":at().optional().describe(ze.of({label:"Profile Name"})),"dynamodb.region":at().optional().describe(ze.of({label:"Region"})),"dynamodb.access-key-id":at().optional().describe(ze.of({label:"Access Key ID"})),"dynamodb.secret-access-key":at().optional().describe(ze.of({label:"Secret Access Key",inputType:"password"})),"dynamodb.session-token":at().optional().describe(ze.of({label:"Session Token",inputType:"password"}))})]).default({type:"REST"}).describe(ze.of({special:"tabs"}))}),ng=ut({type:pt("datafusion"),sessionContext:as().optional().describe(ze.of({label:"Use Session Context"}))}),og=ut({type:pt("pyspark"),host:Qo().optional(),port:tr().optional()}),rg=ut({type:pt("redshift"),host:Qo(),port:tr(5439),connectionType:Xf("type",[ut({type:pt("IAM credentials"),region:at().describe(ze.of({label:"Region"})),aws_access_key_id:at().nonempty().describe(ze.of({label:"AWS Access Key ID",inputType:"password",optionRegex:".*aws_access_key_id.*"})),aws_secret_access_key:at().nonempty().describe(ze.of({label:"AWS Secret Access Key",inputType:"password",optionRegex:".*aws_secret_access_key.*"})),aws_session_token:at().optional().describe(ze.of({label:"AWS Session Token",inputType:"password",optionRegex:".*aws_session_token.*"}))}),ut({type:pt("DB credentials"),user:er(),password:Zo()})]).default({type:"IAM credentials",aws_access_key_id:"",aws_secret_access_key:"",region:""}),database:Qn()}).describe(ze.of({direction:"two-columns"})),nS=Xf("type",[Hp,Wp,qp,Gp,Yp,Kp,Xp,Jp,Zp,Qp,eg,tg,ng,og,rg]),rd="env:";function yi(t){return typeof t=="string"&&t.startsWith(rd)}function sd(t){return`${rd}${t}`}const sg={sqlmodel:"SQLModel",sqlalchemy:"SQLAlchemy",duckdb:"DuckDB",clickhouse_connect:"ClickHouse Connect",chdb:"chDB",pyiceberg:"PyIceberg",ibis:"Ibis",motherduck:"MotherDuck",redshift:"Redshift"};class qt{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 oS{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),yi(n)){const r=n.replace(rd,""),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"?kr(n):n?`"${n}"`:""}printInFString(e,n,o){if(n===void 0)return"";if(typeof n=="number")return`${n}`;if(typeof n=="boolean")return kr(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 yi(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-C_dGiPTC.js","./index-n_GqBKKX.js","./index-BlxPam9h.css","./compile-Cl1o_7gd.js","./time-BBJ6iAB1.js","./timer-BwIYMJWC.js","./linear-D4x1AG46.js","./init-DLRA0X12.js","./range-CtcPcB_L.js","./zoom-COrs4lFh.js","./ordinal-DDUp3AbE.js","./colors-bszWmPJw.js","./step-BwsUM5iJ.js","./arc-ZB5pDULS.js","./index-BEQfoZiP.js","./storage-CKj6hBJ4.js","./index-Iu6x1Jci.js","./index-C-QER5Cp.js","./index-CKQgVkGV.js","./index-DJxlooVE.js","./index-BZNmfXXH.js","./index-CbiaqnTb.js","./index-vW5au9aB.js","./index-dct4iFjA.js","./index-CbwpqzaQ.js","./index-DwvfLR8r.js","./index-DaU5TnVr.js","./index-qKWbz5C3.js","./index-d72fnN8m.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","./trash-CeVKfwMo.js","./storage-B6yZpgAI.css","./links-BBNCB9lj.js","./index-Ot6DHYIK.js","./links-Dn1Stwqz.css","./circle-play-BCDLFs3E.js","./_createAggregator-CzywzDdV.js","./_baseEach-AJIvfl2o.js","./loro_wasm_bg-C3hKWL9L.js","./transform-B8bpuzxV.js","./sortBy-BqJLBYny.js","./_baseMap-CrkWz8qo.js","./terminal-YtWC9fV-.js","./terminal-B3isKKSk.css"])))=>i.map(i=>d[i]);
|
2
|
+
var RM=Object.defineProperty;var uk=Tt=>{throw TypeError(Tt)};var LM=(Tt,wt,Qt)=>wt in Tt?RM(Tt,wt,{enumerable:!0,configurable:!0,writable:!0,value:Qt}):Tt[wt]=Qt;var Z=(Tt,wt,Qt)=>LM(Tt,typeof wt!="symbol"?wt+"":wt,Qt),FM=(Tt,wt,Qt)=>wt.has(Tt)||uk("Cannot "+Qt);var hk=(Tt,wt,Qt)=>(FM(Tt,wt,"read from private field"),Qt?Qt.call(Tt):wt.get(Tt)),fk=(Tt,wt,Qt)=>wt.has(Tt)?uk("Cannot add the same private member more than once"):wt instanceof WeakSet?wt.add(Tt):wt.set(Tt,Qt);import{c as Ee,is as dr,it as zM,iu as zf,iv as mk,iw as BM,ix as UM,iy as pk,iz as Ul,U as T,iA as $M,iB as VM,iC as gk,iD as HM,dH as WM,dK as qM,b as q,dF as Bf,a as H,T as et,ac as Je,j as c,a1 as Pn,a9 as $o,a8 as os,aa as rs,bn as Vo,a6 as ve,ab as on,iE as Ca,a7 as Ho,aS as Rn,ad as Na,at as Ne,ao as jt,dY as Uf,eM as Ea,iF as GM,aN as Le,S as it,iG as YM,e_ as gn,iH as xk,iI as bk,iJ as $l,iK as yk,L as ft,dx as Vl,aX as Wo,iL as Hl,aZ as $f,ag as Zt,iM as KM,aw as _a,iN as XM,iO as vk,eZ as wk,al as yt,b4 as kk,iP as jk,cA as Wl,iQ as JM,dP as Qe,iR as ql,dW as En,iS as Ia,V as Se,b9 as _n,iT as Gl,iU as Yl,eP as ss,iV as ZM,iW as Aa,iX as Sk,eX as Ck,iY as Vf,iZ as Hf,ep as Wf,i_ as Kn,i$ as ur,aV as Kl,j0 as QM,j1 as Xl,j2 as Jl,au as jo,ed as Nk,av as Ta,j3 as e9,j4 as Zl,bp as hr,eQ as fr,ft as Ek,bd as Ot,j5 as t9,j6 as n9,ga as Ql,aP as ec,j7 as qf,j8 as o9,j9 as _k,ja as Gf,jb as r9,jc as Yf,jd as Xn,je as Ik,gc as Kf,jf as Ma,jg as tc,eu as ut,ew as as,jh as pt,ji as ze,jj as at,jk as Xf,jl as s9,jm as Jf,jn as gt,jo as Ak,dr as Oa,dm as Da,dn as Pa,dp as Ra,dl as is,fG as Zf,b3 as Ln,aJ as In,fw as Tk,fy as Mk,fz as a9,fE as i9,fA as Ok,jp as Dk,ar as xe,eo as l9,b1 as So,a$ as Co,b2 as No,a_ as It,eY as rn,jq as Pk,fC as Rk,jr as c9,js as d9,fu as Lk,fv as Fk,jt as ls,dq as zk,ju as Bk,jv as u9,jw as h9,a5 as f9,a4 as m9,jx as Qf,du as p9,dw as em,fh as nc,jy as oc,jz as rc,bs as xn,eT as La,fe as sn,bi as Uk,dZ as zt,ej as g9,a2 as tm,jA as Fa,jB as sc,jC as x9,jD as b9,jE as $k,a3 as y9,ae as za,eJ as Vk,jF as Wt,aW as v9,af as nm,gf as Hk,eq as ac,jG as w9,gz as om,bh as ic,bk as k9,jH as j9,jI as Wk,gJ as S9,gH as C9,gK as N9,gL as E9,jJ as rm,ds as Fn,jK as _9,jL as lc,jM as cs,q as Jn,o as We,fX as zn,jN as bn,jO as nt,jP as ds,jQ as At,gb as Dt,jR as sm,et as yn,jS as I9,jT as am,bf as qk,bg as Gk,jU as A9,gB as us,jV as cc,bc as dc,gC as mr,e$ as im,jW as T9,jX as Yk,jY as Ba,jZ as Kk,j_ as lm,j$ as Xk,k0 as Jk,k1 as Zk,k2 as Qk,f0 as cm,k3 as M9,k4 as Zn,k5 as uc,k6 as e3,dt as t3,k7 as hc,gw as dm,k8 as Ua,k9 as $a,ka as Va,kb as fc,kc as qo,kd as n3,ke as Eo,kf as hs,kg as um,kh as Ha,ki as fs,kj as hm,kk as fm,kl as o3,km as mc,kn as O9,ay as Wa,ko as qa,kp as D9,dV as pc,kq as P9,kr as mm,ks as R9,kt as L9,ku as gc,e2 as F9,kv as pr,kw as xc,kx as ms,fW as An,g4 as _o,fS as r3,cl as s3,ky as pm,fF as a3,eI as i3,kz as l3,kA as Ga,kB as c3,kC as bc,kD as gm,kE as ps,kF as Ya,kG as Ka,kH as z9,fO as yc,kI as xm,kJ as vc,ei as B9,fP as U9,kK as $9,kL as V9,kM as H9,kN as W9,u as q9,kO as G9,kP as Y9,kQ as K9,f_ as X9,kR as J9,kS as d3,t as L,kT as Z9,kU as Q9,kV as eO,kW as tO,kX as nO,kY as oO,kZ as rO,k_ as sO,k$ as aO,l0 as iO,l1 as lO,l2 as cO,l3 as dO,l4 as uO,l5 as hO,l6 as fO,l7 as mO,l8 as pO,l9 as gO,la as xO,lb as bO,lc as yO,ld as Xa,le as vO,lf as wO,lg as kO,lh as jO,li as SO,lj as CO,lk as NO,ll as EO,lm as bm,ln as wc,lo as u3,lp as _O,lq as IO,lr as h3,ls as AO,lt as gs,lu as Tn,lv as TO,lw as MO,lx as OO,ly as DO,lz as PO,lA as RO,lB as LO,lC as FO,lD as zO,lE as BO,lF as Go,lG as UO,lH as $O,lI as VO,lJ as HO,d$ as WO,lK as qO,lL as f3,e3 as GO,lM as kc,lN as YO,lO as KO,lP as XO,lQ as JO,gM as Yo,lR as jc,lS as ZO,lT as QO,lU as m3,lV as ym,gA as xs,lW as eD,lX as tD,lY as nD,lZ as Ja,l_ as Za,eW as vm,l$ as oD,g3 as rD,bm as sD,an as wm,m0 as p3,m1 as aD,m2 as iD,m3 as km,m4 as jm,m5 as lD,m6 as g3,m7 as x3,m8 as Sc,fR as cD,Y as b3,dN as dD,m9 as y3,fr as vt,ma as Qa,mb as bs,mc as uD,md as hD,me as fD,mf as mD,ck as Sm,mg as pD,am as Ko,be as v3,mh as gD,mi as xD,mj as bD,mk as Cc,ml as w3,dL as Nc,bo as k3,ev as yD,mm as j3,mn as S3,mo as C3,mp as vD,mq as N3,mr as E3,ms as ei,mt as wD,mu as _3,mv as kD,mw as jD,mx as I3,Z as Ec,my as SD,bq as A3,mz as CD,as as Io,mA as ND,mB as ti,mC as ED,mD as T3,eV as M3,fI as _c,mE as Cm,aU as Nm,en as Ic,em as Em,mF as _D,eS as O3,mG as ID,mH as D3,fq as AD,mI as TD,gr as MD,fx as OD,fB as _m,gu as DD,bl as ni,mJ as P3,mK as Im,mL as PD,mM as RD,mN as LD,_ as vn,er as FD,mO as zD,mP as BD,mQ as R3,fj as Am,dz as L3,mR as UD,aq as gr,mS as $D,mT as VD,mU as HD,aO as WD,mV as qD,mW as GD,mX as YD,W as KD,mY as Ac,ff as XD,mZ as F3,fM as JD,gj as ZD,m_ as QD,m$ as z3,n0 as eP,n1 as ys,n2 as tP,n3 as Tc,n4 as nP,n5 as oP,n6 as rP,z as B3,gF as sP,n7 as oi,n8 as U3,n9 as $3,na as V3,nb as H3,nc as aP,C as W3,nd as iP,ne as lP,nf as cP,E as xr,f5 as q3,bb as dP,b8 as uP,ng as hP,nh as fP,ni as mP,dC as G3,nj as Tm,nk as pP,dX as Y3,nl as gP,nm as Mm,nn as xP,no as bP,np as yP,nq as K3,nr as X3,ns as J3,fd as Z3,nt as vP,nu as wP,nv as Q3,nw as ej,nx as Mc,ny as tj,nz as nj,nA as oj,nB as kP,nC as jP,nD as rj,nE as SP,nF as CP,nG as NP,nH as EP,nI as _P,nJ as IP,dU as AP,nK as TP,nL as MP,nM as OP,nN as DP,nO as PP,nP as RP,nQ as LP,nR as FP,nS as zP,nT as BP,nU as UP,fU as $P,nV as VP,nW as HP,nX as sj,nY as WP,ax as qP,nZ as GP,ap as YP,eL as KP,n_ as XP,gm as Om,gk as vs,gn as br,gl as yr,go as Dm,gp as Pm,n$ as aj,o0 as ij,o1 as lj,o2 as Xo,gt as JP,o3 as ZP,o4 as QP,o5 as eR,o6 as tR,o7 as nR,o8 as cj,eA as oR,o9 as Rm,oa as rR,ah as Oc,ob as dj,oc as uj,aj as hj,ai as sR,dT as aR,__tla as iR}from"./index-n_GqBKKX.js";import{b as ws,A as lR,L as fj,g as cR,G as dR,o as mj,s as uR,k as hR,B as pj,a as fR,M as mR,Y as pR,c as an,u as ri,C as gR,S as xR,K as bR,d as yR,i as vR,e as gj,f as wR,h as kR,j as si,P as ai,l as xj,m as jR,n as SR,p as CR,D as ks,q as NR,r as bj,t as Lm,T as ER}from"./links-BBNCB9lj.js";import{V as yj,d as vr,I as Fm,N as vj,S as wj,e as kj,f as jj,L as Sj,g as Cj,F as Nj,M as _R,l as Ej,h as IR,E as Dc,i as AR,j as zm,k as Bm,n as TR,o as MR,p as OR,q as DR,s as PR,t as RR,v as LR,w as FR,u as zR,C as BR,R as _j,A as UR,a as $R,T as VR,x as HR,y as WR,m as qR,z as GR,B as YR,O as KR,c as XR,P as JR,__tla as ZR}from"./storage-CKj6hBJ4.js";import{c as QR}from"./_createAggregator-CzywzDdV.js";import{_ as Ij,a as Aj,i as eL,w as tL,L as Tj,A as nL,C as Mj,b as Um,c as Oj,__tla as oL}from"./loro_wasm_bg-C3hKWL9L.js";import{s as Bn,i as Jo,T as $m,a as Vm}from"./transform-B8bpuzxV.js";import{g as Dj}from"./timer-BwIYMJWC.js";import{i as rL}from"./zoom-COrs4lFh.js";import{s as ii}from"./sortBy-BqJLBYny.js";let Hm,Pc,ln,Rc,Pj,js,sL=Promise.all([(()=>{try{return iR}catch{}})(),(()=>{try{return ZR}catch{}})(),(()=>{try{return oL}catch{}})()]).then(async()=>{var Bl,lk;var Tt=QR(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});let wt,Qt,Wm,Lc,Ss,wr,Fc,zc,qm,Gm,li,Bc,Ym,ci,Km,Uc,Xm,Jm,$c,Zm,Qm,ep,di,tp,Vc,np,op,rp,sp,ap,ip,Hc,lp,Wc,qc,cp,dp,up,hp,fp,mp,ui,pp,gp,Gc,xp,bp,yp,Yc,vp,wp,kp,hi,Kc,Xc,jp,Sp,Cp,Np,Ep,_p,Ip,Ap,Tp,Jc,Zc,Mp,Op,Dp,fi,cn,dn;wt=Ee("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),Qt=Ee("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"}]]),Wm=Ee("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"}]]),Lc=Ee("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),Ss=Ee("ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]),wr=Ee("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"}]]),Fc=Ee("chevrons-down",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]),zc=Ee("chevrons-up",[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]]),Rc=Ee("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),qm=Ee("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),Gm=Ee("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),li=Ee("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),Bc=Ee("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"}]]),Ym=Ee("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"}]]),ci=Ee("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"}]]),Km=Ee("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]),Uc=Ee("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"}]]),Xm=Ee("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"}]]),Jm=Ee("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"}]]),$c=Ee("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"}]]),Zm=Ee("eraser",[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]]),Qm=Ee("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=Ee("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"}]]),di=Ee("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"}]]),tp=Ee("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"}]]),Vc=Ee("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"}]]),np=Ee("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"}]]),op=Ee("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"}]]),rp=Ee("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"}]]),sp=Ee("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"}]]),ap=Ee("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"}]]),ip=Ee("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"}]]),Hc=Ee("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"}]]),lp=Ee("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"}]]),Wc=Ee("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"}]]),qc=Ee("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"}]]),cp=Ee("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"}]]),dp=Ee("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"}]]),up=Ee("map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]),hp=Ee("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"}]]),fp=Ee("message-circle-question-mark",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),mp=Ee("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"}]]),ui=Ee("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"}]]),pp=Ee("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"}]]),gp=Ee("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"}]]),Gc=Ee("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"}]]),xp=Ee("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),bp=Ee("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"}]]),yp=Ee("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"}]]),Yc=Ee("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"}]]),vp=Ee("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"}]]),wp=Ee("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"}]]),kp=Ee("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"}]]),hi=Ee("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"}]]),Kc=Ee("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"}]]),Xc=Ee("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"}]]),jp=Ee("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"}]]),Sp=Ee("square-code",[["path",{d:"m10 9-3 3 3 3",key:"1oro0q"}],["path",{d:"m14 15 3-3-3-3",key:"bz13h7"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]),Cp=Ee("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"}]]),Np=Ee("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"}]]),Ep=Ee("square-m",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 16V8l4 4 4-4v8",key:"141u4e"}]]),_p=Ee("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"}]]),Ip=Ee("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"}]]),Ap=Ee("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"}]]),Tp=Ee("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"}]]),Jc=Ee("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"}]]),Zc=Ee("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"}]]),Mp=Ee("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]),Op=Ee("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"}]]),Dp=Ee("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"}]]),fi=Ee("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"}]]),cn=Ee("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"}]]),dn=Ee("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"}]]);function mi(t,e){const n=+dr(t)-+dr(e);return n<0?-1:n>0?1:n}function Rj(t,e){const n=dr(t,e==null?void 0:e.in);return+function(o,r){const s=dr(o,r==null?void 0:r.in);return s.setHours(23,59,59,999),s}(n,e)==+function(o,r){const s=dr(o,r==null?void 0:r.in),a=s.getMonth();return s.setFullYear(s.getFullYear(),a+1,0),s.setHours(23,59,59,999),s}(n,e)}function Lj(t,e,n){const[o,r,s]=zf(n==null?void 0:n.in,t,t,e),a=mi(r,s),i=Math.abs(function(u,h,f){const[m,x]=zf(f==null?void 0:f.in,u,h);return 12*(m.getFullYear()-x.getFullYear())+(m.getMonth()-x.getMonth())}(r,s));if(i<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-a*i);let l=mi(r,s)===-a;Rj(o)&&i===1&&mi(o,s)===1&&(l=!1);const d=a*(i-+l);return d===0?0:d}function Fj(t,e,n){const o=function(r,s){return+dr(r)-+dr(s)}(t,e)/1e3;return(r=>{const s=(0,Math.trunc)(r);return s===0?0:s})(o)}function zj(t,e){return function(n,o,r){const s=BM(),a=(r==null?void 0:r.locale)??s.locale??UM,i=mi(n,o);if(isNaN(i))throw new RangeError("Invalid time value");const l=Object.assign({},r,{addSuffix:r==null?void 0:r.addSuffix,comparison:i}),[d,u]=zf(r==null?void 0:r.in,...i>0?[o,n]:[n,o]),h=Fj(u,d),f=(mk(u)-mk(d))/1e3,m=Math.round((h-f)/60);let x;if(m<2)return m===0?a.formatDistance("lessThanXMinutes",1,l):a.formatDistance("xMinutes",m,l);if(m<45)return a.formatDistance("xMinutes",m,l);if(m<90)return a.formatDistance("aboutXHours",1,l);if(m<pk){const g=Math.round(m/60);return a.formatDistance("aboutXHours",g,l)}if(m<2520)return a.formatDistance("xDays",1,l);if(m<Ul){const g=Math.round(m/pk);return a.formatDistance("xDays",g,l)}if(m<2*Ul)return x=Math.round(m/Ul),a.formatDistance("aboutXMonths",x,l);if(x=Lj(u,d),x<12){const g=Math.round(m/Ul);return a.formatDistance("xMonths",g,l)}{const g=x%12,p=Math.trunc(x/12);return g<3?a.formatDistance("aboutXYears",p,l):g<9?a.formatDistance("overXYears",p,l):a.formatDistance("almostXYears",p+1,l)}}(t,function(n){return zM(n,Date.now())}(t),e)}const Bj=T.createContext({}),Uj=T.forwardRef(function(t,e){[t,e]=WM(t,e,Bj);let{toolbarProps:n}=function(s,a){const{"aria-label":i,"aria-labelledby":l,orientation:d="horizontal"}=s;let[u,h]=T.useState(!1);$M(()=>{var p;h(!(!a.current||!(!((p=a.current.parentElement)===null||p===void 0)&&p.closest('[role="toolbar"]'))))});const{direction:f}=VM(),m=f==="rtl"&&d==="horizontal";let x=HM(a);const g=T.useRef(null);return{toolbarProps:{...gk(s,{labelable:!0}),role:u?"group":"toolbar","aria-orientation":d,"aria-label":i,"aria-labelledby":i==null?l:void 0,onKeyDownCapture:u?void 0:p=>{if(p.currentTarget.contains(p.target)){if(d==="horizontal"&&p.key==="ArrowRight"||d==="vertical"&&p.key==="ArrowDown")m?x.focusPrevious():x.focusNext();else{if(!(d==="horizontal"&&p.key==="ArrowLeft"||d==="vertical"&&p.key==="ArrowUp"))return p.key==="Tab"?(p.stopPropagation(),g.current=document.activeElement,void(p.shiftKey?x.focusFirst():x.focusLast())):void 0;m?x.focusNext():x.focusPrevious()}p.stopPropagation(),p.preventDefault()}},onFocusCapture:u?void 0:p=>{var b,y;g.current&&!p.currentTarget.contains(p.relatedTarget)&&(!((b=a.current)===null||b===void 0)&&b.contains(p.target))&&((y=g.current)===null||y===void 0||y.focus(),g.current=null)},onBlurCapture:u?void 0:p=>{p.currentTarget.contains(p.relatedTarget)||g.current||(g.current=p.target)}}}}(t,e),o=qM({...t,values:{orientation:t.orientation||"horizontal"},defaultClassName:"react-aria-Toolbar"}),r=gk(t);return delete r.id,q.createElement("div",{...Bf(n,r),...o,ref:e,slot:t.slot||void 0,"data-orientation":t.orientation||"horizontal"},o.children)}),pi="https://static.marimo.app",$j=t=>{const e=H.c(25),{onClose:n}=t,[o,r]=T.useState(""),{exportAsHTML:s}=et();let a;a=Math.random().toString(36).slice(2,6);const i=`${o}-${a}`,l=`${pi}/static/${i}`;let d,u,h,f,m,x,g,p,b,y,v;return e[0]!==s||e[1]!==n||e[2]!==i?(d=async w=>{w.preventDefault(),n();const S=await s({download:!1,includeCode:!0,files:yj.INSTANCE.filenames()}),j=Je({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${pi}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:S,path:i})}).catch(()=>{j.dismiss(),Je({title:"Error uploading static page",description:c.jsxs("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",c.jsx("a",{href:Pn.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),j.dismiss(),Je({title:"Static page uploaded!",description:c.jsxs("div",{children:["The URL has been copied to your clipboard.",c.jsx("br",{}),"You can share it with anyone."]})})},e[0]=s,e[1]=n,e[2]=i,e[3]=d):d=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(u=c.jsx($o,{children:"Share static notebook"}),e[4]=u):u=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(h=c.jsxs(os,{children:[u,c.jsxs(rs,{children:["You can publish a static, non-interactive version of this notebook to the public web. We will create a link for you that lives on"," ",c.jsx("a",{href:pi,target:"_blank",children:pi}),"."]})]}),e[5]=h):h=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(f=w=>{const S=w.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,"");r(S)},e[6]=f):f=e[6],e[7]!==o?(m=c.jsx(Vo,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:f,required:!0,autoComplete:"off"}),e[7]=o,e[8]=m):m=e[8],e[9]!==l?(x=c.jsxs("div",{className:"font-semibold text-sm text-muted-foreground gap-2 flex flex-col",children:["Anyone will be able to access your notebook at this URL:",c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Vj,{text:l}),c.jsx("span",{className:"text-primary",children:l})]})]}),e[9]=l,e[10]=x):x=e[10],e[11]!==m||e[12]!==x?(g=c.jsxs("div",{className:"flex flex-col gap-6 py-4",children:[m,x]}),e[11]=m,e[12]=x,e[13]=g):g=e[13],e[14]!==n?(p=c.jsx(ve,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),e[14]=n,e[15]=p):p=e[15],e[16]!==l?(b=c.jsx(ve,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await on(l)},children:"Create"}),e[16]=l,e[17]=b):b=e[17],e[18]!==b||e[19]!==p?(y=c.jsxs(Ca,{children:[p,b]}),e[18]=b,e[19]=p,e[20]=y):y=e[20],e[21]!==y||e[22]!==d||e[23]!==g?(v=c.jsx(Ho,{className:"w-fit",children:c.jsxs("form",{onSubmit:d,children:[h,g,y]})}),e[21]=y,e[22]=d,e[23]=g,e[24]=v):v=e[24],v},Vj=t=>{const e=H.c(8),[n,o]=q.useState(!1);let r;e[0]!==t.text?(r=Rn.stopPropagation(async d=>{d.preventDefault(),await on(t.text),o(!0),setTimeout(()=>o(!1),2e3)}),e[0]=t.text,e[1]=r):r=e[1];const s=r;let a,i,l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(Na,{size:14,strokeWidth:1.5}),e[2]=a):a=e[2],e[3]!==s?(i=c.jsx(ve,{"data-testid":"copy-static-notebook-url-button",onClick:s,size:"xs",variant:"secondary",children:a}),e[3]=s,e[4]=i):i=e[4],e[5]!==n||e[6]!==i?(l=c.jsx(Ne,{content:"Copied!",open:n,children:i}),e[5]=n,e[6]=i,e[7]=l):l=e[7],l};function Pp(){const t=H.c(2),e=jt(Uf);let n;return t[0]!==e?(n=()=>{const o=document.getElementsByClassName("output-area"),r=window.innerHeight||document.documentElement.clientHeight;let s=null;for(const a of Array.from(o)){const i=a.getBoundingClientRect();if(i.top>=0&&i.top<=r||i.bottom>=0&&i.bottom<=r){s=Ea.parse(a.parentNode.id);break}}e(a=>({mode:GM(a.mode),cellAnchor:s})),requestAnimationFrame(()=>{var a;s!==null&&((a=document.getElementById(Ea.create(s)))==null||a.scrollIntoView())})},t[0]=e,t[1]=n):n=t[1],n}function Qc(t){const e=H.c(3),n=Cs();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],Le(o)}function Rp(){const t=H.c(2),e=Cs();let n;return t[0]!==e?(n=()=>e(xk(gn())),t[0]=e,t[1]=n):n=t[1],Le(n)}function Cs(){const t=H.c(3),{prepareForRun:e}=it(),{sendRun:n}=et();let o;return t[0]!==e||t[1]!==n?(o=async r=>{var l,d;if(r.length===0)return;const{cellHandles:s,cellData:a}=gn(),i=[];for(const u of r){const h=s[u],f=(l=h==null?void 0:h.current)==null?void 0:l.editorView;let m;f?(bk(f)!=="markdown"&&$l(f),m=yk(f)):m=((d=a[u])==null?void 0:d.code)||"",i.push(m),e({cellId:u})}await n({cellIds:r,codes:i}).catch(Hj)},t[0]=e,t[1]=n,t[2]=o):o=t[2],Le(o)}function Hj(t){ft.error(t)}const ed=[{type:"files",Icon:np,tooltip:"View files",position:"sidebar"},{type:"variables",Icon:Vl,tooltip:"Explore variables",position:"sidebar"},{type:"datasources",Icon:Wo,tooltip:"Explore data sources",position:"sidebar"},{type:"dependencies",Icon:ui,tooltip:"Explore dependencies",position:"sidebar"},{type:"packages",Icon:ws,tooltip:"Manage packages",position:"sidebar"},{type:"outline",Icon:Xc,tooltip:"View outline",position:"sidebar"},{type:"chat",Icon:Hl,tooltip:"Chat with AI",position:"sidebar"},{type:"documentation",Icon:Jc,tooltip:"View live docs",position:"sidebar"},{type:"logs",Icon:$f,tooltip:"Notebook logs",position:"sidebar"},{type:"tracing",Icon:lR,tooltip:"Tracing",position:"sidebar"},{type:"snippets",Icon:Cp,tooltip:"Snippets",position:"sidebar"},{type:"secrets",Icon:ip,tooltip:"Secrets",hidden:Zt(),position:"sidebar"},{type:"scratchpad",Icon:KM,tooltip:"Scratchpad",position:"sidebar"},{type:"errors",Icon:_a,tooltip:"View errors",position:"footer"}];function Wj(){const t=H.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],t[0]=e):e=t[0];const[n,o]=function(a,i){const l=H.c(11);let d;l[0]!==i?(d=new XM(i),l[0]=i,l[1]=d):d=l[1];const u=d;let h;l[2]!==a||l[3]!==u?(h=()=>u.get(a),l[2]=a,l[3]=u,l[4]=h):h=l[4];const[f,m]=T.useState(h);let x;l[5]!==a||l[6]!==u?(x=b=>{m(b),u.set(a,b)},l[5]=a,l[6]=u,l[7]=x):x=l[7];const g=x;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=a=>{const i=(l=[a,...n],[...new Set(l)]);var l;o(i.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 Lp(t){return t.dropdown!==void 0}function gi(t,e=""){return t.flatMap(n=>n.label?Lp(n)?gi(n.dropdown,`${e+n.label} > `):{...n,label:e+n.label}:[])}const Ns=t=>{const e=H.c(8),{children:n,layerTop:o}=t,r=o!==void 0&&o;let s;e[0]!==n?(s=q.Children.toArray(n),e[0]=n,e[1]=s):s=e[1];const[a,i]=s,l=`second-icon absolute ${r?"top-[-2px] left-[-2px]":"bottom-[-2px] right-[-2px]"} rounded-full`;let d,u;return e[2]!==i||e[3]!==l?(d=c.jsx("div",{className:l,children:i}),e[2]=i,e[3]=l,e[4]=d):d=e[4],e[5]!==a||e[6]!==d?(u=c.jsxs("div",{className:"multi-icon relative w-fit",children:[a,d]}),e[5]=a,e[6]=d,e[7]=u):u=e[7],u},Es=yt(null),qj=yt(!1),td=kk("marimo:ai:chatState:v3",{chats:[],activeChatId:null}),Gj=yt(t=>{const e=t(td);return e.chats.find(n=>n.id===e.activeChatId)},(t,e,n)=>{e(td,o=>({...o,activeChatId:n}))});function Fp(t){return t!==jk&&!!(t&&t.trim().length>0)}const xi=t=>{const e=H.c(7);let n,o;e[0]!==t?(n=i=>{var l;(i.ctrlKey||i.metaKey)&&i.key==="z"&&(i.preventDefault(),i.stopPropagation(),(l=t.onClick)==null||l.call(t,i))},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],Wl(window,"keydown",n,o);const r=t.children??"Undo";let s,a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(s=c.jsx(JM,{className:"ml-2",shortcut:"cmd-z"}),e[3]=s):s=e[3],e[4]!==r||e[5]!==t?(a=c.jsxs(ve,{"data-testid":"undo-button",size:"sm",variant:"outline",...t,children:[r," ",s]}),e[4]=r,e[5]=t,e[6]=a):a=e[6],a};function _s(){const t=H.c(4),{deleteCell:e,undoDeleteCell:n}=it(),{sendDeleteCell:o}=et();let r;return t[0]!==e||t[1]!==o||t[2]!==n?(r=s=>{var d;if(Qe.get(ql))return;const{cellId:a}=s,i=Qe.get(En),l=(((d=i.cellData[a])==null?void 0:d.code)??"").trim()==="";if(e({cellId:a}),o({cellId:a}).catch(()=>{n()}),!l){const{dismiss:u}=Je({title:"Cell deleted",description:"You can bring it back by clicking undo or through the command palette.",action:c.jsx(xi,{"data-testid":"undo-delete-button",onClick:()=>{n(),h()}})}),h=u}},t[0]=e,t[1]=o,t[2]=n,t[3]=r):r=t[3],Le(r)}function Is(){const t=H.c(4),{deleteCell:e,undoDeleteCell:n}=it(),{sendDeleteCell:o}=et();let r;return t[0]!==e||t[1]!==o||t[2]!==n?(r=async s=>{if(Qe.get(ql))return;const{cellIds:a}=s;for(const d of a)await o({cellId:d}).then(()=>{e({cellId:d})});const{dismiss:i}=Je({title:"Cells deleted",action:c.jsx(xi,{"data-testid":"undo-delete-button",onClick:()=>{for(const d of a)n();l()}})}),l=i},t[0]=e,t[1]=o,t[2]=n,t[3]=r):r=t[3],Le(r)}function zp(){const t=H.c(3),{splitCell:e,undoSplitCell:n}=it();let o;return t[0]!==e||t[1]!==n?(o=r=>{const s=Ia(r.cellId);if(!s)return;const a=yk(s);e(r);const{dismiss:i}=Je({title:"Cell split",action:c.jsx(xi,{"data-testid":"undo-split-button",size:"sm",variant:"outline",onClick:()=>{n({...r,snapshot:a}),l()},children:"Undo"})}),l=i},t[0]=e,t[1]=n,t[2]=o):o=t[2],Le(o)}function nd(t){const e=H.c(51),{cell:n}=t,{createNewCell:o,updateCellConfig:r,updateCellName:s,moveCell:a,sendToTop:i,sendToBottom:l,addColumnBreakpoint:d,clearCellOutput:u}=it(),h=zp(),f=Qc(n==null?void 0:n.cellId),m=!Se(ql),x=_s(),{openModal:g}=_n(),p=jt(Es),b=Se(Gl),y=Se(Yl),v=Se(ss),w=Se(ZM),{saveCellConfig:S}=et();if(!n||v){let U;return e[0]===Symbol.for("react.memo_cache_sentinel")?(U=[],e[0]=U):U=e[0],U}const{cellId:j,config:C,getEditorView:_,name:E,hasOutput:M,hasConsoleOutput:I,status:D}=n;let F;e[1]!==j||e[2]!==C.disabled||e[3]!==S||e[4]!==r?(F=async()=>{const U={disabled:!C.disabled};await S({configs:{[j]:U}}),r({cellId:j,config:U})},e[1]=j,e[2]=C.disabled,e[3]=S,e[4]=r,e[5]=F):F=e[5];const O=F;let P;e[6]!==j||e[7]!==C.hide_code||e[8]!==_||e[9]!==S||e[10]!==r?(P=async()=>{const U={hide_code:!C.hide_code};await S({configs:{[j]:U}}),r({cellId:j,config:U});const $=_();$&&(U.hide_code?$.contentDOM.blur():$.focus())},e[6]=j,e[7]=C.hide_code,e[8]=_,e[9]=S,e[10]=r,e[11]=P):P=e[11];const R=P;let z,N,k,B,A;return e[12]===Symbol.for("react.memo_cache_sentinel")?(z=c.jsx(Tp,{size:13,strokeWidth:1.5}),e[12]=z):z=e[12],e[13]!==j||e[14]!==E||e[15]!==g||e[16]!==s?(N=()=>{g(c.jsxs(Ho,{children:[c.jsx(os,{children:c.jsx($o,{children:"Rename cell"})}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(hr,{htmlFor:"cell-name",children:"Cell name"}),c.jsx(vj,{placeholder:"cell name",value:E,onKeyDown:U=>{U.key==="Enter"&&(U.preventDefault(),U.stopPropagation(),g(null))},onChange:U=>s({cellId:j,name:U})})]})]}))},e[13]=j,e[14]=E,e[15]=g,e[16]=s,e[17]=N):N=e[17],e[18]!==j||e[19]!==s?(k=U=>s({cellId:j,name:U}),e[18]=j,e[19]=s,e[20]=k):k=e[20],e[21]!==E||e[22]!==k?(B=c.jsx(vj,{placeholder:"cell name",value:E,onChange:k}),e[21]=E,e[22]=k,e[23]=B):B=e[23],e[24]!==d||e[25]!==b||e[26]!==w||e[27]!==y||e[28]!==m||e[29]!==j||e[30]!==u||e[31]!==C.disabled||e[32]!==C.hide_code||e[33]!==o||e[34]!==x||e[35]!==_||e[36]!==I||e[37]!==M||e[38]!==a||e[39]!==E||e[40]!==f||e[41]!==l||e[42]!==i||e[43]!==p||e[44]!==h||e[45]!==D||e[46]!==N||e[47]!==B||e[48]!==O||e[49]!==R?(A=[[{icon:z,label:"Name",disableClick:!0,handle:Jj,handleHeadless:N,rightElement:B},{icon:c.jsx(vr,{size:13,strokeWidth:1.5}),label:"Run cell",hotkey:"cell.run",hidden:D==="running"||D==="queued"||D==="disabled-transitively"||C.disabled,handle:()=>f()},{icon:c.jsx(Aa,{size:13,strokeWidth:1.5}),label:"AI completion",hidden:!b,handle:()=>{p(U=>(U==null?void 0:U.cellId)===j?null:{cellId:j})},hotkey:"cell.aiCompletion"},{icon:c.jsx(Kc,{size:13,strokeWidth:1.5}),label:"Split cell",hotkey:"cell.splitCell",handle:()=>h({cellId:j})},{icon:c.jsx(Fm,{size:13,strokeWidth:1.5}),label:"Export output as PNG",hidden:!M,handle:()=>function(U){const $=document.getElementById(vk.create(U));$&&($.classList.add("printing-output"),wk($,"result.png").finally(()=>{$.classList.remove("printing-output")}))}(j)},{icon:c.jsx(Ck,{size:13,strokeWidth:1.5}),label:"Format cell",hotkey:"cell.format",handle:()=>{const U=_();U&&Sk({[j]:U})}},{icon:C.hide_code?c.jsx(Vf,{size:13,strokeWidth:1.5}):c.jsx(Hf,{size:13,strokeWidth:1.5}),label:C.hide_code?"Show code":"Hide code",handle:R,hotkey:"cell.hideCode"},{icon:C.disabled?c.jsx(cn,{size:13,strokeWidth:1.5}):c.jsx(dn,{size:13,strokeWidth:1.5}),label:"Reactive execution",rightElement:c.jsx(Wf,{"data-testid":"cell-disable-switch",checked:!C.disabled,size:"sm",onCheckedChange:O}),handle:O},{icon:c.jsx(_a,{size:13,strokeWidth:1.5}),label:"Clear output",hidden:!(M||I),handle:()=>{u({cellId:j})}}],[{icon:c.jsx(Kl,{}),label:"Convert to Markdown",hotkey:"cell.viewAsMarkdown",handle:()=>{const U=_();U&&(Kn({autoInstantiate:y,createNewCell:o}),ur(U,{language:"markdown",keepCodeAsIs:!1}))}},{icon:c.jsx(Wo,{size:13,strokeWidth:1.5}),label:"Convert to SQL",handle:()=>{const U=_();U&&(Kn({autoInstantiate:y,createNewCell:o}),ur(U,{language:"sql",keepCodeAsIs:!1}))}},{icon:c.jsx(Xl,{}),label:"Toggle as Python",handle:()=>{const U=_();U&&(Kn({autoInstantiate:y,createNewCell:o}),QM(U,"python",{force:!0}))}}],[{icon:c.jsxs(Ns,{children:[c.jsx(li,{size:13,strokeWidth:1.5}),c.jsx(Jl,{size:8,strokeWidth:2})]}),label:"Create cell above",hotkey:"cell.createAbove",handle:()=>o({cellId:j,before:!0})},{icon:c.jsxs(Ns,{children:[c.jsx(li,{size:13,strokeWidth:1.5}),c.jsx(jo,{size:8,strokeWidth:2})]}),label:"Create cell below",hotkey:"cell.createBelow",handle:()=>o({cellId:j,before:!1})},{icon:c.jsx(Jl,{size:13,strokeWidth:1.5}),label:"Move cell up",hotkey:"cell.moveUp",handle:()=>a({cellId:j,before:!0})},{icon:c.jsx(jo,{size:13,strokeWidth:1.5}),label:"Move cell down",hotkey:"cell.moveDown",handle:()=>a({cellId:j,before:!1})},{icon:c.jsx(Nk,{size:13,strokeWidth:1.5}),label:"Move cell left",hotkey:"cell.moveLeft",handle:()=>a({cellId:j,direction:"left"}),hidden:w!=="columns"},{icon:c.jsx(Ta,{size:13,strokeWidth:1.5}),label:"Move cell right",hotkey:"cell.moveRight",handle:()=>a({cellId:j,direction:"right"}),hidden:w!=="columns"},{icon:c.jsx(zc,{size:13,strokeWidth:1.5}),label:"Send to top",hotkey:"cell.sendToTop",handle:()=>i({cellId:j,scroll:!1})},{icon:c.jsx(Fc,{size:13,strokeWidth:1.5}),label:"Send to bottom",hotkey:"cell.sendToBottom",handle:()=>l({cellId:j,scroll:!1})},{icon:c.jsx(e9,{size:13,strokeWidth:1.5}),label:"Break into new column",hotkey:"cell.addColumnBreakpoint",hidden:w!=="columns",handle:()=>d({cellId:j})}],[{icon:c.jsx(fj,{size:13,strokeWidth:1.5}),label:"Copy link to cell",disabled:!Fp(E),tooltip:Fp(E)?void 0:"Only named cells can be linked to",handle:async()=>{await on(function(U){const $=new URL(window.location.href);return $.hash=`scrollTo=${encodeURIComponent(U)}`,$.toString()}(E)),Je({description:"Link copied to clipboard"})}}],[{label:"Delete",hidden:!m,variant:"danger",icon:c.jsx(Zl,{size:13,strokeWidth:1.5}),handle:()=>{x({cellId:j})}}]].map(Kj).filter(Yj),e[24]=d,e[25]=b,e[26]=w,e[27]=y,e[28]=m,e[29]=j,e[30]=u,e[31]=C.disabled,e[32]=C.hide_code,e[33]=o,e[34]=x,e[35]=_,e[36]=I,e[37]=M,e[38]=a,e[39]=E,e[40]=f,e[41]=l,e[42]=i,e[43]=p,e[44]=h,e[45]=D,e[46]=N,e[47]=B,e[48]=O,e[49]=R,e[50]=A):A=e[50],A}function Yj(t){return t.length>0}function Kj(t){return t.filter(Xj)}function Xj(t){return!t.hidden}function Jj(t){t==null||t.stopPropagation(),t==null||t.preventDefault()}function Zj(t){return!t.hidden}const od=yt(!1),Bp=()=>{const t=H.c(37),[e,n]=Ot(od),o=t9(),r=Se(n9),s=Se(Ql);let a;t[0]!==r?(a={cell:r},t[0]=r,t[1]=a):a=t[1];let i=nd(a).flat();i=gi(i);const l=function(){const N=H.c(75),[k,B]=fr(),[A,U]=Ek(),{saveAppConfig:$,saveUserConfig:X}=et();let Y;N[0]!==X||N[1]!==B?(Y=async re=>{await X({config:re}).then(()=>{B(re)})},N[0]=X,N[1]=B,N[2]=Y):Y=N[2];const G=Y;let W;N[3]!==$||N[4]!==U?(W=async re=>{await $({config:re}).then(()=>{U(re)})},N[3]=$,N[4]=U,N[5]=W):W=N[5];const J=W;let V;if(N[6]!==A||N[7]!==k||N[8]!==J||N[9]!==G){let re,ne,ae,se,ie;N[11]!==A?(re=He=>He!==A.width,N[11]=A,N[12]=re):re=N[12],N[13]!==A||N[14]!==J?(ne=He=>({label:`App config > Set width=${He}`,handle:()=>{J({...A,width:He})}}),N[13]=A,N[14]=J,N[15]=ne):ne=N[15],N[16]!==k||N[17]!==G?(ae={label:"Config > Set theme: dark",handle:()=>{G({...k,display:{...k.display,theme:"dark"}})}},N[16]=k,N[17]=G,N[18]=ae):ae=N[18],N[19]!==k||N[20]!==G?(se={label:"Config > Set theme: light",handle:()=>{G({...k,display:{...k.display,theme:"light"}})}},N[19]=k,N[20]=G,N[21]=se):se=N[21],N[22]!==k||N[23]!==G?(ie={label:"Config > Set theme: system",handle:()=>{G({...k,display:{...k.display,theme:"system"}})}},N[22]=k,N[23]=G,N[24]=ie):ie=N[24];const ge=k.keymap.preset==="vim";let oe,ue;N[25]!==k||N[26]!==G?(oe=()=>{G({...k,keymap:{...k.keymap,preset:"vim"}})},N[25]=k,N[26]=G,N[27]=oe):oe=N[27],N[28]!==ge||N[29]!==oe?(ue={label:"Config > Switch keymap to VIM",hidden:ge,handle:oe},N[28]=ge,N[29]=oe,N[30]=ue):ue=N[30];const de=k.keymap.preset==="default";let Ce,Te,Fe;N[31]!==k||N[32]!==G?(Ce=()=>{G({...k,keymap:{...k.keymap,preset:"default"}})},N[31]=k,N[32]=G,N[33]=Ce):Ce=N[33],N[34]!==de||N[35]!==Ce?(Te={label:"Config > Switch keymap to default (current: VIM)",hidden:de,handle:Ce},N[34]=de,N[35]=Ce,N[36]=Te):Te=N[36],N[37]!==k||N[38]!==G?(Fe=()=>{G({...k,completion:{...k.completion,copilot:!1}})},N[37]=k,N[38]=G,N[39]=Fe):Fe=N[39];const _e=k.completion.copilot!=="github";let ke,Ye;N[40]!==Fe||N[41]!==_e?(ke={label:"Config > Disable GitHub Copilot",handle:Fe,hidden:_e},N[40]=Fe,N[41]=_e,N[42]=ke):ke=N[42],N[43]!==k||N[44]!==G?(Ye=()=>{G({...k,completion:{...k.completion,copilot:"github"}})},N[43]=k,N[44]=G,N[45]=Ye):Ye=N[45];const Ve=k.completion.copilot==="github";let Ke;N[46]!==Ye||N[47]!==Ve?(Ke={label:"Config > Enable GitHub Copilot",handle:Ye,hidden:Ve},N[46]=Ye,N[47]=Ve,N[48]=Ke):Ke=N[48];const ee=!k.display.reference_highlighting;let ye,we,Ie,K;N[49]!==k||N[50]!==G?(ye=()=>{G({...k,display:{...k.display,reference_highlighting:!1}})},N[49]=k,N[50]=G,N[51]=ye):ye=N[51],N[52]!==ee||N[53]!==ye?(we={label:"Config > Disable reference highlighting",hidden:ee,handle:ye},N[52]=ee,N[53]=ye,N[54]=we):we=N[54],N[55]!==k||N[56]!==G?(Ie=()=>{G({...k,display:{...k.display,reference_highlighting:!0}})},N[55]=k,N[56]=G,N[57]=Ie):Ie=N[57],N[58]!==k.display.reference_highlighting||N[59]!==Ie?(K={label:"Config > Enable reference highlighting",hidden:k.display.reference_highlighting,handle:Ie},N[58]=k.display.reference_highlighting,N[59]=Ie,N[60]=K):K=N[60];const me=k.display.cell_output==="above";let pe,he;N[61]!==k||N[62]!==G?(pe=()=>{G({...k,display:{...k.display,cell_output:"above"}})},N[61]=k,N[62]=G,N[63]=pe):pe=N[63],N[64]!==me||N[65]!==pe?(he={label:"Config > Set cell output area: above",hidden:me,handle:pe},N[64]=me,N[65]=pe,N[66]=he):he=N[66];const je=k.display.cell_output==="below";let Pe,Re;N[67]!==k||N[68]!==G?(Pe=()=>{G({...k,display:{...k.display,cell_output:"below"}})},N[67]=k,N[68]=G,N[69]=Pe):Pe=N[69],N[70]!==je||N[71]!==Pe?(Re={label:"Config > Set cell output area: below",hidden:je,handle:Pe},N[70]=je,N[71]=Pe,N[72]=Re):Re=N[72],V=[...cR().filter(re).map(ne),ae,se,ie,ue,Te,ke,Ke,we,K,he,Re],N[6]=A,N[7]=k,N[8]=J,N[9]=G,N[10]=V}else V=N[10];const Q=V;let te;return N[73]!==Q?(te=Q.filter(Zj),N[73]=Q,N[74]=te):te=N[74],te}();let d=gg();d=[...gi(d),...gi(l)];const u=d.filter(Qj),h=ec.keyBy(u,eS),{recentCommands:f,addRecentCommand:m}=Wj();let x;t[2]!==f?(x=new Set(f),t[2]=f,t[3]=x):x=t[3];const g=x;let p,b;t[4]!==s||t[5]!==n?(p=N=>{Yf(s.getHotkey("global.commandPalette").key)(N)&&(N.preventDefault(),n(tS))},t[4]=s,t[5]=n,t[6]=p):p=t[6],Wl(document,"keydown",p),t[7]!==m||t[8]!==s||t[9]!==o||t[10]!==n?(b=(N,k)=>{const B=o[N];if(!B)return null;const A=s.getHotkey(N);return c.jsxs(Xn,{disabled:k.disabled,onSelect:()=>{m(N),n(!1),requestAnimationFrame(()=>{B()})},value:A.name,children:[c.jsxs("span",{children:[A.name,k.tooltip&&c.jsx("span",{className:"ml-2",children:k.tooltip})]}),c.jsx(Ik,{children:c.jsx(Kf,{shortcut:A.key})})]},N)},t[7]=m,t[8]=s,t[9]=o,t[10]=n,t[11]=b):b=t[11];const y=b;let v;t[12]!==m||t[13]!==s||t[14]!==n?(v=N=>{const{label:k,handle:B,props:A,hotkey:U}=N,$=A===void 0?{}:A;return c.jsxs(Xn,{disabled:$.disabled,onSelect:()=>{m(k),n(!1),requestAnimationFrame(()=>{B()})},value:k,children:[c.jsxs("span",{children:[k,$.tooltip&&c.jsxs("span",{className:"ml-2",children:["(",$.tooltip,")"]})]}),U&&c.jsx(Ik,{children:c.jsx(Kf,{shortcut:s.getHotkey(U).key})})]},k)},t[12]=m,t[13]=s,t[14]=n,t[15]=v):v=t[15];const w=v,S=r9;let j;t[16]===Symbol.for("react.memo_cache_sentinel")?(j=c.jsx(Ma,{placeholder:"Type to search..."}),t[16]=j):j=t[16];const C=Gf;let _;t[17]===Symbol.for("react.memo_cache_sentinel")?(_=c.jsx(tc,{children:"No results found."}),t[17]=_):_=t[17];const E=f.length>0&&c.jsxs(c.Fragment,{children:[c.jsx(qf,{heading:"Recently Used",children:f.map(N=>{const k=h[N];return o9(N)?y(N,{disabled:k==null?void 0:k.disabled,tooltip:k==null?void 0:k.tooltip}):k&&!Lp(k)?w({label:k.label,handle:k.handleHeadless||k.handle,props:{disabled:k.disabled,tooltip:k.tooltip}}):null})}),c.jsx(_k,{})]}),M=qf,I=s.iterate().map(N=>{if(g.has(N))return null;const k=h[N];return y(N,{disabled:k==null?void 0:k.disabled,tooltip:k==null?void 0:k.tooltip})}),D=u.map(N=>g.has(N.label)?null:w({label:N.label,handle:N.handleHeadless||N.handle,props:{disabled:N.disabled,tooltip:N.tooltip}}));let F;t[18]!==g||t[19]!==w?(F=N=>g.has(N.label)?null:w({label:`Cell > ${N.label}`,handle:N.handleHeadless||N.handle,props:{disabled:N.disabled,tooltip:N.tooltip}}),t[18]=g,t[19]=w,t[20]=F):F=t[20];const O=i.map(F);let P,R,z;return t[21]!==M||t[22]!==D||t[23]!==O||t[24]!==I?(P=c.jsxs(M,{heading:"Commands",children:[I,D,O]}),t[21]=M,t[22]=D,t[23]=O,t[24]=I,t[25]=P):P=t[25],t[26]!==C||t[27]!==P||t[28]!==_||t[29]!==E?(R=c.jsxs(C,{children:[_,E,P]}),t[26]=C,t[27]=P,t[28]=_,t[29]=E,t[30]=R):R=t[30],t[31]!==S||t[32]!==e||t[33]!==n||t[34]!==R||t[35]!==j?(z=c.jsxs(S,{open:e,onOpenChange:n,children:[j,R]}),t[31]=S,t[32]=e,t[33]=n,t[34]=R,t[35]=j,t[36]=z):z=t[36],z};function Qj(t){return!t.hotkey}function eS(t){return t.label}function tS(t){return!t}function Zo(){return at().optional().describe(ze.of({label:"Password",inputType:"password",placeholder:"password",optionRegex:".*password.*"}))}function Up(){return at().optional().describe(ze.of({label:"Token",inputType:"password",placeholder:"token",optionRegex:".*token.*"}))}function bi(){return at().optional().describe(ze.of({label:"Warehouse Name",placeholder:"warehouse",optionRegex:".*warehouse.*"}))}function $p(){return at().optional().describe(ze.of({label:"URI",optionRegex:".*uri.*"}))}function Qo(){return at().nonempty().describe(ze.of({label:"Host",placeholder:"localhost",optionRegex:".*host.*"}))}function Qn(){return at().describe(ze.of({label:"Database",placeholder:"db name",optionRegex:".*database.*"}))}function er(){return at().nonempty().describe(ze.of({label:"Username",placeholder:"username",optionRegex:".*username.*"}))}function tr(t){const e=s9.string().describe(ze.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 Vp(){return as().default(!1).describe(ze.of({label:"Read Only"}))}const Hp=ut({type:pt("postgres"),host:Qo(),port:tr(5432).optional(),database:Qn(),username:er(),password:Zo(),ssl:as().default(!1).describe(ze.of({label:"Use SSL"}))}).describe(ze.of({direction:"two-columns"})),Wp=ut({type:pt("mysql"),host:Qo(),port:tr(3306),database:Qn(),username:er(),password:Zo(),ssl:as().default(!1).describe(ze.of({label:"Use SSL"}))}).describe(ze.of({direction:"two-columns"})),qp=ut({type:pt("sqlite"),database:Qn().describe(ze.of({label:"Database Path"}))}).describe(ze.of({direction:"two-columns"})),Gp=ut({type:pt("duckdb"),database:Qn().describe(ze.of({label:"Database Path"})),read_only:Vp()}).describe(ze.of({direction:"two-columns"})),Yp=ut({type:pt("motherduck"),database:Qn().default("my_db").describe(ze.of({label:"Database Name"})),token:Up()}).describe(ze.of({direction:"two-columns"})),Kp=ut({type:pt("snowflake"),account:at().nonempty().describe(ze.of({label:"Account",optionRegex:".*snowflake.*"})),warehouse:at().optional().describe(ze.of({label:"Warehouse",optionRegex:".*snowflake.*"})),database:Qn(),schema:at().optional().describe(ze.of({label:"Schema",optionRegex:".*snowflake.*"})),username:er(),password:Zo(),role:at().optional().describe(ze.of({label:"Role"}))}).describe(ze.of({direction:"two-columns"})),Xp=ut({type:pt("bigquery"),project:at().nonempty().describe(ze.of({label:"Project ID",optionRegex:".*bigquery.*"})),dataset:at().nonempty().describe(ze.of({label:"Dataset",optionRegex:".*bigquery.*"})),credentials_json:at().describe(ze.of({label:"Credentials JSON",inputType:"textarea"}))}).describe(ze.of({direction:"two-columns"})),Jp=ut({type:pt("clickhouse_connect"),host:Qo(),port:tr(8123).optional(),username:er(),password:Zo(),secure:as().default(!1).describe(ze.of({label:"Use HTTPs"}))}).describe(ze.of({direction:"two-columns"})),Zp=ut({type:pt("timeplus"),host:Qo().default("localhost"),port:tr(8123).optional(),username:er().default("default"),password:Zo().default("")}).describe(ze.of({direction:"two-columns"})),Qp=ut({type:pt("chdb"),database:Qn().describe(ze.of({label:"Database Path"})),read_only:Vp()}).describe(ze.of({direction:"two-columns"})),eg=ut({type:pt("trino"),host:Qo(),port:tr(8080),database:Qn(),schema:at().describe(ze.of({label:"Schema",placeholder:"schema name",optionRegex:".*schema.*"})).optional(),username:er(),password:Zo(),async_support:as().default(!1).describe(ze.of({label:"Async Support"}))}).describe(ze.of({direction:"two-columns"})),tg=ut({type:pt("iceberg"),name:at().describe(ze.of({label:"Catalog Name"})),catalog:Xf("type",[ut({type:pt("REST"),warehouse:bi(),uri:at().optional().describe(ze.of({label:"URI",placeholder:"https://",optionRegex:".*uri.*"})),token:Up()}),ut({type:pt("SQL"),warehouse:bi(),uri:at().optional().describe(ze.of({label:"URI",placeholder:"jdbc:iceberg://host:port/database",optionRegex:".*uri.*"}))}),ut({type:pt("Hive"),warehouse:bi(),uri:$p()}),ut({type:pt("Glue"),warehouse:bi(),uri:$p()}),ut({type:pt("DynamoDB"),"dynamodb.profile-name":at().optional().describe(ze.of({label:"Profile Name"})),"dynamodb.region":at().optional().describe(ze.of({label:"Region"})),"dynamodb.access-key-id":at().optional().describe(ze.of({label:"Access Key ID"})),"dynamodb.secret-access-key":at().optional().describe(ze.of({label:"Secret Access Key",inputType:"password"})),"dynamodb.session-token":at().optional().describe(ze.of({label:"Session Token",inputType:"password"}))})]).default({type:"REST"}).describe(ze.of({special:"tabs"}))}),ng=ut({type:pt("datafusion"),sessionContext:as().optional().describe(ze.of({label:"Use Session Context"}))}),og=ut({type:pt("pyspark"),host:Qo().optional(),port:tr().optional()}),rg=ut({type:pt("redshift"),host:Qo(),port:tr(5439),connectionType:Xf("type",[ut({type:pt("IAM credentials"),region:at().describe(ze.of({label:"Region"})),aws_access_key_id:at().nonempty().describe(ze.of({label:"AWS Access Key ID",inputType:"password",optionRegex:".*aws_access_key_id.*"})),aws_secret_access_key:at().nonempty().describe(ze.of({label:"AWS Secret Access Key",inputType:"password",optionRegex:".*aws_secret_access_key.*"})),aws_session_token:at().optional().describe(ze.of({label:"AWS Session Token",inputType:"password",optionRegex:".*aws_session_token.*"}))}),ut({type:pt("DB credentials"),user:er(),password:Zo()})]).default({type:"IAM credentials",aws_access_key_id:"",aws_secret_access_key:"",region:""}),database:Qn()}).describe(ze.of({direction:"two-columns"})),nS=Xf("type",[Hp,Wp,qp,Gp,Yp,Kp,Xp,Jp,Zp,Qp,eg,tg,ng,og,rg]),rd="env:";function yi(t){return typeof t=="string"&&t.startsWith(rd)}function sd(t){return`${rd}${t}`}const sg={sqlmodel:"SQLModel",sqlalchemy:"SQLAlchemy",duckdb:"DuckDB",clickhouse_connect:"ClickHouse Connect",chdb:"chDB",pyiceberg:"PyIceberg",ibis:"Ibis",motherduck:"MotherDuck",redshift:"Redshift"};class qt{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 oS{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),yi(n)){const r=n.replace(rd,""),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"?kr(n):n?`"${n}"`:""}printInFString(e,n,o){if(n===void 0)return"";if(typeof n=="number")return`${n}`;if(typeof n=="boolean")return kr(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 yi(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 rS extends qt{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),a=this.secrets.printInFString("database",this.connection.database);return gt(`
|
4
4
|
DATABASE_URL = f"postgresql://${o}:${n}@${r}:${s}/${a}"
|
5
5
|
engine = ${this.orm}.create_engine(DATABASE_URL${e})
|
@@ -144,5 +144,5 @@ ${M}
|
|
144
144
|
`)}),includeOtherCode:yc("")}),onFinish:I=>{e(D=>Ru(D,D.activeChatId,I.id,"assistant",I.content,I.parts))},onToolCall:async({toolCall:I})=>{try{const D=await f({toolName:I.toolName,arguments:I.args});return D.result||D.error}catch(D){return ft.error("Tool call failed:",D),`Error: ${D instanceof Error?D.message:String(D)}`}},onError:I=>{ft.error("An error occurred:",I)},onResponse:I=>{ft.debug("Received HTTP response from server:",I)}}),C=w==="submitted"||w==="streaming";T.useEffect(()=>{if(!t.activeChatId||m.length===0)return;const I=m[m.length-1];if((I==null?void 0:I.role)!=="user")return;const D=t.chats.find(P=>P.id===t.activeChatId);if(!D)return;const F=new Set(D.messages.map(P=>P.id)),O=m.filter(P=>P.role==="user"&&!F.has(P.id));O.length>0&&e(P=>{let R=P;for(const z of O)R=Ru(R,P.activeChatId,z.id,"user",z.content);return R})},[m,t.activeChatId,t.chats,e]);const _=C&&m.length>0&&(I=>{if(I.length===0)return!1;const D=I.at(-1);if(!D||D.role!=="assistant"||!D.parts)return!1;const F=D.parts;return F.length===0?!1:F[F.length-1].type==="reasoning"})(m);T.useEffect(()=>{requestAnimationFrame(()=>{if(l.current){const I=l.current;I.scrollTop=I.scrollHeight}})},[t.activeChatId]);const E=(I,D)=>{p(F=>F.slice(0,I)),t.activeChatId&&e(F=>({...F,chats:F.chats.map(O=>O.id===t.activeChatId?{...O,messages:O.messages.slice(0,I),updatedAt:Date.now()}:O)})),b({role:"user",content:D})},M=()=>{r.trim()&&(I=>{const D=Date.now(),F={id:q3(),title:I.length>50?`${I.slice(0,50)}...`:I,messages:[],createdAt:D,updatedAt:D};e(P=>({...P,chats:[...P.chats,F],activeChatId:F.id}));const O=q3();b({id:O,role:"user",content:I}),g("")})(r.trim())};return c.jsxs("div",{className:"flex flex-col h-[calc(100%-53px)]",children:[c.jsx(Cm,{children:c.jsx(c8,{onNewChat:()=>{o(null),g(""),s("")},activeChatId:n==null?void 0:n.id,setActiveChat:o,chats:[...t.chats].sort((I,D)=>D.updatedAt-I.updatedAt)})}),c.jsxs("div",{className:"flex-1 px-3 bg-(--slate-1) gap-4 py-3 flex flex-col overflow-y-auto",ref:l,children:[(!m||m.length===0)&&c.jsxs("div",{className:"flex flex-col rounded-md border bg-background",children:[c.jsx("div",{className:"px-1",children:c.jsx(Cc,{value:r,placeholder:"Ask anything, @ to include context about tables or dataframes",theme:u,onClose:()=>{var I,D;return(D=(I=a.current)==null?void 0:I.editor)==null?void 0:D.blur()},onChange:s,onSubmit:M},"new-thread-input")}),c.jsx(gh,{input:r,onSendClick:M,isLoading:C,onStop:j})]}),m.map((I,D)=>c.jsx(Jy,{message:I,index:D,theme:u,onEdit:E,setChatState:e,chatState:t,isStreamingReasoning:_,totalMessages:m.length},D)),C&&c.jsx("div",{className:"flex justify-center py-4",children:c.jsx(Nc,{className:"h-4 w-4 animate-spin"})}),v&&c.jsxs("div",{className:"flex items-center justify-center space-x-2 mb-4",children:[c.jsx(xr,{error:v}),c.jsx(ve,{variant:"outline",size:"sm",onClick:()=>{S()},children:"Retry"})]}),c.jsx("div",{ref:d})]}),C&&c.jsx("div",{className:"w-full flex justify-center items-center z-20 border-t",children:c.jsx(ve,{variant:"linkDestructive",size:"sm",onClick:j,children:"Stop"})}),m&&m.length>0&&c.jsx(Zy,{input:x,setInput:g,onSubmit:(I,D)=>{D.trim()&&y(I)},theme:u,inputRef:i,isLoading:C,onStop:j})]})};function h8(){}function f8(){}function m8(t){return c.jsx(is,{value:t.value,className:"text-xs",subtitle:c.jsx("div",{className:"text-muted-foreground text-xs pl-2",children:t.subtitle}),children:t.label},t.value)}function p8(t){return c.jsx(is,{value:t,className:"text-sm",children:t},t)}function Xt(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=Xt(t[o]))!==""&&(e+=(e&&" ")+n);else for(let n in t)t[n]&&(e+=(e&&" ")+n);return e}const{useDebugValue:g8}=q,{useSyncExternalStoreWithSelector:x8}=hP,b8=t=>t;function Qy(t,e=b8,n){const o=x8(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return g8(o),o}const ev=(t,e)=>{const n=fP(t),o=(r,s=e)=>Qy(n,r,s);return Object.assign(o,n),o};function Vt(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 Gn(t,e){if(t=function(s){let a;for(;a=s.sourceEvent;)s=a;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 y8={passive:!1},fa={capture:!0,passive:!1};function xh(t){t.stopImmediatePropagation()}function Hr(t){t.preventDefault(),t.stopImmediatePropagation()}function tv(t){var e=t.document.documentElement,n=Bn(t).on("dragstart.drag",Hr,fa);"onselectstart"in e?n.on("selectstart.drag",Hr,fa):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function nv(t,e){var n=t.document.documentElement,o=Bn(t).on("dragstart.drag",null);e&&(o.on("click.drag",Hr,fa),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 Nl=t=>()=>t;function bh(t,{sourceEvent:e,subject:n,target:o,identifier:r,active:s,x:a,y:i,dx:l,dy:d,dispatch:u}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:i,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:u}})}function v8(t){return!t.ctrlKey&&!t.button}function w8(){return this.parentNode}function k8(t,e){return e??{x:t.x,y:t.y}}function j8(){return navigator.maxTouchPoints||"ontouchstart"in this}bh.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};const El=t=>()=>t;function S8(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 yh(t){t.stopImmediatePropagation()}function ma(t){t.preventDefault(),t.stopImmediatePropagation()}function C8(t){return!(t.ctrlKey&&t.type!=="wheel"||t.button)}function N8(){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||Jo}function E8(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function _8(){return navigator.maxTouchPoints||"ontouchstart"in this}function I8(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],a=t.invertY(e[1][1])-n[1][1];return t.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}const _l=T.createContext(null),A8=_l.Provider,T8=t=>`Node type "${t}" not found. Using fallback type "default".`,M8=()=>"The React Flow parent container needs a width and a height to render the graph.",O8=()=>"Only child nodes can use a parent extent.",D8=t=>`Marker type "${t}" doesn't exist.`,P8=(t,e)=>`Couldn't create edge for ${t?"target":"source"} handle id: "${t?e.targetHandle:e.sourceHandle}", edge id: ${e.id}.`,R8=()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",L8=t=>`Edge type "${t}" not found. Using fallback type "default".`,F8=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.`,rv="[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001";function lt(t,e){const n=T.useContext(_l);if(n===null)throw new Error(rv);return Qy(n,t,e)}const Ft=()=>{const t=T.useContext(_l);if(t===null)throw new Error(rv);return T.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe,destroy:t.destroy}),[t])},z8=t=>t.userSelectionActive?"none":"all";function Il({position:t,children:e,className:n,style:o,...r}){const s=lt(z8),a=`${t}`.split("-");return q.createElement("div",{className:Xt(["react-flow__panel",n,...a]),style:{...o,pointerEvents:s},...r},e)}function B8({proOptions:t,position:e="bottom-right"}){return t!=null&&t.hideAttribution?null:q.createElement(Il,{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"},q.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}var U8=T.memo(({x:t,y:e,label:n,labelStyle:o={},labelShowBg:r=!0,labelBgStyle:s={},labelBgPadding:a=[2,4],labelBgBorderRadius:i=2,children:l,className:d,...u})=>{const h=T.useRef(null),[f,m]=T.useState({x:0,y:0,width:0,height:0}),x=Xt(["react-flow__edge-textwrapper",d]);return T.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?q.createElement("g",{transform:`translate(${t-f.width/2} ${e-f.height/2})`,className:x,visibility:f.width?"visible":"hidden",...u},r&&q.createElement("rect",{width:f.width+2*a[0],x:-a[0],y:-a[1],height:f.height+2*a[1],className:"react-flow__edge-textbg",style:s,rx:i,ry:i}),q.createElement("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:h,style:o},n),l):null});const vh=t=>({width:t.offsetWidth,height:t.offsetHeight}),Wr=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),wh=(t={x:0,y:0},e)=>({x:Wr(t.x,e[0][0],e[1][0]),y:Wr(t.y,e[0][1],e[1][1])}),sv=(t,e,n)=>t<e?Wr(Math.abs(t-e),1,50)/50:t>n?-Wr(Math.abs(t-n),1,50)/50:0,av=(t,e)=>[20*sv(t.x,35,e.width-35),20*sv(t.y,35,e.height-35)],iv=t=>{var e;return((e=t.getRootNode)==null?void 0:e.call(t))||(window==null?void 0:window.document)},kh=({x:t,y:e,width:n,height:o})=>({x:t,y:e,x2:t+n,y2:e+o}),lv=t=>({...t.positionAbsolute||{x:0,y:0},width:t.width||0,height:t.height||0}),jh=(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)},Sn=t=>!isNaN(t)&&isFinite(t),bt=Symbol.for("internals"),cv=["Enter"," ","Escape"];function Sh(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 dv=t=>"clientX"in t,Ro=(t,e)=>{var s,a;const n=dv(t),o=n?t.clientX:(s=t.touches)==null?void 0:s[0].clientX,r=n?t.clientY:(a=t.touches)==null?void 0:a[0].clientY;return{x:o-((e==null?void 0:e.left)??0),y:r-((e==null?void 0:e.top)??0)}},Al=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0},pa=({id:t,path:e,labelX:n,labelY:o,label:r,labelStyle:s,labelShowBg:a,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:d,style:u,markerEnd:h,markerStart:f,interactionWidth:m=20})=>q.createElement(q.Fragment,null,q.createElement("path",{id:t,style:u,d:e,fill:"none",className:"react-flow__edge-path",markerEnd:h,markerStart:f}),m&&q.createElement("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:m,className:"react-flow__edge-interaction"}),r&&Sn(n)&&Sn(o)?q.createElement(U8,{x:n,y:o,label:r,labelStyle:s,labelShowBg:a,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:d}):null);function ga(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,a=Math.abs(o-e)/2;return[s,o<e?o+a:o-a,r,a]}function hv({sourceX:t,sourceY:e,targetX:n,targetY:o,sourceControlX:r,sourceControlY:s,targetControlX:a,targetControlY:i}){const l=.125*t+.375*r+.375*a+.125*n,d=.125*e+.375*s+.375*i+.125*o;return[l,d,Math.abs(l-t),Math.abs(d-e)]}var lr,fv,Lo,Ch,xa,mv,Fo,ba,qr,pv,Oe,Tl;function gv({pos:t,x1:e,y1:n,x2:o,y2:r}){return t===Oe.Left||t===Oe.Right?[.5*(e+o),n]:[e,.5*(n+r)]}function xv({sourceX:t,sourceY:e,sourcePosition:n=Oe.Bottom,targetX:o,targetY:r,targetPosition:s=Oe.Top}){const[a,i]=gv({pos:n,x1:t,y1:e,x2:o,y2:r}),[l,d]=gv({pos:s,x1:o,y1:r,x2:t,y2:e}),[u,h,f,m]=hv({sourceX:t,sourceY:e,targetX:o,targetY:r,sourceControlX:a,sourceControlY:i,targetControlX:l,targetControlY:d});return[`M${t},${e} C${a},${i} ${l},${d} ${o},${r}`,u,h,f,m]}pa.displayName="BaseEdge",(fv=lr||(lr={})).Strict="strict",fv.Loose="loose",(Ch=Lo||(Lo={})).Free="free",Ch.Vertical="vertical",Ch.Horizontal="horizontal",(mv=xa||(xa={})).Partial="partial",mv.Full="full",(ba=Fo||(Fo={})).Bezier="default",ba.Straight="straight",ba.Step="step",ba.SmoothStep="smoothstep",ba.SimpleBezier="simplebezier",(pv=qr||(qr={})).Arrow="arrow",pv.ArrowClosed="arrowclosed",(Tl=Oe||(Oe={})).Left="left",Tl.Top="top",Tl.Right="right",Tl.Bottom="bottom";const Nh=T.memo(({sourceX:t,sourceY:e,targetX:n,targetY:o,sourcePosition:r=Oe.Bottom,targetPosition:s=Oe.Top,label:a,labelStyle:i,labelShowBg:l,labelBgStyle:d,labelBgPadding:u,labelBgBorderRadius:h,style:f,markerEnd:m,markerStart:x,interactionWidth:g})=>{const[p,b,y]=xv({sourceX:t,sourceY:e,sourcePosition:r,targetX:n,targetY:o,targetPosition:s});return q.createElement(pa,{path:p,labelX:b,labelY:y,label:a,labelStyle:i,labelShowBg:l,labelBgStyle:d,labelBgPadding:u,labelBgBorderRadius:h,style:f,markerEnd:m,markerStart:x,interactionWidth:g})});Nh.displayName="SimpleBezierEdge";const bv={[Oe.Left]:{x:-1,y:0},[Oe.Right]:{x:1,y:0},[Oe.Top]:{x:0,y:-1},[Oe.Bottom]:{x:0,y:1}},yv=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function $8({source:t,sourcePosition:e=Oe.Bottom,target:n,targetPosition:o=Oe.Top,center:r,offset:s}){const a=bv[e],i=bv[o],l={x:t.x+a.x*s,y:t.y+a.y*s},d={x:n.x+i.x*s,y:n.y+i.y*s},u=(({source:j,sourcePosition:C=Oe.Bottom,target:_})=>C===Oe.Left||C===Oe.Right?j.x<_.x?{x:1,y:0}:{x:-1,y:0}:j.y<_.y?{x:0,y:1}:{x:0,y:-1})({source:l,sourcePosition:e,target:d}),h=u.x!==0?"x":"y",f=u[h];let m,x,g=[];const p={x:0,y:0},b={x:0,y:0},[y,v,w,S]=uv({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(a[h]*i[h]===-1){m=r.x??y,x=r.y??v;const j=[{x:m,y:l.y},{x:m,y:d.y}],C=[{x:l.x,y:x},{x:d.x,y:x}];g=a[h]===f?h==="x"?j:C:h==="x"?C:j}else{const j=[{x:l.x,y:d.y}],C=[{x:d.x,y:l.y}];if(g=h==="x"?a.x===f?C:j:a.y===f?j:C,e===o){const M=Math.abs(t[h]-n[h]);if(M<=s){const I=Math.min(s-1,s-M);a[h]===f?p[h]=(l[h]>t[h]?-1:1)*I:b[h]=(d[h]>n[h]?-1:1)*I}}if(e!==o){const M=h==="x"?"y":"x",I=a[h]===i[M],D=l[M]>d[M],F=l[M]<d[M];(a[h]===1&&(!I&&D||I&&F)||a[h]!==1&&(!I&&F||I&&D))&&(g=h==="x"?j:C)}const _={x:l.x+p.x,y:l.y+p.y},E={x:d.x+b.x,y:d.y+b.y};Math.max(Math.abs(_.x-g[0].x),Math.abs(E.x-g[0].x))>=Math.max(Math.abs(_.y-g[0].y),Math.abs(E.y-g[0].y))?(m=(_.x+E.x)/2,x=g[0].y):(m=g[0].x,x=(_.y+E.y)/2)}return[[t,{x:l.x+p.x,y:l.y+p.y},...g,{x:d.x+b.x,y:d.y+b.y},n],m,x,w,S]}function Eh({sourceX:t,sourceY:e,sourcePosition:n=Oe.Bottom,targetX:o,targetY:r,targetPosition:s=Oe.Top,borderRadius:a=5,centerX:i,centerY:l,offset:d=20}){const[u,h,f,m,x]=$8({source:{x:t,y:e},sourcePosition:n,target:{x:o,y:r},targetPosition:s,center:{x:i,y:l},offset:d});return[u.reduce((g,p,b)=>{let y="";return y=b>0&&b<u.length-1?function(v,w,S,j){const C=Math.min(yv(v,w)/2,yv(w,S)/2,j),{x:_,y:E}=w;if(v.x===_&&_===S.x||v.y===E&&E===S.y)return`L${_} ${E}`;if(v.y===E)return`L ${_+C*(v.x<S.x?-1:1)},${E}Q ${_},${E} ${_},${E+C*(v.y<S.y?1:-1)}`;const M=v.x<S.x?1:-1;return`L ${_},${E+C*(v.y<S.y?-1:1)}Q ${_},${E} ${_+C*M},${E}`}(u[b-1],p,u[b+1],a):`${b===0?"M":"L"}${p.x} ${p.y}`,g+=y},""),h,f,m,x]}const Ml=T.memo(({sourceX:t,sourceY:e,targetX:n,targetY:o,label:r,labelStyle:s,labelShowBg:a,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:d,style:u,sourcePosition:h=Oe.Bottom,targetPosition:f=Oe.Top,markerEnd:m,markerStart:x,pathOptions:g,interactionWidth:p})=>{const[b,y,v]=Eh({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 q.createElement(pa,{path:b,labelX:y,labelY:v,label:r,labelStyle:s,labelShowBg:a,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:d,style:u,markerEnd:m,markerStart:x,interactionWidth:p})});Ml.displayName="SmoothStepEdge";const _h=T.memo(t=>{var e;return q.createElement(Ml,{...t,pathOptions:T.useMemo(()=>{var n;return{borderRadius:0,offset:(n=t.pathOptions)==null?void 0:n.offset}},[(e=t.pathOptions)==null?void 0:e.offset])})});_h.displayName="StepEdge";const Ih=T.memo(({sourceX:t,sourceY:e,targetX:n,targetY:o,label:r,labelStyle:s,labelShowBg:a,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:d,style:u,markerEnd:h,markerStart:f,interactionWidth:m})=>{const[x,g,p]=function({sourceX:b,sourceY:y,targetX:v,targetY:w}){const[S,j,C,_]=uv({sourceX:b,sourceY:y,targetX:v,targetY:w});return[`M ${b},${y}L ${v},${w}`,S,j,C,_]}({sourceX:t,sourceY:e,targetX:n,targetY:o});return q.createElement(pa,{path:x,labelX:g,labelY:p,label:r,labelStyle:s,labelShowBg:a,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:d,style:u,markerEnd:h,markerStart:f,interactionWidth:m})});function Ol(t,e){return t>=0?.5*t:25*e*Math.sqrt(-t)}function vv({pos:t,x1:e,y1:n,x2:o,y2:r,c:s}){switch(t){case Oe.Left:return[e-Ol(e-o,s),n];case Oe.Right:return[e+Ol(o-e,s),n];case Oe.Top:return[e,n-Ol(n-r,s)];case Oe.Bottom:return[e,n+Ol(r-n,s)]}}function wv({sourceX:t,sourceY:e,sourcePosition:n=Oe.Bottom,targetX:o,targetY:r,targetPosition:s=Oe.Top,curvature:a=.25}){const[i,l]=vv({pos:n,x1:t,y1:e,x2:o,y2:r,c:a}),[d,u]=vv({pos:s,x1:o,y1:r,x2:t,y2:e,c:a}),[h,f,m,x]=hv({sourceX:t,sourceY:e,targetX:o,targetY:r,sourceControlX:i,sourceControlY:l,targetControlX:d,targetControlY:u});return[`M${t},${e} C${i},${l} ${d},${u} ${o},${r}`,h,f,m,x]}Ih.displayName="StraightEdge";const Dl=T.memo(({sourceX:t,sourceY:e,targetX:n,targetY:o,sourcePosition:r=Oe.Bottom,targetPosition:s=Oe.Top,label:a,labelStyle:i,labelShowBg:l,labelBgStyle:d,labelBgPadding:u,labelBgBorderRadius:h,style:f,markerEnd:m,markerStart:x,pathOptions:g,interactionWidth:p})=>{const[b,y,v]=wv({sourceX:t,sourceY:e,sourcePosition:r,targetX:n,targetY:o,targetPosition:s,curvature:g==null?void 0:g.curvature});return q.createElement(pa,{path:b,labelX:y,labelY:v,label:a,labelStyle:i,labelShowBg:l,labelBgStyle:d,labelBgPadding:u,labelBgBorderRadius:h,style:f,markerEnd:m,markerStart:x,interactionWidth:p})});Dl.displayName="BezierEdge";const Ah=T.createContext(null),V8=Ah.Provider;Ah.Consumer;const H8=({source:t,sourceHandle:e,target:n,targetHandle:o})=>`reactflow__edge-${t}${e||""}-${n}${o||""}`,Th=(t,e)=>t===void 0?"":typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(n=>`${n}=${t[n]}`).join("&")}`,Mh=({x:t,y:e},[n,o,r],s,[a,i])=>{const l={x:(t-n)/r,y:(e-o)/r};return s?{x:a*Math.round(l.x/a),y:i*Math.round(l.y/i)}:l},kv=({x:t,y:e},[n,o,r])=>({x:t*r+n,y:e*r+o}),Gr=(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}},Oh=(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:a}=Gr(r,e).positionAbsolute;return i=o,l=kh({x:s,y:a,width:r.width||0,height:r.height||0}),{x:Math.min(i.x,l.x),y:Math.min(i.y,l.y),x2:Math.max(i.x2,l.x2),y2:Math.max(i.y2,l.y2)};var i,l},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return(({x:o,y:r,x2:s,y2:a})=>({x:o,y:r,width:s-o,height:a-r}))(n)},jv=(t,e,[n,o,r]=[0,0,1],s=!1,a=!1,i=[0,0])=>{const l={x:(e.x-n)/r,y:(e.y-o)/r,width:e.width/r,height:e.height/r},d=[];return t.forEach(u=>{const{width:h,height:f,selectable:m=!0,hidden:x=!1}=u;if(a&&!m||x)return!1;const{positionAbsolute:g}=Gr(u,i),p={x:g.x,y:g.y,width:h||0,height:f||0},b=jh(l,p);(h===void 0||f===void 0||h===null||f===null||s&&b>0||b>=(h||0)*(f||0)||u.dragging)&&d.push(u)}),d},Sv=(t,e)=>{const n=t.map(o=>o.id);return e.filter(o=>n.includes(o.source)||n.includes(o.target))},Cv=(t,e,n,o,r,s=.1)=>{const a=e/(t.width*(1+s)),i=n/(t.height*(1+s)),l=Math.min(a,i),d=Wr(l,o,r);return{x:e/2-(t.x+t.width/2)*d,y:n/2-(t.y+t.height/2)*d,zoom:d}},cr=(t,e=0)=>t.transition().duration(e);function Nv(t,e,n,o){return(e[n]||[]).reduce((r,s)=>{var a,i;return`${t.id}-${s.id}-${n}`!==o&&r.push({id:s.id||null,type:n,nodeId:t.id,x:(((a=t.positionAbsolute)==null?void 0:a.x)??0)+s.x+s.width/2,y:(((i=t.positionAbsolute)==null?void 0:i.y)??0)+s.y+s.height/2}),r},[])}const W8={source:null,target:null,sourceHandle:null,targetHandle:null},Ev=()=>({handleDomNode:null,isValid:!1,connection:W8,endHandle:null});function _v(t,e,n,o,r,s,a){const i=r==="target",l=a.querySelector(`.react-flow__handle[data-id="${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`),d={...Ev(),handleDomNode:l};if(l){const u=Dh(void 0,l),h=l.getAttribute("data-nodeid"),f=l.getAttribute("data-handleid"),m=l.classList.contains("connectable"),x=l.classList.contains("connectableend"),g={source:i?h:n,sourceHandle:i?f:o,target:i?n:h,targetHandle:i?o:f};d.connection=g,m&&x&&(e===lr.Strict?i&&u==="source"||!i&&u==="target":h!==n||f!==o)&&(d.endHandle={nodeId:h,handleId:f,type:u},d.isValid=s(g))}return d}function Dh(t,e){return t||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function Ph(t){t==null||t.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function q8(t,e){let n=null;return e?n="valid":t&&!e&&(n="invalid"),n}function Iv({event:t,handleId:e,nodeId:n,onConnect:o,isTarget:r,getState:s,setState:a,isValidConnection:i,edgeUpdaterType:l,onReconnectEnd:d}){const u=iv(t.target),{connectionMode:h,domNode:f,autoPanOnConnect:m,connectionRadius:x,onConnectStart:g,panBy:p,getNodes:b,cancelConnection:y}=s();let v,w=0;const{x:S,y:j}=Ro(t),C=u==null?void 0:u.elementFromPoint(S,j),_=Dh(l,C),E=f==null?void 0:f.getBoundingClientRect();if(!E||!_)return;let M,I=Ro(t,E),D=!1,F=null,O=!1,P=null;const R=function({nodes:B,nodeId:A,handleId:U,handleType:$}){return B.reduce((X,Y)=>{if(Y[bt]){const{handleBounds:G}=Y[bt];let W=[],J=[];G&&(W=Nv(Y,G,"source",`${A}-${U}-${$}`),J=Nv(Y,G,"target",`${A}-${U}-${$}`)),X.push(...W,...J)}return X},[])}({nodes:b(),nodeId:n,handleId:e,handleType:_}),z=()=>{if(!m)return;const[B,A]=av(I,E);p({x:B,y:A}),w=requestAnimationFrame(z)};function N(B){const{transform:A}=s();I=Ro(B,E);const{handle:U,validHandleResult:$}=function(X,Y,G,W,J,V){const{x:Q,y:te}=Ro(X),re=Y.elementsFromPoint(Q,te).find(ge=>ge.classList.contains("react-flow__handle"));if(re){const ge=re.getAttribute("data-nodeid");if(ge){const oe=Dh(void 0,re),ue=re.getAttribute("data-handleid"),de=V({nodeId:ge,id:ue,type:oe});if(de){const Ce=J.find(Te=>Te.nodeId===ge&&Te.type===oe&&Te.id===ue);return{handle:{id:ue,type:oe,nodeId:ge,x:(Ce==null?void 0:Ce.x)||G.x,y:(Ce==null?void 0:Ce.y)||G.y},validHandleResult:de}}}}let ne=[],ae=1/0;if(J.forEach(ge=>{const oe=Math.sqrt((ge.x-G.x)**2+(ge.y-G.y)**2);if(oe<=W){const ue=V(ge);oe<=ae&&(oe<ae?ne=[{handle:ge,validHandleResult:ue}]:oe===ae&&ne.push({handle:ge,validHandleResult:ue}),ae=oe)}}),!ne.length)return{handle:null,validHandleResult:Ev()};if(ne.length===1)return ne[0];const se=ne.some(({validHandleResult:ge})=>ge.isValid),ie=ne.some(({handle:ge})=>ge.type==="target");return ne.find(({handle:ge,validHandleResult:oe})=>ie?ge.type==="target":!se||oe.isValid)||ne[0]}(B,u,Mh(I,A,!1,[1,1]),x,R,X=>_v(X,h,n,e,r?"target":"source",i,u));if(v=U,D||(z(),D=!0),P=$.handleDomNode,F=$.connection,O=$.isValid,a({connectionPosition:v&&O?kv({x:v.x,y:v.y},A):I,connectionStatus:q8(!!v,O),connectionEndHandle:$.endHandle}),!v&&!O&&!P)return Ph(M);F.source!==F.target&&P&&(Ph(M),M=P,P.classList.add("connecting","react-flow__handle-connecting"),P.classList.toggle("valid",O),P.classList.toggle("react-flow__handle-valid",O))}function k(B){var A,U;(v||P)&&F&&O&&(o==null||o(F)),(U=(A=s()).onConnectEnd)==null||U.call(A,B),l&&(d==null||d(B)),Ph(M),y(),cancelAnimationFrame(w),D=!1,O=!1,F=null,P=null,u.removeEventListener("mousemove",N),u.removeEventListener("mouseup",k),u.removeEventListener("touchmove",N),u.removeEventListener("touchend",k)}a({connectionPosition:I,connectionStatus:null,connectionNodeId:n,connectionHandleId:e,connectionHandleType:_,connectionStartHandle:{nodeId:n,handleId:e,type:_},connectionEndHandle:null}),g==null||g(t,{nodeId:n,handleId:e,handleType:_}),u.addEventListener("mousemove",N),u.addEventListener("mouseup",k),u.addEventListener("touchmove",N),u.addEventListener("touchend",k)}const Av=()=>!0,G8=t=>({connectionStartHandle:t.connectionStartHandle,connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName}),Tv=T.forwardRef(({type:t="source",position:e=Oe.Top,isValidConnection:n,isConnectable:o=!0,isConnectableStart:r=!0,isConnectableEnd:s=!0,id:a,onConnect:i,children:l,className:d,onMouseDown:u,onTouchStart:h,...f},m)=>{var _,E;const x=a||null,g=t==="target",p=Ft(),b=T.useContext(Ah),{connectOnClick:y,noPanClassName:v}=lt(G8,Vt),{connecting:w,clickConnecting:S}=lt(((M,I,D)=>F=>{const{connectionStartHandle:O,connectionEndHandle:P,connectionClickStartHandle:R}=F;return{connecting:(O==null?void 0:O.nodeId)===M&&(O==null?void 0:O.handleId)===I&&(O==null?void 0:O.type)===D||(P==null?void 0:P.nodeId)===M&&(P==null?void 0:P.handleId)===I&&(P==null?void 0:P.type)===D,clickConnecting:(R==null?void 0:R.nodeId)===M&&(R==null?void 0:R.handleId)===I&&(R==null?void 0:R.type)===D}})(b,x,t),Vt);b||((E=(_=p.getState()).onError)==null||E.call(_,"010",R8()));const j=M=>{const{defaultEdgeOptions:I,onConnect:D,hasDefaultEdges:F}=p.getState(),O={...I,...M};if(F){const{edges:P,setEdges:R}=p.getState();R(((z,N)=>{if(!z.source||!z.target)return N;let k;return k=(B=>"id"in B&&"source"in B&&"target"in B)(z)?{...z}:{...z,id:H8(z)},((B,A)=>A.some(U=>!(U.source!==B.source||U.target!==B.target||U.sourceHandle!==B.sourceHandle&&(U.sourceHandle||B.sourceHandle)||U.targetHandle!==B.targetHandle&&(U.targetHandle||B.targetHandle))))(k,N)?N:N.concat(k)})(O,P))}D==null||D(O),i==null||i(O)},C=M=>{if(!b)return;const I=dv(M);r&&(I&&M.button===0||!I)&&Iv({event:M,handleId:x,nodeId:b,onConnect:j,isTarget:g,getState:p.getState,setState:p.setState,isValidConnection:n||p.getState().isValidConnection||Av}),I?u==null||u(M):h==null||h(M)};return q.createElement("div",{"data-handleid":x,"data-nodeid":b,"data-handlepos":e,"data-id":`${b}-${x}-${t}`,className:Xt(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",v,d,{source:!g,target:g,connectable:o,connectablestart:r,connectableend:s,connecting:S,connectionindicator:o&&(r&&!w||s&&w)}]),onMouseDown:C,onTouchStart:C,onClick:y?M=>{const{onClickConnectStart:I,onClickConnectEnd:D,connectionClickStartHandle:F,connectionMode:O,isValidConnection:P}=p.getState();if(!b||!F&&!r)return;if(!F)return I==null||I(M,{nodeId:b,handleId:x,handleType:t}),void p.setState({connectionClickStartHandle:{nodeId:b,type:t,handleId:x}});const R=iv(M.target),z=n||P||Av,{connection:N,isValid:k}=_v({nodeId:b,id:x,type:t},O,F.nodeId,F.handleId||null,F.type,z,R);k&&j(N),D==null||D(M),p.setState({connectionClickStartHandle:null})}:void 0,ref:m,...f},l)});Tv.displayName="Handle";var zo=T.memo(Tv);const Mv=({data:t,isConnectable:e,targetPosition:n=Oe.Top,sourcePosition:o=Oe.Bottom})=>q.createElement(q.Fragment,null,q.createElement(zo,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label,q.createElement(zo,{type:"source",position:o,isConnectable:e}));Mv.displayName="DefaultNode";var Rh=T.memo(Mv);const Ov=({data:t,isConnectable:e,sourcePosition:n=Oe.Bottom})=>q.createElement(q.Fragment,null,t==null?void 0:t.label,q.createElement(zo,{type:"source",position:n,isConnectable:e}));Ov.displayName="InputNode";var Dv=T.memo(Ov);const Pv=({data:t,isConnectable:e,targetPosition:n=Oe.Top})=>q.createElement(q.Fragment,null,q.createElement(zo,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label);Pv.displayName="OutputNode";var Rv=T.memo(Pv);const Lh=()=>null;Lh.displayName="GroupNode";const Y8=t=>({selectedNodes:t.getNodes().filter(e=>e.selected),selectedEdges:t.edges.filter(e=>e.selected).map(e=>({...e}))}),Pl=t=>t.id;function K8(t,e){return Vt(t.selectedNodes.map(Pl),e.selectedNodes.map(Pl))&&Vt(t.selectedEdges.map(Pl),e.selectedEdges.map(Pl))}const Lv=T.memo(({onSelectionChange:t})=>{const e=Ft(),{selectedNodes:n,selectedEdges:o}=lt(Y8,K8);return T.useEffect(()=>{const r={nodes:n,edges:o};t==null||t(r),e.getState().onSelectionChange.forEach(s=>s(r))},[n,o,t]),null});Lv.displayName="SelectionListener";const X8=t=>!!t.onSelectionChange;function J8({onSelectionChange:t}){const e=lt(X8);return t||e?q.createElement(Lv,{onSelectionChange:t}):null}const Z8=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 Yr(t,e){T.useEffect(()=>{t!==void 0&&e(t)},[t])}function Ze(t,e,n){T.useEffect(()=>{e!==void 0&&n({[t]:e})},[e])}const Q8=({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,onConnect:r,onConnectStart:s,onConnectEnd:a,onClickConnectStart:i,onClickConnectEnd:l,nodesDraggable:d,nodesConnectable:u,nodesFocusable:h,edgesFocusable:f,edgesUpdatable:m,elevateNodesOnSelect:x,minZoom:g,maxZoom:p,nodeExtent:b,onNodesChange:y,onEdgesChange:v,elementsSelectable:w,connectionMode:S,snapGrid:j,snapToGrid:C,translateExtent:_,connectOnClick:E,defaultEdgeOptions:M,fitView:I,fitViewOptions:D,onNodesDelete:F,onEdgesDelete:O,onNodeDrag:P,onNodeDragStart:R,onNodeDragStop:z,onSelectionDrag:N,onSelectionDragStart:k,onSelectionDragStop:B,noPanClassName:A,nodeOrigin:U,rfId:$,autoPanOnConnect:X,autoPanOnNodeDrag:Y,onError:G,connectionRadius:W,isValidConnection:J,nodeDragThreshold:V})=>{const{setNodes:Q,setEdges:te,setDefaultNodesAndEdges:re,setMinZoom:ne,setMaxZoom:ae,setTranslateExtent:se,setNodeExtent:ie,reset:ge}=lt(Z8,Vt),oe=Ft();return T.useEffect(()=>{const ue=o==null?void 0:o.map(de=>({...de,...M}));return re(n,ue),()=>{ge()}},[]),Ze("defaultEdgeOptions",M,oe.setState),Ze("connectionMode",S,oe.setState),Ze("onConnect",r,oe.setState),Ze("onConnectStart",s,oe.setState),Ze("onConnectEnd",a,oe.setState),Ze("onClickConnectStart",i,oe.setState),Ze("onClickConnectEnd",l,oe.setState),Ze("nodesDraggable",d,oe.setState),Ze("nodesConnectable",u,oe.setState),Ze("nodesFocusable",h,oe.setState),Ze("edgesFocusable",f,oe.setState),Ze("edgesUpdatable",m,oe.setState),Ze("elementsSelectable",w,oe.setState),Ze("elevateNodesOnSelect",x,oe.setState),Ze("snapToGrid",C,oe.setState),Ze("snapGrid",j,oe.setState),Ze("onNodesChange",y,oe.setState),Ze("onEdgesChange",v,oe.setState),Ze("connectOnClick",E,oe.setState),Ze("fitViewOnInit",I,oe.setState),Ze("fitViewOnInitOptions",D,oe.setState),Ze("onNodesDelete",F,oe.setState),Ze("onEdgesDelete",O,oe.setState),Ze("onNodeDrag",P,oe.setState),Ze("onNodeDragStart",R,oe.setState),Ze("onNodeDragStop",z,oe.setState),Ze("onSelectionDrag",N,oe.setState),Ze("onSelectionDragStart",k,oe.setState),Ze("onSelectionDragStop",B,oe.setState),Ze("noPanClassName",A,oe.setState),Ze("nodeOrigin",U,oe.setState),Ze("rfId",$,oe.setState),Ze("autoPanOnConnect",X,oe.setState),Ze("autoPanOnNodeDrag",Y,oe.setState),Ze("onError",G,oe.setState),Ze("connectionRadius",W,oe.setState),Ze("isValidConnection",J,oe.setState),Ze("nodeDragThreshold",V,oe.setState),Yr(t,Q),Yr(e,te),Yr(g,ne),Yr(p,ae),Yr(_,se),Yr(b,ie),null},Fv={display:"none"},eA={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},zv="react-flow__node-desc",Bv="react-flow__edge-desc",tA=t=>t.ariaLiveMessage;function nA({rfId:t}){const e=lt(tA);return q.createElement("div",{id:`react-flow__aria-live-${t}`,"aria-live":"assertive","aria-atomic":"true",style:eA},e)}function oA({rfId:t,disableKeyboardA11y:e}){return q.createElement(q.Fragment,null,q.createElement("div",{id:`${zv}-${t}`,style:Fv},"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."," "),q.createElement("div",{id:`${Bv}-${t}`,style:Fv},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!e&&q.createElement(nA,{rfId:t}))}var ya=(t=null,e={actInsideInputWithModifier:!0})=>{const[n,o]=T.useState(!1),r=T.useRef(!1),s=T.useRef(new Set([])),[a,i]=T.useMemo(()=>{if(t!==null){const l=(Array.isArray(t)?t:[t]).filter(u=>typeof u=="string").map(u=>u.split("+")),d=l.reduce((u,h)=>u.concat(...h),[]);return[l,d]}return[[],[]]},[t]);return T.useEffect(()=>{const l=typeof document<"u"?document:null,d=(e==null?void 0:e.target)||l;if(t!==null){const u=m=>{if(r.current=m.ctrlKey||m.metaKey||m.shiftKey,(!r.current||r.current&&!e.actInsideInputWithModifier)&&Sh(m))return!1;const x=$v(m.code,i);s.current.add(m[x]),Uv(a,s.current,!1)&&(m.preventDefault(),o(!0))},h=m=>{if((!r.current||r.current&&!e.actInsideInputWithModifier)&&Sh(m))return!1;const x=$v(m.code,i);Uv(a,s.current,!0)?(o(!1),s.current.clear()):s.current.delete(m[x]),m.key==="Meta"&&s.current.clear(),r.current=!1},f=()=>{s.current.clear(),o(!1)};return d==null||d.addEventListener("keydown",u),d==null||d.addEventListener("keyup",h),window.addEventListener("blur",f),()=>{d==null||d.removeEventListener("keydown",u),d==null||d.removeEventListener("keyup",h),window.removeEventListener("blur",f)}}},[t,o]),n};function Uv(t,e,n){return t.filter(o=>n||o.length===e.size).some(o=>o.every(r=>e.has(r)))}function $v(t,e){return e.includes(t)?"code":"key"}function Vv(t,e,n,o){var i,l;const r=t.parentNode||t.parentId;if(!r)return n;const s=e.get(r),a=Gr(s,o);return Vv(s,e,{x:(n.x??0)+a.x,y:(n.y??0)+a.y,z:(((i=s[bt])==null?void 0:i.z)??0)>(n.z??0)?((l=s[bt])==null?void 0:l.z)??0:n.z??0},o)}function Hv(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:a,y:i,z:l}=Vv(o,t,{...o.position,z:((s=o[bt])==null?void 0:s.z)??0},e);o.positionAbsolute={x:a,y:i},o[bt].z=l,n!=null&&n[o.id]&&(o[bt].isParent=!0)}})}function Fh(t,e,n,o){const r=new Map,s={},a=o?1e3:0;return t.forEach(i=>{var m;const l=(Sn(i.zIndex)?i.zIndex:0)+(i.selected?a:0),d=e.get(i.id),u={...i,positionAbsolute:{x:i.position.x,y:i.position.y}},h=i.parentNode||i.parentId;h&&(s[h]=!0);const f=(d==null?void 0:d.type)&&(d==null?void 0:d.type)!==i.type;Object.defineProperty(u,bt,{enumerable:!1,value:{handleBounds:f||(m=d==null?void 0:d[bt])==null?void 0:m.handleBounds,z:l}}),r.set(i.id,u)}),Hv(r,n,s),r}function Wv(t,e={}){const{getNodes:n,width:o,height:r,minZoom:s,maxZoom:a,d3Zoom:i,d3Selection:l,fitViewOnInitDone:d,fitViewOnInit:u,nodeOrigin:h}=t(),f=e.initial&&!d&&u;if(i&&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}),x=m.every(g=>g.width&&g.height);if(m.length>0&&x){const g=Oh(m,h),{x:p,y:b,zoom:y}=Cv(g,o,r,e.minZoom??s,e.maxZoom??a,e.padding??.1),v=Jo.translate(p,b).scale(y);return typeof e.duration=="number"&&e.duration>0?i.transform(cr(l,e.duration),v):i.transform(l,v),!0}}return!1}function rA(t,e){return t.forEach(n=>{const o=e.get(n.id);o&&e.set(o.id,{...o,[bt]:o[bt],selected:n.selected})}),new Map(e)}function sA(t,e){return e.map(n=>{const o=t.find(r=>r.id===n.id);return o&&(n.selected=o.selected),n})}function Rl({changedNodes:t,changedEdges:e,get:n,set:o}){const{nodeInternals:r,edges:s,onNodesChange:a,onEdgesChange:i,hasDefaultNodes:l,hasDefaultEdges:d}=n();t!=null&&t.length&&(l&&o({nodeInternals:rA(t,r)}),a==null||a(t)),e!=null&&e.length&&(d&&o({edges:sA(e,s)}),i==null||i(e))}const Kr=()=>{},aA={zoomIn:Kr,zoomOut:Kr,zoomTo:Kr,getZoom:()=>1,setViewport:Kr,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Kr,fitBounds:Kr,project:t=>t,screenToFlowPosition:t=>t,flowToScreenPosition:t=>t,viewportInitialized:!1},iA=t=>({d3Zoom:t.d3Zoom,d3Selection:t.d3Selection});function va(){const t=(()=>{const g=Ft(),{d3Zoom:p,d3Selection:b}=lt(iA,Vt);return T.useMemo(()=>b&&p?{zoomIn:v=>p.scaleBy(cr(b,v==null?void 0:v.duration),1.2),zoomOut:v=>p.scaleBy(cr(b,v==null?void 0:v.duration),1/1.2),zoomTo:(v,w)=>p.scaleTo(cr(b,w==null?void 0:w.duration),v),getZoom:()=>g.getState().transform[2],setViewport:(v,w)=>{const[S,j,C]=g.getState().transform,_=Jo.translate(v.x??S,v.y??j).scale(v.zoom??C);p.transform(cr(b,w==null?void 0:w.duration),_)},getViewport:()=>{const[v,w,S]=g.getState().transform;return{x:v,y:w,zoom:S}},fitView:v=>Wv(g.getState,v),setCenter:(v,w,S)=>{const{width:j,height:C,maxZoom:_}=g.getState(),E=(S==null?void 0:S.zoom)!==void 0?S.zoom:_,M=j/2-v*E,I=C/2-w*E,D=Jo.translate(M,I).scale(E);p.transform(cr(b,S==null?void 0:S.duration),D)},fitBounds:(v,w)=>{const{width:S,height:j,minZoom:C,maxZoom:_}=g.getState(),{x:E,y:M,zoom:I}=Cv(v,S,j,C,_,(w==null?void 0:w.padding)??.1),D=Jo.translate(E,M).scale(I);p.transform(cr(b,w==null?void 0:w.duration),D)},project:v=>{const{transform:w,snapToGrid:S,snapGrid:j}=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"),Mh(v,w,S,j)},screenToFlowPosition:v=>{const{transform:w,snapToGrid:S,snapGrid:j,domNode:C}=g.getState();if(!C)return v;const{x:_,y:E}=C.getBoundingClientRect(),M={x:v.x-_,y:v.y-E};return Mh(M,w,S,j)},flowToScreenPosition:v=>{const{transform:w,domNode:S}=g.getState();if(!S)return v;const{x:j,y:C}=S.getBoundingClientRect(),_=kv(v,w);return{x:_.x+j,y:_.y+C}},viewportInitialized:!0}:aA,[p,b])})(),e=Ft(),n=T.useCallback(()=>e.getState().getNodes().map(g=>({...g})),[]),o=T.useCallback(g=>e.getState().nodeInternals.get(g),[]),r=T.useCallback(()=>{const{edges:g=[]}=e.getState();return g.map(p=>({...p}))},[]),s=T.useCallback(g=>{const{edges:p=[]}=e.getState();return p.find(b=>b.id===g)},[]),a=T.useCallback(g=>{const{getNodes:p,setNodes:b,hasDefaultNodes:y,onNodesChange:v}=e.getState(),w=p(),S=typeof g=="function"?g(w):g;if(y)b(S);else if(v){const j=S.length===0?w.map(C=>({type:"remove",id:C.id})):S.map(C=>({item:C,type:"reset"}));v(j)}},[]),i=T.useCallback(g=>{const{edges:p=[],setEdges:b,hasDefaultEdges:y,onEdgesChange:v}=e.getState(),w=typeof g=="function"?g(p):g;y?b(w):v&&v(w.length===0?p.map(S=>({type:"remove",id:S.id})):w.map(S=>({item:S,type:"reset"})))},[]),l=T.useCallback(g=>{const p=Array.isArray(g)?g:[g],{getNodes:b,setNodes:y,hasDefaultNodes:v,onNodesChange:w}=e.getState();if(v)y([...b(),...p]);else if(w){const S=p.map(j=>({item:j,type:"add"}));w(S)}},[]),d=T.useCallback(g=>{const p=Array.isArray(g)?g:[g],{edges:b=[],setEdges:y,hasDefaultEdges:v,onEdgesChange:w}=e.getState();v?y([...b,...p]):w&&w(p.map(S=>({item:S,type:"add"})))},[]),u=T.useCallback(()=>{const{getNodes:g,edges:p=[],transform:b}=e.getState(),[y,v,w]=b;return{nodes:g().map(S=>({...S})),edges:p.map(S=>({...S})),viewport:{x:y,y:v,zoom:w}}},[]),h=T.useCallback(({nodes:g,edges:p})=>{const{nodeInternals:b,getNodes:y,edges:v,hasDefaultNodes:w,hasDefaultEdges:S,onNodesDelete:j,onEdgesDelete:C,onNodesChange:_,onEdgesChange:E}=e.getState(),M=(g||[]).map(P=>P.id),I=(p||[]).map(P=>P.id),D=y().reduce((P,R)=>{const z=R.parentNode||R.parentId,N=!M.includes(R.id)&&z&&P.find(k=>k.id===z);return(typeof R.deletable!="boolean"||R.deletable)&&(M.includes(R.id)||N)&&P.push(R),P},[]),F=v.filter(P=>typeof P.deletable!="boolean"||P.deletable),O=F.filter(P=>I.includes(P.id));if(D||O){const P=Sv(D,F),R=[...O,...P],z=R.reduce((N,k)=>(N.includes(k.id)||N.push(k.id),N),[]);(S||w)&&(S&&e.setState({edges:v.filter(N=>!z.includes(N.id))}),w&&(D.forEach(N=>{b.delete(N.id)}),e.setState({nodeInternals:new Map(b)}))),z.length>0&&(C==null||C(R),E&&E(z.map(N=>({id:N,type:"remove"})))),D.length>0&&(j==null||j(D),_)&&_(D.map(N=>({id:N.id,type:"remove"})))}},[]),f=T.useCallback(g=>{const p=Sn((b=g).width)&&Sn(b.height)&&Sn(b.x)&&Sn(b.y);var b;const y=p?null:e.getState().nodeInternals.get(g.id);return!p&&!y?[null,null,p]:[p?g:lv(y),y,p]},[]),m=T.useCallback((g,p=!0,b)=>{const[y,v,w]=f(g);return y?(b||e.getState().getNodes()).filter(S=>{if(!(w||S.id!==v.id&&S.positionAbsolute))return!1;const j=lv(S),C=jh(j,y);return p&&C>0||C>=y.width*y.height}):[]},[]),x=T.useCallback((g,p,b=!0)=>{const[y]=f(g);if(!y)return!1;const v=jh(y,p);return b&&v>0||v>=y.width*y.height},[]);return T.useMemo(()=>({...t,getNodes:n,getNode:o,getEdges:r,getEdge:s,setNodes:a,setEdges:i,addNodes:l,addEdges:d,toObject:u,deleteElements:h,getIntersectingNodes:m,isNodeIntersecting:x}),[t,n,o,r,s,a,i,l,d,u,h,m,x])}const lA={actInsideInputWithModifier:!1},zh={position:"absolute",width:"100%",height:"100%",top:0,left:0},Ll=t=>({x:t.x,y:t.y,zoom:t.k}),Xr=(t,e)=>t.target.closest(`.${e}`),qv=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),Gv=t=>{const e=t.ctrlKey&&Al()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e},cA=t=>({d3Zoom:t.d3Zoom,d3Selection:t.d3Selection,d3ZoomHandler:t.d3ZoomHandler,userSelectionActive:t.userSelectionActive}),dA=({onMove:t,onMoveStart:e,onMoveEnd:n,onPaneContextMenu:o,zoomOnScroll:r=!0,zoomOnPinch:s=!0,panOnScroll:a=!1,panOnScrollSpeed:i=.5,panOnScrollMode:l=Lo.Free,zoomOnDoubleClick:d=!0,elementsSelectable:u,panOnDrag:h=!0,defaultViewport:f,translateExtent:m,minZoom:x,maxZoom:g,zoomActivationKeyCode:p,preventScrolling:b=!0,children:y,noWheelClassName:v,noPanClassName:w})=>{const S=T.useRef(),j=Ft(),C=T.useRef(!1),_=T.useRef(!1),E=T.useRef(null),M=T.useRef({x:0,y:0,zoom:0}),{d3Zoom:I,d3Selection:D,d3ZoomHandler:F,userSelectionActive:O}=lt(cA,Vt),P=ya(p),R=T.useRef(0),z=T.useRef(!1),N=T.useRef();return function(k){const B=Ft();T.useEffect(()=>{let A;const U=()=>{var X,Y;if(!k.current)return;const $=vh(k.current);$.height!==0&&$.width!==0||((Y=(X=B.getState()).onError)==null||Y.call(X,"004",M8())),B.setState({width:$.width||500,height:$.height||500})};return U(),window.addEventListener("resize",U),k.current&&(A=new ResizeObserver(()=>U()),A.observe(k.current)),()=>{window.removeEventListener("resize",U),A&&k.current&&A.unobserve(k.current)}},[])}(E),T.useEffect(()=>{if(E.current){const k=E.current.getBoundingClientRect(),B=function(){var Y,G,W,J=C8,V=N8,Q=I8,te=E8,re=_8,ne=[0,1/0],ae=[[-1/0,-1/0],[1/0,1/0]],se=250,ie=rL,ge=Dj("start","zoom","end"),oe=0,ue=10;function de(K){K.property("__zoom",ov).on("wheel.zoom",Ve,{passive:!1}).on("mousedown.zoom",Ke).on("dblclick.zoom",ee).filter(re).on("touchstart.zoom",ye).on("touchmove.zoom",we).on("touchend.zoom touchcancel.zoom",Ie).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function Ce(K,me){return(me=Math.max(ne[0],Math.min(ne[1],me)))===K.k?K:new $m(me,K.x,K.y)}function Te(K,me,pe){var he=me[0]-pe[0]*K.k,je=me[1]-pe[1]*K.k;return he===K.x&&je===K.y?K:new $m(K.k,he,je)}function Fe(K){return[(+K[0][0]+ +K[1][0])/2,(+K[0][1]+ +K[1][1])/2]}function _e(K,me,pe,he){K.on("start.zoom",function(){ke(this,arguments).event(he).start()}).on("interrupt.zoom end.zoom",function(){ke(this,arguments).event(he).end()}).tween("zoom",function(){var je=this,Pe=arguments,Re=ke(je,Pe).event(he),He=V.apply(je,Pe),le=pe==null?Fe(He):typeof pe=="function"?pe.apply(je,Pe):pe,Ae=Math.max(He[1][0]-He[0][0],He[1][1]-He[0][1]),Me=je.__zoom,Be=typeof me=="function"?me.apply(je,Pe):me,qe=ie(Me.invert(le).concat(Ae/Me.k),Be.invert(le).concat(Ae/Be.k));return function(De){if(De===1)De=Be;else{var $e=qe(De),ot=Ae/$e[2];De=new $m(ot,le[0]-$e[0]*ot,le[1]-$e[1]*ot)}Re.zoom(null,De)}})}function ke(K,me,pe){return!pe&&K.__zooming||new Ye(K,me)}function Ye(K,me){this.that=K,this.args=me,this.active=0,this.sourceEvent=null,this.extent=V.apply(K,me),this.taps=0}function Ve(K,...me){if(J.apply(this,arguments)){var pe=ke(this,me).event(K),he=this.__zoom,je=Math.max(ne[0],Math.min(ne[1],he.k*Math.pow(2,te.apply(this,arguments)))),Pe=Gn(K);if(pe.wheel)pe.mouse[0][0]===Pe[0]&&pe.mouse[0][1]===Pe[1]||(pe.mouse[1]=he.invert(pe.mouse[0]=Pe)),clearTimeout(pe.wheel);else{if(he.k===je)return;pe.mouse=[Pe,he.invert(Pe)],Vm(this),pe.start()}ma(K),pe.wheel=setTimeout(function(){pe.wheel=null,pe.end()},150),pe.zoom("mouse",Q(Te(Ce(he,je),pe.mouse[0],pe.mouse[1]),pe.extent,ae))}}function Ke(K,...me){if(!W&&J.apply(this,arguments)){var pe=K.currentTarget,he=ke(this,me,!0).event(K),je=Bn(K.view).on("mousemove.zoom",function(le){if(ma(le),!he.moved){var Ae=le.clientX-Re,Me=le.clientY-He;he.moved=Ae*Ae+Me*Me>oe}he.event(le).zoom("mouse",Q(Te(he.that.__zoom,he.mouse[0]=Gn(le,pe),he.mouse[1]),he.extent,ae))},!0).on("mouseup.zoom",function(le){je.on("mousemove.zoom mouseup.zoom",null),nv(le.view,he.moved),ma(le),he.event(le).end()},!0),Pe=Gn(K,pe),Re=K.clientX,He=K.clientY;tv(K.view),yh(K),he.mouse=[Pe,this.__zoom.invert(Pe)],Vm(this),he.start()}}function ee(K,...me){if(J.apply(this,arguments)){var pe=this.__zoom,he=Gn(K.changedTouches?K.changedTouches[0]:K,this),je=pe.invert(he),Pe=pe.k*(K.shiftKey?.5:2),Re=Q(Te(Ce(pe,Pe),he,je),V.apply(this,me),ae);ma(K),se>0?Bn(this).transition().duration(se).call(_e,Re,he,K):Bn(this).call(de.transform,Re,he,K)}}function ye(K,...me){if(J.apply(this,arguments)){var pe,he,je,Pe,Re=K.touches,He=Re.length,le=ke(this,me,K.changedTouches.length===He).event(K);for(yh(K),he=0;he<He;++he)Pe=[Pe=Gn(je=Re[he],this),this.__zoom.invert(Pe),je.identifier],le.touch0?le.touch1||le.touch0[2]===Pe[2]||(le.touch1=Pe,le.taps=0):(le.touch0=Pe,pe=!0,le.taps=1+!!Y);Y&&(Y=clearTimeout(Y)),pe&&(le.taps<2&&(G=Pe[0],Y=setTimeout(function(){Y=null},500)),Vm(this),le.start())}}function we(K,...me){if(this.__zooming){var pe,he,je,Pe,Re=ke(this,me).event(K),He=K.changedTouches,le=He.length;for(ma(K),pe=0;pe<le;++pe)je=Gn(he=He[pe],this),Re.touch0&&Re.touch0[2]===he.identifier?Re.touch0[0]=je:Re.touch1&&Re.touch1[2]===he.identifier&&(Re.touch1[0]=je);if(he=Re.that.__zoom,Re.touch1){var Ae=Re.touch0[0],Me=Re.touch0[1],Be=Re.touch1[0],qe=Re.touch1[1],De=(De=Be[0]-Ae[0])*De+(De=Be[1]-Ae[1])*De,$e=($e=qe[0]-Me[0])*$e+($e=qe[1]-Me[1])*$e;he=Ce(he,Math.sqrt(De/$e)),je=[(Ae[0]+Be[0])/2,(Ae[1]+Be[1])/2],Pe=[(Me[0]+qe[0])/2,(Me[1]+qe[1])/2]}else{if(!Re.touch0)return;je=Re.touch0[0],Pe=Re.touch0[1]}Re.zoom("touch",Q(Te(he,je,Pe),Re.extent,ae))}}function Ie(K,...me){if(this.__zooming){var pe,he,je=ke(this,me).event(K),Pe=K.changedTouches,Re=Pe.length;for(yh(K),W&&clearTimeout(W),W=setTimeout(function(){W=null},500),pe=0;pe<Re;++pe)he=Pe[pe],je.touch0&&je.touch0[2]===he.identifier?delete je.touch0:je.touch1&&je.touch1[2]===he.identifier&&delete je.touch1;if(je.touch1&&!je.touch0&&(je.touch0=je.touch1,delete je.touch1),je.touch0)je.touch0[1]=this.__zoom.invert(je.touch0[0]);else if(je.end(),je.taps===2&&(he=Gn(he,this),Math.hypot(G[0]-he[0],G[1]-he[1])<ue)){var He=Bn(this).on("dblclick.zoom");He&&He.apply(this,arguments)}}}return de.transform=function(K,me,pe,he){var je=K.selection?K.selection():K;je.property("__zoom",ov),K!==je?_e(K,me,pe,he):je.interrupt().each(function(){ke(this,arguments).event(he).start().zoom(null,typeof me=="function"?me.apply(this,arguments):me).end()})},de.scaleBy=function(K,me,pe,he){de.scaleTo(K,function(){return this.__zoom.k*(typeof me=="function"?me.apply(this,arguments):me)},pe,he)},de.scaleTo=function(K,me,pe,he){de.transform(K,function(){var je=V.apply(this,arguments),Pe=this.__zoom,Re=pe==null?Fe(je):typeof pe=="function"?pe.apply(this,arguments):pe,He=Pe.invert(Re),le=typeof me=="function"?me.apply(this,arguments):me;return Q(Te(Ce(Pe,le),Re,He),je,ae)},pe,he)},de.translateBy=function(K,me,pe,he){de.transform(K,function(){return Q(this.__zoom.translate(typeof me=="function"?me.apply(this,arguments):me,typeof pe=="function"?pe.apply(this,arguments):pe),V.apply(this,arguments),ae)},null,he)},de.translateTo=function(K,me,pe,he,je){de.transform(K,function(){var Pe=V.apply(this,arguments),Re=this.__zoom,He=he==null?Fe(Pe):typeof he=="function"?he.apply(this,arguments):he;return Q(Jo.translate(He[0],He[1]).scale(Re.k).translate(typeof me=="function"?-me.apply(this,arguments):-me,typeof pe=="function"?-pe.apply(this,arguments):-pe),Pe,ae)},he,je)},Ye.prototype={event:function(K){return K&&(this.sourceEvent=K),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(K,me){return this.mouse&&K!=="mouse"&&(this.mouse[1]=me.invert(this.mouse[0])),this.touch0&&K!=="touch"&&(this.touch0[1]=me.invert(this.touch0[0])),this.touch1&&K!=="touch"&&(this.touch1[1]=me.invert(this.touch1[0])),this.that.__zoom=me,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(K){var me=Bn(this.that).datum();ge.call(K,this.that,new S8(K,{sourceEvent:this.sourceEvent,target:de,transform:this.that.__zoom,dispatch:ge}),me)}},de.wheelDelta=function(K){return arguments.length?(te=typeof K=="function"?K:El(+K),de):te},de.filter=function(K){return arguments.length?(J=typeof K=="function"?K:El(!!K),de):J},de.touchable=function(K){return arguments.length?(re=typeof K=="function"?K:El(!!K),de):re},de.extent=function(K){return arguments.length?(V=typeof K=="function"?K:El([[+K[0][0],+K[0][1]],[+K[1][0],+K[1][1]]]),de):V},de.scaleExtent=function(K){return arguments.length?(ne[0]=+K[0],ne[1]=+K[1],de):[ne[0],ne[1]]},de.translateExtent=function(K){return arguments.length?(ae[0][0]=+K[0][0],ae[1][0]=+K[1][0],ae[0][1]=+K[0][1],ae[1][1]=+K[1][1],de):[[ae[0][0],ae[0][1]],[ae[1][0],ae[1][1]]]},de.constrain=function(K){return arguments.length?(Q=K,de):Q},de.duration=function(K){return arguments.length?(se=+K,de):se},de.interpolate=function(K){return arguments.length?(ie=K,de):ie},de.on=function(){var K=ge.on.apply(ge,arguments);return K===ge?de:K},de.clickDistance=function(K){return arguments.length?(oe=(K=+K)*K,de):Math.sqrt(oe)},de.tapDistance=function(K){return arguments.length?(ue=+K,de):ue},de}().scaleExtent([x,g]).translateExtent(m),A=Bn(E.current).call(B),U=Jo.translate(f.x,f.y).scale(Wr(f.zoom,x,g)),$=[[0,0],[k.width,k.height]],X=B.constrain()(U,$,m);B.transform(A,X),B.wheelDelta(Gv),j.setState({d3Zoom:B,d3Selection:A,d3ZoomHandler:A.on("wheel.zoom"),transform:[X.x,X.y,X.k],domNode:E.current.closest(".react-flow")})}},[]),T.useEffect(()=>{D&&I&&(!a||P||O?F!==void 0&&D.on("wheel.zoom",function(k,B){if(!b&&k.type==="wheel"&&!k.ctrlKey||Xr(k,v))return null;k.preventDefault(),F.call(this,k,B)},{passive:!1}):D.on("wheel.zoom",k=>{if(Xr(k,v))return!1;k.preventDefault(),k.stopImmediatePropagation();const B=D.property("__zoom").k||1;if(k.ctrlKey&&s){const J=Gn(k),V=Gv(k),Q=B*Math.pow(2,V);return void I.scaleTo(D,Q,J,k)}const A=k.deltaMode===1?20:1;let U=l===Lo.Vertical?0:k.deltaX*A,$=l===Lo.Horizontal?0:k.deltaY*A;!Al()&&k.shiftKey&&l!==Lo.Vertical&&(U=k.deltaY*A,$=0),I.translateBy(D,-U/B*i,-$/B*i,{internal:!0});const X=Ll(D.property("__zoom")),{onViewportChangeStart:Y,onViewportChange:G,onViewportChangeEnd:W}=j.getState();clearTimeout(N.current),z.current||(z.current=!0,e==null||e(k,X),Y==null||Y(X)),z.current&&(t==null||t(k,X),G==null||G(X),N.current=setTimeout(()=>{n==null||n(k,X),W==null||W(X),z.current=!1},150))},{passive:!1}))},[O,a,l,D,I,F,P,s,b,v,e,t,n]),T.useEffect(()=>{I&&I.on("start",k=>{var U,$;if(!k.sourceEvent||k.sourceEvent.internal)return null;R.current=(U=k.sourceEvent)==null?void 0:U.button;const{onViewportChangeStart:B}=j.getState(),A=Ll(k.transform);C.current=!0,M.current=A,(($=k.sourceEvent)==null?void 0:$.type)==="mousedown"&&j.setState({paneDragging:!0}),B==null||B(A),e==null||e(k.sourceEvent,A)})},[I,e]),T.useEffect(()=>{I&&(O&&!C.current?I.on("zoom",null):O||I.on("zoom",k=>{var A;const{onViewportChange:B}=j.getState();if(j.setState({transform:[k.transform.x,k.transform.y,k.transform.k]}),_.current=!(!o||!qv(h,R.current??0)),(t||B)&&!((A=k.sourceEvent)!=null&&A.internal)){const U=Ll(k.transform);B==null||B(U),t==null||t(k.sourceEvent,U)}}))},[O,I,t,h,o]),T.useEffect(()=>{I&&I.on("end",k=>{if(!k.sourceEvent||k.sourceEvent.internal)return null;const{onViewportChangeEnd:B}=j.getState();if(C.current=!1,j.setState({paneDragging:!1}),o&&qv(h,R.current??0)&&!_.current&&o(k.sourceEvent),_.current=!1,(n||B)&&(A=M.current,U=k.transform,A.x!==U.x||A.y!==U.y||A.zoom!==U.k)){const $=Ll(k.transform);M.current=$,clearTimeout(S.current),S.current=setTimeout(()=>{B==null||B($),n==null||n(k.sourceEvent,$)},a?150:0)}var A,U})},[I,a,h,n,o]),T.useEffect(()=>{I&&I.filter(k=>{const B=P||r,A=s&&k.ctrlKey;if((h===!0||Array.isArray(h)&&h.includes(1))&&k.button===1&&k.type==="mousedown"&&(Xr(k,"react-flow__node")||Xr(k,"react-flow__edge")))return!0;if(!(h||B||a||d||s)||O||!d&&k.type==="dblclick"||Xr(k,v)&&k.type==="wheel"||Xr(k,w)&&(k.type!=="wheel"||a&&k.type==="wheel"&&!P)||!s&&k.ctrlKey&&k.type==="wheel"||!B&&!a&&!A&&k.type==="wheel"||!h&&(k.type==="mousedown"||k.type==="touchstart")||Array.isArray(h)&&!h.includes(k.button)&&k.type==="mousedown")return!1;const U=Array.isArray(h)&&h.includes(k.button)||!k.button||k.button<=1;return(!k.ctrlKey||k.type==="wheel")&&U})},[O,I,r,s,a,d,h,u,P]),q.createElement("div",{className:"react-flow__renderer",ref:E,style:zh},y)},uA=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function hA(){const{userSelectionActive:t,userSelectionRect:e}=lt(uA,Vt);return t&&e?q.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 Yv(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 a=Math.abs(e.position.x);o.position.x=o.position.x-a,o.style.width+=a,e.position.x=0}if(e.position.y<0){const a=Math.abs(e.position.y);o.position.y=o.position.y-a,o.style.height+=a,e.position.y=0}o.width=o.style.width,o.height=o.style.height}}}function Kv(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(i=>i.id===r.id);if(s.length===0)return o.push(r),o;const a={...r};for(const i of s)if(i)switch(i.type){case"select":a.selected=i.selected;break;case"position":i.position!==void 0&&(a.position=i.position),i.positionAbsolute!==void 0&&(a.positionAbsolute=i.positionAbsolute),i.dragging!==void 0&&(a.dragging=i.dragging),a.expandParent&&Yv(o,a);break;case"dimensions":i.dimensions!==void 0&&(a.width=i.dimensions.width,a.height=i.dimensions.height),i.updateStyle!==void 0&&(a.style={...a.style||{},...i.dimensions}),typeof i.resizing=="boolean"&&(a.resizing=i.resizing),a.expandParent&&Yv(o,a);break;case"remove":return o}return o.push(a),o},n)}function Xv(t,e){return Kv(t,e)}const Bo=(t,e)=>({id:t,type:"select",selected:e});function Jr(t,e){return t.reduce((n,o)=>{const r=e.includes(o.id);return!o.selected&&r?(o.selected=!0,n.push(Bo(o.id,!0))):o.selected&&!r&&(o.selected=!1,n.push(Bo(o.id,!1))),n},[])}const Bh=(t,e)=>n=>{n.target===e.current&&(t==null||t(n))},fA=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,dragging:t.paneDragging}),Jv=T.memo(({isSelecting:t,selectionMode:e=xa.Full,panOnDrag:n,onSelectionStart:o,onSelectionEnd:r,onPaneClick:s,onPaneContextMenu:a,onPaneScroll:i,onPaneMouseEnter:l,onPaneMouseMove:d,onPaneMouseLeave:u,children:h})=>{const f=T.useRef(null),m=Ft(),x=T.useRef(0),g=T.useRef(0),p=T.useRef(),{userSelectionActive:b,elementsSelectable:y,dragging:v}=lt(fA,Vt),w=()=>{m.setState({userSelectionActive:!1,userSelectionRect:null}),x.current=0,g.current=0},S=_=>{s==null||s(_),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},j=i?_=>i(_):void 0,C=y&&(t||b);return q.createElement("div",{className:Xt(["react-flow__pane",{dragging:v,selection:t}]),onClick:C?void 0:Bh(S,f),onContextMenu:Bh(_=>{Array.isArray(n)&&(n!=null&&n.includes(2))?_.preventDefault():a==null||a(_)},f),onWheel:Bh(j,f),onMouseEnter:C?void 0:l,onMouseDown:C?_=>{const{resetSelectedElements:E,domNode:M}=m.getState();if(p.current=M==null?void 0:M.getBoundingClientRect(),!y||!t||_.button!==0||_.target!==f.current||!p.current)return;const{x:I,y:D}=Ro(_,p.current);E(),m.setState({userSelectionRect:{width:0,height:0,startX:I,startY:D,x:I,y:D}}),o==null||o(_)}:void 0,onMouseMove:C?_=>{const{userSelectionRect:E,nodeInternals:M,edges:I,transform:D,onNodesChange:F,onEdgesChange:O,nodeOrigin:P,getNodes:R}=m.getState();if(!t||!p.current||!E)return;m.setState({userSelectionActive:!0,nodesSelectionActive:!1});const z=Ro(_,p.current),N=E.startX??0,k=E.startY??0,B={...E,x:z.x<N?z.x:N,y:z.y<k?z.y:k,width:Math.abs(z.x-N),height:Math.abs(z.y-k)},A=R(),U=jv(M,B,D,e===xa.Partial,!0,P),$=Sv(U,I).map(Y=>Y.id),X=U.map(Y=>Y.id);if(x.current!==X.length){x.current=X.length;const Y=Jr(A,X);Y.length&&(F==null||F(Y))}if(g.current!==$.length){g.current=$.length;const Y=Jr(I,$);Y.length&&(O==null||O(Y))}m.setState({userSelectionRect:B})}:d,onMouseUp:C?_=>{if(_.button!==0)return;const{userSelectionRect:E}=m.getState();!b&&E&&_.target===f.current&&(S==null||S(_)),m.setState({nodesSelectionActive:x.current>0}),w(),r==null||r(_)}:void 0,onMouseLeave:C?_=>{b&&(m.setState({nodesSelectionActive:x.current>0}),r==null||r(_)),w()}:u,ref:f,style:zh},h,q.createElement(hA,null))});function Zv(t,e){const n=t.parentNode||t.parentId;if(!n)return!1;const o=e.get(n);return!!o&&(!!o.selected||Zv(o,e))}function Qv(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 mA(t,e,n,o){return Array.from(t.values()).filter(r=>(r.selected||r.id===o)&&(!r.parentNode||r.parentId||!Zv(r,t))&&(r.draggable||e&&r.draggable===void 0)).map(r=>{var s,a;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-(((a=r.positionAbsolute)==null?void 0:a.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 e2(t,e,n,o,r=[0,0],s){const a=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 i=a;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}=Gr(h,r).positionAbsolute;i=[[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}=Gr(h,r).positionAbsolute;i=h&&Sn(f)&&Sn(m)&&Sn(h.width)&&Sn(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]]]:i}else s==null||s("005",O8()),i=a;let d={x:0,y:0};if(l){const h=n.get(l);d=Gr(h,r).positionAbsolute}const u=i&&i!=="parent"?wh(e,i):e;return{position:{x:u.x-d.x,y:u.y-d.y},positionAbsolute:u}}function Uh({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]}Jv.displayName="Pane";const t2=(t,e,n,o)=>{const r=e.querySelectorAll(t);if(!r||!r.length)return null;const s=Array.from(r),a=e.getBoundingClientRect(),i=a.width*o[0],l=a.height*o[1];return s.map(d=>{const u=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),position:d.getAttribute("data-handlepos"),x:(u.left-a.left-i)/n,y:(u.top-a.top-l)/n,...vh(d)}})};function wa(t,e,n){return n===void 0?n:o=>{const r=e().nodeInternals.get(t);r&&n(o,{...r})}}function $h({id:t,store:e,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:r,unselectNodesAndEdges:s,multiSelectionActive:a,nodeInternals:i,onError:l}=e.getState(),d=i.get(t);d?(e.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&a)&&(s({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var u;return(u=o==null?void 0:o.current)==null?void 0:u.blur()})):r([t])):l==null||l("012",F8(t))}function Vh(t){return(e,n,o)=>t==null?void 0:t(e,o)}function n2({nodeRef:t,disabled:e=!1,noDragClassName:n,handleSelector:o,nodeId:r,isSelectable:s,selectNodesOnDrag:a}){const i=Ft(),[l,d]=T.useState(!1),u=T.useRef([]),h=T.useRef({x:null,y:null}),f=T.useRef(0),m=T.useRef(null),x=T.useRef({x:0,y:0}),g=T.useRef(null),p=T.useRef(!1),b=T.useRef(!1),y=T.useRef(!1),v=function(){const w=Ft();return T.useCallback(({sourceEvent:j})=>{const{transform:C,snapGrid:_,snapToGrid:E}=w.getState(),M=j.touches?j.touches[0].clientX:j.clientX,I=j.touches?j.touches[0].clientY:j.clientY,D={x:(M-C[0])/C[2],y:(I-C[1])/C[2]};return{xSnapped:E?_[0]*Math.round(D.x/_[0]):D.x,ySnapped:E?_[1]*Math.round(D.y/_[1]):D.y,...D}},[])}();return T.useEffect(()=>{if(t!=null&&t.current){const w=Bn(t.current),S=({x:_,y:E})=>{const{nodeInternals:M,onNodeDrag:I,onSelectionDrag:D,updateNodePositions:F,nodeExtent:O,snapGrid:P,snapToGrid:R,nodeOrigin:z,onError:N}=i.getState();h.current={x:_,y:E};let k=!1,B={x:0,y:0,x2:0,y2:0};if(u.current.length>1&&O){const U=Oh(u.current,z);B=kh(U)}if(u.current=u.current.map(U=>{const $={x:_-U.distance.x,y:E-U.distance.y};R&&($.x=P[0]*Math.round($.x/P[0]),$.y=P[1]*Math.round($.y/P[1]));const X=[[O[0][0],O[0][1]],[O[1][0],O[1][1]]];u.current.length>1&&O&&!U.extent&&(X[0][0]=U.positionAbsolute.x-B.x+O[0][0],X[1][0]=U.positionAbsolute.x+(U.width??0)-B.x2+O[1][0],X[0][1]=U.positionAbsolute.y-B.y+O[0][1],X[1][1]=U.positionAbsolute.y+(U.height??0)-B.y2+O[1][1]);const Y=e2(U,$,M,X,z,N);return k=k||U.position.x!==Y.position.x||U.position.y!==Y.position.y,U.position=Y.position,U.positionAbsolute=Y.positionAbsolute,U}),!k)return;F(u.current,!0,!0),d(!0);const A=r?I:Vh(D);if(A&&g.current){const[U,$]=Uh({nodeId:r,dragItems:u.current,nodeInternals:M});A(g.current,U,$)}},j=()=>{if(!m.current)return;const[_,E]=av(x.current,m.current);if(_!==0||E!==0){const{transform:M,panBy:I}=i.getState();h.current.x=(h.current.x??0)-_/M[2],h.current.y=(h.current.y??0)-E/M[2],I({x:_,y:E})&&S(h.current)}f.current=requestAnimationFrame(j)},C=_=>{var z;const{nodeInternals:E,multiSelectionActive:M,nodesDraggable:I,unselectNodesAndEdges:D,onNodeDragStart:F,onSelectionDragStart:O}=i.getState();b.current=!0;const P=r?F:Vh(O);a&&s||M||!r||(z=E.get(r))!=null&&z.selected||D(),r&&s&&a&&$h({id:r,store:i,nodeRef:t});const R=v(_);if(h.current=R,u.current=mA(E,I,R,r),P&&u.current){const[N,k]=Uh({nodeId:r,dragItems:u.current,nodeInternals:E});P(_.sourceEvent,N,k)}};if(!e){const _=function(){var E,M,I,D,F=v8,O=w8,P=k8,R=j8,z={},N=Dj("start","drag","end"),k=0,B=0;function A(V){V.on("mousedown.drag",U).filter(R).on("touchstart.drag",Y).on("touchmove.drag",G,y8).on("touchend.drag touchcancel.drag",W).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function U(V,Q){if(!D&&F.call(this,V,Q)){var te=J(this,O.call(this,V,Q),V,Q,"mouse");te&&(Bn(V.view).on("mousemove.drag",$,fa).on("mouseup.drag",X,fa),tv(V.view),xh(V),I=!1,E=V.clientX,M=V.clientY,te("start",V))}}function $(V){if(Hr(V),!I){var Q=V.clientX-E,te=V.clientY-M;I=Q*Q+te*te>B}z.mouse("drag",V)}function X(V){Bn(V.view).on("mousemove.drag mouseup.drag",null),nv(V.view,I),Hr(V),z.mouse("end",V)}function Y(V,Q){if(F.call(this,V,Q)){var te,re,ne=V.changedTouches,ae=O.call(this,V,Q),se=ne.length;for(te=0;te<se;++te)(re=J(this,ae,V,Q,ne[te].identifier,ne[te]))&&(xh(V),re("start",V,ne[te]))}}function G(V){var Q,te,re=V.changedTouches,ne=re.length;for(Q=0;Q<ne;++Q)(te=z[re[Q].identifier])&&(Hr(V),te("drag",V,re[Q]))}function W(V){var Q,te,re=V.changedTouches,ne=re.length;for(D&&clearTimeout(D),D=setTimeout(function(){D=null},500),Q=0;Q<ne;++Q)(te=z[re[Q].identifier])&&(xh(V),te("end",V,re[Q]))}function J(V,Q,te,re,ne,ae){var se,ie,ge,oe=N.copy(),ue=Gn(ae||te,Q);if((ge=P.call(V,new bh("beforestart",{sourceEvent:te,target:A,identifier:ne,active:k,x:ue[0],y:ue[1],dx:0,dy:0,dispatch:oe}),re))!=null)return se=ge.x-ue[0]||0,ie=ge.y-ue[1]||0,function de(Ce,Te,Fe){var _e,ke=ue;switch(Ce){case"start":z[ne]=de,_e=k++;break;case"end":delete z[ne],--k;case"drag":ue=Gn(Fe||Te,Q),_e=k}oe.call(Ce,V,new bh(Ce,{sourceEvent:Te,subject:ge,target:A,identifier:ne,active:_e,x:ue[0]+se,y:ue[1]+ie,dx:ue[0]-ke[0],dy:ue[1]-ke[1],dispatch:oe}),re)}}return A.filter=function(V){return arguments.length?(F=typeof V=="function"?V:Nl(!!V),A):F},A.container=function(V){return arguments.length?(O=typeof V=="function"?V:Nl(V),A):O},A.subject=function(V){return arguments.length?(P=typeof V=="function"?V:Nl(V),A):P},A.touchable=function(V){return arguments.length?(R=typeof V=="function"?V:Nl(!!V),A):R},A.on=function(){var V=N.on.apply(N,arguments);return V===N?A:V},A.clickDistance=function(V){return arguments.length?(B=(V=+V)*V,A):Math.sqrt(B)},A}().on("start",E=>{const{domNode:M,nodeDragThreshold:I}=i.getState();I===0&&C(E),y.current=!1;const D=v(E);h.current=D,m.current=(M==null?void 0:M.getBoundingClientRect())||null,x.current=Ro(E.sourceEvent,m.current)}).on("drag",E=>{var F,O;const M=v(E),{autoPanOnNodeDrag:I,nodeDragThreshold:D}=i.getState();if(E.sourceEvent.type==="touchmove"&&E.sourceEvent.touches.length>1&&(y.current=!0),!y.current){if(!p.current&&b.current&&I&&(p.current=!0,j()),!b.current){const P=M.xSnapped-(((F=h==null?void 0:h.current)==null?void 0:F.x)??0),R=M.ySnapped-(((O=h==null?void 0:h.current)==null?void 0:O.y)??0);Math.sqrt(P*P+R*R)>D&&C(E)}(h.current.x!==M.xSnapped||h.current.y!==M.ySnapped)&&u.current&&b.current&&(g.current=E.sourceEvent,x.current=Ro(E.sourceEvent,m.current),S(M))}}).on("end",E=>{if(b.current&&!y.current&&(d(!1),p.current=!1,b.current=!1,cancelAnimationFrame(f.current),u.current)){const{updateNodePositions:M,nodeInternals:I,onNodeDragStop:D,onSelectionDragStop:F}=i.getState(),O=r?D:Vh(F);if(M(u.current,!1,!1),O){const[P,R]=Uh({nodeId:r,dragItems:u.current,nodeInternals:I});O(E.sourceEvent,P,R)}}}).filter(E=>{const M=E.target;return!E.button&&(!n||!Qv(M,`.${n}`,t))&&(!o||Qv(M,o,t))});return w.call(_),()=>{w.on(".drag",null)}}w.on(".drag",null)}},[t,e,n,o,s,i,r,a,v]),l}function o2(){const t=Ft();return T.useCallback(n=>{const{nodeInternals:o,nodeExtent:r,updateNodePositions:s,getNodes:a,snapToGrid:i,snapGrid:l,onError:d,nodesDraggable:u}=t.getState(),h=a().filter(y=>y.selected&&(y.draggable||u&&y.draggable===void 0)),f=i?l[0]:5,m=i?l[1]:5,x=n.isShiftPressed?4:1,g=n.x*f*x,p=n.y*m*x,b=h.map(y=>{if(y.positionAbsolute){const v={x:y.positionAbsolute.x+g,y:y.positionAbsolute.y+p};i&&(v.x=l[0]*Math.round(v.x/l[0]),v.y=l[1]*Math.round(v.y/l[1]));const{positionAbsolute:w,position:S}=e2(y,v,o,r,void 0,d);y.position=S,y.positionAbsolute=w}return y});s(b,!0,!1)},[])}const Zr={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var ka=t=>{const e=({id:n,type:o,data:r,xPos:s,yPos:a,xPosOrigin:i,yPosOrigin:l,selected:d,onClick:u,onMouseEnter:h,onMouseMove:f,onMouseLeave:m,onContextMenu:x,onDoubleClick:g,style:p,className:b,isDraggable:y,isSelectable:v,isConnectable:w,isFocusable:S,selectNodesOnDrag:j,sourcePosition:C,targetPosition:_,hidden:E,resizeObserver:M,dragHandle:I,zIndex:D,isParent:F,noDragClassName:O,noPanClassName:P,initialized:R,disableKeyboardA11y:z,ariaLabel:N,rfId:k,hasHandleBounds:B})=>{const A=Ft(),U=T.useRef(null),$=T.useRef(null),X=T.useRef(C),Y=T.useRef(_),G=T.useRef(o),W=v||y||u||h||f||m,J=o2(),V=wa(n,A.getState,h),Q=wa(n,A.getState,f),te=wa(n,A.getState,m),re=wa(n,A.getState,x),ne=wa(n,A.getState,g);T.useEffect(()=>()=>{$.current&&(M==null||M.unobserve($.current),$.current=null)},[]),T.useEffect(()=>{if(U.current&&!E){const se=U.current;R&&B&&$.current===se||($.current&&(M==null||M.unobserve($.current)),M==null||M.observe(se),$.current=se)}},[E,R,B]),T.useEffect(()=>{const se=G.current!==o,ie=X.current!==C,ge=Y.current!==_;U.current&&(se||ie||ge)&&(se&&(G.current=o),ie&&(X.current=C),ge&&(Y.current=_),A.getState().updateNodeDimensions([{id:n,nodeElement:U.current,forceUpdate:!0}]))},[n,o,C,_]);const ae=n2({nodeRef:U,disabled:E||!y,noDragClassName:O,handleSelector:I,nodeId:n,isSelectable:v,selectNodesOnDrag:j});return E?null:q.createElement("div",{className:Xt(["react-flow__node",`react-flow__node-${o}`,{[P]:y},b,{selected:d,selectable:v,parent:F,dragging:ae}]),ref:U,style:{zIndex:D,transform:`translate(${i}px,${l}px)`,pointerEvents:W?"all":"none",visibility:R?"visible":"hidden",...p},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:V,onMouseMove:Q,onMouseLeave:te,onContextMenu:re,onClick:se=>{const{nodeDragThreshold:ie}=A.getState();if(v&&(!j||!y||ie>0)&&$h({id:n,store:A,nodeRef:U}),u){const ge=A.getState().nodeInternals.get(n);ge&&u(se,{...ge})}},onDoubleClick:ne,onKeyDown:S?se=>{if(!Sh(se)&&!z)if(cv.includes(se.key)&&v){const ie=se.key==="Escape";$h({id:n,store:A,unselect:ie,nodeRef:U})}else y&&d&&Object.prototype.hasOwnProperty.call(Zr,se.key)&&(A.setState({ariaLiveMessage:`Moved selected node ${se.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~s}, y: ${~~a}`}),J({x:Zr[se.key].x,y:Zr[se.key].y,isShiftPressed:se.shiftKey}))}:void 0,tabIndex:S?0:void 0,role:S?"button":void 0,"aria-describedby":z?void 0:`${zv}-${k}`,"aria-label":N},q.createElement(V8,{value:n},q.createElement(t,{id:n,data:r,type:o,xPos:s,yPos:a,selected:d,isConnectable:w,sourcePosition:C,targetPosition:_,dragging:ae,dragHandle:I,zIndex:D})))};return e.displayName="NodeWrapper",T.memo(e)};const pA=t=>{const e=t.getNodes().filter(n=>n.selected);return{...Oh(e,t.nodeOrigin),transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`,userSelectionActive:t.userSelectionActive}};var gA=T.memo(function({onSelectionContextMenu:t,noPanClassName:e,disableKeyboardA11y:n}){const o=Ft(),{width:r,height:s,x:a,y:i,transformString:l,userSelectionActive:d}=lt(pA,Vt),u=o2(),h=T.useRef(null);if(T.useEffect(()=>{var m;n||((m=h.current)==null||m.focus({preventScroll:!0}))},[n]),n2({nodeRef:h}),d||!r||!s)return null;const f=t?m=>{const x=o.getState().getNodes().filter(g=>g.selected);t(m,x)}:void 0;return q.createElement("div",{className:Xt(["react-flow__nodesselection","react-flow__container",e]),style:{transform:l}},q.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(Zr,m.key)&&u({x:Zr[m.key].x,y:Zr[m.key].y,isShiftPressed:m.shiftKey})},style:{width:r,height:s,top:i,left:a}}))});const xA=t=>t.nodesSelectionActive,r2=({children:t,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:a,deleteKeyCode:i,onMove:l,onMoveStart:d,onMoveEnd:u,selectionKeyCode:h,selectionOnDrag:f,selectionMode:m,onSelectionStart:x,onSelectionEnd:g,multiSelectionKeyCode:p,panActivationKeyCode:b,zoomActivationKeyCode:y,elementsSelectable:v,zoomOnScroll:w,zoomOnPinch:S,panOnScroll:j,panOnScrollSpeed:C,panOnScrollMode:_,zoomOnDoubleClick:E,panOnDrag:M,defaultViewport:I,translateExtent:D,minZoom:F,maxZoom:O,preventScrolling:P,onSelectionContextMenu:R,noWheelClassName:z,noPanClassName:N,disableKeyboardA11y:k})=>{const B=lt(xA),A=ya(h),U=ya(b),$=U||M,X=U||j,Y=A||f&&$!==!0;return(({deleteKeyCode:G,multiSelectionKeyCode:W})=>{const J=Ft(),{deleteElements:V}=va(),Q=ya(G,lA),te=ya(W);T.useEffect(()=>{if(Q){const{edges:re,getNodes:ne}=J.getState(),ae=ne().filter(ie=>ie.selected),se=re.filter(ie=>ie.selected);V({nodes:ae,edges:se}),J.setState({nodesSelectionActive:!1})}},[Q]),T.useEffect(()=>{J.setState({multiSelectionActive:te})},[te])})({deleteKeyCode:i,multiSelectionKeyCode:p}),q.createElement(dA,{onMove:l,onMoveStart:d,onMoveEnd:u,onPaneContextMenu:s,elementsSelectable:v,zoomOnScroll:w,zoomOnPinch:S,panOnScroll:X,panOnScrollSpeed:C,panOnScrollMode:_,zoomOnDoubleClick:E,panOnDrag:!A&&$,defaultViewport:I,translateExtent:D,minZoom:F,maxZoom:O,zoomActivationKeyCode:y,preventScrolling:P,noWheelClassName:z,noPanClassName:N},q.createElement(Jv,{onSelectionStart:x,onSelectionEnd:g,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:a,panOnDrag:$,isSelecting:!!Y,selectionMode:m},t,B&&q.createElement(gA,{onSelectionContextMenu:R,noPanClassName:N,disableKeyboardA11y:k})))};r2.displayName="FlowRenderer";var bA=T.memo(r2);function yA(t){return{input:ka(t.input||Dv),default:ka(t.default||Rh),output:ka(t.output||Rv),group:ka(t.group||Lh),...Object.keys(t).filter(e=>!["input","default","output","group"].includes(e)).reduce((e,n)=>(e[n]=ka(t[n]||Rh),e),{})}}const vA=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,updateNodeDimensions:t.updateNodeDimensions,onError:t.onError}),s2=t=>{const{nodesDraggable:e,nodesConnectable:n,nodesFocusable:o,elementsSelectable:r,updateNodeDimensions:s,onError:a}=lt(vA,Vt),i=(l=t.onlyRenderVisibleElements,lt(T.useCallback(h=>l?jv(h.nodeInternals,{x:0,y:0,width:h.width,height:h.height},h.transform,!0):h.getNodes(),[l])));var l;const d=T.useRef(),u=T.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const h=new ResizeObserver(f=>{const m=f.map(x=>({id:x.target.getAttribute("data-id"),nodeElement:x.target,forceUpdate:!0}));s(m)});return d.current=h,h},[]);return T.useEffect(()=>()=>{var h;(h=d==null?void 0:d.current)==null||h.disconnect()},[]),q.createElement("div",{className:"react-flow__nodes",style:zh},i.map(h=>{var j,C,_;let f=h.type||"default";t.nodeTypes[f]||(a==null||a("003",T8(f)),f="default");const m=t.nodeTypes[f]||t.nodeTypes.default,x=!!(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,v=(y==null?void 0:y.x)??0,w=(y==null?void 0:y.y)??0,S=(({x:E,y:M,width:I,height:D,origin:F})=>I&&D?F[0]<0||F[1]<0||F[0]>1||F[1]>1?{x:E,y:M}:{x:E-I*F[0],y:M-D*F[1]}:{x:E,y:M})({x:v,y:w,width:h.width??0,height:h.height??0,origin:t.nodeOrigin});return q.createElement(m,{key:h.id,id:h.id,className:h.className,style:h.style,type:f,data:h.data,sourcePosition:h.sourcePosition||Oe.Bottom,targetPosition:h.targetPosition||Oe.Top,hidden:h.hidden,xPos:v,yPos:w,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:x,isSelectable:g,isConnectable:p,isFocusable:b,resizeObserver:u,dragHandle:h.dragHandle,zIndex:((j=h[bt])==null?void 0:j.z)??0,isParent:!!((C=h[bt])!=null&&C.isParent),noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,initialized:!!h.width&&!!h.height,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,ariaLabel:h.ariaLabel,hasHandleBounds:!!((_=h[bt])!=null&&_.handleBounds)})}))};s2.displayName="NodeRenderer";var wA=T.memo(s2);const kA=(t,e,n)=>n===Oe.Left?t-e:n===Oe.Right?t+e:t,jA=(t,e,n)=>n===Oe.Top?t-e:n===Oe.Bottom?t+e:t,a2="react-flow__edgeupdater",i2=({position:t,centerX:e,centerY:n,radius:o=10,onMouseDown:r,onMouseEnter:s,onMouseOut:a,type:i})=>q.createElement("circle",{onMouseDown:r,onMouseEnter:s,onMouseOut:a,className:Xt([a2,`${a2}-${i}`]),cx:kA(e,o,t),cy:jA(n,o,t),r:o,stroke:"transparent",fill:"transparent"}),SA=()=>!0;var Qr=t=>{const e=({id:n,className:o,type:r,data:s,onClick:a,onEdgeDoubleClick:i,selected:l,animated:d,label:u,labelStyle:h,labelShowBg:f,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:g,style:p,source:b,target:y,sourceX:v,sourceY:w,targetX:S,targetY:j,sourcePosition:C,targetPosition:_,elementsSelectable:E,hidden:M,sourceHandleId:I,targetHandleId:D,onContextMenu:F,onMouseEnter:O,onMouseMove:P,onMouseLeave:R,reconnectRadius:z,onReconnect:N,onReconnectStart:k,onReconnectEnd:B,markerEnd:A,markerStart:U,rfId:$,ariaLabel:X,isFocusable:Y,isReconnectable:G,pathOptions:W,interactionWidth:J,disableKeyboardA11y:V})=>{const Q=T.useRef(null),[te,re]=T.useState(!1),[ne,ae]=T.useState(!1),se=Ft(),ie=T.useMemo(()=>`url('#${Th(U,$)}')`,[U,$]),ge=T.useMemo(()=>`url('#${Th(A,$)}')`,[A,$]);if(M)return null;const oe=ga(n,se.getState,i),ue=ga(n,se.getState,F),de=ga(n,se.getState,O),Ce=ga(n,se.getState,P),Te=ga(n,se.getState,R),Fe=(Ve,Ke)=>{if(Ve.button!==0)return;const{edges:ee,isValidConnection:ye}=se.getState(),we=Ke?y:b,Ie=(Ke?D:I)||null,K=Ke?"target":"source",me=ye||SA,pe=Ke,he=ee.find(je=>je.id===n);ae(!0),k==null||k(Ve,he,K),Iv({event:Ve,handleId:Ie,nodeId:we,onConnect:je=>N==null?void 0:N(he,je),isTarget:pe,getState:se.getState,setState:se.setState,isValidConnection:me,edgeUpdaterType:K,onReconnectEnd:je=>{ae(!1),B==null||B(je,he,K)}})},_e=()=>re(!0),ke=()=>re(!1),Ye=!E&&!a;return q.createElement("g",{className:Xt(["react-flow__edge",`react-flow__edge-${r}`,o,{selected:l,animated:d,inactive:Ye,updating:te}]),onClick:Ve=>{var K;const{edges:Ke,addSelectedEdges:ee,unselectNodesAndEdges:ye,multiSelectionActive:we}=se.getState(),Ie=Ke.find(me=>me.id===n);Ie&&(E&&(se.setState({nodesSelectionActive:!1}),Ie.selected&&we?(ye({nodes:[],edges:[Ie]}),(K=Q.current)==null||K.blur()):ee([n])),a&&a(Ve,Ie))},onDoubleClick:oe,onContextMenu:ue,onMouseEnter:de,onMouseMove:Ce,onMouseLeave:Te,onKeyDown:Y?Ve=>{var Ke;if(!V&&cv.includes(Ve.key)&&E){const{unselectNodesAndEdges:ee,addSelectedEdges:ye,edges:we}=se.getState();Ve.key==="Escape"?((Ke=Q.current)==null||Ke.blur(),ee({edges:[we.find(Ie=>Ie.id===n)]})):ye([n])}}:void 0,tabIndex:Y?0:void 0,role:Y?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":X===null?void 0:X||`Edge from ${b} to ${y}`,"aria-describedby":Y?`${Bv}-${$}`:void 0,ref:Q},!ne&&q.createElement(t,{id:n,source:b,target:y,selected:l,animated:d,label:u,labelStyle:h,labelShowBg:f,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:g,data:s,style:p,sourceX:v,sourceY:w,targetX:S,targetY:j,sourcePosition:C,targetPosition:_,sourceHandleId:I,targetHandleId:D,markerStart:ie,markerEnd:ge,pathOptions:W,interactionWidth:J}),G&&q.createElement(q.Fragment,null,(G==="source"||G===!0)&&q.createElement(i2,{position:C,centerX:v,centerY:w,radius:z,onMouseDown:Ve=>Fe(Ve,!0),onMouseEnter:_e,onMouseOut:ke,type:"source"}),(G==="target"||G===!0)&&q.createElement(i2,{position:_,centerX:S,centerY:j,radius:z,onMouseDown:Ve=>Fe(Ve,!1),onMouseEnter:_e,onMouseOut:ke,type:"target"})))};return e.displayName="EdgeWrapper",T.memo(e)};function CA(t){return{default:Qr(t.default||Dl),straight:Qr(t.bezier||Ih),step:Qr(t.step||_h),smoothstep:Qr(t.step||Ml),simplebezier:Qr(t.simplebezier||Nh),...Object.keys(t).filter(e=>!["default","bezier"].includes(e)).reduce((e,n)=>(e[n]=Qr(t[n]||Dl),e),{})}}function l2(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,a=(n==null?void 0:n.height)||e.height;switch(t){case Oe.Top:return{x:o+s/2,y:r};case Oe.Right:return{x:o+s,y:r+a/2};case Oe.Bottom:return{x:o+s/2,y:r+a};case Oe.Left:return{x:o,y:r+a/2}}}function c2(t,e){return t?t.length!==1&&e?e&&t.find(n=>n.id===e)||null:t[0]:null}function d2(t){var o,r,s,a,i;const e=((o=t==null?void 0:t[bt])==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:((a=t==null?void 0:t.positionAbsolute)==null?void 0:a.x)||0,y:((i=t==null?void 0:t.positionAbsolute)==null?void 0:i.y)||0,width:(t==null?void 0:t.width)||0,height:(t==null?void 0:t.height)||0},e,!!n]}const NA=[{level:0,isMaxLevel:!0,edges:[]}];function EA(t,e,n){return function(o,r,s=!1){let a=-1;const i=o.reduce((d,u)=>{var m,x;const h=Sn(u.zIndex);let f=h?u.zIndex:0;if(s){const g=r.get(u.target),p=r.get(u.source),b=u.selected||(g==null?void 0:g.selected)||(p==null?void 0:p.selected),y=Math.max(((m=p==null?void 0:p[bt])==null?void 0:m.z)||0,((x=g==null?void 0:g[bt])==null?void 0:x.z)||0,1e3);f=(h?u.zIndex:0)+(b?y:0)}return d[f]?d[f].push(u):d[f]=[u],a=f>a?f:a,d},{}),l=Object.entries(i).map(([d,u])=>{const h=+d;return{edges:u,level:h,isMaxLevel:h===a}});return l.length===0?NA:l}(lt(T.useCallback(o=>t?o.edges.filter(r=>{const s=e.get(r.source),a=e.get(r.target);return(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&(a==null?void 0:a.width)&&(a==null?void 0:a.height)&&function({sourcePos:i,targetPos:l,sourceWidth:d,sourceHeight:u,targetWidth:h,targetHeight:f,width:m,height:x,transform:g}){const p={x:Math.min(i.x,l.x),y:Math.min(i.y,l.y),x2:Math.max(i.x+d,l.x+h),y2:Math.max(i.y+u,l.y+f)};p.x===p.x2&&(p.x2+=1),p.y===p.y2&&(p.y2+=1);const b=kh({x:(0-g[0])/g[2],y:(0-g[1])/g[2],width:m/g[2],height:x/g[2]}),y=Math.max(0,Math.min(b.x2,p.x2)-Math.max(b.x,p.x)),v=Math.max(0,Math.min(b.y2,p.y2)-Math.max(b.y,p.y));return Math.ceil(y*v)>0}({sourcePos:s.positionAbsolute||{x:0,y:0},targetPos:a.positionAbsolute||{x:0,y:0},sourceWidth:s.width,sourceHeight:s.height,targetWidth:a.width,targetHeight:a.height,width:o.width,height:o.height,transform:o.transform})}):o.edges,[t,e])),e,n)}const u2={[qr.Arrow]:({color:t="none",strokeWidth:e=1})=>q.createElement("polyline",{style:{stroke:t,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),[qr.ArrowClosed]:({color:t="none",strokeWidth:e=1})=>q.createElement("polyline",{style:{stroke:t,fill:t,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},_A=({id:t,type:e,color:n,width:o=12.5,height:r=12.5,markerUnits:s="strokeWidth",strokeWidth:a,orient:i="auto-start-reverse"})=>{const l=function(d){const u=Ft();return T.useMemo(()=>{var h,f;return Object.prototype.hasOwnProperty.call(u2,d)?u2[d]:((f=(h=u.getState()).onError)==null||f.call(h,"009",D8(d)),null)},[d])}(e);return l?q.createElement("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${o}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:i,refX:"0",refY:"0"},q.createElement(l,{color:n,strokeWidth:a})):null},h2=({defaultColor:t,rfId:e})=>{const n=lt(T.useCallback((({defaultColor:o,rfId:r})=>s=>{const a=[];return s.edges.reduce((i,l)=>([l.markerStart,l.markerEnd].forEach(d=>{if(d&&typeof d=="object"){const u=Th(d,r);a.includes(u)||(i.push({id:u,color:d.color||o,...d}),a.push(u))}}),i),[]).sort((i,l)=>i.id.localeCompare(l.id))})({defaultColor:t,rfId:e}),[t,e]),(o,r)=>!(o.length!==r.length||o.some((s,a)=>s.id!==r[a].id)));return q.createElement("defs",null,n.map(o=>q.createElement(_A,{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})))};h2.displayName="MarkerDefinitions";var IA=T.memo(h2);const AA=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}),f2=({defaultMarkerColor:t,onlyRenderVisibleElements:e,elevateEdgesOnSelect:n,rfId:o,edgeTypes:r,noPanClassName:s,onEdgeContextMenu:a,onEdgeMouseEnter:i,onEdgeMouseMove:l,onEdgeMouseLeave:d,onEdgeClick:u,onEdgeDoubleClick:h,onReconnect:f,onReconnectStart:m,onReconnectEnd:x,reconnectRadius:g,children:p,disableKeyboardA11y:b})=>{const{edgesFocusable:y,edgesUpdatable:v,elementsSelectable:w,width:S,height:j,connectionMode:C,nodeInternals:_,onError:E}=lt(AA,Vt),M=EA(e,_,n);return S?q.createElement(q.Fragment,null,M.map(({level:I,edges:D,isMaxLevel:F})=>q.createElement("svg",{key:I,style:{zIndex:I},width:S,height:j,className:"react-flow__edges react-flow__container"},F&&q.createElement(IA,{defaultColor:t,rfId:o}),q.createElement("g",null,D.map(O=>{const[P,R,z]=d2(_.get(O.source)),[N,k,B]=d2(_.get(O.target));if(!z||!B)return null;let A=O.type||"default";r[A]||(E==null||E("011",L8(A)),A="default");const U=r[A]||r.default,$=C===lr.Strict?k.target:(k.target??[]).concat(k.source??[]),X=c2(R.source,O.sourceHandle),Y=c2($,O.targetHandle),G=(X==null?void 0:X.position)||Oe.Bottom,W=(Y==null?void 0:Y.position)||Oe.Top,J=!!(O.focusable||y&&O.focusable===void 0),V=O.reconnectable||O.updatable,Q=f!==void 0&&(V||v&&V===void 0);if(!X||!Y)return E==null||E("008",P8(X,O)),null;const{sourceX:te,sourceY:re,targetX:ne,targetY:ae}=((se,ie,ge,oe,ue,de)=>{const Ce=l2(ge,se,ie),Te=l2(de,oe,ue);return{sourceX:Ce.x,sourceY:Ce.y,targetX:Te.x,targetY:Te.y}})(P,X,G,N,Y,W);return q.createElement(U,{key:O.id,id:O.id,className:Xt([O.className,s]),type:A,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:te,sourceY:re,targetX:ne,targetY:ae,sourcePosition:G,targetPosition:W,elementsSelectable:w,onContextMenu:a,onMouseEnter:i,onMouseMove:l,onMouseLeave:d,onClick:u,onEdgeDoubleClick:h,onReconnect:f,onReconnectStart:m,onReconnectEnd:x,reconnectRadius:g,rfId:o,ariaLabel:O.ariaLabel,isFocusable:J,isReconnectable:Q,pathOptions:"pathOptions"in O?O.pathOptions:void 0,interactionWidth:O.interactionWidth,disableKeyboardA11y:b})})))),p):null};f2.displayName="EdgeRenderer";var TA=T.memo(f2);const MA=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function OA({children:t}){const e=lt(MA);return q.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:e}},t)}const DA={[Oe.Left]:Oe.Right,[Oe.Right]:Oe.Left,[Oe.Top]:Oe.Bottom,[Oe.Bottom]:Oe.Top},m2=({nodeId:t,handleType:e,style:n,type:o=Fo.Bezier,CustomComponent:r,connectionStatus:s})=>{var j,C,_;const{fromNode:a,handleId:i,toX:l,toY:d,connectionMode:u}=lt(T.useCallback(E=>({fromNode:E.nodeInternals.get(t),handleId:E.connectionHandleId,toX:(E.connectionPosition.x-E.transform[0])/E.transform[2],toY:(E.connectionPosition.y-E.transform[1])/E.transform[2],connectionMode:E.connectionMode}),[t]),Vt),h=(j=a==null?void 0:a[bt])==null?void 0:j.handleBounds;let f=h==null?void 0:h[e];if(u===lr.Loose&&(f=f||(h==null?void 0:h[e==="source"?"target":"source"])),!a||!f)return null;const m=i?f.find(E=>E.id===i):f[0],x=m?m.x+m.width/2:(a.width??0)/2,g=m?m.y+m.height/2:a.height??0,p=(((C=a.positionAbsolute)==null?void 0:C.x)??0)+x,b=(((_=a.positionAbsolute)==null?void 0:_.y)??0)+g,y=m==null?void 0:m.position,v=y?DA[y]:null;if(!y||!v)return null;if(r)return q.createElement(r,{connectionLineType:o,connectionLineStyle:n,fromNode:a,fromHandle:m,fromX:p,fromY:b,toX:l,toY:d,fromPosition:y,toPosition:v,connectionStatus:s});let w="";const S={sourceX:p,sourceY:b,sourcePosition:y,targetX:l,targetY:d,targetPosition:v};return o===Fo.Bezier?[w]=wv(S):o===Fo.Step?[w]=Eh({...S,borderRadius:0}):o===Fo.SmoothStep?[w]=Eh(S):o===Fo.SimpleBezier?[w]=xv(S):w=`M${p},${b} ${l},${d}`,q.createElement("path",{d:w,fill:"none",className:"react-flow__connection-path",style:n})};m2.displayName="ConnectionLine";const PA=t=>({nodeId:t.connectionNodeId,handleType:t.connectionHandleType,nodesConnectable:t.nodesConnectable,connectionStatus:t.connectionStatus,width:t.width,height:t.height});function RA({containerStyle:t,style:e,type:n,component:o}){const{nodeId:r,handleType:s,nodesConnectable:a,width:i,height:l,connectionStatus:d}=lt(PA,Vt);return r&&s&&i&&a?q.createElement("svg",{style:t,width:i,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container"},q.createElement("g",{className:Xt(["react-flow__connection",d])},q.createElement(m2,{nodeId:r,handleType:s,style:e,type:n,CustomComponent:o,connectionStatus:d}))):null}function p2(t,e){return T.useRef(null),Ft(),T.useMemo(()=>e(t),[t])}const g2=({nodeTypes:t,edgeTypes:e,onMove:n,onMoveStart:o,onMoveEnd:r,onInit:s,onNodeClick:a,onEdgeClick:i,onNodeDoubleClick:l,onEdgeDoubleClick:d,onNodeMouseEnter:u,onNodeMouseMove:h,onNodeMouseLeave:f,onNodeContextMenu:m,onSelectionContextMenu:x,onSelectionStart:g,onSelectionEnd:p,connectionLineType:b,connectionLineStyle:y,connectionLineComponent:v,connectionLineContainerStyle:w,selectionKeyCode:S,selectionOnDrag:j,selectionMode:C,multiSelectionKeyCode:_,panActivationKeyCode:E,zoomActivationKeyCode:M,deleteKeyCode:I,onlyRenderVisibleElements:D,elementsSelectable:F,selectNodesOnDrag:O,defaultViewport:P,translateExtent:R,minZoom:z,maxZoom:N,preventScrolling:k,defaultMarkerColor:B,zoomOnScroll:A,zoomOnPinch:U,panOnScroll:$,panOnScrollSpeed:X,panOnScrollMode:Y,zoomOnDoubleClick:G,panOnDrag:W,onPaneClick:J,onPaneMouseEnter:V,onPaneMouseMove:Q,onPaneMouseLeave:te,onPaneScroll:re,onPaneContextMenu:ne,onEdgeContextMenu:ae,onEdgeMouseEnter:se,onEdgeMouseMove:ie,onEdgeMouseLeave:ge,onReconnect:oe,onReconnectStart:ue,onReconnectEnd:de,reconnectRadius:Ce,noDragClassName:Te,noWheelClassName:Fe,noPanClassName:_e,elevateEdgesOnSelect:ke,disableKeyboardA11y:Ye,nodeOrigin:Ve,nodeExtent:Ke,rfId:ee})=>{const ye=p2(t,yA),we=p2(e,CA);return function(Ie){const K=va(),me=T.useRef(!1);T.useEffect(()=>{!me.current&&K.viewportInitialized&&Ie&&(setTimeout(()=>Ie(K),1),me.current=!0)},[Ie,K.viewportInitialized])}(s),q.createElement(bA,{onPaneClick:J,onPaneMouseEnter:V,onPaneMouseMove:Q,onPaneMouseLeave:te,onPaneContextMenu:ne,onPaneScroll:re,deleteKeyCode:I,selectionKeyCode:S,selectionOnDrag:j,selectionMode:C,onSelectionStart:g,onSelectionEnd:p,multiSelectionKeyCode:_,panActivationKeyCode:E,zoomActivationKeyCode:M,elementsSelectable:F,onMove:n,onMoveStart:o,onMoveEnd:r,zoomOnScroll:A,zoomOnPinch:U,zoomOnDoubleClick:G,panOnScroll:$,panOnScrollSpeed:X,panOnScrollMode:Y,panOnDrag:W,defaultViewport:P,translateExtent:R,minZoom:z,maxZoom:N,onSelectionContextMenu:x,preventScrolling:k,noDragClassName:Te,noWheelClassName:Fe,noPanClassName:_e,disableKeyboardA11y:Ye},q.createElement(OA,null,q.createElement(TA,{edgeTypes:we,onEdgeClick:i,onEdgeDoubleClick:d,onlyRenderVisibleElements:D,onEdgeContextMenu:ae,onEdgeMouseEnter:se,onEdgeMouseMove:ie,onEdgeMouseLeave:ge,onReconnect:oe,onReconnectStart:ue,onReconnectEnd:de,reconnectRadius:Ce,defaultMarkerColor:B,noPanClassName:_e,elevateEdgesOnSelect:!!ke,disableKeyboardA11y:Ye,rfId:ee},q.createElement(RA,{style:y,type:b,component:v,containerStyle:w})),q.createElement("div",{className:"react-flow__edgelabel-renderer"}),q.createElement(wA,{nodeTypes:ye,onNodeClick:a,onNodeDoubleClick:l,onNodeMouseEnter:u,onNodeMouseMove:h,onNodeMouseLeave:f,onNodeContextMenu:m,selectNodesOnDrag:O,onlyRenderVisibleElements:D,noPanClassName:_e,noDragClassName:Te,disableKeyboardA11y:Ye,nodeOrigin:Ve,nodeExtent:Ke,rfId:ee})))};g2.displayName="GraphView";var LA=T.memo(g2);const Hh=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Uo={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:Hh,nodeExtent:Hh,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:lr.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},FA=()=>((t,e)=>t?ev(t,e):ev)((t,e)=>({...Uo,setNodes:n=>{const{nodeInternals:o,nodeOrigin:r,elevateNodesOnSelect:s}=e();t({nodeInternals:Fh(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,a=r?Fh(n,new Map,e().nodeOrigin,e().elevateNodesOnSelect):new Map;t({nodeInternals:a,edges:s?o:[],hasDefaultNodes:r,hasDefaultEdges:s})},updateNodeDimensions:n=>{const{onNodesChange:o,nodeInternals:r,fitViewOnInit:s,fitViewOnInitDone:a,fitViewOnInitOptions:i,domNode:l,nodeOrigin:d}=e(),u=l==null?void 0:l.querySelector(".react-flow__viewport");if(!u)return;const h=window.getComputedStyle(u),{m22:f}=new window.DOMMatrixReadOnly(h.transform),m=n.reduce((g,p)=>{const b=r.get(p.id);if(b!=null&&b.hidden)r.set(b.id,{...b,[bt]:{...b[bt],handleBounds:void 0}});else if(b){const y=vh(p.nodeElement);!(!y.width||!y.height||b.width===y.width&&b.height===y.height&&!p.forceUpdate)&&(r.set(b.id,{...b,[bt]:{...b[bt],handleBounds:{source:t2(".source",p.nodeElement,f,d),target:t2(".target",p.nodeElement,f,d)}},...y}),g.push({id:b.id,type:"dimensions",dimensions:y}))}return g},[]);Hv(r,d);const x=a||s&&!a&&Wv(e,{initial:!0,...i});t({nodeInternals:new Map(r),fitViewOnInitDone:x}),(m==null?void 0:m.length)>0&&(o==null||o(m))},updateNodePositions:(n,o=!0,r=!1)=>{const{triggerNodeChanges:s}=e(),a=n.map(i=>{const l={id:i.id,type:"position",dragging:r};return o&&(l.positionAbsolute=i.positionAbsolute,l.position=i.position),l});s(a)},triggerNodeChanges:n=>{const{onNodesChange:o,nodeInternals:r,hasDefaultNodes:s,nodeOrigin:a,getNodes:i,elevateNodesOnSelect:l}=e();if(n!=null&&n.length){if(s){const d=Fh(Xv(n,i()),r,a,l);t({nodeInternals:d})}o==null||o(n)}},addSelectedNodes:n=>{const{multiSelectionActive:o,edges:r,getNodes:s}=e();let a,i=null;o?a=n.map(l=>Bo(l,!0)):(a=Jr(s(),n),i=Jr(r,[])),Rl({changedNodes:a,changedEdges:i,get:e,set:t})},addSelectedEdges:n=>{const{multiSelectionActive:o,edges:r,getNodes:s}=e();let a,i=null;o?a=n.map(l=>Bo(l,!0)):(a=Jr(r,n),i=Jr(s(),[])),Rl({changedNodes:i,changedEdges:a,get:e,set:t})},unselectNodesAndEdges:({nodes:n,edges:o}={})=>{const{edges:r,getNodes:s}=e(),a=o||r;Rl({changedNodes:(n||s()).map(i=>(i.selected=!1,Bo(i.id,!1))),changedEdges:a.map(i=>Bo(i.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();Rl({changedNodes:o().filter(r=>r.selected).map(r=>Bo(r.id,!1)),changedEdges:n.filter(r=>r.selected).map(r=>Bo(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:a,d3Selection:i,translateExtent:l}=e();if(!a||!i||!n.x&&!n.y)return!1;const d=Jo.translate(o[0]+n.x,o[1]+n.y).scale(o[2]),u=[[0,0],[r,s]],h=a==null?void 0:a.constrain()(d,u,l);return a.transform(i,h),o[0]!==h.x||o[1]!==h.y||o[2]!==h.k},cancelConnection:()=>t({connectionNodeId:Uo.connectionNodeId,connectionHandleId:Uo.connectionHandleId,connectionHandleType:Uo.connectionHandleType,connectionStatus:Uo.connectionStatus,connectionStartHandle:Uo.connectionStartHandle,connectionEndHandle:Uo.connectionEndHandle}),reset:()=>t({...Uo})}),Object.is),Wh=({children:t})=>{const e=T.useRef(null);return e.current||(e.current=FA()),q.createElement(A8,{value:e.current},t)};Wh.displayName="ReactFlowProvider";const x2=({children:t})=>T.useContext(_l)?q.createElement(q.Fragment,null,t):q.createElement(Wh,null,t);x2.displayName="ReactFlowWrapper";const zA={input:Dv,default:Rh,output:Rv,group:Lh},BA={default:Dl,straight:Ih,step:_h,smoothstep:Ml,simplebezier:Nh},UA=[0,0],$A=[15,15],VA={x:0,y:0,zoom:1},HA={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},qh=T.forwardRef(({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,className:r,nodeTypes:s=zA,edgeTypes:a=BA,onNodeClick:i,onEdgeClick:l,onInit:d,onMove:u,onMoveStart:h,onMoveEnd:f,onConnect:m,onConnectStart:x,onConnectEnd:g,onClickConnectStart:p,onClickConnectEnd:b,onNodeMouseEnter:y,onNodeMouseMove:v,onNodeMouseLeave:w,onNodeContextMenu:S,onNodeDoubleClick:j,onNodeDragStart:C,onNodeDrag:_,onNodeDragStop:E,onNodesDelete:M,onEdgesDelete:I,onSelectionChange:D,onSelectionDragStart:F,onSelectionDrag:O,onSelectionDragStop:P,onSelectionContextMenu:R,onSelectionStart:z,onSelectionEnd:N,connectionMode:k=lr.Strict,connectionLineType:B=Fo.Bezier,connectionLineStyle:A,connectionLineComponent:U,connectionLineContainerStyle:$,deleteKeyCode:X="Backspace",selectionKeyCode:Y="Shift",selectionOnDrag:G=!1,selectionMode:W=xa.Full,panActivationKeyCode:J="Space",multiSelectionKeyCode:V=Al()?"Meta":"Control",zoomActivationKeyCode:Q=Al()?"Meta":"Control",snapToGrid:te=!1,snapGrid:re=$A,onlyRenderVisibleElements:ne=!1,selectNodesOnDrag:ae=!0,nodesDraggable:se,nodesConnectable:ie,nodesFocusable:ge,nodeOrigin:oe=UA,edgesFocusable:ue,edgesUpdatable:de,elementsSelectable:Ce,defaultViewport:Te=VA,minZoom:Fe=.5,maxZoom:_e=2,translateExtent:ke=Hh,preventScrolling:Ye=!0,nodeExtent:Ve,defaultMarkerColor:Ke="#b1b1b7",zoomOnScroll:ee=!0,zoomOnPinch:ye=!0,panOnScroll:we=!1,panOnScrollSpeed:Ie=.5,panOnScrollMode:K=Lo.Free,zoomOnDoubleClick:me=!0,panOnDrag:pe=!0,onPaneClick:he,onPaneMouseEnter:je,onPaneMouseMove:Pe,onPaneMouseLeave:Re,onPaneScroll:He,onPaneContextMenu:le,children:Ae,onEdgeContextMenu:Me,onEdgeDoubleClick:Be,onEdgeMouseEnter:qe,onEdgeMouseMove:De,onEdgeMouseLeave:$e,onEdgeUpdate:ot,onEdgeUpdateStart:Xe,onEdgeUpdateEnd:st,onReconnect:Bt,onReconnectStart:Ht,onReconnectEnd:pn,reconnectRadius:Jt=10,edgeUpdaterRadius:Dn=10,onNodesChange:ts,onEdgesChange:Yn,noDragClassName:ko="nodrag",noWheelClassName:Nn="nowheel",noPanClassName:ns="nopan",fitView:Sa=!1,fitViewOptions:vM,connectOnClick:wM=!0,attributionPosition:kM,proOptions:jM,defaultEdgeOptions:SM,elevateNodesOnSelect:CM=!0,elevateEdgesOnSelect:NM=!1,disableKeyboardA11y:ck=!1,autoPanOnConnect:EM=!0,autoPanOnNodeDrag:_M=!0,connectionRadius:IM=20,isValidConnection:AM,onError:TM,style:MM,id:dk,nodeDragThreshold:OM,...DM},PM)=>{const Ff=dk||"1";return q.createElement("div",{...DM,style:{...MM,...HA},ref:PM,className:Xt(["react-flow",r]),"data-testid":"rf__wrapper",id:dk},q.createElement(x2,null,q.createElement(LA,{onInit:d,onMove:u,onMoveStart:h,onMoveEnd:f,onNodeClick:i,onEdgeClick:l,onNodeMouseEnter:y,onNodeMouseMove:v,onNodeMouseLeave:w,onNodeContextMenu:S,onNodeDoubleClick:j,nodeTypes:s,edgeTypes:a,connectionLineType:B,connectionLineStyle:A,connectionLineComponent:U,connectionLineContainerStyle:$,selectionKeyCode:Y,selectionOnDrag:G,selectionMode:W,deleteKeyCode:X,multiSelectionKeyCode:V,panActivationKeyCode:J,zoomActivationKeyCode:Q,onlyRenderVisibleElements:ne,selectNodesOnDrag:ae,defaultViewport:Te,translateExtent:ke,minZoom:Fe,maxZoom:_e,preventScrolling:Ye,zoomOnScroll:ee,zoomOnPinch:ye,zoomOnDoubleClick:me,panOnScroll:we,panOnScrollSpeed:Ie,panOnScrollMode:K,panOnDrag:pe,onPaneClick:he,onPaneMouseEnter:je,onPaneMouseMove:Pe,onPaneMouseLeave:Re,onPaneScroll:He,onPaneContextMenu:le,onSelectionContextMenu:R,onSelectionStart:z,onSelectionEnd:N,onEdgeContextMenu:Me,onEdgeDoubleClick:Be,onEdgeMouseEnter:qe,onEdgeMouseMove:De,onEdgeMouseLeave:$e,onReconnect:Bt??ot,onReconnectStart:Ht??Xe,onReconnectEnd:pn??st,reconnectRadius:Jt??Dn,defaultMarkerColor:Ke,noDragClassName:ko,noWheelClassName:Nn,noPanClassName:ns,elevateEdgesOnSelect:NM,rfId:Ff,disableKeyboardA11y:ck,nodeOrigin:oe,nodeExtent:Ve}),q.createElement(Q8,{nodes:t,edges:e,defaultNodes:n,defaultEdges:o,onConnect:m,onConnectStart:x,onConnectEnd:g,onClickConnectStart:p,onClickConnectEnd:b,nodesDraggable:se,nodesConnectable:ie,nodesFocusable:ge,edgesFocusable:ue,edgesUpdatable:de,elementsSelectable:Ce,elevateNodesOnSelect:CM,minZoom:Fe,maxZoom:_e,nodeExtent:Ve,onNodesChange:ts,onEdgesChange:Yn,snapToGrid:te,snapGrid:re,connectionMode:k,translateExtent:ke,connectOnClick:wM,defaultEdgeOptions:SM,fitView:Sa,fitViewOptions:vM,onNodesDelete:M,onEdgesDelete:I,onNodeDragStart:C,onNodeDrag:_,onNodeDragStop:E,onSelectionDrag:O,onSelectionDragStart:F,onSelectionDragStop:P,noPanClassName:ns,nodeOrigin:oe,rfId:Ff,autoPanOnConnect:EM,autoPanOnNodeDrag:_M,onError:TM,connectionRadius:IM,isValidConnection:AM,nodeDragThreshold:OM}),q.createElement(J8,{onSelectionChange:D}),Ae,q.createElement(B8,{proOptions:jM,position:kM}),q.createElement(oA,{rfId:Ff,disableKeyboardA11y:ck})))});function b2(t){return e=>{const[n,o]=T.useState(e),r=T.useCallback(s=>o(a=>t(s,a)),[]);return[n,o,r]}}qh.displayName="ReactFlow";const y2=b2(Xv),v2=b2(function(t,e){return Kv(t,e)});function WA(){return q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},q.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function qA(){return q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},q.createElement("path",{d:"M0 0h32v4.2H0z"}))}function GA(){return q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},q.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 YA(){return q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},q.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 KA(){return q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},q.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 es=({children:t,className:e,...n})=>q.createElement("button",{type:"button",className:Xt(["react-flow__controls-button",e]),...n},t);es.displayName="ControlButton";const XA=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom}),w2=({style:t,showZoom:e=!0,showFitView:n=!0,showInteractive:o=!0,fitViewOptions:r,onZoomIn:s,onZoomOut:a,onFitView:i,onInteractiveChange:l,className:d,children:u,position:h="bottom-left"})=>{const f=Ft(),[m,x]=T.useState(!1),{isInteractive:g,minZoomReached:p,maxZoomReached:b}=lt(XA,Vt),{zoomIn:y,zoomOut:v,fitView:w}=va();return T.useEffect(()=>{x(!0)},[]),m?q.createElement(Il,{className:Xt(["react-flow__controls",d]),position:h,style:t,"data-testid":"rf__controls"},e&&q.createElement(q.Fragment,null,q.createElement(es,{onClick:()=>{y(),s==null||s()},className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:b},q.createElement(WA,null)),q.createElement(es,{onClick:()=>{v(),a==null||a()},className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:p},q.createElement(qA,null))),n&&q.createElement(es,{className:"react-flow__controls-fitview",onClick:()=>{w(r),i==null||i()},title:"fit view","aria-label":"fit view"},q.createElement(GA,null)),o&&q.createElement(es,{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?q.createElement(KA,null):q.createElement(YA,null)),u):null};w2.displayName="Controls";var Cn,JA=T.memo(w2);function ZA({color:t,dimensions:e,lineWidth:n}){return q.createElement("path",{stroke:t,strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})}function QA({color:t,radius:e}){return q.createElement("circle",{cx:e,cy:e,r:e,fill:t})}(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Cn||(Cn={}));const eT={[Cn.Dots]:"#91919a",[Cn.Lines]:"#eee",[Cn.Cross]:"#e2e2e2"},tT={[Cn.Dots]:1,[Cn.Lines]:1,[Cn.Cross]:6},nT=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function k2({id:t,variant:e=Cn.Dots,gap:n=20,size:o,lineWidth:r=1,offset:s=2,color:a,style:i,className:l}){const d=T.useRef(null),{transform:u,patternId:h}=lt(nT,Vt),f=a||eT[e],m=o||tT[e],x=e===Cn.Dots,g=e===Cn.Cross,p=Array.isArray(n)?n:[n,n],b=[p[0]*u[2]||1,p[1]*u[2]||1],y=m*u[2],v=g?[y,y]:b,w=x?[y/s,y/s]:[v[0]/s,v[1]/s];return q.createElement("svg",{className:Xt(["react-flow__background",l]),style:{...i,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:d,"data-testid":"rf__background"},q.createElement("pattern",{id:h+t,x:u[0]%b[0],y:u[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${w[0]},-${w[1]})`},x?q.createElement(QA,{color:f,radius:y/s}):q.createElement(ZA,{dimensions:v,color:f,lineWidth:r})),q.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${h+t})`}))}k2.displayName="Background";var oT=T.memo(k2);function Gh(t){return Math.min(11*t+35,200)}const j2=q.createContext("LR"),S2=T.memo(t=>{const e=H.c(51),{data:n,selected:o}=t,r=Se(n.atom),s=gr().inOrderIds.indexOf(r.id),a=o?"var(--gray-9)":"var(--gray-3)",i=lt(rT),l=T.use(j2);let d,u,h,f,m;if(e[0]!==r.code||e[1]!==a||e[2]!==l||e[3]!==o){const I=r.code.split(`
|
145
145
|
`).length,D=l==="LR"?Oe.Left:Oe.Top;let F;e[8]!==a?(F={background:a},e[8]=a,e[9]=F):F=e[9],e[10]!==D||e[11]!==F?(h=c.jsx(zo,{type:"target",id:"inputs",position:D,style:F}),e[10]=D,e[11]=F,e[12]=h):h=e[12];const O=l==="LR"?Oe.Left:Oe.Top;let P;e[13]!==a?(P={background:a},e[13]=a,e[14]=P):P=e[14],e[15]!==O||e[16]!==P?(f=c.jsx(zo,{type:"source",id:"inputs",position:O,style:P}),e[15]=O,e[16]=P,e[17]=f):f=e[17];const R=o&&"border-primary";e[18]!==R?(u=xe("flex flex-col bg-card border border-input/50 rounded-md mx-[2px] overflow-hidden",R),e[18]=R,e[19]=u):u=e[19],d=Gh(I),e[0]=r.code,e[1]=a,e[2]=l,e[3]=o,e[4]=d,e[5]=u,e[6]=h,e[7]=f}else d=e[4],u=e[5],h=e[6],f=e[7];var x;let g;e[20]!==n.forceWidth||e[21]!==i?(m=n.forceWidth||(x=i,Math.min(Math.max(x-100,100),400)),e[20]=n.forceWidth,e[21]=i,e[22]=m):m=e[22],e[23]!==d||e[24]!==m?(g={height:d,width:m},e[23]=d,e[24]=m,e[25]=g):g=e[25];const p=mP(r.name,s);let b,y,v;e[26]!==p?(b=c.jsx("div",{className:"text-muted-foreground font-semibold text-xs py-1 px-2 bg-muted border-b",children:p}),e[26]=p,e[27]=b):b=e[27],e[28]!==r.code?(y=c.jsx(VR,{code:r.code}),e[28]=r.code,e[29]=y):y=e[29],e[30]!==u||e[31]!==g||e[32]!==b||e[33]!==y?(v=c.jsxs("div",{className:u,style:g,children:[b,y]}),e[30]=u,e[31]=g,e[32]=b,e[33]=y,e[34]=v):v=e[34];const w=l==="LR"?Oe.Right:Oe.Bottom;let S,j;e[35]!==a?(S={background:a},e[35]=a,e[36]=S):S=e[36],e[37]!==w||e[38]!==S?(j=c.jsx(zo,{type:"source",id:"outputs",position:w,style:S}),e[37]=w,e[38]=S,e[39]=j):j=e[39];const C=l==="LR"?Oe.Right:Oe.Bottom;let _,E,M;return e[40]!==a?(_={background:a},e[40]=a,e[41]=_):_=e[41],e[42]!==C||e[43]!==_?(E=c.jsx(zo,{type:"target",id:"outputs",position:C,style:_}),e[42]=C,e[43]=_,e[44]=E):E=e[44],e[45]!==v||e[46]!==j||e[47]!==E||e[48]!==h||e[49]!==f?(M=c.jsxs("div",{children:[h,f,v,j,E]}),e[45]=v,e[46]=j,e[47]=E,e[48]=h,e[49]=f,e[50]=M):M=e[50],M},(t,e)=>["data","selected","id"].every(n=>t[n]===e[n]));S2.displayName="CustomNode";const C2={custom:S2};function rT(t){const{width:e}=t;return e}const N2=t=>{const e=H.c(18),{maxCount:n,cellIds:o,onClick:r,skipScroll:s}=t,a=gr();let i,l,d,u;if(e[0]!==o||e[1]!==a||e[2]!==n||e[3]!==r||e[4]!==s){d=Symbol.for("react.early_return_sentinel");e:{let h;e[8]!==a?(h=(x,g)=>a.inOrderIds.indexOf(x)-a.inOrderIds.indexOf(g),e[8]=a,e[9]=h):h=e[9];const f=[...o].sort(h);if(o.length===0){let x;e[10]===Symbol.for("react.memo_cache_sentinel")?(x=c.jsx("div",{className:"text-muted-foreground",children:"--"}),e[10]=x):x=e[10],d=x;break e}let m;e[11]!==o.length||e[12]!==r||e[13]!==s?(m=(x,g)=>c.jsxs("span",{className:"truncate",children:[c.jsx(Io,{variant:"focus",cellId:x,skipScroll:s,className:"whitespace-nowrap",onClick:r?()=>r(x):void 0},x),g<o.length-1&&", "]},x),e[11]=o.length,e[12]=r,e[13]=s,e[14]=m):m=e[14],i=f.slice(0,n).map(m),l=o.length>n&&c.jsxs(mr,{children:[c.jsx(xs,{asChild:!0,children:c.jsxs("span",{className:"whitespace-nowrap text-muted-foreground text-xs hover:underline cursor-pointer",children:["+",o.length-n," more"]})}),c.jsx(us,{className:"w-auto",children:c.jsx("div",{className:"flex flex-col gap-1 py-1",children:f.slice(n).map(x=>c.jsx(Io,{variant:"focus",cellId:x,className:"whitespace-nowrap",onClick:r?()=>r(x):void 0},x))})})]})}e[0]=o,e[1]=a,e[2]=n,e[3]=r,e[4]=s,e[5]=i,e[6]=l,e[7]=d}else i=e[5],l=e[6],d=e[7];return d!==Symbol.for("react.early_return_sentinel")?d:(e[15]!==i||e[16]!==l?(u=c.jsxs(c.Fragment,{children:[i,l]}),e[15]=i,e[16]=l,e[17]=u):u=e[17],u)},Yh=t=>{const e=H.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 a=n.length>1?"destructive":"outline";let i,l,d;return e[5]!==o||e[6]!==r?(i=async u=>{r?r(u):(await on(o),Je({title:"Copied to clipboard"}))},e[5]=o,e[6]=r,e[7]=i):i=e[7],e[8]!==o||e[9]!==a||e[10]!==i?(l=c.jsx(G3,{title:o,variant:a,className:"rounded-sm text-ellipsis block overflow-hidden max-w-fit cursor-pointer font-medium",onClick:i,children:o}),e[8]=o,e[9]=a,e[10]=i,e[11]=l):l=e[11],e[12]!==s||e[13]!==l?(d=c.jsx("div",{className:"max-w-[130px]",...s,children:l}),e[12]=s,e[13]=l,e[14]=d):d=e[14],d},Kh=T.memo(t=>{const e=H.c(38),{onChange:n,view:o,settings:r,onSettingsChange:s}=t;let a;e[0]!==s||e[1]!==r?(a=(O,P)=>{s({...r,[O]:P})},e[0]=s,e[1]=r,e[2]=a):a=e[2];const i=a;let l,d,u,h,f,m;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(xs,{asChild:!0,children:c.jsx(ve,{variant:"text",size:"xs",children:c.jsx(om,{className:"w-4 h-4"})})}),e[3]=l):l=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(d=c.jsx("div",{className:"font-semibold pb-4",children:"Settings"}),e[4]=d):d=e[4],e[5]!==i?(u=O=>i("hidePureMarkdown",!!O),e[5]=i,e[6]=u):u=e[6],e[7]!==r.hidePureMarkdown||e[8]!==u?(h=c.jsx(k3,{"data-testid":"hide-pure-markdown-checkbox",id:"hide-pure-markdown",checked:r.hidePureMarkdown,onCheckedChange:u}),e[7]=r.hidePureMarkdown,e[8]=u,e[9]=h):h=e[9],e[10]===Symbol.for("react.memo_cache_sentinel")?(f=c.jsx(hr,{htmlFor:"hide-pure-markdown",children:"Hide pure markdown"}),e[10]=f):f=e[10],e[11]!==h?(m=c.jsxs(mr,{children:[l,c.jsxs(us,{className:"w-auto p-2 text-muted-foreground",children:[d,c.jsxs("div",{className:"flex items-center gap-2",children:[h,f]})]})]}),e[11]=h,e[12]=m):m=e[12];const x=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=c.jsx(kp,{className:"w-4 h-4 mr-1"}),e[15]=b):b=e[15],e[16]!==g||e[17]!==p?(y=c.jsxs(ve,{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 v=o==="TB";let w,S,j;e[19]!==n?(w=()=>n("TB"),e[19]=n,e[20]=w):w=e[20],e[21]===Symbol.for("react.memo_cache_sentinel")?(S=c.jsx(ui,{className:"w-4 h-4 mr-1"}),e[21]=S):S=e[21],e[22]!==v||e[23]!==w?(j=c.jsxs(ve,{variant:"outline",className:"bg-background","aria-selected":v,size:"xs",onClick:w,children:[S,"Vertical Tree"]}),e[22]=v,e[23]=w,e[24]=j):j=e[24];const C=o==="LR";let _,E,M,I;e[25]!==n?(_=()=>n("LR"),e[25]=n,e[26]=_):_=e[26],e[27]===Symbol.for("react.memo_cache_sentinel")?(E=c.jsx(ui,{className:"w-4 h-4 mr-1 transform -rotate-90"}),e[27]=E):E=e[27],e[28]!==C||e[29]!==_?(M=c.jsxs(ve,{variant:"outline",className:"bg-background","aria-selected":C,size:"xs",onClick:_,children:[E," ","Horizontal Tree"]}),e[28]=C,e[29]=_,e[30]=M):M=e[30],e[31]!==y||e[32]!==j||e[33]!==M?(I=c.jsxs("div",{className:"flex gap-2",children:[y,j,M]}),e[31]=y,e[32]=j,e[33]=M,e[34]=I):I=e[34];const D=o!=="_minimap_"&&x;let F;return e[35]!==I||e[36]!==D?(F=c.jsxs(Il,{position:"top-right",className:"flex flex-col items-end gap-2",children:[I,D]}),e[35]=I,e[36]=D,e[37]=F):F=e[37],F});Kh.displayName="GraphToolbar";const Fl=T.memo(t=>{const e=H.c(11),{selection:n,variables:o,onClearSelection:r}=t;if(!n)return null;const s=sT;let a;e[0]!==r||e[1]!==n.id||e[2]!==n.source||e[3]!==n.target||e[4]!==n.type||e[5]!==o?(a=()=>{if(n.type==="node"){const u=Object.values(o).filter(m=>m.usedBy.includes(n.id)),h=Object.values(o).filter(m=>m.declaredBy.includes(n.id)),f=(m,x)=>c.jsxs(c.Fragment,{children:[m.length===0&&c.jsx("div",{className:"text-muted-foreground text-sm text-center",children:"--"}),c.jsx("div",{className:"grid grid-cols-5 gap-3 items-center text-sm py-1 flex-1 empty:hidden",children:m.map(g=>c.jsxs(q.Fragment,{children:[c.jsx(Yh,{declaredBy:g.declaredBy,name:g.name}),c.jsxs("div",{className:"truncate col-span-2",title:g.value??"",children:[g.value,c.jsxs("span",{className:"ml-1 truncate text-foreground/60 font-mono",children:["(",g.dataType,")"]})]}),c.jsx("div",{className:"truncate col-span-2 gap-1 items-center",children:c.jsx(N2,{skipScroll:!0,onClick:()=>s(x==="in"?g.declaredBy[0]:g.usedBy[0],g.name),maxCount:3,cellIds:g.usedBy})})]},g.name))})]});return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"font-bold py-2 flex items-center gap-2 border-b px-3",children:[c.jsx(Vl,{className:"w-5 h-5"}),c.jsx(Io,{cellId:n.id}),c.jsx("div",{className:"flex-1"}),c.jsx(tx,{cellId:n.id,children:c.jsx(ve,{variant:"ghost",size:"icon",children:c.jsx($c,{className:"w-4 h-4"})})}),c.jsx(ve,{variant:"text",size:"icon",onClick:()=>{r()},children:c.jsx(yn,{className:"w-4 h-4"})})]}),c.jsxs("div",{className:"text-sm flex flex-col py-3 pl-2 pr-4 flex-1 justify-center",children:[c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsxs("span",{className:"flex items-center gap-2 font-semibold",children:[c.jsx(Wm,{className:"w-4 h-4"}),"Outputs"]}),f(h,"out")]}),c.jsx("hr",{className:"border-divider my-3"}),c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsxs("span",{className:"flex items-center gap-2 font-semibold",children:[c.jsx(Qt,{className:"w-4 h-4"}),"Inputs"]}),f(u,"in")]})]})]})}if(n.type==="edge"){const u=Object.values(o).filter(h=>h.declaredBy.includes(n.source)&&h.usedBy.includes(n.target));return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"font-bold py-2 flex items-center gap-2 border-b px-3",children:[c.jsx(fi,{className:"w-4 h-4"}),c.jsx(Io,{cellId:n.source}),c.jsx(Lc,{className:"w-4 h-4"}),c.jsx(Io,{cellId:n.target})]}),c.jsx("div",{className:"grid grid-cols-4 gap-3 max-w-[350px] items-center text-sm p-3 flex-1",children:u.map(h=>c.jsxs(q.Fragment,{children:[c.jsx(Yh,{declaredBy:h.declaredBy,name:h.name,onClick:()=>{s(h.declaredBy[0],h.name)}}),c.jsx("div",{className:"truncate text-foreground/60 font-mono",children:h.dataType}),c.jsx("div",{className:"truncate col-span-2",title:h.value??"",children:h.value})]},h.name))})]})}},e[0]=r,e[1]=n.id,e[2]=n.source,e[3]=n.target,e[4]=n.type,e[5]=o,e[6]=a):a=e[6];const i=a;let l,d;return e[7]!==i?(l=i(),e[7]=i,e[8]=l):l=e[8],e[9]!==l?(d=c.jsx(Il,{position:"bottom-left",className:"max-h-[90%] flex flex-col w-[calc(100%-5rem)]",children:c.jsx("div",{className:"min-h-[100px] shadow-md rounded-md border max-w-[550px] border-primary/40 my-4 min-w-[240px] bg-(--slate-1) text-muted-foreground/80 flex flex-col overflow-y-auto",children:l})}),e[9]=l,e[10]=d):d=e[10],d});function sT(t,e){const n=Ia(t);n&&Tm(n,e)}function E2(){const t=H.c(7),e=va(),n=lt(iT),o=lt(aT);let r;t[0]!==e?(r=()=>{e.fitView({duration:100})},t[0]=e,t[1]=r):r=t[1];const s=pP(r,100);let a,i;t[2]!==s||t[3]!==o||t[4]!==n?(a=()=>{n&&o&&s()},i=[n,o,s],t[2]=s,t[3]=o,t[4]=n,t[5]=a,t[6]=i):(a=t[5],i=t[6]),T.useEffect(a,i)}function aT(t){const{height:e}=t;return e}function iT(t){const{width:e}=t;return e}Fl.displayName="GraphSelectionPanel";const _2=new class{createEdge(t,e,n){return{type:"smoothstep",pathOptions:{offset:20,borderRadius:100},data:{direction:n},markerEnd:{type:qr.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:Gh(Qe.get(e).code.trim().split(`
|
146
146
|
`).length),position:{x:0,y:n+20}}}createElements(t,e,n,o){let r=0;const s=[],a=[];for(const[l,d]of Im.zip(t,e)){const u=this.createNode(l,d,r);s.push(u),r=u.position.y+(u.height||0)}const i=new Set;for(const l of Object.values(n)){const{declaredBy:d,usedBy:u}=l;for(const h of d)for(const f of u){const m=`${h}-${f}`;i.has(m)||(i.add(m),a.push(this.createEdge(h,f,"inputs"),this.createEdge(h,f,"outputs")))}}return{nodes:s,edges:a}}},lT=t=>{const e=H.c(37),{cellIds:n,variables:o,cellAtoms:r,children:s}=t;let a;e[0]!==r||e[1]!==n||e[2]!==o?(a=_2.createElements(n,r,o,!1),e[0]=r,e[1]=n,e[2]=o,e[3]=a):a=e[3];const{nodes:i,edges:l}=a;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=[],e[4]=d):d=e[4];const[u,h]=v2(d),[f,m]=y2(i),[x,g]=T.useState(),[p,b]=T.useState(),y=T.useRef(!1);E2();const v=lt(cT);let w;e[5]!==h||e[6]!==m?(w=k=>{m(k.nodes),h([])},e[5]=h,e[6]=m,e[7]=w):w=e[7];const S=Le(w);let j,C,_,E;e[8]!==r||e[9]!==n||e[10]!==S||e[11]!==o?(j=()=>{y.current?S(_2.createElements(n,r,o,!1)):y.current=!0},C=[n,o,r,S],e[8]=r,e[9]=n,e[10]=S,e[11]=o,e[12]=j,e[13]=C):(j=e[12],C=e[13]),T.useEffect(j,C),e[14]!==l||e[15]!==x||e[16]!==h?(_=()=>{if(x){const k=l.filter(B=>{const{source:A,target:U,data:$}=B;return A===x&&$.direction==="outputs"||U===x&&$.direction==="inputs"});h(k)}},E=[x,h,l],e[14]=l,e[15]=x,e[16]=h,e[17]=_,e[18]=E):(_=e[17],E=e[18]),T.useEffect(_,E);const M=function(k,B){const A=H.c(17);let U,$;if(A[0]!==B||A[1]!==k){let Q;A[3]!==B?(Q=(te,re)=>{const{position:ne}=re;return Math.min(te,ne.y-B/2-10)},A[3]=B,A[4]=Q):Q=A[4],$=k.reduce(Q,Number.POSITIVE_INFINITY),A[0]=B,A[1]=k,A[2]=$}else $=A[2];const X=$;let Y;if(A[5]!==B||A[6]!==k){let Q;A[8]!==B?(Q=(te,re)=>{const{position:ne}=re;return Math.max(te,ne.y+B/2+10)},A[8]=B,A[9]=Q):Q=A[9],Y=k.reduce(Q,Number.NEGATIVE_INFINITY),A[5]=B,A[6]=k,A[7]=Y}else Y=A[7];const G=Y;let W,J,V;return A[10]!==X?(W=[Number.NEGATIVE_INFINITY,X],A[10]=X,A[11]=W):W=A[11],A[12]!==G?(J=[Number.POSITIVE_INFINITY,G],A[12]=G,A[13]=J):J=A[13],A[14]!==W||A[15]!==J?(V=[W,J],A[14]=W,A[15]=J,A[16]=V):V=A[16],U=V,U}(f,v);let I;e[19]===Symbol.for("react.memo_cache_sentinel")?(I=()=>{g(void 0),b(void 0)},e[19]=I):I=e[19];const D=I;let F;e[20]!==u||e[21]!==p||e[22]!==x||e[23]!==o?(F=()=>p?c.jsx(Fl,{selection:{type:"edge",source:p.source,target:p.target},onClearSelection:D,variables:o,edges:u}):x?c.jsx(Fl,{selection:{type:"node",id:x},variables:o,edges:u,onClearSelection:D}):null,e[20]=u,e[21]=p,e[22]=x,e[23]=o,e[24]=F):F=e[24];const O=F;let P,R,z,N;return e[25]!==h?(P=(k,B)=>{const A=B.id;g(A),b(void 0),h([])},e[25]=h,e[26]=P):P=e[26],e[27]===Symbol.for("react.memo_cache_sentinel")?(R=(k,B)=>{b(B)},e[27]=R):R=e[27],e[28]!==O?(z=O(),e[28]=O,e[29]=z):z=e[29],e[30]!==s||e[31]!==u||e[32]!==f||e[33]!==P||e[34]!==z||e[35]!==M?(N=c.jsxs(qh,{nodes:f,edges:u,nodeTypes:C2,translateExtent:M,onNodeClick:P,onNodeDoubleClick:dT,onEdgeClick:R,snapToGrid:!0,fitView:!0,elementsSelectable:!0,minZoom:1,maxZoom:1,draggable:!1,panOnScrollMode:Lo.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:[z,s]}),e[30]=s,e[31]=u,e[32]=f,e[33]=P,e[34]=z,e[35]=M,e[36]=N):N=e[36],N};function cT(t){const{height:e}=t;return e}function dT(t,e){Y3(e.id,"focus")}var Xh,I2,A2,T2,M2,O2,Jh,D2,Zh,P2,Qh,R2,ef,L2,tf,F2,nf,z2,of,B2,rf,U2,sf,$2,af,V2,lf,H2,cf,W2,df,q2,uf,G2,Y2,K2,X2,J2,Z2,Q2,hf,ew,ff,tw,mf,nw,pf,ow,gf,rw,xf,sw,bf,aw,yf,iw,vf,lw,wf,cw,kf,dw,jf,uw,Sf,hw,Cf,fw,mw,pw,gw,xw,bw,yw,Nf,vw,Ef,ww,kw,jw,_f,Sw,If,Cw,Af,Nw,Tf,Ew,Mf,_w,Iw,Aw,Tw,Mw;function Of(){if(I2)return Xh;I2=1;var t="\0";function e(s,a){s[a]?s[a]++:s[a]=1}function n(s,a){--s[a]||delete s[a]}function o(s,a,i,l){var d=""+a,u=""+i;if(!s&&d>u){var h=d;d=u,u=h}return d+""+u+""+(l===void 0?"\0":l)}function r(s,a){return o(s,a.v,a.w,a.name)}return Xh=class{constructor(s){Z(this,"_isDirected",!0);Z(this,"_isMultigraph",!1);Z(this,"_isCompound",!1);Z(this,"_label");Z(this,"_defaultNodeLabelFn",()=>{});Z(this,"_defaultEdgeLabelFn",()=>{});Z(this,"_nodes",{});Z(this,"_in",{});Z(this,"_preds",{});Z(this,"_out",{});Z(this,"_sucs",{});Z(this,"_edgeObjs",{});Z(this,"_edgeLabels",{});Z(this,"_nodeCount",0);Z(this,"_edgeCount",0);Z(this,"_parent");Z(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(a=>Object.keys(s._in[a]).length===0)}sinks(){var s=this;return this.nodes().filter(a=>Object.keys(s._out[a]).length===0)}setNodes(s,a){var i=arguments,l=this;return s.forEach(function(d){i.length>1?l.setNode(d,a):l.setNode(d)}),this}setNode(s,a){return Object.hasOwn(this._nodes,s)?(arguments.length>1&&(this._nodes[s]=a),this):(this._nodes[s]=arguments.length>1?a: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 a=this;if(Object.hasOwn(this._nodes,s)){var i=l=>a.removeEdge(a._edgeObjs[l]);delete this._nodes[s],this._isCompound&&(this._removeFromParentsChildList(s),delete this._parent[s],this.children(s).forEach(function(l){a.setParent(l)}),delete this._children[s]),Object.keys(this._in[s]).forEach(i),delete this._in[s],delete this._preds[s],Object.keys(this._out[s]).forEach(i),delete this._out[s],delete this._sucs[s],--this._nodeCount}return this}setParent(s,a){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(a===void 0)a=t;else{for(var i=a+="";i!==void 0;i=this.parent(i))if(i===s)throw new Error("Setting "+a+" as parent of "+s+" would create a cycle");this.setNode(a)}return this.setNode(s),this._removeFromParentsChildList(s),this._parent[s]=a,this._children[a][s]=!0,this}_removeFromParentsChildList(s){delete this._children[this._parent[s]][s]}parent(s){if(this._isCompound){var a=this._parent[s];if(a!==t)return a}}children(s=t){if(this._isCompound){var a=this._children[s];if(a)return Object.keys(a)}else{if(s===t)return this.nodes();if(this.hasNode(s))return[]}}predecessors(s){var a=this._preds[s];if(a)return Object.keys(a)}successors(s){var a=this._sucs[s];if(a)return Object.keys(a)}neighbors(s){var a=this.predecessors(s);if(a){const l=new Set(a);for(var i of this.successors(s))l.add(i);return Array.from(l.values())}}isLeaf(s){return(this.isDirected()?this.successors(s):this.neighbors(s)).length===0}filterNodes(s){var a=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});a.setGraph(this.graph());var i=this;Object.entries(this._nodes).forEach(function([u,h]){s(u)&&a.setNode(u,h)}),Object.values(this._edgeObjs).forEach(function(u){a.hasNode(u.v)&&a.hasNode(u.w)&&a.setEdge(u,i.edge(u))});var l={};function d(u){var h=i.parent(u);return h===void 0||a.hasNode(h)?(l[u]=h,h):h in l?l[h]:d(h)}return this._isCompound&&a.nodes().forEach(u=>a.setParent(u,d(u))),a}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,a){var i=this,l=arguments;return s.reduce(function(d,u){return l.length>1?i.setEdge(d,u,a):i.setEdge(d,u),u}),this}setEdge(){var s,a,i,l,d=!1,u=arguments[0];typeof u=="object"&&u!==null&&"v"in u?(s=u.v,a=u.w,i=u.name,arguments.length===2&&(l=arguments[1],d=!0)):(s=u,a=arguments[1],i=arguments[3],arguments.length>2&&(l=arguments[2],d=!0)),s=""+s,a=""+a,i!==void 0&&(i=""+i);var h=o(this._isDirected,s,a,i);if(Object.hasOwn(this._edgeLabels,h))return d&&(this._edgeLabels[h]=l),this;if(i!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(s),this.setNode(a),this._edgeLabels[h]=d?l:this._defaultEdgeLabelFn(s,a,i);var f=function(m,x,g,p){var b=""+x,y=""+g;if(!m&&b>y){var v=b;b=y,y=v}var w={v:b,w:y};return p&&(w.name=p),w}(this._isDirected,s,a,i);return s=f.v,a=f.w,Object.freeze(f),this._edgeObjs[h]=f,e(this._preds[a],s),e(this._sucs[s],a),this._in[a][h]=f,this._out[s][h]=f,this._edgeCount++,this}edge(s,a,i){var l=arguments.length===1?r(this._isDirected,arguments[0]):o(this._isDirected,s,a,i);return this._edgeLabels[l]}edgeAsObj(){const s=this.edge(...arguments);return typeof s!="object"?{label:s}:s}hasEdge(s,a,i){var l=arguments.length===1?r(this._isDirected,arguments[0]):o(this._isDirected,s,a,i);return Object.hasOwn(this._edgeLabels,l)}removeEdge(s,a,i){var l=arguments.length===1?r(this._isDirected,arguments[0]):o(this._isDirected,s,a,i),d=this._edgeObjs[l];return d&&(s=d.v,a=d.w,delete this._edgeLabels[l],delete this._edgeObjs[l],n(this._preds[a],s),n(this._sucs[s],a),delete this._in[a][l],delete this._out[s][l],this._edgeCount--),this}inEdges(s,a){var i=this._in[s];if(i){var l=Object.values(i);return a?l.filter(d=>d.v===a):l}}outEdges(s,a){var i=this._out[s];if(i){var l=Object.values(i);return a?l.filter(d=>d.w===a):l}}nodeEdges(s,a){var i=this.inEdges(s,a);if(i)return i.concat(this.outEdges(s,a))}},Xh}function uT(){return O2?M2:(O2=1,M2={Graph:Of(),version:T2?A2:(T2=1,A2="2.2.4")})}function hT(){if(D2)return Jh;D2=1;var t=Of();function e(o){return o.nodes().map(function(r){var s=o.node(r),a=o.parent(r),i={v:r};return s!==void 0&&(i.value=s),a!==void 0&&(i.parent=a),i})}function n(o){return o.edges().map(function(r){var s=o.edge(r),a={v:r.v,w:r.w};return r.name!==void 0&&(a.name=r.name),s!==void 0&&(a.value=s),a})}return Jh={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}},Jh}function fT(){return P2||(P2=1,Zh=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}),Zh}function Ow(){return R2?Qh:(R2=1,Qh=class{constructor(){Z(this,"_arr",[]);Z(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}},Qh)}function Dw(){if(L2)return ef;L2=1;var t=Ow();ef=function(n,o,r,s){return function(a,i,l,d){var u,h,f={},m=new t,x=function(g){var p=g.v!==u?g.v:g.w,b=f[p],y=l(g),v=h.distance+y;if(y<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+g+" Weight: "+y);v<b.distance&&(b.distance=v,b.predecessor=u,m.decrease(p,v))};for(a.nodes().forEach(function(g){var p=g===i?0:Number.POSITIVE_INFINITY;f[g]={distance:p},m.add(g,p)});m.size()>0&&(u=m.removeMin(),(h=f[u]).distance!==Number.POSITIVE_INFINITY);)d(u).forEach(x);return f}(n,String(o),r||e,s||function(a){return n.outEdges(a)})};var e=()=>1;return ef}function mT(){if(F2)return tf;F2=1;var t=Dw();return tf=function(e,n,o){return e.nodes().reduce(function(r,s){return r[s]=t(e,s,n,o),r},{})},tf}function Pw(){return z2||(z2=1,nf=function(t){var e=0,n=[],o={},r=[];function s(a){var i=o[a]={onStack:!0,lowlink:e,index:e++};if(n.push(a),t.successors(a).forEach(function(u){Object.hasOwn(o,u)?o[u].onStack&&(i.lowlink=Math.min(i.lowlink,o[u].index)):(s(u),i.lowlink=Math.min(i.lowlink,o[u].lowlink))}),i.lowlink===i.index){var l,d=[];do l=n.pop(),o[l].onStack=!1,d.push(l);while(a!==l);r.push(d)}}return t.nodes().forEach(function(a){Object.hasOwn(o,a)||s(a)}),r}),nf}function pT(){if(B2)return of;B2=1;var t=Pw();return of=function(e){return t(e).filter(function(n){return n.length>1||n.length===1&&e.hasEdge(n[0],n[0])})},of}function gT(){if(U2)return rf;U2=1,rf=function(e,n,o){return function(r,s,a){var i={},l=r.nodes();return l.forEach(function(d){i[d]={},i[d][d]={distance:0},l.forEach(function(u){d!==u&&(i[d][u]={distance:Number.POSITIVE_INFINITY})}),a(d).forEach(function(u){var h=u.v===d?u.w:u.v,f=s(u);i[d][h]={distance:f,predecessor:d}})}),l.forEach(function(d){var u=i[d];l.forEach(function(h){var f=i[h];l.forEach(function(m){var x=f[d],g=u[m],p=f[m],b=x.distance+g.distance;b<p.distance&&(p.distance=b,p.predecessor=g.predecessor)})})}),i}(e,n||t,o||function(r){return e.outEdges(r)})};var t=()=>1;return rf}function Rw(){if($2)return sf;function t(n){var o={},r={},s=[];if(n.sinks().forEach(function a(i){if(Object.hasOwn(r,i))throw new e;Object.hasOwn(o,i)||(r[i]=!0,o[i]=!0,n.predecessors(i).forEach(a),delete r[i],s.push(i))}),Object.keys(o).length!==n.nodeCount())throw new e;return s}$2=1;class e extends Error{constructor(){super(...arguments)}}return sf=t,t.CycleException=e,sf}function xT(){if(V2)return af;V2=1;var t=Rw();return af=function(e){try{t(e)}catch(n){if(n instanceof t.CycleException)return!1;throw n}return!0},af}function Lw(){if(H2)return lf;function t(o,r,s,a){for(var i=[[o,!1]];i.length>0;){var l=i.pop();l[1]?a.push(l[0]):Object.hasOwn(s,l[0])||(s[l[0]]=!0,i.push([l[0],!0]),n(r(l[0]),d=>i.push([d,!1])))}}function e(o,r,s,a){for(var i=[o];i.length>0;){var l=i.pop();Object.hasOwn(s,l)||(s[l]=!0,a.push(l),n(r(l),d=>i.push(d)))}}function n(o,r){for(var s=o.length;s--;)r(o[s],s,o);return o}return H2=1,lf=function(o,r,s){Array.isArray(r)||(r=[r]);var a=o.isDirected()?u=>o.successors(u):u=>o.neighbors(u),i=s==="post"?t:e,l=[],d={};return r.forEach(u=>{if(!o.hasNode(u))throw new Error("Graph does not have node: "+u);i(u,a,d,l)}),l},lf}function bT(){if(W2)return cf;W2=1;var t=Lw();return cf=function(e,n){return t(e,n,"post")},cf}function yT(){if(q2)return df;q2=1;var t=Lw();return df=function(e,n){return t(e,n,"pre")},df}function vT(){if(G2)return uf;G2=1;var t=Of(),e=Ow();return uf=function(n,o){var r,s=new t,a={},i=new e;function l(u){var h=u.v===r?u.w:u.v,f=i.priority(h);if(f!==void 0){var m=o(u);m<f&&(a[h]=r,i.decrease(h,m))}}if(n.nodeCount()===0)return s;n.nodes().forEach(function(u){i.add(u,Number.POSITIVE_INFINITY),s.setNode(u)}),i.decrease(n.nodes()[0],0);for(var d=!1;i.size()>0;){if(r=i.removeMin(),Object.hasOwn(a,r))s.setEdge(r,a[r]);else{if(d)throw new Error("Input graph is not connected: "+n);d=!0}n.nodeEdges(r).forEach(l)}return s},uf}function On(){if(J2)return X2;J2=1;var t=uT();return X2={Graph:t.Graph,json:hT(),alg:K2?Y2:(K2=1,Y2={components:fT(),dijkstra:Dw(),dijkstraAll:mT(),findCycles:pT(),floydWarshall:gT(),isAcyclic:xT(),postorder:bT(),preorder:yT(),prim:vT(),tarjan:Pw(),topsort:Rw()}),version:t.version}}function wT(){if(ew)return hf;ew=1;let t=On().Graph,e=function(){if(Q2)return Z2;function s(i){i._prev._next=i._next,i._next._prev=i._prev,delete i._next,delete i._prev}function a(i,l){if(i!=="_next"&&i!=="_prev")return l}return Q2=1,Z2=class{constructor(){let i={};i._next=i._prev=i,this._sentinel=i}dequeue(){let i=this._sentinel,l=i._prev;if(l!==i)return s(l),l}enqueue(i){let l=this._sentinel;i._prev&&i._next&&s(i),i._next=l._next,l._next._prev=i,l._next=i,i._prev=l}toString(){let i=[],l=this._sentinel,d=l._prev;for(;d!==l;)i.push(JSON.stringify(d,a)),d=d._prev;return"["+i.join(", ")+"]"}}}();hf=function(s,a){if(s.nodeCount()<=1)return[];let i=function(l,d){let u=new t,h=0,f=0;l.nodes().forEach(g=>{u.setNode(g,{v:g,in:0,out:0})}),l.edges().forEach(g=>{let p=u.edge(g.v,g.w)||0,b=d(g),y=p+b;u.setEdge(g.v,g.w,y),f=Math.max(f,u.node(g.v).out+=b),h=Math.max(h,u.node(g.w).in+=b)});let m=function(g){const p=[];for(let b=0;b<g;b++)p.push(b);return p}(f+h+3).map(()=>new e),x=h+1;return u.nodes().forEach(g=>{r(m,x,u.node(g))}),{graph:u,buckets:m,zeroIdx:x}}(s,a||n);return function(l,d,u){let h,f=[],m=d[d.length-1],x=d[0];for(;l.nodeCount();){for(;h=x.dequeue();)o(l,d,u,h);for(;h=m.dequeue();)o(l,d,u,h);if(l.nodeCount()){for(let g=d.length-2;g>0;--g)if(h=d[g].dequeue(),h){f=f.concat(o(l,d,u,h,!0));break}}}return f}(i.graph,i.buckets,i.zeroIdx).flatMap(l=>s.outEdges(l.v,l.w))};let n=()=>1;function o(s,a,i,l,d){let u=d?[]:void 0;return s.inEdges(l.v).forEach(h=>{let f=s.edge(h),m=s.node(h.v);d&&u.push({v:h.v,w:h.w}),m.out-=f,r(a,i,m)}),s.outEdges(l.v).forEach(h=>{let f=s.edge(h),m=h.w,x=s.node(m);x.in-=f,r(a,i,x)}),s.removeNode(l.v),u}function r(s,a,i){i.out?i.in?s[i.out-i.in+a].enqueue(i):s[s.length-1].enqueue(i):s[0].enqueue(i)}return hf}function _t(){if(tw)return ff;tw=1;let t=On().Graph;function e(d,u,h,f){for(var m=f;d.hasNode(m);)m=a(f);return h.dummy=u,d.setNode(m,h),m}ff={addBorderNode:function(d,u,h,f){let m={width:0,height:0};return arguments.length>=4&&(m.rank=h,m.order=f),e(d,"border",m,u)},addDummyNode:e,applyWithChunking:o,asNonCompoundGraph:function(d){let u=new t({multigraph:d.isMultigraph()}).setGraph(d.graph());return d.nodes().forEach(h=>{d.children(h).length||u.setNode(h,d.node(h))}),d.edges().forEach(h=>{u.setEdge(h,d.edge(h))}),u},buildLayerMatrix:function(d){let u=i(r(d)+1).map(()=>[]);return d.nodes().forEach(h=>{let f=d.node(h),m=f.rank;m!==void 0&&(u[m][f.order]=h)}),u},intersectRect:function(d,u){let h,f,m=d.x,x=d.y,g=u.x-m,p=u.y-x,b=d.width/2,y=d.height/2;if(!g&&!p)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(p)*b>Math.abs(g)*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:x+f}},mapValues:function(d,u){let h=u;return typeof u=="string"&&(h=f=>f[u]),Object.entries(d).reduce((f,[m,x])=>(f[m]=h(x,m),f),{})},maxRank:r,normalizeRanks:function(d){let u=d.nodes().map(f=>{let m=d.node(f).rank;return m===void 0?Number.MAX_VALUE:m}),h=o(Math.min,u);d.nodes().forEach(f=>{let m=d.node(f);Object.hasOwn(m,"rank")&&(m.rank-=h)})},notime:function(d,u){return u()},partition:function(d,u){let h={lhs:[],rhs:[]};return d.forEach(f=>{u(f)?h.lhs.push(f):h.rhs.push(f)}),h},pick:function(d,u){const h={};for(const f of u)d[f]!==void 0&&(h[f]=d[f]);return h},predecessorWeights:function(d){let u=d.nodes().map(h=>{let f={};return d.inEdges(h).forEach(m=>{f[m.v]=(f[m.v]||0)+d.edge(m).weight}),f});return l(d.nodes(),u)},range:i,removeEmptyRanks:function(d){let u=d.nodes().map(g=>d.node(g).rank),h=o(Math.min,u),f=[];d.nodes().forEach(g=>{let p=d.node(g).rank-h;f[p]||(f[p]=[]),f[p].push(g)});let m=0,x=d.graph().nodeRankFactor;Array.from(f).forEach((g,p)=>{g===void 0&&p%x!==0?--m:g!==void 0&&m&&g.forEach(b=>d.node(b).rank+=m)})},simplify:function(d){let u=new t().setGraph(d.graph());return d.nodes().forEach(h=>u.setNode(h,d.node(h))),d.edges().forEach(h=>{let f=u.edge(h.v,h.w)||{weight:0,minlen:1},m=d.edge(h);u.setEdge(h.v,h.w,{weight:f.weight+m.weight,minlen:Math.max(f.minlen,m.minlen)})}),u},successorWeights:function(d){let u=d.nodes().map(h=>{let f={};return d.outEdges(h).forEach(m=>{f[m.w]=(f[m.w]||0)+d.edge(m).weight}),f});return l(d.nodes(),u)},time:function(d,u){let h=Date.now();try{return u()}finally{console.log(d+" time: "+(Date.now()-h)+"ms")}},uniqueId:a,zipObject:l};const n=65535;function o(d,u){if(u.length>n){const h=function(f,m=n){const x=[];for(let g=0;g<f.length;g+=m){const p=f.slice(g,g+m);x.push(p)}return x}(u);return d.apply(null,h.map(f=>d.apply(null,f)))}return d.apply(null,u)}function r(d){const u=d.nodes().map(h=>{let f=d.node(h).rank;return f===void 0?Number.MIN_VALUE:f});return o(Math.max,u)}let s=0;function a(d){return d+""+ ++s}function i(d,u,h=1){u==null&&(u=d,d=0);let f=x=>x<u;h<0&&(f=x=>u<x);const m=[];for(let x=d;f(x);x+=h)m.push(x);return m}function l(d,u){return d.reduce((h,f,m)=>(h[f]=u[m],h),{})}return ff}function kT(){if(nw)return mf;nw=1;let t=wT(),e=_t().uniqueId;return mf={run:function(n){(n.graph().acyclicer==="greedy"?t(n,function(r){return s=>r.edge(s).weight}(n)):function(r){let s=[],a={},i={};function l(d){Object.hasOwn(i,d)||(i[d]=!0,a[d]=!0,r.outEdges(d).forEach(u=>{Object.hasOwn(a,u.w)?s.push(u):l(u.w)}),delete a[d])}return r.nodes().forEach(l),s}(n)).forEach(r=>{let s=n.edge(r);n.removeEdge(r),s.forwardName=r.name,s.reversed=!0,n.setEdge(r.w,r.v,s,e("rev"))})},undo:function(n){n.edges().forEach(o=>{let r=n.edge(o);if(r.reversed){n.removeEdge(o);let s=r.forwardName;delete r.reversed,delete r.forwardName,n.setEdge(o.w,o.v,r,s)}})}},mf}function jT(){if(ow)return pf;ow=1;let t=_t();return pf={run:function(e){e.graph().dummyChains=[],e.edges().forEach(n=>function(o,r){let s,a,i,l=r.v,d=o.node(l).rank,u=r.w,h=o.node(u).rank,f=r.name,m=o.edge(r),x=m.labelRank;if(h!==d+1){for(o.removeEdge(r),i=0,++d;d<h;++i,++d)m.points=[],a={width:0,height:0,edgeLabel:m,edgeObj:r,rank:d},s=t.addDummyNode(o,"edge",a,"_d"),d===x&&(a.width=m.width,a.height=m.height,a.dummy="edge-label",a.labelpos=m.labelpos),o.setEdge(l,s,{weight:m.weight},f),i===0&&o.graph().dummyChains.push(s),l=s;o.setEdge(l,u,{weight:m.weight},f)}}(e,n))},undo:function(e){e.graph().dummyChains.forEach(n=>{let o,r=e.node(n),s=r.edgeLabel;for(e.setEdge(r.edgeObj,s);r.dummy;)o=e.successors(n)[0],e.removeNode(n),s.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(s.x=r.x,s.y=r.y,s.width=r.width,s.height=r.height),n=o,r=e.node(n)})}},pf}function zl(){if(rw)return gf;rw=1;const{applyWithChunking:t}=_t();return gf={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 a=e.outEdges(r).map(l=>l==null?Number.POSITIVE_INFINITY:o(l.w)-e.edge(l).minlen);var i=t(Math.min,a);return i===Number.POSITIVE_INFINITY&&(i=0),s.rank=i})},slack:function(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}},gf}function Fw(){if(sw)return xf;sw=1;var t=On().Graph,e=zl().slack;function n(s,a){return s.nodes().forEach(function i(l){a.nodeEdges(l).forEach(d=>{var u=d.v,h=l===u?d.w:u;s.hasNode(h)||e(a,d)||(s.setNode(h,{}),s.setEdge(l,h,{}),i(h))})}),s.nodeCount()}function o(s,a){return a.edges().reduce((i,l)=>{let d=Number.POSITIVE_INFINITY;return s.hasNode(l.v)!==s.hasNode(l.w)&&(d=e(a,l)),d<i[0]?[d,l]:i},[Number.POSITIVE_INFINITY,null])[1]}function r(s,a,i){s.nodes().forEach(l=>a.node(l).rank+=i)}return xf=function(s){var a,i,l=new t({directed:!1}),d=s.nodes()[0],u=s.nodeCount();for(l.setNode(d,{});n(l,s)<u;)a=o(l,s),i=l.hasNode(a.v)?e(s,a):-e(s,a),r(l,s,i);return l},xf}function ST(){if(aw)return bf;aw=1;var t=Fw(),e=zl().slack,n=zl().longestPath,o=On().alg.preorder,r=On().alg.postorder,s=_t().simplify;function a(g){g=s(g),n(g);var p,b=t(g);for(d(b),i(b,g);p=h(b);)m(b,g,p,f(b,g,p))}function i(g,p){var b=r(g,g.nodes());(b=b.slice(0,b.length-1)).forEach(y=>function(v,w,S){var j=v.node(S),C=j.parent;v.edge(S,C).cutvalue=l(v,w,S)}(g,p,y))}function l(g,p,b){var y=g.node(b).parent,v=!0,w=p.edge(b,y),S=0;return w||(v=!1,w=p.edge(y,b)),S=w.weight,p.nodeEdges(b).forEach(j=>{var C,_,E=j.v===b,M=E?j.w:j.v;if(M!==y){var I=E===v,D=p.edge(j).weight;if(S+=I?D:-D,C=b,_=M,g.hasEdge(C,_)){var F=g.edge(b,M).cutvalue;S+=I?-F:F}}}),S}function d(g,p){arguments.length<2&&(p=g.nodes()[0]),u(g,{},1,p)}function u(g,p,b,y,v){var w=b,S=g.node(y);return p[y]=!0,g.neighbors(y).forEach(j=>{Object.hasOwn(p,j)||(b=u(g,p,b,j,y))}),S.low=w,S.lim=b++,v?S.parent=v: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,v=b.w;p.hasEdge(y,v)||(y=b.w,v=b.v);var w=g.node(y),S=g.node(v),j=w,C=!1;w.lim>S.lim&&(j=S,C=!0);var _=p.edges().filter(E=>C===x(g,g.node(E.v),j)&&C!==x(g,g.node(E.w),j));return _.reduce((E,M)=>e(p,M)<e(p,E)?M:E)}function m(g,p,b,y){var v=b.v,w=b.w;g.removeEdge(v,w),g.setEdge(y.v,y.w,{}),d(g),i(g,p),function(S,j){var C=S.nodes().find(E=>!j.node(E).parent),_=o(S,C);(_=_.slice(1)).forEach(E=>{var M=S.node(E).parent,I=j.edge(E,M),D=!1;I||(I=j.edge(M,E),D=!0),j.node(E).rank=j.node(M).rank+(D?I.minlen:-I.minlen)})}(g,p)}function x(g,p,b){return b.low<=p.lim&&p.lim<=b.lim}return bf=a,a.initLowLimValues=d,a.initCutValues=i,a.calcCutValue=l,a.leaveEdge=h,a.enterEdge=f,a.exchangeEdges=m,bf}function CT(){if(iw)return yf;iw=1;var t=zl().longestPath,e=Fw(),n=ST();yf=function(s){var a=s.graph().ranker;if(a instanceof Function)return a(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);case"none":}};var o=t;function r(s){n(s)}return yf}function NT(){return lw||(lw=1,vf=function(t){let e=function(n){let o={},r=0;function s(a){let i=r;n.children(a).forEach(s),o[a]={low:i,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,x){let g,p,b=[],y=[],v=Math.min(f[m].low,f[x].low),w=Math.max(f[m].lim,f[x].lim);g=m;do g=h.parent(g),b.push(g);while(g&&(f[g].low>v||w>f[g].lim));for(p=g,g=x;(g=h.parent(g))!==p;)y.push(g);return{path:b.concat(y.reverse()),lca:p}}(t,e,r.v,r.w),a=s.path,i=s.lca,l=0,d=a[l],u=!0;for(;n!==r.w;){if(o=t.node(n),u){for(;(d=a[l])!==i&&t.node(d).maxRank<o.rank;)l++;d===i&&(u=!1)}if(!u){for(;l<a.length-1&&t.node(d=a[l+1]).minRank<=o.rank;)l++;d=a[l]}t.setParent(n,d),n=t.successors(n)[0]}})}),vf}function ET(){if(cw)return wf;cw=1;let t=_t();function e(n,o,r,s,a,i,l){let d=n.children(l);if(!d.length)return void(l!==o&&n.setEdge(o,l,{weight:0,minlen:r}));let u=t.addBorderNode(n,"_bt"),h=t.addBorderNode(n,"_bb"),f=n.node(l);n.setParent(u,l),f.borderTop=u,n.setParent(h,l),f.borderBottom=h,d.forEach(m=>{e(n,o,r,s,a,i,m);let x=n.node(m),g=x.borderTop?x.borderTop:m,p=x.borderBottom?x.borderBottom:m,b=x.borderTop?s:2*s,y=g!==p?1:a-i[l]+1;n.setEdge(u,g,{weight:b,minlen:y,nestingEdge:!0}),n.setEdge(p,h,{weight:b,minlen:y,nestingEdge:!0})}),n.parent(l)||n.setEdge(o,u,{weight:0,minlen:a+i[l]})}return wf={run:function(n){let o=t.addDummyNode(n,"root",{},"_root"),r=function(d){var u={};function h(f,m){var x=d.children(f);x&&x.length&&x.forEach(g=>h(g,m+1)),u[f]=m}return d.children().forEach(f=>h(f,1)),u}(n),s=Object.values(r),a=t.applyWithChunking(Math.max,s)-1,i=2*a+1;n.graph().nestingRoot=o,n.edges().forEach(d=>n.edge(d).minlen*=i);let l=function(d){return d.edges().reduce((u,h)=>u+d.edge(h).weight,0)}(n)+1;n.children().forEach(d=>e(n,o,i,l,a,r,d)),n.graph().nodeRankFactor=i},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 _T(){if(uw)return jf;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 uw=1,jf={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(a){a.nodes().forEach(i=>n(a.node(i))),a.edges().forEach(i=>{let l=a.edge(i);l.points.forEach(n),Object.hasOwn(l,"y")&&n(l)})}(r),s!=="lr"&&s!=="rl"||(function(a){a.nodes().forEach(i=>o(a.node(i))),a.edges().forEach(i=>{let l=a.edge(i);l.points.forEach(o),Object.hasOwn(l,"x")&&o(l)})}(r),t(r))}},jf}function IT(){if(xw)return gw;xw=1;let t=_t();return gw=function(e,n){let o={};return e.forEach((r,s)=>{let a=o[r.v]={indegree:0,in:[],out:[],vs:[r.v],i:s};r.barycenter!==void 0&&(a.barycenter=r.barycenter,a.weight=r.weight)}),n.edges().forEach(r=>{let s=o[r.v],a=o[r.w];s!==void 0&&a!==void 0&&(a.indegree++,s.out.push(o[r.w]))}),function(r){let s=[];function a(l){return d=>{d.merged||(d.barycenter===void 0||l.barycenter===void 0||d.barycenter>=l.barycenter)&&function(u,h){let f=0,m=0;u.weight&&(f+=u.barycenter*u.weight,m+=u.weight),h.weight&&(f+=h.barycenter*h.weight,m+=h.weight),u.vs=h.vs.concat(u.vs),u.barycenter=f/m,u.weight=m,u.i=Math.min(h.i,u.i),h.merged=!0}(l,d)}}function i(l){return d=>{d.in.push(l),--d.indegree===0&&r.push(d)}}for(;r.length;){let l=r.pop();s.push(l),l.in.reverse().forEach(a(l)),l.out.forEach(i(l))}return s.filter(l=>!l.merged).map(l=>t.pick(l,["vs","i","barycenter","weight"]))}(Object.values(o).filter(r=>!r.indegree))}}function AT(){if(vw)return Nf;vw=1;let t=(pw||(pw=1,mw=function(o,r=[]){return r.map(s=>{let a=o.inEdges(s);if(a.length){let i=a.reduce((l,d)=>{let u=o.edge(d),h=o.node(d.v);return{sum:l.sum+u.weight*h.order,weight:l.weight+u.weight}},{sum:0,weight:0});return{v:s,barycenter:i.sum/i.weight,weight:i.weight}}return{v:s}})}),mw),e=IT(),n=function(){if(yw)return bw;yw=1;let o=_t();function r(s,a,i){let l;for(;a.length&&(l=a[a.length-1]).i<=i;)a.pop(),s.push(l.vs),i++;return i}return bw=function(s,a){let i=o.partition(s,p=>Object.hasOwn(p,"barycenter")),l=i.lhs,d=i.rhs.sort((p,b)=>b.i-p.i),u=[],h=0,f=0,m=0;var x;l.sort((x=!!a,(p,b)=>p.barycenter<b.barycenter?-1:p.barycenter>b.barycenter?1:x?b.i-p.i:p.i-b.i)),m=r(u,d,m),l.forEach(p=>{m+=p.vs.length,u.push(p.vs),h+=p.barycenter*p.weight,f+=p.weight,m=r(u,d,m)});let g={vs:u.flat(!0)};return f&&(g.barycenter=h/f,g.weight=f),g}}();return Nf=function o(r,s,a,i){let l=r.children(s),d=r.node(s),u=d?d.borderLeft:void 0,h=d?d.borderRight:void 0,f={};u&&(l=l.filter(p=>p!==u&&p!==h));let m=t(r,l);m.forEach(p=>{if(r.children(p.v).length){let v=o(r,p.v,a,i);f[p.v]=v,Object.hasOwn(v,"barycenter")&&(y=v,(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 x=e(m,a);(function(p,b){p.forEach(y=>{y.vs=y.vs.flatMap(v=>b[v]?b[v].vs:v)})})(x,f);let g=n(x,i);if(u&&(g.vs=[u,g.vs,h].flat(!0),r.predecessors(u).length)){let p=r.node(r.predecessors(u)[0]),b=r.node(r.predecessors(h)[0]);Object.hasOwn(g,"barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+p.order+b.order)/(g.weight+2),g.weight+=2}return g},Nf}function TT(){if(ww)return Ef;ww=1;let t=On().Graph,e=_t();return Ef=function(n,o,r){let s=function(i){for(var l;i.hasNode(l=e.uniqueId("_root")););return l}(n),a=new t({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(i=>n.node(i));return n.nodes().forEach(i=>{let l=n.node(i),d=n.parent(i);(l.rank===o||l.minRank<=o&&o<=l.maxRank)&&(a.setNode(i),a.setParent(i,d||s),n[r](i).forEach(u=>{let h=u.v===i?u.w:u.v,f=a.edge(h,i),m=f!==void 0?f.weight:0;a.setEdge(h,i,{weight:n.edge(u).weight+m})}),Object.hasOwn(l,"minRank")&&a.setNode(i,{borderLeft:l.borderLeft[o],borderRight:l.borderRight[o]}))}),a},Ef}function MT(){if(Sw)return _f;Sw=1;let t=function(){if(hw)return Sf;hw=1;let u=_t();return Sf=function(h){let f={},m=h.nodes().filter(y=>!h.children(y).length),x=m.map(y=>h.node(y).rank),g=u.applyWithChunking(Math.max,x),p=u.range(g+1).map(()=>[]);function b(y){if(f[y])return;f[y]=!0;let v=h.node(y);p[v.rank].push(y),h.successors(y).forEach(b)}return m.sort((y,v)=>h.node(y).rank-h.node(v).rank).forEach(b),p},Sf}(),e=function(){if(fw)return Cf;fw=1;let u=_t().zipObject;function h(f,m,x){let g=u(x,x.map((S,j)=>j)),p=m.flatMap(S=>f.outEdges(S).map(j=>({pos:g[j.w],weight:f.edge(j).weight})).sort((j,C)=>j.pos-C.pos)),b=1;for(;b<x.length;)b<<=1;let y=2*b-1;b-=1;let v=new Array(y).fill(0),w=0;return p.forEach(S=>{let j=S.pos+b;v[j]+=S.weight;let C=0;for(;j>0;)j%2&&(C+=v[j+1]),j=j-1>>1,v[j]+=S.weight;w+=S.weight*C}),w}return Cf=function(f,m){let x=0;for(let g=1;g<m.length;++g)x+=h(f,m[g-1],m[g]);return x},Cf}(),n=AT(),o=TT(),r=(jw||(jw=1,kw=function(u,h,f){let m,x={};f.forEach(g=>{let p,b,y=u.parent(g);for(;y;){if(p=u.parent(y),p?(b=x[p],x[p]=y):(b=m,m=y),b&&b!==y)return void h.setEdge(b,y);y=p}})}),kw),s=On().Graph,a=_t();function i(u,h,f){return h.map(function(m){return o(u,m,f)})}function l(u,h){let f=new s;u.forEach(function(m){let x=m.graph().root,g=n(m,x,f,h);g.vs.forEach((p,b)=>m.node(p).order=b),r(m,f,g.vs)})}function d(u,h){Object.values(h).forEach(f=>f.forEach((m,x)=>u.node(m).order=x))}return _f=function u(h,f){if(f&&typeof f.customOrder=="function")return void f.customOrder(h,u);let m=a.maxRank(h),x=i(h,a.range(1,m+1),"inEdges"),g=i(h,a.range(m-1,-1,-1),"outEdges"),p=t(h);if(d(h,p),f&&f.disableOptimalOrderHeuristic)return;let b,y=Number.POSITIVE_INFINITY;for(let v=0,w=0;w<4;++v,++w){l(v%2?x:g,v%4>=2),p=a.buildLayerMatrix(h);let S=e(h,p);S<y&&(w=0,b=Object.assign({},p),y=S)}d(h,b)},_f}function OT(){if(Cw)return If;Cw=1;let t=On().Graph,e=_t();function n(h,f){let m={};return f.length&&f.reduce(function(x,g){let p=0,b=0,y=x.length,v=g[g.length-1];return g.forEach((w,S)=>{let j=function(_,E){if(_.node(E).dummy)return _.predecessors(E).find(M=>_.node(M).dummy)}(h,w),C=j?h.node(j).order:y;(j||w===v)&&(g.slice(b,S+1).forEach(_=>{h.predecessors(_).forEach(E=>{let M=h.node(E),I=M.order;!(I<p||C<I)||M.dummy&&h.node(_).dummy||r(m,E,_)})}),b=S+1,p=C)}),g}),m}function o(h,f){let m={};function x(g,p,b,y,v){let w;e.range(p,b).forEach(S=>{w=g[S],h.node(w).dummy&&h.predecessors(w).forEach(j=>{let C=h.node(j);C.dummy&&(C.order<y||C.order>v)&&r(m,j,w)})})}return f.length&&f.reduce(function(g,p){let b,y=-1,v=0;return p.forEach((w,S)=>{if(h.node(w).dummy==="border"){let j=h.predecessors(w);j.length&&(b=h.node(j[0]).order,x(p,v,S,y,b),v=S,y=b)}x(p,v,p.length,b,g.length)}),p}),m}function r(h,f,m){if(f>m){let g=f;f=m,m=g}let x=h[f];x||(h[f]=x={}),x[m]=!0}function s(h,f,m){if(f>m){let x=f;f=m,m=x}return!!h[f]&&Object.hasOwn(h[f],m)}function a(h,f,m,x){let g={},p={},b={};return f.forEach(y=>{y.forEach((v,w)=>{g[v]=v,p[v]=v,b[v]=w})}),f.forEach(y=>{let v=-1;y.forEach(w=>{let S=x(w);if(S.length){S=S.sort((C,_)=>b[C]-b[_]);let j=(S.length-1)/2;for(let C=Math.floor(j),_=Math.ceil(j);C<=_;++C){let E=S[C];p[w]===w&&v<b[E]&&!s(m,w,E)&&(p[E]=w,p[w]=g[w]=g[E],v=b[E])}}})}),{root:g,align:p}}function i(h,f,m,x,g){let p={},b=function(w,S,j,C){let _=new t,E=w.graph(),M=function(I,D,F){return(O,P,R)=>{let z,N=O.node(P),k=O.node(R),B=0;if(B+=N.width/2,Object.hasOwn(N,"labelpos"))switch(N.labelpos.toLowerCase()){case"l":z=-N.width/2;break;case"r":z=N.width/2}if(z&&(B+=F?z:-z),z=0,B+=(N.dummy?D:I)/2,B+=(k.dummy?D:I)/2,B+=k.width/2,Object.hasOwn(k,"labelpos"))switch(k.labelpos.toLowerCase()){case"l":z=k.width/2;break;case"r":z=-k.width/2}return z&&(B+=F?z:-z),z=0,B}}(E.nodesep,E.edgesep,C);return S.forEach(I=>{let D;I.forEach(F=>{let O=j[F];if(_.setNode(O),D){var P=j[D],R=_.edge(P,O);_.setEdge(P,O,Math.max(M(w,F,D),R||0))}D=F})}),_}(h,f,m,g),y=g?"borderLeft":"borderRight";function v(w,S){let j=b.nodes(),C=j.pop(),_={};for(;C;)_[C]?w(C):(_[C]=!0,j.push(C),j=j.concat(S(C))),C=j.pop()}return v(function(w){p[w]=b.inEdges(w).reduce((S,j)=>Math.max(S,p[j.v]+b.edge(j)),0)},b.predecessors.bind(b)),v(function(w){let S=b.outEdges(w).reduce((C,_)=>Math.min(C,p[_.w]-b.edge(_)),Number.POSITIVE_INFINITY),j=h.node(w);S!==Number.POSITIVE_INFINITY&&j.borderType!==y&&(p[w]=Math.max(p[w],S))},b.successors.bind(b)),Object.keys(x).forEach(w=>p[w]=p[m[w]]),p}function l(h,f){return Object.values(f).reduce((m,x)=>{let g=Number.NEGATIVE_INFINITY,p=Number.POSITIVE_INFINITY;Object.entries(x).forEach(([y,v])=>{let w=function(S,j){return S.node(j).width}(h,y)/2;g=Math.max(v+w,g),p=Math.min(v-w,p)});const b=g-p;return b<m[0]&&(m=[b,x]),m},[Number.POSITIVE_INFINITY,null])[1]}function d(h,f){let m=Object.values(f),x=e.applyWithChunking(Math.min,m),g=e.applyWithChunking(Math.max,m);["u","d"].forEach(p=>{["l","r"].forEach(b=>{let y=p+b,v=h[y];if(v===f)return;let w=Object.values(v),S=x-e.applyWithChunking(Math.min,w);b!=="l"&&(S=g-e.applyWithChunking(Math.max,w)),S&&(h[y]=e.mapValues(v,j=>j+S))})})}function u(h,f){return e.mapValues(h.ul,(m,x)=>{if(f)return h[f.toLowerCase()][x];{let g=Object.values(h).map(p=>p[x]).sort((p,b)=>p-b);return(g[1]+g[2])/2}})}return If={positionX:function(h){let f,m=e.buildLayerMatrix(h),x=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(j=>Object.values(j).reverse()));let v=(b==="u"?h.predecessors:h.successors).bind(h),w=a(h,f,x,v),S=i(h,f,w.root,w.align,y==="r");y==="r"&&(S=e.mapValues(S,j=>-j)),g[b+y]=S})});let p=l(h,g);return d(g,p),u(g,h.graph().align)},findType1Conflicts:n,findType2Conflicts:o,addConflict:r,hasConflict:s,verticalAlignment:a,horizontalCompaction:i,alignCoordinates:d,findSmallestWidthAlignment:l,balance:u},If}function DT(){if(Nw)return Af;Nw=1;let t=_t(),e=OT().positionX;return Af=function(n){n=t.asNonCompoundGraph(n),function(o){let r=t.buildLayerMatrix(o),s=o.graph().ranksep,a=0;r.forEach(i=>{const l=i.reduce((d,u)=>{const h=o.node(u).height;return d>h?d:h},0);i.forEach(d=>o.node(d).y=a+l/2),a+=l+s})}(n),Object.entries(e(n)).forEach(([o,r])=>n.node(o).x=r)},Af}function PT(){if(Ew)return Tf;Ew=1;let t=kT(),e=jT(),n=CT(),o=_t().normalizeRanks,r=NT(),s=_t().removeEmptyRanks,a=ET(),i=function(){if(dw)return kf;dw=1;let C=_t();function _(E,M,I,D,F,O){let P={width:0,height:0,rank:O,borderType:M},R=F[M][O-1],z=C.addDummyNode(E,"border",P,I);F[M][O]=z,E.setParent(z,D),R&&E.setEdge(R,z,{weight:1})}return kf=function(E){E.children().forEach(function M(I){let D=E.children(I),F=E.node(I);if(D.length&&D.forEach(M),Object.hasOwn(F,"minRank")){F.borderLeft=[],F.borderRight=[];for(let O=F.minRank,P=F.maxRank+1;O<P;++O)_(E,"borderLeft","_bl",I,F,O),_(E,"borderRight","_br",I,F,O)}})},kf}(),l=_T(),d=MT(),u=DT(),h=_t(),f=On().Graph;Tf=function(C,_){let E=_&&_.debugTiming?h.time:h.notime;E("layout",()=>{let M=E(" buildLayoutGraph",()=>function(I){let D=new f({multigraph:!0,compound:!0}),F=j(I.graph());return D.setGraph(Object.assign({},x,S(F,m),h.pick(F,g))),I.nodes().forEach(O=>{const P=S(j(I.node(O)),p);Object.keys(b).forEach(R=>{P[R]===void 0&&(P[R]=b[R])}),D.setNode(O,P),D.setParent(O,I.parent(O))}),I.edges().forEach(O=>{let P=j(I.edge(O));D.setEdge(O,Object.assign({},v,S(P,y),h.pick(P,w)))}),D}(C));E(" runLayout",()=>function(I,D,F){D(" makeSpaceForEdgeLabels",()=>function(O){let P=O.graph();P.ranksep/=2,O.edges().forEach(R=>{let z=O.edge(R);z.minlen*=2,z.labelpos.toLowerCase()!=="c"&&(P.rankdir==="TB"||P.rankdir==="BT"?z.width+=z.labeloffset:z.height+=z.labeloffset)})}(I)),D(" removeSelfEdges",()=>function(O){O.edges().forEach(P=>{if(P.v===P.w){var R=O.node(P.v);R.selfEdges||(R.selfEdges=[]),R.selfEdges.push({e:P,label:O.edge(P)}),O.removeEdge(P)}})}(I)),D(" acyclic",()=>t.run(I)),D(" nestingGraph.run",()=>a.run(I)),D(" rank",()=>n(h.asNonCompoundGraph(I))),D(" injectEdgeLabelProxies",()=>function(O){O.edges().forEach(P=>{let R=O.edge(P);if(R.width&&R.height){let z=O.node(P.v),N={rank:(O.node(P.w).rank-z.rank)/2+z.rank,e:P};h.addDummyNode(O,"edge-proxy",N,"_ep")}})}(I)),D(" removeEmptyRanks",()=>s(I)),D(" nestingGraph.cleanup",()=>a.cleanup(I)),D(" normalizeRanks",()=>o(I)),D(" assignRankMinMax",()=>function(O){let P=0;O.nodes().forEach(R=>{let z=O.node(R);z.borderTop&&(z.minRank=O.node(z.borderTop).rank,z.maxRank=O.node(z.borderBottom).rank,P=Math.max(P,z.maxRank))}),O.graph().maxRank=P}(I)),D(" removeEdgeLabelProxies",()=>function(O){O.nodes().forEach(P=>{let R=O.node(P);R.dummy==="edge-proxy"&&(O.edge(R.e).labelRank=R.rank,O.removeNode(P))})}(I)),D(" normalize.run",()=>e.run(I)),D(" parentDummyChains",()=>r(I)),D(" addBorderSegments",()=>i(I)),D(" order",()=>d(I,F)),D(" insertSelfEdges",()=>function(O){var P=h.buildLayerMatrix(O);P.forEach(R=>{var z=0;R.forEach((N,k)=>{var B=O.node(N);B.order=k+z,(B.selfEdges||[]).forEach(A=>{h.addDummyNode(O,"selfedge",{width:A.label.width,height:A.label.height,rank:B.rank,order:k+ ++z,e:A.e,label:A.label},"_se")}),delete B.selfEdges})})}(I)),D(" adjustCoordinateSystem",()=>l.adjust(I)),D(" position",()=>u(I)),D(" positionSelfEdges",()=>function(O){O.nodes().forEach(P=>{var R=O.node(P);if(R.dummy==="selfedge"){var z=O.node(R.e.v),N=z.x+z.width/2,k=z.y,B=R.x-N,A=z.height/2;O.setEdge(R.e,R.label),O.removeNode(P),R.label.points=[{x:N+2*B/3,y:k-A},{x:N+5*B/6,y:k-A},{x:N+B,y:k},{x:N+5*B/6,y:k+A},{x:N+2*B/3,y:k+A}],R.label.x=R.x,R.label.y=R.y}})}(I)),D(" removeBorderNodes",()=>function(O){O.nodes().forEach(P=>{if(O.children(P).length){let R=O.node(P),z=O.node(R.borderTop),N=O.node(R.borderBottom),k=O.node(R.borderLeft[R.borderLeft.length-1]),B=O.node(R.borderRight[R.borderRight.length-1]);R.width=Math.abs(B.x-k.x),R.height=Math.abs(N.y-z.y),R.x=k.x+R.width/2,R.y=z.y+R.height/2}}),O.nodes().forEach(P=>{O.node(P).dummy==="border"&&O.removeNode(P)})}(I)),D(" normalize.undo",()=>e.undo(I)),D(" fixupEdgeLabelCoords",()=>function(O){O.edges().forEach(P=>{let R=O.edge(P);if(Object.hasOwn(R,"x"))switch(R.labelpos!=="l"&&R.labelpos!=="r"||(R.width-=R.labeloffset),R.labelpos){case"l":R.x-=R.width/2+R.labeloffset;break;case"r":R.x+=R.width/2+R.labeloffset}})}(I)),D(" undoCoordinateSystem",()=>l.undo(I)),D(" translateGraph",()=>function(O){let P=Number.POSITIVE_INFINITY,R=0,z=Number.POSITIVE_INFINITY,N=0,k=O.graph(),B=k.marginx||0,A=k.marginy||0;function U($){let X=$.x,Y=$.y,G=$.width,W=$.height;P=Math.min(P,X-G/2),R=Math.max(R,X+G/2),z=Math.min(z,Y-W/2),N=Math.max(N,Y+W/2)}O.nodes().forEach($=>U(O.node($))),O.edges().forEach($=>{let X=O.edge($);Object.hasOwn(X,"x")&&U(X)}),P-=B,z-=A,O.nodes().forEach($=>{let X=O.node($);X.x-=P,X.y-=z}),O.edges().forEach($=>{let X=O.edge($);X.points.forEach(Y=>{Y.x-=P,Y.y-=z}),Object.hasOwn(X,"x")&&(X.x-=P),Object.hasOwn(X,"y")&&(X.y-=z)}),k.width=R-P+B,k.height=N-z+A}(I)),D(" assignNodeIntersects",()=>function(O){O.edges().forEach(P=>{let R,z,N=O.edge(P),k=O.node(P.v),B=O.node(P.w);N.points?(R=N.points[0],z=N.points[N.points.length-1]):(N.points=[],R=B,z=k),N.points.unshift(h.intersectRect(k,R)),N.points.push(h.intersectRect(B,z))})}(I)),D(" reversePoints",()=>function(O){O.edges().forEach(P=>{let R=O.edge(P);R.reversed&&R.points.reverse()})}(I)),D(" acyclic.undo",()=>t.undo(I))}(M,E,_)),E(" updateInputGraph",()=>function(I,D){I.nodes().forEach(F=>{let O=I.node(F),P=D.node(F);O&&(O.x=P.x,O.y=P.y,O.rank=P.rank,D.children(F).length&&(O.width=P.width,O.height=P.height))}),I.edges().forEach(F=>{let O=I.edge(F),P=D.edge(F);O.points=P.points,Object.hasOwn(P,"x")&&(O.x=P.x,O.y=P.y)}),I.graph().width=D.graph().width,I.graph().height=D.graph().height}(C,M))})};let m=["nodesep","edgesep","ranksep","marginx","marginy"],x={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},g=["acyclicer","ranker","rankdir","align"],p=["width","height","rank"],b={width:0,height:0},y=["minlen","weight","width","height","labeloffset"],v={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},w=["labelpos"];function S(C,_){return h.mapValues(h.pick(C,_),Number)}function j(C){var _={};return C&&Object.entries(C).forEach(([E,M])=>{typeof E=="string"&&(E=E.toLowerCase()),_[E]=M}),_}return Tf}function RT(){if(_w)return Mf;_w=1;let t=_t(),e=On().Graph;return Mf={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,a)=>{let i="layer"+a;r.setNode(i,{rank:"same"}),s.reduce((l,d)=>(r.setEdge(l,d,{style:"invis"}),d))}),r}},Mf}var zw=Mw?Tw:(Mw=1,Tw={graphlib:On(),layout:PT(),debug:RT(),util:{time:_t().time,notime:_t().notime},version:Aw?Iw:(Aw=1,Iw="1.1.5")});const ja=new zw.graphlib.Graph().setDefaultEdgeLabel(()=>({})),Bw=({nodes:t,edges:e,direction:n})=>(ja.setGraph({rankdir:n,nodesep:150,ranksep:200,ranker:"longest-path"}),e.forEach(o=>ja.setEdge(o.source,o.target)),t.forEach(o=>ja.setNode(o.id,{...o,width:o.width??0,height:o.height??0})),zw.layout(ja),{nodes:t.map(o=>{const{x:r,y:s}=ja.node(o.id);return{...o,position:{x:r,y:s}}}),edges:e}),Uw=new class{createEdge(t,e){return{animated:!0,markerEnd:{type:qr.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:Gh(Qe.get(e).code.trim().split(`
|
147
|
-
`).length),position:{x:0,y:0}}}createElements(t,e,n,o){const r=[],s=[],a=new Set,i=new Set;for(const l of Object.values(n)){if(l.value==="marimo"&&l.name==="mo")continue;const{declaredBy:d,usedBy:u}=l;for(const h of d)for(const f of u){const m=`${h}-${f}`;i.has(m)||(i.add(m),a.add(h),a.add(f),s.push(this.createEdge(h,f)))}}for(const[l,d]of Im.zip(t,e)){o||r.push(this.createNode(l,d));const u=a.has(l),h=Qe.get(d).code.trim().startsWith("mo.md");!u&&h||r.push(this.createNode(l,d))}return{nodes:r,edges:s}}},LT=t=>{const e=H.c(43),{cellIds:n,variables:o,cellAtoms:r,children:s,layoutDirection:a,settings:i}=t;let l;e[0]!==r||e[1]!==n||e[2]!==a||e[3]!==i.hidePureMarkdown||e[4]!==o?(l=()=>{let k=Uw.createElements(n,r,o,i.hidePureMarkdown);return k=Bw({nodes:k.nodes,edges:k.edges,direction:a}),k},e[0]=r,e[1]=n,e[2]=a,e[3]=i.hidePureMarkdown,e[4]=o,e[5]=l):l=e[5];const[d]=T.useState(l),[u,h,f]=y2(d.nodes),[m,x,g]=v2(d.edges),p=va();let b;e[6]!==a||e[7]!==x||e[8]!==h?(b=k=>{const B=Bw({nodes:k.nodes,edges:k.edges,direction:a});h(B.nodes),x(B.edges)},e[6]=a,e[7]=x,e[8]=h,e[9]=b):b=e[9];const y=Le(b);let v,w;e[10]!==r||e[11]!==n||e[12]!==i.hidePureMarkdown||e[13]!==y||e[14]!==o?(v=()=>{y(Uw.createElements(n,r,o,i.hidePureMarkdown))},w=[n,o,r,y,i.hidePureMarkdown],e[10]=r,e[11]=n,e[12]=i.hidePureMarkdown,e[13]=y,e[14]=o,e[15]=v,e[16]=w):(v=e[15],w=e[16]),T.useEffect(v,w);const[S,j]=T.useState();let C;E2(),e[17]===Symbol.for("react.memo_cache_sentinel")?(C=()=>{j(void 0)},e[17]=C):C=e[17];const _=C;let E,M,I,D,F,O,P,R,z,N;return e[18]===Symbol.for("react.memo_cache_sentinel")?(E={minZoom:.5,maxZoom:1.5},M=(k,B)=>{j({type:"node",id:B.id})},I=(k,B)=>{const{source:A,target:U}=B;j({type:"edge",source:A,target:U})},e[18]=E,e[19]=M,e[20]=I):(E=e[18],M=e[19],I=e[20]),e[21]===Symbol.for("react.memo_cache_sentinel")?(D=c.jsx(oT,{color:"#ccc",variant:Cn.Dots}),e[21]=D):D=e[21],e[22]!==p||e[23]!==u?(F=()=>{const k=Qe.get(gP);if(k){const B=u.find(A=>A.id===k);B&&(p.fitView({padding:1,duration:600,nodes:[B]}),j({type:"node",id:k}))}},e[22]=p,e[23]=u,e[24]=F):F=e[24],e[25]===Symbol.for("react.memo_cache_sentinel")?(O=c.jsx(dp,{className:"size-4"}),e[25]=O):O=e[25],e[26]!==F?(P=c.jsx(JA,{position:"bottom-right",showInteractive:!1,children:c.jsx(Ne,{content:"Jump to focused cell",delayDuration:200,side:"left",asChild:!1,children:c.jsx(es,{onMouseDown:Rn.preventFocus,onClick:F,children:O})})}),e[26]=F,e[27]=P):P=e[27],e[28]!==m||e[29]!==S||e[30]!==o?(R=c.jsx(Fl,{selection:S,variables:o,edges:m,onClearSelection:_}),e[28]=m,e[29]=S,e[30]=o,e[31]=R):R=e[31],e[32]!==s||e[33]!==m||e[34]!==u||e[35]!==g||e[36]!==f||e[37]!==P||e[38]!==R?(z=c.jsxs(qh,{nodes:u,edges:m,nodeTypes:C2,minZoom:.2,fitViewOptions:E,onNodeClick:M,onEdgeClick:I,onNodeDoubleClick:FT,fitView:!0,onNodesChange:f,onEdgesChange:g,zoomOnDoubleClick:!1,nodesConnectable:!1,children:[D,P,R,s]}),e[32]=s,e[33]=m,e[34]=u,e[35]=g,e[36]=f,e[37]=P,e[38]=R,e[39]=z):z=e[39],e[40]!==a||e[41]!==z?(N=c.jsx(j2,{value:a,children:z}),e[40]=a,e[41]=z,e[42]=N):N=e[42],N};function FT(t,e){Y3(e.id,"focus")}const zT=yt("_minimap_"),BT=yt({hidePureMarkdown:!0}),UT=t=>{const e=H.c(11),[n,o]=Ot(zT),[r,s]=Ot(BT);let a;e[0]!==n||e[1]!==t||e[2]!==o||e[3]!==s||e[4]!==r?(a=()=>n==="_minimap_"?c.jsx(lT,{...t,children:c.jsx(Kh,{settings:r,onSettingsChange:s,view:n,onChange:o})}):c.jsx(LT,{...t,settings:r,layoutDirection:n,children:c.jsx(Kh,{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]=a):a=e[5];const i=a;let l,d;return e[6]!==i?(l=i(),e[6]=i,e[7]=l):l=e[7],e[8]!==n||e[9]!==l?(d=c.jsx(Wh,{children:l},n),e[8]=n,e[9]=l,e[10]=d):d=e[10],d},$T=()=>{const t=H.c(5),e=Mm(),n=gr(),[o]=xP();let r,s;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=xe("w-full h-full flex-1 mx-auto -mb-4 relative"),t[0]=r):r=t[0],t[1]!==n.inOrderIds||t[2]!==o||t[3]!==e?(s=c.jsx("div",{className:r,children:c.jsx(UT,{cellAtoms:o,variables:e,cellIds:n.inOrderIds})}),t[1]=n.inOrderIds,t[2]=o,t[3]=e,t[4]=s):s=t[4],s},VT=t=>{const e=H.c(4),{isOpen:n,children:o}=t,[r,s]=q.useState(!1);let a,i;return e[0]!==r||e[1]!==n?(a=()=>{n&&!r&&s(!0)},i=[n,r],e[0]=r,e[1]=n,e[2]=a,e[3]=i):(a=e[2],i=e[3]),q.useEffect(a,i),r?o:null},HT=t=>{const e=H.c(8),{variableName:n,className:o}=t;let r;e[0]!==n?(r=()=>{const l=function(u){const h=Qe.get(hc)[u];if(h)return h.declaredBy[0]}(n);if(!l)return;const d=Ia(l);d&&Tm(d,n)},e[0]=n,e[1]=r):r=e[1];const s=r;let a,i;return e[2]!==o?(a=xe("text-link opacity-80 hover:opacity-100 hover:underline",o),e[2]=o,e[3]=a):a=e[3],e[4]!==s||e[5]!==a||e[6]!==n?(i=c.jsx("button",{type:"button",onClick:s,className:a,children:n}),e[4]=s,e[5]=a,e[6]=n,e[7]=i):i=e[7],i},WT=yt(t=>{const e=t(bP),n=t(hc),o=t(ei);return ii(e,r=>{if(!r.variable_name)return-1;const s=Object.values(n).find(i=>i.name===r.variable_name);if(!s)return 0;const a=o.inOrderIds.indexOf(s.declaredBy[0]);return a===-1?0:a})}),qT=yt(t=>{const e=new Map(t(yP));for(const n of K3){const o=e.get(n);o&&o.databases.length===0&&e.delete(n)}return ii([...e.values()],n=>K3.has(n.name)?1:0)}),GT=()=>{const t=H.c(32),[e,n]=q.useState(""),o=jt(X3),r=Se(WT),s=Se(qT);if(r.length===0&&s.length===0){let b;return t[0]===Symbol.for("react.memo_cache_sentinel")?(b=c.jsx(ln,{title:"No tables found",description:"Any datasets/dataframes in the global scope will be shown here.",action:c.jsx(ug,{children:c.jsxs(ve,{variant:"outline",size:"sm",children:["Add database or catalog",c.jsx(Yo,{className:"h-4 w-4 ml-2"})]})}),icon:c.jsx(Wo,{})}),t[0]=b):b=t[0],b}const a=!!e.trim();let i,l,d,u,h,f,m,x,g,p;if(t[1]!==o?(i=b=>{o(b.length>0),n(b)},t[1]=o,t[2]=i):i=t[2],t[3]!==e||t[4]!==i?(l=c.jsx(Ma,{placeholder:"Search tables...",className:"h-6 m-1",value:e,onValueChange:i,rootClassName:"flex-1 border-r"}),t[3]=e,t[4]=i,t[5]=l):l=t[5],t[6]!==a?(d=a&&c.jsx("button",{type:"button",className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",onClick:()=>n(""),children:c.jsx(yn,{className:"h-4 w-4"})}),t[6]=a,t[7]=d):d=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(u=c.jsx(ug,{children:c.jsx("button",{type:"button",className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:c.jsx(Yo,{className:"h-4 w-4"})})}),t[8]=u):u=t[8],t[9]!==l||t[10]!==d?(h=c.jsxs("div",{className:"flex items-center w-full",children:[l,d,u]}),t[9]=l,t[10]=d,t[11]=h):h=t[11],t[12]!==s||t[13]!==a||t[14]!==e){let b;t[16]!==a||t[17]!==e?(b=y=>c.jsx(YT,{connection:y,hasChildren:y.databases.length>0,children:y.databases.map(v=>c.jsx(KT,{engineName:y.name,database:v,hasSearch:a,children:c.jsx(XT,{schemas:v.schemas,defaultSchema:y.default_schema,defaultDatabase:y.default_database,engineName:y.name,databaseName:v.name,hasSearch:a,searchValue:e})},v.name))},y.name),t[16]=a,t[17]=e,t[18]=b):b=t[18],f=s.map(b),t[12]=s,t[13]=a,t[14]=e,t[15]=f}else f=t[15];return t[19]!==s.length||t[20]!==r.length?(m=s.length>0&&r.length>0&&c.jsxs(J3,{children:[c.jsx(Xl,{className:"h-4 w-4 text-muted-foreground"}),c.jsx("span",{className:"text-xs",children:"Python"})]}),t[19]=s.length,t[20]=r.length,t[21]=m):m=t[21],t[22]!==e||t[23]!==r?(x=r.length>0&&c.jsx($w,{tables:r,searchValue:e}),t[22]=e,t[23]=r,t[24]=x):x=t[24],t[25]!==f||t[26]!==m||t[27]!==x?(g=c.jsxs(ym,{className:"flex flex-col",children:[f,m,x]}),t[25]=f,t[26]=m,t[27]=x,t[28]=g):g=t[28],t[29]!==h||t[30]!==g?(p=c.jsxs(cc,{className:"border-b bg-background rounded-none h-full pb-10 overflow-auto outline-hidden",shouldFilter:!1,children:[h,g]}),t[29]=h,t[30]=g,t[31]=p):p=t[31],p},YT=t=>{const e=H.c(26),{connection:n,children:o,hasChildren:r}=t,s=n.name===vP,a=s?"In-Memory":n.name,{previewDataSourceConnection:i}=et(),[l,d]=q.useState(!1);let u;e[0]!==n.name||e[1]!==i?(u=async()=>{d(!0),await i({engine:n.name}),setTimeout(()=>d(!1),500)},e[0]=n.name,e[1]=i,e[2]=u):u=e[2];const h=u;let f,m,x;e[3]!==n.dialect?(f=c.jsx(Bk,{className:"h-4 w-4 text-muted-foreground",name:n.dialect}),e[3]=n.dialect,e[4]=f):f=e[4],e[5]!==n.dialect?(m=wP(n.dialect),e[5]=n.dialect,e[6]=m):m=e[6],e[7]!==m?(x=c.jsx("span",{className:"text-xs",children:m}),e[7]=m,e[8]=x):x=e[8];const g=a;let p,b,y,v,w;return e[9]!==g?(p=c.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",c.jsx(HT,{variableName:g}),")"]}),e[9]=g,e[10]=p):p=e[10],e[11]!==h||e[12]!==s||e[13]!==l?(b=!s&&c.jsx(Ne,{content:"Refresh connection",children:c.jsx(ve,{variant:"ghost",size:"icon",className:"ml-auto hover:bg-transparent hover:shadow-none",onClick:h,children:c.jsx(wc,{className:xe("h-4 w-4 text-muted-foreground hover:text-foreground",l&&"animate-[spin_0.5s]")})})}),e[11]=h,e[12]=s,e[13]=l,e[14]=b):b=e[14],e[15]!==f||e[16]!==x||e[17]!==p||e[18]!==b?(y=c.jsxs(J3,{children:[f,x,p,b]}),e[15]=f,e[16]=x,e[17]=p,e[18]=b,e[19]=y):y=e[19],e[20]!==o||e[21]!==r?(v=r?o:c.jsx(Mc,{content:"No databases available",className:"pl-2"}),e[20]=o,e[21]=r,e[22]=v):v=e[22],e[23]!==y||e[24]!==v?(w=c.jsxs(c.Fragment,{children:[y,v]}),e[23]=y,e[24]=v,e[25]=w):w=e[25],w},KT=t=>{const e=H.c(28),{hasSearch:n,engineName:o,database:r,children:s}=t,[a,i]=q.useState(!1),[l,d]=q.useState(!1);let u,h,f;e[0]!==n?(u=()=>{i(n)},h=[n],e[0]=n,e[1]=u,e[2]=h):(u=e[1],h=e[2]),q.useEffect(u,h),e[3]!==a||e[4]!==l?(f=()=>{i(!a),d(!l)},e[3]=a,e[4]=l,e[5]=f):f=e[5];const m=`${o}:${r.name}`;let x;e[6]!==a?(x=c.jsx(oj,{isExpanded:a}),e[6]=a,e[7]=x):x=e[7];const g=l&&a?"text-foreground":"text-muted-foreground";let p,b;e[8]!==g?(p=xe("h-4 w-4",g),e[8]=g,e[9]=p):p=e[9],e[10]!==p?(b=c.jsx(Wo,{className:p}),e[10]=p,e[11]=b):b=e[11];const y=l&&a&&"font-semibold";let v,w,S,j;e[12]!==y?(v=xe(y),e[12]=y,e[13]=v):v=e[13],e[14]!==r.name?(w=r.name===""?c.jsx("i",{children:"Not connected"}):r.name,e[14]=r.name,e[15]=w):w=e[15],e[16]!==v||e[17]!==w?(S=c.jsx("span",{className:v,children:w}),e[16]=v,e[17]=w,e[18]=S):S=e[18],e[19]!==S||e[20]!==f||e[21]!==m||e[22]!==x||e[23]!==b?(j=c.jsxs(Xn,{className:"text-sm flex flex-row gap-1 items-center cursor-pointer rounded-none",onSelect:f,value:m,children:[x,b,S]}),e[19]=S,e[20]=f,e[21]=m,e[22]=x,e[23]=b,e[24]=j):j=e[24];const C=a&&s;let _;return e[25]!==j||e[26]!==C?(_=c.jsxs(c.Fragment,{children:[j,C]}),e[25]=j,e[26]=C,e[27]=_):_=e[27],_},XT=t=>{const e=H.c(20),{schemas:n,defaultSchema:o,defaultDatabase:r,engineName:s,databaseName:a,hasSearch:i,searchValue:l}=t;if(n.length===0){let h;return e[0]===Symbol.for("react.memo_cache_sentinel")?(h=c.jsx(Mc,{content:"No schemas available",className:"pl-6"}),e[0]=h):h=e[0],h}let d,u;if(e[1]!==a||e[2]!==r||e[3]!==o||e[4]!==s||e[5]!==i||e[6]!==n||e[7]!==l){let h;e[9]!==l?(h=x=>!l||x.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]!==a||e[12]!==r||e[13]!==o||e[14]!==s||e[15]!==i||e[16]!==l?(m=x=>c.jsx(JT,{databaseName:a,schema:x,hasSearch:i,children:c.jsx($w,{tables:x.tables,searchValue:l,sqlTableContext:{engine:s,database:a,schema:x.name,defaultSchema:o,defaultDatabase:r}})},x.name),e[11]=a,e[12]=r,e[13]=o,e[14]=s,e[15]=i,e[16]=l,e[17]=m):m=e[17],d=f.map(m),e[1]=a,e[2]=r,e[3]=o,e[4]=s,e[5]=i,e[6]=n,e[7]=l,e[8]=d}else d=e[8];return e[18]!==d?(u=c.jsx(c.Fragment,{children:d}),e[18]=d,e[19]=u):u=e[19],u},JT=t=>{const e=H.c(26),{databaseName:n,schema:o,children:r,hasSearch:s}=t,[a,i]=q.useState(!1),[l,d]=q.useState(!1),u=`${n}:${o.name}`;let h,f,m,x;if(e[0]!==s?(h=()=>{i(s)},f=[s],e[0]=s,e[1]=h,e[2]=f):(h=e[1],f=e[2]),q.useEffect(h,f),nj(o.name))return r;e[3]!==a||e[4]!==l?(m=()=>{i(!a),d(!l)},e[3]=a,e[4]=l,e[5]=m):m=e[5],e[6]!==a?(x=c.jsx(oj,{isExpanded:a}),e[6]=a,e[7]=x):x=e[7];const g=l&&a&&"text-foreground";let p,b;e[8]!==g?(p=xe("h-4 w-4 text-muted-foreground",g),e[8]=g,e[9]=p):p=e[9],e[10]!==p?(b=c.jsx(_P,{className:p}),e[10]=p,e[11]=b):b=e[11];const y=l&&a&&"font-semibold";let v,w,S;e[12]!==y?(v=xe(y),e[12]=y,e[13]=v):v=e[13],e[14]!==o.name||e[15]!==v?(w=c.jsx("span",{className:v,children:o.name}),e[14]=o.name,e[15]=v,e[16]=w):w=e[16],e[17]!==w||e[18]!==m||e[19]!==x||e[20]!==b||e[21]!==u?(S=c.jsxs(Xn,{className:"text-sm flex flex-row gap-1 items-center pl-5 cursor-pointer rounded-none",onSelect:m,value:u,children:[x,b,w]}),e[17]=w,e[18]=m,e[19]=x,e[20]=b,e[21]=u,e[22]=S):S=e[22];const j=a&&r;let C;return e[23]!==S||e[24]!==j?(C=c.jsxs(c.Fragment,{children:[S,j]}),e[23]=S,e[24]=j,e[25]=C):C=e[25],C},$w=t=>{const e=H.c(24),{tables:n,sqlTableContext:o,searchValue:r}=t,{addTableList:s}=Z3(),[a,i]=q.useState(!1),[l,d]=q.useState(!1);let u,h;e[0]!==s||e[1]!==o||e[2]!==n.length||e[3]!==a?(u=async()=>{if(n.length===0&&o&&!a){i(!0),d(!0);const{engine:p,database:b,schema:y}=o,v=await HR.request({engine:p,database:b,schema:y});if(!(v!=null&&v.tables))throw d(!1),new Error("No tables available");s({tables:v.tables,sqlTableContext:o}),d(!1)}},e[0]=s,e[1]=o,e[2]=n.length,e[3]=a,e[4]=u):u=e[4],e[5]!==o||e[6]!==n.length||e[7]!==a?(h=[n.length,o,a],e[5]=o,e[6]=n.length,e[7]=a,e[8]=h):h=e[8];const{isPending:f,error:m}=In(u,h);if(f||l){let p;return e[9]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx(Q3,{message:"Loading tables...",className:"pl-12"}),e[9]=p):p=e[9],p}if(m){let p;return e[10]!==m?(p=c.jsx(ej,{error:m,className:"pl-12"}),e[10]=m,e[11]=p):p=e[11],p}if(n.length===0){let p;return e[12]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx(Mc,{content:"No tables found",className:"pl-9"}),e[12]=p):p=e[12],p}let x,g;if(e[13]!==r||e[14]!==o||e[15]!==n){let p;e[17]!==r?(p=v=>!r||v.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=v=>c.jsx(ZT,{table:v,sqlTableContext:o,isSearching:!!r},v.name),e[19]=r,e[20]=o,e[21]=y):y=e[21],x=b.map(y),e[13]=r,e[14]=o,e[15]=n,e[16]=x}else x=e[16];return e[22]!==x?(g=c.jsx(c.Fragment,{children:x}),e[22]=x,e[23]=g):g=e[23],g},ZT=t=>{const e=H.c(64),{table:n,sqlTableContext:o,isSearching:r}=t,{addTable:s}=Z3(),[a,i]=q.useState(!1),[l,d]=q.useState(!1),u=n.columns.length>0;let h,f;e[0]!==s||e[1]!==a||e[2]!==o||e[3]!==n.name||e[4]!==u||e[5]!==l?(h=async()=>{if(a&&!u&&o&&!l){d(!0);const{engine:W,database:J,schema:V}=o,Q=await WR.request({engine:W,database:J,schema:V,tableName:n.name});if(!(Q!=null&&Q.table))throw new Error("No table details available");s({table:Q.table,sqlTableContext:o})}},e[0]=s,e[1]=a,e[2]=o,e[3]=n.name,e[4]=u,e[5]=l,e[6]=h):h=e[6],e[7]!==a||e[8]!==u?(f=[a,u],e[7]=a,e[8]=u,e[9]=f):f=e[9];const{isFetching:m,isPending:x,error:g}=In(h,f),p=Se(Yl),b=ls(),{createNewCell:y}=it(),v=tj();let w;e[10]!==v||e[11]!==p||e[12]!==y||e[13]!==b||e[14]!==o||e[15]!==n?(w=()=>{Kn({autoInstantiate:p,createNewCell:y,fromCellId:b}),v((()=>{if(n.source_type==="catalog"){const W=o!=null&&o.database?`${o.database}.${n.name}`:n.name;return`${n.engine}.load_table("${W}")`}if(o)return rj({table:n,columnName:"*",sqlTableContext:o});switch(n.source_type){case"local":return`mo.ui.table(${n.name})`;case"duckdb":case"connection":return rj({table:n,columnName:"*",sqlTableContext:o});default:return nc(n.source_type),""}})())},e[10]=v,e[11]=p,e[12]=y,e[13]=b,e[14]=o,e[15]=n,e[16]=w):w=e[16];const S=w;let j;e[17]!==n.num_columns||e[18]!==n.num_rows?(j=()=>{const W=[];return n.num_rows!=null&&W.push(`${n.num_rows} rows`),n.num_columns!=null&&W.push(`${n.num_columns} columns`),W.length===0?null:c.jsx("div",{className:"flex flex-row gap-2 items-center pl-6 group-hover:hidden",children:c.jsx("span",{className:"text-xs text-muted-foreground",children:W.join(", ")})})},e[17]=n.num_columns,e[18]=n.num_rows,e[19]=j):j=e[19];const C=j;let _;e[20]!==g||e[21]!==m||e[22]!==x||e[23]!==o||e[24]!==n?(_=()=>{if(x||m)return c.jsx(Q3,{message:"Loading columns...",className:"pl-12"});if(g)return c.jsx(ej,{error:g,className:"pl-12"});const W=n.columns;return W.length===0?c.jsx(Mc,{content:"No columns found",className:"pl-12"}):W.map(J=>c.jsx(QT,{table:n,column:J,sqlTableContext:o},J.name))},e[20]=g,e[21]=m,e[22]=x,e[23]=o,e[24]=n,e[25]=_):_=e[25];const E=_;let M;e[26]!==a||e[27]!==r||e[28]!==n.source_type||e[29]!==n.type?(M=()=>{if(n.source_type==="local")return;const W=n.type==="table"?kP:Vf;return c.jsx(W,{className:"h-3 w-3",strokeWidth:a||r?2.5:void 0})},e[26]=a,e[27]=r,e[28]=n.source_type,e[29]=n.type,e[30]=M):M=e[30];const I=M,D=o?`${o.database}.${o.schema}.${n.name}`:n.name,F=o&&(nj(o.schema)?"pl-9":"pl-12"),O=(a||r)&&"font-semibold";let P,R,z,N,k,B,A,U,$,X,Y,G;return e[31]!==F||e[32]!==O?(P=xe("rounded-none group h-8 cursor-pointer",F,O),e[31]=F,e[32]=O,e[33]=P):P=e[33],e[34]!==a?(R=()=>i(!a),e[34]=a,e[35]=R):R=e[35],e[36]!==I?(z=I(),e[36]=I,e[37]=z):z=e[37],e[38]!==n.name?(N=c.jsx("span",{className:"text-sm",children:n.name}),e[38]=n.name,e[39]=N):N=e[39],e[40]!==z||e[41]!==N?(k=c.jsxs("div",{className:"flex gap-2 items-center flex-1",children:[z,N]}),e[40]=z,e[41]=N,e[42]=k):k=e[42],e[43]!==C?(B=C(),e[43]=C,e[44]=B):B=e[44],e[45]!==S?(A=Rn.stopPropagation(()=>S()),e[45]=S,e[46]=A):A=e[46],e[47]===Symbol.for("react.memo_cache_sentinel")?(U=c.jsx(jP,{className:"h-3 w-3"}),e[47]=U):U=e[47],e[48]!==A?($=c.jsx(Ne,{content:"Add table to notebook",delayDuration:400,children:c.jsx(ve,{className:"group-hover:inline-flex hidden",variant:"text",size:"icon",onClick:A,children:U})}),e[48]=A,e[49]=$):$=e[49],e[50]!==a||e[51]!==R||e[52]!==k||e[53]!==B||e[54]!==$||e[55]!==P||e[56]!==D?(X=c.jsxs(Xn,{className:P,value:D,"aria-selected":a,forceMount:!0,onSelect:R,children:[k,B,$]}),e[50]=a,e[51]=R,e[52]=k,e[53]=B,e[54]=$,e[55]=P,e[56]=D,e[57]=X):X=e[57],e[58]!==a||e[59]!==E?(Y=a&&E(),e[58]=a,e[59]=E,e[60]=Y):Y=e[60],e[61]!==X||e[62]!==Y?(G=c.jsxs(c.Fragment,{children:[X,Y]}),e[61]=X,e[62]=Y,e[63]=G):G=e[63],G},QT=t=>{var A,U;const e=H.c(51),{table:n,column:o,sqlTableContext:r}=t,[s,a]=q.useState(!1),i=Se(X3),l=jt(SP);let d,u;e[0]!==i?(d=()=>{i&&a(!1)},u=[i],e[0]=i,e[1]=d,e[2]=u):(d=e[1],u=e[2]),q.useEffect(d,u),l(s?$=>new Set([...$,`${n.name}:${o.name}`]):$=>($.delete(`${n.name}:${o.name}`),new Set($)));const h=tj(),{columnsPreviews:f}=CP();let m;e[3]!==o.name||e[4]!==n.primary_keys?(m=((A=n.primary_keys)==null?void 0:A.includes(o.name))||!1,e[3]=o.name,e[4]=n.primary_keys,e[5]=m):m=e[5];const x=m;let g;e[6]!==o.name||e[7]!==n.indexes?(g=((U=n.indexes)==null?void 0:U.includes(o.name))||!1,e[6]=o.name,e[7]=n.indexes,e[8]=g):g=e[8];const p=g;let b;e[9]!==h?(b=$=>{h($)},e[9]=h,e[10]=b):b=e[10];const y=b,v=e7,w=s?"font-semibold":"";let S;e[11]!==o.name||e[12]!==w?(S=c.jsx("span",{className:w,children:o.name}),e[11]=o.name,e[12]=w,e[13]=S):S=e[13];const j=S,C=`${n.name}.${o.name}`,_=`${n.name}.${o.name}`;let E;e[14]!==s?(E=()=>a(!s),e[14]=s,e[15]=E):E=e[15];const M=r?"pl-14":"pl-7";let I,D,F,O,P,R,z,N,k,B;return e[16]!==M?(I=xe("flex flex-row gap-2 items-center flex-1",M),e[16]=M,e[17]=I):I=e[17],e[18]!==o.type||e[19]!==j?(D=c.jsx(NP,{columnName:j,dataType:o.type}),e[18]=o.type,e[19]=j,e[20]=D):D=e[20],e[21]!==x?(F=x&&v({tooltipContent:"Primary key",content:"PK"}),e[21]=x,e[22]=F):F=e[22],e[23]!==p?(O=p&&v({tooltipContent:"Indexed",content:"IDX"}),e[23]=p,e[24]=O):O=e[24],e[25]!==I||e[26]!==D||e[27]!==F||e[28]!==O?(P=c.jsxs("div",{className:I,children:[D,F,O]}),e[25]=I,e[26]=D,e[27]=F,e[28]=O,e[29]=P):P=e[29],e[30]!==o.name?(R=c.jsx(Ne,{content:"Copy column name",delayDuration:400,children:c.jsx(ve,{variant:"text",size:"icon",className:"group-hover:opacity-100 opacity-0 hover:bg-muted text-muted-foreground hover:text-foreground",children:c.jsx(W3,{tooltip:!1,value:o.name,className:"h-3 w-3"})})}),e[30]=o.name,e[31]=R):R=e[31],e[32]!==o.external_type?(z=c.jsx("span",{className:"text-xs text-muted-foreground",children:o.external_type}),e[32]=o.external_type,e[33]=z):z=e[33],e[34]!==E||e[35]!==P||e[36]!==R||e[37]!==z||e[38]!==C||e[39]!==_?(N=c.jsxs(Xn,{className:"rounded-none py-1 group cursor-pointer",value:_,onSelect:E,children:[P,R,z]},C),e[34]=E,e[35]=P,e[36]=R,e[37]=z,e[38]=C,e[39]=_,e[40]=N):N=e[40],e[41]!==o||e[42]!==f||e[43]!==y||e[44]!==s||e[45]!==r||e[46]!==n?(k=s&&c.jsx("div",{className:"pl-10 pr-2 py-2 bg-(--slate-1) shadow-inner border-b",children:c.jsx(dc,{children:c.jsx(EP,{table:n,column:o,onAddColumnChart:y,preview:f.get(r?`${r.database}.${r.schema}.${n.name}:${o.name}`:`${n.name}:${o.name}`),sqlTableContext:r})})}),e[41]=o,e[42]=f,e[43]=y,e[44]=s,e[45]=r,e[46]=n,e[47]=k):k=e[47],e[48]!==N||e[49]!==k?(B=c.jsxs(c.Fragment,{children:[N,k]}),e[48]=N,e[49]=k,e[50]=B):B=e[50],B};function e7(t){const{tooltipContent:e,content:n}=t;return c.jsx(Ne,{content:e,delayDuration:100,children:c.jsx("span",{className:"text-xs text-black bg-gray-100 dark:invert rounded px-1",children:n})})}const t7=()=>{const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx(GT,{}),t[0]=e):e=t[0],e},n7=()=>{const t=H.c(5),{documentation:e}=Se(IP);if(!e){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=c.jsx(ln,{title:"View docs as you type",description:"Move your text cursor over a symbol to see its documentation.",icon:c.jsx(Jc,{})}),t[0]=r):r=t[0],r}let n,o;return t[1]!==e?(n=Am({html:e}),t[1]=e,t[2]=n):n=t[2],t[3]!==n?(o=c.jsx("div",{className:"p-3 overflow-y-auto overflow-x-hidden h-full docs-documentation flex flex-col gap-4",children:n}),t[3]=n,t[4]=o):o=t[4],o},o7=()=>{const t=H.c(5),e=AP();if(e.length===0){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=c.jsx(ln,{title:"No errors!",icon:c.jsx(bp,{})}),t[0]=r):r=t[0],r}let n,o;return t[1]!==e?(n=e.map(r7),t[1]=e,t[2]=n):n=t[2],t[3]!==n?(o=c.jsx("div",{className:"flex flex-col overflow-auto",children:n}),t[3]=n,t[4]=o):o=t[4],o};function r7(t){return c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-mono font-semibold bg-muted border-y px-2 py-1",children:c.jsx(TP,{cellId:t.cellId})}),c.jsx("div",{className:"px-2",children:c.jsx(MP,{errors:t.output.data,cellId:t.cellId},t.cellId)},t.cellId)]},t.cellId)}const Df=new Map,s7=({file:t,onOpenNotebook:e})=>{const{theme:n}=Ko(),{sendFileDetails:o,sendUpdateFile:r}=et(),s=Se(Ql),[a,i]=T.useState(""),{data:l,isPending:d,error:u,setData:h}=In(async()=>{const b=await o({path:t.path}),y=b.contents||"";return i(Df.get(t.path)||y),b},[t.path]),f=async()=>{a!==(l==null?void 0:l.contents)&&await r({path:t.path,contents:a}).then(b=>{b.success&&(h(y=>({...y,contents:a})),i(a))})},m=T.useRef(a);if(m.current=a,T.useEffect(()=>()=>{if(!(l!=null&&l.contents))return;const b=m.current;b===l.contents?Df.delete(t.path):Df.set(t.path,b)},[t.path,l==null?void 0:l.contents]),u)return c.jsx(xr,{error:u});if(d||!l)return null;const x=l.mimeType||"text/plain",g=x in Pf;if(!l.contents&&!g)return c.jsxs("div",{className:"grid grid-cols-2 gap-2 p-6",children:[c.jsx("div",{className:"font-bold text-muted-foreground",children:"Name"}),c.jsx("div",{children:l.file.name}),c.jsx("div",{className:"font-bold text-muted-foreground",children:"Type"}),c.jsx("div",{children:x})]});const p=c.jsxs("div",{className:"text-xs text-muted-foreground p-1 flex justify-end gap-2 border-b",children:[t.isMarimoFile&&!Zt()&&c.jsx(Ne,{content:"Open notebook",children:c.jsx(an,{size:"small",onClick:b=>e(b),children:c.jsx(ic,{})})}),c.jsx(Ne,{content:"Download",children:c.jsx(an,{size:"small",onClick:()=>{if(Vw(x)){const b=FP(l.contents,x);return void zP(b,l.file.name)}za(new Blob([l.contents||a],{type:x}),l.file.name)},children:c.jsx(nm,{})})}),!Vw(x)&&c.jsxs(c.Fragment,{children:[c.jsx(Ne,{content:"Copy contents to clipboard",children:c.jsx(an,{size:"small",onClick:async()=>{await on(a)},children:c.jsx(Na,{})})}),c.jsx(Ne,{content:Wt("global.save"),children:c.jsx(an,{size:"small",color:a===l.contents?void 0:"green",onClick:f,disabled:a===l.contents,children:c.jsx(hi,{})})})]})]});return x.startsWith("image/")?c.jsxs(c.Fragment,{children:[p,c.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:c.jsx(OP,{base64:l.contents,mime:x})})]}):x==="text/csv"&&l.contents?c.jsxs(c.Fragment,{children:[p,c.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:c.jsx(DP,{contents:l.contents})})]}):x.startsWith("audio/")?c.jsxs(c.Fragment,{children:[p,c.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:c.jsx(PP,{base64:l.contents,mime:x})})]}):x.startsWith("video/")?c.jsxs(c.Fragment,{children:[p,c.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:c.jsx(RP,{base64:l.contents,mime:x})})]}):x.startsWith("application/pdf")?c.jsxs(c.Fragment,{children:[p,c.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:c.jsx(LP,{base64:l.contents,mime:x})})]}):c.jsxs(c.Fragment,{children:[p,c.jsx("div",{className:"flex-1 overflow-auto",children:c.jsx(T.Suspense,{children:c.jsx(oi,{theme:n==="dark"?"dark":"light",language:Pf[x]||Pf.default,className:"border-b",extensions:[We.lineWrapping,An.of([{key:s.getHotkey("global.save").key,stopPropagation:!0,run:()=>a!==l.contents&&(f(),!0)}])],value:a,onChange:i})})})]})},Vw=t=>t.startsWith("image/")||t.startsWith("audio/")||t.startsWith("video/")||t.startsWith("application/pdf"),Pf={"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"};class a7{constructor(e){this.callbacks=e,this.delegate=new Lm([]),this.rootPath="",this.onChange=Ln.NOOP,this.path=new rc("/"),this.initialize=async n=>{if(this.onChange=n,this.delegate.data.length===0)try{const o=await this.callbacks.listFiles({path:this.rootPath});this.delegate=new Lm(o.files),this.rootPath=o.root,this.path=rc.guessDeliminator(o.root)}catch(o){Je({title:"Failed",description:v3(o)})}this.onChange(this.delegate.data)},this.refreshAll=async n=>{const o=[this.rootPath,...n.map(s=>{var a;return(a=this.delegate.find(s))==null?void 0:a.data.path})].filter(Boolean),r=await Promise.all(o.map(s=>this.callbacks.listFiles({path:s}).catch(()=>({files:[]}))));for(const[s,a]of o.entries()){const i=r[s];a===this.rootPath?this.delegate=new Lm(i.files):this.delegate.update({id:a,changes:{children:i.files}})}this.onChange(this.delegate.data)},this.relativeFromRoot=n=>{const o=this.rootPath.endsWith(this.path.deliminator)?this.rootPath:`${this.rootPath}${this.path.deliminator}`;return n.startsWith(o)?n.slice(o.length):n},this.handleResponse=n=>n.success?n:(Je({title:"Failed",description:n.message}),null)}async expand(e){const n=this.delegate.find(e);if(!n||!n.data.isDirectory)return!1;if(n.children&&n.children.length>0)return!0;const o=await this.callbacks.listFiles({path:n.data.path});return this.delegate.update({id:e,changes:{children:o.files}}),this.onChange(this.delegate.data),!0}async rename(e,n){const o=this.delegate.find(e);if(!o)return;const r=o.data.path,s=this.path.join(this.path.dirname(r),n);await this.callbacks.renameFileOrFolder({path:r,newPath:s}).then(this.handleResponse),this.delegate.update({id:e,changes:{name:n,path:s}}),this.onChange(this.delegate.data),await this.refreshAll([s])}async move(e,n){var r;const o=n?((r=this.delegate.find(n))==null?void 0:r.data.path)??n:this.rootPath;await Promise.all(e.map(s=>{this.delegate.move({id:s,parentId:n,index:0});const a=this.delegate.find(s);if(!a)return Promise.resolve();const i=this.path.join(o,this.path.basename(a.data.path));return this.delegate.update({id:s,changes:{path:i}}),this.callbacks.renameFileOrFolder({path:a.data.path,newPath:i}).then(this.handleResponse)})),this.onChange(this.delegate.data),await this.refreshAll([o])}async createFile(e,n){var s;const o=n?((s=this.delegate.find(n))==null?void 0:s.data.path)??n:this.rootPath,r=await this.callbacks.createFileOrFolder({path:o,type:"file",name:e}).then(this.handleResponse);r!=null&&r.info&&(this.delegate.create({parentId:n,index:0,data:r.info}),this.onChange(this.delegate.data),await this.refreshAll([o]))}async createFolder(e,n){var s;const o=n?((s=this.delegate.find(n))==null?void 0:s.data.path)??n:this.rootPath,r=await this.callbacks.createFileOrFolder({path:o,type:"directory",name:e}).then(this.handleResponse);r!=null&&r.info&&(this.delegate.create({parentId:n,index:0,data:r.info}),this.onChange(this.delegate.data),await this.refreshAll([o]))}async delete(e){const n=this.delegate.find(e);n&&(await this.callbacks.deleteFileOrFolder({path:n.data.path}).then(this.handleResponse),this.delegate.drop({id:e}),this.onChange(this.delegate.data))}}const Hw=yt(t=>{const e=t(BP);return Fn(e,"no requestClientAtom set"),new a7({listFiles:e.sendListFiles,createFileOrFolder:e.sendCreateFileOrFolder,deleteFileOrFolder:e.sendDeleteFileOrFolder,renameFileOrFolder:e.sendRenameFileOrFolder})}),i7=yt({});function l7(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 Ww(t){const e=H.c(7);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const o=n,{sendCreateFileOrFolder:r}=et();let s,a;return e[2]!==r?(s=async i=>{for(const l of i){const d=m7(f7(l));let u="";d&&(u=rc.guessDeliminator(d).dirname(d));const h=(await l7(l)).split(",")[1];await r({path:u,type:"file",name:l.name,contents:h})}await async function(){await Qe.get(Hw).refreshAll([])}()},e[2]=r,e[3]=s):s=e[3],e[4]!==o||e[5]!==s?(a={multiple:!0,maxSize:104857600,onError:h7,onDropRejected:c7,onDrop:s,...o},e[4]=o,e[5]=s,e[6]=a):a=e[6],UP(a)}function c7(t){Je({title:"File upload failed",description:c.jsx("div",{className:"flex flex-col gap-1",children:t.map(d7)}),variant:"danger"})}function d7(t){return c.jsxs("div",{children:[t.file.name," (",t.errors.map(u7).join(", "),")"]},t.file.name)}function u7(t){return t.message}function h7(t){ft.error(t),Je({title:"File upload failed",description:t.message,variant:"danger"})}function f7(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 m7(t){if(t)return t.replace(/^\/+/,"")}const qw=q.createContext(null),p7=t=>{const e=H.c(60),{height:n}=t,o=T.useRef(null),[r]=Ot(Hw);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[0]=s):s=e[0];const[a,i]=T.useState(s),[l,d]=T.useState(null),{openPrompt:u}=_n(),[h,f]=Ot(i7);let m,x;e[1]!==r?(m=()=>r.initialize(i),e[1]=r,e[2]=m):m=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(x=[],e[3]=x):x=e[3];const{isPending:g,error:p}=In(m,x);let b;e[4]!==h||e[5]!==r?(b=()=>{r.refreshAll(Object.keys(h).filter(k=>h[k]))},e[4]=h,e[5]=r,e[6]=b):b=e[6];const y=Le(b);let v;e[7]!==u||e[8]!==r?(v=async()=>{u({title:"Folder name",onConfirm:async k=>{r.createFolder(k,null)}})},e[7]=u,e[8]=r,e[9]=v):v=e[9];const w=Le(v);let S;e[10]!==u||e[11]!==r?(S=async()=>{u({title:"File name",onConfirm:async k=>{r.createFile(k,null)}})},e[10]=u,e[11]=r,e[12]=S):S=e[12];const j=Le(S);let C;e[13]!==f?(C=()=>{var k;(k=o.current)==null||k.closeAll(),f({})},e[13]=f,e[14]=C):C=e[14];const _=Le(C);if(g){let k;return e[15]===Symbol.for("react.memo_cache_sentinel")?(k=c.jsx(vn,{size:"medium",centered:!0}),e[15]=k):k=e[15],k}if(p){let k;return e[16]!==p?(k=c.jsx(xr,{error:p}),e[16]=p,e[17]=k):k=e[17],k}if(l){let k,B,A,U,$,X;return e[18]===Symbol.for("react.memo_cache_sentinel")?(k=()=>d(null),e[18]=k):k=e[18],e[19]===Symbol.for("react.memo_cache_sentinel")?(B=c.jsx(ve,{onClick:k,"data-testid":"file-explorer-back-button",variant:"text",size:"xs",className:"mb-0",children:c.jsx(wt,{size:16})}),e[19]=B):B=e[19],e[20]!==l.name?(A=c.jsxs("div",{className:"flex items-center pl-1 pr-3 shrink-0 border-b justify-between",children:[B,c.jsx("span",{className:"font-bold",children:l.name})]}),e[20]=l.name,e[21]=A):A=e[21],e[22]!==l.path||e[23]!==r?(U=Y=>Gw(Y,r.relativeFromRoot(l.path)),e[22]=l.path,e[23]=r,e[24]=U):U=e[24],e[25]!==l||e[26]!==U?($=c.jsx(T.Suspense,{children:c.jsx(s7,{onOpenNotebook:U,file:l})}),e[25]=l,e[26]=U,e[27]=$):$=e[27],e[28]!==A||e[29]!==$?(X=c.jsxs(c.Fragment,{children:[A,$]}),e[28]=A,e[29]=$,e[30]=X):X=e[30],X}let E;e[31]!==_||e[32]!==j||e[33]!==w||e[34]!==y||e[35]!==r?(E=c.jsx(x7,{onRefresh:y,onCreateFile:j,onCreateFolder:w,onCollapseAll:_,tree:r}),e[31]=_,e[32]=j,e[33]=w,e[34]=y,e[35]=r,e[36]=E):E=e[36];const M=n-33;let I,D,F,O,P,R,z,N;return e[37]!==r?(I=async k=>{const{ids:B}=k;for(const A of B)await r.delete(A)},D=async k=>{const{id:B,name:A}=k;await r.rename(B,A)},F=async k=>{const{dragIds:B,parentId:A}=k;await r.move(B,A)},e[37]=r,e[38]=I,e[39]=D,e[40]=F):(I=e[38],D=e[39],F=e[40]),e[41]===Symbol.for("react.memo_cache_sentinel")?(O=k=>{const B=k[0];B&&(B.data.isDirectory||d(B.data))},e[41]=O):O=e[41],e[42]!==h||e[43]!==f||e[44]!==r?(P=async k=>{if(await r.expand(k)){const B=h[k]??!1;f({...h,[k]:!B})}},e[42]=h,e[43]=f,e[44]=r,e[45]=P):P=e[45],e[46]!==a||e[47]!==h||e[48]!==I||e[49]!==D||e[50]!==F||e[51]!==P||e[52]!==M?(R=c.jsx(ER,{width:"100%",ref:o,height:M,className:"h-full",data:a,initialOpenState:h,openByDefault:!1,renderCursor:k7,disableDrop:j7,onDelete:I,onRename:D,onMove:F,onSelect:O,onToggle:P,padding:15,rowHeight:30,indent:g7,overscanCount:1e3,disableMultiSelection:!0,children:v7}),e[46]=a,e[47]=h,e[48]=I,e[49]=D,e[50]=F,e[51]=P,e[52]=M,e[53]=R):R=e[53],e[54]!==R||e[55]!==r?(z=c.jsx(qw,{value:r,children:R}),e[54]=R,e[55]=r,e[56]=z):z=e[56],e[57]!==z||e[58]!==E?(N=c.jsxs(c.Fragment,{children:[E,z]}),e[57]=z,e[58]=E,e[59]=N):N=e[59],N},g7=15,x7=t=>{const e=H.c(30),{onRefresh:n,onCreateFile:o,onCreateFolder:r,onCollapseAll:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={noDrag:!0,noDragEventsBubbling:!0},e[0]=a):a=e[0];const{getRootProps:i,getInputProps:l}=Ww(a);let d,u,h,f,m,x,g,p,b,y,v,w,S,j,C;return e[1]===Symbol.for("react.memo_cache_sentinel")?(d=c.jsx(di,{size:16}),e[1]=d):d=e[1],e[2]!==o?(u=c.jsx(Ne,{content:"Add file",children:c.jsx(ve,{"data-testid":"file-explorer-add-file-button",onClick:o,variant:"text",size:"xs",children:d})}),e[2]=o,e[3]=u):u=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(h=c.jsx(Vc,{size:16}),e[4]=h):h=e[4],e[5]!==r?(f=c.jsx(Ne,{content:"Add folder",children:c.jsx(ve,{"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]!==i?(m=i({}),e[7]=i,e[8]=m):m=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(x=$P({variant:"text",size:"xs"}),g=c.jsx(HP,{size:16}),e[9]=x,e[10]=g):(x=e[9],g=e[10]),e[11]!==m?(p=c.jsx(Ne,{content:"Upload file",children:c.jsx("button",{"data-testid":"file-explorer-upload-button",...m,className:x,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=c.jsx("input",{...b,type:"file"}),e[15]=b,e[16]=y):y=e[16],e[17]===Symbol.for("react.memo_cache_sentinel")?(v=c.jsx(A3,{size:16}),e[17]=v):v=e[17],e[18]!==n?(w=c.jsx(Ne,{content:"Refresh",children:c.jsx(ve,{"data-testid":"file-explorer-refresh-button",onClick:n,variant:"text",size:"xs",children:v})}),e[18]=n,e[19]=w):w=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(S=c.jsx(Xm,{size:16}),e[20]=S):S=e[20],e[21]!==s?(j=c.jsx(Ne,{content:"Collapse all folders",children:c.jsx(ve,{"data-testid":"file-explorer-collapse-button",onClick:s,variant:"text",size:"xs",children:S})}),e[21]=s,e[22]=j):j=e[22],e[23]!==y||e[24]!==w||e[25]!==j||e[26]!==u||e[27]!==f||e[28]!==p?(C=c.jsxs("div",{className:"flex items-center justify-end px-2 shrink-0 border-b",children:[u,f,p,y,w,j]}),e[23]=y,e[24]=w,e[25]=j,e[26]=u,e[27]=f,e[28]=p,e[29]=C):C=e[29],C},b7=t=>{const e=H.c(9),{node:n,onOpenMarimoFile:o}=t;let r,s,a;return e[0]!==n?(r=i=>{n.data.isDirectory||(i.stopPropagation(),n.select())},e[0]=n,e[1]=r):r=e[1],e[2]!==n.data.isMarimoFile||e[3]!==o?(s=n.data.isMarimoFile&&!Zt()&&c.jsxs("span",{className:"shrink-0 ml-2 text-sm hidden group-hover:inline hover:underline",onClick:o,children:["open ",c.jsx(ic,{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?(a=c.jsxs("span",{className:"flex-1 overflow-hidden text-ellipsis",onClick:r,children:[n.data.name,s]}),e[5]=n.data.name,e[6]=r,e[7]=s,e[8]=a):a=e[8],a},y7=t=>{const e=H.c(10),{node:n}=t,o=T.useRef(null);let r,s,a,i,l;return e[0]!==n.data.name?(r=()=>{var d,u;(d=o.current)==null||d.focus(),(u=o.current)==null||u.setSelectionRange(0,n.data.name.lastIndexOf("."))},s=[n.data.name],e[0]=n.data.name,e[1]=r,e[2]=s):(r=e[1],s=e[2]),T.useEffect(r,s),e[3]!==n?(a=()=>n.reset(),i=d=>{d.key==="Escape"&&n.reset(),d.key==="Enter"&&n.submit(d.currentTarget.value)},e[3]=n,e[4]=a,e[5]=i):(a=e[4],i=e[5]),e[6]!==n.data.name||e[7]!==a||e[8]!==i?(l=c.jsx("input",{ref:o,className:"flex-1 bg-transparent border border-border text-muted-foreground",defaultValue:n.data.name,onClick:S7,onBlur:a,onKeyDown:i}),e[6]=n.data.name,e[7]=a,e[8]=i,e[9]=l):l=e[9],l},v7=({node:t,style:e,dragHandle:n})=>{const{openFile:o,sendCreateFileOrFolder:r,sendFileDetails:s}=et(),a=t.data.isDirectory?"directory":qk(t.data.name),i=Gk[a],{openConfirm:l,openPrompt:d}=_n(),{createNewCell:u}=it(),h=ls(),f=T.use(qw),m=async y=>{Gw(y,f?f.relativeFromRoot(t.data.path):t.data.path)},x=async y=>{y.stopPropagation(),y.preventDefault(),l({title:"Delete file",description:`Are you sure you want to delete ${t.data.name}?`,confirmAction:c.jsx(Uk,{onClick:async()=>{await t.tree.delete(t.id)},"aria-label":"Confirm",children:"Delete"})})},g=Le(async()=>{t.open(),d({title:"Folder name",onConfirm:async y=>{f==null||f.createFolder(y,t.id)}})}),p=Le(async()=>{t.open(),d({title:"File name",onConfirm:async y=>{f==null||f.createFile(y,t.id)}})}),b=Le(async()=>{var S;if(!f||t.data.isDirectory)return;const[y,v]=VP(t.data.name),w=`${y}_copy${v}`;try{const j=await s({path:t.data.path}),C=((S=t.parent)==null?void 0:S.data.path)||"";await r({path:C,type:"file",name:w,contents:j.contents?btoa(j.contents):void 0}),await f.refreshAll([C])}catch{Je({title:"Failed to duplicate file",description:"Unable to create a duplicate of the file",variant:"danger"})}});return c.jsxs("div",{style:e,ref:n,className:xe("flex items-center cursor-pointer ml-1 text-muted-foreground whitespace-nowrap group"),draggable:!0,onClick:y=>{y.stopPropagation(),t.data.isDirectory&&t.toggle()},children:[c.jsx(w7,{node:t}),c.jsxs("span",{className:xe("flex items-center pl-1 py-1 cursor-pointer hover:bg-accent/50 hover:text-accent-foreground rounded-l flex-1 overflow-hidden group",t.willReceiveDrop&&t.data.isDirectory&&"bg-accent/80 hover:bg-accent/80 text-accent-foreground"),children:[t.data.isMarimoFile?c.jsx("img",{src:qR,className:"w-5 h-5 shrink-0 mr-2 filter grayscale",alt:"Marimo"}):c.jsx(i,{className:"w-5 h-5 shrink-0 mr-2",strokeWidth:1.5}),t.isEditing?c.jsx(y7,{node:t}):c.jsx(b7,{node:t,onOpenMarimoFile:m}),c.jsxs(So,{modal:!1,children:[c.jsx(Co,{asChild:!0,tabIndex:-1,onClick:y=>y.stopPropagation(),children:c.jsx(ve,{"data-testid":"file-explorer-more-button",variant:"text",tabIndex:-1,size:"xs",className:"mb-0","aria-label":"More options",children:c.jsx($c,{strokeWidth:2,className:"w-5 h-5 hidden group-hover:block"})})}),(()=>{const y={size:14,strokeWidth:1.5,className:"mr-2"};return c.jsxs(No,{align:"end",className:"no-print w-[220px]",onClick:v=>v.stopPropagation(),onCloseAutoFocus:v=>v.preventDefault(),children:[!t.data.isDirectory&&c.jsxs(It,{onSelect:()=>t.select(),children:[c.jsx(Op,{...y}),"Open file"]}),!t.data.isDirectory&&!Zt()&&c.jsxs(It,{onSelect:()=>{o({path:t.data.path})},children:[c.jsx(ic,{...y}),"Open file in external editor"]}),t.data.isDirectory&&c.jsxs(c.Fragment,{children:[c.jsxs(It,{onSelect:()=>p(),children:[c.jsx(di,{...y}),"Create file"]}),c.jsxs(It,{onSelect:()=>g(),children:[c.jsx(Vc,{...y}),"Create folder"]}),c.jsx(rn,{})]}),c.jsxs(It,{onSelect:()=>t.edit(),children:[c.jsx(yp,{...y}),"Rename"]}),!t.data.isDirectory&&c.jsxs(It,{onSelect:b,children:[c.jsx(Na,{...y}),"Duplicate"]}),c.jsxs(It,{onSelect:async()=>{await on(t.data.path),Je({title:"Copied to clipboard"})},children:[c.jsx(qc,{...y}),"Copy path"]}),f&&c.jsxs(It,{onSelect:async()=>{await on(f.relativeFromRoot(t.data.path)),Je({title:"Copied to clipboard"})},children:[c.jsx(qc,{...y}),"Copy relative path"]}),c.jsx(rn,{}),c.jsxs(It,{onSelect:()=>{const{path:v}=t.data;(w=>{u({code:w,before:!1,cellId:h??"__end__"})})(sj[a](v))},children:[c.jsx(wr,{...y}),"Insert snippet for reading file"]}),c.jsxs(It,{onSelect:async()=>{Je({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:v}=t.data,w=sj[a](v);await on(w)},children:[c.jsx(WP,{...y}),"Copy snippet for reading file"]}),t.data.isMarimoFile&&!Zt()&&c.jsxs(c.Fragment,{children:[c.jsx(rn,{}),c.jsxs(It,{onSelect:m,children:[c.jsx(_p,{...y}),"Open notebook"]})]}),c.jsx(rn,{}),!t.data.isDirectory&&c.jsxs(c.Fragment,{children:[c.jsxs(It,{onSelect:async()=>{const v=(await s({path:t.data.path})).contents||"";za(new Blob([v]),t.data.name)},children:[c.jsx(nm,{...y}),"Download"]}),c.jsx(rn,{})]}),c.jsxs(It,{onSelect:x,variant:"danger",children:[c.jsx(Zl,{...y}),"Delete"]})]})})()]})]})]})},w7=t=>{const e=H.c(3),{node:n}=t;if(!n.data.isDirectory){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=c.jsx("span",{className:"w-5 h-5 shrink-0"}),e[0]=r):r=e[0],r}let o;return e[1]!==n.isOpen?(o=n.isOpen?c.jsx(jo,{className:"w-5 h-5 shrink-0"}):c.jsx(Ta,{className:"w-5 h-5 shrink-0"}),e[1]=n.isOpen,e[2]=o):o=e[2],o};function Gw(t,e){t.stopPropagation(),t.preventDefault(),mj(e)}function k7(){return null}function j7(t){const{parentNode:e}=t;return!e.data.isDirectory}function S7(t){return t.stopPropagation()}let Yw,Kw,Xw;Yw=()=>{const t=H.c(20),{ref:e,height:n}=qP(),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:a,isDragActive:i}=Ww(r);let l,d,u,h,f,m,x,g;return t[1]!==s?(l=s(),t[1]=s,t[2]=l):l=t[2],t[3]===Symbol.for("react.memo_cache_sentinel")?(d=xe("flex flex-col flex-1 overflow-hidden relative"),t[3]=d):d=t[3],t[4]!==a?(u=a(),t[4]=a,t[5]=u):u=t[5],t[6]!==u?(h=c.jsx("input",{...u}),t[6]=u,t[7]=h):h=t[7],t[8]!==i?(f=i&&c.jsx("div",{className:"absolute inset-0 flex items-center uppercase justify-center text-xl font-bold text-primary/90 bg-accent/85 z-10 border-2 border-dashed border-primary/90 rounded-lg pointer-events-none",children:"Drop files here"}),t[8]=i,t[9]=f):f=t[9],t[10]!==o?(m=c.jsx(p7,{height:o}),t[10]=o,t[11]=m):m=t[11],t[12]!==e||t[13]!==m?(x=c.jsx("div",{ref:e,className:"flex flex-col flex-1 overflow-hidden",children:m}),t[12]=e,t[13]=m,t[14]=x):x=t[14],t[15]!==l||t[16]!==h||t[17]!==f||t[18]!==x?(g=c.jsxs("div",{...l,className:d,children:[h,f,x]}),t[15]=l,t[16]=h,t[17]=f,t[18]=x,t[19]=g):g=t[19],g},Hm=t=>{const e=H.c(6),n=t.dataTestId;let o,r;return e[0]!==t.className?(o=xe("text-xs font-semibold text-accent-foreground",t.className),e[0]=t.className,e[1]=o):o=e[1],e[2]!==t.dataTestId||e[3]!==t.onClick||e[4]!==o?(r=c.jsx("button",{type:"button","data-testid":n,className:o,onClick:t.onClick,children:"Clear"}),e[2]=t.dataTestId,e[3]=t.onClick,e[4]=o,e[5]=r):r=e[5],r},Kw=()=>{const t=H.c(9),e=GP(),{clearLogs:n}=it();if(e.length===0){let a,i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx("code",{className:"border rounded px-1",children:"stdout"}),t[0]=a):a=t[0],t[1]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(ln,{title:"No logs",description:c.jsxs("span",{children:[a," and"," ",c.jsx("code",{className:"border rounded px-1",children:"stderr"})," logs will appear here."]}),icon:c.jsx($f,{})}),t[1]=i):i=t[1],i}let o,r,s;return t[2]!==n?(o=c.jsx("div",{className:"flex flex-row justify-end px-2 py-1",children:c.jsx(Hm,{dataTestId:"clear-logs-button",onClick:n})}),t[2]=n,t[3]=o):o=t[3],t[4]!==e?(r=c.jsx("div",{className:"overflow-auto flex-1",children:c.jsx(Xw,{logs:e,className:"min-w-[300px]"})}),t[4]=e,t[5]=r):r=t[5],t[6]!==o||t[7]!==r?(s=c.jsxs(c.Fragment,{children:[o,r]}),t[6]=o,t[7]=r,t[8]=s):s=t[8],s},Xw=t=>{const e=H.c(10),{logs:n,className:o}=t;let r,s,a,i,l;return e[0]!==o?(r=xe("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?(a=n.map(E7),e[3]=n,e[4]=a):a=e[4],e[5]!==a?(i=c.jsx("pre",{className:"grid text-xs font-mono gap-1 whitespace-break-spaces font-semibold align-left",children:c.jsx("div",{className:"grid grid-cols-[30px_1fr]",style:s,children:a})}),e[5]=a,e[6]=i):i=e[6],e[7]!==r||e[8]!==i?(l=c.jsx("div",{className:r,children:i}),e[7]=r,e[8]=i,e[9]=l):l=e[9],l};function C7(t){const e=YP(t.timestamp),n=N7[t.level],o=t.level.toUpperCase();return c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"shrink-0 text-(--gray-10) dark:text-(--gray-11)",children:["[",e,"]"]}),c.jsx("span",{className:xe("shrink-0",n),children:o}),c.jsxs("span",{className:"shrink-0 text-(--gray-10)",children:["(",c.jsx(Io,{cellId:t.cellId}),")"]}),t.message]})}const N7={stdout:"text-(--grass-9)",stderr:"text-(--red-9)"};function E7(t,e){return c.jsxs("div",{className:"contents group",children:[c.jsx("span",{className:xe("opacity-70 group-hover:bg-(--gray-3) group-hover:opacity-100","text-right col-span-1 py-1 pr-1"),children:e+1}),c.jsx("span",{className:xe("opacity-70 group-hover:bg-(--gray-3) group-hover:opacity-100","px-2 flex gap-x-1.5 py-1 flex-wrap"),children:C7(t)})]},e)}const _7=()=>{const t=H.c(7),{items:e}=Se(KP);let n,o;t[0]!==e?(o=GR(e),t[0]=e,t[1]=o):o=t[1],n=o;const r=n,{activeHeaderId:s,activeOccurrences:a}=YR(r);if(e.length===0){let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(ln,{title:"No outline-solid",description:"Add markdown headings to your notebook to create an outline.",icon:c.jsx(Xc,{})}),t[2]=l):l=t[2],l}let i;return t[3]!==s||t[4]!==a||t[5]!==e?(i=c.jsx(KR,{items:e,activeHeaderId:s,activeOccurrences:a}),t[3]=s,t[4]=a,t[5]=e,t[6]=i):i=t[6],i},Jw=yt(null),Zw=t=>{const e=H.c(9),{onClick:n,loading:o,children:r,className:s}=t;if(o){let d;return e[0]===Symbol.for("react.memo_cache_sentinel")?(d=c.jsx(vn,{size:"small",className:"h-4 w-4 shrink-0 opacity-50"}),e[0]=d):d=e[0],d}let a,i,l;return e[1]!==s?(a=xe("px-2 h-full text-xs text-muted-foreground hover:text-foreground","invisible group-hover:visible",s),e[1]=s,e[2]=a):a=e[2],e[3]!==n?(i=Rn.stopPropagation(n),e[3]=n,e[4]=i):i=e[4],e[5]!==r||e[6]!==a||e[7]!==i?(l=c.jsx("button",{type:"button",className:a,onClick:i,children:r}),e[5]=r,e[6]=a,e[7]=i,e[8]=l):l=e[8],l},I7=()=>{var C,_;const t=H.c(30),[e]=fr(),n=e.package_management.manager,{getDependencyTree:o,getPackageList:r}=et(),[s,a]=q.useState(null);let i,l;t[0]!==o||t[1]!==r?(i=async()=>{const[E,M]=await Promise.all([r(),o()]);return{list:E.packages,tree:M.tree}},t[0]=o,t[1]=r,t[2]=i):i=t[2],t[3]!==n?(l=[n],t[3]=n,t[4]=l):l=t[4];const{data:d,error:u,refetch:h,isPending:f}=In(i,l);if(f){let E;return t[5]===Symbol.for("react.memo_cache_sentinel")?(E=c.jsx(vn,{size:"medium",centered:!0}),t[5]=E):E=t[5],E}if(u){let E;return t[6]!==u?(E=c.jsx(xr,{error:u}),t[6]=u,t[7]=E):E=t[7],E}const m=d.tree!=null;let x;t[8]!==m||t[9]!==s?(x=function(E,M){return E==="list"?"list":M?E||"tree":"list"}(s,m),t[8]=m,t[9]=s,t[10]=x):x=t[10];const g=x,p=(C=d.tree)==null?void 0:C.name,b=(_=d==null?void 0:d.tree)==null?void 0:_.version,y=p==="<root>";let v,w,S,j;return t[11]!==n||t[12]!==h?(v=c.jsx(A7,{packageManager:n,onSuccess:h}),t[11]=n,t[12]=h,t[13]=v):v=t[13],t[14]!==y||t[15]!==m||t[16]!==p||t[17]!==b||t[18]!==g?(w=m&&c.jsxs("div",{className:"flex items-center justify-between px-2 py-1 border-b",children:[c.jsxs("div",{className:"flex gap-1",children:[c.jsx("button",{type:"button",className:xe("px-2 py-1 text-xs rounded",g==="list"?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground"),onClick:()=>a("list"),children:"List"}),c.jsx("button",{type:"button",className:xe("px-2 py-1 text-xs rounded",g==="tree"?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground"),onClick:()=>a("tree"),children:"Tree"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"items-center border px-2 py-0.5 text-xs transition-colors focus:outline-hidden 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:y?"sandbox":"project",children:y?"sandbox":"project"}),p&&!y&&c.jsxs("span",{className:"text-xs text-muted-foreground",children:[p,b&&` v${b}`]})]})]}),t[14]=y,t[15]=m,t[16]=p,t[17]=b,t[18]=g,t[19]=w):w=t[19],t[20]!==d.list||t[21]!==d.tree||t[22]!==u||t[23]!==h||t[24]!==g?(S=g==="list"?c.jsx(T7,{packages:d.list,onSuccess:h}):c.jsx(M7,{tree:d.tree,error:u,onSuccess:h}),t[20]=d.list,t[21]=d.tree,t[22]=u,t[23]=h,t[24]=g,t[25]=S):S=t[25],t[26]!==v||t[27]!==w||t[28]!==S?(j=c.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[v,w,S]}),t[26]=v,t[27]=w,t[28]=S,t[29]=j):j=t[29],j},A7=t=>{const e=H.c(40),{onSuccess:n,packageManager:o}=t,[r,s]=q.useState(""),{handleClick:a}=si(),i=Se(Jw),l=jt(Jw);let d,u;e[0]!==i||e[1]!==l?(d=()=>{i&&(s(i),l(null))},u=[i,l],e[0]=i,e[1]=l,e[2]=d,e[3]=u):(d=e[2],u=e[3]),q.useEffect(d,u);const{loading:h,handleInstallPackages:f}=XP();let m;e[4]!==n?(m=()=>{n(),s("")},e[4]=n,e[5]=m):m=e[5];const x=m;let g;e[6]!==f||e[7]!==r||e[8]!==x?(g=()=>{f(r.split(",").map(O7),x)},e[6]=f,e[7]=r,e[8]=x,e[9]=g):g=e[9];const p=g,b=`Install packages with ${o}...`;let y,v,w,S,j,C,_,E,M,I,D,F,O,P;e[10]!==h||e[11]!==a?(y=h?c.jsx(vn,{size:"small",className:"mr-2 h-4 w-4 shrink-0 opacity-50"}):c.jsx(Ne,{content:"Change package manager",children:c.jsx(ws,{onClick:()=>a("packageManagement"),className:"mr-2 h-4 w-4 shrink-0 opacity-50 hover:opacity-80 cursor-pointer"})}),e[10]=h,e[11]=a,e[12]=y):y=e[12],e[13]!==p?(v=A=>{A.key==="Enter"&&(A.preventDefault(),p())},e[13]=p,e[14]=v):v=e[14],e[15]===Symbol.for("react.memo_cache_sentinel")?(w=A=>s(A.target.value),e[15]=w):w=e[15],e[16]!==r||e[17]!==b||e[18]!==y||e[19]!==v?(S=c.jsx(aj,{placeholder:b,id:p1,icon:y,rootClassName:"flex-1 border-none",value:r,onKeyDown:v,onChange:w}),e[16]=r,e[17]=b,e[18]=y,e[19]=v,e[20]=S):S=e[20],e[21]===Symbol.for("react.memo_cache_sentinel")?(j=c.jsx("span",{className:"font-bold tracking-wide",children:"Package name:"}),e[21]=j):j=e[21],e[22]===Symbol.for("react.memo_cache_sentinel")?(C=c.jsxs("div",{children:[j," A package name; this will install the latest version.",c.jsx("div",{className:"text-muted-foreground",children:"Example: httpx"})]}),_=c.jsx("span",{className:"font-bold tracking-wide",children:"Package and version:"}),e[22]=C,e[23]=_):(C=e[22],_=e[23]),e[24]===Symbol.for("react.memo_cache_sentinel")?(E=c.jsxs("div",{children:[_," ","A package with a specific version or version range.",c.jsx("div",{className:"text-muted-foreground",children:"Examples: httpx==0.27.0, httpx>=0.27.0"})]}),M=c.jsx("span",{className:"font-bold tracking-wide",children:"Git:"}),e[24]=E,e[25]=M):(E=e[24],M=e[25]),e[26]===Symbol.for("react.memo_cache_sentinel")?(I=c.jsxs("div",{children:[M," A Git repository",c.jsx("div",{className:"text-muted-foreground",children:"Example: git+https://github.com/encode/httpx"})]}),D=c.jsx("span",{className:"font-bold tracking-wide",children:"URL:"}),e[26]=I,e[27]=D):(I=e[26],D=e[27]),e[28]===Symbol.for("react.memo_cache_sentinel")?(F=c.jsxs("div",{children:[D," A remote wheel or source distribution.",c.jsx("div",{className:"text-muted-foreground",children:"Example: https://example.com/httpx-0.27.0.tar.gz"})]}),O=c.jsx("span",{className:"font-bold tracking-wide",children:"Path:"}),e[28]=F,e[29]=O):(F=e[28],O=e[29]),e[30]===Symbol.for("react.memo_cache_sentinel")?(P=c.jsx(Ne,{delayDuration:300,side:"left",align:"start",content:c.jsxs("div",{className:"text-sm flex flex-col w-full max-w-[360px]",children:["Packages are installed using the package manager specified in your user configuration. Depending on your package manager, you can install packages with various formats:",c.jsxs("div",{className:"flex flex-col gap-2 mt-2",children:[C,E,I,F,c.jsxs("div",{children:[O," A local wheel, source distribution, or project directory.",c.jsx("div",{className:"text-muted-foreground",children:"Example: /example/foo-0.1.0-py3-none-any.whl"})]})]})]}),children:c.jsx(Nm,{className:"h-4 w-4 cursor-help text-muted-foreground hover:text-foreground bg-transparent"})}),e[30]=P):P=e[30];const R=r&&"bg-accent text-accent-foreground";let z;e[31]!==R?(z=xe("float-right px-2 m-0 h-full text-sm text-secondary-foreground ml-2",R,"disabled:cursor-not-allowed disabled:opacity-50"),e[31]=R,e[32]=z):z=e[32];const N=!r;let k,B;return e[33]!==p||e[34]!==z||e[35]!==N?(k=c.jsx("button",{type:"button",className:z,onClick:p,disabled:N,children:"Add"}),e[33]=p,e[34]=z,e[35]=N,e[36]=k):k=e[36],e[37]!==k||e[38]!==S?(B=c.jsxs("div",{className:"flex items-center w-full border-b",children:[S,P,k]}),e[37]=k,e[38]=S,e[39]=B):B=e[39],B},T7=t=>{const e=H.c(9),{onSuccess:n,packages:o}=t;if(o.length===0){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(ln,{title:"No packages",description:"No packages are installed in this environment.",icon:c.jsx(ws,{})}),e[0]=i):i=e[0],i}let r,s,a;if(e[1]===Symbol.for("react.memo_cache_sentinel")?(r=c.jsx(Om,{children:c.jsxs(vs,{children:[c.jsx(br,{children:"Name"}),c.jsx(br,{children:"Version"}),c.jsx(br,{})]})}),e[1]=r):r=e[1],e[2]!==n||e[3]!==o){let i;e[5]!==n?(i=l=>c.jsxs(vs,{className:"group",onClick:async()=>{await on(`${l.name}==${l.version}`),Je({title:"Copied to clipboard"})},children:[c.jsx(yr,{children:l.name}),c.jsx(yr,{children:l.version}),c.jsxs(yr,{className:"flex justify-end",children:[c.jsx(Qw,{packageName:l.name,onSuccess:n}),c.jsx(ek,{packageName:l.name,onSuccess:n})]})]},l.name),e[5]=n,e[6]=i):i=e[6],s=o.map(i),e[2]=n,e[3]=o,e[4]=s}else s=e[4];return e[7]!==s?(a=c.jsxs(Dm,{className:"overflow-auto flex-1",children:[r,c.jsx(Pm,{children:s})]}),e[7]=s,e[8]=a):a=e[8],a},Qw=({packageName:t,onSuccess:e})=>{const[n,o]=q.useState(!1),{addPackage:r}=et();return Zt()?null:c.jsx(Zw,{onClick:async()=>{try{o(!0);const s=await r({package:t,upgrade:!0});s.success?(e(),ij(t)):ij(t,s.error)}finally{o(!1)}},loading:n,children:"Upgrade"})},ek=({packageName:t,onSuccess:e})=>{const[n,o]=q.useState(!1),{removePackage:r}=et();return c.jsx(Zw,{onClick:async()=>{try{o(!0);const s=await r({package:t});s.success?(e(),lj(t)):lj(t,s.error)}finally{o(!1)}},loading:n,children:"Remove"})},M7=t=>{const e=H.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[a,i]=q.useState(s);let l,d,u;if(e[1]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{i(new Set)},e[1]=l):l=e[1],e[2]!==n?(d=[n],e[2]=n,e[3]=d):d=e[3],q.useEffect(l,d),o){let x;return e[4]!==o?(x=c.jsx(xr,{error:o}),e[4]=o,e[5]=x):x=e[5],x}if(!n){let x;return e[6]===Symbol.for("react.memo_cache_sentinel")?(x=c.jsx(vn,{size:"medium",centered:!0}),e[6]=x):x=e[6],x}if(n.dependencies.length===0){let x;return e[7]===Symbol.for("react.memo_cache_sentinel")?(x=c.jsx(ln,{title:"No dependencies",description:"No package dependencies found in this environment.",icon:c.jsx(ws,{})}),e[7]=x):x=e[7],x}e[8]===Symbol.for("react.memo_cache_sentinel")?(u=x=>{i(g=>{const p=new Set(g);return p.has(x)?p.delete(x):p.add(x),p})},e[8]=u):u=e[8];const h=u;let f,m;if(e[9]!==a||e[10]!==r||e[11]!==n.dependencies){let x;e[13]!==a||e[14]!==r?(x=(g,p)=>c.jsx("div",{className:"border-b",children:c.jsx(tk,{nodeId:`root-${p}`,node:g,level:0,isTopLevel:!0,expandedNodes:a,onToggle:h,onSuccess:r})},`${g.name}-${p}`),e[13]=a,e[14]=r,e[15]=x):x=e[15],f=n.dependencies.map(x),e[9]=a,e[10]=r,e[11]=n.dependencies,e[12]=f}else f=e[12];return e[16]!==f?(m=c.jsx("div",{className:"flex-1 overflow-auto",children:c.jsx("div",{children:f})}),e[16]=f,e[17]=m):m=e[17],m},tk=t=>{const e=H.c(57),{nodeId:n,node:o,level:r,isTopLevel:s,expandedNodes:a,onToggle:i,onSuccess:l}=t,d=s!==void 0&&s,u=o.dependencies.length>0;let h;e[0]!==a||e[1]!==n?(h=a.has(n),e[0]=a,e[1]=n,e[2]=h):h=e[2];const f=h,m=d?0:16+16*r;let x;e[3]!==u||e[4]!==n||e[5]!==i?(x=z=>{z.key!=="Enter"&&z.key!==" "||(z.preventDefault(),u&&i(n))},e[3]=u,e[4]=n,e[5]=i,e[6]=x):x=e[6];const g=x;let p;e[7]!==u||e[8]!==n||e[9]!==i?(p=z=>{z.stopPropagation(),u&&i(n)},e[7]=u,e[8]=n,e[9]=i,e[10]=p):p=e[10];const b=p,y=u&&"select-none",v=d?"px-2 py-0.5":"";let w,S;e[11]!==y||e[12]!==v?(w=xe("flex items-center group cursor-pointer text-sm whitespace-nowrap","hover:bg-(--slate-2) focus:bg-(--slate-2) focus:outline-hidden",y,v),e[11]=y,e[12]=v,e[13]=w):w=e[13],e[14]!==m||e[15]!==d?(S=d?{}:{paddingLeft:`${m}px`},e[14]=m,e[15]=d,e[16]=S):S=e[16];const j=u?f:void 0;let C,_,E,M,I,D,F,O,P,R;return e[17]!==u||e[18]!==f?(C=u?f?c.jsx(jo,{className:"w-4 h-4 mr-2 shrink-0"}):c.jsx(Ta,{className:"w-4 h-4 mr-2 shrink-0"}):c.jsx("div",{className:"w-4 mr-2 shrink-0"}),e[17]=u,e[18]=f,e[19]=C):C=e[19],e[20]!==o.name?(_=c.jsx("span",{className:"font-medium truncate",children:o.name}),e[20]=o.name,e[21]=_):_=e[21],e[22]!==o.version?(E=o.version&&c.jsxs("span",{className:"text-muted-foreground text-xs",children:["v",o.version]}),e[22]=o.version,e[23]=E):E=e[23],e[24]!==_||e[25]!==E?(M=c.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0 py-1.5",children:[_,E]}),e[24]=_,e[25]=E,e[26]=M):M=e[26],e[27]!==o.tags?(I=o.tags.map(D7),e[27]=o.tags,e[28]=I):I=e[28],e[29]!==I?(D=c.jsx("div",{className:"flex items-center gap-1 ml-2",children:I}),e[29]=I,e[30]=D):D=e[30],e[31]!==d||e[32]!==o.name||e[33]!==l?(F=d&&c.jsxs("div",{className:"flex gap-1 invisible group-hover:visible",children:[c.jsx(Qw,{packageName:o.name,onSuccess:l}),c.jsx(ek,{packageName:o.name,onSuccess:l})]}),e[31]=d,e[32]=o.name,e[33]=l,e[34]=F):F=e[34],e[35]!==b||e[36]!==g||e[37]!==C||e[38]!==M||e[39]!==D||e[40]!==F||e[41]!==w||e[42]!==S||e[43]!==j?(O=c.jsxs("div",{className:w,style:S,onClick:b,onKeyDown:g,tabIndex:0,role:"treeitem","aria-selected":!1,"aria-expanded":j,children:[C,M,D,F]}),e[35]=b,e[36]=g,e[37]=C,e[38]=M,e[39]=D,e[40]=F,e[41]=w,e[42]=S,e[43]=j,e[44]=O):O=e[44],e[45]!==a||e[46]!==u||e[47]!==f||e[48]!==r||e[49]!==o.dependencies||e[50]!==n||e[51]!==l||e[52]!==i?(P=u&&f&&c.jsx("div",{role:"group",children:o.dependencies.map((z,N)=>c.jsx(tk,{nodeId:`${n}-${N}`,node:z,level:r+1,isTopLevel:!1,expandedNodes:a,onToggle:i,onSuccess:l},`${z.name}-${N}`))}),e[45]=a,e[46]=u,e[47]=f,e[48]=r,e[49]=o.dependencies,e[50]=n,e[51]=l,e[52]=i,e[53]=P):P=e[53],e[54]!==O||e[55]!==P?(R=c.jsxs("div",{children:[O,P]}),e[54]=O,e[55]=P,e[56]=R):R=e[56],R};function O7(t){return t.trim()}function D7(t,e){return t.kind==="cycle"?c.jsx("div",{className:"items-center border px-2 py-0.5 text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium border-orange-300 dark:border-orange-700 text-orange-700 dark:text-orange-300",title:"cycle",children:"cycle"},e):t.kind==="extra"?c.jsx("div",{className:"items-center border px-2 py-0.5 text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium border-blue-300 dark:border-blue-700 text-blue-700 dark:text-blue-300",title:t.value,children:t.value},e):t.kind==="group"?c.jsx("div",{className:"items-center border px-2 py-0.5 text-xs transition-colors focus:outline-hidden 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 Rf=kk("marimo:scratchpadHistory:v1",[]),P7=yt(!1),R7=yt(null,(t,e,n)=>{if(!(n=n.trim()))return;const o=t(Rf),r=[n,...o.filter(s=>s!==n)].slice(0,15);e(Rf,r)}),L7={hide_code:!1,disabled:!1},F7=()=>{const t=H.c(71),e=cm(),[n]=fr(),{theme:o}=Ko(),r=T.useRef(null),s=ls(),{createNewCell:a,updateCellCode:i}=it(),{sendRunScratchpad:l}=et(),d=e.cellRuntime[Xo],u=d==null?void 0:d.output,h=d==null?void 0:d.status,f=d==null?void 0:d.consoleOutputs,m=e.cellData[Xo],x=(m==null?void 0:m.code)??"",g=jt(R7),[p,b]=Ot(P7),y=Se(Rf);let v;t[0]!==g||t[1]!==x||t[2]!==l?(v=()=>{l({code:x}),g(x)},t[0]=g,t[1]=x,t[2]=l,t[3]=v):v=t[3];const w=Le(v);let S;t[4]!==x||t[5]!==a||t[6]!==s?(S=()=>{x.trim()&&a({code:x,before:!1,cellId:s??"__end__"})},t[4]=x,t[5]=a,t[6]=s,t[7]=S):S=t[7];const j=Le(S);let C;t[8]!==l||t[9]!==i?(C=()=>{i({cellId:Xo,code:"",formattingChange:!1}),l({code:""});const ue=r.current;ue&&ue.dispatch({changes:{from:0,to:ue.state.doc.length,insert:""}})},t[8]=l,t[9]=i,t[10]=C):C=t[10];const _=Le(C);let E;t[11]!==b||t[12]!==i?(E=ue=>{b(!1),i({cellId:Xo,code:ue,formattingChange:!1});const de=r.current;de&&de.dispatch({changes:{from:0,to:de.state.doc.length,insert:ue}})},t[11]=b,t[12]=i,t[13]=E):E=t[13];const M=Le(E),[I,D]=T.useState();let F;t[14]!==x||t[15]!==f||t[16]!==w||t[17]!==I||t[18]!==u||t[19]!==o||t[20]!==n?(F=()=>c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"overflow-auto shrink-0 max-h-[40%]",children:c.jsx(Cu,{theme:o,showPlaceholder:!1,id:Xo,code:x,config:L7,status:"idle",serializedEditorState:null,runCell:w,userConfig:n,editorViewRef:r,setEditorView:ue=>{r.current=ue},hidden:!1,showHiddenCode:Ln.NOOP,languageAdapter:I,setLanguageAdapter:D})}),c.jsx("div",{className:"flex-1 overflow-auto shrink-0",children:c.jsx(Ic,{allowExpand:!1,output:u,className:"output-area",cellId:Xo,stale:!1,loading:!1})}),c.jsx("div",{className:"overflow-auto shrink-0 max-h-[35%]",children:c.jsx(Bm,{consoleOutputs:f,className:"overflow-auto",stale:!1,cellName:jk,onSubmitDebugger:Ln.NOOP,cellId:Xo,debuggerActive:!1})})]}),t[14]=x,t[15]=f,t[16]=w,t[17]=I,t[18]=u,t[19]=o,t[20]=n,t[21]=F):F=t[21];const O=F;let P;t[22]!==M||t[23]!==y||t[24]!==p||t[25]!==o?(P=()=>p?c.jsx("div",{className:"absolute inset-0 z-100 bg-background p-3 border-none overflow-auto",children:c.jsx("div",{className:"overflow-auto flex flex-col gap-3",children:y.map((ue,de)=>c.jsx("div",{className:"border rounded-md hover:shadow-sm cursor-pointer hover:border-input overflow-hidden",onClick:()=>M(ue),children:c.jsx(T.Suspense,{children:c.jsx(oi,{language:"python",theme:o,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1},value:ue.trim(),editable:!1,readOnly:!0})})},de))})}):null,t[22]=M,t[23]=y,t[24]=p,t[25]=o,t[26]=P):P=t[26];const R=P;let z,N,k,B,A,U,$,X,Y,G,W;t[27]===Symbol.for("react.memo_cache_sentinel")?(z=Ea.create(Xo),N=c.jsx("p",{className:"mx-2 my-2 text-muted-foreground text-sm",children:"Use this scratchpad cell to experiment with code without restrictions on variable names. Scratchpad code is ephemeral: variables defined in the scratchpad aren't saved to notebook memory, and the code is not saved in the notebook file."}),t[27]=z,t[28]=N):(z=t[27],N=t[28]),t[29]===Symbol.for("react.memo_cache_sentinel")?(k=Wt("cell.run"),t[29]=k):k=t[29],t[30]===Symbol.for("react.memo_cache_sentinel")?(B=c.jsx(vr,{color:"var(--grass-11)",size:16}),t[30]=B):B=t[30],t[31]!==w||t[32]!==p?(A=c.jsx(Ne,{content:k,children:c.jsx(ve,{"data-testid":"scratchpad-run-button",onClick:w,disabled:p,variant:"text",size:"xs",children:B})}),t[31]=w,t[32]=p,t[33]=A):A=t[33],t[34]===Symbol.for("react.memo_cache_sentinel")?(U=c.jsx(Zm,{size:16}),t[34]=U):U=t[34],t[35]!==_||t[36]!==p?($=c.jsx(Ne,{content:"Clear code and outputs",children:c.jsx(ve,{disabled:p,size:"xs",variant:"text",onClick:_,children:U})}),t[35]=_,t[36]=p,t[37]=$):$=t[37],t[38]===Symbol.for("react.memo_cache_sentinel")?(X=c.jsx(wr,{size:16}),t[38]=X):X=t[38],t[39]!==j||t[40]!==p?(Y=c.jsx(Ts,{children:c.jsx(Ne,{content:"Insert code",children:c.jsx(ve,{disabled:p,size:"xs",variant:"text",onClick:j,children:X})})}),t[39]=j,t[40]=p,t[41]=Y):Y=t[41],t[42]!==h?(G=(h==="running"||h==="queued")&&c.jsx(vn,{className:"inline",size:"small"}),t[42]=h,t[43]=G):G=t[43],t[44]===Symbol.for("react.memo_cache_sentinel")?(W=c.jsx("div",{className:"flex-1"}),t[44]=W):W=t[44];const J=p&&"bg-(--sky-3) rounded-none";let V,Q;t[45]!==J?(V=xe(J),t[45]=J,t[46]=V):V=t[46],t[47]!==p||t[48]!==b?(Q=()=>b(!p),t[47]=p,t[48]=b,t[49]=Q):Q=t[49];const te=y.length===0;let re,ne,ae,se,ie,ge,oe;return t[50]===Symbol.for("react.memo_cache_sentinel")?(re=c.jsx(sp,{size:16}),t[50]=re):re=t[50],t[51]!==V||t[52]!==Q||t[53]!==te?(ne=c.jsx(Ne,{content:"Toggle history",children:c.jsx(ve,{size:"xs",variant:"text",className:V,onClick:Q,disabled:te,children:re})}),t[51]=V,t[52]=Q,t[53]=te,t[54]=ne):ne=t[54],t[55]!==A||t[56]!==$||t[57]!==Y||t[58]!==G||t[59]!==ne?(ae=c.jsxs("div",{className:"flex items-center shrink-0",children:[A,$,Y,G,W,ne]}),t[55]=A,t[56]=$,t[57]=Y,t[58]=G,t[59]=ne,t[60]=ae):ae=t[60],t[61]!==O?(se=O(),t[61]=O,t[62]=se):se=t[62],t[63]!==R?(ie=R(),t[63]=R,t[64]=ie):ie=t[64],t[65]!==se||t[66]!==ie?(ge=c.jsxs("div",{className:"flex-1 divide-y relative overflow-hidden flex flex-col",children:[se,ie]}),t[65]=se,t[66]=ie,t[67]=ge):ge=t[67],t[68]!==ae||t[69]!==ge?(oe=c.jsxs("div",{className:"flex flex-col h-full overflow-hidden divide-y",id:z,children:[N,ae,ge]}),t[68]=ae,t[69]=ge,t[70]=oe):oe=t[70],oe},z7=()=>{const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx(F7,{}),t[0]=e):e=t[0],e},B7=()=>{const t=H.c(23),{openModal:e,closeModal:n}=_n();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],t[0]=o):o=t[0];const{data:r,isPending:s,error:a,refetch:i}=In($7,o);if(s){let b;return t[1]===Symbol.for("react.memo_cache_sentinel")?(b=c.jsx(vn,{size:"medium",centered:!0}),t[1]=b):b=t[1],b}if(a){let b;return t[2]!==a?(b=c.jsx(xr,{error:a}),t[2]=a,t[3]=b):b=t[3],b}let l;t[4]!==r?(l=r.filter(V7).map(H7),t[4]=r,t[5]=l):l=t[5];const d=l;if(r.length===0){let b;return t[6]===Symbol.for("react.memo_cache_sentinel")?(b=c.jsx(ln,{title:"No environment variables",description:"No environment variables are available in this notebook.",icon:c.jsx(Hc,{})}),t[6]=b):b=t[6],b}let u,h,f,m,x,g,p;return t[7]!==n||t[8]!==e||t[9]!==d||t[10]!==i?(u=()=>e(c.jsx(ig,{providerNames:d,onSuccess:()=>{i(),n()},onClose:n})),t[7]=n,t[8]=e,t[9]=d,t[10]=i,t[11]=u):u=t[11],t[12]===Symbol.for("react.memo_cache_sentinel")?(h=c.jsx(Yo,{className:"h-4 w-4"}),t[12]=h):h=t[12],t[13]!==u?(f=c.jsx("div",{className:"flex justify-end h-8 border-b",children:c.jsx("button",{type:"button",className:"float-right border-l px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",onClick:u,children:h})}),t[13]=u,t[14]=f):f=t[14],t[15]===Symbol.for("react.memo_cache_sentinel")?(m=c.jsx(Om,{children:c.jsxs(vs,{children:[c.jsx(br,{children:"Environment Variable"}),c.jsx(br,{children:"Source"}),c.jsx(br,{})]})}),t[15]=m):m=t[15],t[16]!==r?(x=r.map(W7),t[16]=r,t[17]=x):x=t[17],t[18]!==x?(g=c.jsxs(Dm,{className:"overflow-auto flex-1 mb-16",children:[m,c.jsx(Pm,{children:x})]}),t[18]=x,t[19]=g):g=t[19],t[20]!==f||t[21]!==g?(p=c.jsxs("div",{className:"flex flex-col h-full",children:[f,g]}),t[20]=f,t[21]=g,t[22]=p):p=t[22],p},U7=t=>{const e=H.c(9),{className:n,ariaLabel:o,onCopy:r}=t,[s,a]=q.useState(!1);let i;e[0]!==r?(i=()=>{r(),a(!0),setTimeout(()=>a(!1),1e3)},e[0]=r,e[1]=i):i=e[1];const l=i;let d,u;return e[2]!==s?(d=s?c.jsx(ac,{className:"w-3 h-3 text-green-700 rounded"}):c.jsx(Na,{className:"w-3 h-3 hover:bg-muted rounded"}),e[2]=s,e[3]=d):d=e[3],e[4]!==o||e[5]!==n||e[6]!==l||e[7]!==d?(u=c.jsx("button",{type:"button",className:n,onClick:l,"aria-label":o,children:d}),e[4]=o,e[5]=n,e[6]=l,e[7]=d,e[8]=u):u=e[8],u};async function $7(){return ag((await wj.request({})).secrets)}function V7(t){return t.provider!=="env"}function H7(t){return t.name}function W7(t){return t.keys.map(e=>c.jsxs(vs,{className:"group",children:[c.jsx(yr,{children:e}),c.jsx(yr,{children:t.provider!=="env"&&c.jsx(G3,{variant:"outline",className:"select-none",children:t.name})}),c.jsx(yr,{children:c.jsx(U7,{ariaLabel:`Copy ${e}`,onCopy:async()=>{await on(`os.environ["${e}"]`),Je({title:"Copied to clipboard",description:`os.environ["${e}"] has been copied to your clipboard.`})},className:xe("float-right px-2 h-full text-xs text-muted-foreground hover:text-foreground","invisible group-hover:visible")})})]},`${t.name}-${e}`))}const q7=t=>{const e=H.c(6),{children:n}=t,{openModal:o,closeModal:r}=_n();let s,a;return e[0]!==r||e[1]!==o?(s=()=>o(c.jsx(Y7,{onClose:r})),e[0]=r,e[1]=o,e[2]=s):s=e[2],e[3]!==n||e[4]!==s?(a=c.jsx(z3,{onClick:s,children:n}),e[3]=n,e[4]=s,e[5]=a):a=e[5],a},G7=[We.lineWrapping],Y7=t=>{const e=H.c(23),{onClose:n}=t,[o,r]=T.useState(""),{theme:s}=Ko();let a,i,l,d,u,h;e[0]!==n?(a=async v=>{v.preventDefault();const w=new FormData(v.target),S=w.get("title"),j=w.get("description"),C=w.get("code");fetch("https://marimo.io/api/suggest-snippet",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:S,description:j,code:C})}),n(),Je({title:"Snippet Submitted",description:"Thank you for contributing! We will review your snippet shortly."})},e[0]=n,e[1]=a):a=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx($o,{children:"Contribute a Snippet"}),e[2]=i):i=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsxs(os,{children:[i,c.jsxs(rs,{children:["Have a useful snippet you want to share with the community? Submit it here or make a pull request"," ",c.jsx("a",{href:Pn.githubPage,target:"_blank",className:"underline",children:"on GitHub"}),"."]})]}),e[3]=l):l=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(d=c.jsx(Vo,{id:"title",name:"title",autoFocus:!0,placeholder:"Title",required:!0,autoComplete:"off"}),u=c.jsx(JP,{id:"description",name:"description",autoFocus:!0,placeholder:"Description",rows:5,required:!0,autoComplete:"off"}),e[4]=d,e[5]=u):(d=e[4],u=e[5]),e[6]!==o?(h=c.jsx("input",{type:"hidden",name:"code",value:o}),e[6]=o,e[7]=h):h=e[7];const f=s==="dark"?"dark":"light";let m,x,g,p,b,y;return e[8]!==o||e[9]!==f?(m=c.jsx(oi,{theme:f,language:"python",className:"cm border rounded overflow-hidden",extensions:G7,value:o,onChange:r}),e[8]=o,e[9]=f,e[10]=m):m=e[10],e[11]!==h||e[12]!==m?(x=c.jsxs("div",{className:"flex flex-col gap-6 py-4",children:[d,u,h,m]}),e[11]=h,e[12]=m,e[13]=x):x=e[13],e[14]!==n?(g=c.jsx(ve,{"data-testid":"snippet-cancel-button",variant:"secondary",onClick:n,children:"Cancel"}),e[14]=n,e[15]=g):g=e[15],e[16]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx(ve,{"data-testid":"snippet-send-button","aria-label":"Save",variant:"default",type:"submit",children:"Send"}),e[16]=p):p=e[16],e[17]!==g?(b=c.jsxs(Ca,{children:[g,p]}),e[17]=g,e[18]=b):b=e[18],e[19]!==a||e[20]!==b||e[21]!==x?(y=c.jsx(Ho,{className:"w-fit",children:c.jsxs("form",{onSubmit:a,children:[l,x,b]})}),e[19]=a,e[20]=b,e[21]=x,e[22]=y):y=e[22],y},K7=[We.lineWrapping],X7=()=>{const t=H.c(22),{readSnippets:e}=et(),[n,o]=q.useState();let r,s;t[0]!==e?(r=()=>e(),t[0]=e,t[1]=r):r=t[1],t[2]===Symbol.for("react.memo_cache_sentinel")?(s=[],t[2]=s):s=t[2];const{data:a,error:i,isPending:l}=In(r,s);if(i){let v;return t[3]!==i?(v=c.jsx(xr,{error:i}),t[3]=i,t[4]=v):v=t[4],v}if(l||!a){let v;return t[5]===Symbol.for("react.memo_cache_sentinel")?(v=c.jsx(vn,{size:"medium",centered:!0}),t[5]=v):v=t[5],v}const d=n?"h-1/3":"h-full";let u,h,f,m,x,g,p,b,y;return t[6]!==d?(u=xe("border-b rounded-none",d),t[6]=d,t[7]=u):u=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(h=c.jsx(Ma,{placeholder:"Search snippets...",className:"h-6 m-1",rootClassName:"flex-1 border-r"}),t[8]=h):h=t[8],t[9]===Symbol.for("react.memo_cache_sentinel")?(f=c.jsxs("div",{className:"flex items-center w-full",children:[h,c.jsx(q7,{children:c.jsx("button",{className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:c.jsx(Yo,{className:"h-4 w-4"})})})]}),m=c.jsx(tc,{children:"No results"}),t[9]=f,t[10]=m):(f=t[9],m=t[10]),t[11]===Symbol.for("react.memo_cache_sentinel")?(x=v=>o(v),t[11]=x):x=t[11],t[12]!==a.snippets?(g=c.jsx(Z7,{onSelect:x,snippets:a.snippets}),t[12]=a.snippets,t[13]=g):g=t[13],t[14]!==u||t[15]!==g?(p=c.jsxs(cc,{className:u,children:[f,m,g]}),t[14]=u,t[15]=g,t[16]=p):p=t[16],t[17]!==n?(b=c.jsx(T.Suspense,{children:c.jsx("div",{className:"h-2/3 snippet-viewer flex flex-col",children:n?c.jsx(J7,{snippet:n,onClose:()=>o(void 0)},n.title):c.jsx(ln,{title:"",description:"Click on a snippet to view its content."})})}),t[17]=n,t[18]=b):b=t[18],t[19]!==b||t[20]!==p?(y=c.jsxs("div",{className:"flex-1 overflow-hidden",children:[p,b]}),t[19]=b,t[20]=p,t[21]=y):y=t[21],y},J7=t=>{const e=H.c(33),{snippet:n,onClose:o}=t,{theme:r}=Ko(),{createNewCell:s}=it(),a=ls();let i;e[0]!==s||e[1]!==a||e[2]!==n.sections?(i=()=>{for(const w of[...n.sections].reverse())w.code&&s({code:w.code,before:!1,cellId:a??"__end__",skipIfCodeExists:!0})},e[0]=s,e[1]=a,e[2]=n.sections,e[3]=i):i=e[3];const l=i;let d;e[4]!==s||e[5]!==a?(d=w=>{s({code:w,before:!1,cellId:a??"__end__"})},e[4]=s,e[5]=a,e[6]=d):d=e[6];const u=d;let h,f,m,x,g,p,b,y,v;if(e[7]!==n.title?(h=c.jsx("span",{children:n.title}),e[7]=n.title,e[8]=h):h=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(f=c.jsx(yn,{className:"h-4 w-4"}),e[9]=f):f=e[9],e[10]!==o?(m=c.jsx(ve,{size:"sm",variant:"ghost",onClick:o,className:"h-6 w-6 p-0 hover:bg-muted-foreground/10",children:f}),e[10]=o,e[11]=m):m=e[11],e[12]!==h||e[13]!==m?(x=c.jsxs("div",{className:"text-sm font-semibold bg-muted border-y px-2 py-1 flex justify-between items-center",children:[h,m]}),e[12]=h,e[13]=m,e[14]=x):x=e[14],e[15]===Symbol.for("react.memo_cache_sentinel")?(g=c.jsx(wr,{className:"ml-2 h-4 w-4"}),e[15]=g):g=e[15],e[16]!==l?(p=c.jsx("div",{className:"flex justify-end",children:c.jsx(Ts,{children:c.jsxs(ve,{className:"float-right",size:"xs",variant:"outline",onClick:l,children:["Insert snippet",g]})})}),e[16]=l,e[17]=p):p=e[17],e[18]!==u||e[19]!==n.sections||e[20]!==n.title||e[21]!==r){let w;e[23]!==u||e[24]!==n.title||e[25]!==r?(w=S=>{const{code:j,html:C,id:_}=S;return C?c.jsx("div",{children:Am({html:C})},`${n.title}-${_}`):j?c.jsxs("div",{className:"relative hover-actions-parent pr-2",children:[c.jsx(Ts,{children:c.jsx(Ne,{content:"Insert snippet",children:c.jsx(ve,{className:"absolute -top-2 -right-1 z-10 hover-action px-2 bg-background",size:"sm",variant:"outline",onClick:()=>{u(j)},children:c.jsx(wr,{className:"h-5 w-5"})})})}),c.jsx(T.Suspense,{children:c.jsx(oi,{theme:r==="dark"?"dark":"light",language:"python",className:"cm border rounded overflow-hidden",extensions:K7,value:j,readOnly:!0},`${n.title}-${_}`)})]},`${n.title}-${_}`):null},e[23]=u,e[24]=n.title,e[25]=r,e[26]=w):w=e[26],b=n.sections.map(w),e[18]=u,e[19]=n.sections,e[20]=n.title,e[21]=r,e[22]=b}else b=e[22];return e[27]!==p||e[28]!==b?(y=c.jsxs("div",{className:"px-2 py-2 space-y-4 overflow-auto flex-1",children:[p,b]}),e[27]=p,e[28]=b,e[29]=y):y=e[29],e[30]!==y||e[31]!==x?(v=c.jsxs(c.Fragment,{children:[x,y]}),e[30]=y,e[31]=x,e[32]=v):v=e[32],v},Z7=t=>{const e=H.c(7),{snippets:n,onSelect:o}=t;let r,s;if(e[0]!==o||e[1]!==n){let a;e[3]!==o?(a=i=>c.jsx(Xn,{className:"rounded-none",onSelect:()=>o(i),children:c.jsx("div",{className:"flex flex-row gap-2 items-center",children:c.jsx("span",{className:"mt-1 text-accent-foreground",children:i.title})})},i.title),e[3]=o,e[4]=a):a=e[4],r=n.map(a),e[0]=o,e[1]=n,e[2]=r}else r=e[2];return e[5]!==r?(s=c.jsx(ym,{className:"flex flex-col overflow-auto",children:r}),e[5]=r,e[6]=s):s=e[6],s},Q7=q.lazy(()=>wm(()=>import("./tracing-BMsJZmo-.js").then(async t=>(await t.__tla,t)),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125]),import.meta.url).then(t=>({default:t.Tracing}))),eM=()=>{const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx(q.Suspense,{fallback:c.jsx(tM,{}),children:c.jsx(Q7,{})}),t[0]=e):e=t[0],e},tM=()=>{const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:c.jsx(vn,{})}),t[0]=e):e=t[0],e},nk="name",ok="type-value",Lf="defs-refs",nM=[{id:nk,accessorFn:t=>[t.name,t.declaredBy],enableSorting:!0,sortingFn:"alphanumeric",header:({column:t})=>c.jsx(Rm,{header:"Name",column:t}),cell:({getValue:t})=>{const[e,n]=t();return c.jsx(Yh,{name:e,declaredBy:n})}},{id:ok,accessorFn:t=>[t.dataType,t.value],enableSorting:!0,sortingFn:"alphanumeric",header:({column:t})=>c.jsx(Rm,{header:c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx("span",{children:"Type"}),c.jsx("span",{children:"Value"})]}),column:t}),cell:({getValue:t})=>{const[e,n]=t();return c.jsxs("div",{className:"max-w-[150px]",children:[c.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap text-muted-foreground font-mono text-xs",children:e}),c.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap",title:n??"",children:n})]})}},{id:Lf,accessorFn:t=>[t.declaredBy,t.usedBy,t.name,t.declaredByNames,t.usedByNames],enableSorting:!0,sortingFn:"basic",header:({column:t})=>c.jsx(Rm,{header:c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx("span",{children:"Declared By"}),c.jsx("span",{children:"Used By"})]}),column:t}),cell:({getValue:t})=>{const[e,n,o]=t(),r=s=>{const a=Ia(s);a&&Tm(a,o)};return c.jsxs("div",{className:"flex flex-col gap-1 py-1",children:[c.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-center",children:[c.jsx("span",{title:"Declared by",children:c.jsx(Np,{className:"w-3.5 h-3.5 text-muted-foreground"})}),e.length===1?c.jsx(Io,{variant:"focus",cellId:e[0],skipScroll:!0,onClick:()=>r(e[0])}):c.jsx("div",{className:"text-destructive flex flex-row gap-2",children:e.slice(0,3).map((s,a)=>c.jsxs("span",{className:"flex",children:[c.jsx(Io,{variant:"focus",cellId:s,skipScroll:!0,className:"whitespace-nowrap text-destructive",onClick:()=>r(s)},s),a<e.length-1&&", "]},s))})]}),c.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-baseline",children:[c.jsx("span",{title:"Used by",children:c.jsx(fi,{className:"w-3.5 h-3.5 text-muted-foreground"})}),c.jsx(N2,{maxCount:3,cellIds:n,skipScroll:!0,onClick:r})]})]})}}],rk=T.memo(({className:t,cellIds:e,variables:n})=>{const[o,r]=q.useState([]),[s,a]=q.useState(""),i=ZP(),l=T.useMemo(()=>{const h=f=>{const m=i[f];return oR(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,i,e]),d=T.useMemo(()=>{const h=new Map;return e.forEach((f,m)=>h.set(f,m)),function({variables:f,sort:m,cellIdToIndex:x}){m||(m={id:Lf,desc:!1});let g=[];switch(m.id){case nk:g=ii(f,p=>p.name);break;case ok:g=ii(f,p=>p.dataType);break;case Lf:g=ii(f,p=>x.get(p.declaredBy[0]))}return m.desc?g.reverse():g}({variables:l,sort:o[0],cellIdToIndex:h})},[l,o,e]),u=QP({data:d,columns:nM,getCoreRowModel:nR(),onGlobalFilterChange:a,getFilteredRowModel:tR(),enableFilters:!0,enableGlobalFilter:!0,enableColumnPinning:!1,getColumnCanGlobalFilter:h=>h.columnDef.enableGlobalFilter??!0,globalFilterFn:"auto",manualSorting:!0,onSortingChange:r,getSortedRowModel:eR(),state:{sorting:o,globalFilter:s}});return c.jsxs(c.Fragment,{children:[c.jsx(aj,{className:"w-full",placeholder:"Search",value:s,onChange:h=>a(h.target.value)}),c.jsxs(Dm,{className:xe("w-full text-sm flex-1 border-separate border-spacing-0",t),children:[c.jsx(Om,{children:c.jsx(vs,{className:"whitespace-nowrap text-xs",children:u.getFlatHeaders().map(h=>c.jsx(br,{className:"sticky top-0 bg-background border-b",children:cj(h.column.columnDef.header,h.getContext())},h.id))})}),c.jsx(Pm,{children:u.getRowModel().rows.map(h=>c.jsx(vs,{className:"hover:bg-accent",children:h.getVisibleCells().map(f=>c.jsx(yr,{className:"border-b",children:cj(f.column.columnDef.cell,f.getContext())},f.id))},h.id))})]})]})});rk.displayName="VariableTable";const oM=()=>{const t=H.c(4),e=Mm(),n=gr();if(Object.keys(e).length===0){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=c.jsx(ln,{title:"No variables",description:"Global variables will appear here.",icon:c.jsx(Vl,{})}),t[0]=r):r=t[0],r}let o;return t[1]!==n.inOrderIds||t[2]!==e?(o=c.jsx(rk,{className:"flex-1",cellIds:n.inOrderIds,variables:e}),t[1]=n.inOrderIds,t[2]=e,t[3]=o):o=t[3],o},rM=t=>{const e=H.c(54),n=Se(rR),o=Se(P_),r=it(),s=C3(),a=t.cellId,i=o[t.cellId],l=Ja(t.cellId),d=l.code,u=Za(t.cellId);let h,f,m,x,g,p,b,y,v,w,S,j,C,_;if(e[0]!==r||e[1]!==s||e[2]!==n.focusedCellId||e[3]!==o||e[4]!==t.cellId||e[5]!==i||e[6]!==l.code||e[7]!==u.errored){if(h={id:a,graph:i,code:d,hasError:u.errored},n.focusedCellId&&o[n.focusedCellId]){const z=o[n.focusedCellId];let N;e[20]!==n.focusedCellId||e[21]!==z?(N={id:n.focusedCellId,graph:z},e[20]=n.focusedCellId,e[21]=z,e[22]=N):N=e[22],x=N}m=(x==null?void 0:x.id)===h.id,f=ak(h.graph)?1.5:3;const O=()=>{m?s.blurCell():(r.focusCell({cellId:h.id,where:"exact"}),s.focusCell({cellId:h.id}))};j=h.id;const P=m?"text-primary-foreground":"text-(--gray-8) hover:text-(--gray-9)";e[23]!==P?(g=xe("group bg-transparent text-left w-full flex relative justify-between items-center","border-none rounded cursor-pointer","h-[21px] pl-[51px] font-inherit",P),e[23]=P,e[24]=g):g=e[24],p=O,b=uM;const R=m&&"bg-primary group-hover:bg-primary";e[25]!==R?(S=xe("group-hover:bg-(--gray-2) flex h-full w-full px-0.5 items-center rounded",R),e[25]=R,e[26]=S):S=e[26],y="truncate px-1 font-mono text-sm flex gap-1",v=h.code,w=h.graph.variables.length>0?c.jsx(lM,{cell:h,selectedCell:x}):c.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap max-w-full",children:iM(h.code)??c.jsx("span",{className:"italic",children:"empty"})}),e[0]=r,e[1]=s,e[2]=n.focusedCellId,e[3]=o,e[4]=t.cellId,e[5]=i,e[6]=l.code,e[7]=u.errored,e[8]=h,e[9]=f,e[10]=m,e[11]=x,e[12]=g,e[13]=p,e[14]=b,e[15]=y,e[16]=v,e[17]=w,e[18]=S,e[19]=j}else h=e[8],f=e[9],m=e[10],x=e[11],g=e[12],p=e[13],b=e[14],y=e[15],v=e[16],w=e[17],S=e[18],j=e[19];e[27]!==y||e[28]!==v||e[29]!==w?(C=c.jsx("div",{className:y,title:v,children:w}),e[27]=y,e[28]=v,e[29]=w,e[30]=C):C=e[30],e[31]!==C||e[32]!==S?(_=c.jsx("div",{className:S,children:C}),e[31]=C,e[32]=S,e[33]=_):_=e[33];const E=m?"z-30":"z-20";let M,I,D,F;return e[34]!==h||e[35]!==x||e[36]!==E?(M=xe("absolute overflow-visible top-[10.5px] left-[calc(var(--spacing-extra-small,8px)+17px)] pointer-events-none",E,function({cell:O,selectedCell:P}){return O.hasError?"text-destructive":!P&&!ak(O.graph)?"text-foreground":(P==null?void 0:P.id)===O.id||P!=null&&P.graph.parents.has(O.id)||P!=null&&P.graph.children.has(O.id)?"text-primary":"text-(--gray-8)"}({cell:h,selectedCell:x})),e[34]=h,e[35]=x,e[36]=E,e[37]=M):M=e[37],e[38]!==h||e[39]!==f||e[40]!==m||e[41]!==t.cellPositions||e[42]!==x?(I=m?c.jsx(cM,{cell:h,cellPositions:t.cellPositions,circleRadius:f}):c.jsx(dM,{cell:h,selectedCell:x,circleRadius:f}),e[38]=h,e[39]=f,e[40]=m,e[41]=t.cellPositions,e[42]=x,e[43]=I):I=e[43],e[44]!==M||e[45]!==I?(D=c.jsx("svg",{className:M,width:"1",height:"1",children:I}),e[44]=M,e[45]=I,e[46]=D):D=e[46],e[47]!==g||e[48]!==p||e[49]!==b||e[50]!==_||e[51]!==D||e[52]!==j?(F=c.jsxs("button",{"data-node-id":j,className:g,onClick:p,onMouseDown:b,children:[_,D]}),e[47]=g,e[48]=p,e[49]=b,e[50]=_,e[51]=D,e[52]=j,e[53]=F):F=e[53],F},sM=t=>{const e=H.c(28),{open:n,setOpen:o}=t,r=gr();let s;e[0]!==r.inOrderIds?(s=Object.fromEntries(r.inOrderIds.map(hM)),e[0]=r.inOrderIds,e[1]=s):s=e[1];const a=s;let i;if(e[2]!==r){i=[];let v=0;for(const[w,S]of r.getColumns().entries())w>0&&i.push(v),v+=S.inOrderIds.length;e[2]=r,e[3]=i}else i=e[3];const l=n?"translate-x-0":"translate-x-[calc(100%+20px)]";let d,u,h,f,m,x,g,p,b,y;if(e[4]!==l?(d=xe("fixed top-14 right-5 z-50 bg-background/95 backdrop-blur-sm supports-backdrop-filter:bg-background/60 rounded-lg border shadow-lg w-64 flex flex-col max-h-[58vh]","motion-safe:transition-transform motion-safe:duration-200 motion-safe:ease-in-out",l),e[4]=l,e[5]=d):d=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(u=c.jsx("span",{className:"text-sm font-semibold",children:"Minimap"}),e[6]=u):u=e[6],e[7]!==o?(h=()=>o(!1),e[7]=o,e[8]=h):h=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(f=c.jsx(yn,{className:"h-4 w-4"}),e[9]=f):f=e[9],e[10]!==h?(m=c.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[u,c.jsx(ve,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:h,children:f})]}),e[10]=h,e[11]=m):m=e[11],e[12]!==r.inOrderIds||e[13]!==a||e[14]!==i){let v;e[16]!==a||e[17]!==i?(v=(w,S)=>{const j=i.includes(S);return c.jsxs(T.Fragment,{children:[j&&c.jsx("div",{className:"absolute left-5 w-[36px] h-px bg-(--gray-4) pointer-events-none","aria-hidden":"true"}),c.jsx(rM,{cellId:w,cellPositions:a})]},w)},e[16]=a,e[17]=i,e[18]=v):v=e[18],x=r.inOrderIds.map(v),e[12]=r.inOrderIds,e[13]=a,e[14]=i,e[15]=x}else x=e[15];return e[19]!==x?(g=c.jsx("div",{className:"py-3 pl-3 pr-4 relative min-h-full",children:x}),e[19]=x,e[20]=g):g=e[20],e[21]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx("div",{className:"h-0 overflow-hidden","aria-hidden":"true"}),e[21]=p):p=e[21],e[22]!==g?(b=c.jsxs("div",{className:"overflow-y-auto overflow-x-hidden flex-1 scrollbar-none",children:[g,p]}),e[22]=g,e[23]=b):b=e[23],e[24]!==b||e[25]!==d||e[26]!==m?(y=c.jsxs("div",{className:d,children:[m,b]}),e[24]=b,e[25]=d,e[26]=m,e[27]=y):y=e[27],y},aM=()=>{const t=H.c(5),[e,n]=Ot(yb);let o,r;return t[0]!==n?(o=()=>n(fM),t[0]=n,t[1]=o):o=t[1],Dt("global.toggleMinimap",o),t[2]!==e||t[3]!==n?(r=c.jsx(sM,{open:e,setOpen:n}),t[2]=e,t[3]=n,t[4]=r):r=t[4],r};function iM(t){return t.split(`
|
148
|
-
`)[0].trim()||void 0}const lM=t=>{const e=H.c(11),{cell:n,selectedCell:o}=t,r=Mm(),s=n.id===(o==null?void 0:o.id);let a,i;if(e[0]!==n.graph.variables||e[1]!==s||e[2]!==o||e[3]!==r){let l;e[5]!==s||e[6]!==o||e[7]!==r?(l=(d,u)=>{const h=r[d];return c.jsxs(T.Fragment,{children:[u>0&&", ",c.jsx("span",{className:xe({"font-bold":s,"text-foreground":o===void 0,"text-primary font-medium":!s&&R_(h,o)}),children:d})]},d)},e[5]=s,e[6]=o,e[7]=r,e[8]=l):l=e[8],a=n.graph.variables.map(l),e[0]=n.graph.variables,e[1]=s,e[2]=o,e[3]=r,e[4]=a}else a=e[4];return e[9]!==a?(i=c.jsx(c.Fragment,{children:a}),e[9]=a,e[10]=i):i=e[10],i},cM=t=>{const e=H.c(12),{cell:n,cellPositions:o,circleRadius:r}=t;let s,a,i,l;if(e[0]!==n.graph.children||e[1]!==n.graph.parents||e[2]!==n.id||e[3]!==o){s=[];const d=o[n.id]??0,u=new Set;for(const h of n.graph.parents)n.graph.children.has(h)&&u.add(h);for(const h of u){const f=o[h];if(f!==void 0){const m=21*(f-d);s.push(c.jsx("path",{d:`M -3 0 H -7 v ${m} h 14 v ${-m} H 3`,fill:"none",strokeWidth:"2",stroke:"currentColor"},`${n.id}-cycle-${h}`))}}for(const h of n.graph.parents){if(u.has(h))continue;const f=o[h];if(f!==void 0){const m=21*(f-d);s.push(c.jsx("path",{d:`M -3 0 H -7 v ${m} h -4`,fill:"none",strokeWidth:"2",stroke:"currentColor"},`${n.id}-up-${h}`))}}for(const h of n.graph.children){if(u.has(h))continue;const f=o[h];if(f!==void 0){const m=21*(f-d);s.push(c.jsx("path",{d:`M 3 0 H 7 v ${m} h 4`,fill:"none",strokeWidth:"2",stroke:"currentColor"},`${n.id}-down-${h}`))}}e[0]=n.graph.children,e[1]=n.graph.parents,e[2]=n.id,e[3]=o,e[4]=s}else s=e[4];return e[5]!==r?(a=c.jsx("circle",{r,fill:"currentColor",className:"pointer-events-auto"}),e[5]=r,e[6]=a):a=e[6],e[7]!==s?(i=c.jsx("g",{className:"pen pointer-events-auto",children:s}),e[7]=s,e[8]=i):i=e[8],e[9]!==a||e[10]!==i?(l=c.jsxs("g",{transform:"translate(0, 0)",children:[a,i]}),e[9]=a,e[10]=i,e[11]=l):l=e[11],l};function dM(t){const{cell:e,selectedCell:n,circleRadius:o}=t,r=e.graph.ancestors.size>0,s=e.graph.descendants.size>0;if(!n)return sk({circleRadius:o,leftWisker:r,rightWisker:s});const a=n.graph.ancestors.has(e.id),i=n.graph.descendants.has(e.id);return sk(a||i?{circleRadius:o,leftWisker:r,rightWisker:s,shift:a&&i?void 0:a?"left":"right"}:{circleRadius:o,leftWisker:!1,rightWisker:!1})}function sk(t){const{circleRadius:e,leftWisker:n,rightWisker:o,shift:r}=t,s=r===void 0?0:r==="left"?-14:14;return c.jsxs("g",{transform:`translate(${s}, 0)`,children:[c.jsxs("g",{children:[n&&c.jsx("path",{d:"M 0 0 h -8",fill:"none",strokeWidth:"2",stroke:"currentColor"}),o&&c.jsx("path",{d:"M 0 0 h 8",fill:"none",strokeWidth:"2",stroke:"currentColor"})]}),c.jsx("circle",{r:e,fill:"currentColor",className:"pointer-events-auto"})]})}function ak(t){return t.variables.length===0&&t.ancestors.size===0&&t.descendants.size===0}function uM(t){return t.preventDefault()}function hM(t,e){return[t,e]}function fM(t){return!t}const mM=q.lazy(()=>wm(()=>import("./terminal-sSuibCH0.js"),__vite__mapDeps([126,1,2,127]),import.meta.url)),pM=t=>{const e=H.c(122),{children:n}=t,{isSidebarOpen:o,isTerminalOpen:r,selectedPanel:s}=sc(),{setIsSidebarOpen:a,setIsTerminalOpen:i}=Fa(),l=q.useRef(null),d=q.useRef(null);let u,h,f,m,x;e[0]!==o?(u=()=>{if(!l.current)return;const Pe=l.current.isCollapsed();o&&Pe&&l.current.expand(),o||Pe||l.current.collapse(),requestAnimationFrame(xM)},h=[o],e[0]=o,e[1]=u,e[2]=h):(u=e[1],h=e[2]),T.useEffect(u,h),e[3]!==r?(f=()=>{if(!d.current)return;const Pe=d.current.isCollapsed();r&&Pe&&d.current.expand(),r||Pe||d.current.collapse(),requestAnimationFrame(yM)},m=[r],e[3]=r,e[4]=f,e[5]=m):(f=e[4],m=e[5]),T.useEffect(f,m),e[6]!==n?(x=c.jsx(Oc,{id:"app",className:"relative h-full",children:c.jsx(T.Suspense,{children:n})},"app"),e[6]=n,e[7]=x):x=e[7];const g=x,p=o?"resize-handle":"resize-handle-collapsed";let b,y;e[8]!==p?(b=xe("border-border no-print z-10",p,"vertical"),e[8]=p,e[9]=b):b=e[9],e[10]!==b?(y=c.jsx(dj,{onDragging:uj,className:b}),e[10]=b,e[11]=y):y=e[11];const v=y,w=r?"resize-handle":"resize-handle-collapsed";let S,j;e[12]!==w?(S=xe("border-border no-print z-20",w,"horizontal"),e[12]=w,e[13]=S):S=e[13],e[14]!==S?(j=c.jsx(dj,{onDragging:uj,className:S}),e[14]=S,e[15]=j):j=e[15];const C=j;let _,E,M,I,D,F,O,P,R,z,N,k,B,A,U,$,X,Y,G,W,J;e[16]!==s?(_=c.jsx("div",{className:"text-sm text-(--slate-11) uppercase tracking-wide font-semibold flex-1",children:s}),e[16]=s,e[17]=_):_=e[17],e[18]!==a?(E=()=>a(!1),e[18]=a,e[19]=E):E=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(M=c.jsx(yn,{className:"w-4 h-4"}),e[20]=M):M=e[20],e[21]!==E?(I=c.jsx(ve,{"data-testid":"close-helper-pane",className:"m-0",size:"xs",variant:"text",onClick:E,children:M}),e[21]=E,e[22]=I):I=e[22],e[23]!==_||e[24]!==I?(D=c.jsxs("div",{className:"p-3 border-b flex justify-between items-center",children:[_,I]}),e[23]=_,e[24]=I,e[25]=D):D=e[25],e[26]!==s?(F=s==="files"&&c.jsx(Yw,{}),e[26]=s,e[27]=F):F=e[27],e[28]!==s?(O=s==="errors"&&c.jsx(o7,{}),e[28]=s,e[29]=O):O=e[29],e[30]!==s?(P=s==="variables"&&c.jsx(oM,{}),e[30]=s,e[31]=P):P=e[31],e[32]!==s?(R=s==="dependencies"&&c.jsx($T,{}),e[32]=s,e[33]=R):R=e[33],e[34]!==s?(z=s==="packages"&&c.jsx(I7,{}),e[34]=s,e[35]=z):z=e[35],e[36]!==s?(N=s==="outline"&&c.jsx(_7,{}),e[36]=s,e[37]=N):N=e[37],e[38]!==s?(k=s==="datasources"&&c.jsx(t7,{}),e[38]=s,e[39]=k):k=e[39],e[40]!==s?(B=s==="documentation"&&c.jsx(n7,{}),e[40]=s,e[41]=B):B=e[41],e[42]!==s?(A=s==="snippets"&&c.jsx(X7,{}),e[42]=s,e[43]=A):A=e[43],e[44]!==s?(U=s==="scratchpad"&&c.jsx(z7,{}),e[44]=s,e[45]=U):U=e[45],e[46]!==s?($=s==="chat"&&c.jsx(d8,{}),e[46]=s,e[47]=$):$=e[47],e[48]!==s?(X=s==="logs"&&c.jsx(Kw,{}),e[48]=s,e[49]=X):X=e[49],e[50]!==s?(Y=s==="tracing"&&c.jsx(eM,{}),e[50]=s,e[51]=Y):Y=e[51],e[52]!==s?(G=s==="secrets"&&c.jsx(B7,{}),e[52]=s,e[53]=G):G=e[53],e[54]!==F||e[55]!==O||e[56]!==P||e[57]!==R||e[58]!==z||e[59]!==N||e[60]!==k||e[61]!==B||e[62]!==A||e[63]!==U||e[64]!==$||e[65]!==X||e[66]!==Y||e[67]!==G?(W=c.jsx(T.Suspense,{children:c.jsxs(Ac,{children:[F,O,P,R,z,N,k,B,A,U,$,X,Y,G]})}),e[54]=F,e[55]=O,e[56]=P,e[57]=R,e[58]=z,e[59]=N,e[60]=k,e[61]=B,e[62]=A,e[63]=U,e[64]=$,e[65]=X,e[66]=Y,e[67]=G,e[68]=W):W=e[68],e[69]!==D||e[70]!==W?(J=c.jsx(dc,{children:c.jsxs("div",{className:"flex flex-col h-full flex-1 overflow-hidden mr-[-4px]",children:[D,W]})}),e[69]=D,e[70]=W,e[71]=J):J=e[71];const V=J,Q=o&&"border-r border-l border-(--slate-7)";let te,re,ne,ae,se,ie;e[72]!==Q?(te=xe("dark:bg-(--slate-1) no-print print:hidden hide-on-fullscreen",Q),e[72]=Q,e[73]=te):te=e[73],e[74]===Symbol.for("react.memo_cache_sentinel")?(re=(Pe,Re)=>{var He;Re===0&&Pe===10&&((He=l.current)==null||He.resize(30))},e[74]=re):re=e[74],e[75]!==a?(ne=()=>a(!1),ae=()=>a(!0),e[75]=a,e[76]=ne,e[77]=ae):(ne=e[76],ae=e[77]),e[78]!==V||e[79]!==v?(se=c.jsxs("span",{className:"flex flex-row h-full",children:[V," ",v]}),e[78]=V,e[79]=v,e[80]=se):se=e[80],e[81]!==te||e[82]!==ne||e[83]!==ae||e[84]!==se?(ie=c.jsx(Oc,{ref:l,id:"helper",collapsedSize:0,collapsible:!0,className:te,minSize:10,defaultSize:0,maxSize:75,onResize:re,onCollapse:ne,onExpand:ae,children:se},"helper"),e[81]=te,e[82]=ne,e[83]=ae,e[84]=se,e[85]=ie):ie=e[85];const ge=ie,oe=r&&"border-(--slate-7)";let ue,de,Ce,Te,Fe,_e,ke,Ye,Ve;e[86]!==oe?(ue=xe("dark:bg-(--slate-1) no-print print:hidden hide-on-fullscreen",oe),e[86]=oe,e[87]=ue):ue=e[87],e[88]===Symbol.for("react.memo_cache_sentinel")?(de=(Pe,Re)=>{var He;Re===0&&Pe===10&&((He=d.current)==null||He.resize(30))},e[88]=de):de=e[88],e[89]!==i?(Ce=()=>i(!1),Te=()=>i(!0),e[89]=i,e[90]=Ce,e[91]=Te):(Ce=e[90],Te=e[91]),e[92]===Symbol.for("react.memo_cache_sentinel")?(Fe=c.jsx("div",{}),e[92]=Fe):Fe=e[92],e[93]!==i?(_e=()=>i(!1),e[93]=i,e[94]=_e):_e=e[94],e[95]!==r||e[96]!==_e?(ke=c.jsx(T.Suspense,{fallback:Fe,children:c.jsx(mM,{visible:r,onClose:_e})}),e[95]=r,e[96]=_e,e[97]=ke):ke=e[97],e[98]!==r||e[99]!==ke?(Ye=c.jsx(VT,{isOpen:r,children:ke}),e[98]=r,e[99]=ke,e[100]=Ye):Ye=e[100],e[101]!==ue||e[102]!==Ce||e[103]!==Te||e[104]!==Ye||e[105]!==C?(Ve=c.jsxs(Oc,{ref:d,id:"terminal",collapsedSize:0,collapsible:!0,className:ue,minSize:10,defaultSize:0,maxSize:75,onResize:de,onCollapse:Ce,onExpand:Te,children:[C,Ye]},"terminal"),e[101]=ue,e[102]=Ce,e[103]=Te,e[104]=Ye,e[105]=C,e[106]=Ve):Ve=e[106];const Ke=Ve;let ee,ye,we,Ie,K,me,pe,he,je;return e[107]===Symbol.for("react.memo_cache_sentinel")?(ee=XR(),e[107]=ee):ee=e[107],e[108]===Symbol.for("react.memo_cache_sentinel")?(ye=c.jsx(Ac,{children:c.jsx(q_,{})}),e[108]=ye):ye=e[108],e[109]!==Ke?(we=c.jsx(xb,{capability:"terminal",children:Ke}),e[109]=Ke,e[110]=we):we=e[110],e[111]!==g||e[112]!==we?(Ie=c.jsx(Oc,{children:c.jsxs(hj,{autoSaveId:"marimo:chrome:v1:l1",direction:"vertical",children:[g,we]})}),e[111]=g,e[112]=we,e[113]=Ie):Ie=e[113],e[114]===Symbol.for("react.memo_cache_sentinel")?(K=c.jsx(sR,{}),e[114]=K):K=e[114],e[115]!==ge||e[116]!==Ie?(me=c.jsxs(hj,{autoSaveId:"marimo:chrome:v1:l2",direction:"horizontal",storage:ee,children:[ye,ge,Ie,K]}),e[115]=ge,e[116]=Ie,e[117]=me):me=e[117],e[118]===Symbol.for("react.memo_cache_sentinel")?(pe=c.jsx(aM,{}),e[118]=pe):pe=e[118],e[119]===Symbol.for("react.memo_cache_sentinel")?(he=c.jsx(dc,{children:c.jsx(Ac,{children:c.jsx(U_,{})})}),e[119]=he):he=e[119],e[120]!==me?(je=c.jsxs(JR,{children:[me,pe,he]}),e[120]=me,e[121]=je):je=e[121],je};function gM(){window.dispatchEvent(new Event("resize"))}function xM(){requestAnimationFrame(gM)}function bM(){window.dispatchEvent(new Event("resize"))}function yM(){requestAnimationFrame(bM)}let ik;ik=new URL(window.location.href).searchParams.get(aR.showChrome)==="false",Pj=Object.freeze(Object.defineProperty({__proto__:null,default:t=>{const e=H.c(10);if(ik){let s,a,i;return e[0]!==t?(s=c.jsx(gb,{hideControls:!0,...t}),e[0]=t,e[1]=s):s=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(Bp,{}),e[2]=a):a=e[2],e[3]!==s?(i=c.jsxs(c.Fragment,{children:[s,a]}),e[3]=s,e[4]=i):i=e[4],i}let n,o,r;return e[5]!==t?(n=c.jsx(gb,{...t}),e[5]=t,e[6]=n):n=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(o=c.jsx(Bp,{}),e[7]=o):o=e[7],e[8]!==n?(r=c.jsxs(pM,{children:[n,o]}),e[8]=n,e[9]=r):r=e[9],r}},Symbol.toStringTag,{value:"Module"}))});export{Hm as C,Pc as E,ln as P,sL as __tla,Rc as a,Pj as e,js as f};
|
147
|
+
`).length),position:{x:0,y:0}}}createElements(t,e,n,o){const r=[],s=[],a=new Set,i=new Set;for(const l of Object.values(n)){if(l.value==="marimo"&&l.name==="mo")continue;const{declaredBy:d,usedBy:u}=l;for(const h of d)for(const f of u){const m=`${h}-${f}`;i.has(m)||(i.add(m),a.add(h),a.add(f),s.push(this.createEdge(h,f)))}}for(const[l,d]of Im.zip(t,e)){o||r.push(this.createNode(l,d));const u=a.has(l),h=Qe.get(d).code.trim().startsWith("mo.md");!u&&h||r.push(this.createNode(l,d))}return{nodes:r,edges:s}}},LT=t=>{const e=H.c(43),{cellIds:n,variables:o,cellAtoms:r,children:s,layoutDirection:a,settings:i}=t;let l;e[0]!==r||e[1]!==n||e[2]!==a||e[3]!==i.hidePureMarkdown||e[4]!==o?(l=()=>{let k=Uw.createElements(n,r,o,i.hidePureMarkdown);return k=Bw({nodes:k.nodes,edges:k.edges,direction:a}),k},e[0]=r,e[1]=n,e[2]=a,e[3]=i.hidePureMarkdown,e[4]=o,e[5]=l):l=e[5];const[d]=T.useState(l),[u,h,f]=y2(d.nodes),[m,x,g]=v2(d.edges),p=va();let b;e[6]!==a||e[7]!==x||e[8]!==h?(b=k=>{const B=Bw({nodes:k.nodes,edges:k.edges,direction:a});h(B.nodes),x(B.edges)},e[6]=a,e[7]=x,e[8]=h,e[9]=b):b=e[9];const y=Le(b);let v,w;e[10]!==r||e[11]!==n||e[12]!==i.hidePureMarkdown||e[13]!==y||e[14]!==o?(v=()=>{y(Uw.createElements(n,r,o,i.hidePureMarkdown))},w=[n,o,r,y,i.hidePureMarkdown],e[10]=r,e[11]=n,e[12]=i.hidePureMarkdown,e[13]=y,e[14]=o,e[15]=v,e[16]=w):(v=e[15],w=e[16]),T.useEffect(v,w);const[S,j]=T.useState();let C;E2(),e[17]===Symbol.for("react.memo_cache_sentinel")?(C=()=>{j(void 0)},e[17]=C):C=e[17];const _=C;let E,M,I,D,F,O,P,R,z,N;return e[18]===Symbol.for("react.memo_cache_sentinel")?(E={minZoom:.5,maxZoom:1.5},M=(k,B)=>{j({type:"node",id:B.id})},I=(k,B)=>{const{source:A,target:U}=B;j({type:"edge",source:A,target:U})},e[18]=E,e[19]=M,e[20]=I):(E=e[18],M=e[19],I=e[20]),e[21]===Symbol.for("react.memo_cache_sentinel")?(D=c.jsx(oT,{color:"#ccc",variant:Cn.Dots}),e[21]=D):D=e[21],e[22]!==p||e[23]!==u?(F=()=>{const k=Qe.get(gP);if(k){const B=u.find(A=>A.id===k);B&&(p.fitView({padding:1,duration:600,nodes:[B]}),j({type:"node",id:k}))}},e[22]=p,e[23]=u,e[24]=F):F=e[24],e[25]===Symbol.for("react.memo_cache_sentinel")?(O=c.jsx(dp,{className:"size-4"}),e[25]=O):O=e[25],e[26]!==F?(P=c.jsx(JA,{position:"bottom-right",showInteractive:!1,children:c.jsx(Ne,{content:"Jump to focused cell",delayDuration:200,side:"left",asChild:!1,children:c.jsx(es,{onMouseDown:Rn.preventFocus,onClick:F,children:O})})}),e[26]=F,e[27]=P):P=e[27],e[28]!==m||e[29]!==S||e[30]!==o?(R=c.jsx(Fl,{selection:S,variables:o,edges:m,onClearSelection:_}),e[28]=m,e[29]=S,e[30]=o,e[31]=R):R=e[31],e[32]!==s||e[33]!==m||e[34]!==u||e[35]!==g||e[36]!==f||e[37]!==P||e[38]!==R?(z=c.jsxs(qh,{nodes:u,edges:m,nodeTypes:C2,minZoom:.2,fitViewOptions:E,onNodeClick:M,onEdgeClick:I,onNodeDoubleClick:FT,fitView:!0,onNodesChange:f,onEdgesChange:g,zoomOnDoubleClick:!1,nodesConnectable:!1,children:[D,P,R,s]}),e[32]=s,e[33]=m,e[34]=u,e[35]=g,e[36]=f,e[37]=P,e[38]=R,e[39]=z):z=e[39],e[40]!==a||e[41]!==z?(N=c.jsx(j2,{value:a,children:z}),e[40]=a,e[41]=z,e[42]=N):N=e[42],N};function FT(t,e){Y3(e.id,"focus")}const zT=yt("_minimap_"),BT=yt({hidePureMarkdown:!0}),UT=t=>{const e=H.c(11),[n,o]=Ot(zT),[r,s]=Ot(BT);let a;e[0]!==n||e[1]!==t||e[2]!==o||e[3]!==s||e[4]!==r?(a=()=>n==="_minimap_"?c.jsx(lT,{...t,children:c.jsx(Kh,{settings:r,onSettingsChange:s,view:n,onChange:o})}):c.jsx(LT,{...t,settings:r,layoutDirection:n,children:c.jsx(Kh,{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]=a):a=e[5];const i=a;let l,d;return e[6]!==i?(l=i(),e[6]=i,e[7]=l):l=e[7],e[8]!==n||e[9]!==l?(d=c.jsx(Wh,{children:l},n),e[8]=n,e[9]=l,e[10]=d):d=e[10],d},$T=()=>{const t=H.c(5),e=Mm(),n=gr(),[o]=xP();let r,s;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=xe("w-full h-full flex-1 mx-auto -mb-4 relative"),t[0]=r):r=t[0],t[1]!==n.inOrderIds||t[2]!==o||t[3]!==e?(s=c.jsx("div",{className:r,children:c.jsx(UT,{cellAtoms:o,variables:e,cellIds:n.inOrderIds})}),t[1]=n.inOrderIds,t[2]=o,t[3]=e,t[4]=s):s=t[4],s},VT=t=>{const e=H.c(4),{isOpen:n,children:o}=t,[r,s]=q.useState(!1);let a,i;return e[0]!==r||e[1]!==n?(a=()=>{n&&!r&&s(!0)},i=[n,r],e[0]=r,e[1]=n,e[2]=a,e[3]=i):(a=e[2],i=e[3]),q.useEffect(a,i),r?o:null},HT=t=>{const e=H.c(8),{variableName:n,className:o}=t;let r;e[0]!==n?(r=()=>{const l=function(u){const h=Qe.get(hc)[u];if(h)return h.declaredBy[0]}(n);if(!l)return;const d=Ia(l);d&&Tm(d,n)},e[0]=n,e[1]=r):r=e[1];const s=r;let a,i;return e[2]!==o?(a=xe("text-link opacity-80 hover:opacity-100 hover:underline",o),e[2]=o,e[3]=a):a=e[3],e[4]!==s||e[5]!==a||e[6]!==n?(i=c.jsx("button",{type:"button",onClick:s,className:a,children:n}),e[4]=s,e[5]=a,e[6]=n,e[7]=i):i=e[7],i},WT=yt(t=>{const e=t(bP),n=t(hc),o=t(ei);return ii(e,r=>{if(!r.variable_name)return-1;const s=Object.values(n).find(i=>i.name===r.variable_name);if(!s)return 0;const a=o.inOrderIds.indexOf(s.declaredBy[0]);return a===-1?0:a})}),qT=yt(t=>{const e=new Map(t(yP));for(const n of K3){const o=e.get(n);o&&o.databases.length===0&&e.delete(n)}return ii([...e.values()],n=>K3.has(n.name)?1:0)}),GT=()=>{const t=H.c(32),[e,n]=q.useState(""),o=jt(X3),r=Se(WT),s=Se(qT);if(r.length===0&&s.length===0){let b;return t[0]===Symbol.for("react.memo_cache_sentinel")?(b=c.jsx(ln,{title:"No tables found",description:"Any datasets/dataframes in the global scope will be shown here.",action:c.jsx(ug,{children:c.jsxs(ve,{variant:"outline",size:"sm",children:["Add database or catalog",c.jsx(Yo,{className:"h-4 w-4 ml-2"})]})}),icon:c.jsx(Wo,{})}),t[0]=b):b=t[0],b}const a=!!e.trim();let i,l,d,u,h,f,m,x,g,p;if(t[1]!==o?(i=b=>{o(b.length>0),n(b)},t[1]=o,t[2]=i):i=t[2],t[3]!==e||t[4]!==i?(l=c.jsx(Ma,{placeholder:"Search tables...",className:"h-6 m-1",value:e,onValueChange:i,rootClassName:"flex-1 border-r"}),t[3]=e,t[4]=i,t[5]=l):l=t[5],t[6]!==a?(d=a&&c.jsx("button",{type:"button",className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",onClick:()=>n(""),children:c.jsx(yn,{className:"h-4 w-4"})}),t[6]=a,t[7]=d):d=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(u=c.jsx(ug,{children:c.jsx("button",{type:"button",className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:c.jsx(Yo,{className:"h-4 w-4"})})}),t[8]=u):u=t[8],t[9]!==l||t[10]!==d?(h=c.jsxs("div",{className:"flex items-center w-full",children:[l,d,u]}),t[9]=l,t[10]=d,t[11]=h):h=t[11],t[12]!==s||t[13]!==a||t[14]!==e){let b;t[16]!==a||t[17]!==e?(b=y=>c.jsx(YT,{connection:y,hasChildren:y.databases.length>0,children:y.databases.map(v=>c.jsx(KT,{engineName:y.name,database:v,hasSearch:a,children:c.jsx(XT,{schemas:v.schemas,defaultSchema:y.default_schema,defaultDatabase:y.default_database,engineName:y.name,databaseName:v.name,hasSearch:a,searchValue:e})},v.name))},y.name),t[16]=a,t[17]=e,t[18]=b):b=t[18],f=s.map(b),t[12]=s,t[13]=a,t[14]=e,t[15]=f}else f=t[15];return t[19]!==s.length||t[20]!==r.length?(m=s.length>0&&r.length>0&&c.jsxs(J3,{children:[c.jsx(Xl,{className:"h-4 w-4 text-muted-foreground"}),c.jsx("span",{className:"text-xs",children:"Python"})]}),t[19]=s.length,t[20]=r.length,t[21]=m):m=t[21],t[22]!==e||t[23]!==r?(x=r.length>0&&c.jsx($w,{tables:r,searchValue:e}),t[22]=e,t[23]=r,t[24]=x):x=t[24],t[25]!==f||t[26]!==m||t[27]!==x?(g=c.jsxs(ym,{className:"flex flex-col",children:[f,m,x]}),t[25]=f,t[26]=m,t[27]=x,t[28]=g):g=t[28],t[29]!==h||t[30]!==g?(p=c.jsxs(cc,{className:"border-b bg-background rounded-none h-full pb-10 overflow-auto outline-hidden",shouldFilter:!1,children:[h,g]}),t[29]=h,t[30]=g,t[31]=p):p=t[31],p},YT=t=>{const e=H.c(26),{connection:n,children:o,hasChildren:r}=t,s=n.name===vP,a=s?"In-Memory":n.name,{previewDataSourceConnection:i}=et(),[l,d]=q.useState(!1);let u;e[0]!==n.name||e[1]!==i?(u=async()=>{d(!0),await i({engine:n.name}),setTimeout(()=>d(!1),500)},e[0]=n.name,e[1]=i,e[2]=u):u=e[2];const h=u;let f,m,x;e[3]!==n.dialect?(f=c.jsx(Bk,{className:"h-4 w-4 text-muted-foreground",name:n.dialect}),e[3]=n.dialect,e[4]=f):f=e[4],e[5]!==n.dialect?(m=wP(n.dialect),e[5]=n.dialect,e[6]=m):m=e[6],e[7]!==m?(x=c.jsx("span",{className:"text-xs",children:m}),e[7]=m,e[8]=x):x=e[8];const g=a;let p,b,y,v,w;return e[9]!==g?(p=c.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",c.jsx(HT,{variableName:g}),")"]}),e[9]=g,e[10]=p):p=e[10],e[11]!==h||e[12]!==s||e[13]!==l?(b=!s&&c.jsx(Ne,{content:"Refresh connection",children:c.jsx(ve,{variant:"ghost",size:"icon",className:"ml-auto hover:bg-transparent hover:shadow-none",onClick:h,children:c.jsx(wc,{className:xe("h-4 w-4 text-muted-foreground hover:text-foreground",l&&"animate-[spin_0.5s]")})})}),e[11]=h,e[12]=s,e[13]=l,e[14]=b):b=e[14],e[15]!==f||e[16]!==x||e[17]!==p||e[18]!==b?(y=c.jsxs(J3,{children:[f,x,p,b]}),e[15]=f,e[16]=x,e[17]=p,e[18]=b,e[19]=y):y=e[19],e[20]!==o||e[21]!==r?(v=r?o:c.jsx(Mc,{content:"No databases available",className:"pl-2"}),e[20]=o,e[21]=r,e[22]=v):v=e[22],e[23]!==y||e[24]!==v?(w=c.jsxs(c.Fragment,{children:[y,v]}),e[23]=y,e[24]=v,e[25]=w):w=e[25],w},KT=t=>{const e=H.c(28),{hasSearch:n,engineName:o,database:r,children:s}=t,[a,i]=q.useState(!1),[l,d]=q.useState(!1);let u,h,f;e[0]!==n?(u=()=>{i(n)},h=[n],e[0]=n,e[1]=u,e[2]=h):(u=e[1],h=e[2]),q.useEffect(u,h),e[3]!==a||e[4]!==l?(f=()=>{i(!a),d(!l)},e[3]=a,e[4]=l,e[5]=f):f=e[5];const m=`${o}:${r.name}`;let x;e[6]!==a?(x=c.jsx(oj,{isExpanded:a}),e[6]=a,e[7]=x):x=e[7];const g=l&&a?"text-foreground":"text-muted-foreground";let p,b;e[8]!==g?(p=xe("h-4 w-4",g),e[8]=g,e[9]=p):p=e[9],e[10]!==p?(b=c.jsx(Wo,{className:p}),e[10]=p,e[11]=b):b=e[11];const y=l&&a&&"font-semibold";let v,w,S,j;e[12]!==y?(v=xe(y),e[12]=y,e[13]=v):v=e[13],e[14]!==r.name?(w=r.name===""?c.jsx("i",{children:"Not connected"}):r.name,e[14]=r.name,e[15]=w):w=e[15],e[16]!==v||e[17]!==w?(S=c.jsx("span",{className:v,children:w}),e[16]=v,e[17]=w,e[18]=S):S=e[18],e[19]!==S||e[20]!==f||e[21]!==m||e[22]!==x||e[23]!==b?(j=c.jsxs(Xn,{className:"text-sm flex flex-row gap-1 items-center cursor-pointer rounded-none",onSelect:f,value:m,children:[x,b,S]}),e[19]=S,e[20]=f,e[21]=m,e[22]=x,e[23]=b,e[24]=j):j=e[24];const C=a&&s;let _;return e[25]!==j||e[26]!==C?(_=c.jsxs(c.Fragment,{children:[j,C]}),e[25]=j,e[26]=C,e[27]=_):_=e[27],_},XT=t=>{const e=H.c(20),{schemas:n,defaultSchema:o,defaultDatabase:r,engineName:s,databaseName:a,hasSearch:i,searchValue:l}=t;if(n.length===0){let h;return e[0]===Symbol.for("react.memo_cache_sentinel")?(h=c.jsx(Mc,{content:"No schemas available",className:"pl-6"}),e[0]=h):h=e[0],h}let d,u;if(e[1]!==a||e[2]!==r||e[3]!==o||e[4]!==s||e[5]!==i||e[6]!==n||e[7]!==l){let h;e[9]!==l?(h=x=>!l||x.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]!==a||e[12]!==r||e[13]!==o||e[14]!==s||e[15]!==i||e[16]!==l?(m=x=>c.jsx(JT,{databaseName:a,schema:x,hasSearch:i,children:c.jsx($w,{tables:x.tables,searchValue:l,sqlTableContext:{engine:s,database:a,schema:x.name,defaultSchema:o,defaultDatabase:r}})},x.name),e[11]=a,e[12]=r,e[13]=o,e[14]=s,e[15]=i,e[16]=l,e[17]=m):m=e[17],d=f.map(m),e[1]=a,e[2]=r,e[3]=o,e[4]=s,e[5]=i,e[6]=n,e[7]=l,e[8]=d}else d=e[8];return e[18]!==d?(u=c.jsx(c.Fragment,{children:d}),e[18]=d,e[19]=u):u=e[19],u},JT=t=>{const e=H.c(26),{databaseName:n,schema:o,children:r,hasSearch:s}=t,[a,i]=q.useState(!1),[l,d]=q.useState(!1),u=`${n}:${o.name}`;let h,f,m,x;if(e[0]!==s?(h=()=>{i(s)},f=[s],e[0]=s,e[1]=h,e[2]=f):(h=e[1],f=e[2]),q.useEffect(h,f),nj(o.name))return r;e[3]!==a||e[4]!==l?(m=()=>{i(!a),d(!l)},e[3]=a,e[4]=l,e[5]=m):m=e[5],e[6]!==a?(x=c.jsx(oj,{isExpanded:a}),e[6]=a,e[7]=x):x=e[7];const g=l&&a&&"text-foreground";let p,b;e[8]!==g?(p=xe("h-4 w-4 text-muted-foreground",g),e[8]=g,e[9]=p):p=e[9],e[10]!==p?(b=c.jsx(_P,{className:p}),e[10]=p,e[11]=b):b=e[11];const y=l&&a&&"font-semibold";let v,w,S;e[12]!==y?(v=xe(y),e[12]=y,e[13]=v):v=e[13],e[14]!==o.name||e[15]!==v?(w=c.jsx("span",{className:v,children:o.name}),e[14]=o.name,e[15]=v,e[16]=w):w=e[16],e[17]!==w||e[18]!==m||e[19]!==x||e[20]!==b||e[21]!==u?(S=c.jsxs(Xn,{className:"text-sm flex flex-row gap-1 items-center pl-5 cursor-pointer rounded-none",onSelect:m,value:u,children:[x,b,w]}),e[17]=w,e[18]=m,e[19]=x,e[20]=b,e[21]=u,e[22]=S):S=e[22];const j=a&&r;let C;return e[23]!==S||e[24]!==j?(C=c.jsxs(c.Fragment,{children:[S,j]}),e[23]=S,e[24]=j,e[25]=C):C=e[25],C},$w=t=>{const e=H.c(24),{tables:n,sqlTableContext:o,searchValue:r}=t,{addTableList:s}=Z3(),[a,i]=q.useState(!1),[l,d]=q.useState(!1);let u,h;e[0]!==s||e[1]!==o||e[2]!==n.length||e[3]!==a?(u=async()=>{if(n.length===0&&o&&!a){i(!0),d(!0);const{engine:p,database:b,schema:y}=o,v=await HR.request({engine:p,database:b,schema:y});if(!(v!=null&&v.tables))throw d(!1),new Error("No tables available");s({tables:v.tables,sqlTableContext:o}),d(!1)}},e[0]=s,e[1]=o,e[2]=n.length,e[3]=a,e[4]=u):u=e[4],e[5]!==o||e[6]!==n.length||e[7]!==a?(h=[n.length,o,a],e[5]=o,e[6]=n.length,e[7]=a,e[8]=h):h=e[8];const{isPending:f,error:m}=In(u,h);if(f||l){let p;return e[9]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx(Q3,{message:"Loading tables...",className:"pl-12"}),e[9]=p):p=e[9],p}if(m){let p;return e[10]!==m?(p=c.jsx(ej,{error:m,className:"pl-12"}),e[10]=m,e[11]=p):p=e[11],p}if(n.length===0){let p;return e[12]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx(Mc,{content:"No tables found",className:"pl-9"}),e[12]=p):p=e[12],p}let x,g;if(e[13]!==r||e[14]!==o||e[15]!==n){let p;e[17]!==r?(p=v=>!r||v.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=v=>c.jsx(ZT,{table:v,sqlTableContext:o,isSearching:!!r},v.name),e[19]=r,e[20]=o,e[21]=y):y=e[21],x=b.map(y),e[13]=r,e[14]=o,e[15]=n,e[16]=x}else x=e[16];return e[22]!==x?(g=c.jsx(c.Fragment,{children:x}),e[22]=x,e[23]=g):g=e[23],g},ZT=t=>{const e=H.c(64),{table:n,sqlTableContext:o,isSearching:r}=t,{addTable:s}=Z3(),[a,i]=q.useState(!1),[l,d]=q.useState(!1),u=n.columns.length>0;let h,f;e[0]!==s||e[1]!==a||e[2]!==o||e[3]!==n.name||e[4]!==u||e[5]!==l?(h=async()=>{if(a&&!u&&o&&!l){d(!0);const{engine:W,database:J,schema:V}=o,Q=await WR.request({engine:W,database:J,schema:V,tableName:n.name});if(!(Q!=null&&Q.table))throw new Error("No table details available");s({table:Q.table,sqlTableContext:o})}},e[0]=s,e[1]=a,e[2]=o,e[3]=n.name,e[4]=u,e[5]=l,e[6]=h):h=e[6],e[7]!==a||e[8]!==u?(f=[a,u],e[7]=a,e[8]=u,e[9]=f):f=e[9];const{isFetching:m,isPending:x,error:g}=In(h,f),p=Se(Yl),b=ls(),{createNewCell:y}=it(),v=tj();let w;e[10]!==v||e[11]!==p||e[12]!==y||e[13]!==b||e[14]!==o||e[15]!==n?(w=()=>{Kn({autoInstantiate:p,createNewCell:y,fromCellId:b}),v((()=>{if(n.source_type==="catalog"){const W=o!=null&&o.database?`${o.database}.${n.name}`:n.name;return`${n.engine}.load_table("${W}")`}if(o)return rj({table:n,columnName:"*",sqlTableContext:o});switch(n.source_type){case"local":return`mo.ui.table(${n.name})`;case"duckdb":case"connection":return rj({table:n,columnName:"*",sqlTableContext:o});default:return nc(n.source_type),""}})())},e[10]=v,e[11]=p,e[12]=y,e[13]=b,e[14]=o,e[15]=n,e[16]=w):w=e[16];const S=w;let j;e[17]!==n.num_columns||e[18]!==n.num_rows?(j=()=>{const W=[];return n.num_rows!=null&&W.push(`${n.num_rows} rows`),n.num_columns!=null&&W.push(`${n.num_columns} columns`),W.length===0?null:c.jsx("div",{className:"flex flex-row gap-2 items-center pl-6 group-hover:hidden",children:c.jsx("span",{className:"text-xs text-muted-foreground",children:W.join(", ")})})},e[17]=n.num_columns,e[18]=n.num_rows,e[19]=j):j=e[19];const C=j;let _;e[20]!==g||e[21]!==m||e[22]!==x||e[23]!==o||e[24]!==n?(_=()=>{if(x||m)return c.jsx(Q3,{message:"Loading columns...",className:"pl-12"});if(g)return c.jsx(ej,{error:g,className:"pl-12"});const W=n.columns;return W.length===0?c.jsx(Mc,{content:"No columns found",className:"pl-12"}):W.map(J=>c.jsx(QT,{table:n,column:J,sqlTableContext:o},J.name))},e[20]=g,e[21]=m,e[22]=x,e[23]=o,e[24]=n,e[25]=_):_=e[25];const E=_;let M;e[26]!==a||e[27]!==r||e[28]!==n.source_type||e[29]!==n.type?(M=()=>{if(n.source_type==="local")return;const W=n.type==="table"?kP:Vf;return c.jsx(W,{className:"h-3 w-3",strokeWidth:a||r?2.5:void 0})},e[26]=a,e[27]=r,e[28]=n.source_type,e[29]=n.type,e[30]=M):M=e[30];const I=M,D=o?`${o.database}.${o.schema}.${n.name}`:n.name,F=o&&(nj(o.schema)?"pl-9":"pl-12"),O=(a||r)&&"font-semibold";let P,R,z,N,k,B,A,U,$,X,Y,G;return e[31]!==F||e[32]!==O?(P=xe("rounded-none group h-8 cursor-pointer",F,O),e[31]=F,e[32]=O,e[33]=P):P=e[33],e[34]!==a?(R=()=>i(!a),e[34]=a,e[35]=R):R=e[35],e[36]!==I?(z=I(),e[36]=I,e[37]=z):z=e[37],e[38]!==n.name?(N=c.jsx("span",{className:"text-sm",children:n.name}),e[38]=n.name,e[39]=N):N=e[39],e[40]!==z||e[41]!==N?(k=c.jsxs("div",{className:"flex gap-2 items-center flex-1",children:[z,N]}),e[40]=z,e[41]=N,e[42]=k):k=e[42],e[43]!==C?(B=C(),e[43]=C,e[44]=B):B=e[44],e[45]!==S?(A=Rn.stopPropagation(()=>S()),e[45]=S,e[46]=A):A=e[46],e[47]===Symbol.for("react.memo_cache_sentinel")?(U=c.jsx(jP,{className:"h-3 w-3"}),e[47]=U):U=e[47],e[48]!==A?($=c.jsx(Ne,{content:"Add table to notebook",delayDuration:400,children:c.jsx(ve,{className:"group-hover:inline-flex hidden",variant:"text",size:"icon",onClick:A,children:U})}),e[48]=A,e[49]=$):$=e[49],e[50]!==a||e[51]!==R||e[52]!==k||e[53]!==B||e[54]!==$||e[55]!==P||e[56]!==D?(X=c.jsxs(Xn,{className:P,value:D,"aria-selected":a,forceMount:!0,onSelect:R,children:[k,B,$]}),e[50]=a,e[51]=R,e[52]=k,e[53]=B,e[54]=$,e[55]=P,e[56]=D,e[57]=X):X=e[57],e[58]!==a||e[59]!==E?(Y=a&&E(),e[58]=a,e[59]=E,e[60]=Y):Y=e[60],e[61]!==X||e[62]!==Y?(G=c.jsxs(c.Fragment,{children:[X,Y]}),e[61]=X,e[62]=Y,e[63]=G):G=e[63],G},QT=t=>{var A,U;const e=H.c(51),{table:n,column:o,sqlTableContext:r}=t,[s,a]=q.useState(!1),i=Se(X3),l=jt(SP);let d,u;e[0]!==i?(d=()=>{i&&a(!1)},u=[i],e[0]=i,e[1]=d,e[2]=u):(d=e[1],u=e[2]),q.useEffect(d,u),l(s?$=>new Set([...$,`${n.name}:${o.name}`]):$=>($.delete(`${n.name}:${o.name}`),new Set($)));const h=tj(),{columnsPreviews:f}=CP();let m;e[3]!==o.name||e[4]!==n.primary_keys?(m=((A=n.primary_keys)==null?void 0:A.includes(o.name))||!1,e[3]=o.name,e[4]=n.primary_keys,e[5]=m):m=e[5];const x=m;let g;e[6]!==o.name||e[7]!==n.indexes?(g=((U=n.indexes)==null?void 0:U.includes(o.name))||!1,e[6]=o.name,e[7]=n.indexes,e[8]=g):g=e[8];const p=g;let b;e[9]!==h?(b=$=>{h($)},e[9]=h,e[10]=b):b=e[10];const y=b,v=e7,w=s?"font-semibold":"";let S;e[11]!==o.name||e[12]!==w?(S=c.jsx("span",{className:w,children:o.name}),e[11]=o.name,e[12]=w,e[13]=S):S=e[13];const j=S,C=`${n.name}.${o.name}`,_=`${n.name}.${o.name}`;let E;e[14]!==s?(E=()=>a(!s),e[14]=s,e[15]=E):E=e[15];const M=r?"pl-14":"pl-7";let I,D,F,O,P,R,z,N,k,B;return e[16]!==M?(I=xe("flex flex-row gap-2 items-center flex-1",M),e[16]=M,e[17]=I):I=e[17],e[18]!==o.type||e[19]!==j?(D=c.jsx(NP,{columnName:j,dataType:o.type}),e[18]=o.type,e[19]=j,e[20]=D):D=e[20],e[21]!==x?(F=x&&v({tooltipContent:"Primary key",content:"PK"}),e[21]=x,e[22]=F):F=e[22],e[23]!==p?(O=p&&v({tooltipContent:"Indexed",content:"IDX"}),e[23]=p,e[24]=O):O=e[24],e[25]!==I||e[26]!==D||e[27]!==F||e[28]!==O?(P=c.jsxs("div",{className:I,children:[D,F,O]}),e[25]=I,e[26]=D,e[27]=F,e[28]=O,e[29]=P):P=e[29],e[30]!==o.name?(R=c.jsx(Ne,{content:"Copy column name",delayDuration:400,children:c.jsx(ve,{variant:"text",size:"icon",className:"group-hover:opacity-100 opacity-0 hover:bg-muted text-muted-foreground hover:text-foreground",children:c.jsx(W3,{tooltip:!1,value:o.name,className:"h-3 w-3"})})}),e[30]=o.name,e[31]=R):R=e[31],e[32]!==o.external_type?(z=c.jsx("span",{className:"text-xs text-muted-foreground",children:o.external_type}),e[32]=o.external_type,e[33]=z):z=e[33],e[34]!==E||e[35]!==P||e[36]!==R||e[37]!==z||e[38]!==C||e[39]!==_?(N=c.jsxs(Xn,{className:"rounded-none py-1 group cursor-pointer",value:_,onSelect:E,children:[P,R,z]},C),e[34]=E,e[35]=P,e[36]=R,e[37]=z,e[38]=C,e[39]=_,e[40]=N):N=e[40],e[41]!==o||e[42]!==f||e[43]!==y||e[44]!==s||e[45]!==r||e[46]!==n?(k=s&&c.jsx("div",{className:"pl-10 pr-2 py-2 bg-(--slate-1) shadow-inner border-b",children:c.jsx(dc,{children:c.jsx(EP,{table:n,column:o,onAddColumnChart:y,preview:f.get(r?`${r.database}.${r.schema}.${n.name}:${o.name}`:`${n.name}:${o.name}`),sqlTableContext:r})})}),e[41]=o,e[42]=f,e[43]=y,e[44]=s,e[45]=r,e[46]=n,e[47]=k):k=e[47],e[48]!==N||e[49]!==k?(B=c.jsxs(c.Fragment,{children:[N,k]}),e[48]=N,e[49]=k,e[50]=B):B=e[50],B};function e7(t){const{tooltipContent:e,content:n}=t;return c.jsx(Ne,{content:e,delayDuration:100,children:c.jsx("span",{className:"text-xs text-black bg-gray-100 dark:invert rounded px-1",children:n})})}const t7=()=>{const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx(GT,{}),t[0]=e):e=t[0],e},n7=()=>{const t=H.c(5),{documentation:e}=Se(IP);if(!e){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=c.jsx(ln,{title:"View docs as you type",description:"Move your text cursor over a symbol to see its documentation.",icon:c.jsx(Jc,{})}),t[0]=r):r=t[0],r}let n,o;return t[1]!==e?(n=Am({html:e}),t[1]=e,t[2]=n):n=t[2],t[3]!==n?(o=c.jsx("div",{className:"p-3 overflow-y-auto overflow-x-hidden h-full docs-documentation flex flex-col gap-4",children:n}),t[3]=n,t[4]=o):o=t[4],o},o7=()=>{const t=H.c(5),e=AP();if(e.length===0){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=c.jsx(ln,{title:"No errors!",icon:c.jsx(bp,{})}),t[0]=r):r=t[0],r}let n,o;return t[1]!==e?(n=e.map(r7),t[1]=e,t[2]=n):n=t[2],t[3]!==n?(o=c.jsx("div",{className:"flex flex-col overflow-auto",children:n}),t[3]=n,t[4]=o):o=t[4],o};function r7(t){return c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-mono font-semibold bg-muted border-y px-2 py-1",children:c.jsx(TP,{cellId:t.cellId})}),c.jsx("div",{className:"px-2",children:c.jsx(MP,{errors:t.output.data,cellId:t.cellId},t.cellId)},t.cellId)]},t.cellId)}const Df=new Map,s7=({file:t,onOpenNotebook:e})=>{const{theme:n}=Ko(),{sendFileDetails:o,sendUpdateFile:r}=et(),s=Se(Ql),[a,i]=T.useState(""),{data:l,isPending:d,error:u,setData:h}=In(async()=>{const b=await o({path:t.path}),y=b.contents||"";return i(Df.get(t.path)||y),b},[t.path]),f=async()=>{a!==(l==null?void 0:l.contents)&&await r({path:t.path,contents:a}).then(b=>{b.success&&(h(y=>({...y,contents:a})),i(a))})},m=T.useRef(a);if(m.current=a,T.useEffect(()=>()=>{if(!(l!=null&&l.contents))return;const b=m.current;b===l.contents?Df.delete(t.path):Df.set(t.path,b)},[t.path,l==null?void 0:l.contents]),u)return c.jsx(xr,{error:u});if(d||!l)return null;const x=l.mimeType||"text/plain",g=x in Pf;if(!l.contents&&!g)return c.jsxs("div",{className:"grid grid-cols-2 gap-2 p-6",children:[c.jsx("div",{className:"font-bold text-muted-foreground",children:"Name"}),c.jsx("div",{children:l.file.name}),c.jsx("div",{className:"font-bold text-muted-foreground",children:"Type"}),c.jsx("div",{children:x})]});const p=c.jsxs("div",{className:"text-xs text-muted-foreground p-1 flex justify-end gap-2 border-b",children:[t.isMarimoFile&&!Zt()&&c.jsx(Ne,{content:"Open notebook",children:c.jsx(an,{size:"small",onClick:b=>e(b),children:c.jsx(ic,{})})}),c.jsx(Ne,{content:"Download",children:c.jsx(an,{size:"small",onClick:()=>{if(Vw(x)){const b=FP(l.contents,x);return void zP(b,l.file.name)}za(new Blob([l.contents||a],{type:x}),l.file.name)},children:c.jsx(nm,{})})}),!Vw(x)&&c.jsxs(c.Fragment,{children:[c.jsx(Ne,{content:"Copy contents to clipboard",children:c.jsx(an,{size:"small",onClick:async()=>{await on(a)},children:c.jsx(Na,{})})}),c.jsx(Ne,{content:Wt("global.save"),children:c.jsx(an,{size:"small",color:a===l.contents?void 0:"green",onClick:f,disabled:a===l.contents,children:c.jsx(hi,{})})})]})]});return x.startsWith("image/")?c.jsxs(c.Fragment,{children:[p,c.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:c.jsx(OP,{base64:l.contents,mime:x})})]}):x==="text/csv"&&l.contents?c.jsxs(c.Fragment,{children:[p,c.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:c.jsx(DP,{contents:l.contents})})]}):x.startsWith("audio/")?c.jsxs(c.Fragment,{children:[p,c.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:c.jsx(PP,{base64:l.contents,mime:x})})]}):x.startsWith("video/")?c.jsxs(c.Fragment,{children:[p,c.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:c.jsx(RP,{base64:l.contents,mime:x})})]}):x.startsWith("application/pdf")?c.jsxs(c.Fragment,{children:[p,c.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:c.jsx(LP,{base64:l.contents,mime:x})})]}):c.jsxs(c.Fragment,{children:[p,c.jsx("div",{className:"flex-1 overflow-auto",children:c.jsx(T.Suspense,{children:c.jsx(oi,{theme:n==="dark"?"dark":"light",language:Pf[x]||Pf.default,className:"border-b",extensions:[We.lineWrapping,An.of([{key:s.getHotkey("global.save").key,stopPropagation:!0,run:()=>a!==l.contents&&(f(),!0)}])],value:a,onChange:i})})})]})},Vw=t=>t.startsWith("image/")||t.startsWith("audio/")||t.startsWith("video/")||t.startsWith("application/pdf"),Pf={"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"};class a7{constructor(e){this.callbacks=e,this.delegate=new Lm([]),this.rootPath="",this.onChange=Ln.NOOP,this.path=new rc("/"),this.initialize=async n=>{if(this.onChange=n,this.delegate.data.length===0)try{const o=await this.callbacks.listFiles({path:this.rootPath});this.delegate=new Lm(o.files),this.rootPath=o.root,this.path=rc.guessDeliminator(o.root)}catch(o){Je({title:"Failed",description:v3(o)})}this.onChange(this.delegate.data)},this.refreshAll=async n=>{const o=[this.rootPath,...n.map(s=>{var a;return(a=this.delegate.find(s))==null?void 0:a.data.path})].filter(Boolean),r=await Promise.all(o.map(s=>this.callbacks.listFiles({path:s}).catch(()=>({files:[]}))));for(const[s,a]of o.entries()){const i=r[s];a===this.rootPath?this.delegate=new Lm(i.files):this.delegate.update({id:a,changes:{children:i.files}})}this.onChange(this.delegate.data)},this.relativeFromRoot=n=>{const o=this.rootPath.endsWith(this.path.deliminator)?this.rootPath:`${this.rootPath}${this.path.deliminator}`;return n.startsWith(o)?n.slice(o.length):n},this.handleResponse=n=>n.success?n:(Je({title:"Failed",description:n.message}),null)}async expand(e){const n=this.delegate.find(e);if(!n||!n.data.isDirectory)return!1;if(n.children&&n.children.length>0)return!0;const o=await this.callbacks.listFiles({path:n.data.path});return this.delegate.update({id:e,changes:{children:o.files}}),this.onChange(this.delegate.data),!0}async rename(e,n){const o=this.delegate.find(e);if(!o)return;const r=o.data.path,s=this.path.join(this.path.dirname(r),n);await this.callbacks.renameFileOrFolder({path:r,newPath:s}).then(this.handleResponse),this.delegate.update({id:e,changes:{name:n,path:s}}),this.onChange(this.delegate.data),await this.refreshAll([s])}async move(e,n){var r;const o=n?((r=this.delegate.find(n))==null?void 0:r.data.path)??n:this.rootPath;await Promise.all(e.map(s=>{this.delegate.move({id:s,parentId:n,index:0});const a=this.delegate.find(s);if(!a)return Promise.resolve();const i=this.path.join(o,this.path.basename(a.data.path));return this.delegate.update({id:s,changes:{path:i}}),this.callbacks.renameFileOrFolder({path:a.data.path,newPath:i}).then(this.handleResponse)})),this.onChange(this.delegate.data),await this.refreshAll([o])}async createFile(e,n){var s;const o=n?((s=this.delegate.find(n))==null?void 0:s.data.path)??n:this.rootPath,r=await this.callbacks.createFileOrFolder({path:o,type:"file",name:e}).then(this.handleResponse);r!=null&&r.info&&(this.delegate.create({parentId:n,index:0,data:r.info}),this.onChange(this.delegate.data),await this.refreshAll([o]))}async createFolder(e,n){var s;const o=n?((s=this.delegate.find(n))==null?void 0:s.data.path)??n:this.rootPath,r=await this.callbacks.createFileOrFolder({path:o,type:"directory",name:e}).then(this.handleResponse);r!=null&&r.info&&(this.delegate.create({parentId:n,index:0,data:r.info}),this.onChange(this.delegate.data),await this.refreshAll([o]))}async delete(e){const n=this.delegate.find(e);n&&(await this.callbacks.deleteFileOrFolder({path:n.data.path}).then(this.handleResponse),this.delegate.drop({id:e}),this.onChange(this.delegate.data))}}const Hw=yt(t=>{const e=t(BP);return Fn(e,"no requestClientAtom set"),new a7({listFiles:e.sendListFiles,createFileOrFolder:e.sendCreateFileOrFolder,deleteFileOrFolder:e.sendDeleteFileOrFolder,renameFileOrFolder:e.sendRenameFileOrFolder})}),i7=yt({});function l7(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 Ww(t){const e=H.c(7);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const o=n,{sendCreateFileOrFolder:r}=et();let s,a;return e[2]!==r?(s=async i=>{for(const l of i){const d=m7(f7(l));let u="";d&&(u=rc.guessDeliminator(d).dirname(d));const h=(await l7(l)).split(",")[1];await r({path:u,type:"file",name:l.name,contents:h})}await async function(){await Qe.get(Hw).refreshAll([])}()},e[2]=r,e[3]=s):s=e[3],e[4]!==o||e[5]!==s?(a={multiple:!0,maxSize:104857600,onError:h7,onDropRejected:c7,onDrop:s,...o},e[4]=o,e[5]=s,e[6]=a):a=e[6],UP(a)}function c7(t){Je({title:"File upload failed",description:c.jsx("div",{className:"flex flex-col gap-1",children:t.map(d7)}),variant:"danger"})}function d7(t){return c.jsxs("div",{children:[t.file.name," (",t.errors.map(u7).join(", "),")"]},t.file.name)}function u7(t){return t.message}function h7(t){ft.error(t),Je({title:"File upload failed",description:t.message,variant:"danger"})}function f7(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 m7(t){if(t)return t.replace(/^\/+/,"")}const qw=q.createContext(null),p7=t=>{const e=H.c(60),{height:n}=t,o=T.useRef(null),[r]=Ot(Hw);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[0]=s):s=e[0];const[a,i]=T.useState(s),[l,d]=T.useState(null),{openPrompt:u}=_n(),[h,f]=Ot(i7);let m,x;e[1]!==r?(m=()=>r.initialize(i),e[1]=r,e[2]=m):m=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(x=[],e[3]=x):x=e[3];const{isPending:g,error:p}=In(m,x);let b;e[4]!==h||e[5]!==r?(b=()=>{r.refreshAll(Object.keys(h).filter(k=>h[k]))},e[4]=h,e[5]=r,e[6]=b):b=e[6];const y=Le(b);let v;e[7]!==u||e[8]!==r?(v=async()=>{u({title:"Folder name",onConfirm:async k=>{r.createFolder(k,null)}})},e[7]=u,e[8]=r,e[9]=v):v=e[9];const w=Le(v);let S;e[10]!==u||e[11]!==r?(S=async()=>{u({title:"File name",onConfirm:async k=>{r.createFile(k,null)}})},e[10]=u,e[11]=r,e[12]=S):S=e[12];const j=Le(S);let C;e[13]!==f?(C=()=>{var k;(k=o.current)==null||k.closeAll(),f({})},e[13]=f,e[14]=C):C=e[14];const _=Le(C);if(g){let k;return e[15]===Symbol.for("react.memo_cache_sentinel")?(k=c.jsx(vn,{size:"medium",centered:!0}),e[15]=k):k=e[15],k}if(p){let k;return e[16]!==p?(k=c.jsx(xr,{error:p}),e[16]=p,e[17]=k):k=e[17],k}if(l){let k,B,A,U,$,X;return e[18]===Symbol.for("react.memo_cache_sentinel")?(k=()=>d(null),e[18]=k):k=e[18],e[19]===Symbol.for("react.memo_cache_sentinel")?(B=c.jsx(ve,{onClick:k,"data-testid":"file-explorer-back-button",variant:"text",size:"xs",className:"mb-0",children:c.jsx(wt,{size:16})}),e[19]=B):B=e[19],e[20]!==l.name?(A=c.jsxs("div",{className:"flex items-center pl-1 pr-3 shrink-0 border-b justify-between",children:[B,c.jsx("span",{className:"font-bold",children:l.name})]}),e[20]=l.name,e[21]=A):A=e[21],e[22]!==l.path||e[23]!==r?(U=Y=>Gw(Y,r.relativeFromRoot(l.path)),e[22]=l.path,e[23]=r,e[24]=U):U=e[24],e[25]!==l||e[26]!==U?($=c.jsx(T.Suspense,{children:c.jsx(s7,{onOpenNotebook:U,file:l})}),e[25]=l,e[26]=U,e[27]=$):$=e[27],e[28]!==A||e[29]!==$?(X=c.jsxs(c.Fragment,{children:[A,$]}),e[28]=A,e[29]=$,e[30]=X):X=e[30],X}let E;e[31]!==_||e[32]!==j||e[33]!==w||e[34]!==y||e[35]!==r?(E=c.jsx(x7,{onRefresh:y,onCreateFile:j,onCreateFolder:w,onCollapseAll:_,tree:r}),e[31]=_,e[32]=j,e[33]=w,e[34]=y,e[35]=r,e[36]=E):E=e[36];const M=n-33;let I,D,F,O,P,R,z,N;return e[37]!==r?(I=async k=>{const{ids:B}=k;for(const A of B)await r.delete(A)},D=async k=>{const{id:B,name:A}=k;await r.rename(B,A)},F=async k=>{const{dragIds:B,parentId:A}=k;await r.move(B,A)},e[37]=r,e[38]=I,e[39]=D,e[40]=F):(I=e[38],D=e[39],F=e[40]),e[41]===Symbol.for("react.memo_cache_sentinel")?(O=k=>{const B=k[0];B&&(B.data.isDirectory||d(B.data))},e[41]=O):O=e[41],e[42]!==h||e[43]!==f||e[44]!==r?(P=async k=>{if(await r.expand(k)){const B=h[k]??!1;f({...h,[k]:!B})}},e[42]=h,e[43]=f,e[44]=r,e[45]=P):P=e[45],e[46]!==a||e[47]!==h||e[48]!==I||e[49]!==D||e[50]!==F||e[51]!==P||e[52]!==M?(R=c.jsx(ER,{width:"100%",ref:o,height:M,className:"h-full",data:a,initialOpenState:h,openByDefault:!1,renderCursor:k7,disableDrop:j7,onDelete:I,onRename:D,onMove:F,onSelect:O,onToggle:P,padding:15,rowHeight:30,indent:g7,overscanCount:1e3,disableMultiSelection:!0,children:v7}),e[46]=a,e[47]=h,e[48]=I,e[49]=D,e[50]=F,e[51]=P,e[52]=M,e[53]=R):R=e[53],e[54]!==R||e[55]!==r?(z=c.jsx(qw,{value:r,children:R}),e[54]=R,e[55]=r,e[56]=z):z=e[56],e[57]!==z||e[58]!==E?(N=c.jsxs(c.Fragment,{children:[E,z]}),e[57]=z,e[58]=E,e[59]=N):N=e[59],N},g7=15,x7=t=>{const e=H.c(30),{onRefresh:n,onCreateFile:o,onCreateFolder:r,onCollapseAll:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={noDrag:!0,noDragEventsBubbling:!0},e[0]=a):a=e[0];const{getRootProps:i,getInputProps:l}=Ww(a);let d,u,h,f,m,x,g,p,b,y,v,w,S,j,C;return e[1]===Symbol.for("react.memo_cache_sentinel")?(d=c.jsx(di,{size:16}),e[1]=d):d=e[1],e[2]!==o?(u=c.jsx(Ne,{content:"Add file",children:c.jsx(ve,{"data-testid":"file-explorer-add-file-button",onClick:o,variant:"text",size:"xs",children:d})}),e[2]=o,e[3]=u):u=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(h=c.jsx(Vc,{size:16}),e[4]=h):h=e[4],e[5]!==r?(f=c.jsx(Ne,{content:"Add folder",children:c.jsx(ve,{"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]!==i?(m=i({}),e[7]=i,e[8]=m):m=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(x=$P({variant:"text",size:"xs"}),g=c.jsx(HP,{size:16}),e[9]=x,e[10]=g):(x=e[9],g=e[10]),e[11]!==m?(p=c.jsx(Ne,{content:"Upload file",children:c.jsx("button",{"data-testid":"file-explorer-upload-button",...m,className:x,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=c.jsx("input",{...b,type:"file"}),e[15]=b,e[16]=y):y=e[16],e[17]===Symbol.for("react.memo_cache_sentinel")?(v=c.jsx(A3,{size:16}),e[17]=v):v=e[17],e[18]!==n?(w=c.jsx(Ne,{content:"Refresh",children:c.jsx(ve,{"data-testid":"file-explorer-refresh-button",onClick:n,variant:"text",size:"xs",children:v})}),e[18]=n,e[19]=w):w=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(S=c.jsx(Xm,{size:16}),e[20]=S):S=e[20],e[21]!==s?(j=c.jsx(Ne,{content:"Collapse all folders",children:c.jsx(ve,{"data-testid":"file-explorer-collapse-button",onClick:s,variant:"text",size:"xs",children:S})}),e[21]=s,e[22]=j):j=e[22],e[23]!==y||e[24]!==w||e[25]!==j||e[26]!==u||e[27]!==f||e[28]!==p?(C=c.jsxs("div",{className:"flex items-center justify-end px-2 shrink-0 border-b",children:[u,f,p,y,w,j]}),e[23]=y,e[24]=w,e[25]=j,e[26]=u,e[27]=f,e[28]=p,e[29]=C):C=e[29],C},b7=t=>{const e=H.c(9),{node:n,onOpenMarimoFile:o}=t;let r,s,a;return e[0]!==n?(r=i=>{n.data.isDirectory||(i.stopPropagation(),n.select())},e[0]=n,e[1]=r):r=e[1],e[2]!==n.data.isMarimoFile||e[3]!==o?(s=n.data.isMarimoFile&&!Zt()&&c.jsxs("span",{className:"shrink-0 ml-2 text-sm hidden group-hover:inline hover:underline",onClick:o,children:["open ",c.jsx(ic,{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?(a=c.jsxs("span",{className:"flex-1 overflow-hidden text-ellipsis",onClick:r,children:[n.data.name,s]}),e[5]=n.data.name,e[6]=r,e[7]=s,e[8]=a):a=e[8],a},y7=t=>{const e=H.c(10),{node:n}=t,o=T.useRef(null);let r,s,a,i,l;return e[0]!==n.data.name?(r=()=>{var d,u;(d=o.current)==null||d.focus(),(u=o.current)==null||u.setSelectionRange(0,n.data.name.lastIndexOf("."))},s=[n.data.name],e[0]=n.data.name,e[1]=r,e[2]=s):(r=e[1],s=e[2]),T.useEffect(r,s),e[3]!==n?(a=()=>n.reset(),i=d=>{d.key==="Escape"&&n.reset(),d.key==="Enter"&&n.submit(d.currentTarget.value)},e[3]=n,e[4]=a,e[5]=i):(a=e[4],i=e[5]),e[6]!==n.data.name||e[7]!==a||e[8]!==i?(l=c.jsx("input",{ref:o,className:"flex-1 bg-transparent border border-border text-muted-foreground",defaultValue:n.data.name,onClick:S7,onBlur:a,onKeyDown:i}),e[6]=n.data.name,e[7]=a,e[8]=i,e[9]=l):l=e[9],l},v7=({node:t,style:e,dragHandle:n})=>{const{openFile:o,sendCreateFileOrFolder:r,sendFileDetails:s}=et(),a=t.data.isDirectory?"directory":qk(t.data.name),i=Gk[a],{openConfirm:l,openPrompt:d}=_n(),{createNewCell:u}=it(),h=ls(),f=T.use(qw),m=async y=>{Gw(y,f?f.relativeFromRoot(t.data.path):t.data.path)},x=async y=>{y.stopPropagation(),y.preventDefault(),l({title:"Delete file",description:`Are you sure you want to delete ${t.data.name}?`,confirmAction:c.jsx(Uk,{onClick:async()=>{await t.tree.delete(t.id)},"aria-label":"Confirm",children:"Delete"})})},g=Le(async()=>{t.open(),d({title:"Folder name",onConfirm:async y=>{f==null||f.createFolder(y,t.id)}})}),p=Le(async()=>{t.open(),d({title:"File name",onConfirm:async y=>{f==null||f.createFile(y,t.id)}})}),b=Le(async()=>{var S;if(!f||t.data.isDirectory)return;const[y,v]=VP(t.data.name),w=`${y}_copy${v}`;try{const j=await s({path:t.data.path}),C=((S=t.parent)==null?void 0:S.data.path)||"";await r({path:C,type:"file",name:w,contents:j.contents?btoa(j.contents):void 0}),await f.refreshAll([C])}catch{Je({title:"Failed to duplicate file",description:"Unable to create a duplicate of the file",variant:"danger"})}});return c.jsxs("div",{style:e,ref:n,className:xe("flex items-center cursor-pointer ml-1 text-muted-foreground whitespace-nowrap group"),draggable:!0,onClick:y=>{y.stopPropagation(),t.data.isDirectory&&t.toggle()},children:[c.jsx(w7,{node:t}),c.jsxs("span",{className:xe("flex items-center pl-1 py-1 cursor-pointer hover:bg-accent/50 hover:text-accent-foreground rounded-l flex-1 overflow-hidden group",t.willReceiveDrop&&t.data.isDirectory&&"bg-accent/80 hover:bg-accent/80 text-accent-foreground"),children:[t.data.isMarimoFile?c.jsx("img",{src:qR,className:"w-5 h-5 shrink-0 mr-2 filter grayscale",alt:"Marimo"}):c.jsx(i,{className:"w-5 h-5 shrink-0 mr-2",strokeWidth:1.5}),t.isEditing?c.jsx(y7,{node:t}):c.jsx(b7,{node:t,onOpenMarimoFile:m}),c.jsxs(So,{modal:!1,children:[c.jsx(Co,{asChild:!0,tabIndex:-1,onClick:y=>y.stopPropagation(),children:c.jsx(ve,{"data-testid":"file-explorer-more-button",variant:"text",tabIndex:-1,size:"xs",className:"mb-0","aria-label":"More options",children:c.jsx($c,{strokeWidth:2,className:"w-5 h-5 hidden group-hover:block"})})}),(()=>{const y={size:14,strokeWidth:1.5,className:"mr-2"};return c.jsxs(No,{align:"end",className:"no-print w-[220px]",onClick:v=>v.stopPropagation(),onCloseAutoFocus:v=>v.preventDefault(),children:[!t.data.isDirectory&&c.jsxs(It,{onSelect:()=>t.select(),children:[c.jsx(Op,{...y}),"Open file"]}),!t.data.isDirectory&&!Zt()&&c.jsxs(It,{onSelect:()=>{o({path:t.data.path})},children:[c.jsx(ic,{...y}),"Open file in external editor"]}),t.data.isDirectory&&c.jsxs(c.Fragment,{children:[c.jsxs(It,{onSelect:()=>p(),children:[c.jsx(di,{...y}),"Create file"]}),c.jsxs(It,{onSelect:()=>g(),children:[c.jsx(Vc,{...y}),"Create folder"]}),c.jsx(rn,{})]}),c.jsxs(It,{onSelect:()=>t.edit(),children:[c.jsx(yp,{...y}),"Rename"]}),!t.data.isDirectory&&c.jsxs(It,{onSelect:b,children:[c.jsx(Na,{...y}),"Duplicate"]}),c.jsxs(It,{onSelect:async()=>{await on(t.data.path),Je({title:"Copied to clipboard"})},children:[c.jsx(qc,{...y}),"Copy path"]}),f&&c.jsxs(It,{onSelect:async()=>{await on(f.relativeFromRoot(t.data.path)),Je({title:"Copied to clipboard"})},children:[c.jsx(qc,{...y}),"Copy relative path"]}),c.jsx(rn,{}),c.jsxs(It,{onSelect:()=>{const{path:v}=t.data;(w=>{u({code:w,before:!1,cellId:h??"__end__"})})(sj[a](v))},children:[c.jsx(wr,{...y}),"Insert snippet for reading file"]}),c.jsxs(It,{onSelect:async()=>{Je({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:v}=t.data,w=sj[a](v);await on(w)},children:[c.jsx(WP,{...y}),"Copy snippet for reading file"]}),t.data.isMarimoFile&&!Zt()&&c.jsxs(c.Fragment,{children:[c.jsx(rn,{}),c.jsxs(It,{onSelect:m,children:[c.jsx(_p,{...y}),"Open notebook"]})]}),c.jsx(rn,{}),!t.data.isDirectory&&c.jsxs(c.Fragment,{children:[c.jsxs(It,{onSelect:async()=>{const v=(await s({path:t.data.path})).contents||"";za(new Blob([v]),t.data.name)},children:[c.jsx(nm,{...y}),"Download"]}),c.jsx(rn,{})]}),c.jsxs(It,{onSelect:x,variant:"danger",children:[c.jsx(Zl,{...y}),"Delete"]})]})})()]})]})]})},w7=t=>{const e=H.c(3),{node:n}=t;if(!n.data.isDirectory){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=c.jsx("span",{className:"w-5 h-5 shrink-0"}),e[0]=r):r=e[0],r}let o;return e[1]!==n.isOpen?(o=n.isOpen?c.jsx(jo,{className:"w-5 h-5 shrink-0"}):c.jsx(Ta,{className:"w-5 h-5 shrink-0"}),e[1]=n.isOpen,e[2]=o):o=e[2],o};function Gw(t,e){t.stopPropagation(),t.preventDefault(),mj(e)}function k7(){return null}function j7(t){const{parentNode:e}=t;return!e.data.isDirectory}function S7(t){return t.stopPropagation()}let Yw,Kw,Xw;Yw=()=>{const t=H.c(20),{ref:e,height:n}=qP(),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:a,isDragActive:i}=Ww(r);let l,d,u,h,f,m,x,g;return t[1]!==s?(l=s(),t[1]=s,t[2]=l):l=t[2],t[3]===Symbol.for("react.memo_cache_sentinel")?(d=xe("flex flex-col flex-1 overflow-hidden relative"),t[3]=d):d=t[3],t[4]!==a?(u=a(),t[4]=a,t[5]=u):u=t[5],t[6]!==u?(h=c.jsx("input",{...u}),t[6]=u,t[7]=h):h=t[7],t[8]!==i?(f=i&&c.jsx("div",{className:"absolute inset-0 flex items-center uppercase justify-center text-xl font-bold text-primary/90 bg-accent/85 z-10 border-2 border-dashed border-primary/90 rounded-lg pointer-events-none",children:"Drop files here"}),t[8]=i,t[9]=f):f=t[9],t[10]!==o?(m=c.jsx(p7,{height:o}),t[10]=o,t[11]=m):m=t[11],t[12]!==e||t[13]!==m?(x=c.jsx("div",{ref:e,className:"flex flex-col flex-1 overflow-hidden",children:m}),t[12]=e,t[13]=m,t[14]=x):x=t[14],t[15]!==l||t[16]!==h||t[17]!==f||t[18]!==x?(g=c.jsxs("div",{...l,className:d,children:[h,f,x]}),t[15]=l,t[16]=h,t[17]=f,t[18]=x,t[19]=g):g=t[19],g},Hm=t=>{const e=H.c(6),n=t.dataTestId;let o,r;return e[0]!==t.className?(o=xe("text-xs font-semibold text-accent-foreground",t.className),e[0]=t.className,e[1]=o):o=e[1],e[2]!==t.dataTestId||e[3]!==t.onClick||e[4]!==o?(r=c.jsx("button",{type:"button","data-testid":n,className:o,onClick:t.onClick,children:"Clear"}),e[2]=t.dataTestId,e[3]=t.onClick,e[4]=o,e[5]=r):r=e[5],r},Kw=()=>{const t=H.c(9),e=GP(),{clearLogs:n}=it();if(e.length===0){let a,i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx("code",{className:"border rounded px-1",children:"stdout"}),t[0]=a):a=t[0],t[1]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(ln,{title:"No logs",description:c.jsxs("span",{children:[a," and"," ",c.jsx("code",{className:"border rounded px-1",children:"stderr"})," logs will appear here."]}),icon:c.jsx($f,{})}),t[1]=i):i=t[1],i}let o,r,s;return t[2]!==n?(o=c.jsx("div",{className:"flex flex-row justify-end px-2 py-1",children:c.jsx(Hm,{dataTestId:"clear-logs-button",onClick:n})}),t[2]=n,t[3]=o):o=t[3],t[4]!==e?(r=c.jsx("div",{className:"overflow-auto flex-1",children:c.jsx(Xw,{logs:e,className:"min-w-[300px]"})}),t[4]=e,t[5]=r):r=t[5],t[6]!==o||t[7]!==r?(s=c.jsxs(c.Fragment,{children:[o,r]}),t[6]=o,t[7]=r,t[8]=s):s=t[8],s},Xw=t=>{const e=H.c(10),{logs:n,className:o}=t;let r,s,a,i,l;return e[0]!==o?(r=xe("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?(a=n.map(E7),e[3]=n,e[4]=a):a=e[4],e[5]!==a?(i=c.jsx("pre",{className:"grid text-xs font-mono gap-1 whitespace-break-spaces font-semibold align-left",children:c.jsx("div",{className:"grid grid-cols-[30px_1fr]",style:s,children:a})}),e[5]=a,e[6]=i):i=e[6],e[7]!==r||e[8]!==i?(l=c.jsx("div",{className:r,children:i}),e[7]=r,e[8]=i,e[9]=l):l=e[9],l};function C7(t){const e=YP(t.timestamp),n=N7[t.level],o=t.level.toUpperCase();return c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"shrink-0 text-(--gray-10) dark:text-(--gray-11)",children:["[",e,"]"]}),c.jsx("span",{className:xe("shrink-0",n),children:o}),c.jsxs("span",{className:"shrink-0 text-(--gray-10)",children:["(",c.jsx(Io,{cellId:t.cellId}),")"]}),t.message]})}const N7={stdout:"text-(--grass-9)",stderr:"text-(--red-9)"};function E7(t,e){return c.jsxs("div",{className:"contents group",children:[c.jsx("span",{className:xe("opacity-70 group-hover:bg-(--gray-3) group-hover:opacity-100","text-right col-span-1 py-1 pr-1"),children:e+1}),c.jsx("span",{className:xe("opacity-70 group-hover:bg-(--gray-3) group-hover:opacity-100","px-2 flex gap-x-1.5 py-1 flex-wrap"),children:C7(t)})]},e)}const _7=()=>{const t=H.c(7),{items:e}=Se(KP);let n,o;t[0]!==e?(o=GR(e),t[0]=e,t[1]=o):o=t[1],n=o;const r=n,{activeHeaderId:s,activeOccurrences:a}=YR(r);if(e.length===0){let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(ln,{title:"No outline-solid",description:"Add markdown headings to your notebook to create an outline.",icon:c.jsx(Xc,{})}),t[2]=l):l=t[2],l}let i;return t[3]!==s||t[4]!==a||t[5]!==e?(i=c.jsx(KR,{items:e,activeHeaderId:s,activeOccurrences:a}),t[3]=s,t[4]=a,t[5]=e,t[6]=i):i=t[6],i},Jw=yt(null),Zw=t=>{const e=H.c(9),{onClick:n,loading:o,children:r,className:s}=t;if(o){let d;return e[0]===Symbol.for("react.memo_cache_sentinel")?(d=c.jsx(vn,{size:"small",className:"h-4 w-4 shrink-0 opacity-50"}),e[0]=d):d=e[0],d}let a,i,l;return e[1]!==s?(a=xe("px-2 h-full text-xs text-muted-foreground hover:text-foreground","invisible group-hover:visible",s),e[1]=s,e[2]=a):a=e[2],e[3]!==n?(i=Rn.stopPropagation(n),e[3]=n,e[4]=i):i=e[4],e[5]!==r||e[6]!==a||e[7]!==i?(l=c.jsx("button",{type:"button",className:a,onClick:i,children:r}),e[5]=r,e[6]=a,e[7]=i,e[8]=l):l=e[8],l},I7=()=>{var C,_;const t=H.c(30),[e]=fr(),n=e.package_management.manager,{getDependencyTree:o,getPackageList:r}=et(),[s,a]=q.useState(null);let i,l;t[0]!==o||t[1]!==r?(i=async()=>{const[E,M]=await Promise.all([r(),o()]);return{list:E.packages,tree:M.tree}},t[0]=o,t[1]=r,t[2]=i):i=t[2],t[3]!==n?(l=[n],t[3]=n,t[4]=l):l=t[4];const{data:d,error:u,refetch:h,isPending:f}=In(i,l);if(f){let E;return t[5]===Symbol.for("react.memo_cache_sentinel")?(E=c.jsx(vn,{size:"medium",centered:!0}),t[5]=E):E=t[5],E}if(u){let E;return t[6]!==u?(E=c.jsx(xr,{error:u}),t[6]=u,t[7]=E):E=t[7],E}const m=d.tree!=null;let x;t[8]!==m||t[9]!==s?(x=function(E,M){return E==="list"?"list":M?E||"tree":"list"}(s,m),t[8]=m,t[9]=s,t[10]=x):x=t[10];const g=x,p=(C=d.tree)==null?void 0:C.name,b=(_=d==null?void 0:d.tree)==null?void 0:_.version,y=p==="<root>";let v,w,S,j;return t[11]!==n||t[12]!==h?(v=c.jsx(A7,{packageManager:n,onSuccess:h}),t[11]=n,t[12]=h,t[13]=v):v=t[13],t[14]!==y||t[15]!==m||t[16]!==p||t[17]!==b||t[18]!==g?(w=m&&c.jsxs("div",{className:"flex items-center justify-between px-2 py-1 border-b",children:[c.jsxs("div",{className:"flex gap-1",children:[c.jsx("button",{type:"button",className:xe("px-2 py-1 text-xs rounded",g==="list"?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground"),onClick:()=>a("list"),children:"List"}),c.jsx("button",{type:"button",className:xe("px-2 py-1 text-xs rounded",g==="tree"?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground"),onClick:()=>a("tree"),children:"Tree"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"items-center border px-2 py-0.5 text-xs transition-colors focus:outline-hidden 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:y?"sandbox":"project",children:y?"sandbox":"project"}),p&&!y&&c.jsxs("span",{className:"text-xs text-muted-foreground",children:[p,b&&` v${b}`]})]})]}),t[14]=y,t[15]=m,t[16]=p,t[17]=b,t[18]=g,t[19]=w):w=t[19],t[20]!==d.list||t[21]!==d.tree||t[22]!==u||t[23]!==h||t[24]!==g?(S=g==="list"?c.jsx(T7,{packages:d.list,onSuccess:h}):c.jsx(M7,{tree:d.tree,error:u,onSuccess:h}),t[20]=d.list,t[21]=d.tree,t[22]=u,t[23]=h,t[24]=g,t[25]=S):S=t[25],t[26]!==v||t[27]!==w||t[28]!==S?(j=c.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[v,w,S]}),t[26]=v,t[27]=w,t[28]=S,t[29]=j):j=t[29],j},A7=t=>{const e=H.c(40),{onSuccess:n,packageManager:o}=t,[r,s]=q.useState(""),{handleClick:a}=si(),i=Se(Jw),l=jt(Jw);let d,u;e[0]!==i||e[1]!==l?(d=()=>{i&&(s(i),l(null))},u=[i,l],e[0]=i,e[1]=l,e[2]=d,e[3]=u):(d=e[2],u=e[3]),q.useEffect(d,u);const{loading:h,handleInstallPackages:f}=XP();let m;e[4]!==n?(m=()=>{n(),s("")},e[4]=n,e[5]=m):m=e[5];const x=m;let g;e[6]!==f||e[7]!==r||e[8]!==x?(g=()=>{f(r.split(",").map(O7),x)},e[6]=f,e[7]=r,e[8]=x,e[9]=g):g=e[9];const p=g,b=`Install packages with ${o}...`;let y,v,w,S,j,C,_,E,M,I,D,F,O,P;e[10]!==h||e[11]!==a?(y=h?c.jsx(vn,{size:"small",className:"mr-2 h-4 w-4 shrink-0 opacity-50"}):c.jsx(Ne,{content:"Change package manager",children:c.jsx(ws,{onClick:()=>a("packageManagement"),className:"mr-2 h-4 w-4 shrink-0 opacity-50 hover:opacity-80 cursor-pointer"})}),e[10]=h,e[11]=a,e[12]=y):y=e[12],e[13]!==p?(v=A=>{A.key==="Enter"&&(A.preventDefault(),p())},e[13]=p,e[14]=v):v=e[14],e[15]===Symbol.for("react.memo_cache_sentinel")?(w=A=>s(A.target.value),e[15]=w):w=e[15],e[16]!==r||e[17]!==b||e[18]!==y||e[19]!==v?(S=c.jsx(aj,{placeholder:b,id:p1,icon:y,rootClassName:"flex-1 border-none",value:r,onKeyDown:v,onChange:w}),e[16]=r,e[17]=b,e[18]=y,e[19]=v,e[20]=S):S=e[20],e[21]===Symbol.for("react.memo_cache_sentinel")?(j=c.jsx("span",{className:"font-bold tracking-wide",children:"Package name:"}),e[21]=j):j=e[21],e[22]===Symbol.for("react.memo_cache_sentinel")?(C=c.jsxs("div",{children:[j," A package name; this will install the latest version.",c.jsx("div",{className:"text-muted-foreground",children:"Example: httpx"})]}),_=c.jsx("span",{className:"font-bold tracking-wide",children:"Package and version:"}),e[22]=C,e[23]=_):(C=e[22],_=e[23]),e[24]===Symbol.for("react.memo_cache_sentinel")?(E=c.jsxs("div",{children:[_," ","A package with a specific version or version range.",c.jsx("div",{className:"text-muted-foreground",children:"Examples: httpx==0.27.0, httpx>=0.27.0"})]}),M=c.jsx("span",{className:"font-bold tracking-wide",children:"Git:"}),e[24]=E,e[25]=M):(E=e[24],M=e[25]),e[26]===Symbol.for("react.memo_cache_sentinel")?(I=c.jsxs("div",{children:[M," A Git repository",c.jsx("div",{className:"text-muted-foreground",children:"Example: git+https://github.com/encode/httpx"})]}),D=c.jsx("span",{className:"font-bold tracking-wide",children:"URL:"}),e[26]=I,e[27]=D):(I=e[26],D=e[27]),e[28]===Symbol.for("react.memo_cache_sentinel")?(F=c.jsxs("div",{children:[D," A remote wheel or source distribution.",c.jsx("div",{className:"text-muted-foreground",children:"Example: https://example.com/httpx-0.27.0.tar.gz"})]}),O=c.jsx("span",{className:"font-bold tracking-wide",children:"Path:"}),e[28]=F,e[29]=O):(F=e[28],O=e[29]),e[30]===Symbol.for("react.memo_cache_sentinel")?(P=c.jsx(Ne,{delayDuration:300,side:"left",align:"start",content:c.jsxs("div",{className:"text-sm flex flex-col w-full max-w-[360px]",children:["Packages are installed using the package manager specified in your user configuration. Depending on your package manager, you can install packages with various formats:",c.jsxs("div",{className:"flex flex-col gap-2 mt-2",children:[C,E,I,F,c.jsxs("div",{children:[O," A local wheel, source distribution, or project directory.",c.jsx("div",{className:"text-muted-foreground",children:"Example: /example/foo-0.1.0-py3-none-any.whl"})]})]})]}),children:c.jsx(Nm,{className:"h-4 w-4 cursor-help text-muted-foreground hover:text-foreground bg-transparent"})}),e[30]=P):P=e[30];const R=r&&"bg-accent text-accent-foreground";let z;e[31]!==R?(z=xe("float-right px-2 m-0 h-full text-sm text-secondary-foreground ml-2",R,"disabled:cursor-not-allowed disabled:opacity-50"),e[31]=R,e[32]=z):z=e[32];const N=!r;let k,B;return e[33]!==p||e[34]!==z||e[35]!==N?(k=c.jsx("button",{type:"button",className:z,onClick:p,disabled:N,children:"Add"}),e[33]=p,e[34]=z,e[35]=N,e[36]=k):k=e[36],e[37]!==k||e[38]!==S?(B=c.jsxs("div",{className:"flex items-center w-full border-b",children:[S,P,k]}),e[37]=k,e[38]=S,e[39]=B):B=e[39],B},T7=t=>{const e=H.c(9),{onSuccess:n,packages:o}=t;if(o.length===0){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(ln,{title:"No packages",description:"No packages are installed in this environment.",icon:c.jsx(ws,{})}),e[0]=i):i=e[0],i}let r,s,a;if(e[1]===Symbol.for("react.memo_cache_sentinel")?(r=c.jsx(Om,{children:c.jsxs(vs,{children:[c.jsx(br,{children:"Name"}),c.jsx(br,{children:"Version"}),c.jsx(br,{})]})}),e[1]=r):r=e[1],e[2]!==n||e[3]!==o){let i;e[5]!==n?(i=l=>c.jsxs(vs,{className:"group",onClick:async()=>{await on(`${l.name}==${l.version}`),Je({title:"Copied to clipboard"})},children:[c.jsx(yr,{children:l.name}),c.jsx(yr,{children:l.version}),c.jsxs(yr,{className:"flex justify-end",children:[c.jsx(Qw,{packageName:l.name,onSuccess:n}),c.jsx(ek,{packageName:l.name,onSuccess:n})]})]},l.name),e[5]=n,e[6]=i):i=e[6],s=o.map(i),e[2]=n,e[3]=o,e[4]=s}else s=e[4];return e[7]!==s?(a=c.jsxs(Dm,{className:"overflow-auto flex-1",children:[r,c.jsx(Pm,{children:s})]}),e[7]=s,e[8]=a):a=e[8],a},Qw=({packageName:t,onSuccess:e})=>{const[n,o]=q.useState(!1),{addPackage:r}=et();return Zt()?null:c.jsx(Zw,{onClick:async()=>{try{o(!0);const s=await r({package:t,upgrade:!0});s.success?(e(),ij(t)):ij(t,s.error)}finally{o(!1)}},loading:n,children:"Upgrade"})},ek=({packageName:t,onSuccess:e})=>{const[n,o]=q.useState(!1),{removePackage:r}=et();return c.jsx(Zw,{onClick:async()=>{try{o(!0);const s=await r({package:t});s.success?(e(),lj(t)):lj(t,s.error)}finally{o(!1)}},loading:n,children:"Remove"})},M7=t=>{const e=H.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[a,i]=q.useState(s);let l,d,u;if(e[1]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{i(new Set)},e[1]=l):l=e[1],e[2]!==n?(d=[n],e[2]=n,e[3]=d):d=e[3],q.useEffect(l,d),o){let x;return e[4]!==o?(x=c.jsx(xr,{error:o}),e[4]=o,e[5]=x):x=e[5],x}if(!n){let x;return e[6]===Symbol.for("react.memo_cache_sentinel")?(x=c.jsx(vn,{size:"medium",centered:!0}),e[6]=x):x=e[6],x}if(n.dependencies.length===0){let x;return e[7]===Symbol.for("react.memo_cache_sentinel")?(x=c.jsx(ln,{title:"No dependencies",description:"No package dependencies found in this environment.",icon:c.jsx(ws,{})}),e[7]=x):x=e[7],x}e[8]===Symbol.for("react.memo_cache_sentinel")?(u=x=>{i(g=>{const p=new Set(g);return p.has(x)?p.delete(x):p.add(x),p})},e[8]=u):u=e[8];const h=u;let f,m;if(e[9]!==a||e[10]!==r||e[11]!==n.dependencies){let x;e[13]!==a||e[14]!==r?(x=(g,p)=>c.jsx("div",{className:"border-b",children:c.jsx(tk,{nodeId:`root-${p}`,node:g,level:0,isTopLevel:!0,expandedNodes:a,onToggle:h,onSuccess:r})},`${g.name}-${p}`),e[13]=a,e[14]=r,e[15]=x):x=e[15],f=n.dependencies.map(x),e[9]=a,e[10]=r,e[11]=n.dependencies,e[12]=f}else f=e[12];return e[16]!==f?(m=c.jsx("div",{className:"flex-1 overflow-auto",children:c.jsx("div",{children:f})}),e[16]=f,e[17]=m):m=e[17],m},tk=t=>{const e=H.c(57),{nodeId:n,node:o,level:r,isTopLevel:s,expandedNodes:a,onToggle:i,onSuccess:l}=t,d=s!==void 0&&s,u=o.dependencies.length>0;let h;e[0]!==a||e[1]!==n?(h=a.has(n),e[0]=a,e[1]=n,e[2]=h):h=e[2];const f=h,m=d?0:16+16*r;let x;e[3]!==u||e[4]!==n||e[5]!==i?(x=z=>{z.key!=="Enter"&&z.key!==" "||(z.preventDefault(),u&&i(n))},e[3]=u,e[4]=n,e[5]=i,e[6]=x):x=e[6];const g=x;let p;e[7]!==u||e[8]!==n||e[9]!==i?(p=z=>{z.stopPropagation(),u&&i(n)},e[7]=u,e[8]=n,e[9]=i,e[10]=p):p=e[10];const b=p,y=u&&"select-none",v=d?"px-2 py-0.5":"";let w,S;e[11]!==y||e[12]!==v?(w=xe("flex items-center group cursor-pointer text-sm whitespace-nowrap","hover:bg-(--slate-2) focus:bg-(--slate-2) focus:outline-hidden",y,v),e[11]=y,e[12]=v,e[13]=w):w=e[13],e[14]!==m||e[15]!==d?(S=d?{}:{paddingLeft:`${m}px`},e[14]=m,e[15]=d,e[16]=S):S=e[16];const j=u?f:void 0;let C,_,E,M,I,D,F,O,P,R;return e[17]!==u||e[18]!==f?(C=u?f?c.jsx(jo,{className:"w-4 h-4 mr-2 shrink-0"}):c.jsx(Ta,{className:"w-4 h-4 mr-2 shrink-0"}):c.jsx("div",{className:"w-4 mr-2 shrink-0"}),e[17]=u,e[18]=f,e[19]=C):C=e[19],e[20]!==o.name?(_=c.jsx("span",{className:"font-medium truncate",children:o.name}),e[20]=o.name,e[21]=_):_=e[21],e[22]!==o.version?(E=o.version&&c.jsxs("span",{className:"text-muted-foreground text-xs",children:["v",o.version]}),e[22]=o.version,e[23]=E):E=e[23],e[24]!==_||e[25]!==E?(M=c.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0 py-1.5",children:[_,E]}),e[24]=_,e[25]=E,e[26]=M):M=e[26],e[27]!==o.tags?(I=o.tags.map(D7),e[27]=o.tags,e[28]=I):I=e[28],e[29]!==I?(D=c.jsx("div",{className:"flex items-center gap-1 ml-2",children:I}),e[29]=I,e[30]=D):D=e[30],e[31]!==d||e[32]!==o.name||e[33]!==l?(F=d&&c.jsxs("div",{className:"flex gap-1 invisible group-hover:visible",children:[c.jsx(Qw,{packageName:o.name,onSuccess:l}),c.jsx(ek,{packageName:o.name,onSuccess:l})]}),e[31]=d,e[32]=o.name,e[33]=l,e[34]=F):F=e[34],e[35]!==b||e[36]!==g||e[37]!==C||e[38]!==M||e[39]!==D||e[40]!==F||e[41]!==w||e[42]!==S||e[43]!==j?(O=c.jsxs("div",{className:w,style:S,onClick:b,onKeyDown:g,tabIndex:0,role:"treeitem","aria-selected":!1,"aria-expanded":j,children:[C,M,D,F]}),e[35]=b,e[36]=g,e[37]=C,e[38]=M,e[39]=D,e[40]=F,e[41]=w,e[42]=S,e[43]=j,e[44]=O):O=e[44],e[45]!==a||e[46]!==u||e[47]!==f||e[48]!==r||e[49]!==o.dependencies||e[50]!==n||e[51]!==l||e[52]!==i?(P=u&&f&&c.jsx("div",{role:"group",children:o.dependencies.map((z,N)=>c.jsx(tk,{nodeId:`${n}-${N}`,node:z,level:r+1,isTopLevel:!1,expandedNodes:a,onToggle:i,onSuccess:l},`${z.name}-${N}`))}),e[45]=a,e[46]=u,e[47]=f,e[48]=r,e[49]=o.dependencies,e[50]=n,e[51]=l,e[52]=i,e[53]=P):P=e[53],e[54]!==O||e[55]!==P?(R=c.jsxs("div",{children:[O,P]}),e[54]=O,e[55]=P,e[56]=R):R=e[56],R};function O7(t){return t.trim()}function D7(t,e){return t.kind==="cycle"?c.jsx("div",{className:"items-center border px-2 py-0.5 text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium border-orange-300 dark:border-orange-700 text-orange-700 dark:text-orange-300",title:"cycle",children:"cycle"},e):t.kind==="extra"?c.jsx("div",{className:"items-center border px-2 py-0.5 text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium border-blue-300 dark:border-blue-700 text-blue-700 dark:text-blue-300",title:t.value,children:t.value},e):t.kind==="group"?c.jsx("div",{className:"items-center border px-2 py-0.5 text-xs transition-colors focus:outline-hidden 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 Rf=kk("marimo:scratchpadHistory:v1",[]),P7=yt(!1),R7=yt(null,(t,e,n)=>{if(!(n=n.trim()))return;const o=t(Rf),r=[n,...o.filter(s=>s!==n)].slice(0,15);e(Rf,r)}),L7={hide_code:!1,disabled:!1},F7=()=>{const t=H.c(71),e=cm(),[n]=fr(),{theme:o}=Ko(),r=T.useRef(null),s=ls(),{createNewCell:a,updateCellCode:i}=it(),{sendRunScratchpad:l}=et(),d=e.cellRuntime[Xo],u=d==null?void 0:d.output,h=d==null?void 0:d.status,f=d==null?void 0:d.consoleOutputs,m=e.cellData[Xo],x=(m==null?void 0:m.code)??"",g=jt(R7),[p,b]=Ot(P7),y=Se(Rf);let v;t[0]!==g||t[1]!==x||t[2]!==l?(v=()=>{l({code:x}),g(x)},t[0]=g,t[1]=x,t[2]=l,t[3]=v):v=t[3];const w=Le(v);let S;t[4]!==x||t[5]!==a||t[6]!==s?(S=()=>{x.trim()&&a({code:x,before:!1,cellId:s??"__end__"})},t[4]=x,t[5]=a,t[6]=s,t[7]=S):S=t[7];const j=Le(S);let C;t[8]!==l||t[9]!==i?(C=()=>{i({cellId:Xo,code:"",formattingChange:!1}),l({code:""});const ue=r.current;ue&&ue.dispatch({changes:{from:0,to:ue.state.doc.length,insert:""}})},t[8]=l,t[9]=i,t[10]=C):C=t[10];const _=Le(C);let E;t[11]!==b||t[12]!==i?(E=ue=>{b(!1),i({cellId:Xo,code:ue,formattingChange:!1});const de=r.current;de&&de.dispatch({changes:{from:0,to:de.state.doc.length,insert:ue}})},t[11]=b,t[12]=i,t[13]=E):E=t[13];const M=Le(E),[I,D]=T.useState();let F;t[14]!==x||t[15]!==f||t[16]!==w||t[17]!==I||t[18]!==u||t[19]!==o||t[20]!==n?(F=()=>c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"overflow-auto shrink-0 max-h-[40%]",children:c.jsx(Cu,{theme:o,showPlaceholder:!1,id:Xo,code:x,config:L7,status:"idle",serializedEditorState:null,runCell:w,userConfig:n,editorViewRef:r,setEditorView:ue=>{r.current=ue},hidden:!1,showHiddenCode:Ln.NOOP,languageAdapter:I,setLanguageAdapter:D})}),c.jsx("div",{className:"flex-1 overflow-auto shrink-0",children:c.jsx(Ic,{allowExpand:!1,output:u,className:"output-area",cellId:Xo,stale:!1,loading:!1})}),c.jsx("div",{className:"overflow-auto shrink-0 max-h-[35%]",children:c.jsx(Bm,{consoleOutputs:f,className:"overflow-auto",stale:!1,cellName:jk,onSubmitDebugger:Ln.NOOP,cellId:Xo,debuggerActive:!1})})]}),t[14]=x,t[15]=f,t[16]=w,t[17]=I,t[18]=u,t[19]=o,t[20]=n,t[21]=F):F=t[21];const O=F;let P;t[22]!==M||t[23]!==y||t[24]!==p||t[25]!==o?(P=()=>p?c.jsx("div",{className:"absolute inset-0 z-100 bg-background p-3 border-none overflow-auto",children:c.jsx("div",{className:"overflow-auto flex flex-col gap-3",children:y.map((ue,de)=>c.jsx("div",{className:"border rounded-md hover:shadow-sm cursor-pointer hover:border-input overflow-hidden",onClick:()=>M(ue),children:c.jsx(T.Suspense,{children:c.jsx(oi,{language:"python",theme:o,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1},value:ue.trim(),editable:!1,readOnly:!0})})},de))})}):null,t[22]=M,t[23]=y,t[24]=p,t[25]=o,t[26]=P):P=t[26];const R=P;let z,N,k,B,A,U,$,X,Y,G,W;t[27]===Symbol.for("react.memo_cache_sentinel")?(z=Ea.create(Xo),N=c.jsx("p",{className:"mx-2 my-2 text-muted-foreground text-sm",children:"Use this scratchpad cell to experiment with code without restrictions on variable names. Scratchpad code is ephemeral: variables defined in the scratchpad aren't saved to notebook memory, and the code is not saved in the notebook file."}),t[27]=z,t[28]=N):(z=t[27],N=t[28]),t[29]===Symbol.for("react.memo_cache_sentinel")?(k=Wt("cell.run"),t[29]=k):k=t[29],t[30]===Symbol.for("react.memo_cache_sentinel")?(B=c.jsx(vr,{color:"var(--grass-11)",size:16}),t[30]=B):B=t[30],t[31]!==w||t[32]!==p?(A=c.jsx(Ne,{content:k,children:c.jsx(ve,{"data-testid":"scratchpad-run-button",onClick:w,disabled:p,variant:"text",size:"xs",children:B})}),t[31]=w,t[32]=p,t[33]=A):A=t[33],t[34]===Symbol.for("react.memo_cache_sentinel")?(U=c.jsx(Zm,{size:16}),t[34]=U):U=t[34],t[35]!==_||t[36]!==p?($=c.jsx(Ne,{content:"Clear code and outputs",children:c.jsx(ve,{disabled:p,size:"xs",variant:"text",onClick:_,children:U})}),t[35]=_,t[36]=p,t[37]=$):$=t[37],t[38]===Symbol.for("react.memo_cache_sentinel")?(X=c.jsx(wr,{size:16}),t[38]=X):X=t[38],t[39]!==j||t[40]!==p?(Y=c.jsx(Ts,{children:c.jsx(Ne,{content:"Insert code",children:c.jsx(ve,{disabled:p,size:"xs",variant:"text",onClick:j,children:X})})}),t[39]=j,t[40]=p,t[41]=Y):Y=t[41],t[42]!==h?(G=(h==="running"||h==="queued")&&c.jsx(vn,{className:"inline",size:"small"}),t[42]=h,t[43]=G):G=t[43],t[44]===Symbol.for("react.memo_cache_sentinel")?(W=c.jsx("div",{className:"flex-1"}),t[44]=W):W=t[44];const J=p&&"bg-(--sky-3) rounded-none";let V,Q;t[45]!==J?(V=xe(J),t[45]=J,t[46]=V):V=t[46],t[47]!==p||t[48]!==b?(Q=()=>b(!p),t[47]=p,t[48]=b,t[49]=Q):Q=t[49];const te=y.length===0;let re,ne,ae,se,ie,ge,oe;return t[50]===Symbol.for("react.memo_cache_sentinel")?(re=c.jsx(sp,{size:16}),t[50]=re):re=t[50],t[51]!==V||t[52]!==Q||t[53]!==te?(ne=c.jsx(Ne,{content:"Toggle history",children:c.jsx(ve,{size:"xs",variant:"text",className:V,onClick:Q,disabled:te,children:re})}),t[51]=V,t[52]=Q,t[53]=te,t[54]=ne):ne=t[54],t[55]!==A||t[56]!==$||t[57]!==Y||t[58]!==G||t[59]!==ne?(ae=c.jsxs("div",{className:"flex items-center shrink-0",children:[A,$,Y,G,W,ne]}),t[55]=A,t[56]=$,t[57]=Y,t[58]=G,t[59]=ne,t[60]=ae):ae=t[60],t[61]!==O?(se=O(),t[61]=O,t[62]=se):se=t[62],t[63]!==R?(ie=R(),t[63]=R,t[64]=ie):ie=t[64],t[65]!==se||t[66]!==ie?(ge=c.jsxs("div",{className:"flex-1 divide-y relative overflow-hidden flex flex-col",children:[se,ie]}),t[65]=se,t[66]=ie,t[67]=ge):ge=t[67],t[68]!==ae||t[69]!==ge?(oe=c.jsxs("div",{className:"flex flex-col h-full overflow-hidden divide-y",id:z,children:[N,ae,ge]}),t[68]=ae,t[69]=ge,t[70]=oe):oe=t[70],oe},z7=()=>{const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx(F7,{}),t[0]=e):e=t[0],e},B7=()=>{const t=H.c(23),{openModal:e,closeModal:n}=_n();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],t[0]=o):o=t[0];const{data:r,isPending:s,error:a,refetch:i}=In($7,o);if(s){let b;return t[1]===Symbol.for("react.memo_cache_sentinel")?(b=c.jsx(vn,{size:"medium",centered:!0}),t[1]=b):b=t[1],b}if(a){let b;return t[2]!==a?(b=c.jsx(xr,{error:a}),t[2]=a,t[3]=b):b=t[3],b}let l;t[4]!==r?(l=r.filter(V7).map(H7),t[4]=r,t[5]=l):l=t[5];const d=l;if(r.length===0){let b;return t[6]===Symbol.for("react.memo_cache_sentinel")?(b=c.jsx(ln,{title:"No environment variables",description:"No environment variables are available in this notebook.",icon:c.jsx(Hc,{})}),t[6]=b):b=t[6],b}let u,h,f,m,x,g,p;return t[7]!==n||t[8]!==e||t[9]!==d||t[10]!==i?(u=()=>e(c.jsx(ig,{providerNames:d,onSuccess:()=>{i(),n()},onClose:n})),t[7]=n,t[8]=e,t[9]=d,t[10]=i,t[11]=u):u=t[11],t[12]===Symbol.for("react.memo_cache_sentinel")?(h=c.jsx(Yo,{className:"h-4 w-4"}),t[12]=h):h=t[12],t[13]!==u?(f=c.jsx("div",{className:"flex justify-end h-8 border-b",children:c.jsx("button",{type:"button",className:"float-right border-l px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",onClick:u,children:h})}),t[13]=u,t[14]=f):f=t[14],t[15]===Symbol.for("react.memo_cache_sentinel")?(m=c.jsx(Om,{children:c.jsxs(vs,{children:[c.jsx(br,{children:"Environment Variable"}),c.jsx(br,{children:"Source"}),c.jsx(br,{})]})}),t[15]=m):m=t[15],t[16]!==r?(x=r.map(W7),t[16]=r,t[17]=x):x=t[17],t[18]!==x?(g=c.jsxs(Dm,{className:"overflow-auto flex-1 mb-16",children:[m,c.jsx(Pm,{children:x})]}),t[18]=x,t[19]=g):g=t[19],t[20]!==f||t[21]!==g?(p=c.jsxs("div",{className:"flex flex-col h-full",children:[f,g]}),t[20]=f,t[21]=g,t[22]=p):p=t[22],p},U7=t=>{const e=H.c(9),{className:n,ariaLabel:o,onCopy:r}=t,[s,a]=q.useState(!1);let i;e[0]!==r?(i=()=>{r(),a(!0),setTimeout(()=>a(!1),1e3)},e[0]=r,e[1]=i):i=e[1];const l=i;let d,u;return e[2]!==s?(d=s?c.jsx(ac,{className:"w-3 h-3 text-green-700 rounded"}):c.jsx(Na,{className:"w-3 h-3 hover:bg-muted rounded"}),e[2]=s,e[3]=d):d=e[3],e[4]!==o||e[5]!==n||e[6]!==l||e[7]!==d?(u=c.jsx("button",{type:"button",className:n,onClick:l,"aria-label":o,children:d}),e[4]=o,e[5]=n,e[6]=l,e[7]=d,e[8]=u):u=e[8],u};async function $7(){return ag((await wj.request({})).secrets)}function V7(t){return t.provider!=="env"}function H7(t){return t.name}function W7(t){return t.keys.map(e=>c.jsxs(vs,{className:"group",children:[c.jsx(yr,{children:e}),c.jsx(yr,{children:t.provider!=="env"&&c.jsx(G3,{variant:"outline",className:"select-none",children:t.name})}),c.jsx(yr,{children:c.jsx(U7,{ariaLabel:`Copy ${e}`,onCopy:async()=>{await on(`os.environ["${e}"]`),Je({title:"Copied to clipboard",description:`os.environ["${e}"] has been copied to your clipboard.`})},className:xe("float-right px-2 h-full text-xs text-muted-foreground hover:text-foreground","invisible group-hover:visible")})})]},`${t.name}-${e}`))}const q7=t=>{const e=H.c(6),{children:n}=t,{openModal:o,closeModal:r}=_n();let s,a;return e[0]!==r||e[1]!==o?(s=()=>o(c.jsx(Y7,{onClose:r})),e[0]=r,e[1]=o,e[2]=s):s=e[2],e[3]!==n||e[4]!==s?(a=c.jsx(z3,{onClick:s,children:n}),e[3]=n,e[4]=s,e[5]=a):a=e[5],a},G7=[We.lineWrapping],Y7=t=>{const e=H.c(23),{onClose:n}=t,[o,r]=T.useState(""),{theme:s}=Ko();let a,i,l,d,u,h;e[0]!==n?(a=async v=>{v.preventDefault();const w=new FormData(v.target),S=w.get("title"),j=w.get("description"),C=w.get("code");fetch("https://marimo.io/api/suggest-snippet",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:S,description:j,code:C})}),n(),Je({title:"Snippet Submitted",description:"Thank you for contributing! We will review your snippet shortly."})},e[0]=n,e[1]=a):a=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx($o,{children:"Contribute a Snippet"}),e[2]=i):i=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsxs(os,{children:[i,c.jsxs(rs,{children:["Have a useful snippet you want to share with the community? Submit it here or make a pull request"," ",c.jsx("a",{href:Pn.githubPage,target:"_blank",className:"underline",children:"on GitHub"}),"."]})]}),e[3]=l):l=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(d=c.jsx(Vo,{id:"title",name:"title",autoFocus:!0,placeholder:"Title",required:!0,autoComplete:"off"}),u=c.jsx(JP,{id:"description",name:"description",autoFocus:!0,placeholder:"Description",rows:5,required:!0,autoComplete:"off"}),e[4]=d,e[5]=u):(d=e[4],u=e[5]),e[6]!==o?(h=c.jsx("input",{type:"hidden",name:"code",value:o}),e[6]=o,e[7]=h):h=e[7];const f=s==="dark"?"dark":"light";let m,x,g,p,b,y;return e[8]!==o||e[9]!==f?(m=c.jsx(oi,{theme:f,language:"python",className:"cm border rounded overflow-hidden",extensions:G7,value:o,onChange:r}),e[8]=o,e[9]=f,e[10]=m):m=e[10],e[11]!==h||e[12]!==m?(x=c.jsxs("div",{className:"flex flex-col gap-6 py-4",children:[d,u,h,m]}),e[11]=h,e[12]=m,e[13]=x):x=e[13],e[14]!==n?(g=c.jsx(ve,{"data-testid":"snippet-cancel-button",variant:"secondary",onClick:n,children:"Cancel"}),e[14]=n,e[15]=g):g=e[15],e[16]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx(ve,{"data-testid":"snippet-send-button","aria-label":"Save",variant:"default",type:"submit",children:"Send"}),e[16]=p):p=e[16],e[17]!==g?(b=c.jsxs(Ca,{children:[g,p]}),e[17]=g,e[18]=b):b=e[18],e[19]!==a||e[20]!==b||e[21]!==x?(y=c.jsx(Ho,{className:"w-fit",children:c.jsxs("form",{onSubmit:a,children:[l,x,b]})}),e[19]=a,e[20]=b,e[21]=x,e[22]=y):y=e[22],y},K7=[We.lineWrapping],X7=()=>{const t=H.c(22),{readSnippets:e}=et(),[n,o]=q.useState();let r,s;t[0]!==e?(r=()=>e(),t[0]=e,t[1]=r):r=t[1],t[2]===Symbol.for("react.memo_cache_sentinel")?(s=[],t[2]=s):s=t[2];const{data:a,error:i,isPending:l}=In(r,s);if(i){let v;return t[3]!==i?(v=c.jsx(xr,{error:i}),t[3]=i,t[4]=v):v=t[4],v}if(l||!a){let v;return t[5]===Symbol.for("react.memo_cache_sentinel")?(v=c.jsx(vn,{size:"medium",centered:!0}),t[5]=v):v=t[5],v}const d=n?"h-1/3":"h-full";let u,h,f,m,x,g,p,b,y;return t[6]!==d?(u=xe("border-b rounded-none",d),t[6]=d,t[7]=u):u=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(h=c.jsx(Ma,{placeholder:"Search snippets...",className:"h-6 m-1",rootClassName:"flex-1 border-r"}),t[8]=h):h=t[8],t[9]===Symbol.for("react.memo_cache_sentinel")?(f=c.jsxs("div",{className:"flex items-center w-full",children:[h,c.jsx(q7,{children:c.jsx("button",{className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:c.jsx(Yo,{className:"h-4 w-4"})})})]}),m=c.jsx(tc,{children:"No results"}),t[9]=f,t[10]=m):(f=t[9],m=t[10]),t[11]===Symbol.for("react.memo_cache_sentinel")?(x=v=>o(v),t[11]=x):x=t[11],t[12]!==a.snippets?(g=c.jsx(Z7,{onSelect:x,snippets:a.snippets}),t[12]=a.snippets,t[13]=g):g=t[13],t[14]!==u||t[15]!==g?(p=c.jsxs(cc,{className:u,children:[f,m,g]}),t[14]=u,t[15]=g,t[16]=p):p=t[16],t[17]!==n?(b=c.jsx(T.Suspense,{children:c.jsx("div",{className:"h-2/3 snippet-viewer flex flex-col",children:n?c.jsx(J7,{snippet:n,onClose:()=>o(void 0)},n.title):c.jsx(ln,{title:"",description:"Click on a snippet to view its content."})})}),t[17]=n,t[18]=b):b=t[18],t[19]!==b||t[20]!==p?(y=c.jsxs("div",{className:"flex-1 overflow-hidden",children:[p,b]}),t[19]=b,t[20]=p,t[21]=y):y=t[21],y},J7=t=>{const e=H.c(33),{snippet:n,onClose:o}=t,{theme:r}=Ko(),{createNewCell:s}=it(),a=ls();let i;e[0]!==s||e[1]!==a||e[2]!==n.sections?(i=()=>{for(const w of[...n.sections].reverse())w.code&&s({code:w.code,before:!1,cellId:a??"__end__",skipIfCodeExists:!0})},e[0]=s,e[1]=a,e[2]=n.sections,e[3]=i):i=e[3];const l=i;let d;e[4]!==s||e[5]!==a?(d=w=>{s({code:w,before:!1,cellId:a??"__end__"})},e[4]=s,e[5]=a,e[6]=d):d=e[6];const u=d;let h,f,m,x,g,p,b,y,v;if(e[7]!==n.title?(h=c.jsx("span",{children:n.title}),e[7]=n.title,e[8]=h):h=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(f=c.jsx(yn,{className:"h-4 w-4"}),e[9]=f):f=e[9],e[10]!==o?(m=c.jsx(ve,{size:"sm",variant:"ghost",onClick:o,className:"h-6 w-6 p-0 hover:bg-muted-foreground/10",children:f}),e[10]=o,e[11]=m):m=e[11],e[12]!==h||e[13]!==m?(x=c.jsxs("div",{className:"text-sm font-semibold bg-muted border-y px-2 py-1 flex justify-between items-center",children:[h,m]}),e[12]=h,e[13]=m,e[14]=x):x=e[14],e[15]===Symbol.for("react.memo_cache_sentinel")?(g=c.jsx(wr,{className:"ml-2 h-4 w-4"}),e[15]=g):g=e[15],e[16]!==l?(p=c.jsx("div",{className:"flex justify-end",children:c.jsx(Ts,{children:c.jsxs(ve,{className:"float-right",size:"xs",variant:"outline",onClick:l,children:["Insert snippet",g]})})}),e[16]=l,e[17]=p):p=e[17],e[18]!==u||e[19]!==n.sections||e[20]!==n.title||e[21]!==r){let w;e[23]!==u||e[24]!==n.title||e[25]!==r?(w=S=>{const{code:j,html:C,id:_}=S;return C?c.jsx("div",{children:Am({html:C})},`${n.title}-${_}`):j?c.jsxs("div",{className:"relative hover-actions-parent pr-2",children:[c.jsx(Ts,{children:c.jsx(Ne,{content:"Insert snippet",children:c.jsx(ve,{className:"absolute -top-2 -right-1 z-10 hover-action px-2 bg-background",size:"sm",variant:"outline",onClick:()=>{u(j)},children:c.jsx(wr,{className:"h-5 w-5"})})})}),c.jsx(T.Suspense,{children:c.jsx(oi,{theme:r==="dark"?"dark":"light",language:"python",className:"cm border rounded overflow-hidden",extensions:K7,value:j,readOnly:!0},`${n.title}-${_}`)})]},`${n.title}-${_}`):null},e[23]=u,e[24]=n.title,e[25]=r,e[26]=w):w=e[26],b=n.sections.map(w),e[18]=u,e[19]=n.sections,e[20]=n.title,e[21]=r,e[22]=b}else b=e[22];return e[27]!==p||e[28]!==b?(y=c.jsxs("div",{className:"px-2 py-2 space-y-4 overflow-auto flex-1",children:[p,b]}),e[27]=p,e[28]=b,e[29]=y):y=e[29],e[30]!==y||e[31]!==x?(v=c.jsxs(c.Fragment,{children:[x,y]}),e[30]=y,e[31]=x,e[32]=v):v=e[32],v},Z7=t=>{const e=H.c(7),{snippets:n,onSelect:o}=t;let r,s;if(e[0]!==o||e[1]!==n){let a;e[3]!==o?(a=i=>c.jsx(Xn,{className:"rounded-none",onSelect:()=>o(i),children:c.jsx("div",{className:"flex flex-row gap-2 items-center",children:c.jsx("span",{className:"mt-1 text-accent-foreground",children:i.title})})},i.title),e[3]=o,e[4]=a):a=e[4],r=n.map(a),e[0]=o,e[1]=n,e[2]=r}else r=e[2];return e[5]!==r?(s=c.jsx(ym,{className:"flex flex-col overflow-auto",children:r}),e[5]=r,e[6]=s):s=e[6],s},Q7=q.lazy(()=>wm(()=>import("./tracing-C_dGiPTC.js").then(async t=>(await t.__tla,t)),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125]),import.meta.url).then(t=>({default:t.Tracing}))),eM=()=>{const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx(q.Suspense,{fallback:c.jsx(tM,{}),children:c.jsx(Q7,{})}),t[0]=e):e=t[0],e},tM=()=>{const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:c.jsx(vn,{})}),t[0]=e):e=t[0],e},nk="name",ok="type-value",Lf="defs-refs",nM=[{id:nk,accessorFn:t=>[t.name,t.declaredBy],enableSorting:!0,sortingFn:"alphanumeric",header:({column:t})=>c.jsx(Rm,{header:"Name",column:t}),cell:({getValue:t})=>{const[e,n]=t();return c.jsx(Yh,{name:e,declaredBy:n})}},{id:ok,accessorFn:t=>[t.dataType,t.value],enableSorting:!0,sortingFn:"alphanumeric",header:({column:t})=>c.jsx(Rm,{header:c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx("span",{children:"Type"}),c.jsx("span",{children:"Value"})]}),column:t}),cell:({getValue:t})=>{const[e,n]=t();return c.jsxs("div",{className:"max-w-[150px]",children:[c.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap text-muted-foreground font-mono text-xs",children:e}),c.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap",title:n??"",children:n})]})}},{id:Lf,accessorFn:t=>[t.declaredBy,t.usedBy,t.name,t.declaredByNames,t.usedByNames],enableSorting:!0,sortingFn:"basic",header:({column:t})=>c.jsx(Rm,{header:c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx("span",{children:"Declared By"}),c.jsx("span",{children:"Used By"})]}),column:t}),cell:({getValue:t})=>{const[e,n,o]=t(),r=s=>{const a=Ia(s);a&&Tm(a,o)};return c.jsxs("div",{className:"flex flex-col gap-1 py-1",children:[c.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-center",children:[c.jsx("span",{title:"Declared by",children:c.jsx(Np,{className:"w-3.5 h-3.5 text-muted-foreground"})}),e.length===1?c.jsx(Io,{variant:"focus",cellId:e[0],skipScroll:!0,onClick:()=>r(e[0])}):c.jsx("div",{className:"text-destructive flex flex-row gap-2",children:e.slice(0,3).map((s,a)=>c.jsxs("span",{className:"flex",children:[c.jsx(Io,{variant:"focus",cellId:s,skipScroll:!0,className:"whitespace-nowrap text-destructive",onClick:()=>r(s)},s),a<e.length-1&&", "]},s))})]}),c.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-baseline",children:[c.jsx("span",{title:"Used by",children:c.jsx(fi,{className:"w-3.5 h-3.5 text-muted-foreground"})}),c.jsx(N2,{maxCount:3,cellIds:n,skipScroll:!0,onClick:r})]})]})}}],rk=T.memo(({className:t,cellIds:e,variables:n})=>{const[o,r]=q.useState([]),[s,a]=q.useState(""),i=ZP(),l=T.useMemo(()=>{const h=f=>{const m=i[f];return oR(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,i,e]),d=T.useMemo(()=>{const h=new Map;return e.forEach((f,m)=>h.set(f,m)),function({variables:f,sort:m,cellIdToIndex:x}){m||(m={id:Lf,desc:!1});let g=[];switch(m.id){case nk:g=ii(f,p=>p.name);break;case ok:g=ii(f,p=>p.dataType);break;case Lf:g=ii(f,p=>x.get(p.declaredBy[0]))}return m.desc?g.reverse():g}({variables:l,sort:o[0],cellIdToIndex:h})},[l,o,e]),u=QP({data:d,columns:nM,getCoreRowModel:nR(),onGlobalFilterChange:a,getFilteredRowModel:tR(),enableFilters:!0,enableGlobalFilter:!0,enableColumnPinning:!1,getColumnCanGlobalFilter:h=>h.columnDef.enableGlobalFilter??!0,globalFilterFn:"auto",manualSorting:!0,onSortingChange:r,getSortedRowModel:eR(),state:{sorting:o,globalFilter:s}});return c.jsxs(c.Fragment,{children:[c.jsx(aj,{className:"w-full",placeholder:"Search",value:s,onChange:h=>a(h.target.value)}),c.jsxs(Dm,{className:xe("w-full text-sm flex-1 border-separate border-spacing-0",t),children:[c.jsx(Om,{children:c.jsx(vs,{className:"whitespace-nowrap text-xs",children:u.getFlatHeaders().map(h=>c.jsx(br,{className:"sticky top-0 bg-background border-b",children:cj(h.column.columnDef.header,h.getContext())},h.id))})}),c.jsx(Pm,{children:u.getRowModel().rows.map(h=>c.jsx(vs,{className:"hover:bg-accent",children:h.getVisibleCells().map(f=>c.jsx(yr,{className:"border-b",children:cj(f.column.columnDef.cell,f.getContext())},f.id))},h.id))})]})]})});rk.displayName="VariableTable";const oM=()=>{const t=H.c(4),e=Mm(),n=gr();if(Object.keys(e).length===0){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=c.jsx(ln,{title:"No variables",description:"Global variables will appear here.",icon:c.jsx(Vl,{})}),t[0]=r):r=t[0],r}let o;return t[1]!==n.inOrderIds||t[2]!==e?(o=c.jsx(rk,{className:"flex-1",cellIds:n.inOrderIds,variables:e}),t[1]=n.inOrderIds,t[2]=e,t[3]=o):o=t[3],o},rM=t=>{const e=H.c(54),n=Se(rR),o=Se(P_),r=it(),s=C3(),a=t.cellId,i=o[t.cellId],l=Ja(t.cellId),d=l.code,u=Za(t.cellId);let h,f,m,x,g,p,b,y,v,w,S,j,C,_;if(e[0]!==r||e[1]!==s||e[2]!==n.focusedCellId||e[3]!==o||e[4]!==t.cellId||e[5]!==i||e[6]!==l.code||e[7]!==u.errored){if(h={id:a,graph:i,code:d,hasError:u.errored},n.focusedCellId&&o[n.focusedCellId]){const z=o[n.focusedCellId];let N;e[20]!==n.focusedCellId||e[21]!==z?(N={id:n.focusedCellId,graph:z},e[20]=n.focusedCellId,e[21]=z,e[22]=N):N=e[22],x=N}m=(x==null?void 0:x.id)===h.id,f=ak(h.graph)?1.5:3;const O=()=>{m?s.blurCell():(r.focusCell({cellId:h.id,where:"exact"}),s.focusCell({cellId:h.id}))};j=h.id;const P=m?"text-primary-foreground":"text-(--gray-8) hover:text-(--gray-9)";e[23]!==P?(g=xe("group bg-transparent text-left w-full flex relative justify-between items-center","border-none rounded cursor-pointer","h-[21px] pl-[51px] font-inherit",P),e[23]=P,e[24]=g):g=e[24],p=O,b=uM;const R=m&&"bg-primary group-hover:bg-primary";e[25]!==R?(S=xe("group-hover:bg-(--gray-2) flex h-full w-full px-0.5 items-center rounded",R),e[25]=R,e[26]=S):S=e[26],y="truncate px-1 font-mono text-sm flex gap-1",v=h.code,w=h.graph.variables.length>0?c.jsx(lM,{cell:h,selectedCell:x}):c.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap max-w-full",children:iM(h.code)??c.jsx("span",{className:"italic",children:"empty"})}),e[0]=r,e[1]=s,e[2]=n.focusedCellId,e[3]=o,e[4]=t.cellId,e[5]=i,e[6]=l.code,e[7]=u.errored,e[8]=h,e[9]=f,e[10]=m,e[11]=x,e[12]=g,e[13]=p,e[14]=b,e[15]=y,e[16]=v,e[17]=w,e[18]=S,e[19]=j}else h=e[8],f=e[9],m=e[10],x=e[11],g=e[12],p=e[13],b=e[14],y=e[15],v=e[16],w=e[17],S=e[18],j=e[19];e[27]!==y||e[28]!==v||e[29]!==w?(C=c.jsx("div",{className:y,title:v,children:w}),e[27]=y,e[28]=v,e[29]=w,e[30]=C):C=e[30],e[31]!==C||e[32]!==S?(_=c.jsx("div",{className:S,children:C}),e[31]=C,e[32]=S,e[33]=_):_=e[33];const E=m?"z-30":"z-20";let M,I,D,F;return e[34]!==h||e[35]!==x||e[36]!==E?(M=xe("absolute overflow-visible top-[10.5px] left-[calc(var(--spacing-extra-small,8px)+17px)] pointer-events-none",E,function({cell:O,selectedCell:P}){return O.hasError?"text-destructive":!P&&!ak(O.graph)?"text-foreground":(P==null?void 0:P.id)===O.id||P!=null&&P.graph.parents.has(O.id)||P!=null&&P.graph.children.has(O.id)?"text-primary":"text-(--gray-8)"}({cell:h,selectedCell:x})),e[34]=h,e[35]=x,e[36]=E,e[37]=M):M=e[37],e[38]!==h||e[39]!==f||e[40]!==m||e[41]!==t.cellPositions||e[42]!==x?(I=m?c.jsx(cM,{cell:h,cellPositions:t.cellPositions,circleRadius:f}):c.jsx(dM,{cell:h,selectedCell:x,circleRadius:f}),e[38]=h,e[39]=f,e[40]=m,e[41]=t.cellPositions,e[42]=x,e[43]=I):I=e[43],e[44]!==M||e[45]!==I?(D=c.jsx("svg",{className:M,width:"1",height:"1",children:I}),e[44]=M,e[45]=I,e[46]=D):D=e[46],e[47]!==g||e[48]!==p||e[49]!==b||e[50]!==_||e[51]!==D||e[52]!==j?(F=c.jsxs("button",{"data-node-id":j,className:g,onClick:p,onMouseDown:b,children:[_,D]}),e[47]=g,e[48]=p,e[49]=b,e[50]=_,e[51]=D,e[52]=j,e[53]=F):F=e[53],F},sM=t=>{const e=H.c(28),{open:n,setOpen:o}=t,r=gr();let s;e[0]!==r.inOrderIds?(s=Object.fromEntries(r.inOrderIds.map(hM)),e[0]=r.inOrderIds,e[1]=s):s=e[1];const a=s;let i;if(e[2]!==r){i=[];let v=0;for(const[w,S]of r.getColumns().entries())w>0&&i.push(v),v+=S.inOrderIds.length;e[2]=r,e[3]=i}else i=e[3];const l=n?"translate-x-0":"translate-x-[calc(100%+20px)]";let d,u,h,f,m,x,g,p,b,y;if(e[4]!==l?(d=xe("fixed top-14 right-5 z-50 bg-background/95 backdrop-blur-sm supports-backdrop-filter:bg-background/60 rounded-lg border shadow-lg w-64 flex flex-col max-h-[58vh]","motion-safe:transition-transform motion-safe:duration-200 motion-safe:ease-in-out",l),e[4]=l,e[5]=d):d=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(u=c.jsx("span",{className:"text-sm font-semibold",children:"Minimap"}),e[6]=u):u=e[6],e[7]!==o?(h=()=>o(!1),e[7]=o,e[8]=h):h=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(f=c.jsx(yn,{className:"h-4 w-4"}),e[9]=f):f=e[9],e[10]!==h?(m=c.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[u,c.jsx(ve,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:h,children:f})]}),e[10]=h,e[11]=m):m=e[11],e[12]!==r.inOrderIds||e[13]!==a||e[14]!==i){let v;e[16]!==a||e[17]!==i?(v=(w,S)=>{const j=i.includes(S);return c.jsxs(T.Fragment,{children:[j&&c.jsx("div",{className:"absolute left-5 w-[36px] h-px bg-(--gray-4) pointer-events-none","aria-hidden":"true"}),c.jsx(rM,{cellId:w,cellPositions:a})]},w)},e[16]=a,e[17]=i,e[18]=v):v=e[18],x=r.inOrderIds.map(v),e[12]=r.inOrderIds,e[13]=a,e[14]=i,e[15]=x}else x=e[15];return e[19]!==x?(g=c.jsx("div",{className:"py-3 pl-3 pr-4 relative min-h-full",children:x}),e[19]=x,e[20]=g):g=e[20],e[21]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx("div",{className:"h-0 overflow-hidden","aria-hidden":"true"}),e[21]=p):p=e[21],e[22]!==g?(b=c.jsxs("div",{className:"overflow-y-auto overflow-x-hidden flex-1 scrollbar-none",children:[g,p]}),e[22]=g,e[23]=b):b=e[23],e[24]!==b||e[25]!==d||e[26]!==m?(y=c.jsxs("div",{className:d,children:[m,b]}),e[24]=b,e[25]=d,e[26]=m,e[27]=y):y=e[27],y},aM=()=>{const t=H.c(5),[e,n]=Ot(yb);let o,r;return t[0]!==n?(o=()=>n(fM),t[0]=n,t[1]=o):o=t[1],Dt("global.toggleMinimap",o),t[2]!==e||t[3]!==n?(r=c.jsx(sM,{open:e,setOpen:n}),t[2]=e,t[3]=n,t[4]=r):r=t[4],r};function iM(t){return t.split(`
|
148
|
+
`)[0].trim()||void 0}const lM=t=>{const e=H.c(11),{cell:n,selectedCell:o}=t,r=Mm(),s=n.id===(o==null?void 0:o.id);let a,i;if(e[0]!==n.graph.variables||e[1]!==s||e[2]!==o||e[3]!==r){let l;e[5]!==s||e[6]!==o||e[7]!==r?(l=(d,u)=>{const h=r[d];return c.jsxs(T.Fragment,{children:[u>0&&", ",c.jsx("span",{className:xe({"font-bold":s,"text-foreground":o===void 0,"text-primary font-medium":!s&&R_(h,o)}),children:d})]},d)},e[5]=s,e[6]=o,e[7]=r,e[8]=l):l=e[8],a=n.graph.variables.map(l),e[0]=n.graph.variables,e[1]=s,e[2]=o,e[3]=r,e[4]=a}else a=e[4];return e[9]!==a?(i=c.jsx(c.Fragment,{children:a}),e[9]=a,e[10]=i):i=e[10],i},cM=t=>{const e=H.c(12),{cell:n,cellPositions:o,circleRadius:r}=t;let s,a,i,l;if(e[0]!==n.graph.children||e[1]!==n.graph.parents||e[2]!==n.id||e[3]!==o){s=[];const d=o[n.id]??0,u=new Set;for(const h of n.graph.parents)n.graph.children.has(h)&&u.add(h);for(const h of u){const f=o[h];if(f!==void 0){const m=21*(f-d);s.push(c.jsx("path",{d:`M -3 0 H -7 v ${m} h 14 v ${-m} H 3`,fill:"none",strokeWidth:"2",stroke:"currentColor"},`${n.id}-cycle-${h}`))}}for(const h of n.graph.parents){if(u.has(h))continue;const f=o[h];if(f!==void 0){const m=21*(f-d);s.push(c.jsx("path",{d:`M -3 0 H -7 v ${m} h -4`,fill:"none",strokeWidth:"2",stroke:"currentColor"},`${n.id}-up-${h}`))}}for(const h of n.graph.children){if(u.has(h))continue;const f=o[h];if(f!==void 0){const m=21*(f-d);s.push(c.jsx("path",{d:`M 3 0 H 7 v ${m} h 4`,fill:"none",strokeWidth:"2",stroke:"currentColor"},`${n.id}-down-${h}`))}}e[0]=n.graph.children,e[1]=n.graph.parents,e[2]=n.id,e[3]=o,e[4]=s}else s=e[4];return e[5]!==r?(a=c.jsx("circle",{r,fill:"currentColor",className:"pointer-events-auto"}),e[5]=r,e[6]=a):a=e[6],e[7]!==s?(i=c.jsx("g",{className:"pen pointer-events-auto",children:s}),e[7]=s,e[8]=i):i=e[8],e[9]!==a||e[10]!==i?(l=c.jsxs("g",{transform:"translate(0, 0)",children:[a,i]}),e[9]=a,e[10]=i,e[11]=l):l=e[11],l};function dM(t){const{cell:e,selectedCell:n,circleRadius:o}=t,r=e.graph.ancestors.size>0,s=e.graph.descendants.size>0;if(!n)return sk({circleRadius:o,leftWisker:r,rightWisker:s});const a=n.graph.ancestors.has(e.id),i=n.graph.descendants.has(e.id);return sk(a||i?{circleRadius:o,leftWisker:r,rightWisker:s,shift:a&&i?void 0:a?"left":"right"}:{circleRadius:o,leftWisker:!1,rightWisker:!1})}function sk(t){const{circleRadius:e,leftWisker:n,rightWisker:o,shift:r}=t,s=r===void 0?0:r==="left"?-14:14;return c.jsxs("g",{transform:`translate(${s}, 0)`,children:[c.jsxs("g",{children:[n&&c.jsx("path",{d:"M 0 0 h -8",fill:"none",strokeWidth:"2",stroke:"currentColor"}),o&&c.jsx("path",{d:"M 0 0 h 8",fill:"none",strokeWidth:"2",stroke:"currentColor"})]}),c.jsx("circle",{r:e,fill:"currentColor",className:"pointer-events-auto"})]})}function ak(t){return t.variables.length===0&&t.ancestors.size===0&&t.descendants.size===0}function uM(t){return t.preventDefault()}function hM(t,e){return[t,e]}function fM(t){return!t}const mM=q.lazy(()=>wm(()=>import("./terminal-YtWC9fV-.js"),__vite__mapDeps([126,1,2,127]),import.meta.url)),pM=t=>{const e=H.c(122),{children:n}=t,{isSidebarOpen:o,isTerminalOpen:r,selectedPanel:s}=sc(),{setIsSidebarOpen:a,setIsTerminalOpen:i}=Fa(),l=q.useRef(null),d=q.useRef(null);let u,h,f,m,x;e[0]!==o?(u=()=>{if(!l.current)return;const Pe=l.current.isCollapsed();o&&Pe&&l.current.expand(),o||Pe||l.current.collapse(),requestAnimationFrame(xM)},h=[o],e[0]=o,e[1]=u,e[2]=h):(u=e[1],h=e[2]),T.useEffect(u,h),e[3]!==r?(f=()=>{if(!d.current)return;const Pe=d.current.isCollapsed();r&&Pe&&d.current.expand(),r||Pe||d.current.collapse(),requestAnimationFrame(yM)},m=[r],e[3]=r,e[4]=f,e[5]=m):(f=e[4],m=e[5]),T.useEffect(f,m),e[6]!==n?(x=c.jsx(Oc,{id:"app",className:"relative h-full",children:c.jsx(T.Suspense,{children:n})},"app"),e[6]=n,e[7]=x):x=e[7];const g=x,p=o?"resize-handle":"resize-handle-collapsed";let b,y;e[8]!==p?(b=xe("border-border no-print z-10",p,"vertical"),e[8]=p,e[9]=b):b=e[9],e[10]!==b?(y=c.jsx(dj,{onDragging:uj,className:b}),e[10]=b,e[11]=y):y=e[11];const v=y,w=r?"resize-handle":"resize-handle-collapsed";let S,j;e[12]!==w?(S=xe("border-border no-print z-20",w,"horizontal"),e[12]=w,e[13]=S):S=e[13],e[14]!==S?(j=c.jsx(dj,{onDragging:uj,className:S}),e[14]=S,e[15]=j):j=e[15];const C=j;let _,E,M,I,D,F,O,P,R,z,N,k,B,A,U,$,X,Y,G,W,J;e[16]!==s?(_=c.jsx("div",{className:"text-sm text-(--slate-11) uppercase tracking-wide font-semibold flex-1",children:s}),e[16]=s,e[17]=_):_=e[17],e[18]!==a?(E=()=>a(!1),e[18]=a,e[19]=E):E=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(M=c.jsx(yn,{className:"w-4 h-4"}),e[20]=M):M=e[20],e[21]!==E?(I=c.jsx(ve,{"data-testid":"close-helper-pane",className:"m-0",size:"xs",variant:"text",onClick:E,children:M}),e[21]=E,e[22]=I):I=e[22],e[23]!==_||e[24]!==I?(D=c.jsxs("div",{className:"p-3 border-b flex justify-between items-center",children:[_,I]}),e[23]=_,e[24]=I,e[25]=D):D=e[25],e[26]!==s?(F=s==="files"&&c.jsx(Yw,{}),e[26]=s,e[27]=F):F=e[27],e[28]!==s?(O=s==="errors"&&c.jsx(o7,{}),e[28]=s,e[29]=O):O=e[29],e[30]!==s?(P=s==="variables"&&c.jsx(oM,{}),e[30]=s,e[31]=P):P=e[31],e[32]!==s?(R=s==="dependencies"&&c.jsx($T,{}),e[32]=s,e[33]=R):R=e[33],e[34]!==s?(z=s==="packages"&&c.jsx(I7,{}),e[34]=s,e[35]=z):z=e[35],e[36]!==s?(N=s==="outline"&&c.jsx(_7,{}),e[36]=s,e[37]=N):N=e[37],e[38]!==s?(k=s==="datasources"&&c.jsx(t7,{}),e[38]=s,e[39]=k):k=e[39],e[40]!==s?(B=s==="documentation"&&c.jsx(n7,{}),e[40]=s,e[41]=B):B=e[41],e[42]!==s?(A=s==="snippets"&&c.jsx(X7,{}),e[42]=s,e[43]=A):A=e[43],e[44]!==s?(U=s==="scratchpad"&&c.jsx(z7,{}),e[44]=s,e[45]=U):U=e[45],e[46]!==s?($=s==="chat"&&c.jsx(d8,{}),e[46]=s,e[47]=$):$=e[47],e[48]!==s?(X=s==="logs"&&c.jsx(Kw,{}),e[48]=s,e[49]=X):X=e[49],e[50]!==s?(Y=s==="tracing"&&c.jsx(eM,{}),e[50]=s,e[51]=Y):Y=e[51],e[52]!==s?(G=s==="secrets"&&c.jsx(B7,{}),e[52]=s,e[53]=G):G=e[53],e[54]!==F||e[55]!==O||e[56]!==P||e[57]!==R||e[58]!==z||e[59]!==N||e[60]!==k||e[61]!==B||e[62]!==A||e[63]!==U||e[64]!==$||e[65]!==X||e[66]!==Y||e[67]!==G?(W=c.jsx(T.Suspense,{children:c.jsxs(Ac,{children:[F,O,P,R,z,N,k,B,A,U,$,X,Y,G]})}),e[54]=F,e[55]=O,e[56]=P,e[57]=R,e[58]=z,e[59]=N,e[60]=k,e[61]=B,e[62]=A,e[63]=U,e[64]=$,e[65]=X,e[66]=Y,e[67]=G,e[68]=W):W=e[68],e[69]!==D||e[70]!==W?(J=c.jsx(dc,{children:c.jsxs("div",{className:"flex flex-col h-full flex-1 overflow-hidden mr-[-4px]",children:[D,W]})}),e[69]=D,e[70]=W,e[71]=J):J=e[71];const V=J,Q=o&&"border-r border-l border-(--slate-7)";let te,re,ne,ae,se,ie;e[72]!==Q?(te=xe("dark:bg-(--slate-1) no-print print:hidden hide-on-fullscreen",Q),e[72]=Q,e[73]=te):te=e[73],e[74]===Symbol.for("react.memo_cache_sentinel")?(re=(Pe,Re)=>{var He;Re===0&&Pe===10&&((He=l.current)==null||He.resize(30))},e[74]=re):re=e[74],e[75]!==a?(ne=()=>a(!1),ae=()=>a(!0),e[75]=a,e[76]=ne,e[77]=ae):(ne=e[76],ae=e[77]),e[78]!==V||e[79]!==v?(se=c.jsxs("span",{className:"flex flex-row h-full",children:[V," ",v]}),e[78]=V,e[79]=v,e[80]=se):se=e[80],e[81]!==te||e[82]!==ne||e[83]!==ae||e[84]!==se?(ie=c.jsx(Oc,{ref:l,id:"helper",collapsedSize:0,collapsible:!0,className:te,minSize:10,defaultSize:0,maxSize:75,onResize:re,onCollapse:ne,onExpand:ae,children:se},"helper"),e[81]=te,e[82]=ne,e[83]=ae,e[84]=se,e[85]=ie):ie=e[85];const ge=ie,oe=r&&"border-(--slate-7)";let ue,de,Ce,Te,Fe,_e,ke,Ye,Ve;e[86]!==oe?(ue=xe("dark:bg-(--slate-1) no-print print:hidden hide-on-fullscreen",oe),e[86]=oe,e[87]=ue):ue=e[87],e[88]===Symbol.for("react.memo_cache_sentinel")?(de=(Pe,Re)=>{var He;Re===0&&Pe===10&&((He=d.current)==null||He.resize(30))},e[88]=de):de=e[88],e[89]!==i?(Ce=()=>i(!1),Te=()=>i(!0),e[89]=i,e[90]=Ce,e[91]=Te):(Ce=e[90],Te=e[91]),e[92]===Symbol.for("react.memo_cache_sentinel")?(Fe=c.jsx("div",{}),e[92]=Fe):Fe=e[92],e[93]!==i?(_e=()=>i(!1),e[93]=i,e[94]=_e):_e=e[94],e[95]!==r||e[96]!==_e?(ke=c.jsx(T.Suspense,{fallback:Fe,children:c.jsx(mM,{visible:r,onClose:_e})}),e[95]=r,e[96]=_e,e[97]=ke):ke=e[97],e[98]!==r||e[99]!==ke?(Ye=c.jsx(VT,{isOpen:r,children:ke}),e[98]=r,e[99]=ke,e[100]=Ye):Ye=e[100],e[101]!==ue||e[102]!==Ce||e[103]!==Te||e[104]!==Ye||e[105]!==C?(Ve=c.jsxs(Oc,{ref:d,id:"terminal",collapsedSize:0,collapsible:!0,className:ue,minSize:10,defaultSize:0,maxSize:75,onResize:de,onCollapse:Ce,onExpand:Te,children:[C,Ye]},"terminal"),e[101]=ue,e[102]=Ce,e[103]=Te,e[104]=Ye,e[105]=C,e[106]=Ve):Ve=e[106];const Ke=Ve;let ee,ye,we,Ie,K,me,pe,he,je;return e[107]===Symbol.for("react.memo_cache_sentinel")?(ee=XR(),e[107]=ee):ee=e[107],e[108]===Symbol.for("react.memo_cache_sentinel")?(ye=c.jsx(Ac,{children:c.jsx(q_,{})}),e[108]=ye):ye=e[108],e[109]!==Ke?(we=c.jsx(xb,{capability:"terminal",children:Ke}),e[109]=Ke,e[110]=we):we=e[110],e[111]!==g||e[112]!==we?(Ie=c.jsx(Oc,{children:c.jsxs(hj,{autoSaveId:"marimo:chrome:v1:l1",direction:"vertical",children:[g,we]})}),e[111]=g,e[112]=we,e[113]=Ie):Ie=e[113],e[114]===Symbol.for("react.memo_cache_sentinel")?(K=c.jsx(sR,{}),e[114]=K):K=e[114],e[115]!==ge||e[116]!==Ie?(me=c.jsxs(hj,{autoSaveId:"marimo:chrome:v1:l2",direction:"horizontal",storage:ee,children:[ye,ge,Ie,K]}),e[115]=ge,e[116]=Ie,e[117]=me):me=e[117],e[118]===Symbol.for("react.memo_cache_sentinel")?(pe=c.jsx(aM,{}),e[118]=pe):pe=e[118],e[119]===Symbol.for("react.memo_cache_sentinel")?(he=c.jsx(dc,{children:c.jsx(Ac,{children:c.jsx(U_,{})})}),e[119]=he):he=e[119],e[120]!==me?(je=c.jsxs(JR,{children:[me,pe,he]}),e[120]=me,e[121]=je):je=e[121],je};function gM(){window.dispatchEvent(new Event("resize"))}function xM(){requestAnimationFrame(gM)}function bM(){window.dispatchEvent(new Event("resize"))}function yM(){requestAnimationFrame(bM)}let ik;ik=new URL(window.location.href).searchParams.get(aR.showChrome)==="false",Pj=Object.freeze(Object.defineProperty({__proto__:null,default:t=>{const e=H.c(10);if(ik){let s,a,i;return e[0]!==t?(s=c.jsx(gb,{hideControls:!0,...t}),e[0]=t,e[1]=s):s=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(Bp,{}),e[2]=a):a=e[2],e[3]!==s?(i=c.jsxs(c.Fragment,{children:[s,a]}),e[3]=s,e[4]=i):i=e[4],i}let n,o,r;return e[5]!==t?(n=c.jsx(gb,{...t}),e[5]=t,e[6]=n):n=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(o=c.jsx(Bp,{}),e[7]=o):o=e[7],e[8]!==n?(r=c.jsxs(pM,{children:[n,o]}),e[8]=n,e[9]=r):r=e[9],r}},Symbol.toStringTag,{value:"Module"}))});export{Hm as C,Pc as E,ln as P,sL as __tla,Rc as a,Pj as e,js as f};
|