@marimo-team/frontend 0.14.18-dev27 → 0.14.18-dev28
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-kV89hegS.js → ConnectedDataExplorerComponent-BGk-isV3.js} +1 -1
- package/dist/assets/{ImageComparisonComponent-CCBT9pik.js → ImageComparisonComponent-BJlDBejS.js} +1 -1
- package/dist/assets/{VegaLite-FoO-nmDF.js → VegaLite-BA2qA-HB.js} +1 -1
- package/dist/assets/{_baseEach-BtPNr9PU.js → _baseEach-Bs9eJW7C.js} +1 -1
- package/dist/assets/_baseMap-BMXPYSvd.js +1 -0
- package/dist/assets/{_baseUniq-BLQswvX5.js → _baseUniq-DZpfmV-G.js} +1 -1
- package/dist/assets/{_createAggregator-DjaN3Ndt.js → _createAggregator-BmYrZ5eo.js} +1 -1
- package/dist/assets/{any-language-editor-g32_9cET.js → any-language-editor-C4U5JSk4.js} +1 -1
- package/dist/assets/{architectureDiagram-SUXI7LT5-C1FIdnR-.js → architectureDiagram-SUXI7LT5-CxcEJwWe.js} +1 -1
- package/dist/assets/{blockDiagram-6J76NXCF-HyHHhbpS.js → blockDiagram-6J76NXCF-D96Zo1pD.js} +1 -1
- package/dist/assets/{c4Diagram-6F6E4RAY-C4V1bSE7.js → c4Diagram-6F6E4RAY-B-ORSC8g.js} +1 -1
- package/dist/assets/channel-FnCloSlV.js +1 -0
- package/dist/assets/{chunk-353BL4L5-BvWoFLoD.js → chunk-353BL4L5-BJ8dY0OG.js} +1 -1
- package/dist/assets/{chunk-67H74DCK-CQxTlpPD.js → chunk-67H74DCK-DpHddHc9.js} +1 -1
- package/dist/assets/{chunk-AACKK3MU-1SBO6ypc.js → chunk-AACKK3MU-BufbENme.js} +1 -1
- package/dist/assets/{chunk-BFAMUDN2-Dtwm2Z3D.js → chunk-BFAMUDN2-c6_G5Lvb.js} +1 -1
- package/dist/assets/{chunk-E2GYISFI-BgLYUu0E.js → chunk-E2GYISFI-D6MqmVph.js} +1 -1
- package/dist/assets/{chunk-OW32GOEJ-jpV888KO.js → chunk-OW32GOEJ-DtvOBw-U.js} +1 -1
- package/dist/assets/{chunk-SKB7J2MH-uQaRxI7q.js → chunk-SKB7J2MH-Xj2W0Qf_.js} +1 -1
- package/dist/assets/{chunk-SZ463SBG-1nKNGw5S.js → chunk-SZ463SBG-BvhDrpSj.js} +1 -1
- package/dist/assets/{circle-play-ln4YSzur.js → circle-play--cLK-_ms.js} +1 -1
- package/dist/assets/classDiagram-M3E45YP4-CQ3Oj_E8.js +1 -0
- package/dist/assets/classDiagram-v2-YAWTLIQI-CQ3Oj_E8.js +1 -0
- package/dist/assets/clone-ByqrGDXz.js +1 -0
- package/dist/assets/{compile-CUHAUIGX.js → compile-B75eibU9.js} +1 -1
- package/dist/assets/{dagre-JOIXM2OF-BsekNXc2.js → dagre-JOIXM2OF-CCTw3W-_.js} +1 -1
- package/dist/assets/{data-grid-overlay-editor-CbLpxNH2.js → data-grid-overlay-editor-4c45agll.js} +1 -1
- package/dist/assets/{diagram-5UYTHUR4-BoQSxLct.js → diagram-5UYTHUR4-CW36tPSI.js} +1 -1
- package/dist/assets/{diagram-VMROVX33-BlQs1oGq.js → diagram-VMROVX33-DbQOxk2E.js} +1 -1
- package/dist/assets/{diagram-ZTM2IBQH-BLTVC_oB.js → diagram-ZTM2IBQH-DBP3JH-J.js} +1 -1
- package/dist/assets/{edit-page-CKuvoCUs.js → edit-page-B2LPiGi8.js} +5 -5
- package/dist/assets/{erDiagram-3M52JZNH-DuJKG4Gf.js → erDiagram-3M52JZNH-CcYK1oIw.js} +1 -1
- package/dist/assets/{flowDiagram-KYDEHFYC-DEy3MkMb.js → flowDiagram-KYDEHFYC-DyyciACD.js} +1 -1
- package/dist/assets/{ganttDiagram-EK5VF46D-C6Lur_08.js → ganttDiagram-EK5VF46D-DLDTH_0x.js} +1 -1
- package/dist/assets/{gitGraphDiagram-GW3U2K7C-R9ILoxeN.js → gitGraphDiagram-GW3U2K7C-CeY7B54s.js} +1 -1
- package/dist/assets/{glide-data-editor-Bbfoi1Gx.js → glide-data-editor-DPsgDuDp.js} +4 -4
- package/dist/assets/{graph-IyATW7Ls.js → graph-CIs2gZzY.js} +1 -1
- package/dist/assets/{home-page-H9Py-FLg.js → home-page-bvpN7mfi.js} +1 -1
- package/dist/assets/{index-Dlo4pRcD.js → index-1c2l-RgC.js} +1 -1
- package/dist/assets/{index-CU4PVlXT.js → index-B30u7UQa.js} +1 -1
- package/dist/assets/{index-BERYPFL1.js → index-BAklN9yx.js} +1 -1
- package/dist/assets/{index-CUb_KVnK.js → index-BNOZ5sYp.js} +1 -1
- package/dist/assets/{index-7dYaveQG.js → index-BS2OovtB.js} +1 -1
- package/dist/assets/{index-C_joixHv.js → index-BnKjcbm6.js} +1 -1
- package/dist/assets/{index-DB6hYznU.js → index-BnOTGeEb.js} +1 -1
- package/dist/assets/{index-brfAOFcq.js → index-BpXbYAhi.js} +1 -1
- package/dist/assets/{index-BkKnv7OZ.js → index-BtXAzkDv.js} +1 -1
- package/dist/assets/{index-BuiYi25-.js → index-Buso0H88.js} +11 -11
- package/dist/assets/{index-CUIPUIK9.js → index-C72zNiee.js} +1 -1
- package/dist/assets/{index-B3Q6PaCG.css → index-CI2OUPJT.css} +1 -1
- package/dist/assets/{index-DQWhXpqD.js → index-CLbaFJE2.js} +1 -1
- package/dist/assets/{index-BuC1PbVD.js → index-CmZVYjqQ.js} +1 -1
- package/dist/assets/{index-DSkvxN6G.js → index-Cq818vcA.js} +1 -1
- package/dist/assets/{index-CmKaZns3.js → index-D9LSCsXX.js} +1 -1
- package/dist/assets/{index-BMTo1kmZ.js → index-DebFjzS3.js} +1 -1
- package/dist/assets/{index-NvSa6WXE.js → index-DziFNxDk.js} +1 -1
- package/dist/assets/{index-BOOKcrkr.js → index-gsDLk9hd.js} +1 -1
- package/dist/assets/{index-ODIo4Rny.js → index-t5mmzKNH.js} +1 -1
- package/dist/assets/{infoDiagram-LHK5PUON-pVniElLT.js → infoDiagram-LHK5PUON-DyIxntyu.js} +1 -1
- package/dist/assets/{journeyDiagram-EWQZEKCU-COlVsWT6.js → journeyDiagram-EWQZEKCU-CwYQ9AO4.js} +1 -1
- package/dist/assets/{kanban-definition-ZSS6B67P-CH-Y8xC4.js → kanban-definition-ZSS6B67P-JjiD001B.js} +1 -1
- package/dist/assets/{layout-DF0eeXRM.js → layout-KWv87I-o.js} +1 -1
- package/dist/assets/{linear-BjNl7qfj.js → linear-BlykO2l3.js} +1 -1
- package/dist/assets/{links-C3JblEio.js → links-Byp_t4Gg.js} +1 -1
- package/dist/assets/{mermaid-CkIWo3KZ.js → mermaid-PYSA9-XP.js} +4 -4
- package/dist/assets/{min-BhHIVgiw.js → min-2sfnjQhK.js} +1 -1
- package/dist/assets/{mindmap-definition-6CBA2TL7-DvXI-sDy.js → mindmap-definition-6CBA2TL7-DoaEN0Dg.js} +1 -1
- package/dist/assets/{number-overlay-editor-BrJwlgom.js → number-overlay-editor-U--GfD0m.js} +1 -1
- package/dist/assets/{pieDiagram-NIOCPIFQ-DmRtvckw.js → pieDiagram-NIOCPIFQ-Fq5QrEss.js} +1 -1
- package/dist/assets/{quadrantDiagram-2OG54O6I-B-myavfQ.js → quadrantDiagram-2OG54O6I-DqRHcIzc.js} +1 -1
- package/dist/assets/{react-plotly-CbD0E3gn.js → react-plotly-3a4gKdgk.js} +1 -1
- package/dist/assets/{requirementDiagram-QOLK2EJ7-B0iBUYVd.js → requirementDiagram-QOLK2EJ7-B-orJhn5.js} +1 -1
- package/dist/assets/{run-page-CfCr8ZaZ.js → run-page-CC73GX5s.js} +1 -1
- package/dist/assets/{sankeyDiagram-4UZDY2LN-BOABhaGp.js → sankeyDiagram-4UZDY2LN-BvBTXGuL.js} +1 -1
- package/dist/assets/{sequenceDiagram-SKLFT4DO-CVm9Rc2n.js → sequenceDiagram-SKLFT4DO-CaqBJ5c8.js} +1 -1
- package/dist/assets/{slides-component-Dhxcg3GE.js → slides-component-D4dP2BCr.js} +1 -1
- package/dist/assets/{sortBy-DboPkNKn.js → sortBy-BpwJ4mKF.js} +1 -1
- package/dist/assets/{stateDiagram-MI5ZYTHO-B0D_2l-g.js → stateDiagram-MI5ZYTHO-XxcGaQey.js} +1 -1
- package/dist/assets/stateDiagram-v2-5AN5P6BG-DWtb-8Ds.js +1 -0
- package/dist/assets/{storage-BG0-GvyP.js → storage-BCorTI1K.js} +3 -3
- package/dist/assets/{terminal-BArxXaJ7.js → terminal-pM14FLUA.js} +1 -1
- package/dist/assets/{time-jUzTrC3Y.js → time-BeHgQetb.js} +1 -1
- package/dist/assets/{timeline-definition-MYPXXCX6-DGqL1AI5.js → timeline-definition-MYPXXCX6-BY6e5n0h.js} +1 -1
- package/dist/assets/{tracing-Bpc-dmnr.js → tracing-CPx3xYyj.js} +2 -2
- package/dist/assets/{trash-XFZSbevE.js → trash-CFPpBf0V.js} +1 -1
- package/dist/assets/{treemap-75Q7IDZK-DZ-dAoS7.js → treemap-75Q7IDZK-CeVh_NEo.js} +1 -1
- package/dist/assets/{vega-component-BHuC7Ytz.js → vega-component-DXdWcsJT.js} +1 -1
- package/dist/assets/{xychartDiagram-H2YORKM3-CqwhMSJ2.js → xychartDiagram-H2YORKM3-fvJ1-_G-.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/src/components/editor/output/CalloutOutput.styles.ts +6 -6
- package/src/components/editor/renderers/CellArray.tsx +1 -1
- package/dist/assets/_baseMap-Bx7gBfad.js +0 -1
- package/dist/assets/channel-ClPZuylT.js +0 -1
- package/dist/assets/classDiagram-M3E45YP4-DrSJwLTe.js +0 -1
- package/dist/assets/classDiagram-v2-YAWTLIQI-DrSJwLTe.js +0 -1
- package/dist/assets/clone-bCrdm5nu.js +0 -1
- package/dist/assets/stateDiagram-v2-5AN5P6BG-D02K8lMX.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./tracing-
|
|
2
|
-
var AO=Object.defineProperty;var l3=Mt=>{throw TypeError(Mt)};var TO=(Mt,wt,nn)=>wt in Mt?AO(Mt,wt,{enumerable:!0,configurable:!0,writable:!0,value:nn}):Mt[wt]=nn;var Z=(Mt,wt,nn)=>TO(Mt,typeof wt!="symbol"?wt+"":wt,nn),MO=(Mt,wt,nn)=>wt.has(Mt)||l3("Cannot "+nn);var c3=(Mt,wt,nn)=>(MO(Mt,wt,"read from private field"),nn?nn.call(Mt):wt.get(Mt)),d3=(Mt,wt,nn)=>wt.has(Mt)?l3("Cannot add the same private member more than once"):wt instanceof WeakSet?wt.add(Mt):wt.set(Mt,nn);import{c as Ee,iC as pr,iD as OO,iE as am,iF as DO,iG as RO,iH as u3,iI as h3,iJ as Kl,U as O,iK as PO,iL as LO,dL as f3,iM as FO,dH as zO,dK as BO,b as q,dF as lm,a as H,T as tt,ac as Je,j as u,a1 as Fn,a9 as Wo,a8 as ls,aa as cs,bn as qo,a6 as ve,ab as sn,iN as Ti,a7 as Go,aS as zn,ad as Mi,at as Ne,ao as Ct,dZ as cm,eN as Oi,iO as UO,aN as Le,S as lt,iP as $O,e$ as bn,iQ as m3,iR as p3,iS as Xl,iT as g3,L as ut,dx as Jl,aX as Yo,iU as Zl,aZ as dm,ag as tn,iV as VO,aw as Di,iW as HO,iX as x3,e_ as b3,al as jt,b4 as um,iY as y3,cA as Ql,iZ as WO,dQ as Qe,i_ as ec,dX as In,i$ as Ri,V as je,b9 as An,j0 as tc,j1 as nc,eQ as ds,j2 as qO,j3 as Pi,j4 as v3,eY as w3,j5 as hm,j6 as fm,eq as mm,j7 as Jn,j8 as gr,aV as oc,j9 as GO,ja as rc,jb as sc,au as No,ee as k3,av as Li,jc as YO,jd as ic,bp as xr,eR as br,fu as C3,bd as Dt,je as KO,jf as XO,g1 as ac,aP as lc,jg as pm,jh as JO,ji as j3,jj as gm,jk as ZO,jl as xm,jm as Zn,jn as S3,g3 as bm,jo as Fi,jp as cc,ev as ft,ex as us,jq as gt,jr as ze,js as at,jt as ym,ju as QO,jv as vm,jw as xt,jx as N3,dr as dc,dm as uc,dn as hc,dp as fc,dl as mc,fH as wm,b3 as Bn,aJ as Tn,fx as E3,fz as _3,fA as eD,fF as tD,fB as I3,jy as A3,ar as xe,ep as nD,b1 as Eo,a$ as _o,b2 as Io,a_ as At,eZ as an,jz as T3,fD as M3,jA as oD,jB as rD,fv as O3,fw as D3,jC as hs,dq as R3,jD as P3,gv as sD,jE as iD,a5 as aD,a4 as lD,jF as km,du as cD,dw as Cm,fi as pc,jG as gc,jH as xc,bs as yn,eU as zi,ff as ln,bi as L3,d_ as Bt,ek as dD,a2 as jm,jI as Bi,jJ as bc,jK as uD,jL as hD,jM as F3,a3 as fD,ae as Ui,eK as z3,jN as Gt,aW as mD,af as Sm,g6 as B3,er as yc,jO as pD,gN as Nm,bh as vc,bk as gD,jP as xD,jQ as U3,gn as bD,gk as yD,gl as vD,gm as wD,jR as Em,ds as Un,jS as kD,jT as wc,jU as fs,q as Qn,o as We,fN as $n,jV as vn,jW as ot,jX as ms,jY as Tt,g2 as Rt,jZ as _m,eu as wn,j_ as CD,j$ as Im,bf as $3,bg as V3,k0 as jD,gQ as ps,k1 as kc,bc as Cc,gR as yr,f0 as Am,k2 as SD,k3 as H3,k4 as $i,k5 as W3,k6 as Tm,k7 as q3,k8 as G3,k9 as Y3,ka as K3,f1 as Mm,kb as ND,kc as eo,kd as jc,ke as X3,dt as J3,kf as Sc,gM as Om,kg as Vi,kh as Hi,ki as Wi,kj as Nc,kk as Ko,kl as Z3,km as Ao,kn as gs,ko as Dm,kp as qi,kq as xs,kr as Rm,ks as Pm,kt as Q3,ku as Ec,kv as ED,ay as Gi,kw as Yi,kx as _D,dW as _c,ky as ID,kz as Lm,kA as AD,kB as TD,kC as Ic,e3 as MD,kD as vr,kE as Ac,fM as Mn,kF as bs,fX as To,gg as eC,cl as tC,kG as Fm,fG as nC,eJ as oC,kH as rC,kI as Ki,kJ as sC,kK as Tc,kL as zm,kM as ys,kN as Xi,kO as Ji,kP as OD,gd as Mc,kQ as Bm,kR as Oc,ej as DD,ge as RD,kS as PD,kT as LD,kU as FD,kV as zD,u as BD,kW as UD,kX as $D,kY as VD,fQ as HD,kZ as WD,k_ as iC,t as L,k$ as qD,l0 as GD,l1 as YD,l2 as KD,l3 as XD,l4 as JD,l5 as ZD,l6 as QD,l7 as eR,l8 as tR,l9 as nR,la as oR,lb as rR,lc as sR,ld as iR,le as aR,lf as lR,lg as cR,lh as dR,li as uR,lj as hR,lk as fR,ll as Zi,lm as mR,ln as pR,lo as gR,lp as xR,lq as bR,lr as yR,ls as vR,lt as wR,lu as Um,lv as Dc,lw as aC,lx as kR,ly as CR,lz as lC,lA as jR,lB as vs,lC as On,lD as SR,lE as NR,lF as ER,lG as _R,lH as IR,lI as AR,lJ as TR,lK as MR,lL as OR,lM as DR,lN as Xo,lO as RR,lP as PR,lQ as LR,lR as FR,e0 as zR,lS as BR,lT as cC,e4 as UR,lU as Rc,lV as $R,lW as VR,lX as HR,lY as WR,gW as Jo,lZ as Pc,l_ as qR,l$ as GR,m0 as dC,m1 as $m,gP as ws,m2 as YR,m3 as KR,m4 as XR,m5 as Qi,m6 as ea,eX as Vm,m7 as JR,fV as ZR,bm as QR,an as Hm,m8 as uC,m9 as eP,ma as tP,mb as Wm,mc as qm,md as nP,me as hC,mf as fC,mg as Lc,fL as oP,Y as mC,dO as rP,mh as pC,fs as vt,mi as ta,mj as ks,mk as sP,ml as iP,mm as aP,mn as lP,ck as Gm,mo as cP,am as Zo,be as gC,mp as dP,mq as uP,mr as hP,ms as Fc,mt as xC,dM as zc,bo as bC,ew as fP,mu as yC,mv as vC,mw as wC,mx as mP,my as kC,mz as CC,mA as na,mB as pP,mC as jC,mD as gP,mE as xP,mF as SC,Z as Bc,mG as bP,bq as NC,mH as yP,as as Mo,mI as vP,mJ as oa,mK as wP,mL as EC,eW as _C,fJ as Uc,mM as Ym,aU as Km,eo as $c,en as Xm,mN as kP,eT as IC,mO as CP,mP as AC,fr as jP,mQ as SP,gJ as NP,fy as EP,fC as Jm,gK as _P,bl as ra,mR as TC,mS as Zm,mT as IP,mU as AP,mV as TP,_ as kn,es as MP,mW as OP,mX as DP,mY as MC,fk as Qm,dz as OC,mZ as RP,aq as wr,m_ as PP,m$ as LP,n0 as FP,aO as zP,n1 as BP,n2 as UP,n3 as $P,W as VP,n4 as Vc,fg as HP,n5 as DC,gw as RC,fW as WP,gp as qP,n6 as GP,n7 as PC,n8 as YP,n9 as Cs,na as KP,nb as Hc,nc as XP,nd as JP,ne as ZP,z as LC,gU as QP,nf as sa,gz as FC,gA as zC,gB as BC,gu as UC,ng as eL,C as $C,nh as tL,ni as nL,nj as oL,E as kr,f6 as VC,bb as rL,b8 as sL,nk as iL,nl as aL,nm as lL,dC as HC,nn as ep,no as cL,dY as WC,np as dL,nq as tp,nr as uL,ns as hL,nt as fL,nu as qC,nv as GC,nw as YC,fe as KC,nx as mL,ny as pL,nz as XC,nA as JC,nB as Wc,nC as ZC,nD as QC,nE as ej,nF as gL,nG as xL,nH as tj,nI as bL,nJ as yL,nK as vL,nL as wL,nM as kL,nN as CL,dV as jL,nO as SL,nP as NL,nQ as EL,nR as _L,nS as IL,nT as AL,nU as TL,nV as ML,nW as OL,nX as DL,nY as RL,gi as PL,nZ as LL,n_ as FL,n$ as nj,o0 as zL,ax as BL,o1 as UL,ap as $L,eM as VL,o2 as HL,gE as np,gC as js,gF as Cr,gD as jr,gG as op,gH as rp,o3 as oj,o4 as rj,o5 as sj,o6 as Qo,gx as WL,o7 as qL,o8 as GL,o9 as YL,oa as KL,ob as XL,oc as ij,eB as JL,od as sp,oe as ZL,ah as qc,of as aj,og as lj,aj as cj,ai as QL,dU as eF,__tla as tF}from"./index-BuiYi25-.js";import{b as Ss,A as nF,L as dj,g as oF,G as rF,o as uj,s as sF,k as iF,B as hj,a as aF,M as lF,Y as cF,c as cn,u as ia,C as dF,S as uF,K as hF,d as fF,i as mF,e as fj,f as pF,h as gF,j as aa,P as la,l as mj,m as xF,n as bF,p as yF,D as Ns,q as vF,r as wF,t as ip,T as kF}from"./links-C3JblEio.js";import{V as pj,d as Sr,I as ap,N as gj,S as xj,e as bj,f as yj,L as vj,g as wj,F as kj,M as CF,l as Cj,h as jF,E as Gc,i as SF,j as lp,k as cp,n as NF,o as EF,p as _F,q as IF,s as AF,t as TF,v as MF,w as OF,u as DF,C as RF,R as jj,A as PF,a as LF,T as FF,x as zF,y as BF,m as UF,z as $F,B as VF,O as HF,c as WF,P as qF,__tla as GF}from"./storage-BG0-GvyP.js";import{c as YF}from"./_createAggregator-DjaN3Ndt.js";import{_ as Sj,a as Nj,i as KF,w as XF,L as Ej,A as JF,C as _j,b as dp,c as Ij,__tla as ZF}from"./loro_wasm_bg-C3hKWL9L.js";import{s as Vn,i as er,T as up,a as hp}from"./transform-B8bpuzxV.js";import{g as Aj}from"./timer-BwIYMJWC.js";import{i as QF}from"./zoom-COrs4lFh.js";import{s as ca}from"./sortBy-DboPkNKn.js";let fp,Yc,dn,Kc,Tj,Es,ez=Promise.all([(()=>{try{return tF}catch{}})(),(()=>{try{return GF}catch{}})(),(()=>{try{return ZF}catch{}})()]).then(async()=>{var Yl,s3;var Mt=YF(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});let wt,nn,mp,Xc,_s,Nr,Jc,Zc,pp,gp,da,Qc,xp,ua,bp,ed,yp,vp,td,wp,kp,Cp,ha,jp,nd,Sp,Np,Ep,_p,Ip,Ap,od,Tp,rd,sd,Mp,Op,Dp,Rp,Pp,Lp,fa,Fp,zp,id,Bp,Up,$p,ad,Vp,Hp,Wp,ma,ld,cd,qp,Gp,Yp,Kp,Xp,Jp,Zp,Qp,eg,dd,ud,tg,ng,og,pa,un,hn;wt=Ee("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),nn=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"}]]),mp=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"}]]),Xc=Ee("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),_s=Ee("ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]),Nr=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"}]]),Jc=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"}]]),Kc=Ee("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),pp=Ee("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),gp=Ee("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),da=Ee("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),Qc=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"}]]),xp=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"}]]),ua=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"}]]),bp=Ee("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]),ed=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"}]]),yp=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"}]]),vp=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"}]]),td=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"}]]),wp=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"}]]),kp=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"}]]),Cp=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"}]]),ha=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"}]]),jp=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"}]]),nd=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"}]]),Sp=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"}]]),Np=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"}]]),Ep=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"}]]),_p=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"}]]),Ip=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"}]]),Ap=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"}]]),od=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"}]]),Tp=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"}]]),rd=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"}]]),sd=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"}]]),Mp=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"}]]),Op=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"}]]),Dp=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"}]]),Rp=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"}]]),Pp=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"}]]),Lp=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"}]]),fa=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"}]]),Fp=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"}]]),zp=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"}]]),id=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"}]]),Bp=Ee("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Up=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"}]]),$p=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"}]]),ad=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"}]]),Hp=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"}]]),Wp=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"}]]),ma=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"}]]),ld=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"}]]),cd=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"}]]),qp=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"}]]),Gp=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"}]]),Yp=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"}]]),Kp=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"}]]),Xp=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"}]]),Jp=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"}]]),Zp=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"}]]),Qp=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"}]]),eg=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"}]]),dd=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"}]]),ud=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"}]]),tg=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"}]]),ng=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"}]]),og=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"}]]),pa=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"}]]),un=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"}]]),hn=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 ga(t,e){const n=+pr(t)-+pr(e);return n<0?-1:n>0?1:n}function Mj(t,e){const n=pr(t,e==null?void 0:e.in);return+function(o,r){const s=pr(o,r==null?void 0:r.in);return s.setHours(23,59,59,999),s}(n,e)==+function(o,r){const s=pr(o,r==null?void 0:r.in),i=s.getMonth();return s.setFullYear(s.getFullYear(),i+1,0),s.setHours(23,59,59,999),s}(n,e)}function Oj(t,e,n){const[o,r,s]=am(n==null?void 0:n.in,t,t,e),i=ga(r,s),a=Math.abs(function(d,h,f){const[m,g]=am(f==null?void 0:f.in,d,h);return 12*(m.getFullYear()-g.getFullYear())+(m.getMonth()-g.getMonth())}(r,s));if(a<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-i*a);let l=ga(r,s)===-i;Mj(o)&&a===1&&ga(o,s)===1&&(l=!1);const c=i*(a-+l);return c===0?0:c}function Dj(t,e,n){const o=function(r,s){return+pr(r)-+pr(s)}(t,e)/1e3;return(r=>{const s=(0,Math.trunc)(r);return s===0?0:s})(o)}function Rj(t,e){return function(n,o,r){const s=DO(),i=(r==null?void 0:r.locale)??s.locale??RO,a=ga(n,o);if(isNaN(a))throw new RangeError("Invalid time value");const l=Object.assign({},r,{addSuffix:r==null?void 0:r.addSuffix,comparison:a}),[c,d]=am(r==null?void 0:r.in,...a>0?[o,n]:[n,o]),h=Dj(d,c),f=(u3(d)-u3(c))/1e3,m=Math.round((h-f)/60);let g;if(m<2)return m===0?i.formatDistance("lessThanXMinutes",1,l):i.formatDistance("xMinutes",m,l);if(m<45)return i.formatDistance("xMinutes",m,l);if(m<90)return i.formatDistance("aboutXHours",1,l);if(m<h3){const x=Math.round(m/60);return i.formatDistance("aboutXHours",x,l)}if(m<2520)return i.formatDistance("xDays",1,l);if(m<Kl){const x=Math.round(m/h3);return i.formatDistance("xDays",x,l)}if(m<2*Kl)return g=Math.round(m/Kl),i.formatDistance("aboutXMonths",g,l);if(g=Oj(d,c),g<12){const x=Math.round(m/Kl);return i.formatDistance("xMonths",x,l)}{const x=g%12,p=Math.trunc(g/12);return x<3?i.formatDistance("aboutXYears",p,l):x<9?i.formatDistance("overXYears",p,l):i.formatDistance("almostXYears",p+1,l)}}(t,function(n){return OO(n,Date.now())}(t),e)}const Pj=O.createContext({}),Lj=O.forwardRef(function(t,e){[t,e]=zO(t,e,Pj);let{toolbarProps:n}=function(s,i){const{"aria-label":a,"aria-labelledby":l,orientation:c="horizontal"}=s;let[d,h]=O.useState(!1);PO(()=>{var p;h(!(!i.current||!(!((p=i.current.parentElement)===null||p===void 0)&&p.closest('[role="toolbar"]'))))});const{direction:f}=LO(),m=f==="rtl"&&c==="horizontal";let g=FO(i);const x=O.useRef(null);return{toolbarProps:{...f3(s,{labelable:!0}),role:d?"group":"toolbar","aria-orientation":c,"aria-label":a,"aria-labelledby":a==null?l:void 0,onKeyDownCapture:d?void 0:p=>{if(p.currentTarget.contains(p.target)){if(c==="horizontal"&&p.key==="ArrowRight"||c==="vertical"&&p.key==="ArrowDown")m?g.focusPrevious():g.focusNext();else{if(!(c==="horizontal"&&p.key==="ArrowLeft"||c==="vertical"&&p.key==="ArrowUp"))return p.key==="Tab"?(p.stopPropagation(),x.current=document.activeElement,void(p.shiftKey?g.focusFirst():g.focusLast())):void 0;m?g.focusNext():g.focusPrevious()}p.stopPropagation(),p.preventDefault()}},onFocusCapture:d?void 0:p=>{var b,y;x.current&&!p.currentTarget.contains(p.relatedTarget)&&(!((b=i.current)===null||b===void 0)&&b.contains(p.target))&&((y=x.current)===null||y===void 0||y.focus(),x.current=null)},onBlurCapture:d?void 0:p=>{p.currentTarget.contains(p.relatedTarget)||x.current||(x.current=p.target)}}}}(t,e),o=BO({...t,values:{orientation:t.orientation||"horizontal"},defaultClassName:"react-aria-Toolbar"}),r=f3(t,{global:!0});return delete r.id,q.createElement("div",{...lm(r,o,n),ref:e,slot:t.slot||void 0,"data-orientation":t.orientation||"horizontal"},o.children)}),xa="https://static.marimo.app",Fj=t=>{const e=H.c(25),{onClose:n}=t,[o,r]=O.useState(""),{exportAsHTML:s}=tt();let i;i=Math.random().toString(36).slice(2,6);const a=`${o}-${i}`,l=`${xa}/static/${a}`;let c,d,h,f,m,g,x,p,b,y,v;return e[0]!==s||e[1]!==n||e[2]!==a?(c=async w=>{w.preventDefault(),n();const j=await s({download:!1,includeCode:!0,files:pj.INSTANCE.filenames()}),C=Je({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${xa}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:j,path:a})}).catch(()=>{C.dismiss(),Je({title:"Error uploading static page",description:u.jsxs("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",u.jsx("a",{href:Fn.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),C.dismiss(),Je({title:"Static page uploaded!",description:u.jsxs("div",{children:["The URL has been copied to your clipboard.",u.jsx("br",{}),"You can share it with anyone."]})})},e[0]=s,e[1]=n,e[2]=a,e[3]=c):c=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(d=u.jsx(Wo,{children:"Share static notebook"}),e[4]=d):d=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(h=u.jsxs(ls,{children:[d,u.jsxs(cs,{children:["You can publish a static, non-interactive version of this notebook to the public web. We will create a link for you that lives on"," ",u.jsx("a",{href:xa,target:"_blank",children:xa}),"."]})]}),e[5]=h):h=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(f=w=>{const j=w.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,"");r(j)},e[6]=f):f=e[6],e[7]!==o?(m=u.jsx(qo,{"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?(g=u.jsxs("div",{className:"font-semibold text-sm text-muted-foreground gap-2 flex flex-col",children:["Anyone will be able to access your notebook at this URL:",u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(zj,{text:l}),u.jsx("span",{className:"text-primary",children:l})]})]}),e[9]=l,e[10]=g):g=e[10],e[11]!==m||e[12]!==g?(x=u.jsxs("div",{className:"flex flex-col gap-6 py-4",children:[m,g]}),e[11]=m,e[12]=g,e[13]=x):x=e[13],e[14]!==n?(p=u.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=u.jsx(ve,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await sn(l)},children:"Create"}),e[16]=l,e[17]=b):b=e[17],e[18]!==b||e[19]!==p?(y=u.jsxs(Ti,{children:[p,b]}),e[18]=b,e[19]=p,e[20]=y):y=e[20],e[21]!==y||e[22]!==c||e[23]!==x?(v=u.jsx(Go,{className:"w-fit",children:u.jsxs("form",{onSubmit:c,children:[h,x,y]})}),e[21]=y,e[22]=c,e[23]=x,e[24]=v):v=e[24],v},zj=t=>{const e=H.c(8),[n,o]=q.useState(!1);let r;e[0]!==t.text?(r=zn.stopPropagation(async c=>{c.preventDefault(),await sn(t.text),o(!0),setTimeout(()=>o(!1),2e3)}),e[0]=t.text,e[1]=r):r=e[1];const s=r;let i,a,l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=u.jsx(Mi,{size:14,strokeWidth:1.5}),e[2]=i):i=e[2],e[3]!==s?(a=u.jsx(ve,{"data-testid":"copy-static-notebook-url-button",onClick:s,size:"xs",variant:"secondary",children:i}),e[3]=s,e[4]=a):a=e[4],e[5]!==n||e[6]!==a?(l=u.jsx(Ne,{content:"Copied!",open:n,children:a}),e[5]=n,e[6]=a,e[7]=l):l=e[7],l};function rg(){const t=H.c(2),e=Ct(cm);let n;return t[0]!==e?(n=()=>{const o=document.getElementsByClassName("output-area"),r=window.innerHeight||document.documentElement.clientHeight;let s=null;for(const i of Array.from(o)){const a=i.getBoundingClientRect();if(a.top>=0&&a.top<=r||a.bottom>=0&&a.bottom<=r){s=Oi.parse(i.parentNode.id);break}}e(i=>({mode:UO(i.mode),cellAnchor:s})),requestAnimationFrame(()=>{var i;s!==null&&((i=document.getElementById(Oi.create(s)))==null||i.scrollIntoView())})},t[0]=e,t[1]=n):n=t[1],n}function hd(t){const e=H.c(3),n=Is();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 sg(){const t=H.c(2),e=Is();let n;return t[0]!==e?(n=()=>e(m3(bn())),t[0]=e,t[1]=n):n=t[1],Le(n)}function Is(){const t=H.c(3),{prepareForRun:e}=lt(),{sendRun:n}=tt();let o;return t[0]!==e||t[1]!==n?(o=async r=>{var l,c;if(r.length===0)return;const{cellHandles:s,cellData:i}=bn(),a=[];for(const d of r){const h=s[d],f=(l=h==null?void 0:h.current)==null?void 0:l.editorView;let m;f?(p3(f)!=="markdown"&&Xl(f),m=g3(f)):m=((c=i[d])==null?void 0:c.code)||"",a.push(m),e({cellId:d})}await n({cellIds:r,codes:a}).catch(Bj)},t[0]=e,t[1]=n,t[2]=o):o=t[2],Le(o)}function Bj(t){ut.error(t)}const fd=[{type:"files",Icon:Sp,tooltip:"View files",position:"sidebar"},{type:"variables",Icon:Jl,tooltip:"Explore variables",position:"sidebar"},{type:"datasources",Icon:Yo,tooltip:"Explore data sources",position:"sidebar"},{type:"dependencies",Icon:fa,tooltip:"Explore dependencies",position:"sidebar"},{type:"packages",Icon:Ss,tooltip:"Manage packages",position:"sidebar"},{type:"outline",Icon:cd,tooltip:"View outline",position:"sidebar"},{type:"chat",Icon:Zl,tooltip:"Chat with AI",position:"sidebar"},{type:"documentation",Icon:dd,tooltip:"View live docs",position:"sidebar"},{type:"logs",Icon:dm,tooltip:"Notebook logs",position:"sidebar"},{type:"tracing",Icon:nF,tooltip:"Tracing",position:"sidebar"},{type:"snippets",Icon:Yp,tooltip:"Snippets",position:"sidebar"},{type:"secrets",Icon:Ap,tooltip:"Secrets",hidden:tn(),position:"sidebar"},{type:"scratchpad",Icon:VO,tooltip:"Scratchpad",position:"sidebar"},{type:"errors",Icon:Di,tooltip:"View errors",position:"footer"}];function Uj(){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(i,a){const l=H.c(11);let c;l[0]!==a?(c=new HO(a),l[0]=a,l[1]=c):c=l[1];const d=c;let h;l[2]!==i||l[3]!==d?(h=()=>d.get(i),l[2]=i,l[3]=d,l[4]=h):h=l[4];const[f,m]=O.useState(h);let g;l[5]!==i||l[6]!==d?(g=b=>{m(b),d.set(i,b)},l[5]=i,l[6]=d,l[7]=g):g=l[7];const x=g;let p;return l[8]!==x||l[9]!==f?(p=[f,x],l[8]=x,l[9]=f,l[10]=p):p=l[10],p}("marimo:commands",e);let r,s;return t[1]!==n||t[2]!==o?(r=i=>{const a=(l=[i,...n],[...new Set(l)]);var l;o(a.slice(0,3))},t[1]=n,t[2]=o,t[3]=r):r=t[3],t[4]!==n||t[5]!==r?(s={recentCommands:n,addRecentCommand:r},t[4]=n,t[5]=r,t[6]=s):s=t[6],s}function ig(t){return t.dropdown!==void 0}function ba(t,e=""){return t.flatMap(n=>n.label?ig(n)?ba(n.dropdown,`${e+n.label} > `):{...n,label:e+n.label}:[])}const As=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[i,a]=s,l=`second-icon absolute ${r?"top-[-2px] left-[-2px]":"bottom-[-2px] right-[-2px]"} rounded-full`;let c,d;return e[2]!==a||e[3]!==l?(c=u.jsx("div",{className:l,children:a}),e[2]=a,e[3]=l,e[4]=c):c=e[4],e[5]!==i||e[6]!==c?(d=u.jsxs("div",{className:"multi-icon relative w-fit",children:[i,c]}),e[5]=i,e[6]=c,e[7]=d):d=e[7],d},Ts=jt(null),$j=um("marimo:ai:includeOtherCells",!0),md=um("marimo:ai:chatState:v3",{chats:[],activeChatId:null}),Vj=jt(t=>{const e=t(md);return e.chats.find(n=>n.id===e.activeChatId)},(t,e,n)=>{e(md,o=>({...o,activeChatId:n}))});function ag(t){return t!==y3&&!!(t&&t.trim().length>0)}const ya=t=>{const e=H.c(7);let n,o;e[0]!==t?(n=a=>{var l;(a.ctrlKey||a.metaKey)&&a.key==="z"&&(a.preventDefault(),a.stopPropagation(),(l=t.onClick)==null||l.call(t,a))},e[0]=t,e[1]=n):n=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(o={capture:!0},e[2]=o):o=e[2],Ql(window,"keydown",n,o);const r=t.children??"Undo";let s,i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(s=u.jsx(WO,{className:"ml-2",shortcut:"cmd-z"}),e[3]=s):s=e[3],e[4]!==r||e[5]!==t?(i=u.jsxs(ve,{"data-testid":"undo-button",size:"sm",variant:"outline",...t,children:[r," ",s]}),e[4]=r,e[5]=t,e[6]=i):i=e[6],i};function Ms(){const t=H.c(4),{deleteCell:e,undoDeleteCell:n}=lt(),{sendDeleteCell:o}=tt();let r;return t[0]!==e||t[1]!==o||t[2]!==n?(r=s=>{var c;if(Qe.get(ec))return;const{cellId:i}=s,a=Qe.get(In),l=(((c=a.cellData[i])==null?void 0:c.code)??"").trim()==="";if(e({cellId:i}),o({cellId:i}).catch(()=>{n()}),!l){const{dismiss:d}=Je({title:"Cell deleted",description:"You can bring it back by clicking undo or through the command palette.",action:u.jsx(ya,{"data-testid":"undo-delete-button",onClick:()=>{n(),h()}})}),h=d}},t[0]=e,t[1]=o,t[2]=n,t[3]=r):r=t[3],Le(r)}function Os(){const t=H.c(4),{deleteCell:e,undoDeleteCell:n}=lt(),{sendDeleteCell:o}=tt();let r;return t[0]!==e||t[1]!==o||t[2]!==n?(r=async s=>{if(Qe.get(ec))return;const{cellIds:i}=s;for(const c of i)await o({cellId:c}).then(()=>{e({cellId:c})});const{dismiss:a}=Je({title:"Cells deleted",action:u.jsx(ya,{"data-testid":"undo-delete-button",onClick:()=>{for(const c of i)n();l()}})}),l=a},t[0]=e,t[1]=o,t[2]=n,t[3]=r):r=t[3],Le(r)}function lg(){const t=H.c(3),{splitCell:e,undoSplitCell:n}=lt();let o;return t[0]!==e||t[1]!==n?(o=r=>{const s=Ri(r.cellId);if(!s)return;const i=g3(s);e(r);const{dismiss:a}=Je({title:"Cell split",action:u.jsx(ya,{"data-testid":"undo-split-button",size:"sm",variant:"outline",onClick:()=>{n({...r,snapshot:i}),l()},children:"Undo"})}),l=a},t[0]=e,t[1]=n,t[2]=o):o=t[2],Le(o)}function pd(t){const e=H.c(51),{cell:n}=t,{createNewCell:o,updateCellConfig:r,updateCellName:s,moveCell:i,sendToTop:a,sendToBottom:l,addColumnBreakpoint:c,clearCellOutput:d}=lt(),h=lg(),f=hd(n==null?void 0:n.cellId),m=!je(ec),g=Ms(),{openModal:x}=An(),p=Ct(Ts),b=je(tc),y=je(nc),v=je(ds),w=je(qO),{saveCellConfig:j}=tt();if(!n||v){let U;return e[0]===Symbol.for("react.memo_cache_sentinel")?(U=[],e[0]=U):U=e[0],U}const{cellId:C,config:N,getEditorView:S,name:E,hasOutput:T,hasConsoleOutput:I,status:M}=n;let F;e[1]!==C||e[2]!==N.disabled||e[3]!==j||e[4]!==r?(F=async()=>{const U={disabled:!N.disabled};await j({configs:{[C]:U}}),r({cellId:C,config:U})},e[1]=C,e[2]=N.disabled,e[3]=j,e[4]=r,e[5]=F):F=e[5];const D=F;let R;e[6]!==C||e[7]!==N.hide_code||e[8]!==S||e[9]!==j||e[10]!==r?(R=async()=>{const U={hide_code:!N.hide_code};await j({configs:{[C]:U}}),r({cellId:C,config:U});const $=S();$&&(U.hide_code?$.contentDOM.blur():$.focus())},e[6]=C,e[7]=N.hide_code,e[8]=S,e[9]=j,e[10]=r,e[11]=R):R=e[11];const P=R;let z,_,k,B,A;return e[12]===Symbol.for("react.memo_cache_sentinel")?(z=u.jsx(eg,{size:13,strokeWidth:1.5}),e[12]=z):z=e[12],e[13]!==C||e[14]!==E||e[15]!==x||e[16]!==s?(_=()=>{x(u.jsxs(Go,{children:[u.jsx(ls,{children:u.jsx(Wo,{children:"Rename cell"})}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(xr,{htmlFor:"cell-name",children:"Cell name"}),u.jsx(gj,{placeholder:"cell name",value:E,onKeyDown:U=>{U.key==="Enter"&&(U.preventDefault(),U.stopPropagation(),x(null))},onChange:U=>s({cellId:C,name:U})})]})]}))},e[13]=C,e[14]=E,e[15]=x,e[16]=s,e[17]=_):_=e[17],e[18]!==C||e[19]!==s?(k=U=>s({cellId:C,name:U}),e[18]=C,e[19]=s,e[20]=k):k=e[20],e[21]!==E||e[22]!==k?(B=u.jsx(gj,{placeholder:"cell name",value:E,onChange:k}),e[21]=E,e[22]=k,e[23]=B):B=e[23],e[24]!==c||e[25]!==b||e[26]!==w||e[27]!==y||e[28]!==m||e[29]!==C||e[30]!==d||e[31]!==N.disabled||e[32]!==N.hide_code||e[33]!==o||e[34]!==g||e[35]!==S||e[36]!==I||e[37]!==T||e[38]!==i||e[39]!==E||e[40]!==f||e[41]!==l||e[42]!==a||e[43]!==p||e[44]!==h||e[45]!==M||e[46]!==_||e[47]!==B||e[48]!==D||e[49]!==P?(A=[[{icon:z,label:"Name",disableClick:!0,handle:Gj,handleHeadless:_,rightElement:B},{icon:u.jsx(Sr,{size:13,strokeWidth:1.5}),label:"Run cell",hotkey:"cell.run",hidden:M==="running"||M==="queued"||M==="disabled-transitively"||N.disabled,handle:()=>f()},{icon:u.jsx(Pi,{size:13,strokeWidth:1.5}),label:"AI completion",hidden:!b,handle:()=>{p(U=>(U==null?void 0:U.cellId)===C?null:{cellId:C})},hotkey:"cell.aiCompletion"},{icon:u.jsx(ld,{size:13,strokeWidth:1.5}),label:"Split cell",hotkey:"cell.splitCell",handle:()=>h({cellId:C})},{icon:u.jsx(ap,{size:13,strokeWidth:1.5}),label:"Export output as PNG",hidden:!T,handle:()=>function(U){const $=document.getElementById(x3.create(U));$&&($.classList.add("printing-output"),b3($,"result.png").finally(()=>{$.classList.remove("printing-output")}))}(C)},{icon:u.jsx(w3,{size:13,strokeWidth:1.5}),label:"Format cell",hotkey:"cell.format",handle:()=>{const U=S();U&&v3({[C]:U})}},{icon:N.hide_code?u.jsx(hm,{size:13,strokeWidth:1.5}):u.jsx(fm,{size:13,strokeWidth:1.5}),label:N.hide_code?"Show code":"Hide code",handle:P,hotkey:"cell.hideCode"},{icon:N.disabled?u.jsx(un,{size:13,strokeWidth:1.5}):u.jsx(hn,{size:13,strokeWidth:1.5}),label:"Reactive execution",rightElement:u.jsx(mm,{"data-testid":"cell-disable-switch",checked:!N.disabled,size:"sm",onCheckedChange:D}),handle:D},{icon:u.jsx(Di,{size:13,strokeWidth:1.5}),label:"Clear output",hidden:!(T||I),handle:()=>{d({cellId:C})}}],[{icon:u.jsx(oc,{}),label:"Convert to Markdown",hotkey:"cell.viewAsMarkdown",handle:()=>{const U=S();U&&(Jn({autoInstantiate:y,createNewCell:o}),gr(U,{language:"markdown",keepCodeAsIs:!1}))}},{icon:u.jsx(Yo,{size:13,strokeWidth:1.5}),label:"Convert to SQL",handle:()=>{const U=S();U&&(Jn({autoInstantiate:y,createNewCell:o}),gr(U,{language:"sql",keepCodeAsIs:!1}))}},{icon:u.jsx(rc,{}),label:"Toggle as Python",handle:()=>{const U=S();U&&(Jn({autoInstantiate:y,createNewCell:o}),GO(U,"python",{force:!0}))}}],[{icon:u.jsxs(As,{children:[u.jsx(da,{size:13,strokeWidth:1.5}),u.jsx(sc,{size:8,strokeWidth:2})]}),label:"Create cell above",hotkey:"cell.createAbove",handle:()=>o({cellId:C,before:!0})},{icon:u.jsxs(As,{children:[u.jsx(da,{size:13,strokeWidth:1.5}),u.jsx(No,{size:8,strokeWidth:2})]}),label:"Create cell below",hotkey:"cell.createBelow",handle:()=>o({cellId:C,before:!1})},{icon:u.jsx(sc,{size:13,strokeWidth:1.5}),label:"Move cell up",hotkey:"cell.moveUp",handle:()=>i({cellId:C,before:!0})},{icon:u.jsx(No,{size:13,strokeWidth:1.5}),label:"Move cell down",hotkey:"cell.moveDown",handle:()=>i({cellId:C,before:!1})},{icon:u.jsx(k3,{size:13,strokeWidth:1.5}),label:"Move cell left",hotkey:"cell.moveLeft",handle:()=>i({cellId:C,direction:"left"}),hidden:w!=="columns"},{icon:u.jsx(Li,{size:13,strokeWidth:1.5}),label:"Move cell right",hotkey:"cell.moveRight",handle:()=>i({cellId:C,direction:"right"}),hidden:w!=="columns"},{icon:u.jsx(Zc,{size:13,strokeWidth:1.5}),label:"Send to top",hotkey:"cell.sendToTop",handle:()=>a({cellId:C,scroll:!1})},{icon:u.jsx(Jc,{size:13,strokeWidth:1.5}),label:"Send to bottom",hotkey:"cell.sendToBottom",handle:()=>l({cellId:C,scroll:!1})},{icon:u.jsx(YO,{size:13,strokeWidth:1.5}),label:"Break into new column",hotkey:"cell.addColumnBreakpoint",hidden:w!=="columns",handle:()=>c({cellId:C})}],[{icon:u.jsx(dj,{size:13,strokeWidth:1.5}),label:"Copy link to cell",disabled:!ag(E),tooltip:ag(E)?void 0:"Only named cells can be linked to",handle:async()=>{await sn(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:u.jsx(ic,{size:13,strokeWidth:1.5}),handle:()=>{g({cellId:C})}}]].map(Wj).filter(Hj),e[24]=c,e[25]=b,e[26]=w,e[27]=y,e[28]=m,e[29]=C,e[30]=d,e[31]=N.disabled,e[32]=N.hide_code,e[33]=o,e[34]=g,e[35]=S,e[36]=I,e[37]=T,e[38]=i,e[39]=E,e[40]=f,e[41]=l,e[42]=a,e[43]=p,e[44]=h,e[45]=M,e[46]=_,e[47]=B,e[48]=D,e[49]=P,e[50]=A):A=e[50],A}function Hj(t){return t.length>0}function Wj(t){return t.filter(qj)}function qj(t){return!t.hidden}function Gj(t){t==null||t.stopPropagation(),t==null||t.preventDefault()}function Yj(t){return!t.hidden}const gd=jt(!1),cg=()=>{const t=H.c(37),[e,n]=Dt(gd),o=KO(),r=je(XO),s=je(ac);let i;t[0]!==r?(i={cell:r},t[0]=r,t[1]=i):i=t[1];let a=pd(i).flat();a=ba(a);const l=function(){const _=H.c(75),[k,B]=br(),[A,U]=C3(),{saveAppConfig:$,saveUserConfig:J}=tt();let G;_[0]!==J||_[1]!==B?(G=async re=>{await J({config:re}).then(()=>{B(re)})},_[0]=J,_[1]=B,_[2]=G):G=_[2];const K=G;let W;_[3]!==$||_[4]!==U?(W=async re=>{await $({config:re}).then(()=>{U(re)})},_[3]=$,_[4]=U,_[5]=W):W=_[5];const X=W;let V;if(_[6]!==A||_[7]!==k||_[8]!==X||_[9]!==K){let re,ne,ie,se,ae;_[11]!==A?(re=He=>He!==A.width,_[11]=A,_[12]=re):re=_[12],_[13]!==A||_[14]!==X?(ne=He=>({label:`App config > Set width=${He}`,handle:()=>{X({...A,width:He})}}),_[13]=A,_[14]=X,_[15]=ne):ne=_[15],_[16]!==k||_[17]!==K?(ie={label:"Config > Set theme: dark",handle:()=>{K({...k,display:{...k.display,theme:"dark"}})}},_[16]=k,_[17]=K,_[18]=ie):ie=_[18],_[19]!==k||_[20]!==K?(se={label:"Config > Set theme: light",handle:()=>{K({...k,display:{...k.display,theme:"light"}})}},_[19]=k,_[20]=K,_[21]=se):se=_[21],_[22]!==k||_[23]!==K?(ae={label:"Config > Set theme: system",handle:()=>{K({...k,display:{...k.display,theme:"system"}})}},_[22]=k,_[23]=K,_[24]=ae):ae=_[24];const ge=k.keymap.preset==="vim";let oe,ue;_[25]!==k||_[26]!==K?(oe=()=>{K({...k,keymap:{...k.keymap,preset:"vim"}})},_[25]=k,_[26]=K,_[27]=oe):oe=_[27],_[28]!==ge||_[29]!==oe?(ue={label:"Config > Switch keymap to VIM",hidden:ge,handle:oe},_[28]=ge,_[29]=oe,_[30]=ue):ue=_[30];const de=k.keymap.preset==="default";let Se,Te,Fe;_[31]!==k||_[32]!==K?(Se=()=>{K({...k,keymap:{...k.keymap,preset:"default"}})},_[31]=k,_[32]=K,_[33]=Se):Se=_[33],_[34]!==de||_[35]!==Se?(Te={label:"Config > Switch keymap to default (current: VIM)",hidden:de,handle:Se},_[34]=de,_[35]=Se,_[36]=Te):Te=_[36],_[37]!==k||_[38]!==K?(Fe=()=>{K({...k,completion:{...k.completion,copilot:!1}})},_[37]=k,_[38]=K,_[39]=Fe):Fe=_[39];const _e=k.completion.copilot!=="github";let ke,Ye;_[40]!==Fe||_[41]!==_e?(ke={label:"Config > Disable GitHub Copilot",handle:Fe,hidden:_e},_[40]=Fe,_[41]=_e,_[42]=ke):ke=_[42],_[43]!==k||_[44]!==K?(Ye=()=>{K({...k,completion:{...k.completion,copilot:"github"}})},_[43]=k,_[44]=K,_[45]=Ye):Ye=_[45];const Ve=k.completion.copilot==="github";let Ke;_[46]!==Ye||_[47]!==Ve?(Ke={label:"Config > Enable GitHub Copilot",handle:Ye,hidden:Ve},_[46]=Ye,_[47]=Ve,_[48]=Ke):Ke=_[48];const ee=!k.display.reference_highlighting;let ye,we,Ie,Y;_[49]!==k||_[50]!==K?(ye=()=>{K({...k,display:{...k.display,reference_highlighting:!1}})},_[49]=k,_[50]=K,_[51]=ye):ye=_[51],_[52]!==ee||_[53]!==ye?(we={label:"Config > Disable reference highlighting",hidden:ee,handle:ye},_[52]=ee,_[53]=ye,_[54]=we):we=_[54],_[55]!==k||_[56]!==K?(Ie=()=>{K({...k,display:{...k.display,reference_highlighting:!0}})},_[55]=k,_[56]=K,_[57]=Ie):Ie=_[57],_[58]!==k.display.reference_highlighting||_[59]!==Ie?(Y={label:"Config > Enable reference highlighting",hidden:k.display.reference_highlighting,handle:Ie},_[58]=k.display.reference_highlighting,_[59]=Ie,_[60]=Y):Y=_[60];const me=k.display.cell_output==="above";let pe,he;_[61]!==k||_[62]!==K?(pe=()=>{K({...k,display:{...k.display,cell_output:"above"}})},_[61]=k,_[62]=K,_[63]=pe):pe=_[63],_[64]!==me||_[65]!==pe?(he={label:"Config > Set cell output area: above",hidden:me,handle:pe},_[64]=me,_[65]=pe,_[66]=he):he=_[66];const Ce=k.display.cell_output==="below";let Re,Pe;_[67]!==k||_[68]!==K?(Re=()=>{K({...k,display:{...k.display,cell_output:"below"}})},_[67]=k,_[68]=K,_[69]=Re):Re=_[69],_[70]!==Ce||_[71]!==Re?(Pe={label:"Config > Set cell output area: below",hidden:Ce,handle:Re},_[70]=Ce,_[71]=Re,_[72]=Pe):Pe=_[72],V=[...oF().filter(re).map(ne),ie,se,ae,ue,Te,ke,Ke,we,Y,he,Pe],_[6]=A,_[7]=k,_[8]=X,_[9]=K,_[10]=V}else V=_[10];const Q=V;let te;return _[73]!==Q?(te=Q.filter(Yj),_[73]=Q,_[74]=te):te=_[74],te}();let c=zg();c=[...ba(c),...ba(l)];const d=c.filter(Kj),h=lc.keyBy(d,Xj),{recentCommands:f,addRecentCommand:m}=Uj();let g;t[2]!==f?(g=new Set(f),t[2]=f,t[3]=g):g=t[3];const x=g;let p,b;t[4]!==s||t[5]!==n?(p=_=>{xm(s.getHotkey("global.commandPalette").key)(_)&&(_.preventDefault(),n(Jj))},t[4]=s,t[5]=n,t[6]=p):p=t[6],Ql(document,"keydown",p),t[7]!==m||t[8]!==s||t[9]!==o||t[10]!==n?(b=(_,k)=>{const B=o[_];if(!B)return null;const A=s.getHotkey(_);return u.jsxs(Zn,{disabled:k.disabled,onSelect:()=>{m(_),n(!1),requestAnimationFrame(()=>{B()})},value:A.name,children:[u.jsxs("span",{children:[A.name,k.tooltip&&u.jsx("span",{className:"ml-2",children:k.tooltip})]}),u.jsx(S3,{children:u.jsx(bm,{shortcut:A.key})})]},_)},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=_=>{const{label:k,handle:B,props:A,hotkey:U}=_,$=A===void 0?{}:A;return u.jsxs(Zn,{disabled:$.disabled,onSelect:()=>{m(k),n(!1),requestAnimationFrame(()=>{B()})},value:k,children:[u.jsxs("span",{children:[k,$.tooltip&&u.jsxs("span",{className:"ml-2",children:["(",$.tooltip,")"]})]}),U&&u.jsx(S3,{children:u.jsx(bm,{shortcut:s.getHotkey(U).key})})]},k)},t[12]=m,t[13]=s,t[14]=n,t[15]=v):v=t[15];const w=v,j=ZO;let C;t[16]===Symbol.for("react.memo_cache_sentinel")?(C=u.jsx(Fi,{placeholder:"Type to search..."}),t[16]=C):C=t[16];const N=gm;let S;t[17]===Symbol.for("react.memo_cache_sentinel")?(S=u.jsx(cc,{children:"No results found."}),t[17]=S):S=t[17];const E=f.length>0&&u.jsxs(u.Fragment,{children:[u.jsx(pm,{heading:"Recently Used",children:f.map(_=>{const k=h[_];return JO(_)?y(_,{disabled:k==null?void 0:k.disabled,tooltip:k==null?void 0:k.tooltip}):k&&!ig(k)?w({label:k.label,handle:k.handleHeadless||k.handle,props:{disabled:k.disabled,tooltip:k.tooltip}}):null})}),u.jsx(j3,{})]}),T=pm,I=s.iterate().map(_=>{if(x.has(_))return null;const k=h[_];return y(_,{disabled:k==null?void 0:k.disabled,tooltip:k==null?void 0:k.tooltip})}),M=d.map(_=>x.has(_.label)?null:w({label:_.label,handle:_.handleHeadless||_.handle,props:{disabled:_.disabled,tooltip:_.tooltip}}));let F;t[18]!==x||t[19]!==w?(F=_=>x.has(_.label)?null:w({label:`Cell > ${_.label}`,handle:_.handleHeadless||_.handle,props:{disabled:_.disabled,tooltip:_.tooltip}}),t[18]=x,t[19]=w,t[20]=F):F=t[20];const D=a.map(F);let R,P,z;return t[21]!==T||t[22]!==M||t[23]!==D||t[24]!==I?(R=u.jsxs(T,{heading:"Commands",children:[I,M,D]}),t[21]=T,t[22]=M,t[23]=D,t[24]=I,t[25]=R):R=t[25],t[26]!==N||t[27]!==R||t[28]!==S||t[29]!==E?(P=u.jsxs(N,{children:[S,E,R]}),t[26]=N,t[27]=R,t[28]=S,t[29]=E,t[30]=P):P=t[30],t[31]!==j||t[32]!==e||t[33]!==n||t[34]!==P||t[35]!==C?(z=u.jsxs(j,{open:e,onOpenChange:n,children:[C,P]}),t[31]=j,t[32]=e,t[33]=n,t[34]=P,t[35]=C,t[36]=z):z=t[36],z};function Kj(t){return!t.hotkey}function Xj(t){return t.label}function Jj(t){return!t}function tr(){return at().optional().describe(ze.of({label:"Password",inputType:"password",placeholder:"password",optionRegex:".*password.*"}))}function dg(){return at().optional().describe(ze.of({label:"Token",inputType:"password",placeholder:"token",optionRegex:".*token.*"}))}function va(){return at().optional().describe(ze.of({label:"Warehouse Name",placeholder:"warehouse",optionRegex:".*warehouse.*"}))}function ug(){return at().optional().describe(ze.of({label:"URI",optionRegex:".*uri.*"}))}function nr(){return at().nonempty().describe(ze.of({label:"Host",placeholder:"localhost",optionRegex:".*host.*"}))}function to(){return at().describe(ze.of({label:"Database",placeholder:"db name",optionRegex:".*database.*"}))}function or(){return at().nonempty().describe(ze.of({label:"Username",placeholder:"username",optionRegex:".*username.*"}))}function rr(t){const e=QO.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 hg(){return us().default(!1).describe(ze.of({label:"Read Only"}))}const fg=ft({type:gt("postgres"),host:nr(),port:rr(5432).optional(),database:to(),username:or(),password:tr(),ssl:us().default(!1).describe(ze.of({label:"Use SSL"}))}).describe(ze.of({direction:"two-columns"})),mg=ft({type:gt("mysql"),host:nr(),port:rr(3306),database:to(),username:or(),password:tr(),ssl:us().default(!1).describe(ze.of({label:"Use SSL"}))}).describe(ze.of({direction:"two-columns"})),pg=ft({type:gt("sqlite"),database:to().describe(ze.of({label:"Database Path"}))}).describe(ze.of({direction:"two-columns"})),gg=ft({type:gt("duckdb"),database:to().describe(ze.of({label:"Database Path"})),read_only:hg()}).describe(ze.of({direction:"two-columns"})),xg=ft({type:gt("motherduck"),database:to().default("my_db").describe(ze.of({label:"Database Name"})),token:dg()}).describe(ze.of({direction:"two-columns"})),bg=ft({type:gt("snowflake"),account:at().nonempty().describe(ze.of({label:"Account",optionRegex:".*snowflake.*"})),warehouse:at().optional().describe(ze.of({label:"Warehouse",optionRegex:".*snowflake.*"})),database:to(),schema:at().optional().describe(ze.of({label:"Schema",optionRegex:".*snowflake.*"})),username:or(),password:tr(),role:at().optional().describe(ze.of({label:"Role"}))}).describe(ze.of({direction:"two-columns"})),yg=ft({type:gt("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"})),vg=ft({type:gt("clickhouse_connect"),host:nr(),port:rr(8123).optional(),username:or(),password:tr(),secure:us().default(!1).describe(ze.of({label:"Use HTTPs"}))}).describe(ze.of({direction:"two-columns"})),wg=ft({type:gt("timeplus"),host:nr().default("localhost"),port:rr(8123).optional(),username:or().default("default"),password:tr().default("")}).describe(ze.of({direction:"two-columns"})),kg=ft({type:gt("chdb"),database:to().describe(ze.of({label:"Database Path"})),read_only:hg()}).describe(ze.of({direction:"two-columns"})),Cg=ft({type:gt("trino"),host:nr(),port:rr(8080),database:to(),schema:at().describe(ze.of({label:"Schema",placeholder:"schema name",optionRegex:".*schema.*"})).optional(),username:or(),password:tr(),async_support:us().default(!1).describe(ze.of({label:"Async Support"}))}).describe(ze.of({direction:"two-columns"})),jg=ft({type:gt("iceberg"),name:at().describe(ze.of({label:"Catalog Name"})),catalog:ym("type",[ft({type:gt("REST"),warehouse:va(),uri:at().optional().describe(ze.of({label:"URI",placeholder:"https://",optionRegex:".*uri.*"})),token:dg()}),ft({type:gt("SQL"),warehouse:va(),uri:at().optional().describe(ze.of({label:"URI",placeholder:"jdbc:iceberg://host:port/database",optionRegex:".*uri.*"}))}),ft({type:gt("Hive"),warehouse:va(),uri:ug()}),ft({type:gt("Glue"),warehouse:va(),uri:ug()}),ft({type:gt("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"}))}),Sg=ft({type:gt("datafusion"),sessionContext:us().optional().describe(ze.of({label:"Use Session Context"}))}),Ng=ft({type:gt("pyspark"),host:nr().optional(),port:rr().optional()}),Eg=ft({type:gt("redshift"),host:nr(),port:rr(5439),connectionType:ym("type",[ft({type:gt("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.*"}))}),ft({type:gt("DB credentials"),user:or(),password:tr()})]).default({type:"IAM credentials",aws_access_key_id:"",aws_secret_access_key:"",region:""}),database:to()}).describe(ze.of({direction:"two-columns"})),Zj=ym("type",[fg,mg,pg,gg,xg,bg,yg,vg,wg,kg,Cg,jg,Sg,Ng,Eg]),xd="env:";function wa(t){return typeof t=="string"&&t.startsWith(xd)}function bd(t){return`${xd}${t}`}const _g={sqlmodel:"SQLModel",sqlalchemy:"SQLAlchemy",duckdb:"DuckDB",clickhouse_connect:"ClickHouse Connect",chdb:"chDB",pyiceberg:"PyIceberg",ibis:"Ibis",motherduck:"MotherDuck",redshift:"Redshift"};class Yt{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 Qj{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),wa(n)){const r=n.replace(xd,""),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"?Er(n):n?`"${n}"`:""}printInFString(e,n,o){if(n===void 0)return"";if(typeof n=="number")return`${n}`;if(typeof n=="boolean")return Er(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 wa(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-CPx3xYyj.js","./index-Buso0H88.js","./index-CI2OUPJT.css","./compile-B75eibU9.js","./time-BeHgQetb.js","./timer-BwIYMJWC.js","./linear-BlykO2l3.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-BCorTI1K.js","./index-t5mmzKNH.js","./index-BS2OovtB.js","./index-B30u7UQa.js","./index-C72zNiee.js","./index-1c2l-RgC.js","./index-CLbaFJE2.js","./index-BAklN9yx.js","./index-BnOTGeEb.js","./index-BtXAzkDv.js","./index-Cq818vcA.js","./index-DebFjzS3.js","./index-D9LSCsXX.js","./index-DziFNxDk.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-CFPpBf0V.js","./storage-B6yZpgAI.css","./links-Byp_t4Gg.js","./index-CmZVYjqQ.js","./links-Dn1Stwqz.css","./circle-play--cLK-_ms.js","./_createAggregator-BmYrZ5eo.js","./_baseEach-Bs9eJW7C.js","./loro_wasm_bg-C3hKWL9L.js","./transform-B8bpuzxV.js","./sortBy-BpwJ4mKF.js","./_baseMap-BMXPYSvd.js","./terminal-pM14FLUA.js","./terminal-B3isKKSk.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var AO=Object.defineProperty;var l3=Mt=>{throw TypeError(Mt)};var TO=(Mt,wt,nn)=>wt in Mt?AO(Mt,wt,{enumerable:!0,configurable:!0,writable:!0,value:nn}):Mt[wt]=nn;var Z=(Mt,wt,nn)=>TO(Mt,typeof wt!="symbol"?wt+"":wt,nn),MO=(Mt,wt,nn)=>wt.has(Mt)||l3("Cannot "+nn);var c3=(Mt,wt,nn)=>(MO(Mt,wt,"read from private field"),nn?nn.call(Mt):wt.get(Mt)),d3=(Mt,wt,nn)=>wt.has(Mt)?l3("Cannot add the same private member more than once"):wt instanceof WeakSet?wt.add(Mt):wt.set(Mt,nn);import{c as Ee,iC as pr,iD as OO,iE as am,iF as DO,iG as RO,iH as u3,iI as h3,iJ as Kl,U as O,iK as PO,iL as LO,dL as f3,iM as FO,dH as zO,dK as BO,b as q,dF as lm,a as H,T as tt,ac as Je,j as u,a1 as Fn,a9 as Wo,a8 as ls,aa as cs,bn as qo,a6 as ve,ab as sn,iN as Ti,a7 as Go,aS as zn,ad as Mi,at as Ne,ao as Ct,dZ as cm,eN as Oi,iO as UO,aN as Le,S as lt,iP as $O,e$ as bn,iQ as m3,iR as p3,iS as Xl,iT as g3,L as ut,dx as Jl,aX as Yo,iU as Zl,aZ as dm,ag as tn,iV as VO,aw as Di,iW as HO,iX as x3,e_ as b3,al as jt,b4 as um,iY as y3,cA as Ql,iZ as WO,dQ as Qe,i_ as ec,dX as In,i$ as Ri,V as je,b9 as An,j0 as tc,j1 as nc,eQ as ds,j2 as qO,j3 as Pi,j4 as v3,eY as w3,j5 as hm,j6 as fm,eq as mm,j7 as Jn,j8 as gr,aV as oc,j9 as GO,ja as rc,jb as sc,au as No,ee as k3,av as Li,jc as YO,jd as ic,bp as xr,eR as br,fu as C3,bd as Dt,je as KO,jf as XO,g1 as ac,aP as lc,jg as pm,jh as JO,ji as j3,jj as gm,jk as ZO,jl as xm,jm as Zn,jn as S3,g3 as bm,jo as Fi,jp as cc,ev as ft,ex as us,jq as gt,jr as ze,js as at,jt as ym,ju as QO,jv as vm,jw as xt,jx as N3,dr as dc,dm as uc,dn as hc,dp as fc,dl as mc,fH as wm,b3 as Bn,aJ as Tn,fx as E3,fz as _3,fA as eD,fF as tD,fB as I3,jy as A3,ar as xe,ep as nD,b1 as Eo,a$ as _o,b2 as Io,a_ as At,eZ as an,jz as T3,fD as M3,jA as oD,jB as rD,fv as O3,fw as D3,jC as hs,dq as R3,jD as P3,gv as sD,jE as iD,a5 as aD,a4 as lD,jF as km,du as cD,dw as Cm,fi as pc,jG as gc,jH as xc,bs as yn,eU as zi,ff as ln,bi as L3,d_ as Bt,ek as dD,a2 as jm,jI as Bi,jJ as bc,jK as uD,jL as hD,jM as F3,a3 as fD,ae as Ui,eK as z3,jN as Gt,aW as mD,af as Sm,g6 as B3,er as yc,jO as pD,gN as Nm,bh as vc,bk as gD,jP as xD,jQ as U3,gn as bD,gk as yD,gl as vD,gm as wD,jR as Em,ds as Un,jS as kD,jT as wc,jU as fs,q as Qn,o as We,fN as $n,jV as vn,jW as ot,jX as ms,jY as Tt,g2 as Rt,jZ as _m,eu as wn,j_ as CD,j$ as Im,bf as $3,bg as V3,k0 as jD,gQ as ps,k1 as kc,bc as Cc,gR as yr,f0 as Am,k2 as SD,k3 as H3,k4 as $i,k5 as W3,k6 as Tm,k7 as q3,k8 as G3,k9 as Y3,ka as K3,f1 as Mm,kb as ND,kc as eo,kd as jc,ke as X3,dt as J3,kf as Sc,gM as Om,kg as Vi,kh as Hi,ki as Wi,kj as Nc,kk as Ko,kl as Z3,km as Ao,kn as gs,ko as Dm,kp as qi,kq as xs,kr as Rm,ks as Pm,kt as Q3,ku as Ec,kv as ED,ay as Gi,kw as Yi,kx as _D,dW as _c,ky as ID,kz as Lm,kA as AD,kB as TD,kC as Ic,e3 as MD,kD as vr,kE as Ac,fM as Mn,kF as bs,fX as To,gg as eC,cl as tC,kG as Fm,fG as nC,eJ as oC,kH as rC,kI as Ki,kJ as sC,kK as Tc,kL as zm,kM as ys,kN as Xi,kO as Ji,kP as OD,gd as Mc,kQ as Bm,kR as Oc,ej as DD,ge as RD,kS as PD,kT as LD,kU as FD,kV as zD,u as BD,kW as UD,kX as $D,kY as VD,fQ as HD,kZ as WD,k_ as iC,t as L,k$ as qD,l0 as GD,l1 as YD,l2 as KD,l3 as XD,l4 as JD,l5 as ZD,l6 as QD,l7 as eR,l8 as tR,l9 as nR,la as oR,lb as rR,lc as sR,ld as iR,le as aR,lf as lR,lg as cR,lh as dR,li as uR,lj as hR,lk as fR,ll as Zi,lm as mR,ln as pR,lo as gR,lp as xR,lq as bR,lr as yR,ls as vR,lt as wR,lu as Um,lv as Dc,lw as aC,lx as kR,ly as CR,lz as lC,lA as jR,lB as vs,lC as On,lD as SR,lE as NR,lF as ER,lG as _R,lH as IR,lI as AR,lJ as TR,lK as MR,lL as OR,lM as DR,lN as Xo,lO as RR,lP as PR,lQ as LR,lR as FR,e0 as zR,lS as BR,lT as cC,e4 as UR,lU as Rc,lV as $R,lW as VR,lX as HR,lY as WR,gW as Jo,lZ as Pc,l_ as qR,l$ as GR,m0 as dC,m1 as $m,gP as ws,m2 as YR,m3 as KR,m4 as XR,m5 as Qi,m6 as ea,eX as Vm,m7 as JR,fV as ZR,bm as QR,an as Hm,m8 as uC,m9 as eP,ma as tP,mb as Wm,mc as qm,md as nP,me as hC,mf as fC,mg as Lc,fL as oP,Y as mC,dO as rP,mh as pC,fs as vt,mi as ta,mj as ks,mk as sP,ml as iP,mm as aP,mn as lP,ck as Gm,mo as cP,am as Zo,be as gC,mp as dP,mq as uP,mr as hP,ms as Fc,mt as xC,dM as zc,bo as bC,ew as fP,mu as yC,mv as vC,mw as wC,mx as mP,my as kC,mz as CC,mA as na,mB as pP,mC as jC,mD as gP,mE as xP,mF as SC,Z as Bc,mG as bP,bq as NC,mH as yP,as as Mo,mI as vP,mJ as oa,mK as wP,mL as EC,eW as _C,fJ as Uc,mM as Ym,aU as Km,eo as $c,en as Xm,mN as kP,eT as IC,mO as CP,mP as AC,fr as jP,mQ as SP,gJ as NP,fy as EP,fC as Jm,gK as _P,bl as ra,mR as TC,mS as Zm,mT as IP,mU as AP,mV as TP,_ as kn,es as MP,mW as OP,mX as DP,mY as MC,fk as Qm,dz as OC,mZ as RP,aq as wr,m_ as PP,m$ as LP,n0 as FP,aO as zP,n1 as BP,n2 as UP,n3 as $P,W as VP,n4 as Vc,fg as HP,n5 as DC,gw as RC,fW as WP,gp as qP,n6 as GP,n7 as PC,n8 as YP,n9 as Cs,na as KP,nb as Hc,nc as XP,nd as JP,ne as ZP,z as LC,gU as QP,nf as sa,gz as FC,gA as zC,gB as BC,gu as UC,ng as eL,C as $C,nh as tL,ni as nL,nj as oL,E as kr,f6 as VC,bb as rL,b8 as sL,nk as iL,nl as aL,nm as lL,dC as HC,nn as ep,no as cL,dY as WC,np as dL,nq as tp,nr as uL,ns as hL,nt as fL,nu as qC,nv as GC,nw as YC,fe as KC,nx as mL,ny as pL,nz as XC,nA as JC,nB as Wc,nC as ZC,nD as QC,nE as ej,nF as gL,nG as xL,nH as tj,nI as bL,nJ as yL,nK as vL,nL as wL,nM as kL,nN as CL,dV as jL,nO as SL,nP as NL,nQ as EL,nR as _L,nS as IL,nT as AL,nU as TL,nV as ML,nW as OL,nX as DL,nY as RL,gi as PL,nZ as LL,n_ as FL,n$ as nj,o0 as zL,ax as BL,o1 as UL,ap as $L,eM as VL,o2 as HL,gE as np,gC as js,gF as Cr,gD as jr,gG as op,gH as rp,o3 as oj,o4 as rj,o5 as sj,o6 as Qo,gx as WL,o7 as qL,o8 as GL,o9 as YL,oa as KL,ob as XL,oc as ij,eB as JL,od as sp,oe as ZL,ah as qc,of as aj,og as lj,aj as cj,ai as QL,dU as eF,__tla as tF}from"./index-Buso0H88.js";import{b as Ss,A as nF,L as dj,g as oF,G as rF,o as uj,s as sF,k as iF,B as hj,a as aF,M as lF,Y as cF,c as cn,u as ia,C as dF,S as uF,K as hF,d as fF,i as mF,e as fj,f as pF,h as gF,j as aa,P as la,l as mj,m as xF,n as bF,p as yF,D as Ns,q as vF,r as wF,t as ip,T as kF}from"./links-Byp_t4Gg.js";import{V as pj,d as Sr,I as ap,N as gj,S as xj,e as bj,f as yj,L as vj,g as wj,F as kj,M as CF,l as Cj,h as jF,E as Gc,i as SF,j as lp,k as cp,n as NF,o as EF,p as _F,q as IF,s as AF,t as TF,v as MF,w as OF,u as DF,C as RF,R as jj,A as PF,a as LF,T as FF,x as zF,y as BF,m as UF,z as $F,B as VF,O as HF,c as WF,P as qF,__tla as GF}from"./storage-BCorTI1K.js";import{c as YF}from"./_createAggregator-BmYrZ5eo.js";import{_ as Sj,a as Nj,i as KF,w as XF,L as Ej,A as JF,C as _j,b as dp,c as Ij,__tla as ZF}from"./loro_wasm_bg-C3hKWL9L.js";import{s as Vn,i as er,T as up,a as hp}from"./transform-B8bpuzxV.js";import{g as Aj}from"./timer-BwIYMJWC.js";import{i as QF}from"./zoom-COrs4lFh.js";import{s as ca}from"./sortBy-BpwJ4mKF.js";let fp,Yc,dn,Kc,Tj,Es,ez=Promise.all([(()=>{try{return tF}catch{}})(),(()=>{try{return GF}catch{}})(),(()=>{try{return ZF}catch{}})()]).then(async()=>{var Yl,s3;var Mt=YF(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});let wt,nn,mp,Xc,_s,Nr,Jc,Zc,pp,gp,da,Qc,xp,ua,bp,ed,yp,vp,td,wp,kp,Cp,ha,jp,nd,Sp,Np,Ep,_p,Ip,Ap,od,Tp,rd,sd,Mp,Op,Dp,Rp,Pp,Lp,fa,Fp,zp,id,Bp,Up,$p,ad,Vp,Hp,Wp,ma,ld,cd,qp,Gp,Yp,Kp,Xp,Jp,Zp,Qp,eg,dd,ud,tg,ng,og,pa,un,hn;wt=Ee("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),nn=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"}]]),mp=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"}]]),Xc=Ee("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),_s=Ee("ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]),Nr=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"}]]),Jc=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"}]]),Kc=Ee("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),pp=Ee("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),gp=Ee("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),da=Ee("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),Qc=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"}]]),xp=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"}]]),ua=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"}]]),bp=Ee("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]),ed=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"}]]),yp=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"}]]),vp=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"}]]),td=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"}]]),wp=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"}]]),kp=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"}]]),Cp=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"}]]),ha=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"}]]),jp=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"}]]),nd=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"}]]),Sp=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"}]]),Np=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"}]]),Ep=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"}]]),_p=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"}]]),Ip=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"}]]),Ap=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"}]]),od=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"}]]),Tp=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"}]]),rd=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"}]]),sd=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"}]]),Mp=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"}]]),Op=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"}]]),Dp=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"}]]),Rp=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"}]]),Pp=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"}]]),Lp=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"}]]),fa=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"}]]),Fp=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"}]]),zp=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"}]]),id=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"}]]),Bp=Ee("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Up=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"}]]),$p=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"}]]),ad=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"}]]),Hp=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"}]]),Wp=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"}]]),ma=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"}]]),ld=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"}]]),cd=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"}]]),qp=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"}]]),Gp=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"}]]),Yp=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"}]]),Kp=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"}]]),Xp=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"}]]),Jp=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"}]]),Zp=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"}]]),Qp=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"}]]),eg=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"}]]),dd=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"}]]),ud=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"}]]),tg=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"}]]),ng=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"}]]),og=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"}]]),pa=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"}]]),un=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"}]]),hn=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 ga(t,e){const n=+pr(t)-+pr(e);return n<0?-1:n>0?1:n}function Mj(t,e){const n=pr(t,e==null?void 0:e.in);return+function(o,r){const s=pr(o,r==null?void 0:r.in);return s.setHours(23,59,59,999),s}(n,e)==+function(o,r){const s=pr(o,r==null?void 0:r.in),i=s.getMonth();return s.setFullYear(s.getFullYear(),i+1,0),s.setHours(23,59,59,999),s}(n,e)}function Oj(t,e,n){const[o,r,s]=am(n==null?void 0:n.in,t,t,e),i=ga(r,s),a=Math.abs(function(d,h,f){const[m,g]=am(f==null?void 0:f.in,d,h);return 12*(m.getFullYear()-g.getFullYear())+(m.getMonth()-g.getMonth())}(r,s));if(a<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-i*a);let l=ga(r,s)===-i;Mj(o)&&a===1&&ga(o,s)===1&&(l=!1);const c=i*(a-+l);return c===0?0:c}function Dj(t,e,n){const o=function(r,s){return+pr(r)-+pr(s)}(t,e)/1e3;return(r=>{const s=(0,Math.trunc)(r);return s===0?0:s})(o)}function Rj(t,e){return function(n,o,r){const s=DO(),i=(r==null?void 0:r.locale)??s.locale??RO,a=ga(n,o);if(isNaN(a))throw new RangeError("Invalid time value");const l=Object.assign({},r,{addSuffix:r==null?void 0:r.addSuffix,comparison:a}),[c,d]=am(r==null?void 0:r.in,...a>0?[o,n]:[n,o]),h=Dj(d,c),f=(u3(d)-u3(c))/1e3,m=Math.round((h-f)/60);let g;if(m<2)return m===0?i.formatDistance("lessThanXMinutes",1,l):i.formatDistance("xMinutes",m,l);if(m<45)return i.formatDistance("xMinutes",m,l);if(m<90)return i.formatDistance("aboutXHours",1,l);if(m<h3){const x=Math.round(m/60);return i.formatDistance("aboutXHours",x,l)}if(m<2520)return i.formatDistance("xDays",1,l);if(m<Kl){const x=Math.round(m/h3);return i.formatDistance("xDays",x,l)}if(m<2*Kl)return g=Math.round(m/Kl),i.formatDistance("aboutXMonths",g,l);if(g=Oj(d,c),g<12){const x=Math.round(m/Kl);return i.formatDistance("xMonths",x,l)}{const x=g%12,p=Math.trunc(g/12);return x<3?i.formatDistance("aboutXYears",p,l):x<9?i.formatDistance("overXYears",p,l):i.formatDistance("almostXYears",p+1,l)}}(t,function(n){return OO(n,Date.now())}(t),e)}const Pj=O.createContext({}),Lj=O.forwardRef(function(t,e){[t,e]=zO(t,e,Pj);let{toolbarProps:n}=function(s,i){const{"aria-label":a,"aria-labelledby":l,orientation:c="horizontal"}=s;let[d,h]=O.useState(!1);PO(()=>{var p;h(!(!i.current||!(!((p=i.current.parentElement)===null||p===void 0)&&p.closest('[role="toolbar"]'))))});const{direction:f}=LO(),m=f==="rtl"&&c==="horizontal";let g=FO(i);const x=O.useRef(null);return{toolbarProps:{...f3(s,{labelable:!0}),role:d?"group":"toolbar","aria-orientation":c,"aria-label":a,"aria-labelledby":a==null?l:void 0,onKeyDownCapture:d?void 0:p=>{if(p.currentTarget.contains(p.target)){if(c==="horizontal"&&p.key==="ArrowRight"||c==="vertical"&&p.key==="ArrowDown")m?g.focusPrevious():g.focusNext();else{if(!(c==="horizontal"&&p.key==="ArrowLeft"||c==="vertical"&&p.key==="ArrowUp"))return p.key==="Tab"?(p.stopPropagation(),x.current=document.activeElement,void(p.shiftKey?g.focusFirst():g.focusLast())):void 0;m?g.focusNext():g.focusPrevious()}p.stopPropagation(),p.preventDefault()}},onFocusCapture:d?void 0:p=>{var b,y;x.current&&!p.currentTarget.contains(p.relatedTarget)&&(!((b=i.current)===null||b===void 0)&&b.contains(p.target))&&((y=x.current)===null||y===void 0||y.focus(),x.current=null)},onBlurCapture:d?void 0:p=>{p.currentTarget.contains(p.relatedTarget)||x.current||(x.current=p.target)}}}}(t,e),o=BO({...t,values:{orientation:t.orientation||"horizontal"},defaultClassName:"react-aria-Toolbar"}),r=f3(t,{global:!0});return delete r.id,q.createElement("div",{...lm(r,o,n),ref:e,slot:t.slot||void 0,"data-orientation":t.orientation||"horizontal"},o.children)}),xa="https://static.marimo.app",Fj=t=>{const e=H.c(25),{onClose:n}=t,[o,r]=O.useState(""),{exportAsHTML:s}=tt();let i;i=Math.random().toString(36).slice(2,6);const a=`${o}-${i}`,l=`${xa}/static/${a}`;let c,d,h,f,m,g,x,p,b,y,v;return e[0]!==s||e[1]!==n||e[2]!==a?(c=async w=>{w.preventDefault(),n();const j=await s({download:!1,includeCode:!0,files:pj.INSTANCE.filenames()}),C=Je({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${xa}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:j,path:a})}).catch(()=>{C.dismiss(),Je({title:"Error uploading static page",description:u.jsxs("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",u.jsx("a",{href:Fn.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),C.dismiss(),Je({title:"Static page uploaded!",description:u.jsxs("div",{children:["The URL has been copied to your clipboard.",u.jsx("br",{}),"You can share it with anyone."]})})},e[0]=s,e[1]=n,e[2]=a,e[3]=c):c=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(d=u.jsx(Wo,{children:"Share static notebook"}),e[4]=d):d=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(h=u.jsxs(ls,{children:[d,u.jsxs(cs,{children:["You can publish a static, non-interactive version of this notebook to the public web. We will create a link for you that lives on"," ",u.jsx("a",{href:xa,target:"_blank",children:xa}),"."]})]}),e[5]=h):h=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(f=w=>{const j=w.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,"");r(j)},e[6]=f):f=e[6],e[7]!==o?(m=u.jsx(qo,{"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?(g=u.jsxs("div",{className:"font-semibold text-sm text-muted-foreground gap-2 flex flex-col",children:["Anyone will be able to access your notebook at this URL:",u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(zj,{text:l}),u.jsx("span",{className:"text-primary",children:l})]})]}),e[9]=l,e[10]=g):g=e[10],e[11]!==m||e[12]!==g?(x=u.jsxs("div",{className:"flex flex-col gap-6 py-4",children:[m,g]}),e[11]=m,e[12]=g,e[13]=x):x=e[13],e[14]!==n?(p=u.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=u.jsx(ve,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await sn(l)},children:"Create"}),e[16]=l,e[17]=b):b=e[17],e[18]!==b||e[19]!==p?(y=u.jsxs(Ti,{children:[p,b]}),e[18]=b,e[19]=p,e[20]=y):y=e[20],e[21]!==y||e[22]!==c||e[23]!==x?(v=u.jsx(Go,{className:"w-fit",children:u.jsxs("form",{onSubmit:c,children:[h,x,y]})}),e[21]=y,e[22]=c,e[23]=x,e[24]=v):v=e[24],v},zj=t=>{const e=H.c(8),[n,o]=q.useState(!1);let r;e[0]!==t.text?(r=zn.stopPropagation(async c=>{c.preventDefault(),await sn(t.text),o(!0),setTimeout(()=>o(!1),2e3)}),e[0]=t.text,e[1]=r):r=e[1];const s=r;let i,a,l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=u.jsx(Mi,{size:14,strokeWidth:1.5}),e[2]=i):i=e[2],e[3]!==s?(a=u.jsx(ve,{"data-testid":"copy-static-notebook-url-button",onClick:s,size:"xs",variant:"secondary",children:i}),e[3]=s,e[4]=a):a=e[4],e[5]!==n||e[6]!==a?(l=u.jsx(Ne,{content:"Copied!",open:n,children:a}),e[5]=n,e[6]=a,e[7]=l):l=e[7],l};function rg(){const t=H.c(2),e=Ct(cm);let n;return t[0]!==e?(n=()=>{const o=document.getElementsByClassName("output-area"),r=window.innerHeight||document.documentElement.clientHeight;let s=null;for(const i of Array.from(o)){const a=i.getBoundingClientRect();if(a.top>=0&&a.top<=r||a.bottom>=0&&a.bottom<=r){s=Oi.parse(i.parentNode.id);break}}e(i=>({mode:UO(i.mode),cellAnchor:s})),requestAnimationFrame(()=>{var i;s!==null&&((i=document.getElementById(Oi.create(s)))==null||i.scrollIntoView())})},t[0]=e,t[1]=n):n=t[1],n}function hd(t){const e=H.c(3),n=Is();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 sg(){const t=H.c(2),e=Is();let n;return t[0]!==e?(n=()=>e(m3(bn())),t[0]=e,t[1]=n):n=t[1],Le(n)}function Is(){const t=H.c(3),{prepareForRun:e}=lt(),{sendRun:n}=tt();let o;return t[0]!==e||t[1]!==n?(o=async r=>{var l,c;if(r.length===0)return;const{cellHandles:s,cellData:i}=bn(),a=[];for(const d of r){const h=s[d],f=(l=h==null?void 0:h.current)==null?void 0:l.editorView;let m;f?(p3(f)!=="markdown"&&Xl(f),m=g3(f)):m=((c=i[d])==null?void 0:c.code)||"",a.push(m),e({cellId:d})}await n({cellIds:r,codes:a}).catch(Bj)},t[0]=e,t[1]=n,t[2]=o):o=t[2],Le(o)}function Bj(t){ut.error(t)}const fd=[{type:"files",Icon:Sp,tooltip:"View files",position:"sidebar"},{type:"variables",Icon:Jl,tooltip:"Explore variables",position:"sidebar"},{type:"datasources",Icon:Yo,tooltip:"Explore data sources",position:"sidebar"},{type:"dependencies",Icon:fa,tooltip:"Explore dependencies",position:"sidebar"},{type:"packages",Icon:Ss,tooltip:"Manage packages",position:"sidebar"},{type:"outline",Icon:cd,tooltip:"View outline",position:"sidebar"},{type:"chat",Icon:Zl,tooltip:"Chat with AI",position:"sidebar"},{type:"documentation",Icon:dd,tooltip:"View live docs",position:"sidebar"},{type:"logs",Icon:dm,tooltip:"Notebook logs",position:"sidebar"},{type:"tracing",Icon:nF,tooltip:"Tracing",position:"sidebar"},{type:"snippets",Icon:Yp,tooltip:"Snippets",position:"sidebar"},{type:"secrets",Icon:Ap,tooltip:"Secrets",hidden:tn(),position:"sidebar"},{type:"scratchpad",Icon:VO,tooltip:"Scratchpad",position:"sidebar"},{type:"errors",Icon:Di,tooltip:"View errors",position:"footer"}];function Uj(){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(i,a){const l=H.c(11);let c;l[0]!==a?(c=new HO(a),l[0]=a,l[1]=c):c=l[1];const d=c;let h;l[2]!==i||l[3]!==d?(h=()=>d.get(i),l[2]=i,l[3]=d,l[4]=h):h=l[4];const[f,m]=O.useState(h);let g;l[5]!==i||l[6]!==d?(g=b=>{m(b),d.set(i,b)},l[5]=i,l[6]=d,l[7]=g):g=l[7];const x=g;let p;return l[8]!==x||l[9]!==f?(p=[f,x],l[8]=x,l[9]=f,l[10]=p):p=l[10],p}("marimo:commands",e);let r,s;return t[1]!==n||t[2]!==o?(r=i=>{const a=(l=[i,...n],[...new Set(l)]);var l;o(a.slice(0,3))},t[1]=n,t[2]=o,t[3]=r):r=t[3],t[4]!==n||t[5]!==r?(s={recentCommands:n,addRecentCommand:r},t[4]=n,t[5]=r,t[6]=s):s=t[6],s}function ig(t){return t.dropdown!==void 0}function ba(t,e=""){return t.flatMap(n=>n.label?ig(n)?ba(n.dropdown,`${e+n.label} > `):{...n,label:e+n.label}:[])}const As=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[i,a]=s,l=`second-icon absolute ${r?"top-[-2px] left-[-2px]":"bottom-[-2px] right-[-2px]"} rounded-full`;let c,d;return e[2]!==a||e[3]!==l?(c=u.jsx("div",{className:l,children:a}),e[2]=a,e[3]=l,e[4]=c):c=e[4],e[5]!==i||e[6]!==c?(d=u.jsxs("div",{className:"multi-icon relative w-fit",children:[i,c]}),e[5]=i,e[6]=c,e[7]=d):d=e[7],d},Ts=jt(null),$j=um("marimo:ai:includeOtherCells",!0),md=um("marimo:ai:chatState:v3",{chats:[],activeChatId:null}),Vj=jt(t=>{const e=t(md);return e.chats.find(n=>n.id===e.activeChatId)},(t,e,n)=>{e(md,o=>({...o,activeChatId:n}))});function ag(t){return t!==y3&&!!(t&&t.trim().length>0)}const ya=t=>{const e=H.c(7);let n,o;e[0]!==t?(n=a=>{var l;(a.ctrlKey||a.metaKey)&&a.key==="z"&&(a.preventDefault(),a.stopPropagation(),(l=t.onClick)==null||l.call(t,a))},e[0]=t,e[1]=n):n=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(o={capture:!0},e[2]=o):o=e[2],Ql(window,"keydown",n,o);const r=t.children??"Undo";let s,i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(s=u.jsx(WO,{className:"ml-2",shortcut:"cmd-z"}),e[3]=s):s=e[3],e[4]!==r||e[5]!==t?(i=u.jsxs(ve,{"data-testid":"undo-button",size:"sm",variant:"outline",...t,children:[r," ",s]}),e[4]=r,e[5]=t,e[6]=i):i=e[6],i};function Ms(){const t=H.c(4),{deleteCell:e,undoDeleteCell:n}=lt(),{sendDeleteCell:o}=tt();let r;return t[0]!==e||t[1]!==o||t[2]!==n?(r=s=>{var c;if(Qe.get(ec))return;const{cellId:i}=s,a=Qe.get(In),l=(((c=a.cellData[i])==null?void 0:c.code)??"").trim()==="";if(e({cellId:i}),o({cellId:i}).catch(()=>{n()}),!l){const{dismiss:d}=Je({title:"Cell deleted",description:"You can bring it back by clicking undo or through the command palette.",action:u.jsx(ya,{"data-testid":"undo-delete-button",onClick:()=>{n(),h()}})}),h=d}},t[0]=e,t[1]=o,t[2]=n,t[3]=r):r=t[3],Le(r)}function Os(){const t=H.c(4),{deleteCell:e,undoDeleteCell:n}=lt(),{sendDeleteCell:o}=tt();let r;return t[0]!==e||t[1]!==o||t[2]!==n?(r=async s=>{if(Qe.get(ec))return;const{cellIds:i}=s;for(const c of i)await o({cellId:c}).then(()=>{e({cellId:c})});const{dismiss:a}=Je({title:"Cells deleted",action:u.jsx(ya,{"data-testid":"undo-delete-button",onClick:()=>{for(const c of i)n();l()}})}),l=a},t[0]=e,t[1]=o,t[2]=n,t[3]=r):r=t[3],Le(r)}function lg(){const t=H.c(3),{splitCell:e,undoSplitCell:n}=lt();let o;return t[0]!==e||t[1]!==n?(o=r=>{const s=Ri(r.cellId);if(!s)return;const i=g3(s);e(r);const{dismiss:a}=Je({title:"Cell split",action:u.jsx(ya,{"data-testid":"undo-split-button",size:"sm",variant:"outline",onClick:()=>{n({...r,snapshot:i}),l()},children:"Undo"})}),l=a},t[0]=e,t[1]=n,t[2]=o):o=t[2],Le(o)}function pd(t){const e=H.c(51),{cell:n}=t,{createNewCell:o,updateCellConfig:r,updateCellName:s,moveCell:i,sendToTop:a,sendToBottom:l,addColumnBreakpoint:c,clearCellOutput:d}=lt(),h=lg(),f=hd(n==null?void 0:n.cellId),m=!je(ec),g=Ms(),{openModal:x}=An(),p=Ct(Ts),b=je(tc),y=je(nc),v=je(ds),w=je(qO),{saveCellConfig:j}=tt();if(!n||v){let U;return e[0]===Symbol.for("react.memo_cache_sentinel")?(U=[],e[0]=U):U=e[0],U}const{cellId:C,config:N,getEditorView:S,name:E,hasOutput:T,hasConsoleOutput:I,status:M}=n;let F;e[1]!==C||e[2]!==N.disabled||e[3]!==j||e[4]!==r?(F=async()=>{const U={disabled:!N.disabled};await j({configs:{[C]:U}}),r({cellId:C,config:U})},e[1]=C,e[2]=N.disabled,e[3]=j,e[4]=r,e[5]=F):F=e[5];const D=F;let R;e[6]!==C||e[7]!==N.hide_code||e[8]!==S||e[9]!==j||e[10]!==r?(R=async()=>{const U={hide_code:!N.hide_code};await j({configs:{[C]:U}}),r({cellId:C,config:U});const $=S();$&&(U.hide_code?$.contentDOM.blur():$.focus())},e[6]=C,e[7]=N.hide_code,e[8]=S,e[9]=j,e[10]=r,e[11]=R):R=e[11];const P=R;let z,_,k,B,A;return e[12]===Symbol.for("react.memo_cache_sentinel")?(z=u.jsx(eg,{size:13,strokeWidth:1.5}),e[12]=z):z=e[12],e[13]!==C||e[14]!==E||e[15]!==x||e[16]!==s?(_=()=>{x(u.jsxs(Go,{children:[u.jsx(ls,{children:u.jsx(Wo,{children:"Rename cell"})}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(xr,{htmlFor:"cell-name",children:"Cell name"}),u.jsx(gj,{placeholder:"cell name",value:E,onKeyDown:U=>{U.key==="Enter"&&(U.preventDefault(),U.stopPropagation(),x(null))},onChange:U=>s({cellId:C,name:U})})]})]}))},e[13]=C,e[14]=E,e[15]=x,e[16]=s,e[17]=_):_=e[17],e[18]!==C||e[19]!==s?(k=U=>s({cellId:C,name:U}),e[18]=C,e[19]=s,e[20]=k):k=e[20],e[21]!==E||e[22]!==k?(B=u.jsx(gj,{placeholder:"cell name",value:E,onChange:k}),e[21]=E,e[22]=k,e[23]=B):B=e[23],e[24]!==c||e[25]!==b||e[26]!==w||e[27]!==y||e[28]!==m||e[29]!==C||e[30]!==d||e[31]!==N.disabled||e[32]!==N.hide_code||e[33]!==o||e[34]!==g||e[35]!==S||e[36]!==I||e[37]!==T||e[38]!==i||e[39]!==E||e[40]!==f||e[41]!==l||e[42]!==a||e[43]!==p||e[44]!==h||e[45]!==M||e[46]!==_||e[47]!==B||e[48]!==D||e[49]!==P?(A=[[{icon:z,label:"Name",disableClick:!0,handle:Gj,handleHeadless:_,rightElement:B},{icon:u.jsx(Sr,{size:13,strokeWidth:1.5}),label:"Run cell",hotkey:"cell.run",hidden:M==="running"||M==="queued"||M==="disabled-transitively"||N.disabled,handle:()=>f()},{icon:u.jsx(Pi,{size:13,strokeWidth:1.5}),label:"AI completion",hidden:!b,handle:()=>{p(U=>(U==null?void 0:U.cellId)===C?null:{cellId:C})},hotkey:"cell.aiCompletion"},{icon:u.jsx(ld,{size:13,strokeWidth:1.5}),label:"Split cell",hotkey:"cell.splitCell",handle:()=>h({cellId:C})},{icon:u.jsx(ap,{size:13,strokeWidth:1.5}),label:"Export output as PNG",hidden:!T,handle:()=>function(U){const $=document.getElementById(x3.create(U));$&&($.classList.add("printing-output"),b3($,"result.png").finally(()=>{$.classList.remove("printing-output")}))}(C)},{icon:u.jsx(w3,{size:13,strokeWidth:1.5}),label:"Format cell",hotkey:"cell.format",handle:()=>{const U=S();U&&v3({[C]:U})}},{icon:N.hide_code?u.jsx(hm,{size:13,strokeWidth:1.5}):u.jsx(fm,{size:13,strokeWidth:1.5}),label:N.hide_code?"Show code":"Hide code",handle:P,hotkey:"cell.hideCode"},{icon:N.disabled?u.jsx(un,{size:13,strokeWidth:1.5}):u.jsx(hn,{size:13,strokeWidth:1.5}),label:"Reactive execution",rightElement:u.jsx(mm,{"data-testid":"cell-disable-switch",checked:!N.disabled,size:"sm",onCheckedChange:D}),handle:D},{icon:u.jsx(Di,{size:13,strokeWidth:1.5}),label:"Clear output",hidden:!(T||I),handle:()=>{d({cellId:C})}}],[{icon:u.jsx(oc,{}),label:"Convert to Markdown",hotkey:"cell.viewAsMarkdown",handle:()=>{const U=S();U&&(Jn({autoInstantiate:y,createNewCell:o}),gr(U,{language:"markdown",keepCodeAsIs:!1}))}},{icon:u.jsx(Yo,{size:13,strokeWidth:1.5}),label:"Convert to SQL",handle:()=>{const U=S();U&&(Jn({autoInstantiate:y,createNewCell:o}),gr(U,{language:"sql",keepCodeAsIs:!1}))}},{icon:u.jsx(rc,{}),label:"Toggle as Python",handle:()=>{const U=S();U&&(Jn({autoInstantiate:y,createNewCell:o}),GO(U,"python",{force:!0}))}}],[{icon:u.jsxs(As,{children:[u.jsx(da,{size:13,strokeWidth:1.5}),u.jsx(sc,{size:8,strokeWidth:2})]}),label:"Create cell above",hotkey:"cell.createAbove",handle:()=>o({cellId:C,before:!0})},{icon:u.jsxs(As,{children:[u.jsx(da,{size:13,strokeWidth:1.5}),u.jsx(No,{size:8,strokeWidth:2})]}),label:"Create cell below",hotkey:"cell.createBelow",handle:()=>o({cellId:C,before:!1})},{icon:u.jsx(sc,{size:13,strokeWidth:1.5}),label:"Move cell up",hotkey:"cell.moveUp",handle:()=>i({cellId:C,before:!0})},{icon:u.jsx(No,{size:13,strokeWidth:1.5}),label:"Move cell down",hotkey:"cell.moveDown",handle:()=>i({cellId:C,before:!1})},{icon:u.jsx(k3,{size:13,strokeWidth:1.5}),label:"Move cell left",hotkey:"cell.moveLeft",handle:()=>i({cellId:C,direction:"left"}),hidden:w!=="columns"},{icon:u.jsx(Li,{size:13,strokeWidth:1.5}),label:"Move cell right",hotkey:"cell.moveRight",handle:()=>i({cellId:C,direction:"right"}),hidden:w!=="columns"},{icon:u.jsx(Zc,{size:13,strokeWidth:1.5}),label:"Send to top",hotkey:"cell.sendToTop",handle:()=>a({cellId:C,scroll:!1})},{icon:u.jsx(Jc,{size:13,strokeWidth:1.5}),label:"Send to bottom",hotkey:"cell.sendToBottom",handle:()=>l({cellId:C,scroll:!1})},{icon:u.jsx(YO,{size:13,strokeWidth:1.5}),label:"Break into new column",hotkey:"cell.addColumnBreakpoint",hidden:w!=="columns",handle:()=>c({cellId:C})}],[{icon:u.jsx(dj,{size:13,strokeWidth:1.5}),label:"Copy link to cell",disabled:!ag(E),tooltip:ag(E)?void 0:"Only named cells can be linked to",handle:async()=>{await sn(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:u.jsx(ic,{size:13,strokeWidth:1.5}),handle:()=>{g({cellId:C})}}]].map(Wj).filter(Hj),e[24]=c,e[25]=b,e[26]=w,e[27]=y,e[28]=m,e[29]=C,e[30]=d,e[31]=N.disabled,e[32]=N.hide_code,e[33]=o,e[34]=g,e[35]=S,e[36]=I,e[37]=T,e[38]=i,e[39]=E,e[40]=f,e[41]=l,e[42]=a,e[43]=p,e[44]=h,e[45]=M,e[46]=_,e[47]=B,e[48]=D,e[49]=P,e[50]=A):A=e[50],A}function Hj(t){return t.length>0}function Wj(t){return t.filter(qj)}function qj(t){return!t.hidden}function Gj(t){t==null||t.stopPropagation(),t==null||t.preventDefault()}function Yj(t){return!t.hidden}const gd=jt(!1),cg=()=>{const t=H.c(37),[e,n]=Dt(gd),o=KO(),r=je(XO),s=je(ac);let i;t[0]!==r?(i={cell:r},t[0]=r,t[1]=i):i=t[1];let a=pd(i).flat();a=ba(a);const l=function(){const _=H.c(75),[k,B]=br(),[A,U]=C3(),{saveAppConfig:$,saveUserConfig:J}=tt();let G;_[0]!==J||_[1]!==B?(G=async re=>{await J({config:re}).then(()=>{B(re)})},_[0]=J,_[1]=B,_[2]=G):G=_[2];const K=G;let W;_[3]!==$||_[4]!==U?(W=async re=>{await $({config:re}).then(()=>{U(re)})},_[3]=$,_[4]=U,_[5]=W):W=_[5];const X=W;let V;if(_[6]!==A||_[7]!==k||_[8]!==X||_[9]!==K){let re,ne,ie,se,ae;_[11]!==A?(re=He=>He!==A.width,_[11]=A,_[12]=re):re=_[12],_[13]!==A||_[14]!==X?(ne=He=>({label:`App config > Set width=${He}`,handle:()=>{X({...A,width:He})}}),_[13]=A,_[14]=X,_[15]=ne):ne=_[15],_[16]!==k||_[17]!==K?(ie={label:"Config > Set theme: dark",handle:()=>{K({...k,display:{...k.display,theme:"dark"}})}},_[16]=k,_[17]=K,_[18]=ie):ie=_[18],_[19]!==k||_[20]!==K?(se={label:"Config > Set theme: light",handle:()=>{K({...k,display:{...k.display,theme:"light"}})}},_[19]=k,_[20]=K,_[21]=se):se=_[21],_[22]!==k||_[23]!==K?(ae={label:"Config > Set theme: system",handle:()=>{K({...k,display:{...k.display,theme:"system"}})}},_[22]=k,_[23]=K,_[24]=ae):ae=_[24];const ge=k.keymap.preset==="vim";let oe,ue;_[25]!==k||_[26]!==K?(oe=()=>{K({...k,keymap:{...k.keymap,preset:"vim"}})},_[25]=k,_[26]=K,_[27]=oe):oe=_[27],_[28]!==ge||_[29]!==oe?(ue={label:"Config > Switch keymap to VIM",hidden:ge,handle:oe},_[28]=ge,_[29]=oe,_[30]=ue):ue=_[30];const de=k.keymap.preset==="default";let Se,Te,Fe;_[31]!==k||_[32]!==K?(Se=()=>{K({...k,keymap:{...k.keymap,preset:"default"}})},_[31]=k,_[32]=K,_[33]=Se):Se=_[33],_[34]!==de||_[35]!==Se?(Te={label:"Config > Switch keymap to default (current: VIM)",hidden:de,handle:Se},_[34]=de,_[35]=Se,_[36]=Te):Te=_[36],_[37]!==k||_[38]!==K?(Fe=()=>{K({...k,completion:{...k.completion,copilot:!1}})},_[37]=k,_[38]=K,_[39]=Fe):Fe=_[39];const _e=k.completion.copilot!=="github";let ke,Ye;_[40]!==Fe||_[41]!==_e?(ke={label:"Config > Disable GitHub Copilot",handle:Fe,hidden:_e},_[40]=Fe,_[41]=_e,_[42]=ke):ke=_[42],_[43]!==k||_[44]!==K?(Ye=()=>{K({...k,completion:{...k.completion,copilot:"github"}})},_[43]=k,_[44]=K,_[45]=Ye):Ye=_[45];const Ve=k.completion.copilot==="github";let Ke;_[46]!==Ye||_[47]!==Ve?(Ke={label:"Config > Enable GitHub Copilot",handle:Ye,hidden:Ve},_[46]=Ye,_[47]=Ve,_[48]=Ke):Ke=_[48];const ee=!k.display.reference_highlighting;let ye,we,Ie,Y;_[49]!==k||_[50]!==K?(ye=()=>{K({...k,display:{...k.display,reference_highlighting:!1}})},_[49]=k,_[50]=K,_[51]=ye):ye=_[51],_[52]!==ee||_[53]!==ye?(we={label:"Config > Disable reference highlighting",hidden:ee,handle:ye},_[52]=ee,_[53]=ye,_[54]=we):we=_[54],_[55]!==k||_[56]!==K?(Ie=()=>{K({...k,display:{...k.display,reference_highlighting:!0}})},_[55]=k,_[56]=K,_[57]=Ie):Ie=_[57],_[58]!==k.display.reference_highlighting||_[59]!==Ie?(Y={label:"Config > Enable reference highlighting",hidden:k.display.reference_highlighting,handle:Ie},_[58]=k.display.reference_highlighting,_[59]=Ie,_[60]=Y):Y=_[60];const me=k.display.cell_output==="above";let pe,he;_[61]!==k||_[62]!==K?(pe=()=>{K({...k,display:{...k.display,cell_output:"above"}})},_[61]=k,_[62]=K,_[63]=pe):pe=_[63],_[64]!==me||_[65]!==pe?(he={label:"Config > Set cell output area: above",hidden:me,handle:pe},_[64]=me,_[65]=pe,_[66]=he):he=_[66];const Ce=k.display.cell_output==="below";let Re,Pe;_[67]!==k||_[68]!==K?(Re=()=>{K({...k,display:{...k.display,cell_output:"below"}})},_[67]=k,_[68]=K,_[69]=Re):Re=_[69],_[70]!==Ce||_[71]!==Re?(Pe={label:"Config > Set cell output area: below",hidden:Ce,handle:Re},_[70]=Ce,_[71]=Re,_[72]=Pe):Pe=_[72],V=[...oF().filter(re).map(ne),ie,se,ae,ue,Te,ke,Ke,we,Y,he,Pe],_[6]=A,_[7]=k,_[8]=X,_[9]=K,_[10]=V}else V=_[10];const Q=V;let te;return _[73]!==Q?(te=Q.filter(Yj),_[73]=Q,_[74]=te):te=_[74],te}();let c=zg();c=[...ba(c),...ba(l)];const d=c.filter(Kj),h=lc.keyBy(d,Xj),{recentCommands:f,addRecentCommand:m}=Uj();let g;t[2]!==f?(g=new Set(f),t[2]=f,t[3]=g):g=t[3];const x=g;let p,b;t[4]!==s||t[5]!==n?(p=_=>{xm(s.getHotkey("global.commandPalette").key)(_)&&(_.preventDefault(),n(Jj))},t[4]=s,t[5]=n,t[6]=p):p=t[6],Ql(document,"keydown",p),t[7]!==m||t[8]!==s||t[9]!==o||t[10]!==n?(b=(_,k)=>{const B=o[_];if(!B)return null;const A=s.getHotkey(_);return u.jsxs(Zn,{disabled:k.disabled,onSelect:()=>{m(_),n(!1),requestAnimationFrame(()=>{B()})},value:A.name,children:[u.jsxs("span",{children:[A.name,k.tooltip&&u.jsx("span",{className:"ml-2",children:k.tooltip})]}),u.jsx(S3,{children:u.jsx(bm,{shortcut:A.key})})]},_)},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=_=>{const{label:k,handle:B,props:A,hotkey:U}=_,$=A===void 0?{}:A;return u.jsxs(Zn,{disabled:$.disabled,onSelect:()=>{m(k),n(!1),requestAnimationFrame(()=>{B()})},value:k,children:[u.jsxs("span",{children:[k,$.tooltip&&u.jsxs("span",{className:"ml-2",children:["(",$.tooltip,")"]})]}),U&&u.jsx(S3,{children:u.jsx(bm,{shortcut:s.getHotkey(U).key})})]},k)},t[12]=m,t[13]=s,t[14]=n,t[15]=v):v=t[15];const w=v,j=ZO;let C;t[16]===Symbol.for("react.memo_cache_sentinel")?(C=u.jsx(Fi,{placeholder:"Type to search..."}),t[16]=C):C=t[16];const N=gm;let S;t[17]===Symbol.for("react.memo_cache_sentinel")?(S=u.jsx(cc,{children:"No results found."}),t[17]=S):S=t[17];const E=f.length>0&&u.jsxs(u.Fragment,{children:[u.jsx(pm,{heading:"Recently Used",children:f.map(_=>{const k=h[_];return JO(_)?y(_,{disabled:k==null?void 0:k.disabled,tooltip:k==null?void 0:k.tooltip}):k&&!ig(k)?w({label:k.label,handle:k.handleHeadless||k.handle,props:{disabled:k.disabled,tooltip:k.tooltip}}):null})}),u.jsx(j3,{})]}),T=pm,I=s.iterate().map(_=>{if(x.has(_))return null;const k=h[_];return y(_,{disabled:k==null?void 0:k.disabled,tooltip:k==null?void 0:k.tooltip})}),M=d.map(_=>x.has(_.label)?null:w({label:_.label,handle:_.handleHeadless||_.handle,props:{disabled:_.disabled,tooltip:_.tooltip}}));let F;t[18]!==x||t[19]!==w?(F=_=>x.has(_.label)?null:w({label:`Cell > ${_.label}`,handle:_.handleHeadless||_.handle,props:{disabled:_.disabled,tooltip:_.tooltip}}),t[18]=x,t[19]=w,t[20]=F):F=t[20];const D=a.map(F);let R,P,z;return t[21]!==T||t[22]!==M||t[23]!==D||t[24]!==I?(R=u.jsxs(T,{heading:"Commands",children:[I,M,D]}),t[21]=T,t[22]=M,t[23]=D,t[24]=I,t[25]=R):R=t[25],t[26]!==N||t[27]!==R||t[28]!==S||t[29]!==E?(P=u.jsxs(N,{children:[S,E,R]}),t[26]=N,t[27]=R,t[28]=S,t[29]=E,t[30]=P):P=t[30],t[31]!==j||t[32]!==e||t[33]!==n||t[34]!==P||t[35]!==C?(z=u.jsxs(j,{open:e,onOpenChange:n,children:[C,P]}),t[31]=j,t[32]=e,t[33]=n,t[34]=P,t[35]=C,t[36]=z):z=t[36],z};function Kj(t){return!t.hotkey}function Xj(t){return t.label}function Jj(t){return!t}function tr(){return at().optional().describe(ze.of({label:"Password",inputType:"password",placeholder:"password",optionRegex:".*password.*"}))}function dg(){return at().optional().describe(ze.of({label:"Token",inputType:"password",placeholder:"token",optionRegex:".*token.*"}))}function va(){return at().optional().describe(ze.of({label:"Warehouse Name",placeholder:"warehouse",optionRegex:".*warehouse.*"}))}function ug(){return at().optional().describe(ze.of({label:"URI",optionRegex:".*uri.*"}))}function nr(){return at().nonempty().describe(ze.of({label:"Host",placeholder:"localhost",optionRegex:".*host.*"}))}function to(){return at().describe(ze.of({label:"Database",placeholder:"db name",optionRegex:".*database.*"}))}function or(){return at().nonempty().describe(ze.of({label:"Username",placeholder:"username",optionRegex:".*username.*"}))}function rr(t){const e=QO.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 hg(){return us().default(!1).describe(ze.of({label:"Read Only"}))}const fg=ft({type:gt("postgres"),host:nr(),port:rr(5432).optional(),database:to(),username:or(),password:tr(),ssl:us().default(!1).describe(ze.of({label:"Use SSL"}))}).describe(ze.of({direction:"two-columns"})),mg=ft({type:gt("mysql"),host:nr(),port:rr(3306),database:to(),username:or(),password:tr(),ssl:us().default(!1).describe(ze.of({label:"Use SSL"}))}).describe(ze.of({direction:"two-columns"})),pg=ft({type:gt("sqlite"),database:to().describe(ze.of({label:"Database Path"}))}).describe(ze.of({direction:"two-columns"})),gg=ft({type:gt("duckdb"),database:to().describe(ze.of({label:"Database Path"})),read_only:hg()}).describe(ze.of({direction:"two-columns"})),xg=ft({type:gt("motherduck"),database:to().default("my_db").describe(ze.of({label:"Database Name"})),token:dg()}).describe(ze.of({direction:"two-columns"})),bg=ft({type:gt("snowflake"),account:at().nonempty().describe(ze.of({label:"Account",optionRegex:".*snowflake.*"})),warehouse:at().optional().describe(ze.of({label:"Warehouse",optionRegex:".*snowflake.*"})),database:to(),schema:at().optional().describe(ze.of({label:"Schema",optionRegex:".*snowflake.*"})),username:or(),password:tr(),role:at().optional().describe(ze.of({label:"Role"}))}).describe(ze.of({direction:"two-columns"})),yg=ft({type:gt("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"})),vg=ft({type:gt("clickhouse_connect"),host:nr(),port:rr(8123).optional(),username:or(),password:tr(),secure:us().default(!1).describe(ze.of({label:"Use HTTPs"}))}).describe(ze.of({direction:"two-columns"})),wg=ft({type:gt("timeplus"),host:nr().default("localhost"),port:rr(8123).optional(),username:or().default("default"),password:tr().default("")}).describe(ze.of({direction:"two-columns"})),kg=ft({type:gt("chdb"),database:to().describe(ze.of({label:"Database Path"})),read_only:hg()}).describe(ze.of({direction:"two-columns"})),Cg=ft({type:gt("trino"),host:nr(),port:rr(8080),database:to(),schema:at().describe(ze.of({label:"Schema",placeholder:"schema name",optionRegex:".*schema.*"})).optional(),username:or(),password:tr(),async_support:us().default(!1).describe(ze.of({label:"Async Support"}))}).describe(ze.of({direction:"two-columns"})),jg=ft({type:gt("iceberg"),name:at().describe(ze.of({label:"Catalog Name"})),catalog:ym("type",[ft({type:gt("REST"),warehouse:va(),uri:at().optional().describe(ze.of({label:"URI",placeholder:"https://",optionRegex:".*uri.*"})),token:dg()}),ft({type:gt("SQL"),warehouse:va(),uri:at().optional().describe(ze.of({label:"URI",placeholder:"jdbc:iceberg://host:port/database",optionRegex:".*uri.*"}))}),ft({type:gt("Hive"),warehouse:va(),uri:ug()}),ft({type:gt("Glue"),warehouse:va(),uri:ug()}),ft({type:gt("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"}))}),Sg=ft({type:gt("datafusion"),sessionContext:us().optional().describe(ze.of({label:"Use Session Context"}))}),Ng=ft({type:gt("pyspark"),host:nr().optional(),port:rr().optional()}),Eg=ft({type:gt("redshift"),host:nr(),port:rr(5439),connectionType:ym("type",[ft({type:gt("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.*"}))}),ft({type:gt("DB credentials"),user:or(),password:tr()})]).default({type:"IAM credentials",aws_access_key_id:"",aws_secret_access_key:"",region:""}),database:to()}).describe(ze.of({direction:"two-columns"})),Zj=ym("type",[fg,mg,pg,gg,xg,bg,yg,vg,wg,kg,Cg,jg,Sg,Ng,Eg]),xd="env:";function wa(t){return typeof t=="string"&&t.startsWith(xd)}function bd(t){return`${xd}${t}`}const _g={sqlmodel:"SQLModel",sqlalchemy:"SQLAlchemy",duckdb:"DuckDB",clickhouse_connect:"ClickHouse Connect",chdb:"chDB",pyiceberg:"PyIceberg",ibis:"Ibis",motherduck:"MotherDuck",redshift:"Redshift"};class Yt{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 Qj{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),wa(n)){const r=n.replace(xd,""),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"?Er(n):n?`"${n}"`:""}printInFString(e,n,o){if(n===void 0)return"";if(typeof n=="number")return`${n}`;if(typeof n=="boolean")return Er(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 wa(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 eS extends Yt{generateImports(){return[]}generateConnectionCode(){const e=this.connection.ssl?", connect_args={'sslmode': 'require'}":"",n=this.secrets.printPassword(this.connection.password,"POSTGRES_PASSWORD",!0),o=this.secrets.printInFString("username",this.connection.username),r=this.secrets.printInFString("host",this.connection.host),s=this.secrets.printInFString("port",this.connection.port),i=this.secrets.printInFString("database",this.connection.database);return xt(`
|
|
4
4
|
DATABASE_URL = f"postgresql://${o}:${n}@${r}:${s}/${i}"
|
|
5
5
|
engine = ${this.orm}.create_engine(DATABASE_URL${e})
|
|
@@ -124,7 +124,7 @@ ${m.codeAfter}
|
|
|
124
124
|
relative before:content-[''] before:absolute before:inset-y-0 before:-left-[3px]
|
|
125
125
|
before:right-[-3px] before:w-[9px] before:z-[-1]
|
|
126
126
|
hover/column:bg-[var(--slate-3)] dark:hover/column:bg-[var(--slate-5)]
|
|
127
|
-
hover/column:hover:bg-primary/60 dark:hover/column:hover:bg-primary/60`})}const e6=t=>{const e=H.c(10),{width:n}=t,{banners:o}=AF(),{removeBanner:r}=TF();if(o.length===0)return null;const s=n==="columns"&&"sticky left-12 w-full max-w-[80vw]";let i,a,l;if(e[0]!==s?(i=xe("flex flex-col gap-4 mb-5 print:hidden",s),e[0]=s,e[1]=i):i=e[1],e[2]!==o||e[3]!==r){let c;e[5]!==r?(c=d=>u.jsxs(ra,{kind:d.variant||"info",className:"flex flex-col rounded p-3",children:[u.jsxs("div",{className:"flex justify-between",children:[u.jsxs("span",{className:"font-bold text-lg flex items-center mb-2",children:[u.jsx(MC,{className:"w-5 h-5 inline-block mr-2"}),d.title]}),u.jsx(ve,{"data-testid":"remove-banner-button",variant:"text",size:"icon",onClick:()=>r(d.id),children:u.jsx(wn,{className:"w-5 h-5"})})]}),u.jsxs("div",{className:"flex justify-between items-end",children:[u.jsx("span",{children:Qm({html:d.description})}),d.action==="restart"&&u.jsx(t6,{})]})]},d.id),e[5]=r,e[6]=c):c=e[6],a=o.map(c),e[2]=o,e[3]=r,e[4]=a}else a=e[4];return e[7]!==i||e[8]!==a?(l=u.jsx("div",{className:i,children:a}),e[7]=i,e[8]=a,e[9]=l):l=e[9],l},t6=()=>{const t=H.c(3),e=Fg();let n,o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(n=u.jsx(Hp,{className:"w-3 h-3 mr-2"}),t[0]=n):n=t[0],t[1]!==e?(o=u.jsxs(ve,{"data-testid":"restart-session-button",variant:"link",size:"xs",onClick:e,children:[n,"Restart"]}),t[1]=e,t[2]=o):o=t[2],o},n6=jt(t=>{const e=t(In);for(const n of e.cellIds.inOrderIds){const o=e.cellRuntime[n];if(o.status==="idle"&&o.consoleOutputs.some(r=>r.channel==="stdin"&&r.response===void 0))return!0}return!1}),o6=()=>{const t=H.c(3),e=r6;if(!je(n6))return null;let n,o,r;if(t[0]===Symbol.for("react.memo_cache_sentinel")?(n=u.jsx("div",{className:"flex justify-between",children:u.jsx("span",{className:"font-bold text-lg flex items-center mb-1",children:"Program waiting for input"})}),t[0]=n):n=t[0],t[1]===Symbol.for("react.memo_cache_sentinel")?(o=u.jsx(nC,{className:"inline",children:"stdin"}),t[1]=o):o=t[1],t[2]===Symbol.for("react.memo_cache_sentinel")){const s=u.jsx("div",{className:"flex flex-col gap-4 mb-5 fixed top-5 left-1/2 transform -translate-x-1/2 z-200 opacity-95",children:u.jsxs(ra,{kind:"info",className:"flex flex-col rounded py-2 px-4 animate-in slide-in-from-top w-fit",children:[n,u.jsx("div",{className:"flex flex-col gap-4 justify-between items-start text-muted-foreground text-base",children:u.jsx("div",{children:u.jsxs("p",{children:["The program is still running, but blocked on"," ",o,".",u.jsx(ve,{variant:"link",className:"h-auto font-normal",onClick:e,children:"Jump to the cell"})]})})})]})});r=u.jsx(Bc,{milliseconds:2e3,children:s}),t[2]=r}else r=t[2];return r};function r6(){const t=document.querySelector("[data-stdin-blocking]");t?(t.scrollIntoView({behavior:"smooth",block:"center"}),requestAnimationFrame(()=>{t.focus()})):ut.error("No element with data-stdin-blocking found")}function s6(){const t=setTimeout(i6,100);return()=>clearTimeout(t)}function i6(){requestAnimationFrame(a6)}function a6(){const t=function(e){const n=e.match(/scrollTo=([^&]+)/),o=n==null?void 0:n[1];return o?decodeURIComponent(o.split("&")[0]):null}(window.location.hash);if(t)(function(e){var o,r;if(Fb)return;const n=document.querySelector(`[data-cell-name="${e}"]`);if(n){if(n.scrollIntoView({behavior:"smooth",block:"start"}),Fb=!0,n instanceof HTMLElement){n.focus();const{cellHandles:s}=bn(),i=n.dataset.cellId;if(!i)return void ut.error(`Missing cellId for cell with name ${e}`);const a=(r=(o=s[i])==null?void 0:o.current)==null?void 0:r.editorView;a&&a.focus()}}else ut.warn(`Cannot focus cell with name ${e} because it was not found`),Lb()})(t);else try{Lb()}catch(e){const n=e;ut.warn("Error focusing first editor",n)}}function Lb(){var o,r;const{cellIds:t,cellData:e,cellHandles:n}=bn();for(const s of t.iterateTopLevelIds){const i=n[s];if(!((o=e[s])==null?void 0:o.config.hide_code)&&((r=i==null?void 0:i.current)!=null&&r.editorView))return void i.current.editorView.focus()}}let Fb=!1;const l6=t=>{const e=H.c(8),n=je(RP),o=t.appConfig.width==="columns";let r,s,i;return e[0]!==t?(r=u.jsx(c6,{...t}),e[0]=t,e[1]=r):r=e[1],e[2]!==n||e[3]!==r?(s=u.jsx(E1,{id:"column-container",items:n,strategy:TN,children:r}),e[2]=n,e[3]=r,e[4]=s):s=e[4],e[5]!==o||e[6]!==s?(i=u.jsx(H_,{multiColumn:o,children:s}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i},c6=t=>{const e=H.c(26),{mode:n,userConfig:o,appConfig:r}=t,s=lt(),{theme:i}=Zo(),{toggleSidebarPanel:a}=Bi();OC(s6),Rt("global.focusTop",s.focusTopCell),Rt("global.focusBottom",s.focusBottomCell),Rt("global.toggleSidebar",a),Rt("global.foldCode",s.foldAll),Rt("global.unfoldCode",s.unfoldAll),Rt("global.formatAll",h6),Rt("cell.hideCode",Bn.NOOP),Rt("cell.format",Bn.NOOP);const l=wr(),c=PP(),d=l.getColumnIds(),h=s.scrollToTarget;let f,m;e[0]!==c||e[1]!==h?(f=()=>{c!==null&&h()},e[0]=c,e[1]=h,e[2]=f):f=e[2],e[3]!==l||e[4]!==c||e[5]!==h?(m=[l,c,h],e[3]=l,e[4]=c,e[5]=h,e[6]=m):m=e[6],O.useEffect(f,m);const g=MF;let x,p,b,y;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=u.jsx(I_,{}),p=u.jsx(o6,{}),b=u.jsx(G_,{}),e[7]=x,e[8]=p,e[9]=b):(x=e[7],p=e[8],b=e[9]),e[10]!==r.width?(y=u.jsx(e6,{width:r.width}),e[10]=r.width,e[11]=y):y=e[11];const v=r.width==="columns"&&"grid grid-flow-col auto-cols-min gap-6";let w;e[12]!==v?(w=xe(v),e[12]=v,e[13]=w):w=e[13];const j=d.map((E,T)=>u.jsx(d6,{columnId:E,index:T,columnsLength:d.length,appConfig:r,mode:n,userConfig:o,theme:i},E));let C,N,S;return e[14]!==w||e[15]!==j?(C=u.jsx("div",{className:w,children:j}),e[14]=w,e[15]=j,e[16]=C):C=e[16],e[17]===Symbol.for("react.memo_cache_sentinel")?(N=u.jsx(OF,{}),e[17]=N):N=e[17],e[18]!==g||e[19]!==r||e[20]!==C||e[21]!==x||e[22]!==p||e[23]!==b||e[24]!==y?(S=u.jsxs(g,{className:"pb-[40vh]",invisible:!1,appConfig:r,innerClassName:"pr-4",children:[x,p,b,y,C,N]}),e[18]=g,e[19]=r,e[20]=C,e[21]=x,e[22]=p,e[23]=b,e[24]=y,e[25]=S):S=e[25],S},d6=t=>{const e=H.c(54),{columnId:n,index:o,columnsLength:r,appConfig:s,mode:i,userConfig:a,theme:l}=t,c=wr();let d,h,f,m,g,x,p,b,y,v,w,j,C,N,S,E;if(e[0]!==s.width||e[1]!==c||e[2]!==n||e[3]!==r||e[4]!==o||e[5]!==i||e[6]!==l||e[7]!==a){const T=c.get(n);let I;Un(T,`Expected column for: ${n}`),e[22]!==c?(I=c.hasOnlyOneId(),e[22]=c,e[23]=I):I=e[23];const M=I;let F;e[24]!==c.inOrderIds?(F=c.inOrderIds.includes(oa),e[24]=c.inOrderIds,e[25]=F):F=e[25];const D=F;h=Pb,w=n,j=o,C=o>0,N=o<r-1,m=s.width,g=r>1;const R=s.width==="columns"&&"opacity-0 group-hover/column:opacity-100";let P;e[26]!==R?(P=xe(R),e[26]=R,e[27]=P):P=e[27],e[28]!==n||e[29]!==P?(x=u.jsx(u6,{columnId:n,className:P}),e[28]=n,e[29]=P,e[30]=x):x=e[30],d=E1,f=`column-${o+1}`,p=T.topLevelIds,b=MN,e[31]!==D||e[32]!==o||e[33]!==i||e[34]!==l||e[35]!==a?(y=o===0&&D&&u.jsx(Ab,{cellId:oa,theme:l,showPlaceholder:!1,canDelete:!0,mode:i,userConfig:a,isCollapsed:!1,collapseCount:0,canMoveX:!1},oa),e[31]=D,e[32]=o,e[33]=i,e[34]=l,e[35]=a,e[36]=y):y=e[36],v=T.topLevelIds.map(z=>z===oa?null:u.jsx(Ab,{cellId:z,theme:l,showPlaceholder:M,canDelete:!M,mode:i,userConfig:a,isCollapsed:T.isCollapsed(z),collapseCount:T.getCount(z),canMoveX:s.width==="columns"},z)),e[0]=s.width,e[1]=c,e[2]=n,e[3]=r,e[4]=o,e[5]=i,e[6]=l,e[7]=a,e[8]=d,e[9]=h,e[10]=f,e[11]=m,e[12]=g,e[13]=x,e[14]=p,e[15]=b,e[16]=y,e[17]=v,e[18]=w,e[19]=j,e[20]=C,e[21]=N}else d=e[8],h=e[9],f=e[10],m=e[11],g=e[12],x=e[13],p=e[14],b=e[15],y=e[16],v=e[17],w=e[18],j=e[19],C=e[20],N=e[21];return e[37]!==d||e[38]!==f||e[39]!==p||e[40]!==b||e[41]!==y||e[42]!==v?(S=u.jsxs(d,{id:f,items:p,strategy:b,children:[y,v]}),e[37]=d,e[38]=f,e[39]=p,e[40]=b,e[41]=y,e[42]=v,e[43]=S):S=e[43],e[44]!==h||e[45]!==m||e[46]!==g||e[47]!==x||e[48]!==S||e[49]!==w||e[50]!==j||e[51]!==C||e[52]!==N?(E=u.jsx(h,{columnId:w,index:j,canMoveLeft:C,canMoveRight:N,width:m,canDelete:g,footer:x,children:S}),e[44]=h,e[45]=m,e[46]=g,e[47]=x,e[48]=S,e[49]=w,e[50]=j,e[51]=C,e[52]=N,e[53]=E):E=e[53],E},u6=t=>{const e=H.c(17),{columnId:n,className:o}=t,{createNewCell:r}=lt(),[s,i]=LP(!1),a=je(tc),l=je(X3);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=xe("mb-0 rounded-none sm:px-4 md:px-5 lg:px-8 tracking-wide no-wrap whitespace-nowrap","hover:bg-accent hover:text-accent-foreground font-semibold uppercase text-xs"),e[0]=c):c=e[0];const d=c;let h;e[1]!==a||e[2]!==n||e[3]!==r||e[4]!==s||e[5]!==i.toggle||e[6]!==l?(h=()=>s?u.jsx(FP,{onClose:i.toggle}):u.jsxs(u.Fragment,{children:[u.jsxs(ve,{className:d,variant:"text",size:"sm",disabled:!l,onClick:()=>r({cellId:{type:"__end__",columnId:n},before:!1}),children:[u.jsx(Gp,{className:"mr-2 size-4 shrink-0"}),"Python"]}),u.jsxs(ve,{className:d,variant:"text",size:"sm",disabled:!l,onClick:()=>{Jn({autoInstantiate:!0,createNewCell:r}),r({cellId:{type:"__end__",columnId:n},before:!1,code:new zi().defaultCode,hideCode:!0})},children:[u.jsx(Xp,{className:"mr-2 size-4 shrink-0"}),"Markdown"]}),u.jsxs(ve,{className:d,variant:"text",size:"sm",disabled:!l,onClick:()=>{Jn({autoInstantiate:!0,createNewCell:r}),r({cellId:{type:"__end__",columnId:n},before:!1,code:new Pc().defaultCode})},children:[u.jsx(Yo,{className:"mr-2 size-4 shrink-0"}),"SQL"]}),u.jsx(Ne,{content:a?null:u.jsx("span",{children:"Enable via settings under AI Assist"}),delayDuration:100,asChild:!1,children:u.jsxs(ve,{className:d,variant:"text",size:"sm",disabled:!a||!l,onClick:i.toggle,children:[u.jsx(Pi,{className:"mr-2 size-4 shrink-0"}),"Generate with AI"]})})]}),e[1]=a,e[2]=n,e[3]=r,e[4]=s,e[5]=i.toggle,e[6]=l,e[7]=h):h=e[7];const f=h,m=!s&&"w-fit",g=s&&"opacity-100 w-full max-w-4xl shadow-lg shadow-(--blue-3)";let x,p,b;return e[8]!==o||e[9]!==m||e[10]!==g?(x=xe("shadow-sm border border-border rounded transition-all duration-200 overflow-hidden divide-x divide-border flex",m,g,o),e[8]=o,e[9]=m,e[10]=g,e[11]=x):x=e[11],e[12]!==f?(p=f(),e[12]=f,e[13]=p):p=e[13],e[14]!==x||e[15]!==p?(b=u.jsx("div",{className:"flex justify-center mt-4 pt-6 pb-32 group gap-4 w-full print:hidden",children:u.jsx("div",{className:x,children:p})}),e[14]=x,e[15]=p,e[16]=b):b=e[16],b};function h6(){Y3()}const f6=zP(t=>oC().syncCellIds(t),400),m6=(t,e)=>{Qe.get(ds)||t.isEmpty()||e.isEmpty()||$i(t.inOrderIds,e.inOrderIds)||f6({cell_ids:t.inOrderIds})},zb=t=>{const e=H.c(70),{userConfig:n,appConfig:o,hideControls:r}=t,s=r!==void 0&&r;BP(na,m6);const{setCells:i,mergeAllColumns:a,collapseAllCells:l,expandAllCells:c}=lt(),d=je(cm),h=je(UP),f=je($P),m=jm(),g=Ct(Cd),{sendComponentValues:x,sendInterrupt:p}=tt(),b=d.mode==="edit",y=d.mode==="present",v=je(VP);let w,j;e[0]!==x?(w=()=>(jj.INSTANCE.start(x),p6),e[0]=x,e[1]=w):w=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(j=[],e[2]=j):j=e[2],O.useEffect(w,j);const C=n.runtime.auto_instantiate;let N,S,E;e[3]!==i||e[4]!==g?(N=(ae,ge)=>{i(ae);const oe=ae.map(g6),ue=ae.map(x6),de=ae.map(b6);g({names:oe,codes:ue,configs:de,layout:ge})},e[3]=i,e[4]=g,e[5]=N):N=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(S=mC(),e[6]=S):S=e[6],e[7]!==N||e[8]!==n.runtime.auto_instantiate?(E={autoInstantiate:C,setCells:N,sessionId:S},e[7]=N,e[8]=n.runtime.auto_instantiate,e[9]=E):E=e[9];const{connection:T}=DF(E);let I,M;e[10]!==o.app_title||e[11]!==m?(I=()=>{document.title=o.app_title||yn.basename(m??"")||"Untitled Notebook"},M=[o.app_title,m],e[10]=o.app_title,e[11]=m,e[12]=I,e[13]=M):(I=e[12],M=e[13]),O.useEffect(I,M);const F=_c(o.width);let D,R;e[14]!==o.width||e[15]!==a||e[16]!==F?(D=()=>{F==="columns"&&o.width!=="columns"&&a()},e[14]=o.width,e[15]=a,e[16]=F,e[17]=D):D=e[17],e[18]!==o.width||e[19]!==a||e[20]!==h||e[21]!==F?(R=[o.width,F,a,h],e[18]=o.width,e[19]=a,e[20]=h,e[21]=F,e[22]=R):R=e[22],O.useEffect(D,R);const P=function(){const ae=H.c(2),ge=Is();let oe;return ae[0]!==ge?(oe=()=>ge($O(bn())),ae[0]=ge,ae[1]=oe):oe=ae[1],Le(oe)}(),z=sg(),_=rg();let k,B,A,U,$,J,G;e[23]!==P?(k=()=>{P()},e[23]=P,e[24]=k):k=e[24],Rt("global.runStale",k),e[25]!==p?(B=()=>{p()},e[25]=p,e[26]=B):B=e[26],Rt("global.interrupt",B),e[27]!==_?(A=()=>{_()},e[27]=_,e[28]=A):A=e[28],Rt("global.hideCode",A),e[29]!==z?(U=()=>{z()},e[29]=z,e[30]=U):U=e[30],Rt("global.runAll",U),e[31]!==l?($=()=>{l()},e[31]=l,e[32]=$):$=e[32],Rt("global.collapseAllSections",$),e[33]!==c?(J=()=>{c()},e[33]=c,e[34]=J):J=e[34],Rt("global.expandAllSections",J),e[35]!==o||e[36]!==n||e[37]!==d.mode?(G=u.jsx(l6,{mode:d.mode,userConfig:n,appConfig:o}),e[35]=o,e[36]=n,e[37]=d.mode,e[38]=G):G=e[38];const K=G,W=o.width;let X,V,Q,te,re,ne,ie,se;return e[39]===Symbol.for("react.memo_cache_sentinel")?(X=xe("pt-4 sm:pt-12 pb-2 mb-4 print:hidden z-50","sticky left-0"),e[39]=X):X=e[39],e[40]!==m||e[41]!==b?(V=b&&u.jsx("div",{className:"flex items-center justify-center container",children:u.jsx(D4,{filename:m})}),e[40]=m,e[41]=b,e[42]=V):V=e[42],e[43]!==T||e[44]!==V?(Q=u.jsx(PF,{connection:T,className:X,children:V}),e[43]=T,e[44]=V,e[45]=Q):Q=e[45],e[46]!==o||e[47]!==K||e[48]!==f||e[49]!==d.mode?(te=f&&u.jsx(RF,{appConfig:o,mode:d.mode,children:K}),e[46]=o,e[47]=K,e[48]=f,e[49]=d.mode,e[50]=te):te=e[50],e[51]!==o.width||e[52]!==T||e[53]!==v||e[54]!==Q||e[55]!==te?(re=u.jsxs(LF,{connection:T,isRunning:v,width:W,children:[Q,te]}),e[51]=o.width,e[52]=T,e[53]=v,e[54]=Q,e[55]=te,e[56]=re):re=e[56],e[57]===Symbol.for("react.memo_cache_sentinel")?(ne=u.jsx(W4,{}),e[57]=ne):ne=e[57],e[58]!==o||e[59]!==T||e[60]!==s||e[61]!==y||e[62]!==v||e[63]!==P||e[64]!==p||e[65]!==_?(ie=!s&&u.jsx(Vc,{children:u.jsx(I4,{presenting:y,onTogglePresenting:_,onInterrupt:p,onRun:P,connectionState:T.state,running:v,appConfig:o})}),e[58]=o,e[59]=T,e[60]=s,e[61]=y,e[62]=v,e[63]=P,e[64]=p,e[65]=_,e[66]=ie):ie=e[66],e[67]!==re||e[68]!==ie?(se=u.jsxs(u.Fragment,{children:[re,ne,ie]}),e[67]=re,e[68]=ie,e[69]=se):se=e[69],se};function p6(){jj.INSTANCE.stop()}function g6(t){return t.name}function x6(t){return t.code}function b6(t){return t.config}const Bb=t=>je(HP)[t.capability]?t.children:null,mn=O.forwardRef((t,e)=>{const n=H.c(18);let o,r,s,i,a;n[0]!==t?({children:o,tooltip:a,selected:i,className:r,...s}=t,n[0]=t,n[1]=o,n[2]=r,n[3]=s,n[4]=i,n[5]=a):(o=n[1],r=n[2],s=n[3],i=n[4],a=n[5]);const l=!i&&"hover:bg-(--sage-3)",c=i&&"bg-(--sage-4)";let d,h;n[6]!==r||n[7]!==l||n[8]!==c?(d=xe("h-full flex items-center p-2 text-sm shadow-inset font-mono cursor-pointer rounded",l,c,r),n[6]=r,n[7]=l,n[8]=c,n[9]=d):d=n[9],n[10]!==o||n[11]!==e||n[12]!==s||n[13]!==d?(h=u.jsx("div",{ref:e,className:d,...s,children:o}),n[10]=o,n[11]=e,n[12]=s,n[13]=d,n[14]=h):h=n[14];const f=h;if(a){let m;return n[15]!==f||n[16]!==a?(m=u.jsx(Ne,{content:a,side:"top",delayDuration:200,children:f}),n[15]=f,n[16]=a,n[17]=m):m=n[17],m}return f});mn.displayName="FooterItem";const y6=()=>{var m,g;const t=H.c(17),e=je(DC),n=je(tc),o=((m=e==null?void 0:e.models)==null?void 0:m.chat_model)||RC,r=((g=e==null?void 0:e.models)==null?void 0:g.edit_model)||o,{handleClick:s}=aa();if(!n){let x,p,b;return t[0]!==s?(x=()=>s("ai"),t[0]=s,t[1]=x):x=t[1],t[2]===Symbol.for("react.memo_cache_sentinel")?(p=u.jsx(Pi,{className:"h-4 w-4 opacity-60"}),t[2]=p):p=t[2],t[3]!==x?(b=u.jsx(mn,{tooltip:"Assist is disabled",selected:!1,onClick:x,"data-testid":"footer-ai-disabled",children:p}),t[3]=x,t[4]=b):b=t[4],b}let i,a,l,c,d,h,f;return t[5]===Symbol.for("react.memo_cache_sentinel")?(i=u.jsx("b",{children:"Chat model:"}),t[5]=i):i=t[5],t[6]===Symbol.for("react.memo_cache_sentinel")?(a=u.jsx("br",{}),l=u.jsx("b",{children:"Edit model:"}),t[6]=a,t[7]=l):(a=t[6],l=t[7]),t[8]!==o||t[9]!==r?(c=u.jsxs(u.Fragment,{children:[i," ",o,a,l," ",r]}),t[8]=o,t[9]=r,t[10]=c):c=t[10],t[11]!==s?(d=()=>s("ai"),t[11]=s,t[12]=d):d=t[12],t[13]===Symbol.for("react.memo_cache_sentinel")?(h=u.jsx(Pi,{className:"h-4 w-4"}),t[13]=h):h=t[13],t[14]!==c||t[15]!==d?(f=u.jsx(mn,{tooltip:c,onClick:d,selected:!1,"data-testid":"footer-ai-enabled",children:h}),t[14]=c,t[15]=d,t[16]=f):f=t[16],f},v6=()=>{const t=H.c(26),e=je(ln).state,n=Gm();let o,r;t[0]!==e||t[1]!==n?(o=async()=>{if(e===Bt.OPEN){if(tn())return{isHealthy:!0,lastChecked:new Date,error:void 0};try{return{isHealthy:await n.isHealthy(),lastChecked:new Date,error:void 0}}catch(w){const j=w;return{isHealthy:!1,lastChecked:new Date,error:j instanceof Error?j.message:"Unknown error"}}}},r=[n,e],t[0]=e,t[1]=n,t[2]=o,t[3]=r):(o=t[2],r=t[3]);const{isFetching:s,error:i,data:a,refetch:l}=Tn(o,r),c=e===Bt.OPEN?3e4:null;let d,h;t[4]!==c?(d={delayMs:c,whenVisible:!0},t[4]=c,t[5]=d):d=t[5],ia(l,d),t[6]!==e||t[7]!==a||t[8]!==i?(h=()=>[Cm(e.toLowerCase()),a!=null&&a.lastChecked?a.isHealthy?"\u2713 Healthy":"\u2717 Unhealthy":"Health: Unknown",i?`Error: ${i}`:""].filter(Boolean).join(`
|
|
127
|
+
hover/column:hover:bg-primary/60 dark:hover/column:hover:bg-primary/60`})}const e6=t=>{const e=H.c(10),{width:n}=t,{banners:o}=AF(),{removeBanner:r}=TF();if(o.length===0)return null;const s=n==="columns"&&"sticky left-12 w-full max-w-[80vw]";let i,a,l;if(e[0]!==s?(i=xe("flex flex-col gap-4 mb-5 print:hidden",s),e[0]=s,e[1]=i):i=e[1],e[2]!==o||e[3]!==r){let c;e[5]!==r?(c=d=>u.jsxs(ra,{kind:d.variant||"info",className:"flex flex-col rounded p-3",children:[u.jsxs("div",{className:"flex justify-between",children:[u.jsxs("span",{className:"font-bold text-lg flex items-center mb-2",children:[u.jsx(MC,{className:"w-5 h-5 inline-block mr-2"}),d.title]}),u.jsx(ve,{"data-testid":"remove-banner-button",variant:"text",size:"icon",onClick:()=>r(d.id),children:u.jsx(wn,{className:"w-5 h-5"})})]}),u.jsxs("div",{className:"flex justify-between items-end",children:[u.jsx("span",{children:Qm({html:d.description})}),d.action==="restart"&&u.jsx(t6,{})]})]},d.id),e[5]=r,e[6]=c):c=e[6],a=o.map(c),e[2]=o,e[3]=r,e[4]=a}else a=e[4];return e[7]!==i||e[8]!==a?(l=u.jsx("div",{className:i,children:a}),e[7]=i,e[8]=a,e[9]=l):l=e[9],l},t6=()=>{const t=H.c(3),e=Fg();let n,o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(n=u.jsx(Hp,{className:"w-3 h-3 mr-2"}),t[0]=n):n=t[0],t[1]!==e?(o=u.jsxs(ve,{"data-testid":"restart-session-button",variant:"link",size:"xs",onClick:e,children:[n,"Restart"]}),t[1]=e,t[2]=o):o=t[2],o},n6=jt(t=>{const e=t(In);for(const n of e.cellIds.inOrderIds){const o=e.cellRuntime[n];if(o.status==="idle"&&o.consoleOutputs.some(r=>r.channel==="stdin"&&r.response===void 0))return!0}return!1}),o6=()=>{const t=H.c(3),e=r6;if(!je(n6))return null;let n,o,r;if(t[0]===Symbol.for("react.memo_cache_sentinel")?(n=u.jsx("div",{className:"flex justify-between",children:u.jsx("span",{className:"font-bold text-lg flex items-center mb-1",children:"Program waiting for input"})}),t[0]=n):n=t[0],t[1]===Symbol.for("react.memo_cache_sentinel")?(o=u.jsx(nC,{className:"inline",children:"stdin"}),t[1]=o):o=t[1],t[2]===Symbol.for("react.memo_cache_sentinel")){const s=u.jsx("div",{className:"flex flex-col gap-4 mb-5 fixed top-5 left-1/2 transform -translate-x-1/2 z-200 opacity-95",children:u.jsxs(ra,{kind:"info",className:"flex flex-col rounded py-2 px-4 animate-in slide-in-from-top w-fit",children:[n,u.jsx("div",{className:"flex flex-col gap-4 justify-between items-start text-muted-foreground text-base",children:u.jsx("div",{children:u.jsxs("p",{children:["The program is still running, but blocked on"," ",o,".",u.jsx(ve,{variant:"link",className:"h-auto font-normal",onClick:e,children:"Jump to the cell"})]})})})]})});r=u.jsx(Bc,{milliseconds:2e3,children:s}),t[2]=r}else r=t[2];return r};function r6(){const t=document.querySelector("[data-stdin-blocking]");t?(t.scrollIntoView({behavior:"smooth",block:"center"}),requestAnimationFrame(()=>{t.focus()})):ut.error("No element with data-stdin-blocking found")}function s6(){const t=setTimeout(i6,100);return()=>clearTimeout(t)}function i6(){requestAnimationFrame(a6)}function a6(){const t=function(e){const n=e.match(/scrollTo=([^&]+)/),o=n==null?void 0:n[1];return o?decodeURIComponent(o.split("&")[0]):null}(window.location.hash);if(t)(function(e){var o,r;if(Fb)return;const n=document.querySelector(`[data-cell-name="${e}"]`);if(n){if(n.scrollIntoView({behavior:"smooth",block:"start"}),Fb=!0,n instanceof HTMLElement){n.focus();const{cellHandles:s}=bn(),i=n.dataset.cellId;if(!i)return void ut.error(`Missing cellId for cell with name ${e}`);const a=(r=(o=s[i])==null?void 0:o.current)==null?void 0:r.editorView;a&&a.focus()}}else ut.warn(`Cannot focus cell with name ${e} because it was not found`),Lb()})(t);else try{Lb()}catch(e){const n=e;ut.warn("Error focusing first editor",n)}}function Lb(){var o,r;const{cellIds:t,cellData:e,cellHandles:n}=bn();for(const s of t.iterateTopLevelIds){const i=n[s];if(!((o=e[s])==null?void 0:o.config.hide_code)&&((r=i==null?void 0:i.current)!=null&&r.editorView))return void i.current.editorView.focus()}}let Fb=!1;const l6=t=>{const e=H.c(8),n=je(RP),o=t.appConfig.width==="columns";let r,s,i;return e[0]!==t?(r=u.jsx(c6,{...t}),e[0]=t,e[1]=r):r=e[1],e[2]!==n||e[3]!==r?(s=u.jsx(E1,{id:"column-container",items:n,strategy:TN,children:r}),e[2]=n,e[3]=r,e[4]=s):s=e[4],e[5]!==o||e[6]!==s?(i=u.jsx(H_,{multiColumn:o,children:s}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i},c6=t=>{const e=H.c(26),{mode:n,userConfig:o,appConfig:r}=t,s=lt(),{theme:i}=Zo(),{toggleSidebarPanel:a}=Bi();OC(s6),Rt("global.focusTop",s.focusTopCell),Rt("global.focusBottom",s.focusBottomCell),Rt("global.toggleSidebar",a),Rt("global.foldCode",s.foldAll),Rt("global.unfoldCode",s.unfoldAll),Rt("global.formatAll",h6),Rt("cell.hideCode",Bn.NOOP),Rt("cell.format",Bn.NOOP);const l=wr(),c=PP(),d=l.getColumnIds(),h=s.scrollToTarget;let f,m;e[0]!==c||e[1]!==h?(f=()=>{c!==null&&h()},e[0]=c,e[1]=h,e[2]=f):f=e[2],e[3]!==l||e[4]!==c||e[5]!==h?(m=[l,c,h],e[3]=l,e[4]=c,e[5]=h,e[6]=m):m=e[6],O.useEffect(f,m);const g=MF;let x,p,b,y;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=u.jsx(I_,{}),p=u.jsx(o6,{}),b=u.jsx(G_,{}),e[7]=x,e[8]=p,e[9]=b):(x=e[7],p=e[8],b=e[9]),e[10]!==r.width?(y=u.jsx(e6,{width:r.width}),e[10]=r.width,e[11]=y):y=e[11];const v=r.width==="columns"&&"grid grid-flow-col auto-cols-min gap-6";let w;e[12]!==v?(w=xe(v),e[12]=v,e[13]=w):w=e[13];const j=d.map((E,T)=>u.jsx(d6,{columnId:E,index:T,columnsLength:d.length,appConfig:r,mode:n,userConfig:o,theme:i},E));let C,N,S;return e[14]!==w||e[15]!==j?(C=u.jsx("div",{className:w,children:j}),e[14]=w,e[15]=j,e[16]=C):C=e[16],e[17]===Symbol.for("react.memo_cache_sentinel")?(N=u.jsx(OF,{}),e[17]=N):N=e[17],e[18]!==g||e[19]!==r||e[20]!==C||e[21]!==x||e[22]!==p||e[23]!==b||e[24]!==y?(S=u.jsxs(g,{className:"pb-[40vh]",invisible:!1,appConfig:r,innerClassName:"pr-4",children:[x,p,b,y,C,N]}),e[18]=g,e[19]=r,e[20]=C,e[21]=x,e[22]=p,e[23]=b,e[24]=y,e[25]=S):S=e[25],S},d6=t=>{const e=H.c(54),{columnId:n,index:o,columnsLength:r,appConfig:s,mode:i,userConfig:a,theme:l}=t,c=wr();let d,h,f,m,g,x,p,b,y,v,w,j,C,N,S,E;if(e[0]!==s.width||e[1]!==c||e[2]!==n||e[3]!==r||e[4]!==o||e[5]!==i||e[6]!==l||e[7]!==a){const T=c.get(n);let I;Un(T,`Expected column for: ${n}`),e[22]!==c?(I=c.hasOnlyOneId(),e[22]=c,e[23]=I):I=e[23];const M=I;let F;e[24]!==c.inOrderIds?(F=c.inOrderIds.includes(oa),e[24]=c.inOrderIds,e[25]=F):F=e[25];const D=F;h=Pb,w=n,j=o,C=o>0,N=o<r-1,m=s.width,g=r>1;const R=s.width==="columns"&&"opacity-0 group-hover/column:opacity-100";let P;e[26]!==R?(P=xe(R),e[26]=R,e[27]=P):P=e[27],e[28]!==n||e[29]!==P?(x=u.jsx(u6,{columnId:n,className:P}),e[28]=n,e[29]=P,e[30]=x):x=e[30],d=E1,f=`column-${o+1}`,p=T.topLevelIds,b=MN,e[31]!==D||e[32]!==o||e[33]!==i||e[34]!==l||e[35]!==a?(y=o===0&&D&&u.jsx(Ab,{cellId:oa,theme:l,showPlaceholder:!1,canDelete:!0,mode:i,userConfig:a,isCollapsed:!1,collapseCount:0,canMoveX:!1},oa),e[31]=D,e[32]=o,e[33]=i,e[34]=l,e[35]=a,e[36]=y):y=e[36],v=T.topLevelIds.map(z=>z===oa?null:u.jsx(Ab,{cellId:z,theme:l,showPlaceholder:M,canDelete:!M,mode:i,userConfig:a,isCollapsed:T.isCollapsed(z),collapseCount:T.getCount(z),canMoveX:s.width==="columns"},z)),e[0]=s.width,e[1]=c,e[2]=n,e[3]=r,e[4]=o,e[5]=i,e[6]=l,e[7]=a,e[8]=d,e[9]=h,e[10]=f,e[11]=m,e[12]=g,e[13]=x,e[14]=p,e[15]=b,e[16]=y,e[17]=v,e[18]=w,e[19]=j,e[20]=C,e[21]=N}else d=e[8],h=e[9],f=e[10],m=e[11],g=e[12],x=e[13],p=e[14],b=e[15],y=e[16],v=e[17],w=e[18],j=e[19],C=e[20],N=e[21];return e[37]!==d||e[38]!==f||e[39]!==p||e[40]!==b||e[41]!==y||e[42]!==v?(S=u.jsxs(d,{id:f,items:p,strategy:b,children:[y,v]}),e[37]=d,e[38]=f,e[39]=p,e[40]=b,e[41]=y,e[42]=v,e[43]=S):S=e[43],e[44]!==h||e[45]!==m||e[46]!==g||e[47]!==x||e[48]!==S||e[49]!==w||e[50]!==j||e[51]!==C||e[52]!==N?(E=u.jsx(h,{columnId:w,index:j,canMoveLeft:C,canMoveRight:N,width:m,canDelete:g,footer:x,children:S}),e[44]=h,e[45]=m,e[46]=g,e[47]=x,e[48]=S,e[49]=w,e[50]=j,e[51]=C,e[52]=N,e[53]=E):E=e[53],E},u6=t=>{const e=H.c(17),{columnId:n,className:o}=t,{createNewCell:r}=lt(),[s,i]=LP(!1),a=je(tc),l=je(X3);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=xe("mb-0 rounded-none sm:px-4 md:px-5 lg:px-8 tracking-wide no-wrap whitespace-nowrap","hover:bg-accent hover:text-accent-foreground font-semibold uppercase text-xs"),e[0]=c):c=e[0];const d=c;let h;e[1]!==a||e[2]!==n||e[3]!==r||e[4]!==s||e[5]!==i.toggle||e[6]!==l?(h=()=>s?u.jsx(FP,{onClose:i.toggle}):u.jsxs(u.Fragment,{children:[u.jsxs(ve,{className:d,variant:"text",size:"sm",disabled:!l,onClick:()=>r({cellId:{type:"__end__",columnId:n},before:!1}),children:[u.jsx(Gp,{className:"mr-2 size-4 shrink-0"}),"Python"]}),u.jsxs(ve,{className:d,variant:"text",size:"sm",disabled:!l,onClick:()=>{Jn({autoInstantiate:!0,createNewCell:r}),r({cellId:{type:"__end__",columnId:n},before:!1,code:new zi().defaultCode,hideCode:!0})},children:[u.jsx(Xp,{className:"mr-2 size-4 shrink-0"}),"Markdown"]}),u.jsxs(ve,{className:d,variant:"text",size:"sm",disabled:!l,onClick:()=>{Jn({autoInstantiate:!0,createNewCell:r}),r({cellId:{type:"__end__",columnId:n},before:!1,code:new Pc().defaultCode})},children:[u.jsx(Yo,{className:"mr-2 size-4 shrink-0"}),"SQL"]}),u.jsx(Ne,{content:a?null:u.jsx("span",{children:"Enable via settings under AI Assist"}),delayDuration:100,asChild:!1,children:u.jsxs(ve,{className:d,variant:"text",size:"sm",disabled:!a||!l,onClick:i.toggle,children:[u.jsx(Pi,{className:"mr-2 size-4 shrink-0"}),"Generate with AI"]})})]}),e[1]=a,e[2]=n,e[3]=r,e[4]=s,e[5]=i.toggle,e[6]=l,e[7]=h):h=e[7];const f=h,m=!s&&"w-fit",g=s&&"opacity-100 w-full max-w-4xl shadow-lg shadow-(color:--blue-3)";let x,p,b;return e[8]!==o||e[9]!==m||e[10]!==g?(x=xe("shadow-sm border border-border rounded transition-all duration-200 overflow-hidden divide-x divide-border flex",m,g,o),e[8]=o,e[9]=m,e[10]=g,e[11]=x):x=e[11],e[12]!==f?(p=f(),e[12]=f,e[13]=p):p=e[13],e[14]!==x||e[15]!==p?(b=u.jsx("div",{className:"flex justify-center mt-4 pt-6 pb-32 group gap-4 w-full print:hidden",children:u.jsx("div",{className:x,children:p})}),e[14]=x,e[15]=p,e[16]=b):b=e[16],b};function h6(){Y3()}const f6=zP(t=>oC().syncCellIds(t),400),m6=(t,e)=>{Qe.get(ds)||t.isEmpty()||e.isEmpty()||$i(t.inOrderIds,e.inOrderIds)||f6({cell_ids:t.inOrderIds})},zb=t=>{const e=H.c(70),{userConfig:n,appConfig:o,hideControls:r}=t,s=r!==void 0&&r;BP(na,m6);const{setCells:i,mergeAllColumns:a,collapseAllCells:l,expandAllCells:c}=lt(),d=je(cm),h=je(UP),f=je($P),m=jm(),g=Ct(Cd),{sendComponentValues:x,sendInterrupt:p}=tt(),b=d.mode==="edit",y=d.mode==="present",v=je(VP);let w,j;e[0]!==x?(w=()=>(jj.INSTANCE.start(x),p6),e[0]=x,e[1]=w):w=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(j=[],e[2]=j):j=e[2],O.useEffect(w,j);const C=n.runtime.auto_instantiate;let N,S,E;e[3]!==i||e[4]!==g?(N=(ae,ge)=>{i(ae);const oe=ae.map(g6),ue=ae.map(x6),de=ae.map(b6);g({names:oe,codes:ue,configs:de,layout:ge})},e[3]=i,e[4]=g,e[5]=N):N=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(S=mC(),e[6]=S):S=e[6],e[7]!==N||e[8]!==n.runtime.auto_instantiate?(E={autoInstantiate:C,setCells:N,sessionId:S},e[7]=N,e[8]=n.runtime.auto_instantiate,e[9]=E):E=e[9];const{connection:T}=DF(E);let I,M;e[10]!==o.app_title||e[11]!==m?(I=()=>{document.title=o.app_title||yn.basename(m??"")||"Untitled Notebook"},M=[o.app_title,m],e[10]=o.app_title,e[11]=m,e[12]=I,e[13]=M):(I=e[12],M=e[13]),O.useEffect(I,M);const F=_c(o.width);let D,R;e[14]!==o.width||e[15]!==a||e[16]!==F?(D=()=>{F==="columns"&&o.width!=="columns"&&a()},e[14]=o.width,e[15]=a,e[16]=F,e[17]=D):D=e[17],e[18]!==o.width||e[19]!==a||e[20]!==h||e[21]!==F?(R=[o.width,F,a,h],e[18]=o.width,e[19]=a,e[20]=h,e[21]=F,e[22]=R):R=e[22],O.useEffect(D,R);const P=function(){const ae=H.c(2),ge=Is();let oe;return ae[0]!==ge?(oe=()=>ge($O(bn())),ae[0]=ge,ae[1]=oe):oe=ae[1],Le(oe)}(),z=sg(),_=rg();let k,B,A,U,$,J,G;e[23]!==P?(k=()=>{P()},e[23]=P,e[24]=k):k=e[24],Rt("global.runStale",k),e[25]!==p?(B=()=>{p()},e[25]=p,e[26]=B):B=e[26],Rt("global.interrupt",B),e[27]!==_?(A=()=>{_()},e[27]=_,e[28]=A):A=e[28],Rt("global.hideCode",A),e[29]!==z?(U=()=>{z()},e[29]=z,e[30]=U):U=e[30],Rt("global.runAll",U),e[31]!==l?($=()=>{l()},e[31]=l,e[32]=$):$=e[32],Rt("global.collapseAllSections",$),e[33]!==c?(J=()=>{c()},e[33]=c,e[34]=J):J=e[34],Rt("global.expandAllSections",J),e[35]!==o||e[36]!==n||e[37]!==d.mode?(G=u.jsx(l6,{mode:d.mode,userConfig:n,appConfig:o}),e[35]=o,e[36]=n,e[37]=d.mode,e[38]=G):G=e[38];const K=G,W=o.width;let X,V,Q,te,re,ne,ie,se;return e[39]===Symbol.for("react.memo_cache_sentinel")?(X=xe("pt-4 sm:pt-12 pb-2 mb-4 print:hidden z-50","sticky left-0"),e[39]=X):X=e[39],e[40]!==m||e[41]!==b?(V=b&&u.jsx("div",{className:"flex items-center justify-center container",children:u.jsx(D4,{filename:m})}),e[40]=m,e[41]=b,e[42]=V):V=e[42],e[43]!==T||e[44]!==V?(Q=u.jsx(PF,{connection:T,className:X,children:V}),e[43]=T,e[44]=V,e[45]=Q):Q=e[45],e[46]!==o||e[47]!==K||e[48]!==f||e[49]!==d.mode?(te=f&&u.jsx(RF,{appConfig:o,mode:d.mode,children:K}),e[46]=o,e[47]=K,e[48]=f,e[49]=d.mode,e[50]=te):te=e[50],e[51]!==o.width||e[52]!==T||e[53]!==v||e[54]!==Q||e[55]!==te?(re=u.jsxs(LF,{connection:T,isRunning:v,width:W,children:[Q,te]}),e[51]=o.width,e[52]=T,e[53]=v,e[54]=Q,e[55]=te,e[56]=re):re=e[56],e[57]===Symbol.for("react.memo_cache_sentinel")?(ne=u.jsx(W4,{}),e[57]=ne):ne=e[57],e[58]!==o||e[59]!==T||e[60]!==s||e[61]!==y||e[62]!==v||e[63]!==P||e[64]!==p||e[65]!==_?(ie=!s&&u.jsx(Vc,{children:u.jsx(I4,{presenting:y,onTogglePresenting:_,onInterrupt:p,onRun:P,connectionState:T.state,running:v,appConfig:o})}),e[58]=o,e[59]=T,e[60]=s,e[61]=y,e[62]=v,e[63]=P,e[64]=p,e[65]=_,e[66]=ie):ie=e[66],e[67]!==re||e[68]!==ie?(se=u.jsxs(u.Fragment,{children:[re,ne,ie]}),e[67]=re,e[68]=ie,e[69]=se):se=e[69],se};function p6(){jj.INSTANCE.stop()}function g6(t){return t.name}function x6(t){return t.code}function b6(t){return t.config}const Bb=t=>je(HP)[t.capability]?t.children:null,mn=O.forwardRef((t,e)=>{const n=H.c(18);let o,r,s,i,a;n[0]!==t?({children:o,tooltip:a,selected:i,className:r,...s}=t,n[0]=t,n[1]=o,n[2]=r,n[3]=s,n[4]=i,n[5]=a):(o=n[1],r=n[2],s=n[3],i=n[4],a=n[5]);const l=!i&&"hover:bg-(--sage-3)",c=i&&"bg-(--sage-4)";let d,h;n[6]!==r||n[7]!==l||n[8]!==c?(d=xe("h-full flex items-center p-2 text-sm shadow-inset font-mono cursor-pointer rounded",l,c,r),n[6]=r,n[7]=l,n[8]=c,n[9]=d):d=n[9],n[10]!==o||n[11]!==e||n[12]!==s||n[13]!==d?(h=u.jsx("div",{ref:e,className:d,...s,children:o}),n[10]=o,n[11]=e,n[12]=s,n[13]=d,n[14]=h):h=n[14];const f=h;if(a){let m;return n[15]!==f||n[16]!==a?(m=u.jsx(Ne,{content:a,side:"top",delayDuration:200,children:f}),n[15]=f,n[16]=a,n[17]=m):m=n[17],m}return f});mn.displayName="FooterItem";const y6=()=>{var m,g;const t=H.c(17),e=je(DC),n=je(tc),o=((m=e==null?void 0:e.models)==null?void 0:m.chat_model)||RC,r=((g=e==null?void 0:e.models)==null?void 0:g.edit_model)||o,{handleClick:s}=aa();if(!n){let x,p,b;return t[0]!==s?(x=()=>s("ai"),t[0]=s,t[1]=x):x=t[1],t[2]===Symbol.for("react.memo_cache_sentinel")?(p=u.jsx(Pi,{className:"h-4 w-4 opacity-60"}),t[2]=p):p=t[2],t[3]!==x?(b=u.jsx(mn,{tooltip:"Assist is disabled",selected:!1,onClick:x,"data-testid":"footer-ai-disabled",children:p}),t[3]=x,t[4]=b):b=t[4],b}let i,a,l,c,d,h,f;return t[5]===Symbol.for("react.memo_cache_sentinel")?(i=u.jsx("b",{children:"Chat model:"}),t[5]=i):i=t[5],t[6]===Symbol.for("react.memo_cache_sentinel")?(a=u.jsx("br",{}),l=u.jsx("b",{children:"Edit model:"}),t[6]=a,t[7]=l):(a=t[6],l=t[7]),t[8]!==o||t[9]!==r?(c=u.jsxs(u.Fragment,{children:[i," ",o,a,l," ",r]}),t[8]=o,t[9]=r,t[10]=c):c=t[10],t[11]!==s?(d=()=>s("ai"),t[11]=s,t[12]=d):d=t[12],t[13]===Symbol.for("react.memo_cache_sentinel")?(h=u.jsx(Pi,{className:"h-4 w-4"}),t[13]=h):h=t[13],t[14]!==c||t[15]!==d?(f=u.jsx(mn,{tooltip:c,onClick:d,selected:!1,"data-testid":"footer-ai-enabled",children:h}),t[14]=c,t[15]=d,t[16]=f):f=t[16],f},v6=()=>{const t=H.c(26),e=je(ln).state,n=Gm();let o,r;t[0]!==e||t[1]!==n?(o=async()=>{if(e===Bt.OPEN){if(tn())return{isHealthy:!0,lastChecked:new Date,error:void 0};try{return{isHealthy:await n.isHealthy(),lastChecked:new Date,error:void 0}}catch(w){const j=w;return{isHealthy:!1,lastChecked:new Date,error:j instanceof Error?j.message:"Unknown error"}}}},r=[n,e],t[0]=e,t[1]=n,t[2]=o,t[3]=r):(o=t[2],r=t[3]);const{isFetching:s,error:i,data:a,refetch:l}=Tn(o,r),c=e===Bt.OPEN?3e4:null;let d,h;t[4]!==c?(d={delayMs:c,whenVisible:!0},t[4]=c,t[5]=d):d=t[5],ia(l,d),t[6]!==e||t[7]!==a||t[8]!==i?(h=()=>[Cm(e.toLowerCase()),a!=null&&a.lastChecked?a.isHealthy?"\u2713 Healthy":"\u2717 Unhealthy":"Health: Unknown",i?`Error: ${i}`:""].filter(Boolean).join(`
|
|
128
128
|
`),t[6]=e,t[7]=a,t[8]=i,t[9]=h):h=t[9];const f=h;let m;t[10]!==e||t[11]!==(a==null?void 0:a.isHealthy)||t[12]!==(a==null?void 0:a.lastChecked)||t[13]!==s?(m=()=>s||e===Bt.CONNECTING?u.jsx(kn,{size:"small"}):e===Bt.CLOSING?u.jsx(kn,{className:"text-destructive",size:"small"}):e===Bt.OPEN?a!=null&&a.isHealthy?u.jsx(Kc,{className:"w-4 h-4 text-(--green-9)"}):a!=null&&a.lastChecked?u.jsx(MC,{className:"w-4 h-4 text-(--yellow-9)"}):u.jsx(Kc,{className:"w-4 h-4"}):u.jsx(la,{className:"w-4 h-4 text-red-500"}),t[10]=e,t[11]=a==null?void 0:a.isHealthy,t[12]=a==null?void 0:a.lastChecked,t[13]=s,t[14]=m):m=t[14];const g=m,x=f();let p,b,y,v;return t[15]!==e?(p=e===Bt.OPEN&&u.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Click to refresh health status"}),t[15]=e,t[16]=p):p=t[16],t[17]!==x||t[18]!==p?(b=u.jsxs("div",{className:"text-sm whitespace-pre-line",children:[x,p]}),t[17]=x,t[18]=p,t[19]=b):b=t[19],t[20]!==g?(y=g(),t[20]=g,t[21]=y):y=t[21],t[22]!==l||t[23]!==b||t[24]!==y?(v=u.jsx(mn,{tooltip:b,selected:!1,onClick:l,"data-testid":"footer-backend-status",children:y}),t[22]=l,t[23]=b,t[24]=y,t[25]=v):v=t[25],v},w6=t=>{const e=H.c(3);let n,o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=u.jsx("path",{d:"M205.28 31.36c14.096 14.88 20.016 35.2 22.512 63.68c6.626 0 12.805 1.47 16.976 7.152l7.792 10.56A17.55 17.55 0 0 1 256 123.2v28.688c-.008 3.704-1.843 7.315-4.832 9.504C215.885 187.222 172.35 208 128 208c-49.066 0-98.19-28.273-123.168-46.608c-2.989-2.189-4.825-5.8-4.832-9.504V123.2c0-3.776 1.2-7.424 3.424-10.464l7.792-10.544c4.173-5.657 10.38-7.152 16.992-7.152c2.496-28.48 8.4-48.8 22.512-63.68C77.331 3.165 112.567.06 127.552 0H128c14.72 0 50.4 2.88 77.28 31.36m-77.264 47.376c-3.04 0-6.544.176-10.272.544c-1.312 4.896-3.248 9.312-6.08 12.128c-11.2 11.2-24.704 12.928-31.936 12.928c-6.802 0-13.927-1.42-19.744-5.088c-5.502 1.808-10.786 4.415-11.136 10.912c-.586 12.28-.637 24.55-.688 36.824c-.026 6.16-.05 12.322-.144 18.488c.024 3.579 2.182 6.903 5.44 8.384C79.936 185.92 104.976 192 128.016 192c23.008 0 48.048-6.08 74.512-18.144c3.258-1.48 5.415-4.805 5.44-8.384c.317-18.418.062-36.912-.816-55.312h.016c-.342-6.534-5.648-9.098-11.168-10.912c-5.82 3.652-12.927 5.088-19.728 5.088c-7.232 0-20.72-1.728-31.936-12.928c-2.832-2.816-4.768-7.232-6.08-12.128a106 106 0 0 0-10.24-.544m-26.941 43.93c5.748 0 10.408 4.66 10.408 10.409v19.183c0 5.749-4.66 10.409-10.408 10.409s-10.408-4.66-10.408-10.409v-19.183c0-5.748 4.66-10.408 10.408-10.408m53.333 0c5.749 0 10.409 4.66 10.409 10.409v19.183c0 5.749-4.66 10.409-10.409 10.409c-5.748 0-10.408-4.66-10.408-10.409v-19.183c0-5.748 4.66-10.408 10.408-10.408M81.44 28.32c-11.2 1.12-20.64 4.8-25.44 9.92c-10.4 11.36-8.16 40.16-2.24 46.24c4.32 4.32 12.48 7.2 21.28 7.2c6.72 0 19.52-1.44 30.08-12.16c4.64-4.48 7.52-15.68 7.2-27.04c-.32-9.12-2.88-16.64-6.72-19.84c-4.16-3.68-13.6-5.28-24.16-4.32m68.96 4.32c-3.84 3.2-6.4 10.72-6.72 19.84c-.32 11.36 2.56 22.56 7.2 27.04c10.56 10.72 23.36 12.16 30.08 12.16c8.8 0 16.96-2.88 21.28-7.2c5.92-6.08 8.16-34.88-2.24-46.24c-4.8-5.12-14.24-8.8-25.44-9.92c-10.56-.96-20 .64-24.16 4.32M128 56c-2.56 0-5.6.16-8.96.48c.32 1.76.48 3.68.64 5.76c0 1.44 0 2.88-.16 4.48c3.2-.32 5.92-.32 8.48-.32s5.28 0 8.48.32c-.16-1.6-.16-3.04-.16-4.48c.16-2.08.32-4 .64-5.76c-3.36-.32-6.4-.48-8.96-.48"}),e[0]=n):n=e[0],e[1]!==t?(o=u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.24em",height:"1em",viewBox:"0 0 256 208",fill:"currentColor",...t,children:n}),e[1]=t,e[2]=o):o=e[2],o},k6=jt(t=>t(WP).completion.copilot),C6=()=>{const t=H.c(1);if(je(k6)==="github"){let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=u.jsx(j6,{}),t[0]=e):e=t[0],e}return null},Ub=ut.get("[copilot-status-bar]"),j6=()=>{const t=je(mj),e=je(xF)!==null,{handleClick:n}=aa(),o=()=>n("ai"),r=t?"Ready":"Not connected",s=Ct(mj),i=Ct(bF);return OC(()=>{const a=fj();let l=!0;return(async()=>{try{if(await a.initializePromise.catch(d=>{throw Ub.error("Failed to initialize",d),a.close(),d}),!l)return;const c=await a.signedIn();if(!l)return;s(c),i(c?"signedIn":"signedOut")}catch(c){if(!l)return;Ub.warn("Connection failed",c),s(!1),i("connectionError"),Je({title:"GitHub Copilot Connection Error",description:"Failed to connect to GitHub Copilot. Check settings and try again.",variant:"danger",action:u.jsx(ve,{variant:"link",onClick:o,children:"Settings"})})}})(),()=>{l=!1}}),u.jsx(mn,{tooltip:u.jsxs(u.Fragment,{children:[u.jsx("b",{children:"GitHub Copilot:"})," ",r]}),selected:!1,onClick:o,"data-testid":"footer-copilot-status",children:u.jsx("span",{children:e?u.jsx(kn,{className:"h-4 w-4"}):u.jsx(w6,{className:xe("h-4 w-4",!t&&"opacity-60")})})})},S6=()=>{const t=H.c(18),[e,n]=O.useState(0),o=je(ln),{getUsageStats:r}=tt();let s,i,a,l;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=()=>n(I6),i={delayMs:1e4,whenVisible:!0},t[0]=s,t[1]=i):(s=t[0],i=t[1]),ia(s,i),t[2]!==o.state||t[3]!==r?(a=async()=>tn()||o.state!==Bt.OPEN?null:r(),t[2]=o.state,t[3]=r,t[4]=a):a=t[4],t[5]!==o.state||t[6]!==e?(l=[e,o.state],t[5]=o.state,t[6]=e,t[7]=l):l=t[7];const{data:c}=Tn(a,l);let d,h,f,m;return t[8]!==c?(d=(c==null?void 0:c.gpu)&&c.gpu.length>0&&u.jsx(_6,{gpus:c.gpu}),t[8]=c,t[9]=d):d=t[9],t[10]!==c?(h=c&&u.jsx(N6,{memory:c.memory,kernel:c.kernel,server:c.server}),t[10]=c,t[11]=h):h=t[11],t[12]!==c?(f=c&&u.jsx(E6,{cpu:c.cpu}),t[12]=c,t[13]=f):f=t[13],t[14]!==d||t[15]!==h||t[16]!==f?(m=u.jsxs("div",{className:"flex gap-2 items-center px-1",children:[d,h,f]}),t[14]=d,t[15]=h,t[16]=f,t[17]=m):m=t[17],m},N6=t=>{const e=H.c(25),{memory:n,kernel:o,server:r}=t,{percent:s,total:i,available:a}=n;let l;e[0]!==s?(l=Math.round(s),e[0]=s,e[1]=l):l=e[1];const c=l;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=u.jsx("b",{children:"computer memory:"}),e[2]=d):d=e[2];const h=i-a;let f,m,g,x,p,b,y,v,w;return e[3]!==h?(f=Vu(h),e[3]=h,e[4]=f):f=e[4],e[5]!==i?(m=Vu(i),e[5]=i,e[6]=m):m=e[6],e[7]!==c||e[8]!==f||e[9]!==m?(g=u.jsxs("span",{children:[d," ",f," / ",m," GB (",c,"%)"]}),e[7]=c,e[8]=f,e[9]=m,e[10]=g):g=e[10],e[11]!==r?(x=(r==null?void 0:r.memory)&&u.jsxs("span",{children:[u.jsx("b",{children:"marimo server:"})," ",pl(r.memory)]}),e[11]=r,e[12]=x):x=e[12],e[13]!==o?(p=(o==null?void 0:o.memory)&&u.jsxs("span",{children:[u.jsx("b",{children:"kernel:"})," ",pl(o.memory)]}),e[13]=o,e[14]=p):p=e[14],e[15]!==g||e[16]!==x||e[17]!==p?(b=u.jsxs("div",{className:"flex flex-col gap-1",children:[g,x,p]}),e[15]=g,e[16]=x,e[17]=p,e[18]=b):b=e[18],e[19]===Symbol.for("react.memo_cache_sentinel")?(y=u.jsx(Rp,{className:"w-4 h-4"}),e[19]=y):y=e[19],e[20]!==c?(v=u.jsxs("div",{className:"flex items-center gap-1","data-testid":"memory-usage-bar",children:[y,u.jsx($u,{percent:c,colorClassName:"bg-primary"})]}),e[20]=c,e[21]=v):v=e[21],e[22]!==v||e[23]!==b?(w=u.jsx(Ne,{delayDuration:200,content:b,children:v}),e[22]=v,e[23]=b,e[24]=w):w=e[24],w},E6=t=>{const e=H.c(11),{cpu:n}=t,{percent:o}=n;let r;e[0]!==o?(r=Math.round(o),e[0]=o,e[1]=r):r=e[1];const s=r;let i,a,l,c,d;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=u.jsx("b",{children:"CPU:"}),e[2]=i):i=e[2],e[3]!==s?(a=u.jsxs("span",{children:[i," ",s,"%"]}),e[3]=s,e[4]=a):a=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(l=u.jsx(yF,{className:"w-4 h-4"}),e[5]=l):l=e[5],e[6]!==s?(c=u.jsxs("div",{className:"flex items-center gap-1","data-testid":"cpu-bar",children:[l,u.jsx($u,{percent:s,colorClassName:"bg-primary"})]}),e[6]=s,e[7]=c):c=e[7],e[8]!==a||e[9]!==c?(d=u.jsx(Ne,{delayDuration:200,content:a,children:c}),e[8]=a,e[9]=c,e[10]=d):d=e[10],d},_6=t=>{const e=H.c(12),{gpus:n}=t;let o;e[0]!==n?(o=Math.round(n.reduce(A6,0)/n.length),e[0]=n,e[1]=o):o=e[1];const r=o;let s,i,a,l,c;return e[2]!==n?(s=n.map(T6),e[2]=n,e[3]=s):s=e[3],e[4]!==s?(i=u.jsx("div",{className:"flex flex-col gap-1",children:s}),e[4]=s,e[5]=i):i=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(a=u.jsx(Lp,{className:"w-4 h-4"}),e[6]=a):a=e[6],e[7]!==r?(l=u.jsxs("div",{className:"flex items-center gap-1","data-testid":"gpu-bar",children:[a,u.jsx($u,{percent:r,colorClassName:"bg-(--grass-9)"})]}),e[7]=r,e[8]=l):l=e[8],e[9]!==i||e[10]!==l?(c=u.jsx(Ne,{delayDuration:200,content:i,children:l}),e[9]=i,e[10]=l,e[11]=c):c=e[11],c},$u=t=>{const e=H.c(7),{percent:n,colorClassName:o}=t;let r;e[0]!==o?(r=xe("h-full bg-primary",o),e[0]=o,e[1]=r):r=e[1];const s=`${n}%`;let i,a;return e[2]!==s?(i={width:s},e[2]=s,e[3]=i):i=e[3],e[4]!==r||e[5]!==i?(a=u.jsx("div",{className:"h-3 w-20 bg-(--slate-4) rounded-lg overflow-hidden border",children:u.jsx("div",{className:r,style:i})}),e[4]=r,e[5]=i,e[6]=a):a=e[6],a};function pl(t){return t>1073741824?`${Vu(t)} GB`:`${function(e){return new Intl.NumberFormat("en-US",{maximumFractionDigits:0}).format(e/1048576)}(t)} MB`}function Vu(t){return new Intl.NumberFormat("en-US",{maximumFractionDigits:2}).format(t/1073741824)}function I6(t){return t+1}function A6(t,e){return t+e.memory.percent}function T6(t){return u.jsxs("span",{children:[u.jsxs("b",{children:["GPU ",t.index," (",t.name,"):"]})," ",pl(t.memory.used)," / ",pl(t.memory.total)," GB (",Math.round(t.memory.percent),"%)"]},t.index)}const $b=jt(!1);function Hu(t,e,n=new Set){if(n.has(t))return new Set;n.add(t);const o=new Set;for(const r of e(t)){o.add(r);for(const s of Hu(r,e,n))o.add(s)}return o}const M6=jt(t=>{const e=t(na),n=t(Sc);return function(o,r){var a,l,c;const s=new Map;for(const d of o)s.set(d,{variables:new Set,parents:new Set,children:new Set});for(const d of Object.values(r))if(d.dataType!=="module")for(const h of d.declaredBy){(a=s.get(h))==null||a.variables.add(d.name);for(const f of d.usedBy)h!==f&&((l=s.get(f))==null||l.parents.add(h),(c=s.get(h))==null||c.children.add(f))}const i={};for(const[d,h]of s.entries())i[d]={parents:h.parents,children:h.children,variables:[...h.variables],ancestors:Hu(d,f=>{var m;return((m=s.get(f))==null?void 0:m.parents)??new Set}),descendants:Hu(d,f=>{var m;return((m=s.get(f))==null?void 0:m.children)??new Set})};return i}(e.inOrderIds,n)});function O6(t,e){return e?t.usedBy.includes(e.id)||t.declaredBy.includes(e.id)?!0:t.declaredBy.some(n=>e.graph.parents.has(n))?t.usedBy.some(n=>e.graph.parents.has(n)):!!t.declaredBy.some(n=>e.graph.children.has(n)):!1}const D6=()=>{const t=H.c(6),[e,n]=Dt($b);let o,r,s;return t[0]!==n?(o=()=>n(R6),t[0]=n,t[1]=o):o=t[1],t[2]===Symbol.for("react.memo_cache_sentinel")?(r=u.jsx(Dp,{className:"h-4 w-4"}),t[2]=r):r=t[2],t[3]!==e||t[4]!==o?(s=u.jsx(mn,{tooltip:"Toggle Minimap",selected:e,onClick:o,"data-testid":"footer-minimap",children:r}),t[3]=e,t[4]=o,t[5]=s):s=t[5],s};function R6(t){return!t}const P6=()=>{const t=H.c(13),e=je(Rr),[n,o]=Dt(pC),[r,s]=O.useState(!1);if(!Lc()||e==="disabled")return null;const i=e?"Real-time collaboration active":"Connecting to real-time collaboration";let a,l,c,d,h,f;return t[0]===Symbol.for("react.memo_cache_sentinel")?(a=u.jsx(tg,{className:"w-4 h-4"}),t[0]=a):a=t[0],t[1]!==i?(l=u.jsx(ws,{asChild:!0,children:u.jsx(mn,{tooltip:i,selected:!1,"data-testid":"footer-rtc-status",children:a})}),t[1]=i,t[2]=l):l=t[2],t[3]===Symbol.for("react.memo_cache_sentinel")?(c=u.jsxs("div",{className:"space-y-2",children:[u.jsx("h4",{className:"font-medium leading-none",children:"Username"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"Set your username for real-time collaboration"})]}),t[3]=c):c=t[3],t[4]!==o?(d=m=>o(m.target.value),t[4]=o,t[5]=d):d=t[5],t[6]!==d||t[7]!==n?(h=u.jsx(ps,{className:"w-80",children:u.jsxs("div",{className:"space-y-4",children:[c,u.jsx(qo,{value:n,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",onChange:d,placeholder:"Enter your username"})]})}),t[6]=d,t[7]=n,t[8]=h):h=t[8],t[9]!==r||t[10]!==l||t[11]!==h?(f=u.jsxs(yr,{open:r,onOpenChange:s,children:[l,h]}),t[9]=r,t[10]=l,t[11]=h,t[12]=f):f=t[12],f},L6=t=>{const e=H.c(104),{className:n}=t,{saveUserConfig:o}=tt(),[r,s]=qP(),i=br()[0],[a,l]=O.useState(!1);let c,d,h;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{const _e=window.matchMedia("(min-width: 768px)"),ke=()=>{_e.matches&&l(!1)};return _e.addEventListener("change",ke),()=>_e.removeEventListener("change",ke)},d=[],e[0]=c,e[1]=d):(c=e[0],d=e[1]),O.useEffect(c,d),e[2]!==i||e[3]!==o||e[4]!==s?(h=async _e=>{const ke={...i,runtime:{...i.runtime,auto_instantiate:_e}};await o({config:ke}).then(()=>s(ke))},e[2]=i,e[3]=o,e[4]=s,e[5]=h):h=e[5];const f=h;let m;e[6]!==o||e[7]!==s||e[8]!==r?(m=async _e=>{const ke={...r,runtime:{...r.runtime,on_cell_change:_e?"autorun":"lazy"}};await o({config:ke}).then(()=>s(ke))},e[6]=o,e[7]=s,e[8]=r,e[9]=m):m=e[9];const g=m;let x;e[10]!==o||e[11]!==s||e[12]!==r?(x=async _e=>{const ke={...r,runtime:{...r.runtime,auto_reload:_e}};await o({config:ke}).then(()=>s(ke))},e[10]=o,e[11]=s,e[12]=r,e[13]=x):x=e[13];const p=x;let b;e[14]!==i.runtime.auto_instantiate||e[15]!==i.runtime.auto_reload||e[16]!==i.runtime.on_cell_change?(b=!i.runtime.auto_instantiate&&i.runtime.on_cell_change==="lazy"&&(tn()||i.runtime.auto_reload!=="autorun"),e[14]=i.runtime.auto_instantiate,e[15]=i.runtime.auto_reload,e[16]=i.runtime.on_cell_change,e[17]=b):b=e[17];const y=b;let v;e[18]!==n?(v=xe("flex items-center",n),e[18]=n,e[19]=v):v=e[19];const w=i.runtime.auto_instantiate?"Disable autorun on startup":"Enable autorun on startup";let j,C,N;e[20]!==i.runtime.auto_instantiate||e[21]!==f?(j=()=>f(!i.runtime.auto_instantiate),e[20]=i.runtime.auto_instantiate,e[21]=f,e[22]=j):j=e[22],e[23]===Symbol.for("react.memo_cache_sentinel")?(C=u.jsx("span",{children:"on startup: "}),e[23]=C):C=e[23],e[24]!==i.runtime.auto_instantiate?(N=i.runtime.auto_instantiate?u.jsx(hn,{size:14}):u.jsx(un,{size:14}),e[24]=i.runtime.auto_instantiate,e[25]=N):N=e[25];const S=i.runtime.auto_instantiate?"autorun":"lazy";let E,T,I,M;e[26]!==S?(E=u.jsx("span",{children:S}),e[26]=S,e[27]=E):E=e[27],e[28]!==N||e[29]!==E?(T=u.jsxs("div",{className:"font-prose text-sm flex items-center gap-1 whitespace-nowrap",children:[C,N,E]}),e[28]=N,e[29]=E,e[30]=T):T=e[30],e[31]!==T||e[32]!==w||e[33]!==j?(I=u.jsx(Ns,{name:"runtime.auto_instantiate",children:u.jsx(mn,{tooltip:w,selected:!1,onClick:j,"data-testid":"footer-autorun-startup",children:T})}),e[31]=T,e[32]=w,e[33]=j,e[34]=I):I=e[34],e[35]===Symbol.for("react.memo_cache_sentinel")?(M=u.jsx("div",{className:"border-r border-border h-6 mx-1"}),e[35]=M):M=e[35];const F=i.runtime.on_cell_change==="autorun"?"Disable autorun":"Enable autorun";let D,R,P,z,_,k,B,A,U,$,J,G,K;e[36]!==i.runtime.on_cell_change||e[37]!==g?(D=()=>g(i.runtime.on_cell_change!=="autorun"),e[36]=i.runtime.on_cell_change,e[37]=g,e[38]=D):D=e[38],e[39]===Symbol.for("react.memo_cache_sentinel")?(R=u.jsx("span",{children:"on cell change: "}),e[39]=R):R=e[39],e[40]!==i.runtime.on_cell_change?(P=u.jsxs("div",{className:"font-prose text-sm flex items-center gap-1 whitespace-nowrap",children:[R,i.runtime.on_cell_change==="autorun"?u.jsx(hn,{size:14}):u.jsx(un,{size:14}),u.jsx("span",{children:i.runtime.on_cell_change})]}),e[40]=i.runtime.on_cell_change,e[41]=P):P=e[41],e[42]!==F||e[43]!==D||e[44]!==P?(z=u.jsx(Ns,{name:"runtime.on_cell_change",children:u.jsx(mn,{tooltip:F,selected:!1,onClick:D,"data-testid":"footer-autorun-cell-change",children:P})}),e[42]=F,e[43]=D,e[44]=P,e[45]=z):z=e[45],e[46]!==i.runtime.auto_reload||e[47]!==p?(_=!tn()&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"border-r border-border h-6 mx-1"}),u.jsx(Ns,{name:"runtime.auto_reload",children:u.jsx(mn,{tooltip:null,selected:!1,"data-testid":"footer-module-reload",children:u.jsxs(Eo,{children:[u.jsxs(_o,{className:"font-prose text-sm flex items-center gap-1 whitespace-nowrap",children:[u.jsx("span",{children:"on module change: "}),i.runtime.auto_reload==="off"&&u.jsx(la,{size:14}),i.runtime.auto_reload==="lazy"&&u.jsx(un,{size:14}),i.runtime.auto_reload==="autorun"&&u.jsx(hn,{size:14}),u.jsx("span",{children:i.runtime.auto_reload}),u.jsx(No,{size:14})]}),u.jsx(Io,{children:["off","lazy","autorun"].map(_e=>u.jsxs(At,{onClick:()=>p(_e),children:[_e==="off"&&u.jsx(la,{size:14,className:"mr-2 text-muted-foreground"}),_e==="lazy"&&u.jsx(un,{size:14,className:"mr-2 text-muted-foreground"}),_e==="autorun"&&u.jsx(hn,{size:14,className:"mr-2 text-muted-foreground"}),_e]},_e))})]})})})]}),e[46]=i.runtime.auto_reload,e[47]=p,e[48]=_):_=e[48],e[49]!==I||e[50]!==z||e[51]!==_?(k=u.jsxs("div",{className:"hidden md:flex md:items-center",children:[I,M,z,_]}),e[49]=I,e[50]=z,e[51]=_,e[52]=k):k=e[52],e[53]!==y?(B=y?u.jsx(un,{size:16,className:"text-muted-foreground"}):u.jsx(hn,{size:16,className:"text-amber-500"}),e[53]=y,e[54]=B):B=e[54],e[55]===Symbol.for("react.memo_cache_sentinel")?(A=u.jsx(No,{size:14}),e[55]=A):A=e[55],e[56]!==B?(U=u.jsx(_o,{asChild:!0,children:u.jsx(mn,{tooltip:"Runtime reactivity",selected:!1,"data-testid":"footer-runtime-settings",children:u.jsxs("div",{className:"flex items-center gap-1",children:[B,A]})})}),e[56]=B,e[57]=U):U=e[57],e[58]===Symbol.for("react.memo_cache_sentinel")?($=u.jsx(T3,{children:"Runtime reactivity"}),J=u.jsx(an,{}),e[58]=$,e[59]=J):($=e[58],J=e[59]),e[60]!==i.runtime.auto_instantiate?(G=i.runtime.auto_instantiate?u.jsx(hn,{size:14,className:"text-amber-500"}):u.jsx(un,{size:14,className:"text-muted-foreground"}),e[60]=i.runtime.auto_instantiate,e[61]=G):G=e[61],e[62]===Symbol.for("react.memo_cache_sentinel")?(K=u.jsx("div",{className:"text-sm font-medium",children:"On startup"}),e[62]=K):K=e[62];const W=i.runtime.auto_instantiate?"autorun":"lazy";let X,V,Q,te,re,ne,ie,se,ae;e[63]!==W?(X=u.jsxs("div",{children:[K,u.jsx("div",{className:"text-xs text-muted-foreground",children:W})]}),e[63]=W,e[64]=X):X=e[64],e[65]!==G||e[66]!==X?(V=u.jsxs("div",{className:"flex items-center space-x-2",children:[G,X]}),e[65]=G,e[66]=X,e[67]=V):V=e[67],e[68]!==i.runtime.auto_instantiate||e[69]!==f?(Q=u.jsx(mm,{checked:i.runtime.auto_instantiate,onCheckedChange:f,size:"sm"}),e[68]=i.runtime.auto_instantiate,e[69]=f,e[70]=Q):Q=e[70],e[71]!==V||e[72]!==Q?(te=u.jsx(Ns,{name:"runtime.auto_instantiate",children:u.jsxs("div",{className:"flex items-center justify-between px-2 py-2",children:[V,Q]})}),e[71]=V,e[72]=Q,e[73]=te):te=e[73],e[74]===Symbol.for("react.memo_cache_sentinel")?(re=u.jsx(an,{}),e[74]=re):re=e[74],e[75]!==i.runtime.on_cell_change?(ne=i.runtime.on_cell_change==="autorun"?u.jsx(hn,{size:14,className:"text-amber-500"}):u.jsx(un,{size:14,className:"text-muted-foreground"}),e[75]=i.runtime.on_cell_change,e[76]=ne):ne=e[76],e[77]===Symbol.for("react.memo_cache_sentinel")?(ie=u.jsx("div",{className:"text-sm font-medium",children:"On cell change"}),e[77]=ie):ie=e[77],e[78]!==i.runtime.on_cell_change?(se=u.jsxs("div",{children:[ie,u.jsx("div",{className:"text-xs text-muted-foreground",children:i.runtime.on_cell_change})]}),e[78]=i.runtime.on_cell_change,e[79]=se):se=e[79],e[80]!==ne||e[81]!==se?(ae=u.jsxs("div",{className:"flex items-center space-x-2",children:[ne,se]}),e[80]=ne,e[81]=se,e[82]=ae):ae=e[82];const ge=i.runtime.on_cell_change==="autorun";let oe,ue,de,Se,Te,Fe;return e[83]!==g||e[84]!==ge?(oe=u.jsx(mm,{checked:ge,onCheckedChange:g,size:"sm"}),e[83]=g,e[84]=ge,e[85]=oe):oe=e[85],e[86]!==ae||e[87]!==oe?(ue=u.jsx(Ns,{name:"runtime.on_cell_change",children:u.jsxs("div",{className:"flex items-center justify-between px-2 py-2",children:[ae,oe]})}),e[86]=ae,e[87]=oe,e[88]=ue):ue=e[88],e[89]!==i.runtime.auto_reload||e[90]!==p?(de=!tn()&&u.jsxs(u.Fragment,{children:[u.jsx(an,{}),u.jsx(Ns,{name:"runtime.auto_reload",children:u.jsxs("div",{className:"px-2 py-1",children:[u.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[i.runtime.auto_reload==="off"&&u.jsx(la,{size:14,className:"text-muted-foreground"}),i.runtime.auto_reload==="lazy"&&u.jsx(un,{size:14,className:"text-muted-foreground"}),i.runtime.auto_reload==="autorun"&&u.jsx(hn,{size:14,className:"text-amber-500"}),u.jsxs("div",{children:[u.jsx("div",{className:"text-sm font-medium",children:"On module change"}),u.jsx("div",{className:"text-xs text-muted-foreground",children:i.runtime.auto_reload})]})]}),u.jsx("div",{className:"space-y-1",children:["off","lazy","autorun"].map(_e=>u.jsxs("button",{onClick:()=>p(_e),className:xe("w-full flex items-center px-2 py-1 text-sm rounded hover:bg-accent",_e===i.runtime.auto_reload&&"bg-accent"),children:[_e==="off"&&u.jsx(la,{size:12,className:"mr-2"}),_e==="lazy"&&u.jsx(un,{size:12,className:"mr-2"}),_e==="autorun"&&u.jsx(hn,{size:12,className:"mr-2"}),u.jsx("span",{className:"capitalize",children:_e}),_e===i.runtime.auto_reload&&u.jsx("span",{className:"ml-auto",children:"\u2713"})]},_e))})]})})]}),e[89]=i.runtime.auto_reload,e[90]=p,e[91]=de):de=e[91],e[92]!==te||e[93]!==ue||e[94]!==de?(Se=u.jsxs(Io,{align:"start",className:"w-64",children:[$,J,te,re,ue,de]}),e[92]=te,e[93]=ue,e[94]=de,e[95]=Se):Se=e[95],e[96]!==a||e[97]!==U||e[98]!==Se?(Te=u.jsx("div",{className:"flex md:hidden",children:u.jsxs(Eo,{open:a,onOpenChange:l,children:[U,Se]})}),e[96]=a,e[97]=U,e[98]=Se,e[99]=Te):Te=e[99],e[100]!==k||e[101]!==Te||e[102]!==v?(Fe=u.jsxs("div",{className:v,children:[k,Te]}),e[100]=k,e[101]=Te,e[102]=v,e[103]=Fe):Fe=e[103],Fe},F6=()=>{const t=H.c(24),{selectedPanel:e,isTerminalOpen:n}=bc(),{toggleApplication:o,toggleTerminal:r}=Bi(),s=je(GP),i=z6,a=fd.find(B6);let l;Un(a,"Error panel not found"),t[0]!==r?(l=()=>{r()},t[0]=r,t[1]=l):l=t[1],Rt("global.toggleTerminal",l);const c=mn,d=a.tooltip,h=e===a.type,f=()=>o(a.type),m=i(a,s>0?"text-destructive":"");let g,x,p,b,y,v,w,j,C,N;return t[2]!==s?(g=u.jsx("span",{className:"ml-1 font-mono mt-0.5",children:s}),t[2]=s,t[3]=g):g=t[3],t[4]!==c||t[5]!==a||t[6]!==h||t[7]!==f||t[8]!==m||t[9]!==g?(x=u.jsxs(c,{tooltip:d,selected:h,onClick:f,"data-testid":"footer-errors",children:[m,g]}),t[4]=c,t[5]=a,t[6]=h,t[7]=f,t[8]=m,t[9]=g,t[10]=x):x=t[10],t[11]!==r?(p=()=>r(),t[11]=r,t[12]=p):p=t[12],t[13]===Symbol.for("react.memo_cache_sentinel")?(b=u.jsx(Qp,{className:"h-5 w-5"}),t[13]=b):b=t[13],t[14]!==n||t[15]!==p?(y=u.jsx(Bb,{capability:"terminal",children:u.jsx(mn,{tooltip:"Open terminal",selected:n,onClick:p,"data-testid":"footer-terminal",children:b})}),t[14]=n,t[15]=p,t[16]=y):y=t[16],t[17]===Symbol.for("react.memo_cache_sentinel")?(v=u.jsx(L6,{}),w=u.jsx("div",{className:"mx-auto"}),t[17]=v,t[18]=w):(v=t[17],w=t[18]),t[19]===Symbol.for("react.memo_cache_sentinel")?(j=u.jsx(N4,{children:u.jsx(Ne,{content:u.jsx("div",{className:"w-[200px]",children:"Kiosk mode is enabled. This allows you to view the outputs of the cells without the ability to edit them."}),children:u.jsx("span",{className:"text-muted-foreground text-sm mr-4",children:"kiosk mode"})})}),t[19]=j):j=t[19],t[20]===Symbol.for("react.memo_cache_sentinel")?(C=u.jsxs("div",{className:"flex items-center shrink-0 min-w-0",children:[u.jsx(S6,{}),u.jsx(D6,{}),u.jsx(y6,{}),u.jsx(C6,{}),u.jsx(P6,{}),u.jsx(v6,{})]}),t[20]=C):C=t[20],t[21]!==y||t[22]!==x?(N=u.jsxs("footer",{className:"h-10 py-2 bg-background flex items-center text-muted-foreground text-md px-1 border-t border-border select-none no-print text-sm shadow-[0_0_4px_1px_rgba(0,0,0,0.1)] z-50 print:hidden hide-on-fullscreen overflow-x-auto overflow-y-hidden scrollbar-thin",children:[x,y,v,w,j,C]}),t[21]=y,t[22]=x,t[23]=N):N=t[23],N};function z6(t,e){const{Icon:n}=t;return u.jsx(n,{className:xe("h-5 w-5",e)})}function B6(t){return t.type==="errors"}const U6=t=>{const e=H.c(6),{children:n}=t,{openModal:o,closeModal:r}=An();let s,i;return e[0]!==r||e[1]!==o?(s=()=>o(u.jsx($6,{onClose:r})),e[0]=r,e[1]=o,e[2]=s):s=e[2],e[3]!==n||e[4]!==s?(i=u.jsx(PC,{onClick:s,children:n}),e[3]=n,e[4]=s,e[5]=i):i=e[5],i},$6=t=>{const e=H.c(9),{onClose:n}=t;let o,r,s,i,a,l,c;return e[0]!==n?(o=async d=>{d.preventDefault();const h=new FormData(d.target),f=h.get("rating"),m=h.get("message");fetch("https://marimo.io/api/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({rating:f,message:m})}),n(),Je({title:"Feedback sent!",description:"Thank you for your feedback!"})},e[0]=n,e[1]=o):o=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(r=u.jsx(Wo,{children:"Send Feedback"}),e[2]=r):r=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(s=u.jsx("p",{className:"my-2 prose dark:prose-invert",children:"We want to hear from you \u2014 from minor bug reports to wishlist features and everything in between. Here are some ways you can get in touch:"}),e[3]=s):s=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(i=u.jsxs("li",{className:"my-0",children:["Take our"," ",u.jsx("a",{href:Fn.feedbackForm,target:"_blank",className:"underline",children:"two-minute survey."})]}),e[4]=i):i=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(a=u.jsxs("li",{className:"my-0",children:["File a"," ",u.jsx("a",{href:Fn.issuesPage,target:"_blank",className:"underline",children:"GitHub issue."})]}),e[5]=a):a=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(l=u.jsxs(ls,{children:[r,u.jsxs(cs,{children:[s,u.jsxs("ul",{className:"list-disc ml-8 my-2 prose dark:prose-invert",children:[i,a,u.jsxs("li",{className:"my-0",children:["Chat with us on"," ",u.jsx("a",{href:Fn.discordLink,target:"_blank",className:"underline",children:"Discord."})]})]}),u.jsx("p",{className:"my-2 prose dark:prose-invert",children:"We're excited you're here as we build the future of Python data tooling. Thanks for being part of our community!"})]})]}),e[6]=l):l=e[6],e[7]!==o?(c=u.jsx(Go,{className:"w-fit",children:u.jsx("form",{onSubmit:o,children:l})}),e[7]=o,e[8]=c):c=e[8],c},V6=()=>{const t=H.c(10),{selectedPanel:e}=bc(),{toggleApplication:n}=Bi(),o=W6;let r,s,i,a,l,c;return t[0]!==e||t[1]!==n?(r="h-full pt-4 pb-1 px-1 flex flex-col items-start text-muted-foreground text-md select-none no-print text-sm z-50 dark:bg-background print:hidden hide-on-fullscreen",s=fd.filter(q6).map(d=>u.jsx(Vb,{tooltip:d.tooltip,selected:e===d.type,onClick:()=>n(d.type),children:o(d)},d.type)),t[0]=e,t[1]=n,t[2]=r,t[3]=s):(r=t[2],s=t[3]),t[4]===Symbol.for("react.memo_cache_sentinel")?(i=u.jsx(U6,{children:u.jsx(Vb,{tooltip:"Send feedback!",selected:!1,children:u.jsx(Pp,{className:"h-5 w-5"})})}),a=u.jsx("div",{className:"flex-1"}),l=u.jsx(H6,{}),t[4]=i,t[5]=a,t[6]=l):(i=t[4],a=t[5],l=t[6]),t[7]!==r||t[8]!==s?(c=u.jsxs("div",{className:r,children:[s,i,a,l]}),t[7]=r,t[8]=s,t[9]=c):c=t[9],c},H6=()=>{const t=H.c(7),e=je(YP);let n,o,r;return t[0]!==e?(n=e>0?u.jsxs("span",{children:[e," cell",e>1?"s":""," queued or running"]}):"No cells queued or running",t[0]=e,t[1]=n):n=t[1],t[2]!==e?(o=u.jsx("div",{className:"flex flex-col-reverse gap-px overflow-hidden",children:Array.from({length:e}).map(G6)}),t[2]=e,t[3]=o):o=t[3],t[4]!==n||t[5]!==o?(r=u.jsx(Ne,{content:n,side:"right",delayDuration:200,children:o}),t[4]=n,t[5]=o,t[6]=r):r=t[6],r},Vb=t=>{const e=H.c(17);let n,o,r,s,i;e[0]!==t?({children:n,tooltip:i,selected:s,className:o,...r}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=r,e[4]=s,e[5]=i):(n=e[1],o=e[2],r=e[3],s=e[4],i=e[5]);const a=!s&&"hover:bg-(--sage-3)",l=s&&"bg-(--sage-4)";let c,d,h;return e[6]!==o||e[7]!==a||e[8]!==l?(c=xe("flex items-center p-2 text-sm mx-px shadow-inset font-mono cursor-pointer rounded",a,l,o),e[6]=o,e[7]=a,e[8]=l,e[9]=c):c=e[9],e[10]!==n||e[11]!==r||e[12]!==c?(d=u.jsx("button",{className:c,...r,children:n}),e[10]=n,e[11]=r,e[12]=c,e[13]=d):d=e[13],e[14]!==d||e[15]!==i?(h=u.jsx(Ne,{content:i,side:"right",delayDuration:200,children:d}),e[14]=d,e[15]=i,e[16]=h):h=e[16],h};function W6(t,e){const{Icon:n}=t;return u.jsx(n,{className:xe("h-5 w-5",e)})}function q6(t){return!t.hidden&&t.position==="sidebar"}function G6(t,e){return u.jsx("div",{className:"shrink-0 h-1 w-2 bg-(--grass-6) border border-(--grass-7)"},e.toString())}var Wu="ScrollArea",[Hb,nz]=lC(Wu),[Y6,jn]=Hb(Wu),Wb=O.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:o="hover",dir:r,scrollHideDelay:s=600,...i}=t,[a,l]=O.useState(null),[c,d]=O.useState(null),[h,f]=O.useState(null),[m,g]=O.useState(null),[x,p]=O.useState(null),[b,y]=O.useState(0),[v,w]=O.useState(0),[j,C]=O.useState(!1),[N,S]=O.useState(!1),E=Cs(e,I=>l(I)),T=KP(r);return u.jsx(Y6,{scope:n,type:o,dir:T,scrollHideDelay:s,scrollArea:a,viewport:c,onViewportChange:d,content:h,onContentChange:f,scrollbarX:m,onScrollbarXChange:g,scrollbarXEnabled:j,onScrollbarXEnabledChange:C,scrollbarY:x,onScrollbarYChange:p,scrollbarYEnabled:N,onScrollbarYEnabledChange:S,onCornerWidthChange:y,onCornerHeightChange:w,children:u.jsx(vs.div,{dir:T,...i,ref:E,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":v+"px",...t.style}})})});Wb.displayName=Wu;var qb="ScrollAreaViewport",Gb=O.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:o,nonce:r,...s}=t,i=jn(qb,n),a=O.useRef(null),l=Cs(e,a,i.onViewportChange);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),u.jsx(vs.div,{"data-radix-scroll-area-viewport":"",...s,ref:l,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...t.style},children:u.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})});Gb.displayName=qb;var qn="ScrollAreaScrollbar",qu=O.forwardRef((t,e)=>{const{forceMount:n,...o}=t,r=jn(qn,t.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=r,a=t.orientation==="horizontal";return O.useEffect(()=>(a?s(!0):i(!0),()=>{a?s(!1):i(!1)}),[a,s,i]),r.type==="hover"?u.jsx(K6,{...o,ref:e,forceMount:n}):r.type==="scroll"?u.jsx(X6,{...o,ref:e,forceMount:n}):r.type==="auto"?u.jsx(Yb,{...o,ref:e,forceMount:n}):r.type==="always"?u.jsx(Gu,{...o,ref:e}):null});qu.displayName=qn;var K6=O.forwardRef((t,e)=>{const{forceMount:n,...o}=t,r=jn(qn,t.__scopeScrollArea),[s,i]=O.useState(!1);return O.useEffect(()=>{const a=r.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),i(!0)},d=()=>{l=window.setTimeout(()=>i(!1),r.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",d)}}},[r.scrollArea,r.scrollHideDelay]),u.jsx(Hc,{present:n||s,children:u.jsx(Yb,{"data-state":s?"visible":"hidden",...o,ref:e})})}),X6=O.forwardRef((t,e)=>{const{forceMount:n,...o}=t,r=jn(qn,t.__scopeScrollArea),s=t.orientation==="horizontal",i=yl(()=>l("SCROLL_END"),100),[a,l]=function(c,d){return O.useReducer((h,f)=>d[h][f]??h,c)}("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return O.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),r.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,r.scrollHideDelay,l]),O.useEffect(()=>{const c=r.viewport,d=s?"scrollLeft":"scrollTop";if(c){let h=c[d];const f=()=>{const m=c[d];h!==m&&(l("SCROLL"),i()),h=m};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[r.viewport,s,l,i]),u.jsx(Hc,{present:n||a!=="hidden",children:u.jsx(Gu,{"data-state":a==="hidden"?"hidden":"visible",...o,ref:e,onPointerEnter:On(t.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:On(t.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),Yb=O.forwardRef((t,e)=>{const n=jn(qn,t.__scopeScrollArea),{forceMount:o,...r}=t,[s,i]=O.useState(!1),a=t.orientation==="horizontal",l=yl(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;i(a?c:d)}},10);return Ur(n.viewport,l),Ur(n.content,l),u.jsx(Hc,{present:o||s,children:u.jsx(Gu,{"data-state":s?"visible":"hidden",...r,ref:e})})}),Gu=O.forwardRef((t,e)=>{const{orientation:n="vertical",...o}=t,r=jn(qn,t.__scopeScrollArea),s=O.useRef(null),i=O.useRef(0),[a,l]=O.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=Qb(a.viewport,a.content),d={...o,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:f=>s.current=f,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:f=>i.current=f};function h(f,m){return function(g,x,p,b="ltr"){const y=bl(p),v=y/2,w=x||v,j=y-w,C=p.scrollbar.paddingStart+w,N=p.scrollbar.size-p.scrollbar.paddingEnd-j,S=p.content-p.viewport,E=b==="ltr"?[0,S]:[-1*S,0];return ty([C,N],E)(g)}(f,i.current,a,m)}return n==="horizontal"?u.jsx(J6,{...d,ref:e,onThumbPositionChange:()=>{if(r.viewport&&s.current){const f=ey(r.viewport.scrollLeft,a,r.dir);s.current.style.transform=`translate3d(${f}px, 0, 0)`}},onWheelScroll:f=>{r.viewport&&(r.viewport.scrollLeft=f)},onDragScroll:f=>{r.viewport&&(r.viewport.scrollLeft=h(f,r.dir))}}):n==="vertical"?u.jsx(Z6,{...d,ref:e,onThumbPositionChange:()=>{if(r.viewport&&s.current){const f=ey(r.viewport.scrollTop,a);s.current.style.transform=`translate3d(0, ${f}px, 0)`}},onWheelScroll:f=>{r.viewport&&(r.viewport.scrollTop=f)},onDragScroll:f=>{r.viewport&&(r.viewport.scrollTop=h(f))}}):null}),J6=O.forwardRef((t,e)=>{const{sizes:n,onSizesChange:o,...r}=t,s=jn(qn,t.__scopeScrollArea),[i,a]=O.useState(),l=O.useRef(null),c=Cs(e,l,s.onScrollbarXChange);return O.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),u.jsx(Xb,{"data-orientation":"horizontal",...r,ref:c,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":bl(n)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.x),onDragScroll:d=>t.onDragScroll(d.x),onWheelScroll:(d,h)=>{if(s.viewport){const f=s.viewport.scrollLeft+d.deltaX;t.onWheelScroll(f),ny(f,h)&&d.preventDefault()}},onResize:()=>{l.current&&s.viewport&&i&&o({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:xl(i.paddingLeft),paddingEnd:xl(i.paddingRight)}})}})}),Z6=O.forwardRef((t,e)=>{const{sizes:n,onSizesChange:o,...r}=t,s=jn(qn,t.__scopeScrollArea),[i,a]=O.useState(),l=O.useRef(null),c=Cs(e,l,s.onScrollbarYChange);return O.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),u.jsx(Xb,{"data-orientation":"vertical",...r,ref:c,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":bl(n)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.y),onDragScroll:d=>t.onDragScroll(d.y),onWheelScroll:(d,h)=>{if(s.viewport){const f=s.viewport.scrollTop+d.deltaY;t.onWheelScroll(f),ny(f,h)&&d.preventDefault()}},onResize:()=>{l.current&&s.viewport&&i&&o({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:xl(i.paddingTop),paddingEnd:xl(i.paddingBottom)}})}})}),[Q6,Kb]=Hb(qn),Xb=O.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:o,hasThumb:r,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:d,onResize:h,...f}=t,m=jn(qn,n),[g,x]=O.useState(null),p=Cs(e,E=>x(E)),b=O.useRef(null),y=O.useRef(""),v=m.viewport,w=o.content-o.viewport,j=Xo(d),C=Xo(l),N=yl(h,10);function S(E){if(b.current){const T=E.clientX-b.current.left,I=E.clientY-b.current.top;c({x:T,y:I})}}return O.useEffect(()=>{const E=T=>{const I=T.target;(g==null?void 0:g.contains(I))&&j(T,w)};return document.addEventListener("wheel",E,{passive:!1}),()=>document.removeEventListener("wheel",E,{passive:!1})},[v,g,w,j]),O.useEffect(C,[o,C]),Ur(g,N),Ur(m.content,N),u.jsx(Q6,{scope:n,scrollbar:g,hasThumb:r,onThumbChange:Xo(s),onThumbPointerUp:Xo(i),onThumbPositionChange:C,onThumbPointerDown:Xo(a),children:u.jsx(vs.div,{...f,ref:p,style:{position:"absolute",...f.style},onPointerDown:On(t.onPointerDown,E=>{E.button===0&&(E.target.setPointerCapture(E.pointerId),b.current=g.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),S(E))}),onPointerMove:On(t.onPointerMove,S),onPointerUp:On(t.onPointerUp,E=>{const T=E.target;T.hasPointerCapture(E.pointerId)&&T.releasePointerCapture(E.pointerId),document.body.style.webkitUserSelect=y.current,m.viewport&&(m.viewport.style.scrollBehavior=""),b.current=null})})})}),gl="ScrollAreaThumb",Jb=O.forwardRef((t,e)=>{const{forceMount:n,...o}=t,r=Kb(gl,t.__scopeScrollArea);return u.jsx(Hc,{present:n||r.hasThumb,children:u.jsx(eI,{ref:e,...o})})}),eI=O.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:o,...r}=t,s=jn(gl,n),i=Kb(gl,n),{onThumbPositionChange:a}=i,l=Cs(e,h=>i.onThumbChange(h)),c=O.useRef(void 0),d=yl(()=>{c.current&&(c.current(),c.current=void 0)},100);return O.useEffect(()=>{const h=s.viewport;if(h){const f=()=>{if(d(),!c.current){const m=nI(h,a);c.current=m,a()}};return a(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[s.viewport,d,a]),u.jsx(vs.div,{"data-state":i.hasThumb?"visible":"hidden",...r,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:On(t.onPointerDownCapture,h=>{const f=h.target.getBoundingClientRect(),m=h.clientX-f.left,g=h.clientY-f.top;i.onThumbPointerDown({x:m,y:g})}),onPointerUp:On(t.onPointerUp,i.onThumbPointerUp)})});Jb.displayName=gl;var Yu="ScrollAreaCorner",Zb=O.forwardRef((t,e)=>{const n=jn(Yu,t.__scopeScrollArea),o=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&o?u.jsx(tI,{...t,ref:e}):null});Zb.displayName=Yu;var tI=O.forwardRef((t,e)=>{const{__scopeScrollArea:n,...o}=t,r=jn(Yu,n),[s,i]=O.useState(0),[a,l]=O.useState(0),c=!!(s&&a);return Ur(r.scrollbarX,()=>{var h;const d=((h=r.scrollbarX)==null?void 0:h.offsetHeight)||0;r.onCornerHeightChange(d),l(d)}),Ur(r.scrollbarY,()=>{var h;const d=((h=r.scrollbarY)==null?void 0:h.offsetWidth)||0;r.onCornerWidthChange(d),i(d)}),c?u.jsx(vs.div,{...o,ref:e,style:{width:s,height:a,position:"absolute",right:r.dir==="ltr"?0:void 0,left:r.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function xl(t){return t?parseInt(t,10):0}function Qb(t,e){const n=t/e;return isNaN(n)?0:n}function bl(t){const e=Qb(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=(t.scrollbar.size-n)*e;return Math.max(o,18)}function ey(t,e,n="ltr"){const o=bl(e),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=e.scrollbar.size-r,i=e.content-e.viewport,a=s-o,l=JP(t,n==="ltr"?[0,i]:[-1*i,0]);return ty([0,i],[0,a])(l)}function ty(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const o=(e[1]-e[0])/(t[1]-t[0]);return e[0]+o*(n-t[0])}}function ny(t,e){return t>0&&t<e}var nI=(t,e=()=>{})=>{let n={left:t.scrollLeft,top:t.scrollTop},o=0;return function r(){const s={left:t.scrollLeft,top:t.scrollTop},i=n.left!==s.left,a=n.top!==s.top;(i||a)&&e(),n=s,o=window.requestAnimationFrame(r)}(),()=>window.cancelAnimationFrame(o)};function yl(t,e){const n=Xo(t),o=O.useRef(0);return O.useEffect(()=>()=>window.clearTimeout(o.current),[]),O.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(n,e)},[n,e])}function Ur(t,e){const n=Xo(e);XP(()=>{let o=0;if(t){const r=new ResizeObserver(()=>{cancelAnimationFrame(o),o=window.requestAnimationFrame(n)});return r.observe(t),()=>{window.cancelAnimationFrame(o),r.unobserve(t)}}},[t,n])}var oy=Wb,oI=Gb,rI=Zb;const ry=O.forwardRef((t,e)=>{const n=H.c(15);let o,r,s,i,a,l,c,d;return n[0]!==t?({className:r,children:o,...s}=t,n[0]=t,n[1]=o,n[2]=r,n[3]=s):(o=n[1],r=n[2],s=n[3]),n[4]!==r?(i=xe("relative overflow-hidden",r),n[4]=r,n[5]=i):i=n[5],n[6]!==o?(a=u.jsx(oI,{className:"h-full w-full rounded-[inherit]",children:o}),n[6]=o,n[7]=a):a=n[7],n[8]===Symbol.for("react.memo_cache_sentinel")?(l=u.jsx(sy,{}),c=u.jsx(rI,{}),n[8]=l,n[9]=c):(l=n[8],c=n[9]),n[10]!==s||n[11]!==e||n[12]!==i||n[13]!==a?(d=u.jsxs(oy,{ref:e,className:i,...s,children:[a,l,c]}),n[10]=s,n[11]=e,n[12]=i,n[13]=a,n[14]=d):d=n[14],d});ry.displayName=oy.displayName;const sy=O.forwardRef((t,e)=>{const n=H.c(14);let o,r,s;n[0]!==t?({className:o,orientation:s,...r}=t,n[0]=t,n[1]=o,n[2]=r,n[3]=s):(o=n[1],r=n[2],s=n[3]);const i=s===void 0?"vertical":s,a=i==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-px",l=i==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-px";let c,d,h;return n[4]!==o||n[5]!==a||n[6]!==l?(c=xe("flex touch-none select-none transition-colors",a,l,o),n[4]=o,n[5]=a,n[6]=l,n[7]=c):c=n[7],n[8]===Symbol.for("react.memo_cache_sentinel")?(d=u.jsx(Jb,{className:"relative flex-1 rounded-full bg-border"}),n[8]=d):d=n[8],n[9]!==i||n[10]!==r||n[11]!==e||n[12]!==c?(h=u.jsx(qu,{ref:e,orientation:i,className:c,...r,children:d}),n[9]=i,n[10]=r,n[11]=e,n[12]=c,n[13]=h):h=n[13],h});sy.displayName=qu.displayName;let Ku;Ku=(t,e,n,o,r,s)=>{if(!e)return ut.warn("No active chat"),t;const i=t.chats.findIndex(h=>h.id===e);if(i===-1)return ut.warn("No active chat"),t;const a=t.chats[i],l=a.messages.findIndex(h=>h.id===n),c=[...t.chats],d=Date.now();if(l===-1)c[i]={...a,messages:[...a.messages,{id:n,role:o,content:r,timestamp:d,parts:s}],updatedAt:d};else{const h=[...a.messages];h[l]={...h[l],content:r,parts:s},c[i]={...a,messages:h,updatedAt:d}}return{...t,chats:c}},dn=t=>{const e=H.c(15),{title:n,description:o,icon:r,action:s}=t;let i,a,l,c,d,h;return e[0]!==r?(i=r&&q.cloneElement(r,{className:"text-accent-foreground"}),e[0]=r,e[1]=i):i=e[1],e[2]!==n?(a=u.jsx("span",{className:"mt-1 text-accent-foreground",children:n}),e[2]=n,e[3]=a):a=e[3],e[4]!==i||e[5]!==a?(l=u.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[i,a]}),e[4]=i,e[5]=a,e[6]=l):l=e[6],e[7]!==o?(c=u.jsx("span",{className:"text-muted-foreground text-sm",children:o}),e[7]=o,e[8]=c):c=e[8],e[9]!==s?(d=s&&u.jsx("div",{className:"mt-2",children:s}),e[9]=s,e[10]=d):d=e[10],e[11]!==l||e[12]!==c||e[13]!==d?(h=u.jsxs("div",{className:"mx-6 my-6 flex flex-col gap-2",children:[l,c,d]}),e[11]=l,e[12]=c,e[13]=d,e[14]=h):h=e[14],h};function oz(){}function rz(){}const sI=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,iI=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,aI={};function iy(t,e){return(aI.jsx?iI:sI).test(t)}const lI=/[ \t\n\f\r]/g;function ay(t){return t.replace(lI,"")===""}class ci{constructor(e,n,o){this.normal=n,this.property=e,o&&(this.space=o)}}function ly(t,e){const n={},o={};for(const r of t)Object.assign(n,r.property),Object.assign(o,r.normal);return new ci(n,o,e)}function Xu(t){return t.toLowerCase()}ci.prototype.normal={},ci.prototype.property={},ci.prototype.space=void 0;class on{constructor(e,n){this.attribute=n,this.property=e}}on.prototype.attribute="",on.prototype.booleanish=!1,on.prototype.boolean=!1,on.prototype.commaOrSpaceSeparated=!1,on.prototype.commaSeparated=!1,on.prototype.defined=!1,on.prototype.mustUseProperty=!1,on.prototype.number=!1,on.prototype.overloadedBoolean=!1,on.prototype.property="",on.prototype.spaceSeparated=!1,on.prototype.space=void 0;let cI=0;const Ge=dr(),_t=dr(),Ju=dr(),fe=dr(),ht=dr(),$r=dr(),pn=dr();function dr(){return 2**++cI}const Zu=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ge,booleanish:_t,commaOrSpaceSeparated:pn,commaSeparated:$r,number:fe,overloadedBoolean:Ju,spaceSeparated:ht},Symbol.toStringTag,{value:"Module"})),Qu=Object.keys(Zu);class eh extends on{constructor(e,n,o,r){let s=-1;if(super(e,n),cy(this,"space",r),typeof o=="number")for(;++s<Qu.length;){const i=Qu[s];cy(this,Qu[s],(o&Zu[i])===Zu[i])}}}function cy(t,e,n){n&&(t[e]=n)}function Vr(t){const e={},n={};for(const[o,r]of Object.entries(t.properties)){const s=new eh(o,t.transform(t.attributes||{},o),r,t.space);t.mustUseProperty&&t.mustUseProperty.includes(o)&&(s.mustUseProperty=!0),e[o]=s,n[Xu(o)]=o,n[Xu(s.attribute)]=o}return new ci(e,n,t.space)}eh.prototype.defined=!0;const dy=Vr({properties:{ariaActiveDescendant:null,ariaAtomic:_t,ariaAutoComplete:null,ariaBusy:_t,ariaChecked:_t,ariaColCount:fe,ariaColIndex:fe,ariaColSpan:fe,ariaControls:ht,ariaCurrent:null,ariaDescribedBy:ht,ariaDetails:null,ariaDisabled:_t,ariaDropEffect:ht,ariaErrorMessage:null,ariaExpanded:_t,ariaFlowTo:ht,ariaGrabbed:_t,ariaHasPopup:null,ariaHidden:_t,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ht,ariaLevel:fe,ariaLive:null,ariaModal:_t,ariaMultiLine:_t,ariaMultiSelectable:_t,ariaOrientation:null,ariaOwns:ht,ariaPlaceholder:null,ariaPosInSet:fe,ariaPressed:_t,ariaReadOnly:_t,ariaRelevant:null,ariaRequired:_t,ariaRoleDescription:ht,ariaRowCount:fe,ariaRowIndex:fe,ariaRowSpan:fe,ariaSelected:_t,ariaSetSize:fe,ariaSort:null,ariaValueMax:fe,ariaValueMin:fe,ariaValueNow:fe,ariaValueText:null,role:null},transform:(t,e)=>e==="role"?e:"aria-"+e.slice(4).toLowerCase()});function uy(t,e){return e in t?t[e]:e}function hy(t,e){return uy(t,e.toLowerCase())}const dI=Vr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:$r,acceptCharset:ht,accessKey:ht,action:null,allow:null,allowFullScreen:Ge,allowPaymentRequest:Ge,allowUserMedia:Ge,alt:null,as:null,async:Ge,autoCapitalize:null,autoComplete:ht,autoFocus:Ge,autoPlay:Ge,blocking:ht,capture:null,charSet:null,checked:Ge,cite:null,className:ht,cols:fe,colSpan:null,content:null,contentEditable:_t,controls:Ge,controlsList:ht,coords:fe|$r,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ge,defer:Ge,dir:null,dirName:null,disabled:Ge,download:Ju,draggable:_t,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ge,formTarget:null,headers:ht,height:fe,hidden:Ju,high:fe,href:null,hrefLang:null,htmlFor:ht,httpEquiv:ht,id:null,imageSizes:null,imageSrcSet:null,inert:Ge,inputMode:null,integrity:null,is:null,isMap:Ge,itemId:null,itemProp:ht,itemRef:ht,itemScope:Ge,itemType:ht,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ge,low:fe,manifest:null,max:null,maxLength:fe,media:null,method:null,min:null,minLength:fe,multiple:Ge,muted:Ge,name:null,nonce:null,noModule:Ge,noValidate:Ge,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ge,optimum:fe,pattern:null,ping:ht,placeholder:null,playsInline:Ge,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ge,referrerPolicy:null,rel:ht,required:Ge,reversed:Ge,rows:fe,rowSpan:fe,sandbox:ht,scope:null,scoped:Ge,seamless:Ge,selected:Ge,shadowRootClonable:Ge,shadowRootDelegatesFocus:Ge,shadowRootMode:null,shape:null,size:fe,sizes:null,slot:null,span:fe,spellCheck:_t,src:null,srcDoc:null,srcLang:null,srcSet:null,start:fe,step:null,style:null,tabIndex:fe,target:null,title:null,translate:null,type:null,typeMustMatch:Ge,useMap:null,value:_t,width:fe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ht,axis:null,background:null,bgColor:null,border:fe,borderColor:null,bottomMargin:fe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ge,declare:Ge,event:null,face:null,frame:null,frameBorder:null,hSpace:fe,leftMargin:fe,link:null,longDesc:null,lowSrc:null,marginHeight:fe,marginWidth:fe,noResize:Ge,noHref:Ge,noShade:Ge,noWrap:Ge,object:null,profile:null,prompt:null,rev:null,rightMargin:fe,rules:null,scheme:null,scrolling:_t,standby:null,summary:null,text:null,topMargin:fe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:fe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ge,disableRemotePlayback:Ge,prefix:null,property:null,results:fe,security:null,unselectable:null},space:"html",transform:hy}),uI=Vr({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:pn,accentHeight:fe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:fe,amplitude:fe,arabicForm:null,ascent:fe,attributeName:null,attributeType:null,azimuth:fe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:fe,by:null,calcMode:null,capHeight:fe,className:ht,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:fe,diffuseConstant:fe,direction:null,display:null,dur:null,divisor:fe,dominantBaseline:null,download:Ge,dx:null,dy:null,edgeMode:null,editable:null,elevation:fe,enableBackground:null,end:null,event:null,exponent:fe,externalResourcesRequired:null,fill:null,fillOpacity:fe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:$r,g2:$r,glyphName:$r,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:fe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:fe,horizOriginX:fe,horizOriginY:fe,id:null,ideographic:fe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:fe,k:fe,k1:fe,k2:fe,k3:fe,k4:fe,kernelMatrix:pn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:fe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:fe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:fe,overlineThickness:fe,paintOrder:null,panose1:null,path:null,pathLength:fe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ht,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:fe,pointsAtY:fe,pointsAtZ:fe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:pn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:pn,rev:pn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:pn,requiredFeatures:pn,requiredFonts:pn,requiredFormats:pn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:fe,specularExponent:fe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:fe,strikethroughThickness:fe,string:null,stroke:null,strokeDashArray:pn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:fe,strokeOpacity:fe,strokeWidth:null,style:null,surfaceScale:fe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:pn,tabIndex:fe,tableValues:null,target:null,targetX:fe,targetY:fe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:pn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:fe,underlineThickness:fe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:fe,values:null,vAlphabetic:fe,vMathematical:fe,vectorEffect:null,vHanging:fe,vIdeographic:fe,version:null,vertAdvY:fe,vertOriginX:fe,vertOriginY:fe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:fe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:uy}),fy=Vr({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(t,e)=>"xlink:"+e.slice(5).toLowerCase()}),my=Vr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:hy}),py=Vr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(t,e)=>"xml:"+e.slice(3).toLowerCase()}),hI={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},fI=/[A-Z]/g,gy=/-[a-z]/g,mI=/^data[-\w.:]+$/i;function pI(t){return"-"+t.toLowerCase()}function gI(t){return t.charAt(1).toUpperCase()}const xI=ly([dy,dI,fy,my,py],"html"),th=ly([dy,uI,fy,my,py],"svg");var xy,Hr={},by,vl,yy,di={};function bI(){if(by)return di;by=1,Object.defineProperty(di,"__esModule",{value:!0}),di.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,r=/^-(ms)-/,s=function(a,l){return l.toUpperCase()},i=function(a,l){return"".concat(l,"-")};return di.camelCase=function(a,l){return l===void 0&&(l={}),function(c){return!c||n.test(c)||t.test(c)}(a)?a:(a=a.toLowerCase(),(a=l.reactCompat?a.replace(r,i):a.replace(o,i)).replace(e,s))},di}var yI=function(){if(yy)return vl;yy=1;var t=(vl&&vl.__importDefault||function(o){return o&&o.__esModule?o:{default:o}})(function(){if(xy)return Hr;xy=1;var o=Hr&&Hr.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Hr,"__esModule",{value:!0}),Hr.default=function(s,i){var a=null;if(!s||typeof s!="string")return a;var l=(0,r.default)(s),c=typeof i=="function";return l.forEach(function(d){if(d.type==="declaration"){var h=d.property,f=d.value;c?i(h,f,d):f&&((a=a||{})[h]=f)}}),a};var r=o(ZP());return Hr}()),e=bI();function n(o,r){var s={};return o&&typeof o=="string"&&(0,t.default)(o,function(i,a){i&&a&&(s[(0,e.camelCase)(i,r)]=a)}),s}return n.default=n,vl=n}();const vI=LC(yI),vy=wy("end"),nh=wy("start");function wy(t){return function(e){const n=e&&e.position&&e.position[t]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function ui(t){return t&&typeof t=="object"?"position"in t||"type"in t?ky(t.position):"start"in t||"end"in t?ky(t):"line"in t||"column"in t?oh(t):"":""}function oh(t){return Cy(t&&t.line)+":"+Cy(t&&t.column)}function ky(t){return oh(t&&t.start)+"-"+oh(t&&t.end)}function Cy(t){return t&&typeof t=="number"?t:1}class Vt extends Error{constructor(e,n,o){super(),typeof n=="string"&&(o=n,n=void 0);let r="",s={},i=!1;if(n&&(s="line"in n&&"column"in n||"start"in n&&"end"in n?{place:n}:"type"in n?{ancestors:[n],place:n.position}:{...n}),typeof e=="string"?r=e:!s.cause&&e&&(i=!0,r=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof o=="string"){const l=o.indexOf(":");l===-1?s.ruleId=o:(s.source=o.slice(0,l),s.ruleId=o.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=r,this.line=a?a.line:void 0,this.name=ui(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=i&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual,this.expected,this.note,this.url}}Vt.prototype.file="",Vt.prototype.name="",Vt.prototype.reason="",Vt.prototype.message="",Vt.prototype.stack="",Vt.prototype.column=void 0,Vt.prototype.line=void 0,Vt.prototype.ancestors=void 0,Vt.prototype.cause=void 0,Vt.prototype.fatal=void 0,Vt.prototype.place=void 0,Vt.prototype.ruleId=void 0,Vt.prototype.source=void 0;const rh={}.hasOwnProperty,wI=new Map,kI=/[A-Z]/g,CI=new Set(["table","tbody","thead","tfoot","tr"]),jI=new Set(["td","th"]),jy="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function SI(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let o;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");o=function(i,a){return l;function l(c,d,h,f){const m=Array.isArray(h.children),g=nh(c);return a(d,h,f,m,{columnNumber:g?g.column-1:void 0,fileName:i,lineNumber:g?g.line:void 0},void 0)}}(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");o=function(i,a,l){return c;function c(d,h,f,m){const g=Array.isArray(f.children)?l:a;return m?g(h,f,m):g(h,f)}}(0,e.jsx,e.jsxs)}const r={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:o,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?th:xI,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=Sy(r,t,void 0);return s&&typeof s!="string"?s:r.create(t,r.Fragment,{children:s||void 0},void 0)}function Sy(t,e,n){return e.type==="element"?function(o,r,s){const i=o.schema;let a=i;r.tagName.toLowerCase()==="svg"&&i.space==="html"&&(a=th,o.schema=a),o.ancestors.push(r);const l=Ey(o,r.tagName,!1),c=function(h,f){const m={};let g,x;for(x in f.properties)if(x!=="children"&&rh.call(f.properties,x)){const p=NI(h,x,f.properties[x]);if(p){const[b,y]=p;h.tableCellAlignToStyle&&b==="align"&&typeof y=="string"&&jI.has(f.tagName)?g=y:m[b]=y}}return g&&((m.style||(m.style={}))[h.stylePropertyNameCase==="css"?"text-align":"textAlign"]=g),m}(o,r);let d=ih(o,r);return CI.has(r.tagName)&&(d=d.filter(function(h){return typeof h!="string"||!(typeof(f=h)=="object"?f.type==="text"&&ay(f.value):ay(f));var f})),Ny(o,c,l,r),sh(c,d),o.ancestors.pop(),o.schema=i,o.create(r,l,c,s)}(t,e,n):e.type==="mdxFlowExpression"||e.type==="mdxTextExpression"?function(o,r){if(r.data&&r.data.estree&&o.evaluater){const s=r.data.estree.body[0];return s.type,o.evaluater.evaluateExpression(s.expression)}hi(o,r.position)}(t,e):e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement"?function(o,r,s){const i=o.schema;let a=i;r.name==="svg"&&i.space==="html"&&(a=th,o.schema=a),o.ancestors.push(r);const l=r.name===null?o.Fragment:Ey(o,r.name,!0),c=function(h,f){const m={};for(const g of f.attributes)if(g.type==="mdxJsxExpressionAttribute")if(g.data&&g.data.estree&&h.evaluater){const x=g.data.estree.body[0];x.type;const p=x.expression;p.type;const b=p.properties[0];b.type,Object.assign(m,h.evaluater.evaluateExpression(b.argument))}else hi(h,f.position);else{const x=g.name;let p;if(g.value&&typeof g.value=="object")if(g.value.data&&g.value.data.estree&&h.evaluater){const b=g.value.data.estree.body[0];b.type,p=h.evaluater.evaluateExpression(b.expression)}else hi(h,f.position);else p=g.value===null||g.value;m[x]=p}return m}(o,r),d=ih(o,r);return Ny(o,c,l,r),sh(c,d),o.ancestors.pop(),o.schema=i,o.create(r,l,c,s)}(t,e,n):e.type==="mdxjsEsm"?function(o,r){if(r.data&&r.data.estree&&o.evaluater)return o.evaluater.evaluateProgram(r.data.estree);hi(o,r.position)}(t,e):e.type==="root"?function(o,r,s){const i={};return sh(i,ih(o,r)),o.create(r,o.Fragment,i,s)}(t,e,n):e.type==="text"?function(o,r){return r.value}(0,e):void 0}function Ny(t,e,n,o){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=o)}function sh(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function ih(t,e){const n=[];let o=-1;const r=t.passKeys?new Map:wI;for(;++o<e.children.length;){const s=e.children[o];let i;if(t.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const c=r.get(l)||0;i=l+"-"+c,r.set(l,c+1)}}const a=Sy(t,s,i);a!==void 0&&n.push(a)}return n}function NI(t,e,n){const o=function(r,s){const i=Xu(s);let a=s,l=on;if(i in r.normal)return r.property[r.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&mI.test(s)){if(s.charAt(4)==="-"){const c=s.slice(5).replace(gy,gI);a="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=s.slice(4);if(!gy.test(c)){let d=c.replace(fI,pI);d.charAt(0)!=="-"&&(d="-"+d),s="data"+d}}l=eh}return new l(a,s)}(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=o.commaSeparated?function(r){const s={};return(r[r.length-1]===""?[...r,""]:r).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}(n):n.join(" ").trim()),o.property==="style"){let r=typeof n=="object"?n:function(s,i){try{return vI(i,{reactCompat:!0})}catch(a){if(s.ignoreInvalidStyle)return{};const l=a,c=new Vt("Cannot parse `style` attribute",{ancestors:s.ancestors,cause:l,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw c.file=s.filePath||void 0,c.url=jy+"#cannot-parse-style-attribute",c}}(t,String(n));return t.stylePropertyNameCase==="css"&&(r=function(s){const i={};let a;for(a in s)rh.call(s,a)&&(i[EI(a)]=s[a]);return i}(r)),["style",r]}return[t.elementAttributeNameCase==="react"&&o.space?hI[o.property]||o.property:o.attribute,n]}}function Ey(t,e,n){let o;if(n)if(e.includes(".")){const r=e.split(".");let s,i=-1;for(;++i<r.length;){const a=iy(r[i])?{type:"Identifier",name:r[i]}:{type:"Literal",value:r[i]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(i&&a.type==="Literal"),optional:!1}:a}o=s}else o=iy(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};else o={type:"Literal",value:e};if(o.type==="Literal"){const r=o.value;return rh.call(t.components,r)?t.components[r]:r}if(t.evaluater)return t.evaluater.evaluateExpression(o);hi(t)}function hi(t,e){const n=new Vt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=jy+"#cannot-handle-mdx-estrees-without-createevaluater",n}function EI(t){let e=t.replace(kI,_I);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function _I(t){return"-"+t.toLowerCase()}const ah={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},wl={};function lh(t,e){return _y(t,typeof wl.includeImageAlt!="boolean"||wl.includeImageAlt,typeof wl.includeHtml!="boolean"||wl.includeHtml)}function _y(t,e,n){if(function(o){return!!(o&&typeof o=="object")}(t)){if("value"in t)return t.type!=="html"||n?t.value:"";if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return Iy(t.children,e,n)}return Array.isArray(t)?Iy(t,e,n):""}function Iy(t,e,n){const o=[];let r=-1;for(;++r<t.length;)o[r]=_y(t[r],e,n);return o.join("")}const Ay=document.createElement("i");function ch(t){const e="&"+t+";";Ay.innerHTML=e;const n=Ay.textContent;return(n.charCodeAt(n.length-1)!==59||t==="semi")&&n!==e&&n}function gn(t,e,n,o){const r=t.length;let s,i=0;if(e=e<0?-e>r?0:r+e:e>r?r:e,n=n>0?n:0,o.length<1e4)s=Array.from(o),s.unshift(e,n),t.splice(...s);else for(n&&t.splice(e,n);i<o.length;)s=o.slice(i,i+1e4),s.unshift(e,0),t.splice(...s),i+=1e4,e+=1e4}function Sn(t,e){return t.length>0?(gn(t,t.length,0,e),t):e}const Ty={}.hasOwnProperty;function My(t){const e={};let n=-1;for(;++n<t.length;)II(e,t[n]);return e}function II(t,e){let n;for(n in e){const o=(Ty.call(t,n)?t[n]:void 0)||(t[n]={}),r=e[n];let s;if(r)for(s in r){Ty.call(o,s)||(o[s]=[]);const i=r[s];AI(o[s],Array.isArray(i)?i:i?[i]:[])}}}function AI(t,e){let n=-1;const o=[];for(;++n<e.length;)(e[n].add==="after"?t:o).push(e[n]);gn(t,0,0,o)}function Oy(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||(65535&n)==65534||n>1114111?"\uFFFD":String.fromCodePoint(n)}function Rn(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Zt=Lo(/[A-Za-z]/),Ht=Lo(/[\dA-Za-z]/),TI=Lo(/[#-'*+\--9=?A-Z^-~]/);function kl(t){return t!==null&&(t<32||t===127)}const dh=Lo(/\d/),MI=Lo(/[\dA-Fa-f]/),OI=Lo(/[!-/:-@[-`{-~]/);function Be(t){return t!==null&&t<-2}function ct(t){return t!==null&&(t<0||t===32)}function et(t){return t===-2||t===-1||t===32}const Cl=Lo(new RegExp("\\p{P}|\\p{S}","u")),ur=Lo(/\s/);function Lo(t){return function(e){return e!==null&&e>-1&&t.test(String.fromCharCode(e))}}function Wr(t){const e=[];let n=-1,o=0,r=0;for(;++n<t.length;){const s=t.charCodeAt(n);let i="";if(s===37&&Ht(t.charCodeAt(n+1))&&Ht(t.charCodeAt(n+2)))r=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(i=String.fromCharCode(s));else if(s>55295&&s<57344){const a=t.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(i=String.fromCharCode(s,a),r=1):i="\uFFFD"}else i=String.fromCharCode(s);i&&(e.push(t.slice(o,n),encodeURIComponent(i)),o=n+r+1,i=""),r&&(n+=r,r=0)}return e.join("")+t.slice(o)}function rt(t,e,n,o){const r=o?o-1:Number.POSITIVE_INFINITY;let s=0;return function(a){return et(a)?(t.enter(n),i(a)):e(a)};function i(a){return et(a)&&s++<r?(t.consume(a),i):(t.exit(n),e(a))}}const DI={tokenize:function(t){const e=t.attempt(this.parser.constructs.contentInitial,function(s){return s===null?void t.consume(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),rt(t,e,"linePrefix"))},function(s){return t.enter("paragraph"),o(s)});let n;return e;function o(s){const i=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=i),n=i,r(s)}function r(s){return s===null?(t.exit("chunkText"),t.exit("paragraph"),void t.consume(s)):Be(s)?(t.consume(s),t.exit("chunkText"),o):(t.consume(s),r)}}},RI={tokenize:function(t){const e=this,n=[];let o,r,s,i=0;return a;function a(v){if(i<n.length){const w=n[i];return e.containerState=w[1],t.attempt(w[0].continuation,l,c)(v)}return c(v)}function l(v){if(i++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,o&&y();const w=e.events.length;let j,C=w;for(;C--;)if(e.events[C][0]==="exit"&&e.events[C][1].type==="chunkFlow"){j=e.events[C][1].end;break}b(i);let N=w;for(;N<e.events.length;)e.events[N][1].end={...j},N++;return gn(e.events,C+1,0,e.events.slice(w)),e.events.length=N,c(v)}return a(v)}function c(v){if(i===n.length){if(!o)return f(v);if(o.currentConstruct&&o.currentConstruct.concrete)return g(v);e.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(Dy,d,h)(v)}function d(v){return o&&y(),b(i),f(v)}function h(v){return e.parser.lazy[e.now().line]=i!==n.length,s=e.now().offset,g(v)}function f(v){return e.containerState={},t.attempt(Dy,m,g)(v)}function m(v){return i++,n.push([e.currentConstruct,e.containerState]),f(v)}function g(v){return v===null?(o&&y(),b(0),void t.consume(v)):(o=o||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:r}),x(v))}function x(v){return v===null?(p(t.exit("chunkFlow"),!0),b(0),void t.consume(v)):Be(v)?(t.consume(v),p(t.exit("chunkFlow")),i=0,e.interrupt=void 0,a):(t.consume(v),x)}function p(v,w){const j=e.sliceStream(v);if(w&&j.push(null),v.previous=r,r&&(r.next=v),r=v,o.defineSkip(v.start),o.write(j),e.parser.lazy[v.start.line]){let C=o.events.length;for(;C--;)if(o.events[C][1].start.offset<s&&(!o.events[C][1].end||o.events[C][1].end.offset>s))return;const N=e.events.length;let S,E,T=N;for(;T--;)if(e.events[T][0]==="exit"&&e.events[T][1].type==="chunkFlow"){if(S){E=e.events[T][1].end;break}S=!0}for(b(i),C=N;C<e.events.length;)e.events[C][1].end={...E},C++;gn(e.events,T+1,0,e.events.slice(N)),e.events.length=C}}function b(v){let w=n.length;for(;w-- >v;){const j=n[w];e.containerState=j[1],j[0].exit.call(e,t)}n.length=v}function y(){o.write([null]),r=void 0,o=void 0,e.containerState._closeFlow=void 0}}},Dy={tokenize:function(t,e,n){return rt(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};function qr(t){return t===null||ct(t)||ur(t)?1:Cl(t)?2:void 0}function jl(t,e,n){const o=[];let r=-1;for(;++r<t.length;){const s=t[r].resolveAll;s&&!o.includes(s)&&(e=s(e,n),o.push(s))}return e}const uh={name:"attention",resolveAll:function(t,e){let n,o,r,s,i,a,l,c,d=-1;for(;++d<t.length;)if(t[d][0]==="enter"&&t[d][1].type==="attentionSequence"&&t[d][1]._close){for(n=d;n--;)if(t[n][0]==="exit"&&t[n][1].type==="attentionSequence"&&t[n][1]._open&&e.sliceSerialize(t[n][1]).charCodeAt(0)===e.sliceSerialize(t[d][1]).charCodeAt(0)){if((t[n][1]._close||t[d][1]._open)&&(t[d][1].end.offset-t[d][1].start.offset)%3&&!((t[n][1].end.offset-t[n][1].start.offset+t[d][1].end.offset-t[d][1].start.offset)%3))continue;a=t[n][1].end.offset-t[n][1].start.offset>1&&t[d][1].end.offset-t[d][1].start.offset>1?2:1;const h={...t[n][1].end},f={...t[d][1].start};Ry(h,-a),Ry(f,a),s={type:a>1?"strongSequence":"emphasisSequence",start:h,end:{...t[n][1].end}},i={type:a>1?"strongSequence":"emphasisSequence",start:{...t[d][1].start},end:f},r={type:a>1?"strongText":"emphasisText",start:{...t[n][1].end},end:{...t[d][1].start}},o={type:a>1?"strong":"emphasis",start:{...s.start},end:{...i.end}},t[n][1].end={...s.start},t[d][1].start={...i.end},l=[],t[n][1].end.offset-t[n][1].start.offset&&(l=Sn(l,[["enter",t[n][1],e],["exit",t[n][1],e]])),l=Sn(l,[["enter",o,e],["enter",s,e],["exit",s,e],["enter",r,e]]),l=Sn(l,jl(e.parser.constructs.insideSpan.null,t.slice(n+1,d),e)),l=Sn(l,[["exit",r,e],["enter",i,e],["exit",i,e],["exit",o,e]]),t[d][1].end.offset-t[d][1].start.offset?(c=2,l=Sn(l,[["enter",t[d][1],e],["exit",t[d][1],e]])):c=0,gn(t,n-1,d-n+3,l),d=n+l.length-c-2;break}}for(d=-1;++d<t.length;)t[d][1].type==="attentionSequence"&&(t[d][1].type="data");return t},tokenize:function(t,e){const n=this.parser.constructs.attentionMarkers.null,o=this.previous,r=qr(o);let s;return function(a){return s=a,t.enter("attentionSequence"),i(a)};function i(a){if(a===s)return t.consume(a),i;const l=t.exit("attentionSequence"),c=qr(a),d=!c||c===2&&r||n.includes(a),h=!r||r===2&&c||n.includes(o);return l._open=!!(s===42?d:d&&(r||!h)),l._close=!!(s===42?h:h&&(c||!d)),e(a)}}};function Ry(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const PI={name:"autolink",tokenize:function(t,e,n){let o=0;return function(f){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),r};function r(f){return Zt(f)?(t.consume(f),s):f===64?n(f):l(f)}function s(f){return f===43||f===45||f===46||Ht(f)?(o=1,i(f)):l(f)}function i(f){return f===58?(t.consume(f),o=0,a):(f===43||f===45||f===46||Ht(f))&&o++<32?(t.consume(f),i):(o=0,l(f))}function a(f){return f===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.exit("autolink"),e):f===null||f===32||f===60||kl(f)?n(f):(t.consume(f),a)}function l(f){return f===64?(t.consume(f),c):TI(f)?(t.consume(f),l):n(f)}function c(f){return Ht(f)?d(f):n(f)}function d(f){return f===46?(t.consume(f),o=0,c):f===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.exit("autolink"),e):h(f)}function h(f){if((f===45||Ht(f))&&o++<63){const m=f===45?h:d;return t.consume(f),m}return n(f)}}},fi={partial:!0,tokenize:function(t,e,n){return function(r){return et(r)?rt(t,o,"linePrefix")(r):o(r)};function o(r){return r===null||Be(r)?e(r):n(r)}}},Py={continuation:{tokenize:function(t,e,n){const o=this;return function(s){return et(s)?rt(t,r,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):r(s)};function r(s){return t.attempt(Py,e,n)(s)}}},exit:function(t){t.exit("blockQuote")},name:"blockQuote",tokenize:function(t,e,n){const o=this;return function(s){if(s===62){const i=o.containerState;return i.open||(t.enter("blockQuote",{_container:!0}),i.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(s),t.exit("blockQuoteMarker"),r}return n(s)};function r(s){return et(s)?(t.enter("blockQuotePrefixWhitespace"),t.consume(s),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(s))}}},Ly={name:"characterEscape",tokenize:function(t,e,n){return function(r){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(r),t.exit("escapeMarker"),o};function o(r){return OI(r)?(t.enter("characterEscapeValue"),t.consume(r),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(r)}}},Fy={name:"characterReference",tokenize:function(t,e,n){const o=this;let r,s,i=0;return function(d){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(d),t.exit("characterReferenceMarker"),a};function a(d){return d===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(d),t.exit("characterReferenceMarkerNumeric"),l):(t.enter("characterReferenceValue"),r=31,s=Ht,c(d))}function l(d){return d===88||d===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(d),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),r=6,s=MI,c):(t.enter("characterReferenceValue"),r=7,s=dh,c(d))}function c(d){if(d===59&&i){const h=t.exit("characterReferenceValue");return s!==Ht||ch(o.sliceSerialize(h))?(t.enter("characterReferenceMarker"),t.consume(d),t.exit("characterReferenceMarker"),t.exit("characterReference"),e):n(d)}return s(d)&&i++<r?(t.consume(d),c):n(d)}}},zy={partial:!0,tokenize:function(t,e,n){const o=this;return function(s){return s===null?n(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),r)};function r(s){return o.parser.lazy[o.now().line]?n(s):e(s)}}},By={concrete:!0,name:"codeFenced",tokenize:function(t,e,n){const o=this,r={partial:!0,tokenize:function(v,w,j){let C=0;return N;function N(M){return v.enter("lineEnding"),v.consume(M),v.exit("lineEnding"),S}function S(M){return v.enter("codeFencedFence"),et(M)?rt(v,E,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):E(M)}function E(M){return M===s?(v.enter("codeFencedFenceSequence"),T(M)):j(M)}function T(M){return M===s?(C++,v.consume(M),T):C>=a?(v.exit("codeFencedFenceSequence"),et(M)?rt(v,I,"whitespace")(M):I(M)):j(M)}function I(M){return M===null||Be(M)?(v.exit("codeFencedFence"),w(M)):j(M)}}};let s,i=0,a=0;return function(v){return function(w){const j=o.events[o.events.length-1];return i=j&&j[1].type==="linePrefix"?j[2].sliceSerialize(j[1],!0).length:0,s=w,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),l(w)}(v)};function l(v){return v===s?(a++,t.consume(v),l):a<3?n(v):(t.exit("codeFencedFenceSequence"),et(v)?rt(t,c,"whitespace")(v):c(v))}function c(v){return v===null||Be(v)?(t.exit("codeFencedFence"),o.interrupt?e(v):t.check(zy,m,y)(v)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),d(v))}function d(v){return v===null||Be(v)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),c(v)):et(v)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),rt(t,h,"whitespace")(v)):v===96&&v===s?n(v):(t.consume(v),d)}function h(v){return v===null||Be(v)?c(v):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),f(v))}function f(v){return v===null||Be(v)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),c(v)):v===96&&v===s?n(v):(t.consume(v),f)}function m(v){return t.attempt(r,y,g)(v)}function g(v){return t.enter("lineEnding"),t.consume(v),t.exit("lineEnding"),x}function x(v){return i>0&&et(v)?rt(t,p,"linePrefix",i+1)(v):p(v)}function p(v){return v===null||Be(v)?t.check(zy,m,y)(v):(t.enter("codeFlowValue"),b(v))}function b(v){return v===null||Be(v)?(t.exit("codeFlowValue"),p(v)):(t.consume(v),b)}function y(v){return t.exit("codeFenced"),e(v)}}},hh={name:"codeIndented",tokenize:function(t,e,n){const o=this;return function(l){return t.enter("codeIndented"),rt(t,r,"linePrefix",5)(l)};function r(l){const c=o.events[o.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(l):n(l)}function s(l){return l===null?a(l):Be(l)?t.attempt(LI,s,a)(l):(t.enter("codeFlowValue"),i(l))}function i(l){return l===null||Be(l)?(t.exit("codeFlowValue"),s(l)):(t.consume(l),i)}function a(l){return t.exit("codeIndented"),e(l)}}},LI={partial:!0,tokenize:function(t,e,n){const o=this;return r;function r(i){return o.parser.lazy[o.now().line]?n(i):Be(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),r):rt(t,s,"linePrefix",5)(i)}function s(i){const a=o.events[o.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(i):Be(i)?r(i):n(i)}}},FI={name:"codeText",previous:function(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"},resolve:function(t){let e,n,o=t.length-4,r=3;if(!(t[r][1].type!=="lineEnding"&&t[r][1].type!=="space"||t[o][1].type!=="lineEnding"&&t[o][1].type!=="space")){for(e=r;++e<o;)if(t[e][1].type==="codeTextData"){t[r][1].type="codeTextPadding",t[o][1].type="codeTextPadding",r+=2,o-=2;break}}for(e=r-1,o++;++e<=o;)n===void 0?e!==o&&t[e][1].type!=="lineEnding"&&(n=e):e!==o&&t[e][1].type!=="lineEnding"||(t[n][1].type="codeTextData",e!==n+2&&(t[n][1].end=t[e-1][1].end,t.splice(n+2,e-n-2),o-=e-n-2,e=n+2),n=void 0);return t},tokenize:function(t,e,n){let o,r,s=0;return function(d){return t.enter("codeText"),t.enter("codeTextSequence"),i(d)};function i(d){return d===96?(t.consume(d),s++,i):(t.exit("codeTextSequence"),a(d))}function a(d){return d===null?n(d):d===32?(t.enter("space"),t.consume(d),t.exit("space"),a):d===96?(r=t.enter("codeTextSequence"),o=0,c(d)):Be(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),a):(t.enter("codeTextData"),l(d))}function l(d){return d===null||d===32||d===96||Be(d)?(t.exit("codeTextData"),a(d)):(t.consume(d),l)}function c(d){return d===96?(t.consume(d),o++,c):o===s?(t.exit("codeTextSequence"),t.exit("codeText"),e(d)):(r.type="codeTextData",l(d))}}};class zI{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const o=n??Number.POSITIVE_INFINITY;return o<this.left.length?this.left.slice(e,o):e>this.left.length?this.right.slice(this.right.length-o+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-o+this.left.length).reverse())}splice(e,n,o){const r=n||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return o&&mi(this.left,o),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),mi(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),mi(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);mi(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);mi(this.left,n.reverse())}}}function mi(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function Uy(t){const e={};let n,o,r,s,i,a,l,c=-1;const d=new zI(t);for(;++c<d.length;){for(;c in e;)c=e[c];if(n=d.get(c),c&&n[1].type==="chunkFlow"&&d.get(c-1)[1].type==="listItemPrefix"&&(a=n[1]._tokenizer.events,r=0,r<a.length&&a[r][1].type==="lineEndingBlank"&&(r+=2),r<a.length&&a[r][1].type==="content"))for(;++r<a.length&&a[r][1].type!=="content";)a[r][1].type==="chunkText"&&(a[r][1]._isInFirstContentOfListItem=!0,r++);if(n[0]==="enter")n[1].contentType&&(Object.assign(e,BI(d,c)),c=e[c],l=!0);else if(n[1]._container){for(r=c,o=void 0;r--;)if(s=d.get(r),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(o&&(d.get(o)[1].type="lineEndingBlank"),s[1].type="lineEnding",o=r);else if(s[1].type!=="linePrefix"&&s[1].type!=="listItemIndent")break;o&&(n[1].end={...d.get(o)[1].start},i=d.slice(o,c),i.unshift(n),d.splice(o,c-o+1,i))}}return gn(t,0,Number.POSITIVE_INFINITY,d.slice(0)),!l}function BI(t,e){const n=t.get(e)[1],o=t.get(e)[2];let r=e-1;const s=[];let i=n._tokenizer;i||(i=o.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(i._contentTypeTextTrailing=!0));const a=i.events,l=[],c={};let d,h,f=-1,m=n,g=0,x=0;const p=[x];for(;m;){for(;t.get(++r)[1]!==m;);s.push(r),m._tokenizer||(d=o.sliceStream(m),m.next||d.push(null),h&&i.defineSkip(m.start),m._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(d),m._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),h=m,m=m.next}for(m=n;++f<a.length;)a[f][0]==="exit"&&a[f-1][0]==="enter"&&a[f][1].type===a[f-1][1].type&&a[f][1].start.line!==a[f][1].end.line&&(x=f+1,p.push(x),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(i.events=[],m?(m._tokenizer=void 0,m.previous=void 0):p.pop(),f=p.length;f--;){const b=a.slice(p[f],p[f+1]),y=s.pop();l.push([y,y+b.length-1]),t.splice(y,2,b)}for(l.reverse(),f=-1;++f<l.length;)c[g+l[f][0]]=g+l[f][1],g+=l[f][1]-l[f][0]-1;return c}const UI={resolve:function(t){return Uy(t),t},tokenize:function(t,e){let n;return function(i){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),o(i)};function o(i){return i===null?r(i):Be(i)?t.check($I,s,r)(i):(t.consume(i),o)}function r(i){return t.exit("chunkContent"),t.exit("content"),e(i)}function s(i){return t.consume(i),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}},$I={partial:!0,tokenize:function(t,e,n){const o=this;return function(s){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),rt(t,r,"linePrefix")};function r(s){if(s===null||Be(s))return n(s);const i=o.events[o.events.length-1];return!o.parser.constructs.disable.null.includes("codeIndented")&&i&&i[1].type==="linePrefix"&&i[2].sliceSerialize(i[1],!0).length>=4?e(s):t.interrupt(o.parser.constructs.flow,n,e)(s)}}};function $y(t,e,n,o,r,s,i,a,l){const c=l||Number.POSITIVE_INFINITY;let d=0;return function(p){return p===60?(t.enter(o),t.enter(r),t.enter(s),t.consume(p),t.exit(s),h):p===null||p===32||p===41||kl(p)?n(p):(t.enter(o),t.enter(i),t.enter(a),t.enter("chunkString",{contentType:"string"}),g(p))};function h(p){return p===62?(t.enter(s),t.consume(p),t.exit(s),t.exit(r),t.exit(o),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===62?(t.exit("chunkString"),t.exit(a),h(p)):p===null||p===60||Be(p)?n(p):(t.consume(p),p===92?m:f)}function m(p){return p===60||p===62||p===92?(t.consume(p),f):f(p)}function g(p){return d||p!==null&&p!==41&&!ct(p)?d<c&&p===40?(t.consume(p),d++,g):p===41?(t.consume(p),d--,g):p===null||p===32||p===40||kl(p)?n(p):(t.consume(p),p===92?x:g):(t.exit("chunkString"),t.exit(a),t.exit(i),t.exit(o),e(p))}function x(p){return p===40||p===41||p===92?(t.consume(p),g):g(p)}}function Vy(t,e,n,o,r,s){const i=this;let a,l=0;return function(f){return t.enter(o),t.enter(r),t.consume(f),t.exit(r),t.enter(s),c};function c(f){return l>999||f===null||f===91||f===93&&!a||f===94&&!l&&"_hiddenFootnoteSupport"in i.parser.constructs?n(f):f===93?(t.exit(s),t.enter(r),t.consume(f),t.exit(r),t.exit(o),e):Be(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),c):(t.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===null||f===91||f===93||Be(f)||l++>999?(t.exit("chunkString"),c(f)):(t.consume(f),a||(a=!et(f)),f===92?h:d)}function h(f){return f===91||f===92||f===93?(t.consume(f),l++,d):d(f)}}function Hy(t,e,n,o,r,s){let i;return function(h){return h===34||h===39||h===40?(t.enter(o),t.enter(r),t.consume(h),t.exit(r),i=h===40?41:h,a):n(h)};function a(h){return h===i?(t.enter(r),t.consume(h),t.exit(r),t.exit(o),e):(t.enter(s),l(h))}function l(h){return h===i?(t.exit(s),a(i)):h===null?n(h):Be(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),rt(t,l,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===i||h===null||Be(h)?(t.exit("chunkString"),l(h)):(t.consume(h),h===92?d:c)}function d(h){return h===i||h===92?(t.consume(h),c):c(h)}}function pi(t,e){let n;return function o(r){return Be(r)?(t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),n=!0,o):et(r)?rt(t,o,n?"linePrefix":"lineSuffix")(r):e(r)}}const VI={name:"definition",tokenize:function(t,e,n){const o=this;let r;return function(h){return t.enter("definition"),function(f){return Vy.call(o,t,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}(h)};function s(h){return r=Rn(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),h===58?(t.enter("definitionMarker"),t.consume(h),t.exit("definitionMarker"),i):n(h)}function i(h){return ct(h)?pi(t,a)(h):a(h)}function a(h){return $y(t,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function l(h){return t.attempt(HI,c,c)(h)}function c(h){return et(h)?rt(t,d,"whitespace")(h):d(h)}function d(h){return h===null||Be(h)?(t.exit("definition"),o.parser.defined.push(r),e(h)):n(h)}}},HI={partial:!0,tokenize:function(t,e,n){return function(i){return ct(i)?pi(t,o)(i):n(i)};function o(i){return Hy(t,r,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(i)}function r(i){return et(i)?rt(t,s,"whitespace")(i):s(i)}function s(i){return i===null||Be(i)?e(i):n(i)}}},WI={name:"hardBreakEscape",tokenize:function(t,e,n){return function(r){return t.enter("hardBreakEscape"),t.consume(r),o};function o(r){return Be(r)?(t.exit("hardBreakEscape"),e(r)):n(r)}}},qI={name:"headingAtx",resolve:function(t,e){let n,o,r=t.length-2,s=3;return t[s][1].type==="whitespace"&&(s+=2),r-2>s&&t[r][1].type==="whitespace"&&(r-=2),t[r][1].type==="atxHeadingSequence"&&(s===r-1||r-4>s&&t[r-2][1].type==="whitespace")&&(r-=s+1===r?2:4),r>s&&(n={type:"atxHeadingText",start:t[s][1].start,end:t[r][1].end},o={type:"chunkText",start:t[s][1].start,end:t[r][1].end,contentType:"text"},gn(t,s,r-s+1,[["enter",n,e],["enter",o,e],["exit",o,e],["exit",n,e]])),t},tokenize:function(t,e,n){let o=0;return function(l){return t.enter("atxHeading"),function(c){return t.enter("atxHeadingSequence"),r(c)}(l)};function r(l){return l===35&&o++<6?(t.consume(l),r):l===null||ct(l)?(t.exit("atxHeadingSequence"),s(l)):n(l)}function s(l){return l===35?(t.enter("atxHeadingSequence"),i(l)):l===null||Be(l)?(t.exit("atxHeading"),e(l)):et(l)?rt(t,s,"whitespace")(l):(t.enter("atxHeadingText"),a(l))}function i(l){return l===35?(t.consume(l),i):(t.exit("atxHeadingSequence"),s(l))}function a(l){return l===null||l===35||ct(l)?(t.exit("atxHeadingText"),s(l)):(t.consume(l),a)}}},GI=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Wy=["pre","script","style","textarea"],YI={concrete:!0,name:"htmlFlow",resolveTo:function(t){let e=t.length;for(;e--&&(t[e][0]!=="enter"||t[e][1].type!=="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t},tokenize:function(t,e,n){const o=this;let r,s,i,a,l;return function(A){return function(U){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(U),c}(A)};function c(A){return A===33?(t.consume(A),d):A===47?(t.consume(A),s=!0,m):A===63?(t.consume(A),r=3,o.interrupt?e:_):Zt(A)?(t.consume(A),i=String.fromCharCode(A),g):n(A)}function d(A){return A===45?(t.consume(A),r=2,h):A===91?(t.consume(A),r=5,a=0,f):Zt(A)?(t.consume(A),r=4,o.interrupt?e:_):n(A)}function h(A){return A===45?(t.consume(A),o.interrupt?e:_):n(A)}function f(A){return A==="CDATA[".charCodeAt(a++)?(t.consume(A),a===6?o.interrupt?e:T:f):n(A)}function m(A){return Zt(A)?(t.consume(A),i=String.fromCharCode(A),g):n(A)}function g(A){if(A===null||A===47||A===62||ct(A)){const U=A===47,$=i.toLowerCase();return U||s||!Wy.includes($)?GI.includes(i.toLowerCase())?(r=6,U?(t.consume(A),x):o.interrupt?e(A):T(A)):(r=7,o.interrupt&&!o.parser.lazy[o.now().line]?n(A):s?p(A):b(A)):(r=1,o.interrupt?e(A):T(A))}return A===45||Ht(A)?(t.consume(A),i+=String.fromCharCode(A),g):n(A)}function x(A){return A===62?(t.consume(A),o.interrupt?e:T):n(A)}function p(A){return et(A)?(t.consume(A),p):S(A)}function b(A){return A===47?(t.consume(A),S):A===58||A===95||Zt(A)?(t.consume(A),y):et(A)?(t.consume(A),b):S(A)}function y(A){return A===45||A===46||A===58||A===95||Ht(A)?(t.consume(A),y):v(A)}function v(A){return A===61?(t.consume(A),w):et(A)?(t.consume(A),v):b(A)}function w(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(t.consume(A),l=A,j):et(A)?(t.consume(A),w):C(A)}function j(A){return A===l?(t.consume(A),l=null,N):A===null||Be(A)?n(A):(t.consume(A),j)}function C(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||ct(A)?v(A):(t.consume(A),C)}function N(A){return A===47||A===62||et(A)?b(A):n(A)}function S(A){return A===62?(t.consume(A),E):n(A)}function E(A){return A===null||Be(A)?T(A):et(A)?(t.consume(A),E):n(A)}function T(A){return A===45&&r===2?(t.consume(A),D):A===60&&r===1?(t.consume(A),R):A===62&&r===4?(t.consume(A),k):A===63&&r===3?(t.consume(A),_):A===93&&r===5?(t.consume(A),z):!Be(A)||r!==6&&r!==7?A===null||Be(A)?(t.exit("htmlFlowData"),I(A)):(t.consume(A),T):(t.exit("htmlFlowData"),t.check(KI,B,I)(A))}function I(A){return t.check(XI,M,B)(A)}function M(A){return t.enter("lineEnding"),t.consume(A),t.exit("lineEnding"),F}function F(A){return A===null||Be(A)?I(A):(t.enter("htmlFlowData"),T(A))}function D(A){return A===45?(t.consume(A),_):T(A)}function R(A){return A===47?(t.consume(A),i="",P):T(A)}function P(A){if(A===62){const U=i.toLowerCase();return Wy.includes(U)?(t.consume(A),k):T(A)}return Zt(A)&&i.length<8?(t.consume(A),i+=String.fromCharCode(A),P):T(A)}function z(A){return A===93?(t.consume(A),_):T(A)}function _(A){return A===62?(t.consume(A),k):A===45&&r===2?(t.consume(A),_):T(A)}function k(A){return A===null||Be(A)?(t.exit("htmlFlowData"),B(A)):(t.consume(A),k)}function B(A){return t.exit("htmlFlow"),e(A)}}},KI={partial:!0,tokenize:function(t,e,n){return function(o){return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),t.attempt(fi,e,n)}}},XI={partial:!0,tokenize:function(t,e,n){const o=this;return function(s){return Be(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),r):n(s)};function r(s){return o.parser.lazy[o.now().line]?n(s):e(s)}}},JI={name:"htmlText",tokenize:function(t,e,n){const o=this;let r,s,i;return function(k){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(k),a};function a(k){return k===33?(t.consume(k),l):k===47?(t.consume(k),w):k===63?(t.consume(k),y):Zt(k)?(t.consume(k),N):n(k)}function l(k){return k===45?(t.consume(k),c):k===91?(t.consume(k),s=0,m):Zt(k)?(t.consume(k),b):n(k)}function c(k){return k===45?(t.consume(k),f):n(k)}function d(k){return k===null?n(k):k===45?(t.consume(k),h):Be(k)?(i=d,P(k)):(t.consume(k),d)}function h(k){return k===45?(t.consume(k),f):d(k)}function f(k){return k===62?R(k):k===45?h(k):d(k)}function m(k){return k==="CDATA[".charCodeAt(s++)?(t.consume(k),s===6?g:m):n(k)}function g(k){return k===null?n(k):k===93?(t.consume(k),x):Be(k)?(i=g,P(k)):(t.consume(k),g)}function x(k){return k===93?(t.consume(k),p):g(k)}function p(k){return k===62?R(k):k===93?(t.consume(k),p):g(k)}function b(k){return k===null||k===62?R(k):Be(k)?(i=b,P(k)):(t.consume(k),b)}function y(k){return k===null?n(k):k===63?(t.consume(k),v):Be(k)?(i=y,P(k)):(t.consume(k),y)}function v(k){return k===62?R(k):y(k)}function w(k){return Zt(k)?(t.consume(k),j):n(k)}function j(k){return k===45||Ht(k)?(t.consume(k),j):C(k)}function C(k){return Be(k)?(i=C,P(k)):et(k)?(t.consume(k),C):R(k)}function N(k){return k===45||Ht(k)?(t.consume(k),N):k===47||k===62||ct(k)?S(k):n(k)}function S(k){return k===47?(t.consume(k),R):k===58||k===95||Zt(k)?(t.consume(k),E):Be(k)?(i=S,P(k)):et(k)?(t.consume(k),S):R(k)}function E(k){return k===45||k===46||k===58||k===95||Ht(k)?(t.consume(k),E):T(k)}function T(k){return k===61?(t.consume(k),I):Be(k)?(i=T,P(k)):et(k)?(t.consume(k),T):S(k)}function I(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(t.consume(k),r=k,M):Be(k)?(i=I,P(k)):et(k)?(t.consume(k),I):(t.consume(k),F)}function M(k){return k===r?(t.consume(k),r=void 0,D):k===null?n(k):Be(k)?(i=M,P(k)):(t.consume(k),M)}function F(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||ct(k)?S(k):(t.consume(k),F)}function D(k){return k===47||k===62||ct(k)?S(k):n(k)}function R(k){return k===62?(t.consume(k),t.exit("htmlTextData"),t.exit("htmlText"),e):n(k)}function P(k){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(k),t.exit("lineEnding"),z}function z(k){return et(k)?rt(t,_,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):_(k)}function _(k){return t.enter("htmlTextData"),i(k)}}},fh={name:"labelEnd",resolveAll:function(t){let e=-1;const n=[];for(;++e<t.length;){const o=t[e][1];if(n.push(t[e]),o.type==="labelImage"||o.type==="labelLink"||o.type==="labelEnd"){const r=o.type==="labelImage"?4:2;o.type="data",e+=r}}return t.length!==n.length&&gn(t,0,t.length,n),t},resolveTo:function(t,e){let n,o,r,s,i=t.length,a=0;for(;i--;)if(n=t[i][1],o){if(n.type==="link"||n.type==="labelLink"&&n._inactive)break;t[i][0]==="enter"&&n.type==="labelLink"&&(n._inactive=!0)}else if(r){if(t[i][0]==="enter"&&(n.type==="labelImage"||n.type==="labelLink")&&!n._balanced&&(o=i,n.type!=="labelLink")){a=2;break}}else n.type==="labelEnd"&&(r=i);const l={type:t[o][1].type==="labelLink"?"link":"image",start:{...t[o][1].start},end:{...t[t.length-1][1].end}},c={type:"label",start:{...t[o][1].start},end:{...t[r][1].end}},d={type:"labelText",start:{...t[o+a+2][1].end},end:{...t[r-2][1].start}};return s=[["enter",l,e],["enter",c,e]],s=Sn(s,t.slice(o+1,o+a+3)),s=Sn(s,[["enter",d,e]]),s=Sn(s,jl(e.parser.constructs.insideSpan.null,t.slice(o+a+4,r-3),e)),s=Sn(s,[["exit",d,e],t[r-2],t[r-1],["exit",c,e]]),s=Sn(s,t.slice(r+1)),s=Sn(s,[["exit",l,e]]),gn(t,o,t.length,s),t},tokenize:function(t,e,n){const o=this;let r,s,i=o.events.length;for(;i--;)if((o.events[i][1].type==="labelImage"||o.events[i][1].type==="labelLink")&&!o.events[i][1]._balanced){r=o.events[i][1];break}return function(h){return r?r._inactive?d(h):(s=o.parser.defined.includes(Rn(o.sliceSerialize({start:r.end,end:o.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(h),t.exit("labelMarker"),t.exit("labelEnd"),a):n(h)};function a(h){return h===40?t.attempt(ZI,c,s?c:d)(h):h===91?t.attempt(QI,c,s?l:d)(h):s?c(h):d(h)}function l(h){return t.attempt(e8,c,d)(h)}function c(h){return e(h)}function d(h){return r._balanced=!0,n(h)}}},ZI={tokenize:function(t,e,n){return function(d){return t.enter("resource"),t.enter("resourceMarker"),t.consume(d),t.exit("resourceMarker"),o};function o(d){return ct(d)?pi(t,r)(d):r(d)}function r(d){return d===41?c(d):$y(t,s,i,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return ct(d)?pi(t,a)(d):c(d)}function i(d){return n(d)}function a(d){return d===34||d===39||d===40?Hy(t,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):c(d)}function l(d){return ct(d)?pi(t,c)(d):c(d)}function c(d){return d===41?(t.enter("resourceMarker"),t.consume(d),t.exit("resourceMarker"),t.exit("resource"),e):n(d)}}},QI={tokenize:function(t,e,n){const o=this;return function(i){return Vy.call(o,t,r,s,"reference","referenceMarker","referenceString")(i)};function r(i){return o.parser.defined.includes(Rn(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)))?e(i):n(i)}function s(i){return n(i)}}},e8={tokenize:function(t,e,n){return function(r){return t.enter("reference"),t.enter("referenceMarker"),t.consume(r),t.exit("referenceMarker"),o};function o(r){return r===93?(t.enter("referenceMarker"),t.consume(r),t.exit("referenceMarker"),t.exit("reference"),e):n(r)}}},t8={name:"labelStartImage",resolveAll:fh.resolveAll,tokenize:function(t,e,n){const o=this;return function(i){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(i),t.exit("labelImageMarker"),r};function r(i){return i===91?(t.enter("labelMarker"),t.consume(i),t.exit("labelMarker"),t.exit("labelImage"),s):n(i)}function s(i){return i===94&&"_hiddenFootnoteSupport"in o.parser.constructs?n(i):e(i)}}},n8={name:"labelStartLink",resolveAll:fh.resolveAll,tokenize:function(t,e,n){const o=this;return function(s){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(s),t.exit("labelMarker"),t.exit("labelLink"),r};function r(s){return s===94&&"_hiddenFootnoteSupport"in o.parser.constructs?n(s):e(s)}}},mh={name:"lineEnding",tokenize:function(t,e){return function(n){return t.enter("lineEnding"),t.consume(n),t.exit("lineEnding"),rt(t,e,"linePrefix")}}},Sl={name:"thematicBreak",tokenize:function(t,e,n){let o,r=0;return function(a){return t.enter("thematicBreak"),function(l){return o=l,s(l)}(a)};function s(a){return a===o?(t.enter("thematicBreakSequence"),i(a)):r>=3&&(a===null||Be(a))?(t.exit("thematicBreak"),e(a)):n(a)}function i(a){return a===o?(t.consume(a),r++,i):(t.exit("thematicBreakSequence"),et(a)?rt(t,s,"whitespace")(a):s(a))}}},rn={continuation:{tokenize:function(t,e,n){const o=this;return o.containerState._closeFlow=void 0,t.check(fi,r,s);function r(a){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,rt(t,e,"listItemIndent",o.containerState.size+1)(a)}function s(a){return o.containerState.furtherBlankLines||!et(a)?(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,i(a)):(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,t.attempt(r8,e,i)(a))}function i(a){return o.containerState._closeFlow=!0,o.interrupt=void 0,rt(t,t.attempt(rn,e,n),"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}},exit:function(t){t.exit(this.containerState.type)},name:"list",tokenize:function(t,e,n){const o=this,r=o.events[o.events.length-1];let s=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,i=0;return function(f){const m=o.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!o.containerState.marker||f===o.containerState.marker:dh(f)){if(o.containerState.type||(o.containerState.type=m,t.enter(m,{_container:!0})),m==="listUnordered")return t.enter("listItemPrefix"),f===42||f===45?t.check(Sl,n,l)(f):l(f);if(!o.interrupt||f===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),a(f)}return n(f)};function a(f){return dh(f)&&++i<10?(t.consume(f),a):(!o.interrupt||i<2)&&(o.containerState.marker?f===o.containerState.marker:f===41||f===46)?(t.exit("listItemValue"),l(f)):n(f)}function l(f){return t.enter("listItemMarker"),t.consume(f),t.exit("listItemMarker"),o.containerState.marker=o.containerState.marker||f,t.check(fi,o.interrupt?n:c,t.attempt(o8,h,d))}function c(f){return o.containerState.initialBlankLine=!0,s++,h(f)}function d(f){return et(f)?(t.enter("listItemPrefixWhitespace"),t.consume(f),t.exit("listItemPrefixWhitespace"),h):n(f)}function h(f){return o.containerState.size=s+o.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(f)}}},o8={partial:!0,tokenize:function(t,e,n){const o=this;return rt(t,function(r){const s=o.events[o.events.length-1];return!et(r)&&s&&s[1].type==="listItemPrefixWhitespace"?e(r):n(r)},"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},r8={partial:!0,tokenize:function(t,e,n){const o=this;return rt(t,function(r){const s=o.events[o.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===o.containerState.size?e(r):n(r)},"listItemIndent",o.containerState.size+1)}},qy={name:"setextUnderline",resolveTo:function(t,e){let n,o,r,s=t.length;for(;s--;)if(t[s][0]==="enter"){if(t[s][1].type==="content"){n=s;break}t[s][1].type==="paragraph"&&(o=s)}else t[s][1].type==="content"&&t.splice(s,1),r||t[s][1].type!=="definition"||(r=s);const i={type:"setextHeading",start:{...t[n][1].start},end:{...t[t.length-1][1].end}};return t[o][1].type="setextHeadingText",r?(t.splice(o,0,["enter",i,e]),t.splice(r+1,0,["exit",t[n][1],e]),t[n][1].end={...t[r][1].end}):t[n][1]=i,t.push(["exit",i,e]),t},tokenize:function(t,e,n){const o=this;let r;return function(a){let l,c=o.events.length;for(;c--;)if(o.events[c][1].type!=="lineEnding"&&o.events[c][1].type!=="linePrefix"&&o.events[c][1].type!=="content"){l=o.events[c][1].type==="paragraph";break}return!o.parser.lazy[o.now().line]&&(o.interrupt||l)?(t.enter("setextHeadingLine"),r=a,function(d){return t.enter("setextHeadingLineSequence"),s(d)}(a)):n(a)};function s(a){return a===r?(t.consume(a),s):(t.exit("setextHeadingLineSequence"),et(a)?rt(t,i,"lineSuffix")(a):i(a))}function i(a){return a===null||Be(a)?(t.exit("setextHeadingLine"),e(a)):n(a)}}},s8={tokenize:function(t){const e=this,n=t.attempt(fi,function(r){return r===null?void t.consume(r):(t.enter("lineEndingBlank"),t.consume(r),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n)},t.attempt(this.parser.constructs.flowInitial,o,rt(t,t.attempt(this.parser.constructs.flow,o,t.attempt(UI,o)),"linePrefix")));return n;function o(r){if(r!==null)return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),e.currentConstruct=void 0,n;t.consume(r)}}},i8={resolveAll:Yy()},a8=Gy("string"),l8=Gy("text");function Gy(t){return{resolveAll:Yy(t==="text"?c8:void 0),tokenize:function(e){const n=this,o=this.parser.constructs[t],r=e.attempt(o,s,i);return s;function s(c){return l(c)?r(c):i(c)}function i(c){if(c!==null)return e.enter("data"),e.consume(c),a;e.consume(c)}function a(c){return l(c)?(e.exit("data"),r(c)):(e.consume(c),a)}function l(c){if(c===null)return!0;const d=o[c];let h=-1;if(d)for(;++h<d.length;){const f=d[h];if(!f.previous||f.previous.call(n,n.previous))return!0}return!1}}}}function Yy(t){return function(e,n){let o,r=-1;for(;++r<=e.length;)o===void 0?e[r]&&e[r][1].type==="data"&&(o=r,r++):e[r]&&e[r][1].type==="data"||(r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),r=o+2),o=void 0);return t?t(e,n):e}}function c8(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const o=t[n-1][1],r=e.sliceStream(o);let s,i=r.length,a=-1,l=0;for(;i--;){const c=r[i];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)l++,a--;if(a)break;a=-1}else if(c===-2)s=!0,l++;else if(c!==-1){i++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(l=0),l){const c={type:n===t.length||s||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?a:o.start._bufferIndex+a,_index:o.start._index+i,line:o.end.line,column:o.end.column-l,offset:o.end.offset-l},end:{...o.end}};o.end={...c.start},o.start.offset===o.end.offset?Object.assign(o,c):(t.splice(n,0,["enter",c,e],["exit",c,e]),n+=2)}n++}return t}const d8={42:rn,43:rn,45:rn,48:rn,49:rn,50:rn,51:rn,52:rn,53:rn,54:rn,55:rn,56:rn,57:rn,62:Py},u8={91:VI},h8={[-2]:hh,[-1]:hh,32:hh},f8={35:qI,42:Sl,45:[qy,Sl],60:YI,61:qy,95:Sl,96:By,126:By},m8={38:Fy,92:Ly},p8={[-5]:mh,[-4]:mh,[-3]:mh,33:t8,38:Fy,42:uh,60:[PI,JI],91:n8,92:[WI,Ly],93:fh,95:uh,96:FI},g8={null:[uh,i8]},x8=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:u8,disable:{null:[]},document:d8,flow:f8,flowInitial:h8,insideSpan:g8,string:m8,text:p8},Symbol.toStringTag,{value:"Module"}));function b8(t,e,n){let o={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const r={},s=[];let i=[],a=[];const l={attempt:p(function(v,w){b(v,w.from)}),check:p(x),consume:function(v){Be(v)?(o.line++,o.column=1,o.offset+=v===-3?2:1,y()):v!==-1&&(o.column++,o.offset++),o._bufferIndex<0?o._index++:(o._bufferIndex++,o._bufferIndex===i[o._index].length&&(o._bufferIndex=-1,o._index++)),c.previous=v},enter:function(v,w){const j=w||{};return j.type=v,j.start=f(),c.events.push(["enter",j,c]),a.push(j),j},exit:function(v){const w=a.pop();return w.end=f(),c.events.push(["exit",w,c]),w},interrupt:p(x,{interrupt:!0})},c={code:null,containerState:{},defineSkip:function(v){r[v.line]=v.column,y()},events:[],now:f,parser:t,previous:null,sliceSerialize:function(v,w){return function(j,C){let N=-1;const S=[];let E;for(;++N<j.length;){const T=j[N];let I;if(typeof T=="string")I=T;else switch(T){case-5:I="\r";break;case-4:I=`
|
|
129
129
|
`;break;case-3:I=`\r
|
|
130
130
|
`;break;case-2:I=C?" ":" ";break;case-1:if(!C&&E)continue;I=" ";break;default:I=String.fromCharCode(T)}E=T===-2,S.push(I)}return S.join("")}(h(v),w)},sliceStream:h,write:function(v){return i=Sn(i,v),m(),i[i.length-1]!==null?[]:(b(e,0),c.events=jl(s,c.events,c),c.events)}};let d=e.tokenize.call(c,l);return e.resolveAll&&s.push(e),c;function h(v){return function(w,j){const C=j.start._index,N=j.start._bufferIndex,S=j.end._index,E=j.end._bufferIndex;let T;if(C===S)T=[w[C].slice(N,E)];else{if(T=w.slice(C,S),N>-1){const I=T[0];typeof I=="string"?T[0]=I.slice(N):T.shift()}E>0&&T.push(w[S].slice(0,E))}return T}(i,v)}function f(){const{_bufferIndex:v,_index:w,line:j,column:C,offset:N}=o;return{_bufferIndex:v,_index:w,line:j,column:C,offset:N}}function m(){let v;for(;o._index<i.length;){const w=i[o._index];if(typeof w=="string")for(v=o._index,o._bufferIndex<0&&(o._bufferIndex=0);o._index===v&&o._bufferIndex<w.length;)g(w.charCodeAt(o._bufferIndex));else g(w)}}function g(v){d=d(v)}function x(v,w){w.restore()}function p(v,w){return function(j,C,N){let S,E,T,I;return Array.isArray(j)?M(j):"tokenize"in j?M([j]):function(P){return z;function z(_){const k=_!==null&&P[_],B=_!==null&&P.null;return M([...Array.isArray(k)?k:k?[k]:[],...Array.isArray(B)?B:B?[B]:[]])(_)}}(j);function M(P){return S=P,E=0,P.length===0?N:F(P[E])}function F(P){return function(z){return I=function(){const _=f(),k=c.previous,B=c.currentConstruct,A=c.events.length,U=Array.from(a);return{from:A,restore:$};function $(){o=_,c.previous=k,c.currentConstruct=B,c.events.length=A,a=U,y()}}(),T=P,P.partial||(c.currentConstruct=P),P.name&&c.parser.constructs.disable.null.includes(P.name)?R():P.tokenize.call(w?Object.assign(Object.create(c),w):c,l,D,R)(z)}}function D(P){return v(T,I),C}function R(P){return I.restore(),++E<S.length?F(S[E]):N}}}function b(v,w){v.resolveAll&&!s.includes(v)&&s.push(v),v.resolve&&gn(c.events,w,c.events.length-w,v.resolve(c.events.slice(w),c)),v.resolveTo&&(c.events=v.resolveTo(c.events,c))}function y(){o.line in r&&o.column<2&&(o.column=r[o.line],o.offset+=r[o.line]-1)}}const Ky=/[\0\t\n\r]/g,y8=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function v8(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),r=o===120||o===88;return Oy(n.slice(r?2:1),r?16:10)}return ch(n)||t}const Xy={}.hasOwnProperty;function w8(t,e,n){return typeof e!="string"&&(n=e,e=void 0),function(o){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Te),autolinkProtocol:M,autolinkEmail:M,atxHeading:l(oe),blockQuote:l(ne),characterEscape:M,characterReference:M,codeFenced:l(ie),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:l(ie,c),codeText:l(se,c),codeTextData:M,data:M,codeFlowValue:M,definition:l(ae),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:l(ge),hardBreakEscape:l(ue),hardBreakTrailing:l(ue),htmlFlow:l(de,c),htmlFlowData:M,htmlText:l(de,c),htmlTextData:M,image:l(Se),label:c,link:l(Te),listItem:l(_e),listItemValue:x,listOrdered:l(Fe,g),listUnordered:l(Fe),paragraph:l(ke),reference:K,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:l(oe),strong:l(Ye),thematicBreak:l(Ke)},exit:{atxHeading:h(),atxHeadingSequence:S,autolink:h(),autolinkEmail:re,autolinkProtocol:te,blockQuote:h(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:X,characterReferenceMarkerNumeric:X,characterReferenceValue:V,characterReference:Q,codeFenced:h(v),codeFencedFence:y,codeFencedFenceInfo:p,codeFencedFenceMeta:b,codeFlowValue:F,codeIndented:h(w),codeText:h(_),codeTextData:F,data:F,definition:h(),definitionDestinationString:N,definitionLabelString:j,definitionTitleString:C,emphasis:h(),hardBreakEscape:h(R),hardBreakTrailing:h(R),htmlFlow:h(P),htmlFlowData:F,htmlText:h(z),htmlTextData:F,image:h(B),label:U,labelText:A,lineEnding:D,link:h(k),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:W,resourceDestinationString:$,resourceTitleString:J,resource:G,setextHeading:h(I),setextHeadingLineSequence:T,setextHeadingText:E,strong:h(),thematicBreak:h()}};Jy(r,(o||{}).mdastExtensions||[]);const s={};return i;function i(ee){let ye={type:"root",children:[]};const we={stack:[ye],tokenStack:[],config:r,enter:d,exit:f,buffer:c,resume:m,data:s},Ie=[];let Y=-1;for(;++Y<ee.length;)(ee[Y][1].type==="listOrdered"||ee[Y][1].type==="listUnordered")&&(ee[Y][0]==="enter"?Ie.push(Y):Y=a(ee,Ie.pop(),Y));for(Y=-1;++Y<ee.length;){const me=r[ee[Y][0]];Xy.call(me,ee[Y][1].type)&&me[ee[Y][1].type].call(Object.assign({sliceSerialize:ee[Y][2].sliceSerialize},we),ee[Y][1])}if(we.tokenStack.length>0){const me=we.tokenStack[we.tokenStack.length-1];(me[1]||Zy).call(we,void 0,me[0])}for(ye.position={start:Fo(ee.length>0?ee[0][1].start:{line:1,column:1,offset:0}),end:Fo(ee.length>0?ee[ee.length-2][1].end:{line:1,column:1,offset:0})},Y=-1;++Y<r.transforms.length;)ye=r.transforms[Y](ye)||ye;return ye}function a(ee,ye,we){let Ie,Y,me,pe,he=ye-1,Ce=-1,Re=!1;for(;++he<=we;){const Pe=ee[he];switch(Pe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":Pe[0]==="enter"?Ce++:Ce--,pe=void 0;break;case"lineEndingBlank":Pe[0]==="enter"&&(!Ie||pe||Ce||me||(me=he),pe=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:pe=void 0}if(!Ce&&Pe[0]==="enter"&&Pe[1].type==="listItemPrefix"||Ce===-1&&Pe[0]==="exit"&&(Pe[1].type==="listUnordered"||Pe[1].type==="listOrdered")){if(Ie){let He=he;for(Y=void 0;He--;){const le=ee[He];if(le[1].type==="lineEnding"||le[1].type==="lineEndingBlank"){if(le[0]==="exit")continue;Y&&(ee[Y][1].type="lineEndingBlank",Re=!0),le[1].type="lineEnding",Y=He}else if(le[1].type!=="linePrefix"&&le[1].type!=="blockQuotePrefix"&&le[1].type!=="blockQuotePrefixWhitespace"&&le[1].type!=="blockQuoteMarker"&&le[1].type!=="listItemIndent")break}me&&(!Y||me<Y)&&(Ie._spread=!0),Ie.end=Object.assign({},Y?ee[Y][1].start:Pe[1].end),ee.splice(Y||he,0,["exit",Ie,Pe[2]]),he++,we++}if(Pe[1].type==="listItemPrefix"){const He={type:"listItem",_spread:!1,start:Object.assign({},Pe[1].start),end:void 0};Ie=He,ee.splice(he,0,["enter",He,Pe[2]]),he++,we++,me=void 0,pe=!0}}}return ee[ye][1]._spread=Re,we}function l(ee,ye){return we;function we(Ie){d.call(this,ee(Ie),Ie),ye&&ye.call(this,Ie)}}function c(){this.stack.push({type:"fragment",children:[]})}function d(ee,ye,we){this.stack[this.stack.length-1].children.push(ee),this.stack.push(ee),this.tokenStack.push([ye,we||void 0]),ee.position={start:Fo(ye.start),end:void 0}}function h(ee){return ye;function ye(we){ee&&ee.call(this,we),f.call(this,we)}}function f(ee,ye){const we=this.stack.pop(),Ie=this.tokenStack.pop();if(!Ie)throw new Error("Cannot close `"+ee.type+"` ("+ui({start:ee.start,end:ee.end})+"): it\u2019s not open");Ie[0].type!==ee.type&&(ye?ye.call(this,ee,Ie[0]):(Ie[1]||Zy).call(this,ee,Ie[0])),we.position.end=Fo(ee.end)}function m(){return lh(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function x(ee){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(ee),10),this.data.expectingFirstListItemValue=void 0)}function p(){const ee=this.resume();this.stack[this.stack.length-1].lang=ee}function b(){const ee=this.resume();this.stack[this.stack.length-1].meta=ee}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const ee=this.resume();this.stack[this.stack.length-1].value=ee.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const ee=this.resume();this.stack[this.stack.length-1].value=ee.replace(/(\r?\n|\r)$/g,"")}function j(ee){const ye=this.resume(),we=this.stack[this.stack.length-1];we.label=ye,we.identifier=Rn(this.sliceSerialize(ee)).toLowerCase()}function C(){const ee=this.resume();this.stack[this.stack.length-1].title=ee}function N(){const ee=this.resume();this.stack[this.stack.length-1].url=ee}function S(ee){const ye=this.stack[this.stack.length-1];if(!ye.depth){const we=this.sliceSerialize(ee).length;ye.depth=we}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function T(ee){this.stack[this.stack.length-1].depth=this.sliceSerialize(ee).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function M(ee){const ye=this.stack[this.stack.length-1].children;let we=ye[ye.length-1];we&&we.type==="text"||(we=Ve(),we.position={start:Fo(ee.start),end:void 0},ye.push(we)),this.stack.push(we)}function F(ee){const ye=this.stack.pop();ye.value+=this.sliceSerialize(ee),ye.position.end=Fo(ee.end)}function D(ee){const ye=this.stack[this.stack.length-1];if(this.data.atHardBreak)return ye.children[ye.children.length-1].position.end=Fo(ee.end),void(this.data.atHardBreak=void 0);!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(ye.type)&&(M.call(this,ee),F.call(this,ee))}function R(){this.data.atHardBreak=!0}function P(){const ee=this.resume();this.stack[this.stack.length-1].value=ee}function z(){const ee=this.resume();this.stack[this.stack.length-1].value=ee}function _(){const ee=this.resume();this.stack[this.stack.length-1].value=ee}function k(){const ee=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";ee.type+="Reference",ee.referenceType=ye,delete ee.url,delete ee.title}else delete ee.identifier,delete ee.label;this.data.referenceType=void 0}function B(){const ee=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";ee.type+="Reference",ee.referenceType=ye,delete ee.url,delete ee.title}else delete ee.identifier,delete ee.label;this.data.referenceType=void 0}function A(ee){const ye=this.sliceSerialize(ee),we=this.stack[this.stack.length-2];we.label=function(Ie){return Ie.replace(y8,v8)}(ye),we.identifier=Rn(ye).toLowerCase()}function U(){const ee=this.stack[this.stack.length-1],ye=this.resume(),we=this.stack[this.stack.length-1];if(this.data.inReference=!0,we.type==="link"){const Ie=ee.children;we.children=Ie}else we.alt=ye}function $(){const ee=this.resume();this.stack[this.stack.length-1].url=ee}function J(){const ee=this.resume();this.stack[this.stack.length-1].title=ee}function G(){this.data.inReference=void 0}function K(){this.data.referenceType="collapsed"}function W(ee){const ye=this.resume(),we=this.stack[this.stack.length-1];we.label=ye,we.identifier=Rn(this.sliceSerialize(ee)).toLowerCase(),this.data.referenceType="full"}function X(ee){this.data.characterReferenceType=ee.type}function V(ee){const ye=this.sliceSerialize(ee),we=this.data.characterReferenceType;let Ie;we?(Ie=Oy(ye,we==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ie=ch(ye),this.stack[this.stack.length-1].value+=Ie}function Q(ee){this.stack.pop().position.end=Fo(ee.end)}function te(ee){F.call(this,ee),this.stack[this.stack.length-1].url=this.sliceSerialize(ee)}function re(ee){F.call(this,ee),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(ee)}function ne(){return{type:"blockquote",children:[]}}function ie(){return{type:"code",lang:null,meta:null,value:""}}function se(){return{type:"inlineCode",value:""}}function ae(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ge(){return{type:"emphasis",children:[]}}function oe(){return{type:"heading",depth:0,children:[]}}function ue(){return{type:"break"}}function de(){return{type:"html",value:""}}function Se(){return{type:"image",title:null,url:"",alt:null}}function Te(){return{type:"link",title:null,url:"",children:[]}}function Fe(ee){return{type:"list",ordered:ee.type==="listOrdered",start:null,spread:ee._spread,children:[]}}function _e(ee){return{type:"listItem",spread:ee._spread,checked:null,children:[]}}function ke(){return{type:"paragraph",children:[]}}function Ye(){return{type:"strong",children:[]}}function Ve(){return{type:"text",value:""}}function Ke(){return{type:"thematicBreak"}}}(n)(function(o){for(;!Uy(o););return o}(function(o){const r={constructs:My([x8,...(o||{}).extensions||[]]),content:s(DI),defined:[],document:s(RI),flow:s(s8),lazy:{},string:s(a8),text:s(l8)};return r;function s(i){return function(a){return b8(r,i,a)}}}(n).document().write(function(){let o,r=1,s="",i=!0;return function(a,l,c){const d=[];let h,f,m,g,x;for(a=s+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),m=0,s="",i&&(a.charCodeAt(0)===65279&&m++,i=void 0);m<a.length;){if(Ky.lastIndex=m,h=Ky.exec(a),g=h&&h.index!==void 0?h.index:a.length,x=a.charCodeAt(g),!h){s=a.slice(m);break}if(x===10&&m===g&&o)d.push(-3),o=void 0;else switch(o&&(d.push(-5),o=void 0),m<g&&(d.push(a.slice(m,g)),r+=g-m),x){case 0:d.push(65533),r++;break;case 9:for(f=4*Math.ceil(r/4),d.push(-2);r++<f;)d.push(-1);break;case 10:d.push(-4),r=1;break;default:o=!0,r=1}m=g+1}return c&&(o&&d.push(-5),s&&d.push(s),d.push(null)),d}}()(t,e,!0))))}function Fo(t){return{line:t.line,column:t.column,offset:t.offset}}function Jy(t,e){let n=-1;for(;++n<e.length;){const o=e[n];Array.isArray(o)?Jy(t,o):k8(t,o)}}function k8(t,e){let n;for(n in e)if(Xy.call(e,n))switch(n){case"canContainEols":{const o=e[n];o&&t[n].push(...o);break}case"transforms":{const o=e[n];o&&t[n].push(...o);break}case"enter":case"exit":{const o=e[n];o&&Object.assign(t[n],o);break}}}function Zy(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+ui({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+ui({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+ui({start:e.start,end:e.end})+") is still open")}function C8(t){const e=this;e.parser=function(n){return w8(n,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function Qy(t,e){const n=e.referenceType;let o="]";if(n==="collapsed"?o+="[]":n==="full"&&(o+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+o}];const r=t.all(e),s=r[0];s&&s.type==="text"?s.value="["+s.value:r.unshift({type:"text",value:"["});const i=r[r.length-1];return i&&i.type==="text"?i.value+=o:r.push({type:"text",value:o}),r}function ev(t){const e=t.spread;return e??t.children.length>1}function j8(t){const e=String(t),n=/\r?\n|\r/g;let o=n.exec(e),r=0;const s=[];for(;o;)s.push(tv(e.slice(r,o.index),r>0,!0),o[0]),r=o.index+o[0].length,o=n.exec(e);return s.push(tv(e.slice(r),r>0,!1)),s.join("")}function tv(t,e,n){let o=0,r=t.length;if(e){let s=t.codePointAt(o);for(;s===9||s===32;)o++,s=t.codePointAt(o)}if(n){let s=t.codePointAt(r-1);for(;s===9||s===32;)r--,s=t.codePointAt(r-1)}return r>o?t.slice(o,r):""}const S8={blockquote:function(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)},break:function(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
|
|
@@ -159,5 +159,5 @@ ${T}
|
|
|
159
159
|
`)}),includeOtherCode:Mc("")}),onFinish:I=>{e(M=>Ku(M,M.activeChatId,I.id,"assistant",I.content,I.parts))},onToolCall:async({toolCall:I})=>{try{const M=await f({toolName:I.toolName,arguments:I.args});return M.result||M.error}catch(M){return ut.error("Tool call failed:",M),`Error: ${M instanceof Error?M.message:String(M)}`}},onError:I=>{ut.error("An error occurred:",I)},onResponse:I=>{ut.debug("Received HTTP response from server:",I)}}),N=w==="submitted"||w==="streaming";O.useEffect(()=>{if(!t.activeChatId||m.length===0)return;const I=m[m.length-1];if((I==null?void 0:I.role)!=="user")return;const M=t.chats.find(R=>R.id===t.activeChatId);if(!M)return;const F=new Set(M.messages.map(R=>R.id)),D=m.filter(R=>R.role==="user"&&!F.has(R.id));D.length>0&&e(R=>{let P=R;for(const z of D)P=Ku(P,R.activeChatId,z.id,"user",z.content);return P})},[m,t.activeChatId,t.chats,e]);const S=N&&m.length>0&&(I=>{if(I.length===0)return!1;const M=I.at(-1);if(!M||M.role!=="assistant"||!M.parts)return!1;const F=M.parts;return F.length===0?!1:F[F.length-1].type==="reasoning"})(m);O.useEffect(()=>{requestAnimationFrame(()=>{if(l.current){const I=l.current;I.scrollTop=I.scrollHeight}})},[t.activeChatId]);const E=(I,M)=>{p(F=>F.slice(0,I)),t.activeChatId&&e(F=>({...F,chats:F.chats.map(D=>D.id===t.activeChatId?{...D,messages:D.messages.slice(0,I),updatedAt:Date.now()}:D)})),b({role:"user",content:M})},T=()=>{r.trim()&&(I=>{const M=Date.now(),F={id:VC(),title:I.length>50?`${I.slice(0,50)}...`:I,messages:[],createdAt:M,updatedAt:M};e(R=>({...R,chats:[...R.chats,F],activeChatId:F.id}));const D=VC();b({id:D,role:"user",content:I}),x("")})(r.trim())};return u.jsxs("div",{className:"flex flex-col h-[calc(100%-53px)]",children:[u.jsx(Ym,{children:u.jsx(rT,{onNewChat:()=>{o(null),x(""),s("")},activeChatId:n==null?void 0:n.id,setActiveChat:o,chats:[...t.chats].sort((I,M)=>M.updatedAt-I.updatedAt)})}),u.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)&&u.jsxs("div",{className:"flex flex-col rounded-md border bg-background",children:[u.jsx("div",{className:"px-1",children:u.jsx(Fc,{value:r,placeholder:"Ask anything, @ to include context about tables or dataframes",theme:d,onClose:()=>{var I,M;return(M=(I=i.current)==null?void 0:I.editor)==null?void 0:M.blur()},onChange:s,onSubmit:T},"new-thread-input")}),u.jsx(Fh,{input:r,onSendClick:T,isLoading:N,onStop:C})]}),m.map((I,M)=>u.jsx(Yv,{message:I,index:M,theme:d,onEdit:E,setChatState:e,chatState:t,isStreamingReasoning:S,totalMessages:m.length},M)),N&&u.jsx("div",{className:"flex justify-center py-4",children:u.jsx(zc,{className:"h-4 w-4 animate-spin"})}),v&&u.jsxs("div",{className:"flex items-center justify-center space-x-2 mb-4",children:[u.jsx(kr,{error:v}),u.jsx(ve,{variant:"outline",size:"sm",onClick:()=>{j()},children:"Retry"})]}),u.jsx("div",{ref:c})]}),N&&u.jsx("div",{className:"w-full flex justify-center items-center z-20 border-t",children:u.jsx(ve,{variant:"linkDestructive",size:"sm",onClick:C,children:"Stop"})}),m&&m.length>0&&u.jsx(Kv,{input:g,setInput:x,onSubmit:(I,M)=>{M.trim()&&y(I)},theme:d,inputRef:a,isLoading:N,onStop:C})]})};function aT(){}function lT(){}function cT(t){return u.jsx(mc,{value:t.value,className:"text-xs",subtitle:u.jsx("div",{className:"text-muted-foreground text-xs pl-2",children:t.subtitle}),children:t.label},t.value)}function Qt(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=Qt(t[o]))!==""&&(e+=(e&&" ")+n);else for(let n in t)t[n]&&(e+=(e&&" ")+n);return e}const{useDebugValue:dT}=q,{useSyncExternalStoreWithSelector:uT}=iL,hT=t=>t;function Xv(t,e=hT,n){const o=uT(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return dT(o),o}const Jv=(t,e)=>{const n=aL(t),o=(r,s=e)=>Xv(n,r,s);return Object.assign(o,n),o};function Wt(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 Kn(t,e){if(t=function(s){let i;for(;i=s.sourceEvent;)s=i;return s}(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=t.clientX,o.y=t.clientY,[(o=o.matrixTransform(e.getScreenCTM().inverse())).x,o.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}const fT={passive:!1},yi={capture:!0,passive:!1};function zh(t){t.stopImmediatePropagation()}function Kr(t){t.preventDefault(),t.stopImmediatePropagation()}function Zv(t){var e=t.document.documentElement,n=Vn(t).on("dragstart.drag",Kr,yi);"onselectstart"in e?n.on("selectstart.drag",Kr,yi):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Qv(t,e){var n=t.document.documentElement,o=Vn(t).on("dragstart.drag",null);e&&(o.on("click.drag",Kr,yi),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 Dl=t=>()=>t;function Bh(t,{sourceEvent:e,subject:n,target:o,identifier:r,active:s,x:i,y:a,dx:l,dy:c,dispatch:d}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:d}})}function mT(t){return!t.ctrlKey&&!t.button}function pT(){return this.parentNode}function gT(t,e){return e??{x:t.x,y:t.y}}function xT(){return navigator.maxTouchPoints||"ontouchstart"in this}Bh.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};const Rl=t=>()=>t;function bT(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 Uh(t){t.stopImmediatePropagation()}function vi(t){t.preventDefault(),t.stopImmediatePropagation()}function yT(t){return!(t.ctrlKey&&t.type!=="wheel"||t.button)}function vT(){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 e2(){return this.__zoom||er}function wT(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function kT(){return navigator.maxTouchPoints||"ontouchstart"in this}function CT(t,e,n){var o=t.invertX(e[0][0])-n[0][0],r=t.invertX(e[1][0])-n[1][0],s=t.invertY(e[0][1])-n[0][1],i=t.invertY(e[1][1])-n[1][1];return t.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),i>s?(s+i)/2:Math.min(0,s)||Math.max(0,i))}const Pl=O.createContext(null),jT=Pl.Provider,ST=t=>`Node type "${t}" not found. Using fallback type "default".`,NT=()=>"The React Flow parent container needs a width and a height to render the graph.",ET=()=>"Only child nodes can use a parent extent.",_T=t=>`Marker type "${t}" doesn't exist.`,IT=(t,e)=>`Couldn't create edge for ${t?"target":"source"} handle id: "${t?e.targetHandle:e.sourceHandle}", edge id: ${e.id}.`,AT=()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",TT=t=>`Edge type "${t}" not found. Using fallback type "default".`,MT=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.`,t2="[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001";function dt(t,e){const n=O.useContext(Pl);if(n===null)throw new Error(t2);return Xv(n,t,e)}const zt=()=>{const t=O.useContext(Pl);if(t===null)throw new Error(t2);return O.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe,destroy:t.destroy}),[t])},OT=t=>t.userSelectionActive?"none":"all";function Ll({position:t,children:e,className:n,style:o,...r}){const s=dt(OT),i=`${t}`.split("-");return q.createElement("div",{className:Qt(["react-flow__panel",n,...i]),style:{...o,pointerEvents:s},...r},e)}function DT({proOptions:t,position:e="bottom-right"}){return t!=null&&t.hideAttribution?null:q.createElement(Ll,{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 RT=O.memo(({x:t,y:e,label:n,labelStyle:o={},labelShowBg:r=!0,labelBgStyle:s={},labelBgPadding:i=[2,4],labelBgBorderRadius:a=2,children:l,className:c,...d})=>{const h=O.useRef(null),[f,m]=O.useState({x:0,y:0,width:0,height:0}),g=Qt(["react-flow__edge-textwrapper",c]);return O.useEffect(()=>{if(h.current){const x=h.current.getBBox();m({x:x.x,y:x.y,width:x.width,height:x.height})}},[n]),n!==void 0&&n?q.createElement("g",{transform:`translate(${t-f.width/2} ${e-f.height/2})`,className:g,visibility:f.width?"visible":"hidden",...d},r&&q.createElement("rect",{width:f.width+2*i[0],x:-i[0],y:-i[1],height:f.height+2*i[1],className:"react-flow__edge-textbg",style:s,rx:a,ry:a}),q.createElement("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:h,style:o},n),l):null});const $h=t=>({width:t.offsetWidth,height:t.offsetHeight}),Xr=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),Vh=(t={x:0,y:0},e)=>({x:Xr(t.x,e[0][0],e[1][0]),y:Xr(t.y,e[0][1],e[1][1])}),n2=(t,e,n)=>t<e?Xr(Math.abs(t-e),1,50)/50:t>n?-Xr(Math.abs(t-n),1,50)/50:0,o2=(t,e)=>[20*n2(t.x,35,e.width-35),20*n2(t.y,35,e.height-35)],r2=t=>{var e;return((e=t.getRootNode)==null?void 0:e.call(t))||(window==null?void 0:window.document)},Hh=({x:t,y:e,width:n,height:o})=>({x:t,y:e,x2:t+n,y2:e+o}),s2=t=>({...t.positionAbsolute||{x:0,y:0},width:t.width||0,height:t.height||0}),Wh=(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)},Nn=t=>!isNaN(t)&&isFinite(t),yt=Symbol.for("internals"),i2=["Enter"," ","Escape"];function qh(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 a2=t=>"clientX"in t,zo=(t,e)=>{var s,i;const n=a2(t),o=n?t.clientX:(s=t.touches)==null?void 0:s[0].clientX,r=n?t.clientY:(i=t.touches)==null?void 0:i[0].clientY;return{x:o-((e==null?void 0:e.left)??0),y:r-((e==null?void 0:e.top)??0)}},Fl=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0},wi=({id:t,path:e,labelX:n,labelY:o,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:h,markerStart:f,interactionWidth:m=20})=>q.createElement(q.Fragment,null,q.createElement("path",{id:t,style:d,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&&Nn(n)&&Nn(o)?q.createElement(RT,{x:n,y:o,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null);function ki(t,e,n){return n===void 0?n:o=>{const r=e().edges.find(s=>s.id===t);r&&n(o,{...r})}}function l2({sourceX:t,sourceY:e,targetX:n,targetY:o}){const r=Math.abs(n-t)/2,s=n<t?n+r:n-r,i=Math.abs(o-e)/2;return[s,o<e?o+i:o-i,r,i]}function c2({sourceX:t,sourceY:e,targetX:n,targetY:o,sourceControlX:r,sourceControlY:s,targetControlX:i,targetControlY:a}){const l=.125*t+.375*r+.375*i+.125*n,c=.125*e+.375*s+.375*a+.125*o;return[l,c,Math.abs(l-t),Math.abs(c-e)]}var fr,d2,Bo,Gh,Ci,u2,Uo,ji,Jr,h2,Oe,zl;function f2({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 m2({sourceX:t,sourceY:e,sourcePosition:n=Oe.Bottom,targetX:o,targetY:r,targetPosition:s=Oe.Top}){const[i,a]=f2({pos:n,x1:t,y1:e,x2:o,y2:r}),[l,c]=f2({pos:s,x1:o,y1:r,x2:t,y2:e}),[d,h,f,m]=c2({sourceX:t,sourceY:e,targetX:o,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:l,targetControlY:c});return[`M${t},${e} C${i},${a} ${l},${c} ${o},${r}`,d,h,f,m]}wi.displayName="BaseEdge",(d2=fr||(fr={})).Strict="strict",d2.Loose="loose",(Gh=Bo||(Bo={})).Free="free",Gh.Vertical="vertical",Gh.Horizontal="horizontal",(u2=Ci||(Ci={})).Partial="partial",u2.Full="full",(ji=Uo||(Uo={})).Bezier="default",ji.Straight="straight",ji.Step="step",ji.SmoothStep="smoothstep",ji.SimpleBezier="simplebezier",(h2=Jr||(Jr={})).Arrow="arrow",h2.ArrowClosed="arrowclosed",(zl=Oe||(Oe={})).Left="left",zl.Top="top",zl.Right="right",zl.Bottom="bottom";const Yh=O.memo(({sourceX:t,sourceY:e,targetX:n,targetY:o,sourcePosition:r=Oe.Bottom,targetPosition:s=Oe.Top,label:i,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:f,markerEnd:m,markerStart:g,interactionWidth:x})=>{const[p,b,y]=m2({sourceX:t,sourceY:e,sourcePosition:r,targetX:n,targetY:o,targetPosition:s});return q.createElement(wi,{path:p,labelX:b,labelY:y,label:i,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:f,markerEnd:m,markerStart:g,interactionWidth:x})});Yh.displayName="SimpleBezierEdge";const p2={[Oe.Left]:{x:-1,y:0},[Oe.Right]:{x:1,y:0},[Oe.Top]:{x:0,y:-1},[Oe.Bottom]:{x:0,y:1}},g2=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function PT({source:t,sourcePosition:e=Oe.Bottom,target:n,targetPosition:o=Oe.Top,center:r,offset:s}){const i=p2[e],a=p2[o],l={x:t.x+i.x*s,y:t.y+i.y*s},c={x:n.x+a.x*s,y:n.y+a.y*s},d=(({source:C,sourcePosition:N=Oe.Bottom,target:S})=>N===Oe.Left||N===Oe.Right?C.x<S.x?{x:1,y:0}:{x:-1,y:0}:C.y<S.y?{x:0,y:1}:{x:0,y:-1})({source:l,sourcePosition:e,target:c}),h=d.x!==0?"x":"y",f=d[h];let m,g,x=[];const p={x:0,y:0},b={x:0,y:0},[y,v,w,j]=l2({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(i[h]*a[h]===-1){m=r.x??y,g=r.y??v;const C=[{x:m,y:l.y},{x:m,y:c.y}],N=[{x:l.x,y:g},{x:c.x,y:g}];x=i[h]===f?h==="x"?C:N:h==="x"?N:C}else{const C=[{x:l.x,y:c.y}],N=[{x:c.x,y:l.y}];if(x=h==="x"?i.x===f?N:C:i.y===f?C:N,e===o){const T=Math.abs(t[h]-n[h]);if(T<=s){const I=Math.min(s-1,s-T);i[h]===f?p[h]=(l[h]>t[h]?-1:1)*I:b[h]=(c[h]>n[h]?-1:1)*I}}if(e!==o){const T=h==="x"?"y":"x",I=i[h]===a[T],M=l[T]>c[T],F=l[T]<c[T];(i[h]===1&&(!I&&M||I&&F)||i[h]!==1&&(!I&&F||I&&M))&&(x=h==="x"?C:N)}const S={x:l.x+p.x,y:l.y+p.y},E={x:c.x+b.x,y:c.y+b.y};Math.max(Math.abs(S.x-x[0].x),Math.abs(E.x-x[0].x))>=Math.max(Math.abs(S.y-x[0].y),Math.abs(E.y-x[0].y))?(m=(S.x+E.x)/2,g=x[0].y):(m=x[0].x,g=(S.y+E.y)/2)}return[[t,{x:l.x+p.x,y:l.y+p.y},...x,{x:c.x+b.x,y:c.y+b.y},n],m,g,w,j]}function Kh({sourceX:t,sourceY:e,sourcePosition:n=Oe.Bottom,targetX:o,targetY:r,targetPosition:s=Oe.Top,borderRadius:i=5,centerX:a,centerY:l,offset:c=20}){const[d,h,f,m,g]=PT({source:{x:t,y:e},sourcePosition:n,target:{x:o,y:r},targetPosition:s,center:{x:a,y:l},offset:c});return[d.reduce((x,p,b)=>{let y="";return y=b>0&&b<d.length-1?function(v,w,j,C){const N=Math.min(g2(v,w)/2,g2(w,j)/2,C),{x:S,y:E}=w;if(v.x===S&&S===j.x||v.y===E&&E===j.y)return`L${S} ${E}`;if(v.y===E)return`L ${S+N*(v.x<j.x?-1:1)},${E}Q ${S},${E} ${S},${E+N*(v.y<j.y?1:-1)}`;const T=v.x<j.x?1:-1;return`L ${S},${E+N*(v.y<j.y?-1:1)}Q ${S},${E} ${S+N*T},${E}`}(d[b-1],p,d[b+1],i):`${b===0?"M":"L"}${p.x} ${p.y}`,x+=y},""),h,f,m,g]}const Bl=O.memo(({sourceX:t,sourceY:e,targetX:n,targetY:o,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,sourcePosition:h=Oe.Bottom,targetPosition:f=Oe.Top,markerEnd:m,markerStart:g,pathOptions:x,interactionWidth:p})=>{const[b,y,v]=Kh({sourceX:t,sourceY:e,sourcePosition:h,targetX:n,targetY:o,targetPosition:f,borderRadius:x==null?void 0:x.borderRadius,offset:x==null?void 0:x.offset});return q.createElement(wi,{path:b,labelX:y,labelY:v,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:m,markerStart:g,interactionWidth:p})});Bl.displayName="SmoothStepEdge";const Xh=O.memo(t=>{var e;return q.createElement(Bl,{...t,pathOptions:O.useMemo(()=>{var n;return{borderRadius:0,offset:(n=t.pathOptions)==null?void 0:n.offset}},[(e=t.pathOptions)==null?void 0:e.offset])})});Xh.displayName="StepEdge";const Jh=O.memo(({sourceX:t,sourceY:e,targetX:n,targetY:o,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:h,markerStart:f,interactionWidth:m})=>{const[g,x,p]=function({sourceX:b,sourceY:y,targetX:v,targetY:w}){const[j,C,N,S]=l2({sourceX:b,sourceY:y,targetX:v,targetY:w});return[`M ${b},${y}L ${v},${w}`,j,C,N,S]}({sourceX:t,sourceY:e,targetX:n,targetY:o});return q.createElement(wi,{path:g,labelX:x,labelY:p,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:h,markerStart:f,interactionWidth:m})});function Ul(t,e){return t>=0?.5*t:25*e*Math.sqrt(-t)}function x2({pos:t,x1:e,y1:n,x2:o,y2:r,c:s}){switch(t){case Oe.Left:return[e-Ul(e-o,s),n];case Oe.Right:return[e+Ul(o-e,s),n];case Oe.Top:return[e,n-Ul(n-r,s)];case Oe.Bottom:return[e,n+Ul(r-n,s)]}}function b2({sourceX:t,sourceY:e,sourcePosition:n=Oe.Bottom,targetX:o,targetY:r,targetPosition:s=Oe.Top,curvature:i=.25}){const[a,l]=x2({pos:n,x1:t,y1:e,x2:o,y2:r,c:i}),[c,d]=x2({pos:s,x1:o,y1:r,x2:t,y2:e,c:i}),[h,f,m,g]=c2({sourceX:t,sourceY:e,targetX:o,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:d});return[`M${t},${e} C${a},${l} ${c},${d} ${o},${r}`,h,f,m,g]}Jh.displayName="StraightEdge";const $l=O.memo(({sourceX:t,sourceY:e,targetX:n,targetY:o,sourcePosition:r=Oe.Bottom,targetPosition:s=Oe.Top,label:i,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:f,markerEnd:m,markerStart:g,pathOptions:x,interactionWidth:p})=>{const[b,y,v]=b2({sourceX:t,sourceY:e,sourcePosition:r,targetX:n,targetY:o,targetPosition:s,curvature:x==null?void 0:x.curvature});return q.createElement(wi,{path:b,labelX:y,labelY:v,label:i,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:f,markerEnd:m,markerStart:g,interactionWidth:p})});$l.displayName="BezierEdge";const Zh=O.createContext(null),LT=Zh.Provider;Zh.Consumer;const FT=({source:t,sourceHandle:e,target:n,targetHandle:o})=>`reactflow__edge-${t}${e||""}-${n}${o||""}`,Qh=(t,e)=>t===void 0?"":typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(n=>`${n}=${t[n]}`).join("&")}`,ef=({x:t,y:e},[n,o,r],s,[i,a])=>{const l={x:(t-n)/r,y:(e-o)/r};return s?{x:i*Math.round(l.x/i),y:a*Math.round(l.y/a)}:l},y2=({x:t,y:e},[n,o,r])=>({x:t*r+n,y:e*r+o}),Zr=(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}},tf=(t,e=[0,0])=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const n=t.reduce((o,r)=>{const{x:s,y:i}=Zr(r,e).positionAbsolute;return a=o,l=Hh({x:s,y:i,width:r.width||0,height:r.height||0}),{x:Math.min(a.x,l.x),y:Math.min(a.y,l.y),x2:Math.max(a.x2,l.x2),y2:Math.max(a.y2,l.y2)};var a,l},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return(({x:o,y:r,x2:s,y2:i})=>({x:o,y:r,width:s-o,height:i-r}))(n)},v2=(t,e,[n,o,r]=[0,0,1],s=!1,i=!1,a=[0,0])=>{const l={x:(e.x-n)/r,y:(e.y-o)/r,width:e.width/r,height:e.height/r},c=[];return t.forEach(d=>{const{width:h,height:f,selectable:m=!0,hidden:g=!1}=d;if(i&&!m||g)return!1;const{positionAbsolute:x}=Zr(d,a),p={x:x.x,y:x.y,width:h||0,height:f||0},b=Wh(l,p);(h===void 0||f===void 0||h===null||f===null||s&&b>0||b>=(h||0)*(f||0)||d.dragging)&&c.push(d)}),c},w2=(t,e)=>{const n=t.map(o=>o.id);return e.filter(o=>n.includes(o.source)||n.includes(o.target))},k2=(t,e,n,o,r,s=.1)=>{const i=e/(t.width*(1+s)),a=n/(t.height*(1+s)),l=Math.min(i,a),c=Xr(l,o,r);return{x:e/2-(t.x+t.width/2)*c,y:n/2-(t.y+t.height/2)*c,zoom:c}},mr=(t,e=0)=>t.transition().duration(e);function C2(t,e,n,o){return(e[n]||[]).reduce((r,s)=>{var i,a;return`${t.id}-${s.id}-${n}`!==o&&r.push({id:s.id||null,type:n,nodeId:t.id,x:(((i=t.positionAbsolute)==null?void 0:i.x)??0)+s.x+s.width/2,y:(((a=t.positionAbsolute)==null?void 0:a.y)??0)+s.y+s.height/2}),r},[])}const zT={source:null,target:null,sourceHandle:null,targetHandle:null},j2=()=>({handleDomNode:null,isValid:!1,connection:zT,endHandle:null});function S2(t,e,n,o,r,s,i){const a=r==="target",l=i.querySelector(`.react-flow__handle[data-id="${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`),c={...j2(),handleDomNode:l};if(l){const d=nf(void 0,l),h=l.getAttribute("data-nodeid"),f=l.getAttribute("data-handleid"),m=l.classList.contains("connectable"),g=l.classList.contains("connectableend"),x={source:a?h:n,sourceHandle:a?f:o,target:a?n:h,targetHandle:a?o:f};c.connection=x,m&&g&&(e===fr.Strict?a&&d==="source"||!a&&d==="target":h!==n||f!==o)&&(c.endHandle={nodeId:h,handleId:f,type:d},c.isValid=s(x))}return c}function nf(t,e){return t||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function of(t){t==null||t.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function BT(t,e){let n=null;return e?n="valid":t&&!e&&(n="invalid"),n}function N2({event:t,handleId:e,nodeId:n,onConnect:o,isTarget:r,getState:s,setState:i,isValidConnection:a,edgeUpdaterType:l,onReconnectEnd:c}){const d=r2(t.target),{connectionMode:h,domNode:f,autoPanOnConnect:m,connectionRadius:g,onConnectStart:x,panBy:p,getNodes:b,cancelConnection:y}=s();let v,w=0;const{x:j,y:C}=zo(t),N=d==null?void 0:d.elementFromPoint(j,C),S=nf(l,N),E=f==null?void 0:f.getBoundingClientRect();if(!E||!S)return;let T,I=zo(t,E),M=!1,F=null,D=!1,R=null;const P=function({nodes:B,nodeId:A,handleId:U,handleType:$}){return B.reduce((J,G)=>{if(G[yt]){const{handleBounds:K}=G[yt];let W=[],X=[];K&&(W=C2(G,K,"source",`${A}-${U}-${$}`),X=C2(G,K,"target",`${A}-${U}-${$}`)),J.push(...W,...X)}return J},[])}({nodes:b(),nodeId:n,handleId:e,handleType:S}),z=()=>{if(!m)return;const[B,A]=o2(I,E);p({x:B,y:A}),w=requestAnimationFrame(z)};function _(B){const{transform:A}=s();I=zo(B,E);const{handle:U,validHandleResult:$}=function(J,G,K,W,X,V){const{x:Q,y:te}=zo(J),re=G.elementsFromPoint(Q,te).find(ge=>ge.classList.contains("react-flow__handle"));if(re){const ge=re.getAttribute("data-nodeid");if(ge){const oe=nf(void 0,re),ue=re.getAttribute("data-handleid"),de=V({nodeId:ge,id:ue,type:oe});if(de){const Se=X.find(Te=>Te.nodeId===ge&&Te.type===oe&&Te.id===ue);return{handle:{id:ue,type:oe,nodeId:ge,x:(Se==null?void 0:Se.x)||K.x,y:(Se==null?void 0:Se.y)||K.y},validHandleResult:de}}}}let ne=[],ie=1/0;if(X.forEach(ge=>{const oe=Math.sqrt((ge.x-K.x)**2+(ge.y-K.y)**2);if(oe<=W){const ue=V(ge);oe<=ie&&(oe<ie?ne=[{handle:ge,validHandleResult:ue}]:oe===ie&&ne.push({handle:ge,validHandleResult:ue}),ie=oe)}}),!ne.length)return{handle:null,validHandleResult:j2()};if(ne.length===1)return ne[0];const se=ne.some(({validHandleResult:ge})=>ge.isValid),ae=ne.some(({handle:ge})=>ge.type==="target");return ne.find(({handle:ge,validHandleResult:oe})=>ae?ge.type==="target":!se||oe.isValid)||ne[0]}(B,d,ef(I,A,!1,[1,1]),g,P,J=>S2(J,h,n,e,r?"target":"source",a,d));if(v=U,M||(z(),M=!0),R=$.handleDomNode,F=$.connection,D=$.isValid,i({connectionPosition:v&&D?y2({x:v.x,y:v.y},A):I,connectionStatus:BT(!!v,D),connectionEndHandle:$.endHandle}),!v&&!D&&!R)return of(T);F.source!==F.target&&R&&(of(T),T=R,R.classList.add("connecting","react-flow__handle-connecting"),R.classList.toggle("valid",D),R.classList.toggle("react-flow__handle-valid",D))}function k(B){var A,U;(v||R)&&F&&D&&(o==null||o(F)),(U=(A=s()).onConnectEnd)==null||U.call(A,B),l&&(c==null||c(B)),of(T),y(),cancelAnimationFrame(w),M=!1,D=!1,F=null,R=null,d.removeEventListener("mousemove",_),d.removeEventListener("mouseup",k),d.removeEventListener("touchmove",_),d.removeEventListener("touchend",k)}i({connectionPosition:I,connectionStatus:null,connectionNodeId:n,connectionHandleId:e,connectionHandleType:S,connectionStartHandle:{nodeId:n,handleId:e,type:S},connectionEndHandle:null}),x==null||x(t,{nodeId:n,handleId:e,handleType:S}),d.addEventListener("mousemove",_),d.addEventListener("mouseup",k),d.addEventListener("touchmove",_),d.addEventListener("touchend",k)}const E2=()=>!0,UT=t=>({connectionStartHandle:t.connectionStartHandle,connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName}),_2=O.forwardRef(({type:t="source",position:e=Oe.Top,isValidConnection:n,isConnectable:o=!0,isConnectableStart:r=!0,isConnectableEnd:s=!0,id:i,onConnect:a,children:l,className:c,onMouseDown:d,onTouchStart:h,...f},m)=>{var S,E;const g=i||null,x=t==="target",p=zt(),b=O.useContext(Zh),{connectOnClick:y,noPanClassName:v}=dt(UT,Wt),{connecting:w,clickConnecting:j}=dt(((T,I,M)=>F=>{const{connectionStartHandle:D,connectionEndHandle:R,connectionClickStartHandle:P}=F;return{connecting:(D==null?void 0:D.nodeId)===T&&(D==null?void 0:D.handleId)===I&&(D==null?void 0:D.type)===M||(R==null?void 0:R.nodeId)===T&&(R==null?void 0:R.handleId)===I&&(R==null?void 0:R.type)===M,clickConnecting:(P==null?void 0:P.nodeId)===T&&(P==null?void 0:P.handleId)===I&&(P==null?void 0:P.type)===M}})(b,g,t),Wt);b||((E=(S=p.getState()).onError)==null||E.call(S,"010",AT()));const C=T=>{const{defaultEdgeOptions:I,onConnect:M,hasDefaultEdges:F}=p.getState(),D={...I,...T};if(F){const{edges:R,setEdges:P}=p.getState();P(((z,_)=>{if(!z.source||!z.target)return _;let k;return k=(B=>"id"in B&&"source"in B&&"target"in B)(z)?{...z}:{...z,id:FT(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,_)?_:_.concat(k)})(D,R))}M==null||M(D),a==null||a(D)},N=T=>{if(!b)return;const I=a2(T);r&&(I&&T.button===0||!I)&&N2({event:T,handleId:g,nodeId:b,onConnect:C,isTarget:x,getState:p.getState,setState:p.setState,isValidConnection:n||p.getState().isValidConnection||E2}),I?d==null||d(T):h==null||h(T)};return q.createElement("div",{"data-handleid":g,"data-nodeid":b,"data-handlepos":e,"data-id":`${b}-${g}-${t}`,className:Qt(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",v,c,{source:!x,target:x,connectable:o,connectablestart:r,connectableend:s,connecting:j,connectionindicator:o&&(r&&!w||s&&w)}]),onMouseDown:N,onTouchStart:N,onClick:y?T=>{const{onClickConnectStart:I,onClickConnectEnd:M,connectionClickStartHandle:F,connectionMode:D,isValidConnection:R}=p.getState();if(!b||!F&&!r)return;if(!F)return I==null||I(T,{nodeId:b,handleId:g,handleType:t}),void p.setState({connectionClickStartHandle:{nodeId:b,type:t,handleId:g}});const P=r2(T.target),z=n||R||E2,{connection:_,isValid:k}=S2({nodeId:b,id:g,type:t},D,F.nodeId,F.handleId||null,F.type,z,P);k&&C(_),M==null||M(T),p.setState({connectionClickStartHandle:null})}:void 0,ref:m,...f},l)});_2.displayName="Handle";var $o=O.memo(_2);const I2=({data:t,isConnectable:e,targetPosition:n=Oe.Top,sourcePosition:o=Oe.Bottom})=>q.createElement(q.Fragment,null,q.createElement($o,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label,q.createElement($o,{type:"source",position:o,isConnectable:e}));I2.displayName="DefaultNode";var rf=O.memo(I2);const A2=({data:t,isConnectable:e,sourcePosition:n=Oe.Bottom})=>q.createElement(q.Fragment,null,t==null?void 0:t.label,q.createElement($o,{type:"source",position:n,isConnectable:e}));A2.displayName="InputNode";var T2=O.memo(A2);const M2=({data:t,isConnectable:e,targetPosition:n=Oe.Top})=>q.createElement(q.Fragment,null,q.createElement($o,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label);M2.displayName="OutputNode";var O2=O.memo(M2);const sf=()=>null;sf.displayName="GroupNode";const $T=t=>({selectedNodes:t.getNodes().filter(e=>e.selected),selectedEdges:t.edges.filter(e=>e.selected).map(e=>({...e}))}),Vl=t=>t.id;function VT(t,e){return Wt(t.selectedNodes.map(Vl),e.selectedNodes.map(Vl))&&Wt(t.selectedEdges.map(Vl),e.selectedEdges.map(Vl))}const D2=O.memo(({onSelectionChange:t})=>{const e=zt(),{selectedNodes:n,selectedEdges:o}=dt($T,VT);return O.useEffect(()=>{const r={nodes:n,edges:o};t==null||t(r),e.getState().onSelectionChange.forEach(s=>s(r))},[n,o,t]),null});D2.displayName="SelectionListener";const HT=t=>!!t.onSelectionChange;function WT({onSelectionChange:t}){const e=dt(HT);return t||e?q.createElement(D2,{onSelectionChange:t}):null}const qT=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 Qr(t,e){O.useEffect(()=>{t!==void 0&&e(t)},[t])}function Ze(t,e,n){O.useEffect(()=>{e!==void 0&&n({[t]:e})},[e])}const GT=({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,onConnect:r,onConnectStart:s,onConnectEnd:i,onClickConnectStart:a,onClickConnectEnd:l,nodesDraggable:c,nodesConnectable:d,nodesFocusable:h,edgesFocusable:f,edgesUpdatable:m,elevateNodesOnSelect:g,minZoom:x,maxZoom:p,nodeExtent:b,onNodesChange:y,onEdgesChange:v,elementsSelectable:w,connectionMode:j,snapGrid:C,snapToGrid:N,translateExtent:S,connectOnClick:E,defaultEdgeOptions:T,fitView:I,fitViewOptions:M,onNodesDelete:F,onEdgesDelete:D,onNodeDrag:R,onNodeDragStart:P,onNodeDragStop:z,onSelectionDrag:_,onSelectionDragStart:k,onSelectionDragStop:B,noPanClassName:A,nodeOrigin:U,rfId:$,autoPanOnConnect:J,autoPanOnNodeDrag:G,onError:K,connectionRadius:W,isValidConnection:X,nodeDragThreshold:V})=>{const{setNodes:Q,setEdges:te,setDefaultNodesAndEdges:re,setMinZoom:ne,setMaxZoom:ie,setTranslateExtent:se,setNodeExtent:ae,reset:ge}=dt(qT,Wt),oe=zt();return O.useEffect(()=>{const ue=o==null?void 0:o.map(de=>({...de,...T}));return re(n,ue),()=>{ge()}},[]),Ze("defaultEdgeOptions",T,oe.setState),Ze("connectionMode",j,oe.setState),Ze("onConnect",r,oe.setState),Ze("onConnectStart",s,oe.setState),Ze("onConnectEnd",i,oe.setState),Ze("onClickConnectStart",a,oe.setState),Ze("onClickConnectEnd",l,oe.setState),Ze("nodesDraggable",c,oe.setState),Ze("nodesConnectable",d,oe.setState),Ze("nodesFocusable",h,oe.setState),Ze("edgesFocusable",f,oe.setState),Ze("edgesUpdatable",m,oe.setState),Ze("elementsSelectable",w,oe.setState),Ze("elevateNodesOnSelect",g,oe.setState),Ze("snapToGrid",N,oe.setState),Ze("snapGrid",C,oe.setState),Ze("onNodesChange",y,oe.setState),Ze("onEdgesChange",v,oe.setState),Ze("connectOnClick",E,oe.setState),Ze("fitViewOnInit",I,oe.setState),Ze("fitViewOnInitOptions",M,oe.setState),Ze("onNodesDelete",F,oe.setState),Ze("onEdgesDelete",D,oe.setState),Ze("onNodeDrag",R,oe.setState),Ze("onNodeDragStart",P,oe.setState),Ze("onNodeDragStop",z,oe.setState),Ze("onSelectionDrag",_,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",J,oe.setState),Ze("autoPanOnNodeDrag",G,oe.setState),Ze("onError",K,oe.setState),Ze("connectionRadius",W,oe.setState),Ze("isValidConnection",X,oe.setState),Ze("nodeDragThreshold",V,oe.setState),Qr(t,Q),Qr(e,te),Qr(x,ne),Qr(p,ie),Qr(S,se),Qr(b,ae),null},R2={display:"none"},YT={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},P2="react-flow__node-desc",L2="react-flow__edge-desc",KT=t=>t.ariaLiveMessage;function XT({rfId:t}){const e=dt(KT);return q.createElement("div",{id:`react-flow__aria-live-${t}`,"aria-live":"assertive","aria-atomic":"true",style:YT},e)}function JT({rfId:t,disableKeyboardA11y:e}){return q.createElement(q.Fragment,null,q.createElement("div",{id:`${P2}-${t}`,style:R2},"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:`${L2}-${t}`,style:R2},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!e&&q.createElement(XT,{rfId:t}))}var Si=(t=null,e={actInsideInputWithModifier:!0})=>{const[n,o]=O.useState(!1),r=O.useRef(!1),s=O.useRef(new Set([])),[i,a]=O.useMemo(()=>{if(t!==null){const l=(Array.isArray(t)?t:[t]).filter(d=>typeof d=="string").map(d=>d.split("+")),c=l.reduce((d,h)=>d.concat(...h),[]);return[l,c]}return[[],[]]},[t]);return O.useEffect(()=>{const l=typeof document<"u"?document:null,c=(e==null?void 0:e.target)||l;if(t!==null){const d=m=>{if(r.current=m.ctrlKey||m.metaKey||m.shiftKey,(!r.current||r.current&&!e.actInsideInputWithModifier)&&qh(m))return!1;const g=z2(m.code,a);s.current.add(m[g]),F2(i,s.current,!1)&&(m.preventDefault(),o(!0))},h=m=>{if((!r.current||r.current&&!e.actInsideInputWithModifier)&&qh(m))return!1;const g=z2(m.code,a);F2(i,s.current,!0)?(o(!1),s.current.clear()):s.current.delete(m[g]),m.key==="Meta"&&s.current.clear(),r.current=!1},f=()=>{s.current.clear(),o(!1)};return c==null||c.addEventListener("keydown",d),c==null||c.addEventListener("keyup",h),window.addEventListener("blur",f),()=>{c==null||c.removeEventListener("keydown",d),c==null||c.removeEventListener("keyup",h),window.removeEventListener("blur",f)}}},[t,o]),n};function F2(t,e,n){return t.filter(o=>n||o.length===e.size).some(o=>o.every(r=>e.has(r)))}function z2(t,e){return e.includes(t)?"code":"key"}function B2(t,e,n,o){var a,l;const r=t.parentNode||t.parentId;if(!r)return n;const s=e.get(r),i=Zr(s,o);return B2(s,e,{x:(n.x??0)+i.x,y:(n.y??0)+i.y,z:(((a=s[yt])==null?void 0:a.z)??0)>(n.z??0)?((l=s[yt])==null?void 0:l.z)??0:n.z??0},o)}function U2(t,e,n){t.forEach(o=>{var s;const r=o.parentNode||o.parentId;if(r&&!t.has(r))throw new Error(`Parent node ${r} not found`);if(r||n!=null&&n[o.id]){const{x:i,y:a,z:l}=B2(o,t,{...o.position,z:((s=o[yt])==null?void 0:s.z)??0},e);o.positionAbsolute={x:i,y:a},o[yt].z=l,n!=null&&n[o.id]&&(o[yt].isParent=!0)}})}function af(t,e,n,o){const r=new Map,s={},i=o?1e3:0;return t.forEach(a=>{var m;const l=(Nn(a.zIndex)?a.zIndex:0)+(a.selected?i:0),c=e.get(a.id),d={...a,positionAbsolute:{x:a.position.x,y:a.position.y}},h=a.parentNode||a.parentId;h&&(s[h]=!0);const f=(c==null?void 0:c.type)&&(c==null?void 0:c.type)!==a.type;Object.defineProperty(d,yt,{enumerable:!1,value:{handleBounds:f||(m=c==null?void 0:c[yt])==null?void 0:m.handleBounds,z:l}}),r.set(a.id,d)}),U2(r,n,s),r}function $2(t,e={}){const{getNodes:n,width:o,height:r,minZoom:s,maxZoom:i,d3Zoom:a,d3Selection:l,fitViewOnInitDone:c,fitViewOnInit:d,nodeOrigin:h}=t(),f=e.initial&&!c&&d;if(a&&l&&(f||!e.initial)){const m=n().filter(x=>{var b;const p=e.includeHiddenNodes?x.width&&x.height:!x.hidden;return(b=e.nodes)!=null&&b.length?p&&e.nodes.some(y=>y.id===x.id):p}),g=m.every(x=>x.width&&x.height);if(m.length>0&&g){const x=tf(m,h),{x:p,y:b,zoom:y}=k2(x,o,r,e.minZoom??s,e.maxZoom??i,e.padding??.1),v=er.translate(p,b).scale(y);return typeof e.duration=="number"&&e.duration>0?a.transform(mr(l,e.duration),v):a.transform(l,v),!0}}return!1}function ZT(t,e){return t.forEach(n=>{const o=e.get(n.id);o&&e.set(o.id,{...o,[yt]:o[yt],selected:n.selected})}),new Map(e)}function QT(t,e){return e.map(n=>{const o=t.find(r=>r.id===n.id);return o&&(n.selected=o.selected),n})}function Hl({changedNodes:t,changedEdges:e,get:n,set:o}){const{nodeInternals:r,edges:s,onNodesChange:i,onEdgesChange:a,hasDefaultNodes:l,hasDefaultEdges:c}=n();t!=null&&t.length&&(l&&o({nodeInternals:ZT(t,r)}),i==null||i(t)),e!=null&&e.length&&(c&&o({edges:QT(e,s)}),a==null||a(e))}const es=()=>{},eM={zoomIn:es,zoomOut:es,zoomTo:es,getZoom:()=>1,setViewport:es,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:es,fitBounds:es,project:t=>t,screenToFlowPosition:t=>t,flowToScreenPosition:t=>t,viewportInitialized:!1},tM=t=>({d3Zoom:t.d3Zoom,d3Selection:t.d3Selection});function Ni(){const t=(()=>{const x=zt(),{d3Zoom:p,d3Selection:b}=dt(tM,Wt);return O.useMemo(()=>b&&p?{zoomIn:v=>p.scaleBy(mr(b,v==null?void 0:v.duration),1.2),zoomOut:v=>p.scaleBy(mr(b,v==null?void 0:v.duration),1/1.2),zoomTo:(v,w)=>p.scaleTo(mr(b,w==null?void 0:w.duration),v),getZoom:()=>x.getState().transform[2],setViewport:(v,w)=>{const[j,C,N]=x.getState().transform,S=er.translate(v.x??j,v.y??C).scale(v.zoom??N);p.transform(mr(b,w==null?void 0:w.duration),S)},getViewport:()=>{const[v,w,j]=x.getState().transform;return{x:v,y:w,zoom:j}},fitView:v=>$2(x.getState,v),setCenter:(v,w,j)=>{const{width:C,height:N,maxZoom:S}=x.getState(),E=(j==null?void 0:j.zoom)!==void 0?j.zoom:S,T=C/2-v*E,I=N/2-w*E,M=er.translate(T,I).scale(E);p.transform(mr(b,j==null?void 0:j.duration),M)},fitBounds:(v,w)=>{const{width:j,height:C,minZoom:N,maxZoom:S}=x.getState(),{x:E,y:T,zoom:I}=k2(v,j,C,N,S,(w==null?void 0:w.padding)??.1),M=er.translate(E,T).scale(I);p.transform(mr(b,w==null?void 0:w.duration),M)},project:v=>{const{transform:w,snapToGrid:j,snapGrid:C}=x.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"),ef(v,w,j,C)},screenToFlowPosition:v=>{const{transform:w,snapToGrid:j,snapGrid:C,domNode:N}=x.getState();if(!N)return v;const{x:S,y:E}=N.getBoundingClientRect(),T={x:v.x-S,y:v.y-E};return ef(T,w,j,C)},flowToScreenPosition:v=>{const{transform:w,domNode:j}=x.getState();if(!j)return v;const{x:C,y:N}=j.getBoundingClientRect(),S=y2(v,w);return{x:S.x+C,y:S.y+N}},viewportInitialized:!0}:eM,[p,b])})(),e=zt(),n=O.useCallback(()=>e.getState().getNodes().map(x=>({...x})),[]),o=O.useCallback(x=>e.getState().nodeInternals.get(x),[]),r=O.useCallback(()=>{const{edges:x=[]}=e.getState();return x.map(p=>({...p}))},[]),s=O.useCallback(x=>{const{edges:p=[]}=e.getState();return p.find(b=>b.id===x)},[]),i=O.useCallback(x=>{const{getNodes:p,setNodes:b,hasDefaultNodes:y,onNodesChange:v}=e.getState(),w=p(),j=typeof x=="function"?x(w):x;if(y)b(j);else if(v){const C=j.length===0?w.map(N=>({type:"remove",id:N.id})):j.map(N=>({item:N,type:"reset"}));v(C)}},[]),a=O.useCallback(x=>{const{edges:p=[],setEdges:b,hasDefaultEdges:y,onEdgesChange:v}=e.getState(),w=typeof x=="function"?x(p):x;y?b(w):v&&v(w.length===0?p.map(j=>({type:"remove",id:j.id})):w.map(j=>({item:j,type:"reset"})))},[]),l=O.useCallback(x=>{const p=Array.isArray(x)?x:[x],{getNodes:b,setNodes:y,hasDefaultNodes:v,onNodesChange:w}=e.getState();if(v)y([...b(),...p]);else if(w){const j=p.map(C=>({item:C,type:"add"}));w(j)}},[]),c=O.useCallback(x=>{const p=Array.isArray(x)?x:[x],{edges:b=[],setEdges:y,hasDefaultEdges:v,onEdgesChange:w}=e.getState();v?y([...b,...p]):w&&w(p.map(j=>({item:j,type:"add"})))},[]),d=O.useCallback(()=>{const{getNodes:x,edges:p=[],transform:b}=e.getState(),[y,v,w]=b;return{nodes:x().map(j=>({...j})),edges:p.map(j=>({...j})),viewport:{x:y,y:v,zoom:w}}},[]),h=O.useCallback(({nodes:x,edges:p})=>{const{nodeInternals:b,getNodes:y,edges:v,hasDefaultNodes:w,hasDefaultEdges:j,onNodesDelete:C,onEdgesDelete:N,onNodesChange:S,onEdgesChange:E}=e.getState(),T=(x||[]).map(R=>R.id),I=(p||[]).map(R=>R.id),M=y().reduce((R,P)=>{const z=P.parentNode||P.parentId,_=!T.includes(P.id)&&z&&R.find(k=>k.id===z);return(typeof P.deletable!="boolean"||P.deletable)&&(T.includes(P.id)||_)&&R.push(P),R},[]),F=v.filter(R=>typeof R.deletable!="boolean"||R.deletable),D=F.filter(R=>I.includes(R.id));if(M||D){const R=w2(M,F),P=[...D,...R],z=P.reduce((_,k)=>(_.includes(k.id)||_.push(k.id),_),[]);(j||w)&&(j&&e.setState({edges:v.filter(_=>!z.includes(_.id))}),w&&(M.forEach(_=>{b.delete(_.id)}),e.setState({nodeInternals:new Map(b)}))),z.length>0&&(N==null||N(P),E&&E(z.map(_=>({id:_,type:"remove"})))),M.length>0&&(C==null||C(M),S)&&S(M.map(_=>({id:_.id,type:"remove"})))}},[]),f=O.useCallback(x=>{const p=Nn((b=x).width)&&Nn(b.height)&&Nn(b.x)&&Nn(b.y);var b;const y=p?null:e.getState().nodeInternals.get(x.id);return!p&&!y?[null,null,p]:[p?x:s2(y),y,p]},[]),m=O.useCallback((x,p=!0,b)=>{const[y,v,w]=f(x);return y?(b||e.getState().getNodes()).filter(j=>{if(!(w||j.id!==v.id&&j.positionAbsolute))return!1;const C=s2(j),N=Wh(C,y);return p&&N>0||N>=y.width*y.height}):[]},[]),g=O.useCallback((x,p,b=!0)=>{const[y]=f(x);if(!y)return!1;const v=Wh(y,p);return b&&v>0||v>=y.width*y.height},[]);return O.useMemo(()=>({...t,getNodes:n,getNode:o,getEdges:r,getEdge:s,setNodes:i,setEdges:a,addNodes:l,addEdges:c,toObject:d,deleteElements:h,getIntersectingNodes:m,isNodeIntersecting:g}),[t,n,o,r,s,i,a,l,c,d,h,m,g])}const nM={actInsideInputWithModifier:!1},lf={position:"absolute",width:"100%",height:"100%",top:0,left:0},Wl=t=>({x:t.x,y:t.y,zoom:t.k}),ts=(t,e)=>t.target.closest(`.${e}`),V2=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),H2=t=>{const e=t.ctrlKey&&Fl()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e},oM=t=>({d3Zoom:t.d3Zoom,d3Selection:t.d3Selection,d3ZoomHandler:t.d3ZoomHandler,userSelectionActive:t.userSelectionActive}),rM=({onMove:t,onMoveStart:e,onMoveEnd:n,onPaneContextMenu:o,zoomOnScroll:r=!0,zoomOnPinch:s=!0,panOnScroll:i=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=Bo.Free,zoomOnDoubleClick:c=!0,elementsSelectable:d,panOnDrag:h=!0,defaultViewport:f,translateExtent:m,minZoom:g,maxZoom:x,zoomActivationKeyCode:p,preventScrolling:b=!0,children:y,noWheelClassName:v,noPanClassName:w})=>{const j=O.useRef(),C=zt(),N=O.useRef(!1),S=O.useRef(!1),E=O.useRef(null),T=O.useRef({x:0,y:0,zoom:0}),{d3Zoom:I,d3Selection:M,d3ZoomHandler:F,userSelectionActive:D}=dt(oM,Wt),R=Si(p),P=O.useRef(0),z=O.useRef(!1),_=O.useRef();return function(k){const B=zt();O.useEffect(()=>{let A;const U=()=>{var J,G;if(!k.current)return;const $=$h(k.current);$.height!==0&&$.width!==0||((G=(J=B.getState()).onError)==null||G.call(J,"004",NT())),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),O.useEffect(()=>{if(E.current){const k=E.current.getBoundingClientRect(),B=function(){var G,K,W,X=yT,V=vT,Q=CT,te=wT,re=kT,ne=[0,1/0],ie=[[-1/0,-1/0],[1/0,1/0]],se=250,ae=QF,ge=Aj("start","zoom","end"),oe=0,ue=10;function de(Y){Y.property("__zoom",e2).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 Se(Y,me){return(me=Math.max(ne[0],Math.min(ne[1],me)))===Y.k?Y:new up(me,Y.x,Y.y)}function Te(Y,me,pe){var he=me[0]-pe[0]*Y.k,Ce=me[1]-pe[1]*Y.k;return he===Y.x&&Ce===Y.y?Y:new up(Y.k,he,Ce)}function Fe(Y){return[(+Y[0][0]+ +Y[1][0])/2,(+Y[0][1]+ +Y[1][1])/2]}function _e(Y,me,pe,he){Y.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 Ce=this,Re=arguments,Pe=ke(Ce,Re).event(he),He=V.apply(Ce,Re),le=pe==null?Fe(He):typeof pe=="function"?pe.apply(Ce,Re):pe,Ae=Math.max(He[1][0]-He[0][0],He[1][1]-He[0][1]),Me=Ce.__zoom,Ue=typeof me=="function"?me.apply(Ce,Re):me,qe=ae(Me.invert(le).concat(Ae/Me.k),Ue.invert(le).concat(Ae/Ue.k));return function(De){if(De===1)De=Ue;else{var $e=qe(De),st=Ae/$e[2];De=new up(st,le[0]-$e[0]*st,le[1]-$e[1]*st)}Pe.zoom(null,De)}})}function ke(Y,me,pe){return!pe&&Y.__zooming||new Ye(Y,me)}function Ye(Y,me){this.that=Y,this.args=me,this.active=0,this.sourceEvent=null,this.extent=V.apply(Y,me),this.taps=0}function Ve(Y,...me){if(X.apply(this,arguments)){var pe=ke(this,me).event(Y),he=this.__zoom,Ce=Math.max(ne[0],Math.min(ne[1],he.k*Math.pow(2,te.apply(this,arguments)))),Re=Kn(Y);if(pe.wheel)pe.mouse[0][0]===Re[0]&&pe.mouse[0][1]===Re[1]||(pe.mouse[1]=he.invert(pe.mouse[0]=Re)),clearTimeout(pe.wheel);else{if(he.k===Ce)return;pe.mouse=[Re,he.invert(Re)],hp(this),pe.start()}vi(Y),pe.wheel=setTimeout(function(){pe.wheel=null,pe.end()},150),pe.zoom("mouse",Q(Te(Se(he,Ce),pe.mouse[0],pe.mouse[1]),pe.extent,ie))}}function Ke(Y,...me){if(!W&&X.apply(this,arguments)){var pe=Y.currentTarget,he=ke(this,me,!0).event(Y),Ce=Vn(Y.view).on("mousemove.zoom",function(le){if(vi(le),!he.moved){var Ae=le.clientX-Pe,Me=le.clientY-He;he.moved=Ae*Ae+Me*Me>oe}he.event(le).zoom("mouse",Q(Te(he.that.__zoom,he.mouse[0]=Kn(le,pe),he.mouse[1]),he.extent,ie))},!0).on("mouseup.zoom",function(le){Ce.on("mousemove.zoom mouseup.zoom",null),Qv(le.view,he.moved),vi(le),he.event(le).end()},!0),Re=Kn(Y,pe),Pe=Y.clientX,He=Y.clientY;Zv(Y.view),Uh(Y),he.mouse=[Re,this.__zoom.invert(Re)],hp(this),he.start()}}function ee(Y,...me){if(X.apply(this,arguments)){var pe=this.__zoom,he=Kn(Y.changedTouches?Y.changedTouches[0]:Y,this),Ce=pe.invert(he),Re=pe.k*(Y.shiftKey?.5:2),Pe=Q(Te(Se(pe,Re),he,Ce),V.apply(this,me),ie);vi(Y),se>0?Vn(this).transition().duration(se).call(_e,Pe,he,Y):Vn(this).call(de.transform,Pe,he,Y)}}function ye(Y,...me){if(X.apply(this,arguments)){var pe,he,Ce,Re,Pe=Y.touches,He=Pe.length,le=ke(this,me,Y.changedTouches.length===He).event(Y);for(Uh(Y),he=0;he<He;++he)Re=[Re=Kn(Ce=Pe[he],this),this.__zoom.invert(Re),Ce.identifier],le.touch0?le.touch1||le.touch0[2]===Re[2]||(le.touch1=Re,le.taps=0):(le.touch0=Re,pe=!0,le.taps=1+!!G);G&&(G=clearTimeout(G)),pe&&(le.taps<2&&(K=Re[0],G=setTimeout(function(){G=null},500)),hp(this),le.start())}}function we(Y,...me){if(this.__zooming){var pe,he,Ce,Re,Pe=ke(this,me).event(Y),He=Y.changedTouches,le=He.length;for(vi(Y),pe=0;pe<le;++pe)Ce=Kn(he=He[pe],this),Pe.touch0&&Pe.touch0[2]===he.identifier?Pe.touch0[0]=Ce:Pe.touch1&&Pe.touch1[2]===he.identifier&&(Pe.touch1[0]=Ce);if(he=Pe.that.__zoom,Pe.touch1){var Ae=Pe.touch0[0],Me=Pe.touch0[1],Ue=Pe.touch1[0],qe=Pe.touch1[1],De=(De=Ue[0]-Ae[0])*De+(De=Ue[1]-Ae[1])*De,$e=($e=qe[0]-Me[0])*$e+($e=qe[1]-Me[1])*$e;he=Se(he,Math.sqrt(De/$e)),Ce=[(Ae[0]+Ue[0])/2,(Ae[1]+Ue[1])/2],Re=[(Me[0]+qe[0])/2,(Me[1]+qe[1])/2]}else{if(!Pe.touch0)return;Ce=Pe.touch0[0],Re=Pe.touch0[1]}Pe.zoom("touch",Q(Te(he,Ce,Re),Pe.extent,ie))}}function Ie(Y,...me){if(this.__zooming){var pe,he,Ce=ke(this,me).event(Y),Re=Y.changedTouches,Pe=Re.length;for(Uh(Y),W&&clearTimeout(W),W=setTimeout(function(){W=null},500),pe=0;pe<Pe;++pe)he=Re[pe],Ce.touch0&&Ce.touch0[2]===he.identifier?delete Ce.touch0:Ce.touch1&&Ce.touch1[2]===he.identifier&&delete Ce.touch1;if(Ce.touch1&&!Ce.touch0&&(Ce.touch0=Ce.touch1,delete Ce.touch1),Ce.touch0)Ce.touch0[1]=this.__zoom.invert(Ce.touch0[0]);else if(Ce.end(),Ce.taps===2&&(he=Kn(he,this),Math.hypot(K[0]-he[0],K[1]-he[1])<ue)){var He=Vn(this).on("dblclick.zoom");He&&He.apply(this,arguments)}}}return de.transform=function(Y,me,pe,he){var Ce=Y.selection?Y.selection():Y;Ce.property("__zoom",e2),Y!==Ce?_e(Y,me,pe,he):Ce.interrupt().each(function(){ke(this,arguments).event(he).start().zoom(null,typeof me=="function"?me.apply(this,arguments):me).end()})},de.scaleBy=function(Y,me,pe,he){de.scaleTo(Y,function(){return this.__zoom.k*(typeof me=="function"?me.apply(this,arguments):me)},pe,he)},de.scaleTo=function(Y,me,pe,he){de.transform(Y,function(){var Ce=V.apply(this,arguments),Re=this.__zoom,Pe=pe==null?Fe(Ce):typeof pe=="function"?pe.apply(this,arguments):pe,He=Re.invert(Pe),le=typeof me=="function"?me.apply(this,arguments):me;return Q(Te(Se(Re,le),Pe,He),Ce,ie)},pe,he)},de.translateBy=function(Y,me,pe,he){de.transform(Y,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),ie)},null,he)},de.translateTo=function(Y,me,pe,he,Ce){de.transform(Y,function(){var Re=V.apply(this,arguments),Pe=this.__zoom,He=he==null?Fe(Re):typeof he=="function"?he.apply(this,arguments):he;return Q(er.translate(He[0],He[1]).scale(Pe.k).translate(typeof me=="function"?-me.apply(this,arguments):-me,typeof pe=="function"?-pe.apply(this,arguments):-pe),Re,ie)},he,Ce)},Ye.prototype={event:function(Y){return Y&&(this.sourceEvent=Y),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(Y,me){return this.mouse&&Y!=="mouse"&&(this.mouse[1]=me.invert(this.mouse[0])),this.touch0&&Y!=="touch"&&(this.touch0[1]=me.invert(this.touch0[0])),this.touch1&&Y!=="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(Y){var me=Vn(this.that).datum();ge.call(Y,this.that,new bT(Y,{sourceEvent:this.sourceEvent,target:de,transform:this.that.__zoom,dispatch:ge}),me)}},de.wheelDelta=function(Y){return arguments.length?(te=typeof Y=="function"?Y:Rl(+Y),de):te},de.filter=function(Y){return arguments.length?(X=typeof Y=="function"?Y:Rl(!!Y),de):X},de.touchable=function(Y){return arguments.length?(re=typeof Y=="function"?Y:Rl(!!Y),de):re},de.extent=function(Y){return arguments.length?(V=typeof Y=="function"?Y:Rl([[+Y[0][0],+Y[0][1]],[+Y[1][0],+Y[1][1]]]),de):V},de.scaleExtent=function(Y){return arguments.length?(ne[0]=+Y[0],ne[1]=+Y[1],de):[ne[0],ne[1]]},de.translateExtent=function(Y){return arguments.length?(ie[0][0]=+Y[0][0],ie[1][0]=+Y[1][0],ie[0][1]=+Y[0][1],ie[1][1]=+Y[1][1],de):[[ie[0][0],ie[0][1]],[ie[1][0],ie[1][1]]]},de.constrain=function(Y){return arguments.length?(Q=Y,de):Q},de.duration=function(Y){return arguments.length?(se=+Y,de):se},de.interpolate=function(Y){return arguments.length?(ae=Y,de):ae},de.on=function(){var Y=ge.on.apply(ge,arguments);return Y===ge?de:Y},de.clickDistance=function(Y){return arguments.length?(oe=(Y=+Y)*Y,de):Math.sqrt(oe)},de.tapDistance=function(Y){return arguments.length?(ue=+Y,de):ue},de}().scaleExtent([g,x]).translateExtent(m),A=Vn(E.current).call(B),U=er.translate(f.x,f.y).scale(Xr(f.zoom,g,x)),$=[[0,0],[k.width,k.height]],J=B.constrain()(U,$,m);B.transform(A,J),B.wheelDelta(H2),C.setState({d3Zoom:B,d3Selection:A,d3ZoomHandler:A.on("wheel.zoom"),transform:[J.x,J.y,J.k],domNode:E.current.closest(".react-flow")})}},[]),O.useEffect(()=>{M&&I&&(!i||R||D?F!==void 0&&M.on("wheel.zoom",function(k,B){if(!b&&k.type==="wheel"&&!k.ctrlKey||ts(k,v))return null;k.preventDefault(),F.call(this,k,B)},{passive:!1}):M.on("wheel.zoom",k=>{if(ts(k,v))return!1;k.preventDefault(),k.stopImmediatePropagation();const B=M.property("__zoom").k||1;if(k.ctrlKey&&s){const X=Kn(k),V=H2(k),Q=B*Math.pow(2,V);return void I.scaleTo(M,Q,X,k)}const A=k.deltaMode===1?20:1;let U=l===Bo.Vertical?0:k.deltaX*A,$=l===Bo.Horizontal?0:k.deltaY*A;!Fl()&&k.shiftKey&&l!==Bo.Vertical&&(U=k.deltaY*A,$=0),I.translateBy(M,-U/B*a,-$/B*a,{internal:!0});const J=Wl(M.property("__zoom")),{onViewportChangeStart:G,onViewportChange:K,onViewportChangeEnd:W}=C.getState();clearTimeout(_.current),z.current||(z.current=!0,e==null||e(k,J),G==null||G(J)),z.current&&(t==null||t(k,J),K==null||K(J),_.current=setTimeout(()=>{n==null||n(k,J),W==null||W(J),z.current=!1},150))},{passive:!1}))},[D,i,l,M,I,F,R,s,b,v,e,t,n]),O.useEffect(()=>{I&&I.on("start",k=>{var U,$;if(!k.sourceEvent||k.sourceEvent.internal)return null;P.current=(U=k.sourceEvent)==null?void 0:U.button;const{onViewportChangeStart:B}=C.getState(),A=Wl(k.transform);N.current=!0,T.current=A,(($=k.sourceEvent)==null?void 0:$.type)==="mousedown"&&C.setState({paneDragging:!0}),B==null||B(A),e==null||e(k.sourceEvent,A)})},[I,e]),O.useEffect(()=>{I&&(D&&!N.current?I.on("zoom",null):D||I.on("zoom",k=>{var A;const{onViewportChange:B}=C.getState();if(C.setState({transform:[k.transform.x,k.transform.y,k.transform.k]}),S.current=!(!o||!V2(h,P.current??0)),(t||B)&&!((A=k.sourceEvent)!=null&&A.internal)){const U=Wl(k.transform);B==null||B(U),t==null||t(k.sourceEvent,U)}}))},[D,I,t,h,o]),O.useEffect(()=>{I&&I.on("end",k=>{if(!k.sourceEvent||k.sourceEvent.internal)return null;const{onViewportChangeEnd:B}=C.getState();if(N.current=!1,C.setState({paneDragging:!1}),o&&V2(h,P.current??0)&&!S.current&&o(k.sourceEvent),S.current=!1,(n||B)&&(A=T.current,U=k.transform,A.x!==U.x||A.y!==U.y||A.zoom!==U.k)){const $=Wl(k.transform);T.current=$,clearTimeout(j.current),j.current=setTimeout(()=>{B==null||B($),n==null||n(k.sourceEvent,$)},i?150:0)}var A,U})},[I,i,h,n,o]),O.useEffect(()=>{I&&I.filter(k=>{const B=R||r,A=s&&k.ctrlKey;if((h===!0||Array.isArray(h)&&h.includes(1))&&k.button===1&&k.type==="mousedown"&&(ts(k,"react-flow__node")||ts(k,"react-flow__edge")))return!0;if(!(h||B||i||c||s)||D||!c&&k.type==="dblclick"||ts(k,v)&&k.type==="wheel"||ts(k,w)&&(k.type!=="wheel"||i&&k.type==="wheel"&&!R)||!s&&k.ctrlKey&&k.type==="wheel"||!B&&!i&&!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})},[D,I,r,s,i,c,h,d,R]),q.createElement("div",{className:"react-flow__renderer",ref:E,style:lf},y)},sM=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function iM(){const{userSelectionActive:t,userSelectionRect:e}=dt(sM,Wt);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 W2(t,e){const n=e.parentNode||e.parentId,o=t.find(r=>r.id===n);if(o){const r=e.position.x+e.width-o.width,s=e.position.y+e.height-o.height;if(r>0||s>0||e.position.x<0||e.position.y<0){if(o.style={...o.style},o.style.width=o.style.width??o.width,o.style.height=o.style.height??o.height,r>0&&(o.style.width+=r),s>0&&(o.style.height+=s),e.position.x<0){const i=Math.abs(e.position.x);o.position.x=o.position.x-i,o.style.width+=i,e.position.x=0}if(e.position.y<0){const i=Math.abs(e.position.y);o.position.y=o.position.y-i,o.style.height+=i,e.position.y=0}o.width=o.style.width,o.height=o.style.height}}}function q2(t,e){if(t.some(o=>o.type==="reset"))return t.filter(o=>o.type==="reset").map(o=>o.item);const n=t.filter(o=>o.type==="add").map(o=>o.item);return e.reduce((o,r)=>{const s=t.filter(a=>a.id===r.id);if(s.length===0)return o.push(r),o;const i={...r};for(const a of s)if(a)switch(a.type){case"select":i.selected=a.selected;break;case"position":a.position!==void 0&&(i.position=a.position),a.positionAbsolute!==void 0&&(i.positionAbsolute=a.positionAbsolute),a.dragging!==void 0&&(i.dragging=a.dragging),i.expandParent&&W2(o,i);break;case"dimensions":a.dimensions!==void 0&&(i.width=a.dimensions.width,i.height=a.dimensions.height),a.updateStyle!==void 0&&(i.style={...i.style||{},...a.dimensions}),typeof a.resizing=="boolean"&&(i.resizing=a.resizing),i.expandParent&&W2(o,i);break;case"remove":return o}return o.push(i),o},n)}function G2(t,e){return q2(t,e)}const Vo=(t,e)=>({id:t,type:"select",selected:e});function ns(t,e){return t.reduce((n,o)=>{const r=e.includes(o.id);return!o.selected&&r?(o.selected=!0,n.push(Vo(o.id,!0))):o.selected&&!r&&(o.selected=!1,n.push(Vo(o.id,!1))),n},[])}const cf=(t,e)=>n=>{n.target===e.current&&(t==null||t(n))},aM=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,dragging:t.paneDragging}),Y2=O.memo(({isSelecting:t,selectionMode:e=Ci.Full,panOnDrag:n,onSelectionStart:o,onSelectionEnd:r,onPaneClick:s,onPaneContextMenu:i,onPaneScroll:a,onPaneMouseEnter:l,onPaneMouseMove:c,onPaneMouseLeave:d,children:h})=>{const f=O.useRef(null),m=zt(),g=O.useRef(0),x=O.useRef(0),p=O.useRef(),{userSelectionActive:b,elementsSelectable:y,dragging:v}=dt(aM,Wt),w=()=>{m.setState({userSelectionActive:!1,userSelectionRect:null}),g.current=0,x.current=0},j=S=>{s==null||s(S),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},C=a?S=>a(S):void 0,N=y&&(t||b);return q.createElement("div",{className:Qt(["react-flow__pane",{dragging:v,selection:t}]),onClick:N?void 0:cf(j,f),onContextMenu:cf(S=>{Array.isArray(n)&&(n!=null&&n.includes(2))?S.preventDefault():i==null||i(S)},f),onWheel:cf(C,f),onMouseEnter:N?void 0:l,onMouseDown:N?S=>{const{resetSelectedElements:E,domNode:T}=m.getState();if(p.current=T==null?void 0:T.getBoundingClientRect(),!y||!t||S.button!==0||S.target!==f.current||!p.current)return;const{x:I,y:M}=zo(S,p.current);E(),m.setState({userSelectionRect:{width:0,height:0,startX:I,startY:M,x:I,y:M}}),o==null||o(S)}:void 0,onMouseMove:N?S=>{const{userSelectionRect:E,nodeInternals:T,edges:I,transform:M,onNodesChange:F,onEdgesChange:D,nodeOrigin:R,getNodes:P}=m.getState();if(!t||!p.current||!E)return;m.setState({userSelectionActive:!0,nodesSelectionActive:!1});const z=zo(S,p.current),_=E.startX??0,k=E.startY??0,B={...E,x:z.x<_?z.x:_,y:z.y<k?z.y:k,width:Math.abs(z.x-_),height:Math.abs(z.y-k)},A=P(),U=v2(T,B,M,e===Ci.Partial,!0,R),$=w2(U,I).map(G=>G.id),J=U.map(G=>G.id);if(g.current!==J.length){g.current=J.length;const G=ns(A,J);G.length&&(F==null||F(G))}if(x.current!==$.length){x.current=$.length;const G=ns(I,$);G.length&&(D==null||D(G))}m.setState({userSelectionRect:B})}:c,onMouseUp:N?S=>{if(S.button!==0)return;const{userSelectionRect:E}=m.getState();!b&&E&&S.target===f.current&&(j==null||j(S)),m.setState({nodesSelectionActive:g.current>0}),w(),r==null||r(S)}:void 0,onMouseLeave:N?S=>{b&&(m.setState({nodesSelectionActive:g.current>0}),r==null||r(S)),w()}:d,ref:f,style:lf},h,q.createElement(iM,null))});function K2(t,e){const n=t.parentNode||t.parentId;if(!n)return!1;const o=e.get(n);return!!o&&(!!o.selected||K2(o,e))}function X2(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 lM(t,e,n,o){return Array.from(t.values()).filter(r=>(r.selected||r.id===o)&&(!r.parentNode||r.parentId||!K2(r,t))&&(r.draggable||e&&r.draggable===void 0)).map(r=>{var s,i;return{id:r.id,position:r.position||{x:0,y:0},positionAbsolute:r.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((s=r.positionAbsolute)==null?void 0:s.x)??0),y:n.y-(((i=r.positionAbsolute)==null?void 0:i.y)??0)},delta:{x:0,y:0},extent:r.extent,parentNode:r.parentNode||r.parentId,parentId:r.parentNode||r.parentId,width:r.width,height:r.height,expandParent:r.expandParent}})}function J2(t,e,n,o,r=[0,0],s){const i=function(h,f){return f&&f!=="parent"?[f[0],[f[1][0]-(h.width||0),f[1][1]-(h.height||0)]]:f}(t,t.extent||o);let a=i;const l=t.parentNode||t.parentId;if(t.extent!=="parent"||t.expandParent){if(t.extent&&l&&t.extent!=="parent"){const h=n.get(l),{x:f,y:m}=Zr(h,r).positionAbsolute;a=[[t.extent[0][0]+f,t.extent[0][1]+m],[t.extent[1][0]+f,t.extent[1][1]+m]]}}else if(l&&t.width&&t.height){const h=n.get(l),{x:f,y:m}=Zr(h,r).positionAbsolute;a=h&&Nn(f)&&Nn(m)&&Nn(h.width)&&Nn(h.height)?[[f+t.width*r[0],m+t.height*r[1]],[f+h.width-t.width+t.width*r[0],m+h.height-t.height+t.height*r[1]]]:a}else s==null||s("005",ET()),a=i;let c={x:0,y:0};if(l){const h=n.get(l);c=Zr(h,r).positionAbsolute}const d=a&&a!=="parent"?Vh(e,a):e;return{position:{x:d.x-c.x,y:d.y-c.y},positionAbsolute:d}}function df({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]}Y2.displayName="Pane";const Z2=(t,e,n,o)=>{const r=e.querySelectorAll(t);if(!r||!r.length)return null;const s=Array.from(r),i=e.getBoundingClientRect(),a=i.width*o[0],l=i.height*o[1];return s.map(c=>{const d=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),position:c.getAttribute("data-handlepos"),x:(d.left-i.left-a)/n,y:(d.top-i.top-l)/n,...$h(c)}})};function Ei(t,e,n){return n===void 0?n:o=>{const r=e().nodeInternals.get(t);r&&n(o,{...r})}}function uf({id:t,store:e,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:r,unselectNodesAndEdges:s,multiSelectionActive:i,nodeInternals:a,onError:l}=e.getState(),c=a.get(t);c?(e.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&i)&&(s({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var d;return(d=o==null?void 0:o.current)==null?void 0:d.blur()})):r([t])):l==null||l("012",MT(t))}function hf(t){return(e,n,o)=>t==null?void 0:t(e,o)}function Q2({nodeRef:t,disabled:e=!1,noDragClassName:n,handleSelector:o,nodeId:r,isSelectable:s,selectNodesOnDrag:i}){const a=zt(),[l,c]=O.useState(!1),d=O.useRef([]),h=O.useRef({x:null,y:null}),f=O.useRef(0),m=O.useRef(null),g=O.useRef({x:0,y:0}),x=O.useRef(null),p=O.useRef(!1),b=O.useRef(!1),y=O.useRef(!1),v=function(){const w=zt();return O.useCallback(({sourceEvent:C})=>{const{transform:N,snapGrid:S,snapToGrid:E}=w.getState(),T=C.touches?C.touches[0].clientX:C.clientX,I=C.touches?C.touches[0].clientY:C.clientY,M={x:(T-N[0])/N[2],y:(I-N[1])/N[2]};return{xSnapped:E?S[0]*Math.round(M.x/S[0]):M.x,ySnapped:E?S[1]*Math.round(M.y/S[1]):M.y,...M}},[])}();return O.useEffect(()=>{if(t!=null&&t.current){const w=Vn(t.current),j=({x:S,y:E})=>{const{nodeInternals:T,onNodeDrag:I,onSelectionDrag:M,updateNodePositions:F,nodeExtent:D,snapGrid:R,snapToGrid:P,nodeOrigin:z,onError:_}=a.getState();h.current={x:S,y:E};let k=!1,B={x:0,y:0,x2:0,y2:0};if(d.current.length>1&&D){const U=tf(d.current,z);B=Hh(U)}if(d.current=d.current.map(U=>{const $={x:S-U.distance.x,y:E-U.distance.y};P&&($.x=R[0]*Math.round($.x/R[0]),$.y=R[1]*Math.round($.y/R[1]));const J=[[D[0][0],D[0][1]],[D[1][0],D[1][1]]];d.current.length>1&&D&&!U.extent&&(J[0][0]=U.positionAbsolute.x-B.x+D[0][0],J[1][0]=U.positionAbsolute.x+(U.width??0)-B.x2+D[1][0],J[0][1]=U.positionAbsolute.y-B.y+D[0][1],J[1][1]=U.positionAbsolute.y+(U.height??0)-B.y2+D[1][1]);const G=J2(U,$,T,J,z,_);return k=k||U.position.x!==G.position.x||U.position.y!==G.position.y,U.position=G.position,U.positionAbsolute=G.positionAbsolute,U}),!k)return;F(d.current,!0,!0),c(!0);const A=r?I:hf(M);if(A&&x.current){const[U,$]=df({nodeId:r,dragItems:d.current,nodeInternals:T});A(x.current,U,$)}},C=()=>{if(!m.current)return;const[S,E]=o2(g.current,m.current);if(S!==0||E!==0){const{transform:T,panBy:I}=a.getState();h.current.x=(h.current.x??0)-S/T[2],h.current.y=(h.current.y??0)-E/T[2],I({x:S,y:E})&&j(h.current)}f.current=requestAnimationFrame(C)},N=S=>{var z;const{nodeInternals:E,multiSelectionActive:T,nodesDraggable:I,unselectNodesAndEdges:M,onNodeDragStart:F,onSelectionDragStart:D}=a.getState();b.current=!0;const R=r?F:hf(D);i&&s||T||!r||(z=E.get(r))!=null&&z.selected||M(),r&&s&&i&&uf({id:r,store:a,nodeRef:t});const P=v(S);if(h.current=P,d.current=lM(E,I,P,r),R&&d.current){const[_,k]=df({nodeId:r,dragItems:d.current,nodeInternals:E});R(S.sourceEvent,_,k)}};if(!e){const S=function(){var E,T,I,M,F=mT,D=pT,R=gT,P=xT,z={},_=Aj("start","drag","end"),k=0,B=0;function A(V){V.on("mousedown.drag",U).filter(P).on("touchstart.drag",G).on("touchmove.drag",K,fT).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(!M&&F.call(this,V,Q)){var te=X(this,D.call(this,V,Q),V,Q,"mouse");te&&(Vn(V.view).on("mousemove.drag",$,yi).on("mouseup.drag",J,yi),Zv(V.view),zh(V),I=!1,E=V.clientX,T=V.clientY,te("start",V))}}function $(V){if(Kr(V),!I){var Q=V.clientX-E,te=V.clientY-T;I=Q*Q+te*te>B}z.mouse("drag",V)}function J(V){Vn(V.view).on("mousemove.drag mouseup.drag",null),Qv(V.view,I),Kr(V),z.mouse("end",V)}function G(V,Q){if(F.call(this,V,Q)){var te,re,ne=V.changedTouches,ie=D.call(this,V,Q),se=ne.length;for(te=0;te<se;++te)(re=X(this,ie,V,Q,ne[te].identifier,ne[te]))&&(zh(V),re("start",V,ne[te]))}}function K(V){var Q,te,re=V.changedTouches,ne=re.length;for(Q=0;Q<ne;++Q)(te=z[re[Q].identifier])&&(Kr(V),te("drag",V,re[Q]))}function W(V){var Q,te,re=V.changedTouches,ne=re.length;for(M&&clearTimeout(M),M=setTimeout(function(){M=null},500),Q=0;Q<ne;++Q)(te=z[re[Q].identifier])&&(zh(V),te("end",V,re[Q]))}function X(V,Q,te,re,ne,ie){var se,ae,ge,oe=_.copy(),ue=Kn(ie||te,Q);if((ge=R.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,ae=ge.y-ue[1]||0,function de(Se,Te,Fe){var _e,ke=ue;switch(Se){case"start":z[ne]=de,_e=k++;break;case"end":delete z[ne],--k;case"drag":ue=Kn(Fe||Te,Q),_e=k}oe.call(Se,V,new Bh(Se,{sourceEvent:Te,subject:ge,target:A,identifier:ne,active:_e,x:ue[0]+se,y:ue[1]+ae,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:Dl(!!V),A):F},A.container=function(V){return arguments.length?(D=typeof V=="function"?V:Dl(V),A):D},A.subject=function(V){return arguments.length?(R=typeof V=="function"?V:Dl(V),A):R},A.touchable=function(V){return arguments.length?(P=typeof V=="function"?V:Dl(!!V),A):P},A.on=function(){var V=_.on.apply(_,arguments);return V===_?A:V},A.clickDistance=function(V){return arguments.length?(B=(V=+V)*V,A):Math.sqrt(B)},A}().on("start",E=>{const{domNode:T,nodeDragThreshold:I}=a.getState();I===0&&N(E),y.current=!1;const M=v(E);h.current=M,m.current=(T==null?void 0:T.getBoundingClientRect())||null,g.current=zo(E.sourceEvent,m.current)}).on("drag",E=>{var F,D;const T=v(E),{autoPanOnNodeDrag:I,nodeDragThreshold:M}=a.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,C()),!b.current){const R=T.xSnapped-(((F=h==null?void 0:h.current)==null?void 0:F.x)??0),P=T.ySnapped-(((D=h==null?void 0:h.current)==null?void 0:D.y)??0);Math.sqrt(R*R+P*P)>M&&N(E)}(h.current.x!==T.xSnapped||h.current.y!==T.ySnapped)&&d.current&&b.current&&(x.current=E.sourceEvent,g.current=zo(E.sourceEvent,m.current),j(T))}}).on("end",E=>{if(b.current&&!y.current&&(c(!1),p.current=!1,b.current=!1,cancelAnimationFrame(f.current),d.current)){const{updateNodePositions:T,nodeInternals:I,onNodeDragStop:M,onSelectionDragStop:F}=a.getState(),D=r?M:hf(F);if(T(d.current,!1,!1),D){const[R,P]=df({nodeId:r,dragItems:d.current,nodeInternals:I});D(E.sourceEvent,R,P)}}}).filter(E=>{const T=E.target;return!E.button&&(!n||!X2(T,`.${n}`,t))&&(!o||X2(T,o,t))});return w.call(S),()=>{w.on(".drag",null)}}w.on(".drag",null)}},[t,e,n,o,s,a,r,i,v]),l}function ew(){const t=zt();return O.useCallback(n=>{const{nodeInternals:o,nodeExtent:r,updateNodePositions:s,getNodes:i,snapToGrid:a,snapGrid:l,onError:c,nodesDraggable:d}=t.getState(),h=i().filter(y=>y.selected&&(y.draggable||d&&y.draggable===void 0)),f=a?l[0]:5,m=a?l[1]:5,g=n.isShiftPressed?4:1,x=n.x*f*g,p=n.y*m*g,b=h.map(y=>{if(y.positionAbsolute){const v={x:y.positionAbsolute.x+x,y:y.positionAbsolute.y+p};a&&(v.x=l[0]*Math.round(v.x/l[0]),v.y=l[1]*Math.round(v.y/l[1]));const{positionAbsolute:w,position:j}=J2(y,v,o,r,void 0,c);y.position=j,y.positionAbsolute=w}return y});s(b,!0,!1)},[])}const os={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var _i=t=>{const e=({id:n,type:o,data:r,xPos:s,yPos:i,xPosOrigin:a,yPosOrigin:l,selected:c,onClick:d,onMouseEnter:h,onMouseMove:f,onMouseLeave:m,onContextMenu:g,onDoubleClick:x,style:p,className:b,isDraggable:y,isSelectable:v,isConnectable:w,isFocusable:j,selectNodesOnDrag:C,sourcePosition:N,targetPosition:S,hidden:E,resizeObserver:T,dragHandle:I,zIndex:M,isParent:F,noDragClassName:D,noPanClassName:R,initialized:P,disableKeyboardA11y:z,ariaLabel:_,rfId:k,hasHandleBounds:B})=>{const A=zt(),U=O.useRef(null),$=O.useRef(null),J=O.useRef(N),G=O.useRef(S),K=O.useRef(o),W=v||y||d||h||f||m,X=ew(),V=Ei(n,A.getState,h),Q=Ei(n,A.getState,f),te=Ei(n,A.getState,m),re=Ei(n,A.getState,g),ne=Ei(n,A.getState,x);O.useEffect(()=>()=>{$.current&&(T==null||T.unobserve($.current),$.current=null)},[]),O.useEffect(()=>{if(U.current&&!E){const se=U.current;P&&B&&$.current===se||($.current&&(T==null||T.unobserve($.current)),T==null||T.observe(se),$.current=se)}},[E,P,B]),O.useEffect(()=>{const se=K.current!==o,ae=J.current!==N,ge=G.current!==S;U.current&&(se||ae||ge)&&(se&&(K.current=o),ae&&(J.current=N),ge&&(G.current=S),A.getState().updateNodeDimensions([{id:n,nodeElement:U.current,forceUpdate:!0}]))},[n,o,N,S]);const ie=Q2({nodeRef:U,disabled:E||!y,noDragClassName:D,handleSelector:I,nodeId:n,isSelectable:v,selectNodesOnDrag:C});return E?null:q.createElement("div",{className:Qt(["react-flow__node",`react-flow__node-${o}`,{[R]:y},b,{selected:c,selectable:v,parent:F,dragging:ie}]),ref:U,style:{zIndex:M,transform:`translate(${a}px,${l}px)`,pointerEvents:W?"all":"none",visibility:P?"visible":"hidden",...p},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:V,onMouseMove:Q,onMouseLeave:te,onContextMenu:re,onClick:se=>{const{nodeDragThreshold:ae}=A.getState();if(v&&(!C||!y||ae>0)&&uf({id:n,store:A,nodeRef:U}),d){const ge=A.getState().nodeInternals.get(n);ge&&d(se,{...ge})}},onDoubleClick:ne,onKeyDown:j?se=>{if(!qh(se)&&!z)if(i2.includes(se.key)&&v){const ae=se.key==="Escape";uf({id:n,store:A,unselect:ae,nodeRef:U})}else y&&c&&Object.prototype.hasOwnProperty.call(os,se.key)&&(A.setState({ariaLiveMessage:`Moved selected node ${se.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~s}, y: ${~~i}`}),X({x:os[se.key].x,y:os[se.key].y,isShiftPressed:se.shiftKey}))}:void 0,tabIndex:j?0:void 0,role:j?"button":void 0,"aria-describedby":z?void 0:`${P2}-${k}`,"aria-label":_},q.createElement(LT,{value:n},q.createElement(t,{id:n,data:r,type:o,xPos:s,yPos:i,selected:c,isConnectable:w,sourcePosition:N,targetPosition:S,dragging:ie,dragHandle:I,zIndex:M})))};return e.displayName="NodeWrapper",O.memo(e)};const cM=t=>{const e=t.getNodes().filter(n=>n.selected);return{...tf(e,t.nodeOrigin),transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`,userSelectionActive:t.userSelectionActive}};var dM=O.memo(function({onSelectionContextMenu:t,noPanClassName:e,disableKeyboardA11y:n}){const o=zt(),{width:r,height:s,x:i,y:a,transformString:l,userSelectionActive:c}=dt(cM,Wt),d=ew(),h=O.useRef(null);if(O.useEffect(()=>{var m;n||((m=h.current)==null||m.focus({preventScroll:!0}))},[n]),Q2({nodeRef:h}),c||!r||!s)return null;const f=t?m=>{const g=o.getState().getNodes().filter(x=>x.selected);t(m,g)}:void 0;return q.createElement("div",{className:Qt(["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(os,m.key)&&d({x:os[m.key].x,y:os[m.key].y,isShiftPressed:m.shiftKey})},style:{width:r,height:s,top:a,left:i}}))});const uM=t=>t.nodesSelectionActive,tw=({children:t,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:i,deleteKeyCode:a,onMove:l,onMoveStart:c,onMoveEnd:d,selectionKeyCode:h,selectionOnDrag:f,selectionMode:m,onSelectionStart:g,onSelectionEnd:x,multiSelectionKeyCode:p,panActivationKeyCode:b,zoomActivationKeyCode:y,elementsSelectable:v,zoomOnScroll:w,zoomOnPinch:j,panOnScroll:C,panOnScrollSpeed:N,panOnScrollMode:S,zoomOnDoubleClick:E,panOnDrag:T,defaultViewport:I,translateExtent:M,minZoom:F,maxZoom:D,preventScrolling:R,onSelectionContextMenu:P,noWheelClassName:z,noPanClassName:_,disableKeyboardA11y:k})=>{const B=dt(uM),A=Si(h),U=Si(b),$=U||T,J=U||C,G=A||f&&$!==!0;return(({deleteKeyCode:K,multiSelectionKeyCode:W})=>{const X=zt(),{deleteElements:V}=Ni(),Q=Si(K,nM),te=Si(W);O.useEffect(()=>{if(Q){const{edges:re,getNodes:ne}=X.getState(),ie=ne().filter(ae=>ae.selected),se=re.filter(ae=>ae.selected);V({nodes:ie,edges:se}),X.setState({nodesSelectionActive:!1})}},[Q]),O.useEffect(()=>{X.setState({multiSelectionActive:te})},[te])})({deleteKeyCode:a,multiSelectionKeyCode:p}),q.createElement(rM,{onMove:l,onMoveStart:c,onMoveEnd:d,onPaneContextMenu:s,elementsSelectable:v,zoomOnScroll:w,zoomOnPinch:j,panOnScroll:J,panOnScrollSpeed:N,panOnScrollMode:S,zoomOnDoubleClick:E,panOnDrag:!A&&$,defaultViewport:I,translateExtent:M,minZoom:F,maxZoom:D,zoomActivationKeyCode:y,preventScrolling:R,noWheelClassName:z,noPanClassName:_},q.createElement(Y2,{onSelectionStart:g,onSelectionEnd:x,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:i,panOnDrag:$,isSelecting:!!G,selectionMode:m},t,B&&q.createElement(dM,{onSelectionContextMenu:P,noPanClassName:_,disableKeyboardA11y:k})))};tw.displayName="FlowRenderer";var hM=O.memo(tw);function fM(t){return{input:_i(t.input||T2),default:_i(t.default||rf),output:_i(t.output||O2),group:_i(t.group||sf),...Object.keys(t).filter(e=>!["input","default","output","group"].includes(e)).reduce((e,n)=>(e[n]=_i(t[n]||rf),e),{})}}const mM=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,updateNodeDimensions:t.updateNodeDimensions,onError:t.onError}),nw=t=>{const{nodesDraggable:e,nodesConnectable:n,nodesFocusable:o,elementsSelectable:r,updateNodeDimensions:s,onError:i}=dt(mM,Wt),a=(l=t.onlyRenderVisibleElements,dt(O.useCallback(h=>l?v2(h.nodeInternals,{x:0,y:0,width:h.width,height:h.height},h.transform,!0):h.getNodes(),[l])));var l;const c=O.useRef(),d=O.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const h=new ResizeObserver(f=>{const m=f.map(g=>({id:g.target.getAttribute("data-id"),nodeElement:g.target,forceUpdate:!0}));s(m)});return c.current=h,h},[]);return O.useEffect(()=>()=>{var h;(h=c==null?void 0:c.current)==null||h.disconnect()},[]),q.createElement("div",{className:"react-flow__nodes",style:lf},a.map(h=>{var C,N,S;let f=h.type||"default";t.nodeTypes[f]||(i==null||i("003",ST(f)),f="default");const m=t.nodeTypes[f]||t.nodeTypes.default,g=!!(h.draggable||e&&h.draggable===void 0),x=!!(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?Vh(h.positionAbsolute,t.nodeExtent):h.positionAbsolute,v=(y==null?void 0:y.x)??0,w=(y==null?void 0:y.y)??0,j=(({x:E,y:T,width:I,height:M,origin:F})=>I&&M?F[0]<0||F[1]<0||F[0]>1||F[1]>1?{x:E,y:T}:{x:E-I*F[0],y:T-M*F[1]}:{x:E,y:T})({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:j.x,yPosOrigin:j.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:g,isSelectable:x,isConnectable:p,isFocusable:b,resizeObserver:d,dragHandle:h.dragHandle,zIndex:((C=h[yt])==null?void 0:C.z)??0,isParent:!!((N=h[yt])!=null&&N.isParent),noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,initialized:!!h.width&&!!h.height,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,ariaLabel:h.ariaLabel,hasHandleBounds:!!((S=h[yt])!=null&&S.handleBounds)})}))};nw.displayName="NodeRenderer";var pM=O.memo(nw);const gM=(t,e,n)=>n===Oe.Left?t-e:n===Oe.Right?t+e:t,xM=(t,e,n)=>n===Oe.Top?t-e:n===Oe.Bottom?t+e:t,ow="react-flow__edgeupdater",rw=({position:t,centerX:e,centerY:n,radius:o=10,onMouseDown:r,onMouseEnter:s,onMouseOut:i,type:a})=>q.createElement("circle",{onMouseDown:r,onMouseEnter:s,onMouseOut:i,className:Qt([ow,`${ow}-${a}`]),cx:gM(e,o,t),cy:xM(n,o,t),r:o,stroke:"transparent",fill:"transparent"}),bM=()=>!0;var rs=t=>{const e=({id:n,className:o,type:r,data:s,onClick:i,onEdgeDoubleClick:a,selected:l,animated:c,label:d,labelStyle:h,labelShowBg:f,labelBgStyle:m,labelBgPadding:g,labelBgBorderRadius:x,style:p,source:b,target:y,sourceX:v,sourceY:w,targetX:j,targetY:C,sourcePosition:N,targetPosition:S,elementsSelectable:E,hidden:T,sourceHandleId:I,targetHandleId:M,onContextMenu:F,onMouseEnter:D,onMouseMove:R,onMouseLeave:P,reconnectRadius:z,onReconnect:_,onReconnectStart:k,onReconnectEnd:B,markerEnd:A,markerStart:U,rfId:$,ariaLabel:J,isFocusable:G,isReconnectable:K,pathOptions:W,interactionWidth:X,disableKeyboardA11y:V})=>{const Q=O.useRef(null),[te,re]=O.useState(!1),[ne,ie]=O.useState(!1),se=zt(),ae=O.useMemo(()=>`url('#${Qh(U,$)}')`,[U,$]),ge=O.useMemo(()=>`url('#${Qh(A,$)}')`,[A,$]);if(T)return null;const oe=ki(n,se.getState,a),ue=ki(n,se.getState,F),de=ki(n,se.getState,D),Se=ki(n,se.getState,R),Te=ki(n,se.getState,P),Fe=(Ve,Ke)=>{if(Ve.button!==0)return;const{edges:ee,isValidConnection:ye}=se.getState(),we=Ke?y:b,Ie=(Ke?M:I)||null,Y=Ke?"target":"source",me=ye||bM,pe=Ke,he=ee.find(Ce=>Ce.id===n);ie(!0),k==null||k(Ve,he,Y),N2({event:Ve,handleId:Ie,nodeId:we,onConnect:Ce=>_==null?void 0:_(he,Ce),isTarget:pe,getState:se.getState,setState:se.setState,isValidConnection:me,edgeUpdaterType:Y,onReconnectEnd:Ce=>{ie(!1),B==null||B(Ce,he,Y)}})},_e=()=>re(!0),ke=()=>re(!1),Ye=!E&&!i;return q.createElement("g",{className:Qt(["react-flow__edge",`react-flow__edge-${r}`,o,{selected:l,animated:c,inactive:Ye,updating:te}]),onClick:Ve=>{var Y;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]}),(Y=Q.current)==null||Y.blur()):ee([n])),i&&i(Ve,Ie))},onDoubleClick:oe,onContextMenu:ue,onMouseEnter:de,onMouseMove:Se,onMouseLeave:Te,onKeyDown:G?Ve=>{var Ke;if(!V&&i2.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:G?0:void 0,role:G?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":J===null?void 0:J||`Edge from ${b} to ${y}`,"aria-describedby":G?`${L2}-${$}`:void 0,ref:Q},!ne&&q.createElement(t,{id:n,source:b,target:y,selected:l,animated:c,label:d,labelStyle:h,labelShowBg:f,labelBgStyle:m,labelBgPadding:g,labelBgBorderRadius:x,data:s,style:p,sourceX:v,sourceY:w,targetX:j,targetY:C,sourcePosition:N,targetPosition:S,sourceHandleId:I,targetHandleId:M,markerStart:ae,markerEnd:ge,pathOptions:W,interactionWidth:X}),K&&q.createElement(q.Fragment,null,(K==="source"||K===!0)&&q.createElement(rw,{position:N,centerX:v,centerY:w,radius:z,onMouseDown:Ve=>Fe(Ve,!0),onMouseEnter:_e,onMouseOut:ke,type:"source"}),(K==="target"||K===!0)&&q.createElement(rw,{position:S,centerX:j,centerY:C,radius:z,onMouseDown:Ve=>Fe(Ve,!1),onMouseEnter:_e,onMouseOut:ke,type:"target"})))};return e.displayName="EdgeWrapper",O.memo(e)};function yM(t){return{default:rs(t.default||$l),straight:rs(t.bezier||Jh),step:rs(t.step||Xh),smoothstep:rs(t.step||Bl),simplebezier:rs(t.simplebezier||Yh),...Object.keys(t).filter(e=>!["default","bezier"].includes(e)).reduce((e,n)=>(e[n]=rs(t[n]||$l),e),{})}}function sw(t,e,n=null){const o=((n==null?void 0:n.x)||0)+e.x,r=((n==null?void 0:n.y)||0)+e.y,s=(n==null?void 0:n.width)||e.width,i=(n==null?void 0:n.height)||e.height;switch(t){case Oe.Top:return{x:o+s/2,y:r};case Oe.Right:return{x:o+s,y:r+i/2};case Oe.Bottom:return{x:o+s/2,y:r+i};case Oe.Left:return{x:o,y:r+i/2}}}function iw(t,e){return t?t.length!==1&&e?e&&t.find(n=>n.id===e)||null:t[0]:null}function aw(t){var o,r,s,i,a;const e=((o=t==null?void 0:t[yt])==null?void 0:o.handleBounds)||null,n=e&&(t==null?void 0:t.width)&&(t==null?void 0:t.height)&&((r=t==null?void 0:t.positionAbsolute)==null?void 0:r.x)!==void 0&&((s=t==null?void 0:t.positionAbsolute)==null?void 0:s.y)!==void 0;return[{x:((i=t==null?void 0:t.positionAbsolute)==null?void 0:i.x)||0,y:((a=t==null?void 0:t.positionAbsolute)==null?void 0:a.y)||0,width:(t==null?void 0:t.width)||0,height:(t==null?void 0:t.height)||0},e,!!n]}const vM=[{level:0,isMaxLevel:!0,edges:[]}];function wM(t,e,n){return function(o,r,s=!1){let i=-1;const a=o.reduce((c,d)=>{var m,g;const h=Nn(d.zIndex);let f=h?d.zIndex:0;if(s){const x=r.get(d.target),p=r.get(d.source),b=d.selected||(x==null?void 0:x.selected)||(p==null?void 0:p.selected),y=Math.max(((m=p==null?void 0:p[yt])==null?void 0:m.z)||0,((g=x==null?void 0:x[yt])==null?void 0:g.z)||0,1e3);f=(h?d.zIndex:0)+(b?y:0)}return c[f]?c[f].push(d):c[f]=[d],i=f>i?f:i,c},{}),l=Object.entries(a).map(([c,d])=>{const h=+c;return{edges:d,level:h,isMaxLevel:h===i}});return l.length===0?vM:l}(dt(O.useCallback(o=>t?o.edges.filter(r=>{const s=e.get(r.source),i=e.get(r.target);return(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&(i==null?void 0:i.width)&&(i==null?void 0:i.height)&&function({sourcePos:a,targetPos:l,sourceWidth:c,sourceHeight:d,targetWidth:h,targetHeight:f,width:m,height:g,transform:x}){const p={x:Math.min(a.x,l.x),y:Math.min(a.y,l.y),x2:Math.max(a.x+c,l.x+h),y2:Math.max(a.y+d,l.y+f)};p.x===p.x2&&(p.x2+=1),p.y===p.y2&&(p.y2+=1);const b=Hh({x:(0-x[0])/x[2],y:(0-x[1])/x[2],width:m/x[2],height:g/x[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:i.positionAbsolute||{x:0,y:0},sourceWidth:s.width,sourceHeight:s.height,targetWidth:i.width,targetHeight:i.height,width:o.width,height:o.height,transform:o.transform})}):o.edges,[t,e])),e,n)}const lw={[Jr.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"}),[Jr.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"})},kM=({id:t,type:e,color:n,width:o=12.5,height:r=12.5,markerUnits:s="strokeWidth",strokeWidth:i,orient:a="auto-start-reverse"})=>{const l=function(c){const d=zt();return O.useMemo(()=>{var h,f;return Object.prototype.hasOwnProperty.call(lw,c)?lw[c]:((f=(h=d.getState()).onError)==null||f.call(h,"009",_T(c)),null)},[c])}(e);return l?q.createElement("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${o}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:a,refX:"0",refY:"0"},q.createElement(l,{color:n,strokeWidth:i})):null},cw=({defaultColor:t,rfId:e})=>{const n=dt(O.useCallback((({defaultColor:o,rfId:r})=>s=>{const i=[];return s.edges.reduce((a,l)=>([l.markerStart,l.markerEnd].forEach(c=>{if(c&&typeof c=="object"){const d=Qh(c,r);i.includes(d)||(a.push({id:d,color:c.color||o,...c}),i.push(d))}}),a),[]).sort((a,l)=>a.id.localeCompare(l.id))})({defaultColor:t,rfId:e}),[t,e]),(o,r)=>!(o.length!==r.length||o.some((s,i)=>s.id!==r[i].id)));return q.createElement("defs",null,n.map(o=>q.createElement(kM,{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})))};cw.displayName="MarkerDefinitions";var CM=O.memo(cw);const jM=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}),dw=({defaultMarkerColor:t,onlyRenderVisibleElements:e,elevateEdgesOnSelect:n,rfId:o,edgeTypes:r,noPanClassName:s,onEdgeContextMenu:i,onEdgeMouseEnter:a,onEdgeMouseMove:l,onEdgeMouseLeave:c,onEdgeClick:d,onEdgeDoubleClick:h,onReconnect:f,onReconnectStart:m,onReconnectEnd:g,reconnectRadius:x,children:p,disableKeyboardA11y:b})=>{const{edgesFocusable:y,edgesUpdatable:v,elementsSelectable:w,width:j,height:C,connectionMode:N,nodeInternals:S,onError:E}=dt(jM,Wt),T=wM(e,S,n);return j?q.createElement(q.Fragment,null,T.map(({level:I,edges:M,isMaxLevel:F})=>q.createElement("svg",{key:I,style:{zIndex:I},width:j,height:C,className:"react-flow__edges react-flow__container"},F&&q.createElement(CM,{defaultColor:t,rfId:o}),q.createElement("g",null,M.map(D=>{const[R,P,z]=aw(S.get(D.source)),[_,k,B]=aw(S.get(D.target));if(!z||!B)return null;let A=D.type||"default";r[A]||(E==null||E("011",TT(A)),A="default");const U=r[A]||r.default,$=N===fr.Strict?k.target:(k.target??[]).concat(k.source??[]),J=iw(P.source,D.sourceHandle),G=iw($,D.targetHandle),K=(J==null?void 0:J.position)||Oe.Bottom,W=(G==null?void 0:G.position)||Oe.Top,X=!!(D.focusable||y&&D.focusable===void 0),V=D.reconnectable||D.updatable,Q=f!==void 0&&(V||v&&V===void 0);if(!J||!G)return E==null||E("008",IT(J,D)),null;const{sourceX:te,sourceY:re,targetX:ne,targetY:ie}=((se,ae,ge,oe,ue,de)=>{const Se=sw(ge,se,ae),Te=sw(de,oe,ue);return{sourceX:Se.x,sourceY:Se.y,targetX:Te.x,targetY:Te.y}})(R,J,K,_,G,W);return q.createElement(U,{key:D.id,id:D.id,className:Qt([D.className,s]),type:A,data:D.data,selected:!!D.selected,animated:!!D.animated,hidden:!!D.hidden,label:D.label,labelStyle:D.labelStyle,labelShowBg:D.labelShowBg,labelBgStyle:D.labelBgStyle,labelBgPadding:D.labelBgPadding,labelBgBorderRadius:D.labelBgBorderRadius,style:D.style,source:D.source,target:D.target,sourceHandleId:D.sourceHandle,targetHandleId:D.targetHandle,markerEnd:D.markerEnd,markerStart:D.markerStart,sourceX:te,sourceY:re,targetX:ne,targetY:ie,sourcePosition:K,targetPosition:W,elementsSelectable:w,onContextMenu:i,onMouseEnter:a,onMouseMove:l,onMouseLeave:c,onClick:d,onEdgeDoubleClick:h,onReconnect:f,onReconnectStart:m,onReconnectEnd:g,reconnectRadius:x,rfId:o,ariaLabel:D.ariaLabel,isFocusable:X,isReconnectable:Q,pathOptions:"pathOptions"in D?D.pathOptions:void 0,interactionWidth:D.interactionWidth,disableKeyboardA11y:b})})))),p):null};dw.displayName="EdgeRenderer";var SM=O.memo(dw);const NM=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function EM({children:t}){const e=dt(NM);return q.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:e}},t)}const _M={[Oe.Left]:Oe.Right,[Oe.Right]:Oe.Left,[Oe.Top]:Oe.Bottom,[Oe.Bottom]:Oe.Top},uw=({nodeId:t,handleType:e,style:n,type:o=Uo.Bezier,CustomComponent:r,connectionStatus:s})=>{var C,N,S;const{fromNode:i,handleId:a,toX:l,toY:c,connectionMode:d}=dt(O.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]),Wt),h=(C=i==null?void 0:i[yt])==null?void 0:C.handleBounds;let f=h==null?void 0:h[e];if(d===fr.Loose&&(f=f||(h==null?void 0:h[e==="source"?"target":"source"])),!i||!f)return null;const m=a?f.find(E=>E.id===a):f[0],g=m?m.x+m.width/2:(i.width??0)/2,x=m?m.y+m.height/2:i.height??0,p=(((N=i.positionAbsolute)==null?void 0:N.x)??0)+g,b=(((S=i.positionAbsolute)==null?void 0:S.y)??0)+x,y=m==null?void 0:m.position,v=y?_M[y]:null;if(!y||!v)return null;if(r)return q.createElement(r,{connectionLineType:o,connectionLineStyle:n,fromNode:i,fromHandle:m,fromX:p,fromY:b,toX:l,toY:c,fromPosition:y,toPosition:v,connectionStatus:s});let w="";const j={sourceX:p,sourceY:b,sourcePosition:y,targetX:l,targetY:c,targetPosition:v};return o===Uo.Bezier?[w]=b2(j):o===Uo.Step?[w]=Kh({...j,borderRadius:0}):o===Uo.SmoothStep?[w]=Kh(j):o===Uo.SimpleBezier?[w]=m2(j):w=`M${p},${b} ${l},${c}`,q.createElement("path",{d:w,fill:"none",className:"react-flow__connection-path",style:n})};uw.displayName="ConnectionLine";const IM=t=>({nodeId:t.connectionNodeId,handleType:t.connectionHandleType,nodesConnectable:t.nodesConnectable,connectionStatus:t.connectionStatus,width:t.width,height:t.height});function AM({containerStyle:t,style:e,type:n,component:o}){const{nodeId:r,handleType:s,nodesConnectable:i,width:a,height:l,connectionStatus:c}=dt(IM,Wt);return r&&s&&a&&i?q.createElement("svg",{style:t,width:a,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container"},q.createElement("g",{className:Qt(["react-flow__connection",c])},q.createElement(uw,{nodeId:r,handleType:s,style:e,type:n,CustomComponent:o,connectionStatus:c}))):null}function hw(t,e){return O.useRef(null),zt(),O.useMemo(()=>e(t),[t])}const fw=({nodeTypes:t,edgeTypes:e,onMove:n,onMoveStart:o,onMoveEnd:r,onInit:s,onNodeClick:i,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:h,onNodeMouseLeave:f,onNodeContextMenu:m,onSelectionContextMenu:g,onSelectionStart:x,onSelectionEnd:p,connectionLineType:b,connectionLineStyle:y,connectionLineComponent:v,connectionLineContainerStyle:w,selectionKeyCode:j,selectionOnDrag:C,selectionMode:N,multiSelectionKeyCode:S,panActivationKeyCode:E,zoomActivationKeyCode:T,deleteKeyCode:I,onlyRenderVisibleElements:M,elementsSelectable:F,selectNodesOnDrag:D,defaultViewport:R,translateExtent:P,minZoom:z,maxZoom:_,preventScrolling:k,defaultMarkerColor:B,zoomOnScroll:A,zoomOnPinch:U,panOnScroll:$,panOnScrollSpeed:J,panOnScrollMode:G,zoomOnDoubleClick:K,panOnDrag:W,onPaneClick:X,onPaneMouseEnter:V,onPaneMouseMove:Q,onPaneMouseLeave:te,onPaneScroll:re,onPaneContextMenu:ne,onEdgeContextMenu:ie,onEdgeMouseEnter:se,onEdgeMouseMove:ae,onEdgeMouseLeave:ge,onReconnect:oe,onReconnectStart:ue,onReconnectEnd:de,reconnectRadius:Se,noDragClassName:Te,noWheelClassName:Fe,noPanClassName:_e,elevateEdgesOnSelect:ke,disableKeyboardA11y:Ye,nodeOrigin:Ve,nodeExtent:Ke,rfId:ee})=>{const ye=hw(t,fM),we=hw(e,yM);return function(Ie){const Y=Ni(),me=O.useRef(!1);O.useEffect(()=>{!me.current&&Y.viewportInitialized&&Ie&&(setTimeout(()=>Ie(Y),1),me.current=!0)},[Ie,Y.viewportInitialized])}(s),q.createElement(hM,{onPaneClick:X,onPaneMouseEnter:V,onPaneMouseMove:Q,onPaneMouseLeave:te,onPaneContextMenu:ne,onPaneScroll:re,deleteKeyCode:I,selectionKeyCode:j,selectionOnDrag:C,selectionMode:N,onSelectionStart:x,onSelectionEnd:p,multiSelectionKeyCode:S,panActivationKeyCode:E,zoomActivationKeyCode:T,elementsSelectable:F,onMove:n,onMoveStart:o,onMoveEnd:r,zoomOnScroll:A,zoomOnPinch:U,zoomOnDoubleClick:K,panOnScroll:$,panOnScrollSpeed:J,panOnScrollMode:G,panOnDrag:W,defaultViewport:R,translateExtent:P,minZoom:z,maxZoom:_,onSelectionContextMenu:g,preventScrolling:k,noDragClassName:Te,noWheelClassName:Fe,noPanClassName:_e,disableKeyboardA11y:Ye},q.createElement(EM,null,q.createElement(SM,{edgeTypes:we,onEdgeClick:a,onEdgeDoubleClick:c,onlyRenderVisibleElements:M,onEdgeContextMenu:ie,onEdgeMouseEnter:se,onEdgeMouseMove:ae,onEdgeMouseLeave:ge,onReconnect:oe,onReconnectStart:ue,onReconnectEnd:de,reconnectRadius:Se,defaultMarkerColor:B,noPanClassName:_e,elevateEdgesOnSelect:!!ke,disableKeyboardA11y:Ye,rfId:ee},q.createElement(AM,{style:y,type:b,component:v,containerStyle:w})),q.createElement("div",{className:"react-flow__edgelabel-renderer"}),q.createElement(pM,{nodeTypes:ye,onNodeClick:i,onNodeDoubleClick:l,onNodeMouseEnter:d,onNodeMouseMove:h,onNodeMouseLeave:f,onNodeContextMenu:m,selectNodesOnDrag:D,onlyRenderVisibleElements:M,noPanClassName:_e,noDragClassName:Te,disableKeyboardA11y:Ye,nodeOrigin:Ve,nodeExtent:Ke,rfId:ee})))};fw.displayName="GraphView";var TM=O.memo(fw);const ff=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Ho={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:ff,nodeExtent:ff,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:fr.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},MM=()=>((t,e)=>t?Jv(t,e):Jv)((t,e)=>({...Ho,setNodes:n=>{const{nodeInternals:o,nodeOrigin:r,elevateNodesOnSelect:s}=e();t({nodeInternals:af(n,o,r,s)})},getNodes:()=>Array.from(e().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:o={}}=e();t({edges:n.map(r=>({...o,...r}))})},setDefaultNodesAndEdges:(n,o)=>{const r=n!==void 0,s=o!==void 0,i=r?af(n,new Map,e().nodeOrigin,e().elevateNodesOnSelect):new Map;t({nodeInternals:i,edges:s?o:[],hasDefaultNodes:r,hasDefaultEdges:s})},updateNodeDimensions:n=>{const{onNodesChange:o,nodeInternals:r,fitViewOnInit:s,fitViewOnInitDone:i,fitViewOnInitOptions:a,domNode:l,nodeOrigin:c}=e(),d=l==null?void 0:l.querySelector(".react-flow__viewport");if(!d)return;const h=window.getComputedStyle(d),{m22:f}=new window.DOMMatrixReadOnly(h.transform),m=n.reduce((x,p)=>{const b=r.get(p.id);if(b!=null&&b.hidden)r.set(b.id,{...b,[yt]:{...b[yt],handleBounds:void 0}});else if(b){const y=$h(p.nodeElement);!(!y.width||!y.height||b.width===y.width&&b.height===y.height&&!p.forceUpdate)&&(r.set(b.id,{...b,[yt]:{...b[yt],handleBounds:{source:Z2(".source",p.nodeElement,f,c),target:Z2(".target",p.nodeElement,f,c)}},...y}),x.push({id:b.id,type:"dimensions",dimensions:y}))}return x},[]);U2(r,c);const g=i||s&&!i&&$2(e,{initial:!0,...a});t({nodeInternals:new Map(r),fitViewOnInitDone:g}),(m==null?void 0:m.length)>0&&(o==null||o(m))},updateNodePositions:(n,o=!0,r=!1)=>{const{triggerNodeChanges:s}=e(),i=n.map(a=>{const l={id:a.id,type:"position",dragging:r};return o&&(l.positionAbsolute=a.positionAbsolute,l.position=a.position),l});s(i)},triggerNodeChanges:n=>{const{onNodesChange:o,nodeInternals:r,hasDefaultNodes:s,nodeOrigin:i,getNodes:a,elevateNodesOnSelect:l}=e();if(n!=null&&n.length){if(s){const c=af(G2(n,a()),r,i,l);t({nodeInternals:c})}o==null||o(n)}},addSelectedNodes:n=>{const{multiSelectionActive:o,edges:r,getNodes:s}=e();let i,a=null;o?i=n.map(l=>Vo(l,!0)):(i=ns(s(),n),a=ns(r,[])),Hl({changedNodes:i,changedEdges:a,get:e,set:t})},addSelectedEdges:n=>{const{multiSelectionActive:o,edges:r,getNodes:s}=e();let i,a=null;o?i=n.map(l=>Vo(l,!0)):(i=ns(r,n),a=ns(s(),[])),Hl({changedNodes:a,changedEdges:i,get:e,set:t})},unselectNodesAndEdges:({nodes:n,edges:o}={})=>{const{edges:r,getNodes:s}=e(),i=o||r;Hl({changedNodes:(n||s()).map(a=>(a.selected=!1,Vo(a.id,!1))),changedEdges:i.map(a=>Vo(a.id,!1)),get:e,set:t})},setMinZoom:n=>{const{d3Zoom:o,maxZoom:r}=e();o==null||o.scaleExtent([n,r]),t({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:o,minZoom:r}=e();o==null||o.scaleExtent([r,n]),t({maxZoom:n})},setTranslateExtent:n=>{var o;(o=e().d3Zoom)==null||o.translateExtent(n),t({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:o}=e();Hl({changedNodes:o().filter(r=>r.selected).map(r=>Vo(r.id,!1)),changedEdges:n.filter(r=>r.selected).map(r=>Vo(r.id,!1)),get:e,set:t})},setNodeExtent:n=>{const{nodeInternals:o}=e();o.forEach(r=>{r.positionAbsolute=Vh(r.position,n)}),t({nodeExtent:n,nodeInternals:new Map(o)})},panBy:n=>{const{transform:o,width:r,height:s,d3Zoom:i,d3Selection:a,translateExtent:l}=e();if(!i||!a||!n.x&&!n.y)return!1;const c=er.translate(o[0]+n.x,o[1]+n.y).scale(o[2]),d=[[0,0],[r,s]],h=i==null?void 0:i.constrain()(c,d,l);return i.transform(a,h),o[0]!==h.x||o[1]!==h.y||o[2]!==h.k},cancelConnection:()=>t({connectionNodeId:Ho.connectionNodeId,connectionHandleId:Ho.connectionHandleId,connectionHandleType:Ho.connectionHandleType,connectionStatus:Ho.connectionStatus,connectionStartHandle:Ho.connectionStartHandle,connectionEndHandle:Ho.connectionEndHandle}),reset:()=>t({...Ho})}),Object.is),mf=({children:t})=>{const e=O.useRef(null);return e.current||(e.current=MM()),q.createElement(jT,{value:e.current},t)};mf.displayName="ReactFlowProvider";const mw=({children:t})=>O.useContext(Pl)?q.createElement(q.Fragment,null,t):q.createElement(mf,null,t);mw.displayName="ReactFlowWrapper";const OM={input:T2,default:rf,output:O2,group:sf},DM={default:$l,straight:Jh,step:Xh,smoothstep:Bl,simplebezier:Yh},RM=[0,0],PM=[15,15],LM={x:0,y:0,zoom:1},FM={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},pf=O.forwardRef(({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,className:r,nodeTypes:s=OM,edgeTypes:i=DM,onNodeClick:a,onEdgeClick:l,onInit:c,onMove:d,onMoveStart:h,onMoveEnd:f,onConnect:m,onConnectStart:g,onConnectEnd:x,onClickConnectStart:p,onClickConnectEnd:b,onNodeMouseEnter:y,onNodeMouseMove:v,onNodeMouseLeave:w,onNodeContextMenu:j,onNodeDoubleClick:C,onNodeDragStart:N,onNodeDrag:S,onNodeDragStop:E,onNodesDelete:T,onEdgesDelete:I,onSelectionChange:M,onSelectionDragStart:F,onSelectionDrag:D,onSelectionDragStop:R,onSelectionContextMenu:P,onSelectionStart:z,onSelectionEnd:_,connectionMode:k=fr.Strict,connectionLineType:B=Uo.Bezier,connectionLineStyle:A,connectionLineComponent:U,connectionLineContainerStyle:$,deleteKeyCode:J="Backspace",selectionKeyCode:G="Shift",selectionOnDrag:K=!1,selectionMode:W=Ci.Full,panActivationKeyCode:X="Space",multiSelectionKeyCode:V=Fl()?"Meta":"Control",zoomActivationKeyCode:Q=Fl()?"Meta":"Control",snapToGrid:te=!1,snapGrid:re=PM,onlyRenderVisibleElements:ne=!1,selectNodesOnDrag:ie=!0,nodesDraggable:se,nodesConnectable:ae,nodesFocusable:ge,nodeOrigin:oe=RM,edgesFocusable:ue,edgesUpdatable:de,elementsSelectable:Se,defaultViewport:Te=LM,minZoom:Fe=.5,maxZoom:_e=2,translateExtent:ke=ff,preventScrolling:Ye=!0,nodeExtent:Ve,defaultMarkerColor:Ke="#b1b1b7",zoomOnScroll:ee=!0,zoomOnPinch:ye=!0,panOnScroll:we=!1,panOnScrollSpeed:Ie=.5,panOnScrollMode:Y=Bo.Free,zoomOnDoubleClick:me=!0,panOnDrag:pe=!0,onPaneClick:he,onPaneMouseEnter:Ce,onPaneMouseMove:Re,onPaneMouseLeave:Pe,onPaneScroll:He,onPaneContextMenu:le,children:Ae,onEdgeContextMenu:Me,onEdgeDoubleClick:Ue,onEdgeMouseEnter:qe,onEdgeMouseMove:De,onEdgeMouseLeave:$e,onEdgeUpdate:st,onEdgeUpdateStart:Xe,onEdgeUpdateEnd:it,onReconnect:Ut,onReconnectStart:qt,onReconnectEnd:xn,reconnectRadius:en=10,edgeUpdaterRadius:Ln=10,onNodesChange:is,onEdgesChange:Xn,noDragClassName:So="nodrag",noWheelClassName:_n="nowheel",noPanClassName:as="nopan",fitView:Ai=!1,fitViewOptions:mO,connectOnClick:pO=!0,attributionPosition:gO,proOptions:xO,defaultEdgeOptions:bO,elevateNodesOnSelect:yO=!0,elevateEdgesOnSelect:vO=!1,disableKeyboardA11y:i3=!1,autoPanOnConnect:wO=!0,autoPanOnNodeDrag:kO=!0,connectionRadius:CO=20,isValidConnection:jO,onError:SO,style:NO,id:a3,nodeDragThreshold:EO,..._O},IO)=>{const im=a3||"1";return q.createElement("div",{..._O,style:{...NO,...FM},ref:IO,className:Qt(["react-flow",r]),"data-testid":"rf__wrapper",id:a3},q.createElement(mw,null,q.createElement(TM,{onInit:c,onMove:d,onMoveStart:h,onMoveEnd:f,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:y,onNodeMouseMove:v,onNodeMouseLeave:w,onNodeContextMenu:j,onNodeDoubleClick:C,nodeTypes:s,edgeTypes:i,connectionLineType:B,connectionLineStyle:A,connectionLineComponent:U,connectionLineContainerStyle:$,selectionKeyCode:G,selectionOnDrag:K,selectionMode:W,deleteKeyCode:J,multiSelectionKeyCode:V,panActivationKeyCode:X,zoomActivationKeyCode:Q,onlyRenderVisibleElements:ne,selectNodesOnDrag:ie,defaultViewport:Te,translateExtent:ke,minZoom:Fe,maxZoom:_e,preventScrolling:Ye,zoomOnScroll:ee,zoomOnPinch:ye,zoomOnDoubleClick:me,panOnScroll:we,panOnScrollSpeed:Ie,panOnScrollMode:Y,panOnDrag:pe,onPaneClick:he,onPaneMouseEnter:Ce,onPaneMouseMove:Re,onPaneMouseLeave:Pe,onPaneScroll:He,onPaneContextMenu:le,onSelectionContextMenu:P,onSelectionStart:z,onSelectionEnd:_,onEdgeContextMenu:Me,onEdgeDoubleClick:Ue,onEdgeMouseEnter:qe,onEdgeMouseMove:De,onEdgeMouseLeave:$e,onReconnect:Ut??st,onReconnectStart:qt??Xe,onReconnectEnd:xn??it,reconnectRadius:en??Ln,defaultMarkerColor:Ke,noDragClassName:So,noWheelClassName:_n,noPanClassName:as,elevateEdgesOnSelect:vO,rfId:im,disableKeyboardA11y:i3,nodeOrigin:oe,nodeExtent:Ve}),q.createElement(GT,{nodes:t,edges:e,defaultNodes:n,defaultEdges:o,onConnect:m,onConnectStart:g,onConnectEnd:x,onClickConnectStart:p,onClickConnectEnd:b,nodesDraggable:se,nodesConnectable:ae,nodesFocusable:ge,edgesFocusable:ue,edgesUpdatable:de,elementsSelectable:Se,elevateNodesOnSelect:yO,minZoom:Fe,maxZoom:_e,nodeExtent:Ve,onNodesChange:is,onEdgesChange:Xn,snapToGrid:te,snapGrid:re,connectionMode:k,translateExtent:ke,connectOnClick:pO,defaultEdgeOptions:bO,fitView:Ai,fitViewOptions:mO,onNodesDelete:T,onEdgesDelete:I,onNodeDragStart:N,onNodeDrag:S,onNodeDragStop:E,onSelectionDrag:D,onSelectionDragStart:F,onSelectionDragStop:R,noPanClassName:as,nodeOrigin:oe,rfId:im,autoPanOnConnect:wO,autoPanOnNodeDrag:kO,onError:SO,connectionRadius:CO,isValidConnection:jO,nodeDragThreshold:EO}),q.createElement(WT,{onSelectionChange:M}),Ae,q.createElement(DT,{proOptions:xO,position:gO}),q.createElement(JT,{rfId:im,disableKeyboardA11y:i3})))});function pw(t){return e=>{const[n,o]=O.useState(e),r=O.useCallback(s=>o(i=>t(s,i)),[]);return[n,o,r]}}pf.displayName="ReactFlow";const gw=pw(G2),xw=pw(function(t,e){return q2(t,e)});function zM(){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 BM(){return q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},q.createElement("path",{d:"M0 0h32v4.2H0z"}))}function UM(){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 $M(){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 VM(){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 ss=({children:t,className:e,...n})=>q.createElement("button",{type:"button",className:Qt(["react-flow__controls-button",e]),...n},t);ss.displayName="ControlButton";const HM=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom}),bw=({style:t,showZoom:e=!0,showFitView:n=!0,showInteractive:o=!0,fitViewOptions:r,onZoomIn:s,onZoomOut:i,onFitView:a,onInteractiveChange:l,className:c,children:d,position:h="bottom-left"})=>{const f=zt(),[m,g]=O.useState(!1),{isInteractive:x,minZoomReached:p,maxZoomReached:b}=dt(HM,Wt),{zoomIn:y,zoomOut:v,fitView:w}=Ni();return O.useEffect(()=>{g(!0)},[]),m?q.createElement(Ll,{className:Qt(["react-flow__controls",c]),position:h,style:t,"data-testid":"rf__controls"},e&&q.createElement(q.Fragment,null,q.createElement(ss,{onClick:()=>{y(),s==null||s()},className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:b},q.createElement(zM,null)),q.createElement(ss,{onClick:()=>{v(),i==null||i()},className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:p},q.createElement(BM,null))),n&&q.createElement(ss,{className:"react-flow__controls-fitview",onClick:()=>{w(r),a==null||a()},title:"fit view","aria-label":"fit view"},q.createElement(UM,null)),o&&q.createElement(ss,{className:"react-flow__controls-interactive",onClick:()=>{f.setState({nodesDraggable:!x,nodesConnectable:!x,elementsSelectable:!x}),l==null||l(!x)},title:"toggle interactivity","aria-label":"toggle interactivity"},x?q.createElement(VM,null):q.createElement($M,null)),d):null};bw.displayName="Controls";var En,WM=O.memo(bw);function qM({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 GM({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"})(En||(En={}));const YM={[En.Dots]:"#91919a",[En.Lines]:"#eee",[En.Cross]:"#e2e2e2"},KM={[En.Dots]:1,[En.Lines]:1,[En.Cross]:6},XM=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function yw({id:t,variant:e=En.Dots,gap:n=20,size:o,lineWidth:r=1,offset:s=2,color:i,style:a,className:l}){const c=O.useRef(null),{transform:d,patternId:h}=dt(XM,Wt),f=i||YM[e],m=o||KM[e],g=e===En.Dots,x=e===En.Cross,p=Array.isArray(n)?n:[n,n],b=[p[0]*d[2]||1,p[1]*d[2]||1],y=m*d[2],v=x?[y,y]:b,w=g?[y/s,y/s]:[v[0]/s,v[1]/s];return q.createElement("svg",{className:Qt(["react-flow__background",l]),style:{...a,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:c,"data-testid":"rf__background"},q.createElement("pattern",{id:h+t,x:d[0]%b[0],y:d[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${w[0]},-${w[1]})`},g?q.createElement(GM,{color:f,radius:y/s}):q.createElement(qM,{dimensions:v,color:f,lineWidth:r})),q.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${h+t})`}))}yw.displayName="Background";var JM=O.memo(yw);function gf(t){return Math.min(11*t+35,200)}const vw=q.createContext("LR"),ww=O.memo(t=>{const e=H.c(51),{data:n,selected:o}=t,r=je(n.atom),s=wr().inOrderIds.indexOf(r.id),i=o?"var(--gray-9)":"var(--gray-3)",a=dt(ZM),l=O.use(vw);let c,d,h,f,m;if(e[0]!==r.code||e[1]!==i||e[2]!==l||e[3]!==o){const I=r.code.split(`
|
|
160
160
|
`).length,M=l==="LR"?Oe.Left:Oe.Top;let F;e[8]!==i?(F={background:i},e[8]=i,e[9]=F):F=e[9],e[10]!==M||e[11]!==F?(h=u.jsx($o,{type:"target",id:"inputs",position:M,style:F}),e[10]=M,e[11]=F,e[12]=h):h=e[12];const D=l==="LR"?Oe.Left:Oe.Top;let R;e[13]!==i?(R={background:i},e[13]=i,e[14]=R):R=e[14],e[15]!==D||e[16]!==R?(f=u.jsx($o,{type:"source",id:"inputs",position:D,style:R}),e[15]=D,e[16]=R,e[17]=f):f=e[17];const P=o&&"border-primary";e[18]!==P?(d=xe("flex flex-col bg-card border border-input/50 rounded-md mx-[2px] overflow-hidden",P),e[18]=P,e[19]=d):d=e[19],c=gf(I),e[0]=r.code,e[1]=i,e[2]=l,e[3]=o,e[4]=c,e[5]=d,e[6]=h,e[7]=f}else c=e[4],d=e[5],h=e[6],f=e[7];var g;let x;e[20]!==n.forceWidth||e[21]!==a?(m=n.forceWidth||(g=a,Math.min(Math.max(g-100,100),400)),e[20]=n.forceWidth,e[21]=a,e[22]=m):m=e[22],e[23]!==c||e[24]!==m?(x={height:c,width:m},e[23]=c,e[24]=m,e[25]=x):x=e[25];const p=lL(r.name,s);let b,y,v;e[26]!==p?(b=u.jsx("div",{className:"text-muted-foreground font-semibold text-xs py-1 px-2 bg-muted border-b",children:p}),e[26]=p,e[27]=b):b=e[27],e[28]!==r.code?(y=u.jsx(FF,{code:r.code}),e[28]=r.code,e[29]=y):y=e[29],e[30]!==d||e[31]!==x||e[32]!==b||e[33]!==y?(v=u.jsxs("div",{className:d,style:x,children:[b,y]}),e[30]=d,e[31]=x,e[32]=b,e[33]=y,e[34]=v):v=e[34];const w=l==="LR"?Oe.Right:Oe.Bottom;let j,C;e[35]!==i?(j={background:i},e[35]=i,e[36]=j):j=e[36],e[37]!==w||e[38]!==j?(C=u.jsx($o,{type:"source",id:"outputs",position:w,style:j}),e[37]=w,e[38]=j,e[39]=C):C=e[39];const N=l==="LR"?Oe.Right:Oe.Bottom;let S,E,T;return e[40]!==i?(S={background:i},e[40]=i,e[41]=S):S=e[41],e[42]!==N||e[43]!==S?(E=u.jsx($o,{type:"target",id:"outputs",position:N,style:S}),e[42]=N,e[43]=S,e[44]=E):E=e[44],e[45]!==v||e[46]!==C||e[47]!==E||e[48]!==h||e[49]!==f?(T=u.jsxs("div",{children:[h,f,v,C,E]}),e[45]=v,e[46]=C,e[47]=E,e[48]=h,e[49]=f,e[50]=T):T=e[50],T},(t,e)=>["data","selected","id"].every(n=>t[n]===e[n]));ww.displayName="CustomNode";const kw={custom:ww};function ZM(t){const{width:e}=t;return e}const Cw=t=>{const e=H.c(18),{maxCount:n,cellIds:o,onClick:r,skipScroll:s}=t,i=wr();let a,l,c,d;if(e[0]!==o||e[1]!==i||e[2]!==n||e[3]!==r||e[4]!==s){c=Symbol.for("react.early_return_sentinel");e:{let h;e[8]!==i?(h=(g,x)=>i.inOrderIds.indexOf(g)-i.inOrderIds.indexOf(x),e[8]=i,e[9]=h):h=e[9];const f=[...o].sort(h);if(o.length===0){let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=u.jsx("div",{className:"text-muted-foreground",children:"--"}),e[10]=g):g=e[10],c=g;break e}let m;e[11]!==o.length||e[12]!==r||e[13]!==s?(m=(g,x)=>u.jsxs("span",{className:"truncate",children:[u.jsx(Mo,{variant:"focus",cellId:g,skipScroll:s,className:"whitespace-nowrap",onClick:r?()=>r(g):void 0},g),x<o.length-1&&", "]},g),e[11]=o.length,e[12]=r,e[13]=s,e[14]=m):m=e[14],a=f.slice(0,n).map(m),l=o.length>n&&u.jsxs(yr,{children:[u.jsx(ws,{asChild:!0,children:u.jsxs("span",{className:"whitespace-nowrap text-muted-foreground text-xs hover:underline cursor-pointer",children:["+",o.length-n," more"]})}),u.jsx(ps,{className:"w-auto",children:u.jsx("div",{className:"flex flex-col gap-1 py-1",children:f.slice(n).map(g=>u.jsx(Mo,{variant:"focus",cellId:g,className:"whitespace-nowrap",onClick:r?()=>r(g):void 0},g))})})]})}e[0]=o,e[1]=i,e[2]=n,e[3]=r,e[4]=s,e[5]=a,e[6]=l,e[7]=c}else a=e[5],l=e[6],c=e[7];return c!==Symbol.for("react.early_return_sentinel")?c:(e[15]!==a||e[16]!==l?(d=u.jsxs(u.Fragment,{children:[a,l]}),e[15]=a,e[16]=l,e[17]=d):d=e[17],d)},xf=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 i=n.length>1?"destructive":"outline";let a,l,c;return e[5]!==o||e[6]!==r?(a=async d=>{r?r(d):(await sn(o),Je({title:"Copied to clipboard"}))},e[5]=o,e[6]=r,e[7]=a):a=e[7],e[8]!==o||e[9]!==i||e[10]!==a?(l=u.jsx(HC,{title:o,variant:i,className:"rounded-sm text-ellipsis block overflow-hidden max-w-fit cursor-pointer font-medium",onClick:a,children:o}),e[8]=o,e[9]=i,e[10]=a,e[11]=l):l=e[11],e[12]!==s||e[13]!==l?(c=u.jsx("div",{className:"max-w-[130px]",...s,children:l}),e[12]=s,e[13]=l,e[14]=c):c=e[14],c},bf=O.memo(t=>{const e=H.c(38),{onChange:n,view:o,settings:r,onSettingsChange:s}=t;let i;e[0]!==s||e[1]!==r?(i=(D,R)=>{s({...r,[D]:R})},e[0]=s,e[1]=r,e[2]=i):i=e[2];const a=i;let l,c,d,h,f,m;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=u.jsx(ws,{asChild:!0,children:u.jsx(ve,{variant:"text",size:"xs",children:u.jsx(Nm,{className:"w-4 h-4"})})}),e[3]=l):l=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(c=u.jsx("div",{className:"font-semibold pb-4",children:"Settings"}),e[4]=c):c=e[4],e[5]!==a?(d=D=>a("hidePureMarkdown",!!D),e[5]=a,e[6]=d):d=e[6],e[7]!==r.hidePureMarkdown||e[8]!==d?(h=u.jsx(bC,{"data-testid":"hide-pure-markdown-checkbox",id:"hide-pure-markdown",checked:r.hidePureMarkdown,onCheckedChange:d}),e[7]=r.hidePureMarkdown,e[8]=d,e[9]=h):h=e[9],e[10]===Symbol.for("react.memo_cache_sentinel")?(f=u.jsx(xr,{htmlFor:"hide-pure-markdown",children:"Hide pure markdown"}),e[10]=f):f=e[10],e[11]!==h?(m=u.jsxs(yr,{children:[l,u.jsxs(ps,{className:"w-auto p-2 text-muted-foreground",children:[c,u.jsxs("div",{className:"flex items-center gap-2",children:[h,f]})]})]}),e[11]=h,e[12]=m):m=e[12];const g=m,x=o==="_minimap_";let p,b,y;e[13]!==n?(p=()=>n("_minimap_"),e[13]=n,e[14]=p):p=e[14],e[15]===Symbol.for("react.memo_cache_sentinel")?(b=u.jsx(Wp,{className:"w-4 h-4 mr-1"}),e[15]=b):b=e[15],e[16]!==x||e[17]!==p?(y=u.jsxs(ve,{variant:"outline",className:"bg-background","aria-selected":x,size:"xs",onClick:p,children:[b,"Mini Map"]}),e[16]=x,e[17]=p,e[18]=y):y=e[18];const v=o==="TB";let w,j,C;e[19]!==n?(w=()=>n("TB"),e[19]=n,e[20]=w):w=e[20],e[21]===Symbol.for("react.memo_cache_sentinel")?(j=u.jsx(fa,{className:"w-4 h-4 mr-1"}),e[21]=j):j=e[21],e[22]!==v||e[23]!==w?(C=u.jsxs(ve,{variant:"outline",className:"bg-background","aria-selected":v,size:"xs",onClick:w,children:[j,"Vertical Tree"]}),e[22]=v,e[23]=w,e[24]=C):C=e[24];const N=o==="LR";let S,E,T,I;e[25]!==n?(S=()=>n("LR"),e[25]=n,e[26]=S):S=e[26],e[27]===Symbol.for("react.memo_cache_sentinel")?(E=u.jsx(fa,{className:"w-4 h-4 mr-1 transform -rotate-90"}),e[27]=E):E=e[27],e[28]!==N||e[29]!==S?(T=u.jsxs(ve,{variant:"outline",className:"bg-background","aria-selected":N,size:"xs",onClick:S,children:[E," ","Horizontal Tree"]}),e[28]=N,e[29]=S,e[30]=T):T=e[30],e[31]!==y||e[32]!==C||e[33]!==T?(I=u.jsxs("div",{className:"flex gap-2",children:[y,C,T]}),e[31]=y,e[32]=C,e[33]=T,e[34]=I):I=e[34];const M=o!=="_minimap_"&&g;let F;return e[35]!==I||e[36]!==M?(F=u.jsxs(Ll,{position:"top-right",className:"flex flex-col items-end gap-2",children:[I,M]}),e[35]=I,e[36]=M,e[37]=F):F=e[37],F});bf.displayName="GraphToolbar";const ql=O.memo(t=>{const e=H.c(11),{selection:n,variables:o,onClearSelection:r}=t;if(!n)return null;const s=QM;let i;e[0]!==r||e[1]!==n.id||e[2]!==n.source||e[3]!==n.target||e[4]!==n.type||e[5]!==o?(i=()=>{if(n.type==="node"){const d=Object.values(o).filter(m=>m.usedBy.includes(n.id)),h=Object.values(o).filter(m=>m.declaredBy.includes(n.id)),f=(m,g)=>u.jsxs(u.Fragment,{children:[m.length===0&&u.jsx("div",{className:"text-muted-foreground text-sm text-center",children:"--"}),u.jsx("div",{className:"grid grid-cols-5 gap-3 items-center text-sm py-1 flex-1 empty:hidden",children:m.map(x=>u.jsxs(q.Fragment,{children:[u.jsx(xf,{declaredBy:x.declaredBy,name:x.name}),u.jsxs("div",{className:"truncate col-span-2",title:x.value??"",children:[x.value,u.jsxs("span",{className:"ml-1 truncate text-foreground/60 font-mono",children:["(",x.dataType,")"]})]}),u.jsx("div",{className:"truncate col-span-2 gap-1 items-center",children:u.jsx(Cw,{skipScroll:!0,onClick:()=>s(g==="in"?x.declaredBy[0]:x.usedBy[0],x.name),maxCount:3,cellIds:x.usedBy})})]},x.name))})]});return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"font-bold py-2 flex items-center gap-2 border-b px-3",children:[u.jsx(Jl,{className:"w-5 h-5"}),u.jsx(Mo,{cellId:n.id}),u.jsx("div",{className:"flex-1"}),u.jsx(jx,{cellId:n.id,children:u.jsx(ve,{variant:"ghost",size:"icon",children:u.jsx(td,{className:"w-4 h-4"})})}),u.jsx(ve,{variant:"text",size:"icon",onClick:()=>{r()},children:u.jsx(wn,{className:"w-4 h-4"})})]}),u.jsxs("div",{className:"text-sm flex flex-col py-3 pl-2 pr-4 flex-1 justify-center",children:[u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsxs("span",{className:"flex items-center gap-2 font-semibold",children:[u.jsx(mp,{className:"w-4 h-4"}),"Outputs"]}),f(h,"out")]}),u.jsx("hr",{className:"border-divider my-3"}),u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsxs("span",{className:"flex items-center gap-2 font-semibold",children:[u.jsx(nn,{className:"w-4 h-4"}),"Inputs"]}),f(d,"in")]})]})]})}if(n.type==="edge"){const d=Object.values(o).filter(h=>h.declaredBy.includes(n.source)&&h.usedBy.includes(n.target));return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"font-bold py-2 flex items-center gap-2 border-b px-3",children:[u.jsx(pa,{className:"w-4 h-4"}),u.jsx(Mo,{cellId:n.source}),u.jsx(Xc,{className:"w-4 h-4"}),u.jsx(Mo,{cellId:n.target})]}),u.jsx("div",{className:"grid grid-cols-4 gap-3 max-w-[350px] items-center text-sm p-3 flex-1",children:d.map(h=>u.jsxs(q.Fragment,{children:[u.jsx(xf,{declaredBy:h.declaredBy,name:h.name,onClick:()=>{s(h.declaredBy[0],h.name)}}),u.jsx("div",{className:"truncate text-foreground/60 font-mono",children:h.dataType}),u.jsx("div",{className:"truncate col-span-2",title:h.value??"",children:h.value})]},h.name))})]})}},e[0]=r,e[1]=n.id,e[2]=n.source,e[3]=n.target,e[4]=n.type,e[5]=o,e[6]=i):i=e[6];const a=i;let l,c;return e[7]!==a?(l=a(),e[7]=a,e[8]=l):l=e[8],e[9]!==l?(c=u.jsx(Ll,{position:"bottom-left",className:"max-h-[90%] flex flex-col w-[calc(100%-5rem)]",children:u.jsx("div",{className:"min-h-[100px] shadow-md rounded-md border max-w-[550px] border-primary/40 my-4 min-w-[240px] bg-(--slate-1) text-muted-foreground/80 flex flex-col overflow-y-auto",children:l})}),e[9]=l,e[10]=c):c=e[10],c});function QM(t,e){const n=Ri(t);n&&ep(n,e)}function jw(){const t=H.c(7),e=Ni(),n=dt(t7),o=dt(e7);let r;t[0]!==e?(r=()=>{e.fitView({duration:100})},t[0]=e,t[1]=r):r=t[1];const s=cL(r,100);let i,a;t[2]!==s||t[3]!==o||t[4]!==n?(i=()=>{n&&o&&s()},a=[n,o,s],t[2]=s,t[3]=o,t[4]=n,t[5]=i,t[6]=a):(i=t[5],a=t[6]),O.useEffect(i,a)}function e7(t){const{height:e}=t;return e}function t7(t){const{width:e}=t;return e}ql.displayName="GraphSelectionPanel";const Sw=new class{createEdge(t,e,n){return{type:"smoothstep",pathOptions:{offset:20,borderRadius:100},data:{direction:n},markerEnd:{type:Jr.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:gf(Qe.get(e).code.trim().split(`
|
|
161
161
|
`).length),position:{x:0,y:n+20}}}createElements(t,e,n,o){let r=0;const s=[],i=[];for(const[l,c]of Zm.zip(t,e)){const d=this.createNode(l,c,r);s.push(d),r=d.position.y+(d.height||0)}const a=new Set;for(const l of Object.values(n)){const{declaredBy:c,usedBy:d}=l;for(const h of c)for(const f of d){const m=`${h}-${f}`;a.has(m)||(a.add(m),i.push(this.createEdge(h,f,"inputs"),this.createEdge(h,f,"outputs")))}}return{nodes:s,edges:i}}},n7=t=>{const e=H.c(37),{cellIds:n,variables:o,cellAtoms:r,children:s}=t;let i;e[0]!==r||e[1]!==n||e[2]!==o?(i=Sw.createElements(n,r,o,!1),e[0]=r,e[1]=n,e[2]=o,e[3]=i):i=e[3];const{nodes:a,edges:l}=i;let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=[],e[4]=c):c=e[4];const[d,h]=xw(c),[f,m]=gw(a),[g,x]=O.useState(),[p,b]=O.useState(),y=O.useRef(!1);jw();const v=dt(o7);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 j=Le(w);let C,N,S,E;e[8]!==r||e[9]!==n||e[10]!==j||e[11]!==o?(C=()=>{y.current?j(Sw.createElements(n,r,o,!1)):y.current=!0},N=[n,o,r,j],e[8]=r,e[9]=n,e[10]=j,e[11]=o,e[12]=C,e[13]=N):(C=e[12],N=e[13]),O.useEffect(C,N),e[14]!==l||e[15]!==g||e[16]!==h?(S=()=>{if(g){const k=l.filter(B=>{const{source:A,target:U,data:$}=B;return A===g&&$.direction==="outputs"||U===g&&$.direction==="inputs"});h(k)}},E=[g,h,l],e[14]=l,e[15]=g,e[16]=h,e[17]=S,e[18]=E):(S=e[17],E=e[18]),O.useEffect(S,E);const T=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 J=$;let G;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],G=k.reduce(Q,Number.NEGATIVE_INFINITY),A[5]=B,A[6]=k,A[7]=G}else G=A[7];const K=G;let W,X,V;return A[10]!==J?(W=[Number.NEGATIVE_INFINITY,J],A[10]=J,A[11]=W):W=A[11],A[12]!==K?(X=[Number.POSITIVE_INFINITY,K],A[12]=K,A[13]=X):X=A[13],A[14]!==W||A[15]!==X?(V=[W,X],A[14]=W,A[15]=X,A[16]=V):V=A[16],U=V,U}(f,v);let I;e[19]===Symbol.for("react.memo_cache_sentinel")?(I=()=>{x(void 0),b(void 0)},e[19]=I):I=e[19];const M=I;let F;e[20]!==d||e[21]!==p||e[22]!==g||e[23]!==o?(F=()=>p?u.jsx(ql,{selection:{type:"edge",source:p.source,target:p.target},onClearSelection:M,variables:o,edges:d}):g?u.jsx(ql,{selection:{type:"node",id:g},variables:o,edges:d,onClearSelection:M}):null,e[20]=d,e[21]=p,e[22]=g,e[23]=o,e[24]=F):F=e[24];const D=F;let R,P,z,_;return e[25]!==h?(R=(k,B)=>{const A=B.id;x(A),b(void 0),h([])},e[25]=h,e[26]=R):R=e[26],e[27]===Symbol.for("react.memo_cache_sentinel")?(P=(k,B)=>{b(B)},e[27]=P):P=e[27],e[28]!==D?(z=D(),e[28]=D,e[29]=z):z=e[29],e[30]!==s||e[31]!==d||e[32]!==f||e[33]!==R||e[34]!==z||e[35]!==T?(_=u.jsxs(pf,{nodes:f,edges:d,nodeTypes:kw,translateExtent:T,onNodeClick:R,onNodeDoubleClick:r7,onEdgeClick:P,snapToGrid:!0,fitView:!0,elementsSelectable:!0,minZoom:1,maxZoom:1,draggable:!1,panOnScrollMode:Bo.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]=d,e[32]=f,e[33]=R,e[34]=z,e[35]=T,e[36]=_):_=e[36],_};function o7(t){const{height:e}=t;return e}function r7(t,e){WC(e.id,"focus")}var yf,Nw,Ew,_w,Iw,Aw,vf,Tw,wf,Mw,kf,Ow,Cf,Dw,jf,Rw,Sf,Pw,Nf,Lw,Ef,Fw,_f,zw,If,Bw,Af,Uw,Tf,$w,Mf,Vw,Of,Hw,Ww,qw,Gw,Yw,Kw,Xw,Df,Jw,Rf,Zw,Pf,Qw,Lf,ek,Ff,tk,zf,nk,Bf,ok,Uf,rk,$f,sk,Vf,ik,Hf,ak,Wf,lk,qf,ck,Gf,dk,uk,hk,fk,mk,pk,gk,Yf,xk,Kf,bk,yk,vk,Xf,wk,Jf,kk,Zf,Ck,Qf,jk,em,Sk,Nk,Ek,_k,Ik;function tm(){if(Nw)return yf;Nw=1;var t="\0";function e(s,i){s[i]?s[i]++:s[i]=1}function n(s,i){--s[i]||delete s[i]}function o(s,i,a,l){var c=""+i,d=""+a;if(!s&&c>d){var h=c;c=d,d=h}return c+""+d+""+(l===void 0?"\0":l)}function r(s,i){return o(s,i.v,i.w,i.name)}return yf=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(i=>Object.keys(s._in[i]).length===0)}sinks(){var s=this;return this.nodes().filter(i=>Object.keys(s._out[i]).length===0)}setNodes(s,i){var a=arguments,l=this;return s.forEach(function(c){a.length>1?l.setNode(c,i):l.setNode(c)}),this}setNode(s,i){return Object.hasOwn(this._nodes,s)?(arguments.length>1&&(this._nodes[s]=i),this):(this._nodes[s]=arguments.length>1?i:this._defaultNodeLabelFn(s),this._isCompound&&(this._parent[s]=t,this._children[s]={},this._children[t][s]=!0),this._in[s]={},this._preds[s]={},this._out[s]={},this._sucs[s]={},++this._nodeCount,this)}node(s){return this._nodes[s]}hasNode(s){return Object.hasOwn(this._nodes,s)}removeNode(s){var i=this;if(Object.hasOwn(this._nodes,s)){var a=l=>i.removeEdge(i._edgeObjs[l]);delete this._nodes[s],this._isCompound&&(this._removeFromParentsChildList(s),delete this._parent[s],this.children(s).forEach(function(l){i.setParent(l)}),delete this._children[s]),Object.keys(this._in[s]).forEach(a),delete this._in[s],delete this._preds[s],Object.keys(this._out[s]).forEach(a),delete this._out[s],delete this._sucs[s],--this._nodeCount}return this}setParent(s,i){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(i===void 0)i=t;else{for(var a=i+="";a!==void 0;a=this.parent(a))if(a===s)throw new Error("Setting "+i+" as parent of "+s+" would create a cycle");this.setNode(i)}return this.setNode(s),this._removeFromParentsChildList(s),this._parent[s]=i,this._children[i][s]=!0,this}_removeFromParentsChildList(s){delete this._children[this._parent[s]][s]}parent(s){if(this._isCompound){var i=this._parent[s];if(i!==t)return i}}children(s=t){if(this._isCompound){var i=this._children[s];if(i)return Object.keys(i)}else{if(s===t)return this.nodes();if(this.hasNode(s))return[]}}predecessors(s){var i=this._preds[s];if(i)return Object.keys(i)}successors(s){var i=this._sucs[s];if(i)return Object.keys(i)}neighbors(s){var i=this.predecessors(s);if(i){const l=new Set(i);for(var a of this.successors(s))l.add(a);return Array.from(l.values())}}isLeaf(s){return(this.isDirected()?this.successors(s):this.neighbors(s)).length===0}filterNodes(s){var i=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});i.setGraph(this.graph());var a=this;Object.entries(this._nodes).forEach(function([d,h]){s(d)&&i.setNode(d,h)}),Object.values(this._edgeObjs).forEach(function(d){i.hasNode(d.v)&&i.hasNode(d.w)&&i.setEdge(d,a.edge(d))});var l={};function c(d){var h=a.parent(d);return h===void 0||i.hasNode(h)?(l[d]=h,h):h in l?l[h]:c(h)}return this._isCompound&&i.nodes().forEach(d=>i.setParent(d,c(d))),i}setDefaultEdgeLabel(s){return this._defaultEdgeLabelFn=s,typeof s!="function"&&(this._defaultEdgeLabelFn=()=>s),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(s,i){var a=this,l=arguments;return s.reduce(function(c,d){return l.length>1?a.setEdge(c,d,i):a.setEdge(c,d),d}),this}setEdge(){var s,i,a,l,c=!1,d=arguments[0];typeof d=="object"&&d!==null&&"v"in d?(s=d.v,i=d.w,a=d.name,arguments.length===2&&(l=arguments[1],c=!0)):(s=d,i=arguments[1],a=arguments[3],arguments.length>2&&(l=arguments[2],c=!0)),s=""+s,i=""+i,a!==void 0&&(a=""+a);var h=o(this._isDirected,s,i,a);if(Object.hasOwn(this._edgeLabels,h))return c&&(this._edgeLabels[h]=l),this;if(a!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(s),this.setNode(i),this._edgeLabels[h]=c?l:this._defaultEdgeLabelFn(s,i,a);var f=function(m,g,x,p){var b=""+g,y=""+x;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,i,a);return s=f.v,i=f.w,Object.freeze(f),this._edgeObjs[h]=f,e(this._preds[i],s),e(this._sucs[s],i),this._in[i][h]=f,this._out[s][h]=f,this._edgeCount++,this}edge(s,i,a){var l=arguments.length===1?r(this._isDirected,arguments[0]):o(this._isDirected,s,i,a);return this._edgeLabels[l]}edgeAsObj(){const s=this.edge(...arguments);return typeof s!="object"?{label:s}:s}hasEdge(s,i,a){var l=arguments.length===1?r(this._isDirected,arguments[0]):o(this._isDirected,s,i,a);return Object.hasOwn(this._edgeLabels,l)}removeEdge(s,i,a){var l=arguments.length===1?r(this._isDirected,arguments[0]):o(this._isDirected,s,i,a),c=this._edgeObjs[l];return c&&(s=c.v,i=c.w,delete this._edgeLabels[l],delete this._edgeObjs[l],n(this._preds[i],s),n(this._sucs[s],i),delete this._in[i][l],delete this._out[s][l],this._edgeCount--),this}inEdges(s,i){var a=this._in[s];if(a){var l=Object.values(a);return i?l.filter(c=>c.v===i):l}}outEdges(s,i){var a=this._out[s];if(a){var l=Object.values(a);return i?l.filter(c=>c.w===i):l}}nodeEdges(s,i){var a=this.inEdges(s,i);if(a)return a.concat(this.outEdges(s,i))}},yf}function s7(){return Aw?Iw:(Aw=1,Iw={Graph:tm(),version:_w?Ew:(_w=1,Ew="2.2.4")})}function i7(){if(Tw)return vf;Tw=1;var t=tm();function e(o){return o.nodes().map(function(r){var s=o.node(r),i=o.parent(r),a={v:r};return s!==void 0&&(a.value=s),i!==void 0&&(a.parent=i),a})}function n(o){return o.edges().map(function(r){var s=o.edge(r),i={v:r.v,w:r.w};return r.name!==void 0&&(i.name=r.name),s!==void 0&&(i.value=s),i})}return vf={write:function(o){var r={options:{directed:o.isDirected(),multigraph:o.isMultigraph(),compound:o.isCompound()},nodes:e(o),edges:n(o)};return o.graph()!==void 0&&(r.value=structuredClone(o.graph())),r},read:function(o){var r=new t(o.options).setGraph(o.value);return o.nodes.forEach(function(s){r.setNode(s.v,s.value),s.parent&&r.setParent(s.v,s.parent)}),o.edges.forEach(function(s){r.setEdge({v:s.v,w:s.w,name:s.name},s.value)}),r}},vf}function a7(){return Mw||(Mw=1,wf=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}),wf}function Ak(){return Ow?kf:(Ow=1,kf=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}},kf)}function Tk(){if(Dw)return Cf;Dw=1;var t=Ak();Cf=function(n,o,r,s){return function(i,a,l,c){var d,h,f={},m=new t,g=function(x){var p=x.v!==d?x.v:x.w,b=f[p],y=l(x),v=h.distance+y;if(y<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+x+" Weight: "+y);v<b.distance&&(b.distance=v,b.predecessor=d,m.decrease(p,v))};for(i.nodes().forEach(function(x){var p=x===a?0:Number.POSITIVE_INFINITY;f[x]={distance:p},m.add(x,p)});m.size()>0&&(d=m.removeMin(),(h=f[d]).distance!==Number.POSITIVE_INFINITY);)c(d).forEach(g);return f}(n,String(o),r||e,s||function(i){return n.outEdges(i)})};var e=()=>1;return Cf}function l7(){if(Rw)return jf;Rw=1;var t=Tk();return jf=function(e,n,o){return e.nodes().reduce(function(r,s){return r[s]=t(e,s,n,o),r},{})},jf}function Mk(){return Pw||(Pw=1,Sf=function(t){var e=0,n=[],o={},r=[];function s(i){var a=o[i]={onStack:!0,lowlink:e,index:e++};if(n.push(i),t.successors(i).forEach(function(d){Object.hasOwn(o,d)?o[d].onStack&&(a.lowlink=Math.min(a.lowlink,o[d].index)):(s(d),a.lowlink=Math.min(a.lowlink,o[d].lowlink))}),a.lowlink===a.index){var l,c=[];do l=n.pop(),o[l].onStack=!1,c.push(l);while(i!==l);r.push(c)}}return t.nodes().forEach(function(i){Object.hasOwn(o,i)||s(i)}),r}),Sf}function c7(){if(Lw)return Nf;Lw=1;var t=Mk();return Nf=function(e){return t(e).filter(function(n){return n.length>1||n.length===1&&e.hasEdge(n[0],n[0])})},Nf}function d7(){if(Fw)return Ef;Fw=1,Ef=function(e,n,o){return function(r,s,i){var a={},l=r.nodes();return l.forEach(function(c){a[c]={},a[c][c]={distance:0},l.forEach(function(d){c!==d&&(a[c][d]={distance:Number.POSITIVE_INFINITY})}),i(c).forEach(function(d){var h=d.v===c?d.w:d.v,f=s(d);a[c][h]={distance:f,predecessor:c}})}),l.forEach(function(c){var d=a[c];l.forEach(function(h){var f=a[h];l.forEach(function(m){var g=f[c],x=d[m],p=f[m],b=g.distance+x.distance;b<p.distance&&(p.distance=b,p.predecessor=x.predecessor)})})}),a}(e,n||t,o||function(r){return e.outEdges(r)})};var t=()=>1;return Ef}function Ok(){if(zw)return _f;function t(n){var o={},r={},s=[];if(n.sinks().forEach(function i(a){if(Object.hasOwn(r,a))throw new e;Object.hasOwn(o,a)||(r[a]=!0,o[a]=!0,n.predecessors(a).forEach(i),delete r[a],s.push(a))}),Object.keys(o).length!==n.nodeCount())throw new e;return s}zw=1;class e extends Error{constructor(){super(...arguments)}}return _f=t,t.CycleException=e,_f}function u7(){if(Bw)return If;Bw=1;var t=Ok();return If=function(e){try{t(e)}catch(n){if(n instanceof t.CycleException)return!1;throw n}return!0},If}function Dk(){if(Uw)return Af;function t(o,r,s,i){for(var a=[[o,!1]];a.length>0;){var l=a.pop();l[1]?i.push(l[0]):Object.hasOwn(s,l[0])||(s[l[0]]=!0,a.push([l[0],!0]),n(r(l[0]),c=>a.push([c,!1])))}}function e(o,r,s,i){for(var a=[o];a.length>0;){var l=a.pop();Object.hasOwn(s,l)||(s[l]=!0,i.push(l),n(r(l),c=>a.push(c)))}}function n(o,r){for(var s=o.length;s--;)r(o[s],s,o);return o}return Uw=1,Af=function(o,r,s){Array.isArray(r)||(r=[r]);var i=o.isDirected()?d=>o.successors(d):d=>o.neighbors(d),a=s==="post"?t:e,l=[],c={};return r.forEach(d=>{if(!o.hasNode(d))throw new Error("Graph does not have node: "+d);a(d,i,c,l)}),l},Af}function h7(){if($w)return Tf;$w=1;var t=Dk();return Tf=function(e,n){return t(e,n,"post")},Tf}function f7(){if(Vw)return Mf;Vw=1;var t=Dk();return Mf=function(e,n){return t(e,n,"pre")},Mf}function m7(){if(Hw)return Of;Hw=1;var t=tm(),e=Ak();return Of=function(n,o){var r,s=new t,i={},a=new e;function l(d){var h=d.v===r?d.w:d.v,f=a.priority(h);if(f!==void 0){var m=o(d);m<f&&(i[h]=r,a.decrease(h,m))}}if(n.nodeCount()===0)return s;n.nodes().forEach(function(d){a.add(d,Number.POSITIVE_INFINITY),s.setNode(d)}),a.decrease(n.nodes()[0],0);for(var c=!1;a.size()>0;){if(r=a.removeMin(),Object.hasOwn(i,r))s.setEdge(r,i[r]);else{if(c)throw new Error("Input graph is not connected: "+n);c=!0}n.nodeEdges(r).forEach(l)}return s},Of}function Pn(){if(Yw)return Gw;Yw=1;var t=s7();return Gw={Graph:t.Graph,json:i7(),alg:qw?Ww:(qw=1,Ww={components:a7(),dijkstra:Tk(),dijkstraAll:l7(),findCycles:c7(),floydWarshall:d7(),isAcyclic:u7(),postorder:h7(),preorder:f7(),prim:m7(),tarjan:Mk(),topsort:Ok()}),version:t.version}}function p7(){if(Jw)return Df;Jw=1;let t=Pn().Graph,e=function(){if(Xw)return Kw;function s(a){a._prev._next=a._next,a._next._prev=a._prev,delete a._next,delete a._prev}function i(a,l){if(a!=="_next"&&a!=="_prev")return l}return Xw=1,Kw=class{constructor(){let a={};a._next=a._prev=a,this._sentinel=a}dequeue(){let a=this._sentinel,l=a._prev;if(l!==a)return s(l),l}enqueue(a){let l=this._sentinel;a._prev&&a._next&&s(a),a._next=l._next,l._next._prev=a,l._next=a,a._prev=l}toString(){let a=[],l=this._sentinel,c=l._prev;for(;c!==l;)a.push(JSON.stringify(c,i)),c=c._prev;return"["+a.join(", ")+"]"}}}();Df=function(s,i){if(s.nodeCount()<=1)return[];let a=function(l,c){let d=new t,h=0,f=0;l.nodes().forEach(x=>{d.setNode(x,{v:x,in:0,out:0})}),l.edges().forEach(x=>{let p=d.edge(x.v,x.w)||0,b=c(x),y=p+b;d.setEdge(x.v,x.w,y),f=Math.max(f,d.node(x.v).out+=b),h=Math.max(h,d.node(x.w).in+=b)});let m=function(x){const p=[];for(let b=0;b<x;b++)p.push(b);return p}(f+h+3).map(()=>new e),g=h+1;return d.nodes().forEach(x=>{r(m,g,d.node(x))}),{graph:d,buckets:m,zeroIdx:g}}(s,i||n);return function(l,c,d){let h,f=[],m=c[c.length-1],g=c[0];for(;l.nodeCount();){for(;h=g.dequeue();)o(l,c,d,h);for(;h=m.dequeue();)o(l,c,d,h);if(l.nodeCount()){for(let x=c.length-2;x>0;--x)if(h=c[x].dequeue(),h){f=f.concat(o(l,c,d,h,!0));break}}}return f}(a.graph,a.buckets,a.zeroIdx).flatMap(l=>s.outEdges(l.v,l.w))};let n=()=>1;function o(s,i,a,l,c){let d=c?[]:void 0;return s.inEdges(l.v).forEach(h=>{let f=s.edge(h),m=s.node(h.v);c&&d.push({v:h.v,w:h.w}),m.out-=f,r(i,a,m)}),s.outEdges(l.v).forEach(h=>{let f=s.edge(h),m=h.w,g=s.node(m);g.in-=f,r(i,a,g)}),s.removeNode(l.v),d}function r(s,i,a){a.out?a.in?s[a.out-a.in+i].enqueue(a):s[s.length-1].enqueue(a):s[0].enqueue(a)}return Df}function It(){if(Zw)return Rf;Zw=1;let t=Pn().Graph;function e(c,d,h,f){for(var m=f;c.hasNode(m);)m=i(f);return h.dummy=d,c.setNode(m,h),m}Rf={addBorderNode:function(c,d,h,f){let m={width:0,height:0};return arguments.length>=4&&(m.rank=h,m.order=f),e(c,"border",m,d)},addDummyNode:e,applyWithChunking:o,asNonCompoundGraph:function(c){let d=new t({multigraph:c.isMultigraph()}).setGraph(c.graph());return c.nodes().forEach(h=>{c.children(h).length||d.setNode(h,c.node(h))}),c.edges().forEach(h=>{d.setEdge(h,c.edge(h))}),d},buildLayerMatrix:function(c){let d=a(r(c)+1).map(()=>[]);return c.nodes().forEach(h=>{let f=c.node(h),m=f.rank;m!==void 0&&(d[m][f.order]=h)}),d},intersectRect:function(c,d){let h,f,m=c.x,g=c.y,x=d.x-m,p=d.y-g,b=c.width/2,y=c.height/2;if(!x&&!p)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(p)*b>Math.abs(x)*y?(p<0&&(y=-y),h=y*x/p,f=y):(x<0&&(b=-b),h=b,f=b*p/x),{x:m+h,y:g+f}},mapValues:function(c,d){let h=d;return typeof d=="string"&&(h=f=>f[d]),Object.entries(c).reduce((f,[m,g])=>(f[m]=h(g,m),f),{})},maxRank:r,normalizeRanks:function(c){let d=c.nodes().map(f=>{let m=c.node(f).rank;return m===void 0?Number.MAX_VALUE:m}),h=o(Math.min,d);c.nodes().forEach(f=>{let m=c.node(f);Object.hasOwn(m,"rank")&&(m.rank-=h)})},notime:function(c,d){return d()},partition:function(c,d){let h={lhs:[],rhs:[]};return c.forEach(f=>{d(f)?h.lhs.push(f):h.rhs.push(f)}),h},pick:function(c,d){const h={};for(const f of d)c[f]!==void 0&&(h[f]=c[f]);return h},predecessorWeights:function(c){let d=c.nodes().map(h=>{let f={};return c.inEdges(h).forEach(m=>{f[m.v]=(f[m.v]||0)+c.edge(m).weight}),f});return l(c.nodes(),d)},range:a,removeEmptyRanks:function(c){let d=c.nodes().map(x=>c.node(x).rank),h=o(Math.min,d),f=[];c.nodes().forEach(x=>{let p=c.node(x).rank-h;f[p]||(f[p]=[]),f[p].push(x)});let m=0,g=c.graph().nodeRankFactor;Array.from(f).forEach((x,p)=>{x===void 0&&p%g!==0?--m:x!==void 0&&m&&x.forEach(b=>c.node(b).rank+=m)})},simplify:function(c){let d=new t().setGraph(c.graph());return c.nodes().forEach(h=>d.setNode(h,c.node(h))),c.edges().forEach(h=>{let f=d.edge(h.v,h.w)||{weight:0,minlen:1},m=c.edge(h);d.setEdge(h.v,h.w,{weight:f.weight+m.weight,minlen:Math.max(f.minlen,m.minlen)})}),d},successorWeights:function(c){let d=c.nodes().map(h=>{let f={};return c.outEdges(h).forEach(m=>{f[m.w]=(f[m.w]||0)+c.edge(m).weight}),f});return l(c.nodes(),d)},time:function(c,d){let h=Date.now();try{return d()}finally{console.log(c+" time: "+(Date.now()-h)+"ms")}},uniqueId:i,zipObject:l};const n=65535;function o(c,d){if(d.length>n){const h=function(f,m=n){const g=[];for(let x=0;x<f.length;x+=m){const p=f.slice(x,x+m);g.push(p)}return g}(d);return c.apply(null,h.map(f=>c.apply(null,f)))}return c.apply(null,d)}function r(c){const d=c.nodes().map(h=>{let f=c.node(h).rank;return f===void 0?Number.MIN_VALUE:f});return o(Math.max,d)}let s=0;function i(c){return c+""+ ++s}function a(c,d,h=1){d==null&&(d=c,c=0);let f=g=>g<d;h<0&&(f=g=>d<g);const m=[];for(let g=c;f(g);g+=h)m.push(g);return m}function l(c,d){return c.reduce((h,f,m)=>(h[f]=d[m],h),{})}return Rf}function g7(){if(Qw)return Pf;Qw=1;let t=p7(),e=It().uniqueId;return Pf={run:function(n){(n.graph().acyclicer==="greedy"?t(n,function(r){return s=>r.edge(s).weight}(n)):function(r){let s=[],i={},a={};function l(c){Object.hasOwn(a,c)||(a[c]=!0,i[c]=!0,r.outEdges(c).forEach(d=>{Object.hasOwn(i,d.w)?s.push(d):l(d.w)}),delete i[c])}return r.nodes().forEach(l),s}(n)).forEach(r=>{let s=n.edge(r);n.removeEdge(r),s.forwardName=r.name,s.reversed=!0,n.setEdge(r.w,r.v,s,e("rev"))})},undo:function(n){n.edges().forEach(o=>{let r=n.edge(o);if(r.reversed){n.removeEdge(o);let s=r.forwardName;delete r.reversed,delete r.forwardName,n.setEdge(o.w,o.v,r,s)}})}},Pf}function x7(){if(ek)return Lf;ek=1;let t=It();return Lf={run:function(e){e.graph().dummyChains=[],e.edges().forEach(n=>function(o,r){let s,i,a,l=r.v,c=o.node(l).rank,d=r.w,h=o.node(d).rank,f=r.name,m=o.edge(r),g=m.labelRank;if(h!==c+1){for(o.removeEdge(r),a=0,++c;c<h;++a,++c)m.points=[],i={width:0,height:0,edgeLabel:m,edgeObj:r,rank:c},s=t.addDummyNode(o,"edge",i,"_d"),c===g&&(i.width=m.width,i.height=m.height,i.dummy="edge-label",i.labelpos=m.labelpos),o.setEdge(l,s,{weight:m.weight},f),a===0&&o.graph().dummyChains.push(s),l=s;o.setEdge(l,d,{weight:m.weight},f)}}(e,n))},undo:function(e){e.graph().dummyChains.forEach(n=>{let o,r=e.node(n),s=r.edgeLabel;for(e.setEdge(r.edgeObj,s);r.dummy;)o=e.successors(n)[0],e.removeNode(n),s.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(s.x=r.x,s.y=r.y,s.width=r.width,s.height=r.height),n=o,r=e.node(n)})}},Lf}function Gl(){if(tk)return Ff;tk=1;const{applyWithChunking:t}=It();return Ff={longestPath:function(e){var n={};e.sources().forEach(function o(r){var s=e.node(r);if(Object.hasOwn(n,r))return s.rank;n[r]=!0;let i=e.outEdges(r).map(l=>l==null?Number.POSITIVE_INFINITY:o(l.w)-e.edge(l).minlen);var a=t(Math.min,i);return a===Number.POSITIVE_INFINITY&&(a=0),s.rank=a})},slack:function(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}},Ff}function Rk(){if(nk)return zf;nk=1;var t=Pn().Graph,e=Gl().slack;function n(s,i){return s.nodes().forEach(function a(l){i.nodeEdges(l).forEach(c=>{var d=c.v,h=l===d?c.w:d;s.hasNode(h)||e(i,c)||(s.setNode(h,{}),s.setEdge(l,h,{}),a(h))})}),s.nodeCount()}function o(s,i){return i.edges().reduce((a,l)=>{let c=Number.POSITIVE_INFINITY;return s.hasNode(l.v)!==s.hasNode(l.w)&&(c=e(i,l)),c<a[0]?[c,l]:a},[Number.POSITIVE_INFINITY,null])[1]}function r(s,i,a){s.nodes().forEach(l=>i.node(l).rank+=a)}return zf=function(s){var i,a,l=new t({directed:!1}),c=s.nodes()[0],d=s.nodeCount();for(l.setNode(c,{});n(l,s)<d;)i=o(l,s),a=l.hasNode(i.v)?e(s,i):-e(s,i),r(l,s,a);return l},zf}function b7(){if(ok)return Bf;ok=1;var t=Rk(),e=Gl().slack,n=Gl().longestPath,o=Pn().alg.preorder,r=Pn().alg.postorder,s=It().simplify;function i(x){x=s(x),n(x);var p,b=t(x);for(c(b),a(b,x);p=h(b);)m(b,x,p,f(b,x,p))}function a(x,p){var b=r(x,x.nodes());(b=b.slice(0,b.length-1)).forEach(y=>function(v,w,j){var C=v.node(j),N=C.parent;v.edge(j,N).cutvalue=l(v,w,j)}(x,p,y))}function l(x,p,b){var y=x.node(b).parent,v=!0,w=p.edge(b,y),j=0;return w||(v=!1,w=p.edge(y,b)),j=w.weight,p.nodeEdges(b).forEach(C=>{var N,S,E=C.v===b,T=E?C.w:C.v;if(T!==y){var I=E===v,M=p.edge(C).weight;if(j+=I?M:-M,N=b,S=T,x.hasEdge(N,S)){var F=x.edge(b,T).cutvalue;j+=I?-F:F}}}),j}function c(x,p){arguments.length<2&&(p=x.nodes()[0]),d(x,{},1,p)}function d(x,p,b,y,v){var w=b,j=x.node(y);return p[y]=!0,x.neighbors(y).forEach(C=>{Object.hasOwn(p,C)||(b=d(x,p,b,C,y))}),j.low=w,j.lim=b++,v?j.parent=v:delete j.parent,b}function h(x){return x.edges().find(p=>x.edge(p).cutvalue<0)}function f(x,p,b){var y=b.v,v=b.w;p.hasEdge(y,v)||(y=b.w,v=b.v);var w=x.node(y),j=x.node(v),C=w,N=!1;w.lim>j.lim&&(C=j,N=!0);var S=p.edges().filter(E=>N===g(x,x.node(E.v),C)&&N!==g(x,x.node(E.w),C));return S.reduce((E,T)=>e(p,T)<e(p,E)?T:E)}function m(x,p,b,y){var v=b.v,w=b.w;x.removeEdge(v,w),x.setEdge(y.v,y.w,{}),c(x),a(x,p),function(j,C){var N=j.nodes().find(E=>!C.node(E).parent),S=o(j,N);(S=S.slice(1)).forEach(E=>{var T=j.node(E).parent,I=C.edge(E,T),M=!1;I||(I=C.edge(T,E),M=!0),C.node(E).rank=C.node(T).rank+(M?I.minlen:-I.minlen)})}(x,p)}function g(x,p,b){return b.low<=p.lim&&p.lim<=b.lim}return Bf=i,i.initLowLimValues=c,i.initCutValues=a,i.calcCutValue=l,i.leaveEdge=h,i.enterEdge=f,i.exchangeEdges=m,Bf}function y7(){if(rk)return Uf;rk=1;var t=Gl().longestPath,e=Rk(),n=b7();Uf=function(s){var i=s.graph().ranker;if(i instanceof Function)return i(s);switch(s.graph().ranker){case"network-simplex":default:r(s);break;case"tight-tree":(function(a){t(a),e(a)})(s);break;case"longest-path":o(s);case"none":}};var o=t;function r(s){n(s)}return Uf}function v7(){return sk||(sk=1,$f=function(t){let e=function(n){let o={},r=0;function s(i){let a=r;n.children(i).forEach(s),o[i]={low:a,lim:r++}}return n.children().forEach(s),o}(t);t.graph().dummyChains.forEach(n=>{let o=t.node(n),r=o.edgeObj,s=function(h,f,m,g){let x,p,b=[],y=[],v=Math.min(f[m].low,f[g].low),w=Math.max(f[m].lim,f[g].lim);x=m;do x=h.parent(x),b.push(x);while(x&&(f[x].low>v||w>f[x].lim));for(p=x,x=g;(x=h.parent(x))!==p;)y.push(x);return{path:b.concat(y.reverse()),lca:p}}(t,e,r.v,r.w),i=s.path,a=s.lca,l=0,c=i[l],d=!0;for(;n!==r.w;){if(o=t.node(n),d){for(;(c=i[l])!==a&&t.node(c).maxRank<o.rank;)l++;c===a&&(d=!1)}if(!d){for(;l<i.length-1&&t.node(c=i[l+1]).minRank<=o.rank;)l++;c=i[l]}t.setParent(n,c),n=t.successors(n)[0]}})}),$f}function w7(){if(ik)return Vf;ik=1;let t=It();function e(n,o,r,s,i,a,l){let c=n.children(l);if(!c.length)return void(l!==o&&n.setEdge(o,l,{weight:0,minlen:r}));let d=t.addBorderNode(n,"_bt"),h=t.addBorderNode(n,"_bb"),f=n.node(l);n.setParent(d,l),f.borderTop=d,n.setParent(h,l),f.borderBottom=h,c.forEach(m=>{e(n,o,r,s,i,a,m);let g=n.node(m),x=g.borderTop?g.borderTop:m,p=g.borderBottom?g.borderBottom:m,b=g.borderTop?s:2*s,y=x!==p?1:i-a[l]+1;n.setEdge(d,x,{weight:b,minlen:y,nestingEdge:!0}),n.setEdge(p,h,{weight:b,minlen:y,nestingEdge:!0})}),n.parent(l)||n.setEdge(o,d,{weight:0,minlen:i+a[l]})}return Vf={run:function(n){let o=t.addDummyNode(n,"root",{},"_root"),r=function(c){var d={};function h(f,m){var g=c.children(f);g&&g.length&&g.forEach(x=>h(x,m+1)),d[f]=m}return c.children().forEach(f=>h(f,1)),d}(n),s=Object.values(r),i=t.applyWithChunking(Math.max,s)-1,a=2*i+1;n.graph().nestingRoot=o,n.edges().forEach(c=>n.edge(c).minlen*=a);let l=function(c){return c.edges().reduce((d,h)=>d+c.edge(h).weight,0)}(n)+1;n.children().forEach(c=>e(n,o,a,l,i,r,c)),n.graph().nodeRankFactor=a},cleanup:function(n){var o=n.graph();n.removeNode(o.nestingRoot),delete o.nestingRoot,n.edges().forEach(r=>{n.edge(r).nestingEdge&&n.removeEdge(r)})}},Vf}function k7(){if(lk)return Wf;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 lk=1,Wf={adjust:function(r){let s=r.graph().rankdir.toLowerCase();s!=="lr"&&s!=="rl"||t(r)},undo:function(r){let s=r.graph().rankdir.toLowerCase();s!=="bt"&&s!=="rl"||function(i){i.nodes().forEach(a=>n(i.node(a))),i.edges().forEach(a=>{let l=i.edge(a);l.points.forEach(n),Object.hasOwn(l,"y")&&n(l)})}(r),s!=="lr"&&s!=="rl"||(function(i){i.nodes().forEach(a=>o(i.node(a))),i.edges().forEach(a=>{let l=i.edge(a);l.points.forEach(o),Object.hasOwn(l,"x")&&o(l)})}(r),t(r))}},Wf}function C7(){if(mk)return fk;mk=1;let t=It();return fk=function(e,n){let o={};return e.forEach((r,s)=>{let i=o[r.v]={indegree:0,in:[],out:[],vs:[r.v],i:s};r.barycenter!==void 0&&(i.barycenter=r.barycenter,i.weight=r.weight)}),n.edges().forEach(r=>{let s=o[r.v],i=o[r.w];s!==void 0&&i!==void 0&&(i.indegree++,s.out.push(o[r.w]))}),function(r){let s=[];function i(l){return c=>{c.merged||(c.barycenter===void 0||l.barycenter===void 0||c.barycenter>=l.barycenter)&&function(d,h){let f=0,m=0;d.weight&&(f+=d.barycenter*d.weight,m+=d.weight),h.weight&&(f+=h.barycenter*h.weight,m+=h.weight),d.vs=h.vs.concat(d.vs),d.barycenter=f/m,d.weight=m,d.i=Math.min(h.i,d.i),h.merged=!0}(l,c)}}function a(l){return c=>{c.in.push(l),--c.indegree===0&&r.push(c)}}for(;r.length;){let l=r.pop();s.push(l),l.in.reverse().forEach(i(l)),l.out.forEach(a(l))}return s.filter(l=>!l.merged).map(l=>t.pick(l,["vs","i","barycenter","weight"]))}(Object.values(o).filter(r=>!r.indegree))}}function j7(){if(xk)return Yf;xk=1;let t=(hk||(hk=1,uk=function(o,r=[]){return r.map(s=>{let i=o.inEdges(s);if(i.length){let a=i.reduce((l,c)=>{let d=o.edge(c),h=o.node(c.v);return{sum:l.sum+d.weight*h.order,weight:l.weight+d.weight}},{sum:0,weight:0});return{v:s,barycenter:a.sum/a.weight,weight:a.weight}}return{v:s}})}),uk),e=C7(),n=function(){if(gk)return pk;gk=1;let o=It();function r(s,i,a){let l;for(;i.length&&(l=i[i.length-1]).i<=a;)i.pop(),s.push(l.vs),a++;return a}return pk=function(s,i){let a=o.partition(s,p=>Object.hasOwn(p,"barycenter")),l=a.lhs,c=a.rhs.sort((p,b)=>b.i-p.i),d=[],h=0,f=0,m=0;var g;l.sort((g=!!i,(p,b)=>p.barycenter<b.barycenter?-1:p.barycenter>b.barycenter?1:g?b.i-p.i:p.i-b.i)),m=r(d,c,m),l.forEach(p=>{m+=p.vs.length,d.push(p.vs),h+=p.barycenter*p.weight,f+=p.weight,m=r(d,c,m)});let x={vs:d.flat(!0)};return f&&(x.barycenter=h/f,x.weight=f),x}}();return Yf=function o(r,s,i,a){let l=r.children(s),c=r.node(s),d=c?c.borderLeft:void 0,h=c?c.borderRight:void 0,f={};d&&(l=l.filter(p=>p!==d&&p!==h));let m=t(r,l);m.forEach(p=>{if(r.children(p.v).length){let v=o(r,p.v,i,a);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 g=e(m,i);(function(p,b){p.forEach(y=>{y.vs=y.vs.flatMap(v=>b[v]?b[v].vs:v)})})(g,f);let x=n(g,a);if(d&&(x.vs=[d,x.vs,h].flat(!0),r.predecessors(d).length)){let p=r.node(r.predecessors(d)[0]),b=r.node(r.predecessors(h)[0]);Object.hasOwn(x,"barycenter")||(x.barycenter=0,x.weight=0),x.barycenter=(x.barycenter*x.weight+p.order+b.order)/(x.weight+2),x.weight+=2}return x},Yf}function S7(){if(bk)return Kf;bk=1;let t=Pn().Graph,e=It();return Kf=function(n,o,r){let s=function(a){for(var l;a.hasNode(l=e.uniqueId("_root")););return l}(n),i=new t({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(a=>n.node(a));return n.nodes().forEach(a=>{let l=n.node(a),c=n.parent(a);(l.rank===o||l.minRank<=o&&o<=l.maxRank)&&(i.setNode(a),i.setParent(a,c||s),n[r](a).forEach(d=>{let h=d.v===a?d.w:d.v,f=i.edge(h,a),m=f!==void 0?f.weight:0;i.setEdge(h,a,{weight:n.edge(d).weight+m})}),Object.hasOwn(l,"minRank")&&i.setNode(a,{borderLeft:l.borderLeft[o],borderRight:l.borderRight[o]}))}),i},Kf}function N7(){if(wk)return Xf;wk=1;let t=function(){if(ck)return qf;ck=1;let d=It();return qf=function(h){let f={},m=h.nodes().filter(y=>!h.children(y).length),g=m.map(y=>h.node(y).rank),x=d.applyWithChunking(Math.max,g),p=d.range(x+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},qf}(),e=function(){if(dk)return Gf;dk=1;let d=It().zipObject;function h(f,m,g){let x=d(g,g.map((j,C)=>C)),p=m.flatMap(j=>f.outEdges(j).map(C=>({pos:x[C.w],weight:f.edge(C).weight})).sort((C,N)=>C.pos-N.pos)),b=1;for(;b<g.length;)b<<=1;let y=2*b-1;b-=1;let v=new Array(y).fill(0),w=0;return p.forEach(j=>{let C=j.pos+b;v[C]+=j.weight;let N=0;for(;C>0;)C%2&&(N+=v[C+1]),C=C-1>>1,v[C]+=j.weight;w+=j.weight*N}),w}return Gf=function(f,m){let g=0;for(let x=1;x<m.length;++x)g+=h(f,m[x-1],m[x]);return g},Gf}(),n=j7(),o=S7(),r=(vk||(vk=1,yk=function(d,h,f){let m,g={};f.forEach(x=>{let p,b,y=d.parent(x);for(;y;){if(p=d.parent(y),p?(b=g[p],g[p]=y):(b=m,m=y),b&&b!==y)return void h.setEdge(b,y);y=p}})}),yk),s=Pn().Graph,i=It();function a(d,h,f){return h.map(function(m){return o(d,m,f)})}function l(d,h){let f=new s;d.forEach(function(m){let g=m.graph().root,x=n(m,g,f,h);x.vs.forEach((p,b)=>m.node(p).order=b),r(m,f,x.vs)})}function c(d,h){Object.values(h).forEach(f=>f.forEach((m,g)=>d.node(m).order=g))}return Xf=function d(h,f){if(f&&typeof f.customOrder=="function")return void f.customOrder(h,d);let m=i.maxRank(h),g=a(h,i.range(1,m+1),"inEdges"),x=a(h,i.range(m-1,-1,-1),"outEdges"),p=t(h);if(c(h,p),f&&f.disableOptimalOrderHeuristic)return;let b,y=Number.POSITIVE_INFINITY;for(let v=0,w=0;w<4;++v,++w){l(v%2?g:x,v%4>=2),p=i.buildLayerMatrix(h);let j=e(h,p);j<y&&(w=0,b=Object.assign({},p),y=j)}c(h,b)},Xf}function E7(){if(kk)return Jf;kk=1;let t=Pn().Graph,e=It();function n(h,f){let m={};return f.length&&f.reduce(function(g,x){let p=0,b=0,y=g.length,v=x[x.length-1];return x.forEach((w,j)=>{let C=function(S,E){if(S.node(E).dummy)return S.predecessors(E).find(T=>S.node(T).dummy)}(h,w),N=C?h.node(C).order:y;(C||w===v)&&(x.slice(b,j+1).forEach(S=>{h.predecessors(S).forEach(E=>{let T=h.node(E),I=T.order;!(I<p||N<I)||T.dummy&&h.node(S).dummy||r(m,E,S)})}),b=j+1,p=N)}),x}),m}function o(h,f){let m={};function g(x,p,b,y,v){let w;e.range(p,b).forEach(j=>{w=x[j],h.node(w).dummy&&h.predecessors(w).forEach(C=>{let N=h.node(C);N.dummy&&(N.order<y||N.order>v)&&r(m,C,w)})})}return f.length&&f.reduce(function(x,p){let b,y=-1,v=0;return p.forEach((w,j)=>{if(h.node(w).dummy==="border"){let C=h.predecessors(w);C.length&&(b=h.node(C[0]).order,g(p,v,j,y,b),v=j,y=b)}g(p,v,p.length,b,x.length)}),p}),m}function r(h,f,m){if(f>m){let x=f;f=m,m=x}let g=h[f];g||(h[f]=g={}),g[m]=!0}function s(h,f,m){if(f>m){let g=f;f=m,m=g}return!!h[f]&&Object.hasOwn(h[f],m)}function i(h,f,m,g){let x={},p={},b={};return f.forEach(y=>{y.forEach((v,w)=>{x[v]=v,p[v]=v,b[v]=w})}),f.forEach(y=>{let v=-1;y.forEach(w=>{let j=g(w);if(j.length){j=j.sort((N,S)=>b[N]-b[S]);let C=(j.length-1)/2;for(let N=Math.floor(C),S=Math.ceil(C);N<=S;++N){let E=j[N];p[w]===w&&v<b[E]&&!s(m,w,E)&&(p[E]=w,p[w]=x[w]=x[E],v=b[E])}}})}),{root:x,align:p}}function a(h,f,m,g,x){let p={},b=function(w,j,C,N){let S=new t,E=w.graph(),T=function(I,M,F){return(D,R,P)=>{let z,_=D.node(R),k=D.node(P),B=0;if(B+=_.width/2,Object.hasOwn(_,"labelpos"))switch(_.labelpos.toLowerCase()){case"l":z=-_.width/2;break;case"r":z=_.width/2}if(z&&(B+=F?z:-z),z=0,B+=(_.dummy?M:I)/2,B+=(k.dummy?M: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,N);return j.forEach(I=>{let M;I.forEach(F=>{let D=C[F];if(S.setNode(D),M){var R=C[M],P=S.edge(R,D);S.setEdge(R,D,Math.max(T(w,F,M),P||0))}M=F})}),S}(h,f,m,x),y=x?"borderLeft":"borderRight";function v(w,j){let C=b.nodes(),N=C.pop(),S={};for(;N;)S[N]?w(N):(S[N]=!0,C.push(N),C=C.concat(j(N))),N=C.pop()}return v(function(w){p[w]=b.inEdges(w).reduce((j,C)=>Math.max(j,p[C.v]+b.edge(C)),0)},b.predecessors.bind(b)),v(function(w){let j=b.outEdges(w).reduce((N,S)=>Math.min(N,p[S.w]-b.edge(S)),Number.POSITIVE_INFINITY),C=h.node(w);j!==Number.POSITIVE_INFINITY&&C.borderType!==y&&(p[w]=Math.max(p[w],j))},b.successors.bind(b)),Object.keys(g).forEach(w=>p[w]=p[m[w]]),p}function l(h,f){return Object.values(f).reduce((m,g)=>{let x=Number.NEGATIVE_INFINITY,p=Number.POSITIVE_INFINITY;Object.entries(g).forEach(([y,v])=>{let w=function(j,C){return j.node(C).width}(h,y)/2;x=Math.max(v+w,x),p=Math.min(v-w,p)});const b=x-p;return b<m[0]&&(m=[b,g]),m},[Number.POSITIVE_INFINITY,null])[1]}function c(h,f){let m=Object.values(f),g=e.applyWithChunking(Math.min,m),x=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),j=g-e.applyWithChunking(Math.min,w);b!=="l"&&(j=x-e.applyWithChunking(Math.max,w)),j&&(h[y]=e.mapValues(v,C=>C+j))})})}function d(h,f){return e.mapValues(h.ul,(m,g)=>{if(f)return h[f.toLowerCase()][g];{let x=Object.values(h).map(p=>p[g]).sort((p,b)=>p-b);return(x[1]+x[2])/2}})}return Jf={positionX:function(h){let f,m=e.buildLayerMatrix(h),g=Object.assign(n(h,m),o(h,m)),x={};["u","d"].forEach(b=>{f=b==="u"?m:Object.values(m).reverse(),["l","r"].forEach(y=>{y==="r"&&(f=f.map(C=>Object.values(C).reverse()));let v=(b==="u"?h.predecessors:h.successors).bind(h),w=i(h,f,g,v),j=a(h,f,w.root,w.align,y==="r");y==="r"&&(j=e.mapValues(j,C=>-C)),x[b+y]=j})});let p=l(h,x);return c(x,p),d(x,h.graph().align)},findType1Conflicts:n,findType2Conflicts:o,addConflict:r,hasConflict:s,verticalAlignment:i,horizontalCompaction:a,alignCoordinates:c,findSmallestWidthAlignment:l,balance:d},Jf}function _7(){if(Ck)return Zf;Ck=1;let t=It(),e=E7().positionX;return Zf=function(n){n=t.asNonCompoundGraph(n),function(o){let r=t.buildLayerMatrix(o),s=o.graph().ranksep,i=0;r.forEach(a=>{const l=a.reduce((c,d)=>{const h=o.node(d).height;return c>h?c:h},0);a.forEach(c=>o.node(c).y=i+l/2),i+=l+s})}(n),Object.entries(e(n)).forEach(([o,r])=>n.node(o).x=r)},Zf}function I7(){if(jk)return Qf;jk=1;let t=g7(),e=x7(),n=y7(),o=It().normalizeRanks,r=v7(),s=It().removeEmptyRanks,i=w7(),a=function(){if(ak)return Hf;ak=1;let N=It();function S(E,T,I,M,F,D){let R={width:0,height:0,rank:D,borderType:T},P=F[T][D-1],z=N.addDummyNode(E,"border",R,I);F[T][D]=z,E.setParent(z,M),P&&E.setEdge(P,z,{weight:1})}return Hf=function(E){E.children().forEach(function T(I){let M=E.children(I),F=E.node(I);if(M.length&&M.forEach(T),Object.hasOwn(F,"minRank")){F.borderLeft=[],F.borderRight=[];for(let D=F.minRank,R=F.maxRank+1;D<R;++D)S(E,"borderLeft","_bl",I,F,D),S(E,"borderRight","_br",I,F,D)}})},Hf}(),l=k7(),c=N7(),d=_7(),h=It(),f=Pn().Graph;Qf=function(N,S){let E=S&&S.debugTiming?h.time:h.notime;E("layout",()=>{let T=E(" buildLayoutGraph",()=>function(I){let M=new f({multigraph:!0,compound:!0}),F=C(I.graph());return M.setGraph(Object.assign({},g,j(F,m),h.pick(F,x))),I.nodes().forEach(D=>{const R=j(C(I.node(D)),p);Object.keys(b).forEach(P=>{R[P]===void 0&&(R[P]=b[P])}),M.setNode(D,R),M.setParent(D,I.parent(D))}),I.edges().forEach(D=>{let R=C(I.edge(D));M.setEdge(D,Object.assign({},v,j(R,y),h.pick(R,w)))}),M}(N));E(" runLayout",()=>function(I,M,F){M(" makeSpaceForEdgeLabels",()=>function(D){let R=D.graph();R.ranksep/=2,D.edges().forEach(P=>{let z=D.edge(P);z.minlen*=2,z.labelpos.toLowerCase()!=="c"&&(R.rankdir==="TB"||R.rankdir==="BT"?z.width+=z.labeloffset:z.height+=z.labeloffset)})}(I)),M(" removeSelfEdges",()=>function(D){D.edges().forEach(R=>{if(R.v===R.w){var P=D.node(R.v);P.selfEdges||(P.selfEdges=[]),P.selfEdges.push({e:R,label:D.edge(R)}),D.removeEdge(R)}})}(I)),M(" acyclic",()=>t.run(I)),M(" nestingGraph.run",()=>i.run(I)),M(" rank",()=>n(h.asNonCompoundGraph(I))),M(" injectEdgeLabelProxies",()=>function(D){D.edges().forEach(R=>{let P=D.edge(R);if(P.width&&P.height){let z=D.node(R.v),_={rank:(D.node(R.w).rank-z.rank)/2+z.rank,e:R};h.addDummyNode(D,"edge-proxy",_,"_ep")}})}(I)),M(" removeEmptyRanks",()=>s(I)),M(" nestingGraph.cleanup",()=>i.cleanup(I)),M(" normalizeRanks",()=>o(I)),M(" assignRankMinMax",()=>function(D){let R=0;D.nodes().forEach(P=>{let z=D.node(P);z.borderTop&&(z.minRank=D.node(z.borderTop).rank,z.maxRank=D.node(z.borderBottom).rank,R=Math.max(R,z.maxRank))}),D.graph().maxRank=R}(I)),M(" removeEdgeLabelProxies",()=>function(D){D.nodes().forEach(R=>{let P=D.node(R);P.dummy==="edge-proxy"&&(D.edge(P.e).labelRank=P.rank,D.removeNode(R))})}(I)),M(" normalize.run",()=>e.run(I)),M(" parentDummyChains",()=>r(I)),M(" addBorderSegments",()=>a(I)),M(" order",()=>c(I,F)),M(" insertSelfEdges",()=>function(D){var R=h.buildLayerMatrix(D);R.forEach(P=>{var z=0;P.forEach((_,k)=>{var B=D.node(_);B.order=k+z,(B.selfEdges||[]).forEach(A=>{h.addDummyNode(D,"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)),M(" adjustCoordinateSystem",()=>l.adjust(I)),M(" position",()=>d(I)),M(" positionSelfEdges",()=>function(D){D.nodes().forEach(R=>{var P=D.node(R);if(P.dummy==="selfedge"){var z=D.node(P.e.v),_=z.x+z.width/2,k=z.y,B=P.x-_,A=z.height/2;D.setEdge(P.e,P.label),D.removeNode(R),P.label.points=[{x:_+2*B/3,y:k-A},{x:_+5*B/6,y:k-A},{x:_+B,y:k},{x:_+5*B/6,y:k+A},{x:_+2*B/3,y:k+A}],P.label.x=P.x,P.label.y=P.y}})}(I)),M(" removeBorderNodes",()=>function(D){D.nodes().forEach(R=>{if(D.children(R).length){let P=D.node(R),z=D.node(P.borderTop),_=D.node(P.borderBottom),k=D.node(P.borderLeft[P.borderLeft.length-1]),B=D.node(P.borderRight[P.borderRight.length-1]);P.width=Math.abs(B.x-k.x),P.height=Math.abs(_.y-z.y),P.x=k.x+P.width/2,P.y=z.y+P.height/2}}),D.nodes().forEach(R=>{D.node(R).dummy==="border"&&D.removeNode(R)})}(I)),M(" normalize.undo",()=>e.undo(I)),M(" fixupEdgeLabelCoords",()=>function(D){D.edges().forEach(R=>{let P=D.edge(R);if(Object.hasOwn(P,"x"))switch(P.labelpos!=="l"&&P.labelpos!=="r"||(P.width-=P.labeloffset),P.labelpos){case"l":P.x-=P.width/2+P.labeloffset;break;case"r":P.x+=P.width/2+P.labeloffset}})}(I)),M(" undoCoordinateSystem",()=>l.undo(I)),M(" translateGraph",()=>function(D){let R=Number.POSITIVE_INFINITY,P=0,z=Number.POSITIVE_INFINITY,_=0,k=D.graph(),B=k.marginx||0,A=k.marginy||0;function U($){let J=$.x,G=$.y,K=$.width,W=$.height;R=Math.min(R,J-K/2),P=Math.max(P,J+K/2),z=Math.min(z,G-W/2),_=Math.max(_,G+W/2)}D.nodes().forEach($=>U(D.node($))),D.edges().forEach($=>{let J=D.edge($);Object.hasOwn(J,"x")&&U(J)}),R-=B,z-=A,D.nodes().forEach($=>{let J=D.node($);J.x-=R,J.y-=z}),D.edges().forEach($=>{let J=D.edge($);J.points.forEach(G=>{G.x-=R,G.y-=z}),Object.hasOwn(J,"x")&&(J.x-=R),Object.hasOwn(J,"y")&&(J.y-=z)}),k.width=P-R+B,k.height=_-z+A}(I)),M(" assignNodeIntersects",()=>function(D){D.edges().forEach(R=>{let P,z,_=D.edge(R),k=D.node(R.v),B=D.node(R.w);_.points?(P=_.points[0],z=_.points[_.points.length-1]):(_.points=[],P=B,z=k),_.points.unshift(h.intersectRect(k,P)),_.points.push(h.intersectRect(B,z))})}(I)),M(" reversePoints",()=>function(D){D.edges().forEach(R=>{let P=D.edge(R);P.reversed&&P.points.reverse()})}(I)),M(" acyclic.undo",()=>t.undo(I))}(T,E,S)),E(" updateInputGraph",()=>function(I,M){I.nodes().forEach(F=>{let D=I.node(F),R=M.node(F);D&&(D.x=R.x,D.y=R.y,D.rank=R.rank,M.children(F).length&&(D.width=R.width,D.height=R.height))}),I.edges().forEach(F=>{let D=I.edge(F),R=M.edge(F);D.points=R.points,Object.hasOwn(R,"x")&&(D.x=R.x,D.y=R.y)}),I.graph().width=M.graph().width,I.graph().height=M.graph().height}(N,T))})};let m=["nodesep","edgesep","ranksep","marginx","marginy"],g={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},x=["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 j(N,S){return h.mapValues(h.pick(N,S),Number)}function C(N){var S={};return N&&Object.entries(N).forEach(([E,T])=>{typeof E=="string"&&(E=E.toLowerCase()),S[E]=T}),S}return Qf}function A7(){if(Sk)return em;Sk=1;let t=It(),e=Pn().Graph;return em={debugOrdering:function(n){let o=t.buildLayerMatrix(n),r=new e({compound:!0,multigraph:!0}).setGraph({});return n.nodes().forEach(s=>{r.setNode(s,{label:s}),r.setParent(s,"layer"+n.node(s).rank)}),n.edges().forEach(s=>r.setEdge(s.v,s.w,{},s.name)),o.forEach((s,i)=>{let a="layer"+i;r.setNode(a,{rank:"same"}),s.reduce((l,c)=>(r.setEdge(l,c,{style:"invis"}),c))}),r}},em}var Pk=Ik?_k:(Ik=1,_k={graphlib:Pn(),layout:I7(),debug:A7(),util:{time:It().time,notime:It().notime},version:Ek?Nk:(Ek=1,Nk="1.1.5")});const Ii=new Pk.graphlib.Graph().setDefaultEdgeLabel(()=>({})),Lk=({nodes:t,edges:e,direction:n})=>(Ii.setGraph({rankdir:n,nodesep:150,ranksep:200,ranker:"longest-path"}),e.forEach(o=>Ii.setEdge(o.source,o.target)),t.forEach(o=>Ii.setNode(o.id,{...o,width:o.width??0,height:o.height??0})),Pk.layout(Ii),{nodes:t.map(o=>{const{x:r,y:s}=Ii.node(o.id);return{...o,position:{x:r,y:s}}}),edges:e}),Fk=new class{createEdge(t,e){return{animated:!0,markerEnd:{type:Jr.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:gf(Qe.get(e).code.trim().split(`
|
|
162
|
-
`).length),position:{x:0,y:0}}}createElements(t,e,n,o){const r=[],s=[],i=new Set,a=new Set;for(const l of Object.values(n)){if(l.value==="marimo"&&l.name==="mo")continue;const{declaredBy:c,usedBy:d}=l;for(const h of c)for(const f of d){const m=`${h}-${f}`;a.has(m)||(a.add(m),i.add(h),i.add(f),s.push(this.createEdge(h,f)))}}for(const[l,c]of Zm.zip(t,e)){o||r.push(this.createNode(l,c));const d=i.has(l),h=Qe.get(c).code.trim().startsWith("mo.md");!d&&h||r.push(this.createNode(l,c))}return{nodes:r,edges:s}}},T7=t=>{const e=H.c(43),{cellIds:n,variables:o,cellAtoms:r,children:s,layoutDirection:i,settings:a}=t;let l;e[0]!==r||e[1]!==n||e[2]!==i||e[3]!==a.hidePureMarkdown||e[4]!==o?(l=()=>{let k=Fk.createElements(n,r,o,a.hidePureMarkdown);return k=Lk({nodes:k.nodes,edges:k.edges,direction:i}),k},e[0]=r,e[1]=n,e[2]=i,e[3]=a.hidePureMarkdown,e[4]=o,e[5]=l):l=e[5];const[c]=O.useState(l),[d,h,f]=gw(c.nodes),[m,g,x]=xw(c.edges),p=Ni();let b;e[6]!==i||e[7]!==g||e[8]!==h?(b=k=>{const B=Lk({nodes:k.nodes,edges:k.edges,direction:i});h(B.nodes),g(B.edges)},e[6]=i,e[7]=g,e[8]=h,e[9]=b):b=e[9];const y=Le(b);let v,w;e[10]!==r||e[11]!==n||e[12]!==a.hidePureMarkdown||e[13]!==y||e[14]!==o?(v=()=>{y(Fk.createElements(n,r,o,a.hidePureMarkdown))},w=[n,o,r,y,a.hidePureMarkdown],e[10]=r,e[11]=n,e[12]=a.hidePureMarkdown,e[13]=y,e[14]=o,e[15]=v,e[16]=w):(v=e[15],w=e[16]),O.useEffect(v,w);const[j,C]=O.useState();let N;jw(),e[17]===Symbol.for("react.memo_cache_sentinel")?(N=()=>{C(void 0)},e[17]=N):N=e[17];const S=N;let E,T,I,M,F,D,R,P,z,_;return e[18]===Symbol.for("react.memo_cache_sentinel")?(E={minZoom:.5,maxZoom:1.5},T=(k,B)=>{C({type:"node",id:B.id})},I=(k,B)=>{const{source:A,target:U}=B;C({type:"edge",source:A,target:U})},e[18]=E,e[19]=T,e[20]=I):(E=e[18],T=e[19],I=e[20]),e[21]===Symbol.for("react.memo_cache_sentinel")?(M=u.jsx(JM,{color:"#ccc",variant:En.Dots}),e[21]=M):M=e[21],e[22]!==p||e[23]!==d?(F=()=>{const k=Qe.get(dL);if(k){const B=d.find(A=>A.id===k);B&&(p.fitView({padding:1,duration:600,nodes:[B]}),C({type:"node",id:k}))}},e[22]=p,e[23]=d,e[24]=F):F=e[24],e[25]===Symbol.for("react.memo_cache_sentinel")?(D=u.jsx(Op,{className:"size-4"}),e[25]=D):D=e[25],e[26]!==F?(R=u.jsx(WM,{position:"bottom-right",showInteractive:!1,children:u.jsx(Ne,{content:"Jump to focused cell",delayDuration:200,side:"left",asChild:!1,children:u.jsx(ss,{onMouseDown:zn.preventFocus,onClick:F,children:D})})}),e[26]=F,e[27]=R):R=e[27],e[28]!==m||e[29]!==j||e[30]!==o?(P=u.jsx(ql,{selection:j,variables:o,edges:m,onClearSelection:S}),e[28]=m,e[29]=j,e[30]=o,e[31]=P):P=e[31],e[32]!==s||e[33]!==m||e[34]!==d||e[35]!==x||e[36]!==f||e[37]!==R||e[38]!==P?(z=u.jsxs(pf,{nodes:d,edges:m,nodeTypes:kw,minZoom:.2,fitViewOptions:E,onNodeClick:T,onEdgeClick:I,onNodeDoubleClick:M7,fitView:!0,onNodesChange:f,onEdgesChange:x,zoomOnDoubleClick:!1,nodesConnectable:!1,children:[M,R,P,s]}),e[32]=s,e[33]=m,e[34]=d,e[35]=x,e[36]=f,e[37]=R,e[38]=P,e[39]=z):z=e[39],e[40]!==i||e[41]!==z?(_=u.jsx(vw,{value:i,children:z}),e[40]=i,e[41]=z,e[42]=_):_=e[42],_};function M7(t,e){WC(e.id,"focus")}const O7=jt("_minimap_"),D7=jt({hidePureMarkdown:!0}),R7=t=>{const e=H.c(11),[n,o]=Dt(O7),[r,s]=Dt(D7);let i;e[0]!==n||e[1]!==t||e[2]!==o||e[3]!==s||e[4]!==r?(i=()=>n==="_minimap_"?u.jsx(n7,{...t,children:u.jsx(bf,{settings:r,onSettingsChange:s,view:n,onChange:o})}):u.jsx(T7,{...t,settings:r,layoutDirection:n,children:u.jsx(bf,{settings:r,onSettingsChange:s,view:n,onChange:o})}),e[0]=n,e[1]=t,e[2]=o,e[3]=s,e[4]=r,e[5]=i):i=e[5];const a=i;let l,c;return e[6]!==a?(l=a(),e[6]=a,e[7]=l):l=e[7],e[8]!==n||e[9]!==l?(c=u.jsx(mf,{children:l},n),e[8]=n,e[9]=l,e[10]=c):c=e[10],c},P7=()=>{const t=H.c(5),e=tp(),n=wr(),[o]=uL();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=u.jsx("div",{className:r,children:u.jsx(R7,{cellAtoms:o,variables:e,cellIds:n.inOrderIds})}),t[1]=n.inOrderIds,t[2]=o,t[3]=e,t[4]=s):s=t[4],s},L7=t=>{const e=H.c(4),{isOpen:n,children:o}=t,[r,s]=q.useState(!1);let i,a;return e[0]!==r||e[1]!==n?(i=()=>{n&&!r&&s(!0)},a=[n,r],e[0]=r,e[1]=n,e[2]=i,e[3]=a):(i=e[2],a=e[3]),q.useEffect(i,a),r?o:null},F7=t=>{const e=H.c(8),{variableName:n,className:o}=t;let r;e[0]!==n?(r=()=>{const l=function(d){const h=Qe.get(Sc)[d];if(h)return h.declaredBy[0]}(n);if(!l)return;const c=Ri(l);c&&ep(c,n)},e[0]=n,e[1]=r):r=e[1];const s=r;let i,a;return e[2]!==o?(i=xe("text-link opacity-80 hover:opacity-100 hover:underline",o),e[2]=o,e[3]=i):i=e[3],e[4]!==s||e[5]!==i||e[6]!==n?(a=u.jsx("button",{type:"button",onClick:s,className:i,children:n}),e[4]=s,e[5]=i,e[6]=n,e[7]=a):a=e[7],a},z7=jt(t=>{const e=t(hL),n=t(Sc),o=t(na);return ca(e,r=>{if(!r.variable_name)return-1;const s=Object.values(n).find(a=>a.name===r.variable_name);if(!s)return 0;const i=o.inOrderIds.indexOf(s.declaredBy[0]);return i===-1?0:i})}),B7=jt(t=>{const e=new Map(t(fL));for(const n of qC){const o=e.get(n);o&&o.databases.length===0&&e.delete(n)}return ca([...e.values()],n=>qC.has(n.name)?1:0)}),U7=()=>{const t=H.c(32),[e,n]=q.useState(""),o=Ct(GC),r=je(z7),s=je(B7);if(r.length===0&&s.length===0){let b;return t[0]===Symbol.for("react.memo_cache_sentinel")?(b=u.jsx(dn,{title:"No tables found",description:"Any datasets/dataframes in the global scope will be shown here.",action:u.jsx(Dg,{children:u.jsxs(ve,{variant:"outline",size:"sm",children:["Add database or catalog",u.jsx(Jo,{className:"h-4 w-4 ml-2"})]})}),icon:u.jsx(Yo,{})}),t[0]=b):b=t[0],b}const i=!!e.trim();let a,l,c,d,h,f,m,g,x,p;if(t[1]!==o?(a=b=>{o(b.length>0),n(b)},t[1]=o,t[2]=a):a=t[2],t[3]!==e||t[4]!==a?(l=u.jsx(Fi,{placeholder:"Search tables...",className:"h-6 m-1",value:e,onValueChange:a,rootClassName:"flex-1 border-r"}),t[3]=e,t[4]=a,t[5]=l):l=t[5],t[6]!==i?(c=i&&u.jsx("button",{type:"button",className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",onClick:()=>n(""),children:u.jsx(wn,{className:"h-4 w-4"})}),t[6]=i,t[7]=c):c=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(d=u.jsx(Dg,{children:u.jsx("button",{type:"button",className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:u.jsx(Jo,{className:"h-4 w-4"})})}),t[8]=d):d=t[8],t[9]!==l||t[10]!==c?(h=u.jsxs("div",{className:"flex items-center w-full",children:[l,c,d]}),t[9]=l,t[10]=c,t[11]=h):h=t[11],t[12]!==s||t[13]!==i||t[14]!==e){let b;t[16]!==i||t[17]!==e?(b=y=>u.jsx($7,{connection:y,hasChildren:y.databases.length>0,children:y.databases.map(v=>u.jsx(V7,{engineName:y.name,database:v,hasSearch:i,children:u.jsx(H7,{schemas:v.schemas,defaultSchema:y.default_schema,defaultDatabase:y.default_database,engineName:y.name,databaseName:v.name,hasSearch:i,searchValue:e})},v.name))},y.name),t[16]=i,t[17]=e,t[18]=b):b=t[18],f=s.map(b),t[12]=s,t[13]=i,t[14]=e,t[15]=f}else f=t[15];return t[19]!==s.length||t[20]!==r.length?(m=s.length>0&&r.length>0&&u.jsxs(YC,{children:[u.jsx(rc,{className:"h-4 w-4 text-muted-foreground"}),u.jsx("span",{className:"text-xs",children:"Python"})]}),t[19]=s.length,t[20]=r.length,t[21]=m):m=t[21],t[22]!==e||t[23]!==r?(g=r.length>0&&u.jsx(zk,{tables:r,searchValue:e}),t[22]=e,t[23]=r,t[24]=g):g=t[24],t[25]!==f||t[26]!==m||t[27]!==g?(x=u.jsxs($m,{className:"flex flex-col",children:[f,m,g]}),t[25]=f,t[26]=m,t[27]=g,t[28]=x):x=t[28],t[29]!==h||t[30]!==x?(p=u.jsxs(kc,{className:"border-b bg-background rounded-none h-full pb-10 overflow-auto outline-hidden",shouldFilter:!1,children:[h,x]}),t[29]=h,t[30]=x,t[31]=p):p=t[31],p},$7=t=>{const e=H.c(26),{connection:n,children:o,hasChildren:r}=t,s=n.name===mL,i=s?"In-Memory":n.name,{previewDataSourceConnection:a}=tt(),[l,c]=q.useState(!1);let d;e[0]!==n.name||e[1]!==a?(d=async()=>{c(!0),await a({engine:n.name}),setTimeout(()=>c(!1),500)},e[0]=n.name,e[1]=a,e[2]=d):d=e[2];const h=d;let f,m,g;e[3]!==n.dialect?(f=u.jsx(P3,{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=pL(n.dialect),e[5]=n.dialect,e[6]=m):m=e[6],e[7]!==m?(g=u.jsx("span",{className:"text-xs",children:m}),e[7]=m,e[8]=g):g=e[8];const x=i;let p,b,y,v,w;return e[9]!==x?(p=u.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",u.jsx(F7,{variableName:x}),")"]}),e[9]=x,e[10]=p):p=e[10],e[11]!==h||e[12]!==s||e[13]!==l?(b=!s&&u.jsx(Ne,{content:"Refresh connection",children:u.jsx(ve,{variant:"ghost",size:"icon",className:"ml-auto hover:bg-transparent hover:shadow-none",onClick:h,children:u.jsx(Dc,{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]!==g||e[17]!==p||e[18]!==b?(y=u.jsxs(YC,{children:[f,g,p,b]}),e[15]=f,e[16]=g,e[17]=p,e[18]=b,e[19]=y):y=e[19],e[20]!==o||e[21]!==r?(v=r?o:u.jsx(Wc,{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=u.jsxs(u.Fragment,{children:[y,v]}),e[23]=y,e[24]=v,e[25]=w):w=e[25],w},V7=t=>{const e=H.c(28),{hasSearch:n,engineName:o,database:r,children:s}=t,[i,a]=q.useState(!1),[l,c]=q.useState(!1);let d,h,f;e[0]!==n?(d=()=>{a(n)},h=[n],e[0]=n,e[1]=d,e[2]=h):(d=e[1],h=e[2]),q.useEffect(d,h),e[3]!==i||e[4]!==l?(f=()=>{a(!i),c(!l)},e[3]=i,e[4]=l,e[5]=f):f=e[5];const m=`${o}:${r.name}`;let g;e[6]!==i?(g=u.jsx(ej,{isExpanded:i}),e[6]=i,e[7]=g):g=e[7];const x=l&&i?"text-foreground":"text-muted-foreground";let p,b;e[8]!==x?(p=xe("h-4 w-4",x),e[8]=x,e[9]=p):p=e[9],e[10]!==p?(b=u.jsx(Yo,{className:p}),e[10]=p,e[11]=b):b=e[11];const y=l&&i&&"font-semibold";let v,w,j,C;e[12]!==y?(v=xe(y),e[12]=y,e[13]=v):v=e[13],e[14]!==r.name?(w=r.name===""?u.jsx("i",{children:"Not connected"}):r.name,e[14]=r.name,e[15]=w):w=e[15],e[16]!==v||e[17]!==w?(j=u.jsx("span",{className:v,children:w}),e[16]=v,e[17]=w,e[18]=j):j=e[18],e[19]!==j||e[20]!==f||e[21]!==m||e[22]!==g||e[23]!==b?(C=u.jsxs(Zn,{className:"text-sm flex flex-row gap-1 items-center cursor-pointer rounded-none",onSelect:f,value:m,children:[g,b,j]}),e[19]=j,e[20]=f,e[21]=m,e[22]=g,e[23]=b,e[24]=C):C=e[24];const N=i&&s;let S;return e[25]!==C||e[26]!==N?(S=u.jsxs(u.Fragment,{children:[C,N]}),e[25]=C,e[26]=N,e[27]=S):S=e[27],S},H7=t=>{const e=H.c(20),{schemas:n,defaultSchema:o,defaultDatabase:r,engineName:s,databaseName:i,hasSearch:a,searchValue:l}=t;if(n.length===0){let h;return e[0]===Symbol.for("react.memo_cache_sentinel")?(h=u.jsx(Wc,{content:"No schemas available",className:"pl-6"}),e[0]=h):h=e[0],h}let c,d;if(e[1]!==i||e[2]!==r||e[3]!==o||e[4]!==s||e[5]!==a||e[6]!==n||e[7]!==l){let h;e[9]!==l?(h=g=>!l||g.tables.some(x=>x.name.toLowerCase().includes(l.toLowerCase())),e[9]=l,e[10]=h):h=e[10];const f=n.filter(h);let m;e[11]!==i||e[12]!==r||e[13]!==o||e[14]!==s||e[15]!==a||e[16]!==l?(m=g=>u.jsx(W7,{databaseName:i,schema:g,hasSearch:a,children:u.jsx(zk,{tables:g.tables,searchValue:l,sqlTableContext:{engine:s,database:i,schema:g.name,defaultSchema:o,defaultDatabase:r}})},g.name),e[11]=i,e[12]=r,e[13]=o,e[14]=s,e[15]=a,e[16]=l,e[17]=m):m=e[17],c=f.map(m),e[1]=i,e[2]=r,e[3]=o,e[4]=s,e[5]=a,e[6]=n,e[7]=l,e[8]=c}else c=e[8];return e[18]!==c?(d=u.jsx(u.Fragment,{children:c}),e[18]=c,e[19]=d):d=e[19],d},W7=t=>{const e=H.c(26),{databaseName:n,schema:o,children:r,hasSearch:s}=t,[i,a]=q.useState(!1),[l,c]=q.useState(!1),d=`${n}:${o.name}`;let h,f,m,g;if(e[0]!==s?(h=()=>{a(s)},f=[s],e[0]=s,e[1]=h,e[2]=f):(h=e[1],f=e[2]),q.useEffect(h,f),QC(o.name))return r;e[3]!==i||e[4]!==l?(m=()=>{a(!i),c(!l)},e[3]=i,e[4]=l,e[5]=m):m=e[5],e[6]!==i?(g=u.jsx(ej,{isExpanded:i}),e[6]=i,e[7]=g):g=e[7];const x=l&&i&&"text-foreground";let p,b;e[8]!==x?(p=xe("h-4 w-4 text-muted-foreground",x),e[8]=x,e[9]=p):p=e[9],e[10]!==p?(b=u.jsx(kL,{className:p}),e[10]=p,e[11]=b):b=e[11];const y=l&&i&&"font-semibold";let v,w,j;e[12]!==y?(v=xe(y),e[12]=y,e[13]=v):v=e[13],e[14]!==o.name||e[15]!==v?(w=u.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]!==g||e[20]!==b||e[21]!==d?(j=u.jsxs(Zn,{className:"text-sm flex flex-row gap-1 items-center pl-5 cursor-pointer rounded-none",onSelect:m,value:d,children:[g,b,w]}),e[17]=w,e[18]=m,e[19]=g,e[20]=b,e[21]=d,e[22]=j):j=e[22];const C=i&&r;let N;return e[23]!==j||e[24]!==C?(N=u.jsxs(u.Fragment,{children:[j,C]}),e[23]=j,e[24]=C,e[25]=N):N=e[25],N},zk=t=>{const e=H.c(24),{tables:n,sqlTableContext:o,searchValue:r}=t,{addTableList:s}=KC(),[i,a]=q.useState(!1),[l,c]=q.useState(!1);let d,h;e[0]!==s||e[1]!==o||e[2]!==n.length||e[3]!==i?(d=async()=>{if(n.length===0&&o&&!i){a(!0),c(!0);const{engine:p,database:b,schema:y}=o,v=await zF.request({engine:p,database:b,schema:y});if(!(v!=null&&v.tables))throw c(!1),new Error("No tables available");s({tables:v.tables,sqlTableContext:o}),c(!1)}},e[0]=s,e[1]=o,e[2]=n.length,e[3]=i,e[4]=d):d=e[4],e[5]!==o||e[6]!==n.length||e[7]!==i?(h=[n.length,o,i],e[5]=o,e[6]=n.length,e[7]=i,e[8]=h):h=e[8];const{isPending:f,error:m}=Tn(d,h);if(f||l){let p;return e[9]===Symbol.for("react.memo_cache_sentinel")?(p=u.jsx(XC,{message:"Loading tables...",className:"pl-12"}),e[9]=p):p=e[9],p}if(m){let p;return e[10]!==m?(p=u.jsx(JC,{error:m,className:"pl-12"}),e[10]=m,e[11]=p):p=e[11],p}if(n.length===0){let p;return e[12]===Symbol.for("react.memo_cache_sentinel")?(p=u.jsx(Wc,{content:"No tables found",className:"pl-9"}),e[12]=p):p=e[12],p}let g,x;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=>u.jsx(q7,{table:v,sqlTableContext:o,isSearching:!!r},v.name),e[19]=r,e[20]=o,e[21]=y):y=e[21],g=b.map(y),e[13]=r,e[14]=o,e[15]=n,e[16]=g}else g=e[16];return e[22]!==g?(x=u.jsx(u.Fragment,{children:g}),e[22]=g,e[23]=x):x=e[23],x},q7=t=>{const e=H.c(64),{table:n,sqlTableContext:o,isSearching:r}=t,{addTable:s}=KC(),[i,a]=q.useState(!1),[l,c]=q.useState(!1),d=n.columns.length>0;let h,f;e[0]!==s||e[1]!==i||e[2]!==o||e[3]!==n.name||e[4]!==d||e[5]!==l?(h=async()=>{if(i&&!d&&o&&!l){c(!0);const{engine:W,database:X,schema:V}=o,Q=await BF.request({engine:W,database:X,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]=i,e[2]=o,e[3]=n.name,e[4]=d,e[5]=l,e[6]=h):h=e[6],e[7]!==i||e[8]!==d?(f=[i,d],e[7]=i,e[8]=d,e[9]=f):f=e[9];const{isFetching:m,isPending:g,error:x}=Tn(h,f),p=je(nc),b=hs(),{createNewCell:y}=lt(),v=ZC();let w;e[10]!==v||e[11]!==p||e[12]!==y||e[13]!==b||e[14]!==o||e[15]!==n?(w=()=>{Jn({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 tj({table:n,columnName:"*",sqlTableContext:o});switch(n.source_type){case"local":return`mo.ui.table(${n.name})`;case"duckdb":case"connection":return tj({table:n,columnName:"*",sqlTableContext:o});default:return pc(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 j=w;let C;e[17]!==n.num_columns||e[18]!==n.num_rows?(C=()=>{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:u.jsx("div",{className:"flex flex-row gap-2 items-center pl-6 group-hover:hidden",children:u.jsx("span",{className:"text-xs text-muted-foreground",children:W.join(", ")})})},e[17]=n.num_columns,e[18]=n.num_rows,e[19]=C):C=e[19];const N=C;let S;e[20]!==x||e[21]!==m||e[22]!==g||e[23]!==o||e[24]!==n?(S=()=>{if(g||m)return u.jsx(XC,{message:"Loading columns...",className:"pl-12"});if(x)return u.jsx(JC,{error:x,className:"pl-12"});const W=n.columns;return W.length===0?u.jsx(Wc,{content:"No columns found",className:"pl-12"}):W.map(X=>u.jsx(G7,{table:n,column:X,sqlTableContext:o},X.name))},e[20]=x,e[21]=m,e[22]=g,e[23]=o,e[24]=n,e[25]=S):S=e[25];const E=S;let T;e[26]!==i||e[27]!==r||e[28]!==n.source_type||e[29]!==n.type?(T=()=>{if(n.source_type==="local")return;const W=n.type==="table"?gL:hm;return u.jsx(W,{className:"h-3 w-3",strokeWidth:i||r?2.5:void 0})},e[26]=i,e[27]=r,e[28]=n.source_type,e[29]=n.type,e[30]=T):T=e[30];const I=T,M=o?`${o.database}.${o.schema}.${n.name}`:n.name,F=o&&(QC(o.schema)?"pl-9":"pl-12"),D=(i||r)&&"font-semibold";let R,P,z,_,k,B,A,U,$,J,G,K;return e[31]!==F||e[32]!==D?(R=xe("rounded-none group h-8 cursor-pointer",F,D),e[31]=F,e[32]=D,e[33]=R):R=e[33],e[34]!==i?(P=()=>a(!i),e[34]=i,e[35]=P):P=e[35],e[36]!==I?(z=I(),e[36]=I,e[37]=z):z=e[37],e[38]!==n.name?(_=u.jsx("span",{className:"text-sm",children:n.name}),e[38]=n.name,e[39]=_):_=e[39],e[40]!==z||e[41]!==_?(k=u.jsxs("div",{className:"flex gap-2 items-center flex-1",children:[z,_]}),e[40]=z,e[41]=_,e[42]=k):k=e[42],e[43]!==N?(B=N(),e[43]=N,e[44]=B):B=e[44],e[45]!==j?(A=zn.stopPropagation(()=>j()),e[45]=j,e[46]=A):A=e[46],e[47]===Symbol.for("react.memo_cache_sentinel")?(U=u.jsx(xL,{className:"h-3 w-3"}),e[47]=U):U=e[47],e[48]!==A?($=u.jsx(Ne,{content:"Add table to notebook",delayDuration:400,children:u.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]!==i||e[51]!==P||e[52]!==k||e[53]!==B||e[54]!==$||e[55]!==R||e[56]!==M?(J=u.jsxs(Zn,{className:R,value:M,"aria-selected":i,forceMount:!0,onSelect:P,children:[k,B,$]}),e[50]=i,e[51]=P,e[52]=k,e[53]=B,e[54]=$,e[55]=R,e[56]=M,e[57]=J):J=e[57],e[58]!==i||e[59]!==E?(G=i&&E(),e[58]=i,e[59]=E,e[60]=G):G=e[60],e[61]!==J||e[62]!==G?(K=u.jsxs(u.Fragment,{children:[J,G]}),e[61]=J,e[62]=G,e[63]=K):K=e[63],K},G7=t=>{var A,U;const e=H.c(51),{table:n,column:o,sqlTableContext:r}=t,[s,i]=q.useState(!1),a=je(GC),l=Ct(bL);let c,d;e[0]!==a?(c=()=>{a&&i(!1)},d=[a],e[0]=a,e[1]=c,e[2]=d):(c=e[1],d=e[2]),q.useEffect(c,d),l(s?$=>new Set([...$,`${n.name}:${o.name}`]):$=>($.delete(`${n.name}:${o.name}`),new Set($)));const h=ZC(),{columnsPreviews:f}=yL();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 g=m;let x;e[6]!==o.name||e[7]!==n.indexes?(x=((U=n.indexes)==null?void 0:U.includes(o.name))||!1,e[6]=o.name,e[7]=n.indexes,e[8]=x):x=e[8];const p=x;let b;e[9]!==h?(b=$=>{h($)},e[9]=h,e[10]=b):b=e[10];const y=b,v=Y7,w=s?"font-semibold":"";let j;e[11]!==o.name||e[12]!==w?(j=u.jsx("span",{className:w,children:o.name}),e[11]=o.name,e[12]=w,e[13]=j):j=e[13];const C=j,N=`${n.name}.${o.name}`,S=`${n.name}.${o.name}`;let E;e[14]!==s?(E=()=>i(!s),e[14]=s,e[15]=E):E=e[15];const T=r?"pl-14":"pl-7";let I,M,F,D,R,P,z,_,k,B;return e[16]!==T?(I=xe("flex flex-row gap-2 items-center flex-1",T),e[16]=T,e[17]=I):I=e[17],e[18]!==o.type||e[19]!==C?(M=u.jsx(vL,{columnName:C,dataType:o.type}),e[18]=o.type,e[19]=C,e[20]=M):M=e[20],e[21]!==g?(F=g&&v({tooltipContent:"Primary key",content:"PK"}),e[21]=g,e[22]=F):F=e[22],e[23]!==p?(D=p&&v({tooltipContent:"Indexed",content:"IDX"}),e[23]=p,e[24]=D):D=e[24],e[25]!==I||e[26]!==M||e[27]!==F||e[28]!==D?(R=u.jsxs("div",{className:I,children:[M,F,D]}),e[25]=I,e[26]=M,e[27]=F,e[28]=D,e[29]=R):R=e[29],e[30]!==o.name?(P=u.jsx(Ne,{content:"Copy column name",delayDuration:400,children:u.jsx(ve,{variant:"text",size:"icon",className:"group-hover:opacity-100 opacity-0 hover:bg-muted text-muted-foreground hover:text-foreground",children:u.jsx($C,{tooltip:!1,value:o.name,className:"h-3 w-3"})})}),e[30]=o.name,e[31]=P):P=e[31],e[32]!==o.external_type?(z=u.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]!==R||e[36]!==P||e[37]!==z||e[38]!==N||e[39]!==S?(_=u.jsxs(Zn,{className:"rounded-none py-1 group cursor-pointer",value:S,onSelect:E,children:[R,P,z]},N),e[34]=E,e[35]=R,e[36]=P,e[37]=z,e[38]=N,e[39]=S,e[40]=_):_=e[40],e[41]!==o||e[42]!==f||e[43]!==y||e[44]!==s||e[45]!==r||e[46]!==n?(k=s&&u.jsx("div",{className:"pl-10 pr-2 py-2 bg-(--slate-1) shadow-inner border-b",children:u.jsx(Cc,{children:u.jsx(wL,{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]!==_||e[49]!==k?(B=u.jsxs(u.Fragment,{children:[_,k]}),e[48]=_,e[49]=k,e[50]=B):B=e[50],B};function Y7(t){const{tooltipContent:e,content:n}=t;return u.jsx(Ne,{content:e,delayDuration:100,children:u.jsx("span",{className:"text-xs text-black bg-gray-100 dark:invert rounded px-1",children:n})})}const K7=()=>{const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=u.jsx(U7,{}),t[0]=e):e=t[0],e},X7=()=>{const t=H.c(5),{documentation:e}=je(CL);if(!e){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=u.jsx(dn,{title:"View docs as you type",description:"Move your text cursor over a symbol to see its documentation.",icon:u.jsx(dd,{})}),t[0]=r):r=t[0],r}let n,o;return t[1]!==e?(n=Qm({html:e}),t[1]=e,t[2]=n):n=t[2],t[3]!==n?(o=u.jsx("div",{className:"p-3 overflow-y-auto overflow-x-hidden h-full docs-documentation flex flex-col gap-4",children:n}),t[3]=n,t[4]=o):o=t[4],o},J7=()=>{const t=H.c(5),e=jL();if(e.length===0){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=u.jsx(dn,{title:"No errors!",icon:u.jsx(Up,{})}),t[0]=r):r=t[0],r}let n,o;return t[1]!==e?(n=e.map(Z7),t[1]=e,t[2]=n):n=t[2],t[3]!==n?(o=u.jsx("div",{className:"flex flex-col overflow-auto",children:n}),t[3]=n,t[4]=o):o=t[4],o};function Z7(t){return u.jsxs("div",{children:[u.jsx("div",{className:"text-xs font-mono font-semibold bg-muted border-y px-2 py-1",children:u.jsx(SL,{cellId:t.cellId})}),u.jsx("div",{className:"px-2",children:u.jsx(NL,{errors:t.output.data,cellId:t.cellId},t.cellId)},t.cellId)]},t.cellId)}const nm=new Map,Q7=({file:t,onOpenNotebook:e})=>{const{theme:n}=Zo(),{sendFileDetails:o,sendUpdateFile:r}=tt(),s=je(ac),[i,a]=O.useState(""),{data:l,isPending:c,error:d,setData:h}=Tn(async()=>{const b=await o({path:t.path}),y=b.contents||"";return a(nm.get(t.path)||y),b},[t.path]),f=async()=>{i!==(l==null?void 0:l.contents)&&await r({path:t.path,contents:i}).then(b=>{b.success&&(h(y=>({...y,contents:i})),a(i))})},m=O.useRef(i);if(m.current=i,O.useEffect(()=>()=>{if(!(l!=null&&l.contents))return;const b=m.current;b===l.contents?nm.delete(t.path):nm.set(t.path,b)},[t.path,l==null?void 0:l.contents]),d)return u.jsx(kr,{error:d});if(c||!l)return null;const g=l.mimeType||"text/plain",x=g in om;if(!l.contents&&!x)return u.jsxs("div",{className:"grid grid-cols-2 gap-2 p-6",children:[u.jsx("div",{className:"font-bold text-muted-foreground",children:"Name"}),u.jsx("div",{children:l.file.name}),u.jsx("div",{className:"font-bold text-muted-foreground",children:"Type"}),u.jsx("div",{children:g})]});const p=u.jsxs("div",{className:"text-xs text-muted-foreground p-1 flex justify-end gap-2 border-b",children:[t.isMarimoFile&&!tn()&&u.jsx(Ne,{content:"Open notebook",children:u.jsx(cn,{size:"small",onClick:b=>e(b),children:u.jsx(vc,{})})}),u.jsx(Ne,{content:"Download",children:u.jsx(cn,{size:"small",onClick:()=>{if(Bk(g)){const b=ML(l.contents,g);return void OL(b,l.file.name)}Ui(new Blob([l.contents||i],{type:g}),l.file.name)},children:u.jsx(Sm,{})})}),!Bk(g)&&u.jsxs(u.Fragment,{children:[u.jsx(Ne,{content:"Copy contents to clipboard",children:u.jsx(cn,{size:"small",onClick:async()=>{await sn(i)},children:u.jsx(Mi,{})})}),u.jsx(Ne,{content:Gt("global.save"),children:u.jsx(cn,{size:"small",color:i===l.contents?void 0:"green",onClick:f,disabled:i===l.contents,children:u.jsx(ma,{})})})]})]});return g.startsWith("image/")?u.jsxs(u.Fragment,{children:[p,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(EL,{base64:l.contents,mime:g})})]}):g==="text/csv"&&l.contents?u.jsxs(u.Fragment,{children:[p,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(_L,{contents:l.contents})})]}):g.startsWith("audio/")?u.jsxs(u.Fragment,{children:[p,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(IL,{base64:l.contents,mime:g})})]}):g.startsWith("video/")?u.jsxs(u.Fragment,{children:[p,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(AL,{base64:l.contents,mime:g})})]}):g.startsWith("application/pdf")?u.jsxs(u.Fragment,{children:[p,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(TL,{base64:l.contents,mime:g})})]}):u.jsxs(u.Fragment,{children:[p,u.jsx("div",{className:"flex-1 overflow-auto",children:u.jsx(O.Suspense,{children:u.jsx(sa,{theme:n==="dark"?"dark":"light",language:om[g]||om.default,className:"border-b",extensions:[We.lineWrapping,Mn.of([{key:s.getHotkey("global.save").key,stopPropagation:!0,run:()=>i!==l.contents&&(f(),!0)}])],value:i,onChange:a})})})]})},Bk=t=>t.startsWith("image/")||t.startsWith("audio/")||t.startsWith("video/")||t.startsWith("application/pdf"),om={"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 e9{constructor(e){this.callbacks=e,this.delegate=new ip([]),this.rootPath="",this.onChange=Bn.NOOP,this.path=new xc("/"),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 ip(o.files),this.rootPath=o.root,this.path=xc.guessDeliminator(o.root)}catch(o){Je({title:"Failed",description:gC(o)})}this.onChange(this.delegate.data)},this.refreshAll=async n=>{const o=[this.rootPath,...n.map(s=>{var i;return(i=this.delegate.find(s))==null?void 0:i.data.path})].filter(Boolean),r=await Promise.all(o.map(s=>this.callbacks.listFiles({path:s}).catch(()=>({files:[]}))));for(const[s,i]of o.entries()){const a=r[s];i===this.rootPath?this.delegate=new ip(a.files):this.delegate.update({id:i,changes:{children:a.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 i=this.delegate.find(s);if(!i)return Promise.resolve();const a=this.path.join(o,this.path.basename(i.data.path));return this.delegate.update({id:s,changes:{path:a}}),this.callbacks.renameFileOrFolder({path:i.data.path,newPath:a}).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 Uk=jt(t=>{const e=t(DL);return Un(e,"no requestClientAtom set"),new e9({listFiles:e.sendListFiles,createFileOrFolder:e.sendCreateFileOrFolder,deleteFileOrFolder:e.sendDeleteFileOrFolder,renameFileOrFolder:e.sendRenameFileOrFolder})}),t9=jt({});function n9(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 $k(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}=tt();let s,i;return e[2]!==r?(s=async a=>{for(const l of a){const c=l9(a9(l));let d="";c&&(d=xc.guessDeliminator(c).dirname(c));const h=(await n9(l)).split(",")[1];await r({path:d,type:"file",name:l.name,contents:h})}await async function(){await Qe.get(Uk).refreshAll([])}()},e[2]=r,e[3]=s):s=e[3],e[4]!==o||e[5]!==s?(i={multiple:!0,maxSize:104857600,onError:i9,onDropRejected:o9,onDrop:s,...o},e[4]=o,e[5]=s,e[6]=i):i=e[6],RL(i)}function o9(t){Je({title:"File upload failed",description:u.jsx("div",{className:"flex flex-col gap-1",children:t.map(r9)}),variant:"danger"})}function r9(t){return u.jsxs("div",{children:[t.file.name," (",t.errors.map(s9).join(", "),")"]},t.file.name)}function s9(t){return t.message}function i9(t){ut.error(t),Je({title:"File upload failed",description:t.message,variant:"danger"})}function a9(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 l9(t){if(t)return t.replace(/^\/+/,"")}const Vk=q.createContext(null),c9=t=>{const e=H.c(60),{height:n}=t,o=O.useRef(null),[r]=Dt(Uk);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[0]=s):s=e[0];const[i,a]=O.useState(s),[l,c]=O.useState(null),{openPrompt:d}=An(),[h,f]=Dt(t9);let m,g;e[1]!==r?(m=()=>r.initialize(a),e[1]=r,e[2]=m):m=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[3]=g):g=e[3];const{isPending:x,error:p}=Tn(m,g);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]!==d||e[8]!==r?(v=async()=>{d({title:"Folder name",onConfirm:async k=>{r.createFolder(k,null)}})},e[7]=d,e[8]=r,e[9]=v):v=e[9];const w=Le(v);let j;e[10]!==d||e[11]!==r?(j=async()=>{d({title:"File name",onConfirm:async k=>{r.createFile(k,null)}})},e[10]=d,e[11]=r,e[12]=j):j=e[12];const C=Le(j);let N;e[13]!==f?(N=()=>{var k;(k=o.current)==null||k.closeAll(),f({})},e[13]=f,e[14]=N):N=e[14];const S=Le(N);if(x){let k;return e[15]===Symbol.for("react.memo_cache_sentinel")?(k=u.jsx(kn,{size:"medium",centered:!0}),e[15]=k):k=e[15],k}if(p){let k;return e[16]!==p?(k=u.jsx(kr,{error:p}),e[16]=p,e[17]=k):k=e[17],k}if(l){let k,B,A,U,$,J;return e[18]===Symbol.for("react.memo_cache_sentinel")?(k=()=>c(null),e[18]=k):k=e[18],e[19]===Symbol.for("react.memo_cache_sentinel")?(B=u.jsx(ve,{onClick:k,"data-testid":"file-explorer-back-button",variant:"text",size:"xs",className:"mb-0",children:u.jsx(wt,{size:16})}),e[19]=B):B=e[19],e[20]!==l.name?(A=u.jsxs("div",{className:"flex items-center pl-1 pr-3 shrink-0 border-b justify-between",children:[B,u.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=G=>Hk(G,r.relativeFromRoot(l.path)),e[22]=l.path,e[23]=r,e[24]=U):U=e[24],e[25]!==l||e[26]!==U?($=u.jsx(O.Suspense,{children:u.jsx(Q7,{onOpenNotebook:U,file:l})}),e[25]=l,e[26]=U,e[27]=$):$=e[27],e[28]!==A||e[29]!==$?(J=u.jsxs(u.Fragment,{children:[A,$]}),e[28]=A,e[29]=$,e[30]=J):J=e[30],J}let E;e[31]!==S||e[32]!==C||e[33]!==w||e[34]!==y||e[35]!==r?(E=u.jsx(u9,{onRefresh:y,onCreateFile:C,onCreateFolder:w,onCollapseAll:S,tree:r}),e[31]=S,e[32]=C,e[33]=w,e[34]=y,e[35]=r,e[36]=E):E=e[36];const T=n-33;let I,M,F,D,R,P,z,_;return e[37]!==r?(I=async k=>{const{ids:B}=k;for(const A of B)await r.delete(A)},M=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]=M,e[40]=F):(I=e[38],M=e[39],F=e[40]),e[41]===Symbol.for("react.memo_cache_sentinel")?(D=k=>{const B=k[0];B&&(B.data.isDirectory||c(B.data))},e[41]=D):D=e[41],e[42]!==h||e[43]!==f||e[44]!==r?(R=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]=R):R=e[45],e[46]!==i||e[47]!==h||e[48]!==I||e[49]!==M||e[50]!==F||e[51]!==R||e[52]!==T?(P=u.jsx(kF,{width:"100%",ref:o,height:T,className:"h-full",data:i,initialOpenState:h,openByDefault:!1,renderCursor:g9,disableDrop:x9,onDelete:I,onRename:M,onMove:F,onSelect:D,onToggle:R,padding:15,rowHeight:30,indent:d9,overscanCount:1e3,disableMultiSelection:!0,children:m9}),e[46]=i,e[47]=h,e[48]=I,e[49]=M,e[50]=F,e[51]=R,e[52]=T,e[53]=P):P=e[53],e[54]!==P||e[55]!==r?(z=u.jsx(Vk,{value:r,children:P}),e[54]=P,e[55]=r,e[56]=z):z=e[56],e[57]!==z||e[58]!==E?(_=u.jsxs(u.Fragment,{children:[E,z]}),e[57]=z,e[58]=E,e[59]=_):_=e[59],_},d9=15,u9=t=>{const e=H.c(30),{onRefresh:n,onCreateFile:o,onCreateFolder:r,onCollapseAll:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={noDrag:!0,noDragEventsBubbling:!0},e[0]=i):i=e[0];const{getRootProps:a,getInputProps:l}=$k(i);let c,d,h,f,m,g,x,p,b,y,v,w,j,C,N;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=u.jsx(ha,{size:16}),e[1]=c):c=e[1],e[2]!==o?(d=u.jsx(Ne,{content:"Add file",children:u.jsx(ve,{"data-testid":"file-explorer-add-file-button",onClick:o,variant:"text",size:"xs",children:c})}),e[2]=o,e[3]=d):d=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(h=u.jsx(nd,{size:16}),e[4]=h):h=e[4],e[5]!==r?(f=u.jsx(Ne,{content:"Add folder",children:u.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]!==a?(m=a({}),e[7]=a,e[8]=m):m=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(g=PL({variant:"text",size:"xs"}),x=u.jsx(FL,{size:16}),e[9]=g,e[10]=x):(g=e[9],x=e[10]),e[11]!==m?(p=u.jsx(Ne,{content:"Upload file",children:u.jsx("button",{"data-testid":"file-explorer-upload-button",...m,className:g,children:x})}),e[11]=m,e[12]=p):p=e[12],e[13]!==l?(b=l({}),e[13]=l,e[14]=b):b=e[14],e[15]!==b?(y=u.jsx("input",{...b,type:"file"}),e[15]=b,e[16]=y):y=e[16],e[17]===Symbol.for("react.memo_cache_sentinel")?(v=u.jsx(NC,{size:16}),e[17]=v):v=e[17],e[18]!==n?(w=u.jsx(Ne,{content:"Refresh",children:u.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")?(j=u.jsx(yp,{size:16}),e[20]=j):j=e[20],e[21]!==s?(C=u.jsx(Ne,{content:"Collapse all folders",children:u.jsx(ve,{"data-testid":"file-explorer-collapse-button",onClick:s,variant:"text",size:"xs",children:j})}),e[21]=s,e[22]=C):C=e[22],e[23]!==y||e[24]!==w||e[25]!==C||e[26]!==d||e[27]!==f||e[28]!==p?(N=u.jsxs("div",{className:"flex items-center justify-end px-2 shrink-0 border-b",children:[d,f,p,y,w,C]}),e[23]=y,e[24]=w,e[25]=C,e[26]=d,e[27]=f,e[28]=p,e[29]=N):N=e[29],N},h9=t=>{const e=H.c(9),{node:n,onOpenMarimoFile:o}=t;let r,s,i;return e[0]!==n?(r=a=>{n.data.isDirectory||(a.stopPropagation(),n.select())},e[0]=n,e[1]=r):r=e[1],e[2]!==n.data.isMarimoFile||e[3]!==o?(s=n.data.isMarimoFile&&!tn()&&u.jsxs("span",{className:"shrink-0 ml-2 text-sm hidden group-hover:inline hover:underline",onClick:o,children:["open ",u.jsx(vc,{className:"inline ml-1",size:12})]}),e[2]=n.data.isMarimoFile,e[3]=o,e[4]=s):s=e[4],e[5]!==n.data.name||e[6]!==r||e[7]!==s?(i=u.jsxs("span",{className:"flex-1 overflow-hidden text-ellipsis",onClick:r,children:[n.data.name,s]}),e[5]=n.data.name,e[6]=r,e[7]=s,e[8]=i):i=e[8],i},f9=t=>{const e=H.c(10),{node:n}=t,o=O.useRef(null);let r,s,i,a,l;return e[0]!==n.data.name?(r=()=>{var c,d;(c=o.current)==null||c.focus(),(d=o.current)==null||d.setSelectionRange(0,n.data.name.lastIndexOf("."))},s=[n.data.name],e[0]=n.data.name,e[1]=r,e[2]=s):(r=e[1],s=e[2]),O.useEffect(r,s),e[3]!==n?(i=()=>n.reset(),a=c=>{c.key==="Escape"&&n.reset(),c.key==="Enter"&&n.submit(c.currentTarget.value)},e[3]=n,e[4]=i,e[5]=a):(i=e[4],a=e[5]),e[6]!==n.data.name||e[7]!==i||e[8]!==a?(l=u.jsx("input",{ref:o,className:"flex-1 bg-transparent border border-border text-muted-foreground",defaultValue:n.data.name,onClick:b9,onBlur:i,onKeyDown:a}),e[6]=n.data.name,e[7]=i,e[8]=a,e[9]=l):l=e[9],l},m9=({node:t,style:e,dragHandle:n})=>{const{openFile:o,sendCreateFileOrFolder:r,sendFileDetails:s}=tt(),i=t.data.isDirectory?"directory":$3(t.data.name),a=V3[i],{openConfirm:l,openPrompt:c}=An(),{createNewCell:d}=lt(),h=hs(),f=O.use(Vk),m=async y=>{Hk(y,f?f.relativeFromRoot(t.data.path):t.data.path)},g=async y=>{y.stopPropagation(),y.preventDefault(),l({title:"Delete file",description:`Are you sure you want to delete ${t.data.name}?`,confirmAction:u.jsx(L3,{onClick:async()=>{await t.tree.delete(t.id)},"aria-label":"Confirm",children:"Delete"})})},x=Le(async()=>{t.open(),c({title:"Folder name",onConfirm:async y=>{f==null||f.createFolder(y,t.id)}})}),p=Le(async()=>{t.open(),c({title:"File name",onConfirm:async y=>{f==null||f.createFile(y,t.id)}})}),b=Le(async()=>{var j;if(!f||t.data.isDirectory)return;const[y,v]=LL(t.data.name),w=`${y}_copy${v}`;try{const C=await s({path:t.data.path}),N=((j=t.parent)==null?void 0:j.data.path)||"";await r({path:N,type:"file",name:w,contents:C.contents?btoa(C.contents):void 0}),await f.refreshAll([N])}catch{Je({title:"Failed to duplicate file",description:"Unable to create a duplicate of the file",variant:"danger"})}});return u.jsxs("div",{style:e,ref:n,className: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:[u.jsx(p9,{node:t}),u.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?u.jsx("img",{src:UF,className:"w-5 h-5 shrink-0 mr-2 filter grayscale",alt:"Marimo"}):u.jsx(a,{className:"w-5 h-5 shrink-0 mr-2",strokeWidth:1.5}),t.isEditing?u.jsx(f9,{node:t}):u.jsx(h9,{node:t,onOpenMarimoFile:m}),u.jsxs(Eo,{modal:!1,children:[u.jsx(_o,{asChild:!0,tabIndex:-1,onClick:y=>y.stopPropagation(),children:u.jsx(ve,{"data-testid":"file-explorer-more-button",variant:"text",tabIndex:-1,size:"xs",className:"mb-0","aria-label":"More options",children:u.jsx(td,{strokeWidth:2,className:"w-5 h-5 hidden group-hover:block"})})}),(()=>{const y={size:14,strokeWidth:1.5,className:"mr-2"};return u.jsxs(Io,{align:"end",className:"no-print w-[220px]",onClick:v=>v.stopPropagation(),onCloseAutoFocus:v=>v.preventDefault(),children:[!t.data.isDirectory&&u.jsxs(At,{onSelect:()=>t.select(),children:[u.jsx(ng,{...y}),"Open file"]}),!t.data.isDirectory&&!tn()&&u.jsxs(At,{onSelect:()=>{o({path:t.data.path})},children:[u.jsx(vc,{...y}),"Open file in external editor"]}),t.data.isDirectory&&u.jsxs(u.Fragment,{children:[u.jsxs(At,{onSelect:()=>p(),children:[u.jsx(ha,{...y}),"Create file"]}),u.jsxs(At,{onSelect:()=>x(),children:[u.jsx(nd,{...y}),"Create folder"]}),u.jsx(an,{})]}),u.jsxs(At,{onSelect:()=>t.edit(),children:[u.jsx($p,{...y}),"Rename"]}),!t.data.isDirectory&&u.jsxs(At,{onSelect:b,children:[u.jsx(Mi,{...y}),"Duplicate"]}),u.jsxs(At,{onSelect:async()=>{await sn(t.data.path),Je({title:"Copied to clipboard"})},children:[u.jsx(sd,{...y}),"Copy path"]}),f&&u.jsxs(At,{onSelect:async()=>{await sn(f.relativeFromRoot(t.data.path)),Je({title:"Copied to clipboard"})},children:[u.jsx(sd,{...y}),"Copy relative path"]}),u.jsx(an,{}),u.jsxs(At,{onSelect:()=>{const{path:v}=t.data;(w=>{d({code:w,before:!1,cellId:h??"__end__"})})(nj[i](v))},children:[u.jsx(Nr,{...y}),"Insert snippet for reading file"]}),u.jsxs(At,{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=nj[i](v);await sn(w)},children:[u.jsx(zL,{...y}),"Copy snippet for reading file"]}),t.data.isMarimoFile&&!tn()&&u.jsxs(u.Fragment,{children:[u.jsx(an,{}),u.jsxs(At,{onSelect:m,children:[u.jsx(Jp,{...y}),"Open notebook"]})]}),u.jsx(an,{}),!t.data.isDirectory&&u.jsxs(u.Fragment,{children:[u.jsxs(At,{onSelect:async()=>{const v=(await s({path:t.data.path})).contents||"";Ui(new Blob([v]),t.data.name)},children:[u.jsx(Sm,{...y}),"Download"]}),u.jsx(an,{})]}),u.jsxs(At,{onSelect:g,variant:"danger",children:[u.jsx(ic,{...y}),"Delete"]})]})})()]})]})]})},p9=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=u.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?u.jsx(No,{className:"w-5 h-5 shrink-0"}):u.jsx(Li,{className:"w-5 h-5 shrink-0"}),e[1]=n.isOpen,e[2]=o):o=e[2],o};function Hk(t,e){t.stopPropagation(),t.preventDefault(),uj(e)}function g9(){return null}function x9(t){const{parentNode:e}=t;return!e.data.isDirectory}function b9(t){return t.stopPropagation()}let Wk,qk,Gk;Wk=()=>{const t=H.c(20),{ref:e,height:n}=BL(),o=n===void 0?1:n;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={noClick:!0,noKeyboard:!0},t[0]=r):r=t[0];const{getRootProps:s,getInputProps:i,isDragActive:a}=$k(r);let l,c,d,h,f,m,g,x;return t[1]!==s?(l=s(),t[1]=s,t[2]=l):l=t[2],t[3]===Symbol.for("react.memo_cache_sentinel")?(c=xe("flex flex-col flex-1 overflow-hidden relative"),t[3]=c):c=t[3],t[4]!==i?(d=i(),t[4]=i,t[5]=d):d=t[5],t[6]!==d?(h=u.jsx("input",{...d}),t[6]=d,t[7]=h):h=t[7],t[8]!==a?(f=a&&u.jsx("div",{className:"absolute inset-0 flex items-center uppercase justify-center text-xl font-bold text-primary/90 bg-accent/85 z-10 border-2 border-dashed border-primary/90 rounded-lg pointer-events-none",children:"Drop files here"}),t[8]=a,t[9]=f):f=t[9],t[10]!==o?(m=u.jsx(c9,{height:o}),t[10]=o,t[11]=m):m=t[11],t[12]!==e||t[13]!==m?(g=u.jsx("div",{ref:e,className:"flex flex-col flex-1 overflow-hidden",children:m}),t[12]=e,t[13]=m,t[14]=g):g=t[14],t[15]!==l||t[16]!==h||t[17]!==f||t[18]!==g?(x=u.jsxs("div",{...l,className:c,children:[h,f,g]}),t[15]=l,t[16]=h,t[17]=f,t[18]=g,t[19]=x):x=t[19],x},fp=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=u.jsx("button",{type:"button","data-testid":n,className:o,onClick:t.onClick,children:"Clear"}),e[2]=t.dataTestId,e[3]=t.onClick,e[4]=o,e[5]=r):r=e[5],r},qk=()=>{const t=H.c(9),e=UL(),{clearLogs:n}=lt();if(e.length===0){let i,a;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=u.jsx("code",{className:"border rounded px-1",children:"stdout"}),t[0]=i):i=t[0],t[1]===Symbol.for("react.memo_cache_sentinel")?(a=u.jsx(dn,{title:"No logs",description:u.jsxs("span",{children:[i," and"," ",u.jsx("code",{className:"border rounded px-1",children:"stderr"})," logs will appear here."]}),icon:u.jsx(dm,{})}),t[1]=a):a=t[1],a}let o,r,s;return t[2]!==n?(o=u.jsx("div",{className:"flex flex-row justify-end px-2 py-1",children:u.jsx(fp,{dataTestId:"clear-logs-button",onClick:n})}),t[2]=n,t[3]=o):o=t[3],t[4]!==e?(r=u.jsx("div",{className:"overflow-auto flex-1",children:u.jsx(Gk,{logs:e,className:"min-w-[300px]"})}),t[4]=e,t[5]=r):r=t[5],t[6]!==o||t[7]!==r?(s=u.jsxs(u.Fragment,{children:[o,r]}),t[6]=o,t[7]=r,t[8]=s):s=t[8],s},Gk=t=>{const e=H.c(10),{logs:n,className:o}=t;let r,s,i,a,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?(i=n.map(w9),e[3]=n,e[4]=i):i=e[4],e[5]!==i?(a=u.jsx("pre",{className:"grid text-xs font-mono gap-1 whitespace-break-spaces font-semibold align-left",children:u.jsx("div",{className:"grid grid-cols-[30px_1fr]",style:s,children:i})}),e[5]=i,e[6]=a):a=e[6],e[7]!==r||e[8]!==a?(l=u.jsx("div",{className:r,children:a}),e[7]=r,e[8]=a,e[9]=l):l=e[9],l};function y9(t){const e=$L(t.timestamp),n=v9[t.level],o=t.level.toUpperCase();return u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"shrink-0 text-(--gray-10) dark:text-(--gray-11)",children:["[",e,"]"]}),u.jsx("span",{className:xe("shrink-0",n),children:o}),u.jsxs("span",{className:"shrink-0 text-(--gray-10)",children:["(",u.jsx(Mo,{cellId:t.cellId}),")"]}),t.message]})}const v9={stdout:"text-(--grass-9)",stderr:"text-(--red-9)"};function w9(t,e){return u.jsxs("div",{className:"contents group",children:[u.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}),u.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:y9(t)})]},e)}const k9=()=>{const t=H.c(7),{items:e}=je(VL);let n,o;t[0]!==e?(o=$F(e),t[0]=e,t[1]=o):o=t[1],n=o;const r=n,{activeHeaderId:s,activeOccurrences:i}=VF(r);if(e.length===0){let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=u.jsx(dn,{title:"No outline-solid",description:"Add markdown headings to your notebook to create an outline.",icon:u.jsx(cd,{})}),t[2]=l):l=t[2],l}let a;return t[3]!==s||t[4]!==i||t[5]!==e?(a=u.jsx(HF,{items:e,activeHeaderId:s,activeOccurrences:i}),t[3]=s,t[4]=i,t[5]=e,t[6]=a):a=t[6],a},Yk=jt(null),Kk=t=>{const e=H.c(9),{onClick:n,loading:o,children:r,className:s}=t;if(o){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=u.jsx(kn,{size:"small",className:"h-4 w-4 shrink-0 opacity-50"}),e[0]=c):c=e[0],c}let i,a,l;return e[1]!==s?(i=xe("px-2 h-full text-xs text-muted-foreground hover:text-foreground","invisible group-hover:visible",s),e[1]=s,e[2]=i):i=e[2],e[3]!==n?(a=zn.stopPropagation(n),e[3]=n,e[4]=a):a=e[4],e[5]!==r||e[6]!==i||e[7]!==a?(l=u.jsx("button",{type:"button",className:i,onClick:a,children:r}),e[5]=r,e[6]=i,e[7]=a,e[8]=l):l=e[8],l},C9=()=>{var N,S;const t=H.c(30),[e]=br(),n=e.package_management.manager,{getDependencyTree:o,getPackageList:r}=tt(),[s,i]=q.useState(null);let a,l;t[0]!==o||t[1]!==r?(a=async()=>{const[E,T]=await Promise.all([r(),o()]);return{list:E.packages,tree:T.tree}},t[0]=o,t[1]=r,t[2]=a):a=t[2],t[3]!==n?(l=[n],t[3]=n,t[4]=l):l=t[4];const{data:c,error:d,refetch:h,isPending:f}=Tn(a,l);if(f){let E;return t[5]===Symbol.for("react.memo_cache_sentinel")?(E=u.jsx(kn,{size:"medium",centered:!0}),t[5]=E):E=t[5],E}if(d){let E;return t[6]!==d?(E=u.jsx(kr,{error:d}),t[6]=d,t[7]=E):E=t[7],E}const m=c.tree!=null;let g;t[8]!==m||t[9]!==s?(g=function(E,T){return E==="list"?"list":T?E||"tree":"list"}(s,m),t[8]=m,t[9]=s,t[10]=g):g=t[10];const x=g,p=(N=c.tree)==null?void 0:N.name,b=(S=c==null?void 0:c.tree)==null?void 0:S.version,y=p==="<root>";let v,w,j,C;return t[11]!==n||t[12]!==h?(v=u.jsx(j9,{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]!==x?(w=m&&u.jsxs("div",{className:"flex items-center justify-between px-2 py-1 border-b",children:[u.jsxs("div",{className:"flex gap-1",children:[u.jsx("button",{type:"button",className:xe("px-2 py-1 text-xs rounded",x==="list"?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground"),onClick:()=>i("list"),children:"List"}),u.jsx("button",{type:"button",className:xe("px-2 py-1 text-xs rounded",x==="tree"?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground"),onClick:()=>i("tree"),children:"Tree"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:"items-center border px-2 py-0.5 text-xs transition-colors focus:outline-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&&u.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]=x,t[19]=w):w=t[19],t[20]!==c.list||t[21]!==c.tree||t[22]!==d||t[23]!==h||t[24]!==x?(j=x==="list"?u.jsx(S9,{packages:c.list,onSuccess:h}):u.jsx(N9,{tree:c.tree,error:d,onSuccess:h}),t[20]=c.list,t[21]=c.tree,t[22]=d,t[23]=h,t[24]=x,t[25]=j):j=t[25],t[26]!==v||t[27]!==w||t[28]!==j?(C=u.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[v,w,j]}),t[26]=v,t[27]=w,t[28]=j,t[29]=C):C=t[29],C},j9=t=>{const e=H.c(40),{onSuccess:n,packageManager:o}=t,[r,s]=q.useState(""),{handleClick:i}=aa(),a=je(Yk),l=Ct(Yk);let c,d;e[0]!==a||e[1]!==l?(c=()=>{a&&(s(a),l(null))},d=[a,l],e[0]=a,e[1]=l,e[2]=c,e[3]=d):(c=e[2],d=e[3]),q.useEffect(c,d);const{loading:h,handleInstallPackages:f}=HL();let m;e[4]!==n?(m=()=>{n(),s("")},e[4]=n,e[5]=m):m=e[5];const g=m;let x;e[6]!==f||e[7]!==r||e[8]!==g?(x=()=>{f(r.split(",").map(E9),g)},e[6]=f,e[7]=r,e[8]=g,e[9]=x):x=e[9];const p=x,b=`Install packages with ${o}...`;let y,v,w,j,C,N,S,E,T,I,M,F,D,R;e[10]!==h||e[11]!==i?(y=h?u.jsx(kn,{size:"small",className:"mr-2 h-4 w-4 shrink-0 opacity-50"}):u.jsx(Ne,{content:"Change package manager",children:u.jsx(Ss,{onClick:()=>i("packageManagement"),className:"mr-2 h-4 w-4 shrink-0 opacity-50 hover:opacity-80 cursor-pointer"})}),e[10]=h,e[11]=i,e[12]=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?(j=u.jsx(oj,{placeholder:b,id:F1,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]=j):j=e[20],e[21]===Symbol.for("react.memo_cache_sentinel")?(C=u.jsx("span",{className:"font-bold tracking-wide",children:"Package name:"}),e[21]=C):C=e[21],e[22]===Symbol.for("react.memo_cache_sentinel")?(N=u.jsxs("div",{children:[C," A package name; this will install the latest version.",u.jsx("div",{className:"text-muted-foreground",children:"Example: httpx"})]}),S=u.jsx("span",{className:"font-bold tracking-wide",children:"Package and version:"}),e[22]=N,e[23]=S):(N=e[22],S=e[23]),e[24]===Symbol.for("react.memo_cache_sentinel")?(E=u.jsxs("div",{children:[S," ","A package with a specific version or version range.",u.jsx("div",{className:"text-muted-foreground",children:"Examples: httpx==0.27.0, httpx>=0.27.0"})]}),T=u.jsx("span",{className:"font-bold tracking-wide",children:"Git:"}),e[24]=E,e[25]=T):(E=e[24],T=e[25]),e[26]===Symbol.for("react.memo_cache_sentinel")?(I=u.jsxs("div",{children:[T," A Git repository",u.jsx("div",{className:"text-muted-foreground",children:"Example: git+https://github.com/encode/httpx"})]}),M=u.jsx("span",{className:"font-bold tracking-wide",children:"URL:"}),e[26]=I,e[27]=M):(I=e[26],M=e[27]),e[28]===Symbol.for("react.memo_cache_sentinel")?(F=u.jsxs("div",{children:[M," A remote wheel or source distribution.",u.jsx("div",{className:"text-muted-foreground",children:"Example: https://example.com/httpx-0.27.0.tar.gz"})]}),D=u.jsx("span",{className:"font-bold tracking-wide",children:"Path:"}),e[28]=F,e[29]=D):(F=e[28],D=e[29]),e[30]===Symbol.for("react.memo_cache_sentinel")?(R=u.jsx(Ne,{delayDuration:300,side:"left",align:"start",content:u.jsxs("div",{className:"text-sm flex flex-col w-full max-w-[360px]",children:["Packages are installed using the package manager specified in your user configuration. Depending on your package manager, you can install packages with various formats:",u.jsxs("div",{className:"flex flex-col gap-2 mt-2",children:[N,E,I,F,u.jsxs("div",{children:[D," A local wheel, source distribution, or project directory.",u.jsx("div",{className:"text-muted-foreground",children:"Example: /example/foo-0.1.0-py3-none-any.whl"})]})]})]}),children:u.jsx(Km,{className:"h-4 w-4 cursor-help text-muted-foreground hover:text-foreground bg-transparent"})}),e[30]=R):R=e[30];const P=r&&"bg-accent text-accent-foreground";let z;e[31]!==P?(z=xe("float-right px-2 m-0 h-full text-sm text-secondary-foreground ml-2",P,"disabled:cursor-not-allowed disabled:opacity-50"),e[31]=P,e[32]=z):z=e[32];const _=!r;let k,B;return e[33]!==p||e[34]!==z||e[35]!==_?(k=u.jsx("button",{type:"button",className:z,onClick:p,disabled:_,children:"Add"}),e[33]=p,e[34]=z,e[35]=_,e[36]=k):k=e[36],e[37]!==k||e[38]!==j?(B=u.jsxs("div",{className:"flex items-center w-full border-b",children:[j,R,k]}),e[37]=k,e[38]=j,e[39]=B):B=e[39],B},S9=t=>{const e=H.c(9),{onSuccess:n,packages:o}=t;if(o.length===0){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=u.jsx(dn,{title:"No packages",description:"No packages are installed in this environment.",icon:u.jsx(Ss,{})}),e[0]=a):a=e[0],a}let r,s,i;if(e[1]===Symbol.for("react.memo_cache_sentinel")?(r=u.jsx(np,{children:u.jsxs(js,{children:[u.jsx(Cr,{children:"Name"}),u.jsx(Cr,{children:"Version"}),u.jsx(Cr,{})]})}),e[1]=r):r=e[1],e[2]!==n||e[3]!==o){let a;e[5]!==n?(a=l=>u.jsxs(js,{className:"group",onClick:async()=>{await sn(`${l.name}==${l.version}`),Je({title:"Copied to clipboard"})},children:[u.jsx(jr,{children:l.name}),u.jsx(jr,{children:l.version}),u.jsxs(jr,{className:"flex justify-end",children:[u.jsx(Xk,{packageName:l.name,onSuccess:n}),u.jsx(Jk,{packageName:l.name,onSuccess:n})]})]},l.name),e[5]=n,e[6]=a):a=e[6],s=o.map(a),e[2]=n,e[3]=o,e[4]=s}else s=e[4];return e[7]!==s?(i=u.jsxs(op,{className:"overflow-auto flex-1",children:[r,u.jsx(rp,{children:s})]}),e[7]=s,e[8]=i):i=e[8],i},Xk=({packageName:t,onSuccess:e})=>{const[n,o]=q.useState(!1),{addPackage:r}=tt();return tn()?null:u.jsx(Kk,{onClick:async()=>{try{o(!0);const s=await r({package:t,upgrade:!0});s.success?(e(),rj(t)):rj(t,s.error)}finally{o(!1)}},loading:n,children:"Upgrade"})},Jk=({packageName:t,onSuccess:e})=>{const[n,o]=q.useState(!1),{removePackage:r}=tt();return u.jsx(Kk,{onClick:async()=>{try{o(!0);const s=await r({package:t});s.success?(e(),sj(t)):sj(t,s.error)}finally{o(!1)}},loading:n,children:"Remove"})},N9=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[i,a]=q.useState(s);let l,c,d;if(e[1]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{a(new Set)},e[1]=l):l=e[1],e[2]!==n?(c=[n],e[2]=n,e[3]=c):c=e[3],q.useEffect(l,c),o){let g;return e[4]!==o?(g=u.jsx(kr,{error:o}),e[4]=o,e[5]=g):g=e[5],g}if(!n){let g;return e[6]===Symbol.for("react.memo_cache_sentinel")?(g=u.jsx(kn,{size:"medium",centered:!0}),e[6]=g):g=e[6],g}if(n.dependencies.length===0){let g;return e[7]===Symbol.for("react.memo_cache_sentinel")?(g=u.jsx(dn,{title:"No dependencies",description:"No package dependencies found in this environment.",icon:u.jsx(Ss,{})}),e[7]=g):g=e[7],g}e[8]===Symbol.for("react.memo_cache_sentinel")?(d=g=>{a(x=>{const p=new Set(x);return p.has(g)?p.delete(g):p.add(g),p})},e[8]=d):d=e[8];const h=d;let f,m;if(e[9]!==i||e[10]!==r||e[11]!==n.dependencies){let g;e[13]!==i||e[14]!==r?(g=(x,p)=>u.jsx("div",{className:"border-b",children:u.jsx(Zk,{nodeId:`root-${p}`,node:x,level:0,isTopLevel:!0,expandedNodes:i,onToggle:h,onSuccess:r})},`${x.name}-${p}`),e[13]=i,e[14]=r,e[15]=g):g=e[15],f=n.dependencies.map(g),e[9]=i,e[10]=r,e[11]=n.dependencies,e[12]=f}else f=e[12];return e[16]!==f?(m=u.jsx("div",{className:"flex-1 overflow-auto",children:u.jsx("div",{children:f})}),e[16]=f,e[17]=m):m=e[17],m},Zk=t=>{const e=H.c(57),{nodeId:n,node:o,level:r,isTopLevel:s,expandedNodes:i,onToggle:a,onSuccess:l}=t,c=s!==void 0&&s,d=o.dependencies.length>0;let h;e[0]!==i||e[1]!==n?(h=i.has(n),e[0]=i,e[1]=n,e[2]=h):h=e[2];const f=h,m=c?0:16+16*r;let g;e[3]!==d||e[4]!==n||e[5]!==a?(g=z=>{z.key!=="Enter"&&z.key!==" "||(z.preventDefault(),d&&a(n))},e[3]=d,e[4]=n,e[5]=a,e[6]=g):g=e[6];const x=g;let p;e[7]!==d||e[8]!==n||e[9]!==a?(p=z=>{z.stopPropagation(),d&&a(n)},e[7]=d,e[8]=n,e[9]=a,e[10]=p):p=e[10];const b=p,y=d&&"select-none",v=c?"px-2 py-0.5":"";let w,j;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]!==c?(j=c?{}:{paddingLeft:`${m}px`},e[14]=m,e[15]=c,e[16]=j):j=e[16];const C=d?f:void 0;let N,S,E,T,I,M,F,D,R,P;return e[17]!==d||e[18]!==f?(N=d?f?u.jsx(No,{className:"w-4 h-4 mr-2 shrink-0"}):u.jsx(Li,{className:"w-4 h-4 mr-2 shrink-0"}):u.jsx("div",{className:"w-4 mr-2 shrink-0"}),e[17]=d,e[18]=f,e[19]=N):N=e[19],e[20]!==o.name?(S=u.jsx("span",{className:"font-medium truncate",children:o.name}),e[20]=o.name,e[21]=S):S=e[21],e[22]!==o.version?(E=o.version&&u.jsxs("span",{className:"text-muted-foreground text-xs",children:["v",o.version]}),e[22]=o.version,e[23]=E):E=e[23],e[24]!==S||e[25]!==E?(T=u.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0 py-1.5",children:[S,E]}),e[24]=S,e[25]=E,e[26]=T):T=e[26],e[27]!==o.tags?(I=o.tags.map(_9),e[27]=o.tags,e[28]=I):I=e[28],e[29]!==I?(M=u.jsx("div",{className:"flex items-center gap-1 ml-2",children:I}),e[29]=I,e[30]=M):M=e[30],e[31]!==c||e[32]!==o.name||e[33]!==l?(F=c&&u.jsxs("div",{className:"flex gap-1 invisible group-hover:visible",children:[u.jsx(Xk,{packageName:o.name,onSuccess:l}),u.jsx(Jk,{packageName:o.name,onSuccess:l})]}),e[31]=c,e[32]=o.name,e[33]=l,e[34]=F):F=e[34],e[35]!==b||e[36]!==x||e[37]!==N||e[38]!==T||e[39]!==M||e[40]!==F||e[41]!==w||e[42]!==j||e[43]!==C?(D=u.jsxs("div",{className:w,style:j,onClick:b,onKeyDown:x,tabIndex:0,role:"treeitem","aria-selected":!1,"aria-expanded":C,children:[N,T,M,F]}),e[35]=b,e[36]=x,e[37]=N,e[38]=T,e[39]=M,e[40]=F,e[41]=w,e[42]=j,e[43]=C,e[44]=D):D=e[44],e[45]!==i||e[46]!==d||e[47]!==f||e[48]!==r||e[49]!==o.dependencies||e[50]!==n||e[51]!==l||e[52]!==a?(R=d&&f&&u.jsx("div",{role:"group",children:o.dependencies.map((z,_)=>u.jsx(Zk,{nodeId:`${n}-${_}`,node:z,level:r+1,isTopLevel:!1,expandedNodes:i,onToggle:a,onSuccess:l},`${z.name}-${_}`))}),e[45]=i,e[46]=d,e[47]=f,e[48]=r,e[49]=o.dependencies,e[50]=n,e[51]=l,e[52]=a,e[53]=R):R=e[53],e[54]!==D||e[55]!==R?(P=u.jsxs("div",{children:[D,R]}),e[54]=D,e[55]=R,e[56]=P):P=e[56],P};function E9(t){return t.trim()}function _9(t,e){return t.kind==="cycle"?u.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"?u.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"?u.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 rm=um("marimo:scratchpadHistory:v1",[]),I9=jt(!1),A9=jt(null,(t,e,n)=>{if(!(n=n.trim()))return;const o=t(rm),r=[n,...o.filter(s=>s!==n)].slice(0,15);e(rm,r)}),T9={hide_code:!1,disabled:!1},M9=()=>{const t=H.c(71),e=Mm(),[n]=br(),{theme:o}=Zo(),r=O.useRef(null),s=hs(),{createNewCell:i,updateCellCode:a}=lt(),{sendRunScratchpad:l}=tt(),c=e.cellRuntime[Qo],d=c==null?void 0:c.output,h=c==null?void 0:c.status,f=c==null?void 0:c.consoleOutputs,m=e.cellData[Qo],g=(m==null?void 0:m.code)??"",x=Ct(A9),[p,b]=Dt(I9),y=je(rm);let v;t[0]!==x||t[1]!==g||t[2]!==l?(v=()=>{l({code:g}),x(g)},t[0]=x,t[1]=g,t[2]=l,t[3]=v):v=t[3];const w=Le(v);let j;t[4]!==g||t[5]!==i||t[6]!==s?(j=()=>{g.trim()&&i({code:g,before:!1,cellId:s??"__end__"})},t[4]=g,t[5]=i,t[6]=s,t[7]=j):j=t[7];const C=Le(j);let N;t[8]!==l||t[9]!==a?(N=()=>{a({cellId:Qo,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]=a,t[10]=N):N=t[10];const S=Le(N);let E;t[11]!==b||t[12]!==a?(E=ue=>{b(!1),a({cellId:Qo,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]=a,t[13]=E):E=t[13];const T=Le(E),[I,M]=O.useState();let F;t[14]!==g||t[15]!==f||t[16]!==w||t[17]!==I||t[18]!==d||t[19]!==o||t[20]!==n?(F=()=>u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"overflow-auto shrink-0 max-h-[40%]",children:u.jsx(Fu,{theme:o,showPlaceholder:!1,id:Qo,code:g,config:T9,status:"idle",serializedEditorState:null,runCell:w,userConfig:n,editorViewRef:r,setEditorView:ue=>{r.current=ue},hidden:!1,showHiddenCode:Bn.NOOP,languageAdapter:I,setLanguageAdapter:M})}),u.jsx("div",{className:"flex-1 overflow-auto shrink-0",children:u.jsx($c,{allowExpand:!1,output:d,className:"output-area",cellId:Qo,stale:!1,loading:!1})}),u.jsx("div",{className:"overflow-auto shrink-0 max-h-[35%]",children:u.jsx(cp,{consoleOutputs:f,className:"overflow-auto",stale:!1,cellName:y3,onSubmitDebugger:Bn.NOOP,cellId:Qo,debuggerActive:!1})})]}),t[14]=g,t[15]=f,t[16]=w,t[17]=I,t[18]=d,t[19]=o,t[20]=n,t[21]=F):F=t[21];const D=F;let R;t[22]!==T||t[23]!==y||t[24]!==p||t[25]!==o?(R=()=>p?u.jsx("div",{className:"absolute inset-0 z-100 bg-background p-3 border-none overflow-auto",children:u.jsx("div",{className:"overflow-auto flex flex-col gap-3",children:y.map((ue,de)=>u.jsx("div",{className:"border rounded-md hover:shadow-sm cursor-pointer hover:border-input overflow-hidden",onClick:()=>T(ue),children:u.jsx(O.Suspense,{children:u.jsx(sa,{language:"python",theme:o,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1},value:ue.trim(),editable:!1,readOnly:!0})})},de))})}):null,t[22]=T,t[23]=y,t[24]=p,t[25]=o,t[26]=R):R=t[26];const P=R;let z,_,k,B,A,U,$,J,G,K,W;t[27]===Symbol.for("react.memo_cache_sentinel")?(z=Oi.create(Qo),_=u.jsx("p",{className:"mx-2 my-2 text-muted-foreground text-sm",children:"Use this scratchpad cell to experiment with code without restrictions on variable names. Scratchpad code is ephemeral: variables defined in the scratchpad aren't saved to notebook memory, and the code is not saved in the notebook file."}),t[27]=z,t[28]=_):(z=t[27],_=t[28]),t[29]===Symbol.for("react.memo_cache_sentinel")?(k=Gt("cell.run"),t[29]=k):k=t[29],t[30]===Symbol.for("react.memo_cache_sentinel")?(B=u.jsx(Sr,{color:"var(--grass-11)",size:16}),t[30]=B):B=t[30],t[31]!==w||t[32]!==p?(A=u.jsx(Ne,{content:k,children:u.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=u.jsx(wp,{size:16}),t[34]=U):U=t[34],t[35]!==S||t[36]!==p?($=u.jsx(Ne,{content:"Clear code and outputs",children:u.jsx(ve,{disabled:p,size:"xs",variant:"text",onClick:S,children:U})}),t[35]=S,t[36]=p,t[37]=$):$=t[37],t[38]===Symbol.for("react.memo_cache_sentinel")?(J=u.jsx(Nr,{size:16}),t[38]=J):J=t[38],t[39]!==C||t[40]!==p?(G=u.jsx(Rs,{children:u.jsx(Ne,{content:"Insert code",children:u.jsx(ve,{disabled:p,size:"xs",variant:"text",onClick:C,children:J})})}),t[39]=C,t[40]=p,t[41]=G):G=t[41],t[42]!==h?(K=(h==="running"||h==="queued")&&u.jsx(kn,{className:"inline",size:"small"}),t[42]=h,t[43]=K):K=t[43],t[44]===Symbol.for("react.memo_cache_sentinel")?(W=u.jsx("div",{className:"flex-1"}),t[44]=W):W=t[44];const X=p&&"bg-(--sky-3) rounded-none";let V,Q;t[45]!==X?(V=xe(X),t[45]=X,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,ie,se,ae,ge,oe;return t[50]===Symbol.for("react.memo_cache_sentinel")?(re=u.jsx(_p,{size:16}),t[50]=re):re=t[50],t[51]!==V||t[52]!==Q||t[53]!==te?(ne=u.jsx(Ne,{content:"Toggle history",children:u.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]!==G||t[58]!==K||t[59]!==ne?(ie=u.jsxs("div",{className:"flex items-center shrink-0",children:[A,$,G,K,W,ne]}),t[55]=A,t[56]=$,t[57]=G,t[58]=K,t[59]=ne,t[60]=ie):ie=t[60],t[61]!==D?(se=D(),t[61]=D,t[62]=se):se=t[62],t[63]!==P?(ae=P(),t[63]=P,t[64]=ae):ae=t[64],t[65]!==se||t[66]!==ae?(ge=u.jsxs("div",{className:"flex-1 divide-y relative overflow-hidden flex flex-col",children:[se,ae]}),t[65]=se,t[66]=ae,t[67]=ge):ge=t[67],t[68]!==ie||t[69]!==ge?(oe=u.jsxs("div",{className:"flex flex-col h-full overflow-hidden divide-y",id:z,children:[_,ie,ge]}),t[68]=ie,t[69]=ge,t[70]=oe):oe=t[70],oe},O9=()=>{const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=u.jsx(M9,{}),t[0]=e):e=t[0],e},D9=()=>{const t=H.c(23),{openModal:e,closeModal:n}=An();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],t[0]=o):o=t[0];const{data:r,isPending:s,error:i,refetch:a}=Tn(P9,o);if(s){let b;return t[1]===Symbol.for("react.memo_cache_sentinel")?(b=u.jsx(kn,{size:"medium",centered:!0}),t[1]=b):b=t[1],b}if(i){let b;return t[2]!==i?(b=u.jsx(kr,{error:i}),t[2]=i,t[3]=b):b=t[3],b}let l;t[4]!==r?(l=r.filter(L9).map(F9),t[4]=r,t[5]=l):l=t[5];const c=l;if(r.length===0){let b;return t[6]===Symbol.for("react.memo_cache_sentinel")?(b=u.jsx(dn,{title:"No environment variables",description:"No environment variables are available in this notebook.",icon:u.jsx(od,{})}),t[6]=b):b=t[6],b}let d,h,f,m,g,x,p;return t[7]!==n||t[8]!==e||t[9]!==c||t[10]!==a?(d=()=>e(u.jsx(Ag,{providerNames:c,onSuccess:()=>{a(),n()},onClose:n})),t[7]=n,t[8]=e,t[9]=c,t[10]=a,t[11]=d):d=t[11],t[12]===Symbol.for("react.memo_cache_sentinel")?(h=u.jsx(Jo,{className:"h-4 w-4"}),t[12]=h):h=t[12],t[13]!==d?(f=u.jsx("div",{className:"flex justify-end h-8 border-b",children:u.jsx("button",{type:"button",className:"float-right border-l px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",onClick:d,children:h})}),t[13]=d,t[14]=f):f=t[14],t[15]===Symbol.for("react.memo_cache_sentinel")?(m=u.jsx(np,{children:u.jsxs(js,{children:[u.jsx(Cr,{children:"Environment Variable"}),u.jsx(Cr,{children:"Source"}),u.jsx(Cr,{})]})}),t[15]=m):m=t[15],t[16]!==r?(g=r.map(z9),t[16]=r,t[17]=g):g=t[17],t[18]!==g?(x=u.jsxs(op,{className:"overflow-auto flex-1 mb-16",children:[m,u.jsx(rp,{children:g})]}),t[18]=g,t[19]=x):x=t[19],t[20]!==f||t[21]!==x?(p=u.jsxs("div",{className:"flex flex-col h-full",children:[f,x]}),t[20]=f,t[21]=x,t[22]=p):p=t[22],p},R9=t=>{const e=H.c(9),{className:n,ariaLabel:o,onCopy:r}=t,[s,i]=q.useState(!1);let a;e[0]!==r?(a=()=>{r(),i(!0),setTimeout(()=>i(!1),1e3)},e[0]=r,e[1]=a):a=e[1];const l=a;let c,d;return e[2]!==s?(c=s?u.jsx(yc,{className:"w-3 h-3 text-green-700 rounded"}):u.jsx(Mi,{className:"w-3 h-3 hover:bg-muted rounded"}),e[2]=s,e[3]=c):c=e[3],e[4]!==o||e[5]!==n||e[6]!==l||e[7]!==c?(d=u.jsx("button",{type:"button",className:n,onClick:l,"aria-label":o,children:c}),e[4]=o,e[5]=n,e[6]=l,e[7]=c,e[8]=d):d=e[8],d};async function P9(){return Ig((await xj.request({})).secrets)}function L9(t){return t.provider!=="env"}function F9(t){return t.name}function z9(t){return t.keys.map(e=>u.jsxs(js,{className:"group",children:[u.jsx(jr,{children:e}),u.jsx(jr,{children:t.provider!=="env"&&u.jsx(HC,{variant:"outline",className:"select-none",children:t.name})}),u.jsx(jr,{children:u.jsx(R9,{ariaLabel:`Copy ${e}`,onCopy:async()=>{await sn(`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 B9=t=>{const e=H.c(6),{children:n}=t,{openModal:o,closeModal:r}=An();let s,i;return e[0]!==r||e[1]!==o?(s=()=>o(u.jsx($9,{onClose:r})),e[0]=r,e[1]=o,e[2]=s):s=e[2],e[3]!==n||e[4]!==s?(i=u.jsx(PC,{onClick:s,children:n}),e[3]=n,e[4]=s,e[5]=i):i=e[5],i},U9=[We.lineWrapping],$9=t=>{const e=H.c(23),{onClose:n}=t,[o,r]=O.useState(""),{theme:s}=Zo();let i,a,l,c,d,h;e[0]!==n?(i=async v=>{v.preventDefault();const w=new FormData(v.target),j=w.get("title"),C=w.get("description"),N=w.get("code");fetch("https://marimo.io/api/suggest-snippet",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:j,description:C,code:N})}),n(),Je({title:"Snippet Submitted",description:"Thank you for contributing! We will review your snippet shortly."})},e[0]=n,e[1]=i):i=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(a=u.jsx(Wo,{children:"Contribute a Snippet"}),e[2]=a):a=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(l=u.jsxs(ls,{children:[a,u.jsxs(cs,{children:["Have a useful snippet you want to share with the community? Submit it here or make a pull request"," ",u.jsx("a",{href:Fn.githubPage,target:"_blank",className:"underline",children:"on GitHub"}),"."]})]}),e[3]=l):l=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(c=u.jsx(qo,{id:"title",name:"title",autoFocus:!0,placeholder:"Title",required:!0,autoComplete:"off"}),d=u.jsx(WL,{id:"description",name:"description",autoFocus:!0,placeholder:"Description",rows:5,required:!0,autoComplete:"off"}),e[4]=c,e[5]=d):(c=e[4],d=e[5]),e[6]!==o?(h=u.jsx("input",{type:"hidden",name:"code",value:o}),e[6]=o,e[7]=h):h=e[7];const f=s==="dark"?"dark":"light";let m,g,x,p,b,y;return e[8]!==o||e[9]!==f?(m=u.jsx(sa,{theme:f,language:"python",className:"cm border rounded overflow-hidden",extensions:U9,value:o,onChange:r}),e[8]=o,e[9]=f,e[10]=m):m=e[10],e[11]!==h||e[12]!==m?(g=u.jsxs("div",{className:"flex flex-col gap-6 py-4",children:[c,d,h,m]}),e[11]=h,e[12]=m,e[13]=g):g=e[13],e[14]!==n?(x=u.jsx(ve,{"data-testid":"snippet-cancel-button",variant:"secondary",onClick:n,children:"Cancel"}),e[14]=n,e[15]=x):x=e[15],e[16]===Symbol.for("react.memo_cache_sentinel")?(p=u.jsx(ve,{"data-testid":"snippet-send-button","aria-label":"Save",variant:"default",type:"submit",children:"Send"}),e[16]=p):p=e[16],e[17]!==x?(b=u.jsxs(Ti,{children:[x,p]}),e[17]=x,e[18]=b):b=e[18],e[19]!==i||e[20]!==b||e[21]!==g?(y=u.jsx(Go,{className:"w-fit",children:u.jsxs("form",{onSubmit:i,children:[l,g,b]})}),e[19]=i,e[20]=b,e[21]=g,e[22]=y):y=e[22],y},V9=[We.lineWrapping],H9=()=>{const t=H.c(22),{readSnippets:e}=tt(),[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:i,error:a,isPending:l}=Tn(r,s);if(a){let v;return t[3]!==a?(v=u.jsx(kr,{error:a}),t[3]=a,t[4]=v):v=t[4],v}if(l||!i){let v;return t[5]===Symbol.for("react.memo_cache_sentinel")?(v=u.jsx(kn,{size:"medium",centered:!0}),t[5]=v):v=t[5],v}const c=n?"h-1/3":"h-full";let d,h,f,m,g,x,p,b,y;return t[6]!==c?(d=xe("border-b rounded-none",c),t[6]=c,t[7]=d):d=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(h=u.jsx(Fi,{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=u.jsxs("div",{className:"flex items-center w-full",children:[h,u.jsx(B9,{children:u.jsx("button",{className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:u.jsx(Jo,{className:"h-4 w-4"})})})]}),m=u.jsx(cc,{children:"No results"}),t[9]=f,t[10]=m):(f=t[9],m=t[10]),t[11]===Symbol.for("react.memo_cache_sentinel")?(g=v=>o(v),t[11]=g):g=t[11],t[12]!==i.snippets?(x=u.jsx(q9,{onSelect:g,snippets:i.snippets}),t[12]=i.snippets,t[13]=x):x=t[13],t[14]!==d||t[15]!==x?(p=u.jsxs(kc,{className:d,children:[f,m,x]}),t[14]=d,t[15]=x,t[16]=p):p=t[16],t[17]!==n?(b=u.jsx(O.Suspense,{children:u.jsx("div",{className:"h-2/3 snippet-viewer flex flex-col",children:n?u.jsx(W9,{snippet:n,onClose:()=>o(void 0)},n.title):u.jsx(dn,{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=u.jsxs("div",{className:"flex-1 overflow-hidden",children:[p,b]}),t[19]=b,t[20]=p,t[21]=y):y=t[21],y},W9=t=>{const e=H.c(33),{snippet:n,onClose:o}=t,{theme:r}=Zo(),{createNewCell:s}=lt(),i=hs();let a;e[0]!==s||e[1]!==i||e[2]!==n.sections?(a=()=>{for(const w of[...n.sections].reverse())w.code&&s({code:w.code,before:!1,cellId:i??"__end__",skipIfCodeExists:!0})},e[0]=s,e[1]=i,e[2]=n.sections,e[3]=a):a=e[3];const l=a;let c;e[4]!==s||e[5]!==i?(c=w=>{s({code:w,before:!1,cellId:i??"__end__"})},e[4]=s,e[5]=i,e[6]=c):c=e[6];const d=c;let h,f,m,g,x,p,b,y,v;if(e[7]!==n.title?(h=u.jsx("span",{children:n.title}),e[7]=n.title,e[8]=h):h=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(f=u.jsx(wn,{className:"h-4 w-4"}),e[9]=f):f=e[9],e[10]!==o?(m=u.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?(g=u.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]=g):g=e[14],e[15]===Symbol.for("react.memo_cache_sentinel")?(x=u.jsx(Nr,{className:"ml-2 h-4 w-4"}),e[15]=x):x=e[15],e[16]!==l?(p=u.jsx("div",{className:"flex justify-end",children:u.jsx(Rs,{children:u.jsxs(ve,{className:"float-right",size:"xs",variant:"outline",onClick:l,children:["Insert snippet",x]})})}),e[16]=l,e[17]=p):p=e[17],e[18]!==d||e[19]!==n.sections||e[20]!==n.title||e[21]!==r){let w;e[23]!==d||e[24]!==n.title||e[25]!==r?(w=j=>{const{code:C,html:N,id:S}=j;return N?u.jsx("div",{children:Qm({html:N})},`${n.title}-${S}`):C?u.jsxs("div",{className:"relative hover-actions-parent pr-2",children:[u.jsx(Rs,{children:u.jsx(Ne,{content:"Insert snippet",children:u.jsx(ve,{className:"absolute -top-2 -right-1 z-10 hover-action px-2 bg-background",size:"sm",variant:"outline",onClick:()=>{d(C)},children:u.jsx(Nr,{className:"h-5 w-5"})})})}),u.jsx(O.Suspense,{children:u.jsx(sa,{theme:r==="dark"?"dark":"light",language:"python",className:"cm border rounded overflow-hidden",extensions:V9,value:C,readOnly:!0},`${n.title}-${S}`)})]},`${n.title}-${S}`):null},e[23]=d,e[24]=n.title,e[25]=r,e[26]=w):w=e[26],b=n.sections.map(w),e[18]=d,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=u.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]!==g?(v=u.jsxs(u.Fragment,{children:[g,y]}),e[30]=y,e[31]=g,e[32]=v):v=e[32],v},q9=t=>{const e=H.c(7),{snippets:n,onSelect:o}=t;let r,s;if(e[0]!==o||e[1]!==n){let i;e[3]!==o?(i=a=>u.jsx(Zn,{className:"rounded-none",onSelect:()=>o(a),children:u.jsx("div",{className:"flex flex-row gap-2 items-center",children:u.jsx("span",{className:"mt-1 text-accent-foreground",children:a.title})})},a.title),e[3]=o,e[4]=i):i=e[4],r=n.map(i),e[0]=o,e[1]=n,e[2]=r}else r=e[2];return e[5]!==r?(s=u.jsx($m,{className:"flex flex-col overflow-auto",children:r}),e[5]=r,e[6]=s):s=e[6],s},G9=q.lazy(()=>Hm(()=>import("./tracing-Bpc-dmnr.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}))),Y9=()=>{const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=u.jsx(q.Suspense,{fallback:u.jsx(K9,{}),children:u.jsx(G9,{})}),t[0]=e):e=t[0],e},K9=()=>{const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=u.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:u.jsx(kn,{})}),t[0]=e):e=t[0],e},Qk="name",e3="type-value",sm="defs-refs",X9=[{id:Qk,accessorFn:t=>[t.name,t.declaredBy],enableSorting:!0,sortingFn:"alphanumeric",header:({column:t})=>u.jsx(sp,{header:"Name",column:t}),cell:({getValue:t})=>{const[e,n]=t();return u.jsx(xf,{name:e,declaredBy:n})}},{id:e3,accessorFn:t=>[t.dataType,t.value],enableSorting:!0,sortingFn:"alphanumeric",header:({column:t})=>u.jsx(sp,{header:u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx("span",{children:"Type"}),u.jsx("span",{children:"Value"})]}),column:t}),cell:({getValue:t})=>{const[e,n]=t();return u.jsxs("div",{className:"max-w-[150px]",children:[u.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap text-muted-foreground font-mono text-xs",children:e}),u.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap",title:n??"",children:n})]})}},{id:sm,accessorFn:t=>[t.declaredBy,t.usedBy,t.name,t.declaredByNames,t.usedByNames],enableSorting:!0,sortingFn:"basic",header:({column:t})=>u.jsx(sp,{header:u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx("span",{children:"Declared By"}),u.jsx("span",{children:"Used By"})]}),column:t}),cell:({getValue:t})=>{const[e,n,o]=t(),r=s=>{const i=Ri(s);i&&ep(i,o)};return u.jsxs("div",{className:"flex flex-col gap-1 py-1",children:[u.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-center",children:[u.jsx("span",{title:"Declared by",children:u.jsx(Kp,{className:"w-3.5 h-3.5 text-muted-foreground"})}),e.length===1?u.jsx(Mo,{variant:"focus",cellId:e[0],skipScroll:!0,onClick:()=>r(e[0])}):u.jsx("div",{className:"text-destructive flex flex-row gap-2",children:e.slice(0,3).map((s,i)=>u.jsxs("span",{className:"flex",children:[u.jsx(Mo,{variant:"focus",cellId:s,skipScroll:!0,className:"whitespace-nowrap text-destructive",onClick:()=>r(s)},s),i<e.length-1&&", "]},s))})]}),u.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-baseline",children:[u.jsx("span",{title:"Used by",children:u.jsx(pa,{className:"w-3.5 h-3.5 text-muted-foreground"})}),u.jsx(Cw,{maxCount:3,cellIds:n,skipScroll:!0,onClick:r})]})]})}}],t3=O.memo(({className:t,cellIds:e,variables:n})=>{const[o,r]=q.useState([]),[s,i]=q.useState(""),a=qL(),l=O.useMemo(()=>{const h=f=>{const m=a[f];return JL(m)?`cell-${e.indexOf(f)}`:m??`cell-${e.indexOf(f)}`};return Object.values(n).map(f=>({...f,declaredByNames:f.declaredBy.map(h),usedByNames:f.usedBy.map(h)}))},[n,a,e]),c=O.useMemo(()=>{const h=new Map;return e.forEach((f,m)=>h.set(f,m)),function({variables:f,sort:m,cellIdToIndex:g}){m||(m={id:sm,desc:!1});let x=[];switch(m.id){case Qk:x=ca(f,p=>p.name);break;case e3:x=ca(f,p=>p.dataType);break;case sm:x=ca(f,p=>g.get(p.declaredBy[0]))}return m.desc?x.reverse():x}({variables:l,sort:o[0],cellIdToIndex:h})},[l,o,e]),d=GL({data:c,columns:X9,getCoreRowModel:XL(),onGlobalFilterChange:i,getFilteredRowModel:KL(),enableFilters:!0,enableGlobalFilter:!0,enableColumnPinning:!1,getColumnCanGlobalFilter:h=>h.columnDef.enableGlobalFilter??!0,globalFilterFn:"auto",manualSorting:!0,onSortingChange:r,getSortedRowModel:YL(),state:{sorting:o,globalFilter:s}});return u.jsxs(u.Fragment,{children:[u.jsx(oj,{className:"w-full",placeholder:"Search",value:s,onChange:h=>i(h.target.value)}),u.jsxs(op,{className:xe("w-full text-sm flex-1 border-separate border-spacing-0",t),children:[u.jsx(np,{children:u.jsx(js,{className:"whitespace-nowrap text-xs",children:d.getFlatHeaders().map(h=>u.jsx(Cr,{className:"sticky top-0 bg-background border-b",children:ij(h.column.columnDef.header,h.getContext())},h.id))})}),u.jsx(rp,{children:d.getRowModel().rows.map(h=>u.jsx(js,{className:"hover:bg-accent",children:h.getVisibleCells().map(f=>u.jsx(jr,{className:"border-b",children:ij(f.column.columnDef.cell,f.getContext())},f.id))},h.id))})]})]})});t3.displayName="VariableTable";const J9=()=>{const t=H.c(4),e=tp(),n=wr();if(Object.keys(e).length===0){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=u.jsx(dn,{title:"No variables",description:"Global variables will appear here.",icon:u.jsx(Jl,{})}),t[0]=r):r=t[0],r}let o;return t[1]!==n.inOrderIds||t[2]!==e?(o=u.jsx(t3,{className:"flex-1",cellIds:n.inOrderIds,variables:e}),t[1]=n.inOrderIds,t[2]=e,t[3]=o):o=t[3],o},Z9=t=>{const e=H.c(54),n=je(ZL),o=je(M6),r=lt(),s=wC(),i=t.cellId,a=o[t.cellId],l=Qi(t.cellId),c=l.code,d=ea(t.cellId);let h,f,m,g,x,p,b,y,v,w,j,C,N,S;if(e[0]!==r||e[1]!==s||e[2]!==n.focusedCellId||e[3]!==o||e[4]!==t.cellId||e[5]!==a||e[6]!==l.code||e[7]!==d.errored){if(h={id:i,graph:a,code:c,hasError:d.errored},n.focusedCellId&&o[n.focusedCellId]){const z=o[n.focusedCellId];let _;e[20]!==n.focusedCellId||e[21]!==z?(_={id:n.focusedCellId,graph:z},e[20]=n.focusedCellId,e[21]=z,e[22]=_):_=e[22],g=_}m=(g==null?void 0:g.id)===h.id,f=o3(h.graph)?1.5:3;const D=()=>{m?s.blurCell():(r.focusCell({cellId:h.id,where:"exact"}),s.focusCell({cellId:h.id}))};C=h.id;const R=m?"text-primary-foreground":"text-(--gray-8) hover:text-(--gray-9)";e[23]!==R?(x=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",R),e[23]=R,e[24]=x):x=e[24],p=D,b=sO;const P=m&&"bg-primary group-hover:bg-primary";e[25]!==P?(j=xe("group-hover:bg-(--gray-2) flex h-full w-full px-0.5 items-center rounded",P),e[25]=P,e[26]=j):j=e[26],y="truncate px-1 font-mono text-sm flex gap-1",v=h.code,w=h.graph.variables.length>0?u.jsx(nO,{cell:h,selectedCell:g}):u.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap max-w-full",children:tO(h.code)??u.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]=a,e[6]=l.code,e[7]=d.errored,e[8]=h,e[9]=f,e[10]=m,e[11]=g,e[12]=x,e[13]=p,e[14]=b,e[15]=y,e[16]=v,e[17]=w,e[18]=j,e[19]=C}else h=e[8],f=e[9],m=e[10],g=e[11],x=e[12],p=e[13],b=e[14],y=e[15],v=e[16],w=e[17],j=e[18],C=e[19];e[27]!==y||e[28]!==v||e[29]!==w?(N=u.jsx("div",{className:y,title:v,children:w}),e[27]=y,e[28]=v,e[29]=w,e[30]=N):N=e[30],e[31]!==N||e[32]!==j?(S=u.jsx("div",{className:j,children:N}),e[31]=N,e[32]=j,e[33]=S):S=e[33];const E=m?"z-30":"z-20";let T,I,M,F;return e[34]!==h||e[35]!==g||e[36]!==E?(T=xe("absolute overflow-visible top-[10.5px] left-[calc(var(--spacing-extra-small,8px)+17px)] pointer-events-none",E,function({cell:D,selectedCell:R}){return D.hasError?"text-destructive":!R&&!o3(D.graph)?"text-foreground":(R==null?void 0:R.id)===D.id||R!=null&&R.graph.parents.has(D.id)||R!=null&&R.graph.children.has(D.id)?"text-primary":"text-(--gray-8)"}({cell:h,selectedCell:g})),e[34]=h,e[35]=g,e[36]=E,e[37]=T):T=e[37],e[38]!==h||e[39]!==f||e[40]!==m||e[41]!==t.cellPositions||e[42]!==g?(I=m?u.jsx(oO,{cell:h,cellPositions:t.cellPositions,circleRadius:f}):u.jsx(rO,{cell:h,selectedCell:g,circleRadius:f}),e[38]=h,e[39]=f,e[40]=m,e[41]=t.cellPositions,e[42]=g,e[43]=I):I=e[43],e[44]!==T||e[45]!==I?(M=u.jsx("svg",{className:T,width:"1",height:"1",children:I}),e[44]=T,e[45]=I,e[46]=M):M=e[46],e[47]!==x||e[48]!==p||e[49]!==b||e[50]!==S||e[51]!==M||e[52]!==C?(F=u.jsxs("button",{"data-node-id":C,className:x,onClick:p,onMouseDown:b,children:[S,M]}),e[47]=x,e[48]=p,e[49]=b,e[50]=S,e[51]=M,e[52]=C,e[53]=F):F=e[53],F},Q9=t=>{const e=H.c(28),{open:n,setOpen:o}=t,r=wr();let s;e[0]!==r.inOrderIds?(s=Object.fromEntries(r.inOrderIds.map(iO)),e[0]=r.inOrderIds,e[1]=s):s=e[1];const i=s;let a;if(e[2]!==r){a=[];let v=0;for(const[w,j]of r.getColumns().entries())w>0&&a.push(v),v+=j.inOrderIds.length;e[2]=r,e[3]=a}else a=e[3];const l=n?"translate-x-0":"translate-x-[calc(100%+20px)]";let c,d,h,f,m,g,x,p,b,y;if(e[4]!==l?(c=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]=c):c=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(d=u.jsx("span",{className:"text-sm font-semibold",children:"Minimap"}),e[6]=d):d=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=u.jsx(wn,{className:"h-4 w-4"}),e[9]=f):f=e[9],e[10]!==h?(m=u.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[d,u.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]!==i||e[14]!==a){let v;e[16]!==i||e[17]!==a?(v=(w,j)=>{const C=a.includes(j);return u.jsxs(O.Fragment,{children:[C&&u.jsx("div",{className:"absolute left-5 w-[36px] h-px bg-(--gray-4) pointer-events-none","aria-hidden":"true"}),u.jsx(Z9,{cellId:w,cellPositions:i})]},w)},e[16]=i,e[17]=a,e[18]=v):v=e[18],g=r.inOrderIds.map(v),e[12]=r.inOrderIds,e[13]=i,e[14]=a,e[15]=g}else g=e[15];return e[19]!==g?(x=u.jsx("div",{className:"py-3 pl-3 pr-4 relative min-h-full",children:g}),e[19]=g,e[20]=x):x=e[20],e[21]===Symbol.for("react.memo_cache_sentinel")?(p=u.jsx("div",{className:"h-0 overflow-hidden","aria-hidden":"true"}),e[21]=p):p=e[21],e[22]!==x?(b=u.jsxs("div",{className:"overflow-y-auto overflow-x-hidden flex-1 scrollbar-none",children:[x,p]}),e[22]=x,e[23]=b):b=e[23],e[24]!==b||e[25]!==c||e[26]!==m?(y=u.jsxs("div",{className:c,children:[m,b]}),e[24]=b,e[25]=c,e[26]=m,e[27]=y):y=e[27],y},eO=()=>{const t=H.c(5),[e,n]=Dt($b);let o,r;return t[0]!==n?(o=()=>n(aO),t[0]=n,t[1]=o):o=t[1],Rt("global.toggleMinimap",o),t[2]!==e||t[3]!==n?(r=u.jsx(Q9,{open:e,setOpen:n}),t[2]=e,t[3]=n,t[4]=r):r=t[4],r};function tO(t){return t.split(`
|
|
163
|
-
`)[0].trim()||void 0}const nO=t=>{const e=H.c(11),{cell:n,selectedCell:o}=t,r=tp(),s=n.id===(o==null?void 0:o.id);let i,a;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=(c,d)=>{const h=r[c];return u.jsxs(O.Fragment,{children:[d>0&&", ",u.jsx("span",{className:xe({"font-bold":s,"text-foreground":o===void 0,"text-primary font-medium":!s&&O6(h,o)}),children:c})]},c)},e[5]=s,e[6]=o,e[7]=r,e[8]=l):l=e[8],i=n.graph.variables.map(l),e[0]=n.graph.variables,e[1]=s,e[2]=o,e[3]=r,e[4]=i}else i=e[4];return e[9]!==i?(a=u.jsx(u.Fragment,{children:i}),e[9]=i,e[10]=a):a=e[10],a},oO=t=>{const e=H.c(12),{cell:n,cellPositions:o,circleRadius:r}=t;let s,i,a,l;if(e[0]!==n.graph.children||e[1]!==n.graph.parents||e[2]!==n.id||e[3]!==o){s=[];const c=o[n.id]??0,d=new Set;for(const h of n.graph.parents)n.graph.children.has(h)&&d.add(h);for(const h of d){const f=o[h];if(f!==void 0){const m=21*(f-c);s.push(u.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(d.has(h))continue;const f=o[h];if(f!==void 0){const m=21*(f-c);s.push(u.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(d.has(h))continue;const f=o[h];if(f!==void 0){const m=21*(f-c);s.push(u.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?(i=u.jsx("circle",{r,fill:"currentColor",className:"pointer-events-auto"}),e[5]=r,e[6]=i):i=e[6],e[7]!==s?(a=u.jsx("g",{className:"pen pointer-events-auto",children:s}),e[7]=s,e[8]=a):a=e[8],e[9]!==i||e[10]!==a?(l=u.jsxs("g",{transform:"translate(0, 0)",children:[i,a]}),e[9]=i,e[10]=a,e[11]=l):l=e[11],l};function rO(t){const{cell:e,selectedCell:n,circleRadius:o}=t,r=e.graph.ancestors.size>0,s=e.graph.descendants.size>0;if(!n)return n3({circleRadius:o,leftWisker:r,rightWisker:s});const i=n.graph.ancestors.has(e.id),a=n.graph.descendants.has(e.id);return n3(i||a?{circleRadius:o,leftWisker:r,rightWisker:s,shift:i&&a?void 0:i?"left":"right"}:{circleRadius:o,leftWisker:!1,rightWisker:!1})}function n3(t){const{circleRadius:e,leftWisker:n,rightWisker:o,shift:r}=t,s=r===void 0?0:r==="left"?-14:14;return u.jsxs("g",{transform:`translate(${s}, 0)`,children:[u.jsxs("g",{children:[n&&u.jsx("path",{d:"M 0 0 h -8",fill:"none",strokeWidth:"2",stroke:"currentColor"}),o&&u.jsx("path",{d:"M 0 0 h 8",fill:"none",strokeWidth:"2",stroke:"currentColor"})]}),u.jsx("circle",{r:e,fill:"currentColor",className:"pointer-events-auto"})]})}function o3(t){return t.variables.length===0&&t.ancestors.size===0&&t.descendants.size===0}function sO(t){return t.preventDefault()}function iO(t,e){return[t,e]}function aO(t){return!t}const lO=q.lazy(()=>Hm(()=>import("./terminal-BArxXaJ7.js"),__vite__mapDeps([126,1,2,127]),import.meta.url)),cO=t=>{const e=H.c(122),{children:n}=t,{isSidebarOpen:o,isTerminalOpen:r,selectedPanel:s}=bc(),{setIsSidebarOpen:i,setIsTerminalOpen:a}=Bi(),l=q.useRef(null),c=q.useRef(null);let d,h,f,m,g;e[0]!==o?(d=()=>{if(!l.current)return;const Re=l.current.isCollapsed();o&&Re&&l.current.expand(),o||Re||l.current.collapse(),requestAnimationFrame(uO)},h=[o],e[0]=o,e[1]=d,e[2]=h):(d=e[1],h=e[2]),O.useEffect(d,h),e[3]!==r?(f=()=>{if(!c.current)return;const Re=c.current.isCollapsed();r&&Re&&c.current.expand(),r||Re||c.current.collapse(),requestAnimationFrame(fO)},m=[r],e[3]=r,e[4]=f,e[5]=m):(f=e[4],m=e[5]),O.useEffect(f,m),e[6]!==n?(g=u.jsx(qc,{id:"app",className:"relative h-full",children:u.jsx(O.Suspense,{children:n})},"app"),e[6]=n,e[7]=g):g=e[7];const x=g,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=u.jsx(aj,{onDragging:lj,className:b}),e[10]=b,e[11]=y):y=e[11];const v=y,w=r?"resize-handle":"resize-handle-collapsed";let j,C;e[12]!==w?(j=xe("border-border no-print z-20",w,"horizontal"),e[12]=w,e[13]=j):j=e[13],e[14]!==j?(C=u.jsx(aj,{onDragging:lj,className:j}),e[14]=j,e[15]=C):C=e[15];const N=C;let S,E,T,I,M,F,D,R,P,z,_,k,B,A,U,$,J,G,K,W,X;e[16]!==s?(S=u.jsx("div",{className:"text-sm text-(--slate-11) uppercase tracking-wide font-semibold flex-1",children:s}),e[16]=s,e[17]=S):S=e[17],e[18]!==i?(E=()=>i(!1),e[18]=i,e[19]=E):E=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(T=u.jsx(wn,{className:"w-4 h-4"}),e[20]=T):T=e[20],e[21]!==E?(I=u.jsx(ve,{"data-testid":"close-helper-pane",className:"m-0",size:"xs",variant:"text",onClick:E,children:T}),e[21]=E,e[22]=I):I=e[22],e[23]!==S||e[24]!==I?(M=u.jsxs("div",{className:"p-3 border-b flex justify-between items-center",children:[S,I]}),e[23]=S,e[24]=I,e[25]=M):M=e[25],e[26]!==s?(F=s==="files"&&u.jsx(Wk,{}),e[26]=s,e[27]=F):F=e[27],e[28]!==s?(D=s==="errors"&&u.jsx(J7,{}),e[28]=s,e[29]=D):D=e[29],e[30]!==s?(R=s==="variables"&&u.jsx(J9,{}),e[30]=s,e[31]=R):R=e[31],e[32]!==s?(P=s==="dependencies"&&u.jsx(P7,{}),e[32]=s,e[33]=P):P=e[33],e[34]!==s?(z=s==="packages"&&u.jsx(C9,{}),e[34]=s,e[35]=z):z=e[35],e[36]!==s?(_=s==="outline"&&u.jsx(k9,{}),e[36]=s,e[37]=_):_=e[37],e[38]!==s?(k=s==="datasources"&&u.jsx(K7,{}),e[38]=s,e[39]=k):k=e[39],e[40]!==s?(B=s==="documentation"&&u.jsx(X7,{}),e[40]=s,e[41]=B):B=e[41],e[42]!==s?(A=s==="snippets"&&u.jsx(H9,{}),e[42]=s,e[43]=A):A=e[43],e[44]!==s?(U=s==="scratchpad"&&u.jsx(O9,{}),e[44]=s,e[45]=U):U=e[45],e[46]!==s?($=s==="chat"&&u.jsx(sT,{}),e[46]=s,e[47]=$):$=e[47],e[48]!==s?(J=s==="logs"&&u.jsx(qk,{}),e[48]=s,e[49]=J):J=e[49],e[50]!==s?(G=s==="tracing"&&u.jsx(Y9,{}),e[50]=s,e[51]=G):G=e[51],e[52]!==s?(K=s==="secrets"&&u.jsx(D9,{}),e[52]=s,e[53]=K):K=e[53],e[54]!==F||e[55]!==D||e[56]!==R||e[57]!==P||e[58]!==z||e[59]!==_||e[60]!==k||e[61]!==B||e[62]!==A||e[63]!==U||e[64]!==$||e[65]!==J||e[66]!==G||e[67]!==K?(W=u.jsx(O.Suspense,{children:u.jsxs(Vc,{children:[F,D,R,P,z,_,k,B,A,U,$,J,G,K]})}),e[54]=F,e[55]=D,e[56]=R,e[57]=P,e[58]=z,e[59]=_,e[60]=k,e[61]=B,e[62]=A,e[63]=U,e[64]=$,e[65]=J,e[66]=G,e[67]=K,e[68]=W):W=e[68],e[69]!==M||e[70]!==W?(X=u.jsx(Cc,{children:u.jsxs("div",{className:"flex flex-col h-full flex-1 overflow-hidden mr-[-4px]",children:[M,W]})}),e[69]=M,e[70]=W,e[71]=X):X=e[71];const V=X,Q=o&&"border-r border-l border-(--slate-7)";let te,re,ne,ie,se,ae;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=(Re,Pe)=>{var He;Pe===0&&Re===10&&((He=l.current)==null||He.resize(30))},e[74]=re):re=e[74],e[75]!==i?(ne=()=>i(!1),ie=()=>i(!0),e[75]=i,e[76]=ne,e[77]=ie):(ne=e[76],ie=e[77]),e[78]!==V||e[79]!==v?(se=u.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]!==ie||e[84]!==se?(ae=u.jsx(qc,{ref:l,id:"helper",collapsedSize:0,collapsible:!0,className:te,minSize:10,defaultSize:0,maxSize:75,onResize:re,onCollapse:ne,onExpand:ie,children:se},"helper"),e[81]=te,e[82]=ne,e[83]=ie,e[84]=se,e[85]=ae):ae=e[85];const ge=ae,oe=r&&"border-(--slate-7)";let ue,de,Se,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=(Re,Pe)=>{var He;Pe===0&&Re===10&&((He=c.current)==null||He.resize(30))},e[88]=de):de=e[88],e[89]!==a?(Se=()=>a(!1),Te=()=>a(!0),e[89]=a,e[90]=Se,e[91]=Te):(Se=e[90],Te=e[91]),e[92]===Symbol.for("react.memo_cache_sentinel")?(Fe=u.jsx("div",{}),e[92]=Fe):Fe=e[92],e[93]!==a?(_e=()=>a(!1),e[93]=a,e[94]=_e):_e=e[94],e[95]!==r||e[96]!==_e?(ke=u.jsx(O.Suspense,{fallback:Fe,children:u.jsx(lO,{visible:r,onClose:_e})}),e[95]=r,e[96]=_e,e[97]=ke):ke=e[97],e[98]!==r||e[99]!==ke?(Ye=u.jsx(L7,{isOpen:r,children:ke}),e[98]=r,e[99]=ke,e[100]=Ye):Ye=e[100],e[101]!==ue||e[102]!==Se||e[103]!==Te||e[104]!==Ye||e[105]!==N?(Ve=u.jsxs(qc,{ref:c,id:"terminal",collapsedSize:0,collapsible:!0,className:ue,minSize:10,defaultSize:0,maxSize:75,onResize:de,onCollapse:Se,onExpand:Te,children:[N,Ye]},"terminal"),e[101]=ue,e[102]=Se,e[103]=Te,e[104]=Ye,e[105]=N,e[106]=Ve):Ve=e[106];const Ke=Ve;let ee,ye,we,Ie,Y,me,pe,he,Ce;return e[107]===Symbol.for("react.memo_cache_sentinel")?(ee=WF(),e[107]=ee):ee=e[107],e[108]===Symbol.for("react.memo_cache_sentinel")?(ye=u.jsx(Vc,{children:u.jsx(V6,{})}),e[108]=ye):ye=e[108],e[109]!==Ke?(we=u.jsx(Bb,{capability:"terminal",children:Ke}),e[109]=Ke,e[110]=we):we=e[110],e[111]!==x||e[112]!==we?(Ie=u.jsx(qc,{children:u.jsxs(cj,{autoSaveId:"marimo:chrome:v1:l1",direction:"vertical",children:[x,we]})}),e[111]=x,e[112]=we,e[113]=Ie):Ie=e[113],e[114]===Symbol.for("react.memo_cache_sentinel")?(Y=u.jsx(QL,{}),e[114]=Y):Y=e[114],e[115]!==ge||e[116]!==Ie?(me=u.jsxs(cj,{autoSaveId:"marimo:chrome:v1:l2",direction:"horizontal",storage:ee,children:[ye,ge,Ie,Y]}),e[115]=ge,e[116]=Ie,e[117]=me):me=e[117],e[118]===Symbol.for("react.memo_cache_sentinel")?(pe=u.jsx(eO,{}),e[118]=pe):pe=e[118],e[119]===Symbol.for("react.memo_cache_sentinel")?(he=u.jsx(Cc,{children:u.jsx(Vc,{children:u.jsx(F6,{})})}),e[119]=he):he=e[119],e[120]!==me?(Ce=u.jsxs(qF,{children:[me,pe,he]}),e[120]=me,e[121]=Ce):Ce=e[121],Ce};function dO(){window.dispatchEvent(new Event("resize"))}function uO(){requestAnimationFrame(dO)}function hO(){window.dispatchEvent(new Event("resize"))}function fO(){requestAnimationFrame(hO)}let r3;r3=new URL(window.location.href).searchParams.get(eF.showChrome)==="false",Tj=Object.freeze(Object.defineProperty({__proto__:null,default:t=>{const e=H.c(10);if(r3){let s,i,a;return e[0]!==t?(s=u.jsx(zb,{hideControls:!0,...t}),e[0]=t,e[1]=s):s=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(i=u.jsx(cg,{}),e[2]=i):i=e[2],e[3]!==s?(a=u.jsxs(u.Fragment,{children:[s,i]}),e[3]=s,e[4]=a):a=e[4],a}let n,o,r;return e[5]!==t?(n=u.jsx(zb,{...t}),e[5]=t,e[6]=n):n=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(o=u.jsx(cg,{}),e[7]=o):o=e[7],e[8]!==n?(r=u.jsxs(cO,{children:[n,o]}),e[8]=n,e[9]=r):r=e[9],r}},Symbol.toStringTag,{value:"Module"}))});export{fp as C,Yc as E,dn as P,ez as __tla,Kc as a,Tj as e,Es as f};
|
|
162
|
+
`).length),position:{x:0,y:0}}}createElements(t,e,n,o){const r=[],s=[],i=new Set,a=new Set;for(const l of Object.values(n)){if(l.value==="marimo"&&l.name==="mo")continue;const{declaredBy:c,usedBy:d}=l;for(const h of c)for(const f of d){const m=`${h}-${f}`;a.has(m)||(a.add(m),i.add(h),i.add(f),s.push(this.createEdge(h,f)))}}for(const[l,c]of Zm.zip(t,e)){o||r.push(this.createNode(l,c));const d=i.has(l),h=Qe.get(c).code.trim().startsWith("mo.md");!d&&h||r.push(this.createNode(l,c))}return{nodes:r,edges:s}}},T7=t=>{const e=H.c(43),{cellIds:n,variables:o,cellAtoms:r,children:s,layoutDirection:i,settings:a}=t;let l;e[0]!==r||e[1]!==n||e[2]!==i||e[3]!==a.hidePureMarkdown||e[4]!==o?(l=()=>{let k=Fk.createElements(n,r,o,a.hidePureMarkdown);return k=Lk({nodes:k.nodes,edges:k.edges,direction:i}),k},e[0]=r,e[1]=n,e[2]=i,e[3]=a.hidePureMarkdown,e[4]=o,e[5]=l):l=e[5];const[c]=O.useState(l),[d,h,f]=gw(c.nodes),[m,g,x]=xw(c.edges),p=Ni();let b;e[6]!==i||e[7]!==g||e[8]!==h?(b=k=>{const B=Lk({nodes:k.nodes,edges:k.edges,direction:i});h(B.nodes),g(B.edges)},e[6]=i,e[7]=g,e[8]=h,e[9]=b):b=e[9];const y=Le(b);let v,w;e[10]!==r||e[11]!==n||e[12]!==a.hidePureMarkdown||e[13]!==y||e[14]!==o?(v=()=>{y(Fk.createElements(n,r,o,a.hidePureMarkdown))},w=[n,o,r,y,a.hidePureMarkdown],e[10]=r,e[11]=n,e[12]=a.hidePureMarkdown,e[13]=y,e[14]=o,e[15]=v,e[16]=w):(v=e[15],w=e[16]),O.useEffect(v,w);const[j,C]=O.useState();let N;jw(),e[17]===Symbol.for("react.memo_cache_sentinel")?(N=()=>{C(void 0)},e[17]=N):N=e[17];const S=N;let E,T,I,M,F,D,R,P,z,_;return e[18]===Symbol.for("react.memo_cache_sentinel")?(E={minZoom:.5,maxZoom:1.5},T=(k,B)=>{C({type:"node",id:B.id})},I=(k,B)=>{const{source:A,target:U}=B;C({type:"edge",source:A,target:U})},e[18]=E,e[19]=T,e[20]=I):(E=e[18],T=e[19],I=e[20]),e[21]===Symbol.for("react.memo_cache_sentinel")?(M=u.jsx(JM,{color:"#ccc",variant:En.Dots}),e[21]=M):M=e[21],e[22]!==p||e[23]!==d?(F=()=>{const k=Qe.get(dL);if(k){const B=d.find(A=>A.id===k);B&&(p.fitView({padding:1,duration:600,nodes:[B]}),C({type:"node",id:k}))}},e[22]=p,e[23]=d,e[24]=F):F=e[24],e[25]===Symbol.for("react.memo_cache_sentinel")?(D=u.jsx(Op,{className:"size-4"}),e[25]=D):D=e[25],e[26]!==F?(R=u.jsx(WM,{position:"bottom-right",showInteractive:!1,children:u.jsx(Ne,{content:"Jump to focused cell",delayDuration:200,side:"left",asChild:!1,children:u.jsx(ss,{onMouseDown:zn.preventFocus,onClick:F,children:D})})}),e[26]=F,e[27]=R):R=e[27],e[28]!==m||e[29]!==j||e[30]!==o?(P=u.jsx(ql,{selection:j,variables:o,edges:m,onClearSelection:S}),e[28]=m,e[29]=j,e[30]=o,e[31]=P):P=e[31],e[32]!==s||e[33]!==m||e[34]!==d||e[35]!==x||e[36]!==f||e[37]!==R||e[38]!==P?(z=u.jsxs(pf,{nodes:d,edges:m,nodeTypes:kw,minZoom:.2,fitViewOptions:E,onNodeClick:T,onEdgeClick:I,onNodeDoubleClick:M7,fitView:!0,onNodesChange:f,onEdgesChange:x,zoomOnDoubleClick:!1,nodesConnectable:!1,children:[M,R,P,s]}),e[32]=s,e[33]=m,e[34]=d,e[35]=x,e[36]=f,e[37]=R,e[38]=P,e[39]=z):z=e[39],e[40]!==i||e[41]!==z?(_=u.jsx(vw,{value:i,children:z}),e[40]=i,e[41]=z,e[42]=_):_=e[42],_};function M7(t,e){WC(e.id,"focus")}const O7=jt("_minimap_"),D7=jt({hidePureMarkdown:!0}),R7=t=>{const e=H.c(11),[n,o]=Dt(O7),[r,s]=Dt(D7);let i;e[0]!==n||e[1]!==t||e[2]!==o||e[3]!==s||e[4]!==r?(i=()=>n==="_minimap_"?u.jsx(n7,{...t,children:u.jsx(bf,{settings:r,onSettingsChange:s,view:n,onChange:o})}):u.jsx(T7,{...t,settings:r,layoutDirection:n,children:u.jsx(bf,{settings:r,onSettingsChange:s,view:n,onChange:o})}),e[0]=n,e[1]=t,e[2]=o,e[3]=s,e[4]=r,e[5]=i):i=e[5];const a=i;let l,c;return e[6]!==a?(l=a(),e[6]=a,e[7]=l):l=e[7],e[8]!==n||e[9]!==l?(c=u.jsx(mf,{children:l},n),e[8]=n,e[9]=l,e[10]=c):c=e[10],c},P7=()=>{const t=H.c(5),e=tp(),n=wr(),[o]=uL();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=u.jsx("div",{className:r,children:u.jsx(R7,{cellAtoms:o,variables:e,cellIds:n.inOrderIds})}),t[1]=n.inOrderIds,t[2]=o,t[3]=e,t[4]=s):s=t[4],s},L7=t=>{const e=H.c(4),{isOpen:n,children:o}=t,[r,s]=q.useState(!1);let i,a;return e[0]!==r||e[1]!==n?(i=()=>{n&&!r&&s(!0)},a=[n,r],e[0]=r,e[1]=n,e[2]=i,e[3]=a):(i=e[2],a=e[3]),q.useEffect(i,a),r?o:null},F7=t=>{const e=H.c(8),{variableName:n,className:o}=t;let r;e[0]!==n?(r=()=>{const l=function(d){const h=Qe.get(Sc)[d];if(h)return h.declaredBy[0]}(n);if(!l)return;const c=Ri(l);c&&ep(c,n)},e[0]=n,e[1]=r):r=e[1];const s=r;let i,a;return e[2]!==o?(i=xe("text-link opacity-80 hover:opacity-100 hover:underline",o),e[2]=o,e[3]=i):i=e[3],e[4]!==s||e[5]!==i||e[6]!==n?(a=u.jsx("button",{type:"button",onClick:s,className:i,children:n}),e[4]=s,e[5]=i,e[6]=n,e[7]=a):a=e[7],a},z7=jt(t=>{const e=t(hL),n=t(Sc),o=t(na);return ca(e,r=>{if(!r.variable_name)return-1;const s=Object.values(n).find(a=>a.name===r.variable_name);if(!s)return 0;const i=o.inOrderIds.indexOf(s.declaredBy[0]);return i===-1?0:i})}),B7=jt(t=>{const e=new Map(t(fL));for(const n of qC){const o=e.get(n);o&&o.databases.length===0&&e.delete(n)}return ca([...e.values()],n=>qC.has(n.name)?1:0)}),U7=()=>{const t=H.c(32),[e,n]=q.useState(""),o=Ct(GC),r=je(z7),s=je(B7);if(r.length===0&&s.length===0){let b;return t[0]===Symbol.for("react.memo_cache_sentinel")?(b=u.jsx(dn,{title:"No tables found",description:"Any datasets/dataframes in the global scope will be shown here.",action:u.jsx(Dg,{children:u.jsxs(ve,{variant:"outline",size:"sm",children:["Add database or catalog",u.jsx(Jo,{className:"h-4 w-4 ml-2"})]})}),icon:u.jsx(Yo,{})}),t[0]=b):b=t[0],b}const i=!!e.trim();let a,l,c,d,h,f,m,g,x,p;if(t[1]!==o?(a=b=>{o(b.length>0),n(b)},t[1]=o,t[2]=a):a=t[2],t[3]!==e||t[4]!==a?(l=u.jsx(Fi,{placeholder:"Search tables...",className:"h-6 m-1",value:e,onValueChange:a,rootClassName:"flex-1 border-r"}),t[3]=e,t[4]=a,t[5]=l):l=t[5],t[6]!==i?(c=i&&u.jsx("button",{type:"button",className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",onClick:()=>n(""),children:u.jsx(wn,{className:"h-4 w-4"})}),t[6]=i,t[7]=c):c=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(d=u.jsx(Dg,{children:u.jsx("button",{type:"button",className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:u.jsx(Jo,{className:"h-4 w-4"})})}),t[8]=d):d=t[8],t[9]!==l||t[10]!==c?(h=u.jsxs("div",{className:"flex items-center w-full",children:[l,c,d]}),t[9]=l,t[10]=c,t[11]=h):h=t[11],t[12]!==s||t[13]!==i||t[14]!==e){let b;t[16]!==i||t[17]!==e?(b=y=>u.jsx($7,{connection:y,hasChildren:y.databases.length>0,children:y.databases.map(v=>u.jsx(V7,{engineName:y.name,database:v,hasSearch:i,children:u.jsx(H7,{schemas:v.schemas,defaultSchema:y.default_schema,defaultDatabase:y.default_database,engineName:y.name,databaseName:v.name,hasSearch:i,searchValue:e})},v.name))},y.name),t[16]=i,t[17]=e,t[18]=b):b=t[18],f=s.map(b),t[12]=s,t[13]=i,t[14]=e,t[15]=f}else f=t[15];return t[19]!==s.length||t[20]!==r.length?(m=s.length>0&&r.length>0&&u.jsxs(YC,{children:[u.jsx(rc,{className:"h-4 w-4 text-muted-foreground"}),u.jsx("span",{className:"text-xs",children:"Python"})]}),t[19]=s.length,t[20]=r.length,t[21]=m):m=t[21],t[22]!==e||t[23]!==r?(g=r.length>0&&u.jsx(zk,{tables:r,searchValue:e}),t[22]=e,t[23]=r,t[24]=g):g=t[24],t[25]!==f||t[26]!==m||t[27]!==g?(x=u.jsxs($m,{className:"flex flex-col",children:[f,m,g]}),t[25]=f,t[26]=m,t[27]=g,t[28]=x):x=t[28],t[29]!==h||t[30]!==x?(p=u.jsxs(kc,{className:"border-b bg-background rounded-none h-full pb-10 overflow-auto outline-hidden",shouldFilter:!1,children:[h,x]}),t[29]=h,t[30]=x,t[31]=p):p=t[31],p},$7=t=>{const e=H.c(26),{connection:n,children:o,hasChildren:r}=t,s=n.name===mL,i=s?"In-Memory":n.name,{previewDataSourceConnection:a}=tt(),[l,c]=q.useState(!1);let d;e[0]!==n.name||e[1]!==a?(d=async()=>{c(!0),await a({engine:n.name}),setTimeout(()=>c(!1),500)},e[0]=n.name,e[1]=a,e[2]=d):d=e[2];const h=d;let f,m,g;e[3]!==n.dialect?(f=u.jsx(P3,{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=pL(n.dialect),e[5]=n.dialect,e[6]=m):m=e[6],e[7]!==m?(g=u.jsx("span",{className:"text-xs",children:m}),e[7]=m,e[8]=g):g=e[8];const x=i;let p,b,y,v,w;return e[9]!==x?(p=u.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",u.jsx(F7,{variableName:x}),")"]}),e[9]=x,e[10]=p):p=e[10],e[11]!==h||e[12]!==s||e[13]!==l?(b=!s&&u.jsx(Ne,{content:"Refresh connection",children:u.jsx(ve,{variant:"ghost",size:"icon",className:"ml-auto hover:bg-transparent hover:shadow-none",onClick:h,children:u.jsx(Dc,{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]!==g||e[17]!==p||e[18]!==b?(y=u.jsxs(YC,{children:[f,g,p,b]}),e[15]=f,e[16]=g,e[17]=p,e[18]=b,e[19]=y):y=e[19],e[20]!==o||e[21]!==r?(v=r?o:u.jsx(Wc,{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=u.jsxs(u.Fragment,{children:[y,v]}),e[23]=y,e[24]=v,e[25]=w):w=e[25],w},V7=t=>{const e=H.c(28),{hasSearch:n,engineName:o,database:r,children:s}=t,[i,a]=q.useState(!1),[l,c]=q.useState(!1);let d,h,f;e[0]!==n?(d=()=>{a(n)},h=[n],e[0]=n,e[1]=d,e[2]=h):(d=e[1],h=e[2]),q.useEffect(d,h),e[3]!==i||e[4]!==l?(f=()=>{a(!i),c(!l)},e[3]=i,e[4]=l,e[5]=f):f=e[5];const m=`${o}:${r.name}`;let g;e[6]!==i?(g=u.jsx(ej,{isExpanded:i}),e[6]=i,e[7]=g):g=e[7];const x=l&&i?"text-foreground":"text-muted-foreground";let p,b;e[8]!==x?(p=xe("h-4 w-4",x),e[8]=x,e[9]=p):p=e[9],e[10]!==p?(b=u.jsx(Yo,{className:p}),e[10]=p,e[11]=b):b=e[11];const y=l&&i&&"font-semibold";let v,w,j,C;e[12]!==y?(v=xe(y),e[12]=y,e[13]=v):v=e[13],e[14]!==r.name?(w=r.name===""?u.jsx("i",{children:"Not connected"}):r.name,e[14]=r.name,e[15]=w):w=e[15],e[16]!==v||e[17]!==w?(j=u.jsx("span",{className:v,children:w}),e[16]=v,e[17]=w,e[18]=j):j=e[18],e[19]!==j||e[20]!==f||e[21]!==m||e[22]!==g||e[23]!==b?(C=u.jsxs(Zn,{className:"text-sm flex flex-row gap-1 items-center cursor-pointer rounded-none",onSelect:f,value:m,children:[g,b,j]}),e[19]=j,e[20]=f,e[21]=m,e[22]=g,e[23]=b,e[24]=C):C=e[24];const N=i&&s;let S;return e[25]!==C||e[26]!==N?(S=u.jsxs(u.Fragment,{children:[C,N]}),e[25]=C,e[26]=N,e[27]=S):S=e[27],S},H7=t=>{const e=H.c(20),{schemas:n,defaultSchema:o,defaultDatabase:r,engineName:s,databaseName:i,hasSearch:a,searchValue:l}=t;if(n.length===0){let h;return e[0]===Symbol.for("react.memo_cache_sentinel")?(h=u.jsx(Wc,{content:"No schemas available",className:"pl-6"}),e[0]=h):h=e[0],h}let c,d;if(e[1]!==i||e[2]!==r||e[3]!==o||e[4]!==s||e[5]!==a||e[6]!==n||e[7]!==l){let h;e[9]!==l?(h=g=>!l||g.tables.some(x=>x.name.toLowerCase().includes(l.toLowerCase())),e[9]=l,e[10]=h):h=e[10];const f=n.filter(h);let m;e[11]!==i||e[12]!==r||e[13]!==o||e[14]!==s||e[15]!==a||e[16]!==l?(m=g=>u.jsx(W7,{databaseName:i,schema:g,hasSearch:a,children:u.jsx(zk,{tables:g.tables,searchValue:l,sqlTableContext:{engine:s,database:i,schema:g.name,defaultSchema:o,defaultDatabase:r}})},g.name),e[11]=i,e[12]=r,e[13]=o,e[14]=s,e[15]=a,e[16]=l,e[17]=m):m=e[17],c=f.map(m),e[1]=i,e[2]=r,e[3]=o,e[4]=s,e[5]=a,e[6]=n,e[7]=l,e[8]=c}else c=e[8];return e[18]!==c?(d=u.jsx(u.Fragment,{children:c}),e[18]=c,e[19]=d):d=e[19],d},W7=t=>{const e=H.c(26),{databaseName:n,schema:o,children:r,hasSearch:s}=t,[i,a]=q.useState(!1),[l,c]=q.useState(!1),d=`${n}:${o.name}`;let h,f,m,g;if(e[0]!==s?(h=()=>{a(s)},f=[s],e[0]=s,e[1]=h,e[2]=f):(h=e[1],f=e[2]),q.useEffect(h,f),QC(o.name))return r;e[3]!==i||e[4]!==l?(m=()=>{a(!i),c(!l)},e[3]=i,e[4]=l,e[5]=m):m=e[5],e[6]!==i?(g=u.jsx(ej,{isExpanded:i}),e[6]=i,e[7]=g):g=e[7];const x=l&&i&&"text-foreground";let p,b;e[8]!==x?(p=xe("h-4 w-4 text-muted-foreground",x),e[8]=x,e[9]=p):p=e[9],e[10]!==p?(b=u.jsx(kL,{className:p}),e[10]=p,e[11]=b):b=e[11];const y=l&&i&&"font-semibold";let v,w,j;e[12]!==y?(v=xe(y),e[12]=y,e[13]=v):v=e[13],e[14]!==o.name||e[15]!==v?(w=u.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]!==g||e[20]!==b||e[21]!==d?(j=u.jsxs(Zn,{className:"text-sm flex flex-row gap-1 items-center pl-5 cursor-pointer rounded-none",onSelect:m,value:d,children:[g,b,w]}),e[17]=w,e[18]=m,e[19]=g,e[20]=b,e[21]=d,e[22]=j):j=e[22];const C=i&&r;let N;return e[23]!==j||e[24]!==C?(N=u.jsxs(u.Fragment,{children:[j,C]}),e[23]=j,e[24]=C,e[25]=N):N=e[25],N},zk=t=>{const e=H.c(24),{tables:n,sqlTableContext:o,searchValue:r}=t,{addTableList:s}=KC(),[i,a]=q.useState(!1),[l,c]=q.useState(!1);let d,h;e[0]!==s||e[1]!==o||e[2]!==n.length||e[3]!==i?(d=async()=>{if(n.length===0&&o&&!i){a(!0),c(!0);const{engine:p,database:b,schema:y}=o,v=await zF.request({engine:p,database:b,schema:y});if(!(v!=null&&v.tables))throw c(!1),new Error("No tables available");s({tables:v.tables,sqlTableContext:o}),c(!1)}},e[0]=s,e[1]=o,e[2]=n.length,e[3]=i,e[4]=d):d=e[4],e[5]!==o||e[6]!==n.length||e[7]!==i?(h=[n.length,o,i],e[5]=o,e[6]=n.length,e[7]=i,e[8]=h):h=e[8];const{isPending:f,error:m}=Tn(d,h);if(f||l){let p;return e[9]===Symbol.for("react.memo_cache_sentinel")?(p=u.jsx(XC,{message:"Loading tables...",className:"pl-12"}),e[9]=p):p=e[9],p}if(m){let p;return e[10]!==m?(p=u.jsx(JC,{error:m,className:"pl-12"}),e[10]=m,e[11]=p):p=e[11],p}if(n.length===0){let p;return e[12]===Symbol.for("react.memo_cache_sentinel")?(p=u.jsx(Wc,{content:"No tables found",className:"pl-9"}),e[12]=p):p=e[12],p}let g,x;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=>u.jsx(q7,{table:v,sqlTableContext:o,isSearching:!!r},v.name),e[19]=r,e[20]=o,e[21]=y):y=e[21],g=b.map(y),e[13]=r,e[14]=o,e[15]=n,e[16]=g}else g=e[16];return e[22]!==g?(x=u.jsx(u.Fragment,{children:g}),e[22]=g,e[23]=x):x=e[23],x},q7=t=>{const e=H.c(64),{table:n,sqlTableContext:o,isSearching:r}=t,{addTable:s}=KC(),[i,a]=q.useState(!1),[l,c]=q.useState(!1),d=n.columns.length>0;let h,f;e[0]!==s||e[1]!==i||e[2]!==o||e[3]!==n.name||e[4]!==d||e[5]!==l?(h=async()=>{if(i&&!d&&o&&!l){c(!0);const{engine:W,database:X,schema:V}=o,Q=await BF.request({engine:W,database:X,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]=i,e[2]=o,e[3]=n.name,e[4]=d,e[5]=l,e[6]=h):h=e[6],e[7]!==i||e[8]!==d?(f=[i,d],e[7]=i,e[8]=d,e[9]=f):f=e[9];const{isFetching:m,isPending:g,error:x}=Tn(h,f),p=je(nc),b=hs(),{createNewCell:y}=lt(),v=ZC();let w;e[10]!==v||e[11]!==p||e[12]!==y||e[13]!==b||e[14]!==o||e[15]!==n?(w=()=>{Jn({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 tj({table:n,columnName:"*",sqlTableContext:o});switch(n.source_type){case"local":return`mo.ui.table(${n.name})`;case"duckdb":case"connection":return tj({table:n,columnName:"*",sqlTableContext:o});default:return pc(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 j=w;let C;e[17]!==n.num_columns||e[18]!==n.num_rows?(C=()=>{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:u.jsx("div",{className:"flex flex-row gap-2 items-center pl-6 group-hover:hidden",children:u.jsx("span",{className:"text-xs text-muted-foreground",children:W.join(", ")})})},e[17]=n.num_columns,e[18]=n.num_rows,e[19]=C):C=e[19];const N=C;let S;e[20]!==x||e[21]!==m||e[22]!==g||e[23]!==o||e[24]!==n?(S=()=>{if(g||m)return u.jsx(XC,{message:"Loading columns...",className:"pl-12"});if(x)return u.jsx(JC,{error:x,className:"pl-12"});const W=n.columns;return W.length===0?u.jsx(Wc,{content:"No columns found",className:"pl-12"}):W.map(X=>u.jsx(G7,{table:n,column:X,sqlTableContext:o},X.name))},e[20]=x,e[21]=m,e[22]=g,e[23]=o,e[24]=n,e[25]=S):S=e[25];const E=S;let T;e[26]!==i||e[27]!==r||e[28]!==n.source_type||e[29]!==n.type?(T=()=>{if(n.source_type==="local")return;const W=n.type==="table"?gL:hm;return u.jsx(W,{className:"h-3 w-3",strokeWidth:i||r?2.5:void 0})},e[26]=i,e[27]=r,e[28]=n.source_type,e[29]=n.type,e[30]=T):T=e[30];const I=T,M=o?`${o.database}.${o.schema}.${n.name}`:n.name,F=o&&(QC(o.schema)?"pl-9":"pl-12"),D=(i||r)&&"font-semibold";let R,P,z,_,k,B,A,U,$,J,G,K;return e[31]!==F||e[32]!==D?(R=xe("rounded-none group h-8 cursor-pointer",F,D),e[31]=F,e[32]=D,e[33]=R):R=e[33],e[34]!==i?(P=()=>a(!i),e[34]=i,e[35]=P):P=e[35],e[36]!==I?(z=I(),e[36]=I,e[37]=z):z=e[37],e[38]!==n.name?(_=u.jsx("span",{className:"text-sm",children:n.name}),e[38]=n.name,e[39]=_):_=e[39],e[40]!==z||e[41]!==_?(k=u.jsxs("div",{className:"flex gap-2 items-center flex-1",children:[z,_]}),e[40]=z,e[41]=_,e[42]=k):k=e[42],e[43]!==N?(B=N(),e[43]=N,e[44]=B):B=e[44],e[45]!==j?(A=zn.stopPropagation(()=>j()),e[45]=j,e[46]=A):A=e[46],e[47]===Symbol.for("react.memo_cache_sentinel")?(U=u.jsx(xL,{className:"h-3 w-3"}),e[47]=U):U=e[47],e[48]!==A?($=u.jsx(Ne,{content:"Add table to notebook",delayDuration:400,children:u.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]!==i||e[51]!==P||e[52]!==k||e[53]!==B||e[54]!==$||e[55]!==R||e[56]!==M?(J=u.jsxs(Zn,{className:R,value:M,"aria-selected":i,forceMount:!0,onSelect:P,children:[k,B,$]}),e[50]=i,e[51]=P,e[52]=k,e[53]=B,e[54]=$,e[55]=R,e[56]=M,e[57]=J):J=e[57],e[58]!==i||e[59]!==E?(G=i&&E(),e[58]=i,e[59]=E,e[60]=G):G=e[60],e[61]!==J||e[62]!==G?(K=u.jsxs(u.Fragment,{children:[J,G]}),e[61]=J,e[62]=G,e[63]=K):K=e[63],K},G7=t=>{var A,U;const e=H.c(51),{table:n,column:o,sqlTableContext:r}=t,[s,i]=q.useState(!1),a=je(GC),l=Ct(bL);let c,d;e[0]!==a?(c=()=>{a&&i(!1)},d=[a],e[0]=a,e[1]=c,e[2]=d):(c=e[1],d=e[2]),q.useEffect(c,d),l(s?$=>new Set([...$,`${n.name}:${o.name}`]):$=>($.delete(`${n.name}:${o.name}`),new Set($)));const h=ZC(),{columnsPreviews:f}=yL();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 g=m;let x;e[6]!==o.name||e[7]!==n.indexes?(x=((U=n.indexes)==null?void 0:U.includes(o.name))||!1,e[6]=o.name,e[7]=n.indexes,e[8]=x):x=e[8];const p=x;let b;e[9]!==h?(b=$=>{h($)},e[9]=h,e[10]=b):b=e[10];const y=b,v=Y7,w=s?"font-semibold":"";let j;e[11]!==o.name||e[12]!==w?(j=u.jsx("span",{className:w,children:o.name}),e[11]=o.name,e[12]=w,e[13]=j):j=e[13];const C=j,N=`${n.name}.${o.name}`,S=`${n.name}.${o.name}`;let E;e[14]!==s?(E=()=>i(!s),e[14]=s,e[15]=E):E=e[15];const T=r?"pl-14":"pl-7";let I,M,F,D,R,P,z,_,k,B;return e[16]!==T?(I=xe("flex flex-row gap-2 items-center flex-1",T),e[16]=T,e[17]=I):I=e[17],e[18]!==o.type||e[19]!==C?(M=u.jsx(vL,{columnName:C,dataType:o.type}),e[18]=o.type,e[19]=C,e[20]=M):M=e[20],e[21]!==g?(F=g&&v({tooltipContent:"Primary key",content:"PK"}),e[21]=g,e[22]=F):F=e[22],e[23]!==p?(D=p&&v({tooltipContent:"Indexed",content:"IDX"}),e[23]=p,e[24]=D):D=e[24],e[25]!==I||e[26]!==M||e[27]!==F||e[28]!==D?(R=u.jsxs("div",{className:I,children:[M,F,D]}),e[25]=I,e[26]=M,e[27]=F,e[28]=D,e[29]=R):R=e[29],e[30]!==o.name?(P=u.jsx(Ne,{content:"Copy column name",delayDuration:400,children:u.jsx(ve,{variant:"text",size:"icon",className:"group-hover:opacity-100 opacity-0 hover:bg-muted text-muted-foreground hover:text-foreground",children:u.jsx($C,{tooltip:!1,value:o.name,className:"h-3 w-3"})})}),e[30]=o.name,e[31]=P):P=e[31],e[32]!==o.external_type?(z=u.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]!==R||e[36]!==P||e[37]!==z||e[38]!==N||e[39]!==S?(_=u.jsxs(Zn,{className:"rounded-none py-1 group cursor-pointer",value:S,onSelect:E,children:[R,P,z]},N),e[34]=E,e[35]=R,e[36]=P,e[37]=z,e[38]=N,e[39]=S,e[40]=_):_=e[40],e[41]!==o||e[42]!==f||e[43]!==y||e[44]!==s||e[45]!==r||e[46]!==n?(k=s&&u.jsx("div",{className:"pl-10 pr-2 py-2 bg-(--slate-1) shadow-inner border-b",children:u.jsx(Cc,{children:u.jsx(wL,{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]!==_||e[49]!==k?(B=u.jsxs(u.Fragment,{children:[_,k]}),e[48]=_,e[49]=k,e[50]=B):B=e[50],B};function Y7(t){const{tooltipContent:e,content:n}=t;return u.jsx(Ne,{content:e,delayDuration:100,children:u.jsx("span",{className:"text-xs text-black bg-gray-100 dark:invert rounded px-1",children:n})})}const K7=()=>{const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=u.jsx(U7,{}),t[0]=e):e=t[0],e},X7=()=>{const t=H.c(5),{documentation:e}=je(CL);if(!e){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=u.jsx(dn,{title:"View docs as you type",description:"Move your text cursor over a symbol to see its documentation.",icon:u.jsx(dd,{})}),t[0]=r):r=t[0],r}let n,o;return t[1]!==e?(n=Qm({html:e}),t[1]=e,t[2]=n):n=t[2],t[3]!==n?(o=u.jsx("div",{className:"p-3 overflow-y-auto overflow-x-hidden h-full docs-documentation flex flex-col gap-4",children:n}),t[3]=n,t[4]=o):o=t[4],o},J7=()=>{const t=H.c(5),e=jL();if(e.length===0){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=u.jsx(dn,{title:"No errors!",icon:u.jsx(Up,{})}),t[0]=r):r=t[0],r}let n,o;return t[1]!==e?(n=e.map(Z7),t[1]=e,t[2]=n):n=t[2],t[3]!==n?(o=u.jsx("div",{className:"flex flex-col overflow-auto",children:n}),t[3]=n,t[4]=o):o=t[4],o};function Z7(t){return u.jsxs("div",{children:[u.jsx("div",{className:"text-xs font-mono font-semibold bg-muted border-y px-2 py-1",children:u.jsx(SL,{cellId:t.cellId})}),u.jsx("div",{className:"px-2",children:u.jsx(NL,{errors:t.output.data,cellId:t.cellId},t.cellId)},t.cellId)]},t.cellId)}const nm=new Map,Q7=({file:t,onOpenNotebook:e})=>{const{theme:n}=Zo(),{sendFileDetails:o,sendUpdateFile:r}=tt(),s=je(ac),[i,a]=O.useState(""),{data:l,isPending:c,error:d,setData:h}=Tn(async()=>{const b=await o({path:t.path}),y=b.contents||"";return a(nm.get(t.path)||y),b},[t.path]),f=async()=>{i!==(l==null?void 0:l.contents)&&await r({path:t.path,contents:i}).then(b=>{b.success&&(h(y=>({...y,contents:i})),a(i))})},m=O.useRef(i);if(m.current=i,O.useEffect(()=>()=>{if(!(l!=null&&l.contents))return;const b=m.current;b===l.contents?nm.delete(t.path):nm.set(t.path,b)},[t.path,l==null?void 0:l.contents]),d)return u.jsx(kr,{error:d});if(c||!l)return null;const g=l.mimeType||"text/plain",x=g in om;if(!l.contents&&!x)return u.jsxs("div",{className:"grid grid-cols-2 gap-2 p-6",children:[u.jsx("div",{className:"font-bold text-muted-foreground",children:"Name"}),u.jsx("div",{children:l.file.name}),u.jsx("div",{className:"font-bold text-muted-foreground",children:"Type"}),u.jsx("div",{children:g})]});const p=u.jsxs("div",{className:"text-xs text-muted-foreground p-1 flex justify-end gap-2 border-b",children:[t.isMarimoFile&&!tn()&&u.jsx(Ne,{content:"Open notebook",children:u.jsx(cn,{size:"small",onClick:b=>e(b),children:u.jsx(vc,{})})}),u.jsx(Ne,{content:"Download",children:u.jsx(cn,{size:"small",onClick:()=>{if(Bk(g)){const b=ML(l.contents,g);return void OL(b,l.file.name)}Ui(new Blob([l.contents||i],{type:g}),l.file.name)},children:u.jsx(Sm,{})})}),!Bk(g)&&u.jsxs(u.Fragment,{children:[u.jsx(Ne,{content:"Copy contents to clipboard",children:u.jsx(cn,{size:"small",onClick:async()=>{await sn(i)},children:u.jsx(Mi,{})})}),u.jsx(Ne,{content:Gt("global.save"),children:u.jsx(cn,{size:"small",color:i===l.contents?void 0:"green",onClick:f,disabled:i===l.contents,children:u.jsx(ma,{})})})]})]});return g.startsWith("image/")?u.jsxs(u.Fragment,{children:[p,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(EL,{base64:l.contents,mime:g})})]}):g==="text/csv"&&l.contents?u.jsxs(u.Fragment,{children:[p,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(_L,{contents:l.contents})})]}):g.startsWith("audio/")?u.jsxs(u.Fragment,{children:[p,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(IL,{base64:l.contents,mime:g})})]}):g.startsWith("video/")?u.jsxs(u.Fragment,{children:[p,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(AL,{base64:l.contents,mime:g})})]}):g.startsWith("application/pdf")?u.jsxs(u.Fragment,{children:[p,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(TL,{base64:l.contents,mime:g})})]}):u.jsxs(u.Fragment,{children:[p,u.jsx("div",{className:"flex-1 overflow-auto",children:u.jsx(O.Suspense,{children:u.jsx(sa,{theme:n==="dark"?"dark":"light",language:om[g]||om.default,className:"border-b",extensions:[We.lineWrapping,Mn.of([{key:s.getHotkey("global.save").key,stopPropagation:!0,run:()=>i!==l.contents&&(f(),!0)}])],value:i,onChange:a})})})]})},Bk=t=>t.startsWith("image/")||t.startsWith("audio/")||t.startsWith("video/")||t.startsWith("application/pdf"),om={"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 e9{constructor(e){this.callbacks=e,this.delegate=new ip([]),this.rootPath="",this.onChange=Bn.NOOP,this.path=new xc("/"),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 ip(o.files),this.rootPath=o.root,this.path=xc.guessDeliminator(o.root)}catch(o){Je({title:"Failed",description:gC(o)})}this.onChange(this.delegate.data)},this.refreshAll=async n=>{const o=[this.rootPath,...n.map(s=>{var i;return(i=this.delegate.find(s))==null?void 0:i.data.path})].filter(Boolean),r=await Promise.all(o.map(s=>this.callbacks.listFiles({path:s}).catch(()=>({files:[]}))));for(const[s,i]of o.entries()){const a=r[s];i===this.rootPath?this.delegate=new ip(a.files):this.delegate.update({id:i,changes:{children:a.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 i=this.delegate.find(s);if(!i)return Promise.resolve();const a=this.path.join(o,this.path.basename(i.data.path));return this.delegate.update({id:s,changes:{path:a}}),this.callbacks.renameFileOrFolder({path:i.data.path,newPath:a}).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 Uk=jt(t=>{const e=t(DL);return Un(e,"no requestClientAtom set"),new e9({listFiles:e.sendListFiles,createFileOrFolder:e.sendCreateFileOrFolder,deleteFileOrFolder:e.sendDeleteFileOrFolder,renameFileOrFolder:e.sendRenameFileOrFolder})}),t9=jt({});function n9(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 $k(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}=tt();let s,i;return e[2]!==r?(s=async a=>{for(const l of a){const c=l9(a9(l));let d="";c&&(d=xc.guessDeliminator(c).dirname(c));const h=(await n9(l)).split(",")[1];await r({path:d,type:"file",name:l.name,contents:h})}await async function(){await Qe.get(Uk).refreshAll([])}()},e[2]=r,e[3]=s):s=e[3],e[4]!==o||e[5]!==s?(i={multiple:!0,maxSize:104857600,onError:i9,onDropRejected:o9,onDrop:s,...o},e[4]=o,e[5]=s,e[6]=i):i=e[6],RL(i)}function o9(t){Je({title:"File upload failed",description:u.jsx("div",{className:"flex flex-col gap-1",children:t.map(r9)}),variant:"danger"})}function r9(t){return u.jsxs("div",{children:[t.file.name," (",t.errors.map(s9).join(", "),")"]},t.file.name)}function s9(t){return t.message}function i9(t){ut.error(t),Je({title:"File upload failed",description:t.message,variant:"danger"})}function a9(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 l9(t){if(t)return t.replace(/^\/+/,"")}const Vk=q.createContext(null),c9=t=>{const e=H.c(60),{height:n}=t,o=O.useRef(null),[r]=Dt(Uk);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[0]=s):s=e[0];const[i,a]=O.useState(s),[l,c]=O.useState(null),{openPrompt:d}=An(),[h,f]=Dt(t9);let m,g;e[1]!==r?(m=()=>r.initialize(a),e[1]=r,e[2]=m):m=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[3]=g):g=e[3];const{isPending:x,error:p}=Tn(m,g);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]!==d||e[8]!==r?(v=async()=>{d({title:"Folder name",onConfirm:async k=>{r.createFolder(k,null)}})},e[7]=d,e[8]=r,e[9]=v):v=e[9];const w=Le(v);let j;e[10]!==d||e[11]!==r?(j=async()=>{d({title:"File name",onConfirm:async k=>{r.createFile(k,null)}})},e[10]=d,e[11]=r,e[12]=j):j=e[12];const C=Le(j);let N;e[13]!==f?(N=()=>{var k;(k=o.current)==null||k.closeAll(),f({})},e[13]=f,e[14]=N):N=e[14];const S=Le(N);if(x){let k;return e[15]===Symbol.for("react.memo_cache_sentinel")?(k=u.jsx(kn,{size:"medium",centered:!0}),e[15]=k):k=e[15],k}if(p){let k;return e[16]!==p?(k=u.jsx(kr,{error:p}),e[16]=p,e[17]=k):k=e[17],k}if(l){let k,B,A,U,$,J;return e[18]===Symbol.for("react.memo_cache_sentinel")?(k=()=>c(null),e[18]=k):k=e[18],e[19]===Symbol.for("react.memo_cache_sentinel")?(B=u.jsx(ve,{onClick:k,"data-testid":"file-explorer-back-button",variant:"text",size:"xs",className:"mb-0",children:u.jsx(wt,{size:16})}),e[19]=B):B=e[19],e[20]!==l.name?(A=u.jsxs("div",{className:"flex items-center pl-1 pr-3 shrink-0 border-b justify-between",children:[B,u.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=G=>Hk(G,r.relativeFromRoot(l.path)),e[22]=l.path,e[23]=r,e[24]=U):U=e[24],e[25]!==l||e[26]!==U?($=u.jsx(O.Suspense,{children:u.jsx(Q7,{onOpenNotebook:U,file:l})}),e[25]=l,e[26]=U,e[27]=$):$=e[27],e[28]!==A||e[29]!==$?(J=u.jsxs(u.Fragment,{children:[A,$]}),e[28]=A,e[29]=$,e[30]=J):J=e[30],J}let E;e[31]!==S||e[32]!==C||e[33]!==w||e[34]!==y||e[35]!==r?(E=u.jsx(u9,{onRefresh:y,onCreateFile:C,onCreateFolder:w,onCollapseAll:S,tree:r}),e[31]=S,e[32]=C,e[33]=w,e[34]=y,e[35]=r,e[36]=E):E=e[36];const T=n-33;let I,M,F,D,R,P,z,_;return e[37]!==r?(I=async k=>{const{ids:B}=k;for(const A of B)await r.delete(A)},M=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]=M,e[40]=F):(I=e[38],M=e[39],F=e[40]),e[41]===Symbol.for("react.memo_cache_sentinel")?(D=k=>{const B=k[0];B&&(B.data.isDirectory||c(B.data))},e[41]=D):D=e[41],e[42]!==h||e[43]!==f||e[44]!==r?(R=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]=R):R=e[45],e[46]!==i||e[47]!==h||e[48]!==I||e[49]!==M||e[50]!==F||e[51]!==R||e[52]!==T?(P=u.jsx(kF,{width:"100%",ref:o,height:T,className:"h-full",data:i,initialOpenState:h,openByDefault:!1,renderCursor:g9,disableDrop:x9,onDelete:I,onRename:M,onMove:F,onSelect:D,onToggle:R,padding:15,rowHeight:30,indent:d9,overscanCount:1e3,disableMultiSelection:!0,children:m9}),e[46]=i,e[47]=h,e[48]=I,e[49]=M,e[50]=F,e[51]=R,e[52]=T,e[53]=P):P=e[53],e[54]!==P||e[55]!==r?(z=u.jsx(Vk,{value:r,children:P}),e[54]=P,e[55]=r,e[56]=z):z=e[56],e[57]!==z||e[58]!==E?(_=u.jsxs(u.Fragment,{children:[E,z]}),e[57]=z,e[58]=E,e[59]=_):_=e[59],_},d9=15,u9=t=>{const e=H.c(30),{onRefresh:n,onCreateFile:o,onCreateFolder:r,onCollapseAll:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={noDrag:!0,noDragEventsBubbling:!0},e[0]=i):i=e[0];const{getRootProps:a,getInputProps:l}=$k(i);let c,d,h,f,m,g,x,p,b,y,v,w,j,C,N;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=u.jsx(ha,{size:16}),e[1]=c):c=e[1],e[2]!==o?(d=u.jsx(Ne,{content:"Add file",children:u.jsx(ve,{"data-testid":"file-explorer-add-file-button",onClick:o,variant:"text",size:"xs",children:c})}),e[2]=o,e[3]=d):d=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(h=u.jsx(nd,{size:16}),e[4]=h):h=e[4],e[5]!==r?(f=u.jsx(Ne,{content:"Add folder",children:u.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]!==a?(m=a({}),e[7]=a,e[8]=m):m=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(g=PL({variant:"text",size:"xs"}),x=u.jsx(FL,{size:16}),e[9]=g,e[10]=x):(g=e[9],x=e[10]),e[11]!==m?(p=u.jsx(Ne,{content:"Upload file",children:u.jsx("button",{"data-testid":"file-explorer-upload-button",...m,className:g,children:x})}),e[11]=m,e[12]=p):p=e[12],e[13]!==l?(b=l({}),e[13]=l,e[14]=b):b=e[14],e[15]!==b?(y=u.jsx("input",{...b,type:"file"}),e[15]=b,e[16]=y):y=e[16],e[17]===Symbol.for("react.memo_cache_sentinel")?(v=u.jsx(NC,{size:16}),e[17]=v):v=e[17],e[18]!==n?(w=u.jsx(Ne,{content:"Refresh",children:u.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")?(j=u.jsx(yp,{size:16}),e[20]=j):j=e[20],e[21]!==s?(C=u.jsx(Ne,{content:"Collapse all folders",children:u.jsx(ve,{"data-testid":"file-explorer-collapse-button",onClick:s,variant:"text",size:"xs",children:j})}),e[21]=s,e[22]=C):C=e[22],e[23]!==y||e[24]!==w||e[25]!==C||e[26]!==d||e[27]!==f||e[28]!==p?(N=u.jsxs("div",{className:"flex items-center justify-end px-2 shrink-0 border-b",children:[d,f,p,y,w,C]}),e[23]=y,e[24]=w,e[25]=C,e[26]=d,e[27]=f,e[28]=p,e[29]=N):N=e[29],N},h9=t=>{const e=H.c(9),{node:n,onOpenMarimoFile:o}=t;let r,s,i;return e[0]!==n?(r=a=>{n.data.isDirectory||(a.stopPropagation(),n.select())},e[0]=n,e[1]=r):r=e[1],e[2]!==n.data.isMarimoFile||e[3]!==o?(s=n.data.isMarimoFile&&!tn()&&u.jsxs("span",{className:"shrink-0 ml-2 text-sm hidden group-hover:inline hover:underline",onClick:o,children:["open ",u.jsx(vc,{className:"inline ml-1",size:12})]}),e[2]=n.data.isMarimoFile,e[3]=o,e[4]=s):s=e[4],e[5]!==n.data.name||e[6]!==r||e[7]!==s?(i=u.jsxs("span",{className:"flex-1 overflow-hidden text-ellipsis",onClick:r,children:[n.data.name,s]}),e[5]=n.data.name,e[6]=r,e[7]=s,e[8]=i):i=e[8],i},f9=t=>{const e=H.c(10),{node:n}=t,o=O.useRef(null);let r,s,i,a,l;return e[0]!==n.data.name?(r=()=>{var c,d;(c=o.current)==null||c.focus(),(d=o.current)==null||d.setSelectionRange(0,n.data.name.lastIndexOf("."))},s=[n.data.name],e[0]=n.data.name,e[1]=r,e[2]=s):(r=e[1],s=e[2]),O.useEffect(r,s),e[3]!==n?(i=()=>n.reset(),a=c=>{c.key==="Escape"&&n.reset(),c.key==="Enter"&&n.submit(c.currentTarget.value)},e[3]=n,e[4]=i,e[5]=a):(i=e[4],a=e[5]),e[6]!==n.data.name||e[7]!==i||e[8]!==a?(l=u.jsx("input",{ref:o,className:"flex-1 bg-transparent border border-border text-muted-foreground",defaultValue:n.data.name,onClick:b9,onBlur:i,onKeyDown:a}),e[6]=n.data.name,e[7]=i,e[8]=a,e[9]=l):l=e[9],l},m9=({node:t,style:e,dragHandle:n})=>{const{openFile:o,sendCreateFileOrFolder:r,sendFileDetails:s}=tt(),i=t.data.isDirectory?"directory":$3(t.data.name),a=V3[i],{openConfirm:l,openPrompt:c}=An(),{createNewCell:d}=lt(),h=hs(),f=O.use(Vk),m=async y=>{Hk(y,f?f.relativeFromRoot(t.data.path):t.data.path)},g=async y=>{y.stopPropagation(),y.preventDefault(),l({title:"Delete file",description:`Are you sure you want to delete ${t.data.name}?`,confirmAction:u.jsx(L3,{onClick:async()=>{await t.tree.delete(t.id)},"aria-label":"Confirm",children:"Delete"})})},x=Le(async()=>{t.open(),c({title:"Folder name",onConfirm:async y=>{f==null||f.createFolder(y,t.id)}})}),p=Le(async()=>{t.open(),c({title:"File name",onConfirm:async y=>{f==null||f.createFile(y,t.id)}})}),b=Le(async()=>{var j;if(!f||t.data.isDirectory)return;const[y,v]=LL(t.data.name),w=`${y}_copy${v}`;try{const C=await s({path:t.data.path}),N=((j=t.parent)==null?void 0:j.data.path)||"";await r({path:N,type:"file",name:w,contents:C.contents?btoa(C.contents):void 0}),await f.refreshAll([N])}catch{Je({title:"Failed to duplicate file",description:"Unable to create a duplicate of the file",variant:"danger"})}});return u.jsxs("div",{style:e,ref:n,className: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:[u.jsx(p9,{node:t}),u.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?u.jsx("img",{src:UF,className:"w-5 h-5 shrink-0 mr-2 filter grayscale",alt:"Marimo"}):u.jsx(a,{className:"w-5 h-5 shrink-0 mr-2",strokeWidth:1.5}),t.isEditing?u.jsx(f9,{node:t}):u.jsx(h9,{node:t,onOpenMarimoFile:m}),u.jsxs(Eo,{modal:!1,children:[u.jsx(_o,{asChild:!0,tabIndex:-1,onClick:y=>y.stopPropagation(),children:u.jsx(ve,{"data-testid":"file-explorer-more-button",variant:"text",tabIndex:-1,size:"xs",className:"mb-0","aria-label":"More options",children:u.jsx(td,{strokeWidth:2,className:"w-5 h-5 hidden group-hover:block"})})}),(()=>{const y={size:14,strokeWidth:1.5,className:"mr-2"};return u.jsxs(Io,{align:"end",className:"no-print w-[220px]",onClick:v=>v.stopPropagation(),onCloseAutoFocus:v=>v.preventDefault(),children:[!t.data.isDirectory&&u.jsxs(At,{onSelect:()=>t.select(),children:[u.jsx(ng,{...y}),"Open file"]}),!t.data.isDirectory&&!tn()&&u.jsxs(At,{onSelect:()=>{o({path:t.data.path})},children:[u.jsx(vc,{...y}),"Open file in external editor"]}),t.data.isDirectory&&u.jsxs(u.Fragment,{children:[u.jsxs(At,{onSelect:()=>p(),children:[u.jsx(ha,{...y}),"Create file"]}),u.jsxs(At,{onSelect:()=>x(),children:[u.jsx(nd,{...y}),"Create folder"]}),u.jsx(an,{})]}),u.jsxs(At,{onSelect:()=>t.edit(),children:[u.jsx($p,{...y}),"Rename"]}),!t.data.isDirectory&&u.jsxs(At,{onSelect:b,children:[u.jsx(Mi,{...y}),"Duplicate"]}),u.jsxs(At,{onSelect:async()=>{await sn(t.data.path),Je({title:"Copied to clipboard"})},children:[u.jsx(sd,{...y}),"Copy path"]}),f&&u.jsxs(At,{onSelect:async()=>{await sn(f.relativeFromRoot(t.data.path)),Je({title:"Copied to clipboard"})},children:[u.jsx(sd,{...y}),"Copy relative path"]}),u.jsx(an,{}),u.jsxs(At,{onSelect:()=>{const{path:v}=t.data;(w=>{d({code:w,before:!1,cellId:h??"__end__"})})(nj[i](v))},children:[u.jsx(Nr,{...y}),"Insert snippet for reading file"]}),u.jsxs(At,{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=nj[i](v);await sn(w)},children:[u.jsx(zL,{...y}),"Copy snippet for reading file"]}),t.data.isMarimoFile&&!tn()&&u.jsxs(u.Fragment,{children:[u.jsx(an,{}),u.jsxs(At,{onSelect:m,children:[u.jsx(Jp,{...y}),"Open notebook"]})]}),u.jsx(an,{}),!t.data.isDirectory&&u.jsxs(u.Fragment,{children:[u.jsxs(At,{onSelect:async()=>{const v=(await s({path:t.data.path})).contents||"";Ui(new Blob([v]),t.data.name)},children:[u.jsx(Sm,{...y}),"Download"]}),u.jsx(an,{})]}),u.jsxs(At,{onSelect:g,variant:"danger",children:[u.jsx(ic,{...y}),"Delete"]})]})})()]})]})]})},p9=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=u.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?u.jsx(No,{className:"w-5 h-5 shrink-0"}):u.jsx(Li,{className:"w-5 h-5 shrink-0"}),e[1]=n.isOpen,e[2]=o):o=e[2],o};function Hk(t,e){t.stopPropagation(),t.preventDefault(),uj(e)}function g9(){return null}function x9(t){const{parentNode:e}=t;return!e.data.isDirectory}function b9(t){return t.stopPropagation()}let Wk,qk,Gk;Wk=()=>{const t=H.c(20),{ref:e,height:n}=BL(),o=n===void 0?1:n;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={noClick:!0,noKeyboard:!0},t[0]=r):r=t[0];const{getRootProps:s,getInputProps:i,isDragActive:a}=$k(r);let l,c,d,h,f,m,g,x;return t[1]!==s?(l=s(),t[1]=s,t[2]=l):l=t[2],t[3]===Symbol.for("react.memo_cache_sentinel")?(c=xe("flex flex-col flex-1 overflow-hidden relative"),t[3]=c):c=t[3],t[4]!==i?(d=i(),t[4]=i,t[5]=d):d=t[5],t[6]!==d?(h=u.jsx("input",{...d}),t[6]=d,t[7]=h):h=t[7],t[8]!==a?(f=a&&u.jsx("div",{className:"absolute inset-0 flex items-center uppercase justify-center text-xl font-bold text-primary/90 bg-accent/85 z-10 border-2 border-dashed border-primary/90 rounded-lg pointer-events-none",children:"Drop files here"}),t[8]=a,t[9]=f):f=t[9],t[10]!==o?(m=u.jsx(c9,{height:o}),t[10]=o,t[11]=m):m=t[11],t[12]!==e||t[13]!==m?(g=u.jsx("div",{ref:e,className:"flex flex-col flex-1 overflow-hidden",children:m}),t[12]=e,t[13]=m,t[14]=g):g=t[14],t[15]!==l||t[16]!==h||t[17]!==f||t[18]!==g?(x=u.jsxs("div",{...l,className:c,children:[h,f,g]}),t[15]=l,t[16]=h,t[17]=f,t[18]=g,t[19]=x):x=t[19],x},fp=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=u.jsx("button",{type:"button","data-testid":n,className:o,onClick:t.onClick,children:"Clear"}),e[2]=t.dataTestId,e[3]=t.onClick,e[4]=o,e[5]=r):r=e[5],r},qk=()=>{const t=H.c(9),e=UL(),{clearLogs:n}=lt();if(e.length===0){let i,a;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=u.jsx("code",{className:"border rounded px-1",children:"stdout"}),t[0]=i):i=t[0],t[1]===Symbol.for("react.memo_cache_sentinel")?(a=u.jsx(dn,{title:"No logs",description:u.jsxs("span",{children:[i," and"," ",u.jsx("code",{className:"border rounded px-1",children:"stderr"})," logs will appear here."]}),icon:u.jsx(dm,{})}),t[1]=a):a=t[1],a}let o,r,s;return t[2]!==n?(o=u.jsx("div",{className:"flex flex-row justify-end px-2 py-1",children:u.jsx(fp,{dataTestId:"clear-logs-button",onClick:n})}),t[2]=n,t[3]=o):o=t[3],t[4]!==e?(r=u.jsx("div",{className:"overflow-auto flex-1",children:u.jsx(Gk,{logs:e,className:"min-w-[300px]"})}),t[4]=e,t[5]=r):r=t[5],t[6]!==o||t[7]!==r?(s=u.jsxs(u.Fragment,{children:[o,r]}),t[6]=o,t[7]=r,t[8]=s):s=t[8],s},Gk=t=>{const e=H.c(10),{logs:n,className:o}=t;let r,s,i,a,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?(i=n.map(w9),e[3]=n,e[4]=i):i=e[4],e[5]!==i?(a=u.jsx("pre",{className:"grid text-xs font-mono gap-1 whitespace-break-spaces font-semibold align-left",children:u.jsx("div",{className:"grid grid-cols-[30px_1fr]",style:s,children:i})}),e[5]=i,e[6]=a):a=e[6],e[7]!==r||e[8]!==a?(l=u.jsx("div",{className:r,children:a}),e[7]=r,e[8]=a,e[9]=l):l=e[9],l};function y9(t){const e=$L(t.timestamp),n=v9[t.level],o=t.level.toUpperCase();return u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"shrink-0 text-(--gray-10) dark:text-(--gray-11)",children:["[",e,"]"]}),u.jsx("span",{className:xe("shrink-0",n),children:o}),u.jsxs("span",{className:"shrink-0 text-(--gray-10)",children:["(",u.jsx(Mo,{cellId:t.cellId}),")"]}),t.message]})}const v9={stdout:"text-(--grass-9)",stderr:"text-(--red-9)"};function w9(t,e){return u.jsxs("div",{className:"contents group",children:[u.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}),u.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:y9(t)})]},e)}const k9=()=>{const t=H.c(7),{items:e}=je(VL);let n,o;t[0]!==e?(o=$F(e),t[0]=e,t[1]=o):o=t[1],n=o;const r=n,{activeHeaderId:s,activeOccurrences:i}=VF(r);if(e.length===0){let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=u.jsx(dn,{title:"No outline-solid",description:"Add markdown headings to your notebook to create an outline.",icon:u.jsx(cd,{})}),t[2]=l):l=t[2],l}let a;return t[3]!==s||t[4]!==i||t[5]!==e?(a=u.jsx(HF,{items:e,activeHeaderId:s,activeOccurrences:i}),t[3]=s,t[4]=i,t[5]=e,t[6]=a):a=t[6],a},Yk=jt(null),Kk=t=>{const e=H.c(9),{onClick:n,loading:o,children:r,className:s}=t;if(o){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=u.jsx(kn,{size:"small",className:"h-4 w-4 shrink-0 opacity-50"}),e[0]=c):c=e[0],c}let i,a,l;return e[1]!==s?(i=xe("px-2 h-full text-xs text-muted-foreground hover:text-foreground","invisible group-hover:visible",s),e[1]=s,e[2]=i):i=e[2],e[3]!==n?(a=zn.stopPropagation(n),e[3]=n,e[4]=a):a=e[4],e[5]!==r||e[6]!==i||e[7]!==a?(l=u.jsx("button",{type:"button",className:i,onClick:a,children:r}),e[5]=r,e[6]=i,e[7]=a,e[8]=l):l=e[8],l},C9=()=>{var N,S;const t=H.c(30),[e]=br(),n=e.package_management.manager,{getDependencyTree:o,getPackageList:r}=tt(),[s,i]=q.useState(null);let a,l;t[0]!==o||t[1]!==r?(a=async()=>{const[E,T]=await Promise.all([r(),o()]);return{list:E.packages,tree:T.tree}},t[0]=o,t[1]=r,t[2]=a):a=t[2],t[3]!==n?(l=[n],t[3]=n,t[4]=l):l=t[4];const{data:c,error:d,refetch:h,isPending:f}=Tn(a,l);if(f){let E;return t[5]===Symbol.for("react.memo_cache_sentinel")?(E=u.jsx(kn,{size:"medium",centered:!0}),t[5]=E):E=t[5],E}if(d){let E;return t[6]!==d?(E=u.jsx(kr,{error:d}),t[6]=d,t[7]=E):E=t[7],E}const m=c.tree!=null;let g;t[8]!==m||t[9]!==s?(g=function(E,T){return E==="list"?"list":T?E||"tree":"list"}(s,m),t[8]=m,t[9]=s,t[10]=g):g=t[10];const x=g,p=(N=c.tree)==null?void 0:N.name,b=(S=c==null?void 0:c.tree)==null?void 0:S.version,y=p==="<root>";let v,w,j,C;return t[11]!==n||t[12]!==h?(v=u.jsx(j9,{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]!==x?(w=m&&u.jsxs("div",{className:"flex items-center justify-between px-2 py-1 border-b",children:[u.jsxs("div",{className:"flex gap-1",children:[u.jsx("button",{type:"button",className:xe("px-2 py-1 text-xs rounded",x==="list"?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground"),onClick:()=>i("list"),children:"List"}),u.jsx("button",{type:"button",className:xe("px-2 py-1 text-xs rounded",x==="tree"?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground"),onClick:()=>i("tree"),children:"Tree"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:"items-center border px-2 py-0.5 text-xs transition-colors focus:outline-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&&u.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]=x,t[19]=w):w=t[19],t[20]!==c.list||t[21]!==c.tree||t[22]!==d||t[23]!==h||t[24]!==x?(j=x==="list"?u.jsx(S9,{packages:c.list,onSuccess:h}):u.jsx(N9,{tree:c.tree,error:d,onSuccess:h}),t[20]=c.list,t[21]=c.tree,t[22]=d,t[23]=h,t[24]=x,t[25]=j):j=t[25],t[26]!==v||t[27]!==w||t[28]!==j?(C=u.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[v,w,j]}),t[26]=v,t[27]=w,t[28]=j,t[29]=C):C=t[29],C},j9=t=>{const e=H.c(40),{onSuccess:n,packageManager:o}=t,[r,s]=q.useState(""),{handleClick:i}=aa(),a=je(Yk),l=Ct(Yk);let c,d;e[0]!==a||e[1]!==l?(c=()=>{a&&(s(a),l(null))},d=[a,l],e[0]=a,e[1]=l,e[2]=c,e[3]=d):(c=e[2],d=e[3]),q.useEffect(c,d);const{loading:h,handleInstallPackages:f}=HL();let m;e[4]!==n?(m=()=>{n(),s("")},e[4]=n,e[5]=m):m=e[5];const g=m;let x;e[6]!==f||e[7]!==r||e[8]!==g?(x=()=>{f(r.split(",").map(E9),g)},e[6]=f,e[7]=r,e[8]=g,e[9]=x):x=e[9];const p=x,b=`Install packages with ${o}...`;let y,v,w,j,C,N,S,E,T,I,M,F,D,R;e[10]!==h||e[11]!==i?(y=h?u.jsx(kn,{size:"small",className:"mr-2 h-4 w-4 shrink-0 opacity-50"}):u.jsx(Ne,{content:"Change package manager",children:u.jsx(Ss,{onClick:()=>i("packageManagement"),className:"mr-2 h-4 w-4 shrink-0 opacity-50 hover:opacity-80 cursor-pointer"})}),e[10]=h,e[11]=i,e[12]=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?(j=u.jsx(oj,{placeholder:b,id:F1,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]=j):j=e[20],e[21]===Symbol.for("react.memo_cache_sentinel")?(C=u.jsx("span",{className:"font-bold tracking-wide",children:"Package name:"}),e[21]=C):C=e[21],e[22]===Symbol.for("react.memo_cache_sentinel")?(N=u.jsxs("div",{children:[C," A package name; this will install the latest version.",u.jsx("div",{className:"text-muted-foreground",children:"Example: httpx"})]}),S=u.jsx("span",{className:"font-bold tracking-wide",children:"Package and version:"}),e[22]=N,e[23]=S):(N=e[22],S=e[23]),e[24]===Symbol.for("react.memo_cache_sentinel")?(E=u.jsxs("div",{children:[S," ","A package with a specific version or version range.",u.jsx("div",{className:"text-muted-foreground",children:"Examples: httpx==0.27.0, httpx>=0.27.0"})]}),T=u.jsx("span",{className:"font-bold tracking-wide",children:"Git:"}),e[24]=E,e[25]=T):(E=e[24],T=e[25]),e[26]===Symbol.for("react.memo_cache_sentinel")?(I=u.jsxs("div",{children:[T," A Git repository",u.jsx("div",{className:"text-muted-foreground",children:"Example: git+https://github.com/encode/httpx"})]}),M=u.jsx("span",{className:"font-bold tracking-wide",children:"URL:"}),e[26]=I,e[27]=M):(I=e[26],M=e[27]),e[28]===Symbol.for("react.memo_cache_sentinel")?(F=u.jsxs("div",{children:[M," A remote wheel or source distribution.",u.jsx("div",{className:"text-muted-foreground",children:"Example: https://example.com/httpx-0.27.0.tar.gz"})]}),D=u.jsx("span",{className:"font-bold tracking-wide",children:"Path:"}),e[28]=F,e[29]=D):(F=e[28],D=e[29]),e[30]===Symbol.for("react.memo_cache_sentinel")?(R=u.jsx(Ne,{delayDuration:300,side:"left",align:"start",content:u.jsxs("div",{className:"text-sm flex flex-col w-full max-w-[360px]",children:["Packages are installed using the package manager specified in your user configuration. Depending on your package manager, you can install packages with various formats:",u.jsxs("div",{className:"flex flex-col gap-2 mt-2",children:[N,E,I,F,u.jsxs("div",{children:[D," A local wheel, source distribution, or project directory.",u.jsx("div",{className:"text-muted-foreground",children:"Example: /example/foo-0.1.0-py3-none-any.whl"})]})]})]}),children:u.jsx(Km,{className:"h-4 w-4 cursor-help text-muted-foreground hover:text-foreground bg-transparent"})}),e[30]=R):R=e[30];const P=r&&"bg-accent text-accent-foreground";let z;e[31]!==P?(z=xe("float-right px-2 m-0 h-full text-sm text-secondary-foreground ml-2",P,"disabled:cursor-not-allowed disabled:opacity-50"),e[31]=P,e[32]=z):z=e[32];const _=!r;let k,B;return e[33]!==p||e[34]!==z||e[35]!==_?(k=u.jsx("button",{type:"button",className:z,onClick:p,disabled:_,children:"Add"}),e[33]=p,e[34]=z,e[35]=_,e[36]=k):k=e[36],e[37]!==k||e[38]!==j?(B=u.jsxs("div",{className:"flex items-center w-full border-b",children:[j,R,k]}),e[37]=k,e[38]=j,e[39]=B):B=e[39],B},S9=t=>{const e=H.c(9),{onSuccess:n,packages:o}=t;if(o.length===0){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=u.jsx(dn,{title:"No packages",description:"No packages are installed in this environment.",icon:u.jsx(Ss,{})}),e[0]=a):a=e[0],a}let r,s,i;if(e[1]===Symbol.for("react.memo_cache_sentinel")?(r=u.jsx(np,{children:u.jsxs(js,{children:[u.jsx(Cr,{children:"Name"}),u.jsx(Cr,{children:"Version"}),u.jsx(Cr,{})]})}),e[1]=r):r=e[1],e[2]!==n||e[3]!==o){let a;e[5]!==n?(a=l=>u.jsxs(js,{className:"group",onClick:async()=>{await sn(`${l.name}==${l.version}`),Je({title:"Copied to clipboard"})},children:[u.jsx(jr,{children:l.name}),u.jsx(jr,{children:l.version}),u.jsxs(jr,{className:"flex justify-end",children:[u.jsx(Xk,{packageName:l.name,onSuccess:n}),u.jsx(Jk,{packageName:l.name,onSuccess:n})]})]},l.name),e[5]=n,e[6]=a):a=e[6],s=o.map(a),e[2]=n,e[3]=o,e[4]=s}else s=e[4];return e[7]!==s?(i=u.jsxs(op,{className:"overflow-auto flex-1",children:[r,u.jsx(rp,{children:s})]}),e[7]=s,e[8]=i):i=e[8],i},Xk=({packageName:t,onSuccess:e})=>{const[n,o]=q.useState(!1),{addPackage:r}=tt();return tn()?null:u.jsx(Kk,{onClick:async()=>{try{o(!0);const s=await r({package:t,upgrade:!0});s.success?(e(),rj(t)):rj(t,s.error)}finally{o(!1)}},loading:n,children:"Upgrade"})},Jk=({packageName:t,onSuccess:e})=>{const[n,o]=q.useState(!1),{removePackage:r}=tt();return u.jsx(Kk,{onClick:async()=>{try{o(!0);const s=await r({package:t});s.success?(e(),sj(t)):sj(t,s.error)}finally{o(!1)}},loading:n,children:"Remove"})},N9=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[i,a]=q.useState(s);let l,c,d;if(e[1]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{a(new Set)},e[1]=l):l=e[1],e[2]!==n?(c=[n],e[2]=n,e[3]=c):c=e[3],q.useEffect(l,c),o){let g;return e[4]!==o?(g=u.jsx(kr,{error:o}),e[4]=o,e[5]=g):g=e[5],g}if(!n){let g;return e[6]===Symbol.for("react.memo_cache_sentinel")?(g=u.jsx(kn,{size:"medium",centered:!0}),e[6]=g):g=e[6],g}if(n.dependencies.length===0){let g;return e[7]===Symbol.for("react.memo_cache_sentinel")?(g=u.jsx(dn,{title:"No dependencies",description:"No package dependencies found in this environment.",icon:u.jsx(Ss,{})}),e[7]=g):g=e[7],g}e[8]===Symbol.for("react.memo_cache_sentinel")?(d=g=>{a(x=>{const p=new Set(x);return p.has(g)?p.delete(g):p.add(g),p})},e[8]=d):d=e[8];const h=d;let f,m;if(e[9]!==i||e[10]!==r||e[11]!==n.dependencies){let g;e[13]!==i||e[14]!==r?(g=(x,p)=>u.jsx("div",{className:"border-b",children:u.jsx(Zk,{nodeId:`root-${p}`,node:x,level:0,isTopLevel:!0,expandedNodes:i,onToggle:h,onSuccess:r})},`${x.name}-${p}`),e[13]=i,e[14]=r,e[15]=g):g=e[15],f=n.dependencies.map(g),e[9]=i,e[10]=r,e[11]=n.dependencies,e[12]=f}else f=e[12];return e[16]!==f?(m=u.jsx("div",{className:"flex-1 overflow-auto",children:u.jsx("div",{children:f})}),e[16]=f,e[17]=m):m=e[17],m},Zk=t=>{const e=H.c(57),{nodeId:n,node:o,level:r,isTopLevel:s,expandedNodes:i,onToggle:a,onSuccess:l}=t,c=s!==void 0&&s,d=o.dependencies.length>0;let h;e[0]!==i||e[1]!==n?(h=i.has(n),e[0]=i,e[1]=n,e[2]=h):h=e[2];const f=h,m=c?0:16+16*r;let g;e[3]!==d||e[4]!==n||e[5]!==a?(g=z=>{z.key!=="Enter"&&z.key!==" "||(z.preventDefault(),d&&a(n))},e[3]=d,e[4]=n,e[5]=a,e[6]=g):g=e[6];const x=g;let p;e[7]!==d||e[8]!==n||e[9]!==a?(p=z=>{z.stopPropagation(),d&&a(n)},e[7]=d,e[8]=n,e[9]=a,e[10]=p):p=e[10];const b=p,y=d&&"select-none",v=c?"px-2 py-0.5":"";let w,j;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]!==c?(j=c?{}:{paddingLeft:`${m}px`},e[14]=m,e[15]=c,e[16]=j):j=e[16];const C=d?f:void 0;let N,S,E,T,I,M,F,D,R,P;return e[17]!==d||e[18]!==f?(N=d?f?u.jsx(No,{className:"w-4 h-4 mr-2 shrink-0"}):u.jsx(Li,{className:"w-4 h-4 mr-2 shrink-0"}):u.jsx("div",{className:"w-4 mr-2 shrink-0"}),e[17]=d,e[18]=f,e[19]=N):N=e[19],e[20]!==o.name?(S=u.jsx("span",{className:"font-medium truncate",children:o.name}),e[20]=o.name,e[21]=S):S=e[21],e[22]!==o.version?(E=o.version&&u.jsxs("span",{className:"text-muted-foreground text-xs",children:["v",o.version]}),e[22]=o.version,e[23]=E):E=e[23],e[24]!==S||e[25]!==E?(T=u.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0 py-1.5",children:[S,E]}),e[24]=S,e[25]=E,e[26]=T):T=e[26],e[27]!==o.tags?(I=o.tags.map(_9),e[27]=o.tags,e[28]=I):I=e[28],e[29]!==I?(M=u.jsx("div",{className:"flex items-center gap-1 ml-2",children:I}),e[29]=I,e[30]=M):M=e[30],e[31]!==c||e[32]!==o.name||e[33]!==l?(F=c&&u.jsxs("div",{className:"flex gap-1 invisible group-hover:visible",children:[u.jsx(Xk,{packageName:o.name,onSuccess:l}),u.jsx(Jk,{packageName:o.name,onSuccess:l})]}),e[31]=c,e[32]=o.name,e[33]=l,e[34]=F):F=e[34],e[35]!==b||e[36]!==x||e[37]!==N||e[38]!==T||e[39]!==M||e[40]!==F||e[41]!==w||e[42]!==j||e[43]!==C?(D=u.jsxs("div",{className:w,style:j,onClick:b,onKeyDown:x,tabIndex:0,role:"treeitem","aria-selected":!1,"aria-expanded":C,children:[N,T,M,F]}),e[35]=b,e[36]=x,e[37]=N,e[38]=T,e[39]=M,e[40]=F,e[41]=w,e[42]=j,e[43]=C,e[44]=D):D=e[44],e[45]!==i||e[46]!==d||e[47]!==f||e[48]!==r||e[49]!==o.dependencies||e[50]!==n||e[51]!==l||e[52]!==a?(R=d&&f&&u.jsx("div",{role:"group",children:o.dependencies.map((z,_)=>u.jsx(Zk,{nodeId:`${n}-${_}`,node:z,level:r+1,isTopLevel:!1,expandedNodes:i,onToggle:a,onSuccess:l},`${z.name}-${_}`))}),e[45]=i,e[46]=d,e[47]=f,e[48]=r,e[49]=o.dependencies,e[50]=n,e[51]=l,e[52]=a,e[53]=R):R=e[53],e[54]!==D||e[55]!==R?(P=u.jsxs("div",{children:[D,R]}),e[54]=D,e[55]=R,e[56]=P):P=e[56],P};function E9(t){return t.trim()}function _9(t,e){return t.kind==="cycle"?u.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"?u.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"?u.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 rm=um("marimo:scratchpadHistory:v1",[]),I9=jt(!1),A9=jt(null,(t,e,n)=>{if(!(n=n.trim()))return;const o=t(rm),r=[n,...o.filter(s=>s!==n)].slice(0,15);e(rm,r)}),T9={hide_code:!1,disabled:!1},M9=()=>{const t=H.c(71),e=Mm(),[n]=br(),{theme:o}=Zo(),r=O.useRef(null),s=hs(),{createNewCell:i,updateCellCode:a}=lt(),{sendRunScratchpad:l}=tt(),c=e.cellRuntime[Qo],d=c==null?void 0:c.output,h=c==null?void 0:c.status,f=c==null?void 0:c.consoleOutputs,m=e.cellData[Qo],g=(m==null?void 0:m.code)??"",x=Ct(A9),[p,b]=Dt(I9),y=je(rm);let v;t[0]!==x||t[1]!==g||t[2]!==l?(v=()=>{l({code:g}),x(g)},t[0]=x,t[1]=g,t[2]=l,t[3]=v):v=t[3];const w=Le(v);let j;t[4]!==g||t[5]!==i||t[6]!==s?(j=()=>{g.trim()&&i({code:g,before:!1,cellId:s??"__end__"})},t[4]=g,t[5]=i,t[6]=s,t[7]=j):j=t[7];const C=Le(j);let N;t[8]!==l||t[9]!==a?(N=()=>{a({cellId:Qo,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]=a,t[10]=N):N=t[10];const S=Le(N);let E;t[11]!==b||t[12]!==a?(E=ue=>{b(!1),a({cellId:Qo,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]=a,t[13]=E):E=t[13];const T=Le(E),[I,M]=O.useState();let F;t[14]!==g||t[15]!==f||t[16]!==w||t[17]!==I||t[18]!==d||t[19]!==o||t[20]!==n?(F=()=>u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"overflow-auto shrink-0 max-h-[40%]",children:u.jsx(Fu,{theme:o,showPlaceholder:!1,id:Qo,code:g,config:T9,status:"idle",serializedEditorState:null,runCell:w,userConfig:n,editorViewRef:r,setEditorView:ue=>{r.current=ue},hidden:!1,showHiddenCode:Bn.NOOP,languageAdapter:I,setLanguageAdapter:M})}),u.jsx("div",{className:"flex-1 overflow-auto shrink-0",children:u.jsx($c,{allowExpand:!1,output:d,className:"output-area",cellId:Qo,stale:!1,loading:!1})}),u.jsx("div",{className:"overflow-auto shrink-0 max-h-[35%]",children:u.jsx(cp,{consoleOutputs:f,className:"overflow-auto",stale:!1,cellName:y3,onSubmitDebugger:Bn.NOOP,cellId:Qo,debuggerActive:!1})})]}),t[14]=g,t[15]=f,t[16]=w,t[17]=I,t[18]=d,t[19]=o,t[20]=n,t[21]=F):F=t[21];const D=F;let R;t[22]!==T||t[23]!==y||t[24]!==p||t[25]!==o?(R=()=>p?u.jsx("div",{className:"absolute inset-0 z-100 bg-background p-3 border-none overflow-auto",children:u.jsx("div",{className:"overflow-auto flex flex-col gap-3",children:y.map((ue,de)=>u.jsx("div",{className:"border rounded-md hover:shadow-sm cursor-pointer hover:border-input overflow-hidden",onClick:()=>T(ue),children:u.jsx(O.Suspense,{children:u.jsx(sa,{language:"python",theme:o,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1},value:ue.trim(),editable:!1,readOnly:!0})})},de))})}):null,t[22]=T,t[23]=y,t[24]=p,t[25]=o,t[26]=R):R=t[26];const P=R;let z,_,k,B,A,U,$,J,G,K,W;t[27]===Symbol.for("react.memo_cache_sentinel")?(z=Oi.create(Qo),_=u.jsx("p",{className:"mx-2 my-2 text-muted-foreground text-sm",children:"Use this scratchpad cell to experiment with code without restrictions on variable names. Scratchpad code is ephemeral: variables defined in the scratchpad aren't saved to notebook memory, and the code is not saved in the notebook file."}),t[27]=z,t[28]=_):(z=t[27],_=t[28]),t[29]===Symbol.for("react.memo_cache_sentinel")?(k=Gt("cell.run"),t[29]=k):k=t[29],t[30]===Symbol.for("react.memo_cache_sentinel")?(B=u.jsx(Sr,{color:"var(--grass-11)",size:16}),t[30]=B):B=t[30],t[31]!==w||t[32]!==p?(A=u.jsx(Ne,{content:k,children:u.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=u.jsx(wp,{size:16}),t[34]=U):U=t[34],t[35]!==S||t[36]!==p?($=u.jsx(Ne,{content:"Clear code and outputs",children:u.jsx(ve,{disabled:p,size:"xs",variant:"text",onClick:S,children:U})}),t[35]=S,t[36]=p,t[37]=$):$=t[37],t[38]===Symbol.for("react.memo_cache_sentinel")?(J=u.jsx(Nr,{size:16}),t[38]=J):J=t[38],t[39]!==C||t[40]!==p?(G=u.jsx(Rs,{children:u.jsx(Ne,{content:"Insert code",children:u.jsx(ve,{disabled:p,size:"xs",variant:"text",onClick:C,children:J})})}),t[39]=C,t[40]=p,t[41]=G):G=t[41],t[42]!==h?(K=(h==="running"||h==="queued")&&u.jsx(kn,{className:"inline",size:"small"}),t[42]=h,t[43]=K):K=t[43],t[44]===Symbol.for("react.memo_cache_sentinel")?(W=u.jsx("div",{className:"flex-1"}),t[44]=W):W=t[44];const X=p&&"bg-(--sky-3) rounded-none";let V,Q;t[45]!==X?(V=xe(X),t[45]=X,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,ie,se,ae,ge,oe;return t[50]===Symbol.for("react.memo_cache_sentinel")?(re=u.jsx(_p,{size:16}),t[50]=re):re=t[50],t[51]!==V||t[52]!==Q||t[53]!==te?(ne=u.jsx(Ne,{content:"Toggle history",children:u.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]!==G||t[58]!==K||t[59]!==ne?(ie=u.jsxs("div",{className:"flex items-center shrink-0",children:[A,$,G,K,W,ne]}),t[55]=A,t[56]=$,t[57]=G,t[58]=K,t[59]=ne,t[60]=ie):ie=t[60],t[61]!==D?(se=D(),t[61]=D,t[62]=se):se=t[62],t[63]!==P?(ae=P(),t[63]=P,t[64]=ae):ae=t[64],t[65]!==se||t[66]!==ae?(ge=u.jsxs("div",{className:"flex-1 divide-y relative overflow-hidden flex flex-col",children:[se,ae]}),t[65]=se,t[66]=ae,t[67]=ge):ge=t[67],t[68]!==ie||t[69]!==ge?(oe=u.jsxs("div",{className:"flex flex-col h-full overflow-hidden divide-y",id:z,children:[_,ie,ge]}),t[68]=ie,t[69]=ge,t[70]=oe):oe=t[70],oe},O9=()=>{const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=u.jsx(M9,{}),t[0]=e):e=t[0],e},D9=()=>{const t=H.c(23),{openModal:e,closeModal:n}=An();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],t[0]=o):o=t[0];const{data:r,isPending:s,error:i,refetch:a}=Tn(P9,o);if(s){let b;return t[1]===Symbol.for("react.memo_cache_sentinel")?(b=u.jsx(kn,{size:"medium",centered:!0}),t[1]=b):b=t[1],b}if(i){let b;return t[2]!==i?(b=u.jsx(kr,{error:i}),t[2]=i,t[3]=b):b=t[3],b}let l;t[4]!==r?(l=r.filter(L9).map(F9),t[4]=r,t[5]=l):l=t[5];const c=l;if(r.length===0){let b;return t[6]===Symbol.for("react.memo_cache_sentinel")?(b=u.jsx(dn,{title:"No environment variables",description:"No environment variables are available in this notebook.",icon:u.jsx(od,{})}),t[6]=b):b=t[6],b}let d,h,f,m,g,x,p;return t[7]!==n||t[8]!==e||t[9]!==c||t[10]!==a?(d=()=>e(u.jsx(Ag,{providerNames:c,onSuccess:()=>{a(),n()},onClose:n})),t[7]=n,t[8]=e,t[9]=c,t[10]=a,t[11]=d):d=t[11],t[12]===Symbol.for("react.memo_cache_sentinel")?(h=u.jsx(Jo,{className:"h-4 w-4"}),t[12]=h):h=t[12],t[13]!==d?(f=u.jsx("div",{className:"flex justify-end h-8 border-b",children:u.jsx("button",{type:"button",className:"float-right border-l px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",onClick:d,children:h})}),t[13]=d,t[14]=f):f=t[14],t[15]===Symbol.for("react.memo_cache_sentinel")?(m=u.jsx(np,{children:u.jsxs(js,{children:[u.jsx(Cr,{children:"Environment Variable"}),u.jsx(Cr,{children:"Source"}),u.jsx(Cr,{})]})}),t[15]=m):m=t[15],t[16]!==r?(g=r.map(z9),t[16]=r,t[17]=g):g=t[17],t[18]!==g?(x=u.jsxs(op,{className:"overflow-auto flex-1 mb-16",children:[m,u.jsx(rp,{children:g})]}),t[18]=g,t[19]=x):x=t[19],t[20]!==f||t[21]!==x?(p=u.jsxs("div",{className:"flex flex-col h-full",children:[f,x]}),t[20]=f,t[21]=x,t[22]=p):p=t[22],p},R9=t=>{const e=H.c(9),{className:n,ariaLabel:o,onCopy:r}=t,[s,i]=q.useState(!1);let a;e[0]!==r?(a=()=>{r(),i(!0),setTimeout(()=>i(!1),1e3)},e[0]=r,e[1]=a):a=e[1];const l=a;let c,d;return e[2]!==s?(c=s?u.jsx(yc,{className:"w-3 h-3 text-green-700 rounded"}):u.jsx(Mi,{className:"w-3 h-3 hover:bg-muted rounded"}),e[2]=s,e[3]=c):c=e[3],e[4]!==o||e[5]!==n||e[6]!==l||e[7]!==c?(d=u.jsx("button",{type:"button",className:n,onClick:l,"aria-label":o,children:c}),e[4]=o,e[5]=n,e[6]=l,e[7]=c,e[8]=d):d=e[8],d};async function P9(){return Ig((await xj.request({})).secrets)}function L9(t){return t.provider!=="env"}function F9(t){return t.name}function z9(t){return t.keys.map(e=>u.jsxs(js,{className:"group",children:[u.jsx(jr,{children:e}),u.jsx(jr,{children:t.provider!=="env"&&u.jsx(HC,{variant:"outline",className:"select-none",children:t.name})}),u.jsx(jr,{children:u.jsx(R9,{ariaLabel:`Copy ${e}`,onCopy:async()=>{await sn(`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 B9=t=>{const e=H.c(6),{children:n}=t,{openModal:o,closeModal:r}=An();let s,i;return e[0]!==r||e[1]!==o?(s=()=>o(u.jsx($9,{onClose:r})),e[0]=r,e[1]=o,e[2]=s):s=e[2],e[3]!==n||e[4]!==s?(i=u.jsx(PC,{onClick:s,children:n}),e[3]=n,e[4]=s,e[5]=i):i=e[5],i},U9=[We.lineWrapping],$9=t=>{const e=H.c(23),{onClose:n}=t,[o,r]=O.useState(""),{theme:s}=Zo();let i,a,l,c,d,h;e[0]!==n?(i=async v=>{v.preventDefault();const w=new FormData(v.target),j=w.get("title"),C=w.get("description"),N=w.get("code");fetch("https://marimo.io/api/suggest-snippet",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:j,description:C,code:N})}),n(),Je({title:"Snippet Submitted",description:"Thank you for contributing! We will review your snippet shortly."})},e[0]=n,e[1]=i):i=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(a=u.jsx(Wo,{children:"Contribute a Snippet"}),e[2]=a):a=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(l=u.jsxs(ls,{children:[a,u.jsxs(cs,{children:["Have a useful snippet you want to share with the community? Submit it here or make a pull request"," ",u.jsx("a",{href:Fn.githubPage,target:"_blank",className:"underline",children:"on GitHub"}),"."]})]}),e[3]=l):l=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(c=u.jsx(qo,{id:"title",name:"title",autoFocus:!0,placeholder:"Title",required:!0,autoComplete:"off"}),d=u.jsx(WL,{id:"description",name:"description",autoFocus:!0,placeholder:"Description",rows:5,required:!0,autoComplete:"off"}),e[4]=c,e[5]=d):(c=e[4],d=e[5]),e[6]!==o?(h=u.jsx("input",{type:"hidden",name:"code",value:o}),e[6]=o,e[7]=h):h=e[7];const f=s==="dark"?"dark":"light";let m,g,x,p,b,y;return e[8]!==o||e[9]!==f?(m=u.jsx(sa,{theme:f,language:"python",className:"cm border rounded overflow-hidden",extensions:U9,value:o,onChange:r}),e[8]=o,e[9]=f,e[10]=m):m=e[10],e[11]!==h||e[12]!==m?(g=u.jsxs("div",{className:"flex flex-col gap-6 py-4",children:[c,d,h,m]}),e[11]=h,e[12]=m,e[13]=g):g=e[13],e[14]!==n?(x=u.jsx(ve,{"data-testid":"snippet-cancel-button",variant:"secondary",onClick:n,children:"Cancel"}),e[14]=n,e[15]=x):x=e[15],e[16]===Symbol.for("react.memo_cache_sentinel")?(p=u.jsx(ve,{"data-testid":"snippet-send-button","aria-label":"Save",variant:"default",type:"submit",children:"Send"}),e[16]=p):p=e[16],e[17]!==x?(b=u.jsxs(Ti,{children:[x,p]}),e[17]=x,e[18]=b):b=e[18],e[19]!==i||e[20]!==b||e[21]!==g?(y=u.jsx(Go,{className:"w-fit",children:u.jsxs("form",{onSubmit:i,children:[l,g,b]})}),e[19]=i,e[20]=b,e[21]=g,e[22]=y):y=e[22],y},V9=[We.lineWrapping],H9=()=>{const t=H.c(22),{readSnippets:e}=tt(),[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:i,error:a,isPending:l}=Tn(r,s);if(a){let v;return t[3]!==a?(v=u.jsx(kr,{error:a}),t[3]=a,t[4]=v):v=t[4],v}if(l||!i){let v;return t[5]===Symbol.for("react.memo_cache_sentinel")?(v=u.jsx(kn,{size:"medium",centered:!0}),t[5]=v):v=t[5],v}const c=n?"h-1/3":"h-full";let d,h,f,m,g,x,p,b,y;return t[6]!==c?(d=xe("border-b rounded-none",c),t[6]=c,t[7]=d):d=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(h=u.jsx(Fi,{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=u.jsxs("div",{className:"flex items-center w-full",children:[h,u.jsx(B9,{children:u.jsx("button",{className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:u.jsx(Jo,{className:"h-4 w-4"})})})]}),m=u.jsx(cc,{children:"No results"}),t[9]=f,t[10]=m):(f=t[9],m=t[10]),t[11]===Symbol.for("react.memo_cache_sentinel")?(g=v=>o(v),t[11]=g):g=t[11],t[12]!==i.snippets?(x=u.jsx(q9,{onSelect:g,snippets:i.snippets}),t[12]=i.snippets,t[13]=x):x=t[13],t[14]!==d||t[15]!==x?(p=u.jsxs(kc,{className:d,children:[f,m,x]}),t[14]=d,t[15]=x,t[16]=p):p=t[16],t[17]!==n?(b=u.jsx(O.Suspense,{children:u.jsx("div",{className:"h-2/3 snippet-viewer flex flex-col",children:n?u.jsx(W9,{snippet:n,onClose:()=>o(void 0)},n.title):u.jsx(dn,{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=u.jsxs("div",{className:"flex-1 overflow-hidden",children:[p,b]}),t[19]=b,t[20]=p,t[21]=y):y=t[21],y},W9=t=>{const e=H.c(33),{snippet:n,onClose:o}=t,{theme:r}=Zo(),{createNewCell:s}=lt(),i=hs();let a;e[0]!==s||e[1]!==i||e[2]!==n.sections?(a=()=>{for(const w of[...n.sections].reverse())w.code&&s({code:w.code,before:!1,cellId:i??"__end__",skipIfCodeExists:!0})},e[0]=s,e[1]=i,e[2]=n.sections,e[3]=a):a=e[3];const l=a;let c;e[4]!==s||e[5]!==i?(c=w=>{s({code:w,before:!1,cellId:i??"__end__"})},e[4]=s,e[5]=i,e[6]=c):c=e[6];const d=c;let h,f,m,g,x,p,b,y,v;if(e[7]!==n.title?(h=u.jsx("span",{children:n.title}),e[7]=n.title,e[8]=h):h=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(f=u.jsx(wn,{className:"h-4 w-4"}),e[9]=f):f=e[9],e[10]!==o?(m=u.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?(g=u.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]=g):g=e[14],e[15]===Symbol.for("react.memo_cache_sentinel")?(x=u.jsx(Nr,{className:"ml-2 h-4 w-4"}),e[15]=x):x=e[15],e[16]!==l?(p=u.jsx("div",{className:"flex justify-end",children:u.jsx(Rs,{children:u.jsxs(ve,{className:"float-right",size:"xs",variant:"outline",onClick:l,children:["Insert snippet",x]})})}),e[16]=l,e[17]=p):p=e[17],e[18]!==d||e[19]!==n.sections||e[20]!==n.title||e[21]!==r){let w;e[23]!==d||e[24]!==n.title||e[25]!==r?(w=j=>{const{code:C,html:N,id:S}=j;return N?u.jsx("div",{children:Qm({html:N})},`${n.title}-${S}`):C?u.jsxs("div",{className:"relative hover-actions-parent pr-2",children:[u.jsx(Rs,{children:u.jsx(Ne,{content:"Insert snippet",children:u.jsx(ve,{className:"absolute -top-2 -right-1 z-10 hover-action px-2 bg-background",size:"sm",variant:"outline",onClick:()=>{d(C)},children:u.jsx(Nr,{className:"h-5 w-5"})})})}),u.jsx(O.Suspense,{children:u.jsx(sa,{theme:r==="dark"?"dark":"light",language:"python",className:"cm border rounded overflow-hidden",extensions:V9,value:C,readOnly:!0},`${n.title}-${S}`)})]},`${n.title}-${S}`):null},e[23]=d,e[24]=n.title,e[25]=r,e[26]=w):w=e[26],b=n.sections.map(w),e[18]=d,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=u.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]!==g?(v=u.jsxs(u.Fragment,{children:[g,y]}),e[30]=y,e[31]=g,e[32]=v):v=e[32],v},q9=t=>{const e=H.c(7),{snippets:n,onSelect:o}=t;let r,s;if(e[0]!==o||e[1]!==n){let i;e[3]!==o?(i=a=>u.jsx(Zn,{className:"rounded-none",onSelect:()=>o(a),children:u.jsx("div",{className:"flex flex-row gap-2 items-center",children:u.jsx("span",{className:"mt-1 text-accent-foreground",children:a.title})})},a.title),e[3]=o,e[4]=i):i=e[4],r=n.map(i),e[0]=o,e[1]=n,e[2]=r}else r=e[2];return e[5]!==r?(s=u.jsx($m,{className:"flex flex-col overflow-auto",children:r}),e[5]=r,e[6]=s):s=e[6],s},G9=q.lazy(()=>Hm(()=>import("./tracing-CPx3xYyj.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}))),Y9=()=>{const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=u.jsx(q.Suspense,{fallback:u.jsx(K9,{}),children:u.jsx(G9,{})}),t[0]=e):e=t[0],e},K9=()=>{const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=u.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:u.jsx(kn,{})}),t[0]=e):e=t[0],e},Qk="name",e3="type-value",sm="defs-refs",X9=[{id:Qk,accessorFn:t=>[t.name,t.declaredBy],enableSorting:!0,sortingFn:"alphanumeric",header:({column:t})=>u.jsx(sp,{header:"Name",column:t}),cell:({getValue:t})=>{const[e,n]=t();return u.jsx(xf,{name:e,declaredBy:n})}},{id:e3,accessorFn:t=>[t.dataType,t.value],enableSorting:!0,sortingFn:"alphanumeric",header:({column:t})=>u.jsx(sp,{header:u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx("span",{children:"Type"}),u.jsx("span",{children:"Value"})]}),column:t}),cell:({getValue:t})=>{const[e,n]=t();return u.jsxs("div",{className:"max-w-[150px]",children:[u.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap text-muted-foreground font-mono text-xs",children:e}),u.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap",title:n??"",children:n})]})}},{id:sm,accessorFn:t=>[t.declaredBy,t.usedBy,t.name,t.declaredByNames,t.usedByNames],enableSorting:!0,sortingFn:"basic",header:({column:t})=>u.jsx(sp,{header:u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx("span",{children:"Declared By"}),u.jsx("span",{children:"Used By"})]}),column:t}),cell:({getValue:t})=>{const[e,n,o]=t(),r=s=>{const i=Ri(s);i&&ep(i,o)};return u.jsxs("div",{className:"flex flex-col gap-1 py-1",children:[u.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-center",children:[u.jsx("span",{title:"Declared by",children:u.jsx(Kp,{className:"w-3.5 h-3.5 text-muted-foreground"})}),e.length===1?u.jsx(Mo,{variant:"focus",cellId:e[0],skipScroll:!0,onClick:()=>r(e[0])}):u.jsx("div",{className:"text-destructive flex flex-row gap-2",children:e.slice(0,3).map((s,i)=>u.jsxs("span",{className:"flex",children:[u.jsx(Mo,{variant:"focus",cellId:s,skipScroll:!0,className:"whitespace-nowrap text-destructive",onClick:()=>r(s)},s),i<e.length-1&&", "]},s))})]}),u.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-baseline",children:[u.jsx("span",{title:"Used by",children:u.jsx(pa,{className:"w-3.5 h-3.5 text-muted-foreground"})}),u.jsx(Cw,{maxCount:3,cellIds:n,skipScroll:!0,onClick:r})]})]})}}],t3=O.memo(({className:t,cellIds:e,variables:n})=>{const[o,r]=q.useState([]),[s,i]=q.useState(""),a=qL(),l=O.useMemo(()=>{const h=f=>{const m=a[f];return JL(m)?`cell-${e.indexOf(f)}`:m??`cell-${e.indexOf(f)}`};return Object.values(n).map(f=>({...f,declaredByNames:f.declaredBy.map(h),usedByNames:f.usedBy.map(h)}))},[n,a,e]),c=O.useMemo(()=>{const h=new Map;return e.forEach((f,m)=>h.set(f,m)),function({variables:f,sort:m,cellIdToIndex:g}){m||(m={id:sm,desc:!1});let x=[];switch(m.id){case Qk:x=ca(f,p=>p.name);break;case e3:x=ca(f,p=>p.dataType);break;case sm:x=ca(f,p=>g.get(p.declaredBy[0]))}return m.desc?x.reverse():x}({variables:l,sort:o[0],cellIdToIndex:h})},[l,o,e]),d=GL({data:c,columns:X9,getCoreRowModel:XL(),onGlobalFilterChange:i,getFilteredRowModel:KL(),enableFilters:!0,enableGlobalFilter:!0,enableColumnPinning:!1,getColumnCanGlobalFilter:h=>h.columnDef.enableGlobalFilter??!0,globalFilterFn:"auto",manualSorting:!0,onSortingChange:r,getSortedRowModel:YL(),state:{sorting:o,globalFilter:s}});return u.jsxs(u.Fragment,{children:[u.jsx(oj,{className:"w-full",placeholder:"Search",value:s,onChange:h=>i(h.target.value)}),u.jsxs(op,{className:xe("w-full text-sm flex-1 border-separate border-spacing-0",t),children:[u.jsx(np,{children:u.jsx(js,{className:"whitespace-nowrap text-xs",children:d.getFlatHeaders().map(h=>u.jsx(Cr,{className:"sticky top-0 bg-background border-b",children:ij(h.column.columnDef.header,h.getContext())},h.id))})}),u.jsx(rp,{children:d.getRowModel().rows.map(h=>u.jsx(js,{className:"hover:bg-accent",children:h.getVisibleCells().map(f=>u.jsx(jr,{className:"border-b",children:ij(f.column.columnDef.cell,f.getContext())},f.id))},h.id))})]})]})});t3.displayName="VariableTable";const J9=()=>{const t=H.c(4),e=tp(),n=wr();if(Object.keys(e).length===0){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=u.jsx(dn,{title:"No variables",description:"Global variables will appear here.",icon:u.jsx(Jl,{})}),t[0]=r):r=t[0],r}let o;return t[1]!==n.inOrderIds||t[2]!==e?(o=u.jsx(t3,{className:"flex-1",cellIds:n.inOrderIds,variables:e}),t[1]=n.inOrderIds,t[2]=e,t[3]=o):o=t[3],o},Z9=t=>{const e=H.c(54),n=je(ZL),o=je(M6),r=lt(),s=wC(),i=t.cellId,a=o[t.cellId],l=Qi(t.cellId),c=l.code,d=ea(t.cellId);let h,f,m,g,x,p,b,y,v,w,j,C,N,S;if(e[0]!==r||e[1]!==s||e[2]!==n.focusedCellId||e[3]!==o||e[4]!==t.cellId||e[5]!==a||e[6]!==l.code||e[7]!==d.errored){if(h={id:i,graph:a,code:c,hasError:d.errored},n.focusedCellId&&o[n.focusedCellId]){const z=o[n.focusedCellId];let _;e[20]!==n.focusedCellId||e[21]!==z?(_={id:n.focusedCellId,graph:z},e[20]=n.focusedCellId,e[21]=z,e[22]=_):_=e[22],g=_}m=(g==null?void 0:g.id)===h.id,f=o3(h.graph)?1.5:3;const D=()=>{m?s.blurCell():(r.focusCell({cellId:h.id,where:"exact"}),s.focusCell({cellId:h.id}))};C=h.id;const R=m?"text-primary-foreground":"text-(--gray-8) hover:text-(--gray-9)";e[23]!==R?(x=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",R),e[23]=R,e[24]=x):x=e[24],p=D,b=sO;const P=m&&"bg-primary group-hover:bg-primary";e[25]!==P?(j=xe("group-hover:bg-(--gray-2) flex h-full w-full px-0.5 items-center rounded",P),e[25]=P,e[26]=j):j=e[26],y="truncate px-1 font-mono text-sm flex gap-1",v=h.code,w=h.graph.variables.length>0?u.jsx(nO,{cell:h,selectedCell:g}):u.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap max-w-full",children:tO(h.code)??u.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]=a,e[6]=l.code,e[7]=d.errored,e[8]=h,e[9]=f,e[10]=m,e[11]=g,e[12]=x,e[13]=p,e[14]=b,e[15]=y,e[16]=v,e[17]=w,e[18]=j,e[19]=C}else h=e[8],f=e[9],m=e[10],g=e[11],x=e[12],p=e[13],b=e[14],y=e[15],v=e[16],w=e[17],j=e[18],C=e[19];e[27]!==y||e[28]!==v||e[29]!==w?(N=u.jsx("div",{className:y,title:v,children:w}),e[27]=y,e[28]=v,e[29]=w,e[30]=N):N=e[30],e[31]!==N||e[32]!==j?(S=u.jsx("div",{className:j,children:N}),e[31]=N,e[32]=j,e[33]=S):S=e[33];const E=m?"z-30":"z-20";let T,I,M,F;return e[34]!==h||e[35]!==g||e[36]!==E?(T=xe("absolute overflow-visible top-[10.5px] left-[calc(var(--spacing-extra-small,8px)+17px)] pointer-events-none",E,function({cell:D,selectedCell:R}){return D.hasError?"text-destructive":!R&&!o3(D.graph)?"text-foreground":(R==null?void 0:R.id)===D.id||R!=null&&R.graph.parents.has(D.id)||R!=null&&R.graph.children.has(D.id)?"text-primary":"text-(--gray-8)"}({cell:h,selectedCell:g})),e[34]=h,e[35]=g,e[36]=E,e[37]=T):T=e[37],e[38]!==h||e[39]!==f||e[40]!==m||e[41]!==t.cellPositions||e[42]!==g?(I=m?u.jsx(oO,{cell:h,cellPositions:t.cellPositions,circleRadius:f}):u.jsx(rO,{cell:h,selectedCell:g,circleRadius:f}),e[38]=h,e[39]=f,e[40]=m,e[41]=t.cellPositions,e[42]=g,e[43]=I):I=e[43],e[44]!==T||e[45]!==I?(M=u.jsx("svg",{className:T,width:"1",height:"1",children:I}),e[44]=T,e[45]=I,e[46]=M):M=e[46],e[47]!==x||e[48]!==p||e[49]!==b||e[50]!==S||e[51]!==M||e[52]!==C?(F=u.jsxs("button",{"data-node-id":C,className:x,onClick:p,onMouseDown:b,children:[S,M]}),e[47]=x,e[48]=p,e[49]=b,e[50]=S,e[51]=M,e[52]=C,e[53]=F):F=e[53],F},Q9=t=>{const e=H.c(28),{open:n,setOpen:o}=t,r=wr();let s;e[0]!==r.inOrderIds?(s=Object.fromEntries(r.inOrderIds.map(iO)),e[0]=r.inOrderIds,e[1]=s):s=e[1];const i=s;let a;if(e[2]!==r){a=[];let v=0;for(const[w,j]of r.getColumns().entries())w>0&&a.push(v),v+=j.inOrderIds.length;e[2]=r,e[3]=a}else a=e[3];const l=n?"translate-x-0":"translate-x-[calc(100%+20px)]";let c,d,h,f,m,g,x,p,b,y;if(e[4]!==l?(c=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]=c):c=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(d=u.jsx("span",{className:"text-sm font-semibold",children:"Minimap"}),e[6]=d):d=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=u.jsx(wn,{className:"h-4 w-4"}),e[9]=f):f=e[9],e[10]!==h?(m=u.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[d,u.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]!==i||e[14]!==a){let v;e[16]!==i||e[17]!==a?(v=(w,j)=>{const C=a.includes(j);return u.jsxs(O.Fragment,{children:[C&&u.jsx("div",{className:"absolute left-5 w-[36px] h-px bg-(--gray-4) pointer-events-none","aria-hidden":"true"}),u.jsx(Z9,{cellId:w,cellPositions:i})]},w)},e[16]=i,e[17]=a,e[18]=v):v=e[18],g=r.inOrderIds.map(v),e[12]=r.inOrderIds,e[13]=i,e[14]=a,e[15]=g}else g=e[15];return e[19]!==g?(x=u.jsx("div",{className:"py-3 pl-3 pr-4 relative min-h-full",children:g}),e[19]=g,e[20]=x):x=e[20],e[21]===Symbol.for("react.memo_cache_sentinel")?(p=u.jsx("div",{className:"h-0 overflow-hidden","aria-hidden":"true"}),e[21]=p):p=e[21],e[22]!==x?(b=u.jsxs("div",{className:"overflow-y-auto overflow-x-hidden flex-1 scrollbar-none",children:[x,p]}),e[22]=x,e[23]=b):b=e[23],e[24]!==b||e[25]!==c||e[26]!==m?(y=u.jsxs("div",{className:c,children:[m,b]}),e[24]=b,e[25]=c,e[26]=m,e[27]=y):y=e[27],y},eO=()=>{const t=H.c(5),[e,n]=Dt($b);let o,r;return t[0]!==n?(o=()=>n(aO),t[0]=n,t[1]=o):o=t[1],Rt("global.toggleMinimap",o),t[2]!==e||t[3]!==n?(r=u.jsx(Q9,{open:e,setOpen:n}),t[2]=e,t[3]=n,t[4]=r):r=t[4],r};function tO(t){return t.split(`
|
|
163
|
+
`)[0].trim()||void 0}const nO=t=>{const e=H.c(11),{cell:n,selectedCell:o}=t,r=tp(),s=n.id===(o==null?void 0:o.id);let i,a;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=(c,d)=>{const h=r[c];return u.jsxs(O.Fragment,{children:[d>0&&", ",u.jsx("span",{className:xe({"font-bold":s,"text-foreground":o===void 0,"text-primary font-medium":!s&&O6(h,o)}),children:c})]},c)},e[5]=s,e[6]=o,e[7]=r,e[8]=l):l=e[8],i=n.graph.variables.map(l),e[0]=n.graph.variables,e[1]=s,e[2]=o,e[3]=r,e[4]=i}else i=e[4];return e[9]!==i?(a=u.jsx(u.Fragment,{children:i}),e[9]=i,e[10]=a):a=e[10],a},oO=t=>{const e=H.c(12),{cell:n,cellPositions:o,circleRadius:r}=t;let s,i,a,l;if(e[0]!==n.graph.children||e[1]!==n.graph.parents||e[2]!==n.id||e[3]!==o){s=[];const c=o[n.id]??0,d=new Set;for(const h of n.graph.parents)n.graph.children.has(h)&&d.add(h);for(const h of d){const f=o[h];if(f!==void 0){const m=21*(f-c);s.push(u.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(d.has(h))continue;const f=o[h];if(f!==void 0){const m=21*(f-c);s.push(u.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(d.has(h))continue;const f=o[h];if(f!==void 0){const m=21*(f-c);s.push(u.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?(i=u.jsx("circle",{r,fill:"currentColor",className:"pointer-events-auto"}),e[5]=r,e[6]=i):i=e[6],e[7]!==s?(a=u.jsx("g",{className:"pen pointer-events-auto",children:s}),e[7]=s,e[8]=a):a=e[8],e[9]!==i||e[10]!==a?(l=u.jsxs("g",{transform:"translate(0, 0)",children:[i,a]}),e[9]=i,e[10]=a,e[11]=l):l=e[11],l};function rO(t){const{cell:e,selectedCell:n,circleRadius:o}=t,r=e.graph.ancestors.size>0,s=e.graph.descendants.size>0;if(!n)return n3({circleRadius:o,leftWisker:r,rightWisker:s});const i=n.graph.ancestors.has(e.id),a=n.graph.descendants.has(e.id);return n3(i||a?{circleRadius:o,leftWisker:r,rightWisker:s,shift:i&&a?void 0:i?"left":"right"}:{circleRadius:o,leftWisker:!1,rightWisker:!1})}function n3(t){const{circleRadius:e,leftWisker:n,rightWisker:o,shift:r}=t,s=r===void 0?0:r==="left"?-14:14;return u.jsxs("g",{transform:`translate(${s}, 0)`,children:[u.jsxs("g",{children:[n&&u.jsx("path",{d:"M 0 0 h -8",fill:"none",strokeWidth:"2",stroke:"currentColor"}),o&&u.jsx("path",{d:"M 0 0 h 8",fill:"none",strokeWidth:"2",stroke:"currentColor"})]}),u.jsx("circle",{r:e,fill:"currentColor",className:"pointer-events-auto"})]})}function o3(t){return t.variables.length===0&&t.ancestors.size===0&&t.descendants.size===0}function sO(t){return t.preventDefault()}function iO(t,e){return[t,e]}function aO(t){return!t}const lO=q.lazy(()=>Hm(()=>import("./terminal-pM14FLUA.js"),__vite__mapDeps([126,1,2,127]),import.meta.url)),cO=t=>{const e=H.c(122),{children:n}=t,{isSidebarOpen:o,isTerminalOpen:r,selectedPanel:s}=bc(),{setIsSidebarOpen:i,setIsTerminalOpen:a}=Bi(),l=q.useRef(null),c=q.useRef(null);let d,h,f,m,g;e[0]!==o?(d=()=>{if(!l.current)return;const Re=l.current.isCollapsed();o&&Re&&l.current.expand(),o||Re||l.current.collapse(),requestAnimationFrame(uO)},h=[o],e[0]=o,e[1]=d,e[2]=h):(d=e[1],h=e[2]),O.useEffect(d,h),e[3]!==r?(f=()=>{if(!c.current)return;const Re=c.current.isCollapsed();r&&Re&&c.current.expand(),r||Re||c.current.collapse(),requestAnimationFrame(fO)},m=[r],e[3]=r,e[4]=f,e[5]=m):(f=e[4],m=e[5]),O.useEffect(f,m),e[6]!==n?(g=u.jsx(qc,{id:"app",className:"relative h-full",children:u.jsx(O.Suspense,{children:n})},"app"),e[6]=n,e[7]=g):g=e[7];const x=g,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=u.jsx(aj,{onDragging:lj,className:b}),e[10]=b,e[11]=y):y=e[11];const v=y,w=r?"resize-handle":"resize-handle-collapsed";let j,C;e[12]!==w?(j=xe("border-border no-print z-20",w,"horizontal"),e[12]=w,e[13]=j):j=e[13],e[14]!==j?(C=u.jsx(aj,{onDragging:lj,className:j}),e[14]=j,e[15]=C):C=e[15];const N=C;let S,E,T,I,M,F,D,R,P,z,_,k,B,A,U,$,J,G,K,W,X;e[16]!==s?(S=u.jsx("div",{className:"text-sm text-(--slate-11) uppercase tracking-wide font-semibold flex-1",children:s}),e[16]=s,e[17]=S):S=e[17],e[18]!==i?(E=()=>i(!1),e[18]=i,e[19]=E):E=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(T=u.jsx(wn,{className:"w-4 h-4"}),e[20]=T):T=e[20],e[21]!==E?(I=u.jsx(ve,{"data-testid":"close-helper-pane",className:"m-0",size:"xs",variant:"text",onClick:E,children:T}),e[21]=E,e[22]=I):I=e[22],e[23]!==S||e[24]!==I?(M=u.jsxs("div",{className:"p-3 border-b flex justify-between items-center",children:[S,I]}),e[23]=S,e[24]=I,e[25]=M):M=e[25],e[26]!==s?(F=s==="files"&&u.jsx(Wk,{}),e[26]=s,e[27]=F):F=e[27],e[28]!==s?(D=s==="errors"&&u.jsx(J7,{}),e[28]=s,e[29]=D):D=e[29],e[30]!==s?(R=s==="variables"&&u.jsx(J9,{}),e[30]=s,e[31]=R):R=e[31],e[32]!==s?(P=s==="dependencies"&&u.jsx(P7,{}),e[32]=s,e[33]=P):P=e[33],e[34]!==s?(z=s==="packages"&&u.jsx(C9,{}),e[34]=s,e[35]=z):z=e[35],e[36]!==s?(_=s==="outline"&&u.jsx(k9,{}),e[36]=s,e[37]=_):_=e[37],e[38]!==s?(k=s==="datasources"&&u.jsx(K7,{}),e[38]=s,e[39]=k):k=e[39],e[40]!==s?(B=s==="documentation"&&u.jsx(X7,{}),e[40]=s,e[41]=B):B=e[41],e[42]!==s?(A=s==="snippets"&&u.jsx(H9,{}),e[42]=s,e[43]=A):A=e[43],e[44]!==s?(U=s==="scratchpad"&&u.jsx(O9,{}),e[44]=s,e[45]=U):U=e[45],e[46]!==s?($=s==="chat"&&u.jsx(sT,{}),e[46]=s,e[47]=$):$=e[47],e[48]!==s?(J=s==="logs"&&u.jsx(qk,{}),e[48]=s,e[49]=J):J=e[49],e[50]!==s?(G=s==="tracing"&&u.jsx(Y9,{}),e[50]=s,e[51]=G):G=e[51],e[52]!==s?(K=s==="secrets"&&u.jsx(D9,{}),e[52]=s,e[53]=K):K=e[53],e[54]!==F||e[55]!==D||e[56]!==R||e[57]!==P||e[58]!==z||e[59]!==_||e[60]!==k||e[61]!==B||e[62]!==A||e[63]!==U||e[64]!==$||e[65]!==J||e[66]!==G||e[67]!==K?(W=u.jsx(O.Suspense,{children:u.jsxs(Vc,{children:[F,D,R,P,z,_,k,B,A,U,$,J,G,K]})}),e[54]=F,e[55]=D,e[56]=R,e[57]=P,e[58]=z,e[59]=_,e[60]=k,e[61]=B,e[62]=A,e[63]=U,e[64]=$,e[65]=J,e[66]=G,e[67]=K,e[68]=W):W=e[68],e[69]!==M||e[70]!==W?(X=u.jsx(Cc,{children:u.jsxs("div",{className:"flex flex-col h-full flex-1 overflow-hidden mr-[-4px]",children:[M,W]})}),e[69]=M,e[70]=W,e[71]=X):X=e[71];const V=X,Q=o&&"border-r border-l border-(--slate-7)";let te,re,ne,ie,se,ae;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=(Re,Pe)=>{var He;Pe===0&&Re===10&&((He=l.current)==null||He.resize(30))},e[74]=re):re=e[74],e[75]!==i?(ne=()=>i(!1),ie=()=>i(!0),e[75]=i,e[76]=ne,e[77]=ie):(ne=e[76],ie=e[77]),e[78]!==V||e[79]!==v?(se=u.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]!==ie||e[84]!==se?(ae=u.jsx(qc,{ref:l,id:"helper",collapsedSize:0,collapsible:!0,className:te,minSize:10,defaultSize:0,maxSize:75,onResize:re,onCollapse:ne,onExpand:ie,children:se},"helper"),e[81]=te,e[82]=ne,e[83]=ie,e[84]=se,e[85]=ae):ae=e[85];const ge=ae,oe=r&&"border-(--slate-7)";let ue,de,Se,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=(Re,Pe)=>{var He;Pe===0&&Re===10&&((He=c.current)==null||He.resize(30))},e[88]=de):de=e[88],e[89]!==a?(Se=()=>a(!1),Te=()=>a(!0),e[89]=a,e[90]=Se,e[91]=Te):(Se=e[90],Te=e[91]),e[92]===Symbol.for("react.memo_cache_sentinel")?(Fe=u.jsx("div",{}),e[92]=Fe):Fe=e[92],e[93]!==a?(_e=()=>a(!1),e[93]=a,e[94]=_e):_e=e[94],e[95]!==r||e[96]!==_e?(ke=u.jsx(O.Suspense,{fallback:Fe,children:u.jsx(lO,{visible:r,onClose:_e})}),e[95]=r,e[96]=_e,e[97]=ke):ke=e[97],e[98]!==r||e[99]!==ke?(Ye=u.jsx(L7,{isOpen:r,children:ke}),e[98]=r,e[99]=ke,e[100]=Ye):Ye=e[100],e[101]!==ue||e[102]!==Se||e[103]!==Te||e[104]!==Ye||e[105]!==N?(Ve=u.jsxs(qc,{ref:c,id:"terminal",collapsedSize:0,collapsible:!0,className:ue,minSize:10,defaultSize:0,maxSize:75,onResize:de,onCollapse:Se,onExpand:Te,children:[N,Ye]},"terminal"),e[101]=ue,e[102]=Se,e[103]=Te,e[104]=Ye,e[105]=N,e[106]=Ve):Ve=e[106];const Ke=Ve;let ee,ye,we,Ie,Y,me,pe,he,Ce;return e[107]===Symbol.for("react.memo_cache_sentinel")?(ee=WF(),e[107]=ee):ee=e[107],e[108]===Symbol.for("react.memo_cache_sentinel")?(ye=u.jsx(Vc,{children:u.jsx(V6,{})}),e[108]=ye):ye=e[108],e[109]!==Ke?(we=u.jsx(Bb,{capability:"terminal",children:Ke}),e[109]=Ke,e[110]=we):we=e[110],e[111]!==x||e[112]!==we?(Ie=u.jsx(qc,{children:u.jsxs(cj,{autoSaveId:"marimo:chrome:v1:l1",direction:"vertical",children:[x,we]})}),e[111]=x,e[112]=we,e[113]=Ie):Ie=e[113],e[114]===Symbol.for("react.memo_cache_sentinel")?(Y=u.jsx(QL,{}),e[114]=Y):Y=e[114],e[115]!==ge||e[116]!==Ie?(me=u.jsxs(cj,{autoSaveId:"marimo:chrome:v1:l2",direction:"horizontal",storage:ee,children:[ye,ge,Ie,Y]}),e[115]=ge,e[116]=Ie,e[117]=me):me=e[117],e[118]===Symbol.for("react.memo_cache_sentinel")?(pe=u.jsx(eO,{}),e[118]=pe):pe=e[118],e[119]===Symbol.for("react.memo_cache_sentinel")?(he=u.jsx(Cc,{children:u.jsx(Vc,{children:u.jsx(F6,{})})}),e[119]=he):he=e[119],e[120]!==me?(Ce=u.jsxs(qF,{children:[me,pe,he]}),e[120]=me,e[121]=Ce):Ce=e[121],Ce};function dO(){window.dispatchEvent(new Event("resize"))}function uO(){requestAnimationFrame(dO)}function hO(){window.dispatchEvent(new Event("resize"))}function fO(){requestAnimationFrame(hO)}let r3;r3=new URL(window.location.href).searchParams.get(eF.showChrome)==="false",Tj=Object.freeze(Object.defineProperty({__proto__:null,default:t=>{const e=H.c(10);if(r3){let s,i,a;return e[0]!==t?(s=u.jsx(zb,{hideControls:!0,...t}),e[0]=t,e[1]=s):s=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(i=u.jsx(cg,{}),e[2]=i):i=e[2],e[3]!==s?(a=u.jsxs(u.Fragment,{children:[s,i]}),e[3]=s,e[4]=a):a=e[4],a}let n,o,r;return e[5]!==t?(n=u.jsx(zb,{...t}),e[5]=t,e[6]=n):n=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(o=u.jsx(cg,{}),e[7]=o):o=e[7],e[8]!==n?(r=u.jsxs(cO,{children:[n,o]}),e[8]=n,e[9]=r):r=e[9],r}},Symbol.toStringTag,{value:"Module"}))});export{fp as C,Yc as E,dn as P,ez as __tla,Kc as a,Tj as e,Es as f};
|