@marimo-team/frontend 0.13.16-dev59 → 0.13.16-dev61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/dist/assets/{ConnectedDataExplorerComponent-BTGxqI_j.js → ConnectedDataExplorerComponent-CHI7o0Ls.js} +1 -1
  2. package/dist/assets/{ImageComparisonComponent-CzzBqdXA.js → ImageComparisonComponent-D71lbZ3M.js} +1 -1
  3. package/dist/assets/{VegaLite-O83nuMfl.js → VegaLite-Cmy0GXio.js} +1 -1
  4. package/dist/assets/{_baseEach-DNkNlAMh.js → _baseEach-DZqw6cVR.js} +1 -1
  5. package/dist/assets/_baseMap-DfoqOFse.js +1 -0
  6. package/dist/assets/{_baseUniq-Ol7Bv7p_.js → _baseUniq-CfbK8n7d.js} +1 -1
  7. package/dist/assets/{_createAggregator-DPHZ8aHb.js → _createAggregator-B_y4dREW.js} +1 -1
  8. package/dist/assets/{any-language-editor-B-V9wcD3.js → any-language-editor-CjqHMNYM.js} +1 -1
  9. package/dist/assets/{architectureDiagram-IEHRJDOE-CqO_EztW.js → architectureDiagram-IEHRJDOE-Dr6vGwGU.js} +1 -1
  10. package/dist/assets/{blockDiagram-JOT3LUYC-BIG0e-Cp.js → blockDiagram-JOT3LUYC-BOXT8121.js} +1 -1
  11. package/dist/assets/{c4Diagram-VJAJSXHY-DgmZAxXR.js → c4Diagram-VJAJSXHY-D9MR6yuH.js} +1 -1
  12. package/dist/assets/channel-DPB3K6fx.js +1 -0
  13. package/dist/assets/{chunk-4BMEZGHF-CIfXA6OF.js → chunk-4BMEZGHF-BUxfafdN.js} +1 -1
  14. package/dist/assets/{chunk-A2AXSNBT-DvfcFk69.js → chunk-A2AXSNBT-wojsaoYS.js} +1 -1
  15. package/dist/assets/{chunk-AEK57VVT-CC_C0KN_.js → chunk-AEK57VVT-DoM9Ddke.js} +1 -1
  16. package/dist/assets/{chunk-D6G4REZN-2A92B6q-.js → chunk-D6G4REZN-dGfTih8d.js} +1 -1
  17. package/dist/assets/{chunk-RZ5BOZE2-Cb8myTXn.js → chunk-RZ5BOZE2-CU1PAUEz.js} +1 -1
  18. package/dist/assets/{chunk-XZIHB7SX-B5VPkIzy.js → chunk-XZIHB7SX-x9UkkhTb.js} +1 -1
  19. package/dist/assets/{circle-play-D7Q3K0Yg.js → circle-play-BNa7rLWp.js} +1 -1
  20. package/dist/assets/classDiagram-GIVACNV2-2U_oTN77.js +1 -0
  21. package/dist/assets/classDiagram-v2-COTLJTTW-2U_oTN77.js +1 -0
  22. package/dist/assets/clone-BzqoMAjq.js +1 -0
  23. package/dist/assets/{compile-XqY323UT.js → compile-BDFZd4zv.js} +1 -1
  24. package/dist/assets/{dagre-OKDRZEBW-XDgYF9dp.js → dagre-OKDRZEBW-0rCL3wZN.js} +1 -1
  25. package/dist/assets/{data-editor-CUHd-CNV.js → data-editor-C-svOE-x.js} +1 -1
  26. package/dist/assets/{diagram-SSKATNLV-DadblRsf.js → diagram-SSKATNLV-CzWfSuN6.js} +1 -1
  27. package/dist/assets/{diagram-VNBRO52H-BDM7DuPf.js → diagram-VNBRO52H-CfrS8iYp.js} +1 -1
  28. package/dist/assets/{edit-page-BYbToCaW.js → edit-page-GfJsJVFB.js} +10 -10
  29. package/dist/assets/{erDiagram-Q7BY3M3F-DNQkBXlv.js → erDiagram-Q7BY3M3F-BWoXv89O.js} +1 -1
  30. package/dist/assets/{flowDiagram-4HSFHLVR-B3w0Iwdx.js → flowDiagram-4HSFHLVR-CgbIy9F1.js} +1 -1
  31. package/dist/assets/{ganttDiagram-APWFNJXF-DhDc_swb.js → ganttDiagram-APWFNJXF-CBWYfWhC.js} +1 -1
  32. package/dist/assets/{gitGraphDiagram-7IBYFJ6S-DUb6mHNw.js → gitGraphDiagram-7IBYFJ6S-DTIFP-4t.js} +1 -1
  33. package/dist/assets/{graph-BBzkRVlU.js → graph-EW5oKcOV.js} +1 -1
  34. package/dist/assets/{home-page-D1LVvBpt.js → home-page-B4txNfNa.js} +1 -1
  35. package/dist/assets/{index-BmOL1-zF.js → index-B3-yDiVQ.js} +1 -1
  36. package/dist/assets/{index-LTjbWZNT.js → index-B3PLapRH.js} +1 -1
  37. package/dist/assets/{index-rIhIMqj8.js → index-B3y5pbE_.js} +1 -1
  38. package/dist/assets/{index-DzTq_FpA.js → index-Bcj9kkXB.js} +14 -14
  39. package/dist/assets/{index-DP9Zq1Ou.js → index-BoJWHgn7.js} +1 -1
  40. package/dist/assets/{index-BjEVP9vB.js → index-Bz4-4V9L.js} +1 -1
  41. package/dist/assets/{index-LSSBC8Rd.js → index-CJP7YMJ_.js} +1 -1
  42. package/dist/assets/{index-DsacajfY.js → index-CKM1O6QU.js} +1 -1
  43. package/dist/assets/{index-DhNA-acH.js → index-CYHfwAvx.js} +1 -1
  44. package/dist/assets/{index-DAOcJ7Ac.js → index-CcgJXYZO.js} +1 -1
  45. package/dist/assets/{index-Uqe0s7wz.js → index-CvNTW1vD.js} +1 -1
  46. package/dist/assets/{index-ByI4QUiD.js → index-D7VOb7xY.js} +1 -1
  47. package/dist/assets/{index-BgPFZE5i.js → index-DJFKbiQ6.js} +1 -1
  48. package/dist/assets/{index-DHKPZ_oX.js → index-DNM48r3l.js} +1 -1
  49. package/dist/assets/index-DRNyeN7N.css +1 -0
  50. package/dist/assets/{index-BTFMHw26.js → index-DZhv-Mtf.js} +1 -1
  51. package/dist/assets/{index-BPGo9u5T.js → index-DapjhA_O.js} +1 -1
  52. package/dist/assets/{index-eY1NQien.js → index-DkL_a1PU.js} +1 -1
  53. package/dist/assets/{index-XTMk23ln.js → index-Ds115XG0.js} +1 -1
  54. package/dist/assets/{index-CZAlGmMU.js → index-jREeNvDK.js} +1 -1
  55. package/dist/assets/infoDiagram-PH2N3AL5-VLu-LlKv.js +2 -0
  56. package/dist/assets/{journeyDiagram-U35MCT3I-DjwkcoCR.js → journeyDiagram-U35MCT3I-DXkDMJuq.js} +1 -1
  57. package/dist/assets/{kanban-definition-NDS4AKOZ-CYmNc75J.js → kanban-definition-NDS4AKOZ-CWb6KICQ.js} +1 -1
  58. package/dist/assets/{layout-DzdHVCPK.js → layout-DzLwEIGn.js} +1 -1
  59. package/dist/assets/{linear-Buy8I-5A.js → linear-BKpOmUoG.js} +1 -1
  60. package/dist/assets/{mermaid-Y_fFfPGV.js → mermaid-CipkSnuo.js} +4 -4
  61. package/dist/assets/{min-yP_99urI.js → min-B0xHXFkK.js} +1 -1
  62. package/dist/assets/{mindmap-definition-ALO5MXBD-BbMGVphq.js → mindmap-definition-ALO5MXBD-DhzR2tmY.js} +1 -1
  63. package/dist/assets/{panels-CHm5-SIx.js → panels-DAkKInWX.js} +3 -3
  64. package/dist/assets/{pieDiagram-IB7DONF6-DBs90AyK.js → pieDiagram-IB7DONF6-DmvVD7Vd.js} +1 -1
  65. package/dist/assets/{quadrantDiagram-7GDLP6J5-DgQ2OXj_.js → quadrantDiagram-7GDLP6J5-CLHOmD8l.js} +1 -1
  66. package/dist/assets/{radar-MK3ICKWK-DfZCoTLS.js → radar-MK3ICKWK-DFE8IRn4.js} +1 -1
  67. package/dist/assets/{react-plotly-C2pU0O8v.js → react-plotly-DTeHeTIi.js} +1 -1
  68. package/dist/assets/{requirementDiagram-KVF5MWMF-CRcC7ZZs.js → requirementDiagram-KVF5MWMF-DemkS1Dz.js} +1 -1
  69. package/dist/assets/{run-page-D8uPNQdD.js → run-page-NdwfYYso.js} +1 -1
  70. package/dist/assets/{sankeyDiagram-QLVOVGJD-VeLT2uT6.js → sankeyDiagram-QLVOVGJD-DIaBrJUd.js} +1 -1
  71. package/dist/assets/{sequenceDiagram-X6HHIX6F-DaGSyS47.js → sequenceDiagram-X6HHIX6F-Bl_bpbHF.js} +1 -1
  72. package/dist/assets/{slides-component-BjNPOckW.js → slides-component-CRsJNPZN.js} +1 -1
  73. package/dist/assets/{sortBy-_g-ev-qv.js → sortBy-C909I68-.js} +1 -1
  74. package/dist/assets/{stateDiagram-DGXRK772-CgaMsIqa.js → stateDiagram-DGXRK772-Dcao3EI4.js} +1 -1
  75. package/dist/assets/stateDiagram-v2-YXO3MK2T-B9igSFlP.js +1 -0
  76. package/dist/assets/{terminal-B0sHUSvx.js → terminal-Du7pUi4V.js} +1 -1
  77. package/dist/assets/{time-D_UBfK0F.js → time-MgirAGPx.js} +1 -1
  78. package/dist/assets/{timeline-definition-BDJGKUSR-D3761Lxj.js → timeline-definition-BDJGKUSR-DtYlgq8C.js} +1 -1
  79. package/dist/assets/{tracing-3IY9qyNR.js → tracing-CCC85gHU.js} +2 -2
  80. package/dist/assets/{tree-VNvVKUNJ.js → tree-CKqD-3bk.js} +1 -1
  81. package/dist/assets/{vega-component-BkOHwwK5.js → vega-component-DiCDGeO3.js} +1 -1
  82. package/dist/assets/{xychartDiagram-VJFVF3MP-DuLi1Qhp.js → xychartDiagram-VJFVF3MP-BgOrbeay.js} +1 -1
  83. package/dist/index.html +2 -2
  84. package/package.json +1 -1
  85. package/dist/assets/_baseMap-DqifI1if.js +0 -1
  86. package/dist/assets/channel-CGpk5nyh.js +0 -1
  87. package/dist/assets/classDiagram-GIVACNV2-CqrERlGh.js +0 -1
  88. package/dist/assets/classDiagram-v2-COTLJTTW-CqrERlGh.js +0 -1
  89. package/dist/assets/clone-BEIuzTZz.js +0 -1
  90. package/dist/assets/index-mD-LrCTs.css +0 -1
  91. package/dist/assets/infoDiagram-PH2N3AL5-CzU-41oC.js +0 -2
  92. package/dist/assets/stateDiagram-v2-YXO3MK2T-Dy0HeBdB.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./tracing-3IY9qyNR.js","./index-DzTq_FpA.js","./index-mD-LrCTs.css","./compile-XqY323UT.js","./time-D_UBfK0F.js","./timer-DFzT7np-.js","./linear-Buy8I-5A.js","./init-DLRA0X12.js","./range-CtcPcB_L.js","./zoom-COrs4lFh.js","./ordinal-DDUp3AbE.js","./colors-bszWmPJw.js","./arc-Cuwikxov.js","./step-BwsUM5iJ.js","./panels-CHm5-SIx.js","./index-DsacajfY.js","./index-Uqe0s7wz.js","./index-rIhIMqj8.js","./index-eY1NQien.js","./index-DAOcJ7Ac.js","./index-DP9Zq1Ou.js","./index-XTMk23ln.js","./index-LTjbWZNT.js","./index-BTFMHw26.js","./index-BjEVP9vB.js","./index-LSSBC8Rd.js","./index-ByI4QUiD.js","./index-CZAlGmMU.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-CHJ5qNM_.js","./ebnf-B-Df8AvO.js","./ecl-DPFc0Uaf.js","./eiffel-DR5c0IrL.js","./elm-D7xaZ7Da.js","./erlang-BuqgqA5h.js","./factor-CFXhaUWb.js","./fcl-CVaBTCzQ.js","./forth-Dri_5nFc.js","./fortran-DL7KluxX.js","./gas-5kEe4nk0.js","./gherkin-B6X1vGSW.js","./groovy-DnIzCrpZ.js","./haskell-CmdsSjFB.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-FFvkTduk.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-OdhglgkO.js","./swift-B_XXVlXX.js","./tcl-B2fODqDH.js","./textile-BuVhTOzU.js","./tiddlywiki-BgR6AEZu.js","./tiki-CI-ztowC.js","./toml-BQXy8elZ.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","./panels-DcAzAz16.css","./tree-VNvVKUNJ.js","./index-BmOL1-zF.js","./tree-C1rhMrxo.css","./circle-play-D7Q3K0Yg.js","./_createAggregator-DPHZ8aHb.js","./_baseEach-DNkNlAMh.js","./transform-Cyp0GDF-.js","./sortBy-_g-ev-qv.js","./_baseMap-DqifI1if.js","./terminal-B0sHUSvx.js","./terminal-WqMRJt5Z.css"])))=>i.map(i=>d[i]);
2
- var wF=Object.defineProperty;var g3=Ft=>{throw TypeError(Ft)};var vF=(Ft,Et,mn)=>Et in Ft?wF(Ft,Et,{enumerable:!0,configurable:!0,writable:!0,value:mn}):Ft[Et]=mn;var ee=(Ft,Et,mn)=>vF(Ft,typeof Et!="symbol"?Et+"":Et,mn),kF=(Ft,Et,mn)=>Et.has(Ft)||g3("Cannot "+mn);var _3=(Ft,Et,mn)=>(kF(Ft,Et,"read from private field"),mn?mn.call(Ft):Et.get(Ft)),b3=(Ft,Et,mn)=>Et.has(Ft)?g3("Cannot add the same private member more than once"):Et instanceof WeakSet?Et.add(Ft):Et.set(Ft,mn);import{u as Fe,Q as A,i9 as SF,ia as CF,ib as y3,ic as NF,id as jF,ie as EF,R as K,ig as IF,ih as Mr,ii as AF,ij as Kf,ik as x3,il as TF,im as MF,io as w3,ip as oc,d as X,as as Un,iq as Xf,j as h,dt as Zf,du as v3,dv as OF,dx as Qf,dz as ep,f7 as rc,ir as tp,dr as np,ds as op,dw as rp,is as DF,it as k3,eh as S3,bp as et,a8 as Lt,iu as RF,dV as fo,iv as C3,iw as N3,ix as sp,iy as j3,iz as PF,L as Zt,_ as Qt,aF as E3,cD as ip,W as Pe,iA as LF,ei as dt,iB as I3,em as sc,iC as FF,ao as lt,iD as ic,Z as We,a_ as Vn,a0 as en,iE as ac,iF as Ts,e5 as Ms,iG as zF,iH as Xi,iI as BF,ef as UF,iJ as A3,iK as T3,dN as VF,a7 as ap,iL as ar,iM as Or,aJ as lc,aL as lr,iN as HF,iO as cc,iP as M3,a5 as Zi,eE as O3,a6 as dc,iQ as $F,an as yn,iR as lp,iS as Dr,aj as cr,ak as Os,al as dr,bg as Rr,U as Fo,e6 as Ds,gn as D3,fP as Rs,gq as WF,b2 as fn,iT as qF,iU as GF,fN as cp,aI as uc,iV as dp,iW as YF,iX as R3,iY as up,iZ as JF,i_ as KF,i$ as po,j0 as P3,fT as hp,j1 as Qi,j2 as hc,e0 as XF,ae as Zn,am as Ps,be as ur,j3 as ea,bt as Hn,ap as Ls,a4 as Le,f4 as mo,b7 as L3,ep as Ut,j4 as ZF,eR as QF,dA as fc,j5 as pc,aN as fp,j6 as ez,eo as pp,ec as Fs,j7 as tz,j8 as mp,bj as jn,j9 as nz,dT as Ae,ja as Je,jb as gp,jc as St,jd as F3,je as oz,fu as _p,aE as En,aT as $n,ga as z3,gb as B3,gc as rz,gg as sz,gd as U3,V as Oe,dM as iz,aG as mc,aR as gc,aH as _c,aO as sn,eg as zo,jf as az,ge as V3,jg as lz,g5 as H3,g7 as $3,jh as zs,ji as W3,jj as cz,jk as dz,ai as uz,ah as hz,eb as ta,af as bp,jl as na,jm as bc,jn as fz,jo as pz,jp as q3,jq as pn,fS as G3,dO as yc,ba as mz,jr as gz,ar as yp,aK as _z,js as bz,gr as Y3,b6 as xc,jt as xp,aq as oa,e1 as J3,ju as yz,ag as xz,jv as K3,jw as wz,jx as vz,jy as kz,jz as Sz,jA as Cz,jB as Nz,dp as Bo,jC as wc,jD as Bs,o as Uo,n as st,fx as Qn,jE as In,jF as ut,jG as Us,jH as Vt,fO as Gt,jI as wp,dS as go,jJ as jz,jK as Ez,b4 as X3,b5 as Z3,jL as Q3,jM as Iz,gu as Vs,jN as vc,b1 as kc,gt as Pr,jO as e4,jP as ra,ej as vp,jQ as Az,jR as Tz,jS as Mz,jT as Oz,jU as t4,jV as Dz,jW as n4,jX as o4,jY as Rz,jZ as r4,j_ as s4,ek as Sc,j$ as Pz,bq as Lz,k0 as Fz,fw as Wn,k1 as zz,k2 as Bz,k3 as Hs,k4 as Cc,k5 as $s,fH as Vo,k6 as kp,k7 as sa,k8 as ia,k9 as aa,ka as Uz,fm as Nc,kb as Sp,kc as i4,kd as jc,eQ as Vz,fn as Hz,r as $z,ke as Wz,kf as qz,kg as a4,t as D,kh as Gz,ki as Yz,kj as Cp,f_ as la,kk as l4,fA as Jz,fr as c4,kl as d4,km as Kz,kn as Xz,ko as Zz,kp as Qz,kq as eB,kr as tB,ks as nB,kt as oB,ku as rB,kv as sB,kw as iB,kx as aB,ky as lB,kz as cB,kA as dB,kB as uB,kC as hB,kD as fB,kE as pB,kF as mB,kG as ca,kH as gB,kI as _B,kJ as bB,kK as yB,kL as xB,kM as wB,kN as u4,kO as vB,kP as kB,kQ as SB,kR as h4,kS as CB,kT as NB,kU as f4,kV as jB,kW as Ws,kX as qn,kY as EB,kZ as IB,k_ as AB,k$ as TB,l0 as MB,l1 as OB,l2 as DB,l3 as RB,l4 as PB,l5 as LB,l6 as hr,l7 as FB,l8 as zB,l9 as BB,la as UB,eq as VB,lb as HB,lc as p4,eu as $B,ld as Ec,le as WB,lf as qB,lg as GB,lh as YB,X as Lr,li as Ic,et as JB,lj as Np,lk as Ac,ll as da,lm as ua,ln as Tc,lo as fr,lp as m4,lq as Ho,lr as qs,ls as jp,lt as ha,lu as Gs,lv as Ep,lw as Ip,lx as g4,ly as Mc,lz as KB,S as fa,lA as pa,lB as XB,eP as Oc,lC as ZB,lD as Ap,lE as QB,lF as eU,lG as Dc,lH as tU,lI as nU,lJ as _4,lK as Tp,gs as Ys,lL as oU,lM as rU,lN as sU,lO as iU,fF as aU,bd as lU,gv as jt,lP as ma,lQ as Js,lR as cU,lS as dU,lT as Mp,lU as uU,cn as Op,lV as hU,b3 as b4,lW as fU,lX as pU,lY as Rc,lZ as y4,eJ as Dp,bf as x4,$ as Rp,l_ as w4,l$ as mU,m0 as gU,m1 as Pp,m2 as Lp,m3 as _U,m4 as v4,m5 as k4,m6 as ga,fq as bU,ab as S4,ft as yU,e3 as xU,m7 as C4,m8 as wU,m9 as vU,ma as N4,mb as kU,mc as SU,md as j4,me as E4,mf as CU,bh as I4,mg as NU,mh as Fp,ea as jU,mi as $o,dK as A4,mj as T4,ee as M4,fg as zp,mk as Bp,ml as O4,bv as Up,dL as Pc,mm as D4,mn as EU,mo as IU,mp as AU,bc as Lc,mq as R4,f9 as Vp,g6 as TU,g8 as MU,gf as Hp,gi as OU,mr as DU,ms as $p,mt as RU,mu as PU,mv as LU,mw as FU,mx as zU,my as BU,mz as UU,mA as VU,a9 as HU,mB as Fc,aa as $U,mC as P4,mD as WU,f5 as qU,mE as L4,a$ as eo,fk as GU,dC as YU,mF as JU,mG as F4,mH as KU,eO as XU,mI as ZU,mJ as QU,e4 as eV,mK as tV,mL as nV,a2 as zc,mM as oV,a3 as pr,dF as z4,mN as Wp,mO as rV,en as B4,mP as sV,mQ as U4,mR as iV,mS as aV,mT as lV,mU as cV,mV as dV,mW as uV,mX as V4,g1 as qp,f$ as Gp,fW as Ks,g0 as Fr,mY as H4,g2 as Yp,fX as zr,dW as hV,mZ as Jp,m_ as fV,a1 as pV,m$ as mV,fG as $4,E as Xs,n0 as gV,n1 as _V,n2 as bV,n3 as yV,n4 as _a,n5 as xV,n6 as wV,n7 as vV,n8 as kV,n9 as SV,na as W4,nb as CV,fv as NV,nc as jV,nd as EV,ne as IV,nf as AV,gh as TV,ng as MV,nh as q4,ni as OV,nj as DV,nk as G4,nl as Y4,nm as J4,f3 as K4,nn as RV,no as PV,np as X4,nq as Z4,nr as Bc,ns as Q4,nt as LV,nu as eS,nv as FV,nw as zV,nx as tS,ny as BV,nz as UV,nA as VV,C as nS,nB as HV,nC as $V,nD as WV,nE as mr,nF as oS,dU as qV,fY as GV,nG as rS,fZ as sS,nH as YV,nI as Zs,nJ as JV,nK as Uc,nL as KV,nM as XV,y as iS,nN as ZV,di as QV,nO as eH,nP as tH,nQ as nH,nR as oH,nS as rH,eW as sH,b0 as iH,aZ as aH,at as Vc,nT as aS,nU as lS,av as cS,au as lH,e8 as cH,__tla as dH}from"./index-DzTq_FpA.js";import{G as uH,L as dS,g as hH,b as ba,A as fH,s as pH,k as mH,B as uS,a as gH,M as _H,Y as bH,c as xn,u as ya,C as yH,S as xH,K as wH,d as vH,i as kH,e as hS,f as SH,h as CH,j as NH,l as xa,P as Kp,m as fS,n as jH,o as EH,p as Xp,T as IH}from"./tree-VNvVKUNJ.js";import{d as pS,e as mS,L as gS,f as Qs,I as Zp,g as AH,h as _S,N as bS,V as yS,S as xS,F as wS,i as vS,M as TH,l as kS,j as MH,E as SS,k as OH,m as Qp,n as DH,o as RH,p as PH,q as LH,s as FH,t as zH,v as BH,w as UH,x as VH,a as HH,C as $H,R as CS,b as WH,A as qH,y as GH,z as YH,O as JH,T as KH,B as XH,D as ZH,c as QH,P as e$,__tla as t$}from"./panels-CHm5-SIx.js";import{c as n$}from"./_createAggregator-DPHZ8aHb.js";import{s as to,i as gr,T as em,a as tm}from"./transform-Cyp0GDF-.js";import{g as NS}from"./timer-DFzT7np-.js";import{i as o$}from"./zoom-COrs4lFh.js";import{s as wa}from"./sortBy-_g-ev-qv.js";let nm,Hc,An,$c,jS,va,om,r$=Promise.all([(()=>{try{return dH}catch{}})(),(()=>{try{return t$}catch{}})()]).then(async()=>{var ec,m3;var Ft=n$(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});let Et,mn,rm,Wc,ei,ti,sm,im,am,lm,ka,qc,cm,Sa,dm,Gc,um,hm,Yc,fm,pm,mm,Ca,gm,Jc,_m,bm,ym,xm,wm,vm,Kc,km,Xc,Sm,Cm,Nm,jm,Em,Na,Im,Am,Zc,Tm,Mm,Om,Qc,Dm,Rm,Pm,ja,ed,td,Lm,Fm,zm,Bm,Um,Vm,Hm,$m,Wm,nd,od,qm,Gm,Ym,Ea,_r,br;Et=Fe("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),mn=Fe("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"}]]),rm=Fe("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"}]]),Wc=Fe("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),ei=Fe("ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]),ti=Fe("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"}]]),sm=Fe("chevrons-down",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]),im=Fe("chevrons-up",[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]]),$c=Fe("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),am=Fe("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),lm=Fe("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),ka=Fe("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),qc=Fe("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"}]]),cm=Fe("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"}]]),Sa=Fe("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"}]]),dm=Fe("code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]),Gc=Fe("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"}]]),um=Fe("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"}]]),hm=Fe("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"}]]),Yc=Fe("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"}]]),fm=Fe("eraser",[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]]),pm=Fe("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"}]]),mm=Fe("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"}]]),Ca=Fe("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"}]]),gm=Fe("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"}]]),Jc=Fe("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"}]]),_m=Fe("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"}]]),bm=Fe("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"}]]),ym=Fe("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"}]]),xm=Fe("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"}]]),wm=Fe("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"}]]),vm=Fe("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"}]]),Kc=Fe("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"}]]),km=Fe("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"}]]),Xc=Fe("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"}]]),Sm=Fe("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"}]]),Cm=Fe("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"}]]),Nm=Fe("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"}]]),jm=Fe("message-circle-question",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Em=Fe("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"}]]),Na=Fe("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"}]]),Im=Fe("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"}]]),Am=Fe("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"}]]),Zc=Fe("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"}]]),Tm=Fe("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Mm=Fe("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"}]]),Om=Fe("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"}]]),Qc=Fe("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"}]]),Dm=Fe("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"}]]),Rm=Fe("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"}]]),Pm=Fe("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"}]]),ja=Fe("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"}]]),ed=Fe("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"}]]),td=Fe("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"}]]),Lm=Fe("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"}]]),Fm=Fe("square-code",[["path",{d:"M10 9.5 8 12l2 2.5",key:"3mjy60"}],["path",{d:"m14 9.5 2 2.5-2 2.5",key:"1bir2l"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),zm=Fe("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"}]]),Bm=Fe("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"}]]),Um=Fe("square-m",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 16V8l4 4 4-4v8",key:"141u4e"}]]),Vm=Fe("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"}]]),Hm=Fe("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"}]]),$m=Fe("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"}]]),Wm=Fe("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"}]]),nd=Fe("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"}]]),od=Fe("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"}]]),qm=Fe("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]),Gm=Fe("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"}]]),Ym=Fe("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"}]]),Ea=Fe("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"}]]),_r=Fe("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"}]]),br=Fe("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);const ES=A.createContext({}),IS=A.forwardRef(function(t,e){[t,e]=jF(t,e,ES);let{toolbarProps:n}=function(s,i){const{"aria-label":a,"aria-labelledby":l,orientation:c="horizontal"}=s;let[d,u]=A.useState(!1);SF(()=>{var m;u(!(!i.current||!(!((m=i.current.parentElement)===null||m===void 0)&&m.closest('[role="toolbar"]'))))});const{direction:f}=CF(),p=f==="rtl"&&c==="horizontal";let _=NF(i);const g=A.useRef(null);return{toolbarProps:{...y3(s,{labelable:!0}),role:d?"group":"toolbar","aria-orientation":c,"aria-label":a,"aria-labelledby":a==null?l:void 0,onKeyDownCapture:d?void 0:m=>{if(m.currentTarget.contains(m.target)){if(c==="horizontal"&&m.key==="ArrowRight"||c==="vertical"&&m.key==="ArrowDown")p?_.focusPrevious():_.focusNext();else{if(!(c==="horizontal"&&m.key==="ArrowLeft"||c==="vertical"&&m.key==="ArrowUp"))return m.key==="Tab"?(m.stopPropagation(),g.current=document.activeElement,void(m.shiftKey?_.focusFirst():_.focusLast())):void 0;p?_.focusNext():_.focusPrevious()}m.stopPropagation(),m.preventDefault()}},onFocusCapture:d?void 0:m=>{var b,x;g.current&&!m.currentTarget.contains(m.relatedTarget)&&(!((b=i.current)===null||b===void 0)&&b.contains(m.target))&&((x=g.current)===null||x===void 0||x.focus(),g.current=null)},onBlurCapture:d?void 0:m=>{m.currentTarget.contains(m.relatedTarget)||g.current||(g.current=m.target)}}}}(t,e),o=EF({...t,values:{orientation:t.orientation||"horizontal"},defaultClassName:"react-aria-Toolbar"}),r=y3(t);return delete r.id,K.createElement("div",{...IF(n,r),...o,ref:e,slot:t.slot||void 0,"data-orientation":t.orientation||"horizontal"},o.children)});function Ia(t,e){const n=+Mr(t)-+Mr(e);return n<0?-1:n>0?1:n}function AS(t,e){const n=Mr(t,e==null?void 0:e.in);return+function(o,r){const s=Mr(o,r==null?void 0:r.in);return s.setHours(23,59,59,999),s}(n,e)==+function(o,r){const s=Mr(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 TS(t,e,n){const[o,r,s]=Kf(n==null?void 0:n.in,t,t,e),i=Ia(r,s),a=Math.abs(function(d,u,f){const[p,_]=Kf(f==null?void 0:f.in,d,u);return 12*(p.getFullYear()-_.getFullYear())+(p.getMonth()-_.getMonth())}(r,s));if(a<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-i*a);let l=Ia(r,s)===-i;AS(o)&&a===1&&Ia(o,s)===1&&(l=!1);const c=i*(a-+l);return c===0?0:c}function MS(t,e,n){const o=function(r,s){return+Mr(r)-+Mr(s)}(t,e)/1e3;return(r=>{const s=(0,Math.trunc)(r);return s===0?0:s})(o)}function OS(t,e){return function(n,o,r){const s=TF(),i=(r==null?void 0:r.locale)??s.locale??MF,a=Ia(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]=Kf(r==null?void 0:r.in,...a>0?[o,n]:[n,o]),u=MS(d,c),f=(x3(d)-x3(c))/1e3,p=Math.round((u-f)/60);let _;if(p<2)return p===0?i.formatDistance("lessThanXMinutes",1,l):i.formatDistance("xMinutes",p,l);if(p<45)return i.formatDistance("xMinutes",p,l);if(p<90)return i.formatDistance("aboutXHours",1,l);if(p<w3){const g=Math.round(p/60);return i.formatDistance("aboutXHours",g,l)}if(p<2520)return i.formatDistance("xDays",1,l);if(p<oc){const g=Math.round(p/w3);return i.formatDistance("xDays",g,l)}if(p<2*oc)return _=Math.round(p/oc),i.formatDistance("aboutXMonths",_,l);if(_=TS(d,c),_<12){const g=Math.round(p/oc);return i.formatDistance("xMonths",g,l)}{const g=_%12,m=Math.trunc(_/12);return g<3?i.formatDistance("aboutXYears",m,l):g<9?i.formatDistance("overXYears",m,l):i.formatDistance("almostXYears",m+1,l)}}(t,function(n){return AF(n,Date.now())}(t),e)}const DS=()=>{const t=X.c(7),{selectedLayout:e}=pS(),{setLayoutView:n}=mS();if(Un()&&!Xf("wasm_layouts"))return null;let o,r,s,i;return t[0]!==n?(o=a=>n(a),t[0]=n,t[1]=o):o=t[1],t[2]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsx(np,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:h.jsx(op,{placeholder:"Select a view"})}),t[2]=r):r=t[2],t[3]===Symbol.for("react.memo_cache_sentinel")?(s=h.jsx(Zf,{children:h.jsxs(v3,{children:[h.jsx(OF,{children:"View as"}),gS.map(PS)]})}),t[3]=s):s=t[3],t[4]!==e||t[5]!==o?(i=h.jsxs(rp,{"data-testid":"layout-select",value:e,onValueChange:o,children:[r,s]}),t[4]=e,t[5]=o,t[6]=i):i=t[6],i};function RS(t){const e=Jm(t);return h.jsx(e,{className:"h-4 w-4"})}function Jm(t){switch(t){case"vertical":return Sm;case"grid":return uH;case"slides":return Qc;default:return rc(t),tp}}function Km(t){return ep(t)}function PS(t){return h.jsx(Qf,{value:t,children:h.jsxs("div",{className:"flex items-center gap-1.5 leading-5",children:[RS(t),h.jsx("span",{children:Km(t)})]})},t)}function LS(){const t=X.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=X.c(11);let c;l[0]!==a?(c=new DF(a),l[0]=a,l[1]=c):c=l[1];const d=c;let u;l[2]!==i||l[3]!==d?(u=()=>d.get(i),l[2]=i,l[3]=d,l[4]=u):u=l[4];const[f,p]=A.useState(u);let _;l[5]!==i||l[6]!==d?(_=b=>{p(b),d.set(i,b)},l[5]=i,l[6]=d,l[7]=_):_=l[7];const g=_;let m;return l[8]!==g||l[9]!==f?(m=[f,g],l[8]=g,l[9]=f,l[10]=m):m=l[10],m}("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 Xm(t){return t.dropdown!==void 0}function Aa(t,e=""){return t.flatMap(n=>n.label?Xm(n)?Aa(n.dropdown,`${e+n.label} > `):{...n,label:e+n.label}:[])}const ni=t=>{const e=X.c(8),{children:n,layerTop:o}=t,r=o!==void 0&&o;let s;e[0]!==n?(s=K.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=h.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=h.jsxs("div",{className:"multi-icon relative w-fit",children:[i,c]}),e[5]=i,e[6]=c,e[7]=d):d=e[7],d};function rd(t){const e=X.c(3),n=sd();let o;return e[0]!==t||e[1]!==n?(o=()=>{t!==void 0&&n([t])},e[0]=t,e[1]=n,e[2]=o):o=e[2],et(o)}function Zm(){const t=X.c(2),e=sd();let n;return t[0]!==e?(n=()=>e(C3(fo())),t[0]=e,t[1]=n):n=t[1],et(n)}function sd(){const t=X.c(2),{prepareForRun:e}=Lt();let n;return t[0]!==e?(n=async o=>{var a;if(o.length===0)return;const{cellHandles:r,cellData:s}=fo(),i=[];for(const l of o){const c=r[l],d=(a=c.current)==null?void 0:a.editorView;let u;d?(N3(d)!=="markdown"&&sp(d),u=j3(d)):u=s[l].code,i.push(u),e({cellId:l})}await PF({cellIds:o,codes:i}).catch(FS)},t[0]=e,t[1]=n):n=t[1],et(n)}function FS(t){Zt.error(t)}const Ta=Qt(null),zS=Qt(!1),id=E3("marimo:ai:chatState:v2",{chats:[],activeChatId:null}),BS=Qt(t=>{const e=t(id);return e.chats.find(n=>n.id===e.activeChatId)},(t,e,n)=>{e(id,o=>({...o,activeChatId:n}))}),ad=t=>{const e=X.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],ip(window,"keydown",n,o);const r=t.children??"Undo";let s,i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(s=h.jsx(LF,{className:"ml-2",shortcut:"cmd-z"}),e[3]=s):s=e[3],e[4]!==r||e[5]!==t?(i=h.jsxs(Pe,{"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 ld(){const t=X.c(3),{deleteCell:e,undoDeleteCell:n}=Lt();let o;return t[0]!==e||t[1]!==n?(o=r=>{var l;if(dt.get(I3))return;const{cellId:s}=r,i=dt.get(sc),a=(((l=i.cellData[s])==null?void 0:l.code)??"").trim()==="";if(e({cellId:s}),FF({cellId:s}).catch(()=>{n()}),!a){const{dismiss:c}=lt({title:"Cell deleted",description:"You can bring it back by clicking undo or through the command palette.",action:h.jsx(ad,{"data-testid":"undo-delete-button",onClick:()=>{n(),d()}})}),d=c}},t[0]=e,t[1]=n,t[2]=o):o=t[2],et(o)}function Qm(){const t=X.c(3),{splitCell:e,undoSplitCell:n}=Lt();let o;return t[0]!==e||t[1]!==n?(o=r=>{const s=ic(r.cellId);if(!s)return;const i=j3(s);e(r);const{dismiss:a}=lt({title:"Cell split",action:h.jsx(ad,{"data-testid":"undo-split-button",size:"sm",variant:"outline",onClick:()=>{n({...r,snapshot:i}),l()},children:"Undo"})}),l=a},t[0]=e,t[1]=n,t[2]=o):o=t[2],et(o)}function cd(t){const e=X.c(49),{cell:n}=t,{createNewCell:o,updateCellConfig:r,updateCellName:s,moveCell:i,sendToTop:a,sendToBottom:l,addColumnBreakpoint:c,clearCellOutput:d}=Lt(),u=Qm(),f=rd(n==null?void 0:n.cellId),p=!We(I3),_=ld(),{openModal:g}=Vn(),m=en(Ta),b=We(ac),x=We(Ts),y=We(Ms),v=We(zF);if(!n||y){let N;return e[0]===Symbol.for("react.memo_cache_sentinel")?(N=[],e[0]=N):N=e[0],N}const{cellId:S,config:k,getEditorView:I,name:j,hasOutput:E,hasConsoleOutput:T,status:M}=n;let L;e[1]!==S||e[2]!==k.disabled||e[3]!==r?(L=async()=>{const N={disabled:!k.disabled};await Dr({configs:{[S]:N}}),r({cellId:S,config:N})},e[1]=S,e[2]=k.disabled,e[3]=r,e[4]=L):L=e[4];const B=L;let O;e[5]!==S||e[6]!==k.hide_code||e[7]!==I||e[8]!==r?(O=async()=>{const N={hide_code:!k.hide_code};await Dr({configs:{[S]:N}}),r({cellId:S,config:N});const $=I();$&&(N.hide_code?$.contentDOM.blur():$.focus())},e[5]=S,e[6]=k.hide_code,e[7]=I,e[8]=r,e[9]=O):O=e[9];const z=O;let F,V,P,C,H;return e[10]===Symbol.for("react.memo_cache_sentinel")?(F=h.jsx(Wm,{size:13,strokeWidth:1.5}),e[10]=F):F=e[10],e[11]!==S||e[12]!==j||e[13]!==g||e[14]!==s?(V=()=>{g(h.jsxs(cr,{children:[h.jsx(Os,{children:h.jsx(dr,{children:"Rename cell"})}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx(Rr,{htmlFor:"cell-name",children:"Cell name"}),h.jsx(bS,{placeholder:"cell name",value:j,onKeyDown:N=>{N.key==="Enter"&&(N.preventDefault(),N.stopPropagation(),g(null))},onChange:N=>s({cellId:S,name:N})})]})]}))},e[11]=S,e[12]=j,e[13]=g,e[14]=s,e[15]=V):V=e[15],e[16]!==S||e[17]!==s?(P=N=>s({cellId:S,name:N}),e[16]=S,e[17]=s,e[18]=P):P=e[18],e[19]!==j||e[20]!==P?(C=h.jsx(bS,{placeholder:"cell name",value:j,onChange:P}),e[19]=j,e[20]=P,e[21]=C):C=e[21],e[22]!==c||e[23]!==b||e[24]!==v||e[25]!==x||e[26]!==p||e[27]!==S||e[28]!==d||e[29]!==k.disabled||e[30]!==k.hide_code||e[31]!==o||e[32]!==_||e[33]!==I||e[34]!==T||e[35]!==E||e[36]!==i||e[37]!==j||e[38]!==f||e[39]!==l||e[40]!==a||e[41]!==m||e[42]!==u||e[43]!==M||e[44]!==V||e[45]!==C||e[46]!==B||e[47]!==z?(H=[[{icon:F,label:"Name",disableClick:!0,handle:$S,handleHeadless:V,rightElement:C},{icon:h.jsx(Qs,{size:13,strokeWidth:1.5}),label:"Run cell",hotkey:"cell.run",hidden:M==="running"||M==="queued"||M==="disabled-transitively"||k.disabled,handle:()=>f()},{icon:h.jsx(Xi,{size:13,strokeWidth:1.5}),label:"AI completion",hidden:!b,handle:()=>{m(N=>(N==null?void 0:N.cellId)===S?null:{cellId:S})},hotkey:"cell.aiCompletion"},{icon:h.jsx(ed,{size:13,strokeWidth:1.5}),label:"Split cell",hotkey:"cell.splitCell",handle:()=>u({cellId:S})},{icon:h.jsx(Zp,{size:13,strokeWidth:1.5}),label:"Export output as PNG",hidden:!E,handle:()=>function(N){const $=document.getElementById(k3.create(N));$&&($.classList.add("printing-output"),S3($,"result.png").finally(()=>{$.classList.remove("printing-output")}))}(S)},{icon:h.jsx(UF,{size:13,strokeWidth:1.5}),label:"Format cell",hotkey:"cell.format",handle:()=>{const N=I();N&&BF({[S]:N})}},{icon:k.hide_code?h.jsx(A3,{size:13,strokeWidth:1.5}):h.jsx(T3,{size:13,strokeWidth:1.5}),label:k.hide_code?"Show code":"Hide code",handle:z,hotkey:"cell.hideCode"},{icon:k.disabled?h.jsx(_r,{size:13,strokeWidth:1.5}):h.jsx(br,{size:13,strokeWidth:1.5}),label:"Reactive execution",rightElement:h.jsx(VF,{"data-testid":"cell-disable-switch",checked:!k.disabled,size:"sm",onCheckedChange:B}),handle:B},{icon:h.jsx(ap,{size:13,strokeWidth:1.5}),label:"Clear output",hidden:!(E||T),handle:()=>{d({cellId:S})}}],[{icon:h.jsx(lc,{}),label:"Convert to Markdown",hotkey:"cell.viewAsMarkdown",handle:()=>{const N=I();N&&(ar(x,o),Or(N,"markdown",{keepCodeAsIs:!1}))}},{icon:h.jsx(lr,{size:13,strokeWidth:1.5}),label:"Convert to SQL",handle:()=>{const N=I();N&&(ar(x,o),Or(N,"sql",{keepCodeAsIs:!1}))}},{icon:h.jsx(cc,{}),label:"Toggle as Python",handle:()=>{const N=I();N&&(ar(x,o),HF(N,"python",{force:!0}))}}],[{icon:h.jsxs(ni,{children:[h.jsx(ka,{size:13,strokeWidth:1.5}),h.jsx(M3,{size:8,strokeWidth:2})]}),label:"Create cell above",hotkey:"cell.createAbove",handle:()=>o({cellId:S,before:!0})},{icon:h.jsxs(ni,{children:[h.jsx(ka,{size:13,strokeWidth:1.5}),h.jsx(Zi,{size:8,strokeWidth:2})]}),label:"Create cell below",hotkey:"cell.createBelow",handle:()=>o({cellId:S,before:!1})},{icon:h.jsx(M3,{size:13,strokeWidth:1.5}),label:"Move cell up",hotkey:"cell.moveUp",handle:()=>i({cellId:S,before:!0})},{icon:h.jsx(Zi,{size:13,strokeWidth:1.5}),label:"Move cell down",hotkey:"cell.moveDown",handle:()=>i({cellId:S,before:!1})},{icon:h.jsx(O3,{size:13,strokeWidth:1.5}),label:"Move cell left",hotkey:"cell.moveLeft",handle:()=>i({cellId:S,direction:"left"}),hidden:v!=="columns"},{icon:h.jsx(dc,{size:13,strokeWidth:1.5}),label:"Move cell right",hotkey:"cell.moveRight",handle:()=>i({cellId:S,direction:"right"}),hidden:v!=="columns"},{icon:h.jsx(im,{size:13,strokeWidth:1.5}),label:"Send to top",hotkey:"cell.sendToTop",handle:()=>a({cellId:S})},{icon:h.jsx(sm,{size:13,strokeWidth:1.5}),label:"Send to bottom",hotkey:"cell.sendToBottom",handle:()=>l({cellId:S})},{icon:h.jsx($F,{size:13,strokeWidth:1.5}),label:"Break into new column",hotkey:"cell.addColumnBreakpoint",hidden:v!=="columns",handle:()=>c({cellId:S})}],[{icon:h.jsx(dS,{size:13,strokeWidth:1.5}),label:"Copy link to cell",disabled:!_S(j),tooltip:_S(j)?void 0:"Only named cells can be linked to",handle:async()=>{await yn(AH(j)),lt({description:"Link copied to clipboard"})}}],[{label:"Delete",hidden:!p,variant:"danger",icon:h.jsx(lp,{size:13,strokeWidth:1.5}),handle:()=>{_({cellId:S})}}]].map(VS).filter(US),e[22]=c,e[23]=b,e[24]=v,e[25]=x,e[26]=p,e[27]=S,e[28]=d,e[29]=k.disabled,e[30]=k.hide_code,e[31]=o,e[32]=_,e[33]=I,e[34]=T,e[35]=E,e[36]=i,e[37]=j,e[38]=f,e[39]=l,e[40]=a,e[41]=m,e[42]=u,e[43]=M,e[44]=V,e[45]=C,e[46]=B,e[47]=z,e[48]=H):H=e[48],H}function US(t){return t.length>0}function VS(t){return t.filter(HS)}function HS(t){return!t.hidden}function $S(t){t==null||t.stopPropagation(),t==null||t.preventDefault()}function WS(t){return!t.hidden}const dd=Qt(!1),eg=()=>{const t=X.c(37),[e,n]=fn(dd),o=qF(),r=We(GF),s=We(cp);let i;t[0]!==r?(i={cell:r},t[0]=r,t[1]=i):i=t[1];let a=cd(i).flat();a=Aa(a);const l=function(){const P=X.c(45),{theme:C}=Fo(),[H,N]=Ds(),[$,Y]=D3();let Z;P[0]!==N?(Z=async ce=>{await Rs({config:ce}).then(()=>{N(ce)})},P[0]=N,P[1]=Z):Z=P[1];const q=Z;let re;P[2]!==Y?(re=async ce=>{await WF({config:ce}).then(()=>{Y(ce)})},P[2]=Y,P[3]=re):re=P[3];const ne=re;let oe;if(P[4]!==$||P[5]!==H||P[6]!==ne||P[7]!==q||P[8]!==C){let ce,pe,de;P[10]!==$?(ce=Ke=>Ke!==$.width,P[10]=$,P[11]=ce):ce=P[11],P[12]!==$||P[13]!==ne?(pe=Ke=>({label:`App config > Set width=${Ke}`,handle:()=>{ne({...$,width:Ke})}}),P[12]=$,P[13]=ne,P[14]=pe):pe=P[14],P[15]!==H||P[16]!==q||P[17]!==C?(de={label:"Config > Toggle dark mode",handle:()=>{q({...H,display:{...H.display,theme:C==="dark"?"light":"dark"}})}},P[15]=H,P[16]=q,P[17]=C,P[18]=de):de=P[18];const ge=H.keymap.preset==="vim";let ie,xe;P[19]!==H||P[20]!==q?(ie=()=>{q({...H,keymap:{...H.keymap,preset:"vim"}})},P[19]=H,P[20]=q,P[21]=ie):ie=P[21],P[22]!==ge||P[23]!==ie?(xe={label:"Config > Switch keymap to VIM",hidden:ge,handle:ie},P[22]=ge,P[23]=ie,P[24]=xe):xe=P[24];const we=H.keymap.preset==="default";let ae,Se,me;P[25]!==H||P[26]!==q?(ae=()=>{q({...H,keymap:{...H.keymap,preset:"default"}})},P[25]=H,P[26]=q,P[27]=ae):ae=P[27],P[28]!==ae||P[29]!==we?(Se={label:"Config > Switch keymap to default (current: VIM)",hidden:we,handle:ae},P[28]=ae,P[29]=we,P[30]=Se):Se=P[30],P[31]!==H||P[32]!==q?(me=()=>{q({...H,completion:{...H.completion,copilot:!1}})},P[31]=H,P[32]=q,P[33]=me):me=P[33];const Te=H.completion.copilot!=="github";let Re,$e;P[34]!==me||P[35]!==Te?(Re={label:"Config > Disable GitHub Copilot",handle:me,hidden:Te},P[34]=me,P[35]=Te,P[36]=Re):Re=P[36],P[37]!==H||P[38]!==q?($e=()=>{q({...H,completion:{...H.completion,copilot:"github"}})},P[37]=H,P[38]=q,P[39]=$e):$e=P[39];const ze=H.completion.copilot==="github";let Ne;P[40]!==$e||P[41]!==ze?(Ne={label:"Config > Enable GitHub Copilot",handle:$e,hidden:ze},P[40]=$e,P[41]=ze,P[42]=Ne):Ne=P[42],oe=[...hH().filter(ce).map(pe),de,xe,Se,Re,Ne],P[4]=$,P[5]=H,P[6]=ne,P[7]=q,P[8]=C,P[9]=oe}else oe=P[9];const G=oe;let Q;return P[43]!==G?(Q=G.filter(WS),P[43]=G,P[44]=Q):Q=P[44],Q}();let c=Ig();c=[...Aa(c),...Aa(l)];const d=c.filter(qS),u=uc.keyBy(d,GS),{recentCommands:f,addRecentCommand:p}=LS();let _;t[2]!==f?(_=new Set(f),t[2]=f,t[3]=_):_=t[3];const g=_;let m,b;t[4]!==s||t[5]!==n?(m=P=>{KF(s.getHotkey("global.commandPalette").key)(P)&&(P.preventDefault(),n(YS))},t[4]=s,t[5]=n,t[6]=m):m=t[6],ip(document,"keydown",m),t[7]!==p||t[8]!==s||t[9]!==o||t[10]!==n?(b=(P,C)=>{const H=o[P];if(!H)return null;const N=s.getHotkey(P);return h.jsxs(po,{disabled:C.disabled,onSelect:()=>{p(P),n(!1),requestAnimationFrame(()=>{H()})},value:N.name,children:[h.jsxs("span",{children:[N.name,C.tooltip&&h.jsx("span",{className:"ml-2",children:C.tooltip})]}),h.jsx(P3,{children:h.jsx(hp,{shortcut:N.key})})]},P)},t[7]=p,t[8]=s,t[9]=o,t[10]=n,t[11]=b):b=t[11];const x=b;let y;t[12]!==p||t[13]!==s||t[14]!==n?(y=(P,C,H,N)=>{const $=H===void 0?{}:H;return h.jsxs(po,{disabled:$.disabled,onSelect:()=>{p(P),n(!1),requestAnimationFrame(()=>{C()})},value:P,children:[h.jsxs("span",{children:[P,$.tooltip&&h.jsxs("span",{className:"ml-2",children:["(",$.tooltip,")"]})]}),N&&h.jsx(P3,{children:h.jsx(hp,{shortcut:s.getHotkey(N).key})})]},P)},t[12]=p,t[13]=s,t[14]=n,t[15]=y):y=t[15];const v=y,S=JF;let k;t[16]===Symbol.for("react.memo_cache_sentinel")?(k=h.jsx(Qi,{placeholder:"Type to search..."}),t[16]=k):k=t[16];const I=up;let j;t[17]===Symbol.for("react.memo_cache_sentinel")?(j=h.jsx(hc,{children:"No results found."}),t[17]=j):j=t[17];const E=f.length>0&&h.jsxs(h.Fragment,{children:[h.jsx(dp,{heading:"Recently Used",children:f.map(P=>{const C=u[P];return YF(P)?x(P,{disabled:C==null?void 0:C.disabled,tooltip:C==null?void 0:C.tooltip}):C&&!Xm(C)?v(C.label,C.handleHeadless||C.handle,{disabled:C.disabled,tooltip:C.tooltip}):null})}),h.jsx(R3,{})]}),T=dp,M=s.iterate().map(P=>{if(g.has(P))return null;const C=u[P];return x(P,{disabled:C==null?void 0:C.disabled,tooltip:C==null?void 0:C.tooltip})}),L=d.map(P=>g.has(P.label)?null:v(P.label,P.handleHeadless||P.handle,{disabled:P.disabled,tooltip:P.tooltip}));let B;t[18]!==g||t[19]!==v?(B=P=>g.has(P.label)?null:v(`Cell > ${P.label}`,P.handleHeadless||P.handle,{disabled:P.disabled,tooltip:P.tooltip}),t[18]=g,t[19]=v,t[20]=B):B=t[20];const O=a.map(B);let z,F,V;return t[21]!==T||t[22]!==L||t[23]!==O||t[24]!==M?(z=h.jsxs(T,{heading:"Commands",children:[M,L,O]}),t[21]=T,t[22]=L,t[23]=O,t[24]=M,t[25]=z):z=t[25],t[26]!==I||t[27]!==z||t[28]!==j||t[29]!==E?(F=h.jsxs(I,{children:[j,E,z]}),t[26]=I,t[27]=z,t[28]=j,t[29]=E,t[30]=F):F=t[30],t[31]!==S||t[32]!==e||t[33]!==n||t[34]!==F||t[35]!==k?(V=h.jsxs(S,{open:e,onOpenChange:n,children:[k,F]}),t[31]=S,t[32]=e,t[33]=n,t[34]=F,t[35]=k,t[36]=V):V=t[36],V};function qS(t){return!t.hotkey}function GS(t){return t.label}function YS(t){return!t}const Ma="https://static.marimo.app",JS=t=>{const e=X.c(24),{onClose:n}=t,[o,r]=A.useState("");let s;s=Math.random().toString(36).slice(2,6);const i=`${o}-${s}`,a=`${Ma}/static/${i}`;let l,c,d,u,f,p,_,g,m,b,x;return e[0]!==n||e[1]!==i?(l=async y=>{y.preventDefault(),n();const v=await XF({download:!1,includeCode:!0,files:yS.INSTANCE.filenames()}),S=lt({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${Ma}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:v,path:i})}).catch(()=>{S.dismiss(),lt({title:"Error uploading static page",description:h.jsxs("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",h.jsx("a",{href:Zn.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),S.dismiss(),lt({title:"Static page uploaded!",description:h.jsxs("div",{children:["The URL has been copied to your clipboard.",h.jsx("br",{}),"You can share it with anyone."]})})},e[0]=n,e[1]=i,e[2]=l):l=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx(dr,{children:"Share static notebook"}),e[3]=c):c=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(d=h.jsxs(Os,{children:[c,h.jsxs(Ps,{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"," ",h.jsx("a",{href:Ma,target:"_blank",children:Ma}),"."]})]}),e[4]=d):d=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(u=y=>{const v=y.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,"");r(v)},e[5]=u):u=e[5],e[6]!==o?(f=h.jsx(ur,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:u,required:!0,autoComplete:"off"}),e[6]=o,e[7]=f):f=e[7],e[8]!==a?(p=h.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:",h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(KS,{text:a}),h.jsx("span",{className:"text-primary",children:a})]})]}),e[8]=a,e[9]=p):p=e[9],e[10]!==f||e[11]!==p?(_=h.jsxs("div",{className:"flex flex-col gap-6 py-4",children:[f,p]}),e[10]=f,e[11]=p,e[12]=_):_=e[12],e[13]!==n?(g=h.jsx(Pe,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),e[13]=n,e[14]=g):g=e[14],e[15]!==a?(m=h.jsx(Pe,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await yn(a)},children:"Create"}),e[15]=a,e[16]=m):m=e[16],e[17]!==m||e[18]!==g?(b=h.jsxs(ea,{children:[g,m]}),e[17]=m,e[18]=g,e[19]=b):b=e[19],e[20]!==b||e[21]!==l||e[22]!==_?(x=h.jsx(cr,{className:"w-fit",children:h.jsxs("form",{onSubmit:l,children:[d,_,b]})}),e[20]=b,e[21]=l,e[22]=_,e[23]=x):x=e[23],x},KS=t=>{const e=X.c(8),[n,o]=K.useState(!1);let r;e[0]!==t.text?(r=Hn.stopPropagation(async c=>{c.preventDefault(),await yn(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=h.jsx(Ls,{size:14,strokeWidth:1.5}),e[2]=i):i=e[2],e[3]!==s?(a=h.jsx(Pe,{"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=h.jsx(Le,{content:"Copied!",open:n,children:a}),e[5]=n,e[6]=a,e[7]=l):l=e[7],l};function tg(){const t=X.c(3),{openConfirm:e}=Vn(),n=en(mo);let o;return t[0]!==e||t[1]!==n?(o=()=>{e({title:"Restart Kernel",description:"This will restart the Python kernel. You'll lose all data that's in memory. You will also lose any unsaved changes, so make sure to save your work before restarting.",variant:"destructive",confirmAction:h.jsx(L3,{onClick:async()=>{n({state:Ut.CLOSING}),await ZF(),QF()},"aria-label":"Confirm Restart",children:"Restart"})})},t[0]=e,t[1]=n,t[2]=o):o=t[2],o}const ud=[{type:"files",Icon:_m,tooltip:"View files",position:"sidebar"},{type:"variables",Icon:fc,tooltip:"Explore variables",position:"sidebar"},{type:"datasources",Icon:lr,tooltip:"Explore data sources",position:"sidebar"},{type:"dependencies",Icon:Na,tooltip:"Explore dependencies",position:"sidebar"},{type:"packages",Icon:ba,tooltip:"Manage packages",position:"sidebar"},{type:"outline",Icon:td,tooltip:"View outline",position:"sidebar"},{type:"chat",Icon:pc,tooltip:"Chat with AI",position:"sidebar"},{type:"documentation",Icon:nd,tooltip:"View live docs",position:"sidebar"},{type:"logs",Icon:fp,tooltip:"Notebook logs",position:"sidebar"},{type:"tracing",Icon:fH,tooltip:"Tracing",position:"sidebar"},{type:"snippets",Icon:zm,tooltip:"Snippets",position:"sidebar"},{type:"secrets",Icon:vm,tooltip:"Secrets",hidden:Un(),position:"sidebar"},{type:"scratchpad",Icon:ez,tooltip:"Scratchpad",position:"sidebar"},{type:"errors",Icon:ap,tooltip:"View errors",position:"footer"}];function ng(){const t=X.c(2),e=en(pp);let n;return t[0]!==e?(n=()=>{const o=document.getElementsByClassName("output-area"),r=window.innerHeight||document.documentElement.clientHeight;let s;s=null;for(const i of Array.from(o)){const a=i.getBoundingClientRect();if(a.top>=0&&a.top<=r||a.bottom>=0&&a.bottom<=r){s=Fs.parse(i.parentNode.id);break}}e(i=>({mode:tz(i.mode),cellAnchor:s})),requestAnimationFrame(()=>{var i;s!==null&&((i=document.getElementById(Fs.create(s)))==null||i.scrollIntoView())})},t[0]=e,t[1]=n):n=t[1],n}function yr(){return Ae.string().optional().describe(Je.of({label:"Password",inputType:"password",placeholder:"password",optionRegex:".*password.*"}))}function og(){return Ae.string().optional().describe(Je.of({label:"Token",inputType:"password",placeholder:"token",optionRegex:".*token.*"}))}function Oa(){return Ae.string().optional().describe(Je.of({label:"Warehouse Name",placeholder:"warehouse",optionRegex:".*warehouse.*"}))}function rg(){return Ae.string().optional().describe(Je.of({label:"URI",optionRegex:".*uri.*"}))}function xr(){return Ae.string().nonempty().describe(Je.of({label:"Host",placeholder:"localhost",optionRegex:".*host.*"}))}function _o(){return Ae.string().describe(Je.of({label:"Database",placeholder:"db name",optionRegex:".*database.*"}))}function wr(){return Ae.string().nonempty().describe(Je.of({label:"Username",placeholder:"username",optionRegex:".*username.*"}))}function vr(t){const e=Ae.coerce.string().describe(Je.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 sg(){return Ae.boolean().default(!1).describe(Je.of({label:"Read Only"}))}const ig=Ae.object({type:Ae.literal("postgres"),host:xr(),port:vr(5432).optional(),database:_o(),username:wr(),password:yr(),ssl:Ae.boolean().default(!1).describe(Je.of({label:"Use SSL"}))}).describe(Je.of({direction:"two-columns"})),ag=Ae.object({type:Ae.literal("mysql"),host:xr(),port:vr(3306),database:_o(),username:wr(),password:yr(),ssl:Ae.boolean().default(!1).describe(Je.of({label:"Use SSL"}))}).describe(Je.of({direction:"two-columns"})),lg=Ae.object({type:Ae.literal("sqlite"),database:_o().describe(Je.of({label:"Database Path"}))}).describe(Je.of({direction:"two-columns"})),cg=Ae.object({type:Ae.literal("duckdb"),database:_o().describe(Je.of({label:"Database Path"})),read_only:sg()}).describe(Je.of({direction:"two-columns"})),dg=Ae.object({type:Ae.literal("motherduck"),database:_o().default("my_db").describe(Je.of({label:"Database Name"})),token:og()}).describe(Je.of({direction:"two-columns"})),ug=Ae.object({type:Ae.literal("snowflake"),account:Ae.string().nonempty().describe(Je.of({label:"Account",optionRegex:".*snowflake.*"})),warehouse:Ae.string().optional().describe(Je.of({label:"Warehouse",optionRegex:".*snowflake.*"})),database:_o(),schema:Ae.string().optional().describe(Je.of({label:"Schema",optionRegex:".*snowflake.*"})),username:wr(),password:yr(),role:Ae.string().optional().describe(Je.of({label:"Role"}))}).describe(Je.of({direction:"two-columns"})),hg=Ae.object({type:Ae.literal("bigquery"),project:Ae.string().nonempty().describe(Je.of({label:"Project ID",optionRegex:".*bigquery.*"})),dataset:Ae.string().nonempty().describe(Je.of({label:"Dataset",optionRegex:".*bigquery.*"})),credentials_json:Ae.string().describe(Je.of({label:"Credentials JSON",inputType:"textarea"}))}).describe(Je.of({direction:"two-columns"})),fg=Ae.object({type:Ae.literal("clickhouse_connect"),host:xr(),port:vr(8123).optional(),username:wr(),password:yr(),secure:Ae.boolean().default(!1).describe(Je.of({label:"Use HTTPs"}))}).describe(Je.of({direction:"two-columns"})),pg=Ae.object({type:Ae.literal("timeplus"),host:xr().default("localhost"),port:vr(8123).optional(),username:wr().default("default"),password:yr().default("")}).describe(Je.of({direction:"two-columns"})),mg=Ae.object({type:Ae.literal("chdb"),database:_o().describe(Je.of({label:"Database Path"})),read_only:sg()}).describe(Je.of({direction:"two-columns"})),gg=Ae.object({type:Ae.literal("trino"),host:xr(),port:vr(8080),database:_o(),schema:Ae.string().describe(Je.of({label:"Schema",placeholder:"schema name",optionRegex:".*schema.*"})).optional(),username:wr(),password:yr(),async_support:Ae.boolean().default(!1).describe(Je.of({label:"Async Support"}))}).describe(Je.of({direction:"two-columns"})),_g=Ae.object({type:Ae.literal("iceberg"),name:Ae.string().describe(Je.of({label:"Catalog Name"})),catalog:Ae.discriminatedUnion("type",[Ae.object({type:Ae.literal("REST"),warehouse:Oa(),uri:Ae.string().optional().describe(Je.of({label:"URI",placeholder:"https://",optionRegex:".*uri.*"})),token:og()}),Ae.object({type:Ae.literal("SQL"),warehouse:Oa(),uri:Ae.string().optional().describe(Je.of({label:"URI",placeholder:"jdbc:iceberg://host:port/database",optionRegex:".*uri.*"}))}),Ae.object({type:Ae.literal("Hive"),warehouse:Oa(),uri:rg()}),Ae.object({type:Ae.literal("Glue"),warehouse:Oa(),uri:rg()}),Ae.object({type:Ae.literal("DynamoDB"),"dynamodb.profile-name":Ae.string().optional().describe(Je.of({label:"Profile Name"})),"dynamodb.region":Ae.string().optional().describe(Je.of({label:"Region"})),"dynamodb.access-key-id":Ae.string().optional().describe(Je.of({label:"Access Key ID"})),"dynamodb.secret-access-key":Ae.string().optional().describe(Je.of({label:"Secret Access Key",inputType:"password"})),"dynamodb.session-token":Ae.string().optional().describe(Je.of({label:"Session Token",inputType:"password"}))})]).default({type:"REST"}).describe(Je.of({special:"tabs"}))}),bg=Ae.object({type:Ae.literal("datafusion"),sessionContext:Ae.boolean().optional().describe(Je.of({label:"Use Session Context"}))}),yg=Ae.object({type:Ae.literal("pyspark"),host:xr().optional(),port:vr().optional()}),xg=Ae.object({type:Ae.literal("redshift"),host:xr(),port:vr(5439),connectionType:Ae.discriminatedUnion("type",[Ae.object({type:Ae.literal("IAM credentials"),region:Ae.string().describe(Je.of({label:"Region"})),aws_access_key_id:Ae.string().nonempty().describe(Je.of({label:"AWS Access Key ID",inputType:"password",optionRegex:".*aws_access_key_id.*"})),aws_secret_access_key:Ae.string().nonempty().describe(Je.of({label:"AWS Secret Access Key",inputType:"password",optionRegex:".*aws_secret_access_key.*"})),aws_session_token:Ae.string().optional().describe(Je.of({label:"AWS Session Token",inputType:"password",optionRegex:".*aws_session_token.*"}))}),Ae.object({type:Ae.literal("DB credentials"),user:wr(),password:yr()})]).default({type:"IAM credentials",aws_access_key_id:"",aws_secret_access_key:"",region:""}),database:_o()}).describe(Je.of({direction:"two-columns"})),XS=Ae.discriminatedUnion("type",[ig,ag,lg,cg,dg,ug,hg,fg,pg,mg,gg,_g,bg,yg,xg]),hd="env:";function Da(t){return typeof t=="string"&&t.startsWith(hd)}function fd(t){return`${hd}${t}`}const wg={sqlmodel:"SQLModel",sqlalchemy:"SQLAlchemy",duckdb:"DuckDB",clickhouse_connect:"ClickHouse Connect",chdb:"chDB",pyiceberg:"PyIceberg",ibis:"Ibis",motherduck:"MotherDuck",redshift:"Redshift"};class an{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 ZS{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),Da(n)){const r=n.replace(hd,""),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"?Br(n):n?`"${n}"`:""}printInFString(e,n,o){if(n===void 0)return"";if(typeof n=="number")return`${n}`;if(typeof n=="boolean")return Br(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 Da(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-CCC85gHU.js","./index-Bcj9kkXB.js","./index-DRNyeN7N.css","./compile-BDFZd4zv.js","./time-MgirAGPx.js","./timer-DFzT7np-.js","./linear-BKpOmUoG.js","./init-DLRA0X12.js","./range-CtcPcB_L.js","./zoom-COrs4lFh.js","./ordinal-DDUp3AbE.js","./colors-bszWmPJw.js","./arc-Cuwikxov.js","./step-BwsUM5iJ.js","./panels-DAkKInWX.js","./index-CKM1O6QU.js","./index-CvNTW1vD.js","./index-B3y5pbE_.js","./index-DkL_a1PU.js","./index-CcgJXYZO.js","./index-BoJWHgn7.js","./index-Ds115XG0.js","./index-B3PLapRH.js","./index-DZhv-Mtf.js","./index-Bz4-4V9L.js","./index-CJP7YMJ_.js","./index-D7VOb7xY.js","./index-jREeNvDK.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-CHJ5qNM_.js","./ebnf-B-Df8AvO.js","./ecl-DPFc0Uaf.js","./eiffel-DR5c0IrL.js","./elm-D7xaZ7Da.js","./erlang-BuqgqA5h.js","./factor-CFXhaUWb.js","./fcl-CVaBTCzQ.js","./forth-Dri_5nFc.js","./fortran-DL7KluxX.js","./gas-5kEe4nk0.js","./gherkin-B6X1vGSW.js","./groovy-DnIzCrpZ.js","./haskell-CmdsSjFB.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-FFvkTduk.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-OdhglgkO.js","./swift-B_XXVlXX.js","./tcl-B2fODqDH.js","./textile-BuVhTOzU.js","./tiddlywiki-BgR6AEZu.js","./tiki-CI-ztowC.js","./toml-BQXy8elZ.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","./panels-DcAzAz16.css","./tree-CKqD-3bk.js","./index-B3-yDiVQ.js","./tree-C1rhMrxo.css","./circle-play-BNa7rLWp.js","./_createAggregator-B_y4dREW.js","./_baseEach-DZqw6cVR.js","./transform-Cyp0GDF-.js","./sortBy-C909I68-.js","./_baseMap-DfoqOFse.js","./terminal-Du7pUi4V.js","./terminal-WqMRJt5Z.css"])))=>i.map(i=>d[i]);
2
+ var wF=Object.defineProperty;var g3=Ft=>{throw TypeError(Ft)};var vF=(Ft,Et,mn)=>Et in Ft?wF(Ft,Et,{enumerable:!0,configurable:!0,writable:!0,value:mn}):Ft[Et]=mn;var ee=(Ft,Et,mn)=>vF(Ft,typeof Et!="symbol"?Et+"":Et,mn),kF=(Ft,Et,mn)=>Et.has(Ft)||g3("Cannot "+mn);var _3=(Ft,Et,mn)=>(kF(Ft,Et,"read from private field"),mn?mn.call(Ft):Et.get(Ft)),b3=(Ft,Et,mn)=>Et.has(Ft)?g3("Cannot add the same private member more than once"):Et instanceof WeakSet?Et.add(Ft):Et.set(Ft,mn);import{u as Fe,Q as A,i9 as SF,ia as CF,ib as y3,ic as NF,id as jF,ie as EF,R as K,ig as IF,ih as Mr,ii as AF,ij as Kf,ik as x3,il as TF,im as MF,io as w3,ip as oc,d as X,as as Un,iq as Xf,j as h,dt as Zf,du as v3,dv as OF,dx as Qf,dz as ep,f7 as rc,ir as tp,dr as np,ds as op,dw as rp,is as DF,it as k3,eh as S3,bp as et,a8 as Lt,iu as RF,dV as fo,iv as C3,iw as N3,ix as sp,iy as j3,iz as PF,L as Zt,_ as Qt,aF as E3,cD as ip,W as Pe,iA as LF,ei as dt,iB as I3,em as sc,iC as FF,ao as lt,iD as ic,Z as We,a_ as Vn,a0 as en,iE as ac,iF as Ts,e5 as Ms,iG as zF,iH as Xi,iI as BF,ef as UF,iJ as A3,iK as T3,dN as VF,a7 as ap,iL as ar,iM as Or,aJ as lc,aL as lr,iN as HF,iO as cc,iP as M3,a5 as Zi,eE as O3,a6 as dc,iQ as $F,an as yn,iR as lp,iS as Dr,aj as cr,ak as Os,al as dr,bg as Rr,U as Fo,e6 as Ds,gn as D3,fP as Rs,gq as WF,b2 as fn,iT as qF,iU as GF,fN as cp,aI as uc,iV as dp,iW as YF,iX as R3,iY as up,iZ as JF,i_ as KF,i$ as po,j0 as P3,fT as hp,j1 as Qi,j2 as hc,e0 as XF,ae as Zn,am as Ps,be as ur,j3 as ea,bt as Hn,ap as Ls,a4 as Le,f4 as mo,b7 as L3,ep as Ut,j4 as ZF,eR as QF,dA as fc,j5 as pc,aN as fp,j6 as ez,eo as pp,ec as Fs,j7 as tz,j8 as mp,bj as jn,j9 as nz,dT as Ae,ja as Je,jb as gp,jc as St,jd as F3,je as oz,fu as _p,aE as En,aT as $n,ga as z3,gb as B3,gc as rz,gg as sz,gd as U3,V as Oe,dM as iz,aG as mc,aR as gc,aH as _c,aO as sn,eg as zo,jf as az,ge as V3,jg as lz,g5 as H3,g7 as $3,jh as zs,ji as W3,jj as cz,jk as dz,ai as uz,ah as hz,eb as ta,af as bp,jl as na,jm as bc,jn as fz,jo as pz,jp as q3,jq as pn,fS as G3,dO as yc,ba as mz,jr as gz,ar as yp,aK as _z,js as bz,gr as Y3,b6 as xc,jt as xp,aq as oa,e1 as J3,ju as yz,ag as xz,jv as K3,jw as wz,jx as vz,jy as kz,jz as Sz,jA as Cz,jB as Nz,dp as Bo,jC as wc,jD as Bs,o as Uo,n as st,fx as Qn,jE as In,jF as ut,jG as Us,jH as Vt,fO as Gt,jI as wp,dS as go,jJ as jz,jK as Ez,b4 as X3,b5 as Z3,jL as Q3,jM as Iz,gu as Vs,jN as vc,b1 as kc,gt as Pr,jO as e4,jP as ra,ej as vp,jQ as Az,jR as Tz,jS as Mz,jT as Oz,jU as t4,jV as Dz,jW as n4,jX as o4,jY as Rz,jZ as r4,j_ as s4,ek as Sc,j$ as Pz,bq as Lz,k0 as Fz,fw as Wn,k1 as zz,k2 as Bz,k3 as Hs,k4 as Cc,k5 as $s,fH as Vo,k6 as kp,k7 as sa,k8 as ia,k9 as aa,ka as Uz,fm as Nc,kb as Sp,kc as i4,kd as jc,eQ as Vz,fn as Hz,r as $z,ke as Wz,kf as qz,kg as a4,t as D,kh as Gz,ki as Yz,kj as Cp,f_ as la,kk as l4,fA as Jz,fr as c4,kl as d4,km as Kz,kn as Xz,ko as Zz,kp as Qz,kq as eB,kr as tB,ks as nB,kt as oB,ku as rB,kv as sB,kw as iB,kx as aB,ky as lB,kz as cB,kA as dB,kB as uB,kC as hB,kD as fB,kE as pB,kF as mB,kG as ca,kH as gB,kI as _B,kJ as bB,kK as yB,kL as xB,kM as wB,kN as u4,kO as vB,kP as kB,kQ as SB,kR as h4,kS as CB,kT as NB,kU as f4,kV as jB,kW as Ws,kX as qn,kY as EB,kZ as IB,k_ as AB,k$ as TB,l0 as MB,l1 as OB,l2 as DB,l3 as RB,l4 as PB,l5 as LB,l6 as hr,l7 as FB,l8 as zB,l9 as BB,la as UB,eq as VB,lb as HB,lc as p4,eu as $B,ld as Ec,le as WB,lf as qB,lg as GB,lh as YB,X as Lr,li as Ic,et as JB,lj as Np,lk as Ac,ll as da,lm as ua,ln as Tc,lo as fr,lp as m4,lq as Ho,lr as qs,ls as jp,lt as ha,lu as Gs,lv as Ep,lw as Ip,lx as g4,ly as Mc,lz as KB,S as fa,lA as pa,lB as XB,eP as Oc,lC as ZB,lD as Ap,lE as QB,lF as eU,lG as Dc,lH as tU,lI as nU,lJ as _4,lK as Tp,gs as Ys,lL as oU,lM as rU,lN as sU,lO as iU,fF as aU,bd as lU,gv as jt,lP as ma,lQ as Js,lR as cU,lS as dU,lT as Mp,lU as uU,cn as Op,lV as hU,b3 as b4,lW as fU,lX as pU,lY as Rc,lZ as y4,eJ as Dp,bf as x4,$ as Rp,l_ as w4,l$ as mU,m0 as gU,m1 as Pp,m2 as Lp,m3 as _U,m4 as v4,m5 as k4,m6 as ga,fq as bU,ab as S4,ft as yU,e3 as xU,m7 as C4,m8 as wU,m9 as vU,ma as N4,mb as kU,mc as SU,md as j4,me as E4,mf as CU,bh as I4,mg as NU,mh as Fp,ea as jU,mi as $o,dK as A4,mj as T4,ee as M4,fg as zp,mk as Bp,ml as O4,bv as Up,dL as Pc,mm as D4,mn as EU,mo as IU,mp as AU,bc as Lc,mq as R4,f9 as Vp,g6 as TU,g8 as MU,gf as Hp,gi as OU,mr as DU,ms as $p,mt as RU,mu as PU,mv as LU,mw as FU,mx as zU,my as BU,mz as UU,mA as VU,a9 as HU,mB as Fc,aa as $U,mC as P4,mD as WU,f5 as qU,mE as L4,a$ as eo,fk as GU,dC as YU,mF as JU,mG as F4,mH as KU,eO as XU,mI as ZU,mJ as QU,e4 as eV,mK as tV,mL as nV,a2 as zc,mM as oV,a3 as pr,dF as z4,mN as Wp,mO as rV,en as B4,mP as sV,mQ as U4,mR as iV,mS as aV,mT as lV,mU as cV,mV as dV,mW as uV,mX as V4,g1 as qp,f$ as Gp,fW as Ks,g0 as Fr,mY as H4,g2 as Yp,fX as zr,dW as hV,mZ as Jp,m_ as fV,a1 as pV,m$ as mV,fG as $4,E as Xs,n0 as gV,n1 as _V,n2 as bV,n3 as yV,n4 as _a,n5 as xV,n6 as wV,n7 as vV,n8 as kV,n9 as SV,na as W4,nb as CV,fv as NV,nc as jV,nd as EV,ne as IV,nf as AV,gh as TV,ng as MV,nh as q4,ni as OV,nj as DV,nk as G4,nl as Y4,nm as J4,f3 as K4,nn as RV,no as PV,np as X4,nq as Z4,nr as Bc,ns as Q4,nt as LV,nu as eS,nv as FV,nw as zV,nx as tS,ny as BV,nz as UV,nA as VV,C as nS,nB as HV,nC as $V,nD as WV,nE as mr,nF as oS,dU as qV,fY as GV,nG as rS,fZ as sS,nH as YV,nI as Zs,nJ as JV,nK as Uc,nL as KV,nM as XV,y as iS,nN as ZV,di as QV,nO as eH,nP as tH,nQ as nH,nR as oH,nS as rH,eW as sH,b0 as iH,aZ as aH,at as Vc,nT as aS,nU as lS,av as cS,au as lH,e8 as cH,__tla as dH}from"./index-Bcj9kkXB.js";import{G as uH,L as dS,g as hH,b as ba,A as fH,s as pH,k as mH,B as uS,a as gH,M as _H,Y as bH,c as xn,u as ya,C as yH,S as xH,K as wH,d as vH,i as kH,e as hS,f as SH,h as CH,j as NH,l as xa,P as Kp,m as fS,n as jH,o as EH,p as Xp,T as IH}from"./tree-CKqD-3bk.js";import{d as pS,e as mS,L as gS,f as Qs,I as Zp,g as AH,h as _S,N as bS,V as yS,S as xS,F as wS,i as vS,M as TH,l as kS,j as MH,E as SS,k as OH,m as Qp,n as DH,o as RH,p as PH,q as LH,s as FH,t as zH,v as BH,w as UH,x as VH,a as HH,C as $H,R as CS,b as WH,A as qH,y as GH,z as YH,O as JH,T as KH,B as XH,D as ZH,c as QH,P as e$,__tla as t$}from"./panels-DAkKInWX.js";import{c as n$}from"./_createAggregator-B_y4dREW.js";import{s as to,i as gr,T as em,a as tm}from"./transform-Cyp0GDF-.js";import{g as NS}from"./timer-DFzT7np-.js";import{i as o$}from"./zoom-COrs4lFh.js";import{s as wa}from"./sortBy-C909I68-.js";let nm,Hc,An,$c,jS,va,om,r$=Promise.all([(()=>{try{return dH}catch{}})(),(()=>{try{return t$}catch{}})()]).then(async()=>{var ec,m3;var Ft=n$(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});let Et,mn,rm,Wc,ei,ti,sm,im,am,lm,ka,qc,cm,Sa,dm,Gc,um,hm,Yc,fm,pm,mm,Ca,gm,Jc,_m,bm,ym,xm,wm,vm,Kc,km,Xc,Sm,Cm,Nm,jm,Em,Na,Im,Am,Zc,Tm,Mm,Om,Qc,Dm,Rm,Pm,ja,ed,td,Lm,Fm,zm,Bm,Um,Vm,Hm,$m,Wm,nd,od,qm,Gm,Ym,Ea,_r,br;Et=Fe("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),mn=Fe("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"}]]),rm=Fe("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"}]]),Wc=Fe("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),ei=Fe("ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]),ti=Fe("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"}]]),sm=Fe("chevrons-down",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]),im=Fe("chevrons-up",[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]]),$c=Fe("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),am=Fe("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),lm=Fe("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),ka=Fe("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),qc=Fe("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"}]]),cm=Fe("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"}]]),Sa=Fe("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"}]]),dm=Fe("code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]),Gc=Fe("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"}]]),um=Fe("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"}]]),hm=Fe("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"}]]),Yc=Fe("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"}]]),fm=Fe("eraser",[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]]),pm=Fe("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"}]]),mm=Fe("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"}]]),Ca=Fe("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"}]]),gm=Fe("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"}]]),Jc=Fe("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"}]]),_m=Fe("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"}]]),bm=Fe("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"}]]),ym=Fe("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"}]]),xm=Fe("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"}]]),wm=Fe("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"}]]),vm=Fe("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"}]]),Kc=Fe("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"}]]),km=Fe("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"}]]),Xc=Fe("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"}]]),Sm=Fe("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"}]]),Cm=Fe("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"}]]),Nm=Fe("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"}]]),jm=Fe("message-circle-question",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Em=Fe("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"}]]),Na=Fe("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"}]]),Im=Fe("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"}]]),Am=Fe("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"}]]),Zc=Fe("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"}]]),Tm=Fe("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Mm=Fe("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"}]]),Om=Fe("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"}]]),Qc=Fe("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"}]]),Dm=Fe("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"}]]),Rm=Fe("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"}]]),Pm=Fe("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"}]]),ja=Fe("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"}]]),ed=Fe("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"}]]),td=Fe("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"}]]),Lm=Fe("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"}]]),Fm=Fe("square-code",[["path",{d:"M10 9.5 8 12l2 2.5",key:"3mjy60"}],["path",{d:"m14 9.5 2 2.5-2 2.5",key:"1bir2l"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),zm=Fe("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"}]]),Bm=Fe("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"}]]),Um=Fe("square-m",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 16V8l4 4 4-4v8",key:"141u4e"}]]),Vm=Fe("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"}]]),Hm=Fe("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"}]]),$m=Fe("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"}]]),Wm=Fe("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"}]]),nd=Fe("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"}]]),od=Fe("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"}]]),qm=Fe("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]),Gm=Fe("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"}]]),Ym=Fe("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"}]]),Ea=Fe("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"}]]),_r=Fe("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"}]]),br=Fe("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);const ES=A.createContext({}),IS=A.forwardRef(function(t,e){[t,e]=jF(t,e,ES);let{toolbarProps:n}=function(s,i){const{"aria-label":a,"aria-labelledby":l,orientation:c="horizontal"}=s;let[d,u]=A.useState(!1);SF(()=>{var m;u(!(!i.current||!(!((m=i.current.parentElement)===null||m===void 0)&&m.closest('[role="toolbar"]'))))});const{direction:f}=CF(),p=f==="rtl"&&c==="horizontal";let _=NF(i);const g=A.useRef(null);return{toolbarProps:{...y3(s,{labelable:!0}),role:d?"group":"toolbar","aria-orientation":c,"aria-label":a,"aria-labelledby":a==null?l:void 0,onKeyDownCapture:d?void 0:m=>{if(m.currentTarget.contains(m.target)){if(c==="horizontal"&&m.key==="ArrowRight"||c==="vertical"&&m.key==="ArrowDown")p?_.focusPrevious():_.focusNext();else{if(!(c==="horizontal"&&m.key==="ArrowLeft"||c==="vertical"&&m.key==="ArrowUp"))return m.key==="Tab"?(m.stopPropagation(),g.current=document.activeElement,void(m.shiftKey?_.focusFirst():_.focusLast())):void 0;p?_.focusNext():_.focusPrevious()}m.stopPropagation(),m.preventDefault()}},onFocusCapture:d?void 0:m=>{var b,x;g.current&&!m.currentTarget.contains(m.relatedTarget)&&(!((b=i.current)===null||b===void 0)&&b.contains(m.target))&&((x=g.current)===null||x===void 0||x.focus(),g.current=null)},onBlurCapture:d?void 0:m=>{m.currentTarget.contains(m.relatedTarget)||g.current||(g.current=m.target)}}}}(t,e),o=EF({...t,values:{orientation:t.orientation||"horizontal"},defaultClassName:"react-aria-Toolbar"}),r=y3(t);return delete r.id,K.createElement("div",{...IF(n,r),...o,ref:e,slot:t.slot||void 0,"data-orientation":t.orientation||"horizontal"},o.children)});function Ia(t,e){const n=+Mr(t)-+Mr(e);return n<0?-1:n>0?1:n}function AS(t,e){const n=Mr(t,e==null?void 0:e.in);return+function(o,r){const s=Mr(o,r==null?void 0:r.in);return s.setHours(23,59,59,999),s}(n,e)==+function(o,r){const s=Mr(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 TS(t,e,n){const[o,r,s]=Kf(n==null?void 0:n.in,t,t,e),i=Ia(r,s),a=Math.abs(function(d,u,f){const[p,_]=Kf(f==null?void 0:f.in,d,u);return 12*(p.getFullYear()-_.getFullYear())+(p.getMonth()-_.getMonth())}(r,s));if(a<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-i*a);let l=Ia(r,s)===-i;AS(o)&&a===1&&Ia(o,s)===1&&(l=!1);const c=i*(a-+l);return c===0?0:c}function MS(t,e,n){const o=function(r,s){return+Mr(r)-+Mr(s)}(t,e)/1e3;return(r=>{const s=(0,Math.trunc)(r);return s===0?0:s})(o)}function OS(t,e){return function(n,o,r){const s=TF(),i=(r==null?void 0:r.locale)??s.locale??MF,a=Ia(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]=Kf(r==null?void 0:r.in,...a>0?[o,n]:[n,o]),u=MS(d,c),f=(x3(d)-x3(c))/1e3,p=Math.round((u-f)/60);let _;if(p<2)return p===0?i.formatDistance("lessThanXMinutes",1,l):i.formatDistance("xMinutes",p,l);if(p<45)return i.formatDistance("xMinutes",p,l);if(p<90)return i.formatDistance("aboutXHours",1,l);if(p<w3){const g=Math.round(p/60);return i.formatDistance("aboutXHours",g,l)}if(p<2520)return i.formatDistance("xDays",1,l);if(p<oc){const g=Math.round(p/w3);return i.formatDistance("xDays",g,l)}if(p<2*oc)return _=Math.round(p/oc),i.formatDistance("aboutXMonths",_,l);if(_=TS(d,c),_<12){const g=Math.round(p/oc);return i.formatDistance("xMonths",g,l)}{const g=_%12,m=Math.trunc(_/12);return g<3?i.formatDistance("aboutXYears",m,l):g<9?i.formatDistance("overXYears",m,l):i.formatDistance("almostXYears",m+1,l)}}(t,function(n){return AF(n,Date.now())}(t),e)}const DS=()=>{const t=X.c(7),{selectedLayout:e}=pS(),{setLayoutView:n}=mS();if(Un()&&!Xf("wasm_layouts"))return null;let o,r,s,i;return t[0]!==n?(o=a=>n(a),t[0]=n,t[1]=o):o=t[1],t[2]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsx(np,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:h.jsx(op,{placeholder:"Select a view"})}),t[2]=r):r=t[2],t[3]===Symbol.for("react.memo_cache_sentinel")?(s=h.jsx(Zf,{children:h.jsxs(v3,{children:[h.jsx(OF,{children:"View as"}),gS.map(PS)]})}),t[3]=s):s=t[3],t[4]!==e||t[5]!==o?(i=h.jsxs(rp,{"data-testid":"layout-select",value:e,onValueChange:o,children:[r,s]}),t[4]=e,t[5]=o,t[6]=i):i=t[6],i};function RS(t){const e=Jm(t);return h.jsx(e,{className:"h-4 w-4"})}function Jm(t){switch(t){case"vertical":return Sm;case"grid":return uH;case"slides":return Qc;default:return rc(t),tp}}function Km(t){return ep(t)}function PS(t){return h.jsx(Qf,{value:t,children:h.jsxs("div",{className:"flex items-center gap-1.5 leading-5",children:[RS(t),h.jsx("span",{children:Km(t)})]})},t)}function LS(){const t=X.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=X.c(11);let c;l[0]!==a?(c=new DF(a),l[0]=a,l[1]=c):c=l[1];const d=c;let u;l[2]!==i||l[3]!==d?(u=()=>d.get(i),l[2]=i,l[3]=d,l[4]=u):u=l[4];const[f,p]=A.useState(u);let _;l[5]!==i||l[6]!==d?(_=b=>{p(b),d.set(i,b)},l[5]=i,l[6]=d,l[7]=_):_=l[7];const g=_;let m;return l[8]!==g||l[9]!==f?(m=[f,g],l[8]=g,l[9]=f,l[10]=m):m=l[10],m}("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 Xm(t){return t.dropdown!==void 0}function Aa(t,e=""){return t.flatMap(n=>n.label?Xm(n)?Aa(n.dropdown,`${e+n.label} > `):{...n,label:e+n.label}:[])}const ni=t=>{const e=X.c(8),{children:n,layerTop:o}=t,r=o!==void 0&&o;let s;e[0]!==n?(s=K.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=h.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=h.jsxs("div",{className:"multi-icon relative w-fit",children:[i,c]}),e[5]=i,e[6]=c,e[7]=d):d=e[7],d};function rd(t){const e=X.c(3),n=sd();let o;return e[0]!==t||e[1]!==n?(o=()=>{t!==void 0&&n([t])},e[0]=t,e[1]=n,e[2]=o):o=e[2],et(o)}function Zm(){const t=X.c(2),e=sd();let n;return t[0]!==e?(n=()=>e(C3(fo())),t[0]=e,t[1]=n):n=t[1],et(n)}function sd(){const t=X.c(2),{prepareForRun:e}=Lt();let n;return t[0]!==e?(n=async o=>{var a;if(o.length===0)return;const{cellHandles:r,cellData:s}=fo(),i=[];for(const l of o){const c=r[l],d=(a=c.current)==null?void 0:a.editorView;let u;d?(N3(d)!=="markdown"&&sp(d),u=j3(d)):u=s[l].code,i.push(u),e({cellId:l})}await PF({cellIds:o,codes:i}).catch(FS)},t[0]=e,t[1]=n):n=t[1],et(n)}function FS(t){Zt.error(t)}const Ta=Qt(null),zS=Qt(!1),id=E3("marimo:ai:chatState:v2",{chats:[],activeChatId:null}),BS=Qt(t=>{const e=t(id);return e.chats.find(n=>n.id===e.activeChatId)},(t,e,n)=>{e(id,o=>({...o,activeChatId:n}))}),ad=t=>{const e=X.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],ip(window,"keydown",n,o);const r=t.children??"Undo";let s,i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(s=h.jsx(LF,{className:"ml-2",shortcut:"cmd-z"}),e[3]=s):s=e[3],e[4]!==r||e[5]!==t?(i=h.jsxs(Pe,{"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 ld(){const t=X.c(3),{deleteCell:e,undoDeleteCell:n}=Lt();let o;return t[0]!==e||t[1]!==n?(o=r=>{var l;if(dt.get(I3))return;const{cellId:s}=r,i=dt.get(sc),a=(((l=i.cellData[s])==null?void 0:l.code)??"").trim()==="";if(e({cellId:s}),FF({cellId:s}).catch(()=>{n()}),!a){const{dismiss:c}=lt({title:"Cell deleted",description:"You can bring it back by clicking undo or through the command palette.",action:h.jsx(ad,{"data-testid":"undo-delete-button",onClick:()=>{n(),d()}})}),d=c}},t[0]=e,t[1]=n,t[2]=o):o=t[2],et(o)}function Qm(){const t=X.c(3),{splitCell:e,undoSplitCell:n}=Lt();let o;return t[0]!==e||t[1]!==n?(o=r=>{const s=ic(r.cellId);if(!s)return;const i=j3(s);e(r);const{dismiss:a}=lt({title:"Cell split",action:h.jsx(ad,{"data-testid":"undo-split-button",size:"sm",variant:"outline",onClick:()=>{n({...r,snapshot:i}),l()},children:"Undo"})}),l=a},t[0]=e,t[1]=n,t[2]=o):o=t[2],et(o)}function cd(t){const e=X.c(49),{cell:n}=t,{createNewCell:o,updateCellConfig:r,updateCellName:s,moveCell:i,sendToTop:a,sendToBottom:l,addColumnBreakpoint:c,clearCellOutput:d}=Lt(),u=Qm(),f=rd(n==null?void 0:n.cellId),p=!We(I3),_=ld(),{openModal:g}=Vn(),m=en(Ta),b=We(ac),x=We(Ts),y=We(Ms),v=We(zF);if(!n||y){let N;return e[0]===Symbol.for("react.memo_cache_sentinel")?(N=[],e[0]=N):N=e[0],N}const{cellId:S,config:k,getEditorView:I,name:j,hasOutput:E,hasConsoleOutput:T,status:M}=n;let L;e[1]!==S||e[2]!==k.disabled||e[3]!==r?(L=async()=>{const N={disabled:!k.disabled};await Dr({configs:{[S]:N}}),r({cellId:S,config:N})},e[1]=S,e[2]=k.disabled,e[3]=r,e[4]=L):L=e[4];const B=L;let O;e[5]!==S||e[6]!==k.hide_code||e[7]!==I||e[8]!==r?(O=async()=>{const N={hide_code:!k.hide_code};await Dr({configs:{[S]:N}}),r({cellId:S,config:N});const $=I();$&&(N.hide_code?$.contentDOM.blur():$.focus())},e[5]=S,e[6]=k.hide_code,e[7]=I,e[8]=r,e[9]=O):O=e[9];const z=O;let F,V,P,C,H;return e[10]===Symbol.for("react.memo_cache_sentinel")?(F=h.jsx(Wm,{size:13,strokeWidth:1.5}),e[10]=F):F=e[10],e[11]!==S||e[12]!==j||e[13]!==g||e[14]!==s?(V=()=>{g(h.jsxs(cr,{children:[h.jsx(Os,{children:h.jsx(dr,{children:"Rename cell"})}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx(Rr,{htmlFor:"cell-name",children:"Cell name"}),h.jsx(bS,{placeholder:"cell name",value:j,onKeyDown:N=>{N.key==="Enter"&&(N.preventDefault(),N.stopPropagation(),g(null))},onChange:N=>s({cellId:S,name:N})})]})]}))},e[11]=S,e[12]=j,e[13]=g,e[14]=s,e[15]=V):V=e[15],e[16]!==S||e[17]!==s?(P=N=>s({cellId:S,name:N}),e[16]=S,e[17]=s,e[18]=P):P=e[18],e[19]!==j||e[20]!==P?(C=h.jsx(bS,{placeholder:"cell name",value:j,onChange:P}),e[19]=j,e[20]=P,e[21]=C):C=e[21],e[22]!==c||e[23]!==b||e[24]!==v||e[25]!==x||e[26]!==p||e[27]!==S||e[28]!==d||e[29]!==k.disabled||e[30]!==k.hide_code||e[31]!==o||e[32]!==_||e[33]!==I||e[34]!==T||e[35]!==E||e[36]!==i||e[37]!==j||e[38]!==f||e[39]!==l||e[40]!==a||e[41]!==m||e[42]!==u||e[43]!==M||e[44]!==V||e[45]!==C||e[46]!==B||e[47]!==z?(H=[[{icon:F,label:"Name",disableClick:!0,handle:$S,handleHeadless:V,rightElement:C},{icon:h.jsx(Qs,{size:13,strokeWidth:1.5}),label:"Run cell",hotkey:"cell.run",hidden:M==="running"||M==="queued"||M==="disabled-transitively"||k.disabled,handle:()=>f()},{icon:h.jsx(Xi,{size:13,strokeWidth:1.5}),label:"AI completion",hidden:!b,handle:()=>{m(N=>(N==null?void 0:N.cellId)===S?null:{cellId:S})},hotkey:"cell.aiCompletion"},{icon:h.jsx(ed,{size:13,strokeWidth:1.5}),label:"Split cell",hotkey:"cell.splitCell",handle:()=>u({cellId:S})},{icon:h.jsx(Zp,{size:13,strokeWidth:1.5}),label:"Export output as PNG",hidden:!E,handle:()=>function(N){const $=document.getElementById(k3.create(N));$&&($.classList.add("printing-output"),S3($,"result.png").finally(()=>{$.classList.remove("printing-output")}))}(S)},{icon:h.jsx(UF,{size:13,strokeWidth:1.5}),label:"Format cell",hotkey:"cell.format",handle:()=>{const N=I();N&&BF({[S]:N})}},{icon:k.hide_code?h.jsx(A3,{size:13,strokeWidth:1.5}):h.jsx(T3,{size:13,strokeWidth:1.5}),label:k.hide_code?"Show code":"Hide code",handle:z,hotkey:"cell.hideCode"},{icon:k.disabled?h.jsx(_r,{size:13,strokeWidth:1.5}):h.jsx(br,{size:13,strokeWidth:1.5}),label:"Reactive execution",rightElement:h.jsx(VF,{"data-testid":"cell-disable-switch",checked:!k.disabled,size:"sm",onCheckedChange:B}),handle:B},{icon:h.jsx(ap,{size:13,strokeWidth:1.5}),label:"Clear output",hidden:!(E||T),handle:()=>{d({cellId:S})}}],[{icon:h.jsx(lc,{}),label:"Convert to Markdown",hotkey:"cell.viewAsMarkdown",handle:()=>{const N=I();N&&(ar(x,o),Or(N,"markdown",{keepCodeAsIs:!1}))}},{icon:h.jsx(lr,{size:13,strokeWidth:1.5}),label:"Convert to SQL",handle:()=>{const N=I();N&&(ar(x,o),Or(N,"sql",{keepCodeAsIs:!1}))}},{icon:h.jsx(cc,{}),label:"Toggle as Python",handle:()=>{const N=I();N&&(ar(x,o),HF(N,"python",{force:!0}))}}],[{icon:h.jsxs(ni,{children:[h.jsx(ka,{size:13,strokeWidth:1.5}),h.jsx(M3,{size:8,strokeWidth:2})]}),label:"Create cell above",hotkey:"cell.createAbove",handle:()=>o({cellId:S,before:!0})},{icon:h.jsxs(ni,{children:[h.jsx(ka,{size:13,strokeWidth:1.5}),h.jsx(Zi,{size:8,strokeWidth:2})]}),label:"Create cell below",hotkey:"cell.createBelow",handle:()=>o({cellId:S,before:!1})},{icon:h.jsx(M3,{size:13,strokeWidth:1.5}),label:"Move cell up",hotkey:"cell.moveUp",handle:()=>i({cellId:S,before:!0})},{icon:h.jsx(Zi,{size:13,strokeWidth:1.5}),label:"Move cell down",hotkey:"cell.moveDown",handle:()=>i({cellId:S,before:!1})},{icon:h.jsx(O3,{size:13,strokeWidth:1.5}),label:"Move cell left",hotkey:"cell.moveLeft",handle:()=>i({cellId:S,direction:"left"}),hidden:v!=="columns"},{icon:h.jsx(dc,{size:13,strokeWidth:1.5}),label:"Move cell right",hotkey:"cell.moveRight",handle:()=>i({cellId:S,direction:"right"}),hidden:v!=="columns"},{icon:h.jsx(im,{size:13,strokeWidth:1.5}),label:"Send to top",hotkey:"cell.sendToTop",handle:()=>a({cellId:S})},{icon:h.jsx(sm,{size:13,strokeWidth:1.5}),label:"Send to bottom",hotkey:"cell.sendToBottom",handle:()=>l({cellId:S})},{icon:h.jsx($F,{size:13,strokeWidth:1.5}),label:"Break into new column",hotkey:"cell.addColumnBreakpoint",hidden:v!=="columns",handle:()=>c({cellId:S})}],[{icon:h.jsx(dS,{size:13,strokeWidth:1.5}),label:"Copy link to cell",disabled:!_S(j),tooltip:_S(j)?void 0:"Only named cells can be linked to",handle:async()=>{await yn(AH(j)),lt({description:"Link copied to clipboard"})}}],[{label:"Delete",hidden:!p,variant:"danger",icon:h.jsx(lp,{size:13,strokeWidth:1.5}),handle:()=>{_({cellId:S})}}]].map(VS).filter(US),e[22]=c,e[23]=b,e[24]=v,e[25]=x,e[26]=p,e[27]=S,e[28]=d,e[29]=k.disabled,e[30]=k.hide_code,e[31]=o,e[32]=_,e[33]=I,e[34]=T,e[35]=E,e[36]=i,e[37]=j,e[38]=f,e[39]=l,e[40]=a,e[41]=m,e[42]=u,e[43]=M,e[44]=V,e[45]=C,e[46]=B,e[47]=z,e[48]=H):H=e[48],H}function US(t){return t.length>0}function VS(t){return t.filter(HS)}function HS(t){return!t.hidden}function $S(t){t==null||t.stopPropagation(),t==null||t.preventDefault()}function WS(t){return!t.hidden}const dd=Qt(!1),eg=()=>{const t=X.c(37),[e,n]=fn(dd),o=qF(),r=We(GF),s=We(cp);let i;t[0]!==r?(i={cell:r},t[0]=r,t[1]=i):i=t[1];let a=cd(i).flat();a=Aa(a);const l=function(){const P=X.c(45),{theme:C}=Fo(),[H,N]=Ds(),[$,Y]=D3();let Z;P[0]!==N?(Z=async ce=>{await Rs({config:ce}).then(()=>{N(ce)})},P[0]=N,P[1]=Z):Z=P[1];const q=Z;let re;P[2]!==Y?(re=async ce=>{await WF({config:ce}).then(()=>{Y(ce)})},P[2]=Y,P[3]=re):re=P[3];const ne=re;let oe;if(P[4]!==$||P[5]!==H||P[6]!==ne||P[7]!==q||P[8]!==C){let ce,pe,de;P[10]!==$?(ce=Ke=>Ke!==$.width,P[10]=$,P[11]=ce):ce=P[11],P[12]!==$||P[13]!==ne?(pe=Ke=>({label:`App config > Set width=${Ke}`,handle:()=>{ne({...$,width:Ke})}}),P[12]=$,P[13]=ne,P[14]=pe):pe=P[14],P[15]!==H||P[16]!==q||P[17]!==C?(de={label:"Config > Toggle dark mode",handle:()=>{q({...H,display:{...H.display,theme:C==="dark"?"light":"dark"}})}},P[15]=H,P[16]=q,P[17]=C,P[18]=de):de=P[18];const ge=H.keymap.preset==="vim";let ie,xe;P[19]!==H||P[20]!==q?(ie=()=>{q({...H,keymap:{...H.keymap,preset:"vim"}})},P[19]=H,P[20]=q,P[21]=ie):ie=P[21],P[22]!==ge||P[23]!==ie?(xe={label:"Config > Switch keymap to VIM",hidden:ge,handle:ie},P[22]=ge,P[23]=ie,P[24]=xe):xe=P[24];const we=H.keymap.preset==="default";let ae,Se,me;P[25]!==H||P[26]!==q?(ae=()=>{q({...H,keymap:{...H.keymap,preset:"default"}})},P[25]=H,P[26]=q,P[27]=ae):ae=P[27],P[28]!==ae||P[29]!==we?(Se={label:"Config > Switch keymap to default (current: VIM)",hidden:we,handle:ae},P[28]=ae,P[29]=we,P[30]=Se):Se=P[30],P[31]!==H||P[32]!==q?(me=()=>{q({...H,completion:{...H.completion,copilot:!1}})},P[31]=H,P[32]=q,P[33]=me):me=P[33];const Te=H.completion.copilot!=="github";let Re,$e;P[34]!==me||P[35]!==Te?(Re={label:"Config > Disable GitHub Copilot",handle:me,hidden:Te},P[34]=me,P[35]=Te,P[36]=Re):Re=P[36],P[37]!==H||P[38]!==q?($e=()=>{q({...H,completion:{...H.completion,copilot:"github"}})},P[37]=H,P[38]=q,P[39]=$e):$e=P[39];const ze=H.completion.copilot==="github";let Ne;P[40]!==$e||P[41]!==ze?(Ne={label:"Config > Enable GitHub Copilot",handle:$e,hidden:ze},P[40]=$e,P[41]=ze,P[42]=Ne):Ne=P[42],oe=[...hH().filter(ce).map(pe),de,xe,Se,Re,Ne],P[4]=$,P[5]=H,P[6]=ne,P[7]=q,P[8]=C,P[9]=oe}else oe=P[9];const G=oe;let Q;return P[43]!==G?(Q=G.filter(WS),P[43]=G,P[44]=Q):Q=P[44],Q}();let c=Ig();c=[...Aa(c),...Aa(l)];const d=c.filter(qS),u=uc.keyBy(d,GS),{recentCommands:f,addRecentCommand:p}=LS();let _;t[2]!==f?(_=new Set(f),t[2]=f,t[3]=_):_=t[3];const g=_;let m,b;t[4]!==s||t[5]!==n?(m=P=>{KF(s.getHotkey("global.commandPalette").key)(P)&&(P.preventDefault(),n(YS))},t[4]=s,t[5]=n,t[6]=m):m=t[6],ip(document,"keydown",m),t[7]!==p||t[8]!==s||t[9]!==o||t[10]!==n?(b=(P,C)=>{const H=o[P];if(!H)return null;const N=s.getHotkey(P);return h.jsxs(po,{disabled:C.disabled,onSelect:()=>{p(P),n(!1),requestAnimationFrame(()=>{H()})},value:N.name,children:[h.jsxs("span",{children:[N.name,C.tooltip&&h.jsx("span",{className:"ml-2",children:C.tooltip})]}),h.jsx(P3,{children:h.jsx(hp,{shortcut:N.key})})]},P)},t[7]=p,t[8]=s,t[9]=o,t[10]=n,t[11]=b):b=t[11];const x=b;let y;t[12]!==p||t[13]!==s||t[14]!==n?(y=(P,C,H,N)=>{const $=H===void 0?{}:H;return h.jsxs(po,{disabled:$.disabled,onSelect:()=>{p(P),n(!1),requestAnimationFrame(()=>{C()})},value:P,children:[h.jsxs("span",{children:[P,$.tooltip&&h.jsxs("span",{className:"ml-2",children:["(",$.tooltip,")"]})]}),N&&h.jsx(P3,{children:h.jsx(hp,{shortcut:s.getHotkey(N).key})})]},P)},t[12]=p,t[13]=s,t[14]=n,t[15]=y):y=t[15];const v=y,S=JF;let k;t[16]===Symbol.for("react.memo_cache_sentinel")?(k=h.jsx(Qi,{placeholder:"Type to search..."}),t[16]=k):k=t[16];const I=up;let j;t[17]===Symbol.for("react.memo_cache_sentinel")?(j=h.jsx(hc,{children:"No results found."}),t[17]=j):j=t[17];const E=f.length>0&&h.jsxs(h.Fragment,{children:[h.jsx(dp,{heading:"Recently Used",children:f.map(P=>{const C=u[P];return YF(P)?x(P,{disabled:C==null?void 0:C.disabled,tooltip:C==null?void 0:C.tooltip}):C&&!Xm(C)?v(C.label,C.handleHeadless||C.handle,{disabled:C.disabled,tooltip:C.tooltip}):null})}),h.jsx(R3,{})]}),T=dp,M=s.iterate().map(P=>{if(g.has(P))return null;const C=u[P];return x(P,{disabled:C==null?void 0:C.disabled,tooltip:C==null?void 0:C.tooltip})}),L=d.map(P=>g.has(P.label)?null:v(P.label,P.handleHeadless||P.handle,{disabled:P.disabled,tooltip:P.tooltip}));let B;t[18]!==g||t[19]!==v?(B=P=>g.has(P.label)?null:v(`Cell > ${P.label}`,P.handleHeadless||P.handle,{disabled:P.disabled,tooltip:P.tooltip}),t[18]=g,t[19]=v,t[20]=B):B=t[20];const O=a.map(B);let z,F,V;return t[21]!==T||t[22]!==L||t[23]!==O||t[24]!==M?(z=h.jsxs(T,{heading:"Commands",children:[M,L,O]}),t[21]=T,t[22]=L,t[23]=O,t[24]=M,t[25]=z):z=t[25],t[26]!==I||t[27]!==z||t[28]!==j||t[29]!==E?(F=h.jsxs(I,{children:[j,E,z]}),t[26]=I,t[27]=z,t[28]=j,t[29]=E,t[30]=F):F=t[30],t[31]!==S||t[32]!==e||t[33]!==n||t[34]!==F||t[35]!==k?(V=h.jsxs(S,{open:e,onOpenChange:n,children:[k,F]}),t[31]=S,t[32]=e,t[33]=n,t[34]=F,t[35]=k,t[36]=V):V=t[36],V};function qS(t){return!t.hotkey}function GS(t){return t.label}function YS(t){return!t}const Ma="https://static.marimo.app",JS=t=>{const e=X.c(24),{onClose:n}=t,[o,r]=A.useState("");let s;s=Math.random().toString(36).slice(2,6);const i=`${o}-${s}`,a=`${Ma}/static/${i}`;let l,c,d,u,f,p,_,g,m,b,x;return e[0]!==n||e[1]!==i?(l=async y=>{y.preventDefault(),n();const v=await XF({download:!1,includeCode:!0,files:yS.INSTANCE.filenames()}),S=lt({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${Ma}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:v,path:i})}).catch(()=>{S.dismiss(),lt({title:"Error uploading static page",description:h.jsxs("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",h.jsx("a",{href:Zn.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),S.dismiss(),lt({title:"Static page uploaded!",description:h.jsxs("div",{children:["The URL has been copied to your clipboard.",h.jsx("br",{}),"You can share it with anyone."]})})},e[0]=n,e[1]=i,e[2]=l):l=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx(dr,{children:"Share static notebook"}),e[3]=c):c=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(d=h.jsxs(Os,{children:[c,h.jsxs(Ps,{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"," ",h.jsx("a",{href:Ma,target:"_blank",children:Ma}),"."]})]}),e[4]=d):d=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(u=y=>{const v=y.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,"");r(v)},e[5]=u):u=e[5],e[6]!==o?(f=h.jsx(ur,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:u,required:!0,autoComplete:"off"}),e[6]=o,e[7]=f):f=e[7],e[8]!==a?(p=h.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:",h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(KS,{text:a}),h.jsx("span",{className:"text-primary",children:a})]})]}),e[8]=a,e[9]=p):p=e[9],e[10]!==f||e[11]!==p?(_=h.jsxs("div",{className:"flex flex-col gap-6 py-4",children:[f,p]}),e[10]=f,e[11]=p,e[12]=_):_=e[12],e[13]!==n?(g=h.jsx(Pe,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),e[13]=n,e[14]=g):g=e[14],e[15]!==a?(m=h.jsx(Pe,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await yn(a)},children:"Create"}),e[15]=a,e[16]=m):m=e[16],e[17]!==m||e[18]!==g?(b=h.jsxs(ea,{children:[g,m]}),e[17]=m,e[18]=g,e[19]=b):b=e[19],e[20]!==b||e[21]!==l||e[22]!==_?(x=h.jsx(cr,{className:"w-fit",children:h.jsxs("form",{onSubmit:l,children:[d,_,b]})}),e[20]=b,e[21]=l,e[22]=_,e[23]=x):x=e[23],x},KS=t=>{const e=X.c(8),[n,o]=K.useState(!1);let r;e[0]!==t.text?(r=Hn.stopPropagation(async c=>{c.preventDefault(),await yn(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=h.jsx(Ls,{size:14,strokeWidth:1.5}),e[2]=i):i=e[2],e[3]!==s?(a=h.jsx(Pe,{"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=h.jsx(Le,{content:"Copied!",open:n,children:a}),e[5]=n,e[6]=a,e[7]=l):l=e[7],l};function tg(){const t=X.c(3),{openConfirm:e}=Vn(),n=en(mo);let o;return t[0]!==e||t[1]!==n?(o=()=>{e({title:"Restart Kernel",description:"This will restart the Python kernel. You'll lose all data that's in memory. You will also lose any unsaved changes, so make sure to save your work before restarting.",variant:"destructive",confirmAction:h.jsx(L3,{onClick:async()=>{n({state:Ut.CLOSING}),await ZF(),QF()},"aria-label":"Confirm Restart",children:"Restart"})})},t[0]=e,t[1]=n,t[2]=o):o=t[2],o}const ud=[{type:"files",Icon:_m,tooltip:"View files",position:"sidebar"},{type:"variables",Icon:fc,tooltip:"Explore variables",position:"sidebar"},{type:"datasources",Icon:lr,tooltip:"Explore data sources",position:"sidebar"},{type:"dependencies",Icon:Na,tooltip:"Explore dependencies",position:"sidebar"},{type:"packages",Icon:ba,tooltip:"Manage packages",position:"sidebar"},{type:"outline",Icon:td,tooltip:"View outline",position:"sidebar"},{type:"chat",Icon:pc,tooltip:"Chat with AI",position:"sidebar"},{type:"documentation",Icon:nd,tooltip:"View live docs",position:"sidebar"},{type:"logs",Icon:fp,tooltip:"Notebook logs",position:"sidebar"},{type:"tracing",Icon:fH,tooltip:"Tracing",position:"sidebar"},{type:"snippets",Icon:zm,tooltip:"Snippets",position:"sidebar"},{type:"secrets",Icon:vm,tooltip:"Secrets",hidden:Un(),position:"sidebar"},{type:"scratchpad",Icon:ez,tooltip:"Scratchpad",position:"sidebar"},{type:"errors",Icon:ap,tooltip:"View errors",position:"footer"}];function ng(){const t=X.c(2),e=en(pp);let n;return t[0]!==e?(n=()=>{const o=document.getElementsByClassName("output-area"),r=window.innerHeight||document.documentElement.clientHeight;let s;s=null;for(const i of Array.from(o)){const a=i.getBoundingClientRect();if(a.top>=0&&a.top<=r||a.bottom>=0&&a.bottom<=r){s=Fs.parse(i.parentNode.id);break}}e(i=>({mode:tz(i.mode),cellAnchor:s})),requestAnimationFrame(()=>{var i;s!==null&&((i=document.getElementById(Fs.create(s)))==null||i.scrollIntoView())})},t[0]=e,t[1]=n):n=t[1],n}function yr(){return Ae.string().optional().describe(Je.of({label:"Password",inputType:"password",placeholder:"password",optionRegex:".*password.*"}))}function og(){return Ae.string().optional().describe(Je.of({label:"Token",inputType:"password",placeholder:"token",optionRegex:".*token.*"}))}function Oa(){return Ae.string().optional().describe(Je.of({label:"Warehouse Name",placeholder:"warehouse",optionRegex:".*warehouse.*"}))}function rg(){return Ae.string().optional().describe(Je.of({label:"URI",optionRegex:".*uri.*"}))}function xr(){return Ae.string().nonempty().describe(Je.of({label:"Host",placeholder:"localhost",optionRegex:".*host.*"}))}function _o(){return Ae.string().describe(Je.of({label:"Database",placeholder:"db name",optionRegex:".*database.*"}))}function wr(){return Ae.string().nonempty().describe(Je.of({label:"Username",placeholder:"username",optionRegex:".*username.*"}))}function vr(t){const e=Ae.coerce.string().describe(Je.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 sg(){return Ae.boolean().default(!1).describe(Je.of({label:"Read Only"}))}const ig=Ae.object({type:Ae.literal("postgres"),host:xr(),port:vr(5432).optional(),database:_o(),username:wr(),password:yr(),ssl:Ae.boolean().default(!1).describe(Je.of({label:"Use SSL"}))}).describe(Je.of({direction:"two-columns"})),ag=Ae.object({type:Ae.literal("mysql"),host:xr(),port:vr(3306),database:_o(),username:wr(),password:yr(),ssl:Ae.boolean().default(!1).describe(Je.of({label:"Use SSL"}))}).describe(Je.of({direction:"two-columns"})),lg=Ae.object({type:Ae.literal("sqlite"),database:_o().describe(Je.of({label:"Database Path"}))}).describe(Je.of({direction:"two-columns"})),cg=Ae.object({type:Ae.literal("duckdb"),database:_o().describe(Je.of({label:"Database Path"})),read_only:sg()}).describe(Je.of({direction:"two-columns"})),dg=Ae.object({type:Ae.literal("motherduck"),database:_o().default("my_db").describe(Je.of({label:"Database Name"})),token:og()}).describe(Je.of({direction:"two-columns"})),ug=Ae.object({type:Ae.literal("snowflake"),account:Ae.string().nonempty().describe(Je.of({label:"Account",optionRegex:".*snowflake.*"})),warehouse:Ae.string().optional().describe(Je.of({label:"Warehouse",optionRegex:".*snowflake.*"})),database:_o(),schema:Ae.string().optional().describe(Je.of({label:"Schema",optionRegex:".*snowflake.*"})),username:wr(),password:yr(),role:Ae.string().optional().describe(Je.of({label:"Role"}))}).describe(Je.of({direction:"two-columns"})),hg=Ae.object({type:Ae.literal("bigquery"),project:Ae.string().nonempty().describe(Je.of({label:"Project ID",optionRegex:".*bigquery.*"})),dataset:Ae.string().nonempty().describe(Je.of({label:"Dataset",optionRegex:".*bigquery.*"})),credentials_json:Ae.string().describe(Je.of({label:"Credentials JSON",inputType:"textarea"}))}).describe(Je.of({direction:"two-columns"})),fg=Ae.object({type:Ae.literal("clickhouse_connect"),host:xr(),port:vr(8123).optional(),username:wr(),password:yr(),secure:Ae.boolean().default(!1).describe(Je.of({label:"Use HTTPs"}))}).describe(Je.of({direction:"two-columns"})),pg=Ae.object({type:Ae.literal("timeplus"),host:xr().default("localhost"),port:vr(8123).optional(),username:wr().default("default"),password:yr().default("")}).describe(Je.of({direction:"two-columns"})),mg=Ae.object({type:Ae.literal("chdb"),database:_o().describe(Je.of({label:"Database Path"})),read_only:sg()}).describe(Je.of({direction:"two-columns"})),gg=Ae.object({type:Ae.literal("trino"),host:xr(),port:vr(8080),database:_o(),schema:Ae.string().describe(Je.of({label:"Schema",placeholder:"schema name",optionRegex:".*schema.*"})).optional(),username:wr(),password:yr(),async_support:Ae.boolean().default(!1).describe(Je.of({label:"Async Support"}))}).describe(Je.of({direction:"two-columns"})),_g=Ae.object({type:Ae.literal("iceberg"),name:Ae.string().describe(Je.of({label:"Catalog Name"})),catalog:Ae.discriminatedUnion("type",[Ae.object({type:Ae.literal("REST"),warehouse:Oa(),uri:Ae.string().optional().describe(Je.of({label:"URI",placeholder:"https://",optionRegex:".*uri.*"})),token:og()}),Ae.object({type:Ae.literal("SQL"),warehouse:Oa(),uri:Ae.string().optional().describe(Je.of({label:"URI",placeholder:"jdbc:iceberg://host:port/database",optionRegex:".*uri.*"}))}),Ae.object({type:Ae.literal("Hive"),warehouse:Oa(),uri:rg()}),Ae.object({type:Ae.literal("Glue"),warehouse:Oa(),uri:rg()}),Ae.object({type:Ae.literal("DynamoDB"),"dynamodb.profile-name":Ae.string().optional().describe(Je.of({label:"Profile Name"})),"dynamodb.region":Ae.string().optional().describe(Je.of({label:"Region"})),"dynamodb.access-key-id":Ae.string().optional().describe(Je.of({label:"Access Key ID"})),"dynamodb.secret-access-key":Ae.string().optional().describe(Je.of({label:"Secret Access Key",inputType:"password"})),"dynamodb.session-token":Ae.string().optional().describe(Je.of({label:"Session Token",inputType:"password"}))})]).default({type:"REST"}).describe(Je.of({special:"tabs"}))}),bg=Ae.object({type:Ae.literal("datafusion"),sessionContext:Ae.boolean().optional().describe(Je.of({label:"Use Session Context"}))}),yg=Ae.object({type:Ae.literal("pyspark"),host:xr().optional(),port:vr().optional()}),xg=Ae.object({type:Ae.literal("redshift"),host:xr(),port:vr(5439),connectionType:Ae.discriminatedUnion("type",[Ae.object({type:Ae.literal("IAM credentials"),region:Ae.string().describe(Je.of({label:"Region"})),aws_access_key_id:Ae.string().nonempty().describe(Je.of({label:"AWS Access Key ID",inputType:"password",optionRegex:".*aws_access_key_id.*"})),aws_secret_access_key:Ae.string().nonempty().describe(Je.of({label:"AWS Secret Access Key",inputType:"password",optionRegex:".*aws_secret_access_key.*"})),aws_session_token:Ae.string().optional().describe(Je.of({label:"AWS Session Token",inputType:"password",optionRegex:".*aws_session_token.*"}))}),Ae.object({type:Ae.literal("DB credentials"),user:wr(),password:yr()})]).default({type:"IAM credentials",aws_access_key_id:"",aws_secret_access_key:"",region:""}),database:_o()}).describe(Je.of({direction:"two-columns"})),XS=Ae.discriminatedUnion("type",[ig,ag,lg,cg,dg,ug,hg,fg,pg,mg,gg,_g,bg,yg,xg]),hd="env:";function Da(t){return typeof t=="string"&&t.startsWith(hd)}function fd(t){return`${hd}${t}`}const wg={sqlmodel:"SQLModel",sqlalchemy:"SQLAlchemy",duckdb:"DuckDB",clickhouse_connect:"ClickHouse Connect",chdb:"chDB",pyiceberg:"PyIceberg",ibis:"Ibis",motherduck:"MotherDuck",redshift:"Redshift"};class an{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 ZS{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),Da(n)){const r=n.replace(hd,""),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"?Br(n):n?`"${n}"`:""}printInFString(e,n,o){if(n===void 0)return"";if(typeof n=="number")return`${n}`;if(typeof n=="boolean")return Br(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 Da(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 QS extends an{generateImports(){return[]}generateConnectionCode(){const e=this.connection.ssl?", connect_args={'sslmode': 'require'}":"",n=this.secrets.printPassword(this.connection.password,"POSTGRES_PASSWORD",!0),o=this.secrets.printInFString("username",this.connection.username),r=this.secrets.printInFString("host",this.connection.host),s=this.secrets.printInFString("port",this.connection.port),i=this.secrets.printInFString("database",this.connection.database);return St(`
4
4
  DATABASE_URL = f"postgresql://${o}:${n}@${r}:${s}/${i}"
5
5
  engine = ${this.orm}.create_engine(DATABASE_URL${e})
@@ -125,20 +125,20 @@ ${t.stack}`:o}function ro(t,e){return t>>>=0,Zr().subarray(t/1,t/1+e)}function J
125
125
  `),t[6]=e,t[7]=a,t[8]=i,t[9]=u):u=t[9];const f=u;let p;t[10]!==e||t[11]!==(a==null?void 0:a.isHealthy)||t[12]!==(a==null?void 0:a.lastChecked)||t[13]!==s?(p=()=>s||e===Ut.CONNECTING?h.jsx(eo,{size:"small"}):e===Ut.CLOSING?h.jsx(eo,{className:"text-destructive",size:"small"}):e===Ut.OPEN?a!=null&&a.isHealthy?h.jsx($c,{className:"w-4 h-4 text-[var(--green-9)]"}):a!=null&&a.lastChecked?h.jsx(R4,{className:"w-4 h-4 text-[var(--yellow-9)]"}):h.jsx($c,{className:"w-4 h-4"}):h.jsx(Kp,{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]=p):p=t[14];const _=p,g=f();let m,b,x,y;return t[15]!==e?(m=e===Ut.OPEN&&h.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Click to refresh health status"}),t[15]=e,t[16]=m):m=t[16],t[17]!==g||t[18]!==m?(b=h.jsxs("div",{className:"text-sm whitespace-pre-line",children:[g,m]}),t[17]=g,t[18]=m,t[19]=b):b=t[19],t[20]!==_?(x=_(),t[20]=_,t[21]=x):x=t[21],t[22]!==l||t[23]!==b||t[24]!==x?(y=h.jsx(Jn,{tooltip:b,selected:!1,onClick:l,children:x}),t[22]=l,t[23]=b,t[24]=x,t[25]=y):y=t[25],y},VM=t=>{const e=X.c(3);let n,o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=h.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=h.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},HM=Qt(t=>t(GU).completion.copilot),$M=()=>{const t=X.c(1);if(We(HM)==="github"){let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=h.jsx(WM,{}),t[0]=e):e=t[0],e}return null},Ex=Zt.get("[copilot-status-bar]"),WM=()=>{const t=We(fS),e=We(jH)!==null,{handleClick:n}=xa(),o=()=>n("ai"),r=t?"Ready":"Not connected",s=en(fS),i=en(EH);return YU(()=>{const a=hS();let l=!0;return(async()=>{try{if(await a.initializePromise.catch(d=>{throw Ex.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;Ex.warn("Connection failed",c),s(!1),i("connectionError"),lt({title:"GitHub Copilot Connection Error",description:"Failed to connect to GitHub Copilot. Check settings and try again.",variant:"danger",action:h.jsx(Pe,{variant:"link",onClick:o,children:"Settings"})})}})(),()=>{l=!1}}),h.jsx(Jn,{tooltip:h.jsxs(h.Fragment,{children:[h.jsx("b",{children:"GitHub Copilot:"})," ",r]}),selected:!1,onClick:o,children:h.jsx("span",{children:e?h.jsx(eo,{className:"h-4 w-4"}):h.jsx(VM,{className:Oe("h-4 w-4",!t&&"opacity-60")})})})},qM=()=>{const t=X.c(13),e=We(os),[n,o]=fn(C4),[r,s]=A.useState(!1);if(!ga()||e==="disabled")return null;const i=e?"Real-time collaboration active":"Connecting to real-time collaboration";let a,l,c,d,u,f;return t[0]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsx(qm,{className:"w-4 h-4"}),t[0]=a):a=t[0],t[1]!==i?(l=h.jsx(Ys,{asChild:!0,children:h.jsx(Jn,{tooltip:i,selected:!1,children:a})}),t[1]=i,t[2]=l):l=t[2],t[3]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsxs("div",{className:"space-y-2",children:[h.jsx("h4",{className:"font-medium leading-none",children:"Username"}),h.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=p=>o(p.target.value),t[4]=o,t[5]=d):d=t[5],t[6]!==d||t[7]!==n?(u=h.jsx(Vs,{className:"w-80",children:h.jsxs("div",{className:"space-y-4",children:[c,h.jsx(ur,{value:n,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",onChange:d,placeholder:"Enter your username"})]})}),t[6]=d,t[7]=n,t[8]=u):u=t[8],t[9]!==r||t[10]!==l||t[11]!==u?(f=h.jsxs(Pr,{open:r,onOpenChange:s,children:[l,u]}),t[9]=r,t[10]=l,t[11]=u,t[12]=f):f=t[12],f},GM=()=>{const t=X.c(56),{selectedPanel:e,isTerminalOpen:n}=bc(),{toggleApplication:o,toggleTerminal:r}=na(),[s,i]=Ds(),a=We(JU),l=YM,c=ud.find(JM);let d;Bo(c,"Error panel not found"),t[0]!==r?(d=()=>{r()},t[0]=r,t[1]=d):d=t[1],Gt("global.toggleTerminal",d);const u=Jn,f=c.tooltip,p=e===c.type,_=()=>o(c.type),g=l(c,a>0?"text-destructive":"");let m,b,x,y,v;t[2]!==a?(m=h.jsx("span",{className:"ml-1 font-mono mt-[0.125rem]",children:a}),t[2]=a,t[3]=m):m=t[3],t[4]!==u||t[5]!==c||t[6]!==p||t[7]!==_||t[8]!==g||t[9]!==m?(b=h.jsxs(u,{tooltip:f,selected:p,onClick:_,children:[g,m]}),t[4]=u,t[5]=c,t[6]=p,t[7]=_,t[8]=g,t[9]=m,t[10]=b):b=t[10],t[11]!==r?(x=()=>r(),t[11]=r,t[12]=x):x=t[12],t[13]===Symbol.for("react.memo_cache_sentinel")?(y=h.jsx($m,{className:"h-5 w-5"}),t[13]=y):y=t[13],t[14]!==n||t[15]!==x?(v=h.jsx(jx,{capability:"terminal",children:h.jsx(Jn,{tooltip:"Open terminal",selected:n,onClick:x,children:y})}),t[14]=n,t[15]=x,t[16]=v):v=t[16];const S=s.runtime.auto_instantiate?"Disable autorun on startup":"Enable autorun on startup";let k,I,j;t[17]!==s||t[18]!==i?(k=async()=>{const q={...s,runtime:{...s.runtime,auto_instantiate:!s.runtime.auto_instantiate}};await Rs({config:q}).then(()=>i(q))},t[17]=s,t[18]=i,t[19]=k):k=t[19],t[20]===Symbol.for("react.memo_cache_sentinel")?(I=h.jsx("span",{children:"on startup: "}),t[20]=I):I=t[20],t[21]!==s.runtime.auto_instantiate?(j=s.runtime.auto_instantiate?h.jsx(br,{size:14}):h.jsx(_r,{size:14}),t[21]=s.runtime.auto_instantiate,t[22]=j):j=t[22];const E=s.runtime.auto_instantiate?"autorun":"lazy";let T,M,L,B;t[23]!==E?(T=h.jsx("span",{children:E}),t[23]=E,t[24]=T):T=t[24],t[25]!==j||t[26]!==T?(M=h.jsxs("div",{className:"font-prose text-sm flex items-center gap-1",children:[I,j,T]}),t[25]=j,t[26]=T,t[27]=M):M=t[27],t[28]!==S||t[29]!==k||t[30]!==M?(L=h.jsx(Jn,{tooltip:S,selected:!1,onClick:k,children:M}),t[28]=S,t[29]=k,t[30]=M,t[31]=L):L=t[31],t[32]===Symbol.for("react.memo_cache_sentinel")?(B=h.jsx("div",{className:"border-r border-border h-6 mx-1"}),t[32]=B):B=t[32];const O=s.runtime.on_cell_change==="autorun"?"Disable autorun":"Enable autorun";let z,F,V,P,C,H,N,$,Y,Z;return t[33]!==s||t[34]!==i?(z=async()=>{const q={...s,runtime:{...s.runtime,on_cell_change:s.runtime.on_cell_change==="autorun"?"lazy":"autorun"}};await Rs({config:q}).then(()=>i(q))},t[33]=s,t[34]=i,t[35]=z):z=t[35],t[36]===Symbol.for("react.memo_cache_sentinel")?(F=h.jsx("span",{children:"on cell change: "}),t[36]=F):F=t[36],t[37]!==s.runtime.on_cell_change?(V=h.jsxs("div",{className:"font-prose text-sm flex items-center gap-1",children:[F,s.runtime.on_cell_change==="autorun"?h.jsx(br,{size:14}):h.jsx(_r,{size:14}),h.jsx("span",{children:s.runtime.on_cell_change})]}),t[37]=s.runtime.on_cell_change,t[38]=V):V=t[38],t[39]!==O||t[40]!==z||t[41]!==V?(P=h.jsx(Jn,{tooltip:O,selected:!1,onClick:z,children:V}),t[39]=O,t[40]=z,t[41]=V,t[42]=P):P=t[42],t[43]===Symbol.for("react.memo_cache_sentinel")?(C=h.jsx("div",{className:"border-r border-border h-6 mx-1"}),t[43]=C):C=t[43],t[44]!==s||t[45]!==i?(H=!Un()&&h.jsx(Jn,{tooltip:null,selected:!1,children:h.jsxs(mc,{children:[h.jsxs(gc,{className:"font-prose text-sm flex items-center gap-1",children:[h.jsx("span",{children:"on module change: "}),s.runtime.auto_reload==="off"&&h.jsx(Kp,{size:14}),s.runtime.auto_reload==="lazy"&&h.jsx(_r,{size:14}),s.runtime.auto_reload==="autorun"&&h.jsx(br,{size:14}),h.jsx("span",{children:s.runtime.auto_reload}),h.jsx(Zi,{size:14})]}),h.jsx(_c,{children:["off","lazy","autorun"].map(q=>h.jsxs(sn,{onClick:async()=>{const re={...s,runtime:{...s.runtime,auto_reload:q}};await Rs({config:re}).then(()=>i(re))},children:[q==="off"&&h.jsx(Kp,{size:14,className:"mr-2 text-muted-foreground"}),q==="lazy"&&h.jsx(_r,{size:14,className:"mr-2 text-muted-foreground"}),q==="autorun"&&h.jsx(br,{size:14,className:"mr-2 text-muted-foreground"}),q]},q))})]})}),t[44]=s,t[45]=i,t[46]=H):H=t[46],t[47]===Symbol.for("react.memo_cache_sentinel")?(N=h.jsx("div",{className:"mx-auto"}),t[47]=N):N=t[47],t[48]===Symbol.for("react.memo_cache_sentinel")?($=h.jsx(hN,{children:h.jsx(Le,{content:h.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:h.jsx("span",{className:"text-muted-foreground text-sm mr-4",children:"kiosk mode"})})}),t[48]=$):$=t[48],t[49]===Symbol.for("react.memo_cache_sentinel")?(Y=h.jsxs("div",{className:"flex items-center",children:[h.jsx(OM,{}),h.jsx(BM,{}),h.jsx($M,{}),h.jsx(qM,{}),h.jsx(UM,{})]}),t[49]=Y):Y=t[49],t[50]!==v||t[51]!==L||t[52]!==P||t[53]!==H||t[54]!==b?(Z=h.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",children:[b,v,L,B,P,C,H,N,$,Y]}),t[50]=v,t[51]=L,t[52]=P,t[53]=H,t[54]=b,t[55]=Z):Z=t[55],Z};function YM(t,e){const{Icon:n}=t;return h.jsx(n,{className:Oe("h-5 w-5",e)})}function JM(t){return t.type==="errors"}const KM=t=>{const e=X.c(6),{children:n}=t,{openModal:o,closeModal:r}=Vn();let s,i;return e[0]!==r||e[1]!==o?(s=()=>o(h.jsx(XM,{onClose:r})),e[0]=r,e[1]=o,e[2]=s):s=e[2],e[3]!==n||e[4]!==s?(i=h.jsx(F4,{onClick:s,children:n}),e[3]=n,e[4]=s,e[5]=i):i=e[5],i},XM=t=>{const e=X.c(9),{onClose:n}=t;let o,r,s,i,a,l,c;return e[0]!==n?(o=async d=>{d.preventDefault();const u=new FormData(d.target),f=u.get("rating"),p=u.get("message");fetch("https://marimo.io/api/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({rating:f,message:p})}),n(),lt({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=h.jsx(dr,{children:"Send Feedback"}),e[2]=r):r=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(s=h.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=h.jsxs("li",{className:"my-0",children:["Take our"," ",h.jsx("a",{href:Zn.feedbackForm,target:"_blank",className:"underline",children:"two-minute survey."})]}),e[4]=i):i=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsxs("li",{className:"my-0",children:["File a"," ",h.jsx("a",{href:Zn.issuesPage,target:"_blank",className:"underline",children:"GitHub issue."})]}),e[5]=a):a=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(l=h.jsxs(Os,{children:[r,h.jsxs(Ps,{children:[s,h.jsxs("ul",{className:"list-disc ml-8 my-2 prose dark:prose-invert",children:[i,a,h.jsxs("li",{className:"my-0",children:["Chat with us on"," ",h.jsx("a",{href:Zn.discordLink,target:"_blank",className:"underline",children:"Discord."})]})]}),h.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=h.jsx(cr,{className:"w-fit",children:h.jsx("form",{onSubmit:o,children:l})}),e[7]=o,e[8]=c):c=e[8],c},ZM=()=>{const t=X.c(10),{selectedPanel:e}=bc(),{toggleApplication:n}=na(),o=eO;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=ud.filter(tO).map(d=>h.jsx(Ix,{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=h.jsx(KM,{children:h.jsx(Ix,{tooltip:"Send feedback!",selected:!1,children:h.jsx(jm,{className:"h-5 w-5"})})}),a=h.jsx("div",{className:"flex-1"}),l=h.jsx(QM,{}),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=h.jsxs("div",{className:r,children:[s,i,a,l]}),t[7]=r,t[8]=s,t[9]=c):c=t[9],c},QM=()=>{const t=X.c(7),e=We(KU);let n,o,r;return t[0]!==e?(n=e>0?h.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=h.jsx("div",{className:"flex flex-col-reverse gap-[1px] overflow-hidden",children:Array.from({length:e}).map(nO)}),t[2]=e,t[3]=o):o=t[3],t[4]!==n||t[5]!==o?(r=h.jsx(Le,{content:n,side:"right",delayDuration:200,children:o}),t[4]=n,t[5]=o,t[6]=r):r=t[6],r},Ix=t=>{const e=X.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-[var(--sage-3)]",l=s&&"bg-[var(--sage-4)]";let c,d,u;return e[6]!==o||e[7]!==a||e[8]!==l?(c=Oe("flex items-center p-2 text-sm mx-[1px] 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=h.jsx("div",{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?(u=h.jsx(Le,{content:i,side:"right",delayDuration:200,children:d}),e[14]=d,e[15]=i,e[16]=u):u=e[16],u};function eO(t,e){const{Icon:n}=t;return h.jsx(n,{className:Oe("h-5 w-5",e)})}function tO(t){return!t.hidden&&t.position==="sidebar"}function nO(t,e){return h.jsx("div",{className:"flex-shrink-0 h-1 w-2 bg-[var(--grass-6)] border border-[var(--grass-7)]"},e.toString())}let Ax;An=t=>{const e=X.c(15),{title:n,description:o,icon:r,action:s}=t;let i,a,l,c,d,u;return e[0]!==r?(i=r&&K.cloneElement(r,{className:"text-accent-foreground"}),e[0]=r,e[1]=i):i=e[1],e[2]!==n?(a=h.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=h.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=h.jsx("span",{className:"text-muted-foreground text-sm",children:o}),e[7]=o,e[8]=c):c=e[8],e[9]!==s?(d=s&&h.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?(u=h.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]=u):u=e[14],u},Ax=()=>{const t=X.c(5),e=XU();if(e.length===0){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsx(An,{title:"No errors!",icon:h.jsx(Mm,{})}),t[0]=r):r=t[0],r}let n,o;return t[1]!==e?(n=e.map(oO),t[1]=e,t[2]=n):n=t[2],t[3]!==n?(o=h.jsx("div",{className:"flex flex-col overflow-auto",children:n}),t[3]=n,t[4]=o):o=t[4],o};function oO(t){return h.jsxs("div",{children:[h.jsx("div",{className:"text-xs font-mono font-semibold bg-muted border-y px-2 py-1",children:h.jsx(ZU,{cellId:t.cellId})}),h.jsx("div",{className:"px-2",children:h.jsx(QU,{errors:t.output.data,cellId:t.cellId},t.cellId)},t.cellId)]},t.cellId)}const rO=()=>{const t=X.c(6),{items:e}=We(eV);let n,o;t[0]!==e?(o=GH(e),t[0]=e,t[1]=o):o=t[1],n=o;const r=n,{activeHeaderId:s}=YH(r);if(e.length===0){let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsx(An,{title:"No outline",description:"Add markdown headings to your notebook to create an outline.",icon:h.jsx(td,{})}),t[2]=a):a=t[2],a}let i;return t[3]!==s||t[4]!==e?(i=h.jsx(JH,{items:e,activeHeaderId:s}),t[3]=s,t[4]=e,t[5]=i):i=t[5],i};function un(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=un(t[o]))!==""&&(e+=(e&&" ")+n);else for(let n in t)t[n]&&(e+=(e&&" ")+n);return e}const{useDebugValue:sO}=K,{useSyncExternalStoreWithSelector:iO}=tV,aO=t=>t;function Tx(t,e=aO,n){const o=iO(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return sO(o),o}const Mx=(t,e)=>{const n=nV(t),o=(r,s=e)=>Tx(n,r,s);return Object.assign(o,n),o};function nn(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 io(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 lO={passive:!1},Oi={capture:!0,passive:!1};function Hu(t){t.stopImmediatePropagation()}function ss(t){t.preventDefault(),t.stopImmediatePropagation()}function Ox(t){var e=t.document.documentElement,n=to(t).on("dragstart.drag",ss,Oi);"onselectstart"in e?n.on("selectstart.drag",ss,Oi):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Dx(t,e){var n=t.document.documentElement,o=to(t).on("dragstart.drag",null);e&&(o.on("click.drag",ss,Oi),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const El=t=>()=>t;function $u(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 cO(t){return!t.ctrlKey&&!t.button}function dO(){return this.parentNode}function uO(t,e){return e??{x:t.x,y:t.y}}function hO(){return navigator.maxTouchPoints||"ontouchstart"in this}$u.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};const Il=t=>()=>t;function fO(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 Wu(t){t.stopImmediatePropagation()}function Di(t){t.preventDefault(),t.stopImmediatePropagation()}function pO(t){return!(t.ctrlKey&&t.type!=="wheel"||t.button)}function mO(){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 Rx(){return this.__zoom||gr}function gO(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function _O(){return navigator.maxTouchPoints||"ontouchstart"in this}function bO(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 Al=A.createContext(null),yO=Al.Provider,xO=t=>`Node type "${t}" not found. Using fallback type "default".`,wO=()=>"The React Flow parent container needs a width and a height to render the graph.",vO=()=>"Only child nodes can use a parent extent.",kO=t=>`Marker type "${t}" doesn't exist.`,SO=(t,e)=>`Couldn't create edge for ${t?"target":"source"} handle id: "${t?e.targetHandle:e.sourceHandle}", edge id: ${e.id}.`,CO=()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",NO=t=>`Edge type "${t}" not found. Using fallback type "default".`,jO=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.`,Px="[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001";function pt(t,e){const n=A.useContext(Al);if(n===null)throw new Error(Px);return Tx(n,t,e)}const qt=()=>{const t=A.useContext(Al);if(t===null)throw new Error(Px);return A.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe,destroy:t.destroy}),[t])},EO=t=>t.userSelectionActive?"none":"all";function Tl({position:t,children:e,className:n,style:o,...r}){const s=pt(EO),i=`${t}`.split("-");return K.createElement("div",{className:un(["react-flow__panel",n,...i]),style:{...o,pointerEvents:s},...r},e)}function IO({proOptions:t,position:e="bottom-right"}){return t!=null&&t.hideAttribution?null:K.createElement(Tl,{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"},K.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}var AO=A.memo(({x:t,y:e,label:n,labelStyle:o={},labelShowBg:r=!0,labelBgStyle:s={},labelBgPadding:i=[2,4],labelBgBorderRadius:a=2,children:l,className:c,...d})=>{const u=A.useRef(null),[f,p]=A.useState({x:0,y:0,width:0,height:0}),_=un(["react-flow__edge-textwrapper",c]);return A.useEffect(()=>{if(u.current){const g=u.current.getBBox();p({x:g.x,y:g.y,width:g.width,height:g.height})}},[n]),n!==void 0&&n?K.createElement("g",{transform:`translate(${t-f.width/2} ${e-f.height/2})`,className:_,visibility:f.width?"visible":"hidden",...d},r&&K.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}),K.createElement("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:u,style:o},n),l):null});const qu=t=>({width:t.offsetWidth,height:t.offsetHeight}),is=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),Gu=(t={x:0,y:0},e)=>({x:is(t.x,e[0][0],e[1][0]),y:is(t.y,e[0][1],e[1][1])}),Lx=(t,e,n)=>t<e?is(Math.abs(t-e),1,50)/50:t>n?-is(Math.abs(t-n),1,50)/50:0,Fx=(t,e)=>[20*Lx(t.x,35,e.width-35),20*Lx(t.y,35,e.height-35)],zx=t=>{var e;return((e=t.getRootNode)==null?void 0:e.call(t))||(window==null?void 0:window.document)},Yu=({x:t,y:e,width:n,height:o})=>({x:t,y:e,x2:t+n,y2:e+o}),Bx=t=>({...t.positionAbsolute||{x:0,y:0},width:t.width||0,height:t.height||0}),Ju=(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)},Pn=t=>!isNaN(t)&&isFinite(t),Nt=Symbol.for("internals"),Ux=["Enter"," ","Escape"];function Ku(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 Vx=t=>"clientX"in t,Zo=(t,e)=>{var s,i;const n=Vx(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)}},Ml=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0},Ri=({id:t,path:e,labelX:n,labelY:o,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:u,markerStart:f,interactionWidth:p=20})=>K.createElement(K.Fragment,null,K.createElement("path",{id:t,style:d,d:e,fill:"none",className:"react-flow__edge-path",markerEnd:u,markerStart:f}),p&&K.createElement("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:p,className:"react-flow__edge-interaction"}),r&&Pn(n)&&Pn(o)?K.createElement(AO,{x:n,y:o,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null);function Pi(t,e,n){return n===void 0?n:o=>{const r=e().edges.find(s=>s.id===t);r&&n(o,{...r})}}function Hx({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 $x({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 Ir,Wx,Qo,Xu,Li,qx,er,Fi,as,Gx,He,Ol;function Yx({pos:t,x1:e,y1:n,x2:o,y2:r}){return t===He.Left||t===He.Right?[.5*(e+o),n]:[e,.5*(n+r)]}function Jx({sourceX:t,sourceY:e,sourcePosition:n=He.Bottom,targetX:o,targetY:r,targetPosition:s=He.Top}){const[i,a]=Yx({pos:n,x1:t,y1:e,x2:o,y2:r}),[l,c]=Yx({pos:s,x1:o,y1:r,x2:t,y2:e}),[d,u,f,p]=$x({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,u,f,p]}Ri.displayName="BaseEdge",(Wx=Ir||(Ir={})).Strict="strict",Wx.Loose="loose",(Xu=Qo||(Qo={})).Free="free",Xu.Vertical="vertical",Xu.Horizontal="horizontal",(qx=Li||(Li={})).Partial="partial",qx.Full="full",(Fi=er||(er={})).Bezier="default",Fi.Straight="straight",Fi.Step="step",Fi.SmoothStep="smoothstep",Fi.SimpleBezier="simplebezier",(Gx=as||(as={})).Arrow="arrow",Gx.ArrowClosed="arrowclosed",(Ol=He||(He={})).Left="left",Ol.Top="top",Ol.Right="right",Ol.Bottom="bottom";const Zu=A.memo(({sourceX:t,sourceY:e,targetX:n,targetY:o,sourcePosition:r=He.Bottom,targetPosition:s=He.Top,label:i,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:u,style:f,markerEnd:p,markerStart:_,interactionWidth:g})=>{const[m,b,x]=Jx({sourceX:t,sourceY:e,sourcePosition:r,targetX:n,targetY:o,targetPosition:s});return K.createElement(Ri,{path:m,labelX:b,labelY:x,label:i,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:u,style:f,markerEnd:p,markerStart:_,interactionWidth:g})});Zu.displayName="SimpleBezierEdge";const Kx={[He.Left]:{x:-1,y:0},[He.Right]:{x:1,y:0},[He.Top]:{x:0,y:-1},[He.Bottom]:{x:0,y:1}},Xx=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function TO({source:t,sourcePosition:e=He.Bottom,target:n,targetPosition:o=He.Top,center:r,offset:s}){const i=Kx[e],a=Kx[o],l={x:t.x+i.x*s,y:t.y+i.y*s},c={x:n.x+a.x*s,y:n.y+a.y*s},d=(({source:k,sourcePosition:I=He.Bottom,target:j})=>I===He.Left||I===He.Right?k.x<j.x?{x:1,y:0}:{x:-1,y:0}:k.y<j.y?{x:0,y:1}:{x:0,y:-1})({source:l,sourcePosition:e,target:c}),u=d.x!==0?"x":"y",f=d[u];let p,_,g=[];const m={x:0,y:0},b={x:0,y:0},[x,y,v,S]=Hx({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(i[u]*a[u]==-1){p=r.x??x,_=r.y??y;const k=[{x:p,y:l.y},{x:p,y:c.y}],I=[{x:l.x,y:_},{x:c.x,y:_}];g=i[u]===f?u==="x"?k:I:u==="x"?I:k}else{const k=[{x:l.x,y:c.y}],I=[{x:c.x,y:l.y}];if(g=u==="x"?i.x===f?I:k:i.y===f?k:I,e===o){const T=Math.abs(t[u]-n[u]);if(T<=s){const M=Math.min(s-1,s-T);i[u]===f?m[u]=(l[u]>t[u]?-1:1)*M:b[u]=(c[u]>n[u]?-1:1)*M}}if(e!==o){const T=u==="x"?"y":"x",M=i[u]===a[T],L=l[T]>c[T],B=l[T]<c[T];(i[u]===1&&(!M&&L||M&&B)||i[u]!==1&&(!M&&B||M&&L))&&(g=u==="x"?k:I)}const j={x:l.x+m.x,y:l.y+m.y},E={x:c.x+b.x,y:c.y+b.y};Math.max(Math.abs(j.x-g[0].x),Math.abs(E.x-g[0].x))>=Math.max(Math.abs(j.y-g[0].y),Math.abs(E.y-g[0].y))?(p=(j.x+E.x)/2,_=g[0].y):(p=g[0].x,_=(j.y+E.y)/2)}return[[t,{x:l.x+m.x,y:l.y+m.y},...g,{x:c.x+b.x,y:c.y+b.y},n],p,_,v,S]}function Qu({sourceX:t,sourceY:e,sourcePosition:n=He.Bottom,targetX:o,targetY:r,targetPosition:s=He.Top,borderRadius:i=5,centerX:a,centerY:l,offset:c=20}){const[d,u,f,p,_]=TO({source:{x:t,y:e},sourcePosition:n,target:{x:o,y:r},targetPosition:s,center:{x:a,y:l},offset:c});return[d.reduce((g,m,b)=>{let x="";return x=b>0&&b<d.length-1?function(y,v,S,k){const I=Math.min(Xx(y,v)/2,Xx(v,S)/2,k),{x:j,y:E}=v;if(y.x===j&&j===S.x||y.y===E&&E===S.y)return`L${j} ${E}`;if(y.y===E)return`L ${j+I*(y.x<S.x?-1:1)},${E}Q ${j},${E} ${j},${E+I*(y.y<S.y?1:-1)}`;const T=y.x<S.x?1:-1;return`L ${j},${E+I*(y.y<S.y?-1:1)}Q ${j},${E} ${j+I*T},${E}`}(d[b-1],m,d[b+1],i):`${b===0?"M":"L"}${m.x} ${m.y}`,g+=x},""),u,f,p,_]}const Dl=A.memo(({sourceX:t,sourceY:e,targetX:n,targetY:o,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,sourcePosition:u=He.Bottom,targetPosition:f=He.Top,markerEnd:p,markerStart:_,pathOptions:g,interactionWidth:m})=>{const[b,x,y]=Qu({sourceX:t,sourceY:e,sourcePosition:u,targetX:n,targetY:o,targetPosition:f,borderRadius:g==null?void 0:g.borderRadius,offset:g==null?void 0:g.offset});return K.createElement(Ri,{path:b,labelX:x,labelY:y,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:p,markerStart:_,interactionWidth:m})});Dl.displayName="SmoothStepEdge";const eh=A.memo(t=>{var e;return K.createElement(Dl,{...t,pathOptions:A.useMemo(()=>{var n;return{borderRadius:0,offset:(n=t.pathOptions)==null?void 0:n.offset}},[(e=t.pathOptions)==null?void 0:e.offset])})});eh.displayName="StepEdge";const th=A.memo(({sourceX:t,sourceY:e,targetX:n,targetY:o,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:u,markerStart:f,interactionWidth:p})=>{const[_,g,m]=function({sourceX:b,sourceY:x,targetX:y,targetY:v}){const[S,k,I,j]=Hx({sourceX:b,sourceY:x,targetX:y,targetY:v});return[`M ${b},${x}L ${y},${v}`,S,k,I,j]}({sourceX:t,sourceY:e,targetX:n,targetY:o});return K.createElement(Ri,{path:_,labelX:g,labelY:m,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:u,markerStart:f,interactionWidth:p})});function Rl(t,e){return t>=0?.5*t:25*e*Math.sqrt(-t)}function Zx({pos:t,x1:e,y1:n,x2:o,y2:r,c:s}){switch(t){case He.Left:return[e-Rl(e-o,s),n];case He.Right:return[e+Rl(o-e,s),n];case He.Top:return[e,n-Rl(n-r,s)];case He.Bottom:return[e,n+Rl(r-n,s)]}}function Qx({sourceX:t,sourceY:e,sourcePosition:n=He.Bottom,targetX:o,targetY:r,targetPosition:s=He.Top,curvature:i=.25}){const[a,l]=Zx({pos:n,x1:t,y1:e,x2:o,y2:r,c:i}),[c,d]=Zx({pos:s,x1:o,y1:r,x2:t,y2:e,c:i}),[u,f,p,_]=$x({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}`,u,f,p,_]}th.displayName="StraightEdge";const Pl=A.memo(({sourceX:t,sourceY:e,targetX:n,targetY:o,sourcePosition:r=He.Bottom,targetPosition:s=He.Top,label:i,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:u,style:f,markerEnd:p,markerStart:_,pathOptions:g,interactionWidth:m})=>{const[b,x,y]=Qx({sourceX:t,sourceY:e,sourcePosition:r,targetX:n,targetY:o,targetPosition:s,curvature:g==null?void 0:g.curvature});return K.createElement(Ri,{path:b,labelX:x,labelY:y,label:i,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:u,style:f,markerEnd:p,markerStart:_,interactionWidth:m})});Pl.displayName="BezierEdge";const nh=A.createContext(null),MO=nh.Provider;nh.Consumer;const OO=({source:t,sourceHandle:e,target:n,targetHandle:o})=>`reactflow__edge-${t}${e||""}-${n}${o||""}`,oh=(t,e)=>t===void 0?"":typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(n=>`${n}=${t[n]}`).join("&")}`,rh=({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},ew=({x:t,y:e},[n,o,r])=>({x:t*r+n,y:e*r+o}),ls=(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}},sh=(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}=ls(r,e).positionAbsolute;return a=o,l=Yu({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)},tw=(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:u,height:f,selectable:p=!0,hidden:_=!1}=d;if(i&&!p||_)return!1;const{positionAbsolute:g}=ls(d,a),m={x:g.x,y:g.y,width:u||0,height:f||0},b=Ju(l,m);(u===void 0||f===void 0||u===null||f===null||s&&b>0||b>=(u||0)*(f||0)||d.dragging)&&c.push(d)}),c},nw=(t,e)=>{const n=t.map(o=>o.id);return e.filter(o=>n.includes(o.source)||n.includes(o.target))},ow=(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=is(l,o,r);return{x:e/2-(t.x+t.width/2)*c,y:n/2-(t.y+t.height/2)*c,zoom:c}},Ar=(t,e=0)=>t.transition().duration(e);function rw(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 DO={source:null,target:null,sourceHandle:null,targetHandle:null},sw=()=>({handleDomNode:null,isValid:!1,connection:DO,endHandle:null});function iw(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={...sw(),handleDomNode:l};if(l){const d=ih(void 0,l),u=l.getAttribute("data-nodeid"),f=l.getAttribute("data-handleid"),p=l.classList.contains("connectable"),_=l.classList.contains("connectableend"),g={source:a?u:n,sourceHandle:a?f:o,target:a?n:u,targetHandle:a?o:f};c.connection=g,p&&_&&(e===Ir.Strict?a&&d==="source"||!a&&d==="target":u!==n||f!==o)&&(c.endHandle={nodeId:u,handleId:f,type:d},c.isValid=s(g))}return c}function ih(t,e){return t||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function ah(t){t==null||t.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function RO(t,e){let n=null;return e?n="valid":t&&!e&&(n="invalid"),n}function aw({event:t,handleId:e,nodeId:n,onConnect:o,isTarget:r,getState:s,setState:i,isValidConnection:a,edgeUpdaterType:l,onReconnectEnd:c}){const d=zx(t.target),{connectionMode:u,domNode:f,autoPanOnConnect:p,connectionRadius:_,onConnectStart:g,panBy:m,getNodes:b,cancelConnection:x}=s();let y,v=0;const{x:S,y:k}=Zo(t),I=d==null?void 0:d.elementFromPoint(S,k),j=ih(l,I),E=f==null?void 0:f.getBoundingClientRect();if(!E||!j)return;let T,M=Zo(t,E),L=!1,B=null,O=!1,z=null;const F=function({nodes:H,nodeId:N,handleId:$,handleType:Y}){return H.reduce((Z,q)=>{if(q[Nt]){const{handleBounds:re}=q[Nt];let ne=[],oe=[];re&&(ne=rw(q,re,"source",`${N}-${$}-${Y}`),oe=rw(q,re,"target",`${N}-${$}-${Y}`)),Z.push(...ne,...oe)}return Z},[])}({nodes:b(),nodeId:n,handleId:e,handleType:j}),V=()=>{if(!p)return;const[H,N]=Fx(M,E);m({x:H,y:N}),v=requestAnimationFrame(V)};function P(H){const{transform:N}=s();M=Zo(H,E);const{handle:$,validHandleResult:Y}=function(Z,q,re,ne,oe,G){const{x:Q,y:ce}=Zo(Z),pe=q.elementsFromPoint(Q,ce).find(we=>we.classList.contains("react-flow__handle"));if(pe){const we=pe.getAttribute("data-nodeid");if(we){const ae=ih(void 0,pe),Se=pe.getAttribute("data-handleid"),me=G({nodeId:we,id:Se,type:ae});if(me){const Te=oe.find(Re=>Re.nodeId===we&&Re.type===ae&&Re.id===Se);return{handle:{id:Se,type:ae,nodeId:we,x:(Te==null?void 0:Te.x)||re.x,y:(Te==null?void 0:Te.y)||re.y},validHandleResult:me}}}}let de=[],ge=1/0;if(oe.forEach(we=>{const ae=Math.sqrt((we.x-re.x)**2+(we.y-re.y)**2);if(ae<=ne){const Se=G(we);ae<=ge&&(ae<ge?de=[{handle:we,validHandleResult:Se}]:ae===ge&&de.push({handle:we,validHandleResult:Se}),ge=ae)}}),!de.length)return{handle:null,validHandleResult:sw()};if(de.length===1)return de[0];const ie=de.some(({validHandleResult:we})=>we.isValid),xe=de.some(({handle:we})=>we.type==="target");return de.find(({handle:we,validHandleResult:ae})=>xe?we.type==="target":!ie||ae.isValid)||de[0]}(H,d,rh(M,N,!1,[1,1]),_,F,Z=>iw(Z,u,n,e,r?"target":"source",a,d));if(y=$,L||(V(),L=!0),z=Y.handleDomNode,B=Y.connection,O=Y.isValid,i({connectionPosition:y&&O?ew({x:y.x,y:y.y},N):M,connectionStatus:RO(!!y,O),connectionEndHandle:Y.endHandle}),!y&&!O&&!z)return ah(T);B.source!==B.target&&z&&(ah(T),T=z,z.classList.add("connecting","react-flow__handle-connecting"),z.classList.toggle("valid",O),z.classList.toggle("react-flow__handle-valid",O))}function C(H){var N,$;(y||z)&&B&&O&&(o==null||o(B)),($=(N=s()).onConnectEnd)==null||$.call(N,H),l&&(c==null||c(H)),ah(T),x(),cancelAnimationFrame(v),L=!1,O=!1,B=null,z=null,d.removeEventListener("mousemove",P),d.removeEventListener("mouseup",C),d.removeEventListener("touchmove",P),d.removeEventListener("touchend",C)}i({connectionPosition:M,connectionStatus:null,connectionNodeId:n,connectionHandleId:e,connectionHandleType:j,connectionStartHandle:{nodeId:n,handleId:e,type:j},connectionEndHandle:null}),g==null||g(t,{nodeId:n,handleId:e,handleType:j}),d.addEventListener("mousemove",P),d.addEventListener("mouseup",C),d.addEventListener("touchmove",P),d.addEventListener("touchend",C)}const lw=()=>!0,PO=t=>({connectionStartHandle:t.connectionStartHandle,connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName}),cw=A.forwardRef(({type:t="source",position:e=He.Top,isValidConnection:n,isConnectable:o=!0,isConnectableStart:r=!0,isConnectableEnd:s=!0,id:i,onConnect:a,children:l,className:c,onMouseDown:d,onTouchStart:u,...f},p)=>{var j,E;const _=i||null,g=t==="target",m=qt(),b=A.useContext(nh),{connectOnClick:x,noPanClassName:y}=pt(PO,nn),{connecting:v,clickConnecting:S}=pt(((T,M,L)=>B=>{const{connectionStartHandle:O,connectionEndHandle:z,connectionClickStartHandle:F}=B;return{connecting:(O==null?void 0:O.nodeId)===T&&(O==null?void 0:O.handleId)===M&&(O==null?void 0:O.type)===L||(z==null?void 0:z.nodeId)===T&&(z==null?void 0:z.handleId)===M&&(z==null?void 0:z.type)===L,clickConnecting:(F==null?void 0:F.nodeId)===T&&(F==null?void 0:F.handleId)===M&&(F==null?void 0:F.type)===L}})(b,_,t),nn);b||((E=(j=m.getState()).onError)==null||E.call(j,"010",CO()));const k=T=>{const{defaultEdgeOptions:M,onConnect:L,hasDefaultEdges:B}=m.getState(),O={...M,...T};if(B){const{edges:z,setEdges:F}=m.getState();F(((V,P)=>{if(!V.source||!V.target)return P;let C;return C=(H=>"id"in H&&"source"in H&&"target"in H)(V)?{...V}:{...V,id:OO(V)},((H,N)=>N.some($=>!($.source!==H.source||$.target!==H.target||$.sourceHandle!==H.sourceHandle&&($.sourceHandle||H.sourceHandle)||$.targetHandle!==H.targetHandle&&($.targetHandle||H.targetHandle))))(C,P)?P:P.concat(C)})(O,z))}L==null||L(O),a==null||a(O)},I=T=>{if(!b)return;const M=Vx(T);r&&(M&&T.button===0||!M)&&aw({event:T,handleId:_,nodeId:b,onConnect:k,isTarget:g,getState:m.getState,setState:m.setState,isValidConnection:n||m.getState().isValidConnection||lw}),M?d==null||d(T):u==null||u(T)};return K.createElement("div",{"data-handleid":_,"data-nodeid":b,"data-handlepos":e,"data-id":`${b}-${_}-${t}`,className:un(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",y,c,{source:!g,target:g,connectable:o,connectablestart:r,connectableend:s,connecting:S,connectionindicator:o&&(r&&!v||s&&v)}]),onMouseDown:I,onTouchStart:I,onClick:x?T=>{const{onClickConnectStart:M,onClickConnectEnd:L,connectionClickStartHandle:B,connectionMode:O,isValidConnection:z}=m.getState();if(!b||!B&&!r)return;if(!B)return M==null||M(T,{nodeId:b,handleId:_,handleType:t}),void m.setState({connectionClickStartHandle:{nodeId:b,type:t,handleId:_}});const F=zx(T.target),V=n||z||lw,{connection:P,isValid:C}=iw({nodeId:b,id:_,type:t},O,B.nodeId,B.handleId||null,B.type,V,F);C&&k(P),L==null||L(T),m.setState({connectionClickStartHandle:null})}:void 0,ref:p,...f},l)});cw.displayName="Handle";var tr=A.memo(cw);const dw=({data:t,isConnectable:e,targetPosition:n=He.Top,sourcePosition:o=He.Bottom})=>K.createElement(K.Fragment,null,K.createElement(tr,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label,K.createElement(tr,{type:"source",position:o,isConnectable:e}));dw.displayName="DefaultNode";var lh=A.memo(dw);const uw=({data:t,isConnectable:e,sourcePosition:n=He.Bottom})=>K.createElement(K.Fragment,null,t==null?void 0:t.label,K.createElement(tr,{type:"source",position:n,isConnectable:e}));uw.displayName="InputNode";var hw=A.memo(uw);const fw=({data:t,isConnectable:e,targetPosition:n=He.Top})=>K.createElement(K.Fragment,null,K.createElement(tr,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label);fw.displayName="OutputNode";var pw=A.memo(fw);const ch=()=>null;ch.displayName="GroupNode";const LO=t=>({selectedNodes:t.getNodes().filter(e=>e.selected),selectedEdges:t.edges.filter(e=>e.selected).map(e=>({...e}))}),Ll=t=>t.id;function FO(t,e){return nn(t.selectedNodes.map(Ll),e.selectedNodes.map(Ll))&&nn(t.selectedEdges.map(Ll),e.selectedEdges.map(Ll))}const mw=A.memo(({onSelectionChange:t})=>{const e=qt(),{selectedNodes:n,selectedEdges:o}=pt(LO,FO);return A.useEffect(()=>{const r={nodes:n,edges:o};t==null||t(r),e.getState().onSelectionChange.forEach(s=>s(r))},[n,o,t]),null});mw.displayName="SelectionListener";const zO=t=>!!t.onSelectionChange;function BO({onSelectionChange:t}){const e=pt(zO);return t||e?K.createElement(mw,{onSelectionChange:t}):null}const UO=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 cs(t,e){A.useEffect(()=>{t!==void 0&&e(t)},[t])}function at(t,e,n){A.useEffect(()=>{e!==void 0&&n({[t]:e})},[e])}const VO=({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,onConnect:r,onConnectStart:s,onConnectEnd:i,onClickConnectStart:a,onClickConnectEnd:l,nodesDraggable:c,nodesConnectable:d,nodesFocusable:u,edgesFocusable:f,edgesUpdatable:p,elevateNodesOnSelect:_,minZoom:g,maxZoom:m,nodeExtent:b,onNodesChange:x,onEdgesChange:y,elementsSelectable:v,connectionMode:S,snapGrid:k,snapToGrid:I,translateExtent:j,connectOnClick:E,defaultEdgeOptions:T,fitView:M,fitViewOptions:L,onNodesDelete:B,onEdgesDelete:O,onNodeDrag:z,onNodeDragStart:F,onNodeDragStop:V,onSelectionDrag:P,onSelectionDragStart:C,onSelectionDragStop:H,noPanClassName:N,nodeOrigin:$,rfId:Y,autoPanOnConnect:Z,autoPanOnNodeDrag:q,onError:re,connectionRadius:ne,isValidConnection:oe,nodeDragThreshold:G})=>{const{setNodes:Q,setEdges:ce,setDefaultNodesAndEdges:pe,setMinZoom:de,setMaxZoom:ge,setTranslateExtent:ie,setNodeExtent:xe,reset:we}=pt(UO,nn),ae=qt();return A.useEffect(()=>{const Se=o==null?void 0:o.map(me=>({...me,...T}));return pe(n,Se),()=>{we()}},[]),at("defaultEdgeOptions",T,ae.setState),at("connectionMode",S,ae.setState),at("onConnect",r,ae.setState),at("onConnectStart",s,ae.setState),at("onConnectEnd",i,ae.setState),at("onClickConnectStart",a,ae.setState),at("onClickConnectEnd",l,ae.setState),at("nodesDraggable",c,ae.setState),at("nodesConnectable",d,ae.setState),at("nodesFocusable",u,ae.setState),at("edgesFocusable",f,ae.setState),at("edgesUpdatable",p,ae.setState),at("elementsSelectable",v,ae.setState),at("elevateNodesOnSelect",_,ae.setState),at("snapToGrid",I,ae.setState),at("snapGrid",k,ae.setState),at("onNodesChange",x,ae.setState),at("onEdgesChange",y,ae.setState),at("connectOnClick",E,ae.setState),at("fitViewOnInit",M,ae.setState),at("fitViewOnInitOptions",L,ae.setState),at("onNodesDelete",B,ae.setState),at("onEdgesDelete",O,ae.setState),at("onNodeDrag",z,ae.setState),at("onNodeDragStart",F,ae.setState),at("onNodeDragStop",V,ae.setState),at("onSelectionDrag",P,ae.setState),at("onSelectionDragStart",C,ae.setState),at("onSelectionDragStop",H,ae.setState),at("noPanClassName",N,ae.setState),at("nodeOrigin",$,ae.setState),at("rfId",Y,ae.setState),at("autoPanOnConnect",Z,ae.setState),at("autoPanOnNodeDrag",q,ae.setState),at("onError",re,ae.setState),at("connectionRadius",ne,ae.setState),at("isValidConnection",oe,ae.setState),at("nodeDragThreshold",G,ae.setState),cs(t,Q),cs(e,ce),cs(g,de),cs(m,ge),cs(j,ie),cs(b,xe),null},gw={display:"none"},HO={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},_w="react-flow__node-desc",bw="react-flow__edge-desc",$O=t=>t.ariaLiveMessage;function WO({rfId:t}){const e=pt($O);return K.createElement("div",{id:`react-flow__aria-live-${t}`,"aria-live":"assertive","aria-atomic":"true",style:HO},e)}function qO({rfId:t,disableKeyboardA11y:e}){return K.createElement(K.Fragment,null,K.createElement("div",{id:`${_w}-${t}`,style:gw},"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."," "),K.createElement("div",{id:`${bw}-${t}`,style:gw},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!e&&K.createElement(WO,{rfId:t}))}var zi=(t=null,e={actInsideInputWithModifier:!0})=>{const[n,o]=A.useState(!1),r=A.useRef(!1),s=A.useRef(new Set([])),[i,a]=A.useMemo(()=>{if(t!==null){const l=(Array.isArray(t)?t:[t]).filter(d=>typeof d=="string").map(d=>d.split("+")),c=l.reduce((d,u)=>d.concat(...u),[]);return[l,c]}return[[],[]]},[t]);return A.useEffect(()=>{const l=typeof document<"u"?document:null,c=(e==null?void 0:e.target)||l;if(t!==null){const d=p=>{if(r.current=p.ctrlKey||p.metaKey||p.shiftKey,(!r.current||r.current&&!e.actInsideInputWithModifier)&&Ku(p))return!1;const _=xw(p.code,a);s.current.add(p[_]),yw(i,s.current,!1)&&(p.preventDefault(),o(!0))},u=p=>{if((!r.current||r.current&&!e.actInsideInputWithModifier)&&Ku(p))return!1;const _=xw(p.code,a);yw(i,s.current,!0)?(o(!1),s.current.clear()):s.current.delete(p[_]),p.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",u),window.addEventListener("blur",f),()=>{c==null||c.removeEventListener("keydown",d),c==null||c.removeEventListener("keyup",u),window.removeEventListener("blur",f)}}},[t,o]),n};function yw(t,e,n){return t.filter(o=>n||o.length===e.size).some(o=>o.every(r=>e.has(r)))}function xw(t,e){return e.includes(t)?"code":"key"}function ww(t,e,n,o){var a,l;const r=t.parentNode||t.parentId;if(!r)return n;const s=e.get(r),i=ls(s,o);return ww(s,e,{x:(n.x??0)+i.x,y:(n.y??0)+i.y,z:(((a=s[Nt])==null?void 0:a.z)??0)>(n.z??0)?((l=s[Nt])==null?void 0:l.z)??0:n.z??0},o)}function vw(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}=ww(o,t,{...o.position,z:((s=o[Nt])==null?void 0:s.z)??0},e);o.positionAbsolute={x:i,y:a},o[Nt].z=l,n!=null&&n[o.id]&&(o[Nt].isParent=!0)}})}function dh(t,e,n,o){const r=new Map,s={},i=o?1e3:0;return t.forEach(a=>{var p;const l=(Pn(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}},u=a.parentNode||a.parentId;u&&(s[u]=!0);const f=(c==null?void 0:c.type)&&(c==null?void 0:c.type)!==a.type;Object.defineProperty(d,Nt,{enumerable:!1,value:{handleBounds:f||(p=c==null?void 0:c[Nt])==null?void 0:p.handleBounds,z:l}}),r.set(a.id,d)}),vw(r,n,s),r}function kw(t,e={}){const{getNodes:n,width:o,height:r,minZoom:s,maxZoom:i,d3Zoom:a,d3Selection:l,fitViewOnInitDone:c,fitViewOnInit:d,nodeOrigin:u}=t(),f=e.initial&&!c&&d;if(a&&l&&(f||!e.initial)){const p=n().filter(g=>{var b;const m=e.includeHiddenNodes?g.width&&g.height:!g.hidden;return(b=e.nodes)!=null&&b.length?m&&e.nodes.some(x=>x.id===g.id):m}),_=p.every(g=>g.width&&g.height);if(p.length>0&&_){const g=sh(p,u),{x:m,y:b,zoom:x}=ow(g,o,r,e.minZoom??s,e.maxZoom??i,e.padding??.1),y=gr.translate(m,b).scale(x);return typeof e.duration=="number"&&e.duration>0?a.transform(Ar(l,e.duration),y):a.transform(l,y),!0}}return!1}function GO(t,e){return t.forEach(n=>{const o=e.get(n.id);o&&e.set(o.id,{...o,[Nt]:o[Nt],selected:n.selected})}),new Map(e)}function YO(t,e){return e.map(n=>{const o=t.find(r=>r.id===n.id);return o&&(n.selected=o.selected),n})}function Fl({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:GO(t,r)}),i==null||i(t)),e!=null&&e.length&&(c&&o({edges:YO(e,s)}),a==null||a(e))}const ds=()=>{},JO={zoomIn:ds,zoomOut:ds,zoomTo:ds,getZoom:()=>1,setViewport:ds,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:ds,fitBounds:ds,project:t=>t,screenToFlowPosition:t=>t,flowToScreenPosition:t=>t,viewportInitialized:!1},KO=t=>({d3Zoom:t.d3Zoom,d3Selection:t.d3Selection});function Bi(){const t=(()=>{const g=qt(),{d3Zoom:m,d3Selection:b}=pt(KO,nn);return A.useMemo(()=>b&&m?{zoomIn:y=>m.scaleBy(Ar(b,y==null?void 0:y.duration),1.2),zoomOut:y=>m.scaleBy(Ar(b,y==null?void 0:y.duration),1/1.2),zoomTo:(y,v)=>m.scaleTo(Ar(b,v==null?void 0:v.duration),y),getZoom:()=>g.getState().transform[2],setViewport:(y,v)=>{const[S,k,I]=g.getState().transform,j=gr.translate(y.x??S,y.y??k).scale(y.zoom??I);m.transform(Ar(b,v==null?void 0:v.duration),j)},getViewport:()=>{const[y,v,S]=g.getState().transform;return{x:y,y:v,zoom:S}},fitView:y=>kw(g.getState,y),setCenter:(y,v,S)=>{const{width:k,height:I,maxZoom:j}=g.getState(),E=(S==null?void 0:S.zoom)!==void 0?S.zoom:j,T=k/2-y*E,M=I/2-v*E,L=gr.translate(T,M).scale(E);m.transform(Ar(b,S==null?void 0:S.duration),L)},fitBounds:(y,v)=>{const{width:S,height:k,minZoom:I,maxZoom:j}=g.getState(),{x:E,y:T,zoom:M}=ow(y,S,k,I,j,(v==null?void 0:v.padding)??.1),L=gr.translate(E,T).scale(M);m.transform(Ar(b,v==null?void 0:v.duration),L)},project:y=>{const{transform:v,snapToGrid:S,snapGrid:k}=g.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),rh(y,v,S,k)},screenToFlowPosition:y=>{const{transform:v,snapToGrid:S,snapGrid:k,domNode:I}=g.getState();if(!I)return y;const{x:j,y:E}=I.getBoundingClientRect(),T={x:y.x-j,y:y.y-E};return rh(T,v,S,k)},flowToScreenPosition:y=>{const{transform:v,domNode:S}=g.getState();if(!S)return y;const{x:k,y:I}=S.getBoundingClientRect(),j=ew(y,v);return{x:j.x+k,y:j.y+I}},viewportInitialized:!0}:JO,[m,b])})(),e=qt(),n=A.useCallback(()=>e.getState().getNodes().map(g=>({...g})),[]),o=A.useCallback(g=>e.getState().nodeInternals.get(g),[]),r=A.useCallback(()=>{const{edges:g=[]}=e.getState();return g.map(m=>({...m}))},[]),s=A.useCallback(g=>{const{edges:m=[]}=e.getState();return m.find(b=>b.id===g)},[]),i=A.useCallback(g=>{const{getNodes:m,setNodes:b,hasDefaultNodes:x,onNodesChange:y}=e.getState(),v=m(),S=typeof g=="function"?g(v):g;if(x)b(S);else if(y){const k=S.length===0?v.map(I=>({type:"remove",id:I.id})):S.map(I=>({item:I,type:"reset"}));y(k)}},[]),a=A.useCallback(g=>{const{edges:m=[],setEdges:b,hasDefaultEdges:x,onEdgesChange:y}=e.getState(),v=typeof g=="function"?g(m):g;x?b(v):y&&y(v.length===0?m.map(S=>({type:"remove",id:S.id})):v.map(S=>({item:S,type:"reset"})))},[]),l=A.useCallback(g=>{const m=Array.isArray(g)?g:[g],{getNodes:b,setNodes:x,hasDefaultNodes:y,onNodesChange:v}=e.getState();if(y)x([...b(),...m]);else if(v){const S=m.map(k=>({item:k,type:"add"}));v(S)}},[]),c=A.useCallback(g=>{const m=Array.isArray(g)?g:[g],{edges:b=[],setEdges:x,hasDefaultEdges:y,onEdgesChange:v}=e.getState();y?x([...b,...m]):v&&v(m.map(S=>({item:S,type:"add"})))},[]),d=A.useCallback(()=>{const{getNodes:g,edges:m=[],transform:b}=e.getState(),[x,y,v]=b;return{nodes:g().map(S=>({...S})),edges:m.map(S=>({...S})),viewport:{x,y,zoom:v}}},[]),u=A.useCallback(({nodes:g,edges:m})=>{const{nodeInternals:b,getNodes:x,edges:y,hasDefaultNodes:v,hasDefaultEdges:S,onNodesDelete:k,onEdgesDelete:I,onNodesChange:j,onEdgesChange:E}=e.getState(),T=(g||[]).map(z=>z.id),M=(m||[]).map(z=>z.id),L=x().reduce((z,F)=>{const V=F.parentNode||F.parentId,P=!T.includes(F.id)&&V&&z.find(C=>C.id===V);return(typeof F.deletable!="boolean"||F.deletable)&&(T.includes(F.id)||P)&&z.push(F),z},[]),B=y.filter(z=>typeof z.deletable!="boolean"||z.deletable),O=B.filter(z=>M.includes(z.id));if(L||O){const z=nw(L,B),F=[...O,...z],V=F.reduce((P,C)=>(P.includes(C.id)||P.push(C.id),P),[]);(S||v)&&(S&&e.setState({edges:y.filter(P=>!V.includes(P.id))}),v&&(L.forEach(P=>{b.delete(P.id)}),e.setState({nodeInternals:new Map(b)}))),V.length>0&&(I==null||I(F),E&&E(V.map(P=>({id:P,type:"remove"})))),L.length>0&&(k==null||k(L),j)&&j(L.map(P=>({id:P.id,type:"remove"})))}},[]),f=A.useCallback(g=>{const m=Pn((b=g).width)&&Pn(b.height)&&Pn(b.x)&&Pn(b.y);var b;const x=m?null:e.getState().nodeInternals.get(g.id);return!m&&!x?[null,null,m]:[m?g:Bx(x),x,m]},[]),p=A.useCallback((g,m=!0,b)=>{const[x,y,v]=f(g);return x?(b||e.getState().getNodes()).filter(S=>{if(!(v||S.id!==y.id&&S.positionAbsolute))return!1;const k=Bx(S),I=Ju(k,x);return m&&I>0||I>=x.width*x.height}):[]},[]),_=A.useCallback((g,m,b=!0)=>{const[x]=f(g);if(!x)return!1;const y=Ju(x,m);return b&&y>0||y>=x.width*x.height},[]);return A.useMemo(()=>({...t,getNodes:n,getNode:o,getEdges:r,getEdge:s,setNodes:i,setEdges:a,addNodes:l,addEdges:c,toObject:d,deleteElements:u,getIntersectingNodes:p,isNodeIntersecting:_}),[t,n,o,r,s,i,a,l,c,d,u,p,_])}const XO={actInsideInputWithModifier:!1},uh={position:"absolute",width:"100%",height:"100%",top:0,left:0},zl=t=>({x:t.x,y:t.y,zoom:t.k}),us=(t,e)=>t.target.closest(`.${e}`),Sw=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),Cw=t=>{const e=t.ctrlKey&&Ml()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e},ZO=t=>({d3Zoom:t.d3Zoom,d3Selection:t.d3Selection,d3ZoomHandler:t.d3ZoomHandler,userSelectionActive:t.userSelectionActive}),QO=({onMove:t,onMoveStart:e,onMoveEnd:n,onPaneContextMenu:o,zoomOnScroll:r=!0,zoomOnPinch:s=!0,panOnScroll:i=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=Qo.Free,zoomOnDoubleClick:c=!0,elementsSelectable:d,panOnDrag:u=!0,defaultViewport:f,translateExtent:p,minZoom:_,maxZoom:g,zoomActivationKeyCode:m,preventScrolling:b=!0,children:x,noWheelClassName:y,noPanClassName:v})=>{const S=A.useRef(),k=qt(),I=A.useRef(!1),j=A.useRef(!1),E=A.useRef(null),T=A.useRef({x:0,y:0,zoom:0}),{d3Zoom:M,d3Selection:L,d3ZoomHandler:B,userSelectionActive:O}=pt(ZO,nn),z=zi(m),F=A.useRef(0),V=A.useRef(!1),P=A.useRef();return function(C){const H=qt();A.useEffect(()=>{let N;const $=()=>{var Z,q;if(!C.current)return;const Y=qu(C.current);Y.height!==0&&Y.width!==0||((q=(Z=H.getState()).onError)==null||q.call(Z,"004",wO())),H.setState({width:Y.width||500,height:Y.height||500})};return $(),window.addEventListener("resize",$),C.current&&(N=new ResizeObserver(()=>$()),N.observe(C.current)),()=>{window.removeEventListener("resize",$),N&&C.current&&N.unobserve(C.current)}},[])}(E),A.useEffect(()=>{if(E.current){const C=E.current.getBoundingClientRect(),H=function(){var q,re,ne,oe=pO,G=mO,Q=bO,ce=gO,pe=_O,de=[0,1/0],ge=[[-1/0,-1/0],[1/0,1/0]],ie=250,xe=o$,we=NS("start","zoom","end"),ae=0,Se=10;function me(J){J.property("__zoom",Rx).on("wheel.zoom",nt,{passive:!1}).on("mousedown.zoom",it).on("dblclick.zoom",te).filter(pe).on("touchstart.zoom",Ce).on("touchmove.zoom",Me).on("touchend.zoom touchcancel.zoom",Be).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function Te(J,fe){return(fe=Math.max(de[0],Math.min(de[1],fe)))===J.k?J:new em(fe,J.x,J.y)}function Re(J,fe,_e){var ue=fe[0]-_e[0]*J.k,je=fe[1]-_e[1]*J.k;return ue===J.x&&je===J.y?J:new em(J.k,ue,je)}function $e(J){return[(+J[0][0]+ +J[1][0])/2,(+J[0][1]+ +J[1][1])/2]}function ze(J,fe,_e,ue){J.on("start.zoom",function(){Ne(this,arguments).event(ue).start()}).on("interrupt.zoom end.zoom",function(){Ne(this,arguments).event(ue).end()}).tween("zoom",function(){var je=this,ve=arguments,Ve=Ne(je,ve).event(ue),Qe=G.apply(je,ve),le=_e==null?$e(Qe):typeof _e=="function"?_e.apply(je,ve):_e,Ee=Math.max(Qe[1][0]-Qe[0][0],Qe[1][1]-Qe[0][1]),Ie=je.__zoom,Ue=typeof fe=="function"?fe.apply(je,ve):fe,qe=xe(Ie.invert(le).concat(Ee/Ie.k),Ue.invert(le).concat(Ee/Ue.k));return function(De){if(De===1)De=Ue;else{var Ye=qe(De),ot=Ee/Ye[2];De=new em(ot,le[0]-Ye[0]*ot,le[1]-Ye[1]*ot)}Ve.zoom(null,De)}})}function Ne(J,fe,_e){return!_e&&J.__zooming||new Ke(J,fe)}function Ke(J,fe){this.that=J,this.args=fe,this.active=0,this.sourceEvent=null,this.extent=G.apply(J,fe),this.taps=0}function nt(J,...fe){if(oe.apply(this,arguments)){var _e=Ne(this,fe).event(J),ue=this.__zoom,je=Math.max(de[0],Math.min(de[1],ue.k*Math.pow(2,ce.apply(this,arguments)))),ve=io(J);if(_e.wheel)_e.mouse[0][0]===ve[0]&&_e.mouse[0][1]===ve[1]||(_e.mouse[1]=ue.invert(_e.mouse[0]=ve)),clearTimeout(_e.wheel);else{if(ue.k===je)return;_e.mouse=[ve,ue.invert(ve)],tm(this),_e.start()}Di(J),_e.wheel=setTimeout(function(){_e.wheel=null,_e.end()},150),_e.zoom("mouse",Q(Re(Te(ue,je),_e.mouse[0],_e.mouse[1]),_e.extent,ge))}}function it(J,...fe){if(!ne&&oe.apply(this,arguments)){var _e=J.currentTarget,ue=Ne(this,fe,!0).event(J),je=to(J.view).on("mousemove.zoom",function(le){if(Di(le),!ue.moved){var Ee=le.clientX-Ve,Ie=le.clientY-Qe;ue.moved=Ee*Ee+Ie*Ie>ae}ue.event(le).zoom("mouse",Q(Re(ue.that.__zoom,ue.mouse[0]=io(le,_e),ue.mouse[1]),ue.extent,ge))},!0).on("mouseup.zoom",function(le){je.on("mousemove.zoom mouseup.zoom",null),Dx(le.view,ue.moved),Di(le),ue.event(le).end()},!0),ve=io(J,_e),Ve=J.clientX,Qe=J.clientY;Ox(J.view),Wu(J),ue.mouse=[ve,this.__zoom.invert(ve)],tm(this),ue.start()}}function te(J,...fe){if(oe.apply(this,arguments)){var _e=this.__zoom,ue=io(J.changedTouches?J.changedTouches[0]:J,this),je=_e.invert(ue),ve=_e.k*(J.shiftKey?.5:2),Ve=Q(Re(Te(_e,ve),ue,je),G.apply(this,fe),ge);Di(J),ie>0?to(this).transition().duration(ie).call(ze,Ve,ue,J):to(this).call(me.transform,Ve,ue,J)}}function Ce(J,...fe){if(oe.apply(this,arguments)){var _e,ue,je,ve,Ve=J.touches,Qe=Ve.length,le=Ne(this,fe,J.changedTouches.length===Qe).event(J);for(Wu(J),ue=0;ue<Qe;++ue)ve=[ve=io(je=Ve[ue],this),this.__zoom.invert(ve),je.identifier],le.touch0?le.touch1||le.touch0[2]===ve[2]||(le.touch1=ve,le.taps=0):(le.touch0=ve,_e=!0,le.taps=1+!!q);q&&(q=clearTimeout(q)),_e&&(le.taps<2&&(re=ve[0],q=setTimeout(function(){q=null},500)),tm(this),le.start())}}function Me(J,...fe){if(this.__zooming){var _e,ue,je,ve,Ve=Ne(this,fe).event(J),Qe=J.changedTouches,le=Qe.length;for(Di(J),_e=0;_e<le;++_e)je=io(ue=Qe[_e],this),Ve.touch0&&Ve.touch0[2]===ue.identifier?Ve.touch0[0]=je:Ve.touch1&&Ve.touch1[2]===ue.identifier&&(Ve.touch1[0]=je);if(ue=Ve.that.__zoom,Ve.touch1){var Ee=Ve.touch0[0],Ie=Ve.touch0[1],Ue=Ve.touch1[0],qe=Ve.touch1[1],De=(De=Ue[0]-Ee[0])*De+(De=Ue[1]-Ee[1])*De,Ye=(Ye=qe[0]-Ie[0])*Ye+(Ye=qe[1]-Ie[1])*Ye;ue=Te(ue,Math.sqrt(De/Ye)),je=[(Ee[0]+Ue[0])/2,(Ee[1]+Ue[1])/2],ve=[(Ie[0]+qe[0])/2,(Ie[1]+qe[1])/2]}else{if(!Ve.touch0)return;je=Ve.touch0[0],ve=Ve.touch0[1]}Ve.zoom("touch",Q(Re(ue,je,ve),Ve.extent,ge))}}function Be(J,...fe){if(this.__zooming){var _e,ue,je=Ne(this,fe).event(J),ve=J.changedTouches,Ve=ve.length;for(Wu(J),ne&&clearTimeout(ne),ne=setTimeout(function(){ne=null},500),_e=0;_e<Ve;++_e)ue=ve[_e],je.touch0&&je.touch0[2]===ue.identifier?delete je.touch0:je.touch1&&je.touch1[2]===ue.identifier&&delete je.touch1;if(je.touch1&&!je.touch0&&(je.touch0=je.touch1,delete je.touch1),je.touch0)je.touch0[1]=this.__zoom.invert(je.touch0[0]);else if(je.end(),je.taps===2&&(ue=io(ue,this),Math.hypot(re[0]-ue[0],re[1]-ue[1])<Se)){var Qe=to(this).on("dblclick.zoom");Qe&&Qe.apply(this,arguments)}}}return me.transform=function(J,fe,_e,ue){var je=J.selection?J.selection():J;je.property("__zoom",Rx),J!==je?ze(J,fe,_e,ue):je.interrupt().each(function(){Ne(this,arguments).event(ue).start().zoom(null,typeof fe=="function"?fe.apply(this,arguments):fe).end()})},me.scaleBy=function(J,fe,_e,ue){me.scaleTo(J,function(){return this.__zoom.k*(typeof fe=="function"?fe.apply(this,arguments):fe)},_e,ue)},me.scaleTo=function(J,fe,_e,ue){me.transform(J,function(){var je=G.apply(this,arguments),ve=this.__zoom,Ve=_e==null?$e(je):typeof _e=="function"?_e.apply(this,arguments):_e,Qe=ve.invert(Ve),le=typeof fe=="function"?fe.apply(this,arguments):fe;return Q(Re(Te(ve,le),Ve,Qe),je,ge)},_e,ue)},me.translateBy=function(J,fe,_e,ue){me.transform(J,function(){return Q(this.__zoom.translate(typeof fe=="function"?fe.apply(this,arguments):fe,typeof _e=="function"?_e.apply(this,arguments):_e),G.apply(this,arguments),ge)},null,ue)},me.translateTo=function(J,fe,_e,ue,je){me.transform(J,function(){var ve=G.apply(this,arguments),Ve=this.__zoom,Qe=ue==null?$e(ve):typeof ue=="function"?ue.apply(this,arguments):ue;return Q(gr.translate(Qe[0],Qe[1]).scale(Ve.k).translate(typeof fe=="function"?-fe.apply(this,arguments):-fe,typeof _e=="function"?-_e.apply(this,arguments):-_e),ve,ge)},ue,je)},Ke.prototype={event:function(J){return J&&(this.sourceEvent=J),this},start:function(){return++this.active==1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(J,fe){return this.mouse&&J!=="mouse"&&(this.mouse[1]=fe.invert(this.mouse[0])),this.touch0&&J!=="touch"&&(this.touch0[1]=fe.invert(this.touch0[0])),this.touch1&&J!=="touch"&&(this.touch1[1]=fe.invert(this.touch1[0])),this.that.__zoom=fe,this.emit("zoom"),this},end:function(){return--this.active==0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(J){var fe=to(this.that).datum();we.call(J,this.that,new fO(J,{sourceEvent:this.sourceEvent,target:me,transform:this.that.__zoom,dispatch:we}),fe)}},me.wheelDelta=function(J){return arguments.length?(ce=typeof J=="function"?J:Il(+J),me):ce},me.filter=function(J){return arguments.length?(oe=typeof J=="function"?J:Il(!!J),me):oe},me.touchable=function(J){return arguments.length?(pe=typeof J=="function"?J:Il(!!J),me):pe},me.extent=function(J){return arguments.length?(G=typeof J=="function"?J:Il([[+J[0][0],+J[0][1]],[+J[1][0],+J[1][1]]]),me):G},me.scaleExtent=function(J){return arguments.length?(de[0]=+J[0],de[1]=+J[1],me):[de[0],de[1]]},me.translateExtent=function(J){return arguments.length?(ge[0][0]=+J[0][0],ge[1][0]=+J[1][0],ge[0][1]=+J[0][1],ge[1][1]=+J[1][1],me):[[ge[0][0],ge[0][1]],[ge[1][0],ge[1][1]]]},me.constrain=function(J){return arguments.length?(Q=J,me):Q},me.duration=function(J){return arguments.length?(ie=+J,me):ie},me.interpolate=function(J){return arguments.length?(xe=J,me):xe},me.on=function(){var J=we.on.apply(we,arguments);return J===we?me:J},me.clickDistance=function(J){return arguments.length?(ae=(J=+J)*J,me):Math.sqrt(ae)},me.tapDistance=function(J){return arguments.length?(Se=+J,me):Se},me}().scaleExtent([_,g]).translateExtent(p),N=to(E.current).call(H),$=gr.translate(f.x,f.y).scale(is(f.zoom,_,g)),Y=[[0,0],[C.width,C.height]],Z=H.constrain()($,Y,p);H.transform(N,Z),H.wheelDelta(Cw),k.setState({d3Zoom:H,d3Selection:N,d3ZoomHandler:N.on("wheel.zoom"),transform:[Z.x,Z.y,Z.k],domNode:E.current.closest(".react-flow")})}},[]),A.useEffect(()=>{L&&M&&(!i||z||O?B!==void 0&&L.on("wheel.zoom",function(C,H){if(!b&&C.type==="wheel"&&!C.ctrlKey||us(C,y))return null;C.preventDefault(),B.call(this,C,H)},{passive:!1}):L.on("wheel.zoom",C=>{if(us(C,y))return!1;C.preventDefault(),C.stopImmediatePropagation();const H=L.property("__zoom").k||1;if(C.ctrlKey&&s){const oe=io(C),G=Cw(C),Q=H*Math.pow(2,G);return void M.scaleTo(L,Q,oe,C)}const N=C.deltaMode===1?20:1;let $=l===Qo.Vertical?0:C.deltaX*N,Y=l===Qo.Horizontal?0:C.deltaY*N;!Ml()&&C.shiftKey&&l!==Qo.Vertical&&($=C.deltaY*N,Y=0),M.translateBy(L,-$/H*a,-Y/H*a,{internal:!0});const Z=zl(L.property("__zoom")),{onViewportChangeStart:q,onViewportChange:re,onViewportChangeEnd:ne}=k.getState();clearTimeout(P.current),V.current||(V.current=!0,e==null||e(C,Z),q==null||q(Z)),V.current&&(t==null||t(C,Z),re==null||re(Z),P.current=setTimeout(()=>{n==null||n(C,Z),ne==null||ne(Z),V.current=!1},150))},{passive:!1}))},[O,i,l,L,M,B,z,s,b,y,e,t,n]),A.useEffect(()=>{M&&M.on("start",C=>{var $,Y;if(!C.sourceEvent||C.sourceEvent.internal)return null;F.current=($=C.sourceEvent)==null?void 0:$.button;const{onViewportChangeStart:H}=k.getState(),N=zl(C.transform);I.current=!0,T.current=N,((Y=C.sourceEvent)==null?void 0:Y.type)==="mousedown"&&k.setState({paneDragging:!0}),H==null||H(N),e==null||e(C.sourceEvent,N)})},[M,e]),A.useEffect(()=>{M&&(O&&!I.current?M.on("zoom",null):O||M.on("zoom",C=>{var N;const{onViewportChange:H}=k.getState();if(k.setState({transform:[C.transform.x,C.transform.y,C.transform.k]}),j.current=!(!o||!Sw(u,F.current??0)),(t||H)&&!((N=C.sourceEvent)!=null&&N.internal)){const $=zl(C.transform);H==null||H($),t==null||t(C.sourceEvent,$)}}))},[O,M,t,u,o]),A.useEffect(()=>{M&&M.on("end",C=>{if(!C.sourceEvent||C.sourceEvent.internal)return null;const{onViewportChangeEnd:H}=k.getState();if(I.current=!1,k.setState({paneDragging:!1}),o&&Sw(u,F.current??0)&&!j.current&&o(C.sourceEvent),j.current=!1,(n||H)&&(N=T.current,$=C.transform,N.x!==$.x||N.y!==$.y||N.zoom!==$.k)){const Y=zl(C.transform);T.current=Y,clearTimeout(S.current),S.current=setTimeout(()=>{H==null||H(Y),n==null||n(C.sourceEvent,Y)},i?150:0)}var N,$})},[M,i,u,n,o]),A.useEffect(()=>{M&&M.filter(C=>{const H=z||r,N=s&&C.ctrlKey;if((u===!0||Array.isArray(u)&&u.includes(1))&&C.button===1&&C.type==="mousedown"&&(us(C,"react-flow__node")||us(C,"react-flow__edge")))return!0;if(!(u||H||i||c||s)||O||!c&&C.type==="dblclick"||us(C,y)&&C.type==="wheel"||us(C,v)&&(C.type!=="wheel"||i&&C.type==="wheel"&&!z)||!s&&C.ctrlKey&&C.type==="wheel"||!H&&!i&&!N&&C.type==="wheel"||!u&&(C.type==="mousedown"||C.type==="touchstart")||Array.isArray(u)&&!u.includes(C.button)&&C.type==="mousedown")return!1;const $=Array.isArray(u)&&u.includes(C.button)||!C.button||C.button<=1;return(!C.ctrlKey||C.type==="wheel")&&$})},[O,M,r,s,i,c,u,d,z]),K.createElement("div",{className:"react-flow__renderer",ref:E,style:uh},x)},e9=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function t9(){const{userSelectionActive:t,userSelectionRect:e}=pt(e9,nn);return t&&e?K.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 Nw(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 jw(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&&Nw(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&&Nw(o,i);break;case"remove":return o}return o.push(i),o},n)}function Ew(t,e){return jw(t,e)}const nr=(t,e)=>({id:t,type:"select",selected:e});function hs(t,e){return t.reduce((n,o)=>{const r=e.includes(o.id);return!o.selected&&r?(o.selected=!0,n.push(nr(o.id,!0))):o.selected&&!r&&(o.selected=!1,n.push(nr(o.id,!1))),n},[])}const hh=(t,e)=>n=>{n.target===e.current&&(t==null||t(n))},n9=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,dragging:t.paneDragging}),Iw=A.memo(({isSelecting:t,selectionMode:e=Li.Full,panOnDrag:n,onSelectionStart:o,onSelectionEnd:r,onPaneClick:s,onPaneContextMenu:i,onPaneScroll:a,onPaneMouseEnter:l,onPaneMouseMove:c,onPaneMouseLeave:d,children:u})=>{const f=A.useRef(null),p=qt(),_=A.useRef(0),g=A.useRef(0),m=A.useRef(),{userSelectionActive:b,elementsSelectable:x,dragging:y}=pt(n9,nn),v=()=>{p.setState({userSelectionActive:!1,userSelectionRect:null}),_.current=0,g.current=0},S=j=>{s==null||s(j),p.getState().resetSelectedElements(),p.setState({nodesSelectionActive:!1})},k=a?j=>a(j):void 0,I=x&&(t||b);return K.createElement("div",{className:un(["react-flow__pane",{dragging:y,selection:t}]),onClick:I?void 0:hh(S,f),onContextMenu:hh(j=>{Array.isArray(n)&&(n!=null&&n.includes(2))?j.preventDefault():i==null||i(j)},f),onWheel:hh(k,f),onMouseEnter:I?void 0:l,onMouseDown:I?j=>{const{resetSelectedElements:E,domNode:T}=p.getState();if(m.current=T==null?void 0:T.getBoundingClientRect(),!x||!t||j.button!==0||j.target!==f.current||!m.current)return;const{x:M,y:L}=Zo(j,m.current);E(),p.setState({userSelectionRect:{width:0,height:0,startX:M,startY:L,x:M,y:L}}),o==null||o(j)}:void 0,onMouseMove:I?j=>{const{userSelectionRect:E,nodeInternals:T,edges:M,transform:L,onNodesChange:B,onEdgesChange:O,nodeOrigin:z,getNodes:F}=p.getState();if(!t||!m.current||!E)return;p.setState({userSelectionActive:!0,nodesSelectionActive:!1});const V=Zo(j,m.current),P=E.startX??0,C=E.startY??0,H={...E,x:V.x<P?V.x:P,y:V.y<C?V.y:C,width:Math.abs(V.x-P),height:Math.abs(V.y-C)},N=F(),$=tw(T,H,L,e===Li.Partial,!0,z),Y=nw($,M).map(q=>q.id),Z=$.map(q=>q.id);if(_.current!==Z.length){_.current=Z.length;const q=hs(N,Z);q.length&&(B==null||B(q))}if(g.current!==Y.length){g.current=Y.length;const q=hs(M,Y);q.length&&(O==null||O(q))}p.setState({userSelectionRect:H})}:c,onMouseUp:I?j=>{if(j.button!==0)return;const{userSelectionRect:E}=p.getState();!b&&E&&j.target===f.current&&(S==null||S(j)),p.setState({nodesSelectionActive:_.current>0}),v(),r==null||r(j)}:void 0,onMouseLeave:I?j=>{b&&(p.setState({nodesSelectionActive:_.current>0}),r==null||r(j)),v()}:d,ref:f,style:uh},u,K.createElement(t9,null))});function Aw(t,e){const n=t.parentNode||t.parentId;if(!n)return!1;const o=e.get(n);return!!o&&(!!o.selected||Aw(o,e))}function Tw(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 o9(t,e,n,o){return Array.from(t.values()).filter(r=>(r.selected||r.id===o)&&(!r.parentNode||r.parentId||!Aw(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 Mw(t,e,n,o,r=[0,0],s){const i=function(u,f){return f&&f!=="parent"?[f[0],[f[1][0]-(u.width||0),f[1][1]-(u.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 u=n.get(l),{x:f,y:p}=ls(u,r).positionAbsolute;a=[[t.extent[0][0]+f,t.extent[0][1]+p],[t.extent[1][0]+f,t.extent[1][1]+p]]}}else if(l&&t.width&&t.height){const u=n.get(l),{x:f,y:p}=ls(u,r).positionAbsolute;a=u&&Pn(f)&&Pn(p)&&Pn(u.width)&&Pn(u.height)?[[f+t.width*r[0],p+t.height*r[1]],[f+u.width-t.width+t.width*r[0],p+u.height-t.height+t.height*r[1]]]:a}else s==null||s("005",vO()),a=i;let c={x:0,y:0};if(l){const u=n.get(l);c=ls(u,r).positionAbsolute}const d=a&&a!=="parent"?Gu(e,a):e;return{position:{x:d.x-c.x,y:d.y-c.y},positionAbsolute:d}}function fh({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]}Iw.displayName="Pane";const Ow=(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,...qu(c)}})};function Ui(t,e,n){return n===void 0?n:o=>{const r=e().nodeInternals.get(t);r&&n(o,{...r})}}function ph({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",jO(t))}function mh(t){return(e,n,o)=>t==null?void 0:t(e,o)}function Dw({nodeRef:t,disabled:e=!1,noDragClassName:n,handleSelector:o,nodeId:r,isSelectable:s,selectNodesOnDrag:i}){const a=qt(),[l,c]=A.useState(!1),d=A.useRef([]),u=A.useRef({x:null,y:null}),f=A.useRef(0),p=A.useRef(null),_=A.useRef({x:0,y:0}),g=A.useRef(null),m=A.useRef(!1),b=A.useRef(!1),x=A.useRef(!1),y=function(){const v=qt();return A.useCallback(({sourceEvent:k})=>{const{transform:I,snapGrid:j,snapToGrid:E}=v.getState(),T=k.touches?k.touches[0].clientX:k.clientX,M=k.touches?k.touches[0].clientY:k.clientY,L={x:(T-I[0])/I[2],y:(M-I[1])/I[2]};return{xSnapped:E?j[0]*Math.round(L.x/j[0]):L.x,ySnapped:E?j[1]*Math.round(L.y/j[1]):L.y,...L}},[])}();return A.useEffect(()=>{if(t!=null&&t.current){const v=to(t.current),S=({x:j,y:E})=>{const{nodeInternals:T,onNodeDrag:M,onSelectionDrag:L,updateNodePositions:B,nodeExtent:O,snapGrid:z,snapToGrid:F,nodeOrigin:V,onError:P}=a.getState();u.current={x:j,y:E};let C=!1,H={x:0,y:0,x2:0,y2:0};if(d.current.length>1&&O){const $=sh(d.current,V);H=Yu($)}if(d.current=d.current.map($=>{const Y={x:j-$.distance.x,y:E-$.distance.y};F&&(Y.x=z[0]*Math.round(Y.x/z[0]),Y.y=z[1]*Math.round(Y.y/z[1]));const Z=[[O[0][0],O[0][1]],[O[1][0],O[1][1]]];d.current.length>1&&O&&!$.extent&&(Z[0][0]=$.positionAbsolute.x-H.x+O[0][0],Z[1][0]=$.positionAbsolute.x+($.width??0)-H.x2+O[1][0],Z[0][1]=$.positionAbsolute.y-H.y+O[0][1],Z[1][1]=$.positionAbsolute.y+($.height??0)-H.y2+O[1][1]);const q=Mw($,Y,T,Z,V,P);return C=C||$.position.x!==q.position.x||$.position.y!==q.position.y,$.position=q.position,$.positionAbsolute=q.positionAbsolute,$}),!C)return;B(d.current,!0,!0),c(!0);const N=r?M:mh(L);if(N&&g.current){const[$,Y]=fh({nodeId:r,dragItems:d.current,nodeInternals:T});N(g.current,$,Y)}},k=()=>{if(!p.current)return;const[j,E]=Fx(_.current,p.current);if(j!==0||E!==0){const{transform:T,panBy:M}=a.getState();u.current.x=(u.current.x??0)-j/T[2],u.current.y=(u.current.y??0)-E/T[2],M({x:j,y:E})&&S(u.current)}f.current=requestAnimationFrame(k)},I=j=>{var V;const{nodeInternals:E,multiSelectionActive:T,nodesDraggable:M,unselectNodesAndEdges:L,onNodeDragStart:B,onSelectionDragStart:O}=a.getState();b.current=!0;const z=r?B:mh(O);i&&s||T||!r||(V=E.get(r))!=null&&V.selected||L(),r&&s&&i&&ph({id:r,store:a,nodeRef:t});const F=y(j);if(u.current=F,d.current=o9(E,M,F,r),z&&d.current){const[P,C]=fh({nodeId:r,dragItems:d.current,nodeInternals:E});z(j.sourceEvent,P,C)}};if(!e){const j=function(){var E,T,M,L,B=cO,O=dO,z=uO,F=hO,V={},P=NS("start","drag","end"),C=0,H=0;function N(G){G.on("mousedown.drag",$).filter(F).on("touchstart.drag",q).on("touchmove.drag",re,lO).on("touchend.drag touchcancel.drag",ne).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function $(G,Q){if(!L&&B.call(this,G,Q)){var ce=oe(this,O.call(this,G,Q),G,Q,"mouse");ce&&(to(G.view).on("mousemove.drag",Y,Oi).on("mouseup.drag",Z,Oi),Ox(G.view),Hu(G),M=!1,E=G.clientX,T=G.clientY,ce("start",G))}}function Y(G){if(ss(G),!M){var Q=G.clientX-E,ce=G.clientY-T;M=Q*Q+ce*ce>H}V.mouse("drag",G)}function Z(G){to(G.view).on("mousemove.drag mouseup.drag",null),Dx(G.view,M),ss(G),V.mouse("end",G)}function q(G,Q){if(B.call(this,G,Q)){var ce,pe,de=G.changedTouches,ge=O.call(this,G,Q),ie=de.length;for(ce=0;ce<ie;++ce)(pe=oe(this,ge,G,Q,de[ce].identifier,de[ce]))&&(Hu(G),pe("start",G,de[ce]))}}function re(G){var Q,ce,pe=G.changedTouches,de=pe.length;for(Q=0;Q<de;++Q)(ce=V[pe[Q].identifier])&&(ss(G),ce("drag",G,pe[Q]))}function ne(G){var Q,ce,pe=G.changedTouches,de=pe.length;for(L&&clearTimeout(L),L=setTimeout(function(){L=null},500),Q=0;Q<de;++Q)(ce=V[pe[Q].identifier])&&(Hu(G),ce("end",G,pe[Q]))}function oe(G,Q,ce,pe,de,ge){var ie,xe,we,ae=P.copy(),Se=io(ge||ce,Q);if((we=z.call(G,new $u("beforestart",{sourceEvent:ce,target:N,identifier:de,active:C,x:Se[0],y:Se[1],dx:0,dy:0,dispatch:ae}),pe))!=null)return ie=we.x-Se[0]||0,xe=we.y-Se[1]||0,function me(Te,Re,$e){var ze,Ne=Se;switch(Te){case"start":V[de]=me,ze=C++;break;case"end":delete V[de],--C;case"drag":Se=io($e||Re,Q),ze=C}ae.call(Te,G,new $u(Te,{sourceEvent:Re,subject:we,target:N,identifier:de,active:ze,x:Se[0]+ie,y:Se[1]+xe,dx:Se[0]-Ne[0],dy:Se[1]-Ne[1],dispatch:ae}),pe)}}return N.filter=function(G){return arguments.length?(B=typeof G=="function"?G:El(!!G),N):B},N.container=function(G){return arguments.length?(O=typeof G=="function"?G:El(G),N):O},N.subject=function(G){return arguments.length?(z=typeof G=="function"?G:El(G),N):z},N.touchable=function(G){return arguments.length?(F=typeof G=="function"?G:El(!!G),N):F},N.on=function(){var G=P.on.apply(P,arguments);return G===P?N:G},N.clickDistance=function(G){return arguments.length?(H=(G=+G)*G,N):Math.sqrt(H)},N}().on("start",E=>{const{domNode:T,nodeDragThreshold:M}=a.getState();M===0&&I(E),x.current=!1;const L=y(E);u.current=L,p.current=(T==null?void 0:T.getBoundingClientRect())||null,_.current=Zo(E.sourceEvent,p.current)}).on("drag",E=>{var B,O;const T=y(E),{autoPanOnNodeDrag:M,nodeDragThreshold:L}=a.getState();if(E.sourceEvent.type==="touchmove"&&E.sourceEvent.touches.length>1&&(x.current=!0),!x.current){if(!m.current&&b.current&&M&&(m.current=!0,k()),!b.current){const z=T.xSnapped-(((B=u==null?void 0:u.current)==null?void 0:B.x)??0),F=T.ySnapped-(((O=u==null?void 0:u.current)==null?void 0:O.y)??0);Math.sqrt(z*z+F*F)>L&&I(E)}(u.current.x!==T.xSnapped||u.current.y!==T.ySnapped)&&d.current&&b.current&&(g.current=E.sourceEvent,_.current=Zo(E.sourceEvent,p.current),S(T))}}).on("end",E=>{if(b.current&&!x.current&&(c(!1),m.current=!1,b.current=!1,cancelAnimationFrame(f.current),d.current)){const{updateNodePositions:T,nodeInternals:M,onNodeDragStop:L,onSelectionDragStop:B}=a.getState(),O=r?L:mh(B);if(T(d.current,!1,!1),O){const[z,F]=fh({nodeId:r,dragItems:d.current,nodeInternals:M});O(E.sourceEvent,z,F)}}}).filter(E=>{const T=E.target;return!E.button&&(!n||!Tw(T,`.${n}`,t))&&(!o||Tw(T,o,t))});return v.call(j),()=>{v.on(".drag",null)}}v.on(".drag",null)}},[t,e,n,o,s,a,r,i,y]),l}function Rw(){const t=qt();return A.useCallback(n=>{const{nodeInternals:o,nodeExtent:r,updateNodePositions:s,getNodes:i,snapToGrid:a,snapGrid:l,onError:c,nodesDraggable:d}=t.getState(),u=i().filter(x=>x.selected&&(x.draggable||d&&x.draggable===void 0)),f=a?l[0]:5,p=a?l[1]:5,_=n.isShiftPressed?4:1,g=n.x*f*_,m=n.y*p*_,b=u.map(x=>{if(x.positionAbsolute){const y={x:x.positionAbsolute.x+g,y:x.positionAbsolute.y+m};a&&(y.x=l[0]*Math.round(y.x/l[0]),y.y=l[1]*Math.round(y.y/l[1]));const{positionAbsolute:v,position:S}=Mw(x,y,o,r,void 0,c);x.position=S,x.positionAbsolute=v}return x});s(b,!0,!1)},[])}const fs={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var Vi=t=>{const e=({id:n,type:o,data:r,xPos:s,yPos:i,xPosOrigin:a,yPosOrigin:l,selected:c,onClick:d,onMouseEnter:u,onMouseMove:f,onMouseLeave:p,onContextMenu:_,onDoubleClick:g,style:m,className:b,isDraggable:x,isSelectable:y,isConnectable:v,isFocusable:S,selectNodesOnDrag:k,sourcePosition:I,targetPosition:j,hidden:E,resizeObserver:T,dragHandle:M,zIndex:L,isParent:B,noDragClassName:O,noPanClassName:z,initialized:F,disableKeyboardA11y:V,ariaLabel:P,rfId:C,hasHandleBounds:H})=>{const N=qt(),$=A.useRef(null),Y=A.useRef(null),Z=A.useRef(I),q=A.useRef(j),re=A.useRef(o),ne=y||x||d||u||f||p,oe=Rw(),G=Ui(n,N.getState,u),Q=Ui(n,N.getState,f),ce=Ui(n,N.getState,p),pe=Ui(n,N.getState,_),de=Ui(n,N.getState,g);A.useEffect(()=>()=>{Y.current&&(T==null||T.unobserve(Y.current),Y.current=null)},[]),A.useEffect(()=>{if($.current&&!E){const ie=$.current;F&&H&&Y.current===ie||(Y.current&&(T==null||T.unobserve(Y.current)),T==null||T.observe(ie),Y.current=ie)}},[E,F,H]),A.useEffect(()=>{const ie=re.current!==o,xe=Z.current!==I,we=q.current!==j;$.current&&(ie||xe||we)&&(ie&&(re.current=o),xe&&(Z.current=I),we&&(q.current=j),N.getState().updateNodeDimensions([{id:n,nodeElement:$.current,forceUpdate:!0}]))},[n,o,I,j]);const ge=Dw({nodeRef:$,disabled:E||!x,noDragClassName:O,handleSelector:M,nodeId:n,isSelectable:y,selectNodesOnDrag:k});return E?null:K.createElement("div",{className:un(["react-flow__node",`react-flow__node-${o}`,{[z]:x},b,{selected:c,selectable:y,parent:B,dragging:ge}]),ref:$,style:{zIndex:L,transform:`translate(${a}px,${l}px)`,pointerEvents:ne?"all":"none",visibility:F?"visible":"hidden",...m},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:G,onMouseMove:Q,onMouseLeave:ce,onContextMenu:pe,onClick:ie=>{const{nodeDragThreshold:xe}=N.getState();if(y&&(!k||!x||xe>0)&&ph({id:n,store:N,nodeRef:$}),d){const we=N.getState().nodeInternals.get(n);we&&d(ie,{...we})}},onDoubleClick:de,onKeyDown:S?ie=>{if(!Ku(ie)&&!V)if(Ux.includes(ie.key)&&y){const xe=ie.key==="Escape";ph({id:n,store:N,unselect:xe,nodeRef:$})}else x&&c&&Object.prototype.hasOwnProperty.call(fs,ie.key)&&(N.setState({ariaLiveMessage:`Moved selected node ${ie.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~s}, y: ${~~i}`}),oe({x:fs[ie.key].x,y:fs[ie.key].y,isShiftPressed:ie.shiftKey}))}:void 0,tabIndex:S?0:void 0,role:S?"button":void 0,"aria-describedby":V?void 0:`${_w}-${C}`,"aria-label":P},K.createElement(MO,{value:n},K.createElement(t,{id:n,data:r,type:o,xPos:s,yPos:i,selected:c,isConnectable:v,sourcePosition:I,targetPosition:j,dragging:ge,dragHandle:M,zIndex:L})))};return e.displayName="NodeWrapper",A.memo(e)};const r9=t=>{const e=t.getNodes().filter(n=>n.selected);return{...sh(e,t.nodeOrigin),transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`,userSelectionActive:t.userSelectionActive}};var s9=A.memo(function({onSelectionContextMenu:t,noPanClassName:e,disableKeyboardA11y:n}){const o=qt(),{width:r,height:s,x:i,y:a,transformString:l,userSelectionActive:c}=pt(r9,nn),d=Rw(),u=A.useRef(null);if(A.useEffect(()=>{var p;n||((p=u.current)==null||p.focus({preventScroll:!0}))},[n]),Dw({nodeRef:u}),c||!r||!s)return null;const f=t?p=>{const _=o.getState().getNodes().filter(g=>g.selected);t(p,_)}:void 0;return K.createElement("div",{className:un(["react-flow__nodesselection","react-flow__container",e]),style:{transform:l}},K.createElement("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:p=>{Object.prototype.hasOwnProperty.call(fs,p.key)&&d({x:fs[p.key].x,y:fs[p.key].y,isShiftPressed:p.shiftKey})},style:{width:r,height:s,top:a,left:i}}))});const i9=t=>t.nodesSelectionActive,Pw=({children:t,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:i,deleteKeyCode:a,onMove:l,onMoveStart:c,onMoveEnd:d,selectionKeyCode:u,selectionOnDrag:f,selectionMode:p,onSelectionStart:_,onSelectionEnd:g,multiSelectionKeyCode:m,panActivationKeyCode:b,zoomActivationKeyCode:x,elementsSelectable:y,zoomOnScroll:v,zoomOnPinch:S,panOnScroll:k,panOnScrollSpeed:I,panOnScrollMode:j,zoomOnDoubleClick:E,panOnDrag:T,defaultViewport:M,translateExtent:L,minZoom:B,maxZoom:O,preventScrolling:z,onSelectionContextMenu:F,noWheelClassName:V,noPanClassName:P,disableKeyboardA11y:C})=>{const H=pt(i9),N=zi(u),$=zi(b),Y=$||T,Z=$||k,q=N||f&&Y!==!0;return(({deleteKeyCode:re,multiSelectionKeyCode:ne})=>{const oe=qt(),{deleteElements:G}=Bi(),Q=zi(re,XO),ce=zi(ne);A.useEffect(()=>{if(Q){const{edges:pe,getNodes:de}=oe.getState(),ge=de().filter(xe=>xe.selected),ie=pe.filter(xe=>xe.selected);G({nodes:ge,edges:ie}),oe.setState({nodesSelectionActive:!1})}},[Q]),A.useEffect(()=>{oe.setState({multiSelectionActive:ce})},[ce])})({deleteKeyCode:a,multiSelectionKeyCode:m}),K.createElement(QO,{onMove:l,onMoveStart:c,onMoveEnd:d,onPaneContextMenu:s,elementsSelectable:y,zoomOnScroll:v,zoomOnPinch:S,panOnScroll:Z,panOnScrollSpeed:I,panOnScrollMode:j,zoomOnDoubleClick:E,panOnDrag:!N&&Y,defaultViewport:M,translateExtent:L,minZoom:B,maxZoom:O,zoomActivationKeyCode:x,preventScrolling:z,noWheelClassName:V,noPanClassName:P},K.createElement(Iw,{onSelectionStart:_,onSelectionEnd:g,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:i,panOnDrag:Y,isSelecting:!!q,selectionMode:p},t,H&&K.createElement(s9,{onSelectionContextMenu:F,noPanClassName:P,disableKeyboardA11y:C})))};Pw.displayName="FlowRenderer";var a9=A.memo(Pw);function l9(t){return{input:Vi(t.input||hw),default:Vi(t.default||lh),output:Vi(t.output||pw),group:Vi(t.group||ch),...Object.keys(t).filter(e=>!["input","default","output","group"].includes(e)).reduce((e,n)=>(e[n]=Vi(t[n]||lh),e),{})}}const c9=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,updateNodeDimensions:t.updateNodeDimensions,onError:t.onError}),Lw=t=>{const{nodesDraggable:e,nodesConnectable:n,nodesFocusable:o,elementsSelectable:r,updateNodeDimensions:s,onError:i}=pt(c9,nn),a=(l=t.onlyRenderVisibleElements,pt(A.useCallback(u=>l?tw(u.nodeInternals,{x:0,y:0,width:u.width,height:u.height},u.transform,!0):u.getNodes(),[l])));var l;const c=A.useRef(),d=A.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const u=new ResizeObserver(f=>{const p=f.map(_=>({id:_.target.getAttribute("data-id"),nodeElement:_.target,forceUpdate:!0}));s(p)});return c.current=u,u},[]);return A.useEffect(()=>()=>{var u;(u=c==null?void 0:c.current)==null||u.disconnect()},[]),K.createElement("div",{className:"react-flow__nodes",style:uh},a.map(u=>{var k,I,j;let f=u.type||"default";t.nodeTypes[f]||(i==null||i("003",xO(f)),f="default");const p=t.nodeTypes[f]||t.nodeTypes.default,_=!!(u.draggable||e&&u.draggable===void 0),g=!!(u.selectable||r&&u.selectable===void 0),m=!!(u.connectable||n&&u.connectable===void 0),b=!!(u.focusable||o&&u.focusable===void 0),x=t.nodeExtent?Gu(u.positionAbsolute,t.nodeExtent):u.positionAbsolute,y=(x==null?void 0:x.x)??0,v=(x==null?void 0:x.y)??0,S=(({x:E,y:T,width:M,height:L,origin:B})=>M&&L?B[0]<0||B[1]<0||B[0]>1||B[1]>1?{x:E,y:T}:{x:E-M*B[0],y:T-L*B[1]}:{x:E,y:T})({x:y,y:v,width:u.width??0,height:u.height??0,origin:t.nodeOrigin});return K.createElement(p,{key:u.id,id:u.id,className:u.className,style:u.style,type:f,data:u.data,sourcePosition:u.sourcePosition||He.Bottom,targetPosition:u.targetPosition||He.Top,hidden:u.hidden,xPos:y,yPos:v,xPosOrigin:S.x,yPosOrigin:S.y,selectNodesOnDrag:t.selectNodesOnDrag,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,selected:!!u.selected,isDraggable:_,isSelectable:g,isConnectable:m,isFocusable:b,resizeObserver:d,dragHandle:u.dragHandle,zIndex:((k=u[Nt])==null?void 0:k.z)??0,isParent:!!((I=u[Nt])!=null&&I.isParent),noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,initialized:!!u.width&&!!u.height,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,ariaLabel:u.ariaLabel,hasHandleBounds:!!((j=u[Nt])!=null&&j.handleBounds)})}))};Lw.displayName="NodeRenderer";var d9=A.memo(Lw);const u9=(t,e,n)=>n===He.Left?t-e:n===He.Right?t+e:t,h9=(t,e,n)=>n===He.Top?t-e:n===He.Bottom?t+e:t,Fw="react-flow__edgeupdater",zw=({position:t,centerX:e,centerY:n,radius:o=10,onMouseDown:r,onMouseEnter:s,onMouseOut:i,type:a})=>K.createElement("circle",{onMouseDown:r,onMouseEnter:s,onMouseOut:i,className:un([Fw,`${Fw}-${a}`]),cx:u9(e,o,t),cy:h9(n,o,t),r:o,stroke:"transparent",fill:"transparent"}),f9=()=>!0;var ps=t=>{const e=({id:n,className:o,type:r,data:s,onClick:i,onEdgeDoubleClick:a,selected:l,animated:c,label:d,labelStyle:u,labelShowBg:f,labelBgStyle:p,labelBgPadding:_,labelBgBorderRadius:g,style:m,source:b,target:x,sourceX:y,sourceY:v,targetX:S,targetY:k,sourcePosition:I,targetPosition:j,elementsSelectable:E,hidden:T,sourceHandleId:M,targetHandleId:L,onContextMenu:B,onMouseEnter:O,onMouseMove:z,onMouseLeave:F,reconnectRadius:V,onReconnect:P,onReconnectStart:C,onReconnectEnd:H,markerEnd:N,markerStart:$,rfId:Y,ariaLabel:Z,isFocusable:q,isReconnectable:re,pathOptions:ne,interactionWidth:oe,disableKeyboardA11y:G})=>{const Q=A.useRef(null),[ce,pe]=A.useState(!1),[de,ge]=A.useState(!1),ie=qt(),xe=A.useMemo(()=>`url('#${oh($,Y)}')`,[$,Y]),we=A.useMemo(()=>`url('#${oh(N,Y)}')`,[N,Y]);if(T)return null;const ae=Pi(n,ie.getState,a),Se=Pi(n,ie.getState,B),me=Pi(n,ie.getState,O),Te=Pi(n,ie.getState,z),Re=Pi(n,ie.getState,F),$e=(nt,it)=>{if(nt.button!==0)return;const{edges:te,isValidConnection:Ce}=ie.getState(),Me=it?x:b,Be=(it?L:M)||null,J=it?"target":"source",fe=Ce||f9,_e=it,ue=te.find(je=>je.id===n);ge(!0),C==null||C(nt,ue,J),aw({event:nt,handleId:Be,nodeId:Me,onConnect:je=>P==null?void 0:P(ue,je),isTarget:_e,getState:ie.getState,setState:ie.setState,isValidConnection:fe,edgeUpdaterType:J,onReconnectEnd:je=>{ge(!1),H==null||H(je,ue,J)}})},ze=()=>pe(!0),Ne=()=>pe(!1),Ke=!E&&!i;return K.createElement("g",{className:un(["react-flow__edge",`react-flow__edge-${r}`,o,{selected:l,animated:c,inactive:Ke,updating:ce}]),onClick:nt=>{var J;const{edges:it,addSelectedEdges:te,unselectNodesAndEdges:Ce,multiSelectionActive:Me}=ie.getState(),Be=it.find(fe=>fe.id===n);Be&&(E&&(ie.setState({nodesSelectionActive:!1}),Be.selected&&Me?(Ce({nodes:[],edges:[Be]}),(J=Q.current)==null||J.blur()):te([n])),i&&i(nt,Be))},onDoubleClick:ae,onContextMenu:Se,onMouseEnter:me,onMouseMove:Te,onMouseLeave:Re,onKeyDown:q?nt=>{var it;if(!G&&Ux.includes(nt.key)&&E){const{unselectNodesAndEdges:te,addSelectedEdges:Ce,edges:Me}=ie.getState();nt.key==="Escape"?((it=Q.current)==null||it.blur(),te({edges:[Me.find(Be=>Be.id===n)]})):Ce([n])}}:void 0,tabIndex:q?0:void 0,role:q?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":Z===null?void 0:Z||`Edge from ${b} to ${x}`,"aria-describedby":q?`${bw}-${Y}`:void 0,ref:Q},!de&&K.createElement(t,{id:n,source:b,target:x,selected:l,animated:c,label:d,labelStyle:u,labelShowBg:f,labelBgStyle:p,labelBgPadding:_,labelBgBorderRadius:g,data:s,style:m,sourceX:y,sourceY:v,targetX:S,targetY:k,sourcePosition:I,targetPosition:j,sourceHandleId:M,targetHandleId:L,markerStart:xe,markerEnd:we,pathOptions:ne,interactionWidth:oe}),re&&K.createElement(K.Fragment,null,(re==="source"||re===!0)&&K.createElement(zw,{position:I,centerX:y,centerY:v,radius:V,onMouseDown:nt=>$e(nt,!0),onMouseEnter:ze,onMouseOut:Ne,type:"source"}),(re==="target"||re===!0)&&K.createElement(zw,{position:j,centerX:S,centerY:k,radius:V,onMouseDown:nt=>$e(nt,!1),onMouseEnter:ze,onMouseOut:Ne,type:"target"})))};return e.displayName="EdgeWrapper",A.memo(e)};function p9(t){return{default:ps(t.default||Pl),straight:ps(t.bezier||th),step:ps(t.step||eh),smoothstep:ps(t.step||Dl),simplebezier:ps(t.simplebezier||Zu),...Object.keys(t).filter(e=>!["default","bezier"].includes(e)).reduce((e,n)=>(e[n]=ps(t[n]||Pl),e),{})}}function Bw(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 He.Top:return{x:o+s/2,y:r};case He.Right:return{x:o+s,y:r+i/2};case He.Bottom:return{x:o+s/2,y:r+i};case He.Left:return{x:o,y:r+i/2}}}function Uw(t,e){return t?t.length!==1&&e?e&&t.find(n=>n.id===e)||null:t[0]:null}function Vw(t){var o,r,s,i,a;const e=((o=t==null?void 0:t[Nt])==null?void 0:o.handleBounds)||null,n=e&&(t==null?void 0:t.width)&&(t==null?void 0:t.height)&&((r=t==null?void 0:t.positionAbsolute)==null?void 0:r.x)!==void 0&&((s=t==null?void 0:t.positionAbsolute)==null?void 0:s.y)!==void 0;return[{x:((i=t==null?void 0:t.positionAbsolute)==null?void 0:i.x)||0,y:((a=t==null?void 0:t.positionAbsolute)==null?void 0:a.y)||0,width:(t==null?void 0:t.width)||0,height:(t==null?void 0:t.height)||0},e,!!n]}const m9=[{level:0,isMaxLevel:!0,edges:[]}];function g9(t,e,n){return function(o,r,s=!1){let i=-1;const a=o.reduce((c,d)=>{var p,_;const u=Pn(d.zIndex);let f=u?d.zIndex:0;if(s){const g=r.get(d.target),m=r.get(d.source),b=d.selected||(g==null?void 0:g.selected)||(m==null?void 0:m.selected),x=Math.max(((p=m==null?void 0:m[Nt])==null?void 0:p.z)||0,((_=g==null?void 0:g[Nt])==null?void 0:_.z)||0,1e3);f=(u?d.zIndex:0)+(b?x: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 u=+c;return{edges:d,level:u,isMaxLevel:u===i}});return l.length===0?m9:l}(pt(A.useCallback(o=>t?o.edges.filter(r=>{const s=e.get(r.source),i=e.get(r.target);return(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&(i==null?void 0:i.width)&&(i==null?void 0:i.height)&&function({sourcePos:a,targetPos:l,sourceWidth:c,sourceHeight:d,targetWidth:u,targetHeight:f,width:p,height:_,transform:g}){const m={x:Math.min(a.x,l.x),y:Math.min(a.y,l.y),x2:Math.max(a.x+c,l.x+u),y2:Math.max(a.y+d,l.y+f)};m.x===m.x2&&(m.x2+=1),m.y===m.y2&&(m.y2+=1);const b=Yu({x:(0-g[0])/g[2],y:(0-g[1])/g[2],width:p/g[2],height:_/g[2]}),x=Math.max(0,Math.min(b.x2,m.x2)-Math.max(b.x,m.x)),y=Math.max(0,Math.min(b.y2,m.y2)-Math.max(b.y,m.y));return Math.ceil(x*y)>0}({sourcePos:s.positionAbsolute||{x:0,y:0},targetPos:i.positionAbsolute||{x:0,y:0},sourceWidth:s.width,sourceHeight:s.height,targetWidth:i.width,targetHeight:i.height,width:o.width,height:o.height,transform:o.transform})}):o.edges,[t,e])),e,n)}const Hw={[as.Arrow]:({color:t="none",strokeWidth:e=1})=>K.createElement("polyline",{style:{stroke:t,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),[as.ArrowClosed]:({color:t="none",strokeWidth:e=1})=>K.createElement("polyline",{style:{stroke:t,fill:t,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},_9=({id:t,type:e,color:n,width:o=12.5,height:r=12.5,markerUnits:s="strokeWidth",strokeWidth:i,orient:a="auto-start-reverse"})=>{const l=function(c){const d=qt();return A.useMemo(()=>{var u,f;return Object.prototype.hasOwnProperty.call(Hw,c)?Hw[c]:((f=(u=d.getState()).onError)==null||f.call(u,"009",kO(c)),null)},[c])}(e);return l?K.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"},K.createElement(l,{color:n,strokeWidth:i})):null},$w=({defaultColor:t,rfId:e})=>{const n=pt(A.useCallback((({defaultColor:o,rfId:r})=>s=>{const i=[];return s.edges.reduce((a,l)=>([l.markerStart,l.markerEnd].forEach(c=>{if(c&&typeof c=="object"){const d=oh(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 K.createElement("defs",null,n.map(o=>K.createElement(_9,{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})))};$w.displayName="MarkerDefinitions";var b9=A.memo($w);const y9=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}),Ww=({defaultMarkerColor:t,onlyRenderVisibleElements:e,elevateEdgesOnSelect:n,rfId:o,edgeTypes:r,noPanClassName:s,onEdgeContextMenu:i,onEdgeMouseEnter:a,onEdgeMouseMove:l,onEdgeMouseLeave:c,onEdgeClick:d,onEdgeDoubleClick:u,onReconnect:f,onReconnectStart:p,onReconnectEnd:_,reconnectRadius:g,children:m,disableKeyboardA11y:b})=>{const{edgesFocusable:x,edgesUpdatable:y,elementsSelectable:v,width:S,height:k,connectionMode:I,nodeInternals:j,onError:E}=pt(y9,nn),T=g9(e,j,n);return S?K.createElement(K.Fragment,null,T.map(({level:M,edges:L,isMaxLevel:B})=>K.createElement("svg",{key:M,style:{zIndex:M},width:S,height:k,className:"react-flow__edges react-flow__container"},B&&K.createElement(b9,{defaultColor:t,rfId:o}),K.createElement("g",null,L.map(O=>{const[z,F,V]=Vw(j.get(O.source)),[P,C,H]=Vw(j.get(O.target));if(!V||!H)return null;let N=O.type||"default";r[N]||(E==null||E("011",NO(N)),N="default");const $=r[N]||r.default,Y=I===Ir.Strict?C.target:(C.target??[]).concat(C.source??[]),Z=Uw(F.source,O.sourceHandle),q=Uw(Y,O.targetHandle),re=(Z==null?void 0:Z.position)||He.Bottom,ne=(q==null?void 0:q.position)||He.Top,oe=!!(O.focusable||x&&O.focusable===void 0),G=O.reconnectable||O.updatable,Q=f!==void 0&&(G||y&&G===void 0);if(!Z||!q)return E==null||E("008",SO(Z,O)),null;const{sourceX:ce,sourceY:pe,targetX:de,targetY:ge}=((ie,xe,we,ae,Se,me)=>{const Te=Bw(we,ie,xe),Re=Bw(me,ae,Se);return{sourceX:Te.x,sourceY:Te.y,targetX:Re.x,targetY:Re.y}})(z,Z,re,P,q,ne);return K.createElement($,{key:O.id,id:O.id,className:un([O.className,s]),type:N,data:O.data,selected:!!O.selected,animated:!!O.animated,hidden:!!O.hidden,label:O.label,labelStyle:O.labelStyle,labelShowBg:O.labelShowBg,labelBgStyle:O.labelBgStyle,labelBgPadding:O.labelBgPadding,labelBgBorderRadius:O.labelBgBorderRadius,style:O.style,source:O.source,target:O.target,sourceHandleId:O.sourceHandle,targetHandleId:O.targetHandle,markerEnd:O.markerEnd,markerStart:O.markerStart,sourceX:ce,sourceY:pe,targetX:de,targetY:ge,sourcePosition:re,targetPosition:ne,elementsSelectable:v,onContextMenu:i,onMouseEnter:a,onMouseMove:l,onMouseLeave:c,onClick:d,onEdgeDoubleClick:u,onReconnect:f,onReconnectStart:p,onReconnectEnd:_,reconnectRadius:g,rfId:o,ariaLabel:O.ariaLabel,isFocusable:oe,isReconnectable:Q,pathOptions:"pathOptions"in O?O.pathOptions:void 0,interactionWidth:O.interactionWidth,disableKeyboardA11y:b})})))),m):null};Ww.displayName="EdgeRenderer";var x9=A.memo(Ww);const w9=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function v9({children:t}){const e=pt(w9);return K.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:e}},t)}const k9={[He.Left]:He.Right,[He.Right]:He.Left,[He.Top]:He.Bottom,[He.Bottom]:He.Top},qw=({nodeId:t,handleType:e,style:n,type:o=er.Bezier,CustomComponent:r,connectionStatus:s})=>{var k,I,j;const{fromNode:i,handleId:a,toX:l,toY:c,connectionMode:d}=pt(A.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]),nn),u=(k=i==null?void 0:i[Nt])==null?void 0:k.handleBounds;let f=u==null?void 0:u[e];if(d===Ir.Loose&&(f=f||(u==null?void 0:u[e==="source"?"target":"source"])),!i||!f)return null;const p=a?f.find(E=>E.id===a):f[0],_=p?p.x+p.width/2:(i.width??0)/2,g=p?p.y+p.height/2:i.height??0,m=(((I=i.positionAbsolute)==null?void 0:I.x)??0)+_,b=(((j=i.positionAbsolute)==null?void 0:j.y)??0)+g,x=p==null?void 0:p.position,y=x?k9[x]:null;if(!x||!y)return null;if(r)return K.createElement(r,{connectionLineType:o,connectionLineStyle:n,fromNode:i,fromHandle:p,fromX:m,fromY:b,toX:l,toY:c,fromPosition:x,toPosition:y,connectionStatus:s});let v="";const S={sourceX:m,sourceY:b,sourcePosition:x,targetX:l,targetY:c,targetPosition:y};return o===er.Bezier?[v]=Qx(S):o===er.Step?[v]=Qu({...S,borderRadius:0}):o===er.SmoothStep?[v]=Qu(S):o===er.SimpleBezier?[v]=Jx(S):v=`M${m},${b} ${l},${c}`,K.createElement("path",{d:v,fill:"none",className:"react-flow__connection-path",style:n})};qw.displayName="ConnectionLine";const S9=t=>({nodeId:t.connectionNodeId,handleType:t.connectionHandleType,nodesConnectable:t.nodesConnectable,connectionStatus:t.connectionStatus,width:t.width,height:t.height});function C9({containerStyle:t,style:e,type:n,component:o}){const{nodeId:r,handleType:s,nodesConnectable:i,width:a,height:l,connectionStatus:c}=pt(S9,nn);return r&&s&&a&&i?K.createElement("svg",{style:t,width:a,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container"},K.createElement("g",{className:un(["react-flow__connection",c])},K.createElement(qw,{nodeId:r,handleType:s,style:e,type:n,CustomComponent:o,connectionStatus:c}))):null}function Gw(t,e){return A.useRef(null),qt(),A.useMemo(()=>e(t),[t])}const Yw=({nodeTypes:t,edgeTypes:e,onMove:n,onMoveStart:o,onMoveEnd:r,onInit:s,onNodeClick:i,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:u,onNodeMouseLeave:f,onNodeContextMenu:p,onSelectionContextMenu:_,onSelectionStart:g,onSelectionEnd:m,connectionLineType:b,connectionLineStyle:x,connectionLineComponent:y,connectionLineContainerStyle:v,selectionKeyCode:S,selectionOnDrag:k,selectionMode:I,multiSelectionKeyCode:j,panActivationKeyCode:E,zoomActivationKeyCode:T,deleteKeyCode:M,onlyRenderVisibleElements:L,elementsSelectable:B,selectNodesOnDrag:O,defaultViewport:z,translateExtent:F,minZoom:V,maxZoom:P,preventScrolling:C,defaultMarkerColor:H,zoomOnScroll:N,zoomOnPinch:$,panOnScroll:Y,panOnScrollSpeed:Z,panOnScrollMode:q,zoomOnDoubleClick:re,panOnDrag:ne,onPaneClick:oe,onPaneMouseEnter:G,onPaneMouseMove:Q,onPaneMouseLeave:ce,onPaneScroll:pe,onPaneContextMenu:de,onEdgeContextMenu:ge,onEdgeMouseEnter:ie,onEdgeMouseMove:xe,onEdgeMouseLeave:we,onReconnect:ae,onReconnectStart:Se,onReconnectEnd:me,reconnectRadius:Te,noDragClassName:Re,noWheelClassName:$e,noPanClassName:ze,elevateEdgesOnSelect:Ne,disableKeyboardA11y:Ke,nodeOrigin:nt,nodeExtent:it,rfId:te})=>{const Ce=Gw(t,l9),Me=Gw(e,p9);return function(Be){const J=Bi(),fe=A.useRef(!1);A.useEffect(()=>{!fe.current&&J.viewportInitialized&&Be&&(setTimeout(()=>Be(J),1),fe.current=!0)},[Be,J.viewportInitialized])}(s),K.createElement(a9,{onPaneClick:oe,onPaneMouseEnter:G,onPaneMouseMove:Q,onPaneMouseLeave:ce,onPaneContextMenu:de,onPaneScroll:pe,deleteKeyCode:M,selectionKeyCode:S,selectionOnDrag:k,selectionMode:I,onSelectionStart:g,onSelectionEnd:m,multiSelectionKeyCode:j,panActivationKeyCode:E,zoomActivationKeyCode:T,elementsSelectable:B,onMove:n,onMoveStart:o,onMoveEnd:r,zoomOnScroll:N,zoomOnPinch:$,zoomOnDoubleClick:re,panOnScroll:Y,panOnScrollSpeed:Z,panOnScrollMode:q,panOnDrag:ne,defaultViewport:z,translateExtent:F,minZoom:V,maxZoom:P,onSelectionContextMenu:_,preventScrolling:C,noDragClassName:Re,noWheelClassName:$e,noPanClassName:ze,disableKeyboardA11y:Ke},K.createElement(v9,null,K.createElement(x9,{edgeTypes:Me,onEdgeClick:a,onEdgeDoubleClick:c,onlyRenderVisibleElements:L,onEdgeContextMenu:ge,onEdgeMouseEnter:ie,onEdgeMouseMove:xe,onEdgeMouseLeave:we,onReconnect:ae,onReconnectStart:Se,onReconnectEnd:me,reconnectRadius:Te,defaultMarkerColor:H,noPanClassName:ze,elevateEdgesOnSelect:!!Ne,disableKeyboardA11y:Ke,rfId:te},K.createElement(C9,{style:x,type:b,component:y,containerStyle:v})),K.createElement("div",{className:"react-flow__edgelabel-renderer"}),K.createElement(d9,{nodeTypes:Ce,onNodeClick:i,onNodeDoubleClick:l,onNodeMouseEnter:d,onNodeMouseMove:u,onNodeMouseLeave:f,onNodeContextMenu:p,selectNodesOnDrag:O,onlyRenderVisibleElements:L,noPanClassName:ze,noDragClassName:Re,disableKeyboardA11y:Ke,nodeOrigin:nt,nodeExtent:it,rfId:te})))};Yw.displayName="GraphView";var N9=A.memo(Yw);const gh=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],or={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:gh,nodeExtent:gh,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Ir.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},j9=()=>((t,e)=>t?Mx(t,e):Mx)((t,e)=>({...or,setNodes:n=>{const{nodeInternals:o,nodeOrigin:r,elevateNodesOnSelect:s}=e();t({nodeInternals:dh(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?dh(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 u=window.getComputedStyle(d),{m22:f}=new window.DOMMatrixReadOnly(u.transform),p=n.reduce((g,m)=>{const b=r.get(m.id);if(b!=null&&b.hidden)r.set(b.id,{...b,[Nt]:{...b[Nt],handleBounds:void 0}});else if(b){const x=qu(m.nodeElement);!(!x.width||!x.height||b.width===x.width&&b.height===x.height&&!m.forceUpdate)&&(r.set(b.id,{...b,[Nt]:{...b[Nt],handleBounds:{source:Ow(".source",m.nodeElement,f,c),target:Ow(".target",m.nodeElement,f,c)}},...x}),g.push({id:b.id,type:"dimensions",dimensions:x}))}return g},[]);vw(r,c);const _=i||s&&!i&&kw(e,{initial:!0,...a});t({nodeInternals:new Map(r),fitViewOnInitDone:_}),(p==null?void 0:p.length)>0&&(o==null||o(p))},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=dh(Ew(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=>nr(l,!0)):(i=hs(s(),n),a=hs(r,[])),Fl({changedNodes:i,changedEdges:a,get:e,set:t})},addSelectedEdges:n=>{const{multiSelectionActive:o,edges:r,getNodes:s}=e();let i,a=null;o?i=n.map(l=>nr(l,!0)):(i=hs(r,n),a=hs(s(),[])),Fl({changedNodes:a,changedEdges:i,get:e,set:t})},unselectNodesAndEdges:({nodes:n,edges:o}={})=>{const{edges:r,getNodes:s}=e(),i=o||r;Fl({changedNodes:(n||s()).map(a=>(a.selected=!1,nr(a.id,!1))),changedEdges:i.map(a=>nr(a.id,!1)),get:e,set:t})},setMinZoom:n=>{const{d3Zoom:o,maxZoom:r}=e();o==null||o.scaleExtent([n,r]),t({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:o,minZoom:r}=e();o==null||o.scaleExtent([r,n]),t({maxZoom:n})},setTranslateExtent:n=>{var o;(o=e().d3Zoom)==null||o.translateExtent(n),t({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:o}=e();Fl({changedNodes:o().filter(r=>r.selected).map(r=>nr(r.id,!1)),changedEdges:n.filter(r=>r.selected).map(r=>nr(r.id,!1)),get:e,set:t})},setNodeExtent:n=>{const{nodeInternals:o}=e();o.forEach(r=>{r.positionAbsolute=Gu(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=gr.translate(o[0]+n.x,o[1]+n.y).scale(o[2]),d=[[0,0],[r,s]],u=i==null?void 0:i.constrain()(c,d,l);return i.transform(a,u),o[0]!==u.x||o[1]!==u.y||o[2]!==u.k},cancelConnection:()=>t({connectionNodeId:or.connectionNodeId,connectionHandleId:or.connectionHandleId,connectionHandleType:or.connectionHandleType,connectionStatus:or.connectionStatus,connectionStartHandle:or.connectionStartHandle,connectionEndHandle:or.connectionEndHandle}),reset:()=>t({...or})}),Object.is),_h=({children:t})=>{const e=A.useRef(null);return e.current||(e.current=j9()),K.createElement(yO,{value:e.current},t)};_h.displayName="ReactFlowProvider";const Jw=({children:t})=>A.useContext(Al)?K.createElement(K.Fragment,null,t):K.createElement(_h,null,t);Jw.displayName="ReactFlowWrapper";const E9={input:hw,default:lh,output:pw,group:ch},I9={default:Pl,straight:th,step:eh,smoothstep:Dl,simplebezier:Zu},A9=[0,0],T9=[15,15],M9={x:0,y:0,zoom:1},O9={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},bh=A.forwardRef(({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,className:r,nodeTypes:s=E9,edgeTypes:i=I9,onNodeClick:a,onEdgeClick:l,onInit:c,onMove:d,onMoveStart:u,onMoveEnd:f,onConnect:p,onConnectStart:_,onConnectEnd:g,onClickConnectStart:m,onClickConnectEnd:b,onNodeMouseEnter:x,onNodeMouseMove:y,onNodeMouseLeave:v,onNodeContextMenu:S,onNodeDoubleClick:k,onNodeDragStart:I,onNodeDrag:j,onNodeDragStop:E,onNodesDelete:T,onEdgesDelete:M,onSelectionChange:L,onSelectionDragStart:B,onSelectionDrag:O,onSelectionDragStop:z,onSelectionContextMenu:F,onSelectionStart:V,onSelectionEnd:P,connectionMode:C=Ir.Strict,connectionLineType:H=er.Bezier,connectionLineStyle:N,connectionLineComponent:$,connectionLineContainerStyle:Y,deleteKeyCode:Z="Backspace",selectionKeyCode:q="Shift",selectionOnDrag:re=!1,selectionMode:ne=Li.Full,panActivationKeyCode:oe="Space",multiSelectionKeyCode:G=Ml()?"Meta":"Control",zoomActivationKeyCode:Q=Ml()?"Meta":"Control",snapToGrid:ce=!1,snapGrid:pe=T9,onlyRenderVisibleElements:de=!1,selectNodesOnDrag:ge=!0,nodesDraggable:ie,nodesConnectable:xe,nodesFocusable:we,nodeOrigin:ae=A9,edgesFocusable:Se,edgesUpdatable:me,elementsSelectable:Te,defaultViewport:Re=M9,minZoom:$e=.5,maxZoom:ze=2,translateExtent:Ne=gh,preventScrolling:Ke=!0,nodeExtent:nt,defaultMarkerColor:it="#b1b1b7",zoomOnScroll:te=!0,zoomOnPinch:Ce=!0,panOnScroll:Me=!1,panOnScrollSpeed:Be=.5,panOnScrollMode:J=Qo.Free,zoomOnDoubleClick:fe=!0,panOnDrag:_e=!0,onPaneClick:ue,onPaneMouseEnter:je,onPaneMouseMove:ve,onPaneMouseLeave:Ve,onPaneScroll:Qe,onPaneContextMenu:le,children:Ee,onEdgeContextMenu:Ie,onEdgeDoubleClick:Ue,onEdgeMouseEnter:qe,onEdgeMouseMove:De,onEdgeMouseLeave:Ye,onEdgeUpdate:ot,onEdgeUpdateStart:Xe,onEdgeUpdateEnd:rt,onReconnect:mt,onReconnectStart:yt,onReconnectEnd:Mt,reconnectRadius:xt=10,edgeUpdaterRadius:Bt=10,onNodesChange:Sn,onEdgesChange:hn,noDragClassName:rn="nodrag",noWheelClassName:Xt="nowheel",noPanClassName:Xn="nopan",fitView:ho=!1,fitViewOptions:vs,connectOnClick:ks=!0,attributionPosition:Ss,proOptions:Cs,defaultEdgeOptions:Ns,elevateNodesOnSelect:ir=!0,elevateEdgesOnSelect:js=!1,disableKeyboardA11y:Es=!1,autoPanOnConnect:Is=!0,autoPanOnNodeDrag:Pt=!0,connectionRadius:wt=20,isValidConnection:Cn,onError:Nn,style:As,id:tc,nodeDragThreshold:Gf,...Yf},nc)=>{const Jf=tc||"1";return K.createElement("div",{...Yf,style:{...As,...O9},ref:nc,className:un(["react-flow",r]),"data-testid":"rf__wrapper",id:tc},K.createElement(Jw,null,K.createElement(N9,{onInit:c,onMove:d,onMoveStart:u,onMoveEnd:f,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:x,onNodeMouseMove:y,onNodeMouseLeave:v,onNodeContextMenu:S,onNodeDoubleClick:k,nodeTypes:s,edgeTypes:i,connectionLineType:H,connectionLineStyle:N,connectionLineComponent:$,connectionLineContainerStyle:Y,selectionKeyCode:q,selectionOnDrag:re,selectionMode:ne,deleteKeyCode:Z,multiSelectionKeyCode:G,panActivationKeyCode:oe,zoomActivationKeyCode:Q,onlyRenderVisibleElements:de,selectNodesOnDrag:ge,defaultViewport:Re,translateExtent:Ne,minZoom:$e,maxZoom:ze,preventScrolling:Ke,zoomOnScroll:te,zoomOnPinch:Ce,zoomOnDoubleClick:fe,panOnScroll:Me,panOnScrollSpeed:Be,panOnScrollMode:J,panOnDrag:_e,onPaneClick:ue,onPaneMouseEnter:je,onPaneMouseMove:ve,onPaneMouseLeave:Ve,onPaneScroll:Qe,onPaneContextMenu:le,onSelectionContextMenu:F,onSelectionStart:V,onSelectionEnd:P,onEdgeContextMenu:Ie,onEdgeDoubleClick:Ue,onEdgeMouseEnter:qe,onEdgeMouseMove:De,onEdgeMouseLeave:Ye,onReconnect:mt??ot,onReconnectStart:yt??Xe,onReconnectEnd:Mt??rt,reconnectRadius:xt??Bt,defaultMarkerColor:it,noDragClassName:rn,noWheelClassName:Xt,noPanClassName:Xn,elevateEdgesOnSelect:js,rfId:Jf,disableKeyboardA11y:Es,nodeOrigin:ae,nodeExtent:nt}),K.createElement(VO,{nodes:t,edges:e,defaultNodes:n,defaultEdges:o,onConnect:p,onConnectStart:_,onConnectEnd:g,onClickConnectStart:m,onClickConnectEnd:b,nodesDraggable:ie,nodesConnectable:xe,nodesFocusable:we,edgesFocusable:Se,edgesUpdatable:me,elementsSelectable:Te,elevateNodesOnSelect:ir,minZoom:$e,maxZoom:ze,nodeExtent:nt,onNodesChange:Sn,onEdgesChange:hn,snapToGrid:ce,snapGrid:pe,connectionMode:C,translateExtent:Ne,connectOnClick:ks,defaultEdgeOptions:Ns,fitView:ho,fitViewOptions:vs,onNodesDelete:T,onEdgesDelete:M,onNodeDragStart:I,onNodeDrag:j,onNodeDragStop:E,onSelectionDrag:O,onSelectionDragStart:B,onSelectionDragStop:z,noPanClassName:Xn,nodeOrigin:ae,rfId:Jf,autoPanOnConnect:Is,autoPanOnNodeDrag:Pt,onError:Nn,connectionRadius:wt,isValidConnection:Cn,nodeDragThreshold:Gf}),K.createElement(BO,{onSelectionChange:L}),Ee,K.createElement(IO,{proOptions:Cs,position:Ss}),K.createElement(qO,{rfId:Jf,disableKeyboardA11y:Es})))});function Kw(t){return e=>{const[n,o]=A.useState(e),r=A.useCallback(s=>o(i=>t(s,i)),[]);return[n,o,r]}}bh.displayName="ReactFlow";const Xw=Kw(Ew),Zw=Kw(function(t,e){return jw(t,e)});function D9(){return K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},K.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function R9(){return K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},K.createElement("path",{d:"M0 0h32v4.2H0z"}))}function P9(){return K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},K.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 L9(){return K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},K.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 F9(){return K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},K.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 ms=({children:t,className:e,...n})=>K.createElement("button",{type:"button",className:un(["react-flow__controls-button",e]),...n},t);ms.displayName="ControlButton";const z9=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom}),Qw=({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:u="bottom-left"})=>{const f=qt(),[p,_]=A.useState(!1),{isInteractive:g,minZoomReached:m,maxZoomReached:b}=pt(z9,nn),{zoomIn:x,zoomOut:y,fitView:v}=Bi();return A.useEffect(()=>{_(!0)},[]),p?K.createElement(Tl,{className:un(["react-flow__controls",c]),position:u,style:t,"data-testid":"rf__controls"},e&&K.createElement(K.Fragment,null,K.createElement(ms,{onClick:()=>{x(),s==null||s()},className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:b},K.createElement(D9,null)),K.createElement(ms,{onClick:()=>{y(),i==null||i()},className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:m},K.createElement(R9,null))),n&&K.createElement(ms,{className:"react-flow__controls-fitview",onClick:()=>{v(r),a==null||a()},title:"fit view","aria-label":"fit view"},K.createElement(P9,null)),o&&K.createElement(ms,{className:"react-flow__controls-interactive",onClick:()=>{f.setState({nodesDraggable:!g,nodesConnectable:!g,elementsSelectable:!g}),l==null||l(!g)},title:"toggle interactivity","aria-label":"toggle interactivity"},g?K.createElement(F9,null):K.createElement(L9,null)),d):null};Qw.displayName="Controls";var Ln,B9=A.memo(Qw);function U9({color:t,dimensions:e,lineWidth:n}){return K.createElement("path",{stroke:t,strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})}function V9({color:t,radius:e}){return K.createElement("circle",{cx:e,cy:e,r:e,fill:t})}(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Ln||(Ln={}));const H9={[Ln.Dots]:"#91919a",[Ln.Lines]:"#eee",[Ln.Cross]:"#e2e2e2"},$9={[Ln.Dots]:1,[Ln.Lines]:1,[Ln.Cross]:6},W9=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function ev({id:t,variant:e=Ln.Dots,gap:n=20,size:o,lineWidth:r=1,offset:s=2,color:i,style:a,className:l}){const c=A.useRef(null),{transform:d,patternId:u}=pt(W9,nn),f=i||H9[e],p=o||$9[e],_=e===Ln.Dots,g=e===Ln.Cross,m=Array.isArray(n)?n:[n,n],b=[m[0]*d[2]||1,m[1]*d[2]||1],x=p*d[2],y=g?[x,x]:b,v=_?[x/s,x/s]:[y[0]/s,y[1]/s];return K.createElement("svg",{className:un(["react-flow__background",l]),style:{...a,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:c,"data-testid":"rf__background"},K.createElement("pattern",{id:u+t,x:d[0]%b[0],y:d[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${v[0]},-${v[1]})`},_?K.createElement(V9,{color:f,radius:x/s}):K.createElement(U9,{dimensions:y,color:f,lineWidth:r})),K.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${u+t})`}))}ev.displayName="Background";var q9=A.memo(ev);function yh(t){return Math.min(11*t+35,200)}const tv=K.createContext("LR"),nv=A.memo(t=>{const e=X.c(51),{data:n,selected:o}=t,r=We(n.atom),s=zc().inOrderIds.indexOf(r.id),i=o?"var(--gray-9)":"var(--gray-3)",a=pt(G9),l=A.useContext(tv);let c,d,u,f,p;if(e[0]!==r.code||e[1]!==i||e[2]!==l||e[3]!==o){const M=r.code.split(`
126
126
  `).length,L=l==="LR"?He.Left:He.Top;let B;e[8]!==i?(B={background:i},e[8]=i,e[9]=B):B=e[9],e[10]!==L||e[11]!==B?(u=h.jsx(tr,{type:"target",id:"inputs",position:L,style:B}),e[10]=L,e[11]=B,e[12]=u):u=e[12];const O=l==="LR"?He.Left:He.Top;let z;e[13]!==i?(z={background:i},e[13]=i,e[14]=z):z=e[14],e[15]!==O||e[16]!==z?(f=h.jsx(tr,{type:"source",id:"inputs",position:O,style:z}),e[15]=O,e[16]=z,e[17]=f):f=e[17];const F=o&&"border-primary";e[18]!==F?(d=Oe("flex flex-col bg-card border border-input/50 rounded-md mx-[2px] overflow-hidden",F),e[18]=F,e[19]=d):d=e[19],c=yh(M),e[0]=r.code,e[1]=i,e[2]=l,e[3]=o,e[4]=c,e[5]=d,e[6]=u,e[7]=f}else c=e[4],d=e[5],u=e[6],f=e[7];var _;let g;e[20]!==n.forceWidth||e[21]!==a?(p=n.forceWidth||(_=a,Math.min(Math.max(_-100,100),400)),e[20]=n.forceWidth,e[21]=a,e[22]=p):p=e[22],e[23]!==c||e[24]!==p?(g={height:c,width:p},e[23]=c,e[24]=p,e[25]=g):g=e[25];const m=oV(r.name,s);let b,x,y;e[26]!==m?(b=h.jsx("div",{className:"text-muted-foreground font-semibold text-xs py-1 px-2 bg-muted border-b",children:m}),e[26]=m,e[27]=b):b=e[27],e[28]!==r.code?(x=h.jsx(KH,{code:r.code}),e[28]=r.code,e[29]=x):x=e[29],e[30]!==d||e[31]!==g||e[32]!==b||e[33]!==x?(y=h.jsxs("div",{className:d,style:g,children:[b,x]}),e[30]=d,e[31]=g,e[32]=b,e[33]=x,e[34]=y):y=e[34];const v=l==="LR"?He.Right:He.Bottom;let S,k;e[35]!==i?(S={background:i},e[35]=i,e[36]=S):S=e[36],e[37]!==v||e[38]!==S?(k=h.jsx(tr,{type:"source",id:"outputs",position:v,style:S}),e[37]=v,e[38]=S,e[39]=k):k=e[39];const I=l==="LR"?He.Right:He.Bottom;let j,E,T;return e[40]!==i?(j={background:i},e[40]=i,e[41]=j):j=e[41],e[42]!==I||e[43]!==j?(E=h.jsx(tr,{type:"target",id:"outputs",position:I,style:j}),e[42]=I,e[43]=j,e[44]=E):E=e[44],e[45]!==y||e[46]!==k||e[47]!==E||e[48]!==u||e[49]!==f?(T=h.jsxs("div",{children:[u,f,y,k,E]}),e[45]=y,e[46]=k,e[47]=E,e[48]=u,e[49]=f,e[50]=T):T=e[50],T},(t,e)=>["data","selected","id"].every(n=>t[n]===e[n]));nv.displayName="CustomNode";const ov={custom:nv};function G9(t){const{width:e}=t;return e}const rv=t=>{const e=X.c(18),{maxCount:n,cellIds:o,onClick:r,skipScroll:s}=t,i=zc();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 u;e[8]!==i?(u=(_,g)=>i.inOrderIds.indexOf(_)-i.inOrderIds.indexOf(g),e[8]=i,e[9]=u):u=e[9];const f=[...o].sort(u);if(o.length===0){let _;e[10]===Symbol.for("react.memo_cache_sentinel")?(_=h.jsx("div",{className:"text-muted-foreground",children:"--"}),e[10]=_):_=e[10],c=_;break e}let p;e[11]!==o.length||e[12]!==r||e[13]!==s?(p=(_,g)=>h.jsxs("span",{className:"truncate",children:[h.jsx(pr,{variant:"focus",cellId:_,skipScroll:s,className:"whitespace-nowrap",onClick:r?()=>r(_):void 0},_),g<o.length-1&&", "]},_),e[11]=o.length,e[12]=r,e[13]=s,e[14]=p):p=e[14],a=f.slice(0,n).map(p),l=o.length>n&&h.jsxs(Pr,{children:[h.jsx(Ys,{asChild:!0,children:h.jsxs("span",{className:"whitespace-nowrap text-muted-foreground text-xs hover:underline cursor-pointer",children:["+",o.length-n," more"]})}),h.jsx(Vs,{className:"w-auto",children:h.jsx("div",{className:"flex flex-col gap-1 py-1",children:f.slice(n).map(_=>h.jsx(pr,{variant:"focus",cellId:_,className:"whitespace-nowrap",onClick:r?()=>r(_):void 0},_))})})]})}e[0]=o,e[1]=i,e[2]=n,e[3]=r,e[4]=s,e[5]=a,e[6]=l,e[7]=c}else a=e[5],l=e[6],c=e[7];return c!==Symbol.for("react.early_return_sentinel")?c:(e[15]!==a||e[16]!==l?(d=h.jsxs(h.Fragment,{children:[a,l]}),e[15]=a,e[16]=l,e[17]=d):d=e[17],d)},xh=t=>{const e=X.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 yn(o),lt({title:"Copied to clipboard"}))},e[5]=o,e[6]=r,e[7]=a):a=e[7],e[8]!==o||e[9]!==i||e[10]!==a?(l=h.jsx(z4,{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=h.jsx("div",{className:"max-w-[130px]",...s,children:l}),e[12]=s,e[13]=l,e[14]=c):c=e[14],c},wh=A.memo(t=>{const e=X.c(38),{onChange:n,view:o,settings:r,onSettingsChange:s}=t;let i;e[0]!==s||e[1]!==r?(i=(O,z)=>{s({...r,[O]:z})},e[0]=s,e[1]=r,e[2]=i):i=e[2];const a=i;let l,c,d,u,f,p;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=h.jsx(Ys,{asChild:!0,children:h.jsx(Pe,{variant:"text",size:"xs",children:h.jsx(Y3,{className:"w-4 h-4"})})}),e[3]=l):l=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx("div",{className:"font-semibold pb-4",children:"Settings"}),e[4]=c):c=e[4],e[5]!==a?(d=O=>a("hidePureMarkdown",!!O),e[5]=a,e[6]=d):d=e[6],e[7]!==r.hidePureMarkdown||e[8]!==d?(u=h.jsx(x4,{"data-testid":"hide-pure-markdown-checkbox",id:"hide-pure-markdown",checked:r.hidePureMarkdown,onCheckedChange:d}),e[7]=r.hidePureMarkdown,e[8]=d,e[9]=u):u=e[9],e[10]===Symbol.for("react.memo_cache_sentinel")?(f=h.jsx(Rr,{htmlFor:"hide-pure-markdown",children:"Hide pure markdown"}),e[10]=f):f=e[10],e[11]!==u?(p=h.jsxs(Pr,{children:[l,h.jsxs(Vs,{className:"w-auto p-2 text-muted-foreground",children:[c,h.jsxs("div",{className:"flex items-center gap-2",children:[u,f]})]})]}),e[11]=u,e[12]=p):p=e[12];const _=p,g=o==="_minimap_";let m,b,x;e[13]!==n?(m=()=>n("_minimap_"),e[13]=n,e[14]=m):m=e[14],e[15]===Symbol.for("react.memo_cache_sentinel")?(b=h.jsx(Pm,{className:"w-4 h-4 mr-1"}),e[15]=b):b=e[15],e[16]!==g||e[17]!==m?(x=h.jsxs(Pe,{variant:"outline",className:"bg-background","aria-selected":g,size:"xs",onClick:m,children:[b,"Mini Map"]}),e[16]=g,e[17]=m,e[18]=x):x=e[18];const y=o==="TB";let v,S,k;e[19]!==n?(v=()=>n("TB"),e[19]=n,e[20]=v):v=e[20],e[21]===Symbol.for("react.memo_cache_sentinel")?(S=h.jsx(Na,{className:"w-4 h-4 mr-1"}),e[21]=S):S=e[21],e[22]!==y||e[23]!==v?(k=h.jsxs(Pe,{variant:"outline",className:"bg-background","aria-selected":y,size:"xs",onClick:v,children:[S,"Vertical Tree"]}),e[22]=y,e[23]=v,e[24]=k):k=e[24];const I=o==="LR";let j,E,T,M;e[25]!==n?(j=()=>n("LR"),e[25]=n,e[26]=j):j=e[26],e[27]===Symbol.for("react.memo_cache_sentinel")?(E=h.jsx(Na,{className:"w-4 h-4 mr-1 transform -rotate-90"}),e[27]=E):E=e[27],e[28]!==I||e[29]!==j?(T=h.jsxs(Pe,{variant:"outline",className:"bg-background","aria-selected":I,size:"xs",onClick:j,children:[E," ","Horizontal Tree"]}),e[28]=I,e[29]=j,e[30]=T):T=e[30],e[31]!==x||e[32]!==k||e[33]!==T?(M=h.jsxs("div",{className:"flex gap-2",children:[x,k,T]}),e[31]=x,e[32]=k,e[33]=T,e[34]=M):M=e[34];const L=o!=="_minimap_"&&_;let B;return e[35]!==M||e[36]!==L?(B=h.jsxs(Tl,{position:"top-right",className:"flex flex-col items-end gap-2",children:[M,L]}),e[35]=M,e[36]=L,e[37]=B):B=e[37],B});wh.displayName="GraphToolbar";const Bl=A.memo(t=>{const e=X.c(11),{selection:n,variables:o,onClearSelection:r}=t;if(!n)return null;const s=Y9;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(p=>p.usedBy.includes(n.id)),u=Object.values(o).filter(p=>p.declaredBy.includes(n.id)),f=(p,_)=>h.jsxs(h.Fragment,{children:[p.length===0&&h.jsx("div",{className:"text-muted-foreground text-sm text-center",children:"--"}),h.jsx("div",{className:"grid grid-cols-5 gap-3 items-center text-sm py-1 flex-1 empty:hidden",children:p.map(g=>h.jsxs(K.Fragment,{children:[h.jsx(xh,{declaredBy:g.declaredBy,name:g.name}),h.jsxs("div",{className:"truncate col-span-2",title:g.value??"",children:[g.value,h.jsxs("span",{className:"ml-1 truncate text-foreground/60 font-mono",children:["(",g.dataType,")"]})]}),h.jsx("div",{className:"truncate col-span-2 gap-1 items-center",children:h.jsx(rv,{skipScroll:!0,onClick:()=>s(_==="in"?g.declaredBy[0]:g.usedBy[0],g.name),maxCount:3,cellIds:g.usedBy})})]},g.name))})]});return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"font-bold py-2 flex items-center gap-2 border-b px-3",children:[h.jsx(fc,{className:"w-5 h-5"}),h.jsx(pr,{cellId:n.id}),h.jsx("div",{className:"flex-1"}),h.jsx(g0,{cellId:n.id,children:h.jsx(Pe,{variant:"ghost",size:"icon",children:h.jsx(Yc,{className:"w-4 h-4"})})}),h.jsx(Pe,{variant:"text",size:"icon",onClick:()=>{r()},children:h.jsx(go,{className:"w-4 h-4"})})]}),h.jsxs("div",{className:"text-sm flex flex-col py-3 pl-2 pr-4 flex-1 justify-center",children:[h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsxs("span",{className:"flex items-center gap-2 font-semibold",children:[h.jsx(mn,{className:"w-4 h-4"}),"Outputs"]}),f(u,"out")]}),h.jsx("hr",{className:"border-divider my-3"}),h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsxs("span",{className:"flex items-center gap-2 font-semibold",children:[h.jsx(rm,{className:"w-4 h-4"}),"Inputs"]}),f(d,"in")]})]})]})}if(n.type==="edge"){const d=Object.values(o).filter(u=>u.declaredBy.includes(n.source)&&u.usedBy.includes(n.target));return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"font-bold py-2 flex items-center gap-2 border-b px-3",children:[h.jsx(Ea,{className:"w-4 h-4"}),h.jsx(pr,{cellId:n.source}),h.jsx(Wc,{className:"w-4 h-4"}),h.jsx(pr,{cellId:n.target})]}),h.jsx("div",{className:"grid grid-cols-4 gap-3 max-w-[350px] items-center text-sm p-3 flex-1",children:d.map(u=>h.jsxs(K.Fragment,{children:[h.jsx(xh,{declaredBy:u.declaredBy,name:u.name,onClick:()=>{s(u.declaredBy[0],u.name)}}),h.jsx("div",{className:"truncate text-foreground/60 font-mono",children:u.dataType}),h.jsx("div",{className:"truncate col-span-2",title:u.value??"",children:u.value})]},u.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=h.jsx(Tl,{position:"bottom-left",className:"max-h-[90%] flex flex-col w-[calc(100%-5rem)]",children:h.jsx("div",{className:"min-h-[100px] shadow-md rounded-md border max-w-[550px] border-primary/40 my-4 min-w-[240px] bg-[var(--slate-1)] text-muted-foreground/80 flex flex-col overflow-y-auto",children:l})}),e[9]=l,e[10]=c):c=e[10],c});function Y9(t,e){const n=ic(t);n&&Wp(n,e)}function sv(){const t=X.c(7),e=Bi(),n=pt(K9),o=pt(J9);let r;t[0]!==e?(r=()=>{e.fitView({duration:100})},t[0]=e,t[1]=r):r=t[1];const s=rV(r,100);let i,a;t[2]!==s||t[3]!==o||t[4]!==n?(i=()=>{n&&o&&s()},a=[n,o,s],t[2]=s,t[3]=o,t[4]=n,t[5]=i,t[6]=a):(i=t[5],a=t[6]),A.useEffect(i,a)}function J9(t){const{height:e}=t;return e}function K9(t){const{width:e}=t;return e}Bl.displayName="GraphSelectionPanel";const iv=new class{createEdge(t,e,n){return{type:"smoothstep",pathOptions:{offset:20,borderRadius:100},data:{direction:n},markerEnd:{type:as.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:yh(dt.get(e).code.trim().split(`
127
127
  `).length),position:{x:0,y:n+20}}}createElements(t,e,n,o){let r=0;const s=[],i=[];for(const[l,c]of $p.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 u of c)for(const f of d){const p=`${u}-${f}`;a.has(p)||(a.add(p),i.push(this.createEdge(u,f,"inputs"),this.createEdge(u,f,"outputs")))}}return{nodes:s,edges:i}}},X9=t=>{const e=X.c(37),{cellIds:n,variables:o,cellAtoms:r,children:s}=t;let i;e[0]!==r||e[1]!==n||e[2]!==o?(i=iv.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,u]=Zw(c),[f,p]=Xw(a),[_,g]=A.useState(),[m,b]=A.useState(),x=A.useRef(!1);sv();const y=pt(Z9);let v;e[5]!==u||e[6]!==p?(v=C=>{p(C.nodes),u([])},e[5]=u,e[6]=p,e[7]=v):v=e[7];const S=et(v);let k,I,j,E;e[8]!==r||e[9]!==n||e[10]!==S||e[11]!==o?(k=()=>{x.current?S(iv.createElements(n,r,o,!1)):x.current=!0},I=[n,o,r,S],e[8]=r,e[9]=n,e[10]=S,e[11]=o,e[12]=k,e[13]=I):(k=e[12],I=e[13]),A.useEffect(k,I),e[14]!==l||e[15]!==_||e[16]!==u?(j=()=>{if(_){const C=l.filter(H=>{const{source:N,target:$,data:Y}=H;return N===_&&Y.direction==="outputs"||$===_&&Y.direction==="inputs"});u(C)}},E=[_,u,l],e[14]=l,e[15]=_,e[16]=u,e[17]=j,e[18]=E):(j=e[17],E=e[18]),A.useEffect(j,E);const T=function(C,H){const N=X.c(17);let $,Y;if(N[0]!==H||N[1]!==C){let Q;N[3]!==H?(Q=(ce,pe)=>{const{position:de}=pe;return Math.min(ce,de.y-H/2-10)},N[3]=H,N[4]=Q):Q=N[4],Y=C.reduce(Q,Number.POSITIVE_INFINITY),N[0]=H,N[1]=C,N[2]=Y}else Y=N[2];const Z=Y;let q;if(N[5]!==H||N[6]!==C){let Q;N[8]!==H?(Q=(ce,pe)=>{const{position:de}=pe;return Math.max(ce,de.y+H/2+10)},N[8]=H,N[9]=Q):Q=N[9],q=C.reduce(Q,Number.NEGATIVE_INFINITY),N[5]=H,N[6]=C,N[7]=q}else q=N[7];const re=q;let ne,oe,G;return N[10]!==Z?(ne=[Number.NEGATIVE_INFINITY,Z],N[10]=Z,N[11]=ne):ne=N[11],N[12]!==re?(oe=[Number.POSITIVE_INFINITY,re],N[12]=re,N[13]=oe):oe=N[13],N[14]!==ne||N[15]!==oe?(G=[ne,oe],N[14]=ne,N[15]=oe,N[16]=G):G=N[16],$=G,$}(f,y);let M;e[19]===Symbol.for("react.memo_cache_sentinel")?(M=()=>{g(void 0),b(void 0)},e[19]=M):M=e[19];const L=M;let B;e[20]!==d||e[21]!==m||e[22]!==_||e[23]!==o?(B=()=>m?h.jsx(Bl,{selection:{type:"edge",source:m.source,target:m.target},onClearSelection:L,variables:o,edges:d}):_?h.jsx(Bl,{selection:{type:"node",id:_},variables:o,edges:d,onClearSelection:L}):null,e[20]=d,e[21]=m,e[22]=_,e[23]=o,e[24]=B):B=e[24];const O=B;let z,F,V,P;return e[25]!==u?(z=(C,H)=>{const N=H.id;g(N),b(void 0),u([])},e[25]=u,e[26]=z):z=e[26],e[27]===Symbol.for("react.memo_cache_sentinel")?(F=(C,H)=>{b(H)},e[27]=F):F=e[27],e[28]!==O?(V=O(),e[28]=O,e[29]=V):V=e[29],e[30]!==s||e[31]!==d||e[32]!==f||e[33]!==z||e[34]!==V||e[35]!==T?(P=h.jsxs(bh,{nodes:f,edges:d,nodeTypes:ov,translateExtent:T,onNodeClick:z,onNodeDoubleClick:Q9,onEdgeClick:F,snapToGrid:!0,fitView:!0,elementsSelectable:!0,minZoom:1,maxZoom:1,draggable:!1,panOnScrollMode:Qo.Vertical,zoomOnDoubleClick:!1,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,edgesFocusable:!1,selectNodesOnDrag:!1,panOnDrag:!1,preventScrolling:!1,zoomOnPinch:!1,panOnScroll:!0,autoPanOnNodeDrag:!1,autoPanOnConnect:!1,children:[V,s]}),e[30]=s,e[31]=d,e[32]=f,e[33]=z,e[34]=V,e[35]=T,e[36]=P):P=e[36],P};function Z9(t){const{height:e}=t;return e}function Q9(t,e){B4(e.id,"focus")}var vh,av,lv,cv,dv,uv,kh,hv,Sh,fv,Ch,pv,Nh,mv,jh,gv,Eh,_v,Ih,bv,Ah,yv,Th,xv,Mh,wv,Oh,vv,Dh,kv,Rh,Sv,Ph,Cv,Nv,jv,Ev,Iv,Av,Tv,Lh,Mv,Fh,Ov,zh,Dv,Bh,Rv,Uh,Pv,Vh,Lv,Hh,Fv,$h,zv,Wh,Bv,qh,Uv,Gh,Vv,Yh,Hv,Jh,$v,Kh,Wv,qv,Gv,Yv,Jv,Kv,Xv,Xh,Zv,Zh,Qv,e2,t2,Qh,n2,ef,o2,tf,r2,nf,s2,of,i2,a2,l2,c2,d2;function rf(){if(av)return vh;av=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 u=c;c=d,d=u}return c+""+d+""+(l===void 0?"\0":l)}function r(s,i){return o(s,i.v,i.w,i.name)}return vh=class{constructor(s){ee(this,"_isDirected",!0);ee(this,"_isMultigraph",!1);ee(this,"_isCompound",!1);ee(this,"_label");ee(this,"_defaultNodeLabelFn",()=>{});ee(this,"_defaultEdgeLabelFn",()=>{});ee(this,"_nodes",{});ee(this,"_in",{});ee(this,"_preds",{});ee(this,"_out",{});ee(this,"_sucs",{});ee(this,"_edgeObjs",{});ee(this,"_edgeLabels",{});ee(this,"_nodeCount",0);ee(this,"_edgeCount",0);ee(this,"_parent");ee(this,"_children");s&&(this._isDirected=!Object.hasOwn(s,"directed")||s.directed,this._isMultigraph=!!Object.hasOwn(s,"multigraph")&&s.multigraph,this._isCompound=!!Object.hasOwn(s,"compound")&&s.compound),this._isCompound&&(this._parent={},this._children={},this._children[t]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(s){return this._label=s,this}graph(){return this._label}setDefaultNodeLabel(s){return this._defaultNodeLabelFn=s,typeof s!="function"&&(this._defaultNodeLabelFn=()=>s),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var s=this;return this.nodes().filter(i=>Object.keys(s._in[i]).length===0)}sinks(){var s=this;return this.nodes().filter(i=>Object.keys(s._out[i]).length===0)}setNodes(s,i){var a=arguments,l=this;return s.forEach(function(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,u]){s(d)&&i.setNode(d,u)}),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 u=a.parent(d);return u===void 0||i.hasNode(u)?(l[d]=u,u):u in l?l[u]:c(u)}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 u=o(this._isDirected,s,i,a);if(Object.hasOwn(this._edgeLabels,u))return c&&(this._edgeLabels[u]=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[u]=c?l:this._defaultEdgeLabelFn(s,i,a);var f=function(p,_,g,m){var b=""+_,x=""+g;if(!p&&b>x){var y=b;b=x,x=y}var v={v:b,w:x};return m&&(v.name=m),v}(this._isDirected,s,i,a);return s=f.v,i=f.w,Object.freeze(f),this._edgeObjs[u]=f,e(this._preds[i],s),e(this._sucs[s],i),this._in[i][u]=f,this._out[s][u]=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))}},vh}function eD(){return uv?dv:(uv=1,dv={Graph:rf(),version:cv?lv:(cv=1,lv="2.2.4")})}function tD(){if(hv)return kh;hv=1;var t=rf();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 kh={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}},kh}function nD(){return fv||(fv=1,Sh=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}),Sh}function u2(){return pv?Ch:(pv=1,Ch=class{constructor(){ee(this,"_arr",[]);ee(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(t){return t.key})}has(t){return Object.hasOwn(this._keyIndices,t)}priority(t){var e=this._keyIndices[t];if(e!==void 0)return this._arr[e].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(t,e){var n=this._keyIndices;if(t=String(t),!Object.hasOwn(n,t)){var o=this._arr,r=o.length;return n[t]=r,o.push({key:t,priority:e}),this._decrease(r),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key}decrease(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)}_heapify(t){var e=this._arr,n=2*t,o=n+1,r=t;n<e.length&&(r=e[n].priority<e[r].priority?n:r,o<e.length&&(r=e[o].priority<e[r].priority?o:r),r!==t&&(this._swap(t,r),this._heapify(r)))}_decrease(t){for(var e,n=this._arr,o=n[t].priority;t!==0&&!(n[e=t>>1].priority<o);)this._swap(t,e),t=e}_swap(t,e){var n=this._arr,o=this._keyIndices,r=n[t],s=n[e];n[t]=s,n[e]=r,o[s.key]=t,o[r.key]=e}},Ch)}function h2(){if(mv)return Nh;mv=1;var t=u2();Nh=function(n,o,r,s){return function(i,a,l,c){var d,u,f={},p=new t,_=function(g){var m=g.v!==d?g.v:g.w,b=f[m],x=l(g),y=u.distance+x;if(x<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+g+" Weight: "+x);y<b.distance&&(b.distance=y,b.predecessor=d,p.decrease(m,y))};for(i.nodes().forEach(function(g){var m=g===a?0:Number.POSITIVE_INFINITY;f[g]={distance:m},p.add(g,m)});p.size()>0&&(d=p.removeMin(),(u=f[d]).distance!==Number.POSITIVE_INFINITY);)c(d).forEach(_);return f}(n,String(o),r||e,s||function(i){return n.outEdges(i)})};var e=()=>1;return Nh}function oD(){if(gv)return jh;gv=1;var t=h2();return jh=function(e,n,o){return e.nodes().reduce(function(r,s){return r[s]=t(e,s,n,o),r},{})},jh}function f2(){return _v||(_v=1,Eh=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}),Eh}function rD(){if(bv)return Ih;bv=1;var t=f2();return Ih=function(e){return t(e).filter(function(n){return n.length>1||n.length===1&&e.hasEdge(n[0],n[0])})},Ih}function sD(){if(yv)return Ah;yv=1,Ah=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 u=d.v===c?d.w:d.v,f=s(d);a[c][u]={distance:f,predecessor:c}})}),l.forEach(function(c){var d=a[c];l.forEach(function(u){var f=a[u];l.forEach(function(p){var _=f[c],g=d[p],m=f[p],b=_.distance+g.distance;b<m.distance&&(m.distance=b,m.predecessor=g.predecessor)})})}),a}(e,n||t,o||function(r){return e.outEdges(r)})};var t=()=>1;return Ah}function p2(){if(xv)return Th;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}xv=1;class e extends Error{constructor(){super(...arguments)}}return Th=t,t.CycleException=e,Th}function iD(){if(wv)return Mh;wv=1;var t=p2();return Mh=function(e){try{t(e)}catch(n){if(n instanceof t.CycleException)return!1;throw n}return!0},Mh}function m2(){if(vv)return Oh;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 vv=1,Oh=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},Oh}function aD(){if(kv)return Dh;kv=1;var t=m2();return Dh=function(e,n){return t(e,n,"post")},Dh}function lD(){if(Sv)return Rh;Sv=1;var t=m2();return Rh=function(e,n){return t(e,n,"pre")},Rh}function cD(){if(Cv)return Ph;Cv=1;var t=rf(),e=u2();return Ph=function(n,o){var r,s=new t,i={},a=new e;function l(d){var u=d.v===r?d.w:d.v,f=a.priority(u);if(f!==void 0){var p=o(d);p<f&&(i[u]=r,a.decrease(u,p))}}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},Ph}function Kn(){if(Iv)return Ev;Iv=1;var t=eD();return Ev={Graph:t.Graph,json:tD(),alg:jv?Nv:(jv=1,Nv={components:nD(),dijkstra:h2(),dijkstraAll:oD(),findCycles:rD(),floydWarshall:sD(),isAcyclic:iD(),postorder:aD(),preorder:lD(),prim:cD(),tarjan:f2(),topsort:p2()}),version:t.version}}function dD(){if(Mv)return Lh;Mv=1;let t=Kn().Graph,e=function(){if(Tv)return Av;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 Tv=1,Av=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(", ")+"]"}}}();Lh=function(s,i){if(s.nodeCount()<=1)return[];let a=function(l,c){let d=new t,u=0,f=0;l.nodes().forEach(g=>{d.setNode(g,{v:g,in:0,out:0})}),l.edges().forEach(g=>{let m=d.edge(g.v,g.w)||0,b=c(g),x=m+b;d.setEdge(g.v,g.w,x),f=Math.max(f,d.node(g.v).out+=b),u=Math.max(u,d.node(g.w).in+=b)});let p=function(g){const m=[];for(let b=0;b<g;b++)m.push(b);return m}(f+u+3).map(()=>new e),_=u+1;return d.nodes().forEach(g=>{r(p,_,d.node(g))}),{graph:d,buckets:p,zeroIdx:_}}(s,i||n);return function(l,c,d){let u,f=[],p=c[c.length-1],_=c[0];for(;l.nodeCount();){for(;u=_.dequeue();)o(l,c,d,u);for(;u=p.dequeue();)o(l,c,d,u);if(l.nodeCount()){for(let g=c.length-2;g>0;--g)if(u=c[g].dequeue(),u){f=f.concat(o(l,c,d,u,!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(u=>{let f=s.edge(u),p=s.node(u.v);c&&d.push({v:u.v,w:u.w}),p.out-=f,r(i,a,p)}),s.outEdges(l.v).forEach(u=>{let f=s.edge(u),p=u.w,_=s.node(p);_.in-=f,r(i,a,_)}),s.removeNode(l.v),d}function r(s,i,a){a.out?a.in?s[a.out-a.in+i].enqueue(a):s[s.length-1].enqueue(a):s[0].enqueue(a)}return Lh}function Dt(){if(Ov)return Fh;Ov=1;let t=Kn().Graph;function e(c,d,u,f){let p;do p=i(f);while(c.hasNode(p));return u.dummy=d,c.setNode(p,u),p}Fh={addBorderNode:function(c,d,u,f){let p={width:0,height:0};return arguments.length>=4&&(p.rank=u,p.order=f),e(c,"border",p,d)},addDummyNode:e,applyWithChunking:o,asNonCompoundGraph:function(c){let d=new t({multigraph:c.isMultigraph()}).setGraph(c.graph());return c.nodes().forEach(u=>{c.children(u).length||d.setNode(u,c.node(u))}),c.edges().forEach(u=>{d.setEdge(u,c.edge(u))}),d},buildLayerMatrix:function(c){let d=a(r(c)+1).map(()=>[]);return c.nodes().forEach(u=>{let f=c.node(u),p=f.rank;p!==void 0&&(d[p][f.order]=u)}),d},intersectRect:function(c,d){let u,f,p=c.x,_=c.y,g=d.x-p,m=d.y-_,b=c.width/2,x=c.height/2;if(!g&&!m)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(m)*b>Math.abs(g)*x?(m<0&&(x=-x),u=x*g/m,f=x):(g<0&&(b=-b),u=b,f=b*m/g),{x:p+u,y:_+f}},mapValues:function(c,d){let u=d;return typeof d=="string"&&(u=f=>f[d]),Object.entries(c).reduce((f,[p,_])=>(f[p]=u(_,p),f),{})},maxRank:r,normalizeRanks:function(c){let d=c.nodes().map(f=>{let p=c.node(f).rank;return p===void 0?Number.MAX_VALUE:p}),u=o(Math.min,d);c.nodes().forEach(f=>{let p=c.node(f);Object.hasOwn(p,"rank")&&(p.rank-=u)})},notime:function(c,d){return d()},partition:function(c,d){let u={lhs:[],rhs:[]};return c.forEach(f=>{d(f)?u.lhs.push(f):u.rhs.push(f)}),u},pick:function(c,d){const u={};for(const f of d)c[f]!==void 0&&(u[f]=c[f]);return u},predecessorWeights:function(c){let d=c.nodes().map(u=>{let f={};return c.inEdges(u).forEach(p=>{f[p.v]=(f[p.v]||0)+c.edge(p).weight}),f});return l(c.nodes(),d)},range:a,removeEmptyRanks:function(c){let d=c.nodes().map(g=>c.node(g).rank),u=o(Math.min,d),f=[];c.nodes().forEach(g=>{let m=c.node(g).rank-u;f[m]||(f[m]=[]),f[m].push(g)});let p=0,_=c.graph().nodeRankFactor;Array.from(f).forEach((g,m)=>{g===void 0&&m%_!=0?--p:g!==void 0&&p&&g.forEach(b=>c.node(b).rank+=p)})},simplify:function(c){let d=new t().setGraph(c.graph());return c.nodes().forEach(u=>d.setNode(u,c.node(u))),c.edges().forEach(u=>{let f=d.edge(u.v,u.w)||{weight:0,minlen:1},p=c.edge(u);d.setEdge(u.v,u.w,{weight:f.weight+p.weight,minlen:Math.max(f.minlen,p.minlen)})}),d},successorWeights:function(c){let d=c.nodes().map(u=>{let f={};return c.outEdges(u).forEach(p=>{f[p.w]=(f[p.w]||0)+c.edge(p).weight}),f});return l(c.nodes(),d)},time:function(c,d){let u=Date.now();try{return d()}finally{console.log(c+" time: "+(Date.now()-u)+"ms")}},uniqueId:i,zipObject:l};const n=65535;function o(c,d){if(d.length>n){const u=function(f,p=n){const _=[];for(let g=0;g<f.length;g+=p){const m=f.slice(g,g+p);_.push(m)}return _}(d);return c.apply(null,u.map(f=>c.apply(null,f)))}return c.apply(null,d)}function r(c){const d=c.nodes().map(u=>{let f=c.node(u).rank;return f===void 0?Number.MIN_VALUE:f});return o(Math.max,d)}let s=0;function i(c){var d=++s;return toString(c)+d}function a(c,d,u=1){d==null&&(d=c,c=0);let f=_=>_<d;u<0&&(f=_=>d<_);const p=[];for(let _=c;f(_);_+=u)p.push(_);return p}function l(c,d){return c.reduce((u,f,p)=>(u[f]=d[p],u),{})}return Fh}function uD(){if(Dv)return zh;Dv=1;let t=dD(),e=Dt().uniqueId;return zh={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)}})}},zh}function hD(){if(Rv)return Bh;Rv=1;let t=Dt();return Bh={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,u=o.node(d).rank,f=r.name,p=o.edge(r),_=p.labelRank;if(u!==c+1){for(o.removeEdge(r),a=0,++c;c<u;++a,++c)p.points=[],i={width:0,height:0,edgeLabel:p,edgeObj:r,rank:c},s=t.addDummyNode(o,"edge",i,"_d"),c===_&&(i.width=p.width,i.height=p.height,i.dummy="edge-label",i.labelpos=p.labelpos),o.setEdge(l,s,{weight:p.weight},f),a===0&&o.graph().dummyChains.push(s),l=s;o.setEdge(l,d,{weight:p.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)})}},Bh}function Ul(){if(Pv)return Uh;Pv=1;const{applyWithChunking:t}=Dt();return Uh={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}},Uh}function g2(){if(Lv)return Vh;Lv=1;var t=Kn().Graph,e=Ul().slack;function n(s,i){return s.nodes().forEach(function a(l){i.nodeEdges(l).forEach(c=>{var d=c.v,u=l===d?c.w:d;s.hasNode(u)||e(i,c)||(s.setNode(u,{}),s.setEdge(l,u,{}),a(u))})}),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 Vh=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},Vh}function fD(){if(Fv)return Hh;Fv=1;var t=g2(),e=Ul().slack,n=Ul().longestPath,o=Kn().alg.preorder,r=Kn().alg.postorder,s=Dt().simplify;function i(g){g=s(g),n(g);var m,b=t(g);for(c(b),a(b,g);m=u(b);)p(b,g,m,f(b,g,m))}function a(g,m){var b=r(g,g.nodes());(b=b.slice(0,b.length-1)).forEach(x=>function(y,v,S){var k=y.node(S),I=k.parent;y.edge(S,I).cutvalue=l(y,v,S)}(g,m,x))}function l(g,m,b){var x=g.node(b).parent,y=!0,v=m.edge(b,x),S=0;return v||(y=!1,v=m.edge(x,b)),S=v.weight,m.nodeEdges(b).forEach(k=>{var I,j,E=k.v===b,T=E?k.w:k.v;if(T!==x){var M=E===y,L=m.edge(k).weight;if(S+=M?L:-L,I=b,j=T,g.hasEdge(I,j)){var B=g.edge(b,T).cutvalue;S+=M?-B:B}}}),S}function c(g,m){arguments.length<2&&(m=g.nodes()[0]),d(g,{},1,m)}function d(g,m,b,x,y){var v=b,S=g.node(x);return m[x]=!0,g.neighbors(x).forEach(k=>{Object.hasOwn(m,k)||(b=d(g,m,b,k,x))}),S.low=v,S.lim=b++,y?S.parent=y:delete S.parent,b}function u(g){return g.edges().find(m=>g.edge(m).cutvalue<0)}function f(g,m,b){var x=b.v,y=b.w;m.hasEdge(x,y)||(x=b.w,y=b.v);var v=g.node(x),S=g.node(y),k=v,I=!1;v.lim>S.lim&&(k=S,I=!0);var j=m.edges().filter(E=>I===_(g,g.node(E.v),k)&&I!==_(g,g.node(E.w),k));return j.reduce((E,T)=>e(m,T)<e(m,E)?T:E)}function p(g,m,b,x){var y=b.v,v=b.w;g.removeEdge(y,v),g.setEdge(x.v,x.w,{}),c(g),a(g,m),function(S,k){var I=S.nodes().find(E=>!k.node(E).parent),j=o(S,I);(j=j.slice(1)).forEach(E=>{var T=S.node(E).parent,M=k.edge(E,T),L=!1;M||(M=k.edge(T,E),L=!0),k.node(E).rank=k.node(T).rank+(L?M.minlen:-M.minlen)})}(g,m)}function _(g,m,b){return b.low<=m.lim&&m.lim<=b.lim}return Hh=i,i.initLowLimValues=c,i.initCutValues=a,i.calcCutValue=l,i.leaveEdge=u,i.enterEdge=f,i.exchangeEdges=p,Hh}function pD(){if(zv)return $h;zv=1;var t=Ul().longestPath,e=g2(),n=fD();$h=function(s){switch(s.graph().ranker){case"network-simplex":default:r(s);break;case"tight-tree":(function(i){t(i),e(i)})(s);break;case"longest-path":o(s)}};var o=t;function r(s){n(s)}return $h}function mD(){return Bv||(Bv=1,Wh=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(u,f,p,_){let g,m,b=[],x=[],y=Math.min(f[p].low,f[_].low),v=Math.max(f[p].lim,f[_].lim);g=p;do g=u.parent(g),b.push(g);while(g&&(f[g].low>y||v>f[g].lim));for(m=g,g=_;(g=u.parent(g))!==m;)x.push(g);return{path:b.concat(x.reverse()),lca:m}}(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]}})}),Wh}function gD(){if(Uv)return qh;Uv=1;let t=Dt();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"),u=t.addBorderNode(n,"_bb"),f=n.node(l);n.setParent(d,l),f.borderTop=d,n.setParent(u,l),f.borderBottom=u,c.forEach(p=>{e(n,o,r,s,i,a,p);let _=n.node(p),g=_.borderTop?_.borderTop:p,m=_.borderBottom?_.borderBottom:p,b=_.borderTop?s:2*s,x=g!==m?1:i-a[l]+1;n.setEdge(d,g,{weight:b,minlen:x,nestingEdge:!0}),n.setEdge(m,u,{weight:b,minlen:x,nestingEdge:!0})}),n.parent(l)||n.setEdge(o,d,{weight:0,minlen:i+a[l]})}return qh={run:function(n){let o=t.addDummyNode(n,"root",{},"_root"),r=function(c){var d={};function u(f,p){var _=c.children(f);_&&_.length&&_.forEach(g=>u(g,p+1)),d[f]=p}return c.children().forEach(f=>u(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,u)=>d+c.edge(u).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)})}},qh}function _D(){if(Hv)return Yh;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 Hv=1,Yh={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))}},Yh}function bD(){if(Jv)return Yv;Jv=1;let t=Dt();return Yv=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,u){let f=0,p=0;d.weight&&(f+=d.barycenter*d.weight,p+=d.weight),u.weight&&(f+=u.barycenter*u.weight,p+=u.weight),d.vs=u.vs.concat(d.vs),d.barycenter=f/p,d.weight=p,d.i=Math.min(u.i,d.i),u.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 yD(){if(Zv)return Xh;Zv=1;let t=(Gv||(Gv=1,qv=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),u=o.node(c.v);return{sum:l.sum+d.weight*u.order,weight:l.weight+d.weight}},{sum:0,weight:0});return{v:s,barycenter:a.sum/a.weight,weight:a.weight}}return{v:s}})}),qv),e=bD(),n=function(){if(Xv)return Kv;Xv=1;let o=Dt();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 Kv=function(s,i){let a=o.partition(s,m=>Object.hasOwn(m,"barycenter")),l=a.lhs,c=a.rhs.sort((m,b)=>b.i-m.i),d=[],u=0,f=0,p=0;var _;l.sort((_=!!i,(m,b)=>m.barycenter<b.barycenter?-1:m.barycenter>b.barycenter?1:_?b.i-m.i:m.i-b.i)),p=r(d,c,p),l.forEach(m=>{p+=m.vs.length,d.push(m.vs),u+=m.barycenter*m.weight,f+=m.weight,p=r(d,c,p)});let g={vs:d.flat(!0)};return f&&(g.barycenter=u/f,g.weight=f),g}}();return Xh=function o(r,s,i,a){let l=r.children(s),c=r.node(s),d=c?c.borderLeft:void 0,u=c?c.borderRight:void 0,f={};d&&(l=l.filter(m=>m!==d&&m!==u));let p=t(r,l);p.forEach(m=>{if(r.children(m.v).length){let y=o(r,m.v,i,a);f[m.v]=y,Object.hasOwn(y,"barycenter")&&(x=y,(b=m).barycenter!==void 0?(b.barycenter=(b.barycenter*b.weight+x.barycenter*x.weight)/(b.weight+x.weight),b.weight+=x.weight):(b.barycenter=x.barycenter,b.weight=x.weight))}var b,x});let _=e(p,i);(function(m,b){m.forEach(x=>{x.vs=x.vs.flatMap(y=>b[y]?b[y].vs:y)})})(_,f);let g=n(_,a);if(d&&(g.vs=[d,g.vs,u].flat(!0),r.predecessors(d).length)){let m=r.node(r.predecessors(d)[0]),b=r.node(r.predecessors(u)[0]);Object.hasOwn(g,"barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+m.order+b.order)/(g.weight+2),g.weight+=2}return g},Xh}function xD(){if(Qv)return Zh;Qv=1;let t=Kn().Graph,e=Dt();return Zh=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 u=d.v===a?d.w:d.v,f=i.edge(u,a),p=f!==void 0?f.weight:0;i.setEdge(u,a,{weight:n.edge(d).weight+p})}),Object.hasOwn(l,"minRank")&&i.setNode(a,{borderLeft:l.borderLeft[o],borderRight:l.borderRight[o]}))}),i},Zh}function wD(){if(n2)return Qh;n2=1;let t=function(){if($v)return Jh;$v=1;let d=Dt();return Jh=function(u){let f={},p=u.nodes().filter(x=>!u.children(x).length),_=p.map(x=>u.node(x).rank),g=d.applyWithChunking(Math.max,_),m=d.range(g+1).map(()=>[]);function b(x){if(f[x])return;f[x]=!0;let y=u.node(x);m[y.rank].push(x),u.successors(x).forEach(b)}return p.sort((x,y)=>u.node(x).rank-u.node(y).rank).forEach(b),m},Jh}(),e=function(){if(Wv)return Kh;Wv=1;let d=Dt().zipObject;function u(f,p,_){let g=d(_,_.map((S,k)=>k)),m=p.flatMap(S=>f.outEdges(S).map(k=>({pos:g[k.w],weight:f.edge(k).weight})).sort((k,I)=>k.pos-I.pos)),b=1;for(;b<_.length;)b<<=1;let x=2*b-1;b-=1;let y=new Array(x).fill(0),v=0;return m.forEach(S=>{let k=S.pos+b;y[k]+=S.weight;let I=0;for(;k>0;)k%2&&(I+=y[k+1]),k=k-1>>1,y[k]+=S.weight;v+=S.weight*I}),v}return Kh=function(f,p){let _=0;for(let g=1;g<p.length;++g)_+=u(f,p[g-1],p[g]);return _},Kh}(),n=yD(),o=xD(),r=(t2||(t2=1,e2=function(d,u,f){let p,_={};f.forEach(g=>{let m,b,x=d.parent(g);for(;x;){if(m=d.parent(x),m?(b=_[m],_[m]=x):(b=p,p=x),b&&b!==x)return void u.setEdge(b,x);x=m}})}),e2),s=Kn().Graph,i=Dt();function a(d,u,f){return u.map(function(p){return o(d,p,f)})}function l(d,u){let f=new s;d.forEach(function(p){let _=p.graph().root,g=n(p,_,f,u);g.vs.forEach((m,b)=>p.node(m).order=b),r(p,f,g.vs)})}function c(d,u){Object.values(u).forEach(f=>f.forEach((p,_)=>d.node(p).order=_))}return Qh=function d(u,f){if(f&&typeof f.customOrder=="function")return void f.customOrder(u,d);let p=i.maxRank(u),_=a(u,i.range(1,p+1),"inEdges"),g=a(u,i.range(p-1,-1,-1),"outEdges"),m=t(u);if(c(u,m),f&&f.disableOptimalOrderHeuristic)return;let b,x=Number.POSITIVE_INFINITY;for(let y=0,v=0;v<4;++y,++v){l(y%2?_:g,y%4>=2),m=i.buildLayerMatrix(u);let S=e(u,m);S<x&&(v=0,b=Object.assign({},m),x=S)}c(u,b)},Qh}function vD(){if(o2)return ef;o2=1;let t=Kn().Graph,e=Dt();function n(u,f){let p={};return f.length&&f.reduce(function(_,g){let m=0,b=0,x=_.length,y=g[g.length-1];return g.forEach((v,S)=>{let k=function(j,E){if(j.node(E).dummy)return j.predecessors(E).find(T=>j.node(T).dummy)}(u,v),I=k?u.node(k).order:x;(k||v===y)&&(g.slice(b,S+1).forEach(j=>{u.predecessors(j).forEach(E=>{let T=u.node(E),M=T.order;!(M<m||I<M)||T.dummy&&u.node(j).dummy||r(p,E,j)})}),b=S+1,m=I)}),g}),p}function o(u,f){let p={};function _(g,m,b,x,y){let v;e.range(m,b).forEach(S=>{v=g[S],u.node(v).dummy&&u.predecessors(v).forEach(k=>{let I=u.node(k);I.dummy&&(I.order<x||I.order>y)&&r(p,k,v)})})}return f.length&&f.reduce(function(g,m){let b,x=-1,y=0;return m.forEach((v,S)=>{if(u.node(v).dummy==="border"){let k=u.predecessors(v);k.length&&(b=u.node(k[0]).order,_(m,y,S,x,b),y=S,x=b)}_(m,y,m.length,b,g.length)}),m}),p}function r(u,f,p){if(f>p){let g=f;f=p,p=g}let _=u[f];_||(u[f]=_={}),_[p]=!0}function s(u,f,p){if(f>p){let _=f;f=p,p=_}return!!u[f]&&Object.hasOwn(u[f],p)}function i(u,f,p,_){let g={},m={},b={};return f.forEach(x=>{x.forEach((y,v)=>{g[y]=y,m[y]=y,b[y]=v})}),f.forEach(x=>{let y=-1;x.forEach(v=>{let S=_(v);if(S.length){S=S.sort((I,j)=>b[I]-b[j]);let k=(S.length-1)/2;for(let I=Math.floor(k),j=Math.ceil(k);I<=j;++I){let E=S[I];m[v]===v&&y<b[E]&&!s(p,v,E)&&(m[E]=v,m[v]=g[v]=g[E],y=b[E])}}})}),{root:g,align:m}}function a(u,f,p,_,g){let m={},b=function(v,S,k,I){let j=new t,E=v.graph(),T=function(M,L,B){return(O,z,F)=>{let V,P=O.node(z),C=O.node(F),H=0;if(H+=P.width/2,Object.hasOwn(P,"labelpos"))switch(P.labelpos.toLowerCase()){case"l":V=-P.width/2;break;case"r":V=P.width/2}if(V&&(H+=B?V:-V),V=0,H+=(P.dummy?L:M)/2,H+=(C.dummy?L:M)/2,H+=C.width/2,Object.hasOwn(C,"labelpos"))switch(C.labelpos.toLowerCase()){case"l":V=C.width/2;break;case"r":V=-C.width/2}return V&&(H+=B?V:-V),V=0,H}}(E.nodesep,E.edgesep,I);return S.forEach(M=>{let L;M.forEach(B=>{let O=k[B];if(j.setNode(O),L){var z=k[L],F=j.edge(z,O);j.setEdge(z,O,Math.max(T(v,B,L),F||0))}L=B})}),j}(u,f,p,g),x=g?"borderLeft":"borderRight";function y(v,S){let k=b.nodes(),I=k.pop(),j={};for(;I;)j[I]?v(I):(j[I]=!0,k.push(I),k=k.concat(S(I))),I=k.pop()}return y(function(v){m[v]=b.inEdges(v).reduce((S,k)=>Math.max(S,m[k.v]+b.edge(k)),0)},b.predecessors.bind(b)),y(function(v){let S=b.outEdges(v).reduce((I,j)=>Math.min(I,m[j.w]-b.edge(j)),Number.POSITIVE_INFINITY),k=u.node(v);S!==Number.POSITIVE_INFINITY&&k.borderType!==x&&(m[v]=Math.max(m[v],S))},b.successors.bind(b)),Object.keys(_).forEach(v=>m[v]=m[p[v]]),m}function l(u,f){return Object.values(f).reduce((p,_)=>{let g=Number.NEGATIVE_INFINITY,m=Number.POSITIVE_INFINITY;Object.entries(_).forEach(([x,y])=>{let v=function(S,k){return S.node(k).width}(u,x)/2;g=Math.max(y+v,g),m=Math.min(y-v,m)});const b=g-m;return b<p[0]&&(p=[b,_]),p},[Number.POSITIVE_INFINITY,null])[1]}function c(u,f){let p=Object.values(f),_=e.applyWithChunking(Math.min,p),g=e.applyWithChunking(Math.max,p);["u","d"].forEach(m=>{["l","r"].forEach(b=>{let x=m+b,y=u[x];if(y===f)return;let v=Object.values(y),S=_-e.applyWithChunking(Math.min,v);b!=="l"&&(S=g-e.applyWithChunking(Math.max,v)),S&&(u[x]=e.mapValues(y,k=>k+S))})})}function d(u,f){return e.mapValues(u.ul,(p,_)=>{if(f)return u[f.toLowerCase()][_];{let g=Object.values(u).map(m=>m[_]).sort((m,b)=>m-b);return(g[1]+g[2])/2}})}return ef={positionX:function(u){let f,p=e.buildLayerMatrix(u),_=Object.assign(n(u,p),o(u,p)),g={};["u","d"].forEach(b=>{f=b==="u"?p:Object.values(p).reverse(),["l","r"].forEach(x=>{x==="r"&&(f=f.map(k=>Object.values(k).reverse()));let y=(b==="u"?u.predecessors:u.successors).bind(u),v=i(u,f,_,y),S=a(u,f,v.root,v.align,x==="r");x==="r"&&(S=e.mapValues(S,k=>-k)),g[b+x]=S})});let m=l(u,g);return c(g,m),d(g,u.graph().align)},findType1Conflicts:n,findType2Conflicts:o,addConflict:r,hasConflict:s,verticalAlignment:i,horizontalCompaction:a,alignCoordinates:c,findSmallestWidthAlignment:l,balance:d},ef}function kD(){if(r2)return tf;r2=1;let t=Dt(),e=vD().positionX;return tf=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 u=o.node(d).height;return c>u?c:u},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)},tf}function SD(){if(s2)return nf;s2=1;let t=uD(),e=hD(),n=pD(),o=Dt().normalizeRanks,r=mD(),s=Dt().removeEmptyRanks,i=gD(),a=function(){if(Vv)return Gh;Vv=1;let I=Dt();function j(E,T,M,L,B,O){let z={width:0,height:0,rank:O,borderType:T},F=B[T][O-1],V=I.addDummyNode(E,"border",z,M);B[T][O]=V,E.setParent(V,L),F&&E.setEdge(F,V,{weight:1})}return Gh=function(E){E.children().forEach(function T(M){let L=E.children(M),B=E.node(M);if(L.length&&L.forEach(T),Object.hasOwn(B,"minRank")){B.borderLeft=[],B.borderRight=[];for(let O=B.minRank,z=B.maxRank+1;O<z;++O)j(E,"borderLeft","_bl",M,B,O),j(E,"borderRight","_br",M,B,O)}})},Gh}(),l=_D(),c=wD(),d=kD(),u=Dt(),f=Kn().Graph;nf=function(I,j){let E=j&&j.debugTiming?u.time:u.notime;E("layout",()=>{let T=E(" buildLayoutGraph",()=>function(M){let L=new f({multigraph:!0,compound:!0}),B=k(M.graph());return L.setGraph(Object.assign({},_,S(B,p),u.pick(B,g))),M.nodes().forEach(O=>{const z=S(k(M.node(O)),m);Object.keys(b).forEach(F=>{z[F]===void 0&&(z[F]=b[F])}),L.setNode(O,z),L.setParent(O,M.parent(O))}),M.edges().forEach(O=>{let z=k(M.edge(O));L.setEdge(O,Object.assign({},y,S(z,x),u.pick(z,v)))}),L}(I));E(" runLayout",()=>function(M,L,B){L(" makeSpaceForEdgeLabels",()=>function(O){let z=O.graph();z.ranksep/=2,O.edges().forEach(F=>{let V=O.edge(F);V.minlen*=2,V.labelpos.toLowerCase()!=="c"&&(z.rankdir==="TB"||z.rankdir==="BT"?V.width+=V.labeloffset:V.height+=V.labeloffset)})}(M)),L(" removeSelfEdges",()=>function(O){O.edges().forEach(z=>{if(z.v===z.w){var F=O.node(z.v);F.selfEdges||(F.selfEdges=[]),F.selfEdges.push({e:z,label:O.edge(z)}),O.removeEdge(z)}})}(M)),L(" acyclic",()=>t.run(M)),L(" nestingGraph.run",()=>i.run(M)),L(" rank",()=>n(u.asNonCompoundGraph(M))),L(" injectEdgeLabelProxies",()=>function(O){O.edges().forEach(z=>{let F=O.edge(z);if(F.width&&F.height){let V=O.node(z.v),P={rank:(O.node(z.w).rank-V.rank)/2+V.rank,e:z};u.addDummyNode(O,"edge-proxy",P,"_ep")}})}(M)),L(" removeEmptyRanks",()=>s(M)),L(" nestingGraph.cleanup",()=>i.cleanup(M)),L(" normalizeRanks",()=>o(M)),L(" assignRankMinMax",()=>function(O){let z=0;O.nodes().forEach(F=>{let V=O.node(F);V.borderTop&&(V.minRank=O.node(V.borderTop).rank,V.maxRank=O.node(V.borderBottom).rank,z=Math.max(z,V.maxRank))}),O.graph().maxRank=z}(M)),L(" removeEdgeLabelProxies",()=>function(O){O.nodes().forEach(z=>{let F=O.node(z);F.dummy==="edge-proxy"&&(O.edge(F.e).labelRank=F.rank,O.removeNode(z))})}(M)),L(" normalize.run",()=>e.run(M)),L(" parentDummyChains",()=>r(M)),L(" addBorderSegments",()=>a(M)),L(" order",()=>c(M,B)),L(" insertSelfEdges",()=>function(O){var z=u.buildLayerMatrix(O);z.forEach(F=>{var V=0;F.forEach((P,C)=>{var H=O.node(P);H.order=C+V,(H.selfEdges||[]).forEach(N=>{u.addDummyNode(O,"selfedge",{width:N.label.width,height:N.label.height,rank:H.rank,order:C+ ++V,e:N.e,label:N.label},"_se")}),delete H.selfEdges})})}(M)),L(" adjustCoordinateSystem",()=>l.adjust(M)),L(" position",()=>d(M)),L(" positionSelfEdges",()=>function(O){O.nodes().forEach(z=>{var F=O.node(z);if(F.dummy==="selfedge"){var V=O.node(F.e.v),P=V.x+V.width/2,C=V.y,H=F.x-P,N=V.height/2;O.setEdge(F.e,F.label),O.removeNode(z),F.label.points=[{x:P+2*H/3,y:C-N},{x:P+5*H/6,y:C-N},{x:P+H,y:C},{x:P+5*H/6,y:C+N},{x:P+2*H/3,y:C+N}],F.label.x=F.x,F.label.y=F.y}})}(M)),L(" removeBorderNodes",()=>function(O){O.nodes().forEach(z=>{if(O.children(z).length){let F=O.node(z),V=O.node(F.borderTop),P=O.node(F.borderBottom),C=O.node(F.borderLeft[F.borderLeft.length-1]),H=O.node(F.borderRight[F.borderRight.length-1]);F.width=Math.abs(H.x-C.x),F.height=Math.abs(P.y-V.y),F.x=C.x+F.width/2,F.y=V.y+F.height/2}}),O.nodes().forEach(z=>{O.node(z).dummy==="border"&&O.removeNode(z)})}(M)),L(" normalize.undo",()=>e.undo(M)),L(" fixupEdgeLabelCoords",()=>function(O){O.edges().forEach(z=>{let F=O.edge(z);if(Object.hasOwn(F,"x"))switch(F.labelpos!=="l"&&F.labelpos!=="r"||(F.width-=F.labeloffset),F.labelpos){case"l":F.x-=F.width/2+F.labeloffset;break;case"r":F.x+=F.width/2+F.labeloffset}})}(M)),L(" undoCoordinateSystem",()=>l.undo(M)),L(" translateGraph",()=>function(O){let z=Number.POSITIVE_INFINITY,F=0,V=Number.POSITIVE_INFINITY,P=0,C=O.graph(),H=C.marginx||0,N=C.marginy||0;function $(Y){let Z=Y.x,q=Y.y,re=Y.width,ne=Y.height;z=Math.min(z,Z-re/2),F=Math.max(F,Z+re/2),V=Math.min(V,q-ne/2),P=Math.max(P,q+ne/2)}O.nodes().forEach(Y=>$(O.node(Y))),O.edges().forEach(Y=>{let Z=O.edge(Y);Object.hasOwn(Z,"x")&&$(Z)}),z-=H,V-=N,O.nodes().forEach(Y=>{let Z=O.node(Y);Z.x-=z,Z.y-=V}),O.edges().forEach(Y=>{let Z=O.edge(Y);Z.points.forEach(q=>{q.x-=z,q.y-=V}),Object.hasOwn(Z,"x")&&(Z.x-=z),Object.hasOwn(Z,"y")&&(Z.y-=V)}),C.width=F-z+H,C.height=P-V+N}(M)),L(" assignNodeIntersects",()=>function(O){O.edges().forEach(z=>{let F,V,P=O.edge(z),C=O.node(z.v),H=O.node(z.w);P.points?(F=P.points[0],V=P.points[P.points.length-1]):(P.points=[],F=H,V=C),P.points.unshift(u.intersectRect(C,F)),P.points.push(u.intersectRect(H,V))})}(M)),L(" reversePoints",()=>function(O){O.edges().forEach(z=>{let F=O.edge(z);F.reversed&&F.points.reverse()})}(M)),L(" acyclic.undo",()=>t.undo(M))}(T,E,j)),E(" updateInputGraph",()=>function(M,L){M.nodes().forEach(B=>{let O=M.node(B),z=L.node(B);O&&(O.x=z.x,O.y=z.y,O.rank=z.rank,L.children(B).length&&(O.width=z.width,O.height=z.height))}),M.edges().forEach(B=>{let O=M.edge(B),z=L.edge(B);O.points=z.points,Object.hasOwn(z,"x")&&(O.x=z.x,O.y=z.y)}),M.graph().width=L.graph().width,M.graph().height=L.graph().height}(I,T))})};let p=["nodesep","edgesep","ranksep","marginx","marginy"],_={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},g=["acyclicer","ranker","rankdir","align"],m=["width","height"],b={width:0,height:0},x=["minlen","weight","width","height","labeloffset"],y={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},v=["labelpos"];function S(I,j){return u.mapValues(u.pick(I,j),Number)}function k(I){var j={};return I&&Object.entries(I).forEach(([E,T])=>{typeof E=="string"&&(E=E.toLowerCase()),j[E]=T}),j}return nf}function CD(){if(i2)return of;i2=1;let t=Dt(),e=Kn().Graph;return of={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}},of}var _2=d2?c2:(d2=1,c2={graphlib:Kn(),layout:SD(),debug:CD(),util:{time:Dt().time,notime:Dt().notime},version:l2?a2:(l2=1,a2="1.1.4")});const Hi=new _2.graphlib.Graph().setDefaultEdgeLabel(()=>({})),b2=(t,e,n)=>(Hi.setGraph({rankdir:n.direction,nodesep:150,ranksep:200,ranker:"longest-path"}),e.forEach(o=>Hi.setEdge(o.source,o.target)),t.forEach(o=>Hi.setNode(o.id,{...o,width:o.width??0,height:o.height??0})),_2.layout(Hi),{nodes:t.map(o=>{const{x:r,y:s}=Hi.node(o.id);return{...o,position:{x:r,y:s}}}),edges:e}),y2=new class{createEdge(t,e){return{animated:!0,markerEnd:{type:as.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:yh(dt.get(e).code.trim().split(`
128
- `).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 u of c)for(const f of d){const p=`${u}-${f}`;a.has(p)||(a.add(p),i.add(u),i.add(f),s.push(this.createEdge(u,f)))}}for(const[l,c]of $p.zip(t,e)){o||r.push(this.createNode(l,c));const d=i.has(l),u=dt.get(c).code.trim().startsWith("mo.md");!d&&u||r.push(this.createNode(l,c))}return{nodes:r,edges:s}}},ND=t=>{const e=X.c(43),{cellIds:n,variables:o,cellAtoms:r,children:s,layoutDirection:i,settings:a}=t;let l;e[0]!==r||e[1]!==n||e[2]!==i||e[3]!==a.hidePureMarkdown||e[4]!==o?(l=()=>{let C=y2.createElements(n,r,o,a.hidePureMarkdown);return C=b2(C.nodes,C.edges,{direction:i}),C},e[0]=r,e[1]=n,e[2]=i,e[3]=a.hidePureMarkdown,e[4]=o,e[5]=l):l=e[5];const[c]=A.useState(l),[d,u,f]=Xw(c.nodes),[p,_,g]=Zw(c.edges),m=Bi();let b;e[6]!==i||e[7]!==_||e[8]!==u?(b=C=>{const H=b2(C.nodes,C.edges,{direction:i});u(H.nodes),_(H.edges)},e[6]=i,e[7]=_,e[8]=u,e[9]=b):b=e[9];const x=et(b);let y,v;e[10]!==r||e[11]!==n||e[12]!==a.hidePureMarkdown||e[13]!==x||e[14]!==o?(y=()=>{x(y2.createElements(n,r,o,a.hidePureMarkdown))},v=[n,o,r,x,a.hidePureMarkdown],e[10]=r,e[11]=n,e[12]=a.hidePureMarkdown,e[13]=x,e[14]=o,e[15]=y,e[16]=v):(y=e[15],v=e[16]),A.useEffect(y,v);const[S,k]=A.useState();let I;sv(),e[17]===Symbol.for("react.memo_cache_sentinel")?(I=()=>{k(void 0)},e[17]=I):I=e[17];const j=I;let E,T,M,L,B,O,z,F,V,P;return e[18]===Symbol.for("react.memo_cache_sentinel")?(E={minZoom:.5,maxZoom:1.5},T=(C,H)=>{k({type:"node",id:H.id})},M=(C,H)=>{const{source:N,target:$}=H;k({type:"edge",source:N,target:$})},e[18]=E,e[19]=T,e[20]=M):(E=e[18],T=e[19],M=e[20]),e[21]===Symbol.for("react.memo_cache_sentinel")?(L=h.jsx(q9,{color:"#ccc",variant:Ln.Dots}),e[21]=L):L=e[21],e[22]!==m||e[23]!==d?(B=()=>{const C=dt.get(sV);if(C){const H=d.find(N=>N.id===C);H&&(m.fitView({padding:1,duration:600,nodes:[H]}),k({type:"node",id:C}))}},e[22]=m,e[23]=d,e[24]=B):B=e[24],e[25]===Symbol.for("react.memo_cache_sentinel")?(O=h.jsx(Cm,{className:"size-4"}),e[25]=O):O=e[25],e[26]!==B?(z=h.jsx(B9,{position:"bottom-right",showInteractive:!1,children:h.jsx(Le,{content:"Jump to focused cell",delayDuration:200,side:"left",asChild:!1,children:h.jsx(ms,{onMouseDown:Hn.preventFocus,onClick:B,children:O})})}),e[26]=B,e[27]=z):z=e[27],e[28]!==p||e[29]!==S||e[30]!==o?(F=h.jsx(Bl,{selection:S,variables:o,edges:p,onClearSelection:j}),e[28]=p,e[29]=S,e[30]=o,e[31]=F):F=e[31],e[32]!==s||e[33]!==p||e[34]!==d||e[35]!==g||e[36]!==f||e[37]!==z||e[38]!==F?(V=h.jsxs(bh,{nodes:d,edges:p,nodeTypes:ov,minZoom:.2,fitViewOptions:E,onNodeClick:T,onEdgeClick:M,onNodeDoubleClick:jD,fitView:!0,onNodesChange:f,onEdgesChange:g,zoomOnDoubleClick:!1,nodesConnectable:!1,children:[L,z,F,s]}),e[32]=s,e[33]=p,e[34]=d,e[35]=g,e[36]=f,e[37]=z,e[38]=F,e[39]=V):V=e[39],e[40]!==i||e[41]!==V?(P=h.jsx(tv.Provider,{value:i,children:V}),e[40]=i,e[41]=V,e[42]=P):P=e[42],P};function jD(t,e){B4(e.id,"focus")}const ED=Qt("_minimap_"),ID=Qt({hidePureMarkdown:!0}),AD=t=>{const e=X.c(11),[n,o]=fn(ED),[r,s]=fn(ID);let i;e[0]!==n||e[1]!==t||e[2]!==o||e[3]!==s||e[4]!==r?(i=()=>n==="_minimap_"?h.jsx(X9,{...t,children:h.jsx(wh,{settings:r,onSettingsChange:s,view:n,onChange:o})}):h.jsx(ND,{...t,settings:r,layoutDirection:n,children:h.jsx(wh,{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=h.jsx(_h,{children:l},n),e[8]=n,e[9]=l,e[10]=c):c=e[10],c},TD=()=>{const t=X.c(5),e=U4(),n=zc(),[o]=iV();let r,s;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=Oe("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=h.jsx("div",{className:r,children:h.jsx(AD,{cellAtoms:o,variables:e,cellIds:n.inOrderIds})}),t[1]=n.inOrderIds,t[2]=o,t[3]=e,t[4]=s):s=t[4],s},x2="name",w2="type-value",sf="defs-refs",MD=[{id:x2,accessorFn:t=>[t.name,t.declaredBy],enableSorting:!0,sortingFn:"alphanumeric",header:({column:t})=>h.jsx(Jp,{header:"Name",column:t}),cell:({getValue:t})=>{const[e,n]=t();return h.jsx(xh,{name:e,declaredBy:n})}},{id:w2,accessorFn:t=>[t.dataType,t.value],enableSorting:!0,sortingFn:"alphanumeric",header:({column:t})=>h.jsx(Jp,{header:h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsx("span",{children:"Type"}),h.jsx("span",{children:"Value"})]}),column:t}),cell:({getValue:t})=>{const[e,n]=t();return h.jsxs("div",{className:"max-w-[150px]",children:[h.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap text-muted-foreground font-mono text-xs",children:e}),h.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap",title:n??"",children:n})]})}},{id:sf,accessorFn:t=>[t.declaredBy,t.usedBy,t.name,t.declaredByNames,t.usedByNames],enableSorting:!0,sortingFn:"basic",header:({column:t})=>h.jsx(Jp,{header:h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsx("span",{children:"Declared By"}),h.jsx("span",{children:"Used By"})]}),column:t}),cell:({getValue:t})=>{const[e,n,o]=t(),r=s=>{const i=ic(s);i&&Wp(i,o)};return h.jsxs("div",{className:"flex flex-col gap-1 py-1",children:[h.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-center",children:[h.jsx("span",{title:"Declared by",children:h.jsx(Bm,{className:"w-3.5 h-3.5 text-muted-foreground"})}),e.length===1?h.jsx(pr,{variant:"focus",cellId:e[0],skipScroll:!0,onClick:()=>r(e[0])}):h.jsx("div",{className:"text-destructive flex flex-row gap-2",children:e.slice(0,3).map((s,i)=>h.jsxs("span",{className:"flex",children:[h.jsx(pr,{variant:"focus",cellId:s,skipScroll:!0,className:"whitespace-nowrap text-destructive",onClick:()=>r(s)},s),i<e.length-1&&", "]},s))})]}),h.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-baseline",children:[h.jsx("span",{title:"Used by",children:h.jsx(Ea,{className:"w-3.5 h-3.5 text-muted-foreground"})}),h.jsx(rv,{maxCount:3,cellIds:n,skipScroll:!0,onClick:r})]})]})}}],v2=A.memo(({className:t,cellIds:e,variables:n})=>{const[o,r]=K.useState([]),[s,i]=K.useState(""),a=aV(),l=A.useMemo(()=>{const u=f=>{const p=a[f];return hV(p)?`cell-${e.indexOf(f)}`:p??`cell-${e.indexOf(f)}`};return Object.values(n).map(f=>({...f,declaredByNames:f.declaredBy.map(u),usedByNames:f.usedBy.map(u)}))},[n,a,e]),c=A.useMemo(()=>{const u=new Map;return e.forEach((f,p)=>u.set(f,p)),function(f,p,_){p||(p={id:sf,desc:!1});let g=[];switch(p.id){case x2:g=wa(f,m=>m.name);break;case w2:g=wa(f,m=>m.dataType);break;case sf:g=wa(f,m=>_.get(m.declaredBy[0]))}return p.desc?g.reverse():g}(l,o[0],u)},[l,o,e]),d=lV({data:c,columns:MD,getCoreRowModel:uV(),onGlobalFilterChange:i,getFilteredRowModel:dV(),enableFilters:!0,enableGlobalFilter:!0,enableColumnPinning:!1,getColumnCanGlobalFilter:u=>u.columnDef.enableGlobalFilter??!0,globalFilterFn:"auto",manualSorting:!0,onSortingChange:r,getSortedRowModel:cV(),state:{sorting:o,globalFilter:s}});return h.jsxs(h.Fragment,{children:[h.jsx(V4,{className:"w-full",placeholder:"Search",value:s,onChange:u=>i(u.target.value)}),h.jsxs(qp,{className:Oe("w-full text-sm flex-1 border-separate border-spacing-0",t),children:[h.jsx(Gp,{children:h.jsx(Ks,{className:"whitespace-nowrap text-xs",children:d.getFlatHeaders().map(u=>h.jsx(Fr,{className:"sticky top-0 bg-background border-b",children:H4(u.column.columnDef.header,u.getContext())},u.id))})}),h.jsx(Yp,{children:d.getRowModel().rows.map(u=>h.jsx(Ks,{className:"hover:bg-accent",children:u.getVisibleCells().map(f=>h.jsx(zr,{className:"border-b",children:H4(f.column.columnDef.cell,f.getContext())},f.id))},u.id))})]})]})});v2.displayName="VariableTable";let k2,S2,C2;k2=()=>{const t=X.c(4),e=U4(),n=zc();if(Object.keys(e).length===0){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsx(An,{title:"No variables",description:"Global variables will appear here.",icon:h.jsx(fc,{})}),t[0]=r):r=t[0],r}let o;return t[1]!==n.inOrderIds||t[2]!==e?(o=h.jsx(v2,{className:"flex-1",cellIds:n.inOrderIds,variables:e}),t[1]=n.inOrderIds,t[2]=e,t[3]=o):o=t[3],o},nm=t=>{const e=X.c(6),n=t.dataTestId;let o,r;return e[0]!==t.className?(o=Oe("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=h.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},S2=()=>{const t=X.c(9),e=fV(),{clearLogs:n}=Lt();if(e.length===0){let i,a;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsx("code",{className:"border rounded px-1",children:"stdout"}),t[0]=i):i=t[0],t[1]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsx(An,{title:"No logs",description:h.jsxs("span",{children:[i," and"," ",h.jsx("code",{className:"border rounded px-1",children:"stderr"})," logs will appear here."]}),icon:h.jsx(fp,{})}),t[1]=a):a=t[1],a}let o,r,s;return t[2]!==n?(o=h.jsx("div",{className:"flex flex-row justify-end px-2 py-1",children:h.jsx(nm,{dataTestId:"clear-logs-button",onClick:n})}),t[2]=n,t[3]=o):o=t[3],t[4]!==e?(r=h.jsx("div",{className:"overflow-auto flex-1",children:h.jsx(C2,{logs:e,className:"min-w-[300px]"})}),t[4]=e,t[5]=r):r=t[5],t[6]!==o||t[7]!==r?(s=h.jsxs(h.Fragment,{children:[o,r]}),t[6]=o,t[7]=r,t[8]=s):s=t[8],s},C2=t=>{const e=X.c(10),{logs:n,className:o}=t;let r,s,i,a,l;return e[0]!==o?(r=Oe("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(RD),e[3]=n,e[4]=i):i=e[4],e[5]!==i?(a=h.jsx("pre",{className:"grid text-xs font-mono gap-1 whitespace-break-spaces font-semibold align-left",children:h.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=h.jsx("div",{className:r,children:a}),e[7]=r,e[8]=a,e[9]=l):l=e[9],l};function OD(t){const e=pV(t.timestamp),n=DD[t.level],o=t.level.toUpperCase();return h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"flex-shrink-0 text-[var(--gray-10)] dark:text-[var(--gray-11)]",children:["[",e,"]"]}),h.jsx("span",{className:Oe("flex-shrink-0",n),children:o}),h.jsxs("span",{className:"flex-shrink-0 text-[var(--gray-10)]",children:["(",h.jsx(pr,{cellId:t.cellId}),")"]}),t.message]})}const DD={stdout:"text-[var(--grass-9)]",stderr:"text-[var(--red-9)]"};function RD(t,e){return h.jsxs("div",{className:"contents group",children:[h.jsx("span",{className:Oe("opacity-70 group-hover:bg-[var(--gray-3)] group-hover:opacity-100","text-right col-span-1 py-1 pr-1"),children:e+1}),h.jsx("span",{className:Oe("opacity-70 group-hover:bg-[var(--gray-3)] group-hover:opacity-100","px-2 flex gap-x-1.5 py-1 flex-wrap"),children:OD(t)})]},e)}const PD=()=>{const t=X.c(5),{documentation:e}=We(mV);if(!e){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsx(An,{title:"View docs as you type",description:"Move your text cursor over a symbol to see its documentation.",icon:h.jsx(nd,{})}),t[0]=r):r=t[0],r}let n,o;return t[1]!==e?(n=Vp({html:e}),t[1]=e,t[2]=n):n=t[2],t[3]!==n?(o=h.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};function N2(t,e,n){return t[e]?t[e][0]?t[e][0][n]:t[e][n]:e==="contentBoxSize"?t.contentRect[n==="inlineSize"?"width":"height"]:void 0}om=function(t){t===void 0&&(t={});var e=t.onResize,n=A.useRef(void 0);n.current=e;var o=t.round||Math.round,r=A.useRef(),s=A.useState({width:void 0,height:void 0}),i=s[0],a=s[1],l=A.useRef(!1);A.useEffect(function(){return l.current=!1,function(){l.current=!0}},[]);var c=A.useRef({width:void 0,height:void 0}),d=function(u,f){var p=A.useRef(null),_=A.useRef(null);_.current=f;var g=A.useRef(null);A.useEffect(function(){m()});var m=A.useCallback(function(){var b=g.current,x=_.current,y=b||(x?x instanceof Element?x:x.current:null);p.current&&p.current.element===y&&p.current.subscriber===u||(p.current&&p.current.cleanup&&p.current.cleanup(),p.current={element:y,subscriber:u,cleanup:y?u(y):void 0})},[u]);return A.useEffect(function(){return function(){p.current&&p.current.cleanup&&(p.current.cleanup(),p.current=null)}},[]),A.useCallback(function(b){g.current=b,m()},[m])}(A.useCallback(function(u){return r.current&&r.current.box===t.box&&r.current.round===o||(r.current={box:t.box,round:o,instance:new ResizeObserver(function(f){var p=f[0],_=t.box==="border-box"?"borderBoxSize":t.box==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",g=N2(p,_,"inlineSize"),m=N2(p,_,"blockSize"),b=g?o(g):void 0,x=m?o(m):void 0;if(c.current.width!==b||c.current.height!==x){var y={width:b,height:x};c.current.width=b,c.current.height=x,n.current?n.current(y):l.current||a(y)}})}),r.current.instance.observe(u,{box:t.box}),function(){r.current&&r.current.instance.unobserve(u)}},[t.box,o]),t.ref);return A.useMemo(function(){return{ref:d,width:i.width,height:i.height}},[d,i.width,i.height])};const af=new Map,LD=({file:t,onOpenNotebook:e})=>{const{theme:n}=Fo(),o=We(cp),[r,s]=A.useState(""),{data:i,loading:a,error:l,setData:c}=$n(async()=>{const g=await $4({path:t.path}),m=g.contents||"";return s(af.get(t.path)||m),g},[t.path]),d=async()=>{r!==(i==null?void 0:i.contents)&&await vV({path:t.path,contents:r}).then(g=>{g.success&&(c(m=>m?{...m,contents:r}:void 0),s(r))})},u=A.useRef(r);if(u.current=r,A.useEffect(()=>()=>{if(!(i!=null&&i.contents))return;const g=u.current;g===i.contents?af.delete(t.path):af.set(t.path,g)},[t.path,i==null?void 0:i.contents]),l)return h.jsx(Xs,{error:l});if(a||!i)return null;const f=i.mimeType||"text/plain",p=f in lf;if(!i.contents&&!p)return h.jsxs("div",{className:"grid grid-cols-2 gap-2 p-6",children:[h.jsx("div",{className:"font-bold text-muted-foreground",children:"Name"}),h.jsx("div",{children:i.file.name}),h.jsx("div",{className:"font-bold text-muted-foreground",children:"Type"}),h.jsx("div",{children:f})]});const _=h.jsxs("div",{className:"text-xs text-muted-foreground p-1 flex justify-end gap-2 border-b",children:[t.isMarimoFile&&!Un()&&h.jsx(Le,{content:"Open notebook",children:h.jsx(xn,{size:"small",onClick:g=>e(g),children:h.jsx(xc,{})})}),h.jsx(Le,{content:"Download",children:h.jsx(xn,{size:"small",onClick:()=>{if(j2(f)){const g=xV(i.contents,f);wV(g,i.file.name)}else oa(new Blob([i.contents||r],{type:f}),i.file.name)},children:h.jsx(yp,{})})}),!j2(f)&&h.jsxs(h.Fragment,{children:[h.jsx(Le,{content:"Copy contents to clipboard",children:h.jsx(xn,{size:"small",onClick:async()=>{await yn(r)},children:h.jsx(Ls,{})})}),h.jsx(Le,{content:pn("global.save"),children:h.jsx(xn,{size:"small",color:r===i.contents?void 0:"green",onClick:d,disabled:r===i.contents,children:h.jsx(ja,{})})})]})]});return f.startsWith("image/")?h.jsxs(h.Fragment,{children:[_,h.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:h.jsx(gV,{base64:i.contents,mime:f})})]}):f==="text/csv"&&i.contents?h.jsxs(h.Fragment,{children:[_,h.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:h.jsx(_V,{contents:i.contents})})]}):f.startsWith("audio/")?h.jsxs(h.Fragment,{children:[_,h.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:h.jsx(bV,{base64:i.contents,mime:f})})]}):f.startsWith("video/")?h.jsxs(h.Fragment,{children:[_,h.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:h.jsx(yV,{base64:i.contents,mime:f})})]}):h.jsxs(h.Fragment,{children:[_,h.jsx("div",{className:"flex-1 overflow-auto",children:h.jsx(_a,{theme:n==="dark"?"dark":"light",language:lf[f]||lf.default,className:"border-b",extensions:[st.lineWrapping,Wn.of([{key:o.getHotkey("global.save").key,stopPropagation:!0,run:()=>r!==i.contents&&(d(),!0)}])],value:r,onChange:s})})]})},j2=t=>t.startsWith("image/")||t.startsWith("audio/")||t.startsWith("video/"),lf={"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"},E2=Qt(new class{constructor(t){this.callbacks=t,this.delegate=new Xp([]),this.rootPath="",this.onChange=En.NOOP,this.path=new mp("/"),this.initialize=async e=>{if(this.onChange=e,this.delegate.data.length===0)try{const n=await this.callbacks.listFiles({path:this.rootPath});this.delegate=new Xp(n.files),this.rootPath=n.root,this.path=mp.guessDeliminator(n.root)}catch(n){lt({title:"Failed",description:b4(n)})}this.onChange(this.delegate.data)},this.refreshAll=async e=>{const n=[this.rootPath,...e.map(r=>{var s;return(s=this.delegate.find(r))==null?void 0:s.data.path})].filter(Boolean),o=await Promise.all(n.map(r=>this.callbacks.listFiles({path:r}).catch(()=>({files:[]}))));for(const[r,s]of n.entries()){const i=o[r];s===this.rootPath?this.delegate=new Xp(i.files):this.delegate.update({id:s,changes:{children:i.files}})}this.onChange(this.delegate.data)},this.relativeFromRoot=e=>{const n=function(o){return o.endsWith("/")?o:`${o}/`}(this.rootPath);return e.startsWith(n)?e.slice(n.length):e},this.handleResponse=e=>e.success?e:(lt({title:"Failed",description:e.message}),null)}async expand(t){const e=this.delegate.find(t);if(!e||!e.data.isDirectory)return!1;if(e.children&&e.children.length>0)return!0;const n=await this.callbacks.listFiles({path:e.data.path});return this.delegate.update({id:t,changes:{children:n.files}}),this.onChange(this.delegate.data),!0}async rename(t,e){const n=this.delegate.find(t);if(!n)return;const o=n.data.path,r=this.path.join(this.path.dirname(o),e);await this.callbacks.renameFileOrFolder({path:o,newPath:r}).then(this.handleResponse),this.delegate.update({id:t,changes:{name:e,path:r}}),this.onChange(this.delegate.data),await this.refreshAll([r])}async move(t,e){var o;const n=e?((o=this.delegate.find(e))==null?void 0:o.data.path)??e:this.rootPath;await Promise.all(t.map(r=>{this.delegate.move({id:r,parentId:e,index:0});const s=this.delegate.find(r);if(!s)return Promise.resolve();const i=this.path.join(n,this.path.basename(s.data.path));return this.delegate.update({id:r,changes:{path:i}}),this.callbacks.renameFileOrFolder({path:s.data.path,newPath:i}).then(this.handleResponse)})),this.onChange(this.delegate.data),await this.refreshAll([n])}async createFile(t,e){var r;const n=e?((r=this.delegate.find(e))==null?void 0:r.data.path)??e:this.rootPath,o=await this.callbacks.createFileOrFolder({path:n,type:"file",name:t}).then(this.handleResponse);o!=null&&o.info&&(this.delegate.create({parentId:e,index:0,data:o.info}),this.onChange(this.delegate.data),await this.refreshAll([n]))}async createFolder(t,e){var r;const n=e?((r=this.delegate.find(e))==null?void 0:r.data.path)??e:this.rootPath,o=await this.callbacks.createFileOrFolder({path:n,type:"directory",name:t}).then(this.handleResponse);o!=null&&o.info&&(this.delegate.create({parentId:e,index:0,data:o.info}),this.onChange(this.delegate.data),await this.refreshAll([n]))}async delete(t){const e=this.delegate.find(t);e&&(await this.callbacks.deleteFileOrFolder({path:e.data.path}).then(this.handleResponse),this.delegate.drop({id:t}),this.onChange(this.delegate.data))}}({listFiles:Q3,createFileOrFolder:W4,deleteFileOrFolder:SV,renameFileOrFolder:kV})),FD=Qt({});function zD(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 I2(t){const e=X.c(4);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const o=n;let r;return e[2]!==o?(r={multiple:!0,maxSize:104857600,onError:$D,onDropRejected:UD,onDrop:BD,...o},e[2]=o,e[3]=r):r=e[3],CV(r)}async function BD(t){for(const e of t){const n=(await zD(e)).split(",")[1];await W4({path:"",type:"file",name:e.name,contents:n})}await async function(){await dt.get(E2).refreshAll([])}()}function UD(t){lt({title:"File upload failed",description:h.jsx("div",{className:"flex flex-col gap-1",children:t.map(VD)}),variant:"danger"})}function VD(t){return h.jsxs("div",{children:[t.file.name," (",t.errors.map(HD).join(", "),")"]},t.file.name)}function HD(t){return t.message}function $D(t){Zt.error(t),lt({title:"File upload failed",description:t.message,variant:"danger"})}const A2=K.createContext(null),WD=t=>{const e=X.c(60),{height:n}=t,o=A.useRef(null),[r]=fn(E2);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[0]=s):s=e[0];const[i,a]=A.useState(s),[l,c]=A.useState(null),{openPrompt:d}=Vn(),[u,f]=fn(FD);let p,_;e[1]!==r?(p=()=>r.initialize(a),e[1]=r,e[2]=p):p=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(_=[],e[3]=_):_=e[3];const{loading:g,error:m}=$n(p,_);let b;e[4]!==u||e[5]!==r?(b=()=>{r.refreshAll(Object.keys(u).filter(C=>u[C]))},e[4]=u,e[5]=r,e[6]=b):b=e[6];const x=et(b);let y;e[7]!==d||e[8]!==r?(y=async()=>{d({title:"Folder name",onConfirm:async C=>{r.createFolder(C,null)}})},e[7]=d,e[8]=r,e[9]=y):y=e[9];const v=et(y);let S;e[10]!==d||e[11]!==r?(S=async()=>{d({title:"File name",onConfirm:async C=>{r.createFile(C,null)}})},e[10]=d,e[11]=r,e[12]=S):S=e[12];const k=et(S);let I;e[13]!==f?(I=()=>{var C;(C=o.current)==null||C.closeAll(),f({})},e[13]=f,e[14]=I):I=e[14];const j=et(I);if(g){let C;return e[15]===Symbol.for("react.memo_cache_sentinel")?(C=h.jsx(eo,{size:"medium",centered:!0}),e[15]=C):C=e[15],C}if(m){let C;return e[16]!==m?(C=h.jsx(Xs,{error:m}),e[16]=m,e[17]=C):C=e[17],C}if(l){let C,H,N,$,Y,Z;return e[18]===Symbol.for("react.memo_cache_sentinel")?(C=()=>c(null),e[18]=C):C=e[18],e[19]===Symbol.for("react.memo_cache_sentinel")?(H=h.jsx(Pe,{onClick:C,"data-testid":"file-explorer-back-button",variant:"text",size:"xs",className:"mb-0",children:h.jsx(Et,{size:16})}),e[19]=H):H=e[19],e[20]!==l.name?(N=h.jsxs("div",{className:"flex items-center pl-1 pr-3 flex-shrink-0 border-b justify-between",children:[H,h.jsx("span",{className:"font-bold",children:l.name})]}),e[20]=l.name,e[21]=N):N=e[21],e[22]!==l.path||e[23]!==r?($=q=>T2(q,r.relativeFromRoot(l.path)),e[22]=l.path,e[23]=r,e[24]=$):$=e[24],e[25]!==l||e[26]!==$?(Y=h.jsx(A.Suspense,{children:h.jsx(LD,{onOpenNotebook:$,file:l})}),e[25]=l,e[26]=$,e[27]=Y):Y=e[27],e[28]!==N||e[29]!==Y?(Z=h.jsxs(h.Fragment,{children:[N,Y]}),e[28]=N,e[29]=Y,e[30]=Z):Z=e[30],Z}let E;e[31]!==j||e[32]!==k||e[33]!==v||e[34]!==x||e[35]!==r?(E=h.jsx(GD,{onRefresh:x,onCreateFile:k,onCreateFolder:v,onCollapseAll:j,tree:r}),e[31]=j,e[32]=k,e[33]=v,e[34]=x,e[35]=r,e[36]=E):E=e[36];const T=n-33;let M,L,B,O,z,F,V,P;return e[37]!==r?(M=async C=>{const{ids:H}=C;for(const N of H)await r.delete(N)},L=async C=>{const{id:H,name:N}=C;await r.rename(H,N)},B=async C=>{const{dragIds:H,parentId:N}=C;await r.move(H,N)},e[37]=r,e[38]=M,e[39]=L,e[40]=B):(M=e[38],L=e[39],B=e[40]),e[41]===Symbol.for("react.memo_cache_sentinel")?(O=C=>{const H=C[0];H&&(H.data.isDirectory||c(H.data))},e[41]=O):O=e[41],e[42]!==u||e[43]!==f||e[44]!==r?(z=async C=>{if(await r.expand(C)){const H=u[C]??!1;f({...u,[C]:!H})}},e[42]=u,e[43]=f,e[44]=r,e[45]=z):z=e[45],e[46]!==i||e[47]!==u||e[48]!==M||e[49]!==L||e[50]!==B||e[51]!==z||e[52]!==T?(F=h.jsx(IH,{width:"100%",ref:o,height:T,className:"h-full",data:i,initialOpenState:u,openByDefault:!1,renderCursor:ZD,disableDrop:QD,onDelete:M,onRename:L,onMove:B,onSelect:O,onToggle:z,padding:15,rowHeight:30,indent:qD,overscanCount:1e3,disableMultiSelection:!0,children:KD}),e[46]=i,e[47]=u,e[48]=M,e[49]=L,e[50]=B,e[51]=z,e[52]=T,e[53]=F):F=e[53],e[54]!==F||e[55]!==r?(V=h.jsx(A2.Provider,{value:r,children:F}),e[54]=F,e[55]=r,e[56]=V):V=e[56],e[57]!==V||e[58]!==E?(P=h.jsxs(h.Fragment,{children:[E,V]}),e[57]=V,e[58]=E,e[59]=P):P=e[59],P},qD=15,GD=t=>{const e=X.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}=I2(i);let c,d,u,f,p,_,g,m,b,x,y,v,S,k,I;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx(Ca,{size:16}),e[1]=c):c=e[1],e[2]!==o?(d=h.jsx(Le,{content:"Add file",children:h.jsx(Pe,{"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")?(u=h.jsx(Jc,{size:16}),e[4]=u):u=e[4],e[5]!==r?(f=h.jsx(Le,{content:"Add folder",children:h.jsx(Pe,{"data-testid":"file-explorer-add-folder-button",onClick:r,variant:"text",size:"xs",children:u})}),e[5]=r,e[6]=f):f=e[6],e[7]!==a?(p=a({}),e[7]=a,e[8]=p):p=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(_=NV({variant:"text",size:"xs"}),g=h.jsx(jV,{size:16}),e[9]=_,e[10]=g):(_=e[9],g=e[10]),e[11]!==p?(m=h.jsx(Le,{content:"Upload file",children:h.jsx("button",{"data-testid":"file-explorer-upload-button",...p,className:_,children:g})}),e[11]=p,e[12]=m):m=e[12],e[13]!==l?(b=l({}),e[13]=l,e[14]=b):b=e[14],e[15]!==b?(x=h.jsx("input",{...b,type:"file"}),e[15]=b,e[16]=x):x=e[16],e[17]===Symbol.for("react.memo_cache_sentinel")?(y=h.jsx(I4,{size:16}),e[17]=y):y=e[17],e[18]!==n?(v=h.jsx(Le,{content:"Refresh",children:h.jsx(Pe,{"data-testid":"file-explorer-refresh-button",onClick:n,variant:"text",size:"xs",children:y})}),e[18]=n,e[19]=v):v=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(S=h.jsx(um,{size:16}),e[20]=S):S=e[20],e[21]!==s?(k=h.jsx(Le,{content:"Collapse all folders",children:h.jsx(Pe,{"data-testid":"file-explorer-collapse-button",onClick:s,variant:"text",size:"xs",children:S})}),e[21]=s,e[22]=k):k=e[22],e[23]!==x||e[24]!==v||e[25]!==k||e[26]!==d||e[27]!==f||e[28]!==m?(I=h.jsxs("div",{className:"flex items-center justify-end px-2 flex-shrink-0 border-b",children:[d,f,m,x,v,k]}),e[23]=x,e[24]=v,e[25]=k,e[26]=d,e[27]=f,e[28]=m,e[29]=I):I=e[29],I},YD=t=>{const e=X.c(9),{node:n,onOpenMarimoFile:o}=t;let r,s,i;return e[0]!==n?(r=a=>{n.data.isDirectory||(a.stopPropagation(),n.select())},e[0]=n,e[1]=r):r=e[1],e[2]!==n.data.isMarimoFile||e[3]!==o?(s=n.data.isMarimoFile&&!Un()&&h.jsxs("span",{className:"flex-shrink-0 ml-2 text-sm hidden group-hover:inline hover:underline",onClick:o,children:["open ",h.jsx(xc,{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=h.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},JD=t=>{const e=X.c(10),{node:n}=t,o=A.useRef(null);let r,s,i,a,l;return e[0]!==n.data.name?(r=()=>{var c,d;(c=o.current)==null||c.focus(),(d=o.current)==null||d.setSelectionRange(0,n.data.name.lastIndexOf("."))},s=[n.data.name],e[0]=n.data.name,e[1]=r,e[2]=s):(r=e[1],s=e[2]),A.useEffect(r,s),e[3]!==n?(i=()=>n.reset(),a=c=>{c.key==="Escape"&&n.reset(),c.key==="Enter"&&n.submit(c.currentTarget.value)},e[3]=n,e[4]=i,e[5]=a):(i=e[4],a=e[5]),e[6]!==n.data.name||e[7]!==i||e[8]!==a?(l=h.jsx("input",{ref:o,className:"flex-1 bg-transparent border border-border text-muted-foreground",defaultValue:n.data.name,onClick:eR,onBlur:i,onKeyDown:a}),e[6]=n.data.name,e[7]=i,e[8]=a,e[9]=l):l=e[9],l},KD=t=>{const e=X.c(53),{node:n,style:o,dragHandle:r}=t;let s;e[0]!==n.data.isDirectory||e[1]!==n.data.name?(s=n.data.isDirectory?"directory":X3(n.data.name),e[0]=n.data.isDirectory,e[1]=n.data.name,e[2]=s):s=e[2];const i=s,a=Z3[i],{openConfirm:l,openPrompt:c}=Vn(),d=A.useContext(A2);let u;e[3]!==n.data.path||e[4]!==d?(u=async F=>{T2(F,d?d.relativeFromRoot(n.data.path):n.data.path)},e[3]=n.data.path,e[4]=d,e[5]=u):u=e[5];const f=u;let p;e[6]!==n.data.name||e[7]!==n.id||e[8]!==n.tree||e[9]!==l?(p=async F=>{F.stopPropagation(),F.preventDefault(),l({title:"Delete file",description:`Are you sure you want to delete ${n.data.name}?`,confirmAction:h.jsx(L3,{onClick:async()=>{await n.tree.delete(n.id)},"aria-label":"Confirm",children:"Delete"})})},e[6]=n.data.name,e[7]=n.id,e[8]=n.tree,e[9]=l,e[10]=p):p=e[10];const _=p;let g;e[11]!==n||e[12]!==c||e[13]!==d?(g=async()=>{n.open(),c({title:"Folder name",onConfirm:async F=>{d==null||d.createFolder(F,n.id)}})},e[11]=n,e[12]=c,e[13]=d,e[14]=g):g=e[14];const m=et(g);let b;e[15]!==n||e[16]!==c||e[17]!==d?(b=async()=>{n.open(),c({title:"File name",onConfirm:async F=>{d==null||d.createFile(F,n.id)}})},e[15]=n,e[16]=c,e[17]=d,e[18]=b):b=e[18];const x=et(b);let y;e[19]!==i||e[20]!==x||e[21]!==m||e[22]!==_||e[23]!==f||e[24]!==n||e[25]!==d?(y=()=>{const F={size:14,strokeWidth:1.5,className:"mr-2"};return h.jsxs(_c,{align:"end",className:"no-print w-[220px]",onClick:tR,onCloseAutoFocus:nR,children:[!n.data.isDirectory&&h.jsxs(sn,{onSelect:()=>n.select(),children:[h.jsx(Gm,{...F}),"Open file"]}),!n.data.isDirectory&&!Un()&&h.jsxs(sn,{onSelect:()=>{EV({path:n.data.path})},children:[h.jsx(xc,{...F}),"Open file in external editor"]}),n.data.isDirectory&&h.jsxs(h.Fragment,{children:[h.jsxs(sn,{onSelect:()=>x(),children:[h.jsx(Ca,{...F}),"Create file"]}),h.jsxs(sn,{onSelect:()=>m(),children:[h.jsx(Jc,{...F}),"Create folder"]}),h.jsx(zo,{})]}),h.jsxs(sn,{onSelect:()=>n.edit(),children:[h.jsx(Om,{...F}),"Rename"]}),h.jsxs(sn,{onSelect:async()=>{await yn(n.data.path),lt({title:"Copied to clipboard"})},children:[h.jsx(Ls,{...F}),"Copy path"]}),d&&h.jsxs(sn,{onSelect:async()=>{await yn(d.relativeFromRoot(n.data.path)),lt({title:"Copied to clipboard"})},children:[h.jsx(Ls,{...F}),"Copy relative path"]}),h.jsxs(sn,{onSelect:async()=>{lt({title:"Copied to clipboard",description:"Code to open the file has been copied to your clipboard. You can also drag and drop this file into the editor"});const{path:V}=n.data,P=AV[i](V);await yn(P)},children:[h.jsx(IV,{...F}),"Copy snippet for reading file"]}),n.data.isMarimoFile&&!Un()&&h.jsxs(h.Fragment,{children:[h.jsx(zo,{}),h.jsxs(sn,{onSelect:f,children:[h.jsx(Vm,{...F}),"Open notebook"]})]}),h.jsx(zo,{}),!n.data.isDirectory&&h.jsxs(h.Fragment,{children:[h.jsxs(sn,{onSelect:async()=>{const V=(await $4({path:n.data.path})).contents||"";oa(new Blob([V]),n.data.name)},children:[h.jsx(yp,{...F}),"Download"]}),h.jsx(zo,{})]}),h.jsxs(sn,{onSelect:_,variant:"danger",children:[h.jsx(lp,{...F}),"Delete"]})]})},e[19]=i,e[20]=x,e[21]=m,e[22]=_,e[23]=f,e[24]=n,e[25]=d,e[26]=y):y=e[26];const v=y;let S,k,I;e[27]===Symbol.for("react.memo_cache_sentinel")?(S=Oe("flex items-center cursor-pointer ml-1 text-muted-foreground whitespace-nowrap group"),e[27]=S):S=e[27],e[28]!==n?(k=F=>{F.stopPropagation(),n.data.isDirectory&&n.toggle()},I=h.jsx(XD,{node:n}),e[28]=n,e[29]=k,e[30]=I):(k=e[29],I=e[30]);const j=n.willReceiveDrop&&n.data.isDirectory&&"bg-accent/80 hover:bg-accent/80 text-accent-foreground";let E,T,M,L,B,O,z;return e[31]!==j?(E=Oe("flex items-center pl-1 py-1 cursor-pointer hover:bg-accent/50 hover:text-accent-foreground rounded-l flex-1 overflow-hidden group",j),e[31]=j,e[32]=E):E=e[32],e[33]!==a||e[34]!==n.data.isMarimoFile?(T=n.data.isMarimoFile?h.jsx("img",{src:"./favicon.ico",className:"w-5 h-5 flex-shrink-0 mr-2 filter grayscale",alt:"Marimo"}):h.jsx(a,{className:"w-5 h-5 flex-shrink-0 mr-2",strokeWidth:1.5}),e[33]=a,e[34]=n.data.isMarimoFile,e[35]=T):T=e[35],e[36]!==f||e[37]!==n?(M=n.isEditing?h.jsx(JD,{node:n}):h.jsx(YD,{node:n,onOpenMarimoFile:f}),e[36]=f,e[37]=n,e[38]=M):M=e[38],e[39]===Symbol.for("react.memo_cache_sentinel")?(L=h.jsx(gc,{asChild:!0,tabIndex:-1,onClick:oR,children:h.jsx(Pe,{"data-testid":"file-explorer-more-button",variant:"text",tabIndex:-1,size:"xs",className:"mb-0","aria-label":"More options",children:h.jsx(Yc,{strokeWidth:2,className:"w-5 h-5 hidden group-hover:block"})})}),e[39]=L):L=e[39],e[40]!==v?(B=h.jsxs(mc,{modal:!1,children:[L,v()]}),e[40]=v,e[41]=B):B=e[41],e[42]!==E||e[43]!==T||e[44]!==M||e[45]!==B?(O=h.jsxs("span",{className:E,children:[T,M,B]}),e[42]=E,e[43]=T,e[44]=M,e[45]=B,e[46]=O):O=e[46],e[47]!==r||e[48]!==o||e[49]!==O||e[50]!==k||e[51]!==I?(z=h.jsxs("div",{style:o,ref:r,className:S,draggable:!0,onClick:k,children:[I,O]}),e[47]=r,e[48]=o,e[49]=O,e[50]=k,e[51]=I,e[52]=z):z=e[52],z},XD=t=>{const e=X.c(3),{node:n}=t;if(!n.data.isDirectory){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsx("span",{className:"w-5 h-5 flex-shrink-0"}),e[0]=r):r=e[0],r}let o;return e[1]!==n.isOpen?(o=n.isOpen?h.jsx(Zi,{className:"w-5 h-5 flex-shrink-0"}):h.jsx(dc,{className:"w-5 h-5 flex-shrink-0"}),e[1]=n.isOpen,e[2]=o):o=e[2],o};function T2(t,e){t.stopPropagation(),t.preventDefault(),window.open(`/?file=${e}`,"_blank")}function ZD(){return null}function QD(t){const{parentNode:e}=t;return!e.data.isDirectory}function eR(t){return t.stopPropagation()}function tR(t){return t.stopPropagation()}function nR(t){return t.preventDefault()}function oR(t){return t.stopPropagation()}const rR=()=>{const t=X.c(20),{ref:e,height:n}=om(),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}=I2(r);let l,c,d,u,f,p,_,g;return t[1]!==s?(l=s(),t[1]=s,t[2]=l):l=t[2],t[3]===Symbol.for("react.memo_cache_sentinel")?(c=Oe("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?(u=h.jsx("input",{...d}),t[6]=d,t[7]=u):u=t[7],t[8]!==a?(f=a&&h.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?(p=h.jsx(WD,{height:o}),t[10]=o,t[11]=p):p=t[11],t[12]!==e||t[13]!==p?(_=h.jsx("div",{ref:e,className:"flex flex-col flex-1 overflow-hidden",children:p}),t[12]=e,t[13]=p,t[14]=_):_=t[14],t[15]!==l||t[16]!==u||t[17]!==f||t[18]!==_?(g=h.jsxs("div",{...l,className:c,children:[u,f,_]}),t[15]=l,t[16]=u,t[17]=f,t[18]=_,t[19]=g):g=t[19],g},sR=t=>{const e=X.c(6),{children:n}=t,{openModal:o,closeModal:r}=Vn();let s,i;return e[0]!==r||e[1]!==o?(s=()=>o(h.jsx(aR,{onClose:r})),e[0]=r,e[1]=o,e[2]=s):s=e[2],e[3]!==n||e[4]!==s?(i=h.jsx(F4,{onClick:s,children:n}),e[3]=n,e[4]=s,e[5]=i):i=e[5],i},iR=[st.lineWrapping],aR=t=>{const e=X.c(23),{onClose:n}=t,[o,r]=A.useState(""),{theme:s}=Fo();let i,a,l,c,d,u;e[0]!==n?(i=async y=>{y.preventDefault();const v=new FormData(y.target),S=v.get("title"),k=v.get("description"),I=v.get("code");fetch("https://marimo.io/api/suggest-snippet",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:S,description:k,code:I})}),n(),lt({title:"Snippet Submitted",description:"Thank you for contributing! We will review your snippet shortly."})},e[0]=n,e[1]=i):i=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsx(dr,{children:"Contribute a Snippet"}),e[2]=a):a=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(l=h.jsxs(Os,{children:[a,h.jsxs(Ps,{children:["Have a useful snippet you want to share with the community? Submit it here or make a pull request"," ",h.jsx("a",{href:Zn.githubPage,target:"_blank",className:"underline",children:"on GitHub"}),"."]})]}),e[3]=l):l=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx(ur,{id:"title",name:"title",autoFocus:!0,placeholder:"Title",required:!0,autoComplete:"off"}),d=h.jsx(TV,{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?(u=h.jsx("input",{type:"hidden",name:"code",value:o}),e[6]=o,e[7]=u):u=e[7];const f=s==="dark"?"dark":"light";let p,_,g,m,b,x;return e[8]!==o||e[9]!==f?(p=h.jsx(_a,{theme:f,language:"python",className:"cm border rounded overflow-hidden",extensions:iR,value:o,onChange:r}),e[8]=o,e[9]=f,e[10]=p):p=e[10],e[11]!==u||e[12]!==p?(_=h.jsxs("div",{className:"flex flex-col gap-6 py-4",children:[c,d,u,p]}),e[11]=u,e[12]=p,e[13]=_):_=e[13],e[14]!==n?(g=h.jsx(Pe,{"data-testid":"snippet-cancel-button",variant:"secondary",onClick:n,children:"Cancel"}),e[14]=n,e[15]=g):g=e[15],e[16]===Symbol.for("react.memo_cache_sentinel")?(m=h.jsx(Pe,{"data-testid":"snippet-send-button","aria-label":"Save",variant:"default",type:"submit",children:"Send"}),e[16]=m):m=e[16],e[17]!==g?(b=h.jsxs(ea,{children:[g,m]}),e[17]=g,e[18]=b):b=e[18],e[19]!==i||e[20]!==b||e[21]!==_?(x=h.jsx(cr,{className:"w-fit",children:h.jsxs("form",{onSubmit:i,children:[l,_,b]})}),e[19]=i,e[20]=b,e[21]=_,e[22]=x):x=e[22],x},lR=[st.lineWrapping],cR=()=>{const t=X.c(20),[e,n]=K.useState();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],t[0]=o):o=t[0];const{data:r,error:s,loading:i}=$n(hR,o);if(s){let b;return t[1]!==s?(b=h.jsx(Xs,{error:s}),t[1]=s,t[2]=b):b=t[2],b}if(i||!r){let b;return t[3]===Symbol.for("react.memo_cache_sentinel")?(b=h.jsx(eo,{size:"medium",centered:!0}),t[3]=b):b=t[3],b}const a=e?"h-1/3":"h-full";let l,c,d,u,f,p,_,g,m;return t[4]!==a?(l=Oe("border-b rounded-none",a),t[4]=a,t[5]=l):l=t[5],t[6]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx(Qi,{placeholder:"Search snippets...",className:"h-6 m-1",rootClassName:"flex-1 border-r"}),t[6]=c):c=t[6],t[7]===Symbol.for("react.memo_cache_sentinel")?(d=h.jsxs("div",{className:"flex items-center w-full",children:[c,h.jsx(sR,{children:h.jsx("button",{className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:h.jsx(Lr,{className:"h-4 w-4"})})})]}),u=h.jsx(hc,{children:"No results"}),t[7]=d,t[8]=u):(d=t[7],u=t[8]),t[9]===Symbol.for("react.memo_cache_sentinel")?(f=b=>n(b),t[9]=f):f=t[9],t[10]!==r.snippets?(p=h.jsx(uR,{onSelect:f,snippets:r.snippets}),t[10]=r.snippets,t[11]=p):p=t[11],t[12]!==l||t[13]!==p?(_=h.jsxs(vc,{className:l,children:[d,u,p]}),t[12]=l,t[13]=p,t[14]=_):_=t[14],t[15]!==e?(g=h.jsx(A.Suspense,{children:h.jsx("div",{className:"h-2/3 snippet-viewer flex flex-col",children:e?h.jsx(dR,{snippet:e},e.title):h.jsx(An,{title:"",description:"Click on a snippet to view its content."})})}),t[15]=e,t[16]=g):g=t[16],t[17]!==_||t[18]!==g?(m=h.jsxs("div",{className:"flex-1 overflow-hidden",children:[_,g]}),t[17]=_,t[18]=g,t[19]=m):m=t[19],m},dR=t=>{const e=X.c(27),{snippet:n}=t,{theme:o}=Fo(),{createNewCell:r}=Lt(),s=zs();let i;e[0]!==r||e[1]!==s||e[2]!==n.sections?(i=()=>{for(const m of[...n.sections].reverse())m.code&&r({code:m.code,before:!1,cellId:s??"__end__",skipIfCodeExists:!0})},e[0]=r,e[1]=s,e[2]=n.sections,e[3]=i):i=e[3];const a=i;let l;e[4]!==r||e[5]!==s?(l=m=>{r({code:m,before:!1,cellId:s??"__end__"})},e[4]=r,e[5]=s,e[6]=l):l=e[6];const c=l;let d,u,f,p,_,g;if(e[7]!==n.title?(d=h.jsx("div",{className:"text-sm font-semibold bg-muted border-y px-2 py-1",children:n.title}),e[7]=n.title,e[8]=d):d=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(u=h.jsx(ti,{className:"ml-2 h-4 w-4"}),e[9]=u):u=e[9],e[10]!==a?(f=h.jsx("div",{className:"flex justify-end",children:h.jsx(ri,{children:h.jsxs(Pe,{className:"float-right",size:"xs",variant:"outline",onClick:a,children:["Insert snippet",u]})})}),e[10]=a,e[11]=f):f=e[11],e[12]!==c||e[13]!==n.sections||e[14]!==n.title||e[15]!==o){let m;e[17]!==c||e[18]!==n.title||e[19]!==o?(m=b=>{const{code:x,html:y,id:v}=b;return y?h.jsx("div",{children:Vp({html:y})},`${n.title}-${v}`):x?h.jsxs("div",{className:"relative hover-actions-parent pr-2",children:[h.jsx(ri,{children:h.jsx(Le,{content:"Insert snippet",children:h.jsx(Pe,{className:"absolute -top-2 -right-1 z-10 hover-action px-2 bg-background",size:"sm",variant:"outline",onClick:()=>{c(x)},children:h.jsx(ti,{className:"h-5 w-5"})})})}),h.jsx(_a,{theme:o==="dark"?"dark":"light",language:"python",className:"cm border rounded overflow-hidden",extensions:lR,value:x,readOnly:!0},`${n.title}-${v}`)]},`${n.title}-${v}`):null},e[17]=c,e[18]=n.title,e[19]=o,e[20]=m):m=e[20],p=n.sections.map(m),e[12]=c,e[13]=n.sections,e[14]=n.title,e[15]=o,e[16]=p}else p=e[16];return e[21]!==f||e[22]!==p?(_=h.jsxs("div",{className:"px-2 py-2 space-y-4 overflow-auto flex-1",children:[f,p]}),e[21]=f,e[22]=p,e[23]=_):_=e[23],e[24]!==d||e[25]!==_?(g=h.jsxs(h.Fragment,{children:[d,_]}),e[24]=d,e[25]=_,e[26]=g):g=e[26],g},uR=t=>{const e=X.c(7),{snippets:n,onSelect:o}=t;let r,s;if(e[0]!==o||e[1]!==n){let i;e[3]!==o?(i=a=>h.jsx(po,{className:"rounded-none",onSelect:()=>o(a),children:h.jsx("div",{className:"flex flex-row gap-2 items-center",children:h.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=h.jsx(Tp,{className:"flex flex-col overflow-auto",children:r}),e[5]=r,e[6]=s):s=e[6],s};function hR(){return MV()}const fR=t=>{const e=X.c(8),{variableName:n,className:o}=t;let r;e[0]!==n?(r=()=>{const l=function(d){const u=dt.get(q4)[d];if(u)return u.declaredBy[0]}(n);if(!l)return;const c=ic(l);c&&Wp(c,n)},e[0]=n,e[1]=r):r=e[1];const s=r;let i,a;return e[2]!==o?(i=Oe("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=h.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},pR=Qt(t=>{const e=t(OV),n=t(q4),o=t(P4);return wa(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})}),mR=Qt(t=>{const e=new Map(t(DV));for(const n of G4){const o=e.get(n);o&&o.databases.length===0&&e.delete(n)}return wa([...e.values()],n=>G4.has(n.name)?1:0)}),gR=()=>{const t=X.c(32),[e,n]=K.useState(""),o=en(Y4),r=We(pR),s=We(mR);if(r.length===0&&s.length===0){let b;return t[0]===Symbol.for("react.memo_cache_sentinel")?(b=h.jsx(An,{title:"No tables found",description:"Any datasets/dataframes in the global scope will be shown here.",action:h.jsx(jg,{children:h.jsxs(Pe,{variant:"outline",size:"sm",children:["Add database or catalog",h.jsx(Lr,{className:"h-4 w-4 ml-2"})]})}),icon:h.jsx(lr,{})}),t[0]=b):b=t[0],b}const i=!!e.trim();let a,l,c,d,u,f,p,_,g,m;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=h.jsx(Qi,{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&&h.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:h.jsx(go,{className:"h-4 w-4"})}),t[6]=i,t[7]=c):c=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(d=h.jsx(jg,{children:h.jsx("button",{type:"button",className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:h.jsx(Lr,{className:"h-4 w-4"})})}),t[8]=d):d=t[8],t[9]!==l||t[10]!==c?(u=h.jsxs("div",{className:"flex items-center w-full",children:[l,c,d]}),t[9]=l,t[10]=c,t[11]=u):u=t[11],t[12]!==s||t[13]!==i||t[14]!==e){let b;t[16]!==i||t[17]!==e?(b=x=>h.jsx(_R,{connection:x,hasChildren:x.databases.length>0,children:x.databases.map(y=>h.jsx(bR,{engineName:x.name,database:y,hasSearch:i,children:h.jsx(yR,{schemas:y.schemas,defaultSchema:x.default_schema,defaultDatabase:x.default_database,engineName:x.name,databaseName:y.name,hasSearch:i,searchValue:e})},y.name))},x.name),t[16]=i,t[17]=e,t[18]=b):b=t[18],f=s.map(b),t[12]=s,t[13]=i,t[14]=e,t[15]=f}else f=t[15];return t[19]!==s.length||t[20]!==r.length?(p=s.length>0&&r.length>0&&h.jsxs(J4,{children:[h.jsx(cc,{className:"h-4 w-4 text-muted-foreground"}),h.jsx("span",{className:"text-xs",children:"Python"})]}),t[19]=s.length,t[20]=r.length,t[21]=p):p=t[21],t[22]!==e||t[23]!==r?(_=r.length>0&&h.jsx(M2,{tables:r,searchValue:e}),t[22]=e,t[23]=r,t[24]=_):_=t[24],t[25]!==f||t[26]!==p||t[27]!==_?(g=h.jsxs(Tp,{className:"flex flex-col",children:[f,p,_]}),t[25]=f,t[26]=p,t[27]=_,t[28]=g):g=t[28],t[29]!==u||t[30]!==g?(m=h.jsxs(vc,{className:"border-b bg-background rounded-none h-full pb-10 overflow-auto outline-none",shouldFilter:!1,children:[u,g]}),t[29]=u,t[30]=g,t[31]=m):m=t[31],m},_R=t=>{const e=X.c(25),{connection:n,children:o,hasChildren:r}=t,s=n.name===RV,i=s?"In-Memory":n.name,[a,l]=K.useState(!1);let c;e[0]!==n.name?(c=async()=>{l(!0),await LV({engine:n.name}),setTimeout(()=>l(!1),500)},e[0]=n.name,e[1]=c):c=e[1];const d=c;let u,f,p;e[2]!==n.dialect?(u=h.jsx(W3,{className:"h-4 w-4 text-muted-foreground",name:n.dialect}),e[2]=n.dialect,e[3]=u):u=e[3],e[4]!==n.dialect?(f=PV(n.dialect),e[4]=n.dialect,e[5]=f):f=e[5],e[6]!==f?(p=h.jsx("span",{className:"text-xs",children:f}),e[6]=f,e[7]=p):p=e[7];const _=i;let g,m,b,x,y;return e[8]!==_?(g=h.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",h.jsx(fR,{variableName:_}),")"]}),e[8]=_,e[9]=g):g=e[9],e[10]!==d||e[11]!==s||e[12]!==a?(m=!s&&h.jsx(Le,{content:"Refresh connection",children:h.jsx(Pe,{variant:"ghost",size:"icon",className:"ml-auto hover:bg-transparent hover:shadow-none",onClick:d,children:h.jsx(Ac,{className:Oe("h-4 w-4 text-muted-foreground hover:text-foreground",a&&"animate-[spin_0.5s]")})})}),e[10]=d,e[11]=s,e[12]=a,e[13]=m):m=e[13],e[14]!==u||e[15]!==p||e[16]!==g||e[17]!==m?(b=h.jsxs(J4,{children:[u,p,g,m]}),e[14]=u,e[15]=p,e[16]=g,e[17]=m,e[18]=b):b=e[18],e[19]!==o||e[20]!==r?(x=r?o:h.jsx(Bc,{content:"No databases available",className:"pl-2"}),e[19]=o,e[20]=r,e[21]=x):x=e[21],e[22]!==b||e[23]!==x?(y=h.jsxs(h.Fragment,{children:[b,x]}),e[22]=b,e[23]=x,e[24]=y):y=e[24],y},bR=t=>{const e=X.c(28),{hasSearch:n,engineName:o,database:r,children:s}=t,[i,a]=K.useState(!1),[l,c]=K.useState(!1);let d,u,f;e[0]!==n?(d=()=>{a(n)},u=[n],e[0]=n,e[1]=d,e[2]=u):(d=e[1],u=e[2]),K.useEffect(d,u),e[3]!==i||e[4]!==l?(f=()=>{a(!i),c(!l)},e[3]=i,e[4]=l,e[5]=f):f=e[5];const p=`${o}:${r.name}`;let _;e[6]!==i?(_=h.jsx(eS,{isExpanded:i}),e[6]=i,e[7]=_):_=e[7];const g=l&&i?"text-foreground":"text-muted-foreground";let m,b;e[8]!==g?(m=Oe("h-4 w-4",g),e[8]=g,e[9]=m):m=e[9],e[10]!==m?(b=h.jsx(lr,{className:m}),e[10]=m,e[11]=b):b=e[11];const x=l&&i&&"font-semibold";let y,v,S,k;e[12]!==x?(y=Oe(x),e[12]=x,e[13]=y):y=e[13],e[14]!==r.name?(v=r.name===""?h.jsx("i",{children:"Not connected"}):r.name,e[14]=r.name,e[15]=v):v=e[15],e[16]!==y||e[17]!==v?(S=h.jsx("span",{className:y,children:v}),e[16]=y,e[17]=v,e[18]=S):S=e[18],e[19]!==S||e[20]!==f||e[21]!==p||e[22]!==_||e[23]!==b?(k=h.jsxs(po,{className:"text-sm flex flex-row gap-1 items-center cursor-pointer rounded-none",onSelect:f,value:p,children:[_,b,S]}),e[19]=S,e[20]=f,e[21]=p,e[22]=_,e[23]=b,e[24]=k):k=e[24];const I=i&&s;let j;return e[25]!==k||e[26]!==I?(j=h.jsxs(h.Fragment,{children:[k,I]}),e[25]=k,e[26]=I,e[27]=j):j=e[27],j},yR=t=>{const e=X.c(20),{schemas:n,defaultSchema:o,defaultDatabase:r,engineName:s,databaseName:i,hasSearch:a,searchValue:l}=t;if(n.length===0){let u;return e[0]===Symbol.for("react.memo_cache_sentinel")?(u=h.jsx(Bc,{content:"No schemas available",className:"pl-6"}),e[0]=u):u=e[0],u}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 u;e[9]!==l?(u=_=>!l||_.tables.some(g=>g.name.toLowerCase().includes(l.toLowerCase())),e[9]=l,e[10]=u):u=e[10];const f=n.filter(u);let p;e[11]!==i||e[12]!==r||e[13]!==o||e[14]!==s||e[15]!==a||e[16]!==l?(p=_=>h.jsx(xR,{databaseName:i,schema:_,hasSearch:a,children:h.jsx(M2,{tables:_.tables,searchValue:l,sqlTableContext:{engine:s,database:i,schema:_.name,defaultSchema:o,defaultDatabase:r}})},_.name),e[11]=i,e[12]=r,e[13]=o,e[14]=s,e[15]=a,e[16]=l,e[17]=p):p=e[17],c=f.map(p),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=h.jsx(h.Fragment,{children:c}),e[18]=c,e[19]=d):d=e[19],d},xR=t=>{const e=X.c(26),{databaseName:n,schema:o,children:r,hasSearch:s}=t,[i,a]=K.useState(!1),[l,c]=K.useState(!1),d=`${n}:${o.name}`;let u,f,p,_;if(e[0]!==s?(u=()=>{a(s)},f=[s],e[0]=s,e[1]=u,e[2]=f):(u=e[1],f=e[2]),K.useEffect(u,f),Q4(o.name))return r;e[3]!==i||e[4]!==l?(p=()=>{a(!i),c(!l)},e[3]=i,e[4]=l,e[5]=p):p=e[5],e[6]!==i?(_=h.jsx(eS,{isExpanded:i}),e[6]=i,e[7]=_):_=e[7];const g=l&&i&&"text-foreground";let m,b;e[8]!==g?(m=Oe("h-4 w-4 text-muted-foreground",g),e[8]=g,e[9]=m):m=e[9],e[10]!==m?(b=h.jsx($V,{className:m}),e[10]=m,e[11]=b):b=e[11];const x=l&&i&&"font-semibold";let y,v,S;e[12]!==x?(y=Oe(x),e[12]=x,e[13]=y):y=e[13],e[14]!==o.name||e[15]!==y?(v=h.jsx("span",{className:y,children:o.name}),e[14]=o.name,e[15]=y,e[16]=v):v=e[16],e[17]!==v||e[18]!==p||e[19]!==_||e[20]!==b||e[21]!==d?(S=h.jsxs(po,{className:"text-sm flex flex-row gap-1 items-center pl-5 cursor-pointer rounded-none",onSelect:p,value:d,children:[_,b,v]}),e[17]=v,e[18]=p,e[19]=_,e[20]=b,e[21]=d,e[22]=S):S=e[22];const k=i&&r;let I;return e[23]!==S||e[24]!==k?(I=h.jsxs(h.Fragment,{children:[S,k]}),e[23]=S,e[24]=k,e[25]=I):I=e[25],I},M2=t=>{const e=X.c(24),{tables:n,sqlTableContext:o,searchValue:r}=t,{addTableList:s}=K4(),[i,a]=K.useState(!1),[l,c]=K.useState(!1);let d,u;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:m,database:b,schema:x}=o,y=await XH.request({engine:m,database:b,schema:x});if(!(y!=null&&y.tables))throw c(!1),new Error("No tables available");s({tables:y.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?(u=[n.length,o,i],e[5]=o,e[6]=n.length,e[7]=i,e[8]=u):u=e[8];const{loading:f,error:p}=$n(d,u);if(f||l){let m;return e[9]===Symbol.for("react.memo_cache_sentinel")?(m=h.jsx(X4,{message:"Loading tables...",className:"pl-12"}),e[9]=m):m=e[9],m}if(p){let m;return e[10]!==p?(m=h.jsx(Z4,{error:p,className:"pl-12"}),e[10]=p,e[11]=m):m=e[11],m}if(n.length===0){let m;return e[12]===Symbol.for("react.memo_cache_sentinel")?(m=h.jsx(Bc,{content:"No tables found",className:"pl-9"}),e[12]=m):m=e[12],m}let _,g;if(e[13]!==r||e[14]!==o||e[15]!==n){let m;e[17]!==r?(m=y=>!r||y.name.toLowerCase().includes(r.toLowerCase()),e[17]=r,e[18]=m):m=e[18];const b=n.filter(m);let x;e[19]!==r||e[20]!==o?(x=y=>h.jsx(wR,{table:y,sqlTableContext:o,isSearching:!!r},y.name),e[19]=r,e[20]=o,e[21]=x):x=e[21],_=b.map(x),e[13]=r,e[14]=o,e[15]=n,e[16]=_}else _=e[16];return e[22]!==_?(g=h.jsx(h.Fragment,{children:_}),e[22]=_,e[23]=g):g=e[23],g},wR=t=>{const e=X.c(62),{table:n,sqlTableContext:o,isSearching:r}=t,{addTable:s}=K4(),[i,a]=K.useState(!1),[l,c]=K.useState(!1),d=n.columns.length>0;let u,f;e[0]!==s||e[1]!==i||e[2]!==o||e[3]!==n.name||e[4]!==d||e[5]!==l?(u=async()=>{if(i&&!d&&o&&!l){c(!0);const{engine:q,database:re,schema:ne}=o,oe=await ZH.request({engine:q,database:re,schema:ne,tableName:n.name});if(!(oe!=null&&oe.table))throw new Error("No table details available");s({table:oe.table,sqlTableContext:o})}},e[0]=s,e[1]=i,e[2]=o,e[3]=n.name,e[4]=d,e[5]=l,e[6]=u):u=e[6],e[7]!==i||e[8]!==d?(f=[i,d],e[7]=i,e[8]=d,e[9]=f):f=e[9];const{loading:p,error:_}=$n(u,f),g=We(Ts),m=zs(),{createNewCell:b}=Lt();let x;e[10]!==g||e[11]!==b||e[12]!==m||e[13]!==o||e[14]!==n?(x=()=>{ar(g,b,m),b({code:(()=>{if(n.source_type==="catalog"){const q=o!=null&&o.database?`${o.database}.${n.name}`:n.name;return`${n.engine}.load_table("${q}")`}if(o)return tS(n,"*",o);switch(n.source_type){case"local":return`mo.ui.table(${n.name})`;case"duckdb":case"connection":return tS(n,"*",o);default:return rc(n.source_type),""}})(),before:!1,cellId:m??"__end__"})},e[10]=g,e[11]=b,e[12]=m,e[13]=o,e[14]=n,e[15]=x):x=e[15];const y=x;let v;e[16]!==n.num_columns||e[17]!==n.num_rows?(v=()=>{const q=[];return n.num_rows!=null&&q.push(`${n.num_rows} rows`),n.num_columns!=null&&q.push(`${n.num_columns} columns`),q.length===0?null:h.jsx("div",{className:"flex flex-row gap-2 items-center pl-6 group-hover:hidden",children:h.jsx("span",{className:"text-xs text-muted-foreground",children:q.join(", ")})})},e[16]=n.num_columns,e[17]=n.num_rows,e[18]=v):v=e[18];const S=v;let k;e[19]!==_||e[20]!==p||e[21]!==o||e[22]!==n?(k=()=>{if(p)return h.jsx(X4,{message:"Loading columns...",className:"pl-12"});if(_)return h.jsx(Z4,{error:_,className:"pl-12"});const q=n.columns;return q.length===0?h.jsx(Bc,{content:"No columns found",className:"pl-12"}):q.map(re=>h.jsx(vR,{table:n,column:re,sqlTableContext:o},re.name))},e[19]=_,e[20]=p,e[21]=o,e[22]=n,e[23]=k):k=e[23];const I=k;let j;e[24]!==i||e[25]!==r||e[26]!==n.source_type||e[27]!==n.type?(j=()=>{if(n.source_type==="local")return;const q=n.type==="table"?FV:A3;return h.jsx(q,{className:"h-3 w-3",strokeWidth:i||r?2.5:void 0})},e[24]=i,e[25]=r,e[26]=n.source_type,e[27]=n.type,e[28]=j):j=e[28];const E=j,T=o?`${o.database}.${o.schema}.${n.name}`:n.name,M=o&&(Q4(o.schema)?"pl-9":"pl-12"),L=(i||r)&&"font-semibold";let B,O,z,F,V,P,C,H,N,$,Y,Z;return e[29]!==M||e[30]!==L?(B=Oe("rounded-none group h-8 cursor-pointer",M,L),e[29]=M,e[30]=L,e[31]=B):B=e[31],e[32]!==i?(O=()=>a(!i),e[32]=i,e[33]=O):O=e[33],e[34]!==E?(z=E(),e[34]=E,e[35]=z):z=e[35],e[36]!==n.name?(F=h.jsx("span",{className:"text-sm",children:n.name}),e[36]=n.name,e[37]=F):F=e[37],e[38]!==z||e[39]!==F?(V=h.jsxs("div",{className:"flex gap-2 items-center flex-1",children:[z,F]}),e[38]=z,e[39]=F,e[40]=V):V=e[40],e[41]!==S?(P=S(),e[41]=S,e[42]=P):P=e[42],e[43]!==y?(C=Hn.stopPropagation(()=>y()),e[43]=y,e[44]=C):C=e[44],e[45]===Symbol.for("react.memo_cache_sentinel")?(H=h.jsx(zV,{className:"h-3 w-3"}),e[45]=H):H=e[45],e[46]!==C?(N=h.jsx(Le,{content:"Add table to notebook",delayDuration:400,children:h.jsx(Pe,{className:"group-hover:inline-flex hidden",variant:"text",size:"icon",onClick:C,children:H})}),e[46]=C,e[47]=N):N=e[47],e[48]!==i||e[49]!==O||e[50]!==V||e[51]!==P||e[52]!==N||e[53]!==B||e[54]!==T?($=h.jsxs(po,{className:B,value:T,"aria-selected":i,forceMount:!0,onSelect:O,children:[V,P,N]}),e[48]=i,e[49]=O,e[50]=V,e[51]=P,e[52]=N,e[53]=B,e[54]=T,e[55]=$):$=e[55],e[56]!==i||e[57]!==I?(Y=i&&I(),e[56]=i,e[57]=I,e[58]=Y):Y=e[58],e[59]!==$||e[60]!==Y?(Z=h.jsxs(h.Fragment,{children:[$,Y]}),e[59]=$,e[60]=Y,e[61]=Z):Z=e[61],Z},vR=t=>{var Y,Z;const e=X.c(53),{table:n,column:o,sqlTableContext:r}=t,[s,i]=K.useState(!1),a=We(Y4),l=en(BV);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]),K.useEffect(c,d),l(s?q=>new Set([...q,`${n.name}:${o.name}`]):q=>(q.delete(`${n.name}:${o.name}`),new Set(q)));const u=We(Ts),f=zs(),{createNewCell:p}=Lt(),{columnsPreviews:_}=UV();let g;e[3]!==o.name||e[4]!==n.primary_keys?(g=((Y=n.primary_keys)==null?void 0:Y.includes(o.name))||!1,e[3]=o.name,e[4]=n.primary_keys,e[5]=g):g=e[5];const m=g;let b;e[6]!==o.name||e[7]!==n.indexes?(b=((Z=n.indexes)==null?void 0:Z.includes(o.name))||!1,e[6]=o.name,e[7]=n.indexes,e[8]=b):b=e[8];const x=b;let y;e[9]!==u||e[10]!==p||e[11]!==f?(y=q=>{q.includes("alt")&&WV(u,p,f),p({code:q,before:!1,cellId:f??"__end__"})},e[9]=u,e[10]=p,e[11]=f,e[12]=y):y=e[12];const v=y,S=kR,k=s?"font-semibold":"";let I;e[13]!==o.name||e[14]!==k?(I=h.jsx("span",{className:k,children:o.name}),e[13]=o.name,e[14]=k,e[15]=I):I=e[15];const j=I,E=`${n.name}.${o.name}`,T=`${n.name}.${o.name}`;let M;e[16]!==s?(M=()=>i(!s),e[16]=s,e[17]=M):M=e[17];const L=r?"pl-14":"pl-7";let B,O,z,F,V,P,C,H,N,$;return e[18]!==L?(B=Oe("flex flex-row gap-2 items-center flex-1",L),e[18]=L,e[19]=B):B=e[19],e[20]!==o.type||e[21]!==j?(O=h.jsx(VV,{columnName:j,dataType:o.type}),e[20]=o.type,e[21]=j,e[22]=O):O=e[22],e[23]!==m?(z=m&&S({tooltipContent:"Primary key",content:"PK"}),e[23]=m,e[24]=z):z=e[24],e[25]!==x?(F=x&&S({tooltipContent:"Indexed",content:"IDX"}),e[25]=x,e[26]=F):F=e[26],e[27]!==B||e[28]!==O||e[29]!==z||e[30]!==F?(V=h.jsxs("div",{className:B,children:[O,z,F]}),e[27]=B,e[28]=O,e[29]=z,e[30]=F,e[31]=V):V=e[31],e[32]!==o.name?(P=h.jsx(Le,{content:"Copy column name",delayDuration:400,children:h.jsx(Pe,{variant:"text",size:"icon",className:"group-hover:opacity-100 opacity-0 hover:bg-muted text-muted-foreground hover:text-foreground",children:h.jsx(nS,{tooltip:!1,value:o.name,className:"h-3 w-3"})})}),e[32]=o.name,e[33]=P):P=e[33],e[34]!==o.external_type?(C=h.jsx("span",{className:"text-xs text-muted-foreground",children:o.external_type}),e[34]=o.external_type,e[35]=C):C=e[35],e[36]!==M||e[37]!==V||e[38]!==P||e[39]!==C||e[40]!==E||e[41]!==T?(H=h.jsxs(po,{className:"rounded-none py-1 group cursor-pointer",value:T,onSelect:M,children:[V,P,C]},E),e[36]=M,e[37]=V,e[38]=P,e[39]=C,e[40]=E,e[41]=T,e[42]=H):H=e[42],e[43]!==o||e[44]!==_||e[45]!==v||e[46]!==s||e[47]!==r||e[48]!==n?(N=s&&h.jsx("div",{className:"pl-10 pr-2 py-2 bg-[var(--slate-1)] shadow-inner border-b",children:h.jsx(kc,{children:h.jsx(HV,{table:n,column:o,onAddColumnChart:v,preview:_.get(r?`${r.database}.${r.schema}.${n.name}:${o.name}`:`${n.name}:${o.name}`),sqlTableContext:r})})}),e[43]=o,e[44]=_,e[45]=v,e[46]=s,e[47]=r,e[48]=n,e[49]=N):N=e[49],e[50]!==H||e[51]!==N?($=h.jsxs(h.Fragment,{children:[H,N]}),e[50]=H,e[51]=N,e[52]=$):$=e[52],$};function kR(t){const{tooltipContent:e,content:n}=t;return h.jsx(Le,{content:e,delayDuration:100,children:h.jsx("span",{className:"text-xs text-black bg-gray-100 dark:invert rounded px-1",children:n})})}const SR=()=>{const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=h.jsx(gR,{}),t[0]=e):e=t[0],e},CR=t=>{const e=X.c(4),{isOpen:n,children:o}=t,[r,s]=K.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]),K.useEffect(i,a),r?o:null},cf=E3("marimo:scratchpadHistory:v1",[]),NR=Qt(!1),jR=Qt(null,(t,e,n)=>{if(!(n=n.trim()))return;const o=t(cf),r=[n,...o.filter(s=>s!==n)].slice(0,15);e(cf,r)}),ER={hide_code:!1,disabled:!1},IR=()=>{const t=X.c(69),e=Sc(),[n]=Ds(),{theme:o}=Fo(),r=A.useRef(null),s=zs(),{createNewCell:i,updateCellCode:a}=Lt(),l=e.cellRuntime[mr],c=l==null?void 0:l.output,d=l==null?void 0:l.status,u=l==null?void 0:l.consoleOutputs,f=e.cellData[mr],p=(f==null?void 0:f.code)??"",_=en(jR),[g,m]=fn(NR),b=We(cf);let x;t[0]!==_||t[1]!==p?(x=()=>{oS({code:p}),_(p)},t[0]=_,t[1]=p,t[2]=x):x=t[2];const y=et(x);let v;t[3]!==p||t[4]!==i||t[5]!==s?(v=()=>{p.trim()&&i({code:p,before:!1,cellId:s??"__end__"})},t[3]=p,t[4]=i,t[5]=s,t[6]=v):v=t[6];const S=et(v);let k;t[7]!==a?(k=()=>{a({cellId:mr,code:"",formattingChange:!1}),oS({code:""});const ae=r.current;ae&&ae.dispatch({changes:{from:0,to:ae.state.doc.length,insert:""}})},t[7]=a,t[8]=k):k=t[8];const I=et(k);let j;t[9]!==m||t[10]!==a?(j=ae=>{m(!1),a({cellId:mr,code:ae,formattingChange:!1});const Se=r.current;Se&&Se.dispatch({changes:{from:0,to:Se.state.doc.length,insert:ae}})},t[9]=m,t[10]=a,t[11]=j):j=t[11];const E=et(j),[T,M]=A.useState();let L;t[12]!==p||t[13]!==u||t[14]!==y||t[15]!==T||t[16]!==c||t[17]!==o||t[18]!==n?(L=()=>h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"overflow-auto flex-shrink-0 max-h-[40%]",children:h.jsx(zu,{theme:o,allowFocus:!1,showPlaceholder:!1,id:mr,code:p,config:ER,status:"idle",serializedEditorState:null,runCell:y,userConfig:n,editorViewRef:r,setEditorView:ae=>{r.current=ae},hidden:!1,temporarilyShowCode:En.NOOP,languageAdapter:T,setLanguageAdapter:M})}),h.jsx("div",{className:"flex-1 overflow-auto flex-shrink-0",children:h.jsx(Pc,{allowExpand:!1,output:c,className:"output-area",cellId:mr,stale:!1,loading:!1})}),h.jsx("div",{className:"overflow-auto flex-shrink-0 max-h-[35%]",children:h.jsx(Qp,{consoleOutputs:u,className:"overflow-auto",stale:!1,cellName:qV,onSubmitDebugger:En.NOOP,cellId:mr,debuggerActive:!1})})]}),t[12]=p,t[13]=u,t[14]=y,t[15]=T,t[16]=c,t[17]=o,t[18]=n,t[19]=L):L=t[19];const B=L;let O;t[20]!==E||t[21]!==b||t[22]!==g||t[23]!==o?(O=()=>g?h.jsx("div",{className:"absolute inset-0 z-100 bg-background p-3 border-none overflow-auto",children:h.jsx("div",{className:"overflow-auto flex flex-col gap-3",children:b.map((ae,Se)=>h.jsx("div",{className:"border rounded-md hover:shadow-sm cursor-pointer hover:border-input overflow-hidden",onClick:()=>E(ae),children:h.jsx(_a,{language:"python",theme:o,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1},value:ae.trim(),editable:!1,readOnly:!0})},Se))})}):null,t[20]=E,t[21]=b,t[22]=g,t[23]=o,t[24]=O):O=t[24];const z=O;let F,V,P,C,H,N,$,Y,Z,q,re;t[25]===Symbol.for("react.memo_cache_sentinel")?(F=Fs.create(mr),V=h.jsx("p",{className:"mx-2 my-2 text-muted-foreground text-sm",children:"Use this scratchpad cell to experiment with code without restrictions on variable names. Scratchpad code is ephemeral: variables defined in the scratchpad aren't saved to notebook memory, and the code is not saved in the notebook file."}),t[25]=F,t[26]=V):(F=t[25],V=t[26]),t[27]===Symbol.for("react.memo_cache_sentinel")?(P=pn("cell.run"),t[27]=P):P=t[27],t[28]===Symbol.for("react.memo_cache_sentinel")?(C=h.jsx(Qs,{color:"var(--grass-11)",size:16}),t[28]=C):C=t[28],t[29]!==y||t[30]!==g?(H=h.jsx(Le,{content:P,children:h.jsx(Pe,{"data-testid":"scratchpad-run-button",onClick:y,disabled:g,variant:"text",size:"xs",children:C})}),t[29]=y,t[30]=g,t[31]=H):H=t[31],t[32]===Symbol.for("react.memo_cache_sentinel")?(N=h.jsx(fm,{size:16}),t[32]=N):N=t[32],t[33]!==I||t[34]!==g?($=h.jsx(Le,{content:"Clear code and outputs",children:h.jsx(Pe,{disabled:g,size:"xs",variant:"text",onClick:I,children:N})}),t[33]=I,t[34]=g,t[35]=$):$=t[35],t[36]===Symbol.for("react.memo_cache_sentinel")?(Y=h.jsx(ti,{size:16}),t[36]=Y):Y=t[36],t[37]!==S||t[38]!==g?(Z=h.jsx(ri,{children:h.jsx(Le,{content:"Insert code",children:h.jsx(Pe,{disabled:g,size:"xs",variant:"text",onClick:S,children:Y})})}),t[37]=S,t[38]=g,t[39]=Z):Z=t[39],t[40]!==d?(q=(d==="running"||d==="queued")&&h.jsx(eo,{className:"inline",size:"small"}),t[40]=d,t[41]=q):q=t[41],t[42]===Symbol.for("react.memo_cache_sentinel")?(re=h.jsx("div",{className:"flex-1"}),t[42]=re):re=t[42];const ne=g&&"bg-[var(--sky-3)] rounded-none";let oe,G;t[43]!==ne?(oe=Oe(ne),t[43]=ne,t[44]=oe):oe=t[44],t[45]!==g||t[46]!==m?(G=()=>m(!g),t[45]=g,t[46]=m,t[47]=G):G=t[47];const Q=b.length===0;let ce,pe,de,ge,ie,xe,we;return t[48]===Symbol.for("react.memo_cache_sentinel")?(ce=h.jsx(xm,{size:16}),t[48]=ce):ce=t[48],t[49]!==oe||t[50]!==G||t[51]!==Q?(pe=h.jsx(Le,{content:"Toggle history",children:h.jsx(Pe,{size:"xs",variant:"text",className:oe,onClick:G,disabled:Q,children:ce})}),t[49]=oe,t[50]=G,t[51]=Q,t[52]=pe):pe=t[52],t[53]!==H||t[54]!==$||t[55]!==Z||t[56]!==q||t[57]!==pe?(de=h.jsxs("div",{className:"flex items-center flex-shrink-0",children:[H,$,Z,q,re,pe]}),t[53]=H,t[54]=$,t[55]=Z,t[56]=q,t[57]=pe,t[58]=de):de=t[58],t[59]!==B?(ge=B(),t[59]=B,t[60]=ge):ge=t[60],t[61]!==z?(ie=z(),t[61]=z,t[62]=ie):ie=t[62],t[63]!==ge||t[64]!==ie?(xe=h.jsxs("div",{className:"flex-1 divide-y relative overflow-hidden flex flex-col",children:[ge,ie]}),t[63]=ge,t[64]=ie,t[65]=xe):xe=t[65],t[66]!==de||t[67]!==xe?(we=h.jsxs("div",{className:"flex flex-col h-full overflow-hidden divide-y",id:F,children:[V,de,xe]}),t[66]=de,t[67]=xe,t[68]=we):we=t[68],we},AR=()=>{const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=h.jsx(IR,{}),t[0]=e):e=t[0],e},O2=(t,e)=>{lt(e?{title:"Failed to add package",description:e,variant:"danger"}:{title:"Package added",description:h.jsxs("div",{children:[h.jsxs("div",{children:["The package ",h.jsx(la,{className:"inline",children:t})," and its dependencies has been added to your environment."]}),h.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Some Python packages may require a kernel restart to see changes."})]})})},D2=(t,e)=>{lt(e?{title:"Failed to upgrade package",description:e,variant:"danger"}:{title:"Package upgraded",description:h.jsxs("div",{children:[h.jsxs("div",{children:["The package ",h.jsx(la,{className:"inline",children:t})," has been upgraded."]}),h.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Some Python packages may require a kernel restart to see changes."})]})})},R2=(t,e)=>{lt(e?{title:"Failed to remove package",description:e,variant:"danger"}:{title:"Package removed",description:h.jsxs("div",{children:[h.jsxs("div",{children:["The package ",h.jsx(la,{className:"inline",children:t})," has been removed from your environment."]}),h.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Some Python packages may require a kernel restart to see changes."})]})})},P2=t=>{const e=X.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=h.jsx(eo,{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=Oe("px-2 h-full text-xs text-muted-foreground hover:text-foreground","invisible group-hover:visible",s),e[1]=s,e[2]=i):i=e[2],e[3]!==n?(a=Hn.stopPropagation(n),e[3]=n,e[4]=a):a=e[4],e[5]!==r||e[6]!==i||e[7]!==a?(l=h.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},TR=()=>{const t=X.c(16),[e]=Ds(),n=e.package_management.manager;let o;t[0]!==n?(o=[n],t[0]=n,t[1]=o):o=t[1];const{data:r,loading:s,error:i,reload:a}=$n(PR,o);if(s&&!r){let p;return t[2]===Symbol.for("react.memo_cache_sentinel")?(p=h.jsx(eo,{size:"medium",centered:!0}),t[2]=p):p=t[2],p}if(i){let p;return t[3]!==i?(p=h.jsx(Xs,{error:i}),t[3]=i,t[4]=p):p=t[4],p}let l;t[5]!==(r==null?void 0:r.packages)?(l=(r==null?void 0:r.packages)||[],t[5]=r==null?void 0:r.packages,t[6]=l):l=t[6];const c=l;let d,u,f;return t[7]!==n||t[8]!==a?(d=h.jsx(MR,{packageManager:n,onSuccess:a}),t[7]=n,t[8]=a,t[9]=d):d=t[9],t[10]!==c||t[11]!==a?(u=h.jsx(OR,{packages:c,onSuccess:a}),t[10]=c,t[11]=a,t[12]=u):u=t[12],t[13]!==d||t[14]!==u?(f=h.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[d,u]}),t[13]=d,t[14]=u,t[15]=f):f=t[15],f},MR=({onSuccess:t,packageManager:e})=>{const[n,o]=K.useState(""),[r,s]=K.useState(!1),{handleClick:i}=xa(),a=We(rS),l=en(rS);K.useEffect(()=>{a&&(o(a),l(null))},[a,l]);const c=async()=>{try{s(!0);const d=await sS({package:n});d.success?(t(),O2(n)):O2(n,d.error)}finally{o(""),s(!1)}};return h.jsxs("div",{className:"flex items-center w-full border-b",children:[h.jsx(V4,{placeholder:`Install packages with ${e}...`,id:Y1,icon:r?h.jsx(eo,{size:"small",className:"mr-2 h-4 w-4 shrink-0 opacity-50"}):h.jsx(Le,{content:"Change package manager",children:h.jsx(ba,{onClick:()=>i("packageManagement"),className:"mr-2 h-4 w-4 shrink-0 opacity-50 hover:opacity-80 cursor-pointer"})}),rootClassName:"flex-1 border-none",value:n,onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),c())},onChange:d=>o(d.target.value)}),h.jsx(Le,{delayDuration:300,side:"left",align:"start",content:h.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:",h.jsxs("div",{className:"flex flex-col gap-2 mt-2",children:[h.jsxs("div",{children:[h.jsx("span",{className:"font-bold tracking-wide",children:"Package name:"})," A package name; this will install the latest version.",h.jsx("div",{className:"text-muted-foreground",children:"Example: httpx"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"font-bold tracking-wide",children:"Package and version:"})," ","A package with a specific version or version range.",h.jsx("div",{className:"text-muted-foreground",children:"Examples: httpx==0.27.0, httpx>=0.27.0"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"font-bold tracking-wide",children:"Git:"})," A Git repository",h.jsx("div",{className:"text-muted-foreground",children:"Example: git+https://github.com/encode/httpx"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"font-bold tracking-wide",children:"URL:"})," A remote wheel or source distribution.",h.jsx("div",{className:"text-muted-foreground",children:"Example: https://example.com/httpx-0.27.0.tar.gz"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"font-bold tracking-wide",children:"Path:"})," A local wheel, source distribution, or project directory.",h.jsx("div",{className:"text-muted-foreground",children:"Example: /example/foo-0.1.0-py3-none-any.whl"})]})]})]}),children:h.jsx(Up,{className:"h-4 w-4 cursor-help text-muted-foreground hover:text-foreground bg-transparent"})}),h.jsx("button",{type:"button",className:Oe("float-right px-2 m-0 h-full text-sm text-secondary-foreground ml-2",n&&"bg-accent text-accent-foreground","disabled:cursor-not-allowed disabled:opacity-50"),onClick:c,disabled:!n,children:"Add"})]})},OR=t=>{const e=X.c(9),{onSuccess:n,packages:o}=t;if(o.length===0){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsx(An,{title:"No packages",description:"No packages are installed in this environment.",icon:h.jsx(ba,{})}),e[0]=a):a=e[0],a}let r,s,i;if(e[1]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsx(Gp,{children:h.jsxs(Ks,{children:[h.jsx(Fr,{children:"Name"}),h.jsx(Fr,{children:"Version"}),h.jsx(Fr,{})]})}),e[1]=r):r=e[1],e[2]!==n||e[3]!==o){let a;e[5]!==n?(a=l=>h.jsxs(Ks,{className:"group",onClick:async()=>{await yn(`${l.name}==${l.version}`),lt({title:"Copied to clipboard"})},children:[h.jsx(zr,{children:l.name}),h.jsx(zr,{children:l.version}),h.jsxs(zr,{className:"flex justify-end",children:[h.jsx(DR,{packageName:l.name,onSuccess:n}),h.jsx(RR,{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=h.jsxs(qp,{className:"overflow-auto flex-1",children:[r,h.jsx(Yp,{children:s})]}),e[7]=s,e[8]=i):i=e[8],i},DR=({packageName:t,onSuccess:e})=>{const[n,o]=K.useState(!1);return Un()?null:h.jsx(P2,{onClick:async()=>{try{o(!0);const r=await sS({package:t,upgrade:!0});r.success?(e(),D2(t)):D2(t,r.error)}finally{o(!1)}},loading:n,children:"Upgrade"})},RR=({packageName:t,onSuccess:e})=>{const[n,o]=K.useState(!1);return h.jsx(P2,{onClick:async()=>{try{o(!0);const r=await YV({package:t});r.success?(e(),R2(t)):R2(t,r.error)}finally{o(!1)}},loading:n,children:"Remove"})};function PR(){return GV()}var df="ScrollArea",[L2,i$]=f4(df),[LR,Fn]=L2(df),F2=A.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:o="hover",dir:r,scrollHideDelay:s=600,...i}=t,[a,l]=A.useState(null),[c,d]=A.useState(null),[u,f]=A.useState(null),[p,_]=A.useState(null),[g,m]=A.useState(null),[b,x]=A.useState(0),[y,v]=A.useState(0),[S,k]=A.useState(!1),[I,j]=A.useState(!1),E=Zs(e,M=>l(M)),T=JV(r);return h.jsx(LR,{scope:n,type:o,dir:T,scrollHideDelay:s,scrollArea:a,viewport:c,onViewportChange:d,content:u,onContentChange:f,scrollbarX:p,onScrollbarXChange:_,scrollbarXEnabled:S,onScrollbarXEnabledChange:k,scrollbarY:g,onScrollbarYChange:m,scrollbarYEnabled:I,onScrollbarYEnabledChange:j,onCornerWidthChange:x,onCornerHeightChange:v,children:h.jsx(Ws.div,{dir:T,...i,ref:E,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":y+"px",...t.style}})})});F2.displayName=df;var z2="ScrollAreaViewport",B2=A.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:o,nonce:r,...s}=t,i=Fn(z2,n),a=A.useRef(null),l=Zs(e,a,i.onViewportChange);return h.jsxs(h.Fragment,{children:[h.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}),h.jsx(Ws.div,{"data-radix-scroll-area-viewport":"",...s,ref:l,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...t.style},children:h.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})});B2.displayName=z2;var ao="ScrollAreaScrollbar",uf=A.forwardRef((t,e)=>{const{forceMount:n,...o}=t,r=Fn(ao,t.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=r,a=t.orientation==="horizontal";return A.useEffect(()=>(a?s(!0):i(!0),()=>{a?s(!1):i(!1)}),[a,s,i]),r.type==="hover"?h.jsx(FR,{...o,ref:e,forceMount:n}):r.type==="scroll"?h.jsx(zR,{...o,ref:e,forceMount:n}):r.type==="auto"?h.jsx(U2,{...o,ref:e,forceMount:n}):r.type==="always"?h.jsx(hf,{...o,ref:e}):null});uf.displayName=ao;var FR=A.forwardRef((t,e)=>{const{forceMount:n,...o}=t,r=Fn(ao,t.__scopeScrollArea),[s,i]=A.useState(!1);return A.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]),h.jsx(Uc,{present:n||s,children:h.jsx(U2,{"data-state":s?"visible":"hidden",...o,ref:e})})}),zR=A.forwardRef((t,e)=>{const{forceMount:n,...o}=t,r=Fn(ao,t.__scopeScrollArea),s=t.orientation==="horizontal",i=Wl(()=>l("SCROLL_END"),100),[a,l]=function(c,d){return A.useReducer((u,f)=>d[u][f]??u,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 A.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),r.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,r.scrollHideDelay,l]),A.useEffect(()=>{const c=r.viewport,d=s?"scrollLeft":"scrollTop";if(c){let u=c[d];const f=()=>{const p=c[d];u!==p&&(l("SCROLL"),i()),u=p};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[r.viewport,s,l,i]),h.jsx(Uc,{present:n||a!=="hidden",children:h.jsx(hf,{"data-state":a==="hidden"?"hidden":"visible",...o,ref:e,onPointerEnter:qn(t.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:qn(t.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),U2=A.forwardRef((t,e)=>{const n=Fn(ao,t.__scopeScrollArea),{forceMount:o,...r}=t,[s,i]=A.useState(!1),a=t.orientation==="horizontal",l=Wl(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;i(a?c:d)}},10);return gs(n.viewport,l),gs(n.content,l),h.jsx(Uc,{present:o||s,children:h.jsx(hf,{"data-state":s?"visible":"hidden",...r,ref:e})})}),hf=A.forwardRef((t,e)=>{const{orientation:n="vertical",...o}=t,r=Fn(ao,t.__scopeScrollArea),s=A.useRef(null),i=A.useRef(0),[a,l]=A.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=q2(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 u(f,p){return function(_,g,m,b="ltr"){const x=$l(m),y=x/2,v=g||y,S=x-v,k=m.scrollbar.paddingStart+v,I=m.scrollbar.size-m.scrollbar.paddingEnd-S,j=m.content-m.viewport,E=b==="ltr"?[0,j]:[-1*j,0];return Y2([k,I],E)(_)}(f,i.current,a,p)}return n==="horizontal"?h.jsx(BR,{...d,ref:e,onThumbPositionChange:()=>{if(r.viewport&&s.current){const f=G2(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=u(f,r.dir))}}):n==="vertical"?h.jsx(UR,{...d,ref:e,onThumbPositionChange:()=>{if(r.viewport&&s.current){const f=G2(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=u(f))}}):null}),BR=A.forwardRef((t,e)=>{const{sizes:n,onSizesChange:o,...r}=t,s=Fn(ao,t.__scopeScrollArea),[i,a]=A.useState(),l=A.useRef(null),c=Zs(e,l,s.onScrollbarXChange);return A.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),h.jsx(H2,{"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":$l(n)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.x),onDragScroll:d=>t.onDragScroll(d.x),onWheelScroll:(d,u)=>{if(s.viewport){const f=s.viewport.scrollLeft+d.deltaX;t.onWheelScroll(f),J2(f,u)&&d.preventDefault()}},onResize:()=>{l.current&&s.viewport&&i&&o({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Hl(i.paddingLeft),paddingEnd:Hl(i.paddingRight)}})}})}),UR=A.forwardRef((t,e)=>{const{sizes:n,onSizesChange:o,...r}=t,s=Fn(ao,t.__scopeScrollArea),[i,a]=A.useState(),l=A.useRef(null),c=Zs(e,l,s.onScrollbarYChange);return A.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),h.jsx(H2,{"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":$l(n)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.y),onDragScroll:d=>t.onDragScroll(d.y),onWheelScroll:(d,u)=>{if(s.viewport){const f=s.viewport.scrollTop+d.deltaY;t.onWheelScroll(f),J2(f,u)&&d.preventDefault()}},onResize:()=>{l.current&&s.viewport&&i&&o({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Hl(i.paddingTop),paddingEnd:Hl(i.paddingBottom)}})}})}),[VR,V2]=L2(ao),H2=A.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:o,hasThumb:r,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:d,onResize:u,...f}=t,p=Fn(ao,n),[_,g]=A.useState(null),m=Zs(e,E=>g(E)),b=A.useRef(null),x=A.useRef(""),y=p.viewport,v=o.content-o.viewport,S=hr(d),k=hr(l),I=Wl(u,10);function j(E){if(b.current){const T=E.clientX-b.current.left,M=E.clientY-b.current.top;c({x:T,y:M})}}return A.useEffect(()=>{const E=T=>{const M=T.target;(_==null?void 0:_.contains(M))&&S(T,v)};return document.addEventListener("wheel",E,{passive:!1}),()=>document.removeEventListener("wheel",E,{passive:!1})},[y,_,v,S]),A.useEffect(k,[o,k]),gs(_,I),gs(p.content,I),h.jsx(VR,{scope:n,scrollbar:_,hasThumb:r,onThumbChange:hr(s),onThumbPointerUp:hr(i),onThumbPositionChange:k,onThumbPointerDown:hr(a),children:h.jsx(Ws.div,{...f,ref:m,style:{position:"absolute",...f.style},onPointerDown:qn(t.onPointerDown,E=>{E.button===0&&(E.target.setPointerCapture(E.pointerId),b.current=_.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),j(E))}),onPointerMove:qn(t.onPointerMove,j),onPointerUp:qn(t.onPointerUp,E=>{const T=E.target;T.hasPointerCapture(E.pointerId)&&T.releasePointerCapture(E.pointerId),document.body.style.webkitUserSelect=x.current,p.viewport&&(p.viewport.style.scrollBehavior=""),b.current=null})})})}),Vl="ScrollAreaThumb",$2=A.forwardRef((t,e)=>{const{forceMount:n,...o}=t,r=V2(Vl,t.__scopeScrollArea);return h.jsx(Uc,{present:n||r.hasThumb,children:h.jsx(HR,{ref:e,...o})})}),HR=A.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:o,...r}=t,s=Fn(Vl,n),i=V2(Vl,n),{onThumbPositionChange:a}=i,l=Zs(e,u=>i.onThumbChange(u)),c=A.useRef(void 0),d=Wl(()=>{c.current&&(c.current(),c.current=void 0)},100);return A.useEffect(()=>{const u=s.viewport;if(u){const f=()=>{if(d(),!c.current){const p=WR(u,a);c.current=p,a()}};return a(),u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[s.viewport,d,a]),h.jsx(Ws.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:qn(t.onPointerDownCapture,u=>{const f=u.target.getBoundingClientRect(),p=u.clientX-f.left,_=u.clientY-f.top;i.onThumbPointerDown({x:p,y:_})}),onPointerUp:qn(t.onPointerUp,i.onThumbPointerUp)})});$2.displayName=Vl;var ff="ScrollAreaCorner",W2=A.forwardRef((t,e)=>{const n=Fn(ff,t.__scopeScrollArea),o=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&o?h.jsx($R,{...t,ref:e}):null});W2.displayName=ff;var $R=A.forwardRef((t,e)=>{const{__scopeScrollArea:n,...o}=t,r=Fn(ff,n),[s,i]=A.useState(0),[a,l]=A.useState(0),c=!!(s&&a);return gs(r.scrollbarX,()=>{var u;const d=((u=r.scrollbarX)==null?void 0:u.offsetHeight)||0;r.onCornerHeightChange(d),l(d)}),gs(r.scrollbarY,()=>{var u;const d=((u=r.scrollbarY)==null?void 0:u.offsetWidth)||0;r.onCornerWidthChange(d),i(d)}),c?h.jsx(Ws.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 Hl(t){return t?parseInt(t,10):0}function q2(t,e){const n=t/e;return isNaN(n)?0:n}function $l(t){const e=q2(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=(t.scrollbar.size-n)*e;return Math.max(o,18)}function G2(t,e,n="ltr"){const o=$l(e),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=e.scrollbar.size-r,i=e.content-e.viewport,a=s-o,l=XV(t,n==="ltr"?[0,i]:[-1*i,0]);return Y2([0,i],[0,a])(l)}function Y2(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 J2(t,e){return t>0&&t<e}var WR=(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 Wl(t,e){const n=hr(t),o=A.useRef(0);return A.useEffect(()=>()=>window.clearTimeout(o.current),[]),A.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(n,e)},[n,e])}function gs(t,e){const n=hr(e);KV(()=>{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 K2=F2,qR=B2,GR=W2;const pf=A.forwardRef((t,e)=>{const n=X.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=Oe("relative overflow-hidden",r),n[4]=r,n[5]=i):i=n[5],n[6]!==o?(a=h.jsx(qR,{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=h.jsx(X2,{}),c=h.jsx(GR,{}),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=h.jsxs(K2,{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});pf.displayName=K2.displayName;const X2=A.forwardRef((t,e)=>{const n=X.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-[1px]",l=i==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]";let c,d,u;return n[4]!==o||n[5]!==a||n[6]!==l?(c=Oe("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=h.jsx($2,{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?(u=h.jsx(uf,{ref:e,orientation:i,className:c,...r,children:d}),n[9]=i,n[10]=r,n[11]=e,n[12]=c,n[13]=u):u=n[13],u});X2.displayName=uf.displayName;const YR=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,JR=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,KR={};function Z2(t,e){return(KR.jsx?JR:YR).test(t)}const XR=/[ \t\n\f\r]/g;function Q2(t){return t.replace(XR,"")===""}class $i{constructor(e,n,o){this.property=e,this.normal=n,o&&(this.space=o)}}function ek(t,e){const n={},o={};let r=-1;for(;++r<t.length;)Object.assign(n,t[r].property),Object.assign(o,t[r].normal);return new $i(n,o,e)}function mf(t){return t.toLowerCase()}$i.prototype.property={},$i.prototype.normal={},$i.prototype.space=null;class zn{constructor(e,n){this.property=e,this.attribute=n}}zn.prototype.space=null,zn.prototype.boolean=!1,zn.prototype.booleanish=!1,zn.prototype.overloadedBoolean=!1,zn.prototype.number=!1,zn.prototype.commaSeparated=!1,zn.prototype.spaceSeparated=!1,zn.prototype.commaOrSpaceSeparated=!1,zn.prototype.mustUseProperty=!1,zn.prototype.defined=!1;let ZR=0;const tt=Tr(),Rt=Tr(),tk=Tr(),ye=Tr(),_t=Tr(),_s=Tr(),vn=Tr();function Tr(){return 2**++ZR}const gf=Object.freeze(Object.defineProperty({__proto__:null,boolean:tt,booleanish:Rt,commaOrSpaceSeparated:vn,commaSeparated:_s,number:ye,overloadedBoolean:tk,spaceSeparated:_t},Symbol.toStringTag,{value:"Module"})),_f=Object.keys(gf);class bf extends zn{constructor(e,n,o,r){let s=-1;if(super(e,n),nk(this,"space",r),typeof o=="number")for(;++s<_f.length;){const i=_f[s];nk(this,_f[s],(o&gf[i])===gf[i])}}}function nk(t,e,n){n&&(t[e]=n)}bf.prototype.defined=!0;const QR={}.hasOwnProperty;function bs(t){const e={},n={};let o;for(o in t.properties)if(QR.call(t.properties,o)){const r=t.properties[o],s=new bf(o,t.transform(t.attributes||{},o),r,t.space);t.mustUseProperty&&t.mustUseProperty.includes(o)&&(s.mustUseProperty=!0),e[o]=s,n[mf(o)]=o,n[mf(s.attribute)]=o}return new $i(e,n,t.space)}const ok=bs({space:"xlink",transform:(t,e)=>"xlink:"+e.slice(5).toLowerCase(),properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),rk=bs({space:"xml",transform:(t,e)=>"xml:"+e.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function sk(t,e){return e in t?t[e]:e}function ik(t,e){return sk(t,e.toLowerCase())}const ak=bs({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:ik,properties:{xmlns:null,xmlnsXLink:null}}),lk=bs({transform:(t,e)=>e==="role"?e:"aria-"+e.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:Rt,ariaAutoComplete:null,ariaBusy:Rt,ariaChecked:Rt,ariaColCount:ye,ariaColIndex:ye,ariaColSpan:ye,ariaControls:_t,ariaCurrent:null,ariaDescribedBy:_t,ariaDetails:null,ariaDisabled:Rt,ariaDropEffect:_t,ariaErrorMessage:null,ariaExpanded:Rt,ariaFlowTo:_t,ariaGrabbed:Rt,ariaHasPopup:null,ariaHidden:Rt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:_t,ariaLevel:ye,ariaLive:null,ariaModal:Rt,ariaMultiLine:Rt,ariaMultiSelectable:Rt,ariaOrientation:null,ariaOwns:_t,ariaPlaceholder:null,ariaPosInSet:ye,ariaPressed:Rt,ariaReadOnly:Rt,ariaRelevant:null,ariaRequired:Rt,ariaRoleDescription:_t,ariaRowCount:ye,ariaRowIndex:ye,ariaRowSpan:ye,ariaSelected:Rt,ariaSetSize:ye,ariaSort:null,ariaValueMax:ye,ariaValueMin:ye,ariaValueNow:ye,ariaValueText:null,role:null}}),eP=bs({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:ik,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:_s,acceptCharset:_t,accessKey:_t,action:null,allow:null,allowFullScreen:tt,allowPaymentRequest:tt,allowUserMedia:tt,alt:null,as:null,async:tt,autoCapitalize:null,autoComplete:_t,autoFocus:tt,autoPlay:tt,blocking:_t,capture:null,charSet:null,checked:tt,cite:null,className:_t,cols:ye,colSpan:null,content:null,contentEditable:Rt,controls:tt,controlsList:_t,coords:ye|_s,crossOrigin:null,data:null,dateTime:null,decoding:null,default:tt,defer:tt,dir:null,dirName:null,disabled:tt,download:tk,draggable:Rt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:tt,formTarget:null,headers:_t,height:ye,hidden:tt,high:ye,href:null,hrefLang:null,htmlFor:_t,httpEquiv:_t,id:null,imageSizes:null,imageSrcSet:null,inert:tt,inputMode:null,integrity:null,is:null,isMap:tt,itemId:null,itemProp:_t,itemRef:_t,itemScope:tt,itemType:_t,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:tt,low:ye,manifest:null,max:null,maxLength:ye,media:null,method:null,min:null,minLength:ye,multiple:tt,muted:tt,name:null,nonce:null,noModule:tt,noValidate:tt,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:tt,optimum:ye,pattern:null,ping:_t,placeholder:null,playsInline:tt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:tt,referrerPolicy:null,rel:_t,required:tt,reversed:tt,rows:ye,rowSpan:ye,sandbox:_t,scope:null,scoped:tt,seamless:tt,selected:tt,shadowRootClonable:tt,shadowRootDelegatesFocus:tt,shadowRootMode:null,shape:null,size:ye,sizes:null,slot:null,span:ye,spellCheck:Rt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ye,step:null,style:null,tabIndex:ye,target:null,title:null,translate:null,type:null,typeMustMatch:tt,useMap:null,value:Rt,width:ye,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:_t,axis:null,background:null,bgColor:null,border:ye,borderColor:null,bottomMargin:ye,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:tt,declare:tt,event:null,face:null,frame:null,frameBorder:null,hSpace:ye,leftMargin:ye,link:null,longDesc:null,lowSrc:null,marginHeight:ye,marginWidth:ye,noResize:tt,noHref:tt,noShade:tt,noWrap:tt,object:null,profile:null,prompt:null,rev:null,rightMargin:ye,rules:null,scheme:null,scrolling:Rt,standby:null,summary:null,text:null,topMargin:ye,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ye,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:tt,disableRemotePlayback:tt,prefix:null,property:null,results:ye,security:null,unselectable:null}}),tP=bs({space:"svg",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"},transform:sk,properties:{about:vn,accentHeight:ye,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ye,amplitude:ye,arabicForm:null,ascent:ye,attributeName:null,attributeType:null,azimuth:ye,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ye,by:null,calcMode:null,capHeight:ye,className:_t,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:ye,diffuseConstant:ye,direction:null,display:null,dur:null,divisor:ye,dominantBaseline:null,download:tt,dx:null,dy:null,edgeMode:null,editable:null,elevation:ye,enableBackground:null,end:null,event:null,exponent:ye,externalResourcesRequired:null,fill:null,fillOpacity:ye,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:_s,g2:_s,glyphName:_s,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ye,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ye,horizOriginX:ye,horizOriginY:ye,id:null,ideographic:ye,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ye,k:ye,k1:ye,k2:ye,k3:ye,k4:ye,kernelMatrix:vn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ye,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:ye,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:ye,overlineThickness:ye,paintOrder:null,panose1:null,path:null,pathLength:ye,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:_t,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ye,pointsAtY:ye,pointsAtZ:ye,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:vn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:vn,rev:vn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:vn,requiredFeatures:vn,requiredFonts:vn,requiredFormats:vn,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:ye,specularExponent:ye,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ye,strikethroughThickness:ye,string:null,stroke:null,strokeDashArray:vn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ye,strokeOpacity:ye,strokeWidth:null,style:null,surfaceScale:ye,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:vn,tabIndex:ye,tableValues:null,target:null,targetX:ye,targetY:ye,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:vn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ye,underlineThickness:ye,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ye,values:null,vAlphabetic:ye,vMathematical:ye,vectorEffect:null,vHanging:ye,vIdeographic:ye,version:null,vertAdvY:ye,vertOriginX:ye,vertOriginY:ye,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ye,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),nP=/^data[-\w.:]+$/i,ck=/-[a-z]/g,oP=/[A-Z]/g;function rP(t){return"-"+t.toLowerCase()}function sP(t){return t.charAt(1).toUpperCase()}const iP={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"},aP=ek([rk,ok,ak,lk,eP],"html"),yf=ek([rk,ok,ak,lk,tP],"svg"),dk=iS(ZV()),lP=dk.default||dk,uk=hk("end"),xf=hk("start");function hk(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 Wi(t){return t&&typeof t=="object"?"position"in t||"type"in t?fk(t.position):"start"in t||"end"in t?fk(t):"line"in t||"column"in t?wf(t):"":""}function wf(t){return pk(t&&t.line)+":"+pk(t&&t.column)}function fk(t){return wf(t&&t.start)+"-"+wf(t&&t.end)}function pk(t){return t&&typeof t=="number"?t:1}class on 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=Wi(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}}on.prototype.file="",on.prototype.name="",on.prototype.reason="",on.prototype.message="",on.prototype.stack="",on.prototype.column=void 0,on.prototype.line=void 0,on.prototype.ancestors=void 0,on.prototype.cause=void 0,on.prototype.fatal=void 0,on.prototype.place=void 0,on.prototype.ruleId=void 0,on.prototype.source=void 0;const vf={}.hasOwnProperty,cP=new Map,dP=/[A-Z]/g,uP=/-([a-z])/g,hP=new Set(["table","tbody","thead","tfoot","tr"]),fP=new Set(["td","th"]),mk="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function pP(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,u,f){const p=Array.isArray(u.children),_=xf(c);return a(d,u,f,p,{columnNumber:_?_.column-1:void 0,fileName:i,lineNumber:_?_.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,u,f,p){const _=Array.isArray(f.children)?l:a;return p?_(u,f,p):_(u,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"?yf:aP,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=gk(r,t,void 0);return s&&typeof s!="string"?s:r.create(t,r.Fragment,{children:s||void 0},void 0)}function gk(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=yf,o.schema=a),o.ancestors.push(r);const l=bk(o,r.tagName,!1),c=function(u,f){const p={};let _,g;for(g in f.properties)if(g!=="children"&&vf.call(f.properties,g)){const m=mP(u,g,f.properties[g]);if(m){const[b,x]=m;u.tableCellAlignToStyle&&b==="align"&&typeof x=="string"&&fP.has(f.tagName)?_=x:p[b]=x}}return _&&((p.style||(p.style={}))[u.stylePropertyNameCase==="css"?"text-align":"textAlign"]=_),p}(o,r);let d=Sf(o,r);return hP.has(r.tagName)&&(d=d.filter(function(u){return typeof u!="string"||!(typeof(f=u)=="object"?f.type==="text"&&Q2(f.value):Q2(f));var f})),_k(o,c,l,r),kf(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)}qi(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=yf,o.schema=a),o.ancestors.push(r);const l=r.name===null?o.Fragment:bk(o,r.name,!0),c=function(u,f){const p={};for(const _ of f.attributes)if(_.type==="mdxJsxExpressionAttribute")if(_.data&&_.data.estree&&u.evaluater){const g=_.data.estree.body[0];g.type;const m=g.expression;m.type;const b=m.properties[0];b.type,Object.assign(p,u.evaluater.evaluateExpression(b.argument))}else qi(u,f.position);else{const g=_.name;let m;if(_.value&&typeof _.value=="object")if(_.value.data&&_.value.data.estree&&u.evaluater){const b=_.value.data.estree.body[0];b.type,m=u.evaluater.evaluateExpression(b.expression)}else qi(u,f.position);else m=_.value===null||_.value;p[g]=m}return p}(o,r),d=Sf(o,r);return _k(o,c,l,r),kf(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);qi(o,r.position)}(t,e):e.type==="root"?function(o,r,s){const i={};return kf(i,Sf(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 _k(t,e,n,o){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=o)}function kf(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function Sf(t,e){const n=[];let o=-1;const r=t.passKeys?new Map:cP;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=gk(t,s,i);a!==void 0&&n.push(a)}return n}function mP(t,e,n){const o=function(r,s){const i=mf(s);let a=s,l=zn;if(i in r.normal)return r.property[r.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&nP.test(s)){if(s.charAt(4)==="-"){const c=s.slice(5).replace(ck,sP);a="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=s.slice(4);if(!ck.test(c)){let d=c.replace(oP,rP);d.charAt(0)!=="-"&&(d="-"+d),s="data"+d}}l=bf}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){const a={};try{lP(i,l)}catch(c){if(!s.ignoreInvalidStyle){const d=c,u=new on("Cannot parse `style` attribute",{ancestors:s.ancestors,cause:d,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw u.file=s.filePath||void 0,u.url=mk+"#cannot-parse-style-attribute",u}}return a;function l(c,d){let u=c;u.slice(0,2)!=="--"&&(u.slice(0,4)==="-ms-"&&(u="ms-"+u.slice(4)),u=u.replace(uP,_P)),a[u]=d}}(t,String(n));return t.stylePropertyNameCase==="css"&&(r=function(s){const i={};let a;for(a in s)vf.call(s,a)&&(i[gP(a)]=s[a]);return i}(r)),["style",r]}return[t.elementAttributeNameCase==="react"&&o.space?iP[o.property]||o.property:o.attribute,n]}}function bk(t,e,n){let o;if(n)if(e.includes(".")){const r=e.split(".");let s,i=-1;for(;++i<r.length;){const a=Z2(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=Z2(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 vf.call(t.components,r)?t.components[r]:r}if(t.evaluater)return t.evaluater.evaluateExpression(o);qi(t)}function qi(t,e){const n=new on("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=mk+"#cannot-handle-mdx-estrees-without-createevaluater",n}function gP(t){let e=t.replace(dP,bP);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function _P(t,e){return e.toUpperCase()}function bP(t){return"-"+t.toLowerCase()}const Cf={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"]},ql={};function yk(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 xk(t.children,e,n)}return Array.isArray(t)?xk(t,e,n):""}function xk(t,e,n){const o=[];let r=-1;for(;++r<t.length;)o[r]=yk(t[r],e,n);return o.join("")}const wk=document.createElement("i");function Nf(t){const e="&"+t+";";wk.innerHTML=e;const n=wk.textContent;return(n.charCodeAt(n.length-1)!==59||t==="semi")&&n!==e&&n}function lo(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 Bn(t,e){return t.length>0?(lo(t,t.length,0,e),t):e}const vk={}.hasOwnProperty;function yP(t,e){let n;for(n in e){const o=(vk.call(t,n)?t[n]:void 0)||(t[n]={}),r=e[n];let s;if(r)for(s in r){vk.call(o,s)||(o[s]=[]);const i=r[s];xP(o[s],Array.isArray(i)?i:i?[i]:[])}}}function xP(t,e){let n=-1;const o=[];for(;++n<e.length;)(e[n].add==="after"?t:o).push(e[n]);lo(t,0,0,o)}function kk(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 ys(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const co=rr(/[A-Za-z]/),kn=rr(/[\dA-Za-z]/),wP=rr(/[#-'*+\--9=?A-Z^-~]/);function jf(t){return t!==null&&(t<32||t===127)}const Ef=rr(/\d/),vP=rr(/[\dA-Fa-f]/),kP=rr(/[!-/:-@[-`{-~]/);function Ze(t){return t!==null&&t<-2}function _n(t){return t!==null&&(t<0||t===32)}function ht(t){return t===-2||t===-1||t===32}const SP=rr(new RegExp("\\p{P}|\\p{S}","u")),CP=rr(/\s/);function rr(t){return function(e){return e!==null&&e>-1&&t.test(String.fromCharCode(e))}}function xs(t){const e=[];let n=-1,o=0,r=0;for(;++n<t.length;){const s=t.charCodeAt(n);let i="";if(s===37&&kn(t.charCodeAt(n+1))&&kn(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 bt(t,e,n,o){const r=o?o-1:Number.POSITIVE_INFINITY;let s=0;return function(a){return ht(a)?(t.enter(n),i(a)):e(a)};function i(a){return ht(a)&&s++<r?(t.consume(a),i):(t.exit(n),e(a))}}const NP={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"),bt(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)):Ze(s)?(t.consume(s),t.exit("chunkText"),o):(t.consume(s),r)}}},jP={tokenize:function(t){const e=this,n=[];let o,r,s,i=0;return a;function a(y){if(i<n.length){const v=n[i];return e.containerState=v[1],t.attempt(v[0].continuation,l,c)(y)}return c(y)}function l(y){if(i++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,o&&x();const v=e.events.length;let S,k=v;for(;k--;)if(e.events[k][0]==="exit"&&e.events[k][1].type==="chunkFlow"){S=e.events[k][1].end;break}b(i);let I=v;for(;I<e.events.length;)e.events[I][1].end={...S},I++;return lo(e.events,k+1,0,e.events.slice(v)),e.events.length=I,c(y)}return a(y)}function c(y){if(i===n.length){if(!o)return f(y);if(o.currentConstruct&&o.currentConstruct.concrete)return _(y);e.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(Sk,d,u)(y)}function d(y){return o&&x(),b(i),f(y)}function u(y){return e.parser.lazy[e.now().line]=i!==n.length,s=e.now().offset,_(y)}function f(y){return e.containerState={},t.attempt(Sk,p,_)(y)}function p(y){return i++,n.push([e.currentConstruct,e.containerState]),f(y)}function _(y){return y===null?(o&&x(),b(0),void t.consume(y)):(o=o||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:r}),g(y))}function g(y){return y===null?(m(t.exit("chunkFlow"),!0),b(0),void t.consume(y)):Ze(y)?(t.consume(y),m(t.exit("chunkFlow")),i=0,e.interrupt=void 0,a):(t.consume(y),g)}function m(y,v){const S=e.sliceStream(y);if(v&&S.push(null),y.previous=r,r&&(r.next=y),r=y,o.defineSkip(y.start),o.write(S),e.parser.lazy[y.start.line]){let k=o.events.length;for(;k--;)if(o.events[k][1].start.offset<s&&(!o.events[k][1].end||o.events[k][1].end.offset>s))return;const I=e.events.length;let j,E,T=I;for(;T--;)if(e.events[T][0]==="exit"&&e.events[T][1].type==="chunkFlow"){if(j){E=e.events[T][1].end;break}j=!0}for(b(i),k=I;k<e.events.length;)e.events[k][1].end={...E},k++;lo(e.events,T+1,0,e.events.slice(I)),e.events.length=k}}function b(y){let v=n.length;for(;v-- >y;){const S=n[v];e.containerState=S[1],S[0].exit.call(e,t)}n.length=y}function x(){o.write([null]),r=void 0,o=void 0,e.containerState._closeFlow=void 0}}},Sk={tokenize:function(t,e,n){return bt(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};function Ck(t){return t===null||_n(t)||CP(t)?1:SP(t)?2:void 0}function If(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 Af={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 u={...t[n][1].end},f={...t[d][1].start};Nk(u,-a),Nk(f,a),s={type:a>1?"strongSequence":"emphasisSequence",start:u,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=Bn(l,[["enter",t[n][1],e],["exit",t[n][1],e]])),l=Bn(l,[["enter",o,e],["enter",s,e],["exit",s,e],["enter",r,e]]),l=Bn(l,If(e.parser.constructs.insideSpan.null,t.slice(n+1,d),e)),l=Bn(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=Bn(l,[["enter",t[d][1],e],["exit",t[d][1],e]])):c=0,lo(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=Ck(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=Ck(a),d=!c||c===2&&r||n.includes(a),u=!r||r===2&&c||n.includes(o);return l._open=!!(s===42?d:d&&(r||!u)),l._close=!!(s===42?u:u&&(c||!d)),e(a)}}};function Nk(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const EP={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 co(f)?(t.consume(f),s):f===64?n(f):l(f)}function s(f){return f===43||f===45||f===46||kn(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||kn(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||jf(f)?n(f):(t.consume(f),a)}function l(f){return f===64?(t.consume(f),c):wP(f)?(t.consume(f),l):n(f)}function c(f){return kn(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):u(f)}function u(f){if((f===45||kn(f))&&o++<63){const p=f===45?u:d;return t.consume(f),p}return n(f)}}},Gl={partial:!0,tokenize:function(t,e,n){return function(r){return ht(r)?bt(t,o,"linePrefix")(r):o(r)};function o(r){return r===null||Ze(r)?e(r):n(r)}}},jk={continuation:{tokenize:function(t,e,n){const o=this;return function(s){return ht(s)?bt(t,r,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):r(s)};function r(s){return t.attempt(jk,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 ht(s)?(t.enter("blockQuotePrefixWhitespace"),t.consume(s),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(s))}}},Ek={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 kP(r)?(t.enter("characterEscapeValue"),t.consume(r),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(r)}}},Ik={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=kn,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=vP,c):(t.enter("characterReferenceValue"),r=7,s=Ef,c(d))}function c(d){if(d===59&&i){const u=t.exit("characterReferenceValue");return s!==kn||Nf(o.sliceSerialize(u))?(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)}}},Ak={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)}}},Tk={concrete:!0,name:"codeFenced",tokenize:function(t,e,n){const o=this,r={partial:!0,tokenize:function(y,v,S){let k=0;return I;function I(L){return y.enter("lineEnding"),y.consume(L),y.exit("lineEnding"),j}function j(L){return y.enter("codeFencedFence"),ht(L)?bt(y,E,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):E(L)}function E(L){return L===s?(y.enter("codeFencedFenceSequence"),T(L)):S(L)}function T(L){return L===s?(k++,y.consume(L),T):k>=a?(y.exit("codeFencedFenceSequence"),ht(L)?bt(y,M,"whitespace")(L):M(L)):S(L)}function M(L){return L===null||Ze(L)?(y.exit("codeFencedFence"),v(L)):S(L)}}};let s,i=0,a=0;return function(y){return function(v){const S=o.events[o.events.length-1];return i=S&&S[1].type==="linePrefix"?S[2].sliceSerialize(S[1],!0).length:0,s=v,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),l(v)}(y)};function l(y){return y===s?(a++,t.consume(y),l):a<3?n(y):(t.exit("codeFencedFenceSequence"),ht(y)?bt(t,c,"whitespace")(y):c(y))}function c(y){return y===null||Ze(y)?(t.exit("codeFencedFence"),o.interrupt?e(y):t.check(Ak,p,x)(y)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),d(y))}function d(y){return y===null||Ze(y)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),c(y)):ht(y)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),bt(t,u,"whitespace")(y)):y===96&&y===s?n(y):(t.consume(y),d)}function u(y){return y===null||Ze(y)?c(y):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===null||Ze(y)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),c(y)):y===96&&y===s?n(y):(t.consume(y),f)}function p(y){return t.attempt(r,x,_)(y)}function _(y){return t.enter("lineEnding"),t.consume(y),t.exit("lineEnding"),g}function g(y){return i>0&&ht(y)?bt(t,m,"linePrefix",i+1)(y):m(y)}function m(y){return y===null||Ze(y)?t.check(Ak,p,x)(y):(t.enter("codeFlowValue"),b(y))}function b(y){return y===null||Ze(y)?(t.exit("codeFlowValue"),m(y)):(t.consume(y),b)}function x(y){return t.exit("codeFenced"),e(y)}}},Tf={name:"codeIndented",tokenize:function(t,e,n){const o=this;return function(l){return t.enter("codeIndented"),bt(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):Ze(l)?t.attempt(IP,s,a)(l):(t.enter("codeFlowValue"),i(l))}function i(l){return l===null||Ze(l)?(t.exit("codeFlowValue"),s(l)):(t.consume(l),i)}function a(l){return t.exit("codeIndented"),e(l)}}},IP={partial:!0,tokenize:function(t,e,n){const o=this;return r;function r(i){return o.parser.lazy[o.now().line]?n(i):Ze(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),r):bt(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):Ze(i)?r(i):n(i)}}},AP={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)):Ze(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||Ze(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 TP{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&&Gi(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),Gi(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Gi(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);Gi(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Gi(this.left,n.reverse())}}}function Gi(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 Mk(t){const e={};let n,o,r,s,i,a,l,c=-1;const d=new TP(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,MP(d,c)),c=e[c],l=!0);else if(n[1]._container){for(r=c,o=void 0;r--&&(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);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 lo(t,0,Number.POSITIVE_INFINITY,d.slice(0)),!l}function MP(t,e){const n=t.get(e)[1],o=t.get(e)[2];let r=e-1;const s=[],i=n._tokenizer||o.parser[n.contentType](n.start),a=i.events,l=[],c={};let d,u,f=-1,p=n,_=0,g=0;const m=[g];for(;p;){for(;t.get(++r)[1]!==p;);s.push(r),p._tokenizer||(d=o.sliceStream(p),p.next||d.push(null),u&&i.defineSkip(p.start),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(d),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),u=p,p=p.next}for(p=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&&(g=f+1,m.push(g),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(i.events=[],p?(p._tokenizer=void 0,p.previous=void 0):m.pop(),f=m.length;f--;){const b=a.slice(m[f],m[f+1]),x=s.pop();l.push([x,x+b.length-1]),t.splice(x,2,b)}for(l.reverse(),f=-1;++f<l.length;)c[_+l[f][0]]=_+l[f][1],_+=l[f][1]-l[f][0]-1;return c}const OP={resolve:function(t){return Mk(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):Ze(i)?t.check(DP,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}}},DP={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"),bt(t,r,"linePrefix")};function r(s){if(s===null||Ze(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 Ok(t,e,n,o,r,s,i,a,l){const c=l||Number.POSITIVE_INFINITY;let d=0;return function(m){return m===60?(t.enter(o),t.enter(r),t.enter(s),t.consume(m),t.exit(s),u):m===null||m===32||m===41||jf(m)?n(m):(t.enter(o),t.enter(i),t.enter(a),t.enter("chunkString",{contentType:"string"}),_(m))};function u(m){return m===62?(t.enter(s),t.consume(m),t.exit(s),t.exit(r),t.exit(o),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===62?(t.exit("chunkString"),t.exit(a),u(m)):m===null||m===60||Ze(m)?n(m):(t.consume(m),m===92?p:f)}function p(m){return m===60||m===62||m===92?(t.consume(m),f):f(m)}function _(m){return d||m!==null&&m!==41&&!_n(m)?d<c&&m===40?(t.consume(m),d++,_):m===41?(t.consume(m),d--,_):m===null||m===32||m===40||jf(m)?n(m):(t.consume(m),m===92?g:_):(t.exit("chunkString"),t.exit(a),t.exit(i),t.exit(o),e(m))}function g(m){return m===40||m===41||m===92?(t.consume(m),_):_(m)}}function Dk(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):Ze(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||Ze(f)||l++>999?(t.exit("chunkString"),c(f)):(t.consume(f),a||(a=!ht(f)),f===92?u:d)}function u(f){return f===91||f===92||f===93?(t.consume(f),l++,d):d(f)}}function Rk(t,e,n,o,r,s){let i;return function(u){return u===34||u===39||u===40?(t.enter(o),t.enter(r),t.consume(u),t.exit(r),i=u===40?41:u,a):n(u)};function a(u){return u===i?(t.enter(r),t.consume(u),t.exit(r),t.exit(o),e):(t.enter(s),l(u))}function l(u){return u===i?(t.exit(s),a(i)):u===null?n(u):Ze(u)?(t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),bt(t,l,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),c(u))}function c(u){return u===i||u===null||Ze(u)?(t.exit("chunkString"),l(u)):(t.consume(u),u===92?d:c)}function d(u){return u===i||u===92?(t.consume(u),c):c(u)}}function Yi(t,e){let n;return function o(r){return Ze(r)?(t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),n=!0,o):ht(r)?bt(t,o,n?"linePrefix":"lineSuffix")(r):e(r)}}const RP={name:"definition",tokenize:function(t,e,n){const o=this;let r;return function(u){return t.enter("definition"),function(f){return Dk.call(o,t,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}(u)};function s(u){return r=ys(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),u===58?(t.enter("definitionMarker"),t.consume(u),t.exit("definitionMarker"),i):n(u)}function i(u){return _n(u)?Yi(t,a)(u):a(u)}function a(u){return Ok(t,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(u)}function l(u){return t.attempt(PP,c,c)(u)}function c(u){return ht(u)?bt(t,d,"whitespace")(u):d(u)}function d(u){return u===null||Ze(u)?(t.exit("definition"),o.parser.defined.push(r),e(u)):n(u)}}},PP={partial:!0,tokenize:function(t,e,n){return function(i){return _n(i)?Yi(t,o)(i):n(i)};function o(i){return Rk(t,r,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(i)}function r(i){return ht(i)?bt(t,s,"whitespace")(i):s(i)}function s(i){return i===null||Ze(i)?e(i):n(i)}}},LP={name:"hardBreakEscape",tokenize:function(t,e,n){return function(r){return t.enter("hardBreakEscape"),t.consume(r),o};function o(r){return Ze(r)?(t.exit("hardBreakEscape"),e(r)):n(r)}}},FP={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"},lo(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||_n(l)?(t.exit("atxHeadingSequence"),s(l)):n(l)}function s(l){return l===35?(t.enter("atxHeadingSequence"),i(l)):l===null||Ze(l)?(t.exit("atxHeading"),e(l)):ht(l)?bt(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||_n(l)?(t.exit("atxHeadingText"),s(l)):(t.consume(l),a)}}},zP=["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"],Pk=["pre","script","style","textarea"],BP={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(N){return function($){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume($),c}(N)};function c(N){return N===33?(t.consume(N),d):N===47?(t.consume(N),s=!0,p):N===63?(t.consume(N),r=3,o.interrupt?e:P):co(N)?(t.consume(N),i=String.fromCharCode(N),_):n(N)}function d(N){return N===45?(t.consume(N),r=2,u):N===91?(t.consume(N),r=5,a=0,f):co(N)?(t.consume(N),r=4,o.interrupt?e:P):n(N)}function u(N){return N===45?(t.consume(N),o.interrupt?e:P):n(N)}function f(N){return N==="CDATA[".charCodeAt(a++)?(t.consume(N),a===6?o.interrupt?e:T:f):n(N)}function p(N){return co(N)?(t.consume(N),i=String.fromCharCode(N),_):n(N)}function _(N){if(N===null||N===47||N===62||_n(N)){const $=N===47,Y=i.toLowerCase();return $||s||!Pk.includes(Y)?zP.includes(i.toLowerCase())?(r=6,$?(t.consume(N),g):o.interrupt?e(N):T(N)):(r=7,o.interrupt&&!o.parser.lazy[o.now().line]?n(N):s?m(N):b(N)):(r=1,o.interrupt?e(N):T(N))}return N===45||kn(N)?(t.consume(N),i+=String.fromCharCode(N),_):n(N)}function g(N){return N===62?(t.consume(N),o.interrupt?e:T):n(N)}function m(N){return ht(N)?(t.consume(N),m):j(N)}function b(N){return N===47?(t.consume(N),j):N===58||N===95||co(N)?(t.consume(N),x):ht(N)?(t.consume(N),b):j(N)}function x(N){return N===45||N===46||N===58||N===95||kn(N)?(t.consume(N),x):y(N)}function y(N){return N===61?(t.consume(N),v):ht(N)?(t.consume(N),y):b(N)}function v(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(t.consume(N),l=N,S):ht(N)?(t.consume(N),v):k(N)}function S(N){return N===l?(t.consume(N),l=null,I):N===null||Ze(N)?n(N):(t.consume(N),S)}function k(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||_n(N)?y(N):(t.consume(N),k)}function I(N){return N===47||N===62||ht(N)?b(N):n(N)}function j(N){return N===62?(t.consume(N),E):n(N)}function E(N){return N===null||Ze(N)?T(N):ht(N)?(t.consume(N),E):n(N)}function T(N){return N===45&&r===2?(t.consume(N),O):N===60&&r===1?(t.consume(N),z):N===62&&r===4?(t.consume(N),C):N===63&&r===3?(t.consume(N),P):N===93&&r===5?(t.consume(N),V):!Ze(N)||r!==6&&r!==7?N===null||Ze(N)?(t.exit("htmlFlowData"),M(N)):(t.consume(N),T):(t.exit("htmlFlowData"),t.check(UP,H,M)(N))}function M(N){return t.check(VP,L,H)(N)}function L(N){return t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),B}function B(N){return N===null||Ze(N)?M(N):(t.enter("htmlFlowData"),T(N))}function O(N){return N===45?(t.consume(N),P):T(N)}function z(N){return N===47?(t.consume(N),i="",F):T(N)}function F(N){if(N===62){const $=i.toLowerCase();return Pk.includes($)?(t.consume(N),C):T(N)}return co(N)&&i.length<8?(t.consume(N),i+=String.fromCharCode(N),F):T(N)}function V(N){return N===93?(t.consume(N),P):T(N)}function P(N){return N===62?(t.consume(N),C):N===45&&r===2?(t.consume(N),P):T(N)}function C(N){return N===null||Ze(N)?(t.exit("htmlFlowData"),H(N)):(t.consume(N),C)}function H(N){return t.exit("htmlFlow"),e(N)}}},UP={partial:!0,tokenize:function(t,e,n){return function(o){return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),t.attempt(Gl,e,n)}}},VP={partial:!0,tokenize:function(t,e,n){const o=this;return function(s){return Ze(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)}}},HP={name:"htmlText",tokenize:function(t,e,n){const o=this;let r,s,i;return function(C){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(C),a};function a(C){return C===33?(t.consume(C),l):C===47?(t.consume(C),v):C===63?(t.consume(C),x):co(C)?(t.consume(C),I):n(C)}function l(C){return C===45?(t.consume(C),c):C===91?(t.consume(C),s=0,p):co(C)?(t.consume(C),b):n(C)}function c(C){return C===45?(t.consume(C),f):n(C)}function d(C){return C===null?n(C):C===45?(t.consume(C),u):Ze(C)?(i=d,F(C)):(t.consume(C),d)}function u(C){return C===45?(t.consume(C),f):d(C)}function f(C){return C===62?z(C):C===45?u(C):d(C)}function p(C){return C==="CDATA[".charCodeAt(s++)?(t.consume(C),s===6?_:p):n(C)}function _(C){return C===null?n(C):C===93?(t.consume(C),g):Ze(C)?(i=_,F(C)):(t.consume(C),_)}function g(C){return C===93?(t.consume(C),m):_(C)}function m(C){return C===62?z(C):C===93?(t.consume(C),m):_(C)}function b(C){return C===null||C===62?z(C):Ze(C)?(i=b,F(C)):(t.consume(C),b)}function x(C){return C===null?n(C):C===63?(t.consume(C),y):Ze(C)?(i=x,F(C)):(t.consume(C),x)}function y(C){return C===62?z(C):x(C)}function v(C){return co(C)?(t.consume(C),S):n(C)}function S(C){return C===45||kn(C)?(t.consume(C),S):k(C)}function k(C){return Ze(C)?(i=k,F(C)):ht(C)?(t.consume(C),k):z(C)}function I(C){return C===45||kn(C)?(t.consume(C),I):C===47||C===62||_n(C)?j(C):n(C)}function j(C){return C===47?(t.consume(C),z):C===58||C===95||co(C)?(t.consume(C),E):Ze(C)?(i=j,F(C)):ht(C)?(t.consume(C),j):z(C)}function E(C){return C===45||C===46||C===58||C===95||kn(C)?(t.consume(C),E):T(C)}function T(C){return C===61?(t.consume(C),M):Ze(C)?(i=T,F(C)):ht(C)?(t.consume(C),T):j(C)}function M(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(t.consume(C),r=C,L):Ze(C)?(i=M,F(C)):ht(C)?(t.consume(C),M):(t.consume(C),B)}function L(C){return C===r?(t.consume(C),r=void 0,O):C===null?n(C):Ze(C)?(i=L,F(C)):(t.consume(C),L)}function B(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||_n(C)?j(C):(t.consume(C),B)}function O(C){return C===47||C===62||_n(C)?j(C):n(C)}function z(C){return C===62?(t.consume(C),t.exit("htmlTextData"),t.exit("htmlText"),e):n(C)}function F(C){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(C),t.exit("lineEnding"),V}function V(C){return ht(C)?bt(t,P,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):P(C)}function P(C){return t.enter("htmlTextData"),i(C)}}},Mf={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&&lo(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=Bn(s,t.slice(o+1,o+a+3)),s=Bn(s,[["enter",d,e]]),s=Bn(s,If(e.parser.constructs.insideSpan.null,t.slice(o+a+4,r-3),e)),s=Bn(s,[["exit",d,e],t[r-2],t[r-1],["exit",c,e]]),s=Bn(s,t.slice(r+1)),s=Bn(s,[["exit",l,e]]),lo(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(u){return r?r._inactive?d(u):(s=o.parser.defined.includes(ys(o.sliceSerialize({start:r.end,end:o.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(u),t.exit("labelMarker"),t.exit("labelEnd"),a):n(u)};function a(u){return u===40?t.attempt($P,c,s?c:d)(u):u===91?t.attempt(WP,c,s?l:d)(u):s?c(u):d(u)}function l(u){return t.attempt(qP,c,d)(u)}function c(u){return e(u)}function d(u){return r._balanced=!0,n(u)}}},$P={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 _n(d)?Yi(t,r)(d):r(d)}function r(d){return d===41?c(d):Ok(t,s,i,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return _n(d)?Yi(t,a)(d):c(d)}function i(d){return n(d)}function a(d){return d===34||d===39||d===40?Rk(t,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):c(d)}function l(d){return _n(d)?Yi(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)}}},WP={tokenize:function(t,e,n){const o=this;return function(i){return Dk.call(o,t,r,s,"reference","referenceMarker","referenceString")(i)};function r(i){return o.parser.defined.includes(ys(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)))?e(i):n(i)}function s(i){return n(i)}}},qP={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)}}},GP={name:"labelStartImage",resolveAll:Mf.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)}}},YP={name:"labelStartLink",resolveAll:Mf.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)}}},Of={name:"lineEnding",tokenize:function(t,e){return function(n){return t.enter("lineEnding"),t.consume(n),t.exit("lineEnding"),bt(t,e,"linePrefix")}}},Yl={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||Ze(a))?(t.exit("thematicBreak"),e(a)):n(a)}function i(a){return a===o?(t.consume(a),r++,i):(t.exit("thematicBreakSequence"),ht(a)?bt(t,s,"whitespace")(a):s(a))}}},bn={continuation:{tokenize:function(t,e,n){const o=this;return o.containerState._closeFlow=void 0,t.check(Gl,r,s);function r(a){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,bt(t,e,"listItemIndent",o.containerState.size+1)(a)}function s(a){return o.containerState.furtherBlankLines||!ht(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(KP,e,i)(a))}function i(a){return o.containerState._closeFlow=!0,o.interrupt=void 0,bt(t,t.attempt(bn,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 p=o.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!o.containerState.marker||f===o.containerState.marker:Ef(f)){if(o.containerState.type||(o.containerState.type=p,t.enter(p,{_container:!0})),p==="listUnordered")return t.enter("listItemPrefix"),f===42||f===45?t.check(Yl,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 Ef(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(Gl,o.interrupt?n:c,t.attempt(JP,u,d))}function c(f){return o.containerState.initialBlankLine=!0,s++,u(f)}function d(f){return ht(f)?(t.enter("listItemPrefixWhitespace"),t.consume(f),t.exit("listItemPrefixWhitespace"),u):n(f)}function u(f){return o.containerState.size=s+o.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(f)}}},JP={partial:!0,tokenize:function(t,e,n){const o=this;return bt(t,function(r){const s=o.events[o.events.length-1];return!ht(r)&&s&&s[1].type==="listItemPrefixWhitespace"?e(r):n(r)},"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},KP={partial:!0,tokenize:function(t,e,n){const o=this;return bt(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)}},Lk={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[o][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"),ht(a)?bt(t,i,"lineSuffix")(a):i(a))}function i(a){return a===null||Ze(a)?(t.exit("setextHeadingLine"),e(a)):n(a)}}},XP={tokenize:function(t){const e=this,n=t.attempt(Gl,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,bt(t,t.attempt(this.parser.constructs.flow,o,t.attempt(OP,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)}}},ZP={resolveAll:zk()},QP=Fk("string"),eL=Fk("text");function Fk(t){return{resolveAll:zk(t==="text"?tL: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 u=-1;if(d)for(;++u<d.length;){const f=d[u];if(!f.previous||f.previous.call(n,n.previous))return!0}return!1}}}}function zk(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 tL(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(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 nL={42:bn,43:bn,45:bn,48:bn,49:bn,50:bn,51:bn,52:bn,53:bn,54:bn,55:bn,56:bn,57:bn,62:jk},oL={91:RP},rL={[-2]:Tf,[-1]:Tf,32:Tf},sL={35:FP,42:Yl,45:[Lk,Yl],60:BP,61:Lk,95:Yl,96:Tk,126:Tk},iL={38:Ik,92:Ek},aL={[-5]:Of,[-4]:Of,[-3]:Of,33:GP,38:Ik,42:Af,60:[EP,HP],91:YP,92:[LP,Ek],93:Mf,95:Af,96:AP},lL={null:[Af,ZP]},cL=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:oL,disable:{null:[]},document:nL,flow:sL,flowInitial:rL,insideSpan:lL,string:iL,text:aL},Symbol.toStringTag,{value:"Module"}));function dL(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:m(function(y,v){b(y,v.from)}),check:m(g),consume:function(y){Ze(y)?(o.line++,o.column=1,o.offset+=y===-3?2:1,x()):y!==-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=y},enter:function(y,v){const S=v||{};return S.type=y,S.start=f(),c.events.push(["enter",S,c]),a.push(S),S},exit:function(y){const v=a.pop();return v.end=f(),c.events.push(["exit",v,c]),v},interrupt:m(g,{interrupt:!0})},c={code:null,containerState:{},defineSkip:function(y){r[y.line]=y.column,x()},events:[],now:f,parser:t,previous:null,sliceSerialize:function(y,v){return function(S,k){let I=-1;const j=[];let E;for(;++I<S.length;){const T=S[I];let M;if(typeof T=="string")M=T;else switch(T){case-5:M="\r";break;case-4:M=`
128
+ `).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 u of c)for(const f of d){const p=`${u}-${f}`;a.has(p)||(a.add(p),i.add(u),i.add(f),s.push(this.createEdge(u,f)))}}for(const[l,c]of $p.zip(t,e)){o||r.push(this.createNode(l,c));const d=i.has(l),u=dt.get(c).code.trim().startsWith("mo.md");!d&&u||r.push(this.createNode(l,c))}return{nodes:r,edges:s}}},ND=t=>{const e=X.c(43),{cellIds:n,variables:o,cellAtoms:r,children:s,layoutDirection:i,settings:a}=t;let l;e[0]!==r||e[1]!==n||e[2]!==i||e[3]!==a.hidePureMarkdown||e[4]!==o?(l=()=>{let C=y2.createElements(n,r,o,a.hidePureMarkdown);return C=b2(C.nodes,C.edges,{direction:i}),C},e[0]=r,e[1]=n,e[2]=i,e[3]=a.hidePureMarkdown,e[4]=o,e[5]=l):l=e[5];const[c]=A.useState(l),[d,u,f]=Xw(c.nodes),[p,_,g]=Zw(c.edges),m=Bi();let b;e[6]!==i||e[7]!==_||e[8]!==u?(b=C=>{const H=b2(C.nodes,C.edges,{direction:i});u(H.nodes),_(H.edges)},e[6]=i,e[7]=_,e[8]=u,e[9]=b):b=e[9];const x=et(b);let y,v;e[10]!==r||e[11]!==n||e[12]!==a.hidePureMarkdown||e[13]!==x||e[14]!==o?(y=()=>{x(y2.createElements(n,r,o,a.hidePureMarkdown))},v=[n,o,r,x,a.hidePureMarkdown],e[10]=r,e[11]=n,e[12]=a.hidePureMarkdown,e[13]=x,e[14]=o,e[15]=y,e[16]=v):(y=e[15],v=e[16]),A.useEffect(y,v);const[S,k]=A.useState();let I;sv(),e[17]===Symbol.for("react.memo_cache_sentinel")?(I=()=>{k(void 0)},e[17]=I):I=e[17];const j=I;let E,T,M,L,B,O,z,F,V,P;return e[18]===Symbol.for("react.memo_cache_sentinel")?(E={minZoom:.5,maxZoom:1.5},T=(C,H)=>{k({type:"node",id:H.id})},M=(C,H)=>{const{source:N,target:$}=H;k({type:"edge",source:N,target:$})},e[18]=E,e[19]=T,e[20]=M):(E=e[18],T=e[19],M=e[20]),e[21]===Symbol.for("react.memo_cache_sentinel")?(L=h.jsx(q9,{color:"#ccc",variant:Ln.Dots}),e[21]=L):L=e[21],e[22]!==m||e[23]!==d?(B=()=>{const C=dt.get(sV);if(C){const H=d.find(N=>N.id===C);H&&(m.fitView({padding:1,duration:600,nodes:[H]}),k({type:"node",id:C}))}},e[22]=m,e[23]=d,e[24]=B):B=e[24],e[25]===Symbol.for("react.memo_cache_sentinel")?(O=h.jsx(Cm,{className:"size-4"}),e[25]=O):O=e[25],e[26]!==B?(z=h.jsx(B9,{position:"bottom-right",showInteractive:!1,children:h.jsx(Le,{content:"Jump to focused cell",delayDuration:200,side:"left",asChild:!1,children:h.jsx(ms,{onMouseDown:Hn.preventFocus,onClick:B,children:O})})}),e[26]=B,e[27]=z):z=e[27],e[28]!==p||e[29]!==S||e[30]!==o?(F=h.jsx(Bl,{selection:S,variables:o,edges:p,onClearSelection:j}),e[28]=p,e[29]=S,e[30]=o,e[31]=F):F=e[31],e[32]!==s||e[33]!==p||e[34]!==d||e[35]!==g||e[36]!==f||e[37]!==z||e[38]!==F?(V=h.jsxs(bh,{nodes:d,edges:p,nodeTypes:ov,minZoom:.2,fitViewOptions:E,onNodeClick:T,onEdgeClick:M,onNodeDoubleClick:jD,fitView:!0,onNodesChange:f,onEdgesChange:g,zoomOnDoubleClick:!1,nodesConnectable:!1,children:[L,z,F,s]}),e[32]=s,e[33]=p,e[34]=d,e[35]=g,e[36]=f,e[37]=z,e[38]=F,e[39]=V):V=e[39],e[40]!==i||e[41]!==V?(P=h.jsx(tv.Provider,{value:i,children:V}),e[40]=i,e[41]=V,e[42]=P):P=e[42],P};function jD(t,e){B4(e.id,"focus")}const ED=Qt("_minimap_"),ID=Qt({hidePureMarkdown:!0}),AD=t=>{const e=X.c(11),[n,o]=fn(ED),[r,s]=fn(ID);let i;e[0]!==n||e[1]!==t||e[2]!==o||e[3]!==s||e[4]!==r?(i=()=>n==="_minimap_"?h.jsx(X9,{...t,children:h.jsx(wh,{settings:r,onSettingsChange:s,view:n,onChange:o})}):h.jsx(ND,{...t,settings:r,layoutDirection:n,children:h.jsx(wh,{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=h.jsx(_h,{children:l},n),e[8]=n,e[9]=l,e[10]=c):c=e[10],c},TD=()=>{const t=X.c(5),e=U4(),n=zc(),[o]=iV();let r,s;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=Oe("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=h.jsx("div",{className:r,children:h.jsx(AD,{cellAtoms:o,variables:e,cellIds:n.inOrderIds})}),t[1]=n.inOrderIds,t[2]=o,t[3]=e,t[4]=s):s=t[4],s},x2="name",w2="type-value",sf="defs-refs",MD=[{id:x2,accessorFn:t=>[t.name,t.declaredBy],enableSorting:!0,sortingFn:"alphanumeric",header:({column:t})=>h.jsx(Jp,{header:"Name",column:t}),cell:({getValue:t})=>{const[e,n]=t();return h.jsx(xh,{name:e,declaredBy:n})}},{id:w2,accessorFn:t=>[t.dataType,t.value],enableSorting:!0,sortingFn:"alphanumeric",header:({column:t})=>h.jsx(Jp,{header:h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsx("span",{children:"Type"}),h.jsx("span",{children:"Value"})]}),column:t}),cell:({getValue:t})=>{const[e,n]=t();return h.jsxs("div",{className:"max-w-[150px]",children:[h.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap text-muted-foreground font-mono text-xs",children:e}),h.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap",title:n??"",children:n})]})}},{id:sf,accessorFn:t=>[t.declaredBy,t.usedBy,t.name,t.declaredByNames,t.usedByNames],enableSorting:!0,sortingFn:"basic",header:({column:t})=>h.jsx(Jp,{header:h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsx("span",{children:"Declared By"}),h.jsx("span",{children:"Used By"})]}),column:t}),cell:({getValue:t})=>{const[e,n,o]=t(),r=s=>{const i=ic(s);i&&Wp(i,o)};return h.jsxs("div",{className:"flex flex-col gap-1 py-1",children:[h.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-center",children:[h.jsx("span",{title:"Declared by",children:h.jsx(Bm,{className:"w-3.5 h-3.5 text-muted-foreground"})}),e.length===1?h.jsx(pr,{variant:"focus",cellId:e[0],skipScroll:!0,onClick:()=>r(e[0])}):h.jsx("div",{className:"text-destructive flex flex-row gap-2",children:e.slice(0,3).map((s,i)=>h.jsxs("span",{className:"flex",children:[h.jsx(pr,{variant:"focus",cellId:s,skipScroll:!0,className:"whitespace-nowrap text-destructive",onClick:()=>r(s)},s),i<e.length-1&&", "]},s))})]}),h.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-baseline",children:[h.jsx("span",{title:"Used by",children:h.jsx(Ea,{className:"w-3.5 h-3.5 text-muted-foreground"})}),h.jsx(rv,{maxCount:3,cellIds:n,skipScroll:!0,onClick:r})]})]})}}],v2=A.memo(({className:t,cellIds:e,variables:n})=>{const[o,r]=K.useState([]),[s,i]=K.useState(""),a=aV(),l=A.useMemo(()=>{const u=f=>{const p=a[f];return hV(p)?`cell-${e.indexOf(f)}`:p??`cell-${e.indexOf(f)}`};return Object.values(n).map(f=>({...f,declaredByNames:f.declaredBy.map(u),usedByNames:f.usedBy.map(u)}))},[n,a,e]),c=A.useMemo(()=>{const u=new Map;return e.forEach((f,p)=>u.set(f,p)),function(f,p,_){p||(p={id:sf,desc:!1});let g=[];switch(p.id){case x2:g=wa(f,m=>m.name);break;case w2:g=wa(f,m=>m.dataType);break;case sf:g=wa(f,m=>_.get(m.declaredBy[0]))}return p.desc?g.reverse():g}(l,o[0],u)},[l,o,e]),d=lV({data:c,columns:MD,getCoreRowModel:uV(),onGlobalFilterChange:i,getFilteredRowModel:dV(),enableFilters:!0,enableGlobalFilter:!0,enableColumnPinning:!1,getColumnCanGlobalFilter:u=>u.columnDef.enableGlobalFilter??!0,globalFilterFn:"auto",manualSorting:!0,onSortingChange:r,getSortedRowModel:cV(),state:{sorting:o,globalFilter:s}});return h.jsxs(h.Fragment,{children:[h.jsx(V4,{className:"w-full",placeholder:"Search",value:s,onChange:u=>i(u.target.value)}),h.jsxs(qp,{className:Oe("w-full text-sm flex-1 border-separate border-spacing-0",t),children:[h.jsx(Gp,{children:h.jsx(Ks,{className:"whitespace-nowrap text-xs",children:d.getFlatHeaders().map(u=>h.jsx(Fr,{className:"sticky top-0 bg-background border-b",children:H4(u.column.columnDef.header,u.getContext())},u.id))})}),h.jsx(Yp,{children:d.getRowModel().rows.map(u=>h.jsx(Ks,{className:"hover:bg-accent",children:u.getVisibleCells().map(f=>h.jsx(zr,{className:"border-b",children:H4(f.column.columnDef.cell,f.getContext())},f.id))},u.id))})]})]})});v2.displayName="VariableTable";let k2,S2,C2;k2=()=>{const t=X.c(4),e=U4(),n=zc();if(Object.keys(e).length===0){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsx(An,{title:"No variables",description:"Global variables will appear here.",icon:h.jsx(fc,{})}),t[0]=r):r=t[0],r}let o;return t[1]!==n.inOrderIds||t[2]!==e?(o=h.jsx(v2,{className:"flex-1",cellIds:n.inOrderIds,variables:e}),t[1]=n.inOrderIds,t[2]=e,t[3]=o):o=t[3],o},nm=t=>{const e=X.c(6),n=t.dataTestId;let o,r;return e[0]!==t.className?(o=Oe("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=h.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},S2=()=>{const t=X.c(9),e=fV(),{clearLogs:n}=Lt();if(e.length===0){let i,a;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsx("code",{className:"border rounded px-1",children:"stdout"}),t[0]=i):i=t[0],t[1]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsx(An,{title:"No logs",description:h.jsxs("span",{children:[i," and"," ",h.jsx("code",{className:"border rounded px-1",children:"stderr"})," logs will appear here."]}),icon:h.jsx(fp,{})}),t[1]=a):a=t[1],a}let o,r,s;return t[2]!==n?(o=h.jsx("div",{className:"flex flex-row justify-end px-2 py-1",children:h.jsx(nm,{dataTestId:"clear-logs-button",onClick:n})}),t[2]=n,t[3]=o):o=t[3],t[4]!==e?(r=h.jsx("div",{className:"overflow-auto flex-1",children:h.jsx(C2,{logs:e,className:"min-w-[300px]"})}),t[4]=e,t[5]=r):r=t[5],t[6]!==o||t[7]!==r?(s=h.jsxs(h.Fragment,{children:[o,r]}),t[6]=o,t[7]=r,t[8]=s):s=t[8],s},C2=t=>{const e=X.c(10),{logs:n,className:o}=t;let r,s,i,a,l;return e[0]!==o?(r=Oe("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(RD),e[3]=n,e[4]=i):i=e[4],e[5]!==i?(a=h.jsx("pre",{className:"grid text-xs font-mono gap-1 whitespace-break-spaces font-semibold align-left",children:h.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=h.jsx("div",{className:r,children:a}),e[7]=r,e[8]=a,e[9]=l):l=e[9],l};function OD(t){const e=pV(t.timestamp),n=DD[t.level],o=t.level.toUpperCase();return h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"flex-shrink-0 text-[var(--gray-10)] dark:text-[var(--gray-11)]",children:["[",e,"]"]}),h.jsx("span",{className:Oe("flex-shrink-0",n),children:o}),h.jsxs("span",{className:"flex-shrink-0 text-[var(--gray-10)]",children:["(",h.jsx(pr,{cellId:t.cellId}),")"]}),t.message]})}const DD={stdout:"text-[var(--grass-9)]",stderr:"text-[var(--red-9)]"};function RD(t,e){return h.jsxs("div",{className:"contents group",children:[h.jsx("span",{className:Oe("opacity-70 group-hover:bg-[var(--gray-3)] group-hover:opacity-100","text-right col-span-1 py-1 pr-1"),children:e+1}),h.jsx("span",{className:Oe("opacity-70 group-hover:bg-[var(--gray-3)] group-hover:opacity-100","px-2 flex gap-x-1.5 py-1 flex-wrap"),children:OD(t)})]},e)}const PD=()=>{const t=X.c(5),{documentation:e}=We(mV);if(!e){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsx(An,{title:"View docs as you type",description:"Move your text cursor over a symbol to see its documentation.",icon:h.jsx(nd,{})}),t[0]=r):r=t[0],r}let n,o;return t[1]!==e?(n=Vp({html:e}),t[1]=e,t[2]=n):n=t[2],t[3]!==n?(o=h.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};function N2(t,e,n){return t[e]?t[e][0]?t[e][0][n]:t[e][n]:e==="contentBoxSize"?t.contentRect[n==="inlineSize"?"width":"height"]:void 0}om=function(t){t===void 0&&(t={});var e=t.onResize,n=A.useRef(void 0);n.current=e;var o=t.round||Math.round,r=A.useRef(),s=A.useState({width:void 0,height:void 0}),i=s[0],a=s[1],l=A.useRef(!1);A.useEffect(function(){return l.current=!1,function(){l.current=!0}},[]);var c=A.useRef({width:void 0,height:void 0}),d=function(u,f){var p=A.useRef(null),_=A.useRef(null);_.current=f;var g=A.useRef(null);A.useEffect(function(){m()});var m=A.useCallback(function(){var b=g.current,x=_.current,y=b||(x?x instanceof Element?x:x.current:null);p.current&&p.current.element===y&&p.current.subscriber===u||(p.current&&p.current.cleanup&&p.current.cleanup(),p.current={element:y,subscriber:u,cleanup:y?u(y):void 0})},[u]);return A.useEffect(function(){return function(){p.current&&p.current.cleanup&&(p.current.cleanup(),p.current=null)}},[]),A.useCallback(function(b){g.current=b,m()},[m])}(A.useCallback(function(u){return r.current&&r.current.box===t.box&&r.current.round===o||(r.current={box:t.box,round:o,instance:new ResizeObserver(function(f){var p=f[0],_=t.box==="border-box"?"borderBoxSize":t.box==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",g=N2(p,_,"inlineSize"),m=N2(p,_,"blockSize"),b=g?o(g):void 0,x=m?o(m):void 0;if(c.current.width!==b||c.current.height!==x){var y={width:b,height:x};c.current.width=b,c.current.height=x,n.current?n.current(y):l.current||a(y)}})}),r.current.instance.observe(u,{box:t.box}),function(){r.current&&r.current.instance.unobserve(u)}},[t.box,o]),t.ref);return A.useMemo(function(){return{ref:d,width:i.width,height:i.height}},[d,i.width,i.height])};const af=new Map,LD=({file:t,onOpenNotebook:e})=>{const{theme:n}=Fo(),o=We(cp),[r,s]=A.useState(""),{data:i,loading:a,error:l,setData:c}=$n(async()=>{const g=await $4({path:t.path}),m=g.contents||"";return s(af.get(t.path)||m),g},[t.path]),d=async()=>{r!==(i==null?void 0:i.contents)&&await vV({path:t.path,contents:r}).then(g=>{g.success&&(c(m=>m?{...m,contents:r}:void 0),s(r))})},u=A.useRef(r);if(u.current=r,A.useEffect(()=>()=>{if(!(i!=null&&i.contents))return;const g=u.current;g===i.contents?af.delete(t.path):af.set(t.path,g)},[t.path,i==null?void 0:i.contents]),l)return h.jsx(Xs,{error:l});if(a||!i)return null;const f=i.mimeType||"text/plain",p=f in lf;if(!i.contents&&!p)return h.jsxs("div",{className:"grid grid-cols-2 gap-2 p-6",children:[h.jsx("div",{className:"font-bold text-muted-foreground",children:"Name"}),h.jsx("div",{children:i.file.name}),h.jsx("div",{className:"font-bold text-muted-foreground",children:"Type"}),h.jsx("div",{children:f})]});const _=h.jsxs("div",{className:"text-xs text-muted-foreground p-1 flex justify-end gap-2 border-b",children:[t.isMarimoFile&&!Un()&&h.jsx(Le,{content:"Open notebook",children:h.jsx(xn,{size:"small",onClick:g=>e(g),children:h.jsx(xc,{})})}),h.jsx(Le,{content:"Download",children:h.jsx(xn,{size:"small",onClick:()=>{if(j2(f)){const g=xV(i.contents,f);wV(g,i.file.name)}else oa(new Blob([i.contents||r],{type:f}),i.file.name)},children:h.jsx(yp,{})})}),!j2(f)&&h.jsxs(h.Fragment,{children:[h.jsx(Le,{content:"Copy contents to clipboard",children:h.jsx(xn,{size:"small",onClick:async()=>{await yn(r)},children:h.jsx(Ls,{})})}),h.jsx(Le,{content:pn("global.save"),children:h.jsx(xn,{size:"small",color:r===i.contents?void 0:"green",onClick:d,disabled:r===i.contents,children:h.jsx(ja,{})})})]})]});return f.startsWith("image/")?h.jsxs(h.Fragment,{children:[_,h.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:h.jsx(gV,{base64:i.contents,mime:f})})]}):f==="text/csv"&&i.contents?h.jsxs(h.Fragment,{children:[_,h.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:h.jsx(_V,{contents:i.contents})})]}):f.startsWith("audio/")?h.jsxs(h.Fragment,{children:[_,h.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:h.jsx(bV,{base64:i.contents,mime:f})})]}):f.startsWith("video/")?h.jsxs(h.Fragment,{children:[_,h.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:h.jsx(yV,{base64:i.contents,mime:f})})]}):h.jsxs(h.Fragment,{children:[_,h.jsx("div",{className:"flex-1 overflow-auto",children:h.jsx(_a,{theme:n==="dark"?"dark":"light",language:lf[f]||lf.default,className:"border-b",extensions:[st.lineWrapping,Wn.of([{key:o.getHotkey("global.save").key,stopPropagation:!0,run:()=>r!==i.contents&&(d(),!0)}])],value:r,onChange:s})})]})},j2=t=>t.startsWith("image/")||t.startsWith("audio/")||t.startsWith("video/"),lf={"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"},E2=Qt(new class{constructor(t){this.callbacks=t,this.delegate=new Xp([]),this.rootPath="",this.onChange=En.NOOP,this.path=new mp("/"),this.initialize=async e=>{if(this.onChange=e,this.delegate.data.length===0)try{const n=await this.callbacks.listFiles({path:this.rootPath});this.delegate=new Xp(n.files),this.rootPath=n.root,this.path=mp.guessDeliminator(n.root)}catch(n){lt({title:"Failed",description:b4(n)})}this.onChange(this.delegate.data)},this.refreshAll=async e=>{const n=[this.rootPath,...e.map(r=>{var s;return(s=this.delegate.find(r))==null?void 0:s.data.path})].filter(Boolean),o=await Promise.all(n.map(r=>this.callbacks.listFiles({path:r}).catch(()=>({files:[]}))));for(const[r,s]of n.entries()){const i=o[r];s===this.rootPath?this.delegate=new Xp(i.files):this.delegate.update({id:s,changes:{children:i.files}})}this.onChange(this.delegate.data)},this.relativeFromRoot=e=>{const n=function(o){return o.endsWith("/")?o:`${o}/`}(this.rootPath);return e.startsWith(n)?e.slice(n.length):e},this.handleResponse=e=>e.success?e:(lt({title:"Failed",description:e.message}),null)}async expand(t){const e=this.delegate.find(t);if(!e||!e.data.isDirectory)return!1;if(e.children&&e.children.length>0)return!0;const n=await this.callbacks.listFiles({path:e.data.path});return this.delegate.update({id:t,changes:{children:n.files}}),this.onChange(this.delegate.data),!0}async rename(t,e){const n=this.delegate.find(t);if(!n)return;const o=n.data.path,r=this.path.join(this.path.dirname(o),e);await this.callbacks.renameFileOrFolder({path:o,newPath:r}).then(this.handleResponse),this.delegate.update({id:t,changes:{name:e,path:r}}),this.onChange(this.delegate.data),await this.refreshAll([r])}async move(t,e){var o;const n=e?((o=this.delegate.find(e))==null?void 0:o.data.path)??e:this.rootPath;await Promise.all(t.map(r=>{this.delegate.move({id:r,parentId:e,index:0});const s=this.delegate.find(r);if(!s)return Promise.resolve();const i=this.path.join(n,this.path.basename(s.data.path));return this.delegate.update({id:r,changes:{path:i}}),this.callbacks.renameFileOrFolder({path:s.data.path,newPath:i}).then(this.handleResponse)})),this.onChange(this.delegate.data),await this.refreshAll([n])}async createFile(t,e){var r;const n=e?((r=this.delegate.find(e))==null?void 0:r.data.path)??e:this.rootPath,o=await this.callbacks.createFileOrFolder({path:n,type:"file",name:t}).then(this.handleResponse);o!=null&&o.info&&(this.delegate.create({parentId:e,index:0,data:o.info}),this.onChange(this.delegate.data),await this.refreshAll([n]))}async createFolder(t,e){var r;const n=e?((r=this.delegate.find(e))==null?void 0:r.data.path)??e:this.rootPath,o=await this.callbacks.createFileOrFolder({path:n,type:"directory",name:t}).then(this.handleResponse);o!=null&&o.info&&(this.delegate.create({parentId:e,index:0,data:o.info}),this.onChange(this.delegate.data),await this.refreshAll([n]))}async delete(t){const e=this.delegate.find(t);e&&(await this.callbacks.deleteFileOrFolder({path:e.data.path}).then(this.handleResponse),this.delegate.drop({id:t}),this.onChange(this.delegate.data))}}({listFiles:Q3,createFileOrFolder:W4,deleteFileOrFolder:SV,renameFileOrFolder:kV})),FD=Qt({});function zD(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 I2(t){const e=X.c(4);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const o=n;let r;return e[2]!==o?(r={multiple:!0,maxSize:104857600,onError:$D,onDropRejected:UD,onDrop:BD,...o},e[2]=o,e[3]=r):r=e[3],CV(r)}async function BD(t){for(const e of t){const n=(await zD(e)).split(",")[1];await W4({path:"",type:"file",name:e.name,contents:n})}await async function(){await dt.get(E2).refreshAll([])}()}function UD(t){lt({title:"File upload failed",description:h.jsx("div",{className:"flex flex-col gap-1",children:t.map(VD)}),variant:"danger"})}function VD(t){return h.jsxs("div",{children:[t.file.name," (",t.errors.map(HD).join(", "),")"]},t.file.name)}function HD(t){return t.message}function $D(t){Zt.error(t),lt({title:"File upload failed",description:t.message,variant:"danger"})}const A2=K.createContext(null),WD=t=>{const e=X.c(60),{height:n}=t,o=A.useRef(null),[r]=fn(E2);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[0]=s):s=e[0];const[i,a]=A.useState(s),[l,c]=A.useState(null),{openPrompt:d}=Vn(),[u,f]=fn(FD);let p,_;e[1]!==r?(p=()=>r.initialize(a),e[1]=r,e[2]=p):p=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(_=[],e[3]=_):_=e[3];const{loading:g,error:m}=$n(p,_);let b;e[4]!==u||e[5]!==r?(b=()=>{r.refreshAll(Object.keys(u).filter(C=>u[C]))},e[4]=u,e[5]=r,e[6]=b):b=e[6];const x=et(b);let y;e[7]!==d||e[8]!==r?(y=async()=>{d({title:"Folder name",onConfirm:async C=>{r.createFolder(C,null)}})},e[7]=d,e[8]=r,e[9]=y):y=e[9];const v=et(y);let S;e[10]!==d||e[11]!==r?(S=async()=>{d({title:"File name",onConfirm:async C=>{r.createFile(C,null)}})},e[10]=d,e[11]=r,e[12]=S):S=e[12];const k=et(S);let I;e[13]!==f?(I=()=>{var C;(C=o.current)==null||C.closeAll(),f({})},e[13]=f,e[14]=I):I=e[14];const j=et(I);if(g){let C;return e[15]===Symbol.for("react.memo_cache_sentinel")?(C=h.jsx(eo,{size:"medium",centered:!0}),e[15]=C):C=e[15],C}if(m){let C;return e[16]!==m?(C=h.jsx(Xs,{error:m}),e[16]=m,e[17]=C):C=e[17],C}if(l){let C,H,N,$,Y,Z;return e[18]===Symbol.for("react.memo_cache_sentinel")?(C=()=>c(null),e[18]=C):C=e[18],e[19]===Symbol.for("react.memo_cache_sentinel")?(H=h.jsx(Pe,{onClick:C,"data-testid":"file-explorer-back-button",variant:"text",size:"xs",className:"mb-0",children:h.jsx(Et,{size:16})}),e[19]=H):H=e[19],e[20]!==l.name?(N=h.jsxs("div",{className:"flex items-center pl-1 pr-3 flex-shrink-0 border-b justify-between",children:[H,h.jsx("span",{className:"font-bold",children:l.name})]}),e[20]=l.name,e[21]=N):N=e[21],e[22]!==l.path||e[23]!==r?($=q=>T2(q,r.relativeFromRoot(l.path)),e[22]=l.path,e[23]=r,e[24]=$):$=e[24],e[25]!==l||e[26]!==$?(Y=h.jsx(A.Suspense,{children:h.jsx(LD,{onOpenNotebook:$,file:l})}),e[25]=l,e[26]=$,e[27]=Y):Y=e[27],e[28]!==N||e[29]!==Y?(Z=h.jsxs(h.Fragment,{children:[N,Y]}),e[28]=N,e[29]=Y,e[30]=Z):Z=e[30],Z}let E;e[31]!==j||e[32]!==k||e[33]!==v||e[34]!==x||e[35]!==r?(E=h.jsx(GD,{onRefresh:x,onCreateFile:k,onCreateFolder:v,onCollapseAll:j,tree:r}),e[31]=j,e[32]=k,e[33]=v,e[34]=x,e[35]=r,e[36]=E):E=e[36];const T=n-33;let M,L,B,O,z,F,V,P;return e[37]!==r?(M=async C=>{const{ids:H}=C;for(const N of H)await r.delete(N)},L=async C=>{const{id:H,name:N}=C;await r.rename(H,N)},B=async C=>{const{dragIds:H,parentId:N}=C;await r.move(H,N)},e[37]=r,e[38]=M,e[39]=L,e[40]=B):(M=e[38],L=e[39],B=e[40]),e[41]===Symbol.for("react.memo_cache_sentinel")?(O=C=>{const H=C[0];H&&(H.data.isDirectory||c(H.data))},e[41]=O):O=e[41],e[42]!==u||e[43]!==f||e[44]!==r?(z=async C=>{if(await r.expand(C)){const H=u[C]??!1;f({...u,[C]:!H})}},e[42]=u,e[43]=f,e[44]=r,e[45]=z):z=e[45],e[46]!==i||e[47]!==u||e[48]!==M||e[49]!==L||e[50]!==B||e[51]!==z||e[52]!==T?(F=h.jsx(IH,{width:"100%",ref:o,height:T,className:"h-full",data:i,initialOpenState:u,openByDefault:!1,renderCursor:ZD,disableDrop:QD,onDelete:M,onRename:L,onMove:B,onSelect:O,onToggle:z,padding:15,rowHeight:30,indent:qD,overscanCount:1e3,disableMultiSelection:!0,children:KD}),e[46]=i,e[47]=u,e[48]=M,e[49]=L,e[50]=B,e[51]=z,e[52]=T,e[53]=F):F=e[53],e[54]!==F||e[55]!==r?(V=h.jsx(A2.Provider,{value:r,children:F}),e[54]=F,e[55]=r,e[56]=V):V=e[56],e[57]!==V||e[58]!==E?(P=h.jsxs(h.Fragment,{children:[E,V]}),e[57]=V,e[58]=E,e[59]=P):P=e[59],P},qD=15,GD=t=>{const e=X.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}=I2(i);let c,d,u,f,p,_,g,m,b,x,y,v,S,k,I;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx(Ca,{size:16}),e[1]=c):c=e[1],e[2]!==o?(d=h.jsx(Le,{content:"Add file",children:h.jsx(Pe,{"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")?(u=h.jsx(Jc,{size:16}),e[4]=u):u=e[4],e[5]!==r?(f=h.jsx(Le,{content:"Add folder",children:h.jsx(Pe,{"data-testid":"file-explorer-add-folder-button",onClick:r,variant:"text",size:"xs",children:u})}),e[5]=r,e[6]=f):f=e[6],e[7]!==a?(p=a({}),e[7]=a,e[8]=p):p=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(_=NV({variant:"text",size:"xs"}),g=h.jsx(jV,{size:16}),e[9]=_,e[10]=g):(_=e[9],g=e[10]),e[11]!==p?(m=h.jsx(Le,{content:"Upload file",children:h.jsx("button",{"data-testid":"file-explorer-upload-button",...p,className:_,children:g})}),e[11]=p,e[12]=m):m=e[12],e[13]!==l?(b=l({}),e[13]=l,e[14]=b):b=e[14],e[15]!==b?(x=h.jsx("input",{...b,type:"file"}),e[15]=b,e[16]=x):x=e[16],e[17]===Symbol.for("react.memo_cache_sentinel")?(y=h.jsx(I4,{size:16}),e[17]=y):y=e[17],e[18]!==n?(v=h.jsx(Le,{content:"Refresh",children:h.jsx(Pe,{"data-testid":"file-explorer-refresh-button",onClick:n,variant:"text",size:"xs",children:y})}),e[18]=n,e[19]=v):v=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(S=h.jsx(um,{size:16}),e[20]=S):S=e[20],e[21]!==s?(k=h.jsx(Le,{content:"Collapse all folders",children:h.jsx(Pe,{"data-testid":"file-explorer-collapse-button",onClick:s,variant:"text",size:"xs",children:S})}),e[21]=s,e[22]=k):k=e[22],e[23]!==x||e[24]!==v||e[25]!==k||e[26]!==d||e[27]!==f||e[28]!==m?(I=h.jsxs("div",{className:"flex items-center justify-end px-2 flex-shrink-0 border-b",children:[d,f,m,x,v,k]}),e[23]=x,e[24]=v,e[25]=k,e[26]=d,e[27]=f,e[28]=m,e[29]=I):I=e[29],I},YD=t=>{const e=X.c(9),{node:n,onOpenMarimoFile:o}=t;let r,s,i;return e[0]!==n?(r=a=>{n.data.isDirectory||(a.stopPropagation(),n.select())},e[0]=n,e[1]=r):r=e[1],e[2]!==n.data.isMarimoFile||e[3]!==o?(s=n.data.isMarimoFile&&!Un()&&h.jsxs("span",{className:"flex-shrink-0 ml-2 text-sm hidden group-hover:inline hover:underline",onClick:o,children:["open ",h.jsx(xc,{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=h.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},JD=t=>{const e=X.c(10),{node:n}=t,o=A.useRef(null);let r,s,i,a,l;return e[0]!==n.data.name?(r=()=>{var c,d;(c=o.current)==null||c.focus(),(d=o.current)==null||d.setSelectionRange(0,n.data.name.lastIndexOf("."))},s=[n.data.name],e[0]=n.data.name,e[1]=r,e[2]=s):(r=e[1],s=e[2]),A.useEffect(r,s),e[3]!==n?(i=()=>n.reset(),a=c=>{c.key==="Escape"&&n.reset(),c.key==="Enter"&&n.submit(c.currentTarget.value)},e[3]=n,e[4]=i,e[5]=a):(i=e[4],a=e[5]),e[6]!==n.data.name||e[7]!==i||e[8]!==a?(l=h.jsx("input",{ref:o,className:"flex-1 bg-transparent border border-border text-muted-foreground",defaultValue:n.data.name,onClick:eR,onBlur:i,onKeyDown:a}),e[6]=n.data.name,e[7]=i,e[8]=a,e[9]=l):l=e[9],l},KD=t=>{const e=X.c(53),{node:n,style:o,dragHandle:r}=t;let s;e[0]!==n.data.isDirectory||e[1]!==n.data.name?(s=n.data.isDirectory?"directory":X3(n.data.name),e[0]=n.data.isDirectory,e[1]=n.data.name,e[2]=s):s=e[2];const i=s,a=Z3[i],{openConfirm:l,openPrompt:c}=Vn(),d=A.useContext(A2);let u;e[3]!==n.data.path||e[4]!==d?(u=async F=>{T2(F,d?d.relativeFromRoot(n.data.path):n.data.path)},e[3]=n.data.path,e[4]=d,e[5]=u):u=e[5];const f=u;let p;e[6]!==n.data.name||e[7]!==n.id||e[8]!==n.tree||e[9]!==l?(p=async F=>{F.stopPropagation(),F.preventDefault(),l({title:"Delete file",description:`Are you sure you want to delete ${n.data.name}?`,confirmAction:h.jsx(L3,{onClick:async()=>{await n.tree.delete(n.id)},"aria-label":"Confirm",children:"Delete"})})},e[6]=n.data.name,e[7]=n.id,e[8]=n.tree,e[9]=l,e[10]=p):p=e[10];const _=p;let g;e[11]!==n||e[12]!==c||e[13]!==d?(g=async()=>{n.open(),c({title:"Folder name",onConfirm:async F=>{d==null||d.createFolder(F,n.id)}})},e[11]=n,e[12]=c,e[13]=d,e[14]=g):g=e[14];const m=et(g);let b;e[15]!==n||e[16]!==c||e[17]!==d?(b=async()=>{n.open(),c({title:"File name",onConfirm:async F=>{d==null||d.createFile(F,n.id)}})},e[15]=n,e[16]=c,e[17]=d,e[18]=b):b=e[18];const x=et(b);let y;e[19]!==i||e[20]!==x||e[21]!==m||e[22]!==_||e[23]!==f||e[24]!==n||e[25]!==d?(y=()=>{const F={size:14,strokeWidth:1.5,className:"mr-2"};return h.jsxs(_c,{align:"end",className:"no-print w-[220px]",onClick:tR,onCloseAutoFocus:nR,children:[!n.data.isDirectory&&h.jsxs(sn,{onSelect:()=>n.select(),children:[h.jsx(Gm,{...F}),"Open file"]}),!n.data.isDirectory&&!Un()&&h.jsxs(sn,{onSelect:()=>{EV({path:n.data.path})},children:[h.jsx(xc,{...F}),"Open file in external editor"]}),n.data.isDirectory&&h.jsxs(h.Fragment,{children:[h.jsxs(sn,{onSelect:()=>x(),children:[h.jsx(Ca,{...F}),"Create file"]}),h.jsxs(sn,{onSelect:()=>m(),children:[h.jsx(Jc,{...F}),"Create folder"]}),h.jsx(zo,{})]}),h.jsxs(sn,{onSelect:()=>n.edit(),children:[h.jsx(Om,{...F}),"Rename"]}),h.jsxs(sn,{onSelect:async()=>{await yn(n.data.path),lt({title:"Copied to clipboard"})},children:[h.jsx(Ls,{...F}),"Copy path"]}),d&&h.jsxs(sn,{onSelect:async()=>{await yn(d.relativeFromRoot(n.data.path)),lt({title:"Copied to clipboard"})},children:[h.jsx(Ls,{...F}),"Copy relative path"]}),h.jsxs(sn,{onSelect:async()=>{lt({title:"Copied to clipboard",description:"Code to open the file has been copied to your clipboard. You can also drag and drop this file into the editor"});const{path:V}=n.data,P=AV[i](V);await yn(P)},children:[h.jsx(IV,{...F}),"Copy snippet for reading file"]}),n.data.isMarimoFile&&!Un()&&h.jsxs(h.Fragment,{children:[h.jsx(zo,{}),h.jsxs(sn,{onSelect:f,children:[h.jsx(Vm,{...F}),"Open notebook"]})]}),h.jsx(zo,{}),!n.data.isDirectory&&h.jsxs(h.Fragment,{children:[h.jsxs(sn,{onSelect:async()=>{const V=(await $4({path:n.data.path})).contents||"";oa(new Blob([V]),n.data.name)},children:[h.jsx(yp,{...F}),"Download"]}),h.jsx(zo,{})]}),h.jsxs(sn,{onSelect:_,variant:"danger",children:[h.jsx(lp,{...F}),"Delete"]})]})},e[19]=i,e[20]=x,e[21]=m,e[22]=_,e[23]=f,e[24]=n,e[25]=d,e[26]=y):y=e[26];const v=y;let S,k,I;e[27]===Symbol.for("react.memo_cache_sentinel")?(S=Oe("flex items-center cursor-pointer ml-1 text-muted-foreground whitespace-nowrap group"),e[27]=S):S=e[27],e[28]!==n?(k=F=>{F.stopPropagation(),n.data.isDirectory&&n.toggle()},I=h.jsx(XD,{node:n}),e[28]=n,e[29]=k,e[30]=I):(k=e[29],I=e[30]);const j=n.willReceiveDrop&&n.data.isDirectory&&"bg-accent/80 hover:bg-accent/80 text-accent-foreground";let E,T,M,L,B,O,z;return e[31]!==j?(E=Oe("flex items-center pl-1 py-1 cursor-pointer hover:bg-accent/50 hover:text-accent-foreground rounded-l flex-1 overflow-hidden group",j),e[31]=j,e[32]=E):E=e[32],e[33]!==a||e[34]!==n.data.isMarimoFile?(T=n.data.isMarimoFile?h.jsx("img",{src:"./favicon.ico",className:"w-5 h-5 flex-shrink-0 mr-2 filter grayscale",alt:"Marimo"}):h.jsx(a,{className:"w-5 h-5 flex-shrink-0 mr-2",strokeWidth:1.5}),e[33]=a,e[34]=n.data.isMarimoFile,e[35]=T):T=e[35],e[36]!==f||e[37]!==n?(M=n.isEditing?h.jsx(JD,{node:n}):h.jsx(YD,{node:n,onOpenMarimoFile:f}),e[36]=f,e[37]=n,e[38]=M):M=e[38],e[39]===Symbol.for("react.memo_cache_sentinel")?(L=h.jsx(gc,{asChild:!0,tabIndex:-1,onClick:oR,children:h.jsx(Pe,{"data-testid":"file-explorer-more-button",variant:"text",tabIndex:-1,size:"xs",className:"mb-0","aria-label":"More options",children:h.jsx(Yc,{strokeWidth:2,className:"w-5 h-5 hidden group-hover:block"})})}),e[39]=L):L=e[39],e[40]!==v?(B=h.jsxs(mc,{modal:!1,children:[L,v()]}),e[40]=v,e[41]=B):B=e[41],e[42]!==E||e[43]!==T||e[44]!==M||e[45]!==B?(O=h.jsxs("span",{className:E,children:[T,M,B]}),e[42]=E,e[43]=T,e[44]=M,e[45]=B,e[46]=O):O=e[46],e[47]!==r||e[48]!==o||e[49]!==O||e[50]!==k||e[51]!==I?(z=h.jsxs("div",{style:o,ref:r,className:S,draggable:!0,onClick:k,children:[I,O]}),e[47]=r,e[48]=o,e[49]=O,e[50]=k,e[51]=I,e[52]=z):z=e[52],z},XD=t=>{const e=X.c(3),{node:n}=t;if(!n.data.isDirectory){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsx("span",{className:"w-5 h-5 flex-shrink-0"}),e[0]=r):r=e[0],r}let o;return e[1]!==n.isOpen?(o=n.isOpen?h.jsx(Zi,{className:"w-5 h-5 flex-shrink-0"}):h.jsx(dc,{className:"w-5 h-5 flex-shrink-0"}),e[1]=n.isOpen,e[2]=o):o=e[2],o};function T2(t,e){t.stopPropagation(),t.preventDefault(),window.open(`/?file=${e}`,"_blank")}function ZD(){return null}function QD(t){const{parentNode:e}=t;return!e.data.isDirectory}function eR(t){return t.stopPropagation()}function tR(t){return t.stopPropagation()}function nR(t){return t.preventDefault()}function oR(t){return t.stopPropagation()}const rR=()=>{const t=X.c(20),{ref:e,height:n}=om(),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}=I2(r);let l,c,d,u,f,p,_,g;return t[1]!==s?(l=s(),t[1]=s,t[2]=l):l=t[2],t[3]===Symbol.for("react.memo_cache_sentinel")?(c=Oe("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?(u=h.jsx("input",{...d}),t[6]=d,t[7]=u):u=t[7],t[8]!==a?(f=a&&h.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?(p=h.jsx(WD,{height:o}),t[10]=o,t[11]=p):p=t[11],t[12]!==e||t[13]!==p?(_=h.jsx("div",{ref:e,className:"flex flex-col flex-1 overflow-hidden",children:p}),t[12]=e,t[13]=p,t[14]=_):_=t[14],t[15]!==l||t[16]!==u||t[17]!==f||t[18]!==_?(g=h.jsxs("div",{...l,className:c,children:[u,f,_]}),t[15]=l,t[16]=u,t[17]=f,t[18]=_,t[19]=g):g=t[19],g},sR=t=>{const e=X.c(6),{children:n}=t,{openModal:o,closeModal:r}=Vn();let s,i;return e[0]!==r||e[1]!==o?(s=()=>o(h.jsx(aR,{onClose:r})),e[0]=r,e[1]=o,e[2]=s):s=e[2],e[3]!==n||e[4]!==s?(i=h.jsx(F4,{onClick:s,children:n}),e[3]=n,e[4]=s,e[5]=i):i=e[5],i},iR=[st.lineWrapping],aR=t=>{const e=X.c(23),{onClose:n}=t,[o,r]=A.useState(""),{theme:s}=Fo();let i,a,l,c,d,u;e[0]!==n?(i=async y=>{y.preventDefault();const v=new FormData(y.target),S=v.get("title"),k=v.get("description"),I=v.get("code");fetch("https://marimo.io/api/suggest-snippet",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:S,description:k,code:I})}),n(),lt({title:"Snippet Submitted",description:"Thank you for contributing! We will review your snippet shortly."})},e[0]=n,e[1]=i):i=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsx(dr,{children:"Contribute a Snippet"}),e[2]=a):a=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(l=h.jsxs(Os,{children:[a,h.jsxs(Ps,{children:["Have a useful snippet you want to share with the community? Submit it here or make a pull request"," ",h.jsx("a",{href:Zn.githubPage,target:"_blank",className:"underline",children:"on GitHub"}),"."]})]}),e[3]=l):l=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx(ur,{id:"title",name:"title",autoFocus:!0,placeholder:"Title",required:!0,autoComplete:"off"}),d=h.jsx(TV,{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?(u=h.jsx("input",{type:"hidden",name:"code",value:o}),e[6]=o,e[7]=u):u=e[7];const f=s==="dark"?"dark":"light";let p,_,g,m,b,x;return e[8]!==o||e[9]!==f?(p=h.jsx(_a,{theme:f,language:"python",className:"cm border rounded overflow-hidden",extensions:iR,value:o,onChange:r}),e[8]=o,e[9]=f,e[10]=p):p=e[10],e[11]!==u||e[12]!==p?(_=h.jsxs("div",{className:"flex flex-col gap-6 py-4",children:[c,d,u,p]}),e[11]=u,e[12]=p,e[13]=_):_=e[13],e[14]!==n?(g=h.jsx(Pe,{"data-testid":"snippet-cancel-button",variant:"secondary",onClick:n,children:"Cancel"}),e[14]=n,e[15]=g):g=e[15],e[16]===Symbol.for("react.memo_cache_sentinel")?(m=h.jsx(Pe,{"data-testid":"snippet-send-button","aria-label":"Save",variant:"default",type:"submit",children:"Send"}),e[16]=m):m=e[16],e[17]!==g?(b=h.jsxs(ea,{children:[g,m]}),e[17]=g,e[18]=b):b=e[18],e[19]!==i||e[20]!==b||e[21]!==_?(x=h.jsx(cr,{className:"w-fit",children:h.jsxs("form",{onSubmit:i,children:[l,_,b]})}),e[19]=i,e[20]=b,e[21]=_,e[22]=x):x=e[22],x},lR=[st.lineWrapping],cR=()=>{const t=X.c(20),[e,n]=K.useState();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],t[0]=o):o=t[0];const{data:r,error:s,loading:i}=$n(hR,o);if(s){let b;return t[1]!==s?(b=h.jsx(Xs,{error:s}),t[1]=s,t[2]=b):b=t[2],b}if(i||!r){let b;return t[3]===Symbol.for("react.memo_cache_sentinel")?(b=h.jsx(eo,{size:"medium",centered:!0}),t[3]=b):b=t[3],b}const a=e?"h-1/3":"h-full";let l,c,d,u,f,p,_,g,m;return t[4]!==a?(l=Oe("border-b rounded-none",a),t[4]=a,t[5]=l):l=t[5],t[6]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx(Qi,{placeholder:"Search snippets...",className:"h-6 m-1",rootClassName:"flex-1 border-r"}),t[6]=c):c=t[6],t[7]===Symbol.for("react.memo_cache_sentinel")?(d=h.jsxs("div",{className:"flex items-center w-full",children:[c,h.jsx(sR,{children:h.jsx("button",{className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:h.jsx(Lr,{className:"h-4 w-4"})})})]}),u=h.jsx(hc,{children:"No results"}),t[7]=d,t[8]=u):(d=t[7],u=t[8]),t[9]===Symbol.for("react.memo_cache_sentinel")?(f=b=>n(b),t[9]=f):f=t[9],t[10]!==r.snippets?(p=h.jsx(uR,{onSelect:f,snippets:r.snippets}),t[10]=r.snippets,t[11]=p):p=t[11],t[12]!==l||t[13]!==p?(_=h.jsxs(vc,{className:l,children:[d,u,p]}),t[12]=l,t[13]=p,t[14]=_):_=t[14],t[15]!==e?(g=h.jsx(A.Suspense,{children:h.jsx("div",{className:"h-2/3 snippet-viewer flex flex-col",children:e?h.jsx(dR,{snippet:e},e.title):h.jsx(An,{title:"",description:"Click on a snippet to view its content."})})}),t[15]=e,t[16]=g):g=t[16],t[17]!==_||t[18]!==g?(m=h.jsxs("div",{className:"flex-1 overflow-hidden",children:[_,g]}),t[17]=_,t[18]=g,t[19]=m):m=t[19],m},dR=t=>{const e=X.c(27),{snippet:n}=t,{theme:o}=Fo(),{createNewCell:r}=Lt(),s=zs();let i;e[0]!==r||e[1]!==s||e[2]!==n.sections?(i=()=>{for(const m of[...n.sections].reverse())m.code&&r({code:m.code,before:!1,cellId:s??"__end__",skipIfCodeExists:!0})},e[0]=r,e[1]=s,e[2]=n.sections,e[3]=i):i=e[3];const a=i;let l;e[4]!==r||e[5]!==s?(l=m=>{r({code:m,before:!1,cellId:s??"__end__"})},e[4]=r,e[5]=s,e[6]=l):l=e[6];const c=l;let d,u,f,p,_,g;if(e[7]!==n.title?(d=h.jsx("div",{className:"text-sm font-semibold bg-muted border-y px-2 py-1",children:n.title}),e[7]=n.title,e[8]=d):d=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(u=h.jsx(ti,{className:"ml-2 h-4 w-4"}),e[9]=u):u=e[9],e[10]!==a?(f=h.jsx("div",{className:"flex justify-end",children:h.jsx(ri,{children:h.jsxs(Pe,{className:"float-right",size:"xs",variant:"outline",onClick:a,children:["Insert snippet",u]})})}),e[10]=a,e[11]=f):f=e[11],e[12]!==c||e[13]!==n.sections||e[14]!==n.title||e[15]!==o){let m;e[17]!==c||e[18]!==n.title||e[19]!==o?(m=b=>{const{code:x,html:y,id:v}=b;return y?h.jsx("div",{children:Vp({html:y})},`${n.title}-${v}`):x?h.jsxs("div",{className:"relative hover-actions-parent pr-2",children:[h.jsx(ri,{children:h.jsx(Le,{content:"Insert snippet",children:h.jsx(Pe,{className:"absolute -top-2 -right-1 z-10 hover-action px-2 bg-background",size:"sm",variant:"outline",onClick:()=>{c(x)},children:h.jsx(ti,{className:"h-5 w-5"})})})}),h.jsx(_a,{theme:o==="dark"?"dark":"light",language:"python",className:"cm border rounded overflow-hidden",extensions:lR,value:x,readOnly:!0},`${n.title}-${v}`)]},`${n.title}-${v}`):null},e[17]=c,e[18]=n.title,e[19]=o,e[20]=m):m=e[20],p=n.sections.map(m),e[12]=c,e[13]=n.sections,e[14]=n.title,e[15]=o,e[16]=p}else p=e[16];return e[21]!==f||e[22]!==p?(_=h.jsxs("div",{className:"px-2 py-2 space-y-4 overflow-auto flex-1",children:[f,p]}),e[21]=f,e[22]=p,e[23]=_):_=e[23],e[24]!==d||e[25]!==_?(g=h.jsxs(h.Fragment,{children:[d,_]}),e[24]=d,e[25]=_,e[26]=g):g=e[26],g},uR=t=>{const e=X.c(7),{snippets:n,onSelect:o}=t;let r,s;if(e[0]!==o||e[1]!==n){let i;e[3]!==o?(i=a=>h.jsx(po,{className:"rounded-none",onSelect:()=>o(a),children:h.jsx("div",{className:"flex flex-row gap-2 items-center",children:h.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=h.jsx(Tp,{className:"flex flex-col overflow-auto",children:r}),e[5]=r,e[6]=s):s=e[6],s};function hR(){return MV()}const fR=t=>{const e=X.c(8),{variableName:n,className:o}=t;let r;e[0]!==n?(r=()=>{const l=function(d){const u=dt.get(q4)[d];if(u)return u.declaredBy[0]}(n);if(!l)return;const c=ic(l);c&&Wp(c,n)},e[0]=n,e[1]=r):r=e[1];const s=r;let i,a;return e[2]!==o?(i=Oe("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=h.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},pR=Qt(t=>{const e=t(OV),n=t(q4),o=t(P4);return wa(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})}),mR=Qt(t=>{const e=new Map(t(DV));for(const n of G4){const o=e.get(n);o&&o.databases.length===0&&e.delete(n)}return wa([...e.values()],n=>G4.has(n.name)?1:0)}),gR=()=>{const t=X.c(32),[e,n]=K.useState(""),o=en(Y4),r=We(pR),s=We(mR);if(r.length===0&&s.length===0){let b;return t[0]===Symbol.for("react.memo_cache_sentinel")?(b=h.jsx(An,{title:"No tables found",description:"Any datasets/dataframes in the global scope will be shown here.",action:h.jsx(jg,{children:h.jsxs(Pe,{variant:"outline",size:"sm",children:["Add database or catalog",h.jsx(Lr,{className:"h-4 w-4 ml-2"})]})}),icon:h.jsx(lr,{})}),t[0]=b):b=t[0],b}const i=!!e.trim();let a,l,c,d,u,f,p,_,g,m;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=h.jsx(Qi,{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&&h.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:h.jsx(go,{className:"h-4 w-4"})}),t[6]=i,t[7]=c):c=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(d=h.jsx(jg,{children:h.jsx("button",{type:"button",className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:h.jsx(Lr,{className:"h-4 w-4"})})}),t[8]=d):d=t[8],t[9]!==l||t[10]!==c?(u=h.jsxs("div",{className:"flex items-center w-full",children:[l,c,d]}),t[9]=l,t[10]=c,t[11]=u):u=t[11],t[12]!==s||t[13]!==i||t[14]!==e){let b;t[16]!==i||t[17]!==e?(b=x=>h.jsx(_R,{connection:x,hasChildren:x.databases.length>0,children:x.databases.map(y=>h.jsx(bR,{engineName:x.name,database:y,hasSearch:i,children:h.jsx(yR,{schemas:y.schemas,defaultSchema:x.default_schema,defaultDatabase:x.default_database,engineName:x.name,databaseName:y.name,hasSearch:i,searchValue:e})},y.name))},x.name),t[16]=i,t[17]=e,t[18]=b):b=t[18],f=s.map(b),t[12]=s,t[13]=i,t[14]=e,t[15]=f}else f=t[15];return t[19]!==s.length||t[20]!==r.length?(p=s.length>0&&r.length>0&&h.jsxs(J4,{children:[h.jsx(cc,{className:"h-4 w-4 text-muted-foreground"}),h.jsx("span",{className:"text-xs",children:"Python"})]}),t[19]=s.length,t[20]=r.length,t[21]=p):p=t[21],t[22]!==e||t[23]!==r?(_=r.length>0&&h.jsx(M2,{tables:r,searchValue:e}),t[22]=e,t[23]=r,t[24]=_):_=t[24],t[25]!==f||t[26]!==p||t[27]!==_?(g=h.jsxs(Tp,{className:"flex flex-col",children:[f,p,_]}),t[25]=f,t[26]=p,t[27]=_,t[28]=g):g=t[28],t[29]!==u||t[30]!==g?(m=h.jsxs(vc,{className:"border-b bg-background rounded-none h-full pb-10 overflow-auto outline-none",shouldFilter:!1,children:[u,g]}),t[29]=u,t[30]=g,t[31]=m):m=t[31],m},_R=t=>{const e=X.c(25),{connection:n,children:o,hasChildren:r}=t,s=n.name===RV,i=s?"In-Memory":n.name,[a,l]=K.useState(!1);let c;e[0]!==n.name?(c=async()=>{l(!0),await LV({engine:n.name}),setTimeout(()=>l(!1),500)},e[0]=n.name,e[1]=c):c=e[1];const d=c;let u,f,p;e[2]!==n.dialect?(u=h.jsx(W3,{className:"h-4 w-4 text-muted-foreground",name:n.dialect}),e[2]=n.dialect,e[3]=u):u=e[3],e[4]!==n.dialect?(f=PV(n.dialect),e[4]=n.dialect,e[5]=f):f=e[5],e[6]!==f?(p=h.jsx("span",{className:"text-xs",children:f}),e[6]=f,e[7]=p):p=e[7];const _=i;let g,m,b,x,y;return e[8]!==_?(g=h.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",h.jsx(fR,{variableName:_}),")"]}),e[8]=_,e[9]=g):g=e[9],e[10]!==d||e[11]!==s||e[12]!==a?(m=!s&&h.jsx(Le,{content:"Refresh connection",children:h.jsx(Pe,{variant:"ghost",size:"icon",className:"ml-auto hover:bg-transparent hover:shadow-none",onClick:d,children:h.jsx(Ac,{className:Oe("h-4 w-4 text-muted-foreground hover:text-foreground",a&&"animate-[spin_0.5s]")})})}),e[10]=d,e[11]=s,e[12]=a,e[13]=m):m=e[13],e[14]!==u||e[15]!==p||e[16]!==g||e[17]!==m?(b=h.jsxs(J4,{children:[u,p,g,m]}),e[14]=u,e[15]=p,e[16]=g,e[17]=m,e[18]=b):b=e[18],e[19]!==o||e[20]!==r?(x=r?o:h.jsx(Bc,{content:"No databases available",className:"pl-2"}),e[19]=o,e[20]=r,e[21]=x):x=e[21],e[22]!==b||e[23]!==x?(y=h.jsxs(h.Fragment,{children:[b,x]}),e[22]=b,e[23]=x,e[24]=y):y=e[24],y},bR=t=>{const e=X.c(28),{hasSearch:n,engineName:o,database:r,children:s}=t,[i,a]=K.useState(!1),[l,c]=K.useState(!1);let d,u,f;e[0]!==n?(d=()=>{a(n)},u=[n],e[0]=n,e[1]=d,e[2]=u):(d=e[1],u=e[2]),K.useEffect(d,u),e[3]!==i||e[4]!==l?(f=()=>{a(!i),c(!l)},e[3]=i,e[4]=l,e[5]=f):f=e[5];const p=`${o}:${r.name}`;let _;e[6]!==i?(_=h.jsx(eS,{isExpanded:i}),e[6]=i,e[7]=_):_=e[7];const g=l&&i?"text-foreground":"text-muted-foreground";let m,b;e[8]!==g?(m=Oe("h-4 w-4",g),e[8]=g,e[9]=m):m=e[9],e[10]!==m?(b=h.jsx(lr,{className:m}),e[10]=m,e[11]=b):b=e[11];const x=l&&i&&"font-semibold";let y,v,S,k;e[12]!==x?(y=Oe(x),e[12]=x,e[13]=y):y=e[13],e[14]!==r.name?(v=r.name===""?h.jsx("i",{children:"Not connected"}):r.name,e[14]=r.name,e[15]=v):v=e[15],e[16]!==y||e[17]!==v?(S=h.jsx("span",{className:y,children:v}),e[16]=y,e[17]=v,e[18]=S):S=e[18],e[19]!==S||e[20]!==f||e[21]!==p||e[22]!==_||e[23]!==b?(k=h.jsxs(po,{className:"text-sm flex flex-row gap-1 items-center cursor-pointer rounded-none",onSelect:f,value:p,children:[_,b,S]}),e[19]=S,e[20]=f,e[21]=p,e[22]=_,e[23]=b,e[24]=k):k=e[24];const I=i&&s;let j;return e[25]!==k||e[26]!==I?(j=h.jsxs(h.Fragment,{children:[k,I]}),e[25]=k,e[26]=I,e[27]=j):j=e[27],j},yR=t=>{const e=X.c(20),{schemas:n,defaultSchema:o,defaultDatabase:r,engineName:s,databaseName:i,hasSearch:a,searchValue:l}=t;if(n.length===0){let u;return e[0]===Symbol.for("react.memo_cache_sentinel")?(u=h.jsx(Bc,{content:"No schemas available",className:"pl-6"}),e[0]=u):u=e[0],u}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 u;e[9]!==l?(u=_=>!l||_.tables.some(g=>g.name.toLowerCase().includes(l.toLowerCase())),e[9]=l,e[10]=u):u=e[10];const f=n.filter(u);let p;e[11]!==i||e[12]!==r||e[13]!==o||e[14]!==s||e[15]!==a||e[16]!==l?(p=_=>h.jsx(xR,{databaseName:i,schema:_,hasSearch:a,children:h.jsx(M2,{tables:_.tables,searchValue:l,sqlTableContext:{engine:s,database:i,schema:_.name,defaultSchema:o,defaultDatabase:r}})},_.name),e[11]=i,e[12]=r,e[13]=o,e[14]=s,e[15]=a,e[16]=l,e[17]=p):p=e[17],c=f.map(p),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=h.jsx(h.Fragment,{children:c}),e[18]=c,e[19]=d):d=e[19],d},xR=t=>{const e=X.c(26),{databaseName:n,schema:o,children:r,hasSearch:s}=t,[i,a]=K.useState(!1),[l,c]=K.useState(!1),d=`${n}:${o.name}`;let u,f,p,_;if(e[0]!==s?(u=()=>{a(s)},f=[s],e[0]=s,e[1]=u,e[2]=f):(u=e[1],f=e[2]),K.useEffect(u,f),Q4(o.name))return r;e[3]!==i||e[4]!==l?(p=()=>{a(!i),c(!l)},e[3]=i,e[4]=l,e[5]=p):p=e[5],e[6]!==i?(_=h.jsx(eS,{isExpanded:i}),e[6]=i,e[7]=_):_=e[7];const g=l&&i&&"text-foreground";let m,b;e[8]!==g?(m=Oe("h-4 w-4 text-muted-foreground",g),e[8]=g,e[9]=m):m=e[9],e[10]!==m?(b=h.jsx($V,{className:m}),e[10]=m,e[11]=b):b=e[11];const x=l&&i&&"font-semibold";let y,v,S;e[12]!==x?(y=Oe(x),e[12]=x,e[13]=y):y=e[13],e[14]!==o.name||e[15]!==y?(v=h.jsx("span",{className:y,children:o.name}),e[14]=o.name,e[15]=y,e[16]=v):v=e[16],e[17]!==v||e[18]!==p||e[19]!==_||e[20]!==b||e[21]!==d?(S=h.jsxs(po,{className:"text-sm flex flex-row gap-1 items-center pl-5 cursor-pointer rounded-none",onSelect:p,value:d,children:[_,b,v]}),e[17]=v,e[18]=p,e[19]=_,e[20]=b,e[21]=d,e[22]=S):S=e[22];const k=i&&r;let I;return e[23]!==S||e[24]!==k?(I=h.jsxs(h.Fragment,{children:[S,k]}),e[23]=S,e[24]=k,e[25]=I):I=e[25],I},M2=t=>{const e=X.c(24),{tables:n,sqlTableContext:o,searchValue:r}=t,{addTableList:s}=K4(),[i,a]=K.useState(!1),[l,c]=K.useState(!1);let d,u;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:m,database:b,schema:x}=o,y=await XH.request({engine:m,database:b,schema:x});if(!(y!=null&&y.tables))throw c(!1),new Error("No tables available");s({tables:y.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?(u=[n.length,o,i],e[5]=o,e[6]=n.length,e[7]=i,e[8]=u):u=e[8];const{loading:f,error:p}=$n(d,u);if(f||l){let m;return e[9]===Symbol.for("react.memo_cache_sentinel")?(m=h.jsx(X4,{message:"Loading tables...",className:"pl-12"}),e[9]=m):m=e[9],m}if(p){let m;return e[10]!==p?(m=h.jsx(Z4,{error:p,className:"pl-12"}),e[10]=p,e[11]=m):m=e[11],m}if(n.length===0){let m;return e[12]===Symbol.for("react.memo_cache_sentinel")?(m=h.jsx(Bc,{content:"No tables found",className:"pl-9"}),e[12]=m):m=e[12],m}let _,g;if(e[13]!==r||e[14]!==o||e[15]!==n){let m;e[17]!==r?(m=y=>!r||y.name.toLowerCase().includes(r.toLowerCase()),e[17]=r,e[18]=m):m=e[18];const b=n.filter(m);let x;e[19]!==r||e[20]!==o?(x=y=>h.jsx(wR,{table:y,sqlTableContext:o,isSearching:!!r},y.name),e[19]=r,e[20]=o,e[21]=x):x=e[21],_=b.map(x),e[13]=r,e[14]=o,e[15]=n,e[16]=_}else _=e[16];return e[22]!==_?(g=h.jsx(h.Fragment,{children:_}),e[22]=_,e[23]=g):g=e[23],g},wR=t=>{const e=X.c(62),{table:n,sqlTableContext:o,isSearching:r}=t,{addTable:s}=K4(),[i,a]=K.useState(!1),[l,c]=K.useState(!1),d=n.columns.length>0;let u,f;e[0]!==s||e[1]!==i||e[2]!==o||e[3]!==n.name||e[4]!==d||e[5]!==l?(u=async()=>{if(i&&!d&&o&&!l){c(!0);const{engine:q,database:re,schema:ne}=o,oe=await ZH.request({engine:q,database:re,schema:ne,tableName:n.name});if(!(oe!=null&&oe.table))throw new Error("No table details available");s({table:oe.table,sqlTableContext:o})}},e[0]=s,e[1]=i,e[2]=o,e[3]=n.name,e[4]=d,e[5]=l,e[6]=u):u=e[6],e[7]!==i||e[8]!==d?(f=[i,d],e[7]=i,e[8]=d,e[9]=f):f=e[9];const{loading:p,error:_}=$n(u,f),g=We(Ts),m=zs(),{createNewCell:b}=Lt();let x;e[10]!==g||e[11]!==b||e[12]!==m||e[13]!==o||e[14]!==n?(x=()=>{ar(g,b,m),b({code:(()=>{if(n.source_type==="catalog"){const q=o!=null&&o.database?`${o.database}.${n.name}`:n.name;return`${n.engine}.load_table("${q}")`}if(o)return tS(n,"*",o);switch(n.source_type){case"local":return`mo.ui.table(${n.name})`;case"duckdb":case"connection":return tS(n,"*",o);default:return rc(n.source_type),""}})(),before:!1,cellId:m??"__end__"})},e[10]=g,e[11]=b,e[12]=m,e[13]=o,e[14]=n,e[15]=x):x=e[15];const y=x;let v;e[16]!==n.num_columns||e[17]!==n.num_rows?(v=()=>{const q=[];return n.num_rows!=null&&q.push(`${n.num_rows} rows`),n.num_columns!=null&&q.push(`${n.num_columns} columns`),q.length===0?null:h.jsx("div",{className:"flex flex-row gap-2 items-center pl-6 group-hover:hidden",children:h.jsx("span",{className:"text-xs text-muted-foreground",children:q.join(", ")})})},e[16]=n.num_columns,e[17]=n.num_rows,e[18]=v):v=e[18];const S=v;let k;e[19]!==_||e[20]!==p||e[21]!==o||e[22]!==n?(k=()=>{if(p)return h.jsx(X4,{message:"Loading columns...",className:"pl-12"});if(_)return h.jsx(Z4,{error:_,className:"pl-12"});const q=n.columns;return q.length===0?h.jsx(Bc,{content:"No columns found",className:"pl-12"}):q.map(re=>h.jsx(vR,{table:n,column:re,sqlTableContext:o},re.name))},e[19]=_,e[20]=p,e[21]=o,e[22]=n,e[23]=k):k=e[23];const I=k;let j;e[24]!==i||e[25]!==r||e[26]!==n.source_type||e[27]!==n.type?(j=()=>{if(n.source_type==="local")return;const q=n.type==="table"?FV:A3;return h.jsx(q,{className:"h-3 w-3",strokeWidth:i||r?2.5:void 0})},e[24]=i,e[25]=r,e[26]=n.source_type,e[27]=n.type,e[28]=j):j=e[28];const E=j,T=o?`${o.database}.${o.schema}.${n.name}`:n.name,M=o&&(Q4(o.schema)?"pl-9":"pl-12"),L=(i||r)&&"font-semibold";let B,O,z,F,V,P,C,H,N,$,Y,Z;return e[29]!==M||e[30]!==L?(B=Oe("rounded-none group h-8 cursor-pointer",M,L),e[29]=M,e[30]=L,e[31]=B):B=e[31],e[32]!==i?(O=()=>a(!i),e[32]=i,e[33]=O):O=e[33],e[34]!==E?(z=E(),e[34]=E,e[35]=z):z=e[35],e[36]!==n.name?(F=h.jsx("span",{className:"text-sm",children:n.name}),e[36]=n.name,e[37]=F):F=e[37],e[38]!==z||e[39]!==F?(V=h.jsxs("div",{className:"flex gap-2 items-center flex-1",children:[z,F]}),e[38]=z,e[39]=F,e[40]=V):V=e[40],e[41]!==S?(P=S(),e[41]=S,e[42]=P):P=e[42],e[43]!==y?(C=Hn.stopPropagation(()=>y()),e[43]=y,e[44]=C):C=e[44],e[45]===Symbol.for("react.memo_cache_sentinel")?(H=h.jsx(zV,{className:"h-3 w-3"}),e[45]=H):H=e[45],e[46]!==C?(N=h.jsx(Le,{content:"Add table to notebook",delayDuration:400,children:h.jsx(Pe,{className:"group-hover:inline-flex hidden",variant:"text",size:"icon",onClick:C,children:H})}),e[46]=C,e[47]=N):N=e[47],e[48]!==i||e[49]!==O||e[50]!==V||e[51]!==P||e[52]!==N||e[53]!==B||e[54]!==T?($=h.jsxs(po,{className:B,value:T,"aria-selected":i,forceMount:!0,onSelect:O,children:[V,P,N]}),e[48]=i,e[49]=O,e[50]=V,e[51]=P,e[52]=N,e[53]=B,e[54]=T,e[55]=$):$=e[55],e[56]!==i||e[57]!==I?(Y=i&&I(),e[56]=i,e[57]=I,e[58]=Y):Y=e[58],e[59]!==$||e[60]!==Y?(Z=h.jsxs(h.Fragment,{children:[$,Y]}),e[59]=$,e[60]=Y,e[61]=Z):Z=e[61],Z},vR=t=>{var Y,Z;const e=X.c(53),{table:n,column:o,sqlTableContext:r}=t,[s,i]=K.useState(!1),a=We(Y4),l=en(BV);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]),K.useEffect(c,d),l(s?q=>new Set([...q,`${n.name}:${o.name}`]):q=>(q.delete(`${n.name}:${o.name}`),new Set(q)));const u=We(Ts),f=zs(),{createNewCell:p}=Lt(),{columnsPreviews:_}=UV();let g;e[3]!==o.name||e[4]!==n.primary_keys?(g=((Y=n.primary_keys)==null?void 0:Y.includes(o.name))||!1,e[3]=o.name,e[4]=n.primary_keys,e[5]=g):g=e[5];const m=g;let b;e[6]!==o.name||e[7]!==n.indexes?(b=((Z=n.indexes)==null?void 0:Z.includes(o.name))||!1,e[6]=o.name,e[7]=n.indexes,e[8]=b):b=e[8];const x=b;let y;e[9]!==u||e[10]!==p||e[11]!==f?(y=q=>{q.includes("alt")&&WV(u,p,f),p({code:q,before:!1,cellId:f??"__end__"})},e[9]=u,e[10]=p,e[11]=f,e[12]=y):y=e[12];const v=y,S=kR,k=s?"font-semibold":"";let I;e[13]!==o.name||e[14]!==k?(I=h.jsx("span",{className:k,children:o.name}),e[13]=o.name,e[14]=k,e[15]=I):I=e[15];const j=I,E=`${n.name}.${o.name}`,T=`${n.name}.${o.name}`;let M;e[16]!==s?(M=()=>i(!s),e[16]=s,e[17]=M):M=e[17];const L=r?"pl-14":"pl-7";let B,O,z,F,V,P,C,H,N,$;return e[18]!==L?(B=Oe("flex flex-row gap-2 items-center flex-1",L),e[18]=L,e[19]=B):B=e[19],e[20]!==o.type||e[21]!==j?(O=h.jsx(VV,{columnName:j,dataType:o.type}),e[20]=o.type,e[21]=j,e[22]=O):O=e[22],e[23]!==m?(z=m&&S({tooltipContent:"Primary key",content:"PK"}),e[23]=m,e[24]=z):z=e[24],e[25]!==x?(F=x&&S({tooltipContent:"Indexed",content:"IDX"}),e[25]=x,e[26]=F):F=e[26],e[27]!==B||e[28]!==O||e[29]!==z||e[30]!==F?(V=h.jsxs("div",{className:B,children:[O,z,F]}),e[27]=B,e[28]=O,e[29]=z,e[30]=F,e[31]=V):V=e[31],e[32]!==o.name?(P=h.jsx(Le,{content:"Copy column name",delayDuration:400,children:h.jsx(Pe,{variant:"text",size:"icon",className:"group-hover:opacity-100 opacity-0 hover:bg-muted text-muted-foreground hover:text-foreground",children:h.jsx(nS,{tooltip:!1,value:o.name,className:"h-3 w-3"})})}),e[32]=o.name,e[33]=P):P=e[33],e[34]!==o.external_type?(C=h.jsx("span",{className:"text-xs text-muted-foreground",children:o.external_type}),e[34]=o.external_type,e[35]=C):C=e[35],e[36]!==M||e[37]!==V||e[38]!==P||e[39]!==C||e[40]!==E||e[41]!==T?(H=h.jsxs(po,{className:"rounded-none py-1 group cursor-pointer",value:T,onSelect:M,children:[V,P,C]},E),e[36]=M,e[37]=V,e[38]=P,e[39]=C,e[40]=E,e[41]=T,e[42]=H):H=e[42],e[43]!==o||e[44]!==_||e[45]!==v||e[46]!==s||e[47]!==r||e[48]!==n?(N=s&&h.jsx("div",{className:"pl-10 pr-2 py-2 bg-[var(--slate-1)] shadow-inner border-b",children:h.jsx(kc,{children:h.jsx(HV,{table:n,column:o,onAddColumnChart:v,preview:_.get(r?`${r.database}.${r.schema}.${n.name}:${o.name}`:`${n.name}:${o.name}`),sqlTableContext:r})})}),e[43]=o,e[44]=_,e[45]=v,e[46]=s,e[47]=r,e[48]=n,e[49]=N):N=e[49],e[50]!==H||e[51]!==N?($=h.jsxs(h.Fragment,{children:[H,N]}),e[50]=H,e[51]=N,e[52]=$):$=e[52],$};function kR(t){const{tooltipContent:e,content:n}=t;return h.jsx(Le,{content:e,delayDuration:100,children:h.jsx("span",{className:"text-xs text-black bg-gray-100 dark:invert rounded px-1",children:n})})}const SR=()=>{const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=h.jsx(gR,{}),t[0]=e):e=t[0],e},CR=t=>{const e=X.c(4),{isOpen:n,children:o}=t,[r,s]=K.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]),K.useEffect(i,a),r?o:null},cf=E3("marimo:scratchpadHistory:v1",[]),NR=Qt(!1),jR=Qt(null,(t,e,n)=>{if(!(n=n.trim()))return;const o=t(cf),r=[n,...o.filter(s=>s!==n)].slice(0,15);e(cf,r)}),ER={hide_code:!1,disabled:!1},IR=()=>{const t=X.c(69),e=Sc(),[n]=Ds(),{theme:o}=Fo(),r=A.useRef(null),s=zs(),{createNewCell:i,updateCellCode:a}=Lt(),l=e.cellRuntime[mr],c=l==null?void 0:l.output,d=l==null?void 0:l.status,u=l==null?void 0:l.consoleOutputs,f=e.cellData[mr],p=(f==null?void 0:f.code)??"",_=en(jR),[g,m]=fn(NR),b=We(cf);let x;t[0]!==_||t[1]!==p?(x=()=>{oS({code:p}),_(p)},t[0]=_,t[1]=p,t[2]=x):x=t[2];const y=et(x);let v;t[3]!==p||t[4]!==i||t[5]!==s?(v=()=>{p.trim()&&i({code:p,before:!1,cellId:s??"__end__"})},t[3]=p,t[4]=i,t[5]=s,t[6]=v):v=t[6];const S=et(v);let k;t[7]!==a?(k=()=>{a({cellId:mr,code:"",formattingChange:!1}),oS({code:""});const ae=r.current;ae&&ae.dispatch({changes:{from:0,to:ae.state.doc.length,insert:""}})},t[7]=a,t[8]=k):k=t[8];const I=et(k);let j;t[9]!==m||t[10]!==a?(j=ae=>{m(!1),a({cellId:mr,code:ae,formattingChange:!1});const Se=r.current;Se&&Se.dispatch({changes:{from:0,to:Se.state.doc.length,insert:ae}})},t[9]=m,t[10]=a,t[11]=j):j=t[11];const E=et(j),[T,M]=A.useState();let L;t[12]!==p||t[13]!==u||t[14]!==y||t[15]!==T||t[16]!==c||t[17]!==o||t[18]!==n?(L=()=>h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"overflow-auto flex-shrink-0 max-h-[40%]",children:h.jsx(zu,{theme:o,allowFocus:!1,showPlaceholder:!1,id:mr,code:p,config:ER,status:"idle",serializedEditorState:null,runCell:y,userConfig:n,editorViewRef:r,setEditorView:ae=>{r.current=ae},hidden:!1,temporarilyShowCode:En.NOOP,languageAdapter:T,setLanguageAdapter:M})}),h.jsx("div",{className:"flex-1 overflow-auto flex-shrink-0",children:h.jsx(Pc,{allowExpand:!1,output:c,className:"output-area",cellId:mr,stale:!1,loading:!1})}),h.jsx("div",{className:"overflow-auto flex-shrink-0 max-h-[35%]",children:h.jsx(Qp,{consoleOutputs:u,className:"overflow-auto",stale:!1,cellName:qV,onSubmitDebugger:En.NOOP,cellId:mr,debuggerActive:!1})})]}),t[12]=p,t[13]=u,t[14]=y,t[15]=T,t[16]=c,t[17]=o,t[18]=n,t[19]=L):L=t[19];const B=L;let O;t[20]!==E||t[21]!==b||t[22]!==g||t[23]!==o?(O=()=>g?h.jsx("div",{className:"absolute inset-0 z-100 bg-background p-3 border-none overflow-auto",children:h.jsx("div",{className:"overflow-auto flex flex-col gap-3",children:b.map((ae,Se)=>h.jsx("div",{className:"border rounded-md hover:shadow-sm cursor-pointer hover:border-input overflow-hidden",onClick:()=>E(ae),children:h.jsx(_a,{language:"python",theme:o,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1},value:ae.trim(),editable:!1,readOnly:!0})},Se))})}):null,t[20]=E,t[21]=b,t[22]=g,t[23]=o,t[24]=O):O=t[24];const z=O;let F,V,P,C,H,N,$,Y,Z,q,re;t[25]===Symbol.for("react.memo_cache_sentinel")?(F=Fs.create(mr),V=h.jsx("p",{className:"mx-2 my-2 text-muted-foreground text-sm",children:"Use this scratchpad cell to experiment with code without restrictions on variable names. Scratchpad code is ephemeral: variables defined in the scratchpad aren't saved to notebook memory, and the code is not saved in the notebook file."}),t[25]=F,t[26]=V):(F=t[25],V=t[26]),t[27]===Symbol.for("react.memo_cache_sentinel")?(P=pn("cell.run"),t[27]=P):P=t[27],t[28]===Symbol.for("react.memo_cache_sentinel")?(C=h.jsx(Qs,{color:"var(--grass-11)",size:16}),t[28]=C):C=t[28],t[29]!==y||t[30]!==g?(H=h.jsx(Le,{content:P,children:h.jsx(Pe,{"data-testid":"scratchpad-run-button",onClick:y,disabled:g,variant:"text",size:"xs",children:C})}),t[29]=y,t[30]=g,t[31]=H):H=t[31],t[32]===Symbol.for("react.memo_cache_sentinel")?(N=h.jsx(fm,{size:16}),t[32]=N):N=t[32],t[33]!==I||t[34]!==g?($=h.jsx(Le,{content:"Clear code and outputs",children:h.jsx(Pe,{disabled:g,size:"xs",variant:"text",onClick:I,children:N})}),t[33]=I,t[34]=g,t[35]=$):$=t[35],t[36]===Symbol.for("react.memo_cache_sentinel")?(Y=h.jsx(ti,{size:16}),t[36]=Y):Y=t[36],t[37]!==S||t[38]!==g?(Z=h.jsx(ri,{children:h.jsx(Le,{content:"Insert code",children:h.jsx(Pe,{disabled:g,size:"xs",variant:"text",onClick:S,children:Y})})}),t[37]=S,t[38]=g,t[39]=Z):Z=t[39],t[40]!==d?(q=(d==="running"||d==="queued")&&h.jsx(eo,{className:"inline",size:"small"}),t[40]=d,t[41]=q):q=t[41],t[42]===Symbol.for("react.memo_cache_sentinel")?(re=h.jsx("div",{className:"flex-1"}),t[42]=re):re=t[42];const ne=g&&"bg-[var(--sky-3)] rounded-none";let oe,G;t[43]!==ne?(oe=Oe(ne),t[43]=ne,t[44]=oe):oe=t[44],t[45]!==g||t[46]!==m?(G=()=>m(!g),t[45]=g,t[46]=m,t[47]=G):G=t[47];const Q=b.length===0;let ce,pe,de,ge,ie,xe,we;return t[48]===Symbol.for("react.memo_cache_sentinel")?(ce=h.jsx(xm,{size:16}),t[48]=ce):ce=t[48],t[49]!==oe||t[50]!==G||t[51]!==Q?(pe=h.jsx(Le,{content:"Toggle history",children:h.jsx(Pe,{size:"xs",variant:"text",className:oe,onClick:G,disabled:Q,children:ce})}),t[49]=oe,t[50]=G,t[51]=Q,t[52]=pe):pe=t[52],t[53]!==H||t[54]!==$||t[55]!==Z||t[56]!==q||t[57]!==pe?(de=h.jsxs("div",{className:"flex items-center flex-shrink-0",children:[H,$,Z,q,re,pe]}),t[53]=H,t[54]=$,t[55]=Z,t[56]=q,t[57]=pe,t[58]=de):de=t[58],t[59]!==B?(ge=B(),t[59]=B,t[60]=ge):ge=t[60],t[61]!==z?(ie=z(),t[61]=z,t[62]=ie):ie=t[62],t[63]!==ge||t[64]!==ie?(xe=h.jsxs("div",{className:"flex-1 divide-y relative overflow-hidden flex flex-col",children:[ge,ie]}),t[63]=ge,t[64]=ie,t[65]=xe):xe=t[65],t[66]!==de||t[67]!==xe?(we=h.jsxs("div",{className:"flex flex-col h-full overflow-hidden divide-y",id:F,children:[V,de,xe]}),t[66]=de,t[67]=xe,t[68]=we):we=t[68],we},AR=()=>{const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=h.jsx(IR,{}),t[0]=e):e=t[0],e},O2=(t,e)=>{lt(e?{title:"Failed to add package",description:e,variant:"danger"}:{title:"Package added",description:h.jsxs("div",{children:[h.jsxs("div",{children:["The package ",h.jsx(la,{className:"inline",children:t})," and its dependencies has been added to your environment."]}),h.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Some Python packages may require a kernel restart to see changes."})]})})},D2=(t,e)=>{lt(e?{title:"Failed to upgrade package",description:e,variant:"danger"}:{title:"Package upgraded",description:h.jsxs("div",{children:[h.jsxs("div",{children:["The package ",h.jsx(la,{className:"inline",children:t})," has been upgraded."]}),h.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Some Python packages may require a kernel restart to see changes."})]})})},R2=(t,e)=>{lt(e?{title:"Failed to remove package",description:e,variant:"danger"}:{title:"Package removed",description:h.jsxs("div",{children:[h.jsxs("div",{children:["The package ",h.jsx(la,{className:"inline",children:t})," has been removed from your environment."]}),h.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Some Python packages may require a kernel restart to see changes."})]})})},P2=t=>{const e=X.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=h.jsx(eo,{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=Oe("px-2 h-full text-xs text-muted-foreground hover:text-foreground","invisible group-hover:visible",s),e[1]=s,e[2]=i):i=e[2],e[3]!==n?(a=Hn.stopPropagation(n),e[3]=n,e[4]=a):a=e[4],e[5]!==r||e[6]!==i||e[7]!==a?(l=h.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},TR=()=>{const t=X.c(16),[e]=Ds(),n=e.package_management.manager;let o;t[0]!==n?(o=[n],t[0]=n,t[1]=o):o=t[1];const{data:r,loading:s,error:i,reload:a}=$n(PR,o);if(s&&!r){let p;return t[2]===Symbol.for("react.memo_cache_sentinel")?(p=h.jsx(eo,{size:"medium",centered:!0}),t[2]=p):p=t[2],p}if(i){let p;return t[3]!==i?(p=h.jsx(Xs,{error:i}),t[3]=i,t[4]=p):p=t[4],p}let l;t[5]!==(r==null?void 0:r.packages)?(l=(r==null?void 0:r.packages)||[],t[5]=r==null?void 0:r.packages,t[6]=l):l=t[6];const c=l;let d,u,f;return t[7]!==n||t[8]!==a?(d=h.jsx(MR,{packageManager:n,onSuccess:a}),t[7]=n,t[8]=a,t[9]=d):d=t[9],t[10]!==c||t[11]!==a?(u=h.jsx(OR,{packages:c,onSuccess:a}),t[10]=c,t[11]=a,t[12]=u):u=t[12],t[13]!==d||t[14]!==u?(f=h.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[d,u]}),t[13]=d,t[14]=u,t[15]=f):f=t[15],f},MR=({onSuccess:t,packageManager:e})=>{const[n,o]=K.useState(""),[r,s]=K.useState(!1),{handleClick:i}=xa(),a=We(rS),l=en(rS);K.useEffect(()=>{a&&(o(a),l(null))},[a,l]);const c=async()=>{try{s(!0);const d=await sS({package:n});d.success?(t(),O2(n)):O2(n,d.error)}finally{o(""),s(!1)}};return h.jsxs("div",{className:"flex items-center w-full border-b",children:[h.jsx(V4,{placeholder:`Install packages with ${e}...`,id:Y1,icon:r?h.jsx(eo,{size:"small",className:"mr-2 h-4 w-4 shrink-0 opacity-50"}):h.jsx(Le,{content:"Change package manager",children:h.jsx(ba,{onClick:()=>i("packageManagement"),className:"mr-2 h-4 w-4 shrink-0 opacity-50 hover:opacity-80 cursor-pointer"})}),rootClassName:"flex-1 border-none",value:n,onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),c())},onChange:d=>o(d.target.value)}),h.jsx(Le,{delayDuration:300,side:"left",align:"start",content:h.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:",h.jsxs("div",{className:"flex flex-col gap-2 mt-2",children:[h.jsxs("div",{children:[h.jsx("span",{className:"font-bold tracking-wide",children:"Package name:"})," A package name; this will install the latest version.",h.jsx("div",{className:"text-muted-foreground",children:"Example: httpx"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"font-bold tracking-wide",children:"Package and version:"})," ","A package with a specific version or version range.",h.jsx("div",{className:"text-muted-foreground",children:"Examples: httpx==0.27.0, httpx>=0.27.0"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"font-bold tracking-wide",children:"Git:"})," A Git repository",h.jsx("div",{className:"text-muted-foreground",children:"Example: git+https://github.com/encode/httpx"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"font-bold tracking-wide",children:"URL:"})," A remote wheel or source distribution.",h.jsx("div",{className:"text-muted-foreground",children:"Example: https://example.com/httpx-0.27.0.tar.gz"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"font-bold tracking-wide",children:"Path:"})," A local wheel, source distribution, or project directory.",h.jsx("div",{className:"text-muted-foreground",children:"Example: /example/foo-0.1.0-py3-none-any.whl"})]})]})]}),children:h.jsx(Up,{className:"h-4 w-4 cursor-help text-muted-foreground hover:text-foreground bg-transparent"})}),h.jsx("button",{type:"button",className:Oe("float-right px-2 m-0 h-full text-sm text-secondary-foreground ml-2",n&&"bg-accent text-accent-foreground","disabled:cursor-not-allowed disabled:opacity-50"),onClick:c,disabled:!n,children:"Add"})]})},OR=t=>{const e=X.c(9),{onSuccess:n,packages:o}=t;if(o.length===0){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsx(An,{title:"No packages",description:"No packages are installed in this environment.",icon:h.jsx(ba,{})}),e[0]=a):a=e[0],a}let r,s,i;if(e[1]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsx(Gp,{children:h.jsxs(Ks,{children:[h.jsx(Fr,{children:"Name"}),h.jsx(Fr,{children:"Version"}),h.jsx(Fr,{})]})}),e[1]=r):r=e[1],e[2]!==n||e[3]!==o){let a;e[5]!==n?(a=l=>h.jsxs(Ks,{className:"group",onClick:async()=>{await yn(`${l.name}==${l.version}`),lt({title:"Copied to clipboard"})},children:[h.jsx(zr,{children:l.name}),h.jsx(zr,{children:l.version}),h.jsxs(zr,{className:"flex justify-end",children:[h.jsx(DR,{packageName:l.name,onSuccess:n}),h.jsx(RR,{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=h.jsxs(qp,{className:"overflow-auto flex-1",children:[r,h.jsx(Yp,{children:s})]}),e[7]=s,e[8]=i):i=e[8],i},DR=({packageName:t,onSuccess:e})=>{const[n,o]=K.useState(!1);return Un()?null:h.jsx(P2,{onClick:async()=>{try{o(!0);const r=await sS({package:t,upgrade:!0});r.success?(e(),D2(t)):D2(t,r.error)}finally{o(!1)}},loading:n,children:"Upgrade"})},RR=({packageName:t,onSuccess:e})=>{const[n,o]=K.useState(!1);return h.jsx(P2,{onClick:async()=>{try{o(!0);const r=await YV({package:t});r.success?(e(),R2(t)):R2(t,r.error)}finally{o(!1)}},loading:n,children:"Remove"})};function PR(){return GV()}var df="ScrollArea",[L2,i$]=f4(df),[LR,Fn]=L2(df),F2=A.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:o="hover",dir:r,scrollHideDelay:s=600,...i}=t,[a,l]=A.useState(null),[c,d]=A.useState(null),[u,f]=A.useState(null),[p,_]=A.useState(null),[g,m]=A.useState(null),[b,x]=A.useState(0),[y,v]=A.useState(0),[S,k]=A.useState(!1),[I,j]=A.useState(!1),E=Zs(e,M=>l(M)),T=JV(r);return h.jsx(LR,{scope:n,type:o,dir:T,scrollHideDelay:s,scrollArea:a,viewport:c,onViewportChange:d,content:u,onContentChange:f,scrollbarX:p,onScrollbarXChange:_,scrollbarXEnabled:S,onScrollbarXEnabledChange:k,scrollbarY:g,onScrollbarYChange:m,scrollbarYEnabled:I,onScrollbarYEnabledChange:j,onCornerWidthChange:x,onCornerHeightChange:v,children:h.jsx(Ws.div,{dir:T,...i,ref:E,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":y+"px",...t.style}})})});F2.displayName=df;var z2="ScrollAreaViewport",B2=A.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:o,nonce:r,...s}=t,i=Fn(z2,n),a=A.useRef(null),l=Zs(e,a,i.onViewportChange);return h.jsxs(h.Fragment,{children:[h.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}),h.jsx(Ws.div,{"data-radix-scroll-area-viewport":"",...s,ref:l,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...t.style},children:h.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})});B2.displayName=z2;var ao="ScrollAreaScrollbar",uf=A.forwardRef((t,e)=>{const{forceMount:n,...o}=t,r=Fn(ao,t.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=r,a=t.orientation==="horizontal";return A.useEffect(()=>(a?s(!0):i(!0),()=>{a?s(!1):i(!1)}),[a,s,i]),r.type==="hover"?h.jsx(FR,{...o,ref:e,forceMount:n}):r.type==="scroll"?h.jsx(zR,{...o,ref:e,forceMount:n}):r.type==="auto"?h.jsx(U2,{...o,ref:e,forceMount:n}):r.type==="always"?h.jsx(hf,{...o,ref:e}):null});uf.displayName=ao;var FR=A.forwardRef((t,e)=>{const{forceMount:n,...o}=t,r=Fn(ao,t.__scopeScrollArea),[s,i]=A.useState(!1);return A.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]),h.jsx(Uc,{present:n||s,children:h.jsx(U2,{"data-state":s?"visible":"hidden",...o,ref:e})})}),zR=A.forwardRef((t,e)=>{const{forceMount:n,...o}=t,r=Fn(ao,t.__scopeScrollArea),s=t.orientation==="horizontal",i=Wl(()=>l("SCROLL_END"),100),[a,l]=function(c,d){return A.useReducer((u,f)=>d[u][f]??u,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 A.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),r.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,r.scrollHideDelay,l]),A.useEffect(()=>{const c=r.viewport,d=s?"scrollLeft":"scrollTop";if(c){let u=c[d];const f=()=>{const p=c[d];u!==p&&(l("SCROLL"),i()),u=p};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[r.viewport,s,l,i]),h.jsx(Uc,{present:n||a!=="hidden",children:h.jsx(hf,{"data-state":a==="hidden"?"hidden":"visible",...o,ref:e,onPointerEnter:qn(t.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:qn(t.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),U2=A.forwardRef((t,e)=>{const n=Fn(ao,t.__scopeScrollArea),{forceMount:o,...r}=t,[s,i]=A.useState(!1),a=t.orientation==="horizontal",l=Wl(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;i(a?c:d)}},10);return gs(n.viewport,l),gs(n.content,l),h.jsx(Uc,{present:o||s,children:h.jsx(hf,{"data-state":s?"visible":"hidden",...r,ref:e})})}),hf=A.forwardRef((t,e)=>{const{orientation:n="vertical",...o}=t,r=Fn(ao,t.__scopeScrollArea),s=A.useRef(null),i=A.useRef(0),[a,l]=A.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=q2(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 u(f,p){return function(_,g,m,b="ltr"){const x=$l(m),y=x/2,v=g||y,S=x-v,k=m.scrollbar.paddingStart+v,I=m.scrollbar.size-m.scrollbar.paddingEnd-S,j=m.content-m.viewport,E=b==="ltr"?[0,j]:[-1*j,0];return Y2([k,I],E)(_)}(f,i.current,a,p)}return n==="horizontal"?h.jsx(BR,{...d,ref:e,onThumbPositionChange:()=>{if(r.viewport&&s.current){const f=G2(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=u(f,r.dir))}}):n==="vertical"?h.jsx(UR,{...d,ref:e,onThumbPositionChange:()=>{if(r.viewport&&s.current){const f=G2(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=u(f))}}):null}),BR=A.forwardRef((t,e)=>{const{sizes:n,onSizesChange:o,...r}=t,s=Fn(ao,t.__scopeScrollArea),[i,a]=A.useState(),l=A.useRef(null),c=Zs(e,l,s.onScrollbarXChange);return A.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),h.jsx(H2,{"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":$l(n)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.x),onDragScroll:d=>t.onDragScroll(d.x),onWheelScroll:(d,u)=>{if(s.viewport){const f=s.viewport.scrollLeft+d.deltaX;t.onWheelScroll(f),J2(f,u)&&d.preventDefault()}},onResize:()=>{l.current&&s.viewport&&i&&o({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Hl(i.paddingLeft),paddingEnd:Hl(i.paddingRight)}})}})}),UR=A.forwardRef((t,e)=>{const{sizes:n,onSizesChange:o,...r}=t,s=Fn(ao,t.__scopeScrollArea),[i,a]=A.useState(),l=A.useRef(null),c=Zs(e,l,s.onScrollbarYChange);return A.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),h.jsx(H2,{"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":$l(n)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.y),onDragScroll:d=>t.onDragScroll(d.y),onWheelScroll:(d,u)=>{if(s.viewport){const f=s.viewport.scrollTop+d.deltaY;t.onWheelScroll(f),J2(f,u)&&d.preventDefault()}},onResize:()=>{l.current&&s.viewport&&i&&o({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Hl(i.paddingTop),paddingEnd:Hl(i.paddingBottom)}})}})}),[VR,V2]=L2(ao),H2=A.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:o,hasThumb:r,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:d,onResize:u,...f}=t,p=Fn(ao,n),[_,g]=A.useState(null),m=Zs(e,E=>g(E)),b=A.useRef(null),x=A.useRef(""),y=p.viewport,v=o.content-o.viewport,S=hr(d),k=hr(l),I=Wl(u,10);function j(E){if(b.current){const T=E.clientX-b.current.left,M=E.clientY-b.current.top;c({x:T,y:M})}}return A.useEffect(()=>{const E=T=>{const M=T.target;(_==null?void 0:_.contains(M))&&S(T,v)};return document.addEventListener("wheel",E,{passive:!1}),()=>document.removeEventListener("wheel",E,{passive:!1})},[y,_,v,S]),A.useEffect(k,[o,k]),gs(_,I),gs(p.content,I),h.jsx(VR,{scope:n,scrollbar:_,hasThumb:r,onThumbChange:hr(s),onThumbPointerUp:hr(i),onThumbPositionChange:k,onThumbPointerDown:hr(a),children:h.jsx(Ws.div,{...f,ref:m,style:{position:"absolute",...f.style},onPointerDown:qn(t.onPointerDown,E=>{E.button===0&&(E.target.setPointerCapture(E.pointerId),b.current=_.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),j(E))}),onPointerMove:qn(t.onPointerMove,j),onPointerUp:qn(t.onPointerUp,E=>{const T=E.target;T.hasPointerCapture(E.pointerId)&&T.releasePointerCapture(E.pointerId),document.body.style.webkitUserSelect=x.current,p.viewport&&(p.viewport.style.scrollBehavior=""),b.current=null})})})}),Vl="ScrollAreaThumb",$2=A.forwardRef((t,e)=>{const{forceMount:n,...o}=t,r=V2(Vl,t.__scopeScrollArea);return h.jsx(Uc,{present:n||r.hasThumb,children:h.jsx(HR,{ref:e,...o})})}),HR=A.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:o,...r}=t,s=Fn(Vl,n),i=V2(Vl,n),{onThumbPositionChange:a}=i,l=Zs(e,u=>i.onThumbChange(u)),c=A.useRef(void 0),d=Wl(()=>{c.current&&(c.current(),c.current=void 0)},100);return A.useEffect(()=>{const u=s.viewport;if(u){const f=()=>{if(d(),!c.current){const p=WR(u,a);c.current=p,a()}};return a(),u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[s.viewport,d,a]),h.jsx(Ws.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:qn(t.onPointerDownCapture,u=>{const f=u.target.getBoundingClientRect(),p=u.clientX-f.left,_=u.clientY-f.top;i.onThumbPointerDown({x:p,y:_})}),onPointerUp:qn(t.onPointerUp,i.onThumbPointerUp)})});$2.displayName=Vl;var ff="ScrollAreaCorner",W2=A.forwardRef((t,e)=>{const n=Fn(ff,t.__scopeScrollArea),o=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&o?h.jsx($R,{...t,ref:e}):null});W2.displayName=ff;var $R=A.forwardRef((t,e)=>{const{__scopeScrollArea:n,...o}=t,r=Fn(ff,n),[s,i]=A.useState(0),[a,l]=A.useState(0),c=!!(s&&a);return gs(r.scrollbarX,()=>{var u;const d=((u=r.scrollbarX)==null?void 0:u.offsetHeight)||0;r.onCornerHeightChange(d),l(d)}),gs(r.scrollbarY,()=>{var u;const d=((u=r.scrollbarY)==null?void 0:u.offsetWidth)||0;r.onCornerWidthChange(d),i(d)}),c?h.jsx(Ws.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 Hl(t){return t?parseInt(t,10):0}function q2(t,e){const n=t/e;return isNaN(n)?0:n}function $l(t){const e=q2(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=(t.scrollbar.size-n)*e;return Math.max(o,18)}function G2(t,e,n="ltr"){const o=$l(e),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=e.scrollbar.size-r,i=e.content-e.viewport,a=s-o,l=XV(t,n==="ltr"?[0,i]:[-1*i,0]);return Y2([0,i],[0,a])(l)}function Y2(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 J2(t,e){return t>0&&t<e}var WR=(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 Wl(t,e){const n=hr(t),o=A.useRef(0);return A.useEffect(()=>()=>window.clearTimeout(o.current),[]),A.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(n,e)},[n,e])}function gs(t,e){const n=hr(e);KV(()=>{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 K2=F2,qR=B2,GR=W2;const X2=A.forwardRef((t,e)=>{const n=X.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=Oe("relative overflow-hidden",r),n[4]=r,n[5]=i):i=n[5],n[6]!==o?(a=h.jsx(qR,{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=h.jsx(Z2,{}),c=h.jsx(GR,{}),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=h.jsxs(K2,{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});X2.displayName=K2.displayName;const Z2=A.forwardRef((t,e)=>{const n=X.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-[1px]",l=i==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]";let c,d,u;return n[4]!==o||n[5]!==a||n[6]!==l?(c=Oe("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=h.jsx($2,{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?(u=h.jsx(uf,{ref:e,orientation:i,className:c,...r,children:d}),n[9]=i,n[10]=r,n[11]=e,n[12]=c,n[13]=u):u=n[13],u});Z2.displayName=uf.displayName;const YR=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,JR=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,KR={};function Q2(t,e){return(KR.jsx?JR:YR).test(t)}const XR=/[ \t\n\f\r]/g;function ek(t){return t.replace(XR,"")===""}class $i{constructor(e,n,o){this.property=e,this.normal=n,o&&(this.space=o)}}function tk(t,e){const n={},o={};let r=-1;for(;++r<t.length;)Object.assign(n,t[r].property),Object.assign(o,t[r].normal);return new $i(n,o,e)}function pf(t){return t.toLowerCase()}$i.prototype.property={},$i.prototype.normal={},$i.prototype.space=null;class zn{constructor(e,n){this.property=e,this.attribute=n}}zn.prototype.space=null,zn.prototype.boolean=!1,zn.prototype.booleanish=!1,zn.prototype.overloadedBoolean=!1,zn.prototype.number=!1,zn.prototype.commaSeparated=!1,zn.prototype.spaceSeparated=!1,zn.prototype.commaOrSpaceSeparated=!1,zn.prototype.mustUseProperty=!1,zn.prototype.defined=!1;let ZR=0;const tt=Tr(),Rt=Tr(),nk=Tr(),ye=Tr(),_t=Tr(),_s=Tr(),vn=Tr();function Tr(){return 2**++ZR}const mf=Object.freeze(Object.defineProperty({__proto__:null,boolean:tt,booleanish:Rt,commaOrSpaceSeparated:vn,commaSeparated:_s,number:ye,overloadedBoolean:nk,spaceSeparated:_t},Symbol.toStringTag,{value:"Module"})),gf=Object.keys(mf);class _f extends zn{constructor(e,n,o,r){let s=-1;if(super(e,n),ok(this,"space",r),typeof o=="number")for(;++s<gf.length;){const i=gf[s];ok(this,gf[s],(o&mf[i])===mf[i])}}}function ok(t,e,n){n&&(t[e]=n)}_f.prototype.defined=!0;const QR={}.hasOwnProperty;function bs(t){const e={},n={};let o;for(o in t.properties)if(QR.call(t.properties,o)){const r=t.properties[o],s=new _f(o,t.transform(t.attributes||{},o),r,t.space);t.mustUseProperty&&t.mustUseProperty.includes(o)&&(s.mustUseProperty=!0),e[o]=s,n[pf(o)]=o,n[pf(s.attribute)]=o}return new $i(e,n,t.space)}const rk=bs({space:"xlink",transform:(t,e)=>"xlink:"+e.slice(5).toLowerCase(),properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),sk=bs({space:"xml",transform:(t,e)=>"xml:"+e.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function ik(t,e){return e in t?t[e]:e}function ak(t,e){return ik(t,e.toLowerCase())}const lk=bs({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:ak,properties:{xmlns:null,xmlnsXLink:null}}),ck=bs({transform:(t,e)=>e==="role"?e:"aria-"+e.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:Rt,ariaAutoComplete:null,ariaBusy:Rt,ariaChecked:Rt,ariaColCount:ye,ariaColIndex:ye,ariaColSpan:ye,ariaControls:_t,ariaCurrent:null,ariaDescribedBy:_t,ariaDetails:null,ariaDisabled:Rt,ariaDropEffect:_t,ariaErrorMessage:null,ariaExpanded:Rt,ariaFlowTo:_t,ariaGrabbed:Rt,ariaHasPopup:null,ariaHidden:Rt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:_t,ariaLevel:ye,ariaLive:null,ariaModal:Rt,ariaMultiLine:Rt,ariaMultiSelectable:Rt,ariaOrientation:null,ariaOwns:_t,ariaPlaceholder:null,ariaPosInSet:ye,ariaPressed:Rt,ariaReadOnly:Rt,ariaRelevant:null,ariaRequired:Rt,ariaRoleDescription:_t,ariaRowCount:ye,ariaRowIndex:ye,ariaRowSpan:ye,ariaSelected:Rt,ariaSetSize:ye,ariaSort:null,ariaValueMax:ye,ariaValueMin:ye,ariaValueNow:ye,ariaValueText:null,role:null}}),eP=bs({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:ak,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:_s,acceptCharset:_t,accessKey:_t,action:null,allow:null,allowFullScreen:tt,allowPaymentRequest:tt,allowUserMedia:tt,alt:null,as:null,async:tt,autoCapitalize:null,autoComplete:_t,autoFocus:tt,autoPlay:tt,blocking:_t,capture:null,charSet:null,checked:tt,cite:null,className:_t,cols:ye,colSpan:null,content:null,contentEditable:Rt,controls:tt,controlsList:_t,coords:ye|_s,crossOrigin:null,data:null,dateTime:null,decoding:null,default:tt,defer:tt,dir:null,dirName:null,disabled:tt,download:nk,draggable:Rt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:tt,formTarget:null,headers:_t,height:ye,hidden:tt,high:ye,href:null,hrefLang:null,htmlFor:_t,httpEquiv:_t,id:null,imageSizes:null,imageSrcSet:null,inert:tt,inputMode:null,integrity:null,is:null,isMap:tt,itemId:null,itemProp:_t,itemRef:_t,itemScope:tt,itemType:_t,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:tt,low:ye,manifest:null,max:null,maxLength:ye,media:null,method:null,min:null,minLength:ye,multiple:tt,muted:tt,name:null,nonce:null,noModule:tt,noValidate:tt,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:tt,optimum:ye,pattern:null,ping:_t,placeholder:null,playsInline:tt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:tt,referrerPolicy:null,rel:_t,required:tt,reversed:tt,rows:ye,rowSpan:ye,sandbox:_t,scope:null,scoped:tt,seamless:tt,selected:tt,shadowRootClonable:tt,shadowRootDelegatesFocus:tt,shadowRootMode:null,shape:null,size:ye,sizes:null,slot:null,span:ye,spellCheck:Rt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ye,step:null,style:null,tabIndex:ye,target:null,title:null,translate:null,type:null,typeMustMatch:tt,useMap:null,value:Rt,width:ye,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:_t,axis:null,background:null,bgColor:null,border:ye,borderColor:null,bottomMargin:ye,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:tt,declare:tt,event:null,face:null,frame:null,frameBorder:null,hSpace:ye,leftMargin:ye,link:null,longDesc:null,lowSrc:null,marginHeight:ye,marginWidth:ye,noResize:tt,noHref:tt,noShade:tt,noWrap:tt,object:null,profile:null,prompt:null,rev:null,rightMargin:ye,rules:null,scheme:null,scrolling:Rt,standby:null,summary:null,text:null,topMargin:ye,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ye,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:tt,disableRemotePlayback:tt,prefix:null,property:null,results:ye,security:null,unselectable:null}}),tP=bs({space:"svg",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"},transform:ik,properties:{about:vn,accentHeight:ye,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ye,amplitude:ye,arabicForm:null,ascent:ye,attributeName:null,attributeType:null,azimuth:ye,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ye,by:null,calcMode:null,capHeight:ye,className:_t,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:ye,diffuseConstant:ye,direction:null,display:null,dur:null,divisor:ye,dominantBaseline:null,download:tt,dx:null,dy:null,edgeMode:null,editable:null,elevation:ye,enableBackground:null,end:null,event:null,exponent:ye,externalResourcesRequired:null,fill:null,fillOpacity:ye,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:_s,g2:_s,glyphName:_s,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ye,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ye,horizOriginX:ye,horizOriginY:ye,id:null,ideographic:ye,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ye,k:ye,k1:ye,k2:ye,k3:ye,k4:ye,kernelMatrix:vn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ye,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:ye,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:ye,overlineThickness:ye,paintOrder:null,panose1:null,path:null,pathLength:ye,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:_t,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ye,pointsAtY:ye,pointsAtZ:ye,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:vn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:vn,rev:vn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:vn,requiredFeatures:vn,requiredFonts:vn,requiredFormats:vn,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:ye,specularExponent:ye,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ye,strikethroughThickness:ye,string:null,stroke:null,strokeDashArray:vn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ye,strokeOpacity:ye,strokeWidth:null,style:null,surfaceScale:ye,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:vn,tabIndex:ye,tableValues:null,target:null,targetX:ye,targetY:ye,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:vn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ye,underlineThickness:ye,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ye,values:null,vAlphabetic:ye,vMathematical:ye,vectorEffect:null,vHanging:ye,vIdeographic:ye,version:null,vertAdvY:ye,vertOriginX:ye,vertOriginY:ye,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ye,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),nP=/^data[-\w.:]+$/i,dk=/-[a-z]/g,oP=/[A-Z]/g;function rP(t){return"-"+t.toLowerCase()}function sP(t){return t.charAt(1).toUpperCase()}const iP={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"},aP=tk([sk,rk,lk,ck,eP],"html"),bf=tk([sk,rk,lk,ck,tP],"svg"),uk=iS(ZV()),lP=uk.default||uk,hk=fk("end"),yf=fk("start");function fk(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 Wi(t){return t&&typeof t=="object"?"position"in t||"type"in t?pk(t.position):"start"in t||"end"in t?pk(t):"line"in t||"column"in t?xf(t):"":""}function xf(t){return mk(t&&t.line)+":"+mk(t&&t.column)}function pk(t){return xf(t&&t.start)+"-"+xf(t&&t.end)}function mk(t){return t&&typeof t=="number"?t:1}class on 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=Wi(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}}on.prototype.file="",on.prototype.name="",on.prototype.reason="",on.prototype.message="",on.prototype.stack="",on.prototype.column=void 0,on.prototype.line=void 0,on.prototype.ancestors=void 0,on.prototype.cause=void 0,on.prototype.fatal=void 0,on.prototype.place=void 0,on.prototype.ruleId=void 0,on.prototype.source=void 0;const wf={}.hasOwnProperty,cP=new Map,dP=/[A-Z]/g,uP=/-([a-z])/g,hP=new Set(["table","tbody","thead","tfoot","tr"]),fP=new Set(["td","th"]),gk="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function pP(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,u,f){const p=Array.isArray(u.children),_=yf(c);return a(d,u,f,p,{columnNumber:_?_.column-1:void 0,fileName:i,lineNumber:_?_.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,u,f,p){const _=Array.isArray(f.children)?l:a;return p?_(u,f,p):_(u,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"?bf:aP,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=_k(r,t,void 0);return s&&typeof s!="string"?s:r.create(t,r.Fragment,{children:s||void 0},void 0)}function _k(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=bf,o.schema=a),o.ancestors.push(r);const l=yk(o,r.tagName,!1),c=function(u,f){const p={};let _,g;for(g in f.properties)if(g!=="children"&&wf.call(f.properties,g)){const m=mP(u,g,f.properties[g]);if(m){const[b,x]=m;u.tableCellAlignToStyle&&b==="align"&&typeof x=="string"&&fP.has(f.tagName)?_=x:p[b]=x}}return _&&((p.style||(p.style={}))[u.stylePropertyNameCase==="css"?"text-align":"textAlign"]=_),p}(o,r);let d=kf(o,r);return hP.has(r.tagName)&&(d=d.filter(function(u){return typeof u!="string"||!(typeof(f=u)=="object"?f.type==="text"&&ek(f.value):ek(f));var f})),bk(o,c,l,r),vf(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)}qi(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=bf,o.schema=a),o.ancestors.push(r);const l=r.name===null?o.Fragment:yk(o,r.name,!0),c=function(u,f){const p={};for(const _ of f.attributes)if(_.type==="mdxJsxExpressionAttribute")if(_.data&&_.data.estree&&u.evaluater){const g=_.data.estree.body[0];g.type;const m=g.expression;m.type;const b=m.properties[0];b.type,Object.assign(p,u.evaluater.evaluateExpression(b.argument))}else qi(u,f.position);else{const g=_.name;let m;if(_.value&&typeof _.value=="object")if(_.value.data&&_.value.data.estree&&u.evaluater){const b=_.value.data.estree.body[0];b.type,m=u.evaluater.evaluateExpression(b.expression)}else qi(u,f.position);else m=_.value===null||_.value;p[g]=m}return p}(o,r),d=kf(o,r);return bk(o,c,l,r),vf(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);qi(o,r.position)}(t,e):e.type==="root"?function(o,r,s){const i={};return vf(i,kf(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 bk(t,e,n,o){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=o)}function vf(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function kf(t,e){const n=[];let o=-1;const r=t.passKeys?new Map:cP;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=_k(t,s,i);a!==void 0&&n.push(a)}return n}function mP(t,e,n){const o=function(r,s){const i=pf(s);let a=s,l=zn;if(i in r.normal)return r.property[r.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&nP.test(s)){if(s.charAt(4)==="-"){const c=s.slice(5).replace(dk,sP);a="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=s.slice(4);if(!dk.test(c)){let d=c.replace(oP,rP);d.charAt(0)!=="-"&&(d="-"+d),s="data"+d}}l=_f}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){const a={};try{lP(i,l)}catch(c){if(!s.ignoreInvalidStyle){const d=c,u=new on("Cannot parse `style` attribute",{ancestors:s.ancestors,cause:d,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw u.file=s.filePath||void 0,u.url=gk+"#cannot-parse-style-attribute",u}}return a;function l(c,d){let u=c;u.slice(0,2)!=="--"&&(u.slice(0,4)==="-ms-"&&(u="ms-"+u.slice(4)),u=u.replace(uP,_P)),a[u]=d}}(t,String(n));return t.stylePropertyNameCase==="css"&&(r=function(s){const i={};let a;for(a in s)wf.call(s,a)&&(i[gP(a)]=s[a]);return i}(r)),["style",r]}return[t.elementAttributeNameCase==="react"&&o.space?iP[o.property]||o.property:o.attribute,n]}}function yk(t,e,n){let o;if(n)if(e.includes(".")){const r=e.split(".");let s,i=-1;for(;++i<r.length;){const a=Q2(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=Q2(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 wf.call(t.components,r)?t.components[r]:r}if(t.evaluater)return t.evaluater.evaluateExpression(o);qi(t)}function qi(t,e){const n=new on("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=gk+"#cannot-handle-mdx-estrees-without-createevaluater",n}function gP(t){let e=t.replace(dP,bP);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function _P(t,e){return e.toUpperCase()}function bP(t){return"-"+t.toLowerCase()}const Sf={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"]},ql={};function xk(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 wk(t.children,e,n)}return Array.isArray(t)?wk(t,e,n):""}function wk(t,e,n){const o=[];let r=-1;for(;++r<t.length;)o[r]=xk(t[r],e,n);return o.join("")}const vk=document.createElement("i");function Cf(t){const e="&"+t+";";vk.innerHTML=e;const n=vk.textContent;return(n.charCodeAt(n.length-1)!==59||t==="semi")&&n!==e&&n}function lo(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 Bn(t,e){return t.length>0?(lo(t,t.length,0,e),t):e}const kk={}.hasOwnProperty;function yP(t,e){let n;for(n in e){const o=(kk.call(t,n)?t[n]:void 0)||(t[n]={}),r=e[n];let s;if(r)for(s in r){kk.call(o,s)||(o[s]=[]);const i=r[s];xP(o[s],Array.isArray(i)?i:i?[i]:[])}}}function xP(t,e){let n=-1;const o=[];for(;++n<e.length;)(e[n].add==="after"?t:o).push(e[n]);lo(t,0,0,o)}function Sk(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 ys(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const co=rr(/[A-Za-z]/),kn=rr(/[\dA-Za-z]/),wP=rr(/[#-'*+\--9=?A-Z^-~]/);function Nf(t){return t!==null&&(t<32||t===127)}const jf=rr(/\d/),vP=rr(/[\dA-Fa-f]/),kP=rr(/[!-/:-@[-`{-~]/);function Ze(t){return t!==null&&t<-2}function _n(t){return t!==null&&(t<0||t===32)}function ht(t){return t===-2||t===-1||t===32}const SP=rr(new RegExp("\\p{P}|\\p{S}","u")),CP=rr(/\s/);function rr(t){return function(e){return e!==null&&e>-1&&t.test(String.fromCharCode(e))}}function xs(t){const e=[];let n=-1,o=0,r=0;for(;++n<t.length;){const s=t.charCodeAt(n);let i="";if(s===37&&kn(t.charCodeAt(n+1))&&kn(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 bt(t,e,n,o){const r=o?o-1:Number.POSITIVE_INFINITY;let s=0;return function(a){return ht(a)?(t.enter(n),i(a)):e(a)};function i(a){return ht(a)&&s++<r?(t.consume(a),i):(t.exit(n),e(a))}}const NP={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"),bt(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)):Ze(s)?(t.consume(s),t.exit("chunkText"),o):(t.consume(s),r)}}},jP={tokenize:function(t){const e=this,n=[];let o,r,s,i=0;return a;function a(y){if(i<n.length){const v=n[i];return e.containerState=v[1],t.attempt(v[0].continuation,l,c)(y)}return c(y)}function l(y){if(i++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,o&&x();const v=e.events.length;let S,k=v;for(;k--;)if(e.events[k][0]==="exit"&&e.events[k][1].type==="chunkFlow"){S=e.events[k][1].end;break}b(i);let I=v;for(;I<e.events.length;)e.events[I][1].end={...S},I++;return lo(e.events,k+1,0,e.events.slice(v)),e.events.length=I,c(y)}return a(y)}function c(y){if(i===n.length){if(!o)return f(y);if(o.currentConstruct&&o.currentConstruct.concrete)return _(y);e.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(Ck,d,u)(y)}function d(y){return o&&x(),b(i),f(y)}function u(y){return e.parser.lazy[e.now().line]=i!==n.length,s=e.now().offset,_(y)}function f(y){return e.containerState={},t.attempt(Ck,p,_)(y)}function p(y){return i++,n.push([e.currentConstruct,e.containerState]),f(y)}function _(y){return y===null?(o&&x(),b(0),void t.consume(y)):(o=o||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:r}),g(y))}function g(y){return y===null?(m(t.exit("chunkFlow"),!0),b(0),void t.consume(y)):Ze(y)?(t.consume(y),m(t.exit("chunkFlow")),i=0,e.interrupt=void 0,a):(t.consume(y),g)}function m(y,v){const S=e.sliceStream(y);if(v&&S.push(null),y.previous=r,r&&(r.next=y),r=y,o.defineSkip(y.start),o.write(S),e.parser.lazy[y.start.line]){let k=o.events.length;for(;k--;)if(o.events[k][1].start.offset<s&&(!o.events[k][1].end||o.events[k][1].end.offset>s))return;const I=e.events.length;let j,E,T=I;for(;T--;)if(e.events[T][0]==="exit"&&e.events[T][1].type==="chunkFlow"){if(j){E=e.events[T][1].end;break}j=!0}for(b(i),k=I;k<e.events.length;)e.events[k][1].end={...E},k++;lo(e.events,T+1,0,e.events.slice(I)),e.events.length=k}}function b(y){let v=n.length;for(;v-- >y;){const S=n[v];e.containerState=S[1],S[0].exit.call(e,t)}n.length=y}function x(){o.write([null]),r=void 0,o=void 0,e.containerState._closeFlow=void 0}}},Ck={tokenize:function(t,e,n){return bt(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};function Nk(t){return t===null||_n(t)||CP(t)?1:SP(t)?2:void 0}function Ef(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 If={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 u={...t[n][1].end},f={...t[d][1].start};jk(u,-a),jk(f,a),s={type:a>1?"strongSequence":"emphasisSequence",start:u,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=Bn(l,[["enter",t[n][1],e],["exit",t[n][1],e]])),l=Bn(l,[["enter",o,e],["enter",s,e],["exit",s,e],["enter",r,e]]),l=Bn(l,Ef(e.parser.constructs.insideSpan.null,t.slice(n+1,d),e)),l=Bn(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=Bn(l,[["enter",t[d][1],e],["exit",t[d][1],e]])):c=0,lo(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=Nk(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=Nk(a),d=!c||c===2&&r||n.includes(a),u=!r||r===2&&c||n.includes(o);return l._open=!!(s===42?d:d&&(r||!u)),l._close=!!(s===42?u:u&&(c||!d)),e(a)}}};function jk(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const EP={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 co(f)?(t.consume(f),s):f===64?n(f):l(f)}function s(f){return f===43||f===45||f===46||kn(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||kn(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||Nf(f)?n(f):(t.consume(f),a)}function l(f){return f===64?(t.consume(f),c):wP(f)?(t.consume(f),l):n(f)}function c(f){return kn(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):u(f)}function u(f){if((f===45||kn(f))&&o++<63){const p=f===45?u:d;return t.consume(f),p}return n(f)}}},Gl={partial:!0,tokenize:function(t,e,n){return function(r){return ht(r)?bt(t,o,"linePrefix")(r):o(r)};function o(r){return r===null||Ze(r)?e(r):n(r)}}},Ek={continuation:{tokenize:function(t,e,n){const o=this;return function(s){return ht(s)?bt(t,r,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):r(s)};function r(s){return t.attempt(Ek,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 ht(s)?(t.enter("blockQuotePrefixWhitespace"),t.consume(s),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(s))}}},Ik={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 kP(r)?(t.enter("characterEscapeValue"),t.consume(r),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(r)}}},Ak={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=kn,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=vP,c):(t.enter("characterReferenceValue"),r=7,s=jf,c(d))}function c(d){if(d===59&&i){const u=t.exit("characterReferenceValue");return s!==kn||Cf(o.sliceSerialize(u))?(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)}}},Tk={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)}}},Mk={concrete:!0,name:"codeFenced",tokenize:function(t,e,n){const o=this,r={partial:!0,tokenize:function(y,v,S){let k=0;return I;function I(L){return y.enter("lineEnding"),y.consume(L),y.exit("lineEnding"),j}function j(L){return y.enter("codeFencedFence"),ht(L)?bt(y,E,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):E(L)}function E(L){return L===s?(y.enter("codeFencedFenceSequence"),T(L)):S(L)}function T(L){return L===s?(k++,y.consume(L),T):k>=a?(y.exit("codeFencedFenceSequence"),ht(L)?bt(y,M,"whitespace")(L):M(L)):S(L)}function M(L){return L===null||Ze(L)?(y.exit("codeFencedFence"),v(L)):S(L)}}};let s,i=0,a=0;return function(y){return function(v){const S=o.events[o.events.length-1];return i=S&&S[1].type==="linePrefix"?S[2].sliceSerialize(S[1],!0).length:0,s=v,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),l(v)}(y)};function l(y){return y===s?(a++,t.consume(y),l):a<3?n(y):(t.exit("codeFencedFenceSequence"),ht(y)?bt(t,c,"whitespace")(y):c(y))}function c(y){return y===null||Ze(y)?(t.exit("codeFencedFence"),o.interrupt?e(y):t.check(Tk,p,x)(y)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),d(y))}function d(y){return y===null||Ze(y)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),c(y)):ht(y)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),bt(t,u,"whitespace")(y)):y===96&&y===s?n(y):(t.consume(y),d)}function u(y){return y===null||Ze(y)?c(y):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===null||Ze(y)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),c(y)):y===96&&y===s?n(y):(t.consume(y),f)}function p(y){return t.attempt(r,x,_)(y)}function _(y){return t.enter("lineEnding"),t.consume(y),t.exit("lineEnding"),g}function g(y){return i>0&&ht(y)?bt(t,m,"linePrefix",i+1)(y):m(y)}function m(y){return y===null||Ze(y)?t.check(Tk,p,x)(y):(t.enter("codeFlowValue"),b(y))}function b(y){return y===null||Ze(y)?(t.exit("codeFlowValue"),m(y)):(t.consume(y),b)}function x(y){return t.exit("codeFenced"),e(y)}}},Af={name:"codeIndented",tokenize:function(t,e,n){const o=this;return function(l){return t.enter("codeIndented"),bt(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):Ze(l)?t.attempt(IP,s,a)(l):(t.enter("codeFlowValue"),i(l))}function i(l){return l===null||Ze(l)?(t.exit("codeFlowValue"),s(l)):(t.consume(l),i)}function a(l){return t.exit("codeIndented"),e(l)}}},IP={partial:!0,tokenize:function(t,e,n){const o=this;return r;function r(i){return o.parser.lazy[o.now().line]?n(i):Ze(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),r):bt(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):Ze(i)?r(i):n(i)}}},AP={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)):Ze(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||Ze(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 TP{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&&Gi(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),Gi(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Gi(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);Gi(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Gi(this.left,n.reverse())}}}function Gi(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 Ok(t){const e={};let n,o,r,s,i,a,l,c=-1;const d=new TP(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,MP(d,c)),c=e[c],l=!0);else if(n[1]._container){for(r=c,o=void 0;r--&&(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);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 lo(t,0,Number.POSITIVE_INFINITY,d.slice(0)),!l}function MP(t,e){const n=t.get(e)[1],o=t.get(e)[2];let r=e-1;const s=[],i=n._tokenizer||o.parser[n.contentType](n.start),a=i.events,l=[],c={};let d,u,f=-1,p=n,_=0,g=0;const m=[g];for(;p;){for(;t.get(++r)[1]!==p;);s.push(r),p._tokenizer||(d=o.sliceStream(p),p.next||d.push(null),u&&i.defineSkip(p.start),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(d),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),u=p,p=p.next}for(p=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&&(g=f+1,m.push(g),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(i.events=[],p?(p._tokenizer=void 0,p.previous=void 0):m.pop(),f=m.length;f--;){const b=a.slice(m[f],m[f+1]),x=s.pop();l.push([x,x+b.length-1]),t.splice(x,2,b)}for(l.reverse(),f=-1;++f<l.length;)c[_+l[f][0]]=_+l[f][1],_+=l[f][1]-l[f][0]-1;return c}const OP={resolve:function(t){return Ok(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):Ze(i)?t.check(DP,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}}},DP={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"),bt(t,r,"linePrefix")};function r(s){if(s===null||Ze(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 Dk(t,e,n,o,r,s,i,a,l){const c=l||Number.POSITIVE_INFINITY;let d=0;return function(m){return m===60?(t.enter(o),t.enter(r),t.enter(s),t.consume(m),t.exit(s),u):m===null||m===32||m===41||Nf(m)?n(m):(t.enter(o),t.enter(i),t.enter(a),t.enter("chunkString",{contentType:"string"}),_(m))};function u(m){return m===62?(t.enter(s),t.consume(m),t.exit(s),t.exit(r),t.exit(o),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===62?(t.exit("chunkString"),t.exit(a),u(m)):m===null||m===60||Ze(m)?n(m):(t.consume(m),m===92?p:f)}function p(m){return m===60||m===62||m===92?(t.consume(m),f):f(m)}function _(m){return d||m!==null&&m!==41&&!_n(m)?d<c&&m===40?(t.consume(m),d++,_):m===41?(t.consume(m),d--,_):m===null||m===32||m===40||Nf(m)?n(m):(t.consume(m),m===92?g:_):(t.exit("chunkString"),t.exit(a),t.exit(i),t.exit(o),e(m))}function g(m){return m===40||m===41||m===92?(t.consume(m),_):_(m)}}function Rk(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):Ze(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||Ze(f)||l++>999?(t.exit("chunkString"),c(f)):(t.consume(f),a||(a=!ht(f)),f===92?u:d)}function u(f){return f===91||f===92||f===93?(t.consume(f),l++,d):d(f)}}function Pk(t,e,n,o,r,s){let i;return function(u){return u===34||u===39||u===40?(t.enter(o),t.enter(r),t.consume(u),t.exit(r),i=u===40?41:u,a):n(u)};function a(u){return u===i?(t.enter(r),t.consume(u),t.exit(r),t.exit(o),e):(t.enter(s),l(u))}function l(u){return u===i?(t.exit(s),a(i)):u===null?n(u):Ze(u)?(t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),bt(t,l,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),c(u))}function c(u){return u===i||u===null||Ze(u)?(t.exit("chunkString"),l(u)):(t.consume(u),u===92?d:c)}function d(u){return u===i||u===92?(t.consume(u),c):c(u)}}function Yi(t,e){let n;return function o(r){return Ze(r)?(t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),n=!0,o):ht(r)?bt(t,o,n?"linePrefix":"lineSuffix")(r):e(r)}}const RP={name:"definition",tokenize:function(t,e,n){const o=this;let r;return function(u){return t.enter("definition"),function(f){return Rk.call(o,t,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}(u)};function s(u){return r=ys(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),u===58?(t.enter("definitionMarker"),t.consume(u),t.exit("definitionMarker"),i):n(u)}function i(u){return _n(u)?Yi(t,a)(u):a(u)}function a(u){return Dk(t,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(u)}function l(u){return t.attempt(PP,c,c)(u)}function c(u){return ht(u)?bt(t,d,"whitespace")(u):d(u)}function d(u){return u===null||Ze(u)?(t.exit("definition"),o.parser.defined.push(r),e(u)):n(u)}}},PP={partial:!0,tokenize:function(t,e,n){return function(i){return _n(i)?Yi(t,o)(i):n(i)};function o(i){return Pk(t,r,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(i)}function r(i){return ht(i)?bt(t,s,"whitespace")(i):s(i)}function s(i){return i===null||Ze(i)?e(i):n(i)}}},LP={name:"hardBreakEscape",tokenize:function(t,e,n){return function(r){return t.enter("hardBreakEscape"),t.consume(r),o};function o(r){return Ze(r)?(t.exit("hardBreakEscape"),e(r)):n(r)}}},FP={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"},lo(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||_n(l)?(t.exit("atxHeadingSequence"),s(l)):n(l)}function s(l){return l===35?(t.enter("atxHeadingSequence"),i(l)):l===null||Ze(l)?(t.exit("atxHeading"),e(l)):ht(l)?bt(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||_n(l)?(t.exit("atxHeadingText"),s(l)):(t.consume(l),a)}}},zP=["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"],Lk=["pre","script","style","textarea"],BP={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(N){return function($){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume($),c}(N)};function c(N){return N===33?(t.consume(N),d):N===47?(t.consume(N),s=!0,p):N===63?(t.consume(N),r=3,o.interrupt?e:P):co(N)?(t.consume(N),i=String.fromCharCode(N),_):n(N)}function d(N){return N===45?(t.consume(N),r=2,u):N===91?(t.consume(N),r=5,a=0,f):co(N)?(t.consume(N),r=4,o.interrupt?e:P):n(N)}function u(N){return N===45?(t.consume(N),o.interrupt?e:P):n(N)}function f(N){return N==="CDATA[".charCodeAt(a++)?(t.consume(N),a===6?o.interrupt?e:T:f):n(N)}function p(N){return co(N)?(t.consume(N),i=String.fromCharCode(N),_):n(N)}function _(N){if(N===null||N===47||N===62||_n(N)){const $=N===47,Y=i.toLowerCase();return $||s||!Lk.includes(Y)?zP.includes(i.toLowerCase())?(r=6,$?(t.consume(N),g):o.interrupt?e(N):T(N)):(r=7,o.interrupt&&!o.parser.lazy[o.now().line]?n(N):s?m(N):b(N)):(r=1,o.interrupt?e(N):T(N))}return N===45||kn(N)?(t.consume(N),i+=String.fromCharCode(N),_):n(N)}function g(N){return N===62?(t.consume(N),o.interrupt?e:T):n(N)}function m(N){return ht(N)?(t.consume(N),m):j(N)}function b(N){return N===47?(t.consume(N),j):N===58||N===95||co(N)?(t.consume(N),x):ht(N)?(t.consume(N),b):j(N)}function x(N){return N===45||N===46||N===58||N===95||kn(N)?(t.consume(N),x):y(N)}function y(N){return N===61?(t.consume(N),v):ht(N)?(t.consume(N),y):b(N)}function v(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(t.consume(N),l=N,S):ht(N)?(t.consume(N),v):k(N)}function S(N){return N===l?(t.consume(N),l=null,I):N===null||Ze(N)?n(N):(t.consume(N),S)}function k(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||_n(N)?y(N):(t.consume(N),k)}function I(N){return N===47||N===62||ht(N)?b(N):n(N)}function j(N){return N===62?(t.consume(N),E):n(N)}function E(N){return N===null||Ze(N)?T(N):ht(N)?(t.consume(N),E):n(N)}function T(N){return N===45&&r===2?(t.consume(N),O):N===60&&r===1?(t.consume(N),z):N===62&&r===4?(t.consume(N),C):N===63&&r===3?(t.consume(N),P):N===93&&r===5?(t.consume(N),V):!Ze(N)||r!==6&&r!==7?N===null||Ze(N)?(t.exit("htmlFlowData"),M(N)):(t.consume(N),T):(t.exit("htmlFlowData"),t.check(UP,H,M)(N))}function M(N){return t.check(VP,L,H)(N)}function L(N){return t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),B}function B(N){return N===null||Ze(N)?M(N):(t.enter("htmlFlowData"),T(N))}function O(N){return N===45?(t.consume(N),P):T(N)}function z(N){return N===47?(t.consume(N),i="",F):T(N)}function F(N){if(N===62){const $=i.toLowerCase();return Lk.includes($)?(t.consume(N),C):T(N)}return co(N)&&i.length<8?(t.consume(N),i+=String.fromCharCode(N),F):T(N)}function V(N){return N===93?(t.consume(N),P):T(N)}function P(N){return N===62?(t.consume(N),C):N===45&&r===2?(t.consume(N),P):T(N)}function C(N){return N===null||Ze(N)?(t.exit("htmlFlowData"),H(N)):(t.consume(N),C)}function H(N){return t.exit("htmlFlow"),e(N)}}},UP={partial:!0,tokenize:function(t,e,n){return function(o){return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),t.attempt(Gl,e,n)}}},VP={partial:!0,tokenize:function(t,e,n){const o=this;return function(s){return Ze(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)}}},HP={name:"htmlText",tokenize:function(t,e,n){const o=this;let r,s,i;return function(C){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(C),a};function a(C){return C===33?(t.consume(C),l):C===47?(t.consume(C),v):C===63?(t.consume(C),x):co(C)?(t.consume(C),I):n(C)}function l(C){return C===45?(t.consume(C),c):C===91?(t.consume(C),s=0,p):co(C)?(t.consume(C),b):n(C)}function c(C){return C===45?(t.consume(C),f):n(C)}function d(C){return C===null?n(C):C===45?(t.consume(C),u):Ze(C)?(i=d,F(C)):(t.consume(C),d)}function u(C){return C===45?(t.consume(C),f):d(C)}function f(C){return C===62?z(C):C===45?u(C):d(C)}function p(C){return C==="CDATA[".charCodeAt(s++)?(t.consume(C),s===6?_:p):n(C)}function _(C){return C===null?n(C):C===93?(t.consume(C),g):Ze(C)?(i=_,F(C)):(t.consume(C),_)}function g(C){return C===93?(t.consume(C),m):_(C)}function m(C){return C===62?z(C):C===93?(t.consume(C),m):_(C)}function b(C){return C===null||C===62?z(C):Ze(C)?(i=b,F(C)):(t.consume(C),b)}function x(C){return C===null?n(C):C===63?(t.consume(C),y):Ze(C)?(i=x,F(C)):(t.consume(C),x)}function y(C){return C===62?z(C):x(C)}function v(C){return co(C)?(t.consume(C),S):n(C)}function S(C){return C===45||kn(C)?(t.consume(C),S):k(C)}function k(C){return Ze(C)?(i=k,F(C)):ht(C)?(t.consume(C),k):z(C)}function I(C){return C===45||kn(C)?(t.consume(C),I):C===47||C===62||_n(C)?j(C):n(C)}function j(C){return C===47?(t.consume(C),z):C===58||C===95||co(C)?(t.consume(C),E):Ze(C)?(i=j,F(C)):ht(C)?(t.consume(C),j):z(C)}function E(C){return C===45||C===46||C===58||C===95||kn(C)?(t.consume(C),E):T(C)}function T(C){return C===61?(t.consume(C),M):Ze(C)?(i=T,F(C)):ht(C)?(t.consume(C),T):j(C)}function M(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(t.consume(C),r=C,L):Ze(C)?(i=M,F(C)):ht(C)?(t.consume(C),M):(t.consume(C),B)}function L(C){return C===r?(t.consume(C),r=void 0,O):C===null?n(C):Ze(C)?(i=L,F(C)):(t.consume(C),L)}function B(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||_n(C)?j(C):(t.consume(C),B)}function O(C){return C===47||C===62||_n(C)?j(C):n(C)}function z(C){return C===62?(t.consume(C),t.exit("htmlTextData"),t.exit("htmlText"),e):n(C)}function F(C){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(C),t.exit("lineEnding"),V}function V(C){return ht(C)?bt(t,P,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):P(C)}function P(C){return t.enter("htmlTextData"),i(C)}}},Tf={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&&lo(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=Bn(s,t.slice(o+1,o+a+3)),s=Bn(s,[["enter",d,e]]),s=Bn(s,Ef(e.parser.constructs.insideSpan.null,t.slice(o+a+4,r-3),e)),s=Bn(s,[["exit",d,e],t[r-2],t[r-1],["exit",c,e]]),s=Bn(s,t.slice(r+1)),s=Bn(s,[["exit",l,e]]),lo(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(u){return r?r._inactive?d(u):(s=o.parser.defined.includes(ys(o.sliceSerialize({start:r.end,end:o.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(u),t.exit("labelMarker"),t.exit("labelEnd"),a):n(u)};function a(u){return u===40?t.attempt($P,c,s?c:d)(u):u===91?t.attempt(WP,c,s?l:d)(u):s?c(u):d(u)}function l(u){return t.attempt(qP,c,d)(u)}function c(u){return e(u)}function d(u){return r._balanced=!0,n(u)}}},$P={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 _n(d)?Yi(t,r)(d):r(d)}function r(d){return d===41?c(d):Dk(t,s,i,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return _n(d)?Yi(t,a)(d):c(d)}function i(d){return n(d)}function a(d){return d===34||d===39||d===40?Pk(t,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):c(d)}function l(d){return _n(d)?Yi(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)}}},WP={tokenize:function(t,e,n){const o=this;return function(i){return Rk.call(o,t,r,s,"reference","referenceMarker","referenceString")(i)};function r(i){return o.parser.defined.includes(ys(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)))?e(i):n(i)}function s(i){return n(i)}}},qP={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)}}},GP={name:"labelStartImage",resolveAll:Tf.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)}}},YP={name:"labelStartLink",resolveAll:Tf.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)}}},Mf={name:"lineEnding",tokenize:function(t,e){return function(n){return t.enter("lineEnding"),t.consume(n),t.exit("lineEnding"),bt(t,e,"linePrefix")}}},Yl={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||Ze(a))?(t.exit("thematicBreak"),e(a)):n(a)}function i(a){return a===o?(t.consume(a),r++,i):(t.exit("thematicBreakSequence"),ht(a)?bt(t,s,"whitespace")(a):s(a))}}},bn={continuation:{tokenize:function(t,e,n){const o=this;return o.containerState._closeFlow=void 0,t.check(Gl,r,s);function r(a){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,bt(t,e,"listItemIndent",o.containerState.size+1)(a)}function s(a){return o.containerState.furtherBlankLines||!ht(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(KP,e,i)(a))}function i(a){return o.containerState._closeFlow=!0,o.interrupt=void 0,bt(t,t.attempt(bn,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 p=o.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!o.containerState.marker||f===o.containerState.marker:jf(f)){if(o.containerState.type||(o.containerState.type=p,t.enter(p,{_container:!0})),p==="listUnordered")return t.enter("listItemPrefix"),f===42||f===45?t.check(Yl,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 jf(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(Gl,o.interrupt?n:c,t.attempt(JP,u,d))}function c(f){return o.containerState.initialBlankLine=!0,s++,u(f)}function d(f){return ht(f)?(t.enter("listItemPrefixWhitespace"),t.consume(f),t.exit("listItemPrefixWhitespace"),u):n(f)}function u(f){return o.containerState.size=s+o.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(f)}}},JP={partial:!0,tokenize:function(t,e,n){const o=this;return bt(t,function(r){const s=o.events[o.events.length-1];return!ht(r)&&s&&s[1].type==="listItemPrefixWhitespace"?e(r):n(r)},"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},KP={partial:!0,tokenize:function(t,e,n){const o=this;return bt(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)}},Fk={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[o][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"),ht(a)?bt(t,i,"lineSuffix")(a):i(a))}function i(a){return a===null||Ze(a)?(t.exit("setextHeadingLine"),e(a)):n(a)}}},XP={tokenize:function(t){const e=this,n=t.attempt(Gl,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,bt(t,t.attempt(this.parser.constructs.flow,o,t.attempt(OP,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)}}},ZP={resolveAll:Bk()},QP=zk("string"),eL=zk("text");function zk(t){return{resolveAll:Bk(t==="text"?tL: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 u=-1;if(d)for(;++u<d.length;){const f=d[u];if(!f.previous||f.previous.call(n,n.previous))return!0}return!1}}}}function Bk(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 tL(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(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 nL={42:bn,43:bn,45:bn,48:bn,49:bn,50:bn,51:bn,52:bn,53:bn,54:bn,55:bn,56:bn,57:bn,62:Ek},oL={91:RP},rL={[-2]:Af,[-1]:Af,32:Af},sL={35:FP,42:Yl,45:[Fk,Yl],60:BP,61:Fk,95:Yl,96:Mk,126:Mk},iL={38:Ak,92:Ik},aL={[-5]:Mf,[-4]:Mf,[-3]:Mf,33:GP,38:Ak,42:If,60:[EP,HP],91:YP,92:[LP,Ik],93:Tf,95:If,96:AP},lL={null:[If,ZP]},cL=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:oL,disable:{null:[]},document:nL,flow:sL,flowInitial:rL,insideSpan:lL,string:iL,text:aL},Symbol.toStringTag,{value:"Module"}));function dL(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:m(function(y,v){b(y,v.from)}),check:m(g),consume:function(y){Ze(y)?(o.line++,o.column=1,o.offset+=y===-3?2:1,x()):y!==-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=y},enter:function(y,v){const S=v||{};return S.type=y,S.start=f(),c.events.push(["enter",S,c]),a.push(S),S},exit:function(y){const v=a.pop();return v.end=f(),c.events.push(["exit",v,c]),v},interrupt:m(g,{interrupt:!0})},c={code:null,containerState:{},defineSkip:function(y){r[y.line]=y.column,x()},events:[],now:f,parser:t,previous:null,sliceSerialize:function(y,v){return function(S,k){let I=-1;const j=[];let E;for(;++I<S.length;){const T=S[I];let M;if(typeof T=="string")M=T;else switch(T){case-5:M="\r";break;case-4:M=`
129
129
  `;break;case-3:M=`\r
130
- `;break;case-2:M=k?" ":" ";break;case-1:if(!k&&E)continue;M=" ";break;default:M=String.fromCharCode(T)}E=T===-2,j.push(M)}return j.join("")}(u(y),v)},sliceStream:u,write:function(y){return i=Bn(i,y),p(),i[i.length-1]!==null?[]:(b(e,0),c.events=If(s,c.events,c),c.events)}};let d=e.tokenize.call(c,l);return e.resolveAll&&s.push(e),c;function u(y){return function(v,S){const k=S.start._index,I=S.start._bufferIndex,j=S.end._index,E=S.end._bufferIndex;let T;if(k===j)T=[v[k].slice(I,E)];else{if(T=v.slice(k,j),I>-1){const M=T[0];typeof M=="string"?T[0]=M.slice(I):T.shift()}E>0&&T.push(v[j].slice(0,E))}return T}(i,y)}function f(){const{_bufferIndex:y,_index:v,line:S,column:k,offset:I}=o;return{_bufferIndex:y,_index:v,line:S,column:k,offset:I}}function p(){let y;for(;o._index<i.length;){const v=i[o._index];if(typeof v=="string")for(y=o._index,o._bufferIndex<0&&(o._bufferIndex=0);o._index===y&&o._bufferIndex<v.length;)_(v.charCodeAt(o._bufferIndex));else _(v)}}function _(y){d=d(y)}function g(y,v){v.restore()}function m(y,v){return function(S,k,I){let j,E,T,M;return Array.isArray(S)?L(S):"tokenize"in S?L([S]):function(F){return V;function V(P){const C=P!==null&&F[P],H=P!==null&&F.null;return L([...Array.isArray(C)?C:C?[C]:[],...Array.isArray(H)?H:H?[H]:[]])(P)}}(S);function L(F){return j=F,E=0,F.length===0?I:B(F[E])}function B(F){return function(V){return M=function(){const P=f(),C=c.previous,H=c.currentConstruct,N=c.events.length,$=Array.from(a);return{from:N,restore:Y};function Y(){o=P,c.previous=C,c.currentConstruct=H,c.events.length=N,a=$,x()}}(),T=F,F.partial||(c.currentConstruct=F),F.name&&c.parser.constructs.disable.null.includes(F.name)?z():F.tokenize.call(v?Object.assign(Object.create(c),v):c,l,O,z)(V)}}function O(F){return y(T,M),k}function z(F){return M.restore(),++E<j.length?B(j[E]):I}}}function b(y,v){y.resolveAll&&!s.includes(y)&&s.push(y),y.resolve&&lo(c.events,v,c.events.length-v,y.resolve(c.events.slice(v),c)),y.resolveTo&&(c.events=y.resolveTo(c.events,c))}function x(){o.line in r&&o.column<2&&(o.column=r[o.line],o.offset+=r[o.line]-1)}}function uL(t){const e=function(r){const s={};let i=-1;for(;++i<r.length;)yP(s,r[i]);return s}([cL,...(t||{}).extensions||[]]),n={constructs:e,content:o(NP),defined:[],document:o(jP),flow:o(XP),lazy:{},string:o(QP),text:o(eL)};return n;function o(r){return function(s){return dL(n,r,s)}}}const Bk=/[\0\t\n\r]/g,hL=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function fL(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),r=o===120||o===88;return kk(n.slice(r?2:1),r?16:10)}return Nf(n)||t}const Uk={}.hasOwnProperty;function pL(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(Re),autolinkProtocol:L,autolinkEmail:L,atxHeading:l(ae),blockQuote:l(de),characterEscape:L,characterReference:L,codeFenced:l(ge),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:l(ge,c),codeText:l(ie,c),codeTextData:L,data:L,codeFlowValue:L,definition:l(xe),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:l(we),hardBreakEscape:l(Se),hardBreakTrailing:l(Se),htmlFlow:l(me,c),htmlFlowData:L,htmlText:l(me,c),htmlTextData:L,image:l(Te),label:c,link:l(Re),listItem:l(ze),listItemValue:g,listOrdered:l($e,_),listUnordered:l($e),paragraph:l(Ne),reference:re,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:l(ae),strong:l(Ke),thematicBreak:l(it)},exit:{atxHeading:u(),atxHeadingSequence:j,autolink:u(),autolinkEmail:pe,autolinkProtocol:ce,blockQuote:u(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:oe,characterReferenceMarkerNumeric:oe,characterReferenceValue:G,characterReference:Q,codeFenced:u(y),codeFencedFence:x,codeFencedFenceInfo:m,codeFencedFenceMeta:b,codeFlowValue:B,codeIndented:u(v),codeText:u(P),codeTextData:B,data:B,definition:u(),definitionDestinationString:I,definitionLabelString:S,definitionTitleString:k,emphasis:u(),hardBreakEscape:u(z),hardBreakTrailing:u(z),htmlFlow:u(F),htmlFlowData:B,htmlText:u(V),htmlTextData:B,image:u(H),label:$,labelText:N,lineEnding:O,link:u(C),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ne,resourceDestinationString:Y,resourceTitleString:Z,resource:q,setextHeading:u(M),setextHeadingLineSequence:T,setextHeadingText:E,strong:u(),thematicBreak:u()}};Vk(r,(o||{}).mdastExtensions||[]);const s={};return i;function i(te){let Ce={type:"root",children:[]};const Me={stack:[Ce],tokenStack:[],config:r,enter:d,exit:f,buffer:c,resume:p,data:s},Be=[];let J=-1;for(;++J<te.length;)(te[J][1].type==="listOrdered"||te[J][1].type==="listUnordered")&&(te[J][0]==="enter"?Be.push(J):J=a(te,Be.pop(),J));for(J=-1;++J<te.length;){const fe=r[te[J][0]];Uk.call(fe,te[J][1].type)&&fe[te[J][1].type].call(Object.assign({sliceSerialize:te[J][2].sliceSerialize},Me),te[J][1])}if(Me.tokenStack.length>0){const fe=Me.tokenStack[Me.tokenStack.length-1];(fe[1]||Hk).call(Me,void 0,fe[0])}for(Ce.position={start:sr(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:sr(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},J=-1;++J<r.transforms.length;)Ce=r.transforms[J](Ce)||Ce;return Ce}function a(te,Ce,Me){let Be,J,fe,_e,ue=Ce-1,je=-1,ve=!1;for(;++ue<=Me;){const Ve=te[ue];switch(Ve[1].type){case"listUnordered":case"listOrdered":case"blockQuote":Ve[0]==="enter"?je++:je--,_e=void 0;break;case"lineEndingBlank":Ve[0]==="enter"&&(!Be||_e||je||fe||(fe=ue),_e=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:_e=void 0}if(!je&&Ve[0]==="enter"&&Ve[1].type==="listItemPrefix"||je===-1&&Ve[0]==="exit"&&(Ve[1].type==="listUnordered"||Ve[1].type==="listOrdered")){if(Be){let Qe=ue;for(J=void 0;Qe--;){const le=te[Qe];if(le[1].type==="lineEnding"||le[1].type==="lineEndingBlank"){if(le[0]==="exit")continue;J&&(te[J][1].type="lineEndingBlank",ve=!0),le[1].type="lineEnding",J=Qe}else if(le[1].type!=="linePrefix"&&le[1].type!=="blockQuotePrefix"&&le[1].type!=="blockQuotePrefixWhitespace"&&le[1].type!=="blockQuoteMarker"&&le[1].type!=="listItemIndent")break}fe&&(!J||fe<J)&&(Be._spread=!0),Be.end=Object.assign({},J?te[J][1].start:Ve[1].end),te.splice(J||ue,0,["exit",Be,Ve[2]]),ue++,Me++}if(Ve[1].type==="listItemPrefix"){const Qe={type:"listItem",_spread:!1,start:Object.assign({},Ve[1].start),end:void 0};Be=Qe,te.splice(ue,0,["enter",Qe,Ve[2]]),ue++,Me++,fe=void 0,_e=!0}}}return te[Ce][1]._spread=ve,Me}function l(te,Ce){return Me;function Me(Be){d.call(this,te(Be),Be),Ce&&Ce.call(this,Be)}}function c(){this.stack.push({type:"fragment",children:[]})}function d(te,Ce,Me){this.stack[this.stack.length-1].children.push(te),this.stack.push(te),this.tokenStack.push([Ce,Me||void 0]),te.position={start:sr(Ce.start),end:void 0}}function u(te){return Ce;function Ce(Me){te&&te.call(this,Me),f.call(this,Me)}}function f(te,Ce){const Me=this.stack.pop(),Be=this.tokenStack.pop();if(!Be)throw new Error("Cannot close `"+te.type+"` ("+Wi({start:te.start,end:te.end})+"): it\u2019s not open");Be[0].type!==te.type&&(Ce?Ce.call(this,te,Be[0]):(Be[1]||Hk).call(this,te,Be[0])),Me.position.end=sr(te.end)}function p(){return function(te){return yk(te,typeof ql.includeImageAlt!="boolean"||ql.includeImageAlt,typeof ql.includeHtml!="boolean"||ql.includeHtml)}(this.stack.pop())}function _(){this.data.expectingFirstListItemValue=!0}function g(te){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(te),10),this.data.expectingFirstListItemValue=void 0)}function m(){const te=this.resume();this.stack[this.stack.length-1].lang=te}function b(){const te=this.resume();this.stack[this.stack.length-1].meta=te}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const te=this.resume();this.stack[this.stack.length-1].value=te.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const te=this.resume();this.stack[this.stack.length-1].value=te.replace(/(\r?\n|\r)$/g,"")}function S(te){const Ce=this.resume(),Me=this.stack[this.stack.length-1];Me.label=Ce,Me.identifier=ys(this.sliceSerialize(te)).toLowerCase()}function k(){const te=this.resume();this.stack[this.stack.length-1].title=te}function I(){const te=this.resume();this.stack[this.stack.length-1].url=te}function j(te){const Ce=this.stack[this.stack.length-1];if(!Ce.depth){const Me=this.sliceSerialize(te).length;Ce.depth=Me}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function T(te){this.stack[this.stack.length-1].depth=this.sliceSerialize(te).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function L(te){const Ce=this.stack[this.stack.length-1].children;let Me=Ce[Ce.length-1];Me&&Me.type==="text"||(Me=nt(),Me.position={start:sr(te.start),end:void 0},Ce.push(Me)),this.stack.push(Me)}function B(te){const Ce=this.stack.pop();Ce.value+=this.sliceSerialize(te),Ce.position.end=sr(te.end)}function O(te){const Ce=this.stack[this.stack.length-1];if(this.data.atHardBreak)return Ce.children[Ce.children.length-1].position.end=sr(te.end),void(this.data.atHardBreak=void 0);!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(Ce.type)&&(L.call(this,te),B.call(this,te))}function z(){this.data.atHardBreak=!0}function F(){const te=this.resume();this.stack[this.stack.length-1].value=te}function V(){const te=this.resume();this.stack[this.stack.length-1].value=te}function P(){const te=this.resume();this.stack[this.stack.length-1].value=te}function C(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=Ce,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function H(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=Ce,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function N(te){const Ce=this.sliceSerialize(te),Me=this.stack[this.stack.length-2];Me.label=function(Be){return Be.replace(hL,fL)}(Ce),Me.identifier=ys(Ce).toLowerCase()}function $(){const te=this.stack[this.stack.length-1],Ce=this.resume(),Me=this.stack[this.stack.length-1];if(this.data.inReference=!0,Me.type==="link"){const Be=te.children;Me.children=Be}else Me.alt=Ce}function Y(){const te=this.resume();this.stack[this.stack.length-1].url=te}function Z(){const te=this.resume();this.stack[this.stack.length-1].title=te}function q(){this.data.inReference=void 0}function re(){this.data.referenceType="collapsed"}function ne(te){const Ce=this.resume(),Me=this.stack[this.stack.length-1];Me.label=Ce,Me.identifier=ys(this.sliceSerialize(te)).toLowerCase(),this.data.referenceType="full"}function oe(te){this.data.characterReferenceType=te.type}function G(te){const Ce=this.sliceSerialize(te),Me=this.data.characterReferenceType;let Be;Me?(Be=kk(Ce,Me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Be=Nf(Ce),this.stack[this.stack.length-1].value+=Be}function Q(te){this.stack.pop().position.end=sr(te.end)}function ce(te){B.call(this,te),this.stack[this.stack.length-1].url=this.sliceSerialize(te)}function pe(te){B.call(this,te),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(te)}function de(){return{type:"blockquote",children:[]}}function ge(){return{type:"code",lang:null,meta:null,value:""}}function ie(){return{type:"inlineCode",value:""}}function xe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function we(){return{type:"emphasis",children:[]}}function ae(){return{type:"heading",depth:0,children:[]}}function Se(){return{type:"break"}}function me(){return{type:"html",value:""}}function Te(){return{type:"image",title:null,url:"",alt:null}}function Re(){return{type:"link",title:null,url:"",children:[]}}function $e(te){return{type:"list",ordered:te.type==="listOrdered",start:null,spread:te._spread,children:[]}}function ze(te){return{type:"listItem",spread:te._spread,checked:null,children:[]}}function Ne(){return{type:"paragraph",children:[]}}function Ke(){return{type:"strong",children:[]}}function nt(){return{type:"text",value:""}}function it(){return{type:"thematicBreak"}}}(n)(function(o){for(;!Mk(o););return o}(uL(n).document().write(function(){let o,r=1,s="",i=!0;return function(a,l,c){const d=[];let u,f,p,_,g;for(a=s+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),p=0,s="",i&&(a.charCodeAt(0)===65279&&p++,i=void 0);p<a.length;){if(Bk.lastIndex=p,u=Bk.exec(a),_=u&&u.index!==void 0?u.index:a.length,g=a.charCodeAt(_),!u){s=a.slice(p);break}if(g===10&&p===_&&o)d.push(-3),o=void 0;else switch(o&&(d.push(-5),o=void 0),p<_&&(d.push(a.slice(p,_)),r+=_-p),g){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}p=_+1}return c&&(o&&d.push(-5),s&&d.push(s),d.push(null)),d}}()(t,e,!0))))}function sr(t){return{line:t.line,column:t.column,offset:t.offset}}function Vk(t,e){let n=-1;for(;++n<e.length;){const o=e[n];Array.isArray(o)?Vk(t,o):mL(t,o)}}function mL(t,e){let n;for(n in e)if(Uk.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 Hk(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+Wi({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+Wi({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+Wi({start:e.start,end:e.end})+") is still open")}function gL(t){const e=this;e.parser=function(n){return pL(n,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function $k(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 Wk(t){const e=t.spread;return e??t.children.length>1}function _L(t){const e=String(t),n=/\r?\n|\r/g;let o=n.exec(e),r=0;const s=[];for(;o;)s.push(qk(e.slice(r,o.index),r>0,!0),o[0]),r=o.index+o[0].length,o=n.exec(e);return s.push(qk(e.slice(r),r>0,!1)),s.join("")}function qk(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 bL={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:`
130
+ `;break;case-2:M=k?" ":" ";break;case-1:if(!k&&E)continue;M=" ";break;default:M=String.fromCharCode(T)}E=T===-2,j.push(M)}return j.join("")}(u(y),v)},sliceStream:u,write:function(y){return i=Bn(i,y),p(),i[i.length-1]!==null?[]:(b(e,0),c.events=Ef(s,c.events,c),c.events)}};let d=e.tokenize.call(c,l);return e.resolveAll&&s.push(e),c;function u(y){return function(v,S){const k=S.start._index,I=S.start._bufferIndex,j=S.end._index,E=S.end._bufferIndex;let T;if(k===j)T=[v[k].slice(I,E)];else{if(T=v.slice(k,j),I>-1){const M=T[0];typeof M=="string"?T[0]=M.slice(I):T.shift()}E>0&&T.push(v[j].slice(0,E))}return T}(i,y)}function f(){const{_bufferIndex:y,_index:v,line:S,column:k,offset:I}=o;return{_bufferIndex:y,_index:v,line:S,column:k,offset:I}}function p(){let y;for(;o._index<i.length;){const v=i[o._index];if(typeof v=="string")for(y=o._index,o._bufferIndex<0&&(o._bufferIndex=0);o._index===y&&o._bufferIndex<v.length;)_(v.charCodeAt(o._bufferIndex));else _(v)}}function _(y){d=d(y)}function g(y,v){v.restore()}function m(y,v){return function(S,k,I){let j,E,T,M;return Array.isArray(S)?L(S):"tokenize"in S?L([S]):function(F){return V;function V(P){const C=P!==null&&F[P],H=P!==null&&F.null;return L([...Array.isArray(C)?C:C?[C]:[],...Array.isArray(H)?H:H?[H]:[]])(P)}}(S);function L(F){return j=F,E=0,F.length===0?I:B(F[E])}function B(F){return function(V){return M=function(){const P=f(),C=c.previous,H=c.currentConstruct,N=c.events.length,$=Array.from(a);return{from:N,restore:Y};function Y(){o=P,c.previous=C,c.currentConstruct=H,c.events.length=N,a=$,x()}}(),T=F,F.partial||(c.currentConstruct=F),F.name&&c.parser.constructs.disable.null.includes(F.name)?z():F.tokenize.call(v?Object.assign(Object.create(c),v):c,l,O,z)(V)}}function O(F){return y(T,M),k}function z(F){return M.restore(),++E<j.length?B(j[E]):I}}}function b(y,v){y.resolveAll&&!s.includes(y)&&s.push(y),y.resolve&&lo(c.events,v,c.events.length-v,y.resolve(c.events.slice(v),c)),y.resolveTo&&(c.events=y.resolveTo(c.events,c))}function x(){o.line in r&&o.column<2&&(o.column=r[o.line],o.offset+=r[o.line]-1)}}function uL(t){const e=function(r){const s={};let i=-1;for(;++i<r.length;)yP(s,r[i]);return s}([cL,...(t||{}).extensions||[]]),n={constructs:e,content:o(NP),defined:[],document:o(jP),flow:o(XP),lazy:{},string:o(QP),text:o(eL)};return n;function o(r){return function(s){return dL(n,r,s)}}}const Uk=/[\0\t\n\r]/g,hL=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function fL(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),r=o===120||o===88;return Sk(n.slice(r?2:1),r?16:10)}return Cf(n)||t}const Vk={}.hasOwnProperty;function pL(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(Re),autolinkProtocol:L,autolinkEmail:L,atxHeading:l(ae),blockQuote:l(de),characterEscape:L,characterReference:L,codeFenced:l(ge),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:l(ge,c),codeText:l(ie,c),codeTextData:L,data:L,codeFlowValue:L,definition:l(xe),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:l(we),hardBreakEscape:l(Se),hardBreakTrailing:l(Se),htmlFlow:l(me,c),htmlFlowData:L,htmlText:l(me,c),htmlTextData:L,image:l(Te),label:c,link:l(Re),listItem:l(ze),listItemValue:g,listOrdered:l($e,_),listUnordered:l($e),paragraph:l(Ne),reference:re,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:l(ae),strong:l(Ke),thematicBreak:l(it)},exit:{atxHeading:u(),atxHeadingSequence:j,autolink:u(),autolinkEmail:pe,autolinkProtocol:ce,blockQuote:u(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:oe,characterReferenceMarkerNumeric:oe,characterReferenceValue:G,characterReference:Q,codeFenced:u(y),codeFencedFence:x,codeFencedFenceInfo:m,codeFencedFenceMeta:b,codeFlowValue:B,codeIndented:u(v),codeText:u(P),codeTextData:B,data:B,definition:u(),definitionDestinationString:I,definitionLabelString:S,definitionTitleString:k,emphasis:u(),hardBreakEscape:u(z),hardBreakTrailing:u(z),htmlFlow:u(F),htmlFlowData:B,htmlText:u(V),htmlTextData:B,image:u(H),label:$,labelText:N,lineEnding:O,link:u(C),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ne,resourceDestinationString:Y,resourceTitleString:Z,resource:q,setextHeading:u(M),setextHeadingLineSequence:T,setextHeadingText:E,strong:u(),thematicBreak:u()}};Hk(r,(o||{}).mdastExtensions||[]);const s={};return i;function i(te){let Ce={type:"root",children:[]};const Me={stack:[Ce],tokenStack:[],config:r,enter:d,exit:f,buffer:c,resume:p,data:s},Be=[];let J=-1;for(;++J<te.length;)(te[J][1].type==="listOrdered"||te[J][1].type==="listUnordered")&&(te[J][0]==="enter"?Be.push(J):J=a(te,Be.pop(),J));for(J=-1;++J<te.length;){const fe=r[te[J][0]];Vk.call(fe,te[J][1].type)&&fe[te[J][1].type].call(Object.assign({sliceSerialize:te[J][2].sliceSerialize},Me),te[J][1])}if(Me.tokenStack.length>0){const fe=Me.tokenStack[Me.tokenStack.length-1];(fe[1]||$k).call(Me,void 0,fe[0])}for(Ce.position={start:sr(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:sr(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},J=-1;++J<r.transforms.length;)Ce=r.transforms[J](Ce)||Ce;return Ce}function a(te,Ce,Me){let Be,J,fe,_e,ue=Ce-1,je=-1,ve=!1;for(;++ue<=Me;){const Ve=te[ue];switch(Ve[1].type){case"listUnordered":case"listOrdered":case"blockQuote":Ve[0]==="enter"?je++:je--,_e=void 0;break;case"lineEndingBlank":Ve[0]==="enter"&&(!Be||_e||je||fe||(fe=ue),_e=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:_e=void 0}if(!je&&Ve[0]==="enter"&&Ve[1].type==="listItemPrefix"||je===-1&&Ve[0]==="exit"&&(Ve[1].type==="listUnordered"||Ve[1].type==="listOrdered")){if(Be){let Qe=ue;for(J=void 0;Qe--;){const le=te[Qe];if(le[1].type==="lineEnding"||le[1].type==="lineEndingBlank"){if(le[0]==="exit")continue;J&&(te[J][1].type="lineEndingBlank",ve=!0),le[1].type="lineEnding",J=Qe}else if(le[1].type!=="linePrefix"&&le[1].type!=="blockQuotePrefix"&&le[1].type!=="blockQuotePrefixWhitespace"&&le[1].type!=="blockQuoteMarker"&&le[1].type!=="listItemIndent")break}fe&&(!J||fe<J)&&(Be._spread=!0),Be.end=Object.assign({},J?te[J][1].start:Ve[1].end),te.splice(J||ue,0,["exit",Be,Ve[2]]),ue++,Me++}if(Ve[1].type==="listItemPrefix"){const Qe={type:"listItem",_spread:!1,start:Object.assign({},Ve[1].start),end:void 0};Be=Qe,te.splice(ue,0,["enter",Qe,Ve[2]]),ue++,Me++,fe=void 0,_e=!0}}}return te[Ce][1]._spread=ve,Me}function l(te,Ce){return Me;function Me(Be){d.call(this,te(Be),Be),Ce&&Ce.call(this,Be)}}function c(){this.stack.push({type:"fragment",children:[]})}function d(te,Ce,Me){this.stack[this.stack.length-1].children.push(te),this.stack.push(te),this.tokenStack.push([Ce,Me||void 0]),te.position={start:sr(Ce.start),end:void 0}}function u(te){return Ce;function Ce(Me){te&&te.call(this,Me),f.call(this,Me)}}function f(te,Ce){const Me=this.stack.pop(),Be=this.tokenStack.pop();if(!Be)throw new Error("Cannot close `"+te.type+"` ("+Wi({start:te.start,end:te.end})+"): it\u2019s not open");Be[0].type!==te.type&&(Ce?Ce.call(this,te,Be[0]):(Be[1]||$k).call(this,te,Be[0])),Me.position.end=sr(te.end)}function p(){return function(te){return xk(te,typeof ql.includeImageAlt!="boolean"||ql.includeImageAlt,typeof ql.includeHtml!="boolean"||ql.includeHtml)}(this.stack.pop())}function _(){this.data.expectingFirstListItemValue=!0}function g(te){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(te),10),this.data.expectingFirstListItemValue=void 0)}function m(){const te=this.resume();this.stack[this.stack.length-1].lang=te}function b(){const te=this.resume();this.stack[this.stack.length-1].meta=te}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const te=this.resume();this.stack[this.stack.length-1].value=te.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const te=this.resume();this.stack[this.stack.length-1].value=te.replace(/(\r?\n|\r)$/g,"")}function S(te){const Ce=this.resume(),Me=this.stack[this.stack.length-1];Me.label=Ce,Me.identifier=ys(this.sliceSerialize(te)).toLowerCase()}function k(){const te=this.resume();this.stack[this.stack.length-1].title=te}function I(){const te=this.resume();this.stack[this.stack.length-1].url=te}function j(te){const Ce=this.stack[this.stack.length-1];if(!Ce.depth){const Me=this.sliceSerialize(te).length;Ce.depth=Me}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function T(te){this.stack[this.stack.length-1].depth=this.sliceSerialize(te).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function L(te){const Ce=this.stack[this.stack.length-1].children;let Me=Ce[Ce.length-1];Me&&Me.type==="text"||(Me=nt(),Me.position={start:sr(te.start),end:void 0},Ce.push(Me)),this.stack.push(Me)}function B(te){const Ce=this.stack.pop();Ce.value+=this.sliceSerialize(te),Ce.position.end=sr(te.end)}function O(te){const Ce=this.stack[this.stack.length-1];if(this.data.atHardBreak)return Ce.children[Ce.children.length-1].position.end=sr(te.end),void(this.data.atHardBreak=void 0);!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(Ce.type)&&(L.call(this,te),B.call(this,te))}function z(){this.data.atHardBreak=!0}function F(){const te=this.resume();this.stack[this.stack.length-1].value=te}function V(){const te=this.resume();this.stack[this.stack.length-1].value=te}function P(){const te=this.resume();this.stack[this.stack.length-1].value=te}function C(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=Ce,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function H(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=Ce,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function N(te){const Ce=this.sliceSerialize(te),Me=this.stack[this.stack.length-2];Me.label=function(Be){return Be.replace(hL,fL)}(Ce),Me.identifier=ys(Ce).toLowerCase()}function $(){const te=this.stack[this.stack.length-1],Ce=this.resume(),Me=this.stack[this.stack.length-1];if(this.data.inReference=!0,Me.type==="link"){const Be=te.children;Me.children=Be}else Me.alt=Ce}function Y(){const te=this.resume();this.stack[this.stack.length-1].url=te}function Z(){const te=this.resume();this.stack[this.stack.length-1].title=te}function q(){this.data.inReference=void 0}function re(){this.data.referenceType="collapsed"}function ne(te){const Ce=this.resume(),Me=this.stack[this.stack.length-1];Me.label=Ce,Me.identifier=ys(this.sliceSerialize(te)).toLowerCase(),this.data.referenceType="full"}function oe(te){this.data.characterReferenceType=te.type}function G(te){const Ce=this.sliceSerialize(te),Me=this.data.characterReferenceType;let Be;Me?(Be=Sk(Ce,Me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Be=Cf(Ce),this.stack[this.stack.length-1].value+=Be}function Q(te){this.stack.pop().position.end=sr(te.end)}function ce(te){B.call(this,te),this.stack[this.stack.length-1].url=this.sliceSerialize(te)}function pe(te){B.call(this,te),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(te)}function de(){return{type:"blockquote",children:[]}}function ge(){return{type:"code",lang:null,meta:null,value:""}}function ie(){return{type:"inlineCode",value:""}}function xe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function we(){return{type:"emphasis",children:[]}}function ae(){return{type:"heading",depth:0,children:[]}}function Se(){return{type:"break"}}function me(){return{type:"html",value:""}}function Te(){return{type:"image",title:null,url:"",alt:null}}function Re(){return{type:"link",title:null,url:"",children:[]}}function $e(te){return{type:"list",ordered:te.type==="listOrdered",start:null,spread:te._spread,children:[]}}function ze(te){return{type:"listItem",spread:te._spread,checked:null,children:[]}}function Ne(){return{type:"paragraph",children:[]}}function Ke(){return{type:"strong",children:[]}}function nt(){return{type:"text",value:""}}function it(){return{type:"thematicBreak"}}}(n)(function(o){for(;!Ok(o););return o}(uL(n).document().write(function(){let o,r=1,s="",i=!0;return function(a,l,c){const d=[];let u,f,p,_,g;for(a=s+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),p=0,s="",i&&(a.charCodeAt(0)===65279&&p++,i=void 0);p<a.length;){if(Uk.lastIndex=p,u=Uk.exec(a),_=u&&u.index!==void 0?u.index:a.length,g=a.charCodeAt(_),!u){s=a.slice(p);break}if(g===10&&p===_&&o)d.push(-3),o=void 0;else switch(o&&(d.push(-5),o=void 0),p<_&&(d.push(a.slice(p,_)),r+=_-p),g){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}p=_+1}return c&&(o&&d.push(-5),s&&d.push(s),d.push(null)),d}}()(t,e,!0))))}function sr(t){return{line:t.line,column:t.column,offset:t.offset}}function Hk(t,e){let n=-1;for(;++n<e.length;){const o=e[n];Array.isArray(o)?Hk(t,o):mL(t,o)}}function mL(t,e){let n;for(n in e)if(Vk.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 $k(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+Wi({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+Wi({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+Wi({start:e.start,end:e.end})+") is still open")}function gL(t){const e=this;e.parser=function(n){return pL(n,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function Wk(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 qk(t){const e=t.spread;return e??t.children.length>1}function _L(t){const e=String(t),n=/\r?\n|\r/g;let o=n.exec(e),r=0;const s=[];for(;o;)s.push(Gk(e.slice(r,o.index),r>0,!0),o[0]),r=o.index+o[0].length,o=n.exec(e);return s.push(Gk(e.slice(r),r>0,!1)),s.join("")}function Gk(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 bL={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:`
131
131
  `}]},code:function(t,e){const n=e.value?e.value+`
132
- `:"",o={};e.lang&&(o.className=["language-"+e.lang]);let r={type:"element",tagName:"code",properties:o,children:[{type:"text",value:n}]};return e.meta&&(r.data={meta:e.meta}),t.patch(e,r),r=t.applyData(e,r),r={type:"element",tagName:"pre",properties:{},children:[r]},t.patch(e,r),r},delete:function(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)},emphasis:function(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)},footnoteReference:function(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",o=String(e.identifier).toUpperCase(),r=xs(o.toLowerCase()),s=t.footnoteOrder.indexOf(o);let i,a=t.footnoteCounts.get(o);a===void 0?(a=0,t.footnoteOrder.push(o),i=t.footnoteOrder.length):i=s+1,a+=1,t.footnoteCounts.set(o,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(i)}]};t.patch(e,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return t.patch(e,c),t.applyData(e,c)},heading:function(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)},html:function(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}},imageReference:function(t,e){const n=String(e.identifier).toUpperCase(),o=t.definitionById.get(n);if(!o)return $k(t,e);const r={src:xs(o.url||""),alt:e.alt};o.title!==null&&o.title!==void 0&&(r.title=o.title);const s={type:"element",tagName:"img",properties:r,children:[]};return t.patch(e,s),t.applyData(e,s)},image:function(t,e){const n={src:xs(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const o={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,o),t.applyData(e,o)},inlineCode:function(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const o={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,o),t.applyData(e,o)},linkReference:function(t,e){const n=String(e.identifier).toUpperCase(),o=t.definitionById.get(n);if(!o)return $k(t,e);const r={href:xs(o.url||"")};o.title!==null&&o.title!==void 0&&(r.title=o.title);const s={type:"element",tagName:"a",properties:r,children:t.all(e)};return t.patch(e,s),t.applyData(e,s)},link:function(t,e){const n={href:xs(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const o={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,o),t.applyData(e,o)},listItem:function(t,e,n){const o=t.all(e),r=n?function(d){let u=!1;if(d.type==="list"){u=d.spread||!1;const f=d.children;let p=-1;for(;!u&&++p<f.length;)u=Wk(f[p])}return u}(n):Wk(e),s={},i=[];if(typeof e.checked=="boolean"){const d=o[0];let u;d&&d.type==="element"&&d.tagName==="p"?u=d:(u={type:"element",tagName:"p",properties:{},children:[]},o.unshift(u)),u.children.length>0&&u.children.unshift({type:"text",value:" "}),u.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let a=-1;for(;++a<o.length;){const d=o[a];(r||a!==0||d.type!=="element"||d.tagName!=="p")&&i.push({type:"text",value:`
132
+ `:"",o={};e.lang&&(o.className=["language-"+e.lang]);let r={type:"element",tagName:"code",properties:o,children:[{type:"text",value:n}]};return e.meta&&(r.data={meta:e.meta}),t.patch(e,r),r=t.applyData(e,r),r={type:"element",tagName:"pre",properties:{},children:[r]},t.patch(e,r),r},delete:function(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)},emphasis:function(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)},footnoteReference:function(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",o=String(e.identifier).toUpperCase(),r=xs(o.toLowerCase()),s=t.footnoteOrder.indexOf(o);let i,a=t.footnoteCounts.get(o);a===void 0?(a=0,t.footnoteOrder.push(o),i=t.footnoteOrder.length):i=s+1,a+=1,t.footnoteCounts.set(o,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(i)}]};t.patch(e,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return t.patch(e,c),t.applyData(e,c)},heading:function(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)},html:function(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}},imageReference:function(t,e){const n=String(e.identifier).toUpperCase(),o=t.definitionById.get(n);if(!o)return Wk(t,e);const r={src:xs(o.url||""),alt:e.alt};o.title!==null&&o.title!==void 0&&(r.title=o.title);const s={type:"element",tagName:"img",properties:r,children:[]};return t.patch(e,s),t.applyData(e,s)},image:function(t,e){const n={src:xs(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const o={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,o),t.applyData(e,o)},inlineCode:function(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const o={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,o),t.applyData(e,o)},linkReference:function(t,e){const n=String(e.identifier).toUpperCase(),o=t.definitionById.get(n);if(!o)return Wk(t,e);const r={href:xs(o.url||"")};o.title!==null&&o.title!==void 0&&(r.title=o.title);const s={type:"element",tagName:"a",properties:r,children:t.all(e)};return t.patch(e,s),t.applyData(e,s)},link:function(t,e){const n={href:xs(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const o={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,o),t.applyData(e,o)},listItem:function(t,e,n){const o=t.all(e),r=n?function(d){let u=!1;if(d.type==="list"){u=d.spread||!1;const f=d.children;let p=-1;for(;!u&&++p<f.length;)u=qk(f[p])}return u}(n):qk(e),s={},i=[];if(typeof e.checked=="boolean"){const d=o[0];let u;d&&d.type==="element"&&d.tagName==="p"?u=d:(u={type:"element",tagName:"p",properties:{},children:[]},o.unshift(u)),u.children.length>0&&u.children.unshift({type:"text",value:" "}),u.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let a=-1;for(;++a<o.length;){const d=o[a];(r||a!==0||d.type!=="element"||d.tagName!=="p")&&i.push({type:"text",value:`
133
133
  `}),d.type!=="element"||d.tagName!=="p"||r?i.push(d):i.push(...d.children)}const l=o[o.length-1];l&&(r||l.type!=="element"||l.tagName!=="p")&&i.push({type:"text",value:`
134
- `});const c={type:"element",tagName:"li",properties:s,children:i};return t.patch(e,c),t.applyData(e,c)},list:function(t,e){const n={},o=t.all(e);let r=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++r<o.length;){const i=o[r];if(i.type==="element"&&i.tagName==="li"&&i.properties&&Array.isArray(i.properties.className)&&i.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(o,!0)};return t.patch(e,s),t.applyData(e,s)},paragraph:function(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)},root:function(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)},strong:function(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)},table:function(t,e){const n=t.all(e),o=n.shift(),r=[];if(o){const i={type:"element",tagName:"thead",properties:{},children:t.wrap([o],!0)};t.patch(e.children[0],i),r.push(i)}if(n.length>0){const i={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},a=xf(e.children[1]),l=uk(e.children[e.children.length-1]);a&&l&&(i.position={start:a,end:l}),r.push(i)}const s={type:"element",tagName:"table",properties:{},children:t.wrap(r,!0)};return t.patch(e,s),t.applyData(e,s)},tableCell:function(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)},tableRow:function(t,e,n){const o=n?n.children:void 0,r=(o?o.indexOf(e):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,i=s?s.length:e.children.length;let a=-1;const l=[];for(;++a<i;){const d=e.children[a],u={},f=s?s[a]:void 0;f&&(u.align=f);let p={type:"element",tagName:r,properties:u,children:[]};d&&(p.children=t.all(d),t.patch(d,p),p=t.applyData(d,p)),l.push(p)}const c={type:"element",tagName:"tr",properties:{},children:t.wrap(l,!0)};return t.patch(e,c),t.applyData(e,c)},text:function(t,e){const n={type:"text",value:_L(String(e.value))};return t.patch(e,n),t.applyData(e,n)},thematicBreak:function(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)},toml:Jl,yaml:Jl,definition:Jl,footnoteDefinition:Jl};function Jl(){}const Gk=typeof self=="object"?self:globalThis,Yk=t=>((e,n)=>{const o=(s,i)=>(e.set(i,s),s),r=s=>{if(e.has(s))return e.get(s);const[i,a]=n[s];switch(i){case 0:case-1:return o(a,s);case 1:{const l=o([],s);for(const c of a)l.push(r(c));return l}case 2:{const l=o({},s);for(const[c,d]of a)l[r(c)]=r(d);return l}case 3:return o(new Date(a),s);case 4:{const{source:l,flags:c}=a;return o(new RegExp(l,c),s)}case 5:{const l=o(new Map,s);for(const[c,d]of a)l.set(r(c),r(d));return l}case 6:{const l=o(new Set,s);for(const c of a)l.add(r(c));return l}case 7:{const{name:l,message:c}=a;return o(new Gk[l](c),s)}case 8:return o(BigInt(a),s);case"BigInt":return o(Object(BigInt(a)),s)}return o(new Gk[i](a),s)};return r})(new Map,t)(0),ws="",{toString:yL}={},{keys:xL}=Object,Ji=t=>{const e=typeof t;if(e!=="object"||!t)return[0,e];const n=yL.call(t).slice(8,-1);switch(n){case"Array":return[1,ws];case"Object":return[2,ws];case"Date":return[3,ws];case"RegExp":return[4,ws];case"Map":return[5,ws];case"Set":return[6,ws]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},Kl=([t,e])=>t===0&&(e==="function"||e==="symbol"),Jk=(t,{json:e,lossy:n}={})=>{const o=[];return((r,s,i,a)=>{const l=(d,u)=>{const f=a.push(d)-1;return i.set(u,f),f},c=d=>{if(i.has(d))return i.get(d);let[u,f]=Ji(d);switch(u){case 0:{let _=d;switch(f){case"bigint":u=8,_=d.toString();break;case"function":case"symbol":if(r)throw new TypeError("unable to serialize "+f);_=null;break;case"undefined":return l([-1],d)}return l([u,_],d)}case 1:{if(f)return l([f,[...d]],d);const _=[],g=l([u,_],d);for(const m of d)_.push(c(m));return g}case 2:{if(f)switch(f){case"BigInt":return l([f,d.toString()],d);case"Boolean":case"Number":case"String":return l([f,d.valueOf()],d)}if(s&&"toJSON"in d)return c(d.toJSON());const _=[],g=l([u,_],d);for(const m of xL(d))!r&&Kl(Ji(d[m]))||_.push([c(m),c(d[m])]);return g}case 3:return l([u,d.toISOString()],d);case 4:{const{source:_,flags:g}=d;return l([u,{source:_,flags:g}],d)}case 5:{const _=[],g=l([u,_],d);for(const[m,b]of d)(r||!Kl(Ji(m))&&!Kl(Ji(b)))&&_.push([c(m),c(b)]);return g}case 6:{const _=[],g=l([u,_],d);for(const m of d)!r&&Kl(Ji(m))||_.push(c(m));return g}}const{message:p}=d;return l([u,{name:f,message:p}],d)};return c})(!(e||n),!!e,new Map,o)(t),o},Xl=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?Yk(Jk(t,e)):structuredClone(t):(t,e)=>Yk(Jk(t,e));function wL(t,e){const n=[{type:"text",value:"\u21A9"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function vL(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}const Kk=function(t){if(t==null)return kL;if(typeof t=="function")return Zl(t);if(typeof t=="object")return Array.isArray(t)?function(e){const n=[];let o=-1;for(;++o<e.length;)n[o]=Kk(e[o]);return Zl(r);function r(...s){let i=-1;for(;++i<n.length;)if(n[i].apply(this,s))return!0;return!1}}(t):function(e){const n=e;return Zl(o);function o(r){const s=r;let i;for(i in e)if(s[i]!==n[i])return!1;return!0}}(t);if(typeof t=="string")return function(e){return Zl(n);function n(o){return o&&o.type===e}}(t);throw new Error("Expected function, string, or object as test")};function Zl(t){return function(e,n,o){return!!(function(r){return r!==null&&typeof r=="object"&&"type"in r}(e)&&t.call(this,e,typeof n=="number"?n:void 0,o||void 0))}}function kL(){return!0}const Xk=[],SL=!0,Zk=!1;function CL(t,e,n,o){let r;typeof e=="function"&&typeof n!="function"?(o=n,n=e):r=e;const s=Kk(r),i=o?-1:1;(function a(l,c,d){const u=l&&typeof l=="object"?l:{};if(typeof u.type=="string"){const p=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(f,"name",{value:"node ("+l.type+(p?"<"+p+">":"")+")"})}return f;function f(){let p,_,g,m=Xk;if((!e||s(l,c,d[d.length-1]||void 0))&&(m=function(b){return Array.isArray(b)?b:typeof b=="number"?[SL,b]:b==null?Xk:[b]}(n(l,d)),m[0]===Zk))return m;if("children"in l&&l.children){const b=l;if(b.children&&m[0]!=="skip")for(_=(o?b.children.length:-1)+i,g=d.concat(b);_>-1&&_<b.children.length;){const x=b.children[_];if(p=a(x,_,g)(),p[0]===Zk)return p;_=typeof p[1]=="number"?p[1]:_+i}}return m}})(t,void 0,[])()}function Qk(t,e,n,o){let r,s,i;typeof e=="function"?(s=void 0,i=e,r=n):(s=e,i=n,r=o),CL(t,s,function(a,l){const c=l[l.length-1],d=c?c.children.indexOf(a):void 0;return i(a,d,c)},r)}const Df={}.hasOwnProperty,NL={};function jL(t,e){t.position&&(e.position=function(n){const o=xf(n),r=uk(n);if(o&&r)return{start:o,end:r}}(t))}function EL(t,e){let n=e;if(t&&t.data){const o=t.data.hName,r=t.data.hChildren,s=t.data.hProperties;typeof o=="string"&&(n.type==="element"?n.tagName=o:n={type:"element",tagName:o,properties:{},children:"children"in n?n.children:[n]}),n.type==="element"&&s&&Object.assign(n.properties,Xl(s)),"children"in n&&n.children&&r!=null&&(n.children=r)}return n}function IL(t,e){const n=e.data||{},o=!("value"in e)||Df.call(n,"hProperties")||Df.call(n,"hChildren")?{type:"element",tagName:"div",properties:{},children:t.all(e)}:{type:"text",value:e.value};return t.patch(e,o),t.applyData(e,o)}function AL(t,e){const n=[];let o=-1;for(e&&n.push({type:"text",value:`
134
+ `});const c={type:"element",tagName:"li",properties:s,children:i};return t.patch(e,c),t.applyData(e,c)},list:function(t,e){const n={},o=t.all(e);let r=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++r<o.length;){const i=o[r];if(i.type==="element"&&i.tagName==="li"&&i.properties&&Array.isArray(i.properties.className)&&i.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(o,!0)};return t.patch(e,s),t.applyData(e,s)},paragraph:function(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)},root:function(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)},strong:function(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)},table:function(t,e){const n=t.all(e),o=n.shift(),r=[];if(o){const i={type:"element",tagName:"thead",properties:{},children:t.wrap([o],!0)};t.patch(e.children[0],i),r.push(i)}if(n.length>0){const i={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},a=yf(e.children[1]),l=hk(e.children[e.children.length-1]);a&&l&&(i.position={start:a,end:l}),r.push(i)}const s={type:"element",tagName:"table",properties:{},children:t.wrap(r,!0)};return t.patch(e,s),t.applyData(e,s)},tableCell:function(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)},tableRow:function(t,e,n){const o=n?n.children:void 0,r=(o?o.indexOf(e):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,i=s?s.length:e.children.length;let a=-1;const l=[];for(;++a<i;){const d=e.children[a],u={},f=s?s[a]:void 0;f&&(u.align=f);let p={type:"element",tagName:r,properties:u,children:[]};d&&(p.children=t.all(d),t.patch(d,p),p=t.applyData(d,p)),l.push(p)}const c={type:"element",tagName:"tr",properties:{},children:t.wrap(l,!0)};return t.patch(e,c),t.applyData(e,c)},text:function(t,e){const n={type:"text",value:_L(String(e.value))};return t.patch(e,n),t.applyData(e,n)},thematicBreak:function(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)},toml:Jl,yaml:Jl,definition:Jl,footnoteDefinition:Jl};function Jl(){}const Yk=typeof self=="object"?self:globalThis,Jk=t=>((e,n)=>{const o=(s,i)=>(e.set(i,s),s),r=s=>{if(e.has(s))return e.get(s);const[i,a]=n[s];switch(i){case 0:case-1:return o(a,s);case 1:{const l=o([],s);for(const c of a)l.push(r(c));return l}case 2:{const l=o({},s);for(const[c,d]of a)l[r(c)]=r(d);return l}case 3:return o(new Date(a),s);case 4:{const{source:l,flags:c}=a;return o(new RegExp(l,c),s)}case 5:{const l=o(new Map,s);for(const[c,d]of a)l.set(r(c),r(d));return l}case 6:{const l=o(new Set,s);for(const c of a)l.add(r(c));return l}case 7:{const{name:l,message:c}=a;return o(new Yk[l](c),s)}case 8:return o(BigInt(a),s);case"BigInt":return o(Object(BigInt(a)),s)}return o(new Yk[i](a),s)};return r})(new Map,t)(0),ws="",{toString:yL}={},{keys:xL}=Object,Ji=t=>{const e=typeof t;if(e!=="object"||!t)return[0,e];const n=yL.call(t).slice(8,-1);switch(n){case"Array":return[1,ws];case"Object":return[2,ws];case"Date":return[3,ws];case"RegExp":return[4,ws];case"Map":return[5,ws];case"Set":return[6,ws]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},Kl=([t,e])=>t===0&&(e==="function"||e==="symbol"),Kk=(t,{json:e,lossy:n}={})=>{const o=[];return((r,s,i,a)=>{const l=(d,u)=>{const f=a.push(d)-1;return i.set(u,f),f},c=d=>{if(i.has(d))return i.get(d);let[u,f]=Ji(d);switch(u){case 0:{let _=d;switch(f){case"bigint":u=8,_=d.toString();break;case"function":case"symbol":if(r)throw new TypeError("unable to serialize "+f);_=null;break;case"undefined":return l([-1],d)}return l([u,_],d)}case 1:{if(f)return l([f,[...d]],d);const _=[],g=l([u,_],d);for(const m of d)_.push(c(m));return g}case 2:{if(f)switch(f){case"BigInt":return l([f,d.toString()],d);case"Boolean":case"Number":case"String":return l([f,d.valueOf()],d)}if(s&&"toJSON"in d)return c(d.toJSON());const _=[],g=l([u,_],d);for(const m of xL(d))!r&&Kl(Ji(d[m]))||_.push([c(m),c(d[m])]);return g}case 3:return l([u,d.toISOString()],d);case 4:{const{source:_,flags:g}=d;return l([u,{source:_,flags:g}],d)}case 5:{const _=[],g=l([u,_],d);for(const[m,b]of d)(r||!Kl(Ji(m))&&!Kl(Ji(b)))&&_.push([c(m),c(b)]);return g}case 6:{const _=[],g=l([u,_],d);for(const m of d)!r&&Kl(Ji(m))||_.push(c(m));return g}}const{message:p}=d;return l([u,{name:f,message:p}],d)};return c})(!(e||n),!!e,new Map,o)(t),o},Xl=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?Jk(Kk(t,e)):structuredClone(t):(t,e)=>Jk(Kk(t,e));function wL(t,e){const n=[{type:"text",value:"\u21A9"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function vL(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}const Xk=function(t){if(t==null)return kL;if(typeof t=="function")return Zl(t);if(typeof t=="object")return Array.isArray(t)?function(e){const n=[];let o=-1;for(;++o<e.length;)n[o]=Xk(e[o]);return Zl(r);function r(...s){let i=-1;for(;++i<n.length;)if(n[i].apply(this,s))return!0;return!1}}(t):function(e){const n=e;return Zl(o);function o(r){const s=r;let i;for(i in e)if(s[i]!==n[i])return!1;return!0}}(t);if(typeof t=="string")return function(e){return Zl(n);function n(o){return o&&o.type===e}}(t);throw new Error("Expected function, string, or object as test")};function Zl(t){return function(e,n,o){return!!(function(r){return r!==null&&typeof r=="object"&&"type"in r}(e)&&t.call(this,e,typeof n=="number"?n:void 0,o||void 0))}}function kL(){return!0}const Zk=[],SL=!0,Qk=!1;function CL(t,e,n,o){let r;typeof e=="function"&&typeof n!="function"?(o=n,n=e):r=e;const s=Xk(r),i=o?-1:1;(function a(l,c,d){const u=l&&typeof l=="object"?l:{};if(typeof u.type=="string"){const p=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(f,"name",{value:"node ("+l.type+(p?"<"+p+">":"")+")"})}return f;function f(){let p,_,g,m=Zk;if((!e||s(l,c,d[d.length-1]||void 0))&&(m=function(b){return Array.isArray(b)?b:typeof b=="number"?[SL,b]:b==null?Zk:[b]}(n(l,d)),m[0]===Qk))return m;if("children"in l&&l.children){const b=l;if(b.children&&m[0]!=="skip")for(_=(o?b.children.length:-1)+i,g=d.concat(b);_>-1&&_<b.children.length;){const x=b.children[_];if(p=a(x,_,g)(),p[0]===Qk)return p;_=typeof p[1]=="number"?p[1]:_+i}}return m}})(t,void 0,[])()}function e3(t,e,n,o){let r,s,i;typeof e=="function"?(s=void 0,i=e,r=n):(s=e,i=n,r=o),CL(t,s,function(a,l){const c=l[l.length-1],d=c?c.children.indexOf(a):void 0;return i(a,d,c)},r)}const Of={}.hasOwnProperty,NL={};function jL(t,e){t.position&&(e.position=function(n){const o=yf(n),r=hk(n);if(o&&r)return{start:o,end:r}}(t))}function EL(t,e){let n=e;if(t&&t.data){const o=t.data.hName,r=t.data.hChildren,s=t.data.hProperties;typeof o=="string"&&(n.type==="element"?n.tagName=o:n={type:"element",tagName:o,properties:{},children:"children"in n?n.children:[n]}),n.type==="element"&&s&&Object.assign(n.properties,Xl(s)),"children"in n&&n.children&&r!=null&&(n.children=r)}return n}function IL(t,e){const n=e.data||{},o=!("value"in e)||Of.call(n,"hProperties")||Of.call(n,"hChildren")?{type:"element",tagName:"div",properties:{},children:t.all(e)}:{type:"text",value:e.value};return t.patch(e,o),t.applyData(e,o)}function AL(t,e){const n=[];let o=-1;for(e&&n.push({type:"text",value:`
135
135
  `});++o<t.length;)o&&n.push({type:"text",value:`
136
136
  `}),n.push(t[o]);return e&&t.length>0&&n.push({type:"text",value:`
137
- `}),n}function e3(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function t3(t,e){const n=function(i,a){const l=a||NL,c=new Map,d=new Map,u=new Map,f={...bL,...l.handlers},p={all:function(_){const g=[];if("children"in _){const m=_.children;let b=-1;for(;++b<m.length;){const x=p.one(m[b],_);if(x){if(b&&m[b-1].type==="break"&&(Array.isArray(x)||x.type!=="text"||(x.value=e3(x.value)),!Array.isArray(x)&&x.type==="element")){const y=x.children[0];y&&y.type==="text"&&(y.value=e3(y.value))}Array.isArray(x)?g.push(...x):g.push(x)}}}return g},applyData:EL,definitionById:c,footnoteById:d,footnoteCounts:u,footnoteOrder:[],handlers:f,one:function(_,g){const m=_.type,b=p.handlers[m];if(Df.call(p.handlers,m)&&b)return b(p,_,g);if(p.options.passThrough&&p.options.passThrough.includes(m)){if("children"in _){const{children:x,...y}=_,v=Xl(y);return v.children=p.all(_),v}return Xl(_)}return(p.options.unknownHandler||IL)(p,_,g)},options:l,patch:jL,wrap:AL};return Qk(i,function(_){if(_.type==="definition"||_.type==="footnoteDefinition"){const g=_.type==="definition"?c:d,m=String(_.identifier).toUpperCase();g.has(m)||g.set(m,_)}}),p}(t,e),o=n.one(t,void 0),r=function(i){const a=typeof i.options.clobberPrefix=="string"?i.options.clobberPrefix:"user-content-",l=i.options.footnoteBackContent||wL,c=i.options.footnoteBackLabel||vL,d=i.options.footnoteLabel||"Footnotes",u=i.options.footnoteLabelTagName||"h2",f=i.options.footnoteLabelProperties||{className:["sr-only"]},p=[];let _=-1;for(;++_<i.footnoteOrder.length;){const g=i.footnoteById.get(i.footnoteOrder[_]);if(!g)continue;const m=i.all(g),b=String(g.identifier).toUpperCase(),x=xs(b.toLowerCase());let y=0;const v=[],S=i.footnoteCounts.get(b);for(;S!==void 0&&++y<=S;){v.length>0&&v.push({type:"text",value:" "});let j=typeof l=="string"?l:l(_,y);typeof j=="string"&&(j={type:"text",value:j}),v.push({type:"element",tagName:"a",properties:{href:"#"+a+"fnref-"+x+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof c=="string"?c:c(_,y),className:["data-footnote-backref"]},children:Array.isArray(j)?j:[j]})}const k=m[m.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const j=k.children[k.children.length-1];j&&j.type==="text"?j.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...v)}else m.push(...v);const I={type:"element",tagName:"li",properties:{id:a+"fn-"+x},children:i.wrap(m,!0)};i.patch(g,I),p.push(I)}if(p.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...Xl(f),id:"footnote-label"},children:[{type:"text",value:d}]},{type:"text",value:`
137
+ `}),n}function t3(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function n3(t,e){const n=function(i,a){const l=a||NL,c=new Map,d=new Map,u=new Map,f={...bL,...l.handlers},p={all:function(_){const g=[];if("children"in _){const m=_.children;let b=-1;for(;++b<m.length;){const x=p.one(m[b],_);if(x){if(b&&m[b-1].type==="break"&&(Array.isArray(x)||x.type!=="text"||(x.value=t3(x.value)),!Array.isArray(x)&&x.type==="element")){const y=x.children[0];y&&y.type==="text"&&(y.value=t3(y.value))}Array.isArray(x)?g.push(...x):g.push(x)}}}return g},applyData:EL,definitionById:c,footnoteById:d,footnoteCounts:u,footnoteOrder:[],handlers:f,one:function(_,g){const m=_.type,b=p.handlers[m];if(Of.call(p.handlers,m)&&b)return b(p,_,g);if(p.options.passThrough&&p.options.passThrough.includes(m)){if("children"in _){const{children:x,...y}=_,v=Xl(y);return v.children=p.all(_),v}return Xl(_)}return(p.options.unknownHandler||IL)(p,_,g)},options:l,patch:jL,wrap:AL};return e3(i,function(_){if(_.type==="definition"||_.type==="footnoteDefinition"){const g=_.type==="definition"?c:d,m=String(_.identifier).toUpperCase();g.has(m)||g.set(m,_)}}),p}(t,e),o=n.one(t,void 0),r=function(i){const a=typeof i.options.clobberPrefix=="string"?i.options.clobberPrefix:"user-content-",l=i.options.footnoteBackContent||wL,c=i.options.footnoteBackLabel||vL,d=i.options.footnoteLabel||"Footnotes",u=i.options.footnoteLabelTagName||"h2",f=i.options.footnoteLabelProperties||{className:["sr-only"]},p=[];let _=-1;for(;++_<i.footnoteOrder.length;){const g=i.footnoteById.get(i.footnoteOrder[_]);if(!g)continue;const m=i.all(g),b=String(g.identifier).toUpperCase(),x=xs(b.toLowerCase());let y=0;const v=[],S=i.footnoteCounts.get(b);for(;S!==void 0&&++y<=S;){v.length>0&&v.push({type:"text",value:" "});let j=typeof l=="string"?l:l(_,y);typeof j=="string"&&(j={type:"text",value:j}),v.push({type:"element",tagName:"a",properties:{href:"#"+a+"fnref-"+x+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof c=="string"?c:c(_,y),className:["data-footnote-backref"]},children:Array.isArray(j)?j:[j]})}const k=m[m.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const j=k.children[k.children.length-1];j&&j.type==="text"?j.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...v)}else m.push(...v);const I={type:"element",tagName:"li",properties:{id:a+"fn-"+x},children:i.wrap(m,!0)};i.patch(g,I),p.push(I)}if(p.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...Xl(f),id:"footnote-label"},children:[{type:"text",value:d}]},{type:"text",value:`
138
138
  `},{type:"element",tagName:"ol",properties:{},children:i.wrap(p,!0)},{type:"text",value:`
139
139
  `}]}}(n),s=Array.isArray(o)?{type:"root",children:o}:o||{type:"root",children:[]};return r&&s.children.push({type:"text",value:`
140
- `},r),s}function TL(t,e){return t&&"run"in t?async function(n,o){const r=t3(n,{file:o,...e});await t.run(r,o)}:function(n,o){return t3(n,{file:o,...t||e})}}function n3(t){if(t)throw t}var Rf,o3,ML=function(){if(o3)return Rf;o3=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,r=function(l){return typeof Array.isArray=="function"?Array.isArray(l):e.call(l)==="[object Array]"},s=function(l){if(!l||e.call(l)!=="[object Object]")return!1;var c,d=t.call(l,"constructor"),u=l.constructor&&l.constructor.prototype&&t.call(l.constructor.prototype,"isPrototypeOf");if(l.constructor&&!d&&!u)return!1;for(c in l);return c===void 0||t.call(l,c)},i=function(l,c){n&&c.name==="__proto__"?n(l,c.name,{enumerable:!0,configurable:!0,value:c.newValue,writable:!0}):l[c.name]=c.newValue},a=function(l,c){if(c==="__proto__"){if(!t.call(l,c))return;if(o)return o(l,c).value}return l[c]};return Rf=function l(){var c,d,u,f,p,_,g=arguments[0],m=1,b=arguments.length,x=!1;for(typeof g=="boolean"&&(x=g,g=arguments[1]||{},m=2),(g==null||typeof g!="object"&&typeof g!="function")&&(g={});m<b;++m)if((c=arguments[m])!=null)for(d in c)u=a(g,d),g!==(f=a(c,d))&&(x&&f&&(s(f)||(p=r(f)))?(p?(p=!1,_=u&&r(u)?u:[]):_=u&&s(u)?u:{},i(g,{name:d,newValue:l(x,_,f)})):f!==void 0&&i(g,{name:d,newValue:f}));return g},Rf}();const Pf=iS(ML);function Lf(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return!(e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.toStringTag in t||Symbol.iterator in t)}function OL(){const t=[],e={run:function(...n){let o=-1;const r=n.pop();if(typeof r!="function")throw new TypeError("Expected function as last argument, not "+r);(function s(i,...a){const l=t[++o];let c=-1;if(i)r(i);else{for(;++c<n.length;)a[c]!==null&&a[c]!==void 0||(a[c]=n[c]);n=a,l?function(d,u){let f;return p;function p(...m){const b=d.length>m.length;let x;b&&m.push(_);try{x=d.apply(this,m)}catch(y){if(b&&f)throw y;return _(y)}b||(x&&x.then&&typeof x.then=="function"?x.then(g,_):x instanceof Error?_(x):g(x))}function _(m,...b){f||(f=!0,u(m,...b))}function g(m){_(null,m)}}(l,s)(...a):r(null,...a)}})(null,...n)},use:function(n){if(typeof n!="function")throw new TypeError("Expected `middelware` to be a function, not "+n);return t.push(n),e}};return e}const uo={basename:function(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');Ki(t);let n,o=0,r=-1,s=t.length;if(e===void 0||e.length===0||e.length>t.length){for(;s--;)if(t.codePointAt(s)===47){if(n){o=s+1;break}}else r<0&&(n=!0,r=s+1);return r<0?"":t.slice(o,r)}if(e===t)return"";let i=-1,a=e.length-1;for(;s--;)if(t.codePointAt(s)===47){if(n){o=s+1;break}}else i<0&&(n=!0,i=s+1),a>-1&&(t.codePointAt(s)===e.codePointAt(a--)?a<0&&(r=s):(a=-1,r=i));return o===r?r=i:r<0&&(r=t.length),t.slice(o,r)},dirname:function(t){if(Ki(t),t.length===0)return".";let e,n=-1,o=t.length;for(;--o;)if(t.codePointAt(o)===47){if(e){n=o;break}}else e||(e=!0);return n<0?t.codePointAt(0)===47?"/":".":n===1&&t.codePointAt(0)===47?"//":t.slice(0,n)},extname:function(t){Ki(t);let e,n=t.length,o=-1,r=0,s=-1,i=0;for(;n--;){const a=t.codePointAt(n);if(a!==47)o<0&&(e=!0,o=n+1),a===46?s<0?s=n:i!==1&&(i=1):s>-1&&(i=-1);else if(e){r=n+1;break}}return s<0||o<0||i===0||i===1&&s===o-1&&s===r+1?"":t.slice(s,o)},join:function(...t){let e,n=-1;for(;++n<t.length;)Ki(t[n]),t[n]&&(e=e===void 0?t[n]:e+"/"+t[n]);return e===void 0?".":function(o){Ki(o);const r=o.codePointAt(0)===47;let s=function(i,a){let l,c,d="",u=0,f=-1,p=0,_=-1;for(;++_<=i.length;){if(_<i.length)l=i.codePointAt(_);else{if(l===47)break;l=47}if(l===47){if(!(f===_-1||p===1))if(f!==_-1&&p===2){if(d.length<2||u!==2||d.codePointAt(d.length-1)!==46||d.codePointAt(d.length-2)!==46){if(d.length>2){if(c=d.lastIndexOf("/"),c!==d.length-1){c<0?(d="",u=0):(d=d.slice(0,c),u=d.length-1-d.lastIndexOf("/")),f=_,p=0;continue}}else if(d.length>0){d="",u=0,f=_,p=0;continue}}a&&(d=d.length>0?d+"/..":"..",u=2)}else d.length>0?d+="/"+i.slice(f+1,_):d=i.slice(f+1,_),u=_-f-1;f=_,p=0}else l===46&&p>-1?p++:p=-1}return d}(o,!r);return s.length!==0||r||(s="."),s.length>0&&o.codePointAt(o.length-1)===47&&(s+="/"),r?"/"+s:s}(e)},sep:"/"};function Ki(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const DL={cwd:function(){return"/"}};function Ff(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function RL(t){if(typeof t=="string")t=new URL(t);else if(!Ff(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let o=-1;for(;++o<n.length;)if(n.codePointAt(o)===37&&n.codePointAt(o+1)===50){const r=n.codePointAt(o+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(n)}(t)}const zf=["history","path","basename","stem","extname","dirname"];class r3{constructor(e){let n;n=e?Ff(e)?{path:e}:typeof e=="string"||function(s){return!!(s&&typeof s=="object"&&"byteLength"in s&&"byteOffset"in s)}(e)?{value:e}:e:{},this.cwd="cwd"in n?"":DL.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let o,r=-1;for(;++r<zf.length;){const s=zf[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}for(o in n)zf.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?uo.basename(this.path):void 0}set basename(e){Uf(e,"basename"),Bf(e,"basename"),this.path=uo.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?uo.dirname(this.path):void 0}set dirname(e){s3(this.basename,"dirname"),this.path=uo.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?uo.extname(this.path):void 0}set extname(e){if(Bf(e,"extname"),s3(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=uo.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Ff(e)&&(e=RL(e)),Uf(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?uo.basename(this.path,this.extname):void 0}set stem(e){Uf(e,"stem"),Bf(e,"stem"),this.path=uo.join(this.dirname||"",e+(this.extname||""))}fail(e,n,o){const r=this.message(e,n,o);throw r.fatal=!0,r}info(e,n,o){const r=this.message(e,n,o);return r.fatal=void 0,r}message(e,n,o){const r=new on(e,n,o);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function Bf(t,e){if(t&&t.includes(uo.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+uo.sep+"`")}function Uf(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function s3(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}const PL=function(t){const e=this.constructor.prototype,n=e[t],o=function(){return n.apply(o,arguments)};return Object.setPrototypeOf(o,e),o},LL={}.hasOwnProperty;class Vf extends PL{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=OL()}copy(){const e=new Vf;let n=-1;for(;++n<this.attachers.length;){const o=this.attachers[n];e.use(...o)}return e.data(Pf(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(Wf("data",this.frozen),this.namespace[e]=n,this):LL.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Wf("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...o]=this.attachers[this.freezeIndex];if(o[0]===!1)continue;o[0]===!0&&(o[0]=void 0);const r=n.call(e,...o);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=Ql(e),o=this.parser||this.Parser;return Hf("parse",o),o(String(n),n)}process(e,n){const o=this;return this.freeze(),Hf("process",this.parser||this.Parser),$f("process",this.compiler||this.Compiler),n?r(void 0,n):new Promise(r);function r(s,i){const a=Ql(e),l=o.parse(a);function c(d,u){d||!u?i(d):s?s(u):n(void 0,u)}o.run(l,a,function(d,u,f){if(d||!u||!f)return c(d);const p=u,_=o.stringify(p,f);var g;typeof(g=_)=="string"||function(m){return!!(m&&typeof m=="object"&&"byteLength"in m&&"byteOffset"in m)}(g)?f.value=_:f.result=_,c(d,f)})}}processSync(e){let n,o=!1;return this.freeze(),Hf("processSync",this.parser||this.Parser),$f("processSync",this.compiler||this.Compiler),this.process(e,function(r,s){o=!0,n3(r),n=s}),a3("processSync","process",o),n}run(e,n,o){i3(e),this.freeze();const r=this.transformers;return o||typeof n!="function"||(o=n,n=void 0),o?s(void 0,o):new Promise(s);function s(i,a){const l=Ql(n);r.run(e,l,function(c,d,u){const f=d||e;c?a(c):i?i(f):o(void 0,f,u)})}}runSync(e,n){let o,r=!1;return this.run(e,n,function(s,i){n3(s),o=i,r=!0}),a3("runSync","run",r),o}stringify(e,n){this.freeze();const o=Ql(n),r=this.compiler||this.Compiler;return $f("stringify",r),i3(e),r(e,o)}use(e,...n){const o=this.attachers,r=this.namespace;if(Wf("use",this.frozen),e!=null)if(typeof e=="function")l(e,n);else{if(typeof e!="object")throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?a(e):i(e)}return this;function s(c){if(typeof c=="function")l(c,[]);else{if(typeof c!="object")throw new TypeError("Expected usable value, not `"+c+"`");if(Array.isArray(c)){const[d,...u]=c;l(d,u)}else i(c)}}function i(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(r.settings=Pf(!0,r.settings,c.settings))}function a(c){let d=-1;if(c!=null){if(!Array.isArray(c))throw new TypeError("Expected a list of plugins, not `"+c+"`");for(;++d<c.length;)s(c[d])}}function l(c,d){let u=-1,f=-1;for(;++u<o.length;)if(o[u][0]===c){f=u;break}if(f===-1)o.push([c,...d]);else if(d.length>0){let[p,..._]=d;const g=o[f][1];Lf(g)&&Lf(p)&&(p=Pf(!0,g,p)),o[f]=[c,p,..._]}}}}const FL=new Vf().freeze();function Hf(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function $f(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Wf(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function i3(t){if(!Lf(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function a3(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Ql(t){return function(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}(t)?t:new r3(t)}const l3=[],c3={allowDangerousHtml:!0},zL=/^(https?|ircs?|mailto|xmpp)$/i,BL=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function UL(t){const e=function(o){const r=o.rehypePlugins||l3,s=o.remarkPlugins||l3,i=o.remarkRehypeOptions?{...o.remarkRehypeOptions,...c3}:c3;return FL().use(gL).use(s).use(TL,i).use(r)}(t),n=function(o){const r=o.children||"",s=new r3;return typeof r=="string"&&(s.value=r),s}(t);return function(o,r){const s=r.allowedElements,i=r.allowElement,a=r.components,l=r.disallowedElements,c=r.skipHtml,d=r.unwrapDisallowed,u=r.urlTransform||VL;for(const p of BL)Object.hasOwn(r,p.from)&&(p.from,p.to&&p.to,p.id);return r.className&&(o={type:"element",tagName:"div",properties:{className:r.className},children:o.type==="root"?o.children:[o]}),Qk(o,f),pP(o,{Fragment:h.Fragment,components:a,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function f(p,_,g){if(p.type==="raw"&&g&&typeof _=="number")return c?g.children.splice(_,1):g.children[_]={type:"text",value:p.value},_;if(p.type==="element"){let m;for(m in Cf)if(Object.hasOwn(Cf,m)&&Object.hasOwn(p.properties,m)){const b=p.properties[m],x=Cf[m];(x===null||x.includes(p.tagName))&&(p.properties[m]=u(String(b||""),m,p))}}if(p.type==="element"){let m=s?!s.includes(p.tagName):!!l&&l.includes(p.tagName);if(!m&&i&&typeof _=="number"&&(m=!i(p,_,g)),m&&g&&typeof _=="number")return d&&p.children?g.children.splice(_,1,...p.children):g.children.splice(_,1),_}}}(e.runSync(e.parse(n),n),t)}function VL(t){const e=t.indexOf(":"),n=t.indexOf("?"),o=t.indexOf("#"),r=t.indexOf("/");return e===-1||r!==-1&&e>r||n!==-1&&e>n||o!==-1&&e>o||zL.test(t.slice(0,e))?t:""}const HL=[st.lineWrapping],$L=new Set(["python","markdown","sql","json","yaml","toml","shell","javascript","typescript","jsx","tsx","css","html"]),WL=t=>{const e=X.c(26),{code:n,language:o}=t,{theme:r}=Fo(),{createNewCell:s}=Lt(),i=zs(),a=We(Ts),[l,c]=A.useState(n);let d,u,f;e[0]!==n?(d=()=>{c(n)},u=[n],e[0]=n,e[1]=d,e[2]=u):(d=e[1],u=e[2]),A.useEffect(d,u),e[3]!==a||e[4]!==s||e[5]!==o||e[6]!==i||e[7]!==l?(f=()=>{const j=function(E,T){return E?E==="python"?{language:E,code:T}:E==="sql"?{language:"python",code:Ic.fromQuery(T)}:E==="markdown"?{language:"python",code:ta.fromMarkdown(T)}:E==="shell"||E==="bash"?{language:"python",code:`import subprocess
140
+ `},r),s}function TL(t,e){return t&&"run"in t?async function(n,o){const r=n3(n,{file:o,...e});await t.run(r,o)}:function(n,o){return n3(n,{file:o,...t||e})}}function o3(t){if(t)throw t}var Df,r3,ML=function(){if(r3)return Df;r3=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,r=function(l){return typeof Array.isArray=="function"?Array.isArray(l):e.call(l)==="[object Array]"},s=function(l){if(!l||e.call(l)!=="[object Object]")return!1;var c,d=t.call(l,"constructor"),u=l.constructor&&l.constructor.prototype&&t.call(l.constructor.prototype,"isPrototypeOf");if(l.constructor&&!d&&!u)return!1;for(c in l);return c===void 0||t.call(l,c)},i=function(l,c){n&&c.name==="__proto__"?n(l,c.name,{enumerable:!0,configurable:!0,value:c.newValue,writable:!0}):l[c.name]=c.newValue},a=function(l,c){if(c==="__proto__"){if(!t.call(l,c))return;if(o)return o(l,c).value}return l[c]};return Df=function l(){var c,d,u,f,p,_,g=arguments[0],m=1,b=arguments.length,x=!1;for(typeof g=="boolean"&&(x=g,g=arguments[1]||{},m=2),(g==null||typeof g!="object"&&typeof g!="function")&&(g={});m<b;++m)if((c=arguments[m])!=null)for(d in c)u=a(g,d),g!==(f=a(c,d))&&(x&&f&&(s(f)||(p=r(f)))?(p?(p=!1,_=u&&r(u)?u:[]):_=u&&s(u)?u:{},i(g,{name:d,newValue:l(x,_,f)})):f!==void 0&&i(g,{name:d,newValue:f}));return g},Df}();const Rf=iS(ML);function Pf(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return!(e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.toStringTag in t||Symbol.iterator in t)}function OL(){const t=[],e={run:function(...n){let o=-1;const r=n.pop();if(typeof r!="function")throw new TypeError("Expected function as last argument, not "+r);(function s(i,...a){const l=t[++o];let c=-1;if(i)r(i);else{for(;++c<n.length;)a[c]!==null&&a[c]!==void 0||(a[c]=n[c]);n=a,l?function(d,u){let f;return p;function p(...m){const b=d.length>m.length;let x;b&&m.push(_);try{x=d.apply(this,m)}catch(y){if(b&&f)throw y;return _(y)}b||(x&&x.then&&typeof x.then=="function"?x.then(g,_):x instanceof Error?_(x):g(x))}function _(m,...b){f||(f=!0,u(m,...b))}function g(m){_(null,m)}}(l,s)(...a):r(null,...a)}})(null,...n)},use:function(n){if(typeof n!="function")throw new TypeError("Expected `middelware` to be a function, not "+n);return t.push(n),e}};return e}const uo={basename:function(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');Ki(t);let n,o=0,r=-1,s=t.length;if(e===void 0||e.length===0||e.length>t.length){for(;s--;)if(t.codePointAt(s)===47){if(n){o=s+1;break}}else r<0&&(n=!0,r=s+1);return r<0?"":t.slice(o,r)}if(e===t)return"";let i=-1,a=e.length-1;for(;s--;)if(t.codePointAt(s)===47){if(n){o=s+1;break}}else i<0&&(n=!0,i=s+1),a>-1&&(t.codePointAt(s)===e.codePointAt(a--)?a<0&&(r=s):(a=-1,r=i));return o===r?r=i:r<0&&(r=t.length),t.slice(o,r)},dirname:function(t){if(Ki(t),t.length===0)return".";let e,n=-1,o=t.length;for(;--o;)if(t.codePointAt(o)===47){if(e){n=o;break}}else e||(e=!0);return n<0?t.codePointAt(0)===47?"/":".":n===1&&t.codePointAt(0)===47?"//":t.slice(0,n)},extname:function(t){Ki(t);let e,n=t.length,o=-1,r=0,s=-1,i=0;for(;n--;){const a=t.codePointAt(n);if(a!==47)o<0&&(e=!0,o=n+1),a===46?s<0?s=n:i!==1&&(i=1):s>-1&&(i=-1);else if(e){r=n+1;break}}return s<0||o<0||i===0||i===1&&s===o-1&&s===r+1?"":t.slice(s,o)},join:function(...t){let e,n=-1;for(;++n<t.length;)Ki(t[n]),t[n]&&(e=e===void 0?t[n]:e+"/"+t[n]);return e===void 0?".":function(o){Ki(o);const r=o.codePointAt(0)===47;let s=function(i,a){let l,c,d="",u=0,f=-1,p=0,_=-1;for(;++_<=i.length;){if(_<i.length)l=i.codePointAt(_);else{if(l===47)break;l=47}if(l===47){if(!(f===_-1||p===1))if(f!==_-1&&p===2){if(d.length<2||u!==2||d.codePointAt(d.length-1)!==46||d.codePointAt(d.length-2)!==46){if(d.length>2){if(c=d.lastIndexOf("/"),c!==d.length-1){c<0?(d="",u=0):(d=d.slice(0,c),u=d.length-1-d.lastIndexOf("/")),f=_,p=0;continue}}else if(d.length>0){d="",u=0,f=_,p=0;continue}}a&&(d=d.length>0?d+"/..":"..",u=2)}else d.length>0?d+="/"+i.slice(f+1,_):d=i.slice(f+1,_),u=_-f-1;f=_,p=0}else l===46&&p>-1?p++:p=-1}return d}(o,!r);return s.length!==0||r||(s="."),s.length>0&&o.codePointAt(o.length-1)===47&&(s+="/"),r?"/"+s:s}(e)},sep:"/"};function Ki(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const DL={cwd:function(){return"/"}};function Lf(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function RL(t){if(typeof t=="string")t=new URL(t);else if(!Lf(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let o=-1;for(;++o<n.length;)if(n.codePointAt(o)===37&&n.codePointAt(o+1)===50){const r=n.codePointAt(o+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(n)}(t)}const Ff=["history","path","basename","stem","extname","dirname"];class s3{constructor(e){let n;n=e?Lf(e)?{path:e}:typeof e=="string"||function(s){return!!(s&&typeof s=="object"&&"byteLength"in s&&"byteOffset"in s)}(e)?{value:e}:e:{},this.cwd="cwd"in n?"":DL.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let o,r=-1;for(;++r<Ff.length;){const s=Ff[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}for(o in n)Ff.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?uo.basename(this.path):void 0}set basename(e){Bf(e,"basename"),zf(e,"basename"),this.path=uo.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?uo.dirname(this.path):void 0}set dirname(e){i3(this.basename,"dirname"),this.path=uo.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?uo.extname(this.path):void 0}set extname(e){if(zf(e,"extname"),i3(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=uo.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Lf(e)&&(e=RL(e)),Bf(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?uo.basename(this.path,this.extname):void 0}set stem(e){Bf(e,"stem"),zf(e,"stem"),this.path=uo.join(this.dirname||"",e+(this.extname||""))}fail(e,n,o){const r=this.message(e,n,o);throw r.fatal=!0,r}info(e,n,o){const r=this.message(e,n,o);return r.fatal=void 0,r}message(e,n,o){const r=new on(e,n,o);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function zf(t,e){if(t&&t.includes(uo.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+uo.sep+"`")}function Bf(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function i3(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}const PL=function(t){const e=this.constructor.prototype,n=e[t],o=function(){return n.apply(o,arguments)};return Object.setPrototypeOf(o,e),o},LL={}.hasOwnProperty;class Uf extends PL{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=OL()}copy(){const e=new Uf;let n=-1;for(;++n<this.attachers.length;){const o=this.attachers[n];e.use(...o)}return e.data(Rf(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?($f("data",this.frozen),this.namespace[e]=n,this):LL.call(this.namespace,e)&&this.namespace[e]||void 0:e?($f("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...o]=this.attachers[this.freezeIndex];if(o[0]===!1)continue;o[0]===!0&&(o[0]=void 0);const r=n.call(e,...o);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=Ql(e),o=this.parser||this.Parser;return Vf("parse",o),o(String(n),n)}process(e,n){const o=this;return this.freeze(),Vf("process",this.parser||this.Parser),Hf("process",this.compiler||this.Compiler),n?r(void 0,n):new Promise(r);function r(s,i){const a=Ql(e),l=o.parse(a);function c(d,u){d||!u?i(d):s?s(u):n(void 0,u)}o.run(l,a,function(d,u,f){if(d||!u||!f)return c(d);const p=u,_=o.stringify(p,f);var g;typeof(g=_)=="string"||function(m){return!!(m&&typeof m=="object"&&"byteLength"in m&&"byteOffset"in m)}(g)?f.value=_:f.result=_,c(d,f)})}}processSync(e){let n,o=!1;return this.freeze(),Vf("processSync",this.parser||this.Parser),Hf("processSync",this.compiler||this.Compiler),this.process(e,function(r,s){o=!0,o3(r),n=s}),l3("processSync","process",o),n}run(e,n,o){a3(e),this.freeze();const r=this.transformers;return o||typeof n!="function"||(o=n,n=void 0),o?s(void 0,o):new Promise(s);function s(i,a){const l=Ql(n);r.run(e,l,function(c,d,u){const f=d||e;c?a(c):i?i(f):o(void 0,f,u)})}}runSync(e,n){let o,r=!1;return this.run(e,n,function(s,i){o3(s),o=i,r=!0}),l3("runSync","run",r),o}stringify(e,n){this.freeze();const o=Ql(n),r=this.compiler||this.Compiler;return Hf("stringify",r),a3(e),r(e,o)}use(e,...n){const o=this.attachers,r=this.namespace;if($f("use",this.frozen),e!=null)if(typeof e=="function")l(e,n);else{if(typeof e!="object")throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?a(e):i(e)}return this;function s(c){if(typeof c=="function")l(c,[]);else{if(typeof c!="object")throw new TypeError("Expected usable value, not `"+c+"`");if(Array.isArray(c)){const[d,...u]=c;l(d,u)}else i(c)}}function i(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(r.settings=Rf(!0,r.settings,c.settings))}function a(c){let d=-1;if(c!=null){if(!Array.isArray(c))throw new TypeError("Expected a list of plugins, not `"+c+"`");for(;++d<c.length;)s(c[d])}}function l(c,d){let u=-1,f=-1;for(;++u<o.length;)if(o[u][0]===c){f=u;break}if(f===-1)o.push([c,...d]);else if(d.length>0){let[p,..._]=d;const g=o[f][1];Pf(g)&&Pf(p)&&(p=Rf(!0,g,p)),o[f]=[c,p,..._]}}}}const FL=new Uf().freeze();function Vf(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Hf(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function $f(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function a3(t){if(!Pf(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function l3(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Ql(t){return function(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}(t)?t:new s3(t)}const c3=[],d3={allowDangerousHtml:!0},zL=/^(https?|ircs?|mailto|xmpp)$/i,BL=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function UL(t){const e=function(o){const r=o.rehypePlugins||c3,s=o.remarkPlugins||c3,i=o.remarkRehypeOptions?{...o.remarkRehypeOptions,...d3}:d3;return FL().use(gL).use(s).use(TL,i).use(r)}(t),n=function(o){const r=o.children||"",s=new s3;return typeof r=="string"&&(s.value=r),s}(t);return function(o,r){const s=r.allowedElements,i=r.allowElement,a=r.components,l=r.disallowedElements,c=r.skipHtml,d=r.unwrapDisallowed,u=r.urlTransform||VL;for(const p of BL)Object.hasOwn(r,p.from)&&(p.from,p.to&&p.to,p.id);return r.className&&(o={type:"element",tagName:"div",properties:{className:r.className},children:o.type==="root"?o.children:[o]}),e3(o,f),pP(o,{Fragment:h.Fragment,components:a,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function f(p,_,g){if(p.type==="raw"&&g&&typeof _=="number")return c?g.children.splice(_,1):g.children[_]={type:"text",value:p.value},_;if(p.type==="element"){let m;for(m in Sf)if(Object.hasOwn(Sf,m)&&Object.hasOwn(p.properties,m)){const b=p.properties[m],x=Sf[m];(x===null||x.includes(p.tagName))&&(p.properties[m]=u(String(b||""),m,p))}}if(p.type==="element"){let m=s?!s.includes(p.tagName):!!l&&l.includes(p.tagName);if(!m&&i&&typeof _=="number"&&(m=!i(p,_,g)),m&&g&&typeof _=="number")return d&&p.children?g.children.splice(_,1,...p.children):g.children.splice(_,1),_}}}(e.runSync(e.parse(n),n),t)}function VL(t){const e=t.indexOf(":"),n=t.indexOf("?"),o=t.indexOf("#"),r=t.indexOf("/");return e===-1||r!==-1&&e>r||n!==-1&&e>n||o!==-1&&e>o||zL.test(t.slice(0,e))?t:""}const HL=[st.lineWrapping],$L=new Set(["python","markdown","sql","json","yaml","toml","shell","javascript","typescript","jsx","tsx","css","html"]),WL=t=>{const e=X.c(26),{code:n,language:o}=t,{theme:r}=Fo(),{createNewCell:s}=Lt(),i=zs(),a=We(Ts),[l,c]=A.useState(n);let d,u,f;e[0]!==n?(d=()=>{c(n)},u=[n],e[0]=n,e[1]=d,e[2]=u):(d=e[1],u=e[2]),A.useEffect(d,u),e[3]!==a||e[4]!==s||e[5]!==o||e[6]!==i||e[7]!==l?(f=()=>{const j=function(E,T){return E?E==="python"?{language:E,code:T}:E==="sql"?{language:"python",code:Ic.fromQuery(T)}:E==="markdown"?{language:"python",code:ta.fromMarkdown(T)}:E==="shell"||E==="bash"?{language:"python",code:`import subprocess
141
141
  subprocess.run("${T}")`}:{language:"python",code:`_${E} = """
142
142
  ${T}
143
- """`}:{language:"python",code:T}}(o,l);o==="sql"&&ar(a,s,i),s({code:j.code,before:!1,cellId:i??"__end__"})},e[3]=a,e[4]=s,e[5]=o,e[6]=i,e[7]=l,e[8]=f):f=e[8];const p=f;let _;e[9]!==l?(_=async()=>{await yn(l)},e[9]=l,e[10]=_):_=e[10];const g=_,m=r==="dark"?"dark":"light",b=o&&$L.has(o)?o:void 0;let x,y,v,S,k,I;return e[11]!==m||e[12]!==b||e[13]!==l?(x=h.jsx(_a,{theme:m,language:b,className:"cm border rounded overflow-hidden",extensions:HL,value:l,onChange:c}),e[11]=m,e[12]=b,e[13]=l,e[14]=x):x=e[14],e[15]!==g?(y=h.jsx(qL,{size:"xs",variant:"outline",onClick:g,children:"Copy"}),e[15]=g,e[16]=y):y=e[16],e[17]===Symbol.for("react.memo_cache_sentinel")?(v=h.jsx(ti,{className:"ml-2 h-4 w-4"}),e[17]=v):v=e[17],e[18]!==p?(S=h.jsxs(Pe,{size:"xs",variant:"outline",onClick:p,children:["Add to Notebook",v]}),e[18]=p,e[19]=S):S=e[19],e[20]!==S||e[21]!==y?(k=h.jsxs("div",{className:"flex justify-end mt-2 space-x-2",children:[y,S]}),e[20]=S,e[21]=y,e[22]=k):k=e[22],e[23]!==k||e[24]!==x?(I=h.jsxs("div",{className:"relative",children:[x,k]}),e[23]=k,e[24]=x,e[25]=I):I=e[25],I},qL=t=>{const e=X.c(12);let n,o;e[0]!==t?({onClick:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);const[r,s]=A.useState(!1);let i,a,l;e[3]!==r?(i=()=>{r&&setTimeout(()=>s(!1),1e3)},a=[r],e[3]=r,e[4]=i,e[5]=a):(i=e[4],a=e[5]),A.useEffect(i,a),e[6]!==n?(l=u=>{n==null||n(u),s(!0)},e[6]=n,e[7]=l):l=e[7];const c=r?"Copied":"Copy";let d;return e[8]!==o||e[9]!==l||e[10]!==c?(d=h.jsx(Pe,{...o,onClick:l,children:c}),e[8]=o,e[9]=l,e[10]=c,e[11]=d):d=e[11],d},GL={code:({children:t,className:e})=>{const n=e==null?void 0:e.replace("language-","");return n&&typeof t=="string"?h.jsxs("div",{children:[h.jsx("div",{className:"text-xs text-muted-foreground pl-1",children:n}),h.jsx(WL,{code:t.trim(),language:n})]}):h.jsx("code",{className:e,children:t})}},d3=A.memo(t=>{const e=X.c(2),{content:n}=t;let o;return e[0]!==n?(o=h.jsx(UL,{components:GL,className:"prose dark:prose-invert max-w-none prose-pre:pl-0",children:n}),e[0]=n,e[1]=o):o=e[1],o},(t,e)=>t.content===e.content);d3.displayName="MemoizedMarkdownBlock";const u3=A.memo(({content:t})=>{const e=A.useMemo(()=>{return n=t,QV.lexer(n).map(o=>o.raw);var n},[t]);return h.jsx(h.Fragment,{children:e.map((n,o)=>h.jsx(d3,{content:n},`markdown-block-${o}`))})});u3.displayName="MarkdownRenderer";const qf=(t,e,n,o,r)=>e?{...t,chats:t.chats.map(s=>s.id===e?{...s,messages:[...s.messages,{role:n,content:o,timestamp:Date.now(),parts:r}],updatedAt:Date.now()}:s)}:(Zt.warn("No active chat"),t),YL=t=>{const e=X.c(13),{reasoning:n,index:o,isStreaming:r}=t,s=o===void 0?0:o,i=r!==void 0&&r,a=i?"reasoning":void 0;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=h.jsx(pc,{className:"h-3 w-3"}),e[0]=l):l=e[0];const c=i?"Thinking":"View reasoning";let d,u,f,p;return e[1]!==n.length||e[2]!==c?(d=h.jsx(eH,{className:"text-xs text-muted-foreground hover:bg-muted/50 px-2 py-1 h-auto rounded-sm [&[data-state=open]>svg]:rotate-180",children:h.jsxs("span",{className:"flex items-center gap-2",children:[l,c," (",n.length," ","chars)"]})}),e[1]=n.length,e[2]=c,e[3]=d):d=e[3],e[4]!==n?(u=h.jsx(tH,{className:"pb-2 px-2",children:h.jsx(pf,{className:"max-h-[200px] w-full",children:h.jsx("div",{className:"bg-muted/30 border border-muted rounded-md p-3 text-xs font-mono whitespace-pre-wrap text-muted-foreground",children:n})})}),e[4]=n,e[5]=u):u=e[5],e[6]!==d||e[7]!==u?(f=h.jsxs(nH,{value:"reasoning",className:"border-0",children:[d,u]}),e[6]=d,e[7]=u,e[8]=f):f=e[8],e[9]!==s||e[10]!==a||e[11]!==f?(p=h.jsx(oH,{type:"single",collapsible:!0,className:"w-full mb-2",value:a,children:f},s),e[9]=s,e[10]=a,e[11]=f,e[12]=p):p=e[12],p},JL=t=>{var y;const e=X.c(27),{onNewChat:n,activeChatId:o,setActiveChat:r,chats:s}=t,i=We(L4),{handleClick:a}=xa(),l=((y=i==null?void 0:i.open_ai)==null?void 0:y.model)||"gpt-4-turbo";let c,d,u,f,p,_,g,m,b,x;if(e[0]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx(Lr,{className:"h-4 w-4"}),e[0]=c):c=e[0],e[1]!==n?(d=h.jsx(Le,{content:"New chat",children:h.jsx(Pe,{variant:"text",size:"icon",onClick:n,children:c})}),e[1]=n,e[2]=d):d=e[2],e[3]!==a?(u=()=>a("ai"),e[3]=a,e[4]=u):u=e[4],e[5]!==l||e[6]!==u?(f=h.jsx(Pe,{variant:"text",size:"xs",className:"hover:bg-foreground/10 py-2",onClick:u,children:l}),e[5]=l,e[6]=u,e[7]=f):f=e[7],e[8]!==d||e[9]!==f?(p=h.jsxs("div",{className:"flex items-center gap-2",children:[d,f]}),e[8]=d,e[9]=f,e[10]=p):p=e[10],e[11]===Symbol.for("react.memo_cache_sentinel")?(_=h.jsx(Le,{content:"Previous chats",children:h.jsx(Ys,{asChild:!0,children:h.jsx(Pe,{variant:"text",size:"icon",children:h.jsx(iH,{className:"h-4 w-4"})})})}),e[11]=_):_=e[11],e[12]!==s.length?(g=s.length===0&&h.jsx(An,{title:"No chats yet",description:"Start a new chat to get started",icon:h.jsx(pc,{})}),e[12]=s.length,e[13]=g):g=e[13],e[14]!==o||e[15]!==s||e[16]!==r){let v;e[18]!==o||e[19]!==r?(v=S=>h.jsxs("div",{className:Oe("p-3 rounded-md cursor-pointer hover:bg-accent",S.id===o&&"bg-accent"),onClick:()=>{r(S.id)},children:[h.jsx("div",{className:"font-medium",children:S.title}),h.jsx("div",{className:"text-sm text-muted-foreground",children:aH(S.updatedAt)})]},S.id),e[18]=o,e[19]=r,e[20]=v):v=e[20],m=s.map(v),e[14]=o,e[15]=s,e[16]=r,e[17]=m}else m=e[17];return e[21]!==g||e[22]!==m?(b=h.jsxs(Pr,{children:[_,h.jsx(Vs,{className:"w-[520px] p-0",align:"start",side:"right",children:h.jsx(pf,{className:"h-[500px] p-4",children:h.jsxs("div",{className:"space-y-4",children:[g,m]})})})]}),e[21]=g,e[22]=m,e[23]=b):b=e[23],e[24]!==p||e[25]!==b?(x=h.jsxs("div",{className:"flex border-b px-2 py-1 justify-between flex-shrink-0 items-center",children:[p,b]}),e[24]=p,e[25]=b,e[26]=x):x=e[26],x},h3=A.memo(t=>{var _;const e=X.c(17),{message:n,index:o,theme:r,onEdit:s,setChatState:i,chatState:a,isStreamingReasoning:l,totalMessages:c}=t,d=n.role==="user"?"justify-end":"justify-start";let u,f,p;return e[0]!==d?(u=Oe("flex group relative",d),e[0]=d,e[1]=u):u=e[1],e[2]!==a||e[3]!==o||e[4]!==l||e[5]!==n.content||e[6]!==n.id||e[7]!==n.parts||e[8]!==n.role||e[9]!==s||e[10]!==i||e[11]!==r||e[12]!==c?(f=n.role==="user"?h.jsx("div",{className:"w-[95%] bg-background border p-1 rounded-sm",children:h.jsx(Rc,{value:n.content,theme:r,placeholder:"Type your message...",onChange:ZL,onSubmit:(g,m)=>{m.trim()&&(s(o,m),a.activeChatId&&i(b=>qf(b,a.activeChatId,"user",m)))},onClose:QL},n.id)}):h.jsxs("div",{className:"w-[95%]",children:[h.jsx("div",{className:"absolute right-1 top-1 opacity-0 group-hover:opacity-100 transition-opacity",children:h.jsx(nS,{className:"h-3 w-3",value:n.content})}),(_=n.parts)==null?void 0:_.map((g,m)=>{switch(g.type){case"text":return h.jsx(u3,{content:g.text});case"reasoning":return h.jsx(YL,{reasoning:g.reasoning,index:m,isStreaming:o===c-1&&l});default:return null}})]}),e[2]=a,e[3]=o,e[4]=l,e[5]=n.content,e[6]=n.id,e[7]=n.parts,e[8]=n.role,e[9]=s,e[10]=i,e[11]=r,e[12]=c,e[13]=f):f=e[13],e[14]!==u||e[15]!==f?(p=h.jsx("div",{className:u,children:f}),e[14]=u,e[15]=f,e[16]=p):p=e[16],p});h3.displayName="ChatMessage";const f3=A.memo(t=>{var c,d;const e=X.c(8),{input:n,setInput:o,onSubmit:r,theme:s,inputRef:i}=t;let a,l;return e[0]!==((c=i.current)==null?void 0:c.editor)?(a=()=>{var u,f;return(f=(u=i.current)==null?void 0:u.editor)==null?void 0:f.blur()},e[0]=(d=i.current)==null?void 0:d.editor,e[1]=a):a=e[1],e[2]!==n||e[3]!==r||e[4]!==o||e[5]!==a||e[6]!==s?(l=h.jsx("div",{className:"px-2 py-3 border-t relative flex-shrink-0 min-h-[80px]",children:h.jsx(Rc,{value:n,onChange:o,onSubmit:r,onClose:a,theme:s,placeholder:"Type your message..."})}),e[2]=n,e[3]=r,e[4]=o,e[5]=a,e[6]=s,e[7]=l):l=e[7],l});f3.displayName="ChatInput";const KL=()=>{const t=X.c(6),e=We(ac),{handleClick:n}=xa();if(!e){let r,s,i;return t[0]!==n?(r=h.jsx(Pe,{variant:"outline",size:"sm",onClick:()=>n("ai"),children:"Edit AI settings"}),t[0]=n,t[1]=r):r=t[1],t[2]===Symbol.for("react.memo_cache_sentinel")?(s=h.jsx(pc,{}),t[2]=s):s=t[2],t[3]!==r?(i=h.jsx(An,{title:"Chat with AI",description:"AI is currently disabled. Add your API key to enable.",action:r,icon:s}),t[3]=r,t[4]=i):i=t[4],i}let o;return t[5]===Symbol.for("react.memo_cache_sentinel")?(o=h.jsx(XL,{}),t[5]=o):o=t[5],o},XL=()=>{const t=X.c(86),[e,n]=fn(id),[o,r]=fn(BS),[s,i]=A.useState(""),a=A.useRef(null),l=A.useRef(null),c=A.useRef(null),d=A.useRef(null),{theme:u}=Fo(),f=Op(),p=o==null?void 0:o.id;let _,g,m,b,x,y;t[0]!==o?(g=o?o.messages.map(eF):[],t[0]=o,t[1]=g):g=t[1],_=g,t[2]!==f?(m=f.getAiURL("chat").toString(),t[2]=f,t[3]=m):m=t[3],t[4]!==f?(b=f.headers(),t[4]=f,t[5]=b):b=t[5],t[6]!==n?(x=ze=>{n(Ne=>qf(Ne,Ne.activeChatId,"assistant",ze.content,ze.parts))},t[6]=n,t[7]=x):x=t[7],t[8]!==p||t[9]!==_||t[10]!==m||t[11]!==b||t[12]!==x?(y={id:p,initialMessages:_,keepLastMessageOnError:!0,experimental_throttle:100,api:m,headers:b,experimental_prepareRequestBody:nF,onFinish:x,onError:oF,onResponse:rF},t[8]=p,t[9]=_,t[10]=m,t[11]=b,t[12]=x,t[13]=y):y=t[13];const{messages:v,input:S,setInput:k,setMessages:I,append:j,handleSubmit:E,error:T,status:M,reload:L,stop:B}=rH(y),O=M==="submitted"||M==="streaming",z=sF,F=O&&v.length>0&&z(v);let V,P,C;t[14]===Symbol.for("react.memo_cache_sentinel")?(V=()=>{requestAnimationFrame(()=>{if(c.current){const ze=c.current;ze.scrollTop=ze.scrollHeight}})},t[14]=V):V=t[14],t[15]!==e.activeChatId?(P=[e.activeChatId],t[15]=e.activeChatId,t[16]=P):P=t[16],A.useEffect(V,P),t[17]!==j||t[18]!==n||t[19]!==k?(C=ze=>{const Ne={id:sH(),title:`${ze.slice(0,30)}...`,messages:[{role:"user",content:ze,timestamp:Date.now()}],createdAt:Date.now(),updatedAt:Date.now()};n(Ke=>({chats:[...Ke.chats,Ne],activeChatId:Ne.id})),k(""),j({role:"user",content:ze})},t[17]=j,t[18]=n,t[19]=k,t[20]=C):C=t[20];const H=C;let N;t[21]!==r||t[22]!==k?(N=()=>{r(null),k(""),i("")},t[21]=r,t[22]=k,t[23]=N):N=t[23];const $=N;let Y;t[24]!==j||t[25]!==I?(Y=(ze,Ne)=>{I(Ke=>Ke.slice(0,ze)),j({role:"user",content:Ne})},t[24]=j,t[25]=I,t[26]=Y):Y=t[26];const Z=Y;let q;t[27]!==e.activeChatId||t[28]!==E||t[29]!==n?(q=(ze,Ne)=>{Ne.trim()&&(E(ze),e.activeChatId&&n(Ke=>qf(Ke,e.activeChatId,"user",Ne)))},t[27]=e.activeChatId,t[28]=E,t[29]=n,t[30]=q):q=t[30];const re=q;let ne;t[31]!==L?(ne=()=>{L()},t[31]=L,t[32]=ne):ne=t[32];const oe=ne;let G;t[33]!==H||t[34]!==s?(G=()=>{s.trim()&&H(s.trim())},t[33]=H,t[34]=s,t[35]=G):G=t[35];const Q=G;let ce;t[36]===Symbol.for("react.memo_cache_sentinel")?(ce=()=>{var ze,Ne;return(Ne=(ze=a.current)==null?void 0:ze.editor)==null?void 0:Ne.blur()},t[36]=ce):ce=t[36];const pe=ce,de=o==null?void 0:o.id;let ge,ie,xe,we,ae,Se,me,Te,Re,$e;if(t[37]!==e.chats||t[38]!==$||t[39]!==r||t[40]!==de?(ge=h.jsx(Bp,{children:h.jsx(JL,{onNewChat:$,activeChatId:de,setActiveChat:r,chats:e.chats})}),t[37]=e.chats,t[38]=$,t[39]=r,t[40]=de,t[41]=ge):ge=t[41],t[42]!==Q||t[43]!==v||t[44]!==s||t[45]!==u?(ie=(!v||v.length===0)&&h.jsx("div",{className:"flex rounded-md border px-1 bg-background",children:h.jsx(Rc,{value:s,placeholder:"Ask anything, @ to include context about tables or dataframes",theme:u,onClose:pe,onChange:i,onSubmit:Q},"new-thread-input")}),t[42]=Q,t[43]=v,t[44]=s,t[45]=u,t[46]=ie):ie=t[46],t[47]!==e||t[48]!==Z||t[49]!==F||t[50]!==v||t[51]!==n||t[52]!==u){let ze;t[54]!==e||t[55]!==Z||t[56]!==F||t[57]!==v.length||t[58]!==n||t[59]!==u?(ze=(Ne,Ke)=>h.jsx(h3,{message:Ne,index:Ke,theme:u,onEdit:Z,setChatState:n,chatState:e,isStreamingReasoning:F,totalMessages:v.length},Ke),t[54]=e,t[55]=Z,t[56]=F,t[57]=v.length,t[58]=n,t[59]=u,t[60]=ze):ze=t[60],xe=v.map(ze),t[47]=e,t[48]=Z,t[49]=F,t[50]=v,t[51]=n,t[52]=u,t[53]=xe}else xe=t[53];return t[61]!==O?(we=O&&h.jsx("div",{className:"flex justify-center py-4",children:h.jsx(Dp,{className:"h-4 w-4 animate-spin"})}),t[61]=O,t[62]=we):we=t[62],t[63]!==T||t[64]!==oe?(ae=T&&h.jsxs("div",{className:"flex items-center justify-center space-x-2 mb-4",children:[h.jsx(Xs,{error:T}),h.jsx(Pe,{variant:"outline",size:"sm",onClick:oe,children:"Retry"})]}),t[63]=T,t[64]=oe,t[65]=ae):ae=t[65],t[66]===Symbol.for("react.memo_cache_sentinel")?(Se=h.jsx("div",{ref:d}),t[66]=Se):Se=t[66],t[67]!==ie||t[68]!==xe||t[69]!==we||t[70]!==ae?(me=h.jsxs("div",{className:"flex-1 px-3 bg-[var(--slate-1)] gap-4 py-3 flex flex-col overflow-y-auto",ref:c,children:[ie,xe,we,ae,Se]}),t[67]=ie,t[68]=xe,t[69]=we,t[70]=ae,t[71]=me):me=t[71],t[72]!==O||t[73]!==B?(Te=O&&h.jsx("div",{className:"w-full flex justify-center items-center z-20 border-t",children:h.jsx(Pe,{variant:"linkDestructive",size:"sm",onClick:B,children:"Stop"})}),t[72]=O,t[73]=B,t[74]=Te):Te=t[74],t[75]!==re||t[76]!==S||t[77]!==v||t[78]!==k||t[79]!==u?(Re=v&&v.length>0&&h.jsx(f3,{input:S,setInput:k,onSubmit:re,theme:u,inputRef:l}),t[75]=re,t[76]=S,t[77]=v,t[78]=k,t[79]=u,t[80]=Re):Re=t[80],t[81]!==ge||t[82]!==me||t[83]!==Te||t[84]!==Re?($e=h.jsxs("div",{className:"flex flex-col h-[calc(100%-53px)]",children:[ge,me,Te,Re]}),t[81]=ge,t[82]=me,t[83]=Te,t[84]=Re,t[85]=$e):$e=t[85],$e};function ZL(){}function QL(){}function eF(t){const{role:e,content:n,timestamp:o,parts:r}=t;return{role:e,content:n,id:o.toString(),parts:r}}function tF(t){return t.content}function nF(t){return{...t,...y4({input:t.messages.map(tF).join(`
144
- `)}),includeOtherCode:Nc("")}}function oF(t){Zt.error("An error occurred:",t)}function rF(t){Zt.debug("Received HTTP response from server:",t)}function sF(t){if(t.length===0)return!1;const e=t.at(-1);if(!e||e.role!=="assistant"||!e.parts)return!1;const n=e.parts;return n.length===0?!1:n[n.length-1].type==="reasoning"}const iF=K.lazy(()=>Rp(()=>import("./tracing-3IY9qyNR.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]),import.meta.url).then(t=>({default:t.Tracing}))),aF=()=>{const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=h.jsx(K.Suspense,{fallback:h.jsx(lF,{}),children:h.jsx(iF,{})}),t[0]=e):e=t[0],e},lF=()=>{const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=h.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:h.jsx(eo,{})}),t[0]=e):e=t[0],e},cF=()=>{const t=X.c(25),{openModal:e,closeModal:n}=Vn();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],t[0]=o):o=t[0];const{data:r,loading:s,error:i,reload:a}=$n(uF,o);let l;t[1]!==r?(l=r===void 0?[]:r,t[1]=r,t[2]=l):l=t[2];const c=l;let d;t[3]!==c?(d=c.filter(hF).map(fF),t[3]=c,t[4]=d):d=t[4];const u=d;if(s&&c.length===0){let y;return t[5]===Symbol.for("react.memo_cache_sentinel")?(y=h.jsx(eo,{size:"medium",centered:!0}),t[5]=y):y=t[5],y}if(i){let y;return t[6]!==i?(y=h.jsx(Xs,{error:i}),t[6]=i,t[7]=y):y=t[7],y}if(c.length===0){let y;return t[8]===Symbol.for("react.memo_cache_sentinel")?(y=h.jsx(An,{title:"No environment variables",description:"No environment variables are available in this notebook.",icon:h.jsx(Kc,{})}),t[8]=y):y=t[8],y}let f,p,_,g,m,b,x;return t[9]!==n||t[10]!==e||t[11]!==u||t[12]!==a?(f=()=>e(h.jsx(kg,{providerNames:u,onSuccess:()=>{a(),n()},onClose:n})),t[9]=n,t[10]=e,t[11]=u,t[12]=a,t[13]=f):f=t[13],t[14]===Symbol.for("react.memo_cache_sentinel")?(p=h.jsx(Lr,{className:"h-4 w-4"}),t[14]=p):p=t[14],t[15]!==f?(_=h.jsx("div",{className:"flex justify-end h-8 border-b",children:h.jsx("button",{type:"button",className:"float-right border-l px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",onClick:f,children:p})}),t[15]=f,t[16]=_):_=t[16],t[17]===Symbol.for("react.memo_cache_sentinel")?(g=h.jsx(Gp,{children:h.jsxs(Ks,{children:[h.jsx(Fr,{children:"Environment Variable"}),h.jsx(Fr,{children:"Source"}),h.jsx(Fr,{})]})}),t[17]=g):g=t[17],t[18]!==c?(m=c.map(pF),t[18]=c,t[19]=m):m=t[19],t[20]!==m?(b=h.jsxs(qp,{className:"overflow-auto flex-1 mb-16",children:[g,h.jsx(Yp,{children:m})]}),t[20]=m,t[21]=b):b=t[21],t[22]!==_||t[23]!==b?(x=h.jsxs("div",{className:"flex flex-col h-full",children:[_,b]}),t[22]=_,t[23]=b,t[24]=x):x=t[24],x},dF=t=>{const e=X.c(9),{className:n,ariaLabel:o,onCopy:r}=t,[s,i]=K.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?h.jsx(yc,{className:"w-3 h-3 text-green-700 rounded"}):h.jsx(Ls,{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=h.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 uF(){return vg((await xS.request({})).secrets)}function hF(t){return t.provider!=="env"}function fF(t){return t.name}function pF(t){return t.keys.map(e=>h.jsxs(Ks,{className:"group",children:[h.jsx(zr,{children:e}),h.jsx(zr,{children:t.provider!=="env"&&h.jsx(z4,{variant:"outline",className:"select-none",children:t.name})}),h.jsx(zr,{children:h.jsx(dF,{ariaLabel:`Copy ${e}`,onCopy:async()=>{await yn(`os.environ["${e}"]`),lt({title:"Copied to clipboard",description:`os.environ["${e}"] has been copied to your clipboard.`})},className:Oe("float-right px-2 h-full text-xs text-muted-foreground hover:text-foreground","invisible group-hover:visible")})})]},`${t.name}-${e}`))}const mF=K.lazy(()=>Rp(()=>import("./terminal-B0sHUSvx.js"),__vite__mapDeps([123,1,2,124]),import.meta.url)),gF=t=>{const e=X.c(120),{children:n}=t,{isSidebarOpen:o,isTerminalOpen:r,selectedPanel:s}=bc(),{setIsSidebarOpen:i,setIsTerminalOpen:a}=na(),l=K.useRef(null),c=K.useRef(null);let d,u,f,p,_;e[0]!==o?(d=()=>{if(!l.current)return;const ue=l.current.isCollapsed();o&&ue&&l.current.expand(),o||ue||l.current.collapse(),requestAnimationFrame(bF)},u=[o],e[0]=o,e[1]=d,e[2]=u):(d=e[1],u=e[2]),A.useEffect(d,u),e[3]!==r?(f=()=>{if(!c.current)return;const ue=c.current.isCollapsed();r&&ue&&c.current.expand(),r||ue||c.current.collapse(),requestAnimationFrame(xF)},p=[r],e[3]=r,e[4]=f,e[5]=p):(f=e[4],p=e[5]),A.useEffect(f,p),e[6]!==n?(_=h.jsx(Vc,{id:"app",className:"relative h-full",children:h.jsx(A.Suspense,{children:n})},"app"),e[6]=n,e[7]=_):_=e[7];const g=_,m=o?"resize-handle":"resize-handle-collapsed";let b,x;e[8]!==m?(b=Oe("border-border no-print z-10",m,"vertical"),e[8]=m,e[9]=b):b=e[9],e[10]!==b?(x=h.jsx(aS,{onDragging:lS,className:b}),e[10]=b,e[11]=x):x=e[11];const y=x,v=r?"resize-handle":"resize-handle-collapsed";let S,k;e[12]!==v?(S=Oe("border-border no-print z-20",v,"horizontal"),e[12]=v,e[13]=S):S=e[13],e[14]!==S?(k=h.jsx(aS,{onDragging:lS,className:S}),e[14]=S,e[15]=k):k=e[15];const I=k;let j,E,T,M,L,B,O,z,F,V,P,C,H,N,$,Y,Z,q,re,ne,oe;e[16]!==s?(j=h.jsx("div",{className:"text-sm text-[var(--slate-11)] uppercase tracking-wide font-semibold flex-1",children:s}),e[16]=s,e[17]=j):j=e[17],e[18]!==i?(E=()=>i(!1),e[18]=i,e[19]=E):E=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(T=h.jsx(go,{className:"w-4 h-4"}),e[20]=T):T=e[20],e[21]!==E?(M=h.jsx(Pe,{"data-testid":"close-helper-pane",className:"m-0",size:"xs",variant:"text",onClick:E,children:T}),e[21]=E,e[22]=M):M=e[22],e[23]!==j||e[24]!==M?(L=h.jsxs("div",{className:"p-3 border-b flex justify-between items-center",children:[j,M]}),e[23]=j,e[24]=M,e[25]=L):L=e[25],e[26]!==s?(B=s==="files"&&h.jsx(rR,{}),e[26]=s,e[27]=B):B=e[27],e[28]!==s?(O=s==="errors"&&h.jsx(Ax,{}),e[28]=s,e[29]=O):O=e[29],e[30]!==s?(z=s==="variables"&&h.jsx(k2,{}),e[30]=s,e[31]=z):z=e[31],e[32]!==s?(F=s==="dependencies"&&h.jsx(TD,{}),e[32]=s,e[33]=F):F=e[33],e[34]!==s?(V=s==="packages"&&h.jsx(TR,{}),e[34]=s,e[35]=V):V=e[35],e[36]!==s?(P=s==="outline"&&h.jsx(rO,{}),e[36]=s,e[37]=P):P=e[37],e[38]!==s?(C=s==="datasources"&&h.jsx(SR,{}),e[38]=s,e[39]=C):C=e[39],e[40]!==s?(H=s==="documentation"&&h.jsx(PD,{}),e[40]=s,e[41]=H):H=e[41],e[42]!==s?(N=s==="snippets"&&h.jsx(cR,{}),e[42]=s,e[43]=N):N=e[43],e[44]!==s?($=s==="scratchpad"&&h.jsx(AR,{}),e[44]=s,e[45]=$):$=e[45],e[46]!==s?(Y=s==="chat"&&h.jsx(KL,{}),e[46]=s,e[47]=Y):Y=e[47],e[48]!==s?(Z=s==="logs"&&h.jsx(S2,{}),e[48]=s,e[49]=Z):Z=e[49],e[50]!==s?(q=s==="tracing"&&h.jsx(aF,{}),e[50]=s,e[51]=q):q=e[51],e[52]!==s?(re=s==="secrets"&&h.jsx(cF,{}),e[52]=s,e[53]=re):re=e[53],e[54]!==B||e[55]!==O||e[56]!==z||e[57]!==F||e[58]!==V||e[59]!==P||e[60]!==C||e[61]!==H||e[62]!==N||e[63]!==$||e[64]!==Y||e[65]!==Z||e[66]!==q||e[67]!==re?(ne=h.jsx(A.Suspense,{children:h.jsxs(Fc,{children:[B,O,z,F,V,P,C,H,N,$,Y,Z,q,re]})}),e[54]=B,e[55]=O,e[56]=z,e[57]=F,e[58]=V,e[59]=P,e[60]=C,e[61]=H,e[62]=N,e[63]=$,e[64]=Y,e[65]=Z,e[66]=q,e[67]=re,e[68]=ne):ne=e[68],e[69]!==L||e[70]!==ne?(oe=h.jsx(kc,{children:h.jsxs("div",{className:"flex flex-col h-full flex-1 overflow-hidden mr-[-4px]",children:[L,ne]})}),e[69]=L,e[70]=ne,e[71]=oe):oe=e[71];const G=oe,Q=o&&"border-r border-l border-[var(--slate-7)]";let ce,pe,de,ge,ie,xe;e[72]!==Q?(ce=Oe("dark:bg-[var(--slate-1)] no-print print:hidden hide-on-fullscreen",Q),e[72]=Q,e[73]=ce):ce=e[73],e[74]===Symbol.for("react.memo_cache_sentinel")?(pe=(ue,je)=>{var ve;je===0&&ue===10&&((ve=l.current)==null||ve.resize(30))},e[74]=pe):pe=e[74],e[75]!==i?(de=()=>i(!1),ge=()=>i(!0),e[75]=i,e[76]=de,e[77]=ge):(de=e[76],ge=e[77]),e[78]!==G||e[79]!==y?(ie=h.jsxs("span",{className:"flex flex-row h-full",children:[G," ",y]}),e[78]=G,e[79]=y,e[80]=ie):ie=e[80],e[81]!==ce||e[82]!==de||e[83]!==ge||e[84]!==ie?(xe=h.jsx(Vc,{ref:l,id:"helper",collapsedSize:0,collapsible:!0,className:ce,minSize:10,defaultSize:0,maxSize:75,onResize:pe,onCollapse:de,onExpand:ge,children:ie},"helper"),e[81]=ce,e[82]=de,e[83]=ge,e[84]=ie,e[85]=xe):xe=e[85];const we=xe,ae=r&&"border-[var(--slate-7)]";let Se,me,Te,Re,$e,ze,Ne,Ke;e[86]!==ae?(Se=Oe("dark:bg-[var(--slate-1)] no-print print:hidden hide-on-fullscreen",ae),e[86]=ae,e[87]=Se):Se=e[87],e[88]===Symbol.for("react.memo_cache_sentinel")?(me=(ue,je)=>{var ve;je===0&&ue===10&&((ve=c.current)==null||ve.resize(30))},e[88]=me):me=e[88],e[89]!==a?(Te=()=>a(!1),Re=()=>a(!0),e[89]=a,e[90]=Te,e[91]=Re):(Te=e[90],Re=e[91]),e[92]!==a?($e=()=>a(!1),e[92]=a,e[93]=$e):$e=e[93],e[94]!==r||e[95]!==$e?(ze=h.jsx(mF,{visible:r,onClose:$e}),e[94]=r,e[95]=$e,e[96]=ze):ze=e[96],e[97]!==r||e[98]!==ze?(Ne=h.jsx(CR,{isOpen:r,children:ze}),e[97]=r,e[98]=ze,e[99]=Ne):Ne=e[99],e[100]!==Se||e[101]!==Te||e[102]!==Re||e[103]!==Ne||e[104]!==I?(Ke=h.jsxs(Vc,{ref:c,id:"terminal",collapsedSize:0,collapsible:!0,className:Se,minSize:10,defaultSize:0,maxSize:75,onResize:me,onCollapse:Te,onExpand:Re,children:[I,Ne]},"terminal"),e[100]=Se,e[101]=Te,e[102]=Re,e[103]=Ne,e[104]=I,e[105]=Ke):Ke=e[105];const nt=Ke;let it,te,Ce,Me,Be,J,fe,_e;return e[106]===Symbol.for("react.memo_cache_sentinel")?(it=QH(),e[106]=it):it=e[106],e[107]===Symbol.for("react.memo_cache_sentinel")?(te=h.jsx(Fc,{children:h.jsx(ZM,{})}),e[107]=te):te=e[107],e[108]!==nt?(Ce=h.jsx(jx,{capability:"terminal",children:nt}),e[108]=nt,e[109]=Ce):Ce=e[109],e[110]!==g||e[111]!==Ce?(Me=h.jsx(Vc,{children:h.jsxs(cS,{autoSaveId:"marimo:chrome:v1:l1",direction:"vertical",children:[g,Ce]})}),e[110]=g,e[111]=Ce,e[112]=Me):Me=e[112],e[113]===Symbol.for("react.memo_cache_sentinel")?(Be=h.jsx(lH,{}),e[113]=Be):Be=e[113],e[114]!==we||e[115]!==Me?(J=h.jsxs(cS,{autoSaveId:"marimo:chrome:v1:l2",direction:"horizontal",storage:it,children:[te,we,Me,Be]}),e[114]=we,e[115]=Me,e[116]=J):J=e[116],e[117]===Symbol.for("react.memo_cache_sentinel")?(fe=h.jsx(kc,{children:h.jsx(Fc,{children:h.jsx(GM,{})})}),e[117]=fe):fe=e[117],e[118]!==J?(_e=h.jsxs(e$,{children:[J,fe]}),e[118]=J,e[119]=_e):_e=e[119],_e};function _F(){window.dispatchEvent(new Event("resize"))}function bF(){requestAnimationFrame(_F)}function yF(){window.dispatchEvent(new Event("resize"))}function xF(){requestAnimationFrame(yF)}let p3;p3=new URL(window.location.href).searchParams.get(cH.showChrome)==="false",jS=Object.freeze(Object.defineProperty({__proto__:null,default:t=>{const e=X.c(10);if(p3){let s,i,a;return e[0]!==t?(s=h.jsx(Nx,{hideControls:!0,...t}),e[0]=t,e[1]=s):s=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsx(eg,{}),e[2]=i):i=e[2],e[3]!==s?(a=h.jsxs(h.Fragment,{children:[s,i]}),e[3]=s,e[4]=a):a=e[4],a}let n,o,r;return e[5]!==t?(n=h.jsx(Nx,{...t}),e[5]=t,e[6]=n):n=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(o=h.jsx(eg,{}),e[7]=o):o=e[7],e[8]!==n?(r=h.jsxs(gF,{children:[n,o]}),e[8]=n,e[9]=r):r=e[9],r}},Symbol.toStringTag,{value:"Module"}))});export{nm as C,Hc as E,An as P,r$ as __tla,$c as a,jS as e,va as f,om as u};
143
+ """`}:{language:"python",code:T}}(o,l);o==="sql"&&ar(a,s,i),s({code:j.code,before:!1,cellId:i??"__end__"})},e[3]=a,e[4]=s,e[5]=o,e[6]=i,e[7]=l,e[8]=f):f=e[8];const p=f;let _;e[9]!==l?(_=async()=>{await yn(l)},e[9]=l,e[10]=_):_=e[10];const g=_,m=r==="dark"?"dark":"light",b=o&&$L.has(o)?o:void 0;let x,y,v,S,k,I;return e[11]!==m||e[12]!==b||e[13]!==l?(x=h.jsx(_a,{theme:m,language:b,className:"cm border rounded overflow-hidden",extensions:HL,value:l,onChange:c}),e[11]=m,e[12]=b,e[13]=l,e[14]=x):x=e[14],e[15]!==g?(y=h.jsx(qL,{size:"xs",variant:"outline",onClick:g,children:"Copy"}),e[15]=g,e[16]=y):y=e[16],e[17]===Symbol.for("react.memo_cache_sentinel")?(v=h.jsx(ti,{className:"ml-2 h-4 w-4"}),e[17]=v):v=e[17],e[18]!==p?(S=h.jsxs(Pe,{size:"xs",variant:"outline",onClick:p,children:["Add to Notebook",v]}),e[18]=p,e[19]=S):S=e[19],e[20]!==S||e[21]!==y?(k=h.jsxs("div",{className:"flex justify-end mt-2 space-x-2",children:[y,S]}),e[20]=S,e[21]=y,e[22]=k):k=e[22],e[23]!==k||e[24]!==x?(I=h.jsxs("div",{className:"relative",children:[x,k]}),e[23]=k,e[24]=x,e[25]=I):I=e[25],I},qL=t=>{const e=X.c(12);let n,o;e[0]!==t?({onClick:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);const[r,s]=A.useState(!1);let i,a,l;e[3]!==r?(i=()=>{r&&setTimeout(()=>s(!1),1e3)},a=[r],e[3]=r,e[4]=i,e[5]=a):(i=e[4],a=e[5]),A.useEffect(i,a),e[6]!==n?(l=u=>{n==null||n(u),s(!0)},e[6]=n,e[7]=l):l=e[7];const c=r?"Copied":"Copy";let d;return e[8]!==o||e[9]!==l||e[10]!==c?(d=h.jsx(Pe,{...o,onClick:l,children:c}),e[8]=o,e[9]=l,e[10]=c,e[11]=d):d=e[11],d},GL={code:({children:t,className:e})=>{const n=e==null?void 0:e.replace("language-","");return n&&typeof t=="string"?h.jsxs("div",{children:[h.jsx("div",{className:"text-xs text-muted-foreground pl-1",children:n}),h.jsx(WL,{code:t.trim(),language:n})]}):h.jsx("code",{className:e,children:t})}},u3=A.memo(t=>{const e=X.c(2),{content:n}=t;let o;return e[0]!==n?(o=h.jsx(UL,{components:GL,className:"prose dark:prose-invert max-w-none prose-pre:pl-0",children:n}),e[0]=n,e[1]=o):o=e[1],o},(t,e)=>t.content===e.content);u3.displayName="MemoizedMarkdownBlock";const Wf=A.memo(({content:t})=>{const e=A.useMemo(()=>{return n=t,QV.lexer(n).map(o=>o.raw);var n},[t]);return h.jsx(h.Fragment,{children:e.map((n,o)=>h.jsx(u3,{content:n},`markdown-block-${o}`))})});Wf.displayName="MarkdownRenderer";const qf=(t,e,n,o,r)=>e?{...t,chats:t.chats.map(s=>s.id===e?{...s,messages:[...s.messages,{role:n,content:o,timestamp:Date.now(),parts:r}],updatedAt:Date.now()}:s)}:(Zt.warn("No active chat"),t),YL=t=>{const e=X.c(13),{reasoning:n,index:o,isStreaming:r}=t,s=o===void 0?0:o,i=r!==void 0&&r,a=i?"reasoning":void 0;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=h.jsx(pc,{className:"h-3 w-3"}),e[0]=l):l=e[0];const c=i?"Thinking":"View reasoning";let d,u,f,p;return e[1]!==n.length||e[2]!==c?(d=h.jsx(eH,{className:"text-xs text-muted-foreground hover:bg-muted/50 px-2 py-1 h-auto rounded-sm [&[data-state=open]>svg]:rotate-180",children:h.jsxs("span",{className:"flex items-center gap-2",children:[l,c," (",n.length," ","chars)"]})}),e[1]=n.length,e[2]=c,e[3]=d):d=e[3],e[4]!==n?(u=h.jsx(tH,{className:"pb-2 px-2",children:h.jsx("div",{className:"bg-muted/30 border border-muted/50 rounded-md p-3 italic text-muted-foreground/90 relative",children:h.jsx("div",{className:"pr-6",children:h.jsx(Wf,{content:n})})})}),e[4]=n,e[5]=u):u=e[5],e[6]!==d||e[7]!==u?(f=h.jsxs(nH,{value:"reasoning",className:"border-0",children:[d,u]}),e[6]=d,e[7]=u,e[8]=f):f=e[8],e[9]!==s||e[10]!==a||e[11]!==f?(p=h.jsx(oH,{type:"single",collapsible:!0,className:"w-full mb-2",value:a,children:f},s),e[9]=s,e[10]=a,e[11]=f,e[12]=p):p=e[12],p},JL=t=>{var y;const e=X.c(27),{onNewChat:n,activeChatId:o,setActiveChat:r,chats:s}=t,i=We(L4),{handleClick:a}=xa(),l=((y=i==null?void 0:i.open_ai)==null?void 0:y.model)||"gpt-4-turbo";let c,d,u,f,p,_,g,m,b,x;if(e[0]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx(Lr,{className:"h-4 w-4"}),e[0]=c):c=e[0],e[1]!==n?(d=h.jsx(Le,{content:"New chat",children:h.jsx(Pe,{variant:"text",size:"icon",onClick:n,children:c})}),e[1]=n,e[2]=d):d=e[2],e[3]!==a?(u=()=>a("ai"),e[3]=a,e[4]=u):u=e[4],e[5]!==l||e[6]!==u?(f=h.jsx(Pe,{variant:"text",size:"xs",className:"hover:bg-foreground/10 py-2",onClick:u,children:l}),e[5]=l,e[6]=u,e[7]=f):f=e[7],e[8]!==d||e[9]!==f?(p=h.jsxs("div",{className:"flex items-center gap-2",children:[d,f]}),e[8]=d,e[9]=f,e[10]=p):p=e[10],e[11]===Symbol.for("react.memo_cache_sentinel")?(_=h.jsx(Le,{content:"Previous chats",children:h.jsx(Ys,{asChild:!0,children:h.jsx(Pe,{variant:"text",size:"icon",children:h.jsx(iH,{className:"h-4 w-4"})})})}),e[11]=_):_=e[11],e[12]!==s.length?(g=s.length===0&&h.jsx(An,{title:"No chats yet",description:"Start a new chat to get started",icon:h.jsx(pc,{})}),e[12]=s.length,e[13]=g):g=e[13],e[14]!==o||e[15]!==s||e[16]!==r){let v;e[18]!==o||e[19]!==r?(v=S=>h.jsxs("div",{className:Oe("p-3 rounded-md cursor-pointer hover:bg-accent",S.id===o&&"bg-accent"),onClick:()=>{r(S.id)},children:[h.jsx("div",{className:"font-medium",children:S.title}),h.jsx("div",{className:"text-sm text-muted-foreground",children:aH(S.updatedAt)})]},S.id),e[18]=o,e[19]=r,e[20]=v):v=e[20],m=s.map(v),e[14]=o,e[15]=s,e[16]=r,e[17]=m}else m=e[17];return e[21]!==g||e[22]!==m?(b=h.jsxs(Pr,{children:[_,h.jsx(Vs,{className:"w-[520px] p-0",align:"start",side:"right",children:h.jsx(X2,{className:"h-[500px] p-4",children:h.jsxs("div",{className:"space-y-4",children:[g,m]})})})]}),e[21]=g,e[22]=m,e[23]=b):b=e[23],e[24]!==p||e[25]!==b?(x=h.jsxs("div",{className:"flex border-b px-2 py-1 justify-between flex-shrink-0 items-center",children:[p,b]}),e[24]=p,e[25]=b,e[26]=x):x=e[26],x},h3=A.memo(t=>{var _;const e=X.c(17),{message:n,index:o,theme:r,onEdit:s,setChatState:i,chatState:a,isStreamingReasoning:l,totalMessages:c}=t,d=n.role==="user"?"justify-end":"justify-start";let u,f,p;return e[0]!==d?(u=Oe("flex group relative",d),e[0]=d,e[1]=u):u=e[1],e[2]!==a||e[3]!==o||e[4]!==l||e[5]!==n.content||e[6]!==n.id||e[7]!==n.parts||e[8]!==n.role||e[9]!==s||e[10]!==i||e[11]!==r||e[12]!==c?(f=n.role==="user"?h.jsx("div",{className:"w-[95%] bg-background border p-1 rounded-sm",children:h.jsx(Rc,{value:n.content,theme:r,placeholder:"Type your message...",onChange:ZL,onSubmit:(g,m)=>{m.trim()&&(s(o,m),a.activeChatId&&i(b=>qf(b,a.activeChatId,"user",m)))},onClose:QL},n.id)}):h.jsxs("div",{className:"w-[95%]",children:[h.jsx("div",{className:"absolute right-1 top-1 opacity-0 group-hover:opacity-100 transition-opacity",children:h.jsx(nS,{className:"h-3 w-3",value:n.content})}),(_=n.parts)==null?void 0:_.map((g,m)=>{switch(g.type){case"text":return h.jsx(Wf,{content:g.text});case"reasoning":return h.jsx(YL,{reasoning:g.reasoning,index:m,isStreaming:o===c-1&&l});default:return null}})]}),e[2]=a,e[3]=o,e[4]=l,e[5]=n.content,e[6]=n.id,e[7]=n.parts,e[8]=n.role,e[9]=s,e[10]=i,e[11]=r,e[12]=c,e[13]=f):f=e[13],e[14]!==u||e[15]!==f?(p=h.jsx("div",{className:u,children:f}),e[14]=u,e[15]=f,e[16]=p):p=e[16],p});h3.displayName="ChatMessage";const f3=A.memo(t=>{var c,d;const e=X.c(8),{input:n,setInput:o,onSubmit:r,theme:s,inputRef:i}=t;let a,l;return e[0]!==((c=i.current)==null?void 0:c.editor)?(a=()=>{var u,f;return(f=(u=i.current)==null?void 0:u.editor)==null?void 0:f.blur()},e[0]=(d=i.current)==null?void 0:d.editor,e[1]=a):a=e[1],e[2]!==n||e[3]!==r||e[4]!==o||e[5]!==a||e[6]!==s?(l=h.jsx("div",{className:"px-2 py-3 border-t relative flex-shrink-0 min-h-[80px]",children:h.jsx(Rc,{value:n,onChange:o,onSubmit:r,onClose:a,theme:s,placeholder:"Type your message..."})}),e[2]=n,e[3]=r,e[4]=o,e[5]=a,e[6]=s,e[7]=l):l=e[7],l});f3.displayName="ChatInput";const KL=()=>{const t=X.c(6),e=We(ac),{handleClick:n}=xa();if(!e){let r,s,i;return t[0]!==n?(r=h.jsx(Pe,{variant:"outline",size:"sm",onClick:()=>n("ai"),children:"Edit AI settings"}),t[0]=n,t[1]=r):r=t[1],t[2]===Symbol.for("react.memo_cache_sentinel")?(s=h.jsx(pc,{}),t[2]=s):s=t[2],t[3]!==r?(i=h.jsx(An,{title:"Chat with AI",description:"AI is currently disabled. Add your API key to enable.",action:r,icon:s}),t[3]=r,t[4]=i):i=t[4],i}let o;return t[5]===Symbol.for("react.memo_cache_sentinel")?(o=h.jsx(XL,{}),t[5]=o):o=t[5],o},XL=()=>{const t=X.c(86),[e,n]=fn(id),[o,r]=fn(BS),[s,i]=A.useState(""),a=A.useRef(null),l=A.useRef(null),c=A.useRef(null),d=A.useRef(null),{theme:u}=Fo(),f=Op(),p=o==null?void 0:o.id;let _,g,m,b,x,y;t[0]!==o?(g=o?o.messages.map(eF):[],t[0]=o,t[1]=g):g=t[1],_=g,t[2]!==f?(m=f.getAiURL("chat").toString(),t[2]=f,t[3]=m):m=t[3],t[4]!==f?(b=f.headers(),t[4]=f,t[5]=b):b=t[5],t[6]!==n?(x=ze=>{n(Ne=>qf(Ne,Ne.activeChatId,"assistant",ze.content,ze.parts))},t[6]=n,t[7]=x):x=t[7],t[8]!==p||t[9]!==_||t[10]!==m||t[11]!==b||t[12]!==x?(y={id:p,initialMessages:_,keepLastMessageOnError:!0,experimental_throttle:100,api:m,headers:b,experimental_prepareRequestBody:nF,onFinish:x,onError:oF,onResponse:rF},t[8]=p,t[9]=_,t[10]=m,t[11]=b,t[12]=x,t[13]=y):y=t[13];const{messages:v,input:S,setInput:k,setMessages:I,append:j,handleSubmit:E,error:T,status:M,reload:L,stop:B}=rH(y),O=M==="submitted"||M==="streaming",z=sF,F=O&&v.length>0&&z(v);let V,P,C;t[14]===Symbol.for("react.memo_cache_sentinel")?(V=()=>{requestAnimationFrame(()=>{if(c.current){const ze=c.current;ze.scrollTop=ze.scrollHeight}})},t[14]=V):V=t[14],t[15]!==e.activeChatId?(P=[e.activeChatId],t[15]=e.activeChatId,t[16]=P):P=t[16],A.useEffect(V,P),t[17]!==j||t[18]!==n||t[19]!==k?(C=ze=>{const Ne={id:sH(),title:`${ze.slice(0,30)}...`,messages:[{role:"user",content:ze,timestamp:Date.now()}],createdAt:Date.now(),updatedAt:Date.now()};n(Ke=>({chats:[...Ke.chats,Ne],activeChatId:Ne.id})),k(""),j({role:"user",content:ze})},t[17]=j,t[18]=n,t[19]=k,t[20]=C):C=t[20];const H=C;let N;t[21]!==r||t[22]!==k?(N=()=>{r(null),k(""),i("")},t[21]=r,t[22]=k,t[23]=N):N=t[23];const $=N;let Y;t[24]!==j||t[25]!==I?(Y=(ze,Ne)=>{I(Ke=>Ke.slice(0,ze)),j({role:"user",content:Ne})},t[24]=j,t[25]=I,t[26]=Y):Y=t[26];const Z=Y;let q;t[27]!==e.activeChatId||t[28]!==E||t[29]!==n?(q=(ze,Ne)=>{Ne.trim()&&(E(ze),e.activeChatId&&n(Ke=>qf(Ke,e.activeChatId,"user",Ne)))},t[27]=e.activeChatId,t[28]=E,t[29]=n,t[30]=q):q=t[30];const re=q;let ne;t[31]!==L?(ne=()=>{L()},t[31]=L,t[32]=ne):ne=t[32];const oe=ne;let G;t[33]!==H||t[34]!==s?(G=()=>{s.trim()&&H(s.trim())},t[33]=H,t[34]=s,t[35]=G):G=t[35];const Q=G;let ce;t[36]===Symbol.for("react.memo_cache_sentinel")?(ce=()=>{var ze,Ne;return(Ne=(ze=a.current)==null?void 0:ze.editor)==null?void 0:Ne.blur()},t[36]=ce):ce=t[36];const pe=ce,de=o==null?void 0:o.id;let ge,ie,xe,we,ae,Se,me,Te,Re,$e;if(t[37]!==e.chats||t[38]!==$||t[39]!==r||t[40]!==de?(ge=h.jsx(Bp,{children:h.jsx(JL,{onNewChat:$,activeChatId:de,setActiveChat:r,chats:e.chats})}),t[37]=e.chats,t[38]=$,t[39]=r,t[40]=de,t[41]=ge):ge=t[41],t[42]!==Q||t[43]!==v||t[44]!==s||t[45]!==u?(ie=(!v||v.length===0)&&h.jsx("div",{className:"flex rounded-md border px-1 bg-background",children:h.jsx(Rc,{value:s,placeholder:"Ask anything, @ to include context about tables or dataframes",theme:u,onClose:pe,onChange:i,onSubmit:Q},"new-thread-input")}),t[42]=Q,t[43]=v,t[44]=s,t[45]=u,t[46]=ie):ie=t[46],t[47]!==e||t[48]!==Z||t[49]!==F||t[50]!==v||t[51]!==n||t[52]!==u){let ze;t[54]!==e||t[55]!==Z||t[56]!==F||t[57]!==v.length||t[58]!==n||t[59]!==u?(ze=(Ne,Ke)=>h.jsx(h3,{message:Ne,index:Ke,theme:u,onEdit:Z,setChatState:n,chatState:e,isStreamingReasoning:F,totalMessages:v.length},Ke),t[54]=e,t[55]=Z,t[56]=F,t[57]=v.length,t[58]=n,t[59]=u,t[60]=ze):ze=t[60],xe=v.map(ze),t[47]=e,t[48]=Z,t[49]=F,t[50]=v,t[51]=n,t[52]=u,t[53]=xe}else xe=t[53];return t[61]!==O?(we=O&&h.jsx("div",{className:"flex justify-center py-4",children:h.jsx(Dp,{className:"h-4 w-4 animate-spin"})}),t[61]=O,t[62]=we):we=t[62],t[63]!==T||t[64]!==oe?(ae=T&&h.jsxs("div",{className:"flex items-center justify-center space-x-2 mb-4",children:[h.jsx(Xs,{error:T}),h.jsx(Pe,{variant:"outline",size:"sm",onClick:oe,children:"Retry"})]}),t[63]=T,t[64]=oe,t[65]=ae):ae=t[65],t[66]===Symbol.for("react.memo_cache_sentinel")?(Se=h.jsx("div",{ref:d}),t[66]=Se):Se=t[66],t[67]!==ie||t[68]!==xe||t[69]!==we||t[70]!==ae?(me=h.jsxs("div",{className:"flex-1 px-3 bg-[var(--slate-1)] gap-4 py-3 flex flex-col overflow-y-auto",ref:c,children:[ie,xe,we,ae,Se]}),t[67]=ie,t[68]=xe,t[69]=we,t[70]=ae,t[71]=me):me=t[71],t[72]!==O||t[73]!==B?(Te=O&&h.jsx("div",{className:"w-full flex justify-center items-center z-20 border-t",children:h.jsx(Pe,{variant:"linkDestructive",size:"sm",onClick:B,children:"Stop"})}),t[72]=O,t[73]=B,t[74]=Te):Te=t[74],t[75]!==re||t[76]!==S||t[77]!==v||t[78]!==k||t[79]!==u?(Re=v&&v.length>0&&h.jsx(f3,{input:S,setInput:k,onSubmit:re,theme:u,inputRef:l}),t[75]=re,t[76]=S,t[77]=v,t[78]=k,t[79]=u,t[80]=Re):Re=t[80],t[81]!==ge||t[82]!==me||t[83]!==Te||t[84]!==Re?($e=h.jsxs("div",{className:"flex flex-col h-[calc(100%-53px)]",children:[ge,me,Te,Re]}),t[81]=ge,t[82]=me,t[83]=Te,t[84]=Re,t[85]=$e):$e=t[85],$e};function ZL(){}function QL(){}function eF(t){const{role:e,content:n,timestamp:o,parts:r}=t;return{role:e,content:n,id:o.toString(),parts:r}}function tF(t){return t.content}function nF(t){return{...t,...y4({input:t.messages.map(tF).join(`
144
+ `)}),includeOtherCode:Nc("")}}function oF(t){Zt.error("An error occurred:",t)}function rF(t){Zt.debug("Received HTTP response from server:",t)}function sF(t){if(t.length===0)return!1;const e=t.at(-1);if(!e||e.role!=="assistant"||!e.parts)return!1;const n=e.parts;return n.length===0?!1:n[n.length-1].type==="reasoning"}const iF=K.lazy(()=>Rp(()=>import("./tracing-CCC85gHU.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]),import.meta.url).then(t=>({default:t.Tracing}))),aF=()=>{const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=h.jsx(K.Suspense,{fallback:h.jsx(lF,{}),children:h.jsx(iF,{})}),t[0]=e):e=t[0],e},lF=()=>{const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=h.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:h.jsx(eo,{})}),t[0]=e):e=t[0],e},cF=()=>{const t=X.c(25),{openModal:e,closeModal:n}=Vn();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],t[0]=o):o=t[0];const{data:r,loading:s,error:i,reload:a}=$n(uF,o);let l;t[1]!==r?(l=r===void 0?[]:r,t[1]=r,t[2]=l):l=t[2];const c=l;let d;t[3]!==c?(d=c.filter(hF).map(fF),t[3]=c,t[4]=d):d=t[4];const u=d;if(s&&c.length===0){let y;return t[5]===Symbol.for("react.memo_cache_sentinel")?(y=h.jsx(eo,{size:"medium",centered:!0}),t[5]=y):y=t[5],y}if(i){let y;return t[6]!==i?(y=h.jsx(Xs,{error:i}),t[6]=i,t[7]=y):y=t[7],y}if(c.length===0){let y;return t[8]===Symbol.for("react.memo_cache_sentinel")?(y=h.jsx(An,{title:"No environment variables",description:"No environment variables are available in this notebook.",icon:h.jsx(Kc,{})}),t[8]=y):y=t[8],y}let f,p,_,g,m,b,x;return t[9]!==n||t[10]!==e||t[11]!==u||t[12]!==a?(f=()=>e(h.jsx(kg,{providerNames:u,onSuccess:()=>{a(),n()},onClose:n})),t[9]=n,t[10]=e,t[11]=u,t[12]=a,t[13]=f):f=t[13],t[14]===Symbol.for("react.memo_cache_sentinel")?(p=h.jsx(Lr,{className:"h-4 w-4"}),t[14]=p):p=t[14],t[15]!==f?(_=h.jsx("div",{className:"flex justify-end h-8 border-b",children:h.jsx("button",{type:"button",className:"float-right border-l px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",onClick:f,children:p})}),t[15]=f,t[16]=_):_=t[16],t[17]===Symbol.for("react.memo_cache_sentinel")?(g=h.jsx(Gp,{children:h.jsxs(Ks,{children:[h.jsx(Fr,{children:"Environment Variable"}),h.jsx(Fr,{children:"Source"}),h.jsx(Fr,{})]})}),t[17]=g):g=t[17],t[18]!==c?(m=c.map(pF),t[18]=c,t[19]=m):m=t[19],t[20]!==m?(b=h.jsxs(qp,{className:"overflow-auto flex-1 mb-16",children:[g,h.jsx(Yp,{children:m})]}),t[20]=m,t[21]=b):b=t[21],t[22]!==_||t[23]!==b?(x=h.jsxs("div",{className:"flex flex-col h-full",children:[_,b]}),t[22]=_,t[23]=b,t[24]=x):x=t[24],x},dF=t=>{const e=X.c(9),{className:n,ariaLabel:o,onCopy:r}=t,[s,i]=K.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?h.jsx(yc,{className:"w-3 h-3 text-green-700 rounded"}):h.jsx(Ls,{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=h.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 uF(){return vg((await xS.request({})).secrets)}function hF(t){return t.provider!=="env"}function fF(t){return t.name}function pF(t){return t.keys.map(e=>h.jsxs(Ks,{className:"group",children:[h.jsx(zr,{children:e}),h.jsx(zr,{children:t.provider!=="env"&&h.jsx(z4,{variant:"outline",className:"select-none",children:t.name})}),h.jsx(zr,{children:h.jsx(dF,{ariaLabel:`Copy ${e}`,onCopy:async()=>{await yn(`os.environ["${e}"]`),lt({title:"Copied to clipboard",description:`os.environ["${e}"] has been copied to your clipboard.`})},className:Oe("float-right px-2 h-full text-xs text-muted-foreground hover:text-foreground","invisible group-hover:visible")})})]},`${t.name}-${e}`))}const mF=K.lazy(()=>Rp(()=>import("./terminal-Du7pUi4V.js"),__vite__mapDeps([123,1,2,124]),import.meta.url)),gF=t=>{const e=X.c(120),{children:n}=t,{isSidebarOpen:o,isTerminalOpen:r,selectedPanel:s}=bc(),{setIsSidebarOpen:i,setIsTerminalOpen:a}=na(),l=K.useRef(null),c=K.useRef(null);let d,u,f,p,_;e[0]!==o?(d=()=>{if(!l.current)return;const ue=l.current.isCollapsed();o&&ue&&l.current.expand(),o||ue||l.current.collapse(),requestAnimationFrame(bF)},u=[o],e[0]=o,e[1]=d,e[2]=u):(d=e[1],u=e[2]),A.useEffect(d,u),e[3]!==r?(f=()=>{if(!c.current)return;const ue=c.current.isCollapsed();r&&ue&&c.current.expand(),r||ue||c.current.collapse(),requestAnimationFrame(xF)},p=[r],e[3]=r,e[4]=f,e[5]=p):(f=e[4],p=e[5]),A.useEffect(f,p),e[6]!==n?(_=h.jsx(Vc,{id:"app",className:"relative h-full",children:h.jsx(A.Suspense,{children:n})},"app"),e[6]=n,e[7]=_):_=e[7];const g=_,m=o?"resize-handle":"resize-handle-collapsed";let b,x;e[8]!==m?(b=Oe("border-border no-print z-10",m,"vertical"),e[8]=m,e[9]=b):b=e[9],e[10]!==b?(x=h.jsx(aS,{onDragging:lS,className:b}),e[10]=b,e[11]=x):x=e[11];const y=x,v=r?"resize-handle":"resize-handle-collapsed";let S,k;e[12]!==v?(S=Oe("border-border no-print z-20",v,"horizontal"),e[12]=v,e[13]=S):S=e[13],e[14]!==S?(k=h.jsx(aS,{onDragging:lS,className:S}),e[14]=S,e[15]=k):k=e[15];const I=k;let j,E,T,M,L,B,O,z,F,V,P,C,H,N,$,Y,Z,q,re,ne,oe;e[16]!==s?(j=h.jsx("div",{className:"text-sm text-[var(--slate-11)] uppercase tracking-wide font-semibold flex-1",children:s}),e[16]=s,e[17]=j):j=e[17],e[18]!==i?(E=()=>i(!1),e[18]=i,e[19]=E):E=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(T=h.jsx(go,{className:"w-4 h-4"}),e[20]=T):T=e[20],e[21]!==E?(M=h.jsx(Pe,{"data-testid":"close-helper-pane",className:"m-0",size:"xs",variant:"text",onClick:E,children:T}),e[21]=E,e[22]=M):M=e[22],e[23]!==j||e[24]!==M?(L=h.jsxs("div",{className:"p-3 border-b flex justify-between items-center",children:[j,M]}),e[23]=j,e[24]=M,e[25]=L):L=e[25],e[26]!==s?(B=s==="files"&&h.jsx(rR,{}),e[26]=s,e[27]=B):B=e[27],e[28]!==s?(O=s==="errors"&&h.jsx(Ax,{}),e[28]=s,e[29]=O):O=e[29],e[30]!==s?(z=s==="variables"&&h.jsx(k2,{}),e[30]=s,e[31]=z):z=e[31],e[32]!==s?(F=s==="dependencies"&&h.jsx(TD,{}),e[32]=s,e[33]=F):F=e[33],e[34]!==s?(V=s==="packages"&&h.jsx(TR,{}),e[34]=s,e[35]=V):V=e[35],e[36]!==s?(P=s==="outline"&&h.jsx(rO,{}),e[36]=s,e[37]=P):P=e[37],e[38]!==s?(C=s==="datasources"&&h.jsx(SR,{}),e[38]=s,e[39]=C):C=e[39],e[40]!==s?(H=s==="documentation"&&h.jsx(PD,{}),e[40]=s,e[41]=H):H=e[41],e[42]!==s?(N=s==="snippets"&&h.jsx(cR,{}),e[42]=s,e[43]=N):N=e[43],e[44]!==s?($=s==="scratchpad"&&h.jsx(AR,{}),e[44]=s,e[45]=$):$=e[45],e[46]!==s?(Y=s==="chat"&&h.jsx(KL,{}),e[46]=s,e[47]=Y):Y=e[47],e[48]!==s?(Z=s==="logs"&&h.jsx(S2,{}),e[48]=s,e[49]=Z):Z=e[49],e[50]!==s?(q=s==="tracing"&&h.jsx(aF,{}),e[50]=s,e[51]=q):q=e[51],e[52]!==s?(re=s==="secrets"&&h.jsx(cF,{}),e[52]=s,e[53]=re):re=e[53],e[54]!==B||e[55]!==O||e[56]!==z||e[57]!==F||e[58]!==V||e[59]!==P||e[60]!==C||e[61]!==H||e[62]!==N||e[63]!==$||e[64]!==Y||e[65]!==Z||e[66]!==q||e[67]!==re?(ne=h.jsx(A.Suspense,{children:h.jsxs(Fc,{children:[B,O,z,F,V,P,C,H,N,$,Y,Z,q,re]})}),e[54]=B,e[55]=O,e[56]=z,e[57]=F,e[58]=V,e[59]=P,e[60]=C,e[61]=H,e[62]=N,e[63]=$,e[64]=Y,e[65]=Z,e[66]=q,e[67]=re,e[68]=ne):ne=e[68],e[69]!==L||e[70]!==ne?(oe=h.jsx(kc,{children:h.jsxs("div",{className:"flex flex-col h-full flex-1 overflow-hidden mr-[-4px]",children:[L,ne]})}),e[69]=L,e[70]=ne,e[71]=oe):oe=e[71];const G=oe,Q=o&&"border-r border-l border-[var(--slate-7)]";let ce,pe,de,ge,ie,xe;e[72]!==Q?(ce=Oe("dark:bg-[var(--slate-1)] no-print print:hidden hide-on-fullscreen",Q),e[72]=Q,e[73]=ce):ce=e[73],e[74]===Symbol.for("react.memo_cache_sentinel")?(pe=(ue,je)=>{var ve;je===0&&ue===10&&((ve=l.current)==null||ve.resize(30))},e[74]=pe):pe=e[74],e[75]!==i?(de=()=>i(!1),ge=()=>i(!0),e[75]=i,e[76]=de,e[77]=ge):(de=e[76],ge=e[77]),e[78]!==G||e[79]!==y?(ie=h.jsxs("span",{className:"flex flex-row h-full",children:[G," ",y]}),e[78]=G,e[79]=y,e[80]=ie):ie=e[80],e[81]!==ce||e[82]!==de||e[83]!==ge||e[84]!==ie?(xe=h.jsx(Vc,{ref:l,id:"helper",collapsedSize:0,collapsible:!0,className:ce,minSize:10,defaultSize:0,maxSize:75,onResize:pe,onCollapse:de,onExpand:ge,children:ie},"helper"),e[81]=ce,e[82]=de,e[83]=ge,e[84]=ie,e[85]=xe):xe=e[85];const we=xe,ae=r&&"border-[var(--slate-7)]";let Se,me,Te,Re,$e,ze,Ne,Ke;e[86]!==ae?(Se=Oe("dark:bg-[var(--slate-1)] no-print print:hidden hide-on-fullscreen",ae),e[86]=ae,e[87]=Se):Se=e[87],e[88]===Symbol.for("react.memo_cache_sentinel")?(me=(ue,je)=>{var ve;je===0&&ue===10&&((ve=c.current)==null||ve.resize(30))},e[88]=me):me=e[88],e[89]!==a?(Te=()=>a(!1),Re=()=>a(!0),e[89]=a,e[90]=Te,e[91]=Re):(Te=e[90],Re=e[91]),e[92]!==a?($e=()=>a(!1),e[92]=a,e[93]=$e):$e=e[93],e[94]!==r||e[95]!==$e?(ze=h.jsx(mF,{visible:r,onClose:$e}),e[94]=r,e[95]=$e,e[96]=ze):ze=e[96],e[97]!==r||e[98]!==ze?(Ne=h.jsx(CR,{isOpen:r,children:ze}),e[97]=r,e[98]=ze,e[99]=Ne):Ne=e[99],e[100]!==Se||e[101]!==Te||e[102]!==Re||e[103]!==Ne||e[104]!==I?(Ke=h.jsxs(Vc,{ref:c,id:"terminal",collapsedSize:0,collapsible:!0,className:Se,minSize:10,defaultSize:0,maxSize:75,onResize:me,onCollapse:Te,onExpand:Re,children:[I,Ne]},"terminal"),e[100]=Se,e[101]=Te,e[102]=Re,e[103]=Ne,e[104]=I,e[105]=Ke):Ke=e[105];const nt=Ke;let it,te,Ce,Me,Be,J,fe,_e;return e[106]===Symbol.for("react.memo_cache_sentinel")?(it=QH(),e[106]=it):it=e[106],e[107]===Symbol.for("react.memo_cache_sentinel")?(te=h.jsx(Fc,{children:h.jsx(ZM,{})}),e[107]=te):te=e[107],e[108]!==nt?(Ce=h.jsx(jx,{capability:"terminal",children:nt}),e[108]=nt,e[109]=Ce):Ce=e[109],e[110]!==g||e[111]!==Ce?(Me=h.jsx(Vc,{children:h.jsxs(cS,{autoSaveId:"marimo:chrome:v1:l1",direction:"vertical",children:[g,Ce]})}),e[110]=g,e[111]=Ce,e[112]=Me):Me=e[112],e[113]===Symbol.for("react.memo_cache_sentinel")?(Be=h.jsx(lH,{}),e[113]=Be):Be=e[113],e[114]!==we||e[115]!==Me?(J=h.jsxs(cS,{autoSaveId:"marimo:chrome:v1:l2",direction:"horizontal",storage:it,children:[te,we,Me,Be]}),e[114]=we,e[115]=Me,e[116]=J):J=e[116],e[117]===Symbol.for("react.memo_cache_sentinel")?(fe=h.jsx(kc,{children:h.jsx(Fc,{children:h.jsx(GM,{})})}),e[117]=fe):fe=e[117],e[118]!==J?(_e=h.jsxs(e$,{children:[J,fe]}),e[118]=J,e[119]=_e):_e=e[119],_e};function _F(){window.dispatchEvent(new Event("resize"))}function bF(){requestAnimationFrame(_F)}function yF(){window.dispatchEvent(new Event("resize"))}function xF(){requestAnimationFrame(yF)}let p3;p3=new URL(window.location.href).searchParams.get(cH.showChrome)==="false",jS=Object.freeze(Object.defineProperty({__proto__:null,default:t=>{const e=X.c(10);if(p3){let s,i,a;return e[0]!==t?(s=h.jsx(Nx,{hideControls:!0,...t}),e[0]=t,e[1]=s):s=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsx(eg,{}),e[2]=i):i=e[2],e[3]!==s?(a=h.jsxs(h.Fragment,{children:[s,i]}),e[3]=s,e[4]=a):a=e[4],a}let n,o,r;return e[5]!==t?(n=h.jsx(Nx,{...t}),e[5]=t,e[6]=n):n=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(o=h.jsx(eg,{}),e[7]=o):o=e[7],e[8]!==n?(r=h.jsxs(gF,{children:[n,o]}),e[8]=n,e[9]=r):r=e[9],r}},Symbol.toStringTag,{value:"Module"}))});export{nm as C,Hc as E,An as P,r$ as __tla,$c as a,jS as e,va as f,om as u};